diff -Nru mame-0.242+dfsg.1/3rdparty/lua-zlib/lua_zlib.c mame-0.243+dfsg.1/3rdparty/lua-zlib/lua_zlib.c --- mame-0.242+dfsg.1/3rdparty/lua-zlib/lua_zlib.c 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/lua-zlib/lua_zlib.c 2022-04-29 05:37:26.000000000 +0000 @@ -392,7 +392,7 @@ SETLITERAL("_COPYRIGHT", "Copyright (c) 2009-2010 Brian Maher"); SETLITERAL("_DESCRIPTION", "Yet another binding to the zlib library"); - SETLITERAL("_VERSION", "lua-zlib $Id: b619258c75f480717fad20c113c3b1a35f888ce0 $ (tag: mame0242)"); + SETLITERAL("_VERSION", "lua-zlib $Id: b619258c75f480717fad20c113c3b1a35f888ce0 $ (tag: mame0243)"); /* Expose this to lua so we can do a test: */ SETINT("_TEST_BUFSIZ", LUAL_BUFFERSIZE); diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/ChangeLog mame-0.243+dfsg.1/3rdparty/zlib/ChangeLog --- mame-0.242+dfsg.1/3rdparty/zlib/ChangeLog 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/ChangeLog 2022-04-29 05:37:26.000000000 +0000 @@ -1,6 +1,69 @@ ChangeLog file for zlib +Changes in 1.2.12 (27 Mar 2022) +- Cygwin does not have _wopen(), so do not create gzopen_w() there +- Permit a deflateParams() parameter change as soon as possible +- Limit hash table inserts after switch from stored deflate +- Fix bug when window full in deflate_stored() +- Fix CLEAR_HASH macro to be usable as a single statement +- Avoid a conversion error in gzseek when off_t type too small +- Have Makefile return non-zero error code on test failure +- Avoid some conversion warnings in gzread.c and gzwrite.c +- Update use of errno for newer Windows CE versions +- Small speedup to inflate [psumbera] +- Return an error if the gzputs string length can't fit in an int +- Add address checking in clang to -w option of configure +- Don't compute check value for raw inflate if asked to validate +- Handle case where inflateSync used when header never processed +- Avoid the use of ptrdiff_t +- Avoid an undefined behavior of memcpy() in gzappend() +- Avoid undefined behaviors of memcpy() in gz*printf() +- Avoid an undefined behavior of memcpy() in _tr_stored_block() +- Make the names in functions declarations identical to definitions +- Remove old assembler code in which bugs have manifested +- Fix deflateEnd() to not report an error at start of raw deflate +- Add legal disclaimer to README +- Emphasize the need to continue decompressing gzip members +- Correct the initialization requirements for deflateInit2() +- Fix a bug that can crash deflate on some input when using Z_FIXED +- Assure that the number of bits for deflatePrime() is valid +- Use a structure to make globals in enough.c evident +- Use a macro for the printf format of big_t in enough.c +- Clean up code style in enough.c, update version +- Use inline function instead of macro for index in enough.c +- Clarify that prefix codes are counted in enough.c +- Show all the codes for the maximum tables size in enough.c +- Add gznorm.c example, which normalizes gzip files +- Fix the zran.c example to work on a multiple-member gzip file +- Add tables for crc32_combine(), to speed it up by a factor of 200 +- Add crc32_combine_gen() and crc32_combine_op() for fast combines +- Speed up software CRC-32 computation by a factor of 1.5 to 3 +- Use atomic test and set, if available, for dynamic CRC tables +- Don't bother computing check value after successful inflateSync() +- Correct comment in crc32.c +- Add use of the ARMv8 crc32 instructions when requested +- Use ARM crc32 instructions if the ARM architecture has them +- Explicitly note that the 32-bit check values are 32 bits +- Avoid adding empty gzip member after gzflush with Z_FINISH +- Fix memory leak on error in gzlog.c +- Fix error in comment on the polynomial representation of a byte +- Clarify gz* function interfaces, referring to parameter names +- Change macro name in inflate.c to avoid collision in VxWorks +- Correct typo in blast.c +- Improve portability of contrib/minizip +- Fix indentation in minizip's zip.c +- Replace black/white with allow/block. (theresa-m) +- minizip warning fix if MAXU32 already defined. (gvollant) +- Fix unztell64() in minizip to work past 4GB. (Daniël Hörchner) +- Clean up minizip to reduce warnings for testing +- Add fallthrough comments for gcc +- Eliminate use of ULL constants +- Separate out address sanitizing from warnings in configure +- Remove destructive aspects of make distclean +- Check for cc masquerading as gcc or clang in configure +- Fix crc32.c to compile local functions only if used + Changes in 1.2.11 (15 Jan 2017) - Fix deflate stored bug when pulling last block from window - Permit immediate deflateParams changes before any deflate input @@ -511,7 +574,7 @@ - Don't use _vsnprintf on later versions of MSVC [Lowman] - Add CMake build script and input file [Lowman] - Update contrib/minizip to 1.1 [Svensson, Vollant] -- Moved nintendods directory from contrib to . +- Moved nintendods directory from contrib to root - Replace gzio.c with a new set of routines with the same functionality - Add gzbuffer(), gzoffset(), gzclose_r(), gzclose_w() as part of above - Update contrib/minizip to 1.1b @@ -685,7 +748,7 @@ - Be more strict on incomplete code sets in inflate_table() and increase ENOUGH and MAXD -- this repairs a possible security vulnerability for invalid inflate input. Thanks to Tavis Ormandy and Markus Oberhumer for - discovering the vulnerability and providing test cases. + discovering the vulnerability and providing test cases - Add ia64 support to configure for HP-UX [Smith] - Add error return to gzread() for format or i/o error [Levin] - Use malloc.h for OS/2 [Necasek] @@ -721,7 +784,7 @@ - Add Z_FIXED strategy option to deflateInit2() to force fixed trees - Add updated make_vms.com [Coghlan], update README - Create a new "examples" directory, move gzappend.c there, add zpipe.c, - fitblk.c, gzlog.[ch], gzjoin.c, and zlib_how.html. + fitblk.c, gzlog.[ch], gzjoin.c, and zlib_how.html - Add FAQ entry and comments in deflate.c on uninitialized memory access - Add Solaris 9 make options in configure [Gilbert] - Allow strerror() usage in gzio.c for STDC @@ -792,7 +855,7 @@ - Fix a big fat bug in inftrees.c that prevented decoding valid dynamic blocks with only literals and no distance codes -- Thanks to "Hot Emu" for the bug report and sample file -- Add a note to puff.c on no distance codes case. +- Add a note to puff.c on no distance codes case Changes in 1.2.1 (17 November 2003) - Remove a tab in contrib/gzappend/gzappend.c @@ -1036,14 +1099,14 @@ - Add contrib/puff/ simple inflate for deflate format description Changes in 1.1.4 (11 March 2002) -- ZFREE was repeated on same allocation on some error conditions. +- ZFREE was repeated on same allocation on some error conditions This creates a security problem described in http://www.zlib.org/advisory-2002-03-11.txt - Returned incorrect error (Z_MEM_ERROR) on some invalid data - Avoid accesses before window for invalid distances with inflate window - less than 32K. + less than 32K - force windowBits > 8 to avoid a bug in the encoder for a window size - of 256 bytes. (A complete fix will be available in 1.1.5). + of 256 bytes. (A complete fix will be available in 1.1.5) Changes in 1.1.3 (9 July 1998) - fix "an inflate input buffer bug that shows up on rare but persistent @@ -1117,7 +1180,7 @@ - remove block truncation heuristic which had very marginal effect for zlib (smaller lit_bufsize than in gzip 1.2.4) and degraded a little the compression ratio on some files. This also allows inlining _tr_tally for - matches in deflate_slow. + matches in deflate_slow - added msdos/Makefile.w32 for WIN32 Microsoft Visual C++ (Bob Frazier) Changes in 1.1.0 (24 Feb 98) @@ -1162,7 +1225,7 @@ - include sys/types.h to get off_t on some systems (Marc Lehmann & QingLong) - use constant arrays for the static trees in trees.c instead of computing them at run time (thanks to Ken Raeburn for this suggestion). To create - trees.h, compile with GEN_TREES_H and run "make test". + trees.h, compile with GEN_TREES_H and run "make test" - check return code of example in "make test" and display result - pass minigzip command line options to file_compress - simplifying code of inflateSync to avoid gcc 2.8 bug @@ -1201,12 +1264,12 @@ - add functions gzprintf, gzputc, gzgetc, gztell, gzeof, gzseek, gzrewind and gzsetparams (thanks to Roland Giersig and Kevin Ruland for some of this code) - Fix a deflate bug occurring only with compression level 0 (thanks to - Andy Buckler for finding this one). -- In minigzip, pass transparently also the first byte for .Z files. + Andy Buckler for finding this one) +- In minigzip, pass transparently also the first byte for .Z files - return Z_BUF_ERROR instead of Z_OK if output buffer full in uncompress() - check Z_FINISH in inflate (thanks to Marc Schluper) - Implement deflateCopy (thanks to Adam Costello) -- make static libraries by default in configure, add --shared option. +- make static libraries by default in configure, add --shared option - move MSDOS or Windows specific files to directory msdos - suppress the notion of partial flush to simplify the interface (but the symbol Z_PARTIAL_FLUSH is kept for compatibility with 1.0.4) @@ -1218,7 +1281,7 @@ - added Makefile.nt (thanks to Stephen Williams) - added the unsupported "contrib" directory: contrib/asm386/ by Gilles Vollant - 386 asm code replacing longest_match(). + 386 asm code replacing longest_match() contrib/iostream/ by Kevin Ruland A C++ I/O streams interface to the zlib gz* functions contrib/iostream2/ by Tyge Løvset @@ -1226,7 +1289,7 @@ contrib/untgz/ by "Pedro A. Aranda Guti\irrez" A very simple tar.gz file extractor using zlib contrib/visual-basic.txt by Carlos Rios - How to use compress(), uncompress() and the gz* functions from VB. + How to use compress(), uncompress() and the gz* functions from VB - pass params -f (filtered data), -h (huffman only), -1 to -9 (compression level) in minigzip (thanks to Tom Lane) @@ -1235,8 +1298,8 @@ - add undocumented function inflateSyncPoint() (hack for Paul Mackerras) - add undocumented function zError to convert error code to string (for Tim Smithers) -- Allow compilation of gzio with -DNO_DEFLATE to avoid the compression code. -- Use default memcpy for Symantec MSDOS compiler. +- Allow compilation of gzio with -DNO_DEFLATE to avoid the compression code +- Use default memcpy for Symantec MSDOS compiler - Add EXPORT keyword for check_func (needed for Windows DLL) - add current directory to LD_LIBRARY_PATH for "make test" - create also a link for libz.so.1 @@ -1249,7 +1312,7 @@ - allow compilation with ANSI keywords only enabled for TurboC in large model - avoid "versionString"[0] (Borland bug) - add NEED_DUMMY_RETURN for Borland -- use variable z_verbose for tracing in debug mode (L. Peter Deutsch). +- use variable z_verbose for tracing in debug mode (L. Peter Deutsch) - allow compilation with CC - defined STDC for OS/2 (David Charlap) - limit external names to 8 chars for MVS (Thomas Lund) @@ -1259,7 +1322,7 @@ - use _fdopen instead of fdopen for MSC >= 6.0 (Thomas Fanslau) - added makelcc.bat for lcc-win32 (Tom St Denis) - in Makefile.dj2, use copy and del instead of install and rm (Frank Donahoe) -- Avoid expanded $Id$. Use "rcs -kb" or "cvs admin -kb" to avoid Id expansion. +- Avoid expanded $Id$. Use "rcs -kb" or "cvs admin -kb" to avoid Id expansion - check for unistd.h in configure (for off_t) - remove useless check parameter in inflate_blocks_free - avoid useless assignment of s->check to itself in inflate_blocks_new @@ -1280,7 +1343,7 @@ Changes in 1.0.4 (24 Jul 96) - In very rare conditions, deflate(s, Z_FINISH) could fail to produce an EOF bit, so the decompressor could decompress all the correct data but went - on to attempt decompressing extra garbage data. This affected minigzip too. + on to attempt decompressing extra garbage data. This affected minigzip too - zlibVersion and gzerror return const char* (needed for DLL) - port to RISCOS (no fdopen, no multiple dots, no unlink, no fileno) - use z_error only for DEBUG (avoid problem with DLLs) @@ -1310,7 +1373,7 @@ - fix array overlay in deflate.c which sometimes caused bad compressed data - fix inflate bug with empty stored block - fix MSDOS medium model which was broken in 0.99 -- fix deflateParams() which could generate bad compressed data. +- fix deflateParams() which could generate bad compressed data - Bytef is define'd instead of typedef'ed (work around Borland bug) - added an INDEX file - new makefiles for DJGPP (Makefile.dj2), 32-bit Borland (Makefile.b32), @@ -1331,7 +1394,7 @@ - allow preset dictionary shared between compressor and decompressor - allow compression level 0 (no compression) - add deflateParams in zlib.h: allow dynamic change of compression level - and compression strategy. + and compression strategy - test large buffers and deflateParams in example.c - add optional "configure" to build zlib as a shared library - suppress Makefile.qnx, use configure instead @@ -1373,30 +1436,30 @@ - use STDC instead of __GO32__ to avoid redeclaring exit, calloc, etc... - use Z_BINARY instead of BINARY - document that gzclose after gzdopen will close the file -- allow "a" as mode in gzopen. +- allow "a" as mode in gzopen - fix error checking in gzread - allow skipping .gz extra-field on pipes - added reference to Perl interface in README - put the crc table in FAR data (I dislike more and more the medium model :) - added get_crc_table -- added a dimension to all arrays (Borland C can't count). +- added a dimension to all arrays (Borland C can't count) - workaround Borland C bug in declaration of inflate_codes_new & inflate_fast - guard against multiple inclusion of *.h (for precompiled header on Mac) -- Watcom C pretends to be Microsoft C small model even in 32 bit mode. +- Watcom C pretends to be Microsoft C small model even in 32 bit mode - don't use unsized arrays to avoid silly warnings by Visual C++: warning C4746: 'inflate_mask' : unsized array treated as '__far' - (what's wrong with far data in far model?). + (what's wrong with far data in far model?) - define enum out of inflate_blocks_state to allow compilation with C++ Changes in 0.95 (16 Aug 95) - fix MSDOS small and medium model (now easier to adapt to any compiler) - inlined send_bits - fix the final (:-) bug for deflate with flush (output was correct but - not completely flushed in rare occasions). + not completely flushed in rare occasions) - default window size is same for compression and decompression - (it's now sufficient to set MAX_WBITS in zconf.h). + (it's now sufficient to set MAX_WBITS in zconf.h) - voidp -> voidpf and voidnp -> voidp (for consistency with other - typedefs and because voidnp was not near in large model). + typedefs and because voidnp was not near in large model) Changes in 0.94 (13 Aug 95) - support MSDOS medium model @@ -1405,12 +1468,12 @@ - added support for VMS - allow a compression level in gzopen() - gzflush now calls fflush -- For deflate with flush, flush even if no more input is provided. +- For deflate with flush, flush even if no more input is provided - rename libgz.a as libz.a - avoid complex expression in infcodes.c triggering Turbo C bug - work around a problem with gcc on Alpha (in INSERT_STRING) - don't use inline functions (problem with some gcc versions) -- allow renaming of Byte, uInt, etc... with #define. +- allow renaming of Byte, uInt, etc... with #define - avoid warning about (unused) pointer before start of array in deflate.c - avoid various warnings in gzio.c, example.c, infblock.c, adler32.c, zutil.c - avoid reserved word 'new' in trees.c @@ -1429,7 +1492,7 @@ - no memcpy on Pyramid - suppressed inftest.c - optimized fill_window, put longest_match inline for gcc -- optimized inflate on stored blocks. +- optimized inflate on stored blocks - untabify all sources to simplify patches Changes in 0.91 (2 May 95) @@ -1447,7 +1510,7 @@ - let again gzread copy uncompressed data unchanged (was working in 0.71) - deflate(Z_FULL_FLUSH), inflateReset and inflateSync are now fully implemented - added a test of inflateSync in example.c -- moved MAX_WBITS to zconf.h because users might want to change that. +- moved MAX_WBITS to zconf.h because users might want to change that - document explicitly that zalloc(64K) on MSDOS must return a normalized pointer (zero offset) - added Makefiles for Microsoft C, Turbo C, Borland C++ @@ -1456,7 +1519,7 @@ Changes in 0.8 (29 April 95) - added fast inflate (inffast.c) - deflate(Z_FINISH) now returns Z_STREAM_END when done. Warning: this - is incompatible with previous versions of zlib which returned Z_OK. + is incompatible with previous versions of zlib which returned Z_OK - work around a TurboC compiler bug (bad code for b << 0, see infutil.h) (actually that was not a compiler bug, see 0.81 above) - gzread no longer reads one extra byte in certain cases @@ -1466,50 +1529,50 @@ Changes in 0.71 (14 April 95) - Fixed more MSDOS compilation problems :( There is still a bug with - TurboC large model. + TurboC large model Changes in 0.7 (14 April 95) -- Added full inflate support. +- Added full inflate support - Simplified the crc32() interface. The pre- and post-conditioning (one's complement) is now done inside crc32(). WARNING: this is - incompatible with previous versions; see zlib.h for the new usage. + incompatible with previous versions; see zlib.h for the new usage Changes in 0.61 (12 April 95) -- workaround for a bug in TurboC. example and minigzip now work on MSDOS. +- workaround for a bug in TurboC. example and minigzip now work on MSDOS Changes in 0.6 (11 April 95) - added minigzip.c - added gzdopen to reopen a file descriptor as gzFile -- added transparent reading of non-gziped files in gzread. +- added transparent reading of non-gziped files in gzread - fixed bug in gzread (don't read crc as data) -- fixed bug in destroy (gzio.c) (don't return Z_STREAM_END for gzclose). +- fixed bug in destroy (gzio.c) (don't return Z_STREAM_END for gzclose) - don't allocate big arrays in the stack (for MSDOS) - fix some MSDOS compilation problems Changes in 0.5: - do real compression in deflate.c. Z_PARTIAL_FLUSH is supported but - not yet Z_FULL_FLUSH. + not yet Z_FULL_FLUSH - support decompression but only in a single step (forced Z_FINISH) -- added opaque object for zalloc and zfree. +- added opaque object for zalloc and zfree - added deflateReset and inflateReset -- added a variable zlib_version for consistency checking. -- renamed the 'filter' parameter of deflateInit2 as 'strategy'. - Added Z_FILTERED and Z_HUFFMAN_ONLY constants. +- added a variable zlib_version for consistency checking +- renamed the 'filter' parameter of deflateInit2 as 'strategy' + Added Z_FILTERED and Z_HUFFMAN_ONLY constants Changes in 0.4: -- avoid "zip" everywhere, use zlib instead of ziplib. +- avoid "zip" everywhere, use zlib instead of ziplib - suppress Z_BLOCK_FLUSH, interpret Z_PARTIAL_FLUSH as block flush - if compression method == 8. + if compression method == 8 - added adler32 and crc32 - renamed deflateOptions as deflateInit2, call one or the other but not both -- added the method parameter for deflateInit2. +- added the method parameter for deflateInit2 - added inflateInit2 - simplied considerably deflateInit and inflateInit by not supporting user-provided history buffer. This is supported only in deflateInit2 - and inflateInit2. + and inflateInit2 Changes in 0.3: - prefix all macro names with Z_ -- use Z_FINISH instead of deflateEnd to finish compression. +- use Z_FINISH instead of deflateEnd to finish compression - added Z_HUFFMAN_ONLY - added gzerror() diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/CMakeLists.txt mame-0.243+dfsg.1/3rdparty/zlib/CMakeLists.txt --- mame-0.242+dfsg.1/3rdparty/zlib/CMakeLists.txt 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/CMakeLists.txt 2022-04-29 05:37:26.000000000 +0000 @@ -3,7 +3,7 @@ project(zlib C) -set(VERSION "1.2.11") +set(VERSION "1.2.12") option(ASM686 "Enable building i686 assembly implementation") option(AMD64 "Enable building amd64 assembly implementation") diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/configure mame-0.243+dfsg.1/3rdparty/zlib/configure --- mame-0.242+dfsg.1/3rdparty/zlib/configure 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/configure 2022-04-29 05:37:26.000000000 +0000 @@ -87,6 +87,7 @@ gcc=0 warn=0 debug=0 +sanitize=0 old_cc="$CC" old_cflags="$CFLAGS" OBJC='$(OBJZ) $(OBJG)' @@ -137,6 +138,7 @@ -c* | --const) zconst=1; shift ;; -w* | --warn) warn=1; shift ;; -d* | --debug) debug=1; shift ;; + --sanitize) sanitize=1; shift ;; *) echo "unknown option: $1" | tee -a configure.log echo "$0 --help for help" | tee -a configure.log @@ -165,8 +167,14 @@ int hello() {return getchar();} EOF -test -z "$CC" && echo Checking for ${CROSS_PREFIX}gcc... | tee -a configure.log -cc=${CC-${CROSS_PREFIX}gcc} +if test -z "$CC"; then + echo Checking for ${CROSS_PREFIX}gcc... | tee -a configure.log + if ${CROSS_PREFIX}gcc -v >/dev/null 2>&1; then + cc=${CROSS_PREFIX}gcc + else + cc=${CROSS_PREFIX}cc + fi +fi cflags=${CFLAGS-"-O3"} # to force the asm version use: CFLAGS="-O3 -DASMV" ./configure case "$cc" in @@ -199,6 +207,9 @@ CFLAGS="${CFLAGS} -Wall -Wextra -pedantic" fi fi + if test $sanitize -eq 1; then + CFLAGS="${CFLAGS} -fsanitize=address" + fi if test $debug -eq 1; then CFLAGS="${CFLAGS} -DZLIB_DEBUG" SFLAGS="${SFLAGS} -DZLIB_DEBUG" @@ -367,8 +378,11 @@ try() { show $* - ( $* ) >> configure.log 2>&1 + got=`( $* ) 2>&1` ret=$? + if test "$got" != ""; then + printf "%s\n" "$got" >> configure.log + fi if test $ret -ne 0; then echo "(exit code "$ret")" >> configure.log fi @@ -381,8 +395,11 @@ show $* got=`( $* ) 2>&1` ret=$? - printf %s "$got" >> configure.log + if test "$got" != ""; then + printf "%s\n" "$got" >> configure.log + fi if test $ret -ne 0; then + echo "(exit code "$ret")" >> configure.log return $ret fi test "$got" = "" @@ -457,17 +474,11 @@ EOF if try $CC -c $CFLAGS $test.c; then echo "Checking for size_t... Yes." | tee -a configure.log - need_sizet=0 else echo "Checking for size_t... No." | tee -a configure.log - need_sizet=1 -fi - -echo >> configure.log - -# find the size_t integer type, if needed -if test $need_sizet -eq 1; then - cat > $test.c < $test.c << EOF long long dummy = 0; EOF if try $CC -c $CFLAGS $test.c; then @@ -495,17 +506,13 @@ if try $CC $CFLAGS -o $test $test.c; then sizet=`./$test` echo "Checking for a pointer-size integer type..." $sizet"." | tee -a configure.log + CFLAGS="${CFLAGS} -DNO_SIZE_T=${sizet}" + SFLAGS="${SFLAGS} -DNO_SIZE_T=${sizet}" else - echo "Failed to find a pointer-size integer type." | tee -a configure.log - leave 1 + echo "Checking for a pointer-size integer type... not found." | tee -a configure.log fi fi -if test $need_sizet -eq 1; then - CFLAGS="${CFLAGS} -DNO_SIZE_T=${sizet}" - SFLAGS="${SFLAGS} -DNO_SIZE_T=${sizet}" -fi - echo >> configure.log # check for large file support, and if none, check for fseeko() @@ -849,7 +856,6 @@ echo STATICLIB = $STATICLIB >> configure.log echo TEST = $TEST >> configure.log echo VER = $VER >> configure.log -echo Z_U4 = $Z_U4 >> configure.log echo SRCDIR = $SRCDIR >> configure.log echo exec_prefix = $exec_prefix >> configure.log echo includedir = $includedir >> configure.log diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/contrib/amd64/amd64-match.S mame-0.243+dfsg.1/3rdparty/zlib/contrib/amd64/amd64-match.S --- mame-0.242+dfsg.1/3rdparty/zlib/contrib/amd64/amd64-match.S 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/contrib/amd64/amd64-match.S 1970-01-01 00:00:00.000000000 +0000 @@ -1,452 +0,0 @@ -/* - * match.S -- optimized version of longest_match() - * based on the similar work by Gilles Vollant, and Brian Raiter, written 1998 - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the BSD License. Use by owners of Che Guevarra - * parafernalia is prohibited, where possible, and highly discouraged - * elsewhere. - */ - -#ifndef NO_UNDERLINE -# define match_init _match_init -# define longest_match _longest_match -#endif - -#define scanend ebx -#define scanendw bx -#define chainlenwmask edx /* high word: current chain len low word: s->wmask */ -#define curmatch rsi -#define curmatchd esi -#define windowbestlen r8 -#define scanalign r9 -#define scanalignd r9d -#define window r10 -#define bestlen r11 -#define bestlend r11d -#define scanstart r12d -#define scanstartw r12w -#define scan r13 -#define nicematch r14d -#define limit r15 -#define limitd r15d -#define prev rcx - -/* - * The 258 is a "magic number, not a parameter -- changing it - * breaks the hell loose - */ -#define MAX_MATCH (258) -#define MIN_MATCH (3) -#define MIN_LOOKAHEAD (MAX_MATCH + MIN_MATCH + 1) -#define MAX_MATCH_8 ((MAX_MATCH + 7) & ~7) - -/* stack frame offsets */ -#define LocalVarsSize (112) -#define _chainlenwmask ( 8-LocalVarsSize)(%rsp) -#define _windowbestlen (16-LocalVarsSize)(%rsp) -#define save_r14 (24-LocalVarsSize)(%rsp) -#define save_rsi (32-LocalVarsSize)(%rsp) -#define save_rbx (40-LocalVarsSize)(%rsp) -#define save_r12 (56-LocalVarsSize)(%rsp) -#define save_r13 (64-LocalVarsSize)(%rsp) -#define save_r15 (80-LocalVarsSize)(%rsp) - - -.globl match_init, longest_match - -/* - * On AMD64 the first argument of a function (in our case -- the pointer to - * deflate_state structure) is passed in %rdi, hence our offsets below are - * all off of that. - */ - -/* you can check the structure offset by running - -#include -#include -#include "deflate.h" - -void print_depl() -{ -deflate_state ds; -deflate_state *s=&ds; -printf("size pointer=%u\n",(int)sizeof(void*)); - -printf("#define dsWSize (%3u)(%%rdi)\n",(int)(((char*)&(s->w_size))-((char*)s))); -printf("#define dsWMask (%3u)(%%rdi)\n",(int)(((char*)&(s->w_mask))-((char*)s))); -printf("#define dsWindow (%3u)(%%rdi)\n",(int)(((char*)&(s->window))-((char*)s))); -printf("#define dsPrev (%3u)(%%rdi)\n",(int)(((char*)&(s->prev))-((char*)s))); -printf("#define dsMatchLen (%3u)(%%rdi)\n",(int)(((char*)&(s->match_length))-((char*)s))); -printf("#define dsPrevMatch (%3u)(%%rdi)\n",(int)(((char*)&(s->prev_match))-((char*)s))); -printf("#define dsStrStart (%3u)(%%rdi)\n",(int)(((char*)&(s->strstart))-((char*)s))); -printf("#define dsMatchStart (%3u)(%%rdi)\n",(int)(((char*)&(s->match_start))-((char*)s))); -printf("#define dsLookahead (%3u)(%%rdi)\n",(int)(((char*)&(s->lookahead))-((char*)s))); -printf("#define dsPrevLen (%3u)(%%rdi)\n",(int)(((char*)&(s->prev_length))-((char*)s))); -printf("#define dsMaxChainLen (%3u)(%%rdi)\n",(int)(((char*)&(s->max_chain_length))-((char*)s))); -printf("#define dsGoodMatch (%3u)(%%rdi)\n",(int)(((char*)&(s->good_match))-((char*)s))); -printf("#define dsNiceMatch (%3u)(%%rdi)\n",(int)(((char*)&(s->nice_match))-((char*)s))); -} - -*/ - - -/* - to compile for XCode 3.2 on MacOSX x86_64 - - run "gcc -g -c -DXCODE_MAC_X64_STRUCTURE amd64-match.S" - */ - - -#ifndef CURRENT_LINX_XCODE_MAC_X64_STRUCTURE -#define dsWSize ( 68)(%rdi) -#define dsWMask ( 76)(%rdi) -#define dsWindow ( 80)(%rdi) -#define dsPrev ( 96)(%rdi) -#define dsMatchLen (144)(%rdi) -#define dsPrevMatch (148)(%rdi) -#define dsStrStart (156)(%rdi) -#define dsMatchStart (160)(%rdi) -#define dsLookahead (164)(%rdi) -#define dsPrevLen (168)(%rdi) -#define dsMaxChainLen (172)(%rdi) -#define dsGoodMatch (188)(%rdi) -#define dsNiceMatch (192)(%rdi) - -#else - -#ifndef STRUCT_OFFSET -# define STRUCT_OFFSET (0) -#endif - - -#define dsWSize ( 56 + STRUCT_OFFSET)(%rdi) -#define dsWMask ( 64 + STRUCT_OFFSET)(%rdi) -#define dsWindow ( 72 + STRUCT_OFFSET)(%rdi) -#define dsPrev ( 88 + STRUCT_OFFSET)(%rdi) -#define dsMatchLen (136 + STRUCT_OFFSET)(%rdi) -#define dsPrevMatch (140 + STRUCT_OFFSET)(%rdi) -#define dsStrStart (148 + STRUCT_OFFSET)(%rdi) -#define dsMatchStart (152 + STRUCT_OFFSET)(%rdi) -#define dsLookahead (156 + STRUCT_OFFSET)(%rdi) -#define dsPrevLen (160 + STRUCT_OFFSET)(%rdi) -#define dsMaxChainLen (164 + STRUCT_OFFSET)(%rdi) -#define dsGoodMatch (180 + STRUCT_OFFSET)(%rdi) -#define dsNiceMatch (184 + STRUCT_OFFSET)(%rdi) - -#endif - - - - -.text - -/* uInt longest_match(deflate_state *deflatestate, IPos curmatch) */ - -longest_match: -/* - * Retrieve the function arguments. %curmatch will hold cur_match - * throughout the entire function (passed via rsi on amd64). - * rdi will hold the pointer to the deflate_state (first arg on amd64) - */ - mov %rsi, save_rsi - mov %rbx, save_rbx - mov %r12, save_r12 - mov %r13, save_r13 - mov %r14, save_r14 - mov %r15, save_r15 - -/* uInt wmask = s->w_mask; */ -/* unsigned chain_length = s->max_chain_length; */ -/* if (s->prev_length >= s->good_match) { */ -/* chain_length >>= 2; */ -/* } */ - - movl dsPrevLen, %eax - movl dsGoodMatch, %ebx - cmpl %ebx, %eax - movl dsWMask, %eax - movl dsMaxChainLen, %chainlenwmask - jl LastMatchGood - shrl $2, %chainlenwmask -LastMatchGood: - -/* chainlen is decremented once beforehand so that the function can */ -/* use the sign flag instead of the zero flag for the exit test. */ -/* It is then shifted into the high word, to make room for the wmask */ -/* value, which it will always accompany. */ - - decl %chainlenwmask - shll $16, %chainlenwmask - orl %eax, %chainlenwmask - -/* if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead; */ - - movl dsNiceMatch, %eax - movl dsLookahead, %ebx - cmpl %eax, %ebx - jl LookaheadLess - movl %eax, %ebx -LookaheadLess: movl %ebx, %nicematch - -/* register Bytef *scan = s->window + s->strstart; */ - - mov dsWindow, %window - movl dsStrStart, %limitd - lea (%limit, %window), %scan - -/* Determine how many bytes the scan ptr is off from being */ -/* dword-aligned. */ - - mov %scan, %scanalign - negl %scanalignd - andl $3, %scanalignd - -/* IPos limit = s->strstart > (IPos)MAX_DIST(s) ? */ -/* s->strstart - (IPos)MAX_DIST(s) : NIL; */ - - movl dsWSize, %eax - subl $MIN_LOOKAHEAD, %eax - xorl %ecx, %ecx - subl %eax, %limitd - cmovng %ecx, %limitd - -/* int best_len = s->prev_length; */ - - movl dsPrevLen, %bestlend - -/* Store the sum of s->window + best_len in %windowbestlen locally, and in memory. */ - - lea (%window, %bestlen), %windowbestlen - mov %windowbestlen, _windowbestlen - -/* register ush scan_start = *(ushf*)scan; */ -/* register ush scan_end = *(ushf*)(scan+best_len-1); */ -/* Posf *prev = s->prev; */ - - movzwl (%scan), %scanstart - movzwl -1(%scan, %bestlen), %scanend - mov dsPrev, %prev - -/* Jump into the main loop. */ - - movl %chainlenwmask, _chainlenwmask - jmp LoopEntry - -.balign 16 - -/* do { - * match = s->window + cur_match; - * if (*(ushf*)(match+best_len-1) != scan_end || - * *(ushf*)match != scan_start) continue; - * [...] - * } while ((cur_match = prev[cur_match & wmask]) > limit - * && --chain_length != 0); - * - * Here is the inner loop of the function. The function will spend the - * majority of its time in this loop, and majority of that time will - * be spent in the first ten instructions. - */ -LookupLoop: - andl %chainlenwmask, %curmatchd - movzwl (%prev, %curmatch, 2), %curmatchd - cmpl %limitd, %curmatchd - jbe LeaveNow - subl $0x00010000, %chainlenwmask - js LeaveNow -LoopEntry: cmpw -1(%windowbestlen, %curmatch), %scanendw - jne LookupLoop - cmpw %scanstartw, (%window, %curmatch) - jne LookupLoop - -/* Store the current value of chainlen. */ - movl %chainlenwmask, _chainlenwmask - -/* %scan is the string under scrutiny, and %prev to the string we */ -/* are hoping to match it up with. In actuality, %esi and %edi are */ -/* both pointed (MAX_MATCH_8 - scanalign) bytes ahead, and %edx is */ -/* initialized to -(MAX_MATCH_8 - scanalign). */ - - mov $(-MAX_MATCH_8), %rdx - lea (%curmatch, %window), %windowbestlen - lea MAX_MATCH_8(%windowbestlen, %scanalign), %windowbestlen - lea MAX_MATCH_8(%scan, %scanalign), %prev - -/* the prefetching below makes very little difference... */ - prefetcht1 (%windowbestlen, %rdx) - prefetcht1 (%prev, %rdx) - -/* - * Test the strings for equality, 8 bytes at a time. At the end, - * adjust %rdx so that it is offset to the exact byte that mismatched. - * - * It should be confessed that this loop usually does not represent - * much of the total running time. Replacing it with a more - * straightforward "rep cmpsb" would not drastically degrade - * performance -- unrolling it, for example, makes no difference. - */ - -#undef USE_SSE /* works, but is 6-7% slower, than non-SSE... */ - -LoopCmps: -#ifdef USE_SSE - /* Preload the SSE registers */ - movdqu (%windowbestlen, %rdx), %xmm1 - movdqu (%prev, %rdx), %xmm2 - pcmpeqb %xmm2, %xmm1 - movdqu 16(%windowbestlen, %rdx), %xmm3 - movdqu 16(%prev, %rdx), %xmm4 - pcmpeqb %xmm4, %xmm3 - movdqu 32(%windowbestlen, %rdx), %xmm5 - movdqu 32(%prev, %rdx), %xmm6 - pcmpeqb %xmm6, %xmm5 - movdqu 48(%windowbestlen, %rdx), %xmm7 - movdqu 48(%prev, %rdx), %xmm8 - pcmpeqb %xmm8, %xmm7 - - /* Check the comparisions' results */ - pmovmskb %xmm1, %rax - notw %ax - bsfw %ax, %ax - jnz LeaveLoopCmps - - /* this is the only iteration of the loop with a possibility of having - incremented rdx by 0x108 (each loop iteration add 16*4 = 0x40 - and (0x40*4)+8=0x108 */ - add $8, %rdx - jz LenMaximum - add $8, %rdx - - - pmovmskb %xmm3, %rax - notw %ax - bsfw %ax, %ax - jnz LeaveLoopCmps - - - add $16, %rdx - - - pmovmskb %xmm5, %rax - notw %ax - bsfw %ax, %ax - jnz LeaveLoopCmps - - add $16, %rdx - - - pmovmskb %xmm7, %rax - notw %ax - bsfw %ax, %ax - jnz LeaveLoopCmps - - add $16, %rdx - - jmp LoopCmps -LeaveLoopCmps: add %rax, %rdx -#else - mov (%windowbestlen, %rdx), %rax - xor (%prev, %rdx), %rax - jnz LeaveLoopCmps - - mov 8(%windowbestlen, %rdx), %rax - xor 8(%prev, %rdx), %rax - jnz LeaveLoopCmps8 - - mov 16(%windowbestlen, %rdx), %rax - xor 16(%prev, %rdx), %rax - jnz LeaveLoopCmps16 - - add $24, %rdx - jnz LoopCmps - jmp LenMaximum -# if 0 -/* - * This three-liner is tantalizingly simple, but bsf is a slow instruction, - * and the complicated alternative down below is quite a bit faster. Sad... - */ - -LeaveLoopCmps: bsf %rax, %rax /* find the first non-zero bit */ - shrl $3, %eax /* divide by 8 to get the byte */ - add %rax, %rdx -# else -LeaveLoopCmps16: - add $8, %rdx -LeaveLoopCmps8: - add $8, %rdx -LeaveLoopCmps: testl $0xFFFFFFFF, %eax /* Check the first 4 bytes */ - jnz Check16 - add $4, %rdx - shr $32, %rax -Check16: testw $0xFFFF, %ax - jnz LenLower - add $2, %rdx - shrl $16, %eax -LenLower: subb $1, %al - adc $0, %rdx -# endif -#endif - -/* Calculate the length of the match. If it is longer than MAX_MATCH, */ -/* then automatically accept it as the best possible match and leave. */ - - lea (%prev, %rdx), %rax - sub %scan, %rax - cmpl $MAX_MATCH, %eax - jge LenMaximum - -/* If the length of the match is not longer than the best match we */ -/* have so far, then forget it and return to the lookup loop. */ - - cmpl %bestlend, %eax - jg LongerMatch - mov _windowbestlen, %windowbestlen - mov dsPrev, %prev - movl _chainlenwmask, %edx - jmp LookupLoop - -/* s->match_start = cur_match; */ -/* best_len = len; */ -/* if (len >= nice_match) break; */ -/* scan_end = *(ushf*)(scan+best_len-1); */ - -LongerMatch: - movl %eax, %bestlend - movl %curmatchd, dsMatchStart - cmpl %nicematch, %eax - jge LeaveNow - - lea (%window, %bestlen), %windowbestlen - mov %windowbestlen, _windowbestlen - - movzwl -1(%scan, %rax), %scanend - mov dsPrev, %prev - movl _chainlenwmask, %chainlenwmask - jmp LookupLoop - -/* Accept the current string, with the maximum possible length. */ - -LenMaximum: - movl $MAX_MATCH, %bestlend - movl %curmatchd, dsMatchStart - -/* if ((uInt)best_len <= s->lookahead) return (uInt)best_len; */ -/* return s->lookahead; */ - -LeaveNow: - movl dsLookahead, %eax - cmpl %eax, %bestlend - cmovngl %bestlend, %eax -LookaheadRet: - -/* Restore the registers and return from whence we came. */ - - mov save_rsi, %rsi - mov save_rbx, %rbx - mov save_r12, %r12 - mov save_r13, %r13 - mov save_r14, %r14 - mov save_r15, %r15 - - ret - -match_init: ret diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/contrib/asm686/match.S mame-0.243+dfsg.1/3rdparty/zlib/contrib/asm686/match.S --- mame-0.242+dfsg.1/3rdparty/zlib/contrib/asm686/match.S 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/contrib/asm686/match.S 1970-01-01 00:00:00.000000000 +0000 @@ -1,357 +0,0 @@ -/* match.S -- x86 assembly version of the zlib longest_match() function. - * Optimized for the Intel 686 chips (PPro and later). - * - * Copyright (C) 1998, 2007 Brian Raiter - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the author be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - */ - -#ifndef NO_UNDERLINE -#define match_init _match_init -#define longest_match _longest_match -#endif - -#define MAX_MATCH (258) -#define MIN_MATCH (3) -#define MIN_LOOKAHEAD (MAX_MATCH + MIN_MATCH + 1) -#define MAX_MATCH_8 ((MAX_MATCH + 7) & ~7) - -/* stack frame offsets */ - -#define chainlenwmask 0 /* high word: current chain len */ - /* low word: s->wmask */ -#define window 4 /* local copy of s->window */ -#define windowbestlen 8 /* s->window + bestlen */ -#define scanstart 16 /* first two bytes of string */ -#define scanend 12 /* last two bytes of string */ -#define scanalign 20 /* dword-misalignment of string */ -#define nicematch 24 /* a good enough match size */ -#define bestlen 28 /* size of best match so far */ -#define scan 32 /* ptr to string wanting match */ - -#define LocalVarsSize (36) -/* saved ebx 36 */ -/* saved edi 40 */ -/* saved esi 44 */ -/* saved ebp 48 */ -/* return address 52 */ -#define deflatestate 56 /* the function arguments */ -#define curmatch 60 - -/* All the +zlib1222add offsets are due to the addition of fields - * in zlib in the deflate_state structure since the asm code was first written - * (if you compile with zlib 1.0.4 or older, use "zlib1222add equ (-4)"). - * (if you compile with zlib between 1.0.5 and 1.2.2.1, use "zlib1222add equ 0"). - * if you compile with zlib 1.2.2.2 or later , use "zlib1222add equ 8"). - */ - -#define zlib1222add (8) - -#define dsWSize (36+zlib1222add) -#define dsWMask (44+zlib1222add) -#define dsWindow (48+zlib1222add) -#define dsPrev (56+zlib1222add) -#define dsMatchLen (88+zlib1222add) -#define dsPrevMatch (92+zlib1222add) -#define dsStrStart (100+zlib1222add) -#define dsMatchStart (104+zlib1222add) -#define dsLookahead (108+zlib1222add) -#define dsPrevLen (112+zlib1222add) -#define dsMaxChainLen (116+zlib1222add) -#define dsGoodMatch (132+zlib1222add) -#define dsNiceMatch (136+zlib1222add) - - -.file "match.S" - -.globl match_init, longest_match - -.text - -/* uInt longest_match(deflate_state *deflatestate, IPos curmatch) */ -.cfi_sections .debug_frame - -longest_match: - -.cfi_startproc -/* Save registers that the compiler may be using, and adjust %esp to */ -/* make room for our stack frame. */ - - pushl %ebp - .cfi_def_cfa_offset 8 - .cfi_offset ebp, -8 - pushl %edi - .cfi_def_cfa_offset 12 - pushl %esi - .cfi_def_cfa_offset 16 - pushl %ebx - .cfi_def_cfa_offset 20 - subl $LocalVarsSize, %esp - .cfi_def_cfa_offset LocalVarsSize+20 - -/* Retrieve the function arguments. %ecx will hold cur_match */ -/* throughout the entire function. %edx will hold the pointer to the */ -/* deflate_state structure during the function's setup (before */ -/* entering the main loop). */ - - movl deflatestate(%esp), %edx - movl curmatch(%esp), %ecx - -/* uInt wmask = s->w_mask; */ -/* unsigned chain_length = s->max_chain_length; */ -/* if (s->prev_length >= s->good_match) { */ -/* chain_length >>= 2; */ -/* } */ - - movl dsPrevLen(%edx), %eax - movl dsGoodMatch(%edx), %ebx - cmpl %ebx, %eax - movl dsWMask(%edx), %eax - movl dsMaxChainLen(%edx), %ebx - jl LastMatchGood - shrl $2, %ebx -LastMatchGood: - -/* chainlen is decremented once beforehand so that the function can */ -/* use the sign flag instead of the zero flag for the exit test. */ -/* It is then shifted into the high word, to make room for the wmask */ -/* value, which it will always accompany. */ - - decl %ebx - shll $16, %ebx - orl %eax, %ebx - movl %ebx, chainlenwmask(%esp) - -/* if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead; */ - - movl dsNiceMatch(%edx), %eax - movl dsLookahead(%edx), %ebx - cmpl %eax, %ebx - jl LookaheadLess - movl %eax, %ebx -LookaheadLess: movl %ebx, nicematch(%esp) - -/* register Bytef *scan = s->window + s->strstart; */ - - movl dsWindow(%edx), %esi - movl %esi, window(%esp) - movl dsStrStart(%edx), %ebp - lea (%esi,%ebp), %edi - movl %edi, scan(%esp) - -/* Determine how many bytes the scan ptr is off from being */ -/* dword-aligned. */ - - movl %edi, %eax - negl %eax - andl $3, %eax - movl %eax, scanalign(%esp) - -/* IPos limit = s->strstart > (IPos)MAX_DIST(s) ? */ -/* s->strstart - (IPos)MAX_DIST(s) : NIL; */ - - movl dsWSize(%edx), %eax - subl $MIN_LOOKAHEAD, %eax - subl %eax, %ebp - jg LimitPositive - xorl %ebp, %ebp -LimitPositive: - -/* int best_len = s->prev_length; */ - - movl dsPrevLen(%edx), %eax - movl %eax, bestlen(%esp) - -/* Store the sum of s->window + best_len in %esi locally, and in %esi. */ - - addl %eax, %esi - movl %esi, windowbestlen(%esp) - -/* register ush scan_start = *(ushf*)scan; */ -/* register ush scan_end = *(ushf*)(scan+best_len-1); */ -/* Posf *prev = s->prev; */ - - movzwl (%edi), %ebx - movl %ebx, scanstart(%esp) - movzwl -1(%edi,%eax), %ebx - movl %ebx, scanend(%esp) - movl dsPrev(%edx), %edi - -/* Jump into the main loop. */ - - movl chainlenwmask(%esp), %edx - jmp LoopEntry - -.balign 16 - -/* do { - * match = s->window + cur_match; - * if (*(ushf*)(match+best_len-1) != scan_end || - * *(ushf*)match != scan_start) continue; - * [...] - * } while ((cur_match = prev[cur_match & wmask]) > limit - * && --chain_length != 0); - * - * Here is the inner loop of the function. The function will spend the - * majority of its time in this loop, and majority of that time will - * be spent in the first ten instructions. - * - * Within this loop: - * %ebx = scanend - * %ecx = curmatch - * %edx = chainlenwmask - i.e., ((chainlen << 16) | wmask) - * %esi = windowbestlen - i.e., (window + bestlen) - * %edi = prev - * %ebp = limit - */ -LookupLoop: - andl %edx, %ecx - movzwl (%edi,%ecx,2), %ecx - cmpl %ebp, %ecx - jbe LeaveNow - subl $0x00010000, %edx - js LeaveNow -LoopEntry: movzwl -1(%esi,%ecx), %eax - cmpl %ebx, %eax - jnz LookupLoop - movl window(%esp), %eax - movzwl (%eax,%ecx), %eax - cmpl scanstart(%esp), %eax - jnz LookupLoop - -/* Store the current value of chainlen. */ - - movl %edx, chainlenwmask(%esp) - -/* Point %edi to the string under scrutiny, and %esi to the string we */ -/* are hoping to match it up with. In actuality, %esi and %edi are */ -/* both pointed (MAX_MATCH_8 - scanalign) bytes ahead, and %edx is */ -/* initialized to -(MAX_MATCH_8 - scanalign). */ - - movl window(%esp), %esi - movl scan(%esp), %edi - addl %ecx, %esi - movl scanalign(%esp), %eax - movl $(-MAX_MATCH_8), %edx - lea MAX_MATCH_8(%edi,%eax), %edi - lea MAX_MATCH_8(%esi,%eax), %esi - -/* Test the strings for equality, 8 bytes at a time. At the end, - * adjust %edx so that it is offset to the exact byte that mismatched. - * - * We already know at this point that the first three bytes of the - * strings match each other, and they can be safely passed over before - * starting the compare loop. So what this code does is skip over 0-3 - * bytes, as much as necessary in order to dword-align the %edi - * pointer. (%esi will still be misaligned three times out of four.) - * - * It should be confessed that this loop usually does not represent - * much of the total running time. Replacing it with a more - * straightforward "rep cmpsb" would not drastically degrade - * performance. - */ -LoopCmps: - movl (%esi,%edx), %eax - xorl (%edi,%edx), %eax - jnz LeaveLoopCmps - movl 4(%esi,%edx), %eax - xorl 4(%edi,%edx), %eax - jnz LeaveLoopCmps4 - addl $8, %edx - jnz LoopCmps - jmp LenMaximum -LeaveLoopCmps4: addl $4, %edx -LeaveLoopCmps: testl $0x0000FFFF, %eax - jnz LenLower - addl $2, %edx - shrl $16, %eax -LenLower: subb $1, %al - adcl $0, %edx - -/* Calculate the length of the match. If it is longer than MAX_MATCH, */ -/* then automatically accept it as the best possible match and leave. */ - - lea (%edi,%edx), %eax - movl scan(%esp), %edi - subl %edi, %eax - cmpl $MAX_MATCH, %eax - jge LenMaximum - -/* If the length of the match is not longer than the best match we */ -/* have so far, then forget it and return to the lookup loop. */ - - movl deflatestate(%esp), %edx - movl bestlen(%esp), %ebx - cmpl %ebx, %eax - jg LongerMatch - movl windowbestlen(%esp), %esi - movl dsPrev(%edx), %edi - movl scanend(%esp), %ebx - movl chainlenwmask(%esp), %edx - jmp LookupLoop - -/* s->match_start = cur_match; */ -/* best_len = len; */ -/* if (len >= nice_match) break; */ -/* scan_end = *(ushf*)(scan+best_len-1); */ - -LongerMatch: movl nicematch(%esp), %ebx - movl %eax, bestlen(%esp) - movl %ecx, dsMatchStart(%edx) - cmpl %ebx, %eax - jge LeaveNow - movl window(%esp), %esi - addl %eax, %esi - movl %esi, windowbestlen(%esp) - movzwl -1(%edi,%eax), %ebx - movl dsPrev(%edx), %edi - movl %ebx, scanend(%esp) - movl chainlenwmask(%esp), %edx - jmp LookupLoop - -/* Accept the current string, with the maximum possible length. */ - -LenMaximum: movl deflatestate(%esp), %edx - movl $MAX_MATCH, bestlen(%esp) - movl %ecx, dsMatchStart(%edx) - -/* if ((uInt)best_len <= s->lookahead) return (uInt)best_len; */ -/* return s->lookahead; */ - -LeaveNow: - movl deflatestate(%esp), %edx - movl bestlen(%esp), %ebx - movl dsLookahead(%edx), %eax - cmpl %eax, %ebx - jg LookaheadRet - movl %ebx, %eax -LookaheadRet: - -/* Restore the stack and return from whence we came. */ - - addl $LocalVarsSize, %esp - .cfi_def_cfa_offset 20 - popl %ebx - .cfi_def_cfa_offset 16 - popl %esi - .cfi_def_cfa_offset 12 - popl %edi - .cfi_def_cfa_offset 8 - popl %ebp - .cfi_def_cfa_offset 4 -.cfi_endproc -match_init: ret diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/contrib/asm686/README.686 mame-0.243+dfsg.1/3rdparty/zlib/contrib/asm686/README.686 --- mame-0.242+dfsg.1/3rdparty/zlib/contrib/asm686/README.686 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/contrib/asm686/README.686 1970-01-01 00:00:00.000000000 +0000 @@ -1,51 +0,0 @@ -This is a patched version of zlib, modified to use -Pentium-Pro-optimized assembly code in the deflation algorithm. The -files changed/added by this patch are: - -README.686 -match.S - -The speedup that this patch provides varies, depending on whether the -compiler used to build the original version of zlib falls afoul of the -PPro's speed traps. My own tests show a speedup of around 10-20% at -the default compression level, and 20-30% using -9, against a version -compiled using gcc 2.7.2.3. Your mileage may vary. - -Note that this code has been tailored for the PPro/PII in particular, -and will not perform particuarly well on a Pentium. - -If you are using an assembler other than GNU as, you will have to -translate match.S to use your assembler's syntax. (Have fun.) - -Brian Raiter -breadbox@muppetlabs.com -April, 1998 - - -Added for zlib 1.1.3: - -The patches come from -http://www.muppetlabs.com/~breadbox/software/assembly.html - -To compile zlib with this asm file, copy match.S to the zlib directory -then do: - -CFLAGS="-O3 -DASMV" ./configure -make OBJA=match.o - - -Update: - -I've been ignoring these assembly routines for years, believing that -gcc's generated code had caught up with it sometime around gcc 2.95 -and the major rearchitecting of the Pentium 4. However, I recently -learned that, despite what I believed, this code still has some life -in it. On the Pentium 4 and AMD64 chips, it continues to run about 8% -faster than the code produced by gcc 4.1. - -In acknowledgement of its continuing usefulness, I've altered the -license to match that of the rest of zlib. Share and Enjoy! - -Brian Raiter -breadbox@muppetlabs.com -April, 2007 diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/contrib/blast/blast.h mame-0.243+dfsg.1/3rdparty/zlib/contrib/blast/blast.h --- mame-0.242+dfsg.1/3rdparty/zlib/contrib/blast/blast.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/contrib/blast/blast.h 2022-04-29 05:37:26.000000000 +0000 @@ -57,7 +57,7 @@ * use by the application to pass an input descriptor to infun(), if desired. * * If left and in are not NULL and *left is not zero when blast() is called, - * then the *left bytes are *in are consumed for input before infun() is used. + * then the *left bytes at *in are consumed for input before infun() is used. * * The output function is invoked: err = outfun(how, buf, len), where the bytes * to be written are buf[0..len-1]. If err is not zero, then blast() returns diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/contrib/delphi/ZLib.pas mame-0.243+dfsg.1/3rdparty/zlib/contrib/delphi/ZLib.pas --- mame-0.242+dfsg.1/3rdparty/zlib/contrib/delphi/ZLib.pas 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/contrib/delphi/ZLib.pas 2022-04-29 05:37:26.000000000 +0000 @@ -152,7 +152,7 @@ const OutBuf: Pointer; BufSize: Integer); const - zlib_version = '1.2.11'; + zlib_version = '1.2.12'; type EZlibError = class(Exception); diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/contrib/dotzlib/DotZLib/UnitTests.cs mame-0.243+dfsg.1/3rdparty/zlib/contrib/dotzlib/DotZLib/UnitTests.cs --- mame-0.242+dfsg.1/3rdparty/zlib/contrib/dotzlib/DotZLib/UnitTests.cs 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/contrib/dotzlib/DotZLib/UnitTests.cs 2022-04-29 05:37:26.000000000 +0000 @@ -156,7 +156,7 @@ public void Info_Version() { Info info = new Info(); - Assert.AreEqual("1.2.11", Info.Version); + Assert.AreEqual("1.2.12", Info.Version); Assert.AreEqual(32, info.SizeOfUInt); Assert.AreEqual(32, info.SizeOfULong); Assert.AreEqual(32, info.SizeOfPointer); diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/contrib/infback9/inftree9.c mame-0.243+dfsg.1/3rdparty/zlib/contrib/infback9/inftree9.c --- mame-0.242+dfsg.1/3rdparty/zlib/contrib/infback9/inftree9.c 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/contrib/infback9/inftree9.c 2022-04-29 05:37:26.000000000 +0000 @@ -1,5 +1,5 @@ /* inftree9.c -- generate Huffman trees for efficient decoding - * Copyright (C) 1995-2017 Mark Adler + * Copyright (C) 1995-2022 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -9,7 +9,7 @@ #define MAXBITS 15 const char inflate9_copyright[] = - " inflate9 1.2.11 Copyright 1995-2017 Mark Adler "; + " inflate9 1.2.12 Copyright 1995-2022 Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot @@ -64,7 +64,7 @@ static const unsigned short lext[31] = { /* Length codes 257..285 extra */ 128, 128, 128, 128, 128, 128, 128, 128, 129, 129, 129, 129, 130, 130, 130, 130, 131, 131, 131, 131, 132, 132, 132, 132, - 133, 133, 133, 133, 144, 77, 202}; + 133, 133, 133, 133, 144, 199, 202}; static const unsigned short dbase[32] = { /* Distance codes 0..31 base */ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/contrib/inflate86/inffas86.c mame-0.243+dfsg.1/3rdparty/zlib/contrib/inflate86/inffas86.c --- mame-0.242+dfsg.1/3rdparty/zlib/contrib/inflate86/inffas86.c 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/contrib/inflate86/inffas86.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1157 +0,0 @@ -/* inffas86.c is a hand tuned assembler version of - * - * inffast.c -- fast decoding - * Copyright (C) 1995-2003 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - * - * Copyright (C) 2003 Chris Anderson - * Please use the copyright conditions above. - * - * Dec-29-2003 -- I added AMD64 inflate asm support. This version is also - * slightly quicker on x86 systems because, instead of using rep movsb to copy - * data, it uses rep movsw, which moves data in 2-byte chunks instead of single - * bytes. I've tested the AMD64 code on a Fedora Core 1 + the x86_64 updates - * from http://fedora.linux.duke.edu/fc1_x86_64 - * which is running on an Athlon 64 3000+ / Gigabyte GA-K8VT800M system with - * 1GB ram. The 64-bit version is about 4% faster than the 32-bit version, - * when decompressing mozilla-source-1.3.tar.gz. - * - * Mar-13-2003 -- Most of this is derived from inffast.S which is derived from - * the gcc -S output of zlib-1.2.0/inffast.c. Zlib-1.2.0 is in beta release at - * the moment. I have successfully compiled and tested this code with gcc2.96, - * gcc3.2, icc5.0, msvc6.0. It is very close to the speed of inffast.S - * compiled with gcc -DNO_MMX, but inffast.S is still faster on the P3 with MMX - * enabled. I will attempt to merge the MMX code into this version. Newer - * versions of this and inffast.S can be found at - * http://www.eetbeetee.com/zlib/ and http://www.charm.net/~christop/zlib/ - */ - -#include "zutil.h" -#include "inftrees.h" -#include "inflate.h" -#include "inffast.h" - -/* Mark Adler's comments from inffast.c: */ - -/* - Decode literal, length, and distance codes and write out the resulting - literal and match bytes until either not enough input or output is - available, an end-of-block is encountered, or a data error is encountered. - When large enough input and output buffers are supplied to inflate(), for - example, a 16K input buffer and a 64K output buffer, more than 95% of the - inflate execution time is spent in this routine. - - Entry assumptions: - - state->mode == LEN - strm->avail_in >= 6 - strm->avail_out >= 258 - start >= strm->avail_out - state->bits < 8 - - On return, state->mode is one of: - - LEN -- ran out of enough output space or enough available input - TYPE -- reached end of block code, inflate() to interpret next block - BAD -- error in block data - - Notes: - - - The maximum input bits used by a length/distance pair is 15 bits for the - length code, 5 bits for the length extra, 15 bits for the distance code, - and 13 bits for the distance extra. This totals 48 bits, or six bytes. - Therefore if strm->avail_in >= 6, then there is enough input to avoid - checking for available input while decoding. - - - The maximum bytes that a single length/distance pair can output is 258 - bytes, which is the maximum length that can be coded. inflate_fast() - requires strm->avail_out >= 258 for each loop to avoid checking for - output space. - */ -void inflate_fast(strm, start) -z_streamp strm; -unsigned start; /* inflate()'s starting value for strm->avail_out */ -{ - struct inflate_state FAR *state; - struct inffast_ar { -/* 64 32 x86 x86_64 */ -/* ar offset register */ -/* 0 0 */ void *esp; /* esp save */ -/* 8 4 */ void *ebp; /* ebp save */ -/* 16 8 */ unsigned char FAR *in; /* esi rsi local strm->next_in */ -/* 24 12 */ unsigned char FAR *last; /* r9 while in < last */ -/* 32 16 */ unsigned char FAR *out; /* edi rdi local strm->next_out */ -/* 40 20 */ unsigned char FAR *beg; /* inflate()'s init next_out */ -/* 48 24 */ unsigned char FAR *end; /* r10 while out < end */ -/* 56 28 */ unsigned char FAR *window;/* size of window, wsize!=0 */ -/* 64 32 */ code const FAR *lcode; /* ebp rbp local strm->lencode */ -/* 72 36 */ code const FAR *dcode; /* r11 local strm->distcode */ -/* 80 40 */ unsigned long hold; /* edx rdx local strm->hold */ -/* 88 44 */ unsigned bits; /* ebx rbx local strm->bits */ -/* 92 48 */ unsigned wsize; /* window size */ -/* 96 52 */ unsigned write; /* window write index */ -/*100 56 */ unsigned lmask; /* r12 mask for lcode */ -/*104 60 */ unsigned dmask; /* r13 mask for dcode */ -/*108 64 */ unsigned len; /* r14 match length */ -/*112 68 */ unsigned dist; /* r15 match distance */ -/*116 72 */ unsigned status; /* set when state chng*/ - } ar; - -#if defined( __GNUC__ ) && defined( __amd64__ ) && ! defined( __i386 ) -#define PAD_AVAIL_IN 6 -#define PAD_AVAIL_OUT 258 -#else -#define PAD_AVAIL_IN 5 -#define PAD_AVAIL_OUT 257 -#endif - - /* copy state to local variables */ - state = (struct inflate_state FAR *)strm->state; - ar.in = strm->next_in; - ar.last = ar.in + (strm->avail_in - PAD_AVAIL_IN); - ar.out = strm->next_out; - ar.beg = ar.out - (start - strm->avail_out); - ar.end = ar.out + (strm->avail_out - PAD_AVAIL_OUT); - ar.wsize = state->wsize; - ar.write = state->wnext; - ar.window = state->window; - ar.hold = state->hold; - ar.bits = state->bits; - ar.lcode = state->lencode; - ar.dcode = state->distcode; - ar.lmask = (1U << state->lenbits) - 1; - ar.dmask = (1U << state->distbits) - 1; - - /* decode literals and length/distances until end-of-block or not enough - input data or output space */ - - /* align in on 1/2 hold size boundary */ - while (((unsigned long)(void *)ar.in & (sizeof(ar.hold) / 2 - 1)) != 0) { - ar.hold += (unsigned long)*ar.in++ << ar.bits; - ar.bits += 8; - } - -#if defined( __GNUC__ ) && defined( __amd64__ ) && ! defined( __i386 ) - __asm__ __volatile__ ( -" leaq %0, %%rax\n" -" movq %%rbp, 8(%%rax)\n" /* save regs rbp and rsp */ -" movq %%rsp, (%%rax)\n" -" movq %%rax, %%rsp\n" /* make rsp point to &ar */ -" movq 16(%%rsp), %%rsi\n" /* rsi = in */ -" movq 32(%%rsp), %%rdi\n" /* rdi = out */ -" movq 24(%%rsp), %%r9\n" /* r9 = last */ -" movq 48(%%rsp), %%r10\n" /* r10 = end */ -" movq 64(%%rsp), %%rbp\n" /* rbp = lcode */ -" movq 72(%%rsp), %%r11\n" /* r11 = dcode */ -" movq 80(%%rsp), %%rdx\n" /* rdx = hold */ -" movl 88(%%rsp), %%ebx\n" /* ebx = bits */ -" movl 100(%%rsp), %%r12d\n" /* r12d = lmask */ -" movl 104(%%rsp), %%r13d\n" /* r13d = dmask */ - /* r14d = len */ - /* r15d = dist */ -" cld\n" -" cmpq %%rdi, %%r10\n" -" je .L_one_time\n" /* if only one decode left */ -" cmpq %%rsi, %%r9\n" -" je .L_one_time\n" -" jmp .L_do_loop\n" - -".L_one_time:\n" -" movq %%r12, %%r8\n" /* r8 = lmask */ -" cmpb $32, %%bl\n" -" ja .L_get_length_code_one_time\n" - -" lodsl\n" /* eax = *(uint *)in++ */ -" movb %%bl, %%cl\n" /* cl = bits, needs it for shifting */ -" addb $32, %%bl\n" /* bits += 32 */ -" shlq %%cl, %%rax\n" -" orq %%rax, %%rdx\n" /* hold |= *((uint *)in)++ << bits */ -" jmp .L_get_length_code_one_time\n" - -".align 32,0x90\n" -".L_while_test:\n" -" cmpq %%rdi, %%r10\n" -" jbe .L_break_loop\n" -" cmpq %%rsi, %%r9\n" -" jbe .L_break_loop\n" - -".L_do_loop:\n" -" movq %%r12, %%r8\n" /* r8 = lmask */ -" cmpb $32, %%bl\n" -" ja .L_get_length_code\n" /* if (32 < bits) */ - -" lodsl\n" /* eax = *(uint *)in++ */ -" movb %%bl, %%cl\n" /* cl = bits, needs it for shifting */ -" addb $32, %%bl\n" /* bits += 32 */ -" shlq %%cl, %%rax\n" -" orq %%rax, %%rdx\n" /* hold |= *((uint *)in)++ << bits */ - -".L_get_length_code:\n" -" andq %%rdx, %%r8\n" /* r8 &= hold */ -" movl (%%rbp,%%r8,4), %%eax\n" /* eax = lcode[hold & lmask] */ - -" movb %%ah, %%cl\n" /* cl = this.bits */ -" subb %%ah, %%bl\n" /* bits -= this.bits */ -" shrq %%cl, %%rdx\n" /* hold >>= this.bits */ - -" testb %%al, %%al\n" -" jnz .L_test_for_length_base\n" /* if (op != 0) 45.7% */ - -" movq %%r12, %%r8\n" /* r8 = lmask */ -" shrl $16, %%eax\n" /* output this.val char */ -" stosb\n" - -".L_get_length_code_one_time:\n" -" andq %%rdx, %%r8\n" /* r8 &= hold */ -" movl (%%rbp,%%r8,4), %%eax\n" /* eax = lcode[hold & lmask] */ - -".L_dolen:\n" -" movb %%ah, %%cl\n" /* cl = this.bits */ -" subb %%ah, %%bl\n" /* bits -= this.bits */ -" shrq %%cl, %%rdx\n" /* hold >>= this.bits */ - -" testb %%al, %%al\n" -" jnz .L_test_for_length_base\n" /* if (op != 0) 45.7% */ - -" shrl $16, %%eax\n" /* output this.val char */ -" stosb\n" -" jmp .L_while_test\n" - -".align 32,0x90\n" -".L_test_for_length_base:\n" -" movl %%eax, %%r14d\n" /* len = this */ -" shrl $16, %%r14d\n" /* len = this.val */ -" movb %%al, %%cl\n" - -" testb $16, %%al\n" -" jz .L_test_for_second_level_length\n" /* if ((op & 16) == 0) 8% */ -" andb $15, %%cl\n" /* op &= 15 */ -" jz .L_decode_distance\n" /* if (!op) */ - -".L_add_bits_to_len:\n" -" subb %%cl, %%bl\n" -" xorl %%eax, %%eax\n" -" incl %%eax\n" -" shll %%cl, %%eax\n" -" decl %%eax\n" -" andl %%edx, %%eax\n" /* eax &= hold */ -" shrq %%cl, %%rdx\n" -" addl %%eax, %%r14d\n" /* len += hold & mask[op] */ - -".L_decode_distance:\n" -" movq %%r13, %%r8\n" /* r8 = dmask */ -" cmpb $32, %%bl\n" -" ja .L_get_distance_code\n" /* if (32 < bits) */ - -" lodsl\n" /* eax = *(uint *)in++ */ -" movb %%bl, %%cl\n" /* cl = bits, needs it for shifting */ -" addb $32, %%bl\n" /* bits += 32 */ -" shlq %%cl, %%rax\n" -" orq %%rax, %%rdx\n" /* hold |= *((uint *)in)++ << bits */ - -".L_get_distance_code:\n" -" andq %%rdx, %%r8\n" /* r8 &= hold */ -" movl (%%r11,%%r8,4), %%eax\n" /* eax = dcode[hold & dmask] */ - -".L_dodist:\n" -" movl %%eax, %%r15d\n" /* dist = this */ -" shrl $16, %%r15d\n" /* dist = this.val */ -" movb %%ah, %%cl\n" -" subb %%ah, %%bl\n" /* bits -= this.bits */ -" shrq %%cl, %%rdx\n" /* hold >>= this.bits */ -" movb %%al, %%cl\n" /* cl = this.op */ - -" testb $16, %%al\n" /* if ((op & 16) == 0) */ -" jz .L_test_for_second_level_dist\n" -" andb $15, %%cl\n" /* op &= 15 */ -" jz .L_check_dist_one\n" - -".L_add_bits_to_dist:\n" -" subb %%cl, %%bl\n" -" xorl %%eax, %%eax\n" -" incl %%eax\n" -" shll %%cl, %%eax\n" -" decl %%eax\n" /* (1 << op) - 1 */ -" andl %%edx, %%eax\n" /* eax &= hold */ -" shrq %%cl, %%rdx\n" -" addl %%eax, %%r15d\n" /* dist += hold & ((1 << op) - 1) */ - -".L_check_window:\n" -" movq %%rsi, %%r8\n" /* save in so from can use it's reg */ -" movq %%rdi, %%rax\n" -" subq 40(%%rsp), %%rax\n" /* nbytes = out - beg */ - -" cmpl %%r15d, %%eax\n" -" jb .L_clip_window\n" /* if (dist > nbytes) 4.2% */ - -" movl %%r14d, %%ecx\n" /* ecx = len */ -" movq %%rdi, %%rsi\n" -" subq %%r15, %%rsi\n" /* from = out - dist */ - -" sarl %%ecx\n" -" jnc .L_copy_two\n" /* if len % 2 == 0 */ - -" rep movsw\n" -" movb (%%rsi), %%al\n" -" movb %%al, (%%rdi)\n" -" incq %%rdi\n" - -" movq %%r8, %%rsi\n" /* move in back to %rsi, toss from */ -" jmp .L_while_test\n" - -".L_copy_two:\n" -" rep movsw\n" -" movq %%r8, %%rsi\n" /* move in back to %rsi, toss from */ -" jmp .L_while_test\n" - -".align 32,0x90\n" -".L_check_dist_one:\n" -" cmpl $1, %%r15d\n" /* if dist 1, is a memset */ -" jne .L_check_window\n" -" cmpq %%rdi, 40(%%rsp)\n" /* if out == beg, outside window */ -" je .L_check_window\n" - -" movl %%r14d, %%ecx\n" /* ecx = len */ -" movb -1(%%rdi), %%al\n" -" movb %%al, %%ah\n" - -" sarl %%ecx\n" -" jnc .L_set_two\n" -" movb %%al, (%%rdi)\n" -" incq %%rdi\n" - -".L_set_two:\n" -" rep stosw\n" -" jmp .L_while_test\n" - -".align 32,0x90\n" -".L_test_for_second_level_length:\n" -" testb $64, %%al\n" -" jnz .L_test_for_end_of_block\n" /* if ((op & 64) != 0) */ - -" xorl %%eax, %%eax\n" -" incl %%eax\n" -" shll %%cl, %%eax\n" -" decl %%eax\n" -" andl %%edx, %%eax\n" /* eax &= hold */ -" addl %%r14d, %%eax\n" /* eax += len */ -" movl (%%rbp,%%rax,4), %%eax\n" /* eax = lcode[val+(hold&mask[op])]*/ -" jmp .L_dolen\n" - -".align 32,0x90\n" -".L_test_for_second_level_dist:\n" -" testb $64, %%al\n" -" jnz .L_invalid_distance_code\n" /* if ((op & 64) != 0) */ - -" xorl %%eax, %%eax\n" -" incl %%eax\n" -" shll %%cl, %%eax\n" -" decl %%eax\n" -" andl %%edx, %%eax\n" /* eax &= hold */ -" addl %%r15d, %%eax\n" /* eax += dist */ -" movl (%%r11,%%rax,4), %%eax\n" /* eax = dcode[val+(hold&mask[op])]*/ -" jmp .L_dodist\n" - -".align 32,0x90\n" -".L_clip_window:\n" -" movl %%eax, %%ecx\n" /* ecx = nbytes */ -" movl 92(%%rsp), %%eax\n" /* eax = wsize, prepare for dist cmp */ -" negl %%ecx\n" /* nbytes = -nbytes */ - -" cmpl %%r15d, %%eax\n" -" jb .L_invalid_distance_too_far\n" /* if (dist > wsize) */ - -" addl %%r15d, %%ecx\n" /* nbytes = dist - nbytes */ -" cmpl $0, 96(%%rsp)\n" -" jne .L_wrap_around_window\n" /* if (write != 0) */ - -" movq 56(%%rsp), %%rsi\n" /* from = window */ -" subl %%ecx, %%eax\n" /* eax -= nbytes */ -" addq %%rax, %%rsi\n" /* from += wsize - nbytes */ - -" movl %%r14d, %%eax\n" /* eax = len */ -" cmpl %%ecx, %%r14d\n" -" jbe .L_do_copy\n" /* if (nbytes >= len) */ - -" subl %%ecx, %%eax\n" /* eax -= nbytes */ -" rep movsb\n" -" movq %%rdi, %%rsi\n" -" subq %%r15, %%rsi\n" /* from = &out[ -dist ] */ -" jmp .L_do_copy\n" - -".align 32,0x90\n" -".L_wrap_around_window:\n" -" movl 96(%%rsp), %%eax\n" /* eax = write */ -" cmpl %%eax, %%ecx\n" -" jbe .L_contiguous_in_window\n" /* if (write >= nbytes) */ - -" movl 92(%%rsp), %%esi\n" /* from = wsize */ -" addq 56(%%rsp), %%rsi\n" /* from += window */ -" addq %%rax, %%rsi\n" /* from += write */ -" subq %%rcx, %%rsi\n" /* from -= nbytes */ -" subl %%eax, %%ecx\n" /* nbytes -= write */ - -" movl %%r14d, %%eax\n" /* eax = len */ -" cmpl %%ecx, %%eax\n" -" jbe .L_do_copy\n" /* if (nbytes >= len) */ - -" subl %%ecx, %%eax\n" /* len -= nbytes */ -" rep movsb\n" -" movq 56(%%rsp), %%rsi\n" /* from = window */ -" movl 96(%%rsp), %%ecx\n" /* nbytes = write */ -" cmpl %%ecx, %%eax\n" -" jbe .L_do_copy\n" /* if (nbytes >= len) */ - -" subl %%ecx, %%eax\n" /* len -= nbytes */ -" rep movsb\n" -" movq %%rdi, %%rsi\n" -" subq %%r15, %%rsi\n" /* from = out - dist */ -" jmp .L_do_copy\n" - -".align 32,0x90\n" -".L_contiguous_in_window:\n" -" movq 56(%%rsp), %%rsi\n" /* rsi = window */ -" addq %%rax, %%rsi\n" -" subq %%rcx, %%rsi\n" /* from += write - nbytes */ - -" movl %%r14d, %%eax\n" /* eax = len */ -" cmpl %%ecx, %%eax\n" -" jbe .L_do_copy\n" /* if (nbytes >= len) */ - -" subl %%ecx, %%eax\n" /* len -= nbytes */ -" rep movsb\n" -" movq %%rdi, %%rsi\n" -" subq %%r15, %%rsi\n" /* from = out - dist */ -" jmp .L_do_copy\n" /* if (nbytes >= len) */ - -".align 32,0x90\n" -".L_do_copy:\n" -" movl %%eax, %%ecx\n" /* ecx = len */ -" rep movsb\n" - -" movq %%r8, %%rsi\n" /* move in back to %esi, toss from */ -" jmp .L_while_test\n" - -".L_test_for_end_of_block:\n" -" testb $32, %%al\n" -" jz .L_invalid_literal_length_code\n" -" movl $1, 116(%%rsp)\n" -" jmp .L_break_loop_with_status\n" - -".L_invalid_literal_length_code:\n" -" movl $2, 116(%%rsp)\n" -" jmp .L_break_loop_with_status\n" - -".L_invalid_distance_code:\n" -" movl $3, 116(%%rsp)\n" -" jmp .L_break_loop_with_status\n" - -".L_invalid_distance_too_far:\n" -" movl $4, 116(%%rsp)\n" -" jmp .L_break_loop_with_status\n" - -".L_break_loop:\n" -" movl $0, 116(%%rsp)\n" - -".L_break_loop_with_status:\n" -/* put in, out, bits, and hold back into ar and pop esp */ -" movq %%rsi, 16(%%rsp)\n" /* in */ -" movq %%rdi, 32(%%rsp)\n" /* out */ -" movl %%ebx, 88(%%rsp)\n" /* bits */ -" movq %%rdx, 80(%%rsp)\n" /* hold */ -" movq (%%rsp), %%rax\n" /* restore rbp and rsp */ -" movq 8(%%rsp), %%rbp\n" -" movq %%rax, %%rsp\n" - : - : "m" (ar) - : "memory", "%rax", "%rbx", "%rcx", "%rdx", "%rsi", "%rdi", - "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15" - ); -#elif ( defined( __GNUC__ ) || defined( __ICC ) ) && defined( __i386 ) - __asm__ __volatile__ ( -" leal %0, %%eax\n" -" movl %%esp, (%%eax)\n" /* save esp, ebp */ -" movl %%ebp, 4(%%eax)\n" -" movl %%eax, %%esp\n" -" movl 8(%%esp), %%esi\n" /* esi = in */ -" movl 16(%%esp), %%edi\n" /* edi = out */ -" movl 40(%%esp), %%edx\n" /* edx = hold */ -" movl 44(%%esp), %%ebx\n" /* ebx = bits */ -" movl 32(%%esp), %%ebp\n" /* ebp = lcode */ - -" cld\n" -" jmp .L_do_loop\n" - -".align 32,0x90\n" -".L_while_test:\n" -" cmpl %%edi, 24(%%esp)\n" /* out < end */ -" jbe .L_break_loop\n" -" cmpl %%esi, 12(%%esp)\n" /* in < last */ -" jbe .L_break_loop\n" - -".L_do_loop:\n" -" cmpb $15, %%bl\n" -" ja .L_get_length_code\n" /* if (15 < bits) */ - -" xorl %%eax, %%eax\n" -" lodsw\n" /* al = *(ushort *)in++ */ -" movb %%bl, %%cl\n" /* cl = bits, needs it for shifting */ -" addb $16, %%bl\n" /* bits += 16 */ -" shll %%cl, %%eax\n" -" orl %%eax, %%edx\n" /* hold |= *((ushort *)in)++ << bits */ - -".L_get_length_code:\n" -" movl 56(%%esp), %%eax\n" /* eax = lmask */ -" andl %%edx, %%eax\n" /* eax &= hold */ -" movl (%%ebp,%%eax,4), %%eax\n" /* eax = lcode[hold & lmask] */ - -".L_dolen:\n" -" movb %%ah, %%cl\n" /* cl = this.bits */ -" subb %%ah, %%bl\n" /* bits -= this.bits */ -" shrl %%cl, %%edx\n" /* hold >>= this.bits */ - -" testb %%al, %%al\n" -" jnz .L_test_for_length_base\n" /* if (op != 0) 45.7% */ - -" shrl $16, %%eax\n" /* output this.val char */ -" stosb\n" -" jmp .L_while_test\n" - -".align 32,0x90\n" -".L_test_for_length_base:\n" -" movl %%eax, %%ecx\n" /* len = this */ -" shrl $16, %%ecx\n" /* len = this.val */ -" movl %%ecx, 64(%%esp)\n" /* save len */ -" movb %%al, %%cl\n" - -" testb $16, %%al\n" -" jz .L_test_for_second_level_length\n" /* if ((op & 16) == 0) 8% */ -" andb $15, %%cl\n" /* op &= 15 */ -" jz .L_decode_distance\n" /* if (!op) */ -" cmpb %%cl, %%bl\n" -" jae .L_add_bits_to_len\n" /* if (op <= bits) */ - -" movb %%cl, %%ch\n" /* stash op in ch, freeing cl */ -" xorl %%eax, %%eax\n" -" lodsw\n" /* al = *(ushort *)in++ */ -" movb %%bl, %%cl\n" /* cl = bits, needs it for shifting */ -" addb $16, %%bl\n" /* bits += 16 */ -" shll %%cl, %%eax\n" -" orl %%eax, %%edx\n" /* hold |= *((ushort *)in)++ << bits */ -" movb %%ch, %%cl\n" /* move op back to ecx */ - -".L_add_bits_to_len:\n" -" subb %%cl, %%bl\n" -" xorl %%eax, %%eax\n" -" incl %%eax\n" -" shll %%cl, %%eax\n" -" decl %%eax\n" -" andl %%edx, %%eax\n" /* eax &= hold */ -" shrl %%cl, %%edx\n" -" addl %%eax, 64(%%esp)\n" /* len += hold & mask[op] */ - -".L_decode_distance:\n" -" cmpb $15, %%bl\n" -" ja .L_get_distance_code\n" /* if (15 < bits) */ - -" xorl %%eax, %%eax\n" -" lodsw\n" /* al = *(ushort *)in++ */ -" movb %%bl, %%cl\n" /* cl = bits, needs it for shifting */ -" addb $16, %%bl\n" /* bits += 16 */ -" shll %%cl, %%eax\n" -" orl %%eax, %%edx\n" /* hold |= *((ushort *)in)++ << bits */ - -".L_get_distance_code:\n" -" movl 60(%%esp), %%eax\n" /* eax = dmask */ -" movl 36(%%esp), %%ecx\n" /* ecx = dcode */ -" andl %%edx, %%eax\n" /* eax &= hold */ -" movl (%%ecx,%%eax,4), %%eax\n"/* eax = dcode[hold & dmask] */ - -".L_dodist:\n" -" movl %%eax, %%ebp\n" /* dist = this */ -" shrl $16, %%ebp\n" /* dist = this.val */ -" movb %%ah, %%cl\n" -" subb %%ah, %%bl\n" /* bits -= this.bits */ -" shrl %%cl, %%edx\n" /* hold >>= this.bits */ -" movb %%al, %%cl\n" /* cl = this.op */ - -" testb $16, %%al\n" /* if ((op & 16) == 0) */ -" jz .L_test_for_second_level_dist\n" -" andb $15, %%cl\n" /* op &= 15 */ -" jz .L_check_dist_one\n" -" cmpb %%cl, %%bl\n" -" jae .L_add_bits_to_dist\n" /* if (op <= bits) 97.6% */ - -" movb %%cl, %%ch\n" /* stash op in ch, freeing cl */ -" xorl %%eax, %%eax\n" -" lodsw\n" /* al = *(ushort *)in++ */ -" movb %%bl, %%cl\n" /* cl = bits, needs it for shifting */ -" addb $16, %%bl\n" /* bits += 16 */ -" shll %%cl, %%eax\n" -" orl %%eax, %%edx\n" /* hold |= *((ushort *)in)++ << bits */ -" movb %%ch, %%cl\n" /* move op back to ecx */ - -".L_add_bits_to_dist:\n" -" subb %%cl, %%bl\n" -" xorl %%eax, %%eax\n" -" incl %%eax\n" -" shll %%cl, %%eax\n" -" decl %%eax\n" /* (1 << op) - 1 */ -" andl %%edx, %%eax\n" /* eax &= hold */ -" shrl %%cl, %%edx\n" -" addl %%eax, %%ebp\n" /* dist += hold & ((1 << op) - 1) */ - -".L_check_window:\n" -" movl %%esi, 8(%%esp)\n" /* save in so from can use it's reg */ -" movl %%edi, %%eax\n" -" subl 20(%%esp), %%eax\n" /* nbytes = out - beg */ - -" cmpl %%ebp, %%eax\n" -" jb .L_clip_window\n" /* if (dist > nbytes) 4.2% */ - -" movl 64(%%esp), %%ecx\n" /* ecx = len */ -" movl %%edi, %%esi\n" -" subl %%ebp, %%esi\n" /* from = out - dist */ - -" sarl %%ecx\n" -" jnc .L_copy_two\n" /* if len % 2 == 0 */ - -" rep movsw\n" -" movb (%%esi), %%al\n" -" movb %%al, (%%edi)\n" -" incl %%edi\n" - -" movl 8(%%esp), %%esi\n" /* move in back to %esi, toss from */ -" movl 32(%%esp), %%ebp\n" /* ebp = lcode */ -" jmp .L_while_test\n" - -".L_copy_two:\n" -" rep movsw\n" -" movl 8(%%esp), %%esi\n" /* move in back to %esi, toss from */ -" movl 32(%%esp), %%ebp\n" /* ebp = lcode */ -" jmp .L_while_test\n" - -".align 32,0x90\n" -".L_check_dist_one:\n" -" cmpl $1, %%ebp\n" /* if dist 1, is a memset */ -" jne .L_check_window\n" -" cmpl %%edi, 20(%%esp)\n" -" je .L_check_window\n" /* out == beg, if outside window */ - -" movl 64(%%esp), %%ecx\n" /* ecx = len */ -" movb -1(%%edi), %%al\n" -" movb %%al, %%ah\n" - -" sarl %%ecx\n" -" jnc .L_set_two\n" -" movb %%al, (%%edi)\n" -" incl %%edi\n" - -".L_set_two:\n" -" rep stosw\n" -" movl 32(%%esp), %%ebp\n" /* ebp = lcode */ -" jmp .L_while_test\n" - -".align 32,0x90\n" -".L_test_for_second_level_length:\n" -" testb $64, %%al\n" -" jnz .L_test_for_end_of_block\n" /* if ((op & 64) != 0) */ - -" xorl %%eax, %%eax\n" -" incl %%eax\n" -" shll %%cl, %%eax\n" -" decl %%eax\n" -" andl %%edx, %%eax\n" /* eax &= hold */ -" addl 64(%%esp), %%eax\n" /* eax += len */ -" movl (%%ebp,%%eax,4), %%eax\n" /* eax = lcode[val+(hold&mask[op])]*/ -" jmp .L_dolen\n" - -".align 32,0x90\n" -".L_test_for_second_level_dist:\n" -" testb $64, %%al\n" -" jnz .L_invalid_distance_code\n" /* if ((op & 64) != 0) */ - -" xorl %%eax, %%eax\n" -" incl %%eax\n" -" shll %%cl, %%eax\n" -" decl %%eax\n" -" andl %%edx, %%eax\n" /* eax &= hold */ -" addl %%ebp, %%eax\n" /* eax += dist */ -" movl 36(%%esp), %%ecx\n" /* ecx = dcode */ -" movl (%%ecx,%%eax,4), %%eax\n" /* eax = dcode[val+(hold&mask[op])]*/ -" jmp .L_dodist\n" - -".align 32,0x90\n" -".L_clip_window:\n" -" movl %%eax, %%ecx\n" -" movl 48(%%esp), %%eax\n" /* eax = wsize */ -" negl %%ecx\n" /* nbytes = -nbytes */ -" movl 28(%%esp), %%esi\n" /* from = window */ - -" cmpl %%ebp, %%eax\n" -" jb .L_invalid_distance_too_far\n" /* if (dist > wsize) */ - -" addl %%ebp, %%ecx\n" /* nbytes = dist - nbytes */ -" cmpl $0, 52(%%esp)\n" -" jne .L_wrap_around_window\n" /* if (write != 0) */ - -" subl %%ecx, %%eax\n" -" addl %%eax, %%esi\n" /* from += wsize - nbytes */ - -" movl 64(%%esp), %%eax\n" /* eax = len */ -" cmpl %%ecx, %%eax\n" -" jbe .L_do_copy\n" /* if (nbytes >= len) */ - -" subl %%ecx, %%eax\n" /* len -= nbytes */ -" rep movsb\n" -" movl %%edi, %%esi\n" -" subl %%ebp, %%esi\n" /* from = out - dist */ -" jmp .L_do_copy\n" - -".align 32,0x90\n" -".L_wrap_around_window:\n" -" movl 52(%%esp), %%eax\n" /* eax = write */ -" cmpl %%eax, %%ecx\n" -" jbe .L_contiguous_in_window\n" /* if (write >= nbytes) */ - -" addl 48(%%esp), %%esi\n" /* from += wsize */ -" addl %%eax, %%esi\n" /* from += write */ -" subl %%ecx, %%esi\n" /* from -= nbytes */ -" subl %%eax, %%ecx\n" /* nbytes -= write */ - -" movl 64(%%esp), %%eax\n" /* eax = len */ -" cmpl %%ecx, %%eax\n" -" jbe .L_do_copy\n" /* if (nbytes >= len) */ - -" subl %%ecx, %%eax\n" /* len -= nbytes */ -" rep movsb\n" -" movl 28(%%esp), %%esi\n" /* from = window */ -" movl 52(%%esp), %%ecx\n" /* nbytes = write */ -" cmpl %%ecx, %%eax\n" -" jbe .L_do_copy\n" /* if (nbytes >= len) */ - -" subl %%ecx, %%eax\n" /* len -= nbytes */ -" rep movsb\n" -" movl %%edi, %%esi\n" -" subl %%ebp, %%esi\n" /* from = out - dist */ -" jmp .L_do_copy\n" - -".align 32,0x90\n" -".L_contiguous_in_window:\n" -" addl %%eax, %%esi\n" -" subl %%ecx, %%esi\n" /* from += write - nbytes */ - -" movl 64(%%esp), %%eax\n" /* eax = len */ -" cmpl %%ecx, %%eax\n" -" jbe .L_do_copy\n" /* if (nbytes >= len) */ - -" subl %%ecx, %%eax\n" /* len -= nbytes */ -" rep movsb\n" -" movl %%edi, %%esi\n" -" subl %%ebp, %%esi\n" /* from = out - dist */ -" jmp .L_do_copy\n" /* if (nbytes >= len) */ - -".align 32,0x90\n" -".L_do_copy:\n" -" movl %%eax, %%ecx\n" -" rep movsb\n" - -" movl 8(%%esp), %%esi\n" /* move in back to %esi, toss from */ -" movl 32(%%esp), %%ebp\n" /* ebp = lcode */ -" jmp .L_while_test\n" - -".L_test_for_end_of_block:\n" -" testb $32, %%al\n" -" jz .L_invalid_literal_length_code\n" -" movl $1, 72(%%esp)\n" -" jmp .L_break_loop_with_status\n" - -".L_invalid_literal_length_code:\n" -" movl $2, 72(%%esp)\n" -" jmp .L_break_loop_with_status\n" - -".L_invalid_distance_code:\n" -" movl $3, 72(%%esp)\n" -" jmp .L_break_loop_with_status\n" - -".L_invalid_distance_too_far:\n" -" movl 8(%%esp), %%esi\n" -" movl $4, 72(%%esp)\n" -" jmp .L_break_loop_with_status\n" - -".L_break_loop:\n" -" movl $0, 72(%%esp)\n" - -".L_break_loop_with_status:\n" -/* put in, out, bits, and hold back into ar and pop esp */ -" movl %%esi, 8(%%esp)\n" /* save in */ -" movl %%edi, 16(%%esp)\n" /* save out */ -" movl %%ebx, 44(%%esp)\n" /* save bits */ -" movl %%edx, 40(%%esp)\n" /* save hold */ -" movl 4(%%esp), %%ebp\n" /* restore esp, ebp */ -" movl (%%esp), %%esp\n" - : - : "m" (ar) - : "memory", "%eax", "%ebx", "%ecx", "%edx", "%esi", "%edi" - ); -#elif defined( _MSC_VER ) && ! defined( _M_AMD64 ) - __asm { - lea eax, ar - mov [eax], esp /* save esp, ebp */ - mov [eax+4], ebp - mov esp, eax - mov esi, [esp+8] /* esi = in */ - mov edi, [esp+16] /* edi = out */ - mov edx, [esp+40] /* edx = hold */ - mov ebx, [esp+44] /* ebx = bits */ - mov ebp, [esp+32] /* ebp = lcode */ - - cld - jmp L_do_loop - -ALIGN 4 -L_while_test: - cmp [esp+24], edi - jbe L_break_loop - cmp [esp+12], esi - jbe L_break_loop - -L_do_loop: - cmp bl, 15 - ja L_get_length_code /* if (15 < bits) */ - - xor eax, eax - lodsw /* al = *(ushort *)in++ */ - mov cl, bl /* cl = bits, needs it for shifting */ - add bl, 16 /* bits += 16 */ - shl eax, cl - or edx, eax /* hold |= *((ushort *)in)++ << bits */ - -L_get_length_code: - mov eax, [esp+56] /* eax = lmask */ - and eax, edx /* eax &= hold */ - mov eax, [ebp+eax*4] /* eax = lcode[hold & lmask] */ - -L_dolen: - mov cl, ah /* cl = this.bits */ - sub bl, ah /* bits -= this.bits */ - shr edx, cl /* hold >>= this.bits */ - - test al, al - jnz L_test_for_length_base /* if (op != 0) 45.7% */ - - shr eax, 16 /* output this.val char */ - stosb - jmp L_while_test - -ALIGN 4 -L_test_for_length_base: - mov ecx, eax /* len = this */ - shr ecx, 16 /* len = this.val */ - mov [esp+64], ecx /* save len */ - mov cl, al - - test al, 16 - jz L_test_for_second_level_length /* if ((op & 16) == 0) 8% */ - and cl, 15 /* op &= 15 */ - jz L_decode_distance /* if (!op) */ - cmp bl, cl - jae L_add_bits_to_len /* if (op <= bits) */ - - mov ch, cl /* stash op in ch, freeing cl */ - xor eax, eax - lodsw /* al = *(ushort *)in++ */ - mov cl, bl /* cl = bits, needs it for shifting */ - add bl, 16 /* bits += 16 */ - shl eax, cl - or edx, eax /* hold |= *((ushort *)in)++ << bits */ - mov cl, ch /* move op back to ecx */ - -L_add_bits_to_len: - sub bl, cl - xor eax, eax - inc eax - shl eax, cl - dec eax - and eax, edx /* eax &= hold */ - shr edx, cl - add [esp+64], eax /* len += hold & mask[op] */ - -L_decode_distance: - cmp bl, 15 - ja L_get_distance_code /* if (15 < bits) */ - - xor eax, eax - lodsw /* al = *(ushort *)in++ */ - mov cl, bl /* cl = bits, needs it for shifting */ - add bl, 16 /* bits += 16 */ - shl eax, cl - or edx, eax /* hold |= *((ushort *)in)++ << bits */ - -L_get_distance_code: - mov eax, [esp+60] /* eax = dmask */ - mov ecx, [esp+36] /* ecx = dcode */ - and eax, edx /* eax &= hold */ - mov eax, [ecx+eax*4]/* eax = dcode[hold & dmask] */ - -L_dodist: - mov ebp, eax /* dist = this */ - shr ebp, 16 /* dist = this.val */ - mov cl, ah - sub bl, ah /* bits -= this.bits */ - shr edx, cl /* hold >>= this.bits */ - mov cl, al /* cl = this.op */ - - test al, 16 /* if ((op & 16) == 0) */ - jz L_test_for_second_level_dist - and cl, 15 /* op &= 15 */ - jz L_check_dist_one - cmp bl, cl - jae L_add_bits_to_dist /* if (op <= bits) 97.6% */ - - mov ch, cl /* stash op in ch, freeing cl */ - xor eax, eax - lodsw /* al = *(ushort *)in++ */ - mov cl, bl /* cl = bits, needs it for shifting */ - add bl, 16 /* bits += 16 */ - shl eax, cl - or edx, eax /* hold |= *((ushort *)in)++ << bits */ - mov cl, ch /* move op back to ecx */ - -L_add_bits_to_dist: - sub bl, cl - xor eax, eax - inc eax - shl eax, cl - dec eax /* (1 << op) - 1 */ - and eax, edx /* eax &= hold */ - shr edx, cl - add ebp, eax /* dist += hold & ((1 << op) - 1) */ - -L_check_window: - mov [esp+8], esi /* save in so from can use it's reg */ - mov eax, edi - sub eax, [esp+20] /* nbytes = out - beg */ - - cmp eax, ebp - jb L_clip_window /* if (dist > nbytes) 4.2% */ - - mov ecx, [esp+64] /* ecx = len */ - mov esi, edi - sub esi, ebp /* from = out - dist */ - - sar ecx, 1 - jnc L_copy_two - - rep movsw - mov al, [esi] - mov [edi], al - inc edi - - mov esi, [esp+8] /* move in back to %esi, toss from */ - mov ebp, [esp+32] /* ebp = lcode */ - jmp L_while_test - -L_copy_two: - rep movsw - mov esi, [esp+8] /* move in back to %esi, toss from */ - mov ebp, [esp+32] /* ebp = lcode */ - jmp L_while_test - -ALIGN 4 -L_check_dist_one: - cmp ebp, 1 /* if dist 1, is a memset */ - jne L_check_window - cmp [esp+20], edi - je L_check_window /* out == beg, if outside window */ - - mov ecx, [esp+64] /* ecx = len */ - mov al, [edi-1] - mov ah, al - - sar ecx, 1 - jnc L_set_two - mov [edi], al /* memset out with from[-1] */ - inc edi - -L_set_two: - rep stosw - mov ebp, [esp+32] /* ebp = lcode */ - jmp L_while_test - -ALIGN 4 -L_test_for_second_level_length: - test al, 64 - jnz L_test_for_end_of_block /* if ((op & 64) != 0) */ - - xor eax, eax - inc eax - shl eax, cl - dec eax - and eax, edx /* eax &= hold */ - add eax, [esp+64] /* eax += len */ - mov eax, [ebp+eax*4] /* eax = lcode[val+(hold&mask[op])]*/ - jmp L_dolen - -ALIGN 4 -L_test_for_second_level_dist: - test al, 64 - jnz L_invalid_distance_code /* if ((op & 64) != 0) */ - - xor eax, eax - inc eax - shl eax, cl - dec eax - and eax, edx /* eax &= hold */ - add eax, ebp /* eax += dist */ - mov ecx, [esp+36] /* ecx = dcode */ - mov eax, [ecx+eax*4] /* eax = dcode[val+(hold&mask[op])]*/ - jmp L_dodist - -ALIGN 4 -L_clip_window: - mov ecx, eax - mov eax, [esp+48] /* eax = wsize */ - neg ecx /* nbytes = -nbytes */ - mov esi, [esp+28] /* from = window */ - - cmp eax, ebp - jb L_invalid_distance_too_far /* if (dist > wsize) */ - - add ecx, ebp /* nbytes = dist - nbytes */ - cmp dword ptr [esp+52], 0 - jne L_wrap_around_window /* if (write != 0) */ - - sub eax, ecx - add esi, eax /* from += wsize - nbytes */ - - mov eax, [esp+64] /* eax = len */ - cmp eax, ecx - jbe L_do_copy /* if (nbytes >= len) */ - - sub eax, ecx /* len -= nbytes */ - rep movsb - mov esi, edi - sub esi, ebp /* from = out - dist */ - jmp L_do_copy - -ALIGN 4 -L_wrap_around_window: - mov eax, [esp+52] /* eax = write */ - cmp ecx, eax - jbe L_contiguous_in_window /* if (write >= nbytes) */ - - add esi, [esp+48] /* from += wsize */ - add esi, eax /* from += write */ - sub esi, ecx /* from -= nbytes */ - sub ecx, eax /* nbytes -= write */ - - mov eax, [esp+64] /* eax = len */ - cmp eax, ecx - jbe L_do_copy /* if (nbytes >= len) */ - - sub eax, ecx /* len -= nbytes */ - rep movsb - mov esi, [esp+28] /* from = window */ - mov ecx, [esp+52] /* nbytes = write */ - cmp eax, ecx - jbe L_do_copy /* if (nbytes >= len) */ - - sub eax, ecx /* len -= nbytes */ - rep movsb - mov esi, edi - sub esi, ebp /* from = out - dist */ - jmp L_do_copy - -ALIGN 4 -L_contiguous_in_window: - add esi, eax - sub esi, ecx /* from += write - nbytes */ - - mov eax, [esp+64] /* eax = len */ - cmp eax, ecx - jbe L_do_copy /* if (nbytes >= len) */ - - sub eax, ecx /* len -= nbytes */ - rep movsb - mov esi, edi - sub esi, ebp /* from = out - dist */ - jmp L_do_copy - -ALIGN 4 -L_do_copy: - mov ecx, eax - rep movsb - - mov esi, [esp+8] /* move in back to %esi, toss from */ - mov ebp, [esp+32] /* ebp = lcode */ - jmp L_while_test - -L_test_for_end_of_block: - test al, 32 - jz L_invalid_literal_length_code - mov dword ptr [esp+72], 1 - jmp L_break_loop_with_status - -L_invalid_literal_length_code: - mov dword ptr [esp+72], 2 - jmp L_break_loop_with_status - -L_invalid_distance_code: - mov dword ptr [esp+72], 3 - jmp L_break_loop_with_status - -L_invalid_distance_too_far: - mov esi, [esp+4] - mov dword ptr [esp+72], 4 - jmp L_break_loop_with_status - -L_break_loop: - mov dword ptr [esp+72], 0 - -L_break_loop_with_status: -/* put in, out, bits, and hold back into ar and pop esp */ - mov [esp+8], esi /* save in */ - mov [esp+16], edi /* save out */ - mov [esp+44], ebx /* save bits */ - mov [esp+40], edx /* save hold */ - mov ebp, [esp+4] /* restore esp, ebp */ - mov esp, [esp] - } -#else -#error "x86 architecture not defined" -#endif - - if (ar.status > 1) { - if (ar.status == 2) - strm->msg = "invalid literal/length code"; - else if (ar.status == 3) - strm->msg = "invalid distance code"; - else - strm->msg = "invalid distance too far back"; - state->mode = BAD; - } - else if ( ar.status == 1 ) { - state->mode = TYPE; - } - - /* return unused bytes (on entry, bits < 8, so in won't go too far back) */ - ar.len = ar.bits >> 3; - ar.in -= ar.len; - ar.bits -= ar.len << 3; - ar.hold &= (1U << ar.bits) - 1; - - /* update state and return */ - strm->next_in = ar.in; - strm->next_out = ar.out; - strm->avail_in = (unsigned)(ar.in < ar.last ? - PAD_AVAIL_IN + (ar.last - ar.in) : - PAD_AVAIL_IN - (ar.in - ar.last)); - strm->avail_out = (unsigned)(ar.out < ar.end ? - PAD_AVAIL_OUT + (ar.end - ar.out) : - PAD_AVAIL_OUT - (ar.out - ar.end)); - state->hold = ar.hold; - state->bits = ar.bits; - return; -} - diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/contrib/inflate86/inffast.S mame-0.243+dfsg.1/3rdparty/zlib/contrib/inflate86/inffast.S --- mame-0.242+dfsg.1/3rdparty/zlib/contrib/inflate86/inffast.S 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/contrib/inflate86/inffast.S 1970-01-01 00:00:00.000000000 +0000 @@ -1,1368 +0,0 @@ -/* - * inffast.S is a hand tuned assembler version of: - * - * inffast.c -- fast decoding - * Copyright (C) 1995-2003 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - * - * Copyright (C) 2003 Chris Anderson - * Please use the copyright conditions above. - * - * This version (Jan-23-2003) of inflate_fast was coded and tested under - * GNU/Linux on a pentium 3, using the gcc-3.2 compiler distribution. On that - * machine, I found that gzip style archives decompressed about 20% faster than - * the gcc-3.2 -O3 -fomit-frame-pointer compiled version. Your results will - * depend on how large of a buffer is used for z_stream.next_in & next_out - * (8K-32K worked best for my 256K cpu cache) and how much overhead there is in - * stream processing I/O and crc32/addler32. In my case, this routine used - * 70% of the cpu time and crc32 used 20%. - * - * I am confident that this version will work in the general case, but I have - * not tested a wide variety of datasets or a wide variety of platforms. - * - * Jan-24-2003 -- Added -DUSE_MMX define for slightly faster inflating. - * It should be a runtime flag instead of compile time flag... - * - * Jan-26-2003 -- Added runtime check for MMX support with cpuid instruction. - * With -DUSE_MMX, only MMX code is compiled. With -DNO_MMX, only non-MMX code - * is compiled. Without either option, runtime detection is enabled. Runtime - * detection should work on all modern cpus and the recomended algorithm (flip - * ID bit on eflags and then use the cpuid instruction) is used in many - * multimedia applications. Tested under win2k with gcc-2.95 and gas-2.12 - * distributed with cygwin3. Compiling with gcc-2.95 -c inffast.S -o - * inffast.obj generates a COFF object which can then be linked with MSVC++ - * compiled code. Tested under FreeBSD 4.7 with gcc-2.95. - * - * Jan-28-2003 -- Tested Athlon XP... MMX mode is slower than no MMX (and - * slower than compiler generated code). Adjusted cpuid check to use the MMX - * code only for Pentiums < P4 until I have more data on the P4. Speed - * improvment is only about 15% on the Athlon when compared with code generated - * with MSVC++. Not sure yet, but I think the P4 will also be slower using the - * MMX mode because many of it's x86 ALU instructions execute in .5 cycles and - * have less latency than MMX ops. Added code to buffer the last 11 bytes of - * the input stream since the MMX code grabs bits in chunks of 32, which - * differs from the inffast.c algorithm. I don't think there would have been - * read overruns where a page boundary was crossed (a segfault), but there - * could have been overruns when next_in ends on unaligned memory (unintialized - * memory read). - * - * Mar-13-2003 -- P4 MMX is slightly slower than P4 NO_MMX. I created a C - * version of the non-MMX code so that it doesn't depend on zstrm and zstate - * structure offsets which are hard coded in this file. This was last tested - * with zlib-1.2.0 which is currently in beta testing, newer versions of this - * and inffas86.c can be found at http://www.eetbeetee.com/zlib/ and - * http://www.charm.net/~christop/zlib/ - */ - - -/* - * if you have underscore linking problems (_inflate_fast undefined), try - * using -DGAS_COFF - */ -#if ! defined( GAS_COFF ) && ! defined( GAS_ELF ) - -#if defined( WIN32 ) || defined( __CYGWIN__ ) -#define GAS_COFF /* windows object format */ -#else -#define GAS_ELF -#endif - -#endif /* ! GAS_COFF && ! GAS_ELF */ - - -#if defined( GAS_COFF ) - -/* coff externals have underscores */ -#define inflate_fast _inflate_fast -#define inflate_fast_use_mmx _inflate_fast_use_mmx - -#endif /* GAS_COFF */ - - -.file "inffast.S" - -.globl inflate_fast - -.text -.align 4,0 -.L_invalid_literal_length_code_msg: -.string "invalid literal/length code" - -.align 4,0 -.L_invalid_distance_code_msg: -.string "invalid distance code" - -.align 4,0 -.L_invalid_distance_too_far_msg: -.string "invalid distance too far back" - -#if ! defined( NO_MMX ) -.align 4,0 -.L_mask: /* mask[N] = ( 1 << N ) - 1 */ -.long 0 -.long 1 -.long 3 -.long 7 -.long 15 -.long 31 -.long 63 -.long 127 -.long 255 -.long 511 -.long 1023 -.long 2047 -.long 4095 -.long 8191 -.long 16383 -.long 32767 -.long 65535 -.long 131071 -.long 262143 -.long 524287 -.long 1048575 -.long 2097151 -.long 4194303 -.long 8388607 -.long 16777215 -.long 33554431 -.long 67108863 -.long 134217727 -.long 268435455 -.long 536870911 -.long 1073741823 -.long 2147483647 -.long 4294967295 -#endif /* NO_MMX */ - -.text - -/* - * struct z_stream offsets, in zlib.h - */ -#define next_in_strm 0 /* strm->next_in */ -#define avail_in_strm 4 /* strm->avail_in */ -#define next_out_strm 12 /* strm->next_out */ -#define avail_out_strm 16 /* strm->avail_out */ -#define msg_strm 24 /* strm->msg */ -#define state_strm 28 /* strm->state */ - -/* - * struct inflate_state offsets, in inflate.h - */ -#define mode_state 0 /* state->mode */ -#define wsize_state 32 /* state->wsize */ -#define write_state 40 /* state->write */ -#define window_state 44 /* state->window */ -#define hold_state 48 /* state->hold */ -#define bits_state 52 /* state->bits */ -#define lencode_state 68 /* state->lencode */ -#define distcode_state 72 /* state->distcode */ -#define lenbits_state 76 /* state->lenbits */ -#define distbits_state 80 /* state->distbits */ - -/* - * inflate_fast's activation record - */ -#define local_var_size 64 /* how much local space for vars */ -#define strm_sp 88 /* first arg: z_stream * (local_var_size + 24) */ -#define start_sp 92 /* second arg: unsigned int (local_var_size + 28) */ - -/* - * offsets for local vars on stack - */ -#define out 60 /* unsigned char* */ -#define window 56 /* unsigned char* */ -#define wsize 52 /* unsigned int */ -#define write 48 /* unsigned int */ -#define in 44 /* unsigned char* */ -#define beg 40 /* unsigned char* */ -#define buf 28 /* char[ 12 ] */ -#define len 24 /* unsigned int */ -#define last 20 /* unsigned char* */ -#define end 16 /* unsigned char* */ -#define dcode 12 /* code* */ -#define lcode 8 /* code* */ -#define dmask 4 /* unsigned int */ -#define lmask 0 /* unsigned int */ - -/* - * typedef enum inflate_mode consts, in inflate.h - */ -#define INFLATE_MODE_TYPE 11 /* state->mode flags enum-ed in inflate.h */ -#define INFLATE_MODE_BAD 26 - - -#if ! defined( USE_MMX ) && ! defined( NO_MMX ) - -#define RUN_TIME_MMX - -#define CHECK_MMX 1 -#define DO_USE_MMX 2 -#define DONT_USE_MMX 3 - -.globl inflate_fast_use_mmx - -.data - -.align 4,0 -inflate_fast_use_mmx: /* integer flag for run time control 1=check,2=mmx,3=no */ -.long CHECK_MMX - -#if defined( GAS_ELF ) -/* elf info */ -.type inflate_fast_use_mmx,@object -.size inflate_fast_use_mmx,4 -#endif - -#endif /* RUN_TIME_MMX */ - -#if defined( GAS_COFF ) -/* coff info: scl 2 = extern, type 32 = function */ -.def inflate_fast; .scl 2; .type 32; .endef -#endif - -.text - -.align 32,0x90 -inflate_fast: - pushl %edi - pushl %esi - pushl %ebp - pushl %ebx - pushf /* save eflags (strm_sp, state_sp assumes this is 32 bits) */ - subl $local_var_size, %esp - cld - -#define strm_r %esi -#define state_r %edi - - movl strm_sp(%esp), strm_r - movl state_strm(strm_r), state_r - - /* in = strm->next_in; - * out = strm->next_out; - * last = in + strm->avail_in - 11; - * beg = out - (start - strm->avail_out); - * end = out + (strm->avail_out - 257); - */ - movl avail_in_strm(strm_r), %edx - movl next_in_strm(strm_r), %eax - - addl %eax, %edx /* avail_in += next_in */ - subl $11, %edx /* avail_in -= 11 */ - - movl %eax, in(%esp) - movl %edx, last(%esp) - - movl start_sp(%esp), %ebp - movl avail_out_strm(strm_r), %ecx - movl next_out_strm(strm_r), %ebx - - subl %ecx, %ebp /* start -= avail_out */ - negl %ebp /* start = -start */ - addl %ebx, %ebp /* start += next_out */ - - subl $257, %ecx /* avail_out -= 257 */ - addl %ebx, %ecx /* avail_out += out */ - - movl %ebx, out(%esp) - movl %ebp, beg(%esp) - movl %ecx, end(%esp) - - /* wsize = state->wsize; - * write = state->write; - * window = state->window; - * hold = state->hold; - * bits = state->bits; - * lcode = state->lencode; - * dcode = state->distcode; - * lmask = ( 1 << state->lenbits ) - 1; - * dmask = ( 1 << state->distbits ) - 1; - */ - - movl lencode_state(state_r), %eax - movl distcode_state(state_r), %ecx - - movl %eax, lcode(%esp) - movl %ecx, dcode(%esp) - - movl $1, %eax - movl lenbits_state(state_r), %ecx - shll %cl, %eax - decl %eax - movl %eax, lmask(%esp) - - movl $1, %eax - movl distbits_state(state_r), %ecx - shll %cl, %eax - decl %eax - movl %eax, dmask(%esp) - - movl wsize_state(state_r), %eax - movl write_state(state_r), %ecx - movl window_state(state_r), %edx - - movl %eax, wsize(%esp) - movl %ecx, write(%esp) - movl %edx, window(%esp) - - movl hold_state(state_r), %ebp - movl bits_state(state_r), %ebx - -#undef strm_r -#undef state_r - -#define in_r %esi -#define from_r %esi -#define out_r %edi - - movl in(%esp), in_r - movl last(%esp), %ecx - cmpl in_r, %ecx - ja .L_align_long /* if in < last */ - - addl $11, %ecx /* ecx = &in[ avail_in ] */ - subl in_r, %ecx /* ecx = avail_in */ - movl $12, %eax - subl %ecx, %eax /* eax = 12 - avail_in */ - leal buf(%esp), %edi - rep movsb /* memcpy( buf, in, avail_in ) */ - movl %eax, %ecx - xorl %eax, %eax - rep stosb /* memset( &buf[ avail_in ], 0, 12 - avail_in ) */ - leal buf(%esp), in_r /* in = buf */ - movl in_r, last(%esp) /* last = in, do just one iteration */ - jmp .L_is_aligned - - /* align in_r on long boundary */ -.L_align_long: - testl $3, in_r - jz .L_is_aligned - xorl %eax, %eax - movb (in_r), %al - incl in_r - movl %ebx, %ecx - addl $8, %ebx - shll %cl, %eax - orl %eax, %ebp - jmp .L_align_long - -.L_is_aligned: - movl out(%esp), out_r - -#if defined( NO_MMX ) - jmp .L_do_loop -#endif - -#if defined( USE_MMX ) - jmp .L_init_mmx -#endif - -/*** Runtime MMX check ***/ - -#if defined( RUN_TIME_MMX ) -.L_check_mmx: - cmpl $DO_USE_MMX, inflate_fast_use_mmx - je .L_init_mmx - ja .L_do_loop /* > 2 */ - - pushl %eax - pushl %ebx - pushl %ecx - pushl %edx - pushf - movl (%esp), %eax /* copy eflags to eax */ - xorl $0x200000, (%esp) /* try toggling ID bit of eflags (bit 21) - * to see if cpu supports cpuid... - * ID bit method not supported by NexGen but - * bios may load a cpuid instruction and - * cpuid may be disabled on Cyrix 5-6x86 */ - popf - pushf - popl %edx /* copy new eflags to edx */ - xorl %eax, %edx /* test if ID bit is flipped */ - jz .L_dont_use_mmx /* not flipped if zero */ - xorl %eax, %eax - cpuid - cmpl $0x756e6547, %ebx /* check for GenuineIntel in ebx,ecx,edx */ - jne .L_dont_use_mmx - cmpl $0x6c65746e, %ecx - jne .L_dont_use_mmx - cmpl $0x49656e69, %edx - jne .L_dont_use_mmx - movl $1, %eax - cpuid /* get cpu features */ - shrl $8, %eax - andl $15, %eax - cmpl $6, %eax /* check for Pentium family, is 0xf for P4 */ - jne .L_dont_use_mmx - testl $0x800000, %edx /* test if MMX feature is set (bit 23) */ - jnz .L_use_mmx - jmp .L_dont_use_mmx -.L_use_mmx: - movl $DO_USE_MMX, inflate_fast_use_mmx - jmp .L_check_mmx_pop -.L_dont_use_mmx: - movl $DONT_USE_MMX, inflate_fast_use_mmx -.L_check_mmx_pop: - popl %edx - popl %ecx - popl %ebx - popl %eax - jmp .L_check_mmx -#endif - - -/*** Non-MMX code ***/ - -#if defined ( NO_MMX ) || defined( RUN_TIME_MMX ) - -#define hold_r %ebp -#define bits_r %bl -#define bitslong_r %ebx - -.align 32,0x90 -.L_while_test: - /* while (in < last && out < end) - */ - cmpl out_r, end(%esp) - jbe .L_break_loop /* if (out >= end) */ - - cmpl in_r, last(%esp) - jbe .L_break_loop - -.L_do_loop: - /* regs: %esi = in, %ebp = hold, %bl = bits, %edi = out - * - * do { - * if (bits < 15) { - * hold |= *((unsigned short *)in)++ << bits; - * bits += 16 - * } - * this = lcode[hold & lmask] - */ - cmpb $15, bits_r - ja .L_get_length_code /* if (15 < bits) */ - - xorl %eax, %eax - lodsw /* al = *(ushort *)in++ */ - movb bits_r, %cl /* cl = bits, needs it for shifting */ - addb $16, bits_r /* bits += 16 */ - shll %cl, %eax - orl %eax, hold_r /* hold |= *((ushort *)in)++ << bits */ - -.L_get_length_code: - movl lmask(%esp), %edx /* edx = lmask */ - movl lcode(%esp), %ecx /* ecx = lcode */ - andl hold_r, %edx /* edx &= hold */ - movl (%ecx,%edx,4), %eax /* eax = lcode[hold & lmask] */ - -.L_dolen: - /* regs: %esi = in, %ebp = hold, %bl = bits, %edi = out - * - * dolen: - * bits -= this.bits; - * hold >>= this.bits - */ - movb %ah, %cl /* cl = this.bits */ - subb %ah, bits_r /* bits -= this.bits */ - shrl %cl, hold_r /* hold >>= this.bits */ - - /* check if op is a literal - * if (op == 0) { - * PUP(out) = this.val; - * } - */ - testb %al, %al - jnz .L_test_for_length_base /* if (op != 0) 45.7% */ - - shrl $16, %eax /* output this.val char */ - stosb - jmp .L_while_test - -.L_test_for_length_base: - /* regs: %esi = in, %ebp = hold, %bl = bits, %edi = out, %edx = len - * - * else if (op & 16) { - * len = this.val - * op &= 15 - * if (op) { - * if (op > bits) { - * hold |= *((unsigned short *)in)++ << bits; - * bits += 16 - * } - * len += hold & mask[op]; - * bits -= op; - * hold >>= op; - * } - */ -#define len_r %edx - movl %eax, len_r /* len = this */ - shrl $16, len_r /* len = this.val */ - movb %al, %cl - - testb $16, %al - jz .L_test_for_second_level_length /* if ((op & 16) == 0) 8% */ - andb $15, %cl /* op &= 15 */ - jz .L_save_len /* if (!op) */ - cmpb %cl, bits_r - jae .L_add_bits_to_len /* if (op <= bits) */ - - movb %cl, %ch /* stash op in ch, freeing cl */ - xorl %eax, %eax - lodsw /* al = *(ushort *)in++ */ - movb bits_r, %cl /* cl = bits, needs it for shifting */ - addb $16, bits_r /* bits += 16 */ - shll %cl, %eax - orl %eax, hold_r /* hold |= *((ushort *)in)++ << bits */ - movb %ch, %cl /* move op back to ecx */ - -.L_add_bits_to_len: - movl $1, %eax - shll %cl, %eax - decl %eax - subb %cl, bits_r - andl hold_r, %eax /* eax &= hold */ - shrl %cl, hold_r - addl %eax, len_r /* len += hold & mask[op] */ - -.L_save_len: - movl len_r, len(%esp) /* save len */ -#undef len_r - -.L_decode_distance: - /* regs: %esi = in, %ebp = hold, %bl = bits, %edi = out, %edx = dist - * - * if (bits < 15) { - * hold |= *((unsigned short *)in)++ << bits; - * bits += 16 - * } - * this = dcode[hold & dmask]; - * dodist: - * bits -= this.bits; - * hold >>= this.bits; - * op = this.op; - */ - - cmpb $15, bits_r - ja .L_get_distance_code /* if (15 < bits) */ - - xorl %eax, %eax - lodsw /* al = *(ushort *)in++ */ - movb bits_r, %cl /* cl = bits, needs it for shifting */ - addb $16, bits_r /* bits += 16 */ - shll %cl, %eax - orl %eax, hold_r /* hold |= *((ushort *)in)++ << bits */ - -.L_get_distance_code: - movl dmask(%esp), %edx /* edx = dmask */ - movl dcode(%esp), %ecx /* ecx = dcode */ - andl hold_r, %edx /* edx &= hold */ - movl (%ecx,%edx,4), %eax /* eax = dcode[hold & dmask] */ - -#define dist_r %edx -.L_dodist: - movl %eax, dist_r /* dist = this */ - shrl $16, dist_r /* dist = this.val */ - movb %ah, %cl - subb %ah, bits_r /* bits -= this.bits */ - shrl %cl, hold_r /* hold >>= this.bits */ - - /* if (op & 16) { - * dist = this.val - * op &= 15 - * if (op > bits) { - * hold |= *((unsigned short *)in)++ << bits; - * bits += 16 - * } - * dist += hold & mask[op]; - * bits -= op; - * hold >>= op; - */ - movb %al, %cl /* cl = this.op */ - - testb $16, %al /* if ((op & 16) == 0) */ - jz .L_test_for_second_level_dist - andb $15, %cl /* op &= 15 */ - jz .L_check_dist_one - cmpb %cl, bits_r - jae .L_add_bits_to_dist /* if (op <= bits) 97.6% */ - - movb %cl, %ch /* stash op in ch, freeing cl */ - xorl %eax, %eax - lodsw /* al = *(ushort *)in++ */ - movb bits_r, %cl /* cl = bits, needs it for shifting */ - addb $16, bits_r /* bits += 16 */ - shll %cl, %eax - orl %eax, hold_r /* hold |= *((ushort *)in)++ << bits */ - movb %ch, %cl /* move op back to ecx */ - -.L_add_bits_to_dist: - movl $1, %eax - shll %cl, %eax - decl %eax /* (1 << op) - 1 */ - subb %cl, bits_r - andl hold_r, %eax /* eax &= hold */ - shrl %cl, hold_r - addl %eax, dist_r /* dist += hold & ((1 << op) - 1) */ - jmp .L_check_window - -.L_check_window: - /* regs: %esi = from, %ebp = hold, %bl = bits, %edi = out, %edx = dist - * %ecx = nbytes - * - * nbytes = out - beg; - * if (dist <= nbytes) { - * from = out - dist; - * do { - * PUP(out) = PUP(from); - * } while (--len > 0) { - * } - */ - - movl in_r, in(%esp) /* save in so from can use it's reg */ - movl out_r, %eax - subl beg(%esp), %eax /* nbytes = out - beg */ - - cmpl dist_r, %eax - jb .L_clip_window /* if (dist > nbytes) 4.2% */ - - movl len(%esp), %ecx - movl out_r, from_r - subl dist_r, from_r /* from = out - dist */ - - subl $3, %ecx - movb (from_r), %al - movb %al, (out_r) - movb 1(from_r), %al - movb 2(from_r), %dl - addl $3, from_r - movb %al, 1(out_r) - movb %dl, 2(out_r) - addl $3, out_r - rep movsb - - movl in(%esp), in_r /* move in back to %esi, toss from */ - jmp .L_while_test - -.align 16,0x90 -.L_check_dist_one: - cmpl $1, dist_r - jne .L_check_window - cmpl out_r, beg(%esp) - je .L_check_window - - decl out_r - movl len(%esp), %ecx - movb (out_r), %al - subl $3, %ecx - - movb %al, 1(out_r) - movb %al, 2(out_r) - movb %al, 3(out_r) - addl $4, out_r - rep stosb - - jmp .L_while_test - -.align 16,0x90 -.L_test_for_second_level_length: - /* else if ((op & 64) == 0) { - * this = lcode[this.val + (hold & mask[op])]; - * } - */ - testb $64, %al - jnz .L_test_for_end_of_block /* if ((op & 64) != 0) */ - - movl $1, %eax - shll %cl, %eax - decl %eax - andl hold_r, %eax /* eax &= hold */ - addl %edx, %eax /* eax += this.val */ - movl lcode(%esp), %edx /* edx = lcode */ - movl (%edx,%eax,4), %eax /* eax = lcode[val + (hold&mask[op])] */ - jmp .L_dolen - -.align 16,0x90 -.L_test_for_second_level_dist: - /* else if ((op & 64) == 0) { - * this = dcode[this.val + (hold & mask[op])]; - * } - */ - testb $64, %al - jnz .L_invalid_distance_code /* if ((op & 64) != 0) */ - - movl $1, %eax - shll %cl, %eax - decl %eax - andl hold_r, %eax /* eax &= hold */ - addl %edx, %eax /* eax += this.val */ - movl dcode(%esp), %edx /* edx = dcode */ - movl (%edx,%eax,4), %eax /* eax = dcode[val + (hold&mask[op])] */ - jmp .L_dodist - -.align 16,0x90 -.L_clip_window: - /* regs: %esi = from, %ebp = hold, %bl = bits, %edi = out, %edx = dist - * %ecx = nbytes - * - * else { - * if (dist > wsize) { - * invalid distance - * } - * from = window; - * nbytes = dist - nbytes; - * if (write == 0) { - * from += wsize - nbytes; - */ -#define nbytes_r %ecx - movl %eax, nbytes_r - movl wsize(%esp), %eax /* prepare for dist compare */ - negl nbytes_r /* nbytes = -nbytes */ - movl window(%esp), from_r /* from = window */ - - cmpl dist_r, %eax - jb .L_invalid_distance_too_far /* if (dist > wsize) */ - - addl dist_r, nbytes_r /* nbytes = dist - nbytes */ - cmpl $0, write(%esp) - jne .L_wrap_around_window /* if (write != 0) */ - - subl nbytes_r, %eax - addl %eax, from_r /* from += wsize - nbytes */ - - /* regs: %esi = from, %ebp = hold, %bl = bits, %edi = out, %edx = dist - * %ecx = nbytes, %eax = len - * - * if (nbytes < len) { - * len -= nbytes; - * do { - * PUP(out) = PUP(from); - * } while (--nbytes); - * from = out - dist; - * } - * } - */ -#define len_r %eax - movl len(%esp), len_r - cmpl nbytes_r, len_r - jbe .L_do_copy1 /* if (nbytes >= len) */ - - subl nbytes_r, len_r /* len -= nbytes */ - rep movsb - movl out_r, from_r - subl dist_r, from_r /* from = out - dist */ - jmp .L_do_copy1 - - cmpl nbytes_r, len_r - jbe .L_do_copy1 /* if (nbytes >= len) */ - - subl nbytes_r, len_r /* len -= nbytes */ - rep movsb - movl out_r, from_r - subl dist_r, from_r /* from = out - dist */ - jmp .L_do_copy1 - -.L_wrap_around_window: - /* regs: %esi = from, %ebp = hold, %bl = bits, %edi = out, %edx = dist - * %ecx = nbytes, %eax = write, %eax = len - * - * else if (write < nbytes) { - * from += wsize + write - nbytes; - * nbytes -= write; - * if (nbytes < len) { - * len -= nbytes; - * do { - * PUP(out) = PUP(from); - * } while (--nbytes); - * from = window; - * nbytes = write; - * if (nbytes < len) { - * len -= nbytes; - * do { - * PUP(out) = PUP(from); - * } while(--nbytes); - * from = out - dist; - * } - * } - * } - */ -#define write_r %eax - movl write(%esp), write_r - cmpl write_r, nbytes_r - jbe .L_contiguous_in_window /* if (write >= nbytes) */ - - addl wsize(%esp), from_r - addl write_r, from_r - subl nbytes_r, from_r /* from += wsize + write - nbytes */ - subl write_r, nbytes_r /* nbytes -= write */ -#undef write_r - - movl len(%esp), len_r - cmpl nbytes_r, len_r - jbe .L_do_copy1 /* if (nbytes >= len) */ - - subl nbytes_r, len_r /* len -= nbytes */ - rep movsb - movl window(%esp), from_r /* from = window */ - movl write(%esp), nbytes_r /* nbytes = write */ - cmpl nbytes_r, len_r - jbe .L_do_copy1 /* if (nbytes >= len) */ - - subl nbytes_r, len_r /* len -= nbytes */ - rep movsb - movl out_r, from_r - subl dist_r, from_r /* from = out - dist */ - jmp .L_do_copy1 - -.L_contiguous_in_window: - /* regs: %esi = from, %ebp = hold, %bl = bits, %edi = out, %edx = dist - * %ecx = nbytes, %eax = write, %eax = len - * - * else { - * from += write - nbytes; - * if (nbytes < len) { - * len -= nbytes; - * do { - * PUP(out) = PUP(from); - * } while (--nbytes); - * from = out - dist; - * } - * } - */ -#define write_r %eax - addl write_r, from_r - subl nbytes_r, from_r /* from += write - nbytes */ -#undef write_r - - movl len(%esp), len_r - cmpl nbytes_r, len_r - jbe .L_do_copy1 /* if (nbytes >= len) */ - - subl nbytes_r, len_r /* len -= nbytes */ - rep movsb - movl out_r, from_r - subl dist_r, from_r /* from = out - dist */ - -.L_do_copy1: - /* regs: %esi = from, %esi = in, %ebp = hold, %bl = bits, %edi = out - * %eax = len - * - * while (len > 0) { - * PUP(out) = PUP(from); - * len--; - * } - * } - * } while (in < last && out < end); - */ -#undef nbytes_r -#define in_r %esi - movl len_r, %ecx - rep movsb - - movl in(%esp), in_r /* move in back to %esi, toss from */ - jmp .L_while_test - -#undef len_r -#undef dist_r - -#endif /* NO_MMX || RUN_TIME_MMX */ - - -/*** MMX code ***/ - -#if defined( USE_MMX ) || defined( RUN_TIME_MMX ) - -.align 32,0x90 -.L_init_mmx: - emms - -#undef bits_r -#undef bitslong_r -#define bitslong_r %ebp -#define hold_mm %mm0 - movd %ebp, hold_mm - movl %ebx, bitslong_r - -#define used_mm %mm1 -#define dmask2_mm %mm2 -#define lmask2_mm %mm3 -#define lmask_mm %mm4 -#define dmask_mm %mm5 -#define tmp_mm %mm6 - - movd lmask(%esp), lmask_mm - movq lmask_mm, lmask2_mm - movd dmask(%esp), dmask_mm - movq dmask_mm, dmask2_mm - pxor used_mm, used_mm - movl lcode(%esp), %ebx /* ebx = lcode */ - jmp .L_do_loop_mmx - -.align 32,0x90 -.L_while_test_mmx: - /* while (in < last && out < end) - */ - cmpl out_r, end(%esp) - jbe .L_break_loop /* if (out >= end) */ - - cmpl in_r, last(%esp) - jbe .L_break_loop - -.L_do_loop_mmx: - psrlq used_mm, hold_mm /* hold_mm >>= last bit length */ - - cmpl $32, bitslong_r - ja .L_get_length_code_mmx /* if (32 < bits) */ - - movd bitslong_r, tmp_mm - movd (in_r), %mm7 - addl $4, in_r - psllq tmp_mm, %mm7 - addl $32, bitslong_r - por %mm7, hold_mm /* hold_mm |= *((uint *)in)++ << bits */ - -.L_get_length_code_mmx: - pand hold_mm, lmask_mm - movd lmask_mm, %eax - movq lmask2_mm, lmask_mm - movl (%ebx,%eax,4), %eax /* eax = lcode[hold & lmask] */ - -.L_dolen_mmx: - movzbl %ah, %ecx /* ecx = this.bits */ - movd %ecx, used_mm - subl %ecx, bitslong_r /* bits -= this.bits */ - - testb %al, %al - jnz .L_test_for_length_base_mmx /* if (op != 0) 45.7% */ - - shrl $16, %eax /* output this.val char */ - stosb - jmp .L_while_test_mmx - -.L_test_for_length_base_mmx: -#define len_r %edx - movl %eax, len_r /* len = this */ - shrl $16, len_r /* len = this.val */ - - testb $16, %al - jz .L_test_for_second_level_length_mmx /* if ((op & 16) == 0) 8% */ - andl $15, %eax /* op &= 15 */ - jz .L_decode_distance_mmx /* if (!op) */ - - psrlq used_mm, hold_mm /* hold_mm >>= last bit length */ - movd %eax, used_mm - movd hold_mm, %ecx - subl %eax, bitslong_r - andl .L_mask(,%eax,4), %ecx - addl %ecx, len_r /* len += hold & mask[op] */ - -.L_decode_distance_mmx: - psrlq used_mm, hold_mm /* hold_mm >>= last bit length */ - - cmpl $32, bitslong_r - ja .L_get_dist_code_mmx /* if (32 < bits) */ - - movd bitslong_r, tmp_mm - movd (in_r), %mm7 - addl $4, in_r - psllq tmp_mm, %mm7 - addl $32, bitslong_r - por %mm7, hold_mm /* hold_mm |= *((uint *)in)++ << bits */ - -.L_get_dist_code_mmx: - movl dcode(%esp), %ebx /* ebx = dcode */ - pand hold_mm, dmask_mm - movd dmask_mm, %eax - movq dmask2_mm, dmask_mm - movl (%ebx,%eax,4), %eax /* eax = dcode[hold & lmask] */ - -.L_dodist_mmx: -#define dist_r %ebx - movzbl %ah, %ecx /* ecx = this.bits */ - movl %eax, dist_r - shrl $16, dist_r /* dist = this.val */ - subl %ecx, bitslong_r /* bits -= this.bits */ - movd %ecx, used_mm - - testb $16, %al /* if ((op & 16) == 0) */ - jz .L_test_for_second_level_dist_mmx - andl $15, %eax /* op &= 15 */ - jz .L_check_dist_one_mmx - -.L_add_bits_to_dist_mmx: - psrlq used_mm, hold_mm /* hold_mm >>= last bit length */ - movd %eax, used_mm /* save bit length of current op */ - movd hold_mm, %ecx /* get the next bits on input stream */ - subl %eax, bitslong_r /* bits -= op bits */ - andl .L_mask(,%eax,4), %ecx /* ecx = hold & mask[op] */ - addl %ecx, dist_r /* dist += hold & mask[op] */ - -.L_check_window_mmx: - movl in_r, in(%esp) /* save in so from can use it's reg */ - movl out_r, %eax - subl beg(%esp), %eax /* nbytes = out - beg */ - - cmpl dist_r, %eax - jb .L_clip_window_mmx /* if (dist > nbytes) 4.2% */ - - movl len_r, %ecx - movl out_r, from_r - subl dist_r, from_r /* from = out - dist */ - - subl $3, %ecx - movb (from_r), %al - movb %al, (out_r) - movb 1(from_r), %al - movb 2(from_r), %dl - addl $3, from_r - movb %al, 1(out_r) - movb %dl, 2(out_r) - addl $3, out_r - rep movsb - - movl in(%esp), in_r /* move in back to %esi, toss from */ - movl lcode(%esp), %ebx /* move lcode back to %ebx, toss dist */ - jmp .L_while_test_mmx - -.align 16,0x90 -.L_check_dist_one_mmx: - cmpl $1, dist_r - jne .L_check_window_mmx - cmpl out_r, beg(%esp) - je .L_check_window_mmx - - decl out_r - movl len_r, %ecx - movb (out_r), %al - subl $3, %ecx - - movb %al, 1(out_r) - movb %al, 2(out_r) - movb %al, 3(out_r) - addl $4, out_r - rep stosb - - movl lcode(%esp), %ebx /* move lcode back to %ebx, toss dist */ - jmp .L_while_test_mmx - -.align 16,0x90 -.L_test_for_second_level_length_mmx: - testb $64, %al - jnz .L_test_for_end_of_block /* if ((op & 64) != 0) */ - - andl $15, %eax - psrlq used_mm, hold_mm /* hold_mm >>= last bit length */ - movd hold_mm, %ecx - andl .L_mask(,%eax,4), %ecx - addl len_r, %ecx - movl (%ebx,%ecx,4), %eax /* eax = lcode[hold & lmask] */ - jmp .L_dolen_mmx - -.align 16,0x90 -.L_test_for_second_level_dist_mmx: - testb $64, %al - jnz .L_invalid_distance_code /* if ((op & 64) != 0) */ - - andl $15, %eax - psrlq used_mm, hold_mm /* hold_mm >>= last bit length */ - movd hold_mm, %ecx - andl .L_mask(,%eax,4), %ecx - movl dcode(%esp), %eax /* ecx = dcode */ - addl dist_r, %ecx - movl (%eax,%ecx,4), %eax /* eax = lcode[hold & lmask] */ - jmp .L_dodist_mmx - -.align 16,0x90 -.L_clip_window_mmx: -#define nbytes_r %ecx - movl %eax, nbytes_r - movl wsize(%esp), %eax /* prepare for dist compare */ - negl nbytes_r /* nbytes = -nbytes */ - movl window(%esp), from_r /* from = window */ - - cmpl dist_r, %eax - jb .L_invalid_distance_too_far /* if (dist > wsize) */ - - addl dist_r, nbytes_r /* nbytes = dist - nbytes */ - cmpl $0, write(%esp) - jne .L_wrap_around_window_mmx /* if (write != 0) */ - - subl nbytes_r, %eax - addl %eax, from_r /* from += wsize - nbytes */ - - cmpl nbytes_r, len_r - jbe .L_do_copy1_mmx /* if (nbytes >= len) */ - - subl nbytes_r, len_r /* len -= nbytes */ - rep movsb - movl out_r, from_r - subl dist_r, from_r /* from = out - dist */ - jmp .L_do_copy1_mmx - - cmpl nbytes_r, len_r - jbe .L_do_copy1_mmx /* if (nbytes >= len) */ - - subl nbytes_r, len_r /* len -= nbytes */ - rep movsb - movl out_r, from_r - subl dist_r, from_r /* from = out - dist */ - jmp .L_do_copy1_mmx - -.L_wrap_around_window_mmx: -#define write_r %eax - movl write(%esp), write_r - cmpl write_r, nbytes_r - jbe .L_contiguous_in_window_mmx /* if (write >= nbytes) */ - - addl wsize(%esp), from_r - addl write_r, from_r - subl nbytes_r, from_r /* from += wsize + write - nbytes */ - subl write_r, nbytes_r /* nbytes -= write */ -#undef write_r - - cmpl nbytes_r, len_r - jbe .L_do_copy1_mmx /* if (nbytes >= len) */ - - subl nbytes_r, len_r /* len -= nbytes */ - rep movsb - movl window(%esp), from_r /* from = window */ - movl write(%esp), nbytes_r /* nbytes = write */ - cmpl nbytes_r, len_r - jbe .L_do_copy1_mmx /* if (nbytes >= len) */ - - subl nbytes_r, len_r /* len -= nbytes */ - rep movsb - movl out_r, from_r - subl dist_r, from_r /* from = out - dist */ - jmp .L_do_copy1_mmx - -.L_contiguous_in_window_mmx: -#define write_r %eax - addl write_r, from_r - subl nbytes_r, from_r /* from += write - nbytes */ -#undef write_r - - cmpl nbytes_r, len_r - jbe .L_do_copy1_mmx /* if (nbytes >= len) */ - - subl nbytes_r, len_r /* len -= nbytes */ - rep movsb - movl out_r, from_r - subl dist_r, from_r /* from = out - dist */ - -.L_do_copy1_mmx: -#undef nbytes_r -#define in_r %esi - movl len_r, %ecx - rep movsb - - movl in(%esp), in_r /* move in back to %esi, toss from */ - movl lcode(%esp), %ebx /* move lcode back to %ebx, toss dist */ - jmp .L_while_test_mmx - -#undef hold_r -#undef bitslong_r - -#endif /* USE_MMX || RUN_TIME_MMX */ - - -/*** USE_MMX, NO_MMX, and RUNTIME_MMX from here on ***/ - -.L_invalid_distance_code: - /* else { - * strm->msg = "invalid distance code"; - * state->mode = BAD; - * } - */ - movl $.L_invalid_distance_code_msg, %ecx - movl $INFLATE_MODE_BAD, %edx - jmp .L_update_stream_state - -.L_test_for_end_of_block: - /* else if (op & 32) { - * state->mode = TYPE; - * break; - * } - */ - testb $32, %al - jz .L_invalid_literal_length_code /* if ((op & 32) == 0) */ - - movl $0, %ecx - movl $INFLATE_MODE_TYPE, %edx - jmp .L_update_stream_state - -.L_invalid_literal_length_code: - /* else { - * strm->msg = "invalid literal/length code"; - * state->mode = BAD; - * } - */ - movl $.L_invalid_literal_length_code_msg, %ecx - movl $INFLATE_MODE_BAD, %edx - jmp .L_update_stream_state - -.L_invalid_distance_too_far: - /* strm->msg = "invalid distance too far back"; - * state->mode = BAD; - */ - movl in(%esp), in_r /* from_r has in's reg, put in back */ - movl $.L_invalid_distance_too_far_msg, %ecx - movl $INFLATE_MODE_BAD, %edx - jmp .L_update_stream_state - -.L_update_stream_state: - /* set strm->msg = %ecx, strm->state->mode = %edx */ - movl strm_sp(%esp), %eax - testl %ecx, %ecx /* if (msg != NULL) */ - jz .L_skip_msg - movl %ecx, msg_strm(%eax) /* strm->msg = msg */ -.L_skip_msg: - movl state_strm(%eax), %eax /* state = strm->state */ - movl %edx, mode_state(%eax) /* state->mode = edx (BAD | TYPE) */ - jmp .L_break_loop - -.align 32,0x90 -.L_break_loop: - -/* - * Regs: - * - * bits = %ebp when mmx, and in %ebx when non-mmx - * hold = %hold_mm when mmx, and in %ebp when non-mmx - * in = %esi - * out = %edi - */ - -#if defined( USE_MMX ) || defined( RUN_TIME_MMX ) - -#if defined( RUN_TIME_MMX ) - - cmpl $DO_USE_MMX, inflate_fast_use_mmx - jne .L_update_next_in - -#endif /* RUN_TIME_MMX */ - - movl %ebp, %ebx - -.L_update_next_in: - -#endif - -#define strm_r %eax -#define state_r %edx - - /* len = bits >> 3; - * in -= len; - * bits -= len << 3; - * hold &= (1U << bits) - 1; - * state->hold = hold; - * state->bits = bits; - * strm->next_in = in; - * strm->next_out = out; - */ - movl strm_sp(%esp), strm_r - movl %ebx, %ecx - movl state_strm(strm_r), state_r - shrl $3, %ecx - subl %ecx, in_r - shll $3, %ecx - subl %ecx, %ebx - movl out_r, next_out_strm(strm_r) - movl %ebx, bits_state(state_r) - movl %ebx, %ecx - - leal buf(%esp), %ebx - cmpl %ebx, last(%esp) - jne .L_buf_not_used /* if buf != last */ - - subl %ebx, in_r /* in -= buf */ - movl next_in_strm(strm_r), %ebx - movl %ebx, last(%esp) /* last = strm->next_in */ - addl %ebx, in_r /* in += strm->next_in */ - movl avail_in_strm(strm_r), %ebx - subl $11, %ebx - addl %ebx, last(%esp) /* last = &strm->next_in[ avail_in - 11 ] */ - -.L_buf_not_used: - movl in_r, next_in_strm(strm_r) - - movl $1, %ebx - shll %cl, %ebx - decl %ebx - -#if defined( USE_MMX ) || defined( RUN_TIME_MMX ) - -#if defined( RUN_TIME_MMX ) - - cmpl $DO_USE_MMX, inflate_fast_use_mmx - jne .L_update_hold - -#endif /* RUN_TIME_MMX */ - - psrlq used_mm, hold_mm /* hold_mm >>= last bit length */ - movd hold_mm, %ebp - - emms - -.L_update_hold: - -#endif /* USE_MMX || RUN_TIME_MMX */ - - andl %ebx, %ebp - movl %ebp, hold_state(state_r) - -#define last_r %ebx - - /* strm->avail_in = in < last ? 11 + (last - in) : 11 - (in - last) */ - movl last(%esp), last_r - cmpl in_r, last_r - jbe .L_last_is_smaller /* if (in >= last) */ - - subl in_r, last_r /* last -= in */ - addl $11, last_r /* last += 11 */ - movl last_r, avail_in_strm(strm_r) - jmp .L_fixup_out -.L_last_is_smaller: - subl last_r, in_r /* in -= last */ - negl in_r /* in = -in */ - addl $11, in_r /* in += 11 */ - movl in_r, avail_in_strm(strm_r) - -#undef last_r -#define end_r %ebx - -.L_fixup_out: - /* strm->avail_out = out < end ? 257 + (end - out) : 257 - (out - end)*/ - movl end(%esp), end_r - cmpl out_r, end_r - jbe .L_end_is_smaller /* if (out >= end) */ - - subl out_r, end_r /* end -= out */ - addl $257, end_r /* end += 257 */ - movl end_r, avail_out_strm(strm_r) - jmp .L_done -.L_end_is_smaller: - subl end_r, out_r /* out -= end */ - negl out_r /* out = -out */ - addl $257, out_r /* out += 257 */ - movl out_r, avail_out_strm(strm_r) - -#undef end_r -#undef strm_r -#undef state_r - -.L_done: - addl $local_var_size, %esp - popf - popl %ebx - popl %ebp - popl %esi - popl %edi - ret - -#if defined( GAS_ELF ) -/* elf info */ -.type inflate_fast,@function -.size inflate_fast,.-inflate_fast -#endif diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/contrib/masmx64/bld_ml64.bat mame-0.243+dfsg.1/3rdparty/zlib/contrib/masmx64/bld_ml64.bat --- mame-0.242+dfsg.1/3rdparty/zlib/contrib/masmx64/bld_ml64.bat 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/contrib/masmx64/bld_ml64.bat 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -ml64.exe /Flinffasx64 /c /Zi inffasx64.asm -ml64.exe /Flgvmat64 /c /Zi gvmat64.asm diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/contrib/masmx64/gvmat64.asm mame-0.243+dfsg.1/3rdparty/zlib/contrib/masmx64/gvmat64.asm --- mame-0.242+dfsg.1/3rdparty/zlib/contrib/masmx64/gvmat64.asm 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/contrib/masmx64/gvmat64.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,553 +0,0 @@ -;uInt longest_match_x64( -; deflate_state *s, -; IPos cur_match); /* current match */ - -; gvmat64.asm -- Asm portion of the optimized longest_match for 32 bits x86_64 -; (AMD64 on Athlon 64, Opteron, Phenom -; and Intel EM64T on Pentium 4 with EM64T, Pentium D, Core 2 Duo, Core I5/I7) -; Copyright (C) 1995-2010 Jean-loup Gailly, Brian Raiter and Gilles Vollant. -; -; File written by Gilles Vollant, by converting to assembly the longest_match -; from Jean-loup Gailly in deflate.c of zLib and infoZip zip. -; -; and by taking inspiration on asm686 with masm, optimised assembly code -; from Brian Raiter, written 1998 -; -; This software is provided 'as-is', without any express or implied -; warranty. In no event will the authors be held liable for any damages -; arising from the use of this software. -; -; Permission is granted to anyone to use this software for any purpose, -; including commercial applications, and to alter it and redistribute it -; freely, subject to the following restrictions: -; -; 1. The origin of this software must not be misrepresented; you must not -; claim that you wrote the original software. If you use this software -; in a product, an acknowledgment in the product documentation would be -; appreciated but is not required. -; 2. Altered source versions must be plainly marked as such, and must not be -; misrepresented as being the original software -; 3. This notice may not be removed or altered from any source distribution. -; -; -; -; http://www.zlib.net -; http://www.winimage.com/zLibDll -; http://www.muppetlabs.com/~breadbox/software/assembly.html -; -; to compile this file for infozip Zip, I use option: -; ml64.exe /Flgvmat64 /c /Zi /DINFOZIP gvmat64.asm -; -; to compile this file for zLib, I use option: -; ml64.exe /Flgvmat64 /c /Zi gvmat64.asm -; Be carrefull to adapt zlib1222add below to your version of zLib -; (if you use a version of zLib before 1.0.4 or after 1.2.2.2, change -; value of zlib1222add later) -; -; This file compile with Microsoft Macro Assembler (x64) for AMD64 -; -; ml64.exe is given with Visual Studio 2005/2008/2010 and Windows WDK -; -; (you can get Windows WDK with ml64 for AMD64 from -; http://www.microsoft.com/whdc/Devtools/wdk/default.mspx for low price) -; - - -;uInt longest_match(s, cur_match) -; deflate_state *s; -; IPos cur_match; /* current match */ -.code -longest_match PROC - - -;LocalVarsSize equ 88 - LocalVarsSize equ 72 - -; register used : rax,rbx,rcx,rdx,rsi,rdi,r8,r9,r10,r11,r12 -; free register : r14,r15 -; register can be saved : rsp - - chainlenwmask equ rsp + 8 - LocalVarsSize ; high word: current chain len - ; low word: s->wmask -;window equ rsp + xx - LocalVarsSize ; local copy of s->window ; stored in r10 -;windowbestlen equ rsp + xx - LocalVarsSize ; s->window + bestlen , use r10+r11 -;scanstart equ rsp + xx - LocalVarsSize ; first two bytes of string ; stored in r12w -;scanend equ rsp + xx - LocalVarsSize ; last two bytes of string use ebx -;scanalign equ rsp + xx - LocalVarsSize ; dword-misalignment of string r13 -;bestlen equ rsp + xx - LocalVarsSize ; size of best match so far -> r11d -;scan equ rsp + xx - LocalVarsSize ; ptr to string wanting match -> r9 -IFDEF INFOZIP -ELSE - nicematch equ (rsp + 16 - LocalVarsSize) ; a good enough match size -ENDIF - -save_rdi equ rsp + 24 - LocalVarsSize -save_rsi equ rsp + 32 - LocalVarsSize -save_rbx equ rsp + 40 - LocalVarsSize -save_rbp equ rsp + 48 - LocalVarsSize -save_r12 equ rsp + 56 - LocalVarsSize -save_r13 equ rsp + 64 - LocalVarsSize -;save_r14 equ rsp + 72 - LocalVarsSize -;save_r15 equ rsp + 80 - LocalVarsSize - - -; summary of register usage -; scanend ebx -; scanendw bx -; chainlenwmask edx -; curmatch rsi -; curmatchd esi -; windowbestlen r8 -; scanalign r9 -; scanalignd r9d -; window r10 -; bestlen r11 -; bestlend r11d -; scanstart r12d -; scanstartw r12w -; scan r13 -; nicematch r14d -; limit r15 -; limitd r15d -; prev rcx - -; all the +4 offsets are due to the addition of pending_buf_size (in zlib -; in the deflate_state structure since the asm code was first written -; (if you compile with zlib 1.0.4 or older, remove the +4). -; Note : these value are good with a 8 bytes boundary pack structure - - - MAX_MATCH equ 258 - MIN_MATCH equ 3 - MIN_LOOKAHEAD equ (MAX_MATCH+MIN_MATCH+1) - - -;;; Offsets for fields in the deflate_state structure. These numbers -;;; are calculated from the definition of deflate_state, with the -;;; assumption that the compiler will dword-align the fields. (Thus, -;;; changing the definition of deflate_state could easily cause this -;;; program to crash horribly, without so much as a warning at -;;; compile time. Sigh.) - -; all the +zlib1222add offsets are due to the addition of fields -; in zlib in the deflate_state structure since the asm code was first written -; (if you compile with zlib 1.0.4 or older, use "zlib1222add equ (-4)"). -; (if you compile with zlib between 1.0.5 and 1.2.2.1, use "zlib1222add equ 0"). -; if you compile with zlib 1.2.2.2 or later , use "zlib1222add equ 8"). - - -IFDEF INFOZIP - -_DATA SEGMENT -COMM window_size:DWORD -; WMask ; 7fff -COMM window:BYTE:010040H -COMM prev:WORD:08000H -; MatchLen : unused -; PrevMatch : unused -COMM strstart:DWORD -COMM match_start:DWORD -; Lookahead : ignore -COMM prev_length:DWORD ; PrevLen -COMM max_chain_length:DWORD -COMM good_match:DWORD -COMM nice_match:DWORD -prev_ad equ OFFSET prev -window_ad equ OFFSET window -nicematch equ nice_match -_DATA ENDS -WMask equ 07fffh - -ELSE - - IFNDEF zlib1222add - zlib1222add equ 8 - ENDIF -dsWSize equ 56+zlib1222add+(zlib1222add/2) -dsWMask equ 64+zlib1222add+(zlib1222add/2) -dsWindow equ 72+zlib1222add -dsPrev equ 88+zlib1222add -dsMatchLen equ 128+zlib1222add -dsPrevMatch equ 132+zlib1222add -dsStrStart equ 140+zlib1222add -dsMatchStart equ 144+zlib1222add -dsLookahead equ 148+zlib1222add -dsPrevLen equ 152+zlib1222add -dsMaxChainLen equ 156+zlib1222add -dsGoodMatch equ 172+zlib1222add -dsNiceMatch equ 176+zlib1222add - -window_size equ [ rcx + dsWSize] -WMask equ [ rcx + dsWMask] -window_ad equ [ rcx + dsWindow] -prev_ad equ [ rcx + dsPrev] -strstart equ [ rcx + dsStrStart] -match_start equ [ rcx + dsMatchStart] -Lookahead equ [ rcx + dsLookahead] ; 0ffffffffh on infozip -prev_length equ [ rcx + dsPrevLen] -max_chain_length equ [ rcx + dsMaxChainLen] -good_match equ [ rcx + dsGoodMatch] -nice_match equ [ rcx + dsNiceMatch] -ENDIF - -; parameter 1 in r8(deflate state s), param 2 in rdx (cur match) - -; see http://weblogs.asp.net/oldnewthing/archive/2004/01/14/58579.aspx and -; http://msdn.microsoft.com/library/en-us/kmarch/hh/kmarch/64bitAMD_8e951dd2-ee77-4728-8702-55ce4b5dd24a.xml.asp -; -; All registers must be preserved across the call, except for -; rax, rcx, rdx, r8, r9, r10, and r11, which are scratch. - - - -;;; Save registers that the compiler may be using, and adjust esp to -;;; make room for our stack frame. - - -;;; Retrieve the function arguments. r8d will hold cur_match -;;; throughout the entire function. edx will hold the pointer to the -;;; deflate_state structure during the function's setup (before -;;; entering the main loop. - -; parameter 1 in rcx (deflate_state* s), param 2 in edx -> r8 (cur match) - -; this clear high 32 bits of r8, which can be garbage in both r8 and rdx - - mov [save_rdi],rdi - mov [save_rsi],rsi - mov [save_rbx],rbx - mov [save_rbp],rbp -IFDEF INFOZIP - mov r8d,ecx -ELSE - mov r8d,edx -ENDIF - mov [save_r12],r12 - mov [save_r13],r13 -; mov [save_r14],r14 -; mov [save_r15],r15 - - -;;; uInt wmask = s->w_mask; -;;; unsigned chain_length = s->max_chain_length; -;;; if (s->prev_length >= s->good_match) { -;;; chain_length >>= 2; -;;; } - - mov edi, prev_length - mov esi, good_match - mov eax, WMask - mov ebx, max_chain_length - cmp edi, esi - jl LastMatchGood - shr ebx, 2 -LastMatchGood: - -;;; chainlen is decremented once beforehand so that the function can -;;; use the sign flag instead of the zero flag for the exit test. -;;; It is then shifted into the high word, to make room for the wmask -;;; value, which it will always accompany. - - dec ebx - shl ebx, 16 - or ebx, eax - -;;; on zlib only -;;; if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead; - -IFDEF INFOZIP - mov [chainlenwmask], ebx -; on infozip nice_match = [nice_match] -ELSE - mov eax, nice_match - mov [chainlenwmask], ebx - mov r10d, Lookahead - cmp r10d, eax - cmovnl r10d, eax - mov [nicematch],r10d -ENDIF - -;;; register Bytef *scan = s->window + s->strstart; - mov r10, window_ad - mov ebp, strstart - lea r13, [r10 + rbp] - -;;; Determine how many bytes the scan ptr is off from being -;;; dword-aligned. - - mov r9,r13 - neg r13 - and r13,3 - -;;; IPos limit = s->strstart > (IPos)MAX_DIST(s) ? -;;; s->strstart - (IPos)MAX_DIST(s) : NIL; -IFDEF INFOZIP - mov eax,07efah ; MAX_DIST = (WSIZE-MIN_LOOKAHEAD) (0x8000-(3+8+1)) -ELSE - mov eax, window_size - sub eax, MIN_LOOKAHEAD -ENDIF - xor edi,edi - sub ebp, eax - - mov r11d, prev_length - - cmovng ebp,edi - -;;; int best_len = s->prev_length; - - -;;; Store the sum of s->window + best_len in esi locally, and in esi. - - lea rsi,[r10+r11] - -;;; register ush scan_start = *(ushf*)scan; -;;; register ush scan_end = *(ushf*)(scan+best_len-1); -;;; Posf *prev = s->prev; - - movzx r12d,word ptr [r9] - movzx ebx, word ptr [r9 + r11 - 1] - - mov rdi, prev_ad - -;;; Jump into the main loop. - - mov edx, [chainlenwmask] - - cmp bx,word ptr [rsi + r8 - 1] - jz LookupLoopIsZero - -LookupLoop1: - and r8d, edx - - movzx r8d, word ptr [rdi + r8*2] - cmp r8d, ebp - jbe LeaveNow - sub edx, 00010000h - js LeaveNow - -LoopEntry1: - cmp bx,word ptr [rsi + r8 - 1] - jz LookupLoopIsZero - -LookupLoop2: - and r8d, edx - - movzx r8d, word ptr [rdi + r8*2] - cmp r8d, ebp - jbe LeaveNow - sub edx, 00010000h - js LeaveNow - -LoopEntry2: - cmp bx,word ptr [rsi + r8 - 1] - jz LookupLoopIsZero - -LookupLoop4: - and r8d, edx - - movzx r8d, word ptr [rdi + r8*2] - cmp r8d, ebp - jbe LeaveNow - sub edx, 00010000h - js LeaveNow - -LoopEntry4: - - cmp bx,word ptr [rsi + r8 - 1] - jnz LookupLoop1 - jmp LookupLoopIsZero - - -;;; do { -;;; match = s->window + cur_match; -;;; if (*(ushf*)(match+best_len-1) != scan_end || -;;; *(ushf*)match != scan_start) continue; -;;; [...] -;;; } while ((cur_match = prev[cur_match & wmask]) > limit -;;; && --chain_length != 0); -;;; -;;; Here is the inner loop of the function. The function will spend the -;;; majority of its time in this loop, and majority of that time will -;;; be spent in the first ten instructions. -;;; -;;; Within this loop: -;;; ebx = scanend -;;; r8d = curmatch -;;; edx = chainlenwmask - i.e., ((chainlen << 16) | wmask) -;;; esi = windowbestlen - i.e., (window + bestlen) -;;; edi = prev -;;; ebp = limit - -LookupLoop: - and r8d, edx - - movzx r8d, word ptr [rdi + r8*2] - cmp r8d, ebp - jbe LeaveNow - sub edx, 00010000h - js LeaveNow - -LoopEntry: - - cmp bx,word ptr [rsi + r8 - 1] - jnz LookupLoop1 -LookupLoopIsZero: - cmp r12w, word ptr [r10 + r8] - jnz LookupLoop1 - - -;;; Store the current value of chainlen. - mov [chainlenwmask], edx - -;;; Point edi to the string under scrutiny, and esi to the string we -;;; are hoping to match it up with. In actuality, esi and edi are -;;; both pointed (MAX_MATCH_8 - scanalign) bytes ahead, and edx is -;;; initialized to -(MAX_MATCH_8 - scanalign). - - lea rsi,[r8+r10] - mov rdx, 0fffffffffffffef8h; -(MAX_MATCH_8) - lea rsi, [rsi + r13 + 0108h] ;MAX_MATCH_8] - lea rdi, [r9 + r13 + 0108h] ;MAX_MATCH_8] - - prefetcht1 [rsi+rdx] - prefetcht1 [rdi+rdx] - - -;;; Test the strings for equality, 8 bytes at a time. At the end, -;;; adjust rdx so that it is offset to the exact byte that mismatched. -;;; -;;; We already know at this point that the first three bytes of the -;;; strings match each other, and they can be safely passed over before -;;; starting the compare loop. So what this code does is skip over 0-3 -;;; bytes, as much as necessary in order to dword-align the edi -;;; pointer. (rsi will still be misaligned three times out of four.) -;;; -;;; It should be confessed that this loop usually does not represent -;;; much of the total running time. Replacing it with a more -;;; straightforward "rep cmpsb" would not drastically degrade -;;; performance. - - -LoopCmps: - mov rax, [rsi + rdx] - xor rax, [rdi + rdx] - jnz LeaveLoopCmps - - mov rax, [rsi + rdx + 8] - xor rax, [rdi + rdx + 8] - jnz LeaveLoopCmps8 - - - mov rax, [rsi + rdx + 8+8] - xor rax, [rdi + rdx + 8+8] - jnz LeaveLoopCmps16 - - add rdx,8+8+8 - - jnz short LoopCmps - jmp short LenMaximum -LeaveLoopCmps16: add rdx,8 -LeaveLoopCmps8: add rdx,8 -LeaveLoopCmps: - - test eax, 0000FFFFh - jnz LenLower - - test eax,0ffffffffh - - jnz LenLower32 - - add rdx,4 - shr rax,32 - or ax,ax - jnz LenLower - -LenLower32: - shr eax,16 - add rdx,2 -LenLower: sub al, 1 - adc rdx, 0 -;;; Calculate the length of the match. If it is longer than MAX_MATCH, -;;; then automatically accept it as the best possible match and leave. - - lea rax, [rdi + rdx] - sub rax, r9 - cmp eax, MAX_MATCH - jge LenMaximum - -;;; If the length of the match is not longer than the best match we -;;; have so far, then forget it and return to the lookup loop. -;/////////////////////////////////// - - cmp eax, r11d - jg LongerMatch - - lea rsi,[r10+r11] - - mov rdi, prev_ad - mov edx, [chainlenwmask] - jmp LookupLoop - -;;; s->match_start = cur_match; -;;; best_len = len; -;;; if (len >= nice_match) break; -;;; scan_end = *(ushf*)(scan+best_len-1); - -LongerMatch: - mov r11d, eax - mov match_start, r8d - cmp eax, [nicematch] - jge LeaveNow - - lea rsi,[r10+rax] - - movzx ebx, word ptr [r9 + rax - 1] - mov rdi, prev_ad - mov edx, [chainlenwmask] - jmp LookupLoop - -;;; Accept the current string, with the maximum possible length. - -LenMaximum: - mov r11d,MAX_MATCH - mov match_start, r8d - -;;; if ((uInt)best_len <= s->lookahead) return (uInt)best_len; -;;; return s->lookahead; - -LeaveNow: -IFDEF INFOZIP - mov eax,r11d -ELSE - mov eax, Lookahead - cmp r11d, eax - cmovng eax, r11d -ENDIF - -;;; Restore the stack and return from whence we came. - - - mov rsi,[save_rsi] - mov rdi,[save_rdi] - mov rbx,[save_rbx] - mov rbp,[save_rbp] - mov r12,[save_r12] - mov r13,[save_r13] -; mov r14,[save_r14] -; mov r15,[save_r15] - - - ret 0 -; please don't remove this string ! -; Your can freely use gvmat64 in any free or commercial app -; but it is far better don't remove the string in the binary! - db 0dh,0ah,"asm686 with masm, optimised assembly code from Brian Raiter, written 1998, converted to amd 64 by Gilles Vollant 2005",0dh,0ah,0 -longest_match ENDP - -match_init PROC - ret 0 -match_init ENDP - - -END diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/contrib/masmx64/inffas8664.c mame-0.243+dfsg.1/3rdparty/zlib/contrib/masmx64/inffas8664.c --- mame-0.242+dfsg.1/3rdparty/zlib/contrib/masmx64/inffas8664.c 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/contrib/masmx64/inffas8664.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,186 +0,0 @@ -/* inffas8664.c is a hand tuned assembler version of inffast.c - fast decoding - * version for AMD64 on Windows using Microsoft C compiler - * - * Copyright (C) 1995-2003 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - * - * Copyright (C) 2003 Chris Anderson - * Please use the copyright conditions above. - * - * 2005 - Adaptation to Microsoft C Compiler for AMD64 by Gilles Vollant - * - * inffas8664.c call function inffas8664fnc in inffasx64.asm - * inffasx64.asm is automatically convert from AMD64 portion of inffas86.c - * - * Dec-29-2003 -- I added AMD64 inflate asm support. This version is also - * slightly quicker on x86 systems because, instead of using rep movsb to copy - * data, it uses rep movsw, which moves data in 2-byte chunks instead of single - * bytes. I've tested the AMD64 code on a Fedora Core 1 + the x86_64 updates - * from http://fedora.linux.duke.edu/fc1_x86_64 - * which is running on an Athlon 64 3000+ / Gigabyte GA-K8VT800M system with - * 1GB ram. The 64-bit version is about 4% faster than the 32-bit version, - * when decompressing mozilla-source-1.3.tar.gz. - * - * Mar-13-2003 -- Most of this is derived from inffast.S which is derived from - * the gcc -S output of zlib-1.2.0/inffast.c. Zlib-1.2.0 is in beta release at - * the moment. I have successfully compiled and tested this code with gcc2.96, - * gcc3.2, icc5.0, msvc6.0. It is very close to the speed of inffast.S - * compiled with gcc -DNO_MMX, but inffast.S is still faster on the P3 with MMX - * enabled. I will attempt to merge the MMX code into this version. Newer - * versions of this and inffast.S can be found at - * http://www.eetbeetee.com/zlib/ and http://www.charm.net/~christop/zlib/ - * - */ - -#include -#include "zutil.h" -#include "inftrees.h" -#include "inflate.h" -#include "inffast.h" - -/* Mark Adler's comments from inffast.c: */ - -/* - Decode literal, length, and distance codes and write out the resulting - literal and match bytes until either not enough input or output is - available, an end-of-block is encountered, or a data error is encountered. - When large enough input and output buffers are supplied to inflate(), for - example, a 16K input buffer and a 64K output buffer, more than 95% of the - inflate execution time is spent in this routine. - - Entry assumptions: - - state->mode == LEN - strm->avail_in >= 6 - strm->avail_out >= 258 - start >= strm->avail_out - state->bits < 8 - - On return, state->mode is one of: - - LEN -- ran out of enough output space or enough available input - TYPE -- reached end of block code, inflate() to interpret next block - BAD -- error in block data - - Notes: - - - The maximum input bits used by a length/distance pair is 15 bits for the - length code, 5 bits for the length extra, 15 bits for the distance code, - and 13 bits for the distance extra. This totals 48 bits, or six bytes. - Therefore if strm->avail_in >= 6, then there is enough input to avoid - checking for available input while decoding. - - - The maximum bytes that a single length/distance pair can output is 258 - bytes, which is the maximum length that can be coded. inflate_fast() - requires strm->avail_out >= 258 for each loop to avoid checking for - output space. - */ - - - - typedef struct inffast_ar { -/* 64 32 x86 x86_64 */ -/* ar offset register */ -/* 0 0 */ void *esp; /* esp save */ -/* 8 4 */ void *ebp; /* ebp save */ -/* 16 8 */ unsigned char FAR *in; /* esi rsi local strm->next_in */ -/* 24 12 */ unsigned char FAR *last; /* r9 while in < last */ -/* 32 16 */ unsigned char FAR *out; /* edi rdi local strm->next_out */ -/* 40 20 */ unsigned char FAR *beg; /* inflate()'s init next_out */ -/* 48 24 */ unsigned char FAR *end; /* r10 while out < end */ -/* 56 28 */ unsigned char FAR *window;/* size of window, wsize!=0 */ -/* 64 32 */ code const FAR *lcode; /* ebp rbp local strm->lencode */ -/* 72 36 */ code const FAR *dcode; /* r11 local strm->distcode */ -/* 80 40 */ size_t /*unsigned long */hold; /* edx rdx local strm->hold */ -/* 88 44 */ unsigned bits; /* ebx rbx local strm->bits */ -/* 92 48 */ unsigned wsize; /* window size */ -/* 96 52 */ unsigned write; /* window write index */ -/*100 56 */ unsigned lmask; /* r12 mask for lcode */ -/*104 60 */ unsigned dmask; /* r13 mask for dcode */ -/*108 64 */ unsigned len; /* r14 match length */ -/*112 68 */ unsigned dist; /* r15 match distance */ -/*116 72 */ unsigned status; /* set when state chng*/ - } type_ar; -#ifdef ASMINF - -void inflate_fast(strm, start) -z_streamp strm; -unsigned start; /* inflate()'s starting value for strm->avail_out */ -{ - struct inflate_state FAR *state; - type_ar ar; - void inffas8664fnc(struct inffast_ar * par); - - - -#if (defined( __GNUC__ ) && defined( __amd64__ ) && ! defined( __i386 )) || (defined(_MSC_VER) && defined(_M_AMD64)) -#define PAD_AVAIL_IN 6 -#define PAD_AVAIL_OUT 258 -#else -#define PAD_AVAIL_IN 5 -#define PAD_AVAIL_OUT 257 -#endif - - /* copy state to local variables */ - state = (struct inflate_state FAR *)strm->state; - - ar.in = strm->next_in; - ar.last = ar.in + (strm->avail_in - PAD_AVAIL_IN); - ar.out = strm->next_out; - ar.beg = ar.out - (start - strm->avail_out); - ar.end = ar.out + (strm->avail_out - PAD_AVAIL_OUT); - ar.wsize = state->wsize; - ar.write = state->wnext; - ar.window = state->window; - ar.hold = state->hold; - ar.bits = state->bits; - ar.lcode = state->lencode; - ar.dcode = state->distcode; - ar.lmask = (1U << state->lenbits) - 1; - ar.dmask = (1U << state->distbits) - 1; - - /* decode literals and length/distances until end-of-block or not enough - input data or output space */ - - /* align in on 1/2 hold size boundary */ - while (((size_t)(void *)ar.in & (sizeof(ar.hold) / 2 - 1)) != 0) { - ar.hold += (unsigned long)*ar.in++ << ar.bits; - ar.bits += 8; - } - - inffas8664fnc(&ar); - - if (ar.status > 1) { - if (ar.status == 2) - strm->msg = "invalid literal/length code"; - else if (ar.status == 3) - strm->msg = "invalid distance code"; - else - strm->msg = "invalid distance too far back"; - state->mode = BAD; - } - else if ( ar.status == 1 ) { - state->mode = TYPE; - } - - /* return unused bytes (on entry, bits < 8, so in won't go too far back) */ - ar.len = ar.bits >> 3; - ar.in -= ar.len; - ar.bits -= ar.len << 3; - ar.hold &= (1U << ar.bits) - 1; - - /* update state and return */ - strm->next_in = ar.in; - strm->next_out = ar.out; - strm->avail_in = (unsigned)(ar.in < ar.last ? - PAD_AVAIL_IN + (ar.last - ar.in) : - PAD_AVAIL_IN - (ar.in - ar.last)); - strm->avail_out = (unsigned)(ar.out < ar.end ? - PAD_AVAIL_OUT + (ar.end - ar.out) : - PAD_AVAIL_OUT - (ar.out - ar.end)); - state->hold = (unsigned long)ar.hold; - state->bits = ar.bits; - return; -} - -#endif diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/contrib/masmx64/inffasx64.asm mame-0.243+dfsg.1/3rdparty/zlib/contrib/masmx64/inffasx64.asm --- mame-0.242+dfsg.1/3rdparty/zlib/contrib/masmx64/inffasx64.asm 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/contrib/masmx64/inffasx64.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,396 +0,0 @@ -; inffasx64.asm is a hand tuned assembler version of inffast.c - fast decoding -; version for AMD64 on Windows using Microsoft C compiler -; -; inffasx64.asm is automatically convert from AMD64 portion of inffas86.c -; inffasx64.asm is called by inffas8664.c, which contain more info. - - -; to compile this file, I use option -; ml64.exe /Flinffasx64 /c /Zi inffasx64.asm -; with Microsoft Macro Assembler (x64) for AMD64 -; - -; This file compile with Microsoft Macro Assembler (x64) for AMD64 -; -; ml64.exe is given with Visual Studio 2005/2008/2010 and Windows WDK -; -; (you can get Windows WDK with ml64 for AMD64 from -; http://www.microsoft.com/whdc/Devtools/wdk/default.mspx for low price) -; - - -.code -inffas8664fnc PROC - -; see http://weblogs.asp.net/oldnewthing/archive/2004/01/14/58579.aspx and -; http://msdn.microsoft.com/library/en-us/kmarch/hh/kmarch/64bitAMD_8e951dd2-ee77-4728-8702-55ce4b5dd24a.xml.asp -; -; All registers must be preserved across the call, except for -; rax, rcx, rdx, r8, r-9, r10, and r11, which are scratch. - - - mov [rsp-8],rsi - mov [rsp-16],rdi - mov [rsp-24],r12 - mov [rsp-32],r13 - mov [rsp-40],r14 - mov [rsp-48],r15 - mov [rsp-56],rbx - - mov rax,rcx - - mov [rax+8], rbp ; /* save regs rbp and rsp */ - mov [rax], rsp - - mov rsp, rax ; /* make rsp point to &ar */ - - mov rsi, [rsp+16] ; /* rsi = in */ - mov rdi, [rsp+32] ; /* rdi = out */ - mov r9, [rsp+24] ; /* r9 = last */ - mov r10, [rsp+48] ; /* r10 = end */ - mov rbp, [rsp+64] ; /* rbp = lcode */ - mov r11, [rsp+72] ; /* r11 = dcode */ - mov rdx, [rsp+80] ; /* rdx = hold */ - mov ebx, [rsp+88] ; /* ebx = bits */ - mov r12d, [rsp+100] ; /* r12d = lmask */ - mov r13d, [rsp+104] ; /* r13d = dmask */ - ; /* r14d = len */ - ; /* r15d = dist */ - - - cld - cmp r10, rdi - je L_one_time ; /* if only one decode left */ - cmp r9, rsi - - jne L_do_loop - - -L_one_time: - mov r8, r12 ; /* r8 = lmask */ - cmp bl, 32 - ja L_get_length_code_one_time - - lodsd ; /* eax = *(uint *)in++ */ - mov cl, bl ; /* cl = bits, needs it for shifting */ - add bl, 32 ; /* bits += 32 */ - shl rax, cl - or rdx, rax ; /* hold |= *((uint *)in)++ << bits */ - jmp L_get_length_code_one_time - -ALIGN 4 -L_while_test: - cmp r10, rdi - jbe L_break_loop - cmp r9, rsi - jbe L_break_loop - -L_do_loop: - mov r8, r12 ; /* r8 = lmask */ - cmp bl, 32 - ja L_get_length_code ; /* if (32 < bits) */ - - lodsd ; /* eax = *(uint *)in++ */ - mov cl, bl ; /* cl = bits, needs it for shifting */ - add bl, 32 ; /* bits += 32 */ - shl rax, cl - or rdx, rax ; /* hold |= *((uint *)in)++ << bits */ - -L_get_length_code: - and r8, rdx ; /* r8 &= hold */ - mov eax, [rbp+r8*4] ; /* eax = lcode[hold & lmask] */ - - mov cl, ah ; /* cl = this.bits */ - sub bl, ah ; /* bits -= this.bits */ - shr rdx, cl ; /* hold >>= this.bits */ - - test al, al - jnz L_test_for_length_base ; /* if (op != 0) 45.7% */ - - mov r8, r12 ; /* r8 = lmask */ - shr eax, 16 ; /* output this.val char */ - stosb - -L_get_length_code_one_time: - and r8, rdx ; /* r8 &= hold */ - mov eax, [rbp+r8*4] ; /* eax = lcode[hold & lmask] */ - -L_dolen: - mov cl, ah ; /* cl = this.bits */ - sub bl, ah ; /* bits -= this.bits */ - shr rdx, cl ; /* hold >>= this.bits */ - - test al, al - jnz L_test_for_length_base ; /* if (op != 0) 45.7% */ - - shr eax, 16 ; /* output this.val char */ - stosb - jmp L_while_test - -ALIGN 4 -L_test_for_length_base: - mov r14d, eax ; /* len = this */ - shr r14d, 16 ; /* len = this.val */ - mov cl, al - - test al, 16 - jz L_test_for_second_level_length ; /* if ((op & 16) == 0) 8% */ - and cl, 15 ; /* op &= 15 */ - jz L_decode_distance ; /* if (!op) */ - -L_add_bits_to_len: - sub bl, cl - xor eax, eax - inc eax - shl eax, cl - dec eax - and eax, edx ; /* eax &= hold */ - shr rdx, cl - add r14d, eax ; /* len += hold & mask[op] */ - -L_decode_distance: - mov r8, r13 ; /* r8 = dmask */ - cmp bl, 32 - ja L_get_distance_code ; /* if (32 < bits) */ - - lodsd ; /* eax = *(uint *)in++ */ - mov cl, bl ; /* cl = bits, needs it for shifting */ - add bl, 32 ; /* bits += 32 */ - shl rax, cl - or rdx, rax ; /* hold |= *((uint *)in)++ << bits */ - -L_get_distance_code: - and r8, rdx ; /* r8 &= hold */ - mov eax, [r11+r8*4] ; /* eax = dcode[hold & dmask] */ - -L_dodist: - mov r15d, eax ; /* dist = this */ - shr r15d, 16 ; /* dist = this.val */ - mov cl, ah - sub bl, ah ; /* bits -= this.bits */ - shr rdx, cl ; /* hold >>= this.bits */ - mov cl, al ; /* cl = this.op */ - - test al, 16 ; /* if ((op & 16) == 0) */ - jz L_test_for_second_level_dist - and cl, 15 ; /* op &= 15 */ - jz L_check_dist_one - -L_add_bits_to_dist: - sub bl, cl - xor eax, eax - inc eax - shl eax, cl - dec eax ; /* (1 << op) - 1 */ - and eax, edx ; /* eax &= hold */ - shr rdx, cl - add r15d, eax ; /* dist += hold & ((1 << op) - 1) */ - -L_check_window: - mov r8, rsi ; /* save in so from can use it's reg */ - mov rax, rdi - sub rax, [rsp+40] ; /* nbytes = out - beg */ - - cmp eax, r15d - jb L_clip_window ; /* if (dist > nbytes) 4.2% */ - - mov ecx, r14d ; /* ecx = len */ - mov rsi, rdi - sub rsi, r15 ; /* from = out - dist */ - - sar ecx, 1 - jnc L_copy_two ; /* if len % 2 == 0 */ - - rep movsw - mov al, [rsi] - mov [rdi], al - inc rdi - - mov rsi, r8 ; /* move in back to %rsi, toss from */ - jmp L_while_test - -L_copy_two: - rep movsw - mov rsi, r8 ; /* move in back to %rsi, toss from */ - jmp L_while_test - -ALIGN 4 -L_check_dist_one: - cmp r15d, 1 ; /* if dist 1, is a memset */ - jne L_check_window - cmp [rsp+40], rdi ; /* if out == beg, outside window */ - je L_check_window - - mov ecx, r14d ; /* ecx = len */ - mov al, [rdi-1] - mov ah, al - - sar ecx, 1 - jnc L_set_two - mov [rdi], al - inc rdi - -L_set_two: - rep stosw - jmp L_while_test - -ALIGN 4 -L_test_for_second_level_length: - test al, 64 - jnz L_test_for_end_of_block ; /* if ((op & 64) != 0) */ - - xor eax, eax - inc eax - shl eax, cl - dec eax - and eax, edx ; /* eax &= hold */ - add eax, r14d ; /* eax += len */ - mov eax, [rbp+rax*4] ; /* eax = lcode[val+(hold&mask[op])]*/ - jmp L_dolen - -ALIGN 4 -L_test_for_second_level_dist: - test al, 64 - jnz L_invalid_distance_code ; /* if ((op & 64) != 0) */ - - xor eax, eax - inc eax - shl eax, cl - dec eax - and eax, edx ; /* eax &= hold */ - add eax, r15d ; /* eax += dist */ - mov eax, [r11+rax*4] ; /* eax = dcode[val+(hold&mask[op])]*/ - jmp L_dodist - -ALIGN 4 -L_clip_window: - mov ecx, eax ; /* ecx = nbytes */ - mov eax, [rsp+92] ; /* eax = wsize, prepare for dist cmp */ - neg ecx ; /* nbytes = -nbytes */ - - cmp eax, r15d - jb L_invalid_distance_too_far ; /* if (dist > wsize) */ - - add ecx, r15d ; /* nbytes = dist - nbytes */ - cmp dword ptr [rsp+96], 0 - jne L_wrap_around_window ; /* if (write != 0) */ - - mov rsi, [rsp+56] ; /* from = window */ - sub eax, ecx ; /* eax -= nbytes */ - add rsi, rax ; /* from += wsize - nbytes */ - - mov eax, r14d ; /* eax = len */ - cmp r14d, ecx - jbe L_do_copy ; /* if (nbytes >= len) */ - - sub eax, ecx ; /* eax -= nbytes */ - rep movsb - mov rsi, rdi - sub rsi, r15 ; /* from = &out[ -dist ] */ - jmp L_do_copy - -ALIGN 4 -L_wrap_around_window: - mov eax, [rsp+96] ; /* eax = write */ - cmp ecx, eax - jbe L_contiguous_in_window ; /* if (write >= nbytes) */ - - mov esi, [rsp+92] ; /* from = wsize */ - add rsi, [rsp+56] ; /* from += window */ - add rsi, rax ; /* from += write */ - sub rsi, rcx ; /* from -= nbytes */ - sub ecx, eax ; /* nbytes -= write */ - - mov eax, r14d ; /* eax = len */ - cmp eax, ecx - jbe L_do_copy ; /* if (nbytes >= len) */ - - sub eax, ecx ; /* len -= nbytes */ - rep movsb - mov rsi, [rsp+56] ; /* from = window */ - mov ecx, [rsp+96] ; /* nbytes = write */ - cmp eax, ecx - jbe L_do_copy ; /* if (nbytes >= len) */ - - sub eax, ecx ; /* len -= nbytes */ - rep movsb - mov rsi, rdi - sub rsi, r15 ; /* from = out - dist */ - jmp L_do_copy - -ALIGN 4 -L_contiguous_in_window: - mov rsi, [rsp+56] ; /* rsi = window */ - add rsi, rax - sub rsi, rcx ; /* from += write - nbytes */ - - mov eax, r14d ; /* eax = len */ - cmp eax, ecx - jbe L_do_copy ; /* if (nbytes >= len) */ - - sub eax, ecx ; /* len -= nbytes */ - rep movsb - mov rsi, rdi - sub rsi, r15 ; /* from = out - dist */ - jmp L_do_copy ; /* if (nbytes >= len) */ - -ALIGN 4 -L_do_copy: - mov ecx, eax ; /* ecx = len */ - rep movsb - - mov rsi, r8 ; /* move in back to %esi, toss from */ - jmp L_while_test - -L_test_for_end_of_block: - test al, 32 - jz L_invalid_literal_length_code - mov dword ptr [rsp+116], 1 - jmp L_break_loop_with_status - -L_invalid_literal_length_code: - mov dword ptr [rsp+116], 2 - jmp L_break_loop_with_status - -L_invalid_distance_code: - mov dword ptr [rsp+116], 3 - jmp L_break_loop_with_status - -L_invalid_distance_too_far: - mov dword ptr [rsp+116], 4 - jmp L_break_loop_with_status - -L_break_loop: - mov dword ptr [rsp+116], 0 - -L_break_loop_with_status: -; /* put in, out, bits, and hold back into ar and pop esp */ - mov [rsp+16], rsi ; /* in */ - mov [rsp+32], rdi ; /* out */ - mov [rsp+88], ebx ; /* bits */ - mov [rsp+80], rdx ; /* hold */ - - mov rax, [rsp] ; /* restore rbp and rsp */ - mov rbp, [rsp+8] - mov rsp, rax - - - - mov rsi,[rsp-8] - mov rdi,[rsp-16] - mov r12,[rsp-24] - mov r13,[rsp-32] - mov r14,[rsp-40] - mov r15,[rsp-48] - mov rbx,[rsp-56] - - ret 0 -; : -; : "m" (ar) -; : "memory", "%rax", "%rbx", "%rcx", "%rdx", "%rsi", "%rdi", -; "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15" -; ); - -inffas8664fnc ENDP -;_TEXT ENDS -END diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/contrib/masmx64/readme.txt mame-0.243+dfsg.1/3rdparty/zlib/contrib/masmx64/readme.txt --- mame-0.242+dfsg.1/3rdparty/zlib/contrib/masmx64/readme.txt 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/contrib/masmx64/readme.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -Summary -------- -This directory contains ASM implementations of the functions -longest_match() and inflate_fast(), for 64 bits x86 (both AMD64 and Intel EM64t), -for use with Microsoft Macro Assembler (x64) for AMD64 and Microsoft C++ 64 bits. - -gvmat64.asm is written by Gilles Vollant (2005), by using Brian Raiter 686/32 bits - assembly optimized version from Jean-loup Gailly original longest_match function - -inffasx64.asm and inffas8664.c were written by Chris Anderson, by optimizing - original function from Mark Adler - -Use instructions ----------------- -Assemble the .asm files using MASM and put the object files into the zlib source -directory. You can also get object files here: - - http://www.winimage.com/zLibDll/zlib124_masm_obj.zip - -define ASMV and ASMINF in your project. Include inffas8664.c in your source tree, -and inffasx64.obj and gvmat64.obj as object to link. - - -Build instructions ------------------- -run bld_64.bat with Microsoft Macro Assembler (x64) for AMD64 (ml64.exe) - -ml64.exe is given with Visual Studio 2005, Windows 2003 server DDK - -You can get Windows 2003 server DDK with ml64 and cl for AMD64 from - http://www.microsoft.com/whdc/devtools/ddk/default.mspx for low price) diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/contrib/masmx86/bld_ml32.bat mame-0.243+dfsg.1/3rdparty/zlib/contrib/masmx86/bld_ml32.bat --- mame-0.242+dfsg.1/3rdparty/zlib/contrib/masmx86/bld_ml32.bat 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/contrib/masmx86/bld_ml32.bat 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -ml /coff /Zi /c /Flmatch686.lst match686.asm -ml /coff /Zi /c /Flinffas32.lst inffas32.asm diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/contrib/masmx86/inffas32.asm mame-0.243+dfsg.1/3rdparty/zlib/contrib/masmx86/inffas32.asm --- mame-0.242+dfsg.1/3rdparty/zlib/contrib/masmx86/inffas32.asm 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/contrib/masmx86/inffas32.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,1080 +0,0 @@ -;/* inffas32.asm is a hand tuned assembler version of inffast.c -- fast decoding -; * -; * inffas32.asm is derivated from inffas86.c, with translation of assembly code -; * -; * Copyright (C) 1995-2003 Mark Adler -; * For conditions of distribution and use, see copyright notice in zlib.h -; * -; * Copyright (C) 2003 Chris Anderson -; * Please use the copyright conditions above. -; * -; * Mar-13-2003 -- Most of this is derived from inffast.S which is derived from -; * the gcc -S output of zlib-1.2.0/inffast.c. Zlib-1.2.0 is in beta release at -; * the moment. I have successfully compiled and tested this code with gcc2.96, -; * gcc3.2, icc5.0, msvc6.0. It is very close to the speed of inffast.S -; * compiled with gcc -DNO_MMX, but inffast.S is still faster on the P3 with MMX -; * enabled. I will attempt to merge the MMX code into this version. Newer -; * versions of this and inffast.S can be found at -; * http://www.eetbeetee.com/zlib/ and http://www.charm.net/~christop/zlib/ -; * -; * 2005 : modification by Gilles Vollant -; */ -; For Visual C++ 4.x and higher and ML 6.x and higher -; ml.exe is in directory \MASM611C of Win95 DDK -; ml.exe is also distributed in http://www.masm32.com/masmdl.htm -; and in VC++2003 toolkit at http://msdn.microsoft.com/visualc/vctoolkit2003/ -; -; -; compile with command line option -; ml /coff /Zi /c /Flinffas32.lst inffas32.asm - -; if you define NO_GZIP (see inflate.h), compile with -; ml /coff /Zi /c /Flinffas32.lst /DNO_GUNZIP inffas32.asm - - -; zlib122sup is 0 fort zlib 1.2.2.1 and lower -; zlib122sup is 8 fort zlib 1.2.2.2 and more (with addition of dmax and head -; in inflate_state in inflate.h) -zlib1222sup equ 8 - - -IFDEF GUNZIP - INFLATE_MODE_TYPE equ 11 - INFLATE_MODE_BAD equ 26 -ELSE - IFNDEF NO_GUNZIP - INFLATE_MODE_TYPE equ 11 - INFLATE_MODE_BAD equ 26 - ELSE - INFLATE_MODE_TYPE equ 3 - INFLATE_MODE_BAD equ 17 - ENDIF -ENDIF - - -; 75 "inffast.S" -;FILE "inffast.S" - -;;;GLOBAL _inflate_fast - -;;;SECTION .text - - - - .586p - .mmx - - name inflate_fast_x86 - .MODEL FLAT - -_DATA segment -inflate_fast_use_mmx: - dd 1 - - -_TEXT segment - - - -ALIGN 4 - db 'Fast decoding Code from Chris Anderson' - db 0 - -ALIGN 4 -invalid_literal_length_code_msg: - db 'invalid literal/length code' - db 0 - -ALIGN 4 -invalid_distance_code_msg: - db 'invalid distance code' - db 0 - -ALIGN 4 -invalid_distance_too_far_msg: - db 'invalid distance too far back' - db 0 - - -ALIGN 4 -inflate_fast_mask: -dd 0 -dd 1 -dd 3 -dd 7 -dd 15 -dd 31 -dd 63 -dd 127 -dd 255 -dd 511 -dd 1023 -dd 2047 -dd 4095 -dd 8191 -dd 16383 -dd 32767 -dd 65535 -dd 131071 -dd 262143 -dd 524287 -dd 1048575 -dd 2097151 -dd 4194303 -dd 8388607 -dd 16777215 -dd 33554431 -dd 67108863 -dd 134217727 -dd 268435455 -dd 536870911 -dd 1073741823 -dd 2147483647 -dd 4294967295 - - -mode_state equ 0 ;/* state->mode */ -wsize_state equ (32+zlib1222sup) ;/* state->wsize */ -write_state equ (36+4+zlib1222sup) ;/* state->write */ -window_state equ (40+4+zlib1222sup) ;/* state->window */ -hold_state equ (44+4+zlib1222sup) ;/* state->hold */ -bits_state equ (48+4+zlib1222sup) ;/* state->bits */ -lencode_state equ (64+4+zlib1222sup) ;/* state->lencode */ -distcode_state equ (68+4+zlib1222sup) ;/* state->distcode */ -lenbits_state equ (72+4+zlib1222sup) ;/* state->lenbits */ -distbits_state equ (76+4+zlib1222sup) ;/* state->distbits */ - - -;;SECTION .text -; 205 "inffast.S" -;GLOBAL inflate_fast_use_mmx - -;SECTION .data - - -; GLOBAL inflate_fast_use_mmx:object -;.size inflate_fast_use_mmx, 4 -; 226 "inffast.S" -;SECTION .text - -ALIGN 4 -_inflate_fast proc near -.FPO (16, 4, 0, 0, 1, 0) - push edi - push esi - push ebp - push ebx - pushfd - sub esp,64 - cld - - - - - mov esi, [esp+88] - mov edi, [esi+28] - - - - - - - - mov edx, [esi+4] - mov eax, [esi+0] - - add edx,eax - sub edx,11 - - mov [esp+44],eax - mov [esp+20],edx - - mov ebp, [esp+92] - mov ecx, [esi+16] - mov ebx, [esi+12] - - sub ebp,ecx - neg ebp - add ebp,ebx - - sub ecx,257 - add ecx,ebx - - mov [esp+60],ebx - mov [esp+40],ebp - mov [esp+16],ecx -; 285 "inffast.S" - mov eax, [edi+lencode_state] - mov ecx, [edi+distcode_state] - - mov [esp+8],eax - mov [esp+12],ecx - - mov eax,1 - mov ecx, [edi+lenbits_state] - shl eax,cl - dec eax - mov [esp+0],eax - - mov eax,1 - mov ecx, [edi+distbits_state] - shl eax,cl - dec eax - mov [esp+4],eax - - mov eax, [edi+wsize_state] - mov ecx, [edi+write_state] - mov edx, [edi+window_state] - - mov [esp+52],eax - mov [esp+48],ecx - mov [esp+56],edx - - mov ebp, [edi+hold_state] - mov ebx, [edi+bits_state] -; 321 "inffast.S" - mov esi, [esp+44] - mov ecx, [esp+20] - cmp ecx,esi - ja L_align_long - - add ecx,11 - sub ecx,esi - mov eax,12 - sub eax,ecx - lea edi, [esp+28] - rep movsb - mov ecx,eax - xor eax,eax - rep stosb - lea esi, [esp+28] - mov [esp+20],esi - jmp L_is_aligned - - -L_align_long: - test esi,3 - jz L_is_aligned - xor eax,eax - mov al, [esi] - inc esi - mov ecx,ebx - add ebx,8 - shl eax,cl - or ebp,eax - jmp L_align_long - -L_is_aligned: - mov edi, [esp+60] -; 366 "inffast.S" -L_check_mmx: - cmp dword ptr [inflate_fast_use_mmx],2 - je L_init_mmx - ja L_do_loop - - push eax - push ebx - push ecx - push edx - pushfd - mov eax, [esp] - xor dword ptr [esp],0200000h - - - - - popfd - pushfd - pop edx - xor edx,eax - jz L_dont_use_mmx - xor eax,eax - cpuid - cmp ebx,0756e6547h - jne L_dont_use_mmx - cmp ecx,06c65746eh - jne L_dont_use_mmx - cmp edx,049656e69h - jne L_dont_use_mmx - mov eax,1 - cpuid - shr eax,8 - and eax,15 - cmp eax,6 - jne L_dont_use_mmx - test edx,0800000h - jnz L_use_mmx - jmp L_dont_use_mmx -L_use_mmx: - mov dword ptr [inflate_fast_use_mmx],2 - jmp L_check_mmx_pop -L_dont_use_mmx: - mov dword ptr [inflate_fast_use_mmx],3 -L_check_mmx_pop: - pop edx - pop ecx - pop ebx - pop eax - jmp L_check_mmx -; 426 "inffast.S" -ALIGN 4 -L_do_loop: -; 437 "inffast.S" - cmp bl,15 - ja L_get_length_code - - xor eax,eax - lodsw - mov cl,bl - add bl,16 - shl eax,cl - or ebp,eax - -L_get_length_code: - mov edx, [esp+0] - mov ecx, [esp+8] - and edx,ebp - mov eax, [ecx+edx*4] - -L_dolen: - - - - - - - mov cl,ah - sub bl,ah - shr ebp,cl - - - - - - - test al,al - jnz L_test_for_length_base - - shr eax,16 - stosb - -L_while_test: - - - cmp [esp+16],edi - jbe L_break_loop - - cmp [esp+20],esi - ja L_do_loop - jmp L_break_loop - -L_test_for_length_base: -; 502 "inffast.S" - mov edx,eax - shr edx,16 - mov cl,al - - test al,16 - jz L_test_for_second_level_length - and cl,15 - jz L_save_len - cmp bl,cl - jae L_add_bits_to_len - - mov ch,cl - xor eax,eax - lodsw - mov cl,bl - add bl,16 - shl eax,cl - or ebp,eax - mov cl,ch - -L_add_bits_to_len: - mov eax,1 - shl eax,cl - dec eax - sub bl,cl - and eax,ebp - shr ebp,cl - add edx,eax - -L_save_len: - mov [esp+24],edx - - -L_decode_distance: -; 549 "inffast.S" - cmp bl,15 - ja L_get_distance_code - - xor eax,eax - lodsw - mov cl,bl - add bl,16 - shl eax,cl - or ebp,eax - -L_get_distance_code: - mov edx, [esp+4] - mov ecx, [esp+12] - and edx,ebp - mov eax, [ecx+edx*4] - - -L_dodist: - mov edx,eax - shr edx,16 - mov cl,ah - sub bl,ah - shr ebp,cl -; 584 "inffast.S" - mov cl,al - - test al,16 - jz L_test_for_second_level_dist - and cl,15 - jz L_check_dist_one - cmp bl,cl - jae L_add_bits_to_dist - - mov ch,cl - xor eax,eax - lodsw - mov cl,bl - add bl,16 - shl eax,cl - or ebp,eax - mov cl,ch - -L_add_bits_to_dist: - mov eax,1 - shl eax,cl - dec eax - sub bl,cl - and eax,ebp - shr ebp,cl - add edx,eax - jmp L_check_window - -L_check_window: -; 625 "inffast.S" - mov [esp+44],esi - mov eax,edi - sub eax, [esp+40] - - cmp eax,edx - jb L_clip_window - - mov ecx, [esp+24] - mov esi,edi - sub esi,edx - - sub ecx,3 - mov al, [esi] - mov [edi],al - mov al, [esi+1] - mov dl, [esi+2] - add esi,3 - mov [edi+1],al - mov [edi+2],dl - add edi,3 - rep movsb - - mov esi, [esp+44] - jmp L_while_test - -ALIGN 4 -L_check_dist_one: - cmp edx,1 - jne L_check_window - cmp [esp+40],edi - je L_check_window - - dec edi - mov ecx, [esp+24] - mov al, [edi] - sub ecx,3 - - mov [edi+1],al - mov [edi+2],al - mov [edi+3],al - add edi,4 - rep stosb - - jmp L_while_test - -ALIGN 4 -L_test_for_second_level_length: - - - - - test al,64 - jnz L_test_for_end_of_block - - mov eax,1 - shl eax,cl - dec eax - and eax,ebp - add eax,edx - mov edx, [esp+8] - mov eax, [edx+eax*4] - jmp L_dolen - -ALIGN 4 -L_test_for_second_level_dist: - - - - - test al,64 - jnz L_invalid_distance_code - - mov eax,1 - shl eax,cl - dec eax - and eax,ebp - add eax,edx - mov edx, [esp+12] - mov eax, [edx+eax*4] - jmp L_dodist - -ALIGN 4 -L_clip_window: -; 721 "inffast.S" - mov ecx,eax - mov eax, [esp+52] - neg ecx - mov esi, [esp+56] - - cmp eax,edx - jb L_invalid_distance_too_far - - add ecx,edx - cmp dword ptr [esp+48],0 - jne L_wrap_around_window - - sub eax,ecx - add esi,eax -; 749 "inffast.S" - mov eax, [esp+24] - cmp eax,ecx - jbe L_do_copy1 - - sub eax,ecx - rep movsb - mov esi,edi - sub esi,edx - jmp L_do_copy1 - - cmp eax,ecx - jbe L_do_copy1 - - sub eax,ecx - rep movsb - mov esi,edi - sub esi,edx - jmp L_do_copy1 - -L_wrap_around_window: -; 793 "inffast.S" - mov eax, [esp+48] - cmp ecx,eax - jbe L_contiguous_in_window - - add esi, [esp+52] - add esi,eax - sub esi,ecx - sub ecx,eax - - - mov eax, [esp+24] - cmp eax,ecx - jbe L_do_copy1 - - sub eax,ecx - rep movsb - mov esi, [esp+56] - mov ecx, [esp+48] - cmp eax,ecx - jbe L_do_copy1 - - sub eax,ecx - rep movsb - mov esi,edi - sub esi,edx - jmp L_do_copy1 - -L_contiguous_in_window: -; 836 "inffast.S" - add esi,eax - sub esi,ecx - - - mov eax, [esp+24] - cmp eax,ecx - jbe L_do_copy1 - - sub eax,ecx - rep movsb - mov esi,edi - sub esi,edx - -L_do_copy1: -; 862 "inffast.S" - mov ecx,eax - rep movsb - - mov esi, [esp+44] - jmp L_while_test -; 878 "inffast.S" -ALIGN 4 -L_init_mmx: - emms - - - - - - movd mm0,ebp - mov ebp,ebx -; 896 "inffast.S" - movd mm4,dword ptr [esp+0] - movq mm3,mm4 - movd mm5,dword ptr [esp+4] - movq mm2,mm5 - pxor mm1,mm1 - mov ebx, [esp+8] - jmp L_do_loop_mmx - -ALIGN 4 -L_do_loop_mmx: - psrlq mm0,mm1 - - cmp ebp,32 - ja L_get_length_code_mmx - - movd mm6,ebp - movd mm7,dword ptr [esi] - add esi,4 - psllq mm7,mm6 - add ebp,32 - por mm0,mm7 - -L_get_length_code_mmx: - pand mm4,mm0 - movd eax,mm4 - movq mm4,mm3 - mov eax, [ebx+eax*4] - -L_dolen_mmx: - movzx ecx,ah - movd mm1,ecx - sub ebp,ecx - - test al,al - jnz L_test_for_length_base_mmx - - shr eax,16 - stosb - -L_while_test_mmx: - - - cmp [esp+16],edi - jbe L_break_loop - - cmp [esp+20],esi - ja L_do_loop_mmx - jmp L_break_loop - -L_test_for_length_base_mmx: - - mov edx,eax - shr edx,16 - - test al,16 - jz L_test_for_second_level_length_mmx - and eax,15 - jz L_decode_distance_mmx - - psrlq mm0,mm1 - movd mm1,eax - movd ecx,mm0 - sub ebp,eax - and ecx, [inflate_fast_mask+eax*4] - add edx,ecx - -L_decode_distance_mmx: - psrlq mm0,mm1 - - cmp ebp,32 - ja L_get_dist_code_mmx - - movd mm6,ebp - movd mm7,dword ptr [esi] - add esi,4 - psllq mm7,mm6 - add ebp,32 - por mm0,mm7 - -L_get_dist_code_mmx: - mov ebx, [esp+12] - pand mm5,mm0 - movd eax,mm5 - movq mm5,mm2 - mov eax, [ebx+eax*4] - -L_dodist_mmx: - - movzx ecx,ah - mov ebx,eax - shr ebx,16 - sub ebp,ecx - movd mm1,ecx - - test al,16 - jz L_test_for_second_level_dist_mmx - and eax,15 - jz L_check_dist_one_mmx - -L_add_bits_to_dist_mmx: - psrlq mm0,mm1 - movd mm1,eax - movd ecx,mm0 - sub ebp,eax - and ecx, [inflate_fast_mask+eax*4] - add ebx,ecx - -L_check_window_mmx: - mov [esp+44],esi - mov eax,edi - sub eax, [esp+40] - - cmp eax,ebx - jb L_clip_window_mmx - - mov ecx,edx - mov esi,edi - sub esi,ebx - - sub ecx,3 - mov al, [esi] - mov [edi],al - mov al, [esi+1] - mov dl, [esi+2] - add esi,3 - mov [edi+1],al - mov [edi+2],dl - add edi,3 - rep movsb - - mov esi, [esp+44] - mov ebx, [esp+8] - jmp L_while_test_mmx - -ALIGN 4 -L_check_dist_one_mmx: - cmp ebx,1 - jne L_check_window_mmx - cmp [esp+40],edi - je L_check_window_mmx - - dec edi - mov ecx,edx - mov al, [edi] - sub ecx,3 - - mov [edi+1],al - mov [edi+2],al - mov [edi+3],al - add edi,4 - rep stosb - - mov ebx, [esp+8] - jmp L_while_test_mmx - -ALIGN 4 -L_test_for_second_level_length_mmx: - test al,64 - jnz L_test_for_end_of_block - - and eax,15 - psrlq mm0,mm1 - movd ecx,mm0 - and ecx, [inflate_fast_mask+eax*4] - add ecx,edx - mov eax, [ebx+ecx*4] - jmp L_dolen_mmx - -ALIGN 4 -L_test_for_second_level_dist_mmx: - test al,64 - jnz L_invalid_distance_code - - and eax,15 - psrlq mm0,mm1 - movd ecx,mm0 - and ecx, [inflate_fast_mask+eax*4] - mov eax, [esp+12] - add ecx,ebx - mov eax, [eax+ecx*4] - jmp L_dodist_mmx - -ALIGN 4 -L_clip_window_mmx: - - mov ecx,eax - mov eax, [esp+52] - neg ecx - mov esi, [esp+56] - - cmp eax,ebx - jb L_invalid_distance_too_far - - add ecx,ebx - cmp dword ptr [esp+48],0 - jne L_wrap_around_window_mmx - - sub eax,ecx - add esi,eax - - cmp edx,ecx - jbe L_do_copy1_mmx - - sub edx,ecx - rep movsb - mov esi,edi - sub esi,ebx - jmp L_do_copy1_mmx - - cmp edx,ecx - jbe L_do_copy1_mmx - - sub edx,ecx - rep movsb - mov esi,edi - sub esi,ebx - jmp L_do_copy1_mmx - -L_wrap_around_window_mmx: - - mov eax, [esp+48] - cmp ecx,eax - jbe L_contiguous_in_window_mmx - - add esi, [esp+52] - add esi,eax - sub esi,ecx - sub ecx,eax - - - cmp edx,ecx - jbe L_do_copy1_mmx - - sub edx,ecx - rep movsb - mov esi, [esp+56] - mov ecx, [esp+48] - cmp edx,ecx - jbe L_do_copy1_mmx - - sub edx,ecx - rep movsb - mov esi,edi - sub esi,ebx - jmp L_do_copy1_mmx - -L_contiguous_in_window_mmx: - - add esi,eax - sub esi,ecx - - - cmp edx,ecx - jbe L_do_copy1_mmx - - sub edx,ecx - rep movsb - mov esi,edi - sub esi,ebx - -L_do_copy1_mmx: - - - mov ecx,edx - rep movsb - - mov esi, [esp+44] - mov ebx, [esp+8] - jmp L_while_test_mmx -; 1174 "inffast.S" -L_invalid_distance_code: - - - - - - mov ecx, invalid_distance_code_msg - mov edx,INFLATE_MODE_BAD - jmp L_update_stream_state - -L_test_for_end_of_block: - - - - - - test al,32 - jz L_invalid_literal_length_code - - mov ecx,0 - mov edx,INFLATE_MODE_TYPE - jmp L_update_stream_state - -L_invalid_literal_length_code: - - - - - - mov ecx, invalid_literal_length_code_msg - mov edx,INFLATE_MODE_BAD - jmp L_update_stream_state - -L_invalid_distance_too_far: - - - - mov esi, [esp+44] - mov ecx, invalid_distance_too_far_msg - mov edx,INFLATE_MODE_BAD - jmp L_update_stream_state - -L_update_stream_state: - - mov eax, [esp+88] - test ecx,ecx - jz L_skip_msg - mov [eax+24],ecx -L_skip_msg: - mov eax, [eax+28] - mov [eax+mode_state],edx - jmp L_break_loop - -ALIGN 4 -L_break_loop: -; 1243 "inffast.S" - cmp dword ptr [inflate_fast_use_mmx],2 - jne L_update_next_in - - - - mov ebx,ebp - -L_update_next_in: -; 1266 "inffast.S" - mov eax, [esp+88] - mov ecx,ebx - mov edx, [eax+28] - shr ecx,3 - sub esi,ecx - shl ecx,3 - sub ebx,ecx - mov [eax+12],edi - mov [edx+bits_state],ebx - mov ecx,ebx - - lea ebx, [esp+28] - cmp [esp+20],ebx - jne L_buf_not_used - - sub esi,ebx - mov ebx, [eax+0] - mov [esp+20],ebx - add esi,ebx - mov ebx, [eax+4] - sub ebx,11 - add [esp+20],ebx - -L_buf_not_used: - mov [eax+0],esi - - mov ebx,1 - shl ebx,cl - dec ebx - - - - - - cmp dword ptr [inflate_fast_use_mmx],2 - jne L_update_hold - - - - psrlq mm0,mm1 - movd ebp,mm0 - - emms - -L_update_hold: - - - - and ebp,ebx - mov [edx+hold_state],ebp - - - - - mov ebx, [esp+20] - cmp ebx,esi - jbe L_last_is_smaller - - sub ebx,esi - add ebx,11 - mov [eax+4],ebx - jmp L_fixup_out -L_last_is_smaller: - sub esi,ebx - neg esi - add esi,11 - mov [eax+4],esi - - - - -L_fixup_out: - - mov ebx, [esp+16] - cmp ebx,edi - jbe L_end_is_smaller - - sub ebx,edi - add ebx,257 - mov [eax+16],ebx - jmp L_done -L_end_is_smaller: - sub edi,ebx - neg edi - add edi,257 - mov [eax+16],edi - - - - - -L_done: - add esp,64 - popfd - pop ebx - pop ebp - pop esi - pop edi - ret -_inflate_fast endp - -_TEXT ends -end diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/contrib/masmx86/match686.asm mame-0.243+dfsg.1/3rdparty/zlib/contrib/masmx86/match686.asm --- mame-0.242+dfsg.1/3rdparty/zlib/contrib/masmx86/match686.asm 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/contrib/masmx86/match686.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,479 +0,0 @@ -; match686.asm -- Asm portion of the optimized longest_match for 32 bits x86 -; Copyright (C) 1995-1996 Jean-loup Gailly, Brian Raiter and Gilles Vollant. -; File written by Gilles Vollant, by converting match686.S from Brian Raiter -; for MASM. This is as assembly version of longest_match -; from Jean-loup Gailly in deflate.c -; -; http://www.zlib.net -; http://www.winimage.com/zLibDll -; http://www.muppetlabs.com/~breadbox/software/assembly.html -; -; For Visual C++ 4.x and higher and ML 6.x and higher -; ml.exe is distributed in -; http://www.microsoft.com/downloads/details.aspx?FamilyID=7a1c9da0-0510-44a2-b042-7ef370530c64 -; -; this file contain two implementation of longest_match -; -; this longest_match was written by Brian raiter (1998), optimized for Pentium Pro -; (and the faster known version of match_init on modern Core 2 Duo and AMD Phenom) -; -; for using an assembly version of longest_match, you need define ASMV in project -; -; compile the asm file running -; ml /coff /Zi /c /Flmatch686.lst match686.asm -; and do not include match686.obj in your project -; -; note: contrib of zLib 1.2.3 and earlier contained both a deprecated version for -; Pentium (prior Pentium Pro) and this version for Pentium Pro and modern processor -; with autoselect (with cpu detection code) -; if you want support the old pentium optimization, you can still use these version -; -; this file is not optimized for old pentium, but it compatible with all x86 32 bits -; processor (starting 80386) -; -; -; see below : zlib1222add must be adjuster if you use a zlib version < 1.2.2.2 - -;uInt longest_match(s, cur_match) -; deflate_state *s; -; IPos cur_match; /* current match */ - - NbStack equ 76 - cur_match equ dword ptr[esp+NbStack-0] - str_s equ dword ptr[esp+NbStack-4] -; 5 dword on top (ret,ebp,esi,edi,ebx) - adrret equ dword ptr[esp+NbStack-8] - pushebp equ dword ptr[esp+NbStack-12] - pushedi equ dword ptr[esp+NbStack-16] - pushesi equ dword ptr[esp+NbStack-20] - pushebx equ dword ptr[esp+NbStack-24] - - chain_length equ dword ptr [esp+NbStack-28] - limit equ dword ptr [esp+NbStack-32] - best_len equ dword ptr [esp+NbStack-36] - window equ dword ptr [esp+NbStack-40] - prev equ dword ptr [esp+NbStack-44] - scan_start equ word ptr [esp+NbStack-48] - wmask equ dword ptr [esp+NbStack-52] - match_start_ptr equ dword ptr [esp+NbStack-56] - nice_match equ dword ptr [esp+NbStack-60] - scan equ dword ptr [esp+NbStack-64] - - windowlen equ dword ptr [esp+NbStack-68] - match_start equ dword ptr [esp+NbStack-72] - strend equ dword ptr [esp+NbStack-76] - NbStackAdd equ (NbStack-24) - - .386p - - name gvmatch - .MODEL FLAT - - - -; all the +zlib1222add offsets are due to the addition of fields -; in zlib in the deflate_state structure since the asm code was first written -; (if you compile with zlib 1.0.4 or older, use "zlib1222add equ (-4)"). -; (if you compile with zlib between 1.0.5 and 1.2.2.1, use "zlib1222add equ 0"). -; if you compile with zlib 1.2.2.2 or later , use "zlib1222add equ 8"). - - zlib1222add equ 8 - -; Note : these value are good with a 8 bytes boundary pack structure - dep_chain_length equ 74h+zlib1222add - dep_window equ 30h+zlib1222add - dep_strstart equ 64h+zlib1222add - dep_prev_length equ 70h+zlib1222add - dep_nice_match equ 88h+zlib1222add - dep_w_size equ 24h+zlib1222add - dep_prev equ 38h+zlib1222add - dep_w_mask equ 2ch+zlib1222add - dep_good_match equ 84h+zlib1222add - dep_match_start equ 68h+zlib1222add - dep_lookahead equ 6ch+zlib1222add - - -_TEXT segment - -IFDEF NOUNDERLINE - public longest_match - public match_init -ELSE - public _longest_match - public _match_init -ENDIF - - MAX_MATCH equ 258 - MIN_MATCH equ 3 - MIN_LOOKAHEAD equ (MAX_MATCH+MIN_MATCH+1) - - - -MAX_MATCH equ 258 -MIN_MATCH equ 3 -MIN_LOOKAHEAD equ (MAX_MATCH + MIN_MATCH + 1) -MAX_MATCH_8_ equ ((MAX_MATCH + 7) AND 0FFF0h) - - -;;; stack frame offsets - -chainlenwmask equ esp + 0 ; high word: current chain len - ; low word: s->wmask -window equ esp + 4 ; local copy of s->window -windowbestlen equ esp + 8 ; s->window + bestlen -scanstart equ esp + 16 ; first two bytes of string -scanend equ esp + 12 ; last two bytes of string -scanalign equ esp + 20 ; dword-misalignment of string -nicematch equ esp + 24 ; a good enough match size -bestlen equ esp + 28 ; size of best match so far -scan equ esp + 32 ; ptr to string wanting match - -LocalVarsSize equ 36 -; saved ebx byte esp + 36 -; saved edi byte esp + 40 -; saved esi byte esp + 44 -; saved ebp byte esp + 48 -; return address byte esp + 52 -deflatestate equ esp + 56 ; the function arguments -curmatch equ esp + 60 - -;;; Offsets for fields in the deflate_state structure. These numbers -;;; are calculated from the definition of deflate_state, with the -;;; assumption that the compiler will dword-align the fields. (Thus, -;;; changing the definition of deflate_state could easily cause this -;;; program to crash horribly, without so much as a warning at -;;; compile time. Sigh.) - -dsWSize equ 36+zlib1222add -dsWMask equ 44+zlib1222add -dsWindow equ 48+zlib1222add -dsPrev equ 56+zlib1222add -dsMatchLen equ 88+zlib1222add -dsPrevMatch equ 92+zlib1222add -dsStrStart equ 100+zlib1222add -dsMatchStart equ 104+zlib1222add -dsLookahead equ 108+zlib1222add -dsPrevLen equ 112+zlib1222add -dsMaxChainLen equ 116+zlib1222add -dsGoodMatch equ 132+zlib1222add -dsNiceMatch equ 136+zlib1222add - - -;;; match686.asm -- Pentium-Pro-optimized version of longest_match() -;;; Written for zlib 1.1.2 -;;; Copyright (C) 1998 Brian Raiter -;;; You can look at http://www.muppetlabs.com/~breadbox/software/assembly.html -;;; -;; -;; This software is provided 'as-is', without any express or implied -;; warranty. In no event will the authors be held liable for any damages -;; arising from the use of this software. -;; -;; Permission is granted to anyone to use this software for any purpose, -;; including commercial applications, and to alter it and redistribute it -;; freely, subject to the following restrictions: -;; -;; 1. The origin of this software must not be misrepresented; you must not -;; claim that you wrote the original software. If you use this software -;; in a product, an acknowledgment in the product documentation would be -;; appreciated but is not required. -;; 2. Altered source versions must be plainly marked as such, and must not be -;; misrepresented as being the original software -;; 3. This notice may not be removed or altered from any source distribution. -;; - -;GLOBAL _longest_match, _match_init - - -;SECTION .text - -;;; uInt longest_match(deflate_state *deflatestate, IPos curmatch) - -;_longest_match: - IFDEF NOUNDERLINE - longest_match proc near - ELSE - _longest_match proc near - ENDIF -.FPO (9, 4, 0, 0, 1, 0) - -;;; Save registers that the compiler may be using, and adjust esp to -;;; make room for our stack frame. - - push ebp - push edi - push esi - push ebx - sub esp, LocalVarsSize - -;;; Retrieve the function arguments. ecx will hold cur_match -;;; throughout the entire function. edx will hold the pointer to the -;;; deflate_state structure during the function's setup (before -;;; entering the main loop. - - mov edx, [deflatestate] - mov ecx, [curmatch] - -;;; uInt wmask = s->w_mask; -;;; unsigned chain_length = s->max_chain_length; -;;; if (s->prev_length >= s->good_match) { -;;; chain_length >>= 2; -;;; } - - mov eax, [edx + dsPrevLen] - mov ebx, [edx + dsGoodMatch] - cmp eax, ebx - mov eax, [edx + dsWMask] - mov ebx, [edx + dsMaxChainLen] - jl LastMatchGood - shr ebx, 2 -LastMatchGood: - -;;; chainlen is decremented once beforehand so that the function can -;;; use the sign flag instead of the zero flag for the exit test. -;;; It is then shifted into the high word, to make room for the wmask -;;; value, which it will always accompany. - - dec ebx - shl ebx, 16 - or ebx, eax - mov [chainlenwmask], ebx - -;;; if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead; - - mov eax, [edx + dsNiceMatch] - mov ebx, [edx + dsLookahead] - cmp ebx, eax - jl LookaheadLess - mov ebx, eax -LookaheadLess: mov [nicematch], ebx - -;;; register Bytef *scan = s->window + s->strstart; - - mov esi, [edx + dsWindow] - mov [window], esi - mov ebp, [edx + dsStrStart] - lea edi, [esi + ebp] - mov [scan], edi - -;;; Determine how many bytes the scan ptr is off from being -;;; dword-aligned. - - mov eax, edi - neg eax - and eax, 3 - mov [scanalign], eax - -;;; IPos limit = s->strstart > (IPos)MAX_DIST(s) ? -;;; s->strstart - (IPos)MAX_DIST(s) : NIL; - - mov eax, [edx + dsWSize] - sub eax, MIN_LOOKAHEAD - sub ebp, eax - jg LimitPositive - xor ebp, ebp -LimitPositive: - -;;; int best_len = s->prev_length; - - mov eax, [edx + dsPrevLen] - mov [bestlen], eax - -;;; Store the sum of s->window + best_len in esi locally, and in esi. - - add esi, eax - mov [windowbestlen], esi - -;;; register ush scan_start = *(ushf*)scan; -;;; register ush scan_end = *(ushf*)(scan+best_len-1); -;;; Posf *prev = s->prev; - - movzx ebx, word ptr [edi] - mov [scanstart], ebx - movzx ebx, word ptr [edi + eax - 1] - mov [scanend], ebx - mov edi, [edx + dsPrev] - -;;; Jump into the main loop. - - mov edx, [chainlenwmask] - jmp short LoopEntry - -align 4 - -;;; do { -;;; match = s->window + cur_match; -;;; if (*(ushf*)(match+best_len-1) != scan_end || -;;; *(ushf*)match != scan_start) continue; -;;; [...] -;;; } while ((cur_match = prev[cur_match & wmask]) > limit -;;; && --chain_length != 0); -;;; -;;; Here is the inner loop of the function. The function will spend the -;;; majority of its time in this loop, and majority of that time will -;;; be spent in the first ten instructions. -;;; -;;; Within this loop: -;;; ebx = scanend -;;; ecx = curmatch -;;; edx = chainlenwmask - i.e., ((chainlen << 16) | wmask) -;;; esi = windowbestlen - i.e., (window + bestlen) -;;; edi = prev -;;; ebp = limit - -LookupLoop: - and ecx, edx - movzx ecx, word ptr [edi + ecx*2] - cmp ecx, ebp - jbe LeaveNow - sub edx, 00010000h - js LeaveNow -LoopEntry: movzx eax, word ptr [esi + ecx - 1] - cmp eax, ebx - jnz LookupLoop - mov eax, [window] - movzx eax, word ptr [eax + ecx] - cmp eax, [scanstart] - jnz LookupLoop - -;;; Store the current value of chainlen. - - mov [chainlenwmask], edx - -;;; Point edi to the string under scrutiny, and esi to the string we -;;; are hoping to match it up with. In actuality, esi and edi are -;;; both pointed (MAX_MATCH_8 - scanalign) bytes ahead, and edx is -;;; initialized to -(MAX_MATCH_8 - scanalign). - - mov esi, [window] - mov edi, [scan] - add esi, ecx - mov eax, [scanalign] - mov edx, 0fffffef8h; -(MAX_MATCH_8) - lea edi, [edi + eax + 0108h] ;MAX_MATCH_8] - lea esi, [esi + eax + 0108h] ;MAX_MATCH_8] - -;;; Test the strings for equality, 8 bytes at a time. At the end, -;;; adjust edx so that it is offset to the exact byte that mismatched. -;;; -;;; We already know at this point that the first three bytes of the -;;; strings match each other, and they can be safely passed over before -;;; starting the compare loop. So what this code does is skip over 0-3 -;;; bytes, as much as necessary in order to dword-align the edi -;;; pointer. (esi will still be misaligned three times out of four.) -;;; -;;; It should be confessed that this loop usually does not represent -;;; much of the total running time. Replacing it with a more -;;; straightforward "rep cmpsb" would not drastically degrade -;;; performance. - -LoopCmps: - mov eax, [esi + edx] - xor eax, [edi + edx] - jnz LeaveLoopCmps - mov eax, [esi + edx + 4] - xor eax, [edi + edx + 4] - jnz LeaveLoopCmps4 - add edx, 8 - jnz LoopCmps - jmp short LenMaximum -LeaveLoopCmps4: add edx, 4 -LeaveLoopCmps: test eax, 0000FFFFh - jnz LenLower - add edx, 2 - shr eax, 16 -LenLower: sub al, 1 - adc edx, 0 - -;;; Calculate the length of the match. If it is longer than MAX_MATCH, -;;; then automatically accept it as the best possible match and leave. - - lea eax, [edi + edx] - mov edi, [scan] - sub eax, edi - cmp eax, MAX_MATCH - jge LenMaximum - -;;; If the length of the match is not longer than the best match we -;;; have so far, then forget it and return to the lookup loop. - - mov edx, [deflatestate] - mov ebx, [bestlen] - cmp eax, ebx - jg LongerMatch - mov esi, [windowbestlen] - mov edi, [edx + dsPrev] - mov ebx, [scanend] - mov edx, [chainlenwmask] - jmp LookupLoop - -;;; s->match_start = cur_match; -;;; best_len = len; -;;; if (len >= nice_match) break; -;;; scan_end = *(ushf*)(scan+best_len-1); - -LongerMatch: mov ebx, [nicematch] - mov [bestlen], eax - mov [edx + dsMatchStart], ecx - cmp eax, ebx - jge LeaveNow - mov esi, [window] - add esi, eax - mov [windowbestlen], esi - movzx ebx, word ptr [edi + eax - 1] - mov edi, [edx + dsPrev] - mov [scanend], ebx - mov edx, [chainlenwmask] - jmp LookupLoop - -;;; Accept the current string, with the maximum possible length. - -LenMaximum: mov edx, [deflatestate] - mov dword ptr [bestlen], MAX_MATCH - mov [edx + dsMatchStart], ecx - -;;; if ((uInt)best_len <= s->lookahead) return (uInt)best_len; -;;; return s->lookahead; - -LeaveNow: - mov edx, [deflatestate] - mov ebx, [bestlen] - mov eax, [edx + dsLookahead] - cmp ebx, eax - jg LookaheadRet - mov eax, ebx -LookaheadRet: - -;;; Restore the stack and return from whence we came. - - add esp, LocalVarsSize - pop ebx - pop esi - pop edi - pop ebp - - ret -; please don't remove this string ! -; Your can freely use match686 in any free or commercial app if you don't remove the string in the binary! - db 0dh,0ah,"asm686 with masm, optimised assembly code from Brian Raiter, written 1998",0dh,0ah - - - IFDEF NOUNDERLINE - longest_match endp - ELSE - _longest_match endp - ENDIF - - IFDEF NOUNDERLINE - match_init proc near - ret - match_init endp - ELSE - _match_init proc near - ret - _match_init endp - ENDIF - - -_TEXT ends -end diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/contrib/masmx86/readme.txt mame-0.243+dfsg.1/3rdparty/zlib/contrib/masmx86/readme.txt --- mame-0.242+dfsg.1/3rdparty/zlib/contrib/masmx86/readme.txt 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/contrib/masmx86/readme.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ - -Summary -------- -This directory contains ASM implementations of the functions -longest_match() and inflate_fast(). - - -Use instructions ----------------- -Assemble using MASM, and copy the object files into the zlib source -directory, then run the appropriate makefile, as suggested below. You can -donwload MASM from here: - - http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=7a1c9da0-0510-44a2-b042-7ef370530c64 - -You can also get objects files here: - - http://www.winimage.com/zLibDll/zlib124_masm_obj.zip - -Build instructions ------------------- -* With Microsoft C and MASM: -nmake -f win32/Makefile.msc LOC="-DASMV -DASMINF" OBJA="match686.obj inffas32.obj" - -* With Borland C and TASM: -make -f win32/Makefile.bor LOCAL_ZLIB="-DASMV -DASMINF" OBJA="match686.obj inffas32.obj" OBJPA="+match686c.obj+match686.obj+inffas32.obj" - diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/contrib/minizip/configure.ac mame-0.243+dfsg.1/3rdparty/zlib/contrib/minizip/configure.ac --- mame-0.242+dfsg.1/3rdparty/zlib/contrib/minizip/configure.ac 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/contrib/minizip/configure.ac 2022-04-29 05:37:26.000000000 +0000 @@ -1,7 +1,7 @@ # -*- Autoconf -*- # Process this file with autoconf to produce a configure script. -AC_INIT([minizip], [1.2.11], [bugzilla.redhat.com]) +AC_INIT([minizip], [1.2.12], [bugzilla.redhat.com]) AC_CONFIG_SRCDIR([minizip.c]) AM_INIT_AUTOMAKE([foreign]) LT_INIT diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/contrib/minizip/crypt.h mame-0.243+dfsg.1/3rdparty/zlib/contrib/minizip/crypt.h --- mame-0.242+dfsg.1/3rdparty/zlib/contrib/minizip/crypt.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/contrib/minizip/crypt.h 2022-04-29 05:37:26.000000000 +0000 @@ -38,6 +38,7 @@ * unpredictable manner on 16-bit systems; not a problem * with any known compiler so far, though */ + (void)pcrc_32_tab; temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2; return (int)(((temp * (temp ^ 1)) >> 8) & 0xff); } @@ -77,24 +78,24 @@ (update_keys(pkeys,pcrc_32_tab,c ^= decrypt_byte(pkeys,pcrc_32_tab))) #define zencode(pkeys,pcrc_32_tab,c,t) \ - (t=decrypt_byte(pkeys,pcrc_32_tab), update_keys(pkeys,pcrc_32_tab,c), t^(c)) + (t=decrypt_byte(pkeys,pcrc_32_tab), update_keys(pkeys,pcrc_32_tab,c), (Byte)t^(c)) #ifdef INCLUDECRYPTINGCODE_IFCRYPTALLOWED #define RAND_HEAD_LEN 12 /* "last resort" source for second part of crypt seed pattern */ # ifndef ZCR_SEED2 -# define ZCR_SEED2 3141592654UL /* use PI as default pattern */ +# define ZCR_SEED2 3141592654L /* use PI as default pattern */ # endif -static int crypthead(const char* passwd, /* password string */ - unsigned char* buf, /* where to write header */ - int bufSize, - unsigned long* pkeys, - const z_crc_t* pcrc_32_tab, - unsigned long crcForCrypting) +static unsigned crypthead(const char* passwd, /* password string */ + unsigned char* buf, /* where to write header */ + int bufSize, + unsigned long* pkeys, + const z_crc_t* pcrc_32_tab, + unsigned long crcForCrypting) { - int n; /* index in random header */ + unsigned n; /* index in random header */ int t; /* temporary */ int c; /* random byte */ unsigned char header[RAND_HEAD_LEN-2]; /* random header */ diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/contrib/minizip/ioapi.c mame-0.243+dfsg.1/3rdparty/zlib/contrib/minizip/ioapi.c --- mame-0.242+dfsg.1/3rdparty/zlib/contrib/minizip/ioapi.c 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/contrib/minizip/ioapi.c 2022-04-29 05:37:26.000000000 +0000 @@ -58,7 +58,7 @@ return (*(pfilefunc->zfile_func64.ztell64_file)) (pfilefunc->zfile_func64.opaque,filestream); else { - uLong tell_uLong = (*(pfilefunc->ztell32_file))(pfilefunc->zfile_func64.opaque,filestream); + uLong tell_uLong = (uLong)(*(pfilefunc->ztell32_file))(pfilefunc->zfile_func64.opaque,filestream); if ((tell_uLong) == MAXU32) return (ZPOS64_T)-1; else @@ -94,6 +94,7 @@ static voidpf ZCALLBACK fopen_file_func (voidpf opaque, const char* filename, int mode) { + (void)opaque; FILE* file = NULL; const char* mode_fopen = NULL; if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) @@ -112,6 +113,7 @@ static voidpf ZCALLBACK fopen64_file_func (voidpf opaque, const void* filename, int mode) { + (void)opaque; FILE* file = NULL; const char* mode_fopen = NULL; if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) @@ -131,6 +133,7 @@ static uLong ZCALLBACK fread_file_func (voidpf opaque, voidpf stream, void* buf, uLong size) { + (void)opaque; uLong ret; ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream); return ret; @@ -138,6 +141,7 @@ static uLong ZCALLBACK fwrite_file_func (voidpf opaque, voidpf stream, const void* buf, uLong size) { + (void)opaque; uLong ret; ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream); return ret; @@ -145,6 +149,7 @@ static long ZCALLBACK ftell_file_func (voidpf opaque, voidpf stream) { + (void)opaque; long ret; ret = ftell((FILE *)stream); return ret; @@ -153,13 +158,15 @@ static ZPOS64_T ZCALLBACK ftell64_file_func (voidpf opaque, voidpf stream) { + (void)opaque; ZPOS64_T ret; - ret = FTELLO_FUNC((FILE *)stream); + ret = (ZPOS64_T)FTELLO_FUNC((FILE *)stream); return ret; } static long ZCALLBACK fseek_file_func (voidpf opaque, voidpf stream, uLong offset, int origin) { + (void)opaque; int fseek_origin=0; long ret; switch (origin) @@ -176,13 +183,14 @@ default: return -1; } ret = 0; - if (fseek((FILE *)stream, offset, fseek_origin) != 0) + if (fseek((FILE *)stream, (long)offset, fseek_origin) != 0) ret = -1; return ret; } static long ZCALLBACK fseek64_file_func (voidpf opaque, voidpf stream, ZPOS64_T offset, int origin) { + (void)opaque; int fseek_origin=0; long ret; switch (origin) @@ -200,7 +208,7 @@ } ret = 0; - if(FSEEKO_FUNC((FILE *)stream, offset, fseek_origin) != 0) + if(FSEEKO_FUNC((FILE *)stream, (long)offset, fseek_origin) != 0) ret = -1; return ret; @@ -209,6 +217,7 @@ static int ZCALLBACK fclose_file_func (voidpf opaque, voidpf stream) { + (void)opaque; int ret; ret = fclose((FILE *)stream); return ret; @@ -216,6 +225,7 @@ static int ZCALLBACK ferror_file_func (voidpf opaque, voidpf stream) { + (void)opaque; int ret; ret = ferror((FILE *)stream); return ret; diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/contrib/minizip/ioapi.h mame-0.243+dfsg.1/3rdparty/zlib/contrib/minizip/ioapi.h --- mame-0.242+dfsg.1/3rdparty/zlib/contrib/minizip/ioapi.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/contrib/minizip/ioapi.h 2022-04-29 05:37:26.000000000 +0000 @@ -91,8 +91,7 @@ typedef uint64_t ZPOS64_T; #else -/* Maximum unsigned 32-bit value used as placeholder for zip64 */ -#define MAXU32 0xffffffff + #if defined(_MSC_VER) || defined(__BORLANDC__) typedef unsigned __int64 ZPOS64_T; @@ -102,7 +101,10 @@ #endif #endif - +/* Maximum unsigned 32-bit value used as placeholder for zip64 */ +#ifndef MAXU32 +#define MAXU32 (0xffffffff) +#endif #ifdef __cplusplus extern "C" { diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/contrib/minizip/Makefile mame-0.243+dfsg.1/3rdparty/zlib/contrib/minizip/Makefile --- mame-0.242+dfsg.1/3rdparty/zlib/contrib/minizip/Makefile 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/contrib/minizip/Makefile 2022-04-29 05:37:26.000000000 +0000 @@ -1,5 +1,5 @@ CC=cc -CFLAGS=-O -I../.. +CFLAGS := $(CFLAGS) -O -I../.. UNZ_OBJS = miniunz.o unzip.o ioapi.o ../../libz.a ZIP_OBJS = minizip.o zip.o ioapi.o ../../libz.a @@ -16,10 +16,14 @@ $(CC) $(CFLAGS) -o $@ $(ZIP_OBJS) test: miniunz minizip - ./minizip test readme.txt + @rm -f test.* + @echo hello hello hello > test.txt + ./minizip test test.txt ./miniunz -l test.zip - mv readme.txt readme.old + @mv test.txt test.old ./miniunz test.zip + @cmp test.txt test.old + @rm -f test.* clean: - /bin/rm -f *.o *~ minizip miniunz + /bin/rm -f *.o *~ minizip miniunz test.* diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/contrib/minizip/miniunz.c mame-0.243+dfsg.1/3rdparty/zlib/contrib/minizip/miniunz.c --- mame-0.242+dfsg.1/3rdparty/zlib/contrib/minizip/miniunz.c 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/contrib/minizip/miniunz.c 2022-04-29 05:37:26.000000000 +0000 @@ -45,6 +45,7 @@ #include #include #include +#include #ifdef _WIN32 # include @@ -80,7 +81,7 @@ filename : the filename of the file where date/time must be modified dosdate : the new date at the MSDos format (4 bytes) tmu_date : the SAME new date at the tm_unz format */ -void change_file_date(filename,dosdate,tmu_date) +static void change_file_date(filename,dosdate,tmu_date) const char *filename; uLong dosdate; tm_unz tmu_date; @@ -97,7 +98,8 @@ SetFileTime(hFile,&ftm,&ftLastAcc,&ftm); CloseHandle(hFile); #else -#ifdef unix || __APPLE__ +#if defined(unix) || defined(__APPLE__) + (void)dosdate; struct utimbuf ut; struct tm newdate; newdate.tm_sec = tmu_date.tm_sec; @@ -121,7 +123,7 @@ /* mymkdir and change_file_date are not 100 % portable As I don't know well Unix, I wait feedback for the unix portion */ -int mymkdir(dirname) +static int mymkdir(dirname) const char* dirname; { int ret=0; @@ -135,14 +137,14 @@ return ret; } -int makedir (newdir) - char *newdir; +static int makedir (newdir) + const char *newdir; { char *buffer ; char *p; - int len = (int)strlen(newdir); + size_t len = strlen(newdir); - if (len <= 0) + if (len == 0) return 0; buffer = (char*)malloc(len+1); @@ -185,13 +187,13 @@ return 1; } -void do_banner() +static void do_banner() { printf("MiniUnz 1.01b, demo of zLib + Unz package written by Gilles Vollant\n"); printf("more info at http://www.winimage.com/zLibDll/unzip.html\n\n"); } -void do_help() +static void do_help() { printf("Usage : miniunz [-e] [-x] [-v] [-l] [-o] [-p password] file.zip [file_to_extr.] [-d extractdir]\n\n" \ " -e Extract without pathname (junk paths)\n" \ @@ -203,7 +205,7 @@ " -p extract crypted file using password\n\n"); } -void Display64BitsSize(ZPOS64_T n, int size_char) +static void Display64BitsSize(ZPOS64_T n, int size_char) { /* to avoid compatibility problem , we do here the conversion */ char number[21]; @@ -231,7 +233,7 @@ printf("%s",&number[pos_string]); } -int do_list(uf) +static int do_list(uf) unzFile uf; { uLong i; @@ -309,7 +311,7 @@ } -int do_extract_currentfile(uf,popt_extract_without_path,popt_overwrite,password) +static int do_extract_currentfile(uf,popt_extract_without_path,popt_overwrite,password) unzFile uf; const int* popt_extract_without_path; int* popt_overwrite; @@ -324,7 +326,6 @@ uInt size_buf; unz_file_info64 file_info; - uLong ratio=0; err = unzGetCurrentFileInfo64(uf,&file_info,filename_inzip,sizeof(filename_inzip),NULL,0,NULL,0); if (err!=UNZ_OK) @@ -439,7 +440,7 @@ break; } if (err>0) - if (fwrite(buf,err,1,fout)!=1) + if (fwrite(buf,(unsigned)err,1,fout)!=1) { printf("error in writing extracted file\n"); err=UNZ_ERRNO; @@ -472,7 +473,7 @@ } -int do_extract(uf,opt_extract_without_path,opt_overwrite,password) +static int do_extract(uf,opt_extract_without_path,opt_overwrite,password) unzFile uf; int opt_extract_without_path; int opt_overwrite; @@ -481,7 +482,6 @@ uLong i; unz_global_info64 gi; int err; - FILE* fout=NULL; err = unzGetGlobalInfo64(uf,&gi); if (err!=UNZ_OK) @@ -508,14 +508,13 @@ return 0; } -int do_extract_onefile(uf,filename,opt_extract_without_path,opt_overwrite,password) +static int do_extract_onefile(uf,filename,opt_extract_without_path,opt_overwrite,password) unzFile uf; const char* filename; int opt_extract_without_path; int opt_overwrite; const char* password; { - int err = UNZ_OK; if (unzLocateFile(uf,filename,CASESENSITIVITY)!=UNZ_OK) { printf("file %s not found in the zipfile\n",filename); diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/contrib/minizip/minizip.c mame-0.243+dfsg.1/3rdparty/zlib/contrib/minizip/minizip.c --- mame-0.242+dfsg.1/3rdparty/zlib/contrib/minizip/minizip.c 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/contrib/minizip/minizip.c 2022-04-29 05:37:26.000000000 +0000 @@ -71,8 +71,8 @@ #define MAXFILENAME (256) #ifdef _WIN32 -uLong filetime(f, tmzip, dt) - char *f; /* name of file to get info on */ +static int filetime(f, tmzip, dt) + const char *f; /* name of file to get info on */ tm_zip *tmzip; /* return value: access, modific. and creation times */ uLong *dt; /* dostime */ { @@ -94,12 +94,13 @@ return ret; } #else -#ifdef unix || __APPLE__ -uLong filetime(f, tmzip, dt) - char *f; /* name of file to get info on */ +#if defined(unix) || defined(__APPLE__) +static int filetime(f, tmzip, dt) + const char *f; /* name of file to get info on */ tm_zip *tmzip; /* return value: access, modific. and creation times */ uLong *dt; /* dostime */ { + (void)dt; int ret=0; struct stat s; /* results of stat() */ struct tm* filedate; @@ -108,7 +109,7 @@ if (strcmp(f,"-")!=0) { char name[MAXFILENAME+1]; - int len = strlen(f); + size_t len = strlen(f); if (len > MAXFILENAME) len = MAXFILENAME; @@ -138,7 +139,7 @@ } #else uLong filetime(f, tmzip, dt) - char *f; /* name of file to get info on */ + const char *f; /* name of file to get info on */ tm_zip *tmzip; /* return value: access, modific. and creation times */ uLong *dt; /* dostime */ { @@ -150,7 +151,7 @@ -int check_exist_file(filename) +static int check_exist_file(filename) const char* filename; { FILE* ftestexist; @@ -163,13 +164,13 @@ return ret; } -void do_banner() +static void do_banner() { printf("MiniZip 1.1, demo of zLib + MiniZip64 package, written by Gilles Vollant\n"); printf("more info on MiniZip at http://www.winimage.com/zLibDll/minizip.html\n\n"); } -void do_help() +static void do_help() { printf("Usage : minizip [-o] [-a] [-0 to -9] [-p password] [-j] file.zip [files_to_add]\n\n" \ " -o Overwrite existing file.zip\n" \ @@ -182,7 +183,7 @@ /* calculate the CRC32 of a file, because to encrypt a file, we need known the CRC32 of the file before */ -int getFileCrc(const char* filenameinzip,void*buf,unsigned long size_buf,unsigned long* result_crc) +static int getFileCrc(const char* filenameinzip,void*buf,unsigned long size_buf,unsigned long* result_crc) { unsigned long calculate_crc=0; int err=ZIP_OK; @@ -199,7 +200,7 @@ do { err = ZIP_OK; - size_read = (int)fread(buf,1,size_buf,fin); + size_read = fread(buf,1,size_buf,fin); if (size_read < size_buf) if (feof(fin)==0) { @@ -208,7 +209,7 @@ } if (size_read>0) - calculate_crc = crc32(calculate_crc,buf,size_read); + calculate_crc = crc32_z(calculate_crc,buf,size_read); total_read += size_read; } while ((err == ZIP_OK) && (size_read>0)); @@ -221,7 +222,7 @@ return err; } -int isLargeFile(const char* filename) +static int isLargeFile(const char* filename) { int largeFile = 0; ZPOS64_T pos = 0; @@ -229,8 +230,8 @@ if(pFile != NULL) { - int n = FSEEKO_FUNC(pFile, 0, SEEK_END); - pos = FTELLO_FUNC(pFile); + FSEEKO_FUNC(pFile, 0, SEEK_END); + pos = (ZPOS64_T)FTELLO_FUNC(pFile); printf("File : %s is %lld bytes\n", filename, pos); @@ -255,7 +256,7 @@ char filename_try[MAXFILENAME+16]; int zipok; int err=0; - int size_buf=0; + size_t size_buf=0; void* buf=NULL; const char* password=NULL; @@ -396,7 +397,7 @@ (strlen(argv[i]) == 2))) { FILE * fin; - int size_read; + size_t size_read; const char* filenameinzip = argv[i]; const char *savefilenameinzip; zip_fileinfo zi; @@ -472,7 +473,7 @@ do { err = ZIP_OK; - size_read = (int)fread(buf,1,size_buf,fin); + size_read = fread(buf,1,size_buf,fin); if (size_read < size_buf) if (feof(fin)==0) { @@ -482,7 +483,7 @@ if (size_read>0) { - err = zipWriteInFileInZip (zf,buf,size_read); + err = zipWriteInFileInZip (zf,buf,(unsigned)size_read); if (err<0) { printf("error in writing %s in the zipfile\n", diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/contrib/minizip/unzip.c mame-0.243+dfsg.1/3rdparty/zlib/contrib/minizip/unzip.c --- mame-0.242+dfsg.1/3rdparty/zlib/contrib/minizip/unzip.c 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/contrib/minizip/unzip.c 2022-04-29 05:37:26.000000000 +0000 @@ -455,7 +455,7 @@ if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06)) { - uPosFound = uReadPos+i; + uPosFound = uReadPos+(unsigned)i; break; } @@ -523,7 +523,7 @@ if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && ((*(buf+i+2))==0x06) && ((*(buf+i+3))==0x07)) { - uPosFound = uReadPos+i; + uPosFound = uReadPos+(unsigned)i; break; } @@ -853,13 +853,13 @@ { ZPOS64_T uDate; uDate = (ZPOS64_T)(ulDosDate>>16); - ptm->tm_mday = (uInt)(uDate&0x1f) ; - ptm->tm_mon = (uInt)((((uDate)&0x1E0)/0x20)-1) ; - ptm->tm_year = (uInt)(((uDate&0x0FE00)/0x0200)+1980) ; - - ptm->tm_hour = (uInt) ((ulDosDate &0xF800)/0x800); - ptm->tm_min = (uInt) ((ulDosDate&0x7E0)/0x20) ; - ptm->tm_sec = (uInt) (2*(ulDosDate&0x1f)) ; + ptm->tm_mday = (int)(uDate&0x1f) ; + ptm->tm_mon = (int)((((uDate)&0x1E0)/0x20)-1) ; + ptm->tm_year = (int)(((uDate&0x0FE00)/0x0200)+1980) ; + + ptm->tm_hour = (int) ((ulDosDate &0xF800)/0x800); + ptm->tm_min = (int) ((ulDosDate&0x7E0)/0x20) ; + ptm->tm_sec = (int) (2*(ulDosDate&0x1f)) ; } /* @@ -993,7 +993,7 @@ if (lSeek!=0) { - if (ZSEEK64(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) + if (ZSEEK64(s->z_filefunc, s->filestream,(ZPOS64_T)lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) lSeek=0; else err=UNZ_ERRNO; @@ -1018,7 +1018,7 @@ if (lSeek!=0) { - if (ZSEEK64(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) + if (ZSEEK64(s->z_filefunc, s->filestream,(ZPOS64_T)lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) lSeek=0; else err=UNZ_ERRNO; @@ -1090,7 +1090,7 @@ if (lSeek!=0) { - if (ZSEEK64(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) + if (ZSEEK64(s->z_filefunc, s->filestream,(ZPOS64_T)lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) lSeek=0; else err=UNZ_ERRNO; @@ -1767,7 +1767,7 @@ if ((pfile_in_zip_read_info->stream.avail_in == 0) && (pfile_in_zip_read_info->rest_read_compressed == 0)) - return (iRead==0) ? UNZ_EOF : iRead; + return (iRead==0) ? UNZ_EOF : (int)iRead; if (pfile_in_zip_read_info->stream.avail_out < pfile_in_zip_read_info->stream.avail_in) @@ -1857,6 +1857,9 @@ err = Z_DATA_ERROR; uTotalOutAfter = pfile_in_zip_read_info->stream.total_out; + /* Detect overflow, because z_stream.total_out is uLong (32 bits) */ + if (uTotalOutAftertotal_out_64 = pfile_in_zip_read_info->total_out_64 + uOutThis; @@ -1871,14 +1874,14 @@ iRead += (uInt)(uTotalOutAfter - uTotalOutBefore); if (err==Z_STREAM_END) - return (iRead==0) ? UNZ_EOF : iRead; + return (iRead==0) ? UNZ_EOF : (int)iRead; if (err!=Z_OK) break; } } if (err==Z_OK) - return iRead; + return (int)iRead; return err; } diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/contrib/minizip/unzip.h mame-0.243+dfsg.1/3rdparty/zlib/contrib/minizip/unzip.h --- mame-0.242+dfsg.1/3rdparty/zlib/contrib/minizip/unzip.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/contrib/minizip/unzip.h 2022-04-29 05:37:26.000000000 +0000 @@ -83,12 +83,12 @@ /* tm_unz contain date/time info */ typedef struct tm_unz_s { - uInt tm_sec; /* seconds after the minute - [0,59] */ - uInt tm_min; /* minutes after the hour - [0,59] */ - uInt tm_hour; /* hours since midnight - [0,23] */ - uInt tm_mday; /* day of the month - [1,31] */ - uInt tm_mon; /* months since January - [0,11] */ - uInt tm_year; /* years - [1980..2044] */ + int tm_sec; /* seconds after the minute - [0,59] */ + int tm_min; /* minutes after the hour - [0,59] */ + int tm_hour; /* hours since midnight - [0,23] */ + int tm_mday; /* day of the month - [1,31] */ + int tm_mon; /* months since January - [0,11] */ + int tm_year; /* years - [1980..2044] */ } tm_unz; /* unz_global_info structure contain global data about the ZIPfile diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/contrib/minizip/zip.c mame-0.243+dfsg.1/3rdparty/zlib/contrib/minizip/zip.c --- mame-0.242+dfsg.1/3rdparty/zlib/contrib/minizip/zip.c 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/contrib/minizip/zip.c 2022-04-29 05:37:26.000000000 +0000 @@ -158,7 +158,7 @@ #ifndef NOCRYPT unsigned long keys[3]; /* keys defining the pseudo-random sequence */ const z_crc_t* pcrc_32_tab; - int crypt_header_size; + unsigned crypt_header_size; #endif } curfile64_info; @@ -301,7 +301,7 @@ } } - if (ZWRITE64(*pzlib_filefunc_def,filestream,buf,nbByte)!=(uLong)nbByte) + if (ZWRITE64(*pzlib_filefunc_def,filestream,buf,(uLong)nbByte)!=(uLong)nbByte) return ZIP_ERRNO; else return ZIP_OK; @@ -337,8 +337,8 @@ else if (year>=80) year-=80; return - (uLong) (((ptm->tm_mday) + (32 * (ptm->tm_mon+1)) + (512 * year)) << 16) | - ((ptm->tm_sec/2) + (32* ptm->tm_min) + (2048 * (uLong)ptm->tm_hour)); + (uLong) (((uLong)(ptm->tm_mday) + (32 * (uLong)(ptm->tm_mon+1)) + (512 * year)) << 16) | + (((uLong)ptm->tm_sec/2) + (32 * (uLong)ptm->tm_min) + (2048 * (uLong)ptm->tm_hour)); } @@ -522,12 +522,12 @@ if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06)) { - uPosFound = uReadPos+i; + uPosFound = uReadPos+(unsigned)i; break; } - if (uPosFound!=0) - break; + if (uPosFound!=0) + break; } TRYFREE(buf); return uPosFound; @@ -586,7 +586,7 @@ // Signature "0x07064b50" Zip64 end of central directory locater if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && ((*(buf+i+2))==0x06) && ((*(buf+i+3))==0x07)) { - uPosFound = uReadPos+i; + uPosFound = uReadPos+(unsigned)i; break; } } @@ -637,7 +637,7 @@ return relativeOffset; } -int LoadCentralDirectoryRecord(zip64_internal* pziinit) +local int LoadCentralDirectoryRecord(zip64_internal* pziinit) { int err=ZIP_OK; ZPOS64_T byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ @@ -955,7 +955,7 @@ return zipOpen3(pathname,append,NULL,NULL); } -int Write_LocalFileHeader(zip64_internal* zi, const char* filename, uInt size_extrafield_local, const void* extrafield_local) +local int Write_LocalFileHeader(zip64_internal* zi, const char* filename, uInt size_extrafield_local, const void* extrafield_local) { /* write the local header */ int err; @@ -1034,8 +1034,8 @@ // Remember position of Zip64 extended info for the local file header. (needed when we update size after done with file) zi->ci.pos_zip64extrainfo = ZTELL64(zi->z_filefunc,zi->filestream); - err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (short)HeaderID,2); - err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (short)DataSize,2); + err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (ZPOS64_T)HeaderID,2); + err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (ZPOS64_T)DataSize,2); err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (ZPOS64_T)UncompressedSize,8); err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (ZPOS64_T)CompressedSize,8); @@ -1516,7 +1516,7 @@ zip64_internal* zi; ZPOS64_T compressed_size; uLong invalidValue = 0xffffffff; - short datasize = 0; + unsigned datasize = 0; int err=ZIP_OK; if (file == NULL) @@ -1752,7 +1752,7 @@ return zipCloseFileInZipRaw (file,0,0); } -int Write_Zip64EndOfCentralDirectoryLocator(zip64_internal* zi, ZPOS64_T zip64eocd_pos_inzip) +local int Write_Zip64EndOfCentralDirectoryLocator(zip64_internal* zi, ZPOS64_T zip64eocd_pos_inzip) { int err = ZIP_OK; ZPOS64_T pos = zip64eocd_pos_inzip - zi->add_position_when_writing_offset; @@ -1774,7 +1774,7 @@ return err; } -int Write_Zip64EndOfCentralDirectoryRecord(zip64_internal* zi, uLong size_centraldir, ZPOS64_T centraldir_pos_inzip) +local int Write_Zip64EndOfCentralDirectoryRecord(zip64_internal* zi, uLong size_centraldir, ZPOS64_T centraldir_pos_inzip) { int err = ZIP_OK; @@ -1813,7 +1813,7 @@ } return err; } -int Write_EndOfCentralDirectoryRecord(zip64_internal* zi, uLong size_centraldir, ZPOS64_T centraldir_pos_inzip) +local int Write_EndOfCentralDirectoryRecord(zip64_internal* zi, uLong size_centraldir, ZPOS64_T centraldir_pos_inzip) { int err = ZIP_OK; @@ -1861,7 +1861,7 @@ return err; } -int Write_GlobalComment(zip64_internal* zi, const char* global_comment) +local int Write_GlobalComment(zip64_internal* zi, const char* global_comment) { int err = ZIP_OK; uInt size_global_comment = 0; @@ -1962,7 +1962,7 @@ if(pData == NULL || *dataLen < 4) return ZIP_PARAMERROR; - pNewHeader = (char*)ALLOC(*dataLen); + pNewHeader = (char*)ALLOC((unsigned)*dataLen); pTmp = pNewHeader; while(p < (pData + *dataLen)) diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/contrib/minizip/zip.h mame-0.243+dfsg.1/3rdparty/zlib/contrib/minizip/zip.h --- mame-0.242+dfsg.1/3rdparty/zlib/contrib/minizip/zip.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/contrib/minizip/zip.h 2022-04-29 05:37:26.000000000 +0000 @@ -88,12 +88,12 @@ /* tm_zip contain date/time info */ typedef struct tm_zip_s { - uInt tm_sec; /* seconds after the minute - [0,59] */ - uInt tm_min; /* minutes after the hour - [0,59] */ - uInt tm_hour; /* hours since midnight - [0,23] */ - uInt tm_mday; /* day of the month - [1,31] */ - uInt tm_mon; /* months since January - [0,11] */ - uInt tm_year; /* years - [1980..2044] */ + int tm_sec; /* seconds after the minute - [0,59] */ + int tm_min; /* minutes after the hour - [0,59] */ + int tm_hour; /* hours since midnight - [0,23] */ + int tm_mday; /* day of the month - [1,31] */ + int tm_mon; /* months since January - [0,11] */ + int tm_year; /* years - [1980..2044] */ } tm_zip; typedef struct @@ -144,6 +144,11 @@ zipcharpc* globalcomment, zlib_filefunc64_def* pzlib_filefunc_def)); +extern zipFile ZEXPORT zipOpen3 OF((const void *pathname, + int append, + zipcharpc* globalcomment, + zlib_filefunc64_32_def* pzlib_filefunc64_32_def)); + extern int ZEXPORT zipOpenNewFileInZip OF((zipFile file, const char* filename, const zip_fileinfo* zipfi, diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/contrib/pascal/zlibpas.pas mame-0.243+dfsg.1/3rdparty/zlib/contrib/pascal/zlibpas.pas --- mame-0.242+dfsg.1/3rdparty/zlib/contrib/pascal/zlibpas.pas 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/contrib/pascal/zlibpas.pas 2022-04-29 05:37:26.000000000 +0000 @@ -10,7 +10,7 @@ interface const - ZLIB_VERSION = '1.2.11'; + ZLIB_VERSION = '1.2.12'; ZLIB_VERNUM = $12a0; type diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/contrib/README.contrib mame-0.243+dfsg.1/3rdparty/zlib/contrib/README.contrib --- mame-0.242+dfsg.1/3rdparty/zlib/contrib/README.contrib 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/contrib/README.contrib 2022-04-29 05:37:26.000000000 +0000 @@ -8,14 +8,6 @@ Support for Ada See http://zlib-ada.sourceforge.net/ -amd64/ by Mikhail Teterin - asm code for AMD64 - See patch at http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/96393 - -asm686/ by Brian Raiter - asm code for Pentium and PPro/PII, using the AT&T (GNU as) syntax - See http://www.muppetlabs.com/~breadbox/software/assembly.html - blast/ by Mark Adler Decompressor for output of PKWare Data Compression Library (DCL) @@ -32,9 +24,6 @@ infback9/ by Mark Adler Unsupported diffs to infback to decode the deflate64 format -inflate86/ by Chris Anderson - Tuned x86 gcc asm code to replace inflate_fast() - iostream/ by Kevin Ruland A C++ I/O streams interface to the zlib gz* functions @@ -45,16 +34,6 @@ and Kevin Ruland Yet another C++ I/O streams interface -masmx64/ by Gilles Vollant - x86 64-bit (AMD64 and Intel EM64t) code for x64 assembler to - replace longest_match() and inflate_fast(), also masm x86 - 64-bits translation of Chris Anderson inflate_fast() - -masmx86/ by Gilles Vollant - x86 asm code to replace longest_match() and inflate_fast(), - for Visual C++ and MASM (32 bits). - Based on Brian Raiter (asm686) and Chris Anderson (inflate86) - minizip/ by Gilles Vollant Mini zip and unzip based on zlib Includes Zip64 support by Mathias Svensson diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/contrib/vstudio/readme.txt mame-0.243+dfsg.1/3rdparty/zlib/contrib/vstudio/readme.txt --- mame-0.242+dfsg.1/3rdparty/zlib/contrib/vstudio/readme.txt 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/contrib/vstudio/readme.txt 2022-04-29 05:37:26.000000000 +0000 @@ -1,4 +1,4 @@ -Building instructions for the DLL versions of Zlib 1.2.11 +Building instructions for the DLL versions of Zlib 1.2.12 ======================================================== This directory contains projects that build zlib and minizip using diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/contrib/vstudio/vc10/zlib.rc mame-0.243+dfsg.1/3rdparty/zlib/contrib/vstudio/vc10/zlib.rc --- mame-0.242+dfsg.1/3rdparty/zlib/contrib/vstudio/vc10/zlib.rc 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/contrib/vstudio/vc10/zlib.rc 2022-04-29 05:37:26.000000000 +0000 @@ -2,8 +2,8 @@ #define IDR_VERSION1 1 IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE - FILEVERSION 1, 2, 11, 0 - PRODUCTVERSION 1, 2, 11, 0 + FILEVERSION 1, 2, 12, 0 + PRODUCTVERSION 1, 2, 12, 0 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK FILEFLAGS 0 FILEOS VOS_DOS_WINDOWS32 @@ -17,12 +17,12 @@ BEGIN VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0" - VALUE "FileVersion", "1.2.11\0" + VALUE "FileVersion", "1.2.12\0" VALUE "InternalName", "zlib\0" VALUE "OriginalFilename", "zlibwapi.dll\0" VALUE "ProductName", "ZLib.DLL\0" VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0" - VALUE "LegalCopyright", "(C) 1995-2017 Jean-loup Gailly & Mark Adler\0" + VALUE "LegalCopyright", "(C) 1995-2022 Jean-loup Gailly & Mark Adler\0" END END BLOCK "VarFileInfo" diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/contrib/vstudio/vc10/zlibvc.def mame-0.243+dfsg.1/3rdparty/zlib/contrib/vstudio/vc10/zlibvc.def --- mame-0.242+dfsg.1/3rdparty/zlib/contrib/vstudio/vc10/zlibvc.def 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/contrib/vstudio/vc10/zlibvc.def 2022-04-29 05:37:26.000000000 +0000 @@ -151,3 +151,8 @@ deflateGetDictionary @173 adler32_z @174 crc32_z @175 + +; zlib1 v1.2.12 added: + crc32_combine_gen @176 + crc32_combine_gen64 @177 + crc32_combine_op @178 diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/contrib/vstudio/vc11/zlib.rc mame-0.243+dfsg.1/3rdparty/zlib/contrib/vstudio/vc11/zlib.rc --- mame-0.242+dfsg.1/3rdparty/zlib/contrib/vstudio/vc11/zlib.rc 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/contrib/vstudio/vc11/zlib.rc 2022-04-29 05:37:26.000000000 +0000 @@ -2,8 +2,8 @@ #define IDR_VERSION1 1 IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE - FILEVERSION 1, 2, 11, 0 - PRODUCTVERSION 1, 2, 11, 0 + FILEVERSION 1, 2, 12, 0 + PRODUCTVERSION 1, 2, 12, 0 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK FILEFLAGS 0 FILEOS VOS_DOS_WINDOWS32 @@ -17,12 +17,12 @@ BEGIN VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0" - VALUE "FileVersion", "1.2.11\0" + VALUE "FileVersion", "1.2.12\0" VALUE "InternalName", "zlib\0" VALUE "OriginalFilename", "zlibwapi.dll\0" VALUE "ProductName", "ZLib.DLL\0" VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0" - VALUE "LegalCopyright", "(C) 1995-2017 Jean-loup Gailly & Mark Adler\0" + VALUE "LegalCopyright", "(C) 1995-2022 Jean-loup Gailly & Mark Adler\0" END END BLOCK "VarFileInfo" diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/contrib/vstudio/vc11/zlibvc.def mame-0.243+dfsg.1/3rdparty/zlib/contrib/vstudio/vc11/zlibvc.def --- mame-0.242+dfsg.1/3rdparty/zlib/contrib/vstudio/vc11/zlibvc.def 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/contrib/vstudio/vc11/zlibvc.def 2022-04-29 05:37:26.000000000 +0000 @@ -151,3 +151,8 @@ deflateGetDictionary @173 adler32_z @174 crc32_z @175 + +; zlib1 v1.2.12 added: + crc32_combine_gen @176 + crc32_combine_gen64 @177 + crc32_combine_op @178 diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/contrib/vstudio/vc12/zlib.rc mame-0.243+dfsg.1/3rdparty/zlib/contrib/vstudio/vc12/zlib.rc --- mame-0.242+dfsg.1/3rdparty/zlib/contrib/vstudio/vc12/zlib.rc 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/contrib/vstudio/vc12/zlib.rc 2022-04-29 05:37:26.000000000 +0000 @@ -2,8 +2,8 @@ #define IDR_VERSION1 1 IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE - FILEVERSION 1, 2, 11, 0 - PRODUCTVERSION 1, 2, 11, 0 + FILEVERSION 1, 2, 12, 0 + PRODUCTVERSION 1, 2, 12, 0 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK FILEFLAGS 0 FILEOS VOS_DOS_WINDOWS32 @@ -17,12 +17,12 @@ BEGIN VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0" - VALUE "FileVersion", "1.2.11\0" + VALUE "FileVersion", "1.2.12\0" VALUE "InternalName", "zlib\0" VALUE "OriginalFilename", "zlibwapi.dll\0" VALUE "ProductName", "ZLib.DLL\0" VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0" - VALUE "LegalCopyright", "(C) 1995-2017 Jean-loup Gailly & Mark Adler\0" + VALUE "LegalCopyright", "(C) 1995-2022 Jean-loup Gailly & Mark Adler\0" END END BLOCK "VarFileInfo" diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/contrib/vstudio/vc12/zlibvc.def mame-0.243+dfsg.1/3rdparty/zlib/contrib/vstudio/vc12/zlibvc.def --- mame-0.242+dfsg.1/3rdparty/zlib/contrib/vstudio/vc12/zlibvc.def 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/contrib/vstudio/vc12/zlibvc.def 2022-04-29 05:37:26.000000000 +0000 @@ -151,3 +151,8 @@ deflateGetDictionary @173 adler32_z @174 crc32_z @175 + +; zlib1 v1.2.12 added: + crc32_combine_gen @176 + crc32_combine_gen64 @177 + crc32_combine_op @178 diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/contrib/vstudio/vc14/zlib.rc mame-0.243+dfsg.1/3rdparty/zlib/contrib/vstudio/vc14/zlib.rc --- mame-0.242+dfsg.1/3rdparty/zlib/contrib/vstudio/vc14/zlib.rc 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/contrib/vstudio/vc14/zlib.rc 2022-04-29 05:37:26.000000000 +0000 @@ -2,8 +2,8 @@ #define IDR_VERSION1 1 IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE - FILEVERSION 1, 2, 11, 0 - PRODUCTVERSION 1, 2, 11, 0 + FILEVERSION 1, 2, 12, 0 + PRODUCTVERSION 1, 2, 12, 0 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK FILEFLAGS 0 FILEOS VOS_DOS_WINDOWS32 @@ -17,12 +17,12 @@ BEGIN VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0" - VALUE "FileVersion", "1.2.11\0" + VALUE "FileVersion", "1.2.12\0" VALUE "InternalName", "zlib\0" VALUE "OriginalFilename", "zlibwapi.dll\0" VALUE "ProductName", "ZLib.DLL\0" VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0" - VALUE "LegalCopyright", "(C) 1995-2017 Jean-loup Gailly & Mark Adler\0" + VALUE "LegalCopyright", "(C) 1995-2022 Jean-loup Gailly & Mark Adler\0" END END BLOCK "VarFileInfo" diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/contrib/vstudio/vc14/zlibvc.def mame-0.243+dfsg.1/3rdparty/zlib/contrib/vstudio/vc14/zlibvc.def --- mame-0.242+dfsg.1/3rdparty/zlib/contrib/vstudio/vc14/zlibvc.def 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/contrib/vstudio/vc14/zlibvc.def 2022-04-29 05:37:26.000000000 +0000 @@ -151,3 +151,8 @@ deflateGetDictionary @173 adler32_z @174 crc32_z @175 + +; zlib1 v1.2.12 added: + crc32_combine_gen @176 + crc32_combine_gen64 @177 + crc32_combine_op @178 diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/contrib/vstudio/vc9/zlib.rc mame-0.243+dfsg.1/3rdparty/zlib/contrib/vstudio/vc9/zlib.rc --- mame-0.242+dfsg.1/3rdparty/zlib/contrib/vstudio/vc9/zlib.rc 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/contrib/vstudio/vc9/zlib.rc 2022-04-29 05:37:26.000000000 +0000 @@ -2,8 +2,8 @@ #define IDR_VERSION1 1 IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE - FILEVERSION 1, 2, 11, 0 - PRODUCTVERSION 1, 2, 11, 0 + FILEVERSION 1, 2, 12, 0 + PRODUCTVERSION 1, 2, 12, 0 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK FILEFLAGS 0 FILEOS VOS_DOS_WINDOWS32 @@ -17,12 +17,12 @@ BEGIN VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0" - VALUE "FileVersion", "1.2.11\0" + VALUE "FileVersion", "1.2.12\0" VALUE "InternalName", "zlib\0" VALUE "OriginalFilename", "zlibwapi.dll\0" VALUE "ProductName", "ZLib.DLL\0" VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0" - VALUE "LegalCopyright", "(C) 1995-2017 Jean-loup Gailly & Mark Adler\0" + VALUE "LegalCopyright", "(C) 1995-2022 Jean-loup Gailly & Mark Adler\0" END END BLOCK "VarFileInfo" diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/contrib/vstudio/vc9/zlibvc.def mame-0.243+dfsg.1/3rdparty/zlib/contrib/vstudio/vc9/zlibvc.def --- mame-0.242+dfsg.1/3rdparty/zlib/contrib/vstudio/vc9/zlibvc.def 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/contrib/vstudio/vc9/zlibvc.def 2022-04-29 05:37:26.000000000 +0000 @@ -151,3 +151,8 @@ deflateGetDictionary @173 adler32_z @174 crc32_z @175 + +; zlib1 v1.2.12 added: + crc32_combine_gen @176 + crc32_combine_gen64 @177 + crc32_combine_op @178 diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/crc32.c mame-0.243+dfsg.1/3rdparty/zlib/crc32.c --- mame-0.242+dfsg.1/3rdparty/zlib/crc32.c 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/crc32.c 2022-04-29 05:37:26.000000000 +0000 @@ -1,12 +1,10 @@ /* crc32.c -- compute the CRC-32 of a data stream - * Copyright (C) 1995-2006, 2010, 2011, 2012, 2016 Mark Adler + * Copyright (C) 1995-2022 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h * - * Thanks to Rodney Brown for his contribution of faster - * CRC methods: exclusive-oring 32 bits of data at a time, and pre-computing - * tables for updating the shift register in one step with three exclusive-ors - * instead of four steps with four exclusive-ors. This results in about a - * factor of two increase in speed on a Power PC G4 (PPC7455) using gcc -O3. + * This interleaved implementation of a CRC makes use of pipelined multiple + * arithmetic-logic units, commonly found in modern CPU cores. It is due to + * Kadatch and Jenkins (2010). See doc/crc-doc.1.0.pdf in this distribution. */ /* @(#) $Id$ */ @@ -14,11 +12,12 @@ /* Note on the use of DYNAMIC_CRC_TABLE: there is no mutex or semaphore protection on the static variables used to control the first-use generation - of the crc tables. Therefore, if you #define DYNAMIC_CRC_TABLE, you should + of the crc tables. Therefore, if you #define DYNAMIC_CRC_TABLE, you should first call get_crc_table() to initialize the tables before allowing more than one thread to use crc32(). - DYNAMIC_CRC_TABLE and MAKECRCH can be #defined to write out crc32.h. + MAKECRCH can be #defined to write out crc32.h. A main() routine is also + produced, so that this one source file can be compiled to an executable. */ #ifdef MAKECRCH @@ -28,400 +27,1057 @@ # endif /* !DYNAMIC_CRC_TABLE */ #endif /* MAKECRCH */ -#include "zutil.h" /* for STDC and FAR definitions */ +#include "zutil.h" /* for Z_U4, Z_U8, z_crc_t, and FAR definitions */ -/* Definitions for doing the crc four data bytes at a time. */ -#if !defined(NOBYFOUR) && defined(Z_U4) -# define BYFOUR -#endif -#ifdef BYFOUR - local unsigned long crc32_little OF((unsigned long, - const unsigned char FAR *, z_size_t)); - local unsigned long crc32_big OF((unsigned long, - const unsigned char FAR *, z_size_t)); -# define TBLS 8 + /* + A CRC of a message is computed on N braids of words in the message, where + each word consists of W bytes (4 or 8). If N is 3, for example, then three + running sparse CRCs are calculated respectively on each braid, at these + indices in the array of words: 0, 3, 6, ..., 1, 4, 7, ..., and 2, 5, 8, ... + This is done starting at a word boundary, and continues until as many blocks + of N * W bytes as are available have been processed. The results are combined + into a single CRC at the end. For this code, N must be in the range 1..6 and + W must be 4 or 8. The upper limit on N can be increased if desired by adding + more #if blocks, extending the patterns apparent in the code. In addition, + crc32.h would need to be regenerated, if the maximum N value is increased. + + N and W are chosen empirically by benchmarking the execution time on a given + processor. The choices for N and W below were based on testing on Intel Kaby + Lake i7, AMD Ryzen 7, ARM Cortex-A57, Sparc64-VII, PowerPC POWER9, and MIPS64 + Octeon II processors. The Intel, AMD, and ARM processors were all fastest + with N=5, W=8. The Sparc, PowerPC, and MIPS64 were all fastest at N=5, W=4. + They were all tested with either gcc or clang, all using the -O3 optimization + level. Your mileage may vary. + */ + +/* Define N */ +#ifdef Z_TESTN +# define N Z_TESTN #else -# define TBLS 1 -#endif /* BYFOUR */ +# define N 5 +#endif +#if N < 1 || N > 6 +# error N must be in 1..6 +#endif -/* Local functions for crc concatenation */ -local unsigned long gf2_matrix_times OF((unsigned long *mat, - unsigned long vec)); -local void gf2_matrix_square OF((unsigned long *square, unsigned long *mat)); -local uLong crc32_combine_ OF((uLong crc1, uLong crc2, z_off64_t len2)); +/* + z_crc_t must be at least 32 bits. z_word_t must be at least as long as + z_crc_t. It is assumed here that z_word_t is either 32 bits or 64 bits, and + that bytes are eight bits. + */ + +/* + Define W and the associated z_word_t type. If W is not defined, then a + braided calculation is not used, and the associated tables and code are not + compiled. + */ +#ifdef Z_TESTW +# if Z_TESTW-1 != -1 +# define W Z_TESTW +# endif +#else +# ifdef MAKECRCH +# define W 8 /* required for MAKECRCH */ +# else +# if defined(__x86_64__) || defined(__aarch64__) +# define W 8 +# else +# define W 4 +# endif +# endif +#endif +#ifdef W +# if W == 8 && defined(Z_U8) + typedef Z_U8 z_word_t; +# elif defined(Z_U4) +# undef W +# define W 4 + typedef Z_U4 z_word_t; +# else +# undef W +# endif +#endif +/* Local functions. */ +local z_crc_t multmodp OF((z_crc_t a, z_crc_t b)); +local z_crc_t x2nmodp OF((z_off64_t n, unsigned k)); + +/* If available, use the ARM processor CRC32 instruction. */ +#if defined(__aarch64__) && defined(__ARM_FEATURE_CRC32) && W == 8 +# define ARMCRC32 +#endif + +#if defined(W) && (!defined(ARMCRC32) || defined(DYNAMIC_CRC_TABLE)) +/* + Swap the bytes in a z_word_t to convert between little and big endian. Any + self-respecting compiler will optimize this to a single machine byte-swap + instruction, if one is available. This assumes that word_t is either 32 bits + or 64 bits. + */ +local z_word_t byte_swap(word) + z_word_t word; +{ +# if W == 8 + return + (word & 0xff00000000000000) >> 56 | + (word & 0xff000000000000) >> 40 | + (word & 0xff0000000000) >> 24 | + (word & 0xff00000000) >> 8 | + (word & 0xff000000) << 8 | + (word & 0xff0000) << 24 | + (word & 0xff00) << 40 | + (word & 0xff) << 56; +# else /* W == 4 */ + return + (word & 0xff000000) >> 24 | + (word & 0xff0000) >> 8 | + (word & 0xff00) << 8 | + (word & 0xff) << 24; +# endif +} +#endif + +/* CRC polynomial. */ +#define POLY 0xedb88320 /* p(x) reflected, with x^32 implied */ #ifdef DYNAMIC_CRC_TABLE -local volatile int crc_table_empty = 1; -local z_crc_t FAR crc_table[TBLS][256]; +local z_crc_t FAR crc_table[256]; +local z_crc_t FAR x2n_table[32]; local void make_crc_table OF((void)); +#ifdef W + local z_word_t FAR crc_big_table[256]; + local z_crc_t FAR crc_braid_table[W][256]; + local z_word_t FAR crc_braid_big_table[W][256]; + local void braid OF((z_crc_t [][256], z_word_t [][256], int, int)); +#endif #ifdef MAKECRCH - local void write_table OF((FILE *, const z_crc_t FAR *)); + local void write_table OF((FILE *, const z_crc_t FAR *, int)); + local void write_table32hi OF((FILE *, const z_word_t FAR *, int)); + local void write_table64 OF((FILE *, const z_word_t FAR *, int)); #endif /* MAKECRCH */ + +/* + Define a once() function depending on the availability of atomics. If this is + compiled with DYNAMIC_CRC_TABLE defined, and if CRCs will be computed in + multiple threads, and if atomics are not available, then get_crc_table() must + be called to initialize the tables and must return before any threads are + allowed to compute or combine CRCs. + */ + +/* Definition of once functionality. */ +typedef struct once_s once_t; +local void once OF((once_t *, void (*)(void))); + +/* Check for the availability of atomics. */ +#if defined(__STDC__) && __STDC_VERSION__ >= 201112L && \ + !defined(__STDC_NO_ATOMICS__) + +#include + +/* Structure for once(), which must be initialized with ONCE_INIT. */ +struct once_s { + atomic_flag begun; + atomic_int done; +}; +#define ONCE_INIT {ATOMIC_FLAG_INIT, 0} + +/* + Run the provided init() function exactly once, even if multiple threads + invoke once() at the same time. The state must be a once_t initialized with + ONCE_INIT. + */ +local void once(state, init) + once_t *state; + void (*init)(void); +{ + if (!atomic_load(&state->done)) { + if (atomic_flag_test_and_set(&state->begun)) + while (!atomic_load(&state->done)) + ; + else { + init(); + atomic_store(&state->done, 1); + } + } +} + +#else /* no atomics */ + +/* Structure for once(), which must be initialized with ONCE_INIT. */ +struct once_s { + volatile int begun; + volatile int done; +}; +#define ONCE_INIT {0, 0} + +/* Test and set. Alas, not atomic, but tries to minimize the period of + vulnerability. */ +local int test_and_set OF((int volatile *)); +local int test_and_set(flag) + int volatile *flag; +{ + int was; + + was = *flag; + *flag = 1; + return was; +} + +/* Run the provided init() function once. This is not thread-safe. */ +local void once(state, init) + once_t *state; + void (*init)(void); +{ + if (!state->done) { + if (test_and_set(&state->begun)) + while (!state->done) + ; + else { + init(); + state->done = 1; + } + } +} + +#endif + +/* State for once(). */ +local once_t made = ONCE_INIT; + /* Generate tables for a byte-wise 32-bit CRC calculation on the polynomial: x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1. Polynomials over GF(2) are represented in binary, one bit per coefficient, - with the lowest powers in the most significant bit. Then adding polynomials + with the lowest powers in the most significant bit. Then adding polynomials is just exclusive-or, and multiplying a polynomial by x is a right shift by - one. If we call the above polynomial p, and represent a byte as the + one. If we call the above polynomial p, and represent a byte as the polynomial q, also with the lowest power in the most significant bit (so the - byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p, + byte 0xb1 is the polynomial x^7+x^3+x^2+1), then the CRC is (q*x^32) mod p, where a mod b means the remainder after dividing a by b. This calculation is done using the shift-register method of multiplying and - taking the remainder. The register is initialized to zero, and for each + taking the remainder. The register is initialized to zero, and for each incoming bit, x^32 is added mod p to the register if the bit is a one (where - x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by - x (which is shifting right by one and adding x^32 mod p if the bit shifted - out is a one). We start with the highest power (least significant bit) of - q and repeat for all eight bits of q. - - The first table is simply the CRC of all possible eight bit values. This is - all the information needed to generate CRCs on data a byte at a time for all - combinations of CRC register values and incoming bytes. The remaining tables - allow for word-at-a-time CRC calculation for both big-endian and little- - endian machines, where a word is four bytes. -*/ + x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by x + (which is shifting right by one and adding x^32 mod p if the bit shifted out + is a one). We start with the highest power (least significant bit) of q and + repeat for all eight bits of q. + + The table is simply the CRC of all possible eight bit values. This is all the + information needed to generate CRCs on data a byte at a time for all + combinations of CRC register values and incoming bytes. + */ + local void make_crc_table() { - z_crc_t c; - int n, k; - z_crc_t poly; /* polynomial exclusive-or pattern */ - /* terms of polynomial defining this crc (except x^32): */ - static volatile int first = 1; /* flag to limit concurrent making */ - static const unsigned char p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26}; - - /* See if another task is already doing this (not thread-safe, but better - than nothing -- significantly reduces duration of vulnerability in - case the advice about DYNAMIC_CRC_TABLE is ignored) */ - if (first) { - first = 0; - - /* make exclusive-or pattern from polynomial (0xedb88320UL) */ - poly = 0; - for (n = 0; n < (int)(sizeof(p)/sizeof(unsigned char)); n++) - poly |= (z_crc_t)1 << (31 - p[n]); - - /* generate a crc for every 8-bit value */ - for (n = 0; n < 256; n++) { - c = (z_crc_t)n; - for (k = 0; k < 8; k++) - c = c & 1 ? poly ^ (c >> 1) : c >> 1; - crc_table[0][n] = c; - } + unsigned i, j, n; + z_crc_t p; -#ifdef BYFOUR - /* generate crc for each value followed by one, two, and three zeros, - and then the byte reversal of those as well as the first table */ - for (n = 0; n < 256; n++) { - c = crc_table[0][n]; - crc_table[4][n] = ZSWAP32(c); - for (k = 1; k < 4; k++) { - c = crc_table[0][c & 0xff] ^ (c >> 8); - crc_table[k][n] = c; - crc_table[k + 4][n] = ZSWAP32(c); - } - } -#endif /* BYFOUR */ - - crc_table_empty = 0; - } - else { /* not first */ - /* wait for the other guy to finish (not efficient, but rare) */ - while (crc_table_empty) - ; + /* initialize the CRC of bytes tables */ + for (i = 0; i < 256; i++) { + p = i; + for (j = 0; j < 8; j++) + p = p & 1 ? (p >> 1) ^ POLY : p >> 1; + crc_table[i] = p; +#ifdef W + crc_big_table[i] = byte_swap(p); +#endif } + /* initialize the x^2^n mod p(x) table */ + p = (z_crc_t)1 << 30; /* x^1 */ + x2n_table[0] = p; + for (n = 1; n < 32; n++) + x2n_table[n] = p = multmodp(p, p); + +#ifdef W + /* initialize the braiding tables -- needs x2n_table[] */ + braid(crc_braid_table, crc_braid_big_table, N, W); +#endif + #ifdef MAKECRCH - /* write out CRC tables to crc32.h */ { + /* + The crc32.h header file contains tables for both 32-bit and 64-bit + z_word_t's, and so requires a 64-bit type be available. In that case, + z_word_t must be defined to be 64-bits. This code then also generates + and writes out the tables for the case that z_word_t is 32 bits. + */ +#if !defined(W) || W != 8 +# error Need a 64-bit integer type in order to generate crc32.h. +#endif FILE *out; + int k, n; + z_crc_t ltl[8][256]; + z_word_t big[8][256]; out = fopen("crc32.h", "w"); if (out == NULL) return; - fprintf(out, "/* crc32.h -- tables for rapid CRC calculation\n"); - fprintf(out, " * Generated automatically by crc32.c\n */\n\n"); - fprintf(out, "local const z_crc_t FAR "); - fprintf(out, "crc_table[TBLS][256] =\n{\n {\n"); - write_table(out, crc_table[0]); -# ifdef BYFOUR - fprintf(out, "#ifdef BYFOUR\n"); - for (k = 1; k < 8; k++) { - fprintf(out, " },\n {\n"); - write_table(out, crc_table[k]); + + /* write out little-endian CRC table to crc32.h */ + fprintf(out, + "/* crc32.h -- tables for rapid CRC calculation\n" + " * Generated automatically by crc32.c\n */\n" + "\n" + "local const z_crc_t FAR crc_table[] = {\n" + " "); + write_table(out, crc_table, 256); + fprintf(out, + "};\n"); + + /* write out big-endian CRC table for 64-bit z_word_t to crc32.h */ + fprintf(out, + "\n" + "#ifdef W\n" + "\n" + "#if W == 8\n" + "\n" + "local const z_word_t FAR crc_big_table[] = {\n" + " "); + write_table64(out, crc_big_table, 256); + fprintf(out, + "};\n"); + + /* write out big-endian CRC table for 32-bit z_word_t to crc32.h */ + fprintf(out, + "\n" + "#else /* W == 4 */\n" + "\n" + "local const z_word_t FAR crc_big_table[] = {\n" + " "); + write_table32hi(out, crc_big_table, 256); + fprintf(out, + "};\n" + "\n" + "#endif\n"); + + /* write out braid tables for each value of N */ + for (n = 1; n <= 6; n++) { + fprintf(out, + "\n" + "#if N == %d\n", n); + + /* compute braid tables for this N and 64-bit word_t */ + braid(ltl, big, n, 8); + + /* write out braid tables for 64-bit z_word_t to crc32.h */ + fprintf(out, + "\n" + "#if W == 8\n" + "\n" + "local const z_crc_t FAR crc_braid_table[][256] = {\n"); + for (k = 0; k < 8; k++) { + fprintf(out, " {"); + write_table(out, ltl[k], 256); + fprintf(out, "}%s", k < 7 ? ",\n" : ""); + } + fprintf(out, + "};\n" + "\n" + "local const z_word_t FAR crc_braid_big_table[][256] = {\n"); + for (k = 0; k < 8; k++) { + fprintf(out, " {"); + write_table64(out, big[k], 256); + fprintf(out, "}%s", k < 7 ? ",\n" : ""); + } + fprintf(out, + "};\n"); + + /* compute braid tables for this N and 32-bit word_t */ + braid(ltl, big, n, 4); + + /* write out braid tables for 32-bit z_word_t to crc32.h */ + fprintf(out, + "\n" + "#else /* W == 4 */\n" + "\n" + "local const z_crc_t FAR crc_braid_table[][256] = {\n"); + for (k = 0; k < 4; k++) { + fprintf(out, " {"); + write_table(out, ltl[k], 256); + fprintf(out, "}%s", k < 3 ? ",\n" : ""); + } + fprintf(out, + "};\n" + "\n" + "local const z_word_t FAR crc_braid_big_table[][256] = {\n"); + for (k = 0; k < 4; k++) { + fprintf(out, " {"); + write_table32hi(out, big[k], 256); + fprintf(out, "}%s", k < 3 ? ",\n" : ""); + } + fprintf(out, + "};\n" + "\n" + "#endif\n" + "\n" + "#endif\n"); } - fprintf(out, "#endif\n"); -# endif /* BYFOUR */ - fprintf(out, " }\n};\n"); + fprintf(out, + "\n" + "#endif\n"); + + /* write out zeros operator table to crc32.h */ + fprintf(out, + "\n" + "local const z_crc_t FAR x2n_table[] = {\n" + " "); + write_table(out, x2n_table, 32); + fprintf(out, + "};\n"); fclose(out); } #endif /* MAKECRCH */ } #ifdef MAKECRCH -local void write_table(out, table) + +/* + Write the 32-bit values in table[0..k-1] to out, five per line in + hexadecimal separated by commas. + */ +local void write_table(out, table, k) FILE *out; const z_crc_t FAR *table; + int k; { int n; - for (n = 0; n < 256; n++) - fprintf(out, "%s0x%08lxUL%s", n % 5 ? "" : " ", + for (n = 0; n < k; n++) + fprintf(out, "%s0x%08lx%s", n == 0 || n % 5 ? "" : " ", (unsigned long)(table[n]), - n == 255 ? "\n" : (n % 5 == 4 ? ",\n" : ", ")); + n == k - 1 ? "" : (n % 5 == 4 ? ",\n" : ", ")); } + +/* + Write the high 32-bits of each value in table[0..k-1] to out, five per line + in hexadecimal separated by commas. + */ +local void write_table32hi(out, table, k) +FILE *out; +const z_word_t FAR *table; +int k; +{ + int n; + + for (n = 0; n < k; n++) + fprintf(out, "%s0x%08lx%s", n == 0 || n % 5 ? "" : " ", + (unsigned long)(table[n] >> 32), + n == k - 1 ? "" : (n % 5 == 4 ? ",\n" : ", ")); +} + +/* + Write the 64-bit values in table[0..k-1] to out, three per line in + hexadecimal separated by commas. This assumes that if there is a 64-bit + type, then there is also a long long integer type, and it is at least 64 + bits. If not, then the type cast and format string can be adjusted + accordingly. + */ +local void write_table64(out, table, k) + FILE *out; + const z_word_t FAR *table; + int k; +{ + int n; + + for (n = 0; n < k; n++) + fprintf(out, "%s0x%016llx%s", n == 0 || n % 3 ? "" : " ", + (unsigned long long)(table[n]), + n == k - 1 ? "" : (n % 3 == 2 ? ",\n" : ", ")); +} + +/* Actually do the deed. */ +int main() +{ + make_crc_table(); + return 0; +} + #endif /* MAKECRCH */ +#ifdef W +/* + Generate the little and big-endian braid tables for the given n and z_word_t + size w. Each array must have room for w blocks of 256 elements. + */ +local void braid(ltl, big, n, w) + z_crc_t ltl[][256]; + z_word_t big[][256]; + int n; + int w; +{ + int k; + z_crc_t i, p, q; + for (k = 0; k < w; k++) { + p = x2nmodp((n * w + 3 - k) << 3, 0); + ltl[k][0] = 0; + big[w - 1 - k][0] = 0; + for (i = 1; i < 256; i++) { + ltl[k][i] = q = multmodp(i << 24, p); + big[w - 1 - k][i] = byte_swap(q); + } + } +} +#endif + #else /* !DYNAMIC_CRC_TABLE */ /* ======================================================================== - * Tables of CRC-32s of all single-byte values, made by make_crc_table(). + * Tables for byte-wise and braided CRC-32 calculations, and a table of powers + * of x for combining CRC-32s, all made by make_crc_table(). */ #include "crc32.h" #endif /* DYNAMIC_CRC_TABLE */ +/* ======================================================================== + * Routines used for CRC calculation. Some are also required for the table + * generation above. + */ + +/* + Return a(x) multiplied by b(x) modulo p(x), where p(x) is the CRC polynomial, + reflected. For speed, this requires that a not be zero. + */ +local z_crc_t multmodp(a, b) + z_crc_t a; + z_crc_t b; +{ + z_crc_t m, p; + + m = (z_crc_t)1 << 31; + p = 0; + for (;;) { + if (a & m) { + p ^= b; + if ((a & (m - 1)) == 0) + break; + } + m >>= 1; + b = b & 1 ? (b >> 1) ^ POLY : b >> 1; + } + return p; +} + +/* + Return x^(n * 2^k) modulo p(x). Requires that x2n_table[] has been + initialized. + */ +local z_crc_t x2nmodp(n, k) + z_off64_t n; + unsigned k; +{ + z_crc_t p; + + p = (z_crc_t)1 << 31; /* x^0 == 1 */ + while (n) { + if (n & 1) + p = multmodp(x2n_table[k & 31], p); + n >>= 1; + k++; + } + return p; +} + /* ========================================================================= - * This function can be used by asm versions of crc32() + * This function can be used by asm versions of crc32(), and to force the + * generation of the CRC tables in a threaded application. */ const z_crc_t FAR * ZEXPORT get_crc_table() { #ifdef DYNAMIC_CRC_TABLE - if (crc_table_empty) - make_crc_table(); + once(&made, make_crc_table); #endif /* DYNAMIC_CRC_TABLE */ return (const z_crc_t FAR *)crc_table; } -/* ========================================================================= */ -#define DO1 crc = crc_table[0][((int)crc ^ (*buf++)) & 0xff] ^ (crc >> 8) -#define DO8 DO1; DO1; DO1; DO1; DO1; DO1; DO1; DO1 +/* ========================================================================= + * Use ARM machine instructions if available. This will compute the CRC about + * ten times faster than the braided calculation. This code does not check for + * the presence of the CRC instruction at run time. __ARM_FEATURE_CRC32 will + * only be defined if the compilation specifies an ARM processor architecture + * that has the instructions. For example, compiling with -march=armv8.1-a or + * -march=armv8-a+crc, or -march=native if the compile machine has the crc32 + * instructions. + */ +#ifdef ARMCRC32 + +/* + Constants empirically determined to maximize speed. These values are from + measurements on a Cortex-A57. Your mileage may vary. + */ +#define Z_BATCH 3990 /* number of words in a batch */ +#define Z_BATCH_ZEROS 0xa10d3d0c /* computed from Z_BATCH = 3990 */ +#define Z_BATCH_MIN 800 /* fewest words in a final batch */ -/* ========================================================================= */ unsigned long ZEXPORT crc32_z(crc, buf, len) unsigned long crc; const unsigned char FAR *buf; z_size_t len; { - if (buf == Z_NULL) return 0UL; + z_crc_t val; + z_word_t crc1, crc2; + const z_word_t *word; + z_word_t val0, val1, val2; + z_size_t last, last2, i; + z_size_t num; + + /* Return initial CRC, if requested. */ + if (buf == Z_NULL) return 0; #ifdef DYNAMIC_CRC_TABLE - if (crc_table_empty) - make_crc_table(); + once(&made, make_crc_table); #endif /* DYNAMIC_CRC_TABLE */ -#ifdef BYFOUR - if (sizeof(void *) == sizeof(ptrdiff_t)) { - z_crc_t endian; + /* Pre-condition the CRC */ + crc ^= 0xffffffff; - endian = 1; - if (*((unsigned char *)(&endian))) - return crc32_little(crc, buf, len); - else - return crc32_big(crc, buf, len); + /* Compute the CRC up to a word boundary. */ + while (len && ((z_size_t)buf & 7) != 0) { + len--; + val = *buf++; + __asm__ volatile("crc32b %w0, %w0, %w1" : "+r"(crc) : "r"(val)); } -#endif /* BYFOUR */ - crc = crc ^ 0xffffffffUL; - while (len >= 8) { - DO8; - len -= 8; + + /* Prepare to compute the CRC on full 64-bit words word[0..num-1]. */ + word = (z_word_t const *)buf; + num = len >> 3; + len &= 7; + + /* Do three interleaved CRCs to realize the throughput of one crc32x + instruction per cycle. Each CRC is calcuated on Z_BATCH words. The three + CRCs are combined into a single CRC after each set of batches. */ + while (num >= 3 * Z_BATCH) { + crc1 = 0; + crc2 = 0; + for (i = 0; i < Z_BATCH; i++) { + val0 = word[i]; + val1 = word[i + Z_BATCH]; + val2 = word[i + 2 * Z_BATCH]; + __asm__ volatile("crc32x %w0, %w0, %x1" : "+r"(crc) : "r"(val0)); + __asm__ volatile("crc32x %w0, %w0, %x1" : "+r"(crc1) : "r"(val1)); + __asm__ volatile("crc32x %w0, %w0, %x1" : "+r"(crc2) : "r"(val2)); + } + word += 3 * Z_BATCH; + num -= 3 * Z_BATCH; + crc = multmodp(Z_BATCH_ZEROS, crc) ^ crc1; + crc = multmodp(Z_BATCH_ZEROS, crc) ^ crc2; } - if (len) do { - DO1; - } while (--len); - return crc ^ 0xffffffffUL; -} -/* ========================================================================= */ -unsigned long ZEXPORT crc32(crc, buf, len) - unsigned long crc; - const unsigned char FAR *buf; - uInt len; -{ - return crc32_z(crc, buf, len); + /* Do one last smaller batch with the remaining words, if there are enough + to pay for the combination of CRCs. */ + last = num / 3; + if (last >= Z_BATCH_MIN) { + last2 = last << 1; + crc1 = 0; + crc2 = 0; + for (i = 0; i < last; i++) { + val0 = word[i]; + val1 = word[i + last]; + val2 = word[i + last2]; + __asm__ volatile("crc32x %w0, %w0, %x1" : "+r"(crc) : "r"(val0)); + __asm__ volatile("crc32x %w0, %w0, %x1" : "+r"(crc1) : "r"(val1)); + __asm__ volatile("crc32x %w0, %w0, %x1" : "+r"(crc2) : "r"(val2)); + } + word += 3 * last; + num -= 3 * last; + val = x2nmodp(last, 6); + crc = multmodp(val, crc) ^ crc1; + crc = multmodp(val, crc) ^ crc2; + } + + /* Compute the CRC on any remaining words. */ + for (i = 0; i < num; i++) { + val0 = word[i]; + __asm__ volatile("crc32x %w0, %w0, %x1" : "+r"(crc) : "r"(val0)); + } + word += num; + + /* Complete the CRC on any remaining bytes. */ + buf = (const unsigned char FAR *)word; + while (len) { + len--; + val = *buf++; + __asm__ volatile("crc32b %w0, %w0, %w1" : "+r"(crc) : "r"(val)); + } + + /* Return the CRC, post-conditioned. */ + return crc ^ 0xffffffff; } -#ifdef BYFOUR +#else + +#ifdef W /* - This BYFOUR code accesses the passed unsigned char * buffer with a 32-bit - integer pointer type. This violates the strict aliasing rule, where a - compiler can assume, for optimization purposes, that two pointers to - fundamentally different types won't ever point to the same memory. This can - manifest as a problem only if one of the pointers is written to. This code - only reads from those pointers. So long as this code remains isolated in - this compilation unit, there won't be a problem. For this reason, this code - should not be copied and pasted into a compilation unit in which other code - writes to the buffer that is passed to these routines. + Return the CRC of the W bytes in the word_t data, taking the + least-significant byte of the word as the first byte of data, without any pre + or post conditioning. This is used to combine the CRCs of each braid. */ +local z_crc_t crc_word(data) + z_word_t data; +{ + int k; + for (k = 0; k < W; k++) + data = (data >> 8) ^ crc_table[data & 0xff]; + return (z_crc_t)data; +} -/* ========================================================================= */ -#define DOLIT4 c ^= *buf4++; \ - c = crc_table[3][c & 0xff] ^ crc_table[2][(c >> 8) & 0xff] ^ \ - crc_table[1][(c >> 16) & 0xff] ^ crc_table[0][c >> 24] -#define DOLIT32 DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4 +local z_word_t crc_word_big(data) + z_word_t data; +{ + int k; + for (k = 0; k < W; k++) + data = (data << 8) ^ + crc_big_table[(data >> ((W - 1) << 3)) & 0xff]; + return data; +} + +#endif /* ========================================================================= */ -local unsigned long crc32_little(crc, buf, len) +unsigned long ZEXPORT crc32_z(crc, buf, len) unsigned long crc; const unsigned char FAR *buf; z_size_t len; { - register z_crc_t c; - register const z_crc_t FAR *buf4; + /* Return initial CRC, if requested. */ + if (buf == Z_NULL) return 0; - c = (z_crc_t)crc; - c = ~c; - while (len && ((ptrdiff_t)buf & 3)) { - c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8); - len--; - } +#ifdef DYNAMIC_CRC_TABLE + once(&made, make_crc_table); +#endif /* DYNAMIC_CRC_TABLE */ - buf4 = (const z_crc_t FAR *)(const void FAR *)buf; - while (len >= 32) { - DOLIT32; - len -= 32; - } - while (len >= 4) { - DOLIT4; - len -= 4; - } - buf = (const unsigned char FAR *)buf4; - - if (len) do { - c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8); - } while (--len); - c = ~c; - return (unsigned long)c; -} + /* Pre-condition the CRC */ + crc ^= 0xffffffff; -/* ========================================================================= */ -#define DOBIG4 c ^= *buf4++; \ - c = crc_table[4][c & 0xff] ^ crc_table[5][(c >> 8) & 0xff] ^ \ - crc_table[6][(c >> 16) & 0xff] ^ crc_table[7][c >> 24] -#define DOBIG32 DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4 +#ifdef W -/* ========================================================================= */ -local unsigned long crc32_big(crc, buf, len) - unsigned long crc; - const unsigned char FAR *buf; - z_size_t len; -{ - register z_crc_t c; - register const z_crc_t FAR *buf4; + /* If provided enough bytes, do a braided CRC calculation. */ + if (len >= N * W + W - 1) { + z_size_t blks; + z_word_t const *words; + unsigned endian; + int k; + + /* Compute the CRC up to a z_word_t boundary. */ + while (len && ((z_size_t)buf & (W - 1)) != 0) { + len--; + crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff]; + } - c = ZSWAP32((z_crc_t)crc); - c = ~c; - while (len && ((ptrdiff_t)buf & 3)) { - c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8); - len--; - } + /* Compute the CRC on as many N z_word_t blocks as are available. */ + blks = len / (N * W); + len -= blks * N * W; + words = (z_word_t const *)buf; + + /* Do endian check at execution time instead of compile time, since ARM + processors can change the endianess at execution time. If the + compiler knows what the endianess will be, it can optimize out the + check and the unused branch. */ + endian = 1; + if (*(unsigned char *)&endian) { + /* Little endian. */ - buf4 = (const z_crc_t FAR *)(const void FAR *)buf; - while (len >= 32) { - DOBIG32; - len -= 32; - } - while (len >= 4) { - DOBIG4; - len -= 4; - } - buf = (const unsigned char FAR *)buf4; + z_crc_t crc0; + z_word_t word0; +#if N > 1 + z_crc_t crc1; + z_word_t word1; +#if N > 2 + z_crc_t crc2; + z_word_t word2; +#if N > 3 + z_crc_t crc3; + z_word_t word3; +#if N > 4 + z_crc_t crc4; + z_word_t word4; +#if N > 5 + z_crc_t crc5; + z_word_t word5; +#endif +#endif +#endif +#endif +#endif - if (len) do { - c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8); - } while (--len); - c = ~c; - return (unsigned long)(ZSWAP32(c)); -} + /* Initialize the CRC for each braid. */ + crc0 = crc; +#if N > 1 + crc1 = 0; +#if N > 2 + crc2 = 0; +#if N > 3 + crc3 = 0; +#if N > 4 + crc4 = 0; +#if N > 5 + crc5 = 0; +#endif +#endif +#endif +#endif +#endif -#endif /* BYFOUR */ + /* + Process the first blks-1 blocks, computing the CRCs on each braid + independently. + */ + while (--blks) { + /* Load the word for each braid into registers. */ + word0 = crc0 ^ words[0]; +#if N > 1 + word1 = crc1 ^ words[1]; +#if N > 2 + word2 = crc2 ^ words[2]; +#if N > 3 + word3 = crc3 ^ words[3]; +#if N > 4 + word4 = crc4 ^ words[4]; +#if N > 5 + word5 = crc5 ^ words[5]; +#endif +#endif +#endif +#endif +#endif + words += N; -#define GF2_DIM 32 /* dimension of GF(2) vectors (length of CRC) */ + /* Compute and update the CRC for each word. The loop should + get unrolled. */ + crc0 = crc_braid_table[0][word0 & 0xff]; +#if N > 1 + crc1 = crc_braid_table[0][word1 & 0xff]; +#if N > 2 + crc2 = crc_braid_table[0][word2 & 0xff]; +#if N > 3 + crc3 = crc_braid_table[0][word3 & 0xff]; +#if N > 4 + crc4 = crc_braid_table[0][word4 & 0xff]; +#if N > 5 + crc5 = crc_braid_table[0][word5 & 0xff]; +#endif +#endif +#endif +#endif +#endif + for (k = 1; k < W; k++) { + crc0 ^= crc_braid_table[k][(word0 >> (k << 3)) & 0xff]; +#if N > 1 + crc1 ^= crc_braid_table[k][(word1 >> (k << 3)) & 0xff]; +#if N > 2 + crc2 ^= crc_braid_table[k][(word2 >> (k << 3)) & 0xff]; +#if N > 3 + crc3 ^= crc_braid_table[k][(word3 >> (k << 3)) & 0xff]; +#if N > 4 + crc4 ^= crc_braid_table[k][(word4 >> (k << 3)) & 0xff]; +#if N > 5 + crc5 ^= crc_braid_table[k][(word5 >> (k << 3)) & 0xff]; +#endif +#endif +#endif +#endif +#endif + } + } -/* ========================================================================= */ -local unsigned long gf2_matrix_times(mat, vec) - unsigned long *mat; - unsigned long vec; -{ - unsigned long sum; - - sum = 0; - while (vec) { - if (vec & 1) - sum ^= *mat; - vec >>= 1; - mat++; + /* + Process the last block, combining the CRCs of the N braids at the + same time. + */ + crc = crc_word(crc0 ^ words[0]); +#if N > 1 + crc = crc_word(crc1 ^ words[1] ^ crc); +#if N > 2 + crc = crc_word(crc2 ^ words[2] ^ crc); +#if N > 3 + crc = crc_word(crc3 ^ words[3] ^ crc); +#if N > 4 + crc = crc_word(crc4 ^ words[4] ^ crc); +#if N > 5 + crc = crc_word(crc5 ^ words[5] ^ crc); +#endif +#endif +#endif +#endif +#endif + words += N; + } + else { + /* Big endian. */ + + z_word_t crc0, word0, comb; +#if N > 1 + z_word_t crc1, word1; +#if N > 2 + z_word_t crc2, word2; +#if N > 3 + z_word_t crc3, word3; +#if N > 4 + z_word_t crc4, word4; +#if N > 5 + z_word_t crc5, word5; +#endif +#endif +#endif +#endif +#endif + + /* Initialize the CRC for each braid. */ + crc0 = byte_swap(crc); +#if N > 1 + crc1 = 0; +#if N > 2 + crc2 = 0; +#if N > 3 + crc3 = 0; +#if N > 4 + crc4 = 0; +#if N > 5 + crc5 = 0; +#endif +#endif +#endif +#endif +#endif + + /* + Process the first blks-1 blocks, computing the CRCs on each braid + independently. + */ + while (--blks) { + /* Load the word for each braid into registers. */ + word0 = crc0 ^ words[0]; +#if N > 1 + word1 = crc1 ^ words[1]; +#if N > 2 + word2 = crc2 ^ words[2]; +#if N > 3 + word3 = crc3 ^ words[3]; +#if N > 4 + word4 = crc4 ^ words[4]; +#if N > 5 + word5 = crc5 ^ words[5]; +#endif +#endif +#endif +#endif +#endif + words += N; + + /* Compute and update the CRC for each word. The loop should + get unrolled. */ + crc0 = crc_braid_big_table[0][word0 & 0xff]; +#if N > 1 + crc1 = crc_braid_big_table[0][word1 & 0xff]; +#if N > 2 + crc2 = crc_braid_big_table[0][word2 & 0xff]; +#if N > 3 + crc3 = crc_braid_big_table[0][word3 & 0xff]; +#if N > 4 + crc4 = crc_braid_big_table[0][word4 & 0xff]; +#if N > 5 + crc5 = crc_braid_big_table[0][word5 & 0xff]; +#endif +#endif +#endif +#endif +#endif + for (k = 1; k < W; k++) { + crc0 ^= crc_braid_big_table[k][(word0 >> (k << 3)) & 0xff]; +#if N > 1 + crc1 ^= crc_braid_big_table[k][(word1 >> (k << 3)) & 0xff]; +#if N > 2 + crc2 ^= crc_braid_big_table[k][(word2 >> (k << 3)) & 0xff]; +#if N > 3 + crc3 ^= crc_braid_big_table[k][(word3 >> (k << 3)) & 0xff]; +#if N > 4 + crc4 ^= crc_braid_big_table[k][(word4 >> (k << 3)) & 0xff]; +#if N > 5 + crc5 ^= crc_braid_big_table[k][(word5 >> (k << 3)) & 0xff]; +#endif +#endif +#endif +#endif +#endif + } + } + + /* + Process the last block, combining the CRCs of the N braids at the + same time. + */ + comb = crc_word_big(crc0 ^ words[0]); +#if N > 1 + comb = crc_word_big(crc1 ^ words[1] ^ comb); +#if N > 2 + comb = crc_word_big(crc2 ^ words[2] ^ comb); +#if N > 3 + comb = crc_word_big(crc3 ^ words[3] ^ comb); +#if N > 4 + comb = crc_word_big(crc4 ^ words[4] ^ comb); +#if N > 5 + comb = crc_word_big(crc5 ^ words[5] ^ comb); +#endif +#endif +#endif +#endif +#endif + words += N; + crc = byte_swap(comb); + } + + /* + Update the pointer to the remaining bytes to process. + */ + buf = (unsigned char const *)words; } - return sum; + +#endif /* W */ + + /* Complete the computation of the CRC on any remaining bytes. */ + while (len >= 8) { + len -= 8; + crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff]; + crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff]; + crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff]; + crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff]; + crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff]; + crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff]; + crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff]; + crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff]; + } + while (len) { + len--; + crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff]; + } + + /* Return the CRC, post-conditioned. */ + return crc ^ 0xffffffff; } +#endif + /* ========================================================================= */ -local void gf2_matrix_square(square, mat) - unsigned long *square; - unsigned long *mat; +unsigned long ZEXPORT crc32(crc, buf, len) + unsigned long crc; + const unsigned char FAR *buf; + uInt len; { - int n; - - for (n = 0; n < GF2_DIM; n++) - square[n] = gf2_matrix_times(mat, mat[n]); + return crc32_z(crc, buf, len); } /* ========================================================================= */ -local uLong crc32_combine_(crc1, crc2, len2) +uLong ZEXPORT crc32_combine64(crc1, crc2, len2) uLong crc1; uLong crc2; z_off64_t len2; { - int n; - unsigned long row; - unsigned long even[GF2_DIM]; /* even-power-of-two zeros operator */ - unsigned long odd[GF2_DIM]; /* odd-power-of-two zeros operator */ - - /* degenerate case (also disallow negative lengths) */ - if (len2 <= 0) - return crc1; - - /* put operator for one zero bit in odd */ - odd[0] = 0xedb88320UL; /* CRC-32 polynomial */ - row = 1; - for (n = 1; n < GF2_DIM; n++) { - odd[n] = row; - row <<= 1; - } - - /* put operator for two zero bits in even */ - gf2_matrix_square(even, odd); - - /* put operator for four zero bits in odd */ - gf2_matrix_square(odd, even); - - /* apply len2 zeros to crc1 (first square will put the operator for one - zero byte, eight zero bits, in even) */ - do { - /* apply zeros operator for this bit of len2 */ - gf2_matrix_square(even, odd); - if (len2 & 1) - crc1 = gf2_matrix_times(even, crc1); - len2 >>= 1; - - /* if no more bits set, then done */ - if (len2 == 0) - break; - - /* another iteration of the loop with odd and even swapped */ - gf2_matrix_square(odd, even); - if (len2 & 1) - crc1 = gf2_matrix_times(odd, crc1); - len2 >>= 1; - - /* if no more bits set, then done */ - } while (len2 != 0); - - /* return combined crc */ - crc1 ^= crc2; - return crc1; +#ifdef DYNAMIC_CRC_TABLE + once(&made, make_crc_table); +#endif /* DYNAMIC_CRC_TABLE */ + return multmodp(x2nmodp(len2, 3), crc1) ^ crc2; } /* ========================================================================= */ @@ -430,13 +1086,31 @@ uLong crc2; z_off_t len2; { - return crc32_combine_(crc1, crc2, len2); + return crc32_combine64(crc1, crc2, len2); } -uLong ZEXPORT crc32_combine64(crc1, crc2, len2) +/* ========================================================================= */ +uLong ZEXPORT crc32_combine_gen64(len2) + z_off64_t len2; +{ +#ifdef DYNAMIC_CRC_TABLE + once(&made, make_crc_table); +#endif /* DYNAMIC_CRC_TABLE */ + return x2nmodp(len2, 3); +} + +/* ========================================================================= */ +uLong ZEXPORT crc32_combine_gen(len2) + z_off_t len2; +{ + return crc32_combine_gen64(len2); +} + +/* ========================================================================= */ +uLong crc32_combine_op(crc1, crc2, op) uLong crc1; uLong crc2; - z_off64_t len2; + uLong op; { - return crc32_combine_(crc1, crc2, len2); + return multmodp(op, crc1) ^ crc2; } diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/crc32.h mame-0.243+dfsg.1/3rdparty/zlib/crc32.h --- mame-0.242+dfsg.1/3rdparty/zlib/crc32.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/crc32.h 2022-04-29 05:37:26.000000000 +0000 @@ -2,440 +2,9445 @@ * Generated automatically by crc32.c */ -local const z_crc_t FAR crc_table[TBLS][256] = -{ - { - 0x00000000UL, 0x77073096UL, 0xee0e612cUL, 0x990951baUL, 0x076dc419UL, - 0x706af48fUL, 0xe963a535UL, 0x9e6495a3UL, 0x0edb8832UL, 0x79dcb8a4UL, - 0xe0d5e91eUL, 0x97d2d988UL, 0x09b64c2bUL, 0x7eb17cbdUL, 0xe7b82d07UL, - 0x90bf1d91UL, 0x1db71064UL, 0x6ab020f2UL, 0xf3b97148UL, 0x84be41deUL, - 0x1adad47dUL, 0x6ddde4ebUL, 0xf4d4b551UL, 0x83d385c7UL, 0x136c9856UL, - 0x646ba8c0UL, 0xfd62f97aUL, 0x8a65c9ecUL, 0x14015c4fUL, 0x63066cd9UL, - 0xfa0f3d63UL, 0x8d080df5UL, 0x3b6e20c8UL, 0x4c69105eUL, 0xd56041e4UL, - 0xa2677172UL, 0x3c03e4d1UL, 0x4b04d447UL, 0xd20d85fdUL, 0xa50ab56bUL, - 0x35b5a8faUL, 0x42b2986cUL, 0xdbbbc9d6UL, 0xacbcf940UL, 0x32d86ce3UL, - 0x45df5c75UL, 0xdcd60dcfUL, 0xabd13d59UL, 0x26d930acUL, 0x51de003aUL, - 0xc8d75180UL, 0xbfd06116UL, 0x21b4f4b5UL, 0x56b3c423UL, 0xcfba9599UL, - 0xb8bda50fUL, 0x2802b89eUL, 0x5f058808UL, 0xc60cd9b2UL, 0xb10be924UL, - 0x2f6f7c87UL, 0x58684c11UL, 0xc1611dabUL, 0xb6662d3dUL, 0x76dc4190UL, - 0x01db7106UL, 0x98d220bcUL, 0xefd5102aUL, 0x71b18589UL, 0x06b6b51fUL, - 0x9fbfe4a5UL, 0xe8b8d433UL, 0x7807c9a2UL, 0x0f00f934UL, 0x9609a88eUL, - 0xe10e9818UL, 0x7f6a0dbbUL, 0x086d3d2dUL, 0x91646c97UL, 0xe6635c01UL, - 0x6b6b51f4UL, 0x1c6c6162UL, 0x856530d8UL, 0xf262004eUL, 0x6c0695edUL, - 0x1b01a57bUL, 0x8208f4c1UL, 0xf50fc457UL, 0x65b0d9c6UL, 0x12b7e950UL, - 0x8bbeb8eaUL, 0xfcb9887cUL, 0x62dd1ddfUL, 0x15da2d49UL, 0x8cd37cf3UL, - 0xfbd44c65UL, 0x4db26158UL, 0x3ab551ceUL, 0xa3bc0074UL, 0xd4bb30e2UL, - 0x4adfa541UL, 0x3dd895d7UL, 0xa4d1c46dUL, 0xd3d6f4fbUL, 0x4369e96aUL, - 0x346ed9fcUL, 0xad678846UL, 0xda60b8d0UL, 0x44042d73UL, 0x33031de5UL, - 0xaa0a4c5fUL, 0xdd0d7cc9UL, 0x5005713cUL, 0x270241aaUL, 0xbe0b1010UL, - 0xc90c2086UL, 0x5768b525UL, 0x206f85b3UL, 0xb966d409UL, 0xce61e49fUL, - 0x5edef90eUL, 0x29d9c998UL, 0xb0d09822UL, 0xc7d7a8b4UL, 0x59b33d17UL, - 0x2eb40d81UL, 0xb7bd5c3bUL, 0xc0ba6cadUL, 0xedb88320UL, 0x9abfb3b6UL, - 0x03b6e20cUL, 0x74b1d29aUL, 0xead54739UL, 0x9dd277afUL, 0x04db2615UL, - 0x73dc1683UL, 0xe3630b12UL, 0x94643b84UL, 0x0d6d6a3eUL, 0x7a6a5aa8UL, - 0xe40ecf0bUL, 0x9309ff9dUL, 0x0a00ae27UL, 0x7d079eb1UL, 0xf00f9344UL, - 0x8708a3d2UL, 0x1e01f268UL, 0x6906c2feUL, 0xf762575dUL, 0x806567cbUL, - 0x196c3671UL, 0x6e6b06e7UL, 0xfed41b76UL, 0x89d32be0UL, 0x10da7a5aUL, - 0x67dd4accUL, 0xf9b9df6fUL, 0x8ebeeff9UL, 0x17b7be43UL, 0x60b08ed5UL, - 0xd6d6a3e8UL, 0xa1d1937eUL, 0x38d8c2c4UL, 0x4fdff252UL, 0xd1bb67f1UL, - 0xa6bc5767UL, 0x3fb506ddUL, 0x48b2364bUL, 0xd80d2bdaUL, 0xaf0a1b4cUL, - 0x36034af6UL, 0x41047a60UL, 0xdf60efc3UL, 0xa867df55UL, 0x316e8eefUL, - 0x4669be79UL, 0xcb61b38cUL, 0xbc66831aUL, 0x256fd2a0UL, 0x5268e236UL, - 0xcc0c7795UL, 0xbb0b4703UL, 0x220216b9UL, 0x5505262fUL, 0xc5ba3bbeUL, - 0xb2bd0b28UL, 0x2bb45a92UL, 0x5cb36a04UL, 0xc2d7ffa7UL, 0xb5d0cf31UL, - 0x2cd99e8bUL, 0x5bdeae1dUL, 0x9b64c2b0UL, 0xec63f226UL, 0x756aa39cUL, - 0x026d930aUL, 0x9c0906a9UL, 0xeb0e363fUL, 0x72076785UL, 0x05005713UL, - 0x95bf4a82UL, 0xe2b87a14UL, 0x7bb12baeUL, 0x0cb61b38UL, 0x92d28e9bUL, - 0xe5d5be0dUL, 0x7cdcefb7UL, 0x0bdbdf21UL, 0x86d3d2d4UL, 0xf1d4e242UL, - 0x68ddb3f8UL, 0x1fda836eUL, 0x81be16cdUL, 0xf6b9265bUL, 0x6fb077e1UL, - 0x18b74777UL, 0x88085ae6UL, 0xff0f6a70UL, 0x66063bcaUL, 0x11010b5cUL, - 0x8f659effUL, 0xf862ae69UL, 0x616bffd3UL, 0x166ccf45UL, 0xa00ae278UL, - 0xd70dd2eeUL, 0x4e048354UL, 0x3903b3c2UL, 0xa7672661UL, 0xd06016f7UL, - 0x4969474dUL, 0x3e6e77dbUL, 0xaed16a4aUL, 0xd9d65adcUL, 0x40df0b66UL, - 0x37d83bf0UL, 0xa9bcae53UL, 0xdebb9ec5UL, 0x47b2cf7fUL, 0x30b5ffe9UL, - 0xbdbdf21cUL, 0xcabac28aUL, 0x53b39330UL, 0x24b4a3a6UL, 0xbad03605UL, - 0xcdd70693UL, 0x54de5729UL, 0x23d967bfUL, 0xb3667a2eUL, 0xc4614ab8UL, - 0x5d681b02UL, 0x2a6f2b94UL, 0xb40bbe37UL, 0xc30c8ea1UL, 0x5a05df1bUL, - 0x2d02ef8dUL -#ifdef BYFOUR - }, - { - 0x00000000UL, 0x191b3141UL, 0x32366282UL, 0x2b2d53c3UL, 0x646cc504UL, - 0x7d77f445UL, 0x565aa786UL, 0x4f4196c7UL, 0xc8d98a08UL, 0xd1c2bb49UL, - 0xfaefe88aUL, 0xe3f4d9cbUL, 0xacb54f0cUL, 0xb5ae7e4dUL, 0x9e832d8eUL, - 0x87981ccfUL, 0x4ac21251UL, 0x53d92310UL, 0x78f470d3UL, 0x61ef4192UL, - 0x2eaed755UL, 0x37b5e614UL, 0x1c98b5d7UL, 0x05838496UL, 0x821b9859UL, - 0x9b00a918UL, 0xb02dfadbUL, 0xa936cb9aUL, 0xe6775d5dUL, 0xff6c6c1cUL, - 0xd4413fdfUL, 0xcd5a0e9eUL, 0x958424a2UL, 0x8c9f15e3UL, 0xa7b24620UL, - 0xbea97761UL, 0xf1e8e1a6UL, 0xe8f3d0e7UL, 0xc3de8324UL, 0xdac5b265UL, - 0x5d5daeaaUL, 0x44469febUL, 0x6f6bcc28UL, 0x7670fd69UL, 0x39316baeUL, - 0x202a5aefUL, 0x0b07092cUL, 0x121c386dUL, 0xdf4636f3UL, 0xc65d07b2UL, - 0xed705471UL, 0xf46b6530UL, 0xbb2af3f7UL, 0xa231c2b6UL, 0x891c9175UL, - 0x9007a034UL, 0x179fbcfbUL, 0x0e848dbaUL, 0x25a9de79UL, 0x3cb2ef38UL, - 0x73f379ffUL, 0x6ae848beUL, 0x41c51b7dUL, 0x58de2a3cUL, 0xf0794f05UL, - 0xe9627e44UL, 0xc24f2d87UL, 0xdb541cc6UL, 0x94158a01UL, 0x8d0ebb40UL, - 0xa623e883UL, 0xbf38d9c2UL, 0x38a0c50dUL, 0x21bbf44cUL, 0x0a96a78fUL, - 0x138d96ceUL, 0x5ccc0009UL, 0x45d73148UL, 0x6efa628bUL, 0x77e153caUL, - 0xbabb5d54UL, 0xa3a06c15UL, 0x888d3fd6UL, 0x91960e97UL, 0xded79850UL, - 0xc7cca911UL, 0xece1fad2UL, 0xf5facb93UL, 0x7262d75cUL, 0x6b79e61dUL, - 0x4054b5deUL, 0x594f849fUL, 0x160e1258UL, 0x0f152319UL, 0x243870daUL, - 0x3d23419bUL, 0x65fd6ba7UL, 0x7ce65ae6UL, 0x57cb0925UL, 0x4ed03864UL, - 0x0191aea3UL, 0x188a9fe2UL, 0x33a7cc21UL, 0x2abcfd60UL, 0xad24e1afUL, - 0xb43fd0eeUL, 0x9f12832dUL, 0x8609b26cUL, 0xc94824abUL, 0xd05315eaUL, - 0xfb7e4629UL, 0xe2657768UL, 0x2f3f79f6UL, 0x362448b7UL, 0x1d091b74UL, - 0x04122a35UL, 0x4b53bcf2UL, 0x52488db3UL, 0x7965de70UL, 0x607eef31UL, - 0xe7e6f3feUL, 0xfefdc2bfUL, 0xd5d0917cUL, 0xcccba03dUL, 0x838a36faUL, - 0x9a9107bbUL, 0xb1bc5478UL, 0xa8a76539UL, 0x3b83984bUL, 0x2298a90aUL, - 0x09b5fac9UL, 0x10aecb88UL, 0x5fef5d4fUL, 0x46f46c0eUL, 0x6dd93fcdUL, - 0x74c20e8cUL, 0xf35a1243UL, 0xea412302UL, 0xc16c70c1UL, 0xd8774180UL, - 0x9736d747UL, 0x8e2de606UL, 0xa500b5c5UL, 0xbc1b8484UL, 0x71418a1aUL, - 0x685abb5bUL, 0x4377e898UL, 0x5a6cd9d9UL, 0x152d4f1eUL, 0x0c367e5fUL, - 0x271b2d9cUL, 0x3e001cddUL, 0xb9980012UL, 0xa0833153UL, 0x8bae6290UL, - 0x92b553d1UL, 0xddf4c516UL, 0xc4eff457UL, 0xefc2a794UL, 0xf6d996d5UL, - 0xae07bce9UL, 0xb71c8da8UL, 0x9c31de6bUL, 0x852aef2aUL, 0xca6b79edUL, - 0xd37048acUL, 0xf85d1b6fUL, 0xe1462a2eUL, 0x66de36e1UL, 0x7fc507a0UL, - 0x54e85463UL, 0x4df36522UL, 0x02b2f3e5UL, 0x1ba9c2a4UL, 0x30849167UL, - 0x299fa026UL, 0xe4c5aeb8UL, 0xfdde9ff9UL, 0xd6f3cc3aUL, 0xcfe8fd7bUL, - 0x80a96bbcUL, 0x99b25afdUL, 0xb29f093eUL, 0xab84387fUL, 0x2c1c24b0UL, - 0x350715f1UL, 0x1e2a4632UL, 0x07317773UL, 0x4870e1b4UL, 0x516bd0f5UL, - 0x7a468336UL, 0x635db277UL, 0xcbfad74eUL, 0xd2e1e60fUL, 0xf9ccb5ccUL, - 0xe0d7848dUL, 0xaf96124aUL, 0xb68d230bUL, 0x9da070c8UL, 0x84bb4189UL, - 0x03235d46UL, 0x1a386c07UL, 0x31153fc4UL, 0x280e0e85UL, 0x674f9842UL, - 0x7e54a903UL, 0x5579fac0UL, 0x4c62cb81UL, 0x8138c51fUL, 0x9823f45eUL, - 0xb30ea79dUL, 0xaa1596dcUL, 0xe554001bUL, 0xfc4f315aUL, 0xd7626299UL, - 0xce7953d8UL, 0x49e14f17UL, 0x50fa7e56UL, 0x7bd72d95UL, 0x62cc1cd4UL, - 0x2d8d8a13UL, 0x3496bb52UL, 0x1fbbe891UL, 0x06a0d9d0UL, 0x5e7ef3ecUL, - 0x4765c2adUL, 0x6c48916eUL, 0x7553a02fUL, 0x3a1236e8UL, 0x230907a9UL, - 0x0824546aUL, 0x113f652bUL, 0x96a779e4UL, 0x8fbc48a5UL, 0xa4911b66UL, - 0xbd8a2a27UL, 0xf2cbbce0UL, 0xebd08da1UL, 0xc0fdde62UL, 0xd9e6ef23UL, - 0x14bce1bdUL, 0x0da7d0fcUL, 0x268a833fUL, 0x3f91b27eUL, 0x70d024b9UL, - 0x69cb15f8UL, 0x42e6463bUL, 0x5bfd777aUL, 0xdc656bb5UL, 0xc57e5af4UL, - 0xee530937UL, 0xf7483876UL, 0xb809aeb1UL, 0xa1129ff0UL, 0x8a3fcc33UL, - 0x9324fd72UL - }, - { - 0x00000000UL, 0x01c26a37UL, 0x0384d46eUL, 0x0246be59UL, 0x0709a8dcUL, - 0x06cbc2ebUL, 0x048d7cb2UL, 0x054f1685UL, 0x0e1351b8UL, 0x0fd13b8fUL, - 0x0d9785d6UL, 0x0c55efe1UL, 0x091af964UL, 0x08d89353UL, 0x0a9e2d0aUL, - 0x0b5c473dUL, 0x1c26a370UL, 0x1de4c947UL, 0x1fa2771eUL, 0x1e601d29UL, - 0x1b2f0bacUL, 0x1aed619bUL, 0x18abdfc2UL, 0x1969b5f5UL, 0x1235f2c8UL, - 0x13f798ffUL, 0x11b126a6UL, 0x10734c91UL, 0x153c5a14UL, 0x14fe3023UL, - 0x16b88e7aUL, 0x177ae44dUL, 0x384d46e0UL, 0x398f2cd7UL, 0x3bc9928eUL, - 0x3a0bf8b9UL, 0x3f44ee3cUL, 0x3e86840bUL, 0x3cc03a52UL, 0x3d025065UL, - 0x365e1758UL, 0x379c7d6fUL, 0x35dac336UL, 0x3418a901UL, 0x3157bf84UL, - 0x3095d5b3UL, 0x32d36beaUL, 0x331101ddUL, 0x246be590UL, 0x25a98fa7UL, - 0x27ef31feUL, 0x262d5bc9UL, 0x23624d4cUL, 0x22a0277bUL, 0x20e69922UL, - 0x2124f315UL, 0x2a78b428UL, 0x2bbade1fUL, 0x29fc6046UL, 0x283e0a71UL, - 0x2d711cf4UL, 0x2cb376c3UL, 0x2ef5c89aUL, 0x2f37a2adUL, 0x709a8dc0UL, - 0x7158e7f7UL, 0x731e59aeUL, 0x72dc3399UL, 0x7793251cUL, 0x76514f2bUL, - 0x7417f172UL, 0x75d59b45UL, 0x7e89dc78UL, 0x7f4bb64fUL, 0x7d0d0816UL, - 0x7ccf6221UL, 0x798074a4UL, 0x78421e93UL, 0x7a04a0caUL, 0x7bc6cafdUL, - 0x6cbc2eb0UL, 0x6d7e4487UL, 0x6f38fadeUL, 0x6efa90e9UL, 0x6bb5866cUL, - 0x6a77ec5bUL, 0x68315202UL, 0x69f33835UL, 0x62af7f08UL, 0x636d153fUL, - 0x612bab66UL, 0x60e9c151UL, 0x65a6d7d4UL, 0x6464bde3UL, 0x662203baUL, - 0x67e0698dUL, 0x48d7cb20UL, 0x4915a117UL, 0x4b531f4eUL, 0x4a917579UL, - 0x4fde63fcUL, 0x4e1c09cbUL, 0x4c5ab792UL, 0x4d98dda5UL, 0x46c49a98UL, - 0x4706f0afUL, 0x45404ef6UL, 0x448224c1UL, 0x41cd3244UL, 0x400f5873UL, - 0x4249e62aUL, 0x438b8c1dUL, 0x54f16850UL, 0x55330267UL, 0x5775bc3eUL, - 0x56b7d609UL, 0x53f8c08cUL, 0x523aaabbUL, 0x507c14e2UL, 0x51be7ed5UL, - 0x5ae239e8UL, 0x5b2053dfUL, 0x5966ed86UL, 0x58a487b1UL, 0x5deb9134UL, - 0x5c29fb03UL, 0x5e6f455aUL, 0x5fad2f6dUL, 0xe1351b80UL, 0xe0f771b7UL, - 0xe2b1cfeeUL, 0xe373a5d9UL, 0xe63cb35cUL, 0xe7fed96bUL, 0xe5b86732UL, - 0xe47a0d05UL, 0xef264a38UL, 0xeee4200fUL, 0xeca29e56UL, 0xed60f461UL, - 0xe82fe2e4UL, 0xe9ed88d3UL, 0xebab368aUL, 0xea695cbdUL, 0xfd13b8f0UL, - 0xfcd1d2c7UL, 0xfe976c9eUL, 0xff5506a9UL, 0xfa1a102cUL, 0xfbd87a1bUL, - 0xf99ec442UL, 0xf85cae75UL, 0xf300e948UL, 0xf2c2837fUL, 0xf0843d26UL, - 0xf1465711UL, 0xf4094194UL, 0xf5cb2ba3UL, 0xf78d95faUL, 0xf64fffcdUL, - 0xd9785d60UL, 0xd8ba3757UL, 0xdafc890eUL, 0xdb3ee339UL, 0xde71f5bcUL, - 0xdfb39f8bUL, 0xddf521d2UL, 0xdc374be5UL, 0xd76b0cd8UL, 0xd6a966efUL, - 0xd4efd8b6UL, 0xd52db281UL, 0xd062a404UL, 0xd1a0ce33UL, 0xd3e6706aUL, - 0xd2241a5dUL, 0xc55efe10UL, 0xc49c9427UL, 0xc6da2a7eUL, 0xc7184049UL, - 0xc25756ccUL, 0xc3953cfbUL, 0xc1d382a2UL, 0xc011e895UL, 0xcb4dafa8UL, - 0xca8fc59fUL, 0xc8c97bc6UL, 0xc90b11f1UL, 0xcc440774UL, 0xcd866d43UL, - 0xcfc0d31aUL, 0xce02b92dUL, 0x91af9640UL, 0x906dfc77UL, 0x922b422eUL, - 0x93e92819UL, 0x96a63e9cUL, 0x976454abUL, 0x9522eaf2UL, 0x94e080c5UL, - 0x9fbcc7f8UL, 0x9e7eadcfUL, 0x9c381396UL, 0x9dfa79a1UL, 0x98b56f24UL, - 0x99770513UL, 0x9b31bb4aUL, 0x9af3d17dUL, 0x8d893530UL, 0x8c4b5f07UL, - 0x8e0de15eUL, 0x8fcf8b69UL, 0x8a809decUL, 0x8b42f7dbUL, 0x89044982UL, - 0x88c623b5UL, 0x839a6488UL, 0x82580ebfUL, 0x801eb0e6UL, 0x81dcdad1UL, - 0x8493cc54UL, 0x8551a663UL, 0x8717183aUL, 0x86d5720dUL, 0xa9e2d0a0UL, - 0xa820ba97UL, 0xaa6604ceUL, 0xaba46ef9UL, 0xaeeb787cUL, 0xaf29124bUL, - 0xad6fac12UL, 0xacadc625UL, 0xa7f18118UL, 0xa633eb2fUL, 0xa4755576UL, - 0xa5b73f41UL, 0xa0f829c4UL, 0xa13a43f3UL, 0xa37cfdaaUL, 0xa2be979dUL, - 0xb5c473d0UL, 0xb40619e7UL, 0xb640a7beUL, 0xb782cd89UL, 0xb2cddb0cUL, - 0xb30fb13bUL, 0xb1490f62UL, 0xb08b6555UL, 0xbbd72268UL, 0xba15485fUL, - 0xb853f606UL, 0xb9919c31UL, 0xbcde8ab4UL, 0xbd1ce083UL, 0xbf5a5edaUL, - 0xbe9834edUL - }, - { - 0x00000000UL, 0xb8bc6765UL, 0xaa09c88bUL, 0x12b5afeeUL, 0x8f629757UL, - 0x37def032UL, 0x256b5fdcUL, 0x9dd738b9UL, 0xc5b428efUL, 0x7d084f8aUL, - 0x6fbde064UL, 0xd7018701UL, 0x4ad6bfb8UL, 0xf26ad8ddUL, 0xe0df7733UL, - 0x58631056UL, 0x5019579fUL, 0xe8a530faUL, 0xfa109f14UL, 0x42acf871UL, - 0xdf7bc0c8UL, 0x67c7a7adUL, 0x75720843UL, 0xcdce6f26UL, 0x95ad7f70UL, - 0x2d111815UL, 0x3fa4b7fbUL, 0x8718d09eUL, 0x1acfe827UL, 0xa2738f42UL, - 0xb0c620acUL, 0x087a47c9UL, 0xa032af3eUL, 0x188ec85bUL, 0x0a3b67b5UL, - 0xb28700d0UL, 0x2f503869UL, 0x97ec5f0cUL, 0x8559f0e2UL, 0x3de59787UL, - 0x658687d1UL, 0xdd3ae0b4UL, 0xcf8f4f5aUL, 0x7733283fUL, 0xeae41086UL, - 0x525877e3UL, 0x40edd80dUL, 0xf851bf68UL, 0xf02bf8a1UL, 0x48979fc4UL, - 0x5a22302aUL, 0xe29e574fUL, 0x7f496ff6UL, 0xc7f50893UL, 0xd540a77dUL, - 0x6dfcc018UL, 0x359fd04eUL, 0x8d23b72bUL, 0x9f9618c5UL, 0x272a7fa0UL, - 0xbafd4719UL, 0x0241207cUL, 0x10f48f92UL, 0xa848e8f7UL, 0x9b14583dUL, - 0x23a83f58UL, 0x311d90b6UL, 0x89a1f7d3UL, 0x1476cf6aUL, 0xaccaa80fUL, - 0xbe7f07e1UL, 0x06c36084UL, 0x5ea070d2UL, 0xe61c17b7UL, 0xf4a9b859UL, - 0x4c15df3cUL, 0xd1c2e785UL, 0x697e80e0UL, 0x7bcb2f0eUL, 0xc377486bUL, - 0xcb0d0fa2UL, 0x73b168c7UL, 0x6104c729UL, 0xd9b8a04cUL, 0x446f98f5UL, - 0xfcd3ff90UL, 0xee66507eUL, 0x56da371bUL, 0x0eb9274dUL, 0xb6054028UL, - 0xa4b0efc6UL, 0x1c0c88a3UL, 0x81dbb01aUL, 0x3967d77fUL, 0x2bd27891UL, - 0x936e1ff4UL, 0x3b26f703UL, 0x839a9066UL, 0x912f3f88UL, 0x299358edUL, - 0xb4446054UL, 0x0cf80731UL, 0x1e4da8dfUL, 0xa6f1cfbaUL, 0xfe92dfecUL, - 0x462eb889UL, 0x549b1767UL, 0xec277002UL, 0x71f048bbUL, 0xc94c2fdeUL, - 0xdbf98030UL, 0x6345e755UL, 0x6b3fa09cUL, 0xd383c7f9UL, 0xc1366817UL, - 0x798a0f72UL, 0xe45d37cbUL, 0x5ce150aeUL, 0x4e54ff40UL, 0xf6e89825UL, - 0xae8b8873UL, 0x1637ef16UL, 0x048240f8UL, 0xbc3e279dUL, 0x21e91f24UL, - 0x99557841UL, 0x8be0d7afUL, 0x335cb0caUL, 0xed59b63bUL, 0x55e5d15eUL, - 0x47507eb0UL, 0xffec19d5UL, 0x623b216cUL, 0xda874609UL, 0xc832e9e7UL, - 0x708e8e82UL, 0x28ed9ed4UL, 0x9051f9b1UL, 0x82e4565fUL, 0x3a58313aUL, - 0xa78f0983UL, 0x1f336ee6UL, 0x0d86c108UL, 0xb53aa66dUL, 0xbd40e1a4UL, - 0x05fc86c1UL, 0x1749292fUL, 0xaff54e4aUL, 0x322276f3UL, 0x8a9e1196UL, - 0x982bbe78UL, 0x2097d91dUL, 0x78f4c94bUL, 0xc048ae2eUL, 0xd2fd01c0UL, - 0x6a4166a5UL, 0xf7965e1cUL, 0x4f2a3979UL, 0x5d9f9697UL, 0xe523f1f2UL, - 0x4d6b1905UL, 0xf5d77e60UL, 0xe762d18eUL, 0x5fdeb6ebUL, 0xc2098e52UL, - 0x7ab5e937UL, 0x680046d9UL, 0xd0bc21bcUL, 0x88df31eaUL, 0x3063568fUL, - 0x22d6f961UL, 0x9a6a9e04UL, 0x07bda6bdUL, 0xbf01c1d8UL, 0xadb46e36UL, - 0x15080953UL, 0x1d724e9aUL, 0xa5ce29ffUL, 0xb77b8611UL, 0x0fc7e174UL, - 0x9210d9cdUL, 0x2aacbea8UL, 0x38191146UL, 0x80a57623UL, 0xd8c66675UL, - 0x607a0110UL, 0x72cfaefeUL, 0xca73c99bUL, 0x57a4f122UL, 0xef189647UL, - 0xfdad39a9UL, 0x45115eccUL, 0x764dee06UL, 0xcef18963UL, 0xdc44268dUL, - 0x64f841e8UL, 0xf92f7951UL, 0x41931e34UL, 0x5326b1daUL, 0xeb9ad6bfUL, - 0xb3f9c6e9UL, 0x0b45a18cUL, 0x19f00e62UL, 0xa14c6907UL, 0x3c9b51beUL, - 0x842736dbUL, 0x96929935UL, 0x2e2efe50UL, 0x2654b999UL, 0x9ee8defcUL, - 0x8c5d7112UL, 0x34e11677UL, 0xa9362eceUL, 0x118a49abUL, 0x033fe645UL, - 0xbb838120UL, 0xe3e09176UL, 0x5b5cf613UL, 0x49e959fdUL, 0xf1553e98UL, - 0x6c820621UL, 0xd43e6144UL, 0xc68bceaaUL, 0x7e37a9cfUL, 0xd67f4138UL, - 0x6ec3265dUL, 0x7c7689b3UL, 0xc4caeed6UL, 0x591dd66fUL, 0xe1a1b10aUL, - 0xf3141ee4UL, 0x4ba87981UL, 0x13cb69d7UL, 0xab770eb2UL, 0xb9c2a15cUL, - 0x017ec639UL, 0x9ca9fe80UL, 0x241599e5UL, 0x36a0360bUL, 0x8e1c516eUL, - 0x866616a7UL, 0x3eda71c2UL, 0x2c6fde2cUL, 0x94d3b949UL, 0x090481f0UL, - 0xb1b8e695UL, 0xa30d497bUL, 0x1bb12e1eUL, 0x43d23e48UL, 0xfb6e592dUL, - 0xe9dbf6c3UL, 0x516791a6UL, 0xccb0a91fUL, 0x740cce7aUL, 0x66b96194UL, - 0xde0506f1UL - }, - { - 0x00000000UL, 0x96300777UL, 0x2c610eeeUL, 0xba510999UL, 0x19c46d07UL, - 0x8ff46a70UL, 0x35a563e9UL, 0xa395649eUL, 0x3288db0eUL, 0xa4b8dc79UL, - 0x1ee9d5e0UL, 0x88d9d297UL, 0x2b4cb609UL, 0xbd7cb17eUL, 0x072db8e7UL, - 0x911dbf90UL, 0x6410b71dUL, 0xf220b06aUL, 0x4871b9f3UL, 0xde41be84UL, - 0x7dd4da1aUL, 0xebe4dd6dUL, 0x51b5d4f4UL, 0xc785d383UL, 0x56986c13UL, - 0xc0a86b64UL, 0x7af962fdUL, 0xecc9658aUL, 0x4f5c0114UL, 0xd96c0663UL, - 0x633d0ffaUL, 0xf50d088dUL, 0xc8206e3bUL, 0x5e10694cUL, 0xe44160d5UL, - 0x727167a2UL, 0xd1e4033cUL, 0x47d4044bUL, 0xfd850dd2UL, 0x6bb50aa5UL, - 0xfaa8b535UL, 0x6c98b242UL, 0xd6c9bbdbUL, 0x40f9bcacUL, 0xe36cd832UL, - 0x755cdf45UL, 0xcf0dd6dcUL, 0x593dd1abUL, 0xac30d926UL, 0x3a00de51UL, - 0x8051d7c8UL, 0x1661d0bfUL, 0xb5f4b421UL, 0x23c4b356UL, 0x9995bacfUL, - 0x0fa5bdb8UL, 0x9eb80228UL, 0x0888055fUL, 0xb2d90cc6UL, 0x24e90bb1UL, - 0x877c6f2fUL, 0x114c6858UL, 0xab1d61c1UL, 0x3d2d66b6UL, 0x9041dc76UL, - 0x0671db01UL, 0xbc20d298UL, 0x2a10d5efUL, 0x8985b171UL, 0x1fb5b606UL, - 0xa5e4bf9fUL, 0x33d4b8e8UL, 0xa2c90778UL, 0x34f9000fUL, 0x8ea80996UL, - 0x18980ee1UL, 0xbb0d6a7fUL, 0x2d3d6d08UL, 0x976c6491UL, 0x015c63e6UL, - 0xf4516b6bUL, 0x62616c1cUL, 0xd8306585UL, 0x4e0062f2UL, 0xed95066cUL, - 0x7ba5011bUL, 0xc1f40882UL, 0x57c40ff5UL, 0xc6d9b065UL, 0x50e9b712UL, - 0xeab8be8bUL, 0x7c88b9fcUL, 0xdf1ddd62UL, 0x492dda15UL, 0xf37cd38cUL, - 0x654cd4fbUL, 0x5861b24dUL, 0xce51b53aUL, 0x7400bca3UL, 0xe230bbd4UL, - 0x41a5df4aUL, 0xd795d83dUL, 0x6dc4d1a4UL, 0xfbf4d6d3UL, 0x6ae96943UL, - 0xfcd96e34UL, 0x468867adUL, 0xd0b860daUL, 0x732d0444UL, 0xe51d0333UL, - 0x5f4c0aaaUL, 0xc97c0dddUL, 0x3c710550UL, 0xaa410227UL, 0x10100bbeUL, - 0x86200cc9UL, 0x25b56857UL, 0xb3856f20UL, 0x09d466b9UL, 0x9fe461ceUL, - 0x0ef9de5eUL, 0x98c9d929UL, 0x2298d0b0UL, 0xb4a8d7c7UL, 0x173db359UL, - 0x810db42eUL, 0x3b5cbdb7UL, 0xad6cbac0UL, 0x2083b8edUL, 0xb6b3bf9aUL, - 0x0ce2b603UL, 0x9ad2b174UL, 0x3947d5eaUL, 0xaf77d29dUL, 0x1526db04UL, - 0x8316dc73UL, 0x120b63e3UL, 0x843b6494UL, 0x3e6a6d0dUL, 0xa85a6a7aUL, - 0x0bcf0ee4UL, 0x9dff0993UL, 0x27ae000aUL, 0xb19e077dUL, 0x44930ff0UL, - 0xd2a30887UL, 0x68f2011eUL, 0xfec20669UL, 0x5d5762f7UL, 0xcb676580UL, - 0x71366c19UL, 0xe7066b6eUL, 0x761bd4feUL, 0xe02bd389UL, 0x5a7ada10UL, - 0xcc4add67UL, 0x6fdfb9f9UL, 0xf9efbe8eUL, 0x43beb717UL, 0xd58eb060UL, - 0xe8a3d6d6UL, 0x7e93d1a1UL, 0xc4c2d838UL, 0x52f2df4fUL, 0xf167bbd1UL, - 0x6757bca6UL, 0xdd06b53fUL, 0x4b36b248UL, 0xda2b0dd8UL, 0x4c1b0aafUL, - 0xf64a0336UL, 0x607a0441UL, 0xc3ef60dfUL, 0x55df67a8UL, 0xef8e6e31UL, - 0x79be6946UL, 0x8cb361cbUL, 0x1a8366bcUL, 0xa0d26f25UL, 0x36e26852UL, - 0x95770cccUL, 0x03470bbbUL, 0xb9160222UL, 0x2f260555UL, 0xbe3bbac5UL, - 0x280bbdb2UL, 0x925ab42bUL, 0x046ab35cUL, 0xa7ffd7c2UL, 0x31cfd0b5UL, - 0x8b9ed92cUL, 0x1daede5bUL, 0xb0c2649bUL, 0x26f263ecUL, 0x9ca36a75UL, - 0x0a936d02UL, 0xa906099cUL, 0x3f360eebUL, 0x85670772UL, 0x13570005UL, - 0x824abf95UL, 0x147ab8e2UL, 0xae2bb17bUL, 0x381bb60cUL, 0x9b8ed292UL, - 0x0dbed5e5UL, 0xb7efdc7cUL, 0x21dfdb0bUL, 0xd4d2d386UL, 0x42e2d4f1UL, - 0xf8b3dd68UL, 0x6e83da1fUL, 0xcd16be81UL, 0x5b26b9f6UL, 0xe177b06fUL, - 0x7747b718UL, 0xe65a0888UL, 0x706a0fffUL, 0xca3b0666UL, 0x5c0b0111UL, - 0xff9e658fUL, 0x69ae62f8UL, 0xd3ff6b61UL, 0x45cf6c16UL, 0x78e20aa0UL, - 0xeed20dd7UL, 0x5483044eUL, 0xc2b30339UL, 0x612667a7UL, 0xf71660d0UL, - 0x4d476949UL, 0xdb776e3eUL, 0x4a6ad1aeUL, 0xdc5ad6d9UL, 0x660bdf40UL, - 0xf03bd837UL, 0x53aebca9UL, 0xc59ebbdeUL, 0x7fcfb247UL, 0xe9ffb530UL, - 0x1cf2bdbdUL, 0x8ac2bacaUL, 0x3093b353UL, 0xa6a3b424UL, 0x0536d0baUL, - 0x9306d7cdUL, 0x2957de54UL, 0xbf67d923UL, 0x2e7a66b3UL, 0xb84a61c4UL, - 0x021b685dUL, 0x942b6f2aUL, 0x37be0bb4UL, 0xa18e0cc3UL, 0x1bdf055aUL, - 0x8def022dUL - }, - { - 0x00000000UL, 0x41311b19UL, 0x82623632UL, 0xc3532d2bUL, 0x04c56c64UL, - 0x45f4777dUL, 0x86a75a56UL, 0xc796414fUL, 0x088ad9c8UL, 0x49bbc2d1UL, - 0x8ae8effaUL, 0xcbd9f4e3UL, 0x0c4fb5acUL, 0x4d7eaeb5UL, 0x8e2d839eUL, - 0xcf1c9887UL, 0x5112c24aUL, 0x1023d953UL, 0xd370f478UL, 0x9241ef61UL, - 0x55d7ae2eUL, 0x14e6b537UL, 0xd7b5981cUL, 0x96848305UL, 0x59981b82UL, - 0x18a9009bUL, 0xdbfa2db0UL, 0x9acb36a9UL, 0x5d5d77e6UL, 0x1c6c6cffUL, - 0xdf3f41d4UL, 0x9e0e5acdUL, 0xa2248495UL, 0xe3159f8cUL, 0x2046b2a7UL, - 0x6177a9beUL, 0xa6e1e8f1UL, 0xe7d0f3e8UL, 0x2483dec3UL, 0x65b2c5daUL, - 0xaaae5d5dUL, 0xeb9f4644UL, 0x28cc6b6fUL, 0x69fd7076UL, 0xae6b3139UL, - 0xef5a2a20UL, 0x2c09070bUL, 0x6d381c12UL, 0xf33646dfUL, 0xb2075dc6UL, - 0x715470edUL, 0x30656bf4UL, 0xf7f32abbUL, 0xb6c231a2UL, 0x75911c89UL, - 0x34a00790UL, 0xfbbc9f17UL, 0xba8d840eUL, 0x79dea925UL, 0x38efb23cUL, - 0xff79f373UL, 0xbe48e86aUL, 0x7d1bc541UL, 0x3c2ade58UL, 0x054f79f0UL, - 0x447e62e9UL, 0x872d4fc2UL, 0xc61c54dbUL, 0x018a1594UL, 0x40bb0e8dUL, - 0x83e823a6UL, 0xc2d938bfUL, 0x0dc5a038UL, 0x4cf4bb21UL, 0x8fa7960aUL, - 0xce968d13UL, 0x0900cc5cUL, 0x4831d745UL, 0x8b62fa6eUL, 0xca53e177UL, - 0x545dbbbaUL, 0x156ca0a3UL, 0xd63f8d88UL, 0x970e9691UL, 0x5098d7deUL, - 0x11a9ccc7UL, 0xd2fae1ecUL, 0x93cbfaf5UL, 0x5cd76272UL, 0x1de6796bUL, - 0xdeb55440UL, 0x9f844f59UL, 0x58120e16UL, 0x1923150fUL, 0xda703824UL, - 0x9b41233dUL, 0xa76bfd65UL, 0xe65ae67cUL, 0x2509cb57UL, 0x6438d04eUL, - 0xa3ae9101UL, 0xe29f8a18UL, 0x21cca733UL, 0x60fdbc2aUL, 0xafe124adUL, - 0xeed03fb4UL, 0x2d83129fUL, 0x6cb20986UL, 0xab2448c9UL, 0xea1553d0UL, - 0x29467efbUL, 0x687765e2UL, 0xf6793f2fUL, 0xb7482436UL, 0x741b091dUL, - 0x352a1204UL, 0xf2bc534bUL, 0xb38d4852UL, 0x70de6579UL, 0x31ef7e60UL, - 0xfef3e6e7UL, 0xbfc2fdfeUL, 0x7c91d0d5UL, 0x3da0cbccUL, 0xfa368a83UL, - 0xbb07919aUL, 0x7854bcb1UL, 0x3965a7a8UL, 0x4b98833bUL, 0x0aa99822UL, - 0xc9fab509UL, 0x88cbae10UL, 0x4f5def5fUL, 0x0e6cf446UL, 0xcd3fd96dUL, - 0x8c0ec274UL, 0x43125af3UL, 0x022341eaUL, 0xc1706cc1UL, 0x804177d8UL, - 0x47d73697UL, 0x06e62d8eUL, 0xc5b500a5UL, 0x84841bbcUL, 0x1a8a4171UL, - 0x5bbb5a68UL, 0x98e87743UL, 0xd9d96c5aUL, 0x1e4f2d15UL, 0x5f7e360cUL, - 0x9c2d1b27UL, 0xdd1c003eUL, 0x120098b9UL, 0x533183a0UL, 0x9062ae8bUL, - 0xd153b592UL, 0x16c5f4ddUL, 0x57f4efc4UL, 0x94a7c2efUL, 0xd596d9f6UL, - 0xe9bc07aeUL, 0xa88d1cb7UL, 0x6bde319cUL, 0x2aef2a85UL, 0xed796bcaUL, - 0xac4870d3UL, 0x6f1b5df8UL, 0x2e2a46e1UL, 0xe136de66UL, 0xa007c57fUL, - 0x6354e854UL, 0x2265f34dUL, 0xe5f3b202UL, 0xa4c2a91bUL, 0x67918430UL, - 0x26a09f29UL, 0xb8aec5e4UL, 0xf99fdefdUL, 0x3accf3d6UL, 0x7bfde8cfUL, - 0xbc6ba980UL, 0xfd5ab299UL, 0x3e099fb2UL, 0x7f3884abUL, 0xb0241c2cUL, - 0xf1150735UL, 0x32462a1eUL, 0x73773107UL, 0xb4e17048UL, 0xf5d06b51UL, - 0x3683467aUL, 0x77b25d63UL, 0x4ed7facbUL, 0x0fe6e1d2UL, 0xccb5ccf9UL, - 0x8d84d7e0UL, 0x4a1296afUL, 0x0b238db6UL, 0xc870a09dUL, 0x8941bb84UL, - 0x465d2303UL, 0x076c381aUL, 0xc43f1531UL, 0x850e0e28UL, 0x42984f67UL, - 0x03a9547eUL, 0xc0fa7955UL, 0x81cb624cUL, 0x1fc53881UL, 0x5ef42398UL, - 0x9da70eb3UL, 0xdc9615aaUL, 0x1b0054e5UL, 0x5a314ffcUL, 0x996262d7UL, - 0xd85379ceUL, 0x174fe149UL, 0x567efa50UL, 0x952dd77bUL, 0xd41ccc62UL, - 0x138a8d2dUL, 0x52bb9634UL, 0x91e8bb1fUL, 0xd0d9a006UL, 0xecf37e5eUL, - 0xadc26547UL, 0x6e91486cUL, 0x2fa05375UL, 0xe836123aUL, 0xa9070923UL, - 0x6a542408UL, 0x2b653f11UL, 0xe479a796UL, 0xa548bc8fUL, 0x661b91a4UL, - 0x272a8abdUL, 0xe0bccbf2UL, 0xa18dd0ebUL, 0x62defdc0UL, 0x23efe6d9UL, - 0xbde1bc14UL, 0xfcd0a70dUL, 0x3f838a26UL, 0x7eb2913fUL, 0xb924d070UL, - 0xf815cb69UL, 0x3b46e642UL, 0x7a77fd5bUL, 0xb56b65dcUL, 0xf45a7ec5UL, - 0x370953eeUL, 0x763848f7UL, 0xb1ae09b8UL, 0xf09f12a1UL, 0x33cc3f8aUL, - 0x72fd2493UL - }, - { - 0x00000000UL, 0x376ac201UL, 0x6ed48403UL, 0x59be4602UL, 0xdca80907UL, - 0xebc2cb06UL, 0xb27c8d04UL, 0x85164f05UL, 0xb851130eUL, 0x8f3bd10fUL, - 0xd685970dUL, 0xe1ef550cUL, 0x64f91a09UL, 0x5393d808UL, 0x0a2d9e0aUL, - 0x3d475c0bUL, 0x70a3261cUL, 0x47c9e41dUL, 0x1e77a21fUL, 0x291d601eUL, - 0xac0b2f1bUL, 0x9b61ed1aUL, 0xc2dfab18UL, 0xf5b56919UL, 0xc8f23512UL, - 0xff98f713UL, 0xa626b111UL, 0x914c7310UL, 0x145a3c15UL, 0x2330fe14UL, - 0x7a8eb816UL, 0x4de47a17UL, 0xe0464d38UL, 0xd72c8f39UL, 0x8e92c93bUL, - 0xb9f80b3aUL, 0x3cee443fUL, 0x0b84863eUL, 0x523ac03cUL, 0x6550023dUL, - 0x58175e36UL, 0x6f7d9c37UL, 0x36c3da35UL, 0x01a91834UL, 0x84bf5731UL, - 0xb3d59530UL, 0xea6bd332UL, 0xdd011133UL, 0x90e56b24UL, 0xa78fa925UL, - 0xfe31ef27UL, 0xc95b2d26UL, 0x4c4d6223UL, 0x7b27a022UL, 0x2299e620UL, - 0x15f32421UL, 0x28b4782aUL, 0x1fdeba2bUL, 0x4660fc29UL, 0x710a3e28UL, - 0xf41c712dUL, 0xc376b32cUL, 0x9ac8f52eUL, 0xada2372fUL, 0xc08d9a70UL, - 0xf7e75871UL, 0xae591e73UL, 0x9933dc72UL, 0x1c259377UL, 0x2b4f5176UL, - 0x72f11774UL, 0x459bd575UL, 0x78dc897eUL, 0x4fb64b7fUL, 0x16080d7dUL, - 0x2162cf7cUL, 0xa4748079UL, 0x931e4278UL, 0xcaa0047aUL, 0xfdcac67bUL, - 0xb02ebc6cUL, 0x87447e6dUL, 0xdefa386fUL, 0xe990fa6eUL, 0x6c86b56bUL, - 0x5bec776aUL, 0x02523168UL, 0x3538f369UL, 0x087faf62UL, 0x3f156d63UL, - 0x66ab2b61UL, 0x51c1e960UL, 0xd4d7a665UL, 0xe3bd6464UL, 0xba032266UL, - 0x8d69e067UL, 0x20cbd748UL, 0x17a11549UL, 0x4e1f534bUL, 0x7975914aUL, - 0xfc63de4fUL, 0xcb091c4eUL, 0x92b75a4cUL, 0xa5dd984dUL, 0x989ac446UL, - 0xaff00647UL, 0xf64e4045UL, 0xc1248244UL, 0x4432cd41UL, 0x73580f40UL, - 0x2ae64942UL, 0x1d8c8b43UL, 0x5068f154UL, 0x67023355UL, 0x3ebc7557UL, - 0x09d6b756UL, 0x8cc0f853UL, 0xbbaa3a52UL, 0xe2147c50UL, 0xd57ebe51UL, - 0xe839e25aUL, 0xdf53205bUL, 0x86ed6659UL, 0xb187a458UL, 0x3491eb5dUL, - 0x03fb295cUL, 0x5a456f5eUL, 0x6d2fad5fUL, 0x801b35e1UL, 0xb771f7e0UL, - 0xeecfb1e2UL, 0xd9a573e3UL, 0x5cb33ce6UL, 0x6bd9fee7UL, 0x3267b8e5UL, - 0x050d7ae4UL, 0x384a26efUL, 0x0f20e4eeUL, 0x569ea2ecUL, 0x61f460edUL, - 0xe4e22fe8UL, 0xd388ede9UL, 0x8a36abebUL, 0xbd5c69eaUL, 0xf0b813fdUL, - 0xc7d2d1fcUL, 0x9e6c97feUL, 0xa90655ffUL, 0x2c101afaUL, 0x1b7ad8fbUL, - 0x42c49ef9UL, 0x75ae5cf8UL, 0x48e900f3UL, 0x7f83c2f2UL, 0x263d84f0UL, - 0x115746f1UL, 0x944109f4UL, 0xa32bcbf5UL, 0xfa958df7UL, 0xcdff4ff6UL, - 0x605d78d9UL, 0x5737bad8UL, 0x0e89fcdaUL, 0x39e33edbUL, 0xbcf571deUL, - 0x8b9fb3dfUL, 0xd221f5ddUL, 0xe54b37dcUL, 0xd80c6bd7UL, 0xef66a9d6UL, - 0xb6d8efd4UL, 0x81b22dd5UL, 0x04a462d0UL, 0x33cea0d1UL, 0x6a70e6d3UL, - 0x5d1a24d2UL, 0x10fe5ec5UL, 0x27949cc4UL, 0x7e2adac6UL, 0x494018c7UL, - 0xcc5657c2UL, 0xfb3c95c3UL, 0xa282d3c1UL, 0x95e811c0UL, 0xa8af4dcbUL, - 0x9fc58fcaUL, 0xc67bc9c8UL, 0xf1110bc9UL, 0x740744ccUL, 0x436d86cdUL, - 0x1ad3c0cfUL, 0x2db902ceUL, 0x4096af91UL, 0x77fc6d90UL, 0x2e422b92UL, - 0x1928e993UL, 0x9c3ea696UL, 0xab546497UL, 0xf2ea2295UL, 0xc580e094UL, - 0xf8c7bc9fUL, 0xcfad7e9eUL, 0x9613389cUL, 0xa179fa9dUL, 0x246fb598UL, - 0x13057799UL, 0x4abb319bUL, 0x7dd1f39aUL, 0x3035898dUL, 0x075f4b8cUL, - 0x5ee10d8eUL, 0x698bcf8fUL, 0xec9d808aUL, 0xdbf7428bUL, 0x82490489UL, - 0xb523c688UL, 0x88649a83UL, 0xbf0e5882UL, 0xe6b01e80UL, 0xd1dadc81UL, - 0x54cc9384UL, 0x63a65185UL, 0x3a181787UL, 0x0d72d586UL, 0xa0d0e2a9UL, - 0x97ba20a8UL, 0xce0466aaUL, 0xf96ea4abUL, 0x7c78ebaeUL, 0x4b1229afUL, - 0x12ac6fadUL, 0x25c6adacUL, 0x1881f1a7UL, 0x2feb33a6UL, 0x765575a4UL, - 0x413fb7a5UL, 0xc429f8a0UL, 0xf3433aa1UL, 0xaafd7ca3UL, 0x9d97bea2UL, - 0xd073c4b5UL, 0xe71906b4UL, 0xbea740b6UL, 0x89cd82b7UL, 0x0cdbcdb2UL, - 0x3bb10fb3UL, 0x620f49b1UL, 0x55658bb0UL, 0x6822d7bbUL, 0x5f4815baUL, - 0x06f653b8UL, 0x319c91b9UL, 0xb48adebcUL, 0x83e01cbdUL, 0xda5e5abfUL, - 0xed3498beUL - }, - { - 0x00000000UL, 0x6567bcb8UL, 0x8bc809aaUL, 0xeeafb512UL, 0x5797628fUL, - 0x32f0de37UL, 0xdc5f6b25UL, 0xb938d79dUL, 0xef28b4c5UL, 0x8a4f087dUL, - 0x64e0bd6fUL, 0x018701d7UL, 0xb8bfd64aUL, 0xddd86af2UL, 0x3377dfe0UL, - 0x56106358UL, 0x9f571950UL, 0xfa30a5e8UL, 0x149f10faUL, 0x71f8ac42UL, - 0xc8c07bdfUL, 0xada7c767UL, 0x43087275UL, 0x266fcecdUL, 0x707fad95UL, - 0x1518112dUL, 0xfbb7a43fUL, 0x9ed01887UL, 0x27e8cf1aUL, 0x428f73a2UL, - 0xac20c6b0UL, 0xc9477a08UL, 0x3eaf32a0UL, 0x5bc88e18UL, 0xb5673b0aUL, - 0xd00087b2UL, 0x6938502fUL, 0x0c5fec97UL, 0xe2f05985UL, 0x8797e53dUL, - 0xd1878665UL, 0xb4e03addUL, 0x5a4f8fcfUL, 0x3f283377UL, 0x8610e4eaUL, - 0xe3775852UL, 0x0dd8ed40UL, 0x68bf51f8UL, 0xa1f82bf0UL, 0xc49f9748UL, - 0x2a30225aUL, 0x4f579ee2UL, 0xf66f497fUL, 0x9308f5c7UL, 0x7da740d5UL, - 0x18c0fc6dUL, 0x4ed09f35UL, 0x2bb7238dUL, 0xc518969fUL, 0xa07f2a27UL, - 0x1947fdbaUL, 0x7c204102UL, 0x928ff410UL, 0xf7e848a8UL, 0x3d58149bUL, - 0x583fa823UL, 0xb6901d31UL, 0xd3f7a189UL, 0x6acf7614UL, 0x0fa8caacUL, - 0xe1077fbeUL, 0x8460c306UL, 0xd270a05eUL, 0xb7171ce6UL, 0x59b8a9f4UL, - 0x3cdf154cUL, 0x85e7c2d1UL, 0xe0807e69UL, 0x0e2fcb7bUL, 0x6b4877c3UL, - 0xa20f0dcbUL, 0xc768b173UL, 0x29c70461UL, 0x4ca0b8d9UL, 0xf5986f44UL, - 0x90ffd3fcUL, 0x7e5066eeUL, 0x1b37da56UL, 0x4d27b90eUL, 0x284005b6UL, - 0xc6efb0a4UL, 0xa3880c1cUL, 0x1ab0db81UL, 0x7fd76739UL, 0x9178d22bUL, - 0xf41f6e93UL, 0x03f7263bUL, 0x66909a83UL, 0x883f2f91UL, 0xed589329UL, - 0x546044b4UL, 0x3107f80cUL, 0xdfa84d1eUL, 0xbacff1a6UL, 0xecdf92feUL, - 0x89b82e46UL, 0x67179b54UL, 0x027027ecUL, 0xbb48f071UL, 0xde2f4cc9UL, - 0x3080f9dbUL, 0x55e74563UL, 0x9ca03f6bUL, 0xf9c783d3UL, 0x176836c1UL, - 0x720f8a79UL, 0xcb375de4UL, 0xae50e15cUL, 0x40ff544eUL, 0x2598e8f6UL, - 0x73888baeUL, 0x16ef3716UL, 0xf8408204UL, 0x9d273ebcUL, 0x241fe921UL, - 0x41785599UL, 0xafd7e08bUL, 0xcab05c33UL, 0x3bb659edUL, 0x5ed1e555UL, - 0xb07e5047UL, 0xd519ecffUL, 0x6c213b62UL, 0x094687daUL, 0xe7e932c8UL, - 0x828e8e70UL, 0xd49eed28UL, 0xb1f95190UL, 0x5f56e482UL, 0x3a31583aUL, - 0x83098fa7UL, 0xe66e331fUL, 0x08c1860dUL, 0x6da63ab5UL, 0xa4e140bdUL, - 0xc186fc05UL, 0x2f294917UL, 0x4a4ef5afUL, 0xf3762232UL, 0x96119e8aUL, - 0x78be2b98UL, 0x1dd99720UL, 0x4bc9f478UL, 0x2eae48c0UL, 0xc001fdd2UL, - 0xa566416aUL, 0x1c5e96f7UL, 0x79392a4fUL, 0x97969f5dUL, 0xf2f123e5UL, - 0x05196b4dUL, 0x607ed7f5UL, 0x8ed162e7UL, 0xebb6de5fUL, 0x528e09c2UL, - 0x37e9b57aUL, 0xd9460068UL, 0xbc21bcd0UL, 0xea31df88UL, 0x8f566330UL, - 0x61f9d622UL, 0x049e6a9aUL, 0xbda6bd07UL, 0xd8c101bfUL, 0x366eb4adUL, - 0x53090815UL, 0x9a4e721dUL, 0xff29cea5UL, 0x11867bb7UL, 0x74e1c70fUL, - 0xcdd91092UL, 0xa8beac2aUL, 0x46111938UL, 0x2376a580UL, 0x7566c6d8UL, - 0x10017a60UL, 0xfeaecf72UL, 0x9bc973caUL, 0x22f1a457UL, 0x479618efUL, - 0xa939adfdUL, 0xcc5e1145UL, 0x06ee4d76UL, 0x6389f1ceUL, 0x8d2644dcUL, - 0xe841f864UL, 0x51792ff9UL, 0x341e9341UL, 0xdab12653UL, 0xbfd69aebUL, - 0xe9c6f9b3UL, 0x8ca1450bUL, 0x620ef019UL, 0x07694ca1UL, 0xbe519b3cUL, - 0xdb362784UL, 0x35999296UL, 0x50fe2e2eUL, 0x99b95426UL, 0xfcdee89eUL, - 0x12715d8cUL, 0x7716e134UL, 0xce2e36a9UL, 0xab498a11UL, 0x45e63f03UL, - 0x208183bbUL, 0x7691e0e3UL, 0x13f65c5bUL, 0xfd59e949UL, 0x983e55f1UL, - 0x2106826cUL, 0x44613ed4UL, 0xaace8bc6UL, 0xcfa9377eUL, 0x38417fd6UL, - 0x5d26c36eUL, 0xb389767cUL, 0xd6eecac4UL, 0x6fd61d59UL, 0x0ab1a1e1UL, - 0xe41e14f3UL, 0x8179a84bUL, 0xd769cb13UL, 0xb20e77abUL, 0x5ca1c2b9UL, - 0x39c67e01UL, 0x80fea99cUL, 0xe5991524UL, 0x0b36a036UL, 0x6e511c8eUL, - 0xa7166686UL, 0xc271da3eUL, 0x2cde6f2cUL, 0x49b9d394UL, 0xf0810409UL, - 0x95e6b8b1UL, 0x7b490da3UL, 0x1e2eb11bUL, 0x483ed243UL, 0x2d596efbUL, - 0xc3f6dbe9UL, 0xa6916751UL, 0x1fa9b0ccUL, 0x7ace0c74UL, 0x9461b966UL, - 0xf10605deUL +local const z_crc_t FAR crc_table[] = { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, + 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, + 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, + 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, + 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856, + 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, + 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, + 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, + 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a, + 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, + 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, + 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, + 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, + 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e, + 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, + 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, + 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, + 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, + 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, + 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, + 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010, + 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, + 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, + 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, + 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, + 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344, + 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, + 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, + 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, + 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c, + 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, + 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, + 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, + 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, + 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c, + 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, + 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, + 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, + 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, + 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278, + 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, + 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66, + 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, + 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, + 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, + 0x2d02ef8d}; + +#ifdef W + +#if W == 8 + +local const z_word_t FAR crc_big_table[] = { + 0x0000000000000000, 0x9630077700000000, 0x2c610eee00000000, + 0xba51099900000000, 0x19c46d0700000000, 0x8ff46a7000000000, + 0x35a563e900000000, 0xa395649e00000000, 0x3288db0e00000000, + 0xa4b8dc7900000000, 0x1ee9d5e000000000, 0x88d9d29700000000, + 0x2b4cb60900000000, 0xbd7cb17e00000000, 0x072db8e700000000, + 0x911dbf9000000000, 0x6410b71d00000000, 0xf220b06a00000000, + 0x4871b9f300000000, 0xde41be8400000000, 0x7dd4da1a00000000, + 0xebe4dd6d00000000, 0x51b5d4f400000000, 0xc785d38300000000, + 0x56986c1300000000, 0xc0a86b6400000000, 0x7af962fd00000000, + 0xecc9658a00000000, 0x4f5c011400000000, 0xd96c066300000000, + 0x633d0ffa00000000, 0xf50d088d00000000, 0xc8206e3b00000000, + 0x5e10694c00000000, 0xe44160d500000000, 0x727167a200000000, + 0xd1e4033c00000000, 0x47d4044b00000000, 0xfd850dd200000000, + 0x6bb50aa500000000, 0xfaa8b53500000000, 0x6c98b24200000000, + 0xd6c9bbdb00000000, 0x40f9bcac00000000, 0xe36cd83200000000, + 0x755cdf4500000000, 0xcf0dd6dc00000000, 0x593dd1ab00000000, + 0xac30d92600000000, 0x3a00de5100000000, 0x8051d7c800000000, + 0x1661d0bf00000000, 0xb5f4b42100000000, 0x23c4b35600000000, + 0x9995bacf00000000, 0x0fa5bdb800000000, 0x9eb8022800000000, + 0x0888055f00000000, 0xb2d90cc600000000, 0x24e90bb100000000, + 0x877c6f2f00000000, 0x114c685800000000, 0xab1d61c100000000, + 0x3d2d66b600000000, 0x9041dc7600000000, 0x0671db0100000000, + 0xbc20d29800000000, 0x2a10d5ef00000000, 0x8985b17100000000, + 0x1fb5b60600000000, 0xa5e4bf9f00000000, 0x33d4b8e800000000, + 0xa2c9077800000000, 0x34f9000f00000000, 0x8ea8099600000000, + 0x18980ee100000000, 0xbb0d6a7f00000000, 0x2d3d6d0800000000, + 0x976c649100000000, 0x015c63e600000000, 0xf4516b6b00000000, + 0x62616c1c00000000, 0xd830658500000000, 0x4e0062f200000000, + 0xed95066c00000000, 0x7ba5011b00000000, 0xc1f4088200000000, + 0x57c40ff500000000, 0xc6d9b06500000000, 0x50e9b71200000000, + 0xeab8be8b00000000, 0x7c88b9fc00000000, 0xdf1ddd6200000000, + 0x492dda1500000000, 0xf37cd38c00000000, 0x654cd4fb00000000, + 0x5861b24d00000000, 0xce51b53a00000000, 0x7400bca300000000, + 0xe230bbd400000000, 0x41a5df4a00000000, 0xd795d83d00000000, + 0x6dc4d1a400000000, 0xfbf4d6d300000000, 0x6ae9694300000000, + 0xfcd96e3400000000, 0x468867ad00000000, 0xd0b860da00000000, + 0x732d044400000000, 0xe51d033300000000, 0x5f4c0aaa00000000, + 0xc97c0ddd00000000, 0x3c71055000000000, 0xaa41022700000000, + 0x10100bbe00000000, 0x86200cc900000000, 0x25b5685700000000, + 0xb3856f2000000000, 0x09d466b900000000, 0x9fe461ce00000000, + 0x0ef9de5e00000000, 0x98c9d92900000000, 0x2298d0b000000000, + 0xb4a8d7c700000000, 0x173db35900000000, 0x810db42e00000000, + 0x3b5cbdb700000000, 0xad6cbac000000000, 0x2083b8ed00000000, + 0xb6b3bf9a00000000, 0x0ce2b60300000000, 0x9ad2b17400000000, + 0x3947d5ea00000000, 0xaf77d29d00000000, 0x1526db0400000000, + 0x8316dc7300000000, 0x120b63e300000000, 0x843b649400000000, + 0x3e6a6d0d00000000, 0xa85a6a7a00000000, 0x0bcf0ee400000000, + 0x9dff099300000000, 0x27ae000a00000000, 0xb19e077d00000000, + 0x44930ff000000000, 0xd2a3088700000000, 0x68f2011e00000000, + 0xfec2066900000000, 0x5d5762f700000000, 0xcb67658000000000, + 0x71366c1900000000, 0xe7066b6e00000000, 0x761bd4fe00000000, + 0xe02bd38900000000, 0x5a7ada1000000000, 0xcc4add6700000000, + 0x6fdfb9f900000000, 0xf9efbe8e00000000, 0x43beb71700000000, + 0xd58eb06000000000, 0xe8a3d6d600000000, 0x7e93d1a100000000, + 0xc4c2d83800000000, 0x52f2df4f00000000, 0xf167bbd100000000, + 0x6757bca600000000, 0xdd06b53f00000000, 0x4b36b24800000000, + 0xda2b0dd800000000, 0x4c1b0aaf00000000, 0xf64a033600000000, + 0x607a044100000000, 0xc3ef60df00000000, 0x55df67a800000000, + 0xef8e6e3100000000, 0x79be694600000000, 0x8cb361cb00000000, + 0x1a8366bc00000000, 0xa0d26f2500000000, 0x36e2685200000000, + 0x95770ccc00000000, 0x03470bbb00000000, 0xb916022200000000, + 0x2f26055500000000, 0xbe3bbac500000000, 0x280bbdb200000000, + 0x925ab42b00000000, 0x046ab35c00000000, 0xa7ffd7c200000000, + 0x31cfd0b500000000, 0x8b9ed92c00000000, 0x1daede5b00000000, + 0xb0c2649b00000000, 0x26f263ec00000000, 0x9ca36a7500000000, + 0x0a936d0200000000, 0xa906099c00000000, 0x3f360eeb00000000, + 0x8567077200000000, 0x1357000500000000, 0x824abf9500000000, + 0x147ab8e200000000, 0xae2bb17b00000000, 0x381bb60c00000000, + 0x9b8ed29200000000, 0x0dbed5e500000000, 0xb7efdc7c00000000, + 0x21dfdb0b00000000, 0xd4d2d38600000000, 0x42e2d4f100000000, + 0xf8b3dd6800000000, 0x6e83da1f00000000, 0xcd16be8100000000, + 0x5b26b9f600000000, 0xe177b06f00000000, 0x7747b71800000000, + 0xe65a088800000000, 0x706a0fff00000000, 0xca3b066600000000, + 0x5c0b011100000000, 0xff9e658f00000000, 0x69ae62f800000000, + 0xd3ff6b6100000000, 0x45cf6c1600000000, 0x78e20aa000000000, + 0xeed20dd700000000, 0x5483044e00000000, 0xc2b3033900000000, + 0x612667a700000000, 0xf71660d000000000, 0x4d47694900000000, + 0xdb776e3e00000000, 0x4a6ad1ae00000000, 0xdc5ad6d900000000, + 0x660bdf4000000000, 0xf03bd83700000000, 0x53aebca900000000, + 0xc59ebbde00000000, 0x7fcfb24700000000, 0xe9ffb53000000000, + 0x1cf2bdbd00000000, 0x8ac2baca00000000, 0x3093b35300000000, + 0xa6a3b42400000000, 0x0536d0ba00000000, 0x9306d7cd00000000, + 0x2957de5400000000, 0xbf67d92300000000, 0x2e7a66b300000000, + 0xb84a61c400000000, 0x021b685d00000000, 0x942b6f2a00000000, + 0x37be0bb400000000, 0xa18e0cc300000000, 0x1bdf055a00000000, + 0x8def022d00000000}; + +#else /* W == 4 */ + +local const z_word_t FAR crc_big_table[] = { + 0x00000000, 0x96300777, 0x2c610eee, 0xba510999, 0x19c46d07, + 0x8ff46a70, 0x35a563e9, 0xa395649e, 0x3288db0e, 0xa4b8dc79, + 0x1ee9d5e0, 0x88d9d297, 0x2b4cb609, 0xbd7cb17e, 0x072db8e7, + 0x911dbf90, 0x6410b71d, 0xf220b06a, 0x4871b9f3, 0xde41be84, + 0x7dd4da1a, 0xebe4dd6d, 0x51b5d4f4, 0xc785d383, 0x56986c13, + 0xc0a86b64, 0x7af962fd, 0xecc9658a, 0x4f5c0114, 0xd96c0663, + 0x633d0ffa, 0xf50d088d, 0xc8206e3b, 0x5e10694c, 0xe44160d5, + 0x727167a2, 0xd1e4033c, 0x47d4044b, 0xfd850dd2, 0x6bb50aa5, + 0xfaa8b535, 0x6c98b242, 0xd6c9bbdb, 0x40f9bcac, 0xe36cd832, + 0x755cdf45, 0xcf0dd6dc, 0x593dd1ab, 0xac30d926, 0x3a00de51, + 0x8051d7c8, 0x1661d0bf, 0xb5f4b421, 0x23c4b356, 0x9995bacf, + 0x0fa5bdb8, 0x9eb80228, 0x0888055f, 0xb2d90cc6, 0x24e90bb1, + 0x877c6f2f, 0x114c6858, 0xab1d61c1, 0x3d2d66b6, 0x9041dc76, + 0x0671db01, 0xbc20d298, 0x2a10d5ef, 0x8985b171, 0x1fb5b606, + 0xa5e4bf9f, 0x33d4b8e8, 0xa2c90778, 0x34f9000f, 0x8ea80996, + 0x18980ee1, 0xbb0d6a7f, 0x2d3d6d08, 0x976c6491, 0x015c63e6, + 0xf4516b6b, 0x62616c1c, 0xd8306585, 0x4e0062f2, 0xed95066c, + 0x7ba5011b, 0xc1f40882, 0x57c40ff5, 0xc6d9b065, 0x50e9b712, + 0xeab8be8b, 0x7c88b9fc, 0xdf1ddd62, 0x492dda15, 0xf37cd38c, + 0x654cd4fb, 0x5861b24d, 0xce51b53a, 0x7400bca3, 0xe230bbd4, + 0x41a5df4a, 0xd795d83d, 0x6dc4d1a4, 0xfbf4d6d3, 0x6ae96943, + 0xfcd96e34, 0x468867ad, 0xd0b860da, 0x732d0444, 0xe51d0333, + 0x5f4c0aaa, 0xc97c0ddd, 0x3c710550, 0xaa410227, 0x10100bbe, + 0x86200cc9, 0x25b56857, 0xb3856f20, 0x09d466b9, 0x9fe461ce, + 0x0ef9de5e, 0x98c9d929, 0x2298d0b0, 0xb4a8d7c7, 0x173db359, + 0x810db42e, 0x3b5cbdb7, 0xad6cbac0, 0x2083b8ed, 0xb6b3bf9a, + 0x0ce2b603, 0x9ad2b174, 0x3947d5ea, 0xaf77d29d, 0x1526db04, + 0x8316dc73, 0x120b63e3, 0x843b6494, 0x3e6a6d0d, 0xa85a6a7a, + 0x0bcf0ee4, 0x9dff0993, 0x27ae000a, 0xb19e077d, 0x44930ff0, + 0xd2a30887, 0x68f2011e, 0xfec20669, 0x5d5762f7, 0xcb676580, + 0x71366c19, 0xe7066b6e, 0x761bd4fe, 0xe02bd389, 0x5a7ada10, + 0xcc4add67, 0x6fdfb9f9, 0xf9efbe8e, 0x43beb717, 0xd58eb060, + 0xe8a3d6d6, 0x7e93d1a1, 0xc4c2d838, 0x52f2df4f, 0xf167bbd1, + 0x6757bca6, 0xdd06b53f, 0x4b36b248, 0xda2b0dd8, 0x4c1b0aaf, + 0xf64a0336, 0x607a0441, 0xc3ef60df, 0x55df67a8, 0xef8e6e31, + 0x79be6946, 0x8cb361cb, 0x1a8366bc, 0xa0d26f25, 0x36e26852, + 0x95770ccc, 0x03470bbb, 0xb9160222, 0x2f260555, 0xbe3bbac5, + 0x280bbdb2, 0x925ab42b, 0x046ab35c, 0xa7ffd7c2, 0x31cfd0b5, + 0x8b9ed92c, 0x1daede5b, 0xb0c2649b, 0x26f263ec, 0x9ca36a75, + 0x0a936d02, 0xa906099c, 0x3f360eeb, 0x85670772, 0x13570005, + 0x824abf95, 0x147ab8e2, 0xae2bb17b, 0x381bb60c, 0x9b8ed292, + 0x0dbed5e5, 0xb7efdc7c, 0x21dfdb0b, 0xd4d2d386, 0x42e2d4f1, + 0xf8b3dd68, 0x6e83da1f, 0xcd16be81, 0x5b26b9f6, 0xe177b06f, + 0x7747b718, 0xe65a0888, 0x706a0fff, 0xca3b0666, 0x5c0b0111, + 0xff9e658f, 0x69ae62f8, 0xd3ff6b61, 0x45cf6c16, 0x78e20aa0, + 0xeed20dd7, 0x5483044e, 0xc2b30339, 0x612667a7, 0xf71660d0, + 0x4d476949, 0xdb776e3e, 0x4a6ad1ae, 0xdc5ad6d9, 0x660bdf40, + 0xf03bd837, 0x53aebca9, 0xc59ebbde, 0x7fcfb247, 0xe9ffb530, + 0x1cf2bdbd, 0x8ac2baca, 0x3093b353, 0xa6a3b424, 0x0536d0ba, + 0x9306d7cd, 0x2957de54, 0xbf67d923, 0x2e7a66b3, 0xb84a61c4, + 0x021b685d, 0x942b6f2a, 0x37be0bb4, 0xa18e0cc3, 0x1bdf055a, + 0x8def022d}; + +#endif + +#if N == 1 + +#if W == 8 + +local const z_crc_t FAR crc_braid_table[][256] = { + {0x00000000, 0xccaa009e, 0x4225077d, 0x8e8f07e3, 0x844a0efa, + 0x48e00e64, 0xc66f0987, 0x0ac50919, 0xd3e51bb5, 0x1f4f1b2b, + 0x91c01cc8, 0x5d6a1c56, 0x57af154f, 0x9b0515d1, 0x158a1232, + 0xd92012ac, 0x7cbb312b, 0xb01131b5, 0x3e9e3656, 0xf23436c8, + 0xf8f13fd1, 0x345b3f4f, 0xbad438ac, 0x767e3832, 0xaf5e2a9e, + 0x63f42a00, 0xed7b2de3, 0x21d12d7d, 0x2b142464, 0xe7be24fa, + 0x69312319, 0xa59b2387, 0xf9766256, 0x35dc62c8, 0xbb53652b, + 0x77f965b5, 0x7d3c6cac, 0xb1966c32, 0x3f196bd1, 0xf3b36b4f, + 0x2a9379e3, 0xe639797d, 0x68b67e9e, 0xa41c7e00, 0xaed97719, + 0x62737787, 0xecfc7064, 0x205670fa, 0x85cd537d, 0x496753e3, + 0xc7e85400, 0x0b42549e, 0x01875d87, 0xcd2d5d19, 0x43a25afa, + 0x8f085a64, 0x562848c8, 0x9a824856, 0x140d4fb5, 0xd8a74f2b, + 0xd2624632, 0x1ec846ac, 0x9047414f, 0x5ced41d1, 0x299dc2ed, + 0xe537c273, 0x6bb8c590, 0xa712c50e, 0xadd7cc17, 0x617dcc89, + 0xeff2cb6a, 0x2358cbf4, 0xfa78d958, 0x36d2d9c6, 0xb85dde25, + 0x74f7debb, 0x7e32d7a2, 0xb298d73c, 0x3c17d0df, 0xf0bdd041, + 0x5526f3c6, 0x998cf358, 0x1703f4bb, 0xdba9f425, 0xd16cfd3c, + 0x1dc6fda2, 0x9349fa41, 0x5fe3fadf, 0x86c3e873, 0x4a69e8ed, + 0xc4e6ef0e, 0x084cef90, 0x0289e689, 0xce23e617, 0x40ace1f4, + 0x8c06e16a, 0xd0eba0bb, 0x1c41a025, 0x92cea7c6, 0x5e64a758, + 0x54a1ae41, 0x980baedf, 0x1684a93c, 0xda2ea9a2, 0x030ebb0e, + 0xcfa4bb90, 0x412bbc73, 0x8d81bced, 0x8744b5f4, 0x4beeb56a, + 0xc561b289, 0x09cbb217, 0xac509190, 0x60fa910e, 0xee7596ed, + 0x22df9673, 0x281a9f6a, 0xe4b09ff4, 0x6a3f9817, 0xa6959889, + 0x7fb58a25, 0xb31f8abb, 0x3d908d58, 0xf13a8dc6, 0xfbff84df, + 0x37558441, 0xb9da83a2, 0x7570833c, 0x533b85da, 0x9f918544, + 0x111e82a7, 0xddb48239, 0xd7718b20, 0x1bdb8bbe, 0x95548c5d, + 0x59fe8cc3, 0x80de9e6f, 0x4c749ef1, 0xc2fb9912, 0x0e51998c, + 0x04949095, 0xc83e900b, 0x46b197e8, 0x8a1b9776, 0x2f80b4f1, + 0xe32ab46f, 0x6da5b38c, 0xa10fb312, 0xabcaba0b, 0x6760ba95, + 0xe9efbd76, 0x2545bde8, 0xfc65af44, 0x30cfafda, 0xbe40a839, + 0x72eaa8a7, 0x782fa1be, 0xb485a120, 0x3a0aa6c3, 0xf6a0a65d, + 0xaa4de78c, 0x66e7e712, 0xe868e0f1, 0x24c2e06f, 0x2e07e976, + 0xe2ade9e8, 0x6c22ee0b, 0xa088ee95, 0x79a8fc39, 0xb502fca7, + 0x3b8dfb44, 0xf727fbda, 0xfde2f2c3, 0x3148f25d, 0xbfc7f5be, + 0x736df520, 0xd6f6d6a7, 0x1a5cd639, 0x94d3d1da, 0x5879d144, + 0x52bcd85d, 0x9e16d8c3, 0x1099df20, 0xdc33dfbe, 0x0513cd12, + 0xc9b9cd8c, 0x4736ca6f, 0x8b9ccaf1, 0x8159c3e8, 0x4df3c376, + 0xc37cc495, 0x0fd6c40b, 0x7aa64737, 0xb60c47a9, 0x3883404a, + 0xf42940d4, 0xfeec49cd, 0x32464953, 0xbcc94eb0, 0x70634e2e, + 0xa9435c82, 0x65e95c1c, 0xeb665bff, 0x27cc5b61, 0x2d095278, + 0xe1a352e6, 0x6f2c5505, 0xa386559b, 0x061d761c, 0xcab77682, + 0x44387161, 0x889271ff, 0x825778e6, 0x4efd7878, 0xc0727f9b, + 0x0cd87f05, 0xd5f86da9, 0x19526d37, 0x97dd6ad4, 0x5b776a4a, + 0x51b26353, 0x9d1863cd, 0x1397642e, 0xdf3d64b0, 0x83d02561, + 0x4f7a25ff, 0xc1f5221c, 0x0d5f2282, 0x079a2b9b, 0xcb302b05, + 0x45bf2ce6, 0x89152c78, 0x50353ed4, 0x9c9f3e4a, 0x121039a9, + 0xdeba3937, 0xd47f302e, 0x18d530b0, 0x965a3753, 0x5af037cd, + 0xff6b144a, 0x33c114d4, 0xbd4e1337, 0x71e413a9, 0x7b211ab0, + 0xb78b1a2e, 0x39041dcd, 0xf5ae1d53, 0x2c8e0fff, 0xe0240f61, + 0x6eab0882, 0xa201081c, 0xa8c40105, 0x646e019b, 0xeae10678, + 0x264b06e6}, + {0x00000000, 0xa6770bb4, 0x979f1129, 0x31e81a9d, 0xf44f2413, + 0x52382fa7, 0x63d0353a, 0xc5a73e8e, 0x33ef4e67, 0x959845d3, + 0xa4705f4e, 0x020754fa, 0xc7a06a74, 0x61d761c0, 0x503f7b5d, + 0xf64870e9, 0x67de9cce, 0xc1a9977a, 0xf0418de7, 0x56368653, + 0x9391b8dd, 0x35e6b369, 0x040ea9f4, 0xa279a240, 0x5431d2a9, + 0xf246d91d, 0xc3aec380, 0x65d9c834, 0xa07ef6ba, 0x0609fd0e, + 0x37e1e793, 0x9196ec27, 0xcfbd399c, 0x69ca3228, 0x582228b5, + 0xfe552301, 0x3bf21d8f, 0x9d85163b, 0xac6d0ca6, 0x0a1a0712, + 0xfc5277fb, 0x5a257c4f, 0x6bcd66d2, 0xcdba6d66, 0x081d53e8, + 0xae6a585c, 0x9f8242c1, 0x39f54975, 0xa863a552, 0x0e14aee6, + 0x3ffcb47b, 0x998bbfcf, 0x5c2c8141, 0xfa5b8af5, 0xcbb39068, + 0x6dc49bdc, 0x9b8ceb35, 0x3dfbe081, 0x0c13fa1c, 0xaa64f1a8, + 0x6fc3cf26, 0xc9b4c492, 0xf85cde0f, 0x5e2bd5bb, 0x440b7579, + 0xe27c7ecd, 0xd3946450, 0x75e36fe4, 0xb044516a, 0x16335ade, + 0x27db4043, 0x81ac4bf7, 0x77e43b1e, 0xd19330aa, 0xe07b2a37, + 0x460c2183, 0x83ab1f0d, 0x25dc14b9, 0x14340e24, 0xb2430590, + 0x23d5e9b7, 0x85a2e203, 0xb44af89e, 0x123df32a, 0xd79acda4, + 0x71edc610, 0x4005dc8d, 0xe672d739, 0x103aa7d0, 0xb64dac64, + 0x87a5b6f9, 0x21d2bd4d, 0xe47583c3, 0x42028877, 0x73ea92ea, + 0xd59d995e, 0x8bb64ce5, 0x2dc14751, 0x1c295dcc, 0xba5e5678, + 0x7ff968f6, 0xd98e6342, 0xe86679df, 0x4e11726b, 0xb8590282, + 0x1e2e0936, 0x2fc613ab, 0x89b1181f, 0x4c162691, 0xea612d25, + 0xdb8937b8, 0x7dfe3c0c, 0xec68d02b, 0x4a1fdb9f, 0x7bf7c102, + 0xdd80cab6, 0x1827f438, 0xbe50ff8c, 0x8fb8e511, 0x29cfeea5, + 0xdf879e4c, 0x79f095f8, 0x48188f65, 0xee6f84d1, 0x2bc8ba5f, + 0x8dbfb1eb, 0xbc57ab76, 0x1a20a0c2, 0x8816eaf2, 0x2e61e146, + 0x1f89fbdb, 0xb9fef06f, 0x7c59cee1, 0xda2ec555, 0xebc6dfc8, + 0x4db1d47c, 0xbbf9a495, 0x1d8eaf21, 0x2c66b5bc, 0x8a11be08, + 0x4fb68086, 0xe9c18b32, 0xd82991af, 0x7e5e9a1b, 0xefc8763c, + 0x49bf7d88, 0x78576715, 0xde206ca1, 0x1b87522f, 0xbdf0599b, + 0x8c184306, 0x2a6f48b2, 0xdc27385b, 0x7a5033ef, 0x4bb82972, + 0xedcf22c6, 0x28681c48, 0x8e1f17fc, 0xbff70d61, 0x198006d5, + 0x47abd36e, 0xe1dcd8da, 0xd034c247, 0x7643c9f3, 0xb3e4f77d, + 0x1593fcc9, 0x247be654, 0x820cede0, 0x74449d09, 0xd23396bd, + 0xe3db8c20, 0x45ac8794, 0x800bb91a, 0x267cb2ae, 0x1794a833, + 0xb1e3a387, 0x20754fa0, 0x86024414, 0xb7ea5e89, 0x119d553d, + 0xd43a6bb3, 0x724d6007, 0x43a57a9a, 0xe5d2712e, 0x139a01c7, + 0xb5ed0a73, 0x840510ee, 0x22721b5a, 0xe7d525d4, 0x41a22e60, + 0x704a34fd, 0xd63d3f49, 0xcc1d9f8b, 0x6a6a943f, 0x5b828ea2, + 0xfdf58516, 0x3852bb98, 0x9e25b02c, 0xafcdaab1, 0x09baa105, + 0xfff2d1ec, 0x5985da58, 0x686dc0c5, 0xce1acb71, 0x0bbdf5ff, + 0xadcafe4b, 0x9c22e4d6, 0x3a55ef62, 0xabc30345, 0x0db408f1, + 0x3c5c126c, 0x9a2b19d8, 0x5f8c2756, 0xf9fb2ce2, 0xc813367f, + 0x6e643dcb, 0x982c4d22, 0x3e5b4696, 0x0fb35c0b, 0xa9c457bf, + 0x6c636931, 0xca146285, 0xfbfc7818, 0x5d8b73ac, 0x03a0a617, + 0xa5d7ada3, 0x943fb73e, 0x3248bc8a, 0xf7ef8204, 0x519889b0, + 0x6070932d, 0xc6079899, 0x304fe870, 0x9638e3c4, 0xa7d0f959, + 0x01a7f2ed, 0xc400cc63, 0x6277c7d7, 0x539fdd4a, 0xf5e8d6fe, + 0x647e3ad9, 0xc209316d, 0xf3e12bf0, 0x55962044, 0x90311eca, + 0x3646157e, 0x07ae0fe3, 0xa1d90457, 0x579174be, 0xf1e67f0a, + 0xc00e6597, 0x66796e23, 0xa3de50ad, 0x05a95b19, 0x34414184, + 0x92364a30}, + {0x00000000, 0xcb5cd3a5, 0x4dc8a10b, 0x869472ae, 0x9b914216, + 0x50cd91b3, 0xd659e31d, 0x1d0530b8, 0xec53826d, 0x270f51c8, + 0xa19b2366, 0x6ac7f0c3, 0x77c2c07b, 0xbc9e13de, 0x3a0a6170, + 0xf156b2d5, 0x03d6029b, 0xc88ad13e, 0x4e1ea390, 0x85427035, + 0x9847408d, 0x531b9328, 0xd58fe186, 0x1ed33223, 0xef8580f6, + 0x24d95353, 0xa24d21fd, 0x6911f258, 0x7414c2e0, 0xbf481145, + 0x39dc63eb, 0xf280b04e, 0x07ac0536, 0xccf0d693, 0x4a64a43d, + 0x81387798, 0x9c3d4720, 0x57619485, 0xd1f5e62b, 0x1aa9358e, + 0xebff875b, 0x20a354fe, 0xa6372650, 0x6d6bf5f5, 0x706ec54d, + 0xbb3216e8, 0x3da66446, 0xf6fab7e3, 0x047a07ad, 0xcf26d408, + 0x49b2a6a6, 0x82ee7503, 0x9feb45bb, 0x54b7961e, 0xd223e4b0, + 0x197f3715, 0xe82985c0, 0x23755665, 0xa5e124cb, 0x6ebdf76e, + 0x73b8c7d6, 0xb8e41473, 0x3e7066dd, 0xf52cb578, 0x0f580a6c, + 0xc404d9c9, 0x4290ab67, 0x89cc78c2, 0x94c9487a, 0x5f959bdf, + 0xd901e971, 0x125d3ad4, 0xe30b8801, 0x28575ba4, 0xaec3290a, + 0x659ffaaf, 0x789aca17, 0xb3c619b2, 0x35526b1c, 0xfe0eb8b9, + 0x0c8e08f7, 0xc7d2db52, 0x4146a9fc, 0x8a1a7a59, 0x971f4ae1, + 0x5c439944, 0xdad7ebea, 0x118b384f, 0xe0dd8a9a, 0x2b81593f, + 0xad152b91, 0x6649f834, 0x7b4cc88c, 0xb0101b29, 0x36846987, + 0xfdd8ba22, 0x08f40f5a, 0xc3a8dcff, 0x453cae51, 0x8e607df4, + 0x93654d4c, 0x58399ee9, 0xdeadec47, 0x15f13fe2, 0xe4a78d37, + 0x2ffb5e92, 0xa96f2c3c, 0x6233ff99, 0x7f36cf21, 0xb46a1c84, + 0x32fe6e2a, 0xf9a2bd8f, 0x0b220dc1, 0xc07ede64, 0x46eaacca, + 0x8db67f6f, 0x90b34fd7, 0x5bef9c72, 0xdd7beedc, 0x16273d79, + 0xe7718fac, 0x2c2d5c09, 0xaab92ea7, 0x61e5fd02, 0x7ce0cdba, + 0xb7bc1e1f, 0x31286cb1, 0xfa74bf14, 0x1eb014d8, 0xd5ecc77d, + 0x5378b5d3, 0x98246676, 0x852156ce, 0x4e7d856b, 0xc8e9f7c5, + 0x03b52460, 0xf2e396b5, 0x39bf4510, 0xbf2b37be, 0x7477e41b, + 0x6972d4a3, 0xa22e0706, 0x24ba75a8, 0xefe6a60d, 0x1d661643, + 0xd63ac5e6, 0x50aeb748, 0x9bf264ed, 0x86f75455, 0x4dab87f0, + 0xcb3ff55e, 0x006326fb, 0xf135942e, 0x3a69478b, 0xbcfd3525, + 0x77a1e680, 0x6aa4d638, 0xa1f8059d, 0x276c7733, 0xec30a496, + 0x191c11ee, 0xd240c24b, 0x54d4b0e5, 0x9f886340, 0x828d53f8, + 0x49d1805d, 0xcf45f2f3, 0x04192156, 0xf54f9383, 0x3e134026, + 0xb8873288, 0x73dbe12d, 0x6eded195, 0xa5820230, 0x2316709e, + 0xe84aa33b, 0x1aca1375, 0xd196c0d0, 0x5702b27e, 0x9c5e61db, + 0x815b5163, 0x4a0782c6, 0xcc93f068, 0x07cf23cd, 0xf6999118, + 0x3dc542bd, 0xbb513013, 0x700de3b6, 0x6d08d30e, 0xa65400ab, + 0x20c07205, 0xeb9ca1a0, 0x11e81eb4, 0xdab4cd11, 0x5c20bfbf, + 0x977c6c1a, 0x8a795ca2, 0x41258f07, 0xc7b1fda9, 0x0ced2e0c, + 0xfdbb9cd9, 0x36e74f7c, 0xb0733dd2, 0x7b2fee77, 0x662adecf, + 0xad760d6a, 0x2be27fc4, 0xe0beac61, 0x123e1c2f, 0xd962cf8a, + 0x5ff6bd24, 0x94aa6e81, 0x89af5e39, 0x42f38d9c, 0xc467ff32, + 0x0f3b2c97, 0xfe6d9e42, 0x35314de7, 0xb3a53f49, 0x78f9ecec, + 0x65fcdc54, 0xaea00ff1, 0x28347d5f, 0xe368aefa, 0x16441b82, + 0xdd18c827, 0x5b8cba89, 0x90d0692c, 0x8dd55994, 0x46898a31, + 0xc01df89f, 0x0b412b3a, 0xfa1799ef, 0x314b4a4a, 0xb7df38e4, + 0x7c83eb41, 0x6186dbf9, 0xaada085c, 0x2c4e7af2, 0xe712a957, + 0x15921919, 0xdececabc, 0x585ab812, 0x93066bb7, 0x8e035b0f, + 0x455f88aa, 0xc3cbfa04, 0x089729a1, 0xf9c19b74, 0x329d48d1, + 0xb4093a7f, 0x7f55e9da, 0x6250d962, 0xa90c0ac7, 0x2f987869, + 0xe4c4abcc}, + {0x00000000, 0x3d6029b0, 0x7ac05360, 0x47a07ad0, 0xf580a6c0, + 0xc8e08f70, 0x8f40f5a0, 0xb220dc10, 0x30704bc1, 0x0d106271, + 0x4ab018a1, 0x77d03111, 0xc5f0ed01, 0xf890c4b1, 0xbf30be61, + 0x825097d1, 0x60e09782, 0x5d80be32, 0x1a20c4e2, 0x2740ed52, + 0x95603142, 0xa80018f2, 0xefa06222, 0xd2c04b92, 0x5090dc43, + 0x6df0f5f3, 0x2a508f23, 0x1730a693, 0xa5107a83, 0x98705333, + 0xdfd029e3, 0xe2b00053, 0xc1c12f04, 0xfca106b4, 0xbb017c64, + 0x866155d4, 0x344189c4, 0x0921a074, 0x4e81daa4, 0x73e1f314, + 0xf1b164c5, 0xccd14d75, 0x8b7137a5, 0xb6111e15, 0x0431c205, + 0x3951ebb5, 0x7ef19165, 0x4391b8d5, 0xa121b886, 0x9c419136, + 0xdbe1ebe6, 0xe681c256, 0x54a11e46, 0x69c137f6, 0x2e614d26, + 0x13016496, 0x9151f347, 0xac31daf7, 0xeb91a027, 0xd6f18997, + 0x64d15587, 0x59b17c37, 0x1e1106e7, 0x23712f57, 0x58f35849, + 0x659371f9, 0x22330b29, 0x1f532299, 0xad73fe89, 0x9013d739, + 0xd7b3ade9, 0xead38459, 0x68831388, 0x55e33a38, 0x124340e8, + 0x2f236958, 0x9d03b548, 0xa0639cf8, 0xe7c3e628, 0xdaa3cf98, + 0x3813cfcb, 0x0573e67b, 0x42d39cab, 0x7fb3b51b, 0xcd93690b, + 0xf0f340bb, 0xb7533a6b, 0x8a3313db, 0x0863840a, 0x3503adba, + 0x72a3d76a, 0x4fc3feda, 0xfde322ca, 0xc0830b7a, 0x872371aa, + 0xba43581a, 0x9932774d, 0xa4525efd, 0xe3f2242d, 0xde920d9d, + 0x6cb2d18d, 0x51d2f83d, 0x167282ed, 0x2b12ab5d, 0xa9423c8c, + 0x9422153c, 0xd3826fec, 0xeee2465c, 0x5cc29a4c, 0x61a2b3fc, + 0x2602c92c, 0x1b62e09c, 0xf9d2e0cf, 0xc4b2c97f, 0x8312b3af, + 0xbe729a1f, 0x0c52460f, 0x31326fbf, 0x7692156f, 0x4bf23cdf, + 0xc9a2ab0e, 0xf4c282be, 0xb362f86e, 0x8e02d1de, 0x3c220dce, + 0x0142247e, 0x46e25eae, 0x7b82771e, 0xb1e6b092, 0x8c869922, + 0xcb26e3f2, 0xf646ca42, 0x44661652, 0x79063fe2, 0x3ea64532, + 0x03c66c82, 0x8196fb53, 0xbcf6d2e3, 0xfb56a833, 0xc6368183, + 0x74165d93, 0x49767423, 0x0ed60ef3, 0x33b62743, 0xd1062710, + 0xec660ea0, 0xabc67470, 0x96a65dc0, 0x248681d0, 0x19e6a860, + 0x5e46d2b0, 0x6326fb00, 0xe1766cd1, 0xdc164561, 0x9bb63fb1, + 0xa6d61601, 0x14f6ca11, 0x2996e3a1, 0x6e369971, 0x5356b0c1, + 0x70279f96, 0x4d47b626, 0x0ae7ccf6, 0x3787e546, 0x85a73956, + 0xb8c710e6, 0xff676a36, 0xc2074386, 0x4057d457, 0x7d37fde7, + 0x3a978737, 0x07f7ae87, 0xb5d77297, 0x88b75b27, 0xcf1721f7, + 0xf2770847, 0x10c70814, 0x2da721a4, 0x6a075b74, 0x576772c4, + 0xe547aed4, 0xd8278764, 0x9f87fdb4, 0xa2e7d404, 0x20b743d5, + 0x1dd76a65, 0x5a7710b5, 0x67173905, 0xd537e515, 0xe857cca5, + 0xaff7b675, 0x92979fc5, 0xe915e8db, 0xd475c16b, 0x93d5bbbb, + 0xaeb5920b, 0x1c954e1b, 0x21f567ab, 0x66551d7b, 0x5b3534cb, + 0xd965a31a, 0xe4058aaa, 0xa3a5f07a, 0x9ec5d9ca, 0x2ce505da, + 0x11852c6a, 0x562556ba, 0x6b457f0a, 0x89f57f59, 0xb49556e9, + 0xf3352c39, 0xce550589, 0x7c75d999, 0x4115f029, 0x06b58af9, + 0x3bd5a349, 0xb9853498, 0x84e51d28, 0xc34567f8, 0xfe254e48, + 0x4c059258, 0x7165bbe8, 0x36c5c138, 0x0ba5e888, 0x28d4c7df, + 0x15b4ee6f, 0x521494bf, 0x6f74bd0f, 0xdd54611f, 0xe03448af, + 0xa794327f, 0x9af41bcf, 0x18a48c1e, 0x25c4a5ae, 0x6264df7e, + 0x5f04f6ce, 0xed242ade, 0xd044036e, 0x97e479be, 0xaa84500e, + 0x4834505d, 0x755479ed, 0x32f4033d, 0x0f942a8d, 0xbdb4f69d, + 0x80d4df2d, 0xc774a5fd, 0xfa148c4d, 0x78441b9c, 0x4524322c, + 0x028448fc, 0x3fe4614c, 0x8dc4bd5c, 0xb0a494ec, 0xf704ee3c, + 0xca64c78c}, + {0x00000000, 0xb8bc6765, 0xaa09c88b, 0x12b5afee, 0x8f629757, + 0x37def032, 0x256b5fdc, 0x9dd738b9, 0xc5b428ef, 0x7d084f8a, + 0x6fbde064, 0xd7018701, 0x4ad6bfb8, 0xf26ad8dd, 0xe0df7733, + 0x58631056, 0x5019579f, 0xe8a530fa, 0xfa109f14, 0x42acf871, + 0xdf7bc0c8, 0x67c7a7ad, 0x75720843, 0xcdce6f26, 0x95ad7f70, + 0x2d111815, 0x3fa4b7fb, 0x8718d09e, 0x1acfe827, 0xa2738f42, + 0xb0c620ac, 0x087a47c9, 0xa032af3e, 0x188ec85b, 0x0a3b67b5, + 0xb28700d0, 0x2f503869, 0x97ec5f0c, 0x8559f0e2, 0x3de59787, + 0x658687d1, 0xdd3ae0b4, 0xcf8f4f5a, 0x7733283f, 0xeae41086, + 0x525877e3, 0x40edd80d, 0xf851bf68, 0xf02bf8a1, 0x48979fc4, + 0x5a22302a, 0xe29e574f, 0x7f496ff6, 0xc7f50893, 0xd540a77d, + 0x6dfcc018, 0x359fd04e, 0x8d23b72b, 0x9f9618c5, 0x272a7fa0, + 0xbafd4719, 0x0241207c, 0x10f48f92, 0xa848e8f7, 0x9b14583d, + 0x23a83f58, 0x311d90b6, 0x89a1f7d3, 0x1476cf6a, 0xaccaa80f, + 0xbe7f07e1, 0x06c36084, 0x5ea070d2, 0xe61c17b7, 0xf4a9b859, + 0x4c15df3c, 0xd1c2e785, 0x697e80e0, 0x7bcb2f0e, 0xc377486b, + 0xcb0d0fa2, 0x73b168c7, 0x6104c729, 0xd9b8a04c, 0x446f98f5, + 0xfcd3ff90, 0xee66507e, 0x56da371b, 0x0eb9274d, 0xb6054028, + 0xa4b0efc6, 0x1c0c88a3, 0x81dbb01a, 0x3967d77f, 0x2bd27891, + 0x936e1ff4, 0x3b26f703, 0x839a9066, 0x912f3f88, 0x299358ed, + 0xb4446054, 0x0cf80731, 0x1e4da8df, 0xa6f1cfba, 0xfe92dfec, + 0x462eb889, 0x549b1767, 0xec277002, 0x71f048bb, 0xc94c2fde, + 0xdbf98030, 0x6345e755, 0x6b3fa09c, 0xd383c7f9, 0xc1366817, + 0x798a0f72, 0xe45d37cb, 0x5ce150ae, 0x4e54ff40, 0xf6e89825, + 0xae8b8873, 0x1637ef16, 0x048240f8, 0xbc3e279d, 0x21e91f24, + 0x99557841, 0x8be0d7af, 0x335cb0ca, 0xed59b63b, 0x55e5d15e, + 0x47507eb0, 0xffec19d5, 0x623b216c, 0xda874609, 0xc832e9e7, + 0x708e8e82, 0x28ed9ed4, 0x9051f9b1, 0x82e4565f, 0x3a58313a, + 0xa78f0983, 0x1f336ee6, 0x0d86c108, 0xb53aa66d, 0xbd40e1a4, + 0x05fc86c1, 0x1749292f, 0xaff54e4a, 0x322276f3, 0x8a9e1196, + 0x982bbe78, 0x2097d91d, 0x78f4c94b, 0xc048ae2e, 0xd2fd01c0, + 0x6a4166a5, 0xf7965e1c, 0x4f2a3979, 0x5d9f9697, 0xe523f1f2, + 0x4d6b1905, 0xf5d77e60, 0xe762d18e, 0x5fdeb6eb, 0xc2098e52, + 0x7ab5e937, 0x680046d9, 0xd0bc21bc, 0x88df31ea, 0x3063568f, + 0x22d6f961, 0x9a6a9e04, 0x07bda6bd, 0xbf01c1d8, 0xadb46e36, + 0x15080953, 0x1d724e9a, 0xa5ce29ff, 0xb77b8611, 0x0fc7e174, + 0x9210d9cd, 0x2aacbea8, 0x38191146, 0x80a57623, 0xd8c66675, + 0x607a0110, 0x72cfaefe, 0xca73c99b, 0x57a4f122, 0xef189647, + 0xfdad39a9, 0x45115ecc, 0x764dee06, 0xcef18963, 0xdc44268d, + 0x64f841e8, 0xf92f7951, 0x41931e34, 0x5326b1da, 0xeb9ad6bf, + 0xb3f9c6e9, 0x0b45a18c, 0x19f00e62, 0xa14c6907, 0x3c9b51be, + 0x842736db, 0x96929935, 0x2e2efe50, 0x2654b999, 0x9ee8defc, + 0x8c5d7112, 0x34e11677, 0xa9362ece, 0x118a49ab, 0x033fe645, + 0xbb838120, 0xe3e09176, 0x5b5cf613, 0x49e959fd, 0xf1553e98, + 0x6c820621, 0xd43e6144, 0xc68bceaa, 0x7e37a9cf, 0xd67f4138, + 0x6ec3265d, 0x7c7689b3, 0xc4caeed6, 0x591dd66f, 0xe1a1b10a, + 0xf3141ee4, 0x4ba87981, 0x13cb69d7, 0xab770eb2, 0xb9c2a15c, + 0x017ec639, 0x9ca9fe80, 0x241599e5, 0x36a0360b, 0x8e1c516e, + 0x866616a7, 0x3eda71c2, 0x2c6fde2c, 0x94d3b949, 0x090481f0, + 0xb1b8e695, 0xa30d497b, 0x1bb12e1e, 0x43d23e48, 0xfb6e592d, + 0xe9dbf6c3, 0x516791a6, 0xccb0a91f, 0x740cce7a, 0x66b96194, + 0xde0506f1}, + {0x00000000, 0x01c26a37, 0x0384d46e, 0x0246be59, 0x0709a8dc, + 0x06cbc2eb, 0x048d7cb2, 0x054f1685, 0x0e1351b8, 0x0fd13b8f, + 0x0d9785d6, 0x0c55efe1, 0x091af964, 0x08d89353, 0x0a9e2d0a, + 0x0b5c473d, 0x1c26a370, 0x1de4c947, 0x1fa2771e, 0x1e601d29, + 0x1b2f0bac, 0x1aed619b, 0x18abdfc2, 0x1969b5f5, 0x1235f2c8, + 0x13f798ff, 0x11b126a6, 0x10734c91, 0x153c5a14, 0x14fe3023, + 0x16b88e7a, 0x177ae44d, 0x384d46e0, 0x398f2cd7, 0x3bc9928e, + 0x3a0bf8b9, 0x3f44ee3c, 0x3e86840b, 0x3cc03a52, 0x3d025065, + 0x365e1758, 0x379c7d6f, 0x35dac336, 0x3418a901, 0x3157bf84, + 0x3095d5b3, 0x32d36bea, 0x331101dd, 0x246be590, 0x25a98fa7, + 0x27ef31fe, 0x262d5bc9, 0x23624d4c, 0x22a0277b, 0x20e69922, + 0x2124f315, 0x2a78b428, 0x2bbade1f, 0x29fc6046, 0x283e0a71, + 0x2d711cf4, 0x2cb376c3, 0x2ef5c89a, 0x2f37a2ad, 0x709a8dc0, + 0x7158e7f7, 0x731e59ae, 0x72dc3399, 0x7793251c, 0x76514f2b, + 0x7417f172, 0x75d59b45, 0x7e89dc78, 0x7f4bb64f, 0x7d0d0816, + 0x7ccf6221, 0x798074a4, 0x78421e93, 0x7a04a0ca, 0x7bc6cafd, + 0x6cbc2eb0, 0x6d7e4487, 0x6f38fade, 0x6efa90e9, 0x6bb5866c, + 0x6a77ec5b, 0x68315202, 0x69f33835, 0x62af7f08, 0x636d153f, + 0x612bab66, 0x60e9c151, 0x65a6d7d4, 0x6464bde3, 0x662203ba, + 0x67e0698d, 0x48d7cb20, 0x4915a117, 0x4b531f4e, 0x4a917579, + 0x4fde63fc, 0x4e1c09cb, 0x4c5ab792, 0x4d98dda5, 0x46c49a98, + 0x4706f0af, 0x45404ef6, 0x448224c1, 0x41cd3244, 0x400f5873, + 0x4249e62a, 0x438b8c1d, 0x54f16850, 0x55330267, 0x5775bc3e, + 0x56b7d609, 0x53f8c08c, 0x523aaabb, 0x507c14e2, 0x51be7ed5, + 0x5ae239e8, 0x5b2053df, 0x5966ed86, 0x58a487b1, 0x5deb9134, + 0x5c29fb03, 0x5e6f455a, 0x5fad2f6d, 0xe1351b80, 0xe0f771b7, + 0xe2b1cfee, 0xe373a5d9, 0xe63cb35c, 0xe7fed96b, 0xe5b86732, + 0xe47a0d05, 0xef264a38, 0xeee4200f, 0xeca29e56, 0xed60f461, + 0xe82fe2e4, 0xe9ed88d3, 0xebab368a, 0xea695cbd, 0xfd13b8f0, + 0xfcd1d2c7, 0xfe976c9e, 0xff5506a9, 0xfa1a102c, 0xfbd87a1b, + 0xf99ec442, 0xf85cae75, 0xf300e948, 0xf2c2837f, 0xf0843d26, + 0xf1465711, 0xf4094194, 0xf5cb2ba3, 0xf78d95fa, 0xf64fffcd, + 0xd9785d60, 0xd8ba3757, 0xdafc890e, 0xdb3ee339, 0xde71f5bc, + 0xdfb39f8b, 0xddf521d2, 0xdc374be5, 0xd76b0cd8, 0xd6a966ef, + 0xd4efd8b6, 0xd52db281, 0xd062a404, 0xd1a0ce33, 0xd3e6706a, + 0xd2241a5d, 0xc55efe10, 0xc49c9427, 0xc6da2a7e, 0xc7184049, + 0xc25756cc, 0xc3953cfb, 0xc1d382a2, 0xc011e895, 0xcb4dafa8, + 0xca8fc59f, 0xc8c97bc6, 0xc90b11f1, 0xcc440774, 0xcd866d43, + 0xcfc0d31a, 0xce02b92d, 0x91af9640, 0x906dfc77, 0x922b422e, + 0x93e92819, 0x96a63e9c, 0x976454ab, 0x9522eaf2, 0x94e080c5, + 0x9fbcc7f8, 0x9e7eadcf, 0x9c381396, 0x9dfa79a1, 0x98b56f24, + 0x99770513, 0x9b31bb4a, 0x9af3d17d, 0x8d893530, 0x8c4b5f07, + 0x8e0de15e, 0x8fcf8b69, 0x8a809dec, 0x8b42f7db, 0x89044982, + 0x88c623b5, 0x839a6488, 0x82580ebf, 0x801eb0e6, 0x81dcdad1, + 0x8493cc54, 0x8551a663, 0x8717183a, 0x86d5720d, 0xa9e2d0a0, + 0xa820ba97, 0xaa6604ce, 0xaba46ef9, 0xaeeb787c, 0xaf29124b, + 0xad6fac12, 0xacadc625, 0xa7f18118, 0xa633eb2f, 0xa4755576, + 0xa5b73f41, 0xa0f829c4, 0xa13a43f3, 0xa37cfdaa, 0xa2be979d, + 0xb5c473d0, 0xb40619e7, 0xb640a7be, 0xb782cd89, 0xb2cddb0c, + 0xb30fb13b, 0xb1490f62, 0xb08b6555, 0xbbd72268, 0xba15485f, + 0xb853f606, 0xb9919c31, 0xbcde8ab4, 0xbd1ce083, 0xbf5a5eda, + 0xbe9834ed}, + {0x00000000, 0x191b3141, 0x32366282, 0x2b2d53c3, 0x646cc504, + 0x7d77f445, 0x565aa786, 0x4f4196c7, 0xc8d98a08, 0xd1c2bb49, + 0xfaefe88a, 0xe3f4d9cb, 0xacb54f0c, 0xb5ae7e4d, 0x9e832d8e, + 0x87981ccf, 0x4ac21251, 0x53d92310, 0x78f470d3, 0x61ef4192, + 0x2eaed755, 0x37b5e614, 0x1c98b5d7, 0x05838496, 0x821b9859, + 0x9b00a918, 0xb02dfadb, 0xa936cb9a, 0xe6775d5d, 0xff6c6c1c, + 0xd4413fdf, 0xcd5a0e9e, 0x958424a2, 0x8c9f15e3, 0xa7b24620, + 0xbea97761, 0xf1e8e1a6, 0xe8f3d0e7, 0xc3de8324, 0xdac5b265, + 0x5d5daeaa, 0x44469feb, 0x6f6bcc28, 0x7670fd69, 0x39316bae, + 0x202a5aef, 0x0b07092c, 0x121c386d, 0xdf4636f3, 0xc65d07b2, + 0xed705471, 0xf46b6530, 0xbb2af3f7, 0xa231c2b6, 0x891c9175, + 0x9007a034, 0x179fbcfb, 0x0e848dba, 0x25a9de79, 0x3cb2ef38, + 0x73f379ff, 0x6ae848be, 0x41c51b7d, 0x58de2a3c, 0xf0794f05, + 0xe9627e44, 0xc24f2d87, 0xdb541cc6, 0x94158a01, 0x8d0ebb40, + 0xa623e883, 0xbf38d9c2, 0x38a0c50d, 0x21bbf44c, 0x0a96a78f, + 0x138d96ce, 0x5ccc0009, 0x45d73148, 0x6efa628b, 0x77e153ca, + 0xbabb5d54, 0xa3a06c15, 0x888d3fd6, 0x91960e97, 0xded79850, + 0xc7cca911, 0xece1fad2, 0xf5facb93, 0x7262d75c, 0x6b79e61d, + 0x4054b5de, 0x594f849f, 0x160e1258, 0x0f152319, 0x243870da, + 0x3d23419b, 0x65fd6ba7, 0x7ce65ae6, 0x57cb0925, 0x4ed03864, + 0x0191aea3, 0x188a9fe2, 0x33a7cc21, 0x2abcfd60, 0xad24e1af, + 0xb43fd0ee, 0x9f12832d, 0x8609b26c, 0xc94824ab, 0xd05315ea, + 0xfb7e4629, 0xe2657768, 0x2f3f79f6, 0x362448b7, 0x1d091b74, + 0x04122a35, 0x4b53bcf2, 0x52488db3, 0x7965de70, 0x607eef31, + 0xe7e6f3fe, 0xfefdc2bf, 0xd5d0917c, 0xcccba03d, 0x838a36fa, + 0x9a9107bb, 0xb1bc5478, 0xa8a76539, 0x3b83984b, 0x2298a90a, + 0x09b5fac9, 0x10aecb88, 0x5fef5d4f, 0x46f46c0e, 0x6dd93fcd, + 0x74c20e8c, 0xf35a1243, 0xea412302, 0xc16c70c1, 0xd8774180, + 0x9736d747, 0x8e2de606, 0xa500b5c5, 0xbc1b8484, 0x71418a1a, + 0x685abb5b, 0x4377e898, 0x5a6cd9d9, 0x152d4f1e, 0x0c367e5f, + 0x271b2d9c, 0x3e001cdd, 0xb9980012, 0xa0833153, 0x8bae6290, + 0x92b553d1, 0xddf4c516, 0xc4eff457, 0xefc2a794, 0xf6d996d5, + 0xae07bce9, 0xb71c8da8, 0x9c31de6b, 0x852aef2a, 0xca6b79ed, + 0xd37048ac, 0xf85d1b6f, 0xe1462a2e, 0x66de36e1, 0x7fc507a0, + 0x54e85463, 0x4df36522, 0x02b2f3e5, 0x1ba9c2a4, 0x30849167, + 0x299fa026, 0xe4c5aeb8, 0xfdde9ff9, 0xd6f3cc3a, 0xcfe8fd7b, + 0x80a96bbc, 0x99b25afd, 0xb29f093e, 0xab84387f, 0x2c1c24b0, + 0x350715f1, 0x1e2a4632, 0x07317773, 0x4870e1b4, 0x516bd0f5, + 0x7a468336, 0x635db277, 0xcbfad74e, 0xd2e1e60f, 0xf9ccb5cc, + 0xe0d7848d, 0xaf96124a, 0xb68d230b, 0x9da070c8, 0x84bb4189, + 0x03235d46, 0x1a386c07, 0x31153fc4, 0x280e0e85, 0x674f9842, + 0x7e54a903, 0x5579fac0, 0x4c62cb81, 0x8138c51f, 0x9823f45e, + 0xb30ea79d, 0xaa1596dc, 0xe554001b, 0xfc4f315a, 0xd7626299, + 0xce7953d8, 0x49e14f17, 0x50fa7e56, 0x7bd72d95, 0x62cc1cd4, + 0x2d8d8a13, 0x3496bb52, 0x1fbbe891, 0x06a0d9d0, 0x5e7ef3ec, + 0x4765c2ad, 0x6c48916e, 0x7553a02f, 0x3a1236e8, 0x230907a9, + 0x0824546a, 0x113f652b, 0x96a779e4, 0x8fbc48a5, 0xa4911b66, + 0xbd8a2a27, 0xf2cbbce0, 0xebd08da1, 0xc0fdde62, 0xd9e6ef23, + 0x14bce1bd, 0x0da7d0fc, 0x268a833f, 0x3f91b27e, 0x70d024b9, + 0x69cb15f8, 0x42e6463b, 0x5bfd777a, 0xdc656bb5, 0xc57e5af4, + 0xee530937, 0xf7483876, 0xb809aeb1, 0xa1129ff0, 0x8a3fcc33, + 0x9324fd72}, + {0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, + 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, + 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, + 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, + 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856, + 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, + 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, + 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, + 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a, + 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, + 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, + 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, + 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, + 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e, + 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, + 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, + 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, + 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, + 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, + 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, + 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010, + 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, + 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, + 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, + 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, + 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344, + 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, + 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, + 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, + 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c, + 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, + 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, + 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, + 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, + 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c, + 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, + 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, + 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, + 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, + 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278, + 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, + 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66, + 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, + 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, + 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, + 0x2d02ef8d}}; + +local const z_word_t FAR crc_braid_big_table[][256] = { + {0x0000000000000000, 0x9630077700000000, 0x2c610eee00000000, + 0xba51099900000000, 0x19c46d0700000000, 0x8ff46a7000000000, + 0x35a563e900000000, 0xa395649e00000000, 0x3288db0e00000000, + 0xa4b8dc7900000000, 0x1ee9d5e000000000, 0x88d9d29700000000, + 0x2b4cb60900000000, 0xbd7cb17e00000000, 0x072db8e700000000, + 0x911dbf9000000000, 0x6410b71d00000000, 0xf220b06a00000000, + 0x4871b9f300000000, 0xde41be8400000000, 0x7dd4da1a00000000, + 0xebe4dd6d00000000, 0x51b5d4f400000000, 0xc785d38300000000, + 0x56986c1300000000, 0xc0a86b6400000000, 0x7af962fd00000000, + 0xecc9658a00000000, 0x4f5c011400000000, 0xd96c066300000000, + 0x633d0ffa00000000, 0xf50d088d00000000, 0xc8206e3b00000000, + 0x5e10694c00000000, 0xe44160d500000000, 0x727167a200000000, + 0xd1e4033c00000000, 0x47d4044b00000000, 0xfd850dd200000000, + 0x6bb50aa500000000, 0xfaa8b53500000000, 0x6c98b24200000000, + 0xd6c9bbdb00000000, 0x40f9bcac00000000, 0xe36cd83200000000, + 0x755cdf4500000000, 0xcf0dd6dc00000000, 0x593dd1ab00000000, + 0xac30d92600000000, 0x3a00de5100000000, 0x8051d7c800000000, + 0x1661d0bf00000000, 0xb5f4b42100000000, 0x23c4b35600000000, + 0x9995bacf00000000, 0x0fa5bdb800000000, 0x9eb8022800000000, + 0x0888055f00000000, 0xb2d90cc600000000, 0x24e90bb100000000, + 0x877c6f2f00000000, 0x114c685800000000, 0xab1d61c100000000, + 0x3d2d66b600000000, 0x9041dc7600000000, 0x0671db0100000000, + 0xbc20d29800000000, 0x2a10d5ef00000000, 0x8985b17100000000, + 0x1fb5b60600000000, 0xa5e4bf9f00000000, 0x33d4b8e800000000, + 0xa2c9077800000000, 0x34f9000f00000000, 0x8ea8099600000000, + 0x18980ee100000000, 0xbb0d6a7f00000000, 0x2d3d6d0800000000, + 0x976c649100000000, 0x015c63e600000000, 0xf4516b6b00000000, + 0x62616c1c00000000, 0xd830658500000000, 0x4e0062f200000000, + 0xed95066c00000000, 0x7ba5011b00000000, 0xc1f4088200000000, + 0x57c40ff500000000, 0xc6d9b06500000000, 0x50e9b71200000000, + 0xeab8be8b00000000, 0x7c88b9fc00000000, 0xdf1ddd6200000000, + 0x492dda1500000000, 0xf37cd38c00000000, 0x654cd4fb00000000, + 0x5861b24d00000000, 0xce51b53a00000000, 0x7400bca300000000, + 0xe230bbd400000000, 0x41a5df4a00000000, 0xd795d83d00000000, + 0x6dc4d1a400000000, 0xfbf4d6d300000000, 0x6ae9694300000000, + 0xfcd96e3400000000, 0x468867ad00000000, 0xd0b860da00000000, + 0x732d044400000000, 0xe51d033300000000, 0x5f4c0aaa00000000, + 0xc97c0ddd00000000, 0x3c71055000000000, 0xaa41022700000000, + 0x10100bbe00000000, 0x86200cc900000000, 0x25b5685700000000, + 0xb3856f2000000000, 0x09d466b900000000, 0x9fe461ce00000000, + 0x0ef9de5e00000000, 0x98c9d92900000000, 0x2298d0b000000000, + 0xb4a8d7c700000000, 0x173db35900000000, 0x810db42e00000000, + 0x3b5cbdb700000000, 0xad6cbac000000000, 0x2083b8ed00000000, + 0xb6b3bf9a00000000, 0x0ce2b60300000000, 0x9ad2b17400000000, + 0x3947d5ea00000000, 0xaf77d29d00000000, 0x1526db0400000000, + 0x8316dc7300000000, 0x120b63e300000000, 0x843b649400000000, + 0x3e6a6d0d00000000, 0xa85a6a7a00000000, 0x0bcf0ee400000000, + 0x9dff099300000000, 0x27ae000a00000000, 0xb19e077d00000000, + 0x44930ff000000000, 0xd2a3088700000000, 0x68f2011e00000000, + 0xfec2066900000000, 0x5d5762f700000000, 0xcb67658000000000, + 0x71366c1900000000, 0xe7066b6e00000000, 0x761bd4fe00000000, + 0xe02bd38900000000, 0x5a7ada1000000000, 0xcc4add6700000000, + 0x6fdfb9f900000000, 0xf9efbe8e00000000, 0x43beb71700000000, + 0xd58eb06000000000, 0xe8a3d6d600000000, 0x7e93d1a100000000, + 0xc4c2d83800000000, 0x52f2df4f00000000, 0xf167bbd100000000, + 0x6757bca600000000, 0xdd06b53f00000000, 0x4b36b24800000000, + 0xda2b0dd800000000, 0x4c1b0aaf00000000, 0xf64a033600000000, + 0x607a044100000000, 0xc3ef60df00000000, 0x55df67a800000000, + 0xef8e6e3100000000, 0x79be694600000000, 0x8cb361cb00000000, + 0x1a8366bc00000000, 0xa0d26f2500000000, 0x36e2685200000000, + 0x95770ccc00000000, 0x03470bbb00000000, 0xb916022200000000, + 0x2f26055500000000, 0xbe3bbac500000000, 0x280bbdb200000000, + 0x925ab42b00000000, 0x046ab35c00000000, 0xa7ffd7c200000000, + 0x31cfd0b500000000, 0x8b9ed92c00000000, 0x1daede5b00000000, + 0xb0c2649b00000000, 0x26f263ec00000000, 0x9ca36a7500000000, + 0x0a936d0200000000, 0xa906099c00000000, 0x3f360eeb00000000, + 0x8567077200000000, 0x1357000500000000, 0x824abf9500000000, + 0x147ab8e200000000, 0xae2bb17b00000000, 0x381bb60c00000000, + 0x9b8ed29200000000, 0x0dbed5e500000000, 0xb7efdc7c00000000, + 0x21dfdb0b00000000, 0xd4d2d38600000000, 0x42e2d4f100000000, + 0xf8b3dd6800000000, 0x6e83da1f00000000, 0xcd16be8100000000, + 0x5b26b9f600000000, 0xe177b06f00000000, 0x7747b71800000000, + 0xe65a088800000000, 0x706a0fff00000000, 0xca3b066600000000, + 0x5c0b011100000000, 0xff9e658f00000000, 0x69ae62f800000000, + 0xd3ff6b6100000000, 0x45cf6c1600000000, 0x78e20aa000000000, + 0xeed20dd700000000, 0x5483044e00000000, 0xc2b3033900000000, + 0x612667a700000000, 0xf71660d000000000, 0x4d47694900000000, + 0xdb776e3e00000000, 0x4a6ad1ae00000000, 0xdc5ad6d900000000, + 0x660bdf4000000000, 0xf03bd83700000000, 0x53aebca900000000, + 0xc59ebbde00000000, 0x7fcfb24700000000, 0xe9ffb53000000000, + 0x1cf2bdbd00000000, 0x8ac2baca00000000, 0x3093b35300000000, + 0xa6a3b42400000000, 0x0536d0ba00000000, 0x9306d7cd00000000, + 0x2957de5400000000, 0xbf67d92300000000, 0x2e7a66b300000000, + 0xb84a61c400000000, 0x021b685d00000000, 0x942b6f2a00000000, + 0x37be0bb400000000, 0xa18e0cc300000000, 0x1bdf055a00000000, + 0x8def022d00000000}, + {0x0000000000000000, 0x41311b1900000000, 0x8262363200000000, + 0xc3532d2b00000000, 0x04c56c6400000000, 0x45f4777d00000000, + 0x86a75a5600000000, 0xc796414f00000000, 0x088ad9c800000000, + 0x49bbc2d100000000, 0x8ae8effa00000000, 0xcbd9f4e300000000, + 0x0c4fb5ac00000000, 0x4d7eaeb500000000, 0x8e2d839e00000000, + 0xcf1c988700000000, 0x5112c24a00000000, 0x1023d95300000000, + 0xd370f47800000000, 0x9241ef6100000000, 0x55d7ae2e00000000, + 0x14e6b53700000000, 0xd7b5981c00000000, 0x9684830500000000, + 0x59981b8200000000, 0x18a9009b00000000, 0xdbfa2db000000000, + 0x9acb36a900000000, 0x5d5d77e600000000, 0x1c6c6cff00000000, + 0xdf3f41d400000000, 0x9e0e5acd00000000, 0xa224849500000000, + 0xe3159f8c00000000, 0x2046b2a700000000, 0x6177a9be00000000, + 0xa6e1e8f100000000, 0xe7d0f3e800000000, 0x2483dec300000000, + 0x65b2c5da00000000, 0xaaae5d5d00000000, 0xeb9f464400000000, + 0x28cc6b6f00000000, 0x69fd707600000000, 0xae6b313900000000, + 0xef5a2a2000000000, 0x2c09070b00000000, 0x6d381c1200000000, + 0xf33646df00000000, 0xb2075dc600000000, 0x715470ed00000000, + 0x30656bf400000000, 0xf7f32abb00000000, 0xb6c231a200000000, + 0x75911c8900000000, 0x34a0079000000000, 0xfbbc9f1700000000, + 0xba8d840e00000000, 0x79dea92500000000, 0x38efb23c00000000, + 0xff79f37300000000, 0xbe48e86a00000000, 0x7d1bc54100000000, + 0x3c2ade5800000000, 0x054f79f000000000, 0x447e62e900000000, + 0x872d4fc200000000, 0xc61c54db00000000, 0x018a159400000000, + 0x40bb0e8d00000000, 0x83e823a600000000, 0xc2d938bf00000000, + 0x0dc5a03800000000, 0x4cf4bb2100000000, 0x8fa7960a00000000, + 0xce968d1300000000, 0x0900cc5c00000000, 0x4831d74500000000, + 0x8b62fa6e00000000, 0xca53e17700000000, 0x545dbbba00000000, + 0x156ca0a300000000, 0xd63f8d8800000000, 0x970e969100000000, + 0x5098d7de00000000, 0x11a9ccc700000000, 0xd2fae1ec00000000, + 0x93cbfaf500000000, 0x5cd7627200000000, 0x1de6796b00000000, + 0xdeb5544000000000, 0x9f844f5900000000, 0x58120e1600000000, + 0x1923150f00000000, 0xda70382400000000, 0x9b41233d00000000, + 0xa76bfd6500000000, 0xe65ae67c00000000, 0x2509cb5700000000, + 0x6438d04e00000000, 0xa3ae910100000000, 0xe29f8a1800000000, + 0x21cca73300000000, 0x60fdbc2a00000000, 0xafe124ad00000000, + 0xeed03fb400000000, 0x2d83129f00000000, 0x6cb2098600000000, + 0xab2448c900000000, 0xea1553d000000000, 0x29467efb00000000, + 0x687765e200000000, 0xf6793f2f00000000, 0xb748243600000000, + 0x741b091d00000000, 0x352a120400000000, 0xf2bc534b00000000, + 0xb38d485200000000, 0x70de657900000000, 0x31ef7e6000000000, + 0xfef3e6e700000000, 0xbfc2fdfe00000000, 0x7c91d0d500000000, + 0x3da0cbcc00000000, 0xfa368a8300000000, 0xbb07919a00000000, + 0x7854bcb100000000, 0x3965a7a800000000, 0x4b98833b00000000, + 0x0aa9982200000000, 0xc9fab50900000000, 0x88cbae1000000000, + 0x4f5def5f00000000, 0x0e6cf44600000000, 0xcd3fd96d00000000, + 0x8c0ec27400000000, 0x43125af300000000, 0x022341ea00000000, + 0xc1706cc100000000, 0x804177d800000000, 0x47d7369700000000, + 0x06e62d8e00000000, 0xc5b500a500000000, 0x84841bbc00000000, + 0x1a8a417100000000, 0x5bbb5a6800000000, 0x98e8774300000000, + 0xd9d96c5a00000000, 0x1e4f2d1500000000, 0x5f7e360c00000000, + 0x9c2d1b2700000000, 0xdd1c003e00000000, 0x120098b900000000, + 0x533183a000000000, 0x9062ae8b00000000, 0xd153b59200000000, + 0x16c5f4dd00000000, 0x57f4efc400000000, 0x94a7c2ef00000000, + 0xd596d9f600000000, 0xe9bc07ae00000000, 0xa88d1cb700000000, + 0x6bde319c00000000, 0x2aef2a8500000000, 0xed796bca00000000, + 0xac4870d300000000, 0x6f1b5df800000000, 0x2e2a46e100000000, + 0xe136de6600000000, 0xa007c57f00000000, 0x6354e85400000000, + 0x2265f34d00000000, 0xe5f3b20200000000, 0xa4c2a91b00000000, + 0x6791843000000000, 0x26a09f2900000000, 0xb8aec5e400000000, + 0xf99fdefd00000000, 0x3accf3d600000000, 0x7bfde8cf00000000, + 0xbc6ba98000000000, 0xfd5ab29900000000, 0x3e099fb200000000, + 0x7f3884ab00000000, 0xb0241c2c00000000, 0xf115073500000000, + 0x32462a1e00000000, 0x7377310700000000, 0xb4e1704800000000, + 0xf5d06b5100000000, 0x3683467a00000000, 0x77b25d6300000000, + 0x4ed7facb00000000, 0x0fe6e1d200000000, 0xccb5ccf900000000, + 0x8d84d7e000000000, 0x4a1296af00000000, 0x0b238db600000000, + 0xc870a09d00000000, 0x8941bb8400000000, 0x465d230300000000, + 0x076c381a00000000, 0xc43f153100000000, 0x850e0e2800000000, + 0x42984f6700000000, 0x03a9547e00000000, 0xc0fa795500000000, + 0x81cb624c00000000, 0x1fc5388100000000, 0x5ef4239800000000, + 0x9da70eb300000000, 0xdc9615aa00000000, 0x1b0054e500000000, + 0x5a314ffc00000000, 0x996262d700000000, 0xd85379ce00000000, + 0x174fe14900000000, 0x567efa5000000000, 0x952dd77b00000000, + 0xd41ccc6200000000, 0x138a8d2d00000000, 0x52bb963400000000, + 0x91e8bb1f00000000, 0xd0d9a00600000000, 0xecf37e5e00000000, + 0xadc2654700000000, 0x6e91486c00000000, 0x2fa0537500000000, + 0xe836123a00000000, 0xa907092300000000, 0x6a54240800000000, + 0x2b653f1100000000, 0xe479a79600000000, 0xa548bc8f00000000, + 0x661b91a400000000, 0x272a8abd00000000, 0xe0bccbf200000000, + 0xa18dd0eb00000000, 0x62defdc000000000, 0x23efe6d900000000, + 0xbde1bc1400000000, 0xfcd0a70d00000000, 0x3f838a2600000000, + 0x7eb2913f00000000, 0xb924d07000000000, 0xf815cb6900000000, + 0x3b46e64200000000, 0x7a77fd5b00000000, 0xb56b65dc00000000, + 0xf45a7ec500000000, 0x370953ee00000000, 0x763848f700000000, + 0xb1ae09b800000000, 0xf09f12a100000000, 0x33cc3f8a00000000, + 0x72fd249300000000}, + {0x0000000000000000, 0x376ac20100000000, 0x6ed4840300000000, + 0x59be460200000000, 0xdca8090700000000, 0xebc2cb0600000000, + 0xb27c8d0400000000, 0x85164f0500000000, 0xb851130e00000000, + 0x8f3bd10f00000000, 0xd685970d00000000, 0xe1ef550c00000000, + 0x64f91a0900000000, 0x5393d80800000000, 0x0a2d9e0a00000000, + 0x3d475c0b00000000, 0x70a3261c00000000, 0x47c9e41d00000000, + 0x1e77a21f00000000, 0x291d601e00000000, 0xac0b2f1b00000000, + 0x9b61ed1a00000000, 0xc2dfab1800000000, 0xf5b5691900000000, + 0xc8f2351200000000, 0xff98f71300000000, 0xa626b11100000000, + 0x914c731000000000, 0x145a3c1500000000, 0x2330fe1400000000, + 0x7a8eb81600000000, 0x4de47a1700000000, 0xe0464d3800000000, + 0xd72c8f3900000000, 0x8e92c93b00000000, 0xb9f80b3a00000000, + 0x3cee443f00000000, 0x0b84863e00000000, 0x523ac03c00000000, + 0x6550023d00000000, 0x58175e3600000000, 0x6f7d9c3700000000, + 0x36c3da3500000000, 0x01a9183400000000, 0x84bf573100000000, + 0xb3d5953000000000, 0xea6bd33200000000, 0xdd01113300000000, + 0x90e56b2400000000, 0xa78fa92500000000, 0xfe31ef2700000000, + 0xc95b2d2600000000, 0x4c4d622300000000, 0x7b27a02200000000, + 0x2299e62000000000, 0x15f3242100000000, 0x28b4782a00000000, + 0x1fdeba2b00000000, 0x4660fc2900000000, 0x710a3e2800000000, + 0xf41c712d00000000, 0xc376b32c00000000, 0x9ac8f52e00000000, + 0xada2372f00000000, 0xc08d9a7000000000, 0xf7e7587100000000, + 0xae591e7300000000, 0x9933dc7200000000, 0x1c25937700000000, + 0x2b4f517600000000, 0x72f1177400000000, 0x459bd57500000000, + 0x78dc897e00000000, 0x4fb64b7f00000000, 0x16080d7d00000000, + 0x2162cf7c00000000, 0xa474807900000000, 0x931e427800000000, + 0xcaa0047a00000000, 0xfdcac67b00000000, 0xb02ebc6c00000000, + 0x87447e6d00000000, 0xdefa386f00000000, 0xe990fa6e00000000, + 0x6c86b56b00000000, 0x5bec776a00000000, 0x0252316800000000, + 0x3538f36900000000, 0x087faf6200000000, 0x3f156d6300000000, + 0x66ab2b6100000000, 0x51c1e96000000000, 0xd4d7a66500000000, + 0xe3bd646400000000, 0xba03226600000000, 0x8d69e06700000000, + 0x20cbd74800000000, 0x17a1154900000000, 0x4e1f534b00000000, + 0x7975914a00000000, 0xfc63de4f00000000, 0xcb091c4e00000000, + 0x92b75a4c00000000, 0xa5dd984d00000000, 0x989ac44600000000, + 0xaff0064700000000, 0xf64e404500000000, 0xc124824400000000, + 0x4432cd4100000000, 0x73580f4000000000, 0x2ae6494200000000, + 0x1d8c8b4300000000, 0x5068f15400000000, 0x6702335500000000, + 0x3ebc755700000000, 0x09d6b75600000000, 0x8cc0f85300000000, + 0xbbaa3a5200000000, 0xe2147c5000000000, 0xd57ebe5100000000, + 0xe839e25a00000000, 0xdf53205b00000000, 0x86ed665900000000, + 0xb187a45800000000, 0x3491eb5d00000000, 0x03fb295c00000000, + 0x5a456f5e00000000, 0x6d2fad5f00000000, 0x801b35e100000000, + 0xb771f7e000000000, 0xeecfb1e200000000, 0xd9a573e300000000, + 0x5cb33ce600000000, 0x6bd9fee700000000, 0x3267b8e500000000, + 0x050d7ae400000000, 0x384a26ef00000000, 0x0f20e4ee00000000, + 0x569ea2ec00000000, 0x61f460ed00000000, 0xe4e22fe800000000, + 0xd388ede900000000, 0x8a36abeb00000000, 0xbd5c69ea00000000, + 0xf0b813fd00000000, 0xc7d2d1fc00000000, 0x9e6c97fe00000000, + 0xa90655ff00000000, 0x2c101afa00000000, 0x1b7ad8fb00000000, + 0x42c49ef900000000, 0x75ae5cf800000000, 0x48e900f300000000, + 0x7f83c2f200000000, 0x263d84f000000000, 0x115746f100000000, + 0x944109f400000000, 0xa32bcbf500000000, 0xfa958df700000000, + 0xcdff4ff600000000, 0x605d78d900000000, 0x5737bad800000000, + 0x0e89fcda00000000, 0x39e33edb00000000, 0xbcf571de00000000, + 0x8b9fb3df00000000, 0xd221f5dd00000000, 0xe54b37dc00000000, + 0xd80c6bd700000000, 0xef66a9d600000000, 0xb6d8efd400000000, + 0x81b22dd500000000, 0x04a462d000000000, 0x33cea0d100000000, + 0x6a70e6d300000000, 0x5d1a24d200000000, 0x10fe5ec500000000, + 0x27949cc400000000, 0x7e2adac600000000, 0x494018c700000000, + 0xcc5657c200000000, 0xfb3c95c300000000, 0xa282d3c100000000, + 0x95e811c000000000, 0xa8af4dcb00000000, 0x9fc58fca00000000, + 0xc67bc9c800000000, 0xf1110bc900000000, 0x740744cc00000000, + 0x436d86cd00000000, 0x1ad3c0cf00000000, 0x2db902ce00000000, + 0x4096af9100000000, 0x77fc6d9000000000, 0x2e422b9200000000, + 0x1928e99300000000, 0x9c3ea69600000000, 0xab54649700000000, + 0xf2ea229500000000, 0xc580e09400000000, 0xf8c7bc9f00000000, + 0xcfad7e9e00000000, 0x9613389c00000000, 0xa179fa9d00000000, + 0x246fb59800000000, 0x1305779900000000, 0x4abb319b00000000, + 0x7dd1f39a00000000, 0x3035898d00000000, 0x075f4b8c00000000, + 0x5ee10d8e00000000, 0x698bcf8f00000000, 0xec9d808a00000000, + 0xdbf7428b00000000, 0x8249048900000000, 0xb523c68800000000, + 0x88649a8300000000, 0xbf0e588200000000, 0xe6b01e8000000000, + 0xd1dadc8100000000, 0x54cc938400000000, 0x63a6518500000000, + 0x3a18178700000000, 0x0d72d58600000000, 0xa0d0e2a900000000, + 0x97ba20a800000000, 0xce0466aa00000000, 0xf96ea4ab00000000, + 0x7c78ebae00000000, 0x4b1229af00000000, 0x12ac6fad00000000, + 0x25c6adac00000000, 0x1881f1a700000000, 0x2feb33a600000000, + 0x765575a400000000, 0x413fb7a500000000, 0xc429f8a000000000, + 0xf3433aa100000000, 0xaafd7ca300000000, 0x9d97bea200000000, + 0xd073c4b500000000, 0xe71906b400000000, 0xbea740b600000000, + 0x89cd82b700000000, 0x0cdbcdb200000000, 0x3bb10fb300000000, + 0x620f49b100000000, 0x55658bb000000000, 0x6822d7bb00000000, + 0x5f4815ba00000000, 0x06f653b800000000, 0x319c91b900000000, + 0xb48adebc00000000, 0x83e01cbd00000000, 0xda5e5abf00000000, + 0xed3498be00000000}, + {0x0000000000000000, 0x6567bcb800000000, 0x8bc809aa00000000, + 0xeeafb51200000000, 0x5797628f00000000, 0x32f0de3700000000, + 0xdc5f6b2500000000, 0xb938d79d00000000, 0xef28b4c500000000, + 0x8a4f087d00000000, 0x64e0bd6f00000000, 0x018701d700000000, + 0xb8bfd64a00000000, 0xddd86af200000000, 0x3377dfe000000000, + 0x5610635800000000, 0x9f57195000000000, 0xfa30a5e800000000, + 0x149f10fa00000000, 0x71f8ac4200000000, 0xc8c07bdf00000000, + 0xada7c76700000000, 0x4308727500000000, 0x266fcecd00000000, + 0x707fad9500000000, 0x1518112d00000000, 0xfbb7a43f00000000, + 0x9ed0188700000000, 0x27e8cf1a00000000, 0x428f73a200000000, + 0xac20c6b000000000, 0xc9477a0800000000, 0x3eaf32a000000000, + 0x5bc88e1800000000, 0xb5673b0a00000000, 0xd00087b200000000, + 0x6938502f00000000, 0x0c5fec9700000000, 0xe2f0598500000000, + 0x8797e53d00000000, 0xd187866500000000, 0xb4e03add00000000, + 0x5a4f8fcf00000000, 0x3f28337700000000, 0x8610e4ea00000000, + 0xe377585200000000, 0x0dd8ed4000000000, 0x68bf51f800000000, + 0xa1f82bf000000000, 0xc49f974800000000, 0x2a30225a00000000, + 0x4f579ee200000000, 0xf66f497f00000000, 0x9308f5c700000000, + 0x7da740d500000000, 0x18c0fc6d00000000, 0x4ed09f3500000000, + 0x2bb7238d00000000, 0xc518969f00000000, 0xa07f2a2700000000, + 0x1947fdba00000000, 0x7c20410200000000, 0x928ff41000000000, + 0xf7e848a800000000, 0x3d58149b00000000, 0x583fa82300000000, + 0xb6901d3100000000, 0xd3f7a18900000000, 0x6acf761400000000, + 0x0fa8caac00000000, 0xe1077fbe00000000, 0x8460c30600000000, + 0xd270a05e00000000, 0xb7171ce600000000, 0x59b8a9f400000000, + 0x3cdf154c00000000, 0x85e7c2d100000000, 0xe0807e6900000000, + 0x0e2fcb7b00000000, 0x6b4877c300000000, 0xa20f0dcb00000000, + 0xc768b17300000000, 0x29c7046100000000, 0x4ca0b8d900000000, + 0xf5986f4400000000, 0x90ffd3fc00000000, 0x7e5066ee00000000, + 0x1b37da5600000000, 0x4d27b90e00000000, 0x284005b600000000, + 0xc6efb0a400000000, 0xa3880c1c00000000, 0x1ab0db8100000000, + 0x7fd7673900000000, 0x9178d22b00000000, 0xf41f6e9300000000, + 0x03f7263b00000000, 0x66909a8300000000, 0x883f2f9100000000, + 0xed58932900000000, 0x546044b400000000, 0x3107f80c00000000, + 0xdfa84d1e00000000, 0xbacff1a600000000, 0xecdf92fe00000000, + 0x89b82e4600000000, 0x67179b5400000000, 0x027027ec00000000, + 0xbb48f07100000000, 0xde2f4cc900000000, 0x3080f9db00000000, + 0x55e7456300000000, 0x9ca03f6b00000000, 0xf9c783d300000000, + 0x176836c100000000, 0x720f8a7900000000, 0xcb375de400000000, + 0xae50e15c00000000, 0x40ff544e00000000, 0x2598e8f600000000, + 0x73888bae00000000, 0x16ef371600000000, 0xf840820400000000, + 0x9d273ebc00000000, 0x241fe92100000000, 0x4178559900000000, + 0xafd7e08b00000000, 0xcab05c3300000000, 0x3bb659ed00000000, + 0x5ed1e55500000000, 0xb07e504700000000, 0xd519ecff00000000, + 0x6c213b6200000000, 0x094687da00000000, 0xe7e932c800000000, + 0x828e8e7000000000, 0xd49eed2800000000, 0xb1f9519000000000, + 0x5f56e48200000000, 0x3a31583a00000000, 0x83098fa700000000, + 0xe66e331f00000000, 0x08c1860d00000000, 0x6da63ab500000000, + 0xa4e140bd00000000, 0xc186fc0500000000, 0x2f29491700000000, + 0x4a4ef5af00000000, 0xf376223200000000, 0x96119e8a00000000, + 0x78be2b9800000000, 0x1dd9972000000000, 0x4bc9f47800000000, + 0x2eae48c000000000, 0xc001fdd200000000, 0xa566416a00000000, + 0x1c5e96f700000000, 0x79392a4f00000000, 0x97969f5d00000000, + 0xf2f123e500000000, 0x05196b4d00000000, 0x607ed7f500000000, + 0x8ed162e700000000, 0xebb6de5f00000000, 0x528e09c200000000, + 0x37e9b57a00000000, 0xd946006800000000, 0xbc21bcd000000000, + 0xea31df8800000000, 0x8f56633000000000, 0x61f9d62200000000, + 0x049e6a9a00000000, 0xbda6bd0700000000, 0xd8c101bf00000000, + 0x366eb4ad00000000, 0x5309081500000000, 0x9a4e721d00000000, + 0xff29cea500000000, 0x11867bb700000000, 0x74e1c70f00000000, + 0xcdd9109200000000, 0xa8beac2a00000000, 0x4611193800000000, + 0x2376a58000000000, 0x7566c6d800000000, 0x10017a6000000000, + 0xfeaecf7200000000, 0x9bc973ca00000000, 0x22f1a45700000000, + 0x479618ef00000000, 0xa939adfd00000000, 0xcc5e114500000000, + 0x06ee4d7600000000, 0x6389f1ce00000000, 0x8d2644dc00000000, + 0xe841f86400000000, 0x51792ff900000000, 0x341e934100000000, + 0xdab1265300000000, 0xbfd69aeb00000000, 0xe9c6f9b300000000, + 0x8ca1450b00000000, 0x620ef01900000000, 0x07694ca100000000, + 0xbe519b3c00000000, 0xdb36278400000000, 0x3599929600000000, + 0x50fe2e2e00000000, 0x99b9542600000000, 0xfcdee89e00000000, + 0x12715d8c00000000, 0x7716e13400000000, 0xce2e36a900000000, + 0xab498a1100000000, 0x45e63f0300000000, 0x208183bb00000000, + 0x7691e0e300000000, 0x13f65c5b00000000, 0xfd59e94900000000, + 0x983e55f100000000, 0x2106826c00000000, 0x44613ed400000000, + 0xaace8bc600000000, 0xcfa9377e00000000, 0x38417fd600000000, + 0x5d26c36e00000000, 0xb389767c00000000, 0xd6eecac400000000, + 0x6fd61d5900000000, 0x0ab1a1e100000000, 0xe41e14f300000000, + 0x8179a84b00000000, 0xd769cb1300000000, 0xb20e77ab00000000, + 0x5ca1c2b900000000, 0x39c67e0100000000, 0x80fea99c00000000, + 0xe599152400000000, 0x0b36a03600000000, 0x6e511c8e00000000, + 0xa716668600000000, 0xc271da3e00000000, 0x2cde6f2c00000000, + 0x49b9d39400000000, 0xf081040900000000, 0x95e6b8b100000000, + 0x7b490da300000000, 0x1e2eb11b00000000, 0x483ed24300000000, + 0x2d596efb00000000, 0xc3f6dbe900000000, 0xa691675100000000, + 0x1fa9b0cc00000000, 0x7ace0c7400000000, 0x9461b96600000000, + 0xf10605de00000000}, + {0x0000000000000000, 0xb029603d00000000, 0x6053c07a00000000, + 0xd07aa04700000000, 0xc0a680f500000000, 0x708fe0c800000000, + 0xa0f5408f00000000, 0x10dc20b200000000, 0xc14b703000000000, + 0x7162100d00000000, 0xa118b04a00000000, 0x1131d07700000000, + 0x01edf0c500000000, 0xb1c490f800000000, 0x61be30bf00000000, + 0xd197508200000000, 0x8297e06000000000, 0x32be805d00000000, + 0xe2c4201a00000000, 0x52ed402700000000, 0x4231609500000000, + 0xf21800a800000000, 0x2262a0ef00000000, 0x924bc0d200000000, + 0x43dc905000000000, 0xf3f5f06d00000000, 0x238f502a00000000, + 0x93a6301700000000, 0x837a10a500000000, 0x3353709800000000, + 0xe329d0df00000000, 0x5300b0e200000000, 0x042fc1c100000000, + 0xb406a1fc00000000, 0x647c01bb00000000, 0xd455618600000000, + 0xc489413400000000, 0x74a0210900000000, 0xa4da814e00000000, + 0x14f3e17300000000, 0xc564b1f100000000, 0x754dd1cc00000000, + 0xa537718b00000000, 0x151e11b600000000, 0x05c2310400000000, + 0xb5eb513900000000, 0x6591f17e00000000, 0xd5b8914300000000, + 0x86b821a100000000, 0x3691419c00000000, 0xe6ebe1db00000000, + 0x56c281e600000000, 0x461ea15400000000, 0xf637c16900000000, + 0x264d612e00000000, 0x9664011300000000, 0x47f3519100000000, + 0xf7da31ac00000000, 0x27a091eb00000000, 0x9789f1d600000000, + 0x8755d16400000000, 0x377cb15900000000, 0xe706111e00000000, + 0x572f712300000000, 0x4958f35800000000, 0xf971936500000000, + 0x290b332200000000, 0x9922531f00000000, 0x89fe73ad00000000, + 0x39d7139000000000, 0xe9adb3d700000000, 0x5984d3ea00000000, + 0x8813836800000000, 0x383ae35500000000, 0xe840431200000000, + 0x5869232f00000000, 0x48b5039d00000000, 0xf89c63a000000000, + 0x28e6c3e700000000, 0x98cfa3da00000000, 0xcbcf133800000000, + 0x7be6730500000000, 0xab9cd34200000000, 0x1bb5b37f00000000, + 0x0b6993cd00000000, 0xbb40f3f000000000, 0x6b3a53b700000000, + 0xdb13338a00000000, 0x0a84630800000000, 0xbaad033500000000, + 0x6ad7a37200000000, 0xdafec34f00000000, 0xca22e3fd00000000, + 0x7a0b83c000000000, 0xaa71238700000000, 0x1a5843ba00000000, + 0x4d77329900000000, 0xfd5e52a400000000, 0x2d24f2e300000000, + 0x9d0d92de00000000, 0x8dd1b26c00000000, 0x3df8d25100000000, + 0xed82721600000000, 0x5dab122b00000000, 0x8c3c42a900000000, + 0x3c15229400000000, 0xec6f82d300000000, 0x5c46e2ee00000000, + 0x4c9ac25c00000000, 0xfcb3a26100000000, 0x2cc9022600000000, + 0x9ce0621b00000000, 0xcfe0d2f900000000, 0x7fc9b2c400000000, + 0xafb3128300000000, 0x1f9a72be00000000, 0x0f46520c00000000, + 0xbf6f323100000000, 0x6f15927600000000, 0xdf3cf24b00000000, + 0x0eaba2c900000000, 0xbe82c2f400000000, 0x6ef862b300000000, + 0xded1028e00000000, 0xce0d223c00000000, 0x7e24420100000000, + 0xae5ee24600000000, 0x1e77827b00000000, 0x92b0e6b100000000, + 0x2299868c00000000, 0xf2e326cb00000000, 0x42ca46f600000000, + 0x5216664400000000, 0xe23f067900000000, 0x3245a63e00000000, + 0x826cc60300000000, 0x53fb968100000000, 0xe3d2f6bc00000000, + 0x33a856fb00000000, 0x838136c600000000, 0x935d167400000000, + 0x2374764900000000, 0xf30ed60e00000000, 0x4327b63300000000, + 0x102706d100000000, 0xa00e66ec00000000, 0x7074c6ab00000000, + 0xc05da69600000000, 0xd081862400000000, 0x60a8e61900000000, + 0xb0d2465e00000000, 0x00fb266300000000, 0xd16c76e100000000, + 0x614516dc00000000, 0xb13fb69b00000000, 0x0116d6a600000000, + 0x11caf61400000000, 0xa1e3962900000000, 0x7199366e00000000, + 0xc1b0565300000000, 0x969f277000000000, 0x26b6474d00000000, + 0xf6cce70a00000000, 0x46e5873700000000, 0x5639a78500000000, + 0xe610c7b800000000, 0x366a67ff00000000, 0x864307c200000000, + 0x57d4574000000000, 0xe7fd377d00000000, 0x3787973a00000000, + 0x87aef70700000000, 0x9772d7b500000000, 0x275bb78800000000, + 0xf72117cf00000000, 0x470877f200000000, 0x1408c71000000000, + 0xa421a72d00000000, 0x745b076a00000000, 0xc472675700000000, + 0xd4ae47e500000000, 0x648727d800000000, 0xb4fd879f00000000, + 0x04d4e7a200000000, 0xd543b72000000000, 0x656ad71d00000000, + 0xb510775a00000000, 0x0539176700000000, 0x15e537d500000000, + 0xa5cc57e800000000, 0x75b6f7af00000000, 0xc59f979200000000, + 0xdbe815e900000000, 0x6bc175d400000000, 0xbbbbd59300000000, + 0x0b92b5ae00000000, 0x1b4e951c00000000, 0xab67f52100000000, + 0x7b1d556600000000, 0xcb34355b00000000, 0x1aa365d900000000, + 0xaa8a05e400000000, 0x7af0a5a300000000, 0xcad9c59e00000000, + 0xda05e52c00000000, 0x6a2c851100000000, 0xba56255600000000, + 0x0a7f456b00000000, 0x597ff58900000000, 0xe95695b400000000, + 0x392c35f300000000, 0x890555ce00000000, 0x99d9757c00000000, + 0x29f0154100000000, 0xf98ab50600000000, 0x49a3d53b00000000, + 0x983485b900000000, 0x281de58400000000, 0xf86745c300000000, + 0x484e25fe00000000, 0x5892054c00000000, 0xe8bb657100000000, + 0x38c1c53600000000, 0x88e8a50b00000000, 0xdfc7d42800000000, + 0x6feeb41500000000, 0xbf94145200000000, 0x0fbd746f00000000, + 0x1f6154dd00000000, 0xaf4834e000000000, 0x7f3294a700000000, + 0xcf1bf49a00000000, 0x1e8ca41800000000, 0xaea5c42500000000, + 0x7edf646200000000, 0xcef6045f00000000, 0xde2a24ed00000000, + 0x6e0344d000000000, 0xbe79e49700000000, 0x0e5084aa00000000, + 0x5d50344800000000, 0xed79547500000000, 0x3d03f43200000000, + 0x8d2a940f00000000, 0x9df6b4bd00000000, 0x2ddfd48000000000, + 0xfda574c700000000, 0x4d8c14fa00000000, 0x9c1b447800000000, + 0x2c32244500000000, 0xfc48840200000000, 0x4c61e43f00000000, + 0x5cbdc48d00000000, 0xec94a4b000000000, 0x3cee04f700000000, + 0x8cc764ca00000000}, + {0x0000000000000000, 0xa5d35ccb00000000, 0x0ba1c84d00000000, + 0xae72948600000000, 0x1642919b00000000, 0xb391cd5000000000, + 0x1de359d600000000, 0xb830051d00000000, 0x6d8253ec00000000, + 0xc8510f2700000000, 0x66239ba100000000, 0xc3f0c76a00000000, + 0x7bc0c27700000000, 0xde139ebc00000000, 0x70610a3a00000000, + 0xd5b256f100000000, 0x9b02d60300000000, 0x3ed18ac800000000, + 0x90a31e4e00000000, 0x3570428500000000, 0x8d40479800000000, + 0x28931b5300000000, 0x86e18fd500000000, 0x2332d31e00000000, + 0xf68085ef00000000, 0x5353d92400000000, 0xfd214da200000000, + 0x58f2116900000000, 0xe0c2147400000000, 0x451148bf00000000, + 0xeb63dc3900000000, 0x4eb080f200000000, 0x3605ac0700000000, + 0x93d6f0cc00000000, 0x3da4644a00000000, 0x9877388100000000, + 0x20473d9c00000000, 0x8594615700000000, 0x2be6f5d100000000, + 0x8e35a91a00000000, 0x5b87ffeb00000000, 0xfe54a32000000000, + 0x502637a600000000, 0xf5f56b6d00000000, 0x4dc56e7000000000, + 0xe81632bb00000000, 0x4664a63d00000000, 0xe3b7faf600000000, + 0xad077a0400000000, 0x08d426cf00000000, 0xa6a6b24900000000, + 0x0375ee8200000000, 0xbb45eb9f00000000, 0x1e96b75400000000, + 0xb0e423d200000000, 0x15377f1900000000, 0xc08529e800000000, + 0x6556752300000000, 0xcb24e1a500000000, 0x6ef7bd6e00000000, + 0xd6c7b87300000000, 0x7314e4b800000000, 0xdd66703e00000000, + 0x78b52cf500000000, 0x6c0a580f00000000, 0xc9d904c400000000, + 0x67ab904200000000, 0xc278cc8900000000, 0x7a48c99400000000, + 0xdf9b955f00000000, 0x71e901d900000000, 0xd43a5d1200000000, + 0x01880be300000000, 0xa45b572800000000, 0x0a29c3ae00000000, + 0xaffa9f6500000000, 0x17ca9a7800000000, 0xb219c6b300000000, + 0x1c6b523500000000, 0xb9b80efe00000000, 0xf7088e0c00000000, + 0x52dbd2c700000000, 0xfca9464100000000, 0x597a1a8a00000000, + 0xe14a1f9700000000, 0x4499435c00000000, 0xeaebd7da00000000, + 0x4f388b1100000000, 0x9a8adde000000000, 0x3f59812b00000000, + 0x912b15ad00000000, 0x34f8496600000000, 0x8cc84c7b00000000, + 0x291b10b000000000, 0x8769843600000000, 0x22bad8fd00000000, + 0x5a0ff40800000000, 0xffdca8c300000000, 0x51ae3c4500000000, + 0xf47d608e00000000, 0x4c4d659300000000, 0xe99e395800000000, + 0x47ecadde00000000, 0xe23ff11500000000, 0x378da7e400000000, + 0x925efb2f00000000, 0x3c2c6fa900000000, 0x99ff336200000000, + 0x21cf367f00000000, 0x841c6ab400000000, 0x2a6efe3200000000, + 0x8fbda2f900000000, 0xc10d220b00000000, 0x64de7ec000000000, + 0xcaacea4600000000, 0x6f7fb68d00000000, 0xd74fb39000000000, + 0x729cef5b00000000, 0xdcee7bdd00000000, 0x793d271600000000, + 0xac8f71e700000000, 0x095c2d2c00000000, 0xa72eb9aa00000000, + 0x02fde56100000000, 0xbacde07c00000000, 0x1f1ebcb700000000, + 0xb16c283100000000, 0x14bf74fa00000000, 0xd814b01e00000000, + 0x7dc7ecd500000000, 0xd3b5785300000000, 0x7666249800000000, + 0xce56218500000000, 0x6b857d4e00000000, 0xc5f7e9c800000000, + 0x6024b50300000000, 0xb596e3f200000000, 0x1045bf3900000000, + 0xbe372bbf00000000, 0x1be4777400000000, 0xa3d4726900000000, + 0x06072ea200000000, 0xa875ba2400000000, 0x0da6e6ef00000000, + 0x4316661d00000000, 0xe6c53ad600000000, 0x48b7ae5000000000, + 0xed64f29b00000000, 0x5554f78600000000, 0xf087ab4d00000000, + 0x5ef53fcb00000000, 0xfb26630000000000, 0x2e9435f100000000, + 0x8b47693a00000000, 0x2535fdbc00000000, 0x80e6a17700000000, + 0x38d6a46a00000000, 0x9d05f8a100000000, 0x33776c2700000000, + 0x96a430ec00000000, 0xee111c1900000000, 0x4bc240d200000000, + 0xe5b0d45400000000, 0x4063889f00000000, 0xf8538d8200000000, + 0x5d80d14900000000, 0xf3f245cf00000000, 0x5621190400000000, + 0x83934ff500000000, 0x2640133e00000000, 0x883287b800000000, + 0x2de1db7300000000, 0x95d1de6e00000000, 0x300282a500000000, + 0x9e70162300000000, 0x3ba34ae800000000, 0x7513ca1a00000000, + 0xd0c096d100000000, 0x7eb2025700000000, 0xdb615e9c00000000, + 0x63515b8100000000, 0xc682074a00000000, 0x68f093cc00000000, + 0xcd23cf0700000000, 0x189199f600000000, 0xbd42c53d00000000, + 0x133051bb00000000, 0xb6e30d7000000000, 0x0ed3086d00000000, + 0xab0054a600000000, 0x0572c02000000000, 0xa0a19ceb00000000, + 0xb41ee81100000000, 0x11cdb4da00000000, 0xbfbf205c00000000, + 0x1a6c7c9700000000, 0xa25c798a00000000, 0x078f254100000000, + 0xa9fdb1c700000000, 0x0c2eed0c00000000, 0xd99cbbfd00000000, + 0x7c4fe73600000000, 0xd23d73b000000000, 0x77ee2f7b00000000, + 0xcfde2a6600000000, 0x6a0d76ad00000000, 0xc47fe22b00000000, + 0x61acbee000000000, 0x2f1c3e1200000000, 0x8acf62d900000000, + 0x24bdf65f00000000, 0x816eaa9400000000, 0x395eaf8900000000, + 0x9c8df34200000000, 0x32ff67c400000000, 0x972c3b0f00000000, + 0x429e6dfe00000000, 0xe74d313500000000, 0x493fa5b300000000, + 0xececf97800000000, 0x54dcfc6500000000, 0xf10fa0ae00000000, + 0x5f7d342800000000, 0xfaae68e300000000, 0x821b441600000000, + 0x27c818dd00000000, 0x89ba8c5b00000000, 0x2c69d09000000000, + 0x9459d58d00000000, 0x318a894600000000, 0x9ff81dc000000000, + 0x3a2b410b00000000, 0xef9917fa00000000, 0x4a4a4b3100000000, + 0xe438dfb700000000, 0x41eb837c00000000, 0xf9db866100000000, + 0x5c08daaa00000000, 0xf27a4e2c00000000, 0x57a912e700000000, + 0x1919921500000000, 0xbccacede00000000, 0x12b85a5800000000, + 0xb76b069300000000, 0x0f5b038e00000000, 0xaa885f4500000000, + 0x04facbc300000000, 0xa129970800000000, 0x749bc1f900000000, + 0xd1489d3200000000, 0x7f3a09b400000000, 0xdae9557f00000000, + 0x62d9506200000000, 0xc70a0ca900000000, 0x6978982f00000000, + 0xccabc4e400000000}, + {0x0000000000000000, 0xb40b77a600000000, 0x29119f9700000000, + 0x9d1ae83100000000, 0x13244ff400000000, 0xa72f385200000000, + 0x3a35d06300000000, 0x8e3ea7c500000000, 0x674eef3300000000, + 0xd345989500000000, 0x4e5f70a400000000, 0xfa54070200000000, + 0x746aa0c700000000, 0xc061d76100000000, 0x5d7b3f5000000000, + 0xe97048f600000000, 0xce9cde6700000000, 0x7a97a9c100000000, + 0xe78d41f000000000, 0x5386365600000000, 0xddb8919300000000, + 0x69b3e63500000000, 0xf4a90e0400000000, 0x40a279a200000000, + 0xa9d2315400000000, 0x1dd946f200000000, 0x80c3aec300000000, + 0x34c8d96500000000, 0xbaf67ea000000000, 0x0efd090600000000, + 0x93e7e13700000000, 0x27ec969100000000, 0x9c39bdcf00000000, + 0x2832ca6900000000, 0xb528225800000000, 0x012355fe00000000, + 0x8f1df23b00000000, 0x3b16859d00000000, 0xa60c6dac00000000, + 0x12071a0a00000000, 0xfb7752fc00000000, 0x4f7c255a00000000, + 0xd266cd6b00000000, 0x666dbacd00000000, 0xe8531d0800000000, + 0x5c586aae00000000, 0xc142829f00000000, 0x7549f53900000000, + 0x52a563a800000000, 0xe6ae140e00000000, 0x7bb4fc3f00000000, + 0xcfbf8b9900000000, 0x41812c5c00000000, 0xf58a5bfa00000000, + 0x6890b3cb00000000, 0xdc9bc46d00000000, 0x35eb8c9b00000000, + 0x81e0fb3d00000000, 0x1cfa130c00000000, 0xa8f164aa00000000, + 0x26cfc36f00000000, 0x92c4b4c900000000, 0x0fde5cf800000000, + 0xbbd52b5e00000000, 0x79750b4400000000, 0xcd7e7ce200000000, + 0x506494d300000000, 0xe46fe37500000000, 0x6a5144b000000000, + 0xde5a331600000000, 0x4340db2700000000, 0xf74bac8100000000, + 0x1e3be47700000000, 0xaa3093d100000000, 0x372a7be000000000, + 0x83210c4600000000, 0x0d1fab8300000000, 0xb914dc2500000000, + 0x240e341400000000, 0x900543b200000000, 0xb7e9d52300000000, + 0x03e2a28500000000, 0x9ef84ab400000000, 0x2af33d1200000000, + 0xa4cd9ad700000000, 0x10c6ed7100000000, 0x8ddc054000000000, + 0x39d772e600000000, 0xd0a73a1000000000, 0x64ac4db600000000, + 0xf9b6a58700000000, 0x4dbdd22100000000, 0xc38375e400000000, + 0x7788024200000000, 0xea92ea7300000000, 0x5e999dd500000000, + 0xe54cb68b00000000, 0x5147c12d00000000, 0xcc5d291c00000000, + 0x78565eba00000000, 0xf668f97f00000000, 0x42638ed900000000, + 0xdf7966e800000000, 0x6b72114e00000000, 0x820259b800000000, + 0x36092e1e00000000, 0xab13c62f00000000, 0x1f18b18900000000, + 0x9126164c00000000, 0x252d61ea00000000, 0xb83789db00000000, + 0x0c3cfe7d00000000, 0x2bd068ec00000000, 0x9fdb1f4a00000000, + 0x02c1f77b00000000, 0xb6ca80dd00000000, 0x38f4271800000000, + 0x8cff50be00000000, 0x11e5b88f00000000, 0xa5eecf2900000000, + 0x4c9e87df00000000, 0xf895f07900000000, 0x658f184800000000, + 0xd1846fee00000000, 0x5fbac82b00000000, 0xebb1bf8d00000000, + 0x76ab57bc00000000, 0xc2a0201a00000000, 0xf2ea168800000000, + 0x46e1612e00000000, 0xdbfb891f00000000, 0x6ff0feb900000000, + 0xe1ce597c00000000, 0x55c52eda00000000, 0xc8dfc6eb00000000, + 0x7cd4b14d00000000, 0x95a4f9bb00000000, 0x21af8e1d00000000, + 0xbcb5662c00000000, 0x08be118a00000000, 0x8680b64f00000000, + 0x328bc1e900000000, 0xaf9129d800000000, 0x1b9a5e7e00000000, + 0x3c76c8ef00000000, 0x887dbf4900000000, 0x1567577800000000, + 0xa16c20de00000000, 0x2f52871b00000000, 0x9b59f0bd00000000, + 0x0643188c00000000, 0xb2486f2a00000000, 0x5b3827dc00000000, + 0xef33507a00000000, 0x7229b84b00000000, 0xc622cfed00000000, + 0x481c682800000000, 0xfc171f8e00000000, 0x610df7bf00000000, + 0xd506801900000000, 0x6ed3ab4700000000, 0xdad8dce100000000, + 0x47c234d000000000, 0xf3c9437600000000, 0x7df7e4b300000000, + 0xc9fc931500000000, 0x54e67b2400000000, 0xe0ed0c8200000000, + 0x099d447400000000, 0xbd9633d200000000, 0x208cdbe300000000, + 0x9487ac4500000000, 0x1ab90b8000000000, 0xaeb27c2600000000, + 0x33a8941700000000, 0x87a3e3b100000000, 0xa04f752000000000, + 0x1444028600000000, 0x895eeab700000000, 0x3d559d1100000000, + 0xb36b3ad400000000, 0x07604d7200000000, 0x9a7aa54300000000, + 0x2e71d2e500000000, 0xc7019a1300000000, 0x730aedb500000000, + 0xee10058400000000, 0x5a1b722200000000, 0xd425d5e700000000, + 0x602ea24100000000, 0xfd344a7000000000, 0x493f3dd600000000, + 0x8b9f1dcc00000000, 0x3f946a6a00000000, 0xa28e825b00000000, + 0x1685f5fd00000000, 0x98bb523800000000, 0x2cb0259e00000000, + 0xb1aacdaf00000000, 0x05a1ba0900000000, 0xecd1f2ff00000000, + 0x58da855900000000, 0xc5c06d6800000000, 0x71cb1ace00000000, + 0xfff5bd0b00000000, 0x4bfecaad00000000, 0xd6e4229c00000000, + 0x62ef553a00000000, 0x4503c3ab00000000, 0xf108b40d00000000, + 0x6c125c3c00000000, 0xd8192b9a00000000, 0x56278c5f00000000, + 0xe22cfbf900000000, 0x7f3613c800000000, 0xcb3d646e00000000, + 0x224d2c9800000000, 0x96465b3e00000000, 0x0b5cb30f00000000, + 0xbf57c4a900000000, 0x3169636c00000000, 0x856214ca00000000, + 0x1878fcfb00000000, 0xac738b5d00000000, 0x17a6a00300000000, + 0xa3add7a500000000, 0x3eb73f9400000000, 0x8abc483200000000, + 0x0482eff700000000, 0xb089985100000000, 0x2d93706000000000, + 0x999807c600000000, 0x70e84f3000000000, 0xc4e3389600000000, + 0x59f9d0a700000000, 0xedf2a70100000000, 0x63cc00c400000000, + 0xd7c7776200000000, 0x4add9f5300000000, 0xfed6e8f500000000, + 0xd93a7e6400000000, 0x6d3109c200000000, 0xf02be1f300000000, + 0x4420965500000000, 0xca1e319000000000, 0x7e15463600000000, + 0xe30fae0700000000, 0x5704d9a100000000, 0xbe74915700000000, + 0x0a7fe6f100000000, 0x97650ec000000000, 0x236e796600000000, + 0xad50dea300000000, 0x195ba90500000000, 0x8441413400000000, + 0x304a369200000000}, + {0x0000000000000000, 0x9e00aacc00000000, 0x7d07254200000000, + 0xe3078f8e00000000, 0xfa0e4a8400000000, 0x640ee04800000000, + 0x87096fc600000000, 0x1909c50a00000000, 0xb51be5d300000000, + 0x2b1b4f1f00000000, 0xc81cc09100000000, 0x561c6a5d00000000, + 0x4f15af5700000000, 0xd115059b00000000, 0x32128a1500000000, + 0xac1220d900000000, 0x2b31bb7c00000000, 0xb53111b000000000, + 0x56369e3e00000000, 0xc83634f200000000, 0xd13ff1f800000000, + 0x4f3f5b3400000000, 0xac38d4ba00000000, 0x32387e7600000000, + 0x9e2a5eaf00000000, 0x002af46300000000, 0xe32d7bed00000000, + 0x7d2dd12100000000, 0x6424142b00000000, 0xfa24bee700000000, + 0x1923316900000000, 0x87239ba500000000, 0x566276f900000000, + 0xc862dc3500000000, 0x2b6553bb00000000, 0xb565f97700000000, + 0xac6c3c7d00000000, 0x326c96b100000000, 0xd16b193f00000000, + 0x4f6bb3f300000000, 0xe379932a00000000, 0x7d7939e600000000, + 0x9e7eb66800000000, 0x007e1ca400000000, 0x1977d9ae00000000, + 0x8777736200000000, 0x6470fcec00000000, 0xfa70562000000000, + 0x7d53cd8500000000, 0xe353674900000000, 0x0054e8c700000000, + 0x9e54420b00000000, 0x875d870100000000, 0x195d2dcd00000000, + 0xfa5aa24300000000, 0x645a088f00000000, 0xc848285600000000, + 0x5648829a00000000, 0xb54f0d1400000000, 0x2b4fa7d800000000, + 0x324662d200000000, 0xac46c81e00000000, 0x4f41479000000000, + 0xd141ed5c00000000, 0xedc29d2900000000, 0x73c237e500000000, + 0x90c5b86b00000000, 0x0ec512a700000000, 0x17ccd7ad00000000, + 0x89cc7d6100000000, 0x6acbf2ef00000000, 0xf4cb582300000000, + 0x58d978fa00000000, 0xc6d9d23600000000, 0x25de5db800000000, + 0xbbdef77400000000, 0xa2d7327e00000000, 0x3cd798b200000000, + 0xdfd0173c00000000, 0x41d0bdf000000000, 0xc6f3265500000000, + 0x58f38c9900000000, 0xbbf4031700000000, 0x25f4a9db00000000, + 0x3cfd6cd100000000, 0xa2fdc61d00000000, 0x41fa499300000000, + 0xdffae35f00000000, 0x73e8c38600000000, 0xede8694a00000000, + 0x0eefe6c400000000, 0x90ef4c0800000000, 0x89e6890200000000, + 0x17e623ce00000000, 0xf4e1ac4000000000, 0x6ae1068c00000000, + 0xbba0ebd000000000, 0x25a0411c00000000, 0xc6a7ce9200000000, + 0x58a7645e00000000, 0x41aea15400000000, 0xdfae0b9800000000, + 0x3ca9841600000000, 0xa2a92eda00000000, 0x0ebb0e0300000000, + 0x90bba4cf00000000, 0x73bc2b4100000000, 0xedbc818d00000000, + 0xf4b5448700000000, 0x6ab5ee4b00000000, 0x89b261c500000000, + 0x17b2cb0900000000, 0x909150ac00000000, 0x0e91fa6000000000, + 0xed9675ee00000000, 0x7396df2200000000, 0x6a9f1a2800000000, + 0xf49fb0e400000000, 0x17983f6a00000000, 0x899895a600000000, + 0x258ab57f00000000, 0xbb8a1fb300000000, 0x588d903d00000000, + 0xc68d3af100000000, 0xdf84fffb00000000, 0x4184553700000000, + 0xa283dab900000000, 0x3c83707500000000, 0xda853b5300000000, + 0x4485919f00000000, 0xa7821e1100000000, 0x3982b4dd00000000, + 0x208b71d700000000, 0xbe8bdb1b00000000, 0x5d8c549500000000, + 0xc38cfe5900000000, 0x6f9ede8000000000, 0xf19e744c00000000, + 0x1299fbc200000000, 0x8c99510e00000000, 0x9590940400000000, + 0x0b903ec800000000, 0xe897b14600000000, 0x76971b8a00000000, + 0xf1b4802f00000000, 0x6fb42ae300000000, 0x8cb3a56d00000000, + 0x12b30fa100000000, 0x0bbacaab00000000, 0x95ba606700000000, + 0x76bdefe900000000, 0xe8bd452500000000, 0x44af65fc00000000, + 0xdaafcf3000000000, 0x39a840be00000000, 0xa7a8ea7200000000, + 0xbea12f7800000000, 0x20a185b400000000, 0xc3a60a3a00000000, + 0x5da6a0f600000000, 0x8ce74daa00000000, 0x12e7e76600000000, + 0xf1e068e800000000, 0x6fe0c22400000000, 0x76e9072e00000000, + 0xe8e9ade200000000, 0x0bee226c00000000, 0x95ee88a000000000, + 0x39fca87900000000, 0xa7fc02b500000000, 0x44fb8d3b00000000, + 0xdafb27f700000000, 0xc3f2e2fd00000000, 0x5df2483100000000, + 0xbef5c7bf00000000, 0x20f56d7300000000, 0xa7d6f6d600000000, + 0x39d65c1a00000000, 0xdad1d39400000000, 0x44d1795800000000, + 0x5dd8bc5200000000, 0xc3d8169e00000000, 0x20df991000000000, + 0xbedf33dc00000000, 0x12cd130500000000, 0x8ccdb9c900000000, + 0x6fca364700000000, 0xf1ca9c8b00000000, 0xe8c3598100000000, + 0x76c3f34d00000000, 0x95c47cc300000000, 0x0bc4d60f00000000, + 0x3747a67a00000000, 0xa9470cb600000000, 0x4a40833800000000, + 0xd44029f400000000, 0xcd49ecfe00000000, 0x5349463200000000, + 0xb04ec9bc00000000, 0x2e4e637000000000, 0x825c43a900000000, + 0x1c5ce96500000000, 0xff5b66eb00000000, 0x615bcc2700000000, + 0x7852092d00000000, 0xe652a3e100000000, 0x05552c6f00000000, + 0x9b5586a300000000, 0x1c761d0600000000, 0x8276b7ca00000000, + 0x6171384400000000, 0xff71928800000000, 0xe678578200000000, + 0x7878fd4e00000000, 0x9b7f72c000000000, 0x057fd80c00000000, + 0xa96df8d500000000, 0x376d521900000000, 0xd46add9700000000, + 0x4a6a775b00000000, 0x5363b25100000000, 0xcd63189d00000000, + 0x2e64971300000000, 0xb0643ddf00000000, 0x6125d08300000000, + 0xff257a4f00000000, 0x1c22f5c100000000, 0x82225f0d00000000, + 0x9b2b9a0700000000, 0x052b30cb00000000, 0xe62cbf4500000000, + 0x782c158900000000, 0xd43e355000000000, 0x4a3e9f9c00000000, + 0xa939101200000000, 0x3739bade00000000, 0x2e307fd400000000, + 0xb030d51800000000, 0x53375a9600000000, 0xcd37f05a00000000, + 0x4a146bff00000000, 0xd414c13300000000, 0x37134ebd00000000, + 0xa913e47100000000, 0xb01a217b00000000, 0x2e1a8bb700000000, + 0xcd1d043900000000, 0x531daef500000000, 0xff0f8e2c00000000, + 0x610f24e000000000, 0x8208ab6e00000000, 0x1c0801a200000000, + 0x0501c4a800000000, 0x9b016e6400000000, 0x7806e1ea00000000, + 0xe6064b2600000000}}; + +#else /* W == 4 */ + +local const z_crc_t FAR crc_braid_table[][256] = { + {0x00000000, 0xb8bc6765, 0xaa09c88b, 0x12b5afee, 0x8f629757, + 0x37def032, 0x256b5fdc, 0x9dd738b9, 0xc5b428ef, 0x7d084f8a, + 0x6fbde064, 0xd7018701, 0x4ad6bfb8, 0xf26ad8dd, 0xe0df7733, + 0x58631056, 0x5019579f, 0xe8a530fa, 0xfa109f14, 0x42acf871, + 0xdf7bc0c8, 0x67c7a7ad, 0x75720843, 0xcdce6f26, 0x95ad7f70, + 0x2d111815, 0x3fa4b7fb, 0x8718d09e, 0x1acfe827, 0xa2738f42, + 0xb0c620ac, 0x087a47c9, 0xa032af3e, 0x188ec85b, 0x0a3b67b5, + 0xb28700d0, 0x2f503869, 0x97ec5f0c, 0x8559f0e2, 0x3de59787, + 0x658687d1, 0xdd3ae0b4, 0xcf8f4f5a, 0x7733283f, 0xeae41086, + 0x525877e3, 0x40edd80d, 0xf851bf68, 0xf02bf8a1, 0x48979fc4, + 0x5a22302a, 0xe29e574f, 0x7f496ff6, 0xc7f50893, 0xd540a77d, + 0x6dfcc018, 0x359fd04e, 0x8d23b72b, 0x9f9618c5, 0x272a7fa0, + 0xbafd4719, 0x0241207c, 0x10f48f92, 0xa848e8f7, 0x9b14583d, + 0x23a83f58, 0x311d90b6, 0x89a1f7d3, 0x1476cf6a, 0xaccaa80f, + 0xbe7f07e1, 0x06c36084, 0x5ea070d2, 0xe61c17b7, 0xf4a9b859, + 0x4c15df3c, 0xd1c2e785, 0x697e80e0, 0x7bcb2f0e, 0xc377486b, + 0xcb0d0fa2, 0x73b168c7, 0x6104c729, 0xd9b8a04c, 0x446f98f5, + 0xfcd3ff90, 0xee66507e, 0x56da371b, 0x0eb9274d, 0xb6054028, + 0xa4b0efc6, 0x1c0c88a3, 0x81dbb01a, 0x3967d77f, 0x2bd27891, + 0x936e1ff4, 0x3b26f703, 0x839a9066, 0x912f3f88, 0x299358ed, + 0xb4446054, 0x0cf80731, 0x1e4da8df, 0xa6f1cfba, 0xfe92dfec, + 0x462eb889, 0x549b1767, 0xec277002, 0x71f048bb, 0xc94c2fde, + 0xdbf98030, 0x6345e755, 0x6b3fa09c, 0xd383c7f9, 0xc1366817, + 0x798a0f72, 0xe45d37cb, 0x5ce150ae, 0x4e54ff40, 0xf6e89825, + 0xae8b8873, 0x1637ef16, 0x048240f8, 0xbc3e279d, 0x21e91f24, + 0x99557841, 0x8be0d7af, 0x335cb0ca, 0xed59b63b, 0x55e5d15e, + 0x47507eb0, 0xffec19d5, 0x623b216c, 0xda874609, 0xc832e9e7, + 0x708e8e82, 0x28ed9ed4, 0x9051f9b1, 0x82e4565f, 0x3a58313a, + 0xa78f0983, 0x1f336ee6, 0x0d86c108, 0xb53aa66d, 0xbd40e1a4, + 0x05fc86c1, 0x1749292f, 0xaff54e4a, 0x322276f3, 0x8a9e1196, + 0x982bbe78, 0x2097d91d, 0x78f4c94b, 0xc048ae2e, 0xd2fd01c0, + 0x6a4166a5, 0xf7965e1c, 0x4f2a3979, 0x5d9f9697, 0xe523f1f2, + 0x4d6b1905, 0xf5d77e60, 0xe762d18e, 0x5fdeb6eb, 0xc2098e52, + 0x7ab5e937, 0x680046d9, 0xd0bc21bc, 0x88df31ea, 0x3063568f, + 0x22d6f961, 0x9a6a9e04, 0x07bda6bd, 0xbf01c1d8, 0xadb46e36, + 0x15080953, 0x1d724e9a, 0xa5ce29ff, 0xb77b8611, 0x0fc7e174, + 0x9210d9cd, 0x2aacbea8, 0x38191146, 0x80a57623, 0xd8c66675, + 0x607a0110, 0x72cfaefe, 0xca73c99b, 0x57a4f122, 0xef189647, + 0xfdad39a9, 0x45115ecc, 0x764dee06, 0xcef18963, 0xdc44268d, + 0x64f841e8, 0xf92f7951, 0x41931e34, 0x5326b1da, 0xeb9ad6bf, + 0xb3f9c6e9, 0x0b45a18c, 0x19f00e62, 0xa14c6907, 0x3c9b51be, + 0x842736db, 0x96929935, 0x2e2efe50, 0x2654b999, 0x9ee8defc, + 0x8c5d7112, 0x34e11677, 0xa9362ece, 0x118a49ab, 0x033fe645, + 0xbb838120, 0xe3e09176, 0x5b5cf613, 0x49e959fd, 0xf1553e98, + 0x6c820621, 0xd43e6144, 0xc68bceaa, 0x7e37a9cf, 0xd67f4138, + 0x6ec3265d, 0x7c7689b3, 0xc4caeed6, 0x591dd66f, 0xe1a1b10a, + 0xf3141ee4, 0x4ba87981, 0x13cb69d7, 0xab770eb2, 0xb9c2a15c, + 0x017ec639, 0x9ca9fe80, 0x241599e5, 0x36a0360b, 0x8e1c516e, + 0x866616a7, 0x3eda71c2, 0x2c6fde2c, 0x94d3b949, 0x090481f0, + 0xb1b8e695, 0xa30d497b, 0x1bb12e1e, 0x43d23e48, 0xfb6e592d, + 0xe9dbf6c3, 0x516791a6, 0xccb0a91f, 0x740cce7a, 0x66b96194, + 0xde0506f1}, + {0x00000000, 0x01c26a37, 0x0384d46e, 0x0246be59, 0x0709a8dc, + 0x06cbc2eb, 0x048d7cb2, 0x054f1685, 0x0e1351b8, 0x0fd13b8f, + 0x0d9785d6, 0x0c55efe1, 0x091af964, 0x08d89353, 0x0a9e2d0a, + 0x0b5c473d, 0x1c26a370, 0x1de4c947, 0x1fa2771e, 0x1e601d29, + 0x1b2f0bac, 0x1aed619b, 0x18abdfc2, 0x1969b5f5, 0x1235f2c8, + 0x13f798ff, 0x11b126a6, 0x10734c91, 0x153c5a14, 0x14fe3023, + 0x16b88e7a, 0x177ae44d, 0x384d46e0, 0x398f2cd7, 0x3bc9928e, + 0x3a0bf8b9, 0x3f44ee3c, 0x3e86840b, 0x3cc03a52, 0x3d025065, + 0x365e1758, 0x379c7d6f, 0x35dac336, 0x3418a901, 0x3157bf84, + 0x3095d5b3, 0x32d36bea, 0x331101dd, 0x246be590, 0x25a98fa7, + 0x27ef31fe, 0x262d5bc9, 0x23624d4c, 0x22a0277b, 0x20e69922, + 0x2124f315, 0x2a78b428, 0x2bbade1f, 0x29fc6046, 0x283e0a71, + 0x2d711cf4, 0x2cb376c3, 0x2ef5c89a, 0x2f37a2ad, 0x709a8dc0, + 0x7158e7f7, 0x731e59ae, 0x72dc3399, 0x7793251c, 0x76514f2b, + 0x7417f172, 0x75d59b45, 0x7e89dc78, 0x7f4bb64f, 0x7d0d0816, + 0x7ccf6221, 0x798074a4, 0x78421e93, 0x7a04a0ca, 0x7bc6cafd, + 0x6cbc2eb0, 0x6d7e4487, 0x6f38fade, 0x6efa90e9, 0x6bb5866c, + 0x6a77ec5b, 0x68315202, 0x69f33835, 0x62af7f08, 0x636d153f, + 0x612bab66, 0x60e9c151, 0x65a6d7d4, 0x6464bde3, 0x662203ba, + 0x67e0698d, 0x48d7cb20, 0x4915a117, 0x4b531f4e, 0x4a917579, + 0x4fde63fc, 0x4e1c09cb, 0x4c5ab792, 0x4d98dda5, 0x46c49a98, + 0x4706f0af, 0x45404ef6, 0x448224c1, 0x41cd3244, 0x400f5873, + 0x4249e62a, 0x438b8c1d, 0x54f16850, 0x55330267, 0x5775bc3e, + 0x56b7d609, 0x53f8c08c, 0x523aaabb, 0x507c14e2, 0x51be7ed5, + 0x5ae239e8, 0x5b2053df, 0x5966ed86, 0x58a487b1, 0x5deb9134, + 0x5c29fb03, 0x5e6f455a, 0x5fad2f6d, 0xe1351b80, 0xe0f771b7, + 0xe2b1cfee, 0xe373a5d9, 0xe63cb35c, 0xe7fed96b, 0xe5b86732, + 0xe47a0d05, 0xef264a38, 0xeee4200f, 0xeca29e56, 0xed60f461, + 0xe82fe2e4, 0xe9ed88d3, 0xebab368a, 0xea695cbd, 0xfd13b8f0, + 0xfcd1d2c7, 0xfe976c9e, 0xff5506a9, 0xfa1a102c, 0xfbd87a1b, + 0xf99ec442, 0xf85cae75, 0xf300e948, 0xf2c2837f, 0xf0843d26, + 0xf1465711, 0xf4094194, 0xf5cb2ba3, 0xf78d95fa, 0xf64fffcd, + 0xd9785d60, 0xd8ba3757, 0xdafc890e, 0xdb3ee339, 0xde71f5bc, + 0xdfb39f8b, 0xddf521d2, 0xdc374be5, 0xd76b0cd8, 0xd6a966ef, + 0xd4efd8b6, 0xd52db281, 0xd062a404, 0xd1a0ce33, 0xd3e6706a, + 0xd2241a5d, 0xc55efe10, 0xc49c9427, 0xc6da2a7e, 0xc7184049, + 0xc25756cc, 0xc3953cfb, 0xc1d382a2, 0xc011e895, 0xcb4dafa8, + 0xca8fc59f, 0xc8c97bc6, 0xc90b11f1, 0xcc440774, 0xcd866d43, + 0xcfc0d31a, 0xce02b92d, 0x91af9640, 0x906dfc77, 0x922b422e, + 0x93e92819, 0x96a63e9c, 0x976454ab, 0x9522eaf2, 0x94e080c5, + 0x9fbcc7f8, 0x9e7eadcf, 0x9c381396, 0x9dfa79a1, 0x98b56f24, + 0x99770513, 0x9b31bb4a, 0x9af3d17d, 0x8d893530, 0x8c4b5f07, + 0x8e0de15e, 0x8fcf8b69, 0x8a809dec, 0x8b42f7db, 0x89044982, + 0x88c623b5, 0x839a6488, 0x82580ebf, 0x801eb0e6, 0x81dcdad1, + 0x8493cc54, 0x8551a663, 0x8717183a, 0x86d5720d, 0xa9e2d0a0, + 0xa820ba97, 0xaa6604ce, 0xaba46ef9, 0xaeeb787c, 0xaf29124b, + 0xad6fac12, 0xacadc625, 0xa7f18118, 0xa633eb2f, 0xa4755576, + 0xa5b73f41, 0xa0f829c4, 0xa13a43f3, 0xa37cfdaa, 0xa2be979d, + 0xb5c473d0, 0xb40619e7, 0xb640a7be, 0xb782cd89, 0xb2cddb0c, + 0xb30fb13b, 0xb1490f62, 0xb08b6555, 0xbbd72268, 0xba15485f, + 0xb853f606, 0xb9919c31, 0xbcde8ab4, 0xbd1ce083, 0xbf5a5eda, + 0xbe9834ed}, + {0x00000000, 0x191b3141, 0x32366282, 0x2b2d53c3, 0x646cc504, + 0x7d77f445, 0x565aa786, 0x4f4196c7, 0xc8d98a08, 0xd1c2bb49, + 0xfaefe88a, 0xe3f4d9cb, 0xacb54f0c, 0xb5ae7e4d, 0x9e832d8e, + 0x87981ccf, 0x4ac21251, 0x53d92310, 0x78f470d3, 0x61ef4192, + 0x2eaed755, 0x37b5e614, 0x1c98b5d7, 0x05838496, 0x821b9859, + 0x9b00a918, 0xb02dfadb, 0xa936cb9a, 0xe6775d5d, 0xff6c6c1c, + 0xd4413fdf, 0xcd5a0e9e, 0x958424a2, 0x8c9f15e3, 0xa7b24620, + 0xbea97761, 0xf1e8e1a6, 0xe8f3d0e7, 0xc3de8324, 0xdac5b265, + 0x5d5daeaa, 0x44469feb, 0x6f6bcc28, 0x7670fd69, 0x39316bae, + 0x202a5aef, 0x0b07092c, 0x121c386d, 0xdf4636f3, 0xc65d07b2, + 0xed705471, 0xf46b6530, 0xbb2af3f7, 0xa231c2b6, 0x891c9175, + 0x9007a034, 0x179fbcfb, 0x0e848dba, 0x25a9de79, 0x3cb2ef38, + 0x73f379ff, 0x6ae848be, 0x41c51b7d, 0x58de2a3c, 0xf0794f05, + 0xe9627e44, 0xc24f2d87, 0xdb541cc6, 0x94158a01, 0x8d0ebb40, + 0xa623e883, 0xbf38d9c2, 0x38a0c50d, 0x21bbf44c, 0x0a96a78f, + 0x138d96ce, 0x5ccc0009, 0x45d73148, 0x6efa628b, 0x77e153ca, + 0xbabb5d54, 0xa3a06c15, 0x888d3fd6, 0x91960e97, 0xded79850, + 0xc7cca911, 0xece1fad2, 0xf5facb93, 0x7262d75c, 0x6b79e61d, + 0x4054b5de, 0x594f849f, 0x160e1258, 0x0f152319, 0x243870da, + 0x3d23419b, 0x65fd6ba7, 0x7ce65ae6, 0x57cb0925, 0x4ed03864, + 0x0191aea3, 0x188a9fe2, 0x33a7cc21, 0x2abcfd60, 0xad24e1af, + 0xb43fd0ee, 0x9f12832d, 0x8609b26c, 0xc94824ab, 0xd05315ea, + 0xfb7e4629, 0xe2657768, 0x2f3f79f6, 0x362448b7, 0x1d091b74, + 0x04122a35, 0x4b53bcf2, 0x52488db3, 0x7965de70, 0x607eef31, + 0xe7e6f3fe, 0xfefdc2bf, 0xd5d0917c, 0xcccba03d, 0x838a36fa, + 0x9a9107bb, 0xb1bc5478, 0xa8a76539, 0x3b83984b, 0x2298a90a, + 0x09b5fac9, 0x10aecb88, 0x5fef5d4f, 0x46f46c0e, 0x6dd93fcd, + 0x74c20e8c, 0xf35a1243, 0xea412302, 0xc16c70c1, 0xd8774180, + 0x9736d747, 0x8e2de606, 0xa500b5c5, 0xbc1b8484, 0x71418a1a, + 0x685abb5b, 0x4377e898, 0x5a6cd9d9, 0x152d4f1e, 0x0c367e5f, + 0x271b2d9c, 0x3e001cdd, 0xb9980012, 0xa0833153, 0x8bae6290, + 0x92b553d1, 0xddf4c516, 0xc4eff457, 0xefc2a794, 0xf6d996d5, + 0xae07bce9, 0xb71c8da8, 0x9c31de6b, 0x852aef2a, 0xca6b79ed, + 0xd37048ac, 0xf85d1b6f, 0xe1462a2e, 0x66de36e1, 0x7fc507a0, + 0x54e85463, 0x4df36522, 0x02b2f3e5, 0x1ba9c2a4, 0x30849167, + 0x299fa026, 0xe4c5aeb8, 0xfdde9ff9, 0xd6f3cc3a, 0xcfe8fd7b, + 0x80a96bbc, 0x99b25afd, 0xb29f093e, 0xab84387f, 0x2c1c24b0, + 0x350715f1, 0x1e2a4632, 0x07317773, 0x4870e1b4, 0x516bd0f5, + 0x7a468336, 0x635db277, 0xcbfad74e, 0xd2e1e60f, 0xf9ccb5cc, + 0xe0d7848d, 0xaf96124a, 0xb68d230b, 0x9da070c8, 0x84bb4189, + 0x03235d46, 0x1a386c07, 0x31153fc4, 0x280e0e85, 0x674f9842, + 0x7e54a903, 0x5579fac0, 0x4c62cb81, 0x8138c51f, 0x9823f45e, + 0xb30ea79d, 0xaa1596dc, 0xe554001b, 0xfc4f315a, 0xd7626299, + 0xce7953d8, 0x49e14f17, 0x50fa7e56, 0x7bd72d95, 0x62cc1cd4, + 0x2d8d8a13, 0x3496bb52, 0x1fbbe891, 0x06a0d9d0, 0x5e7ef3ec, + 0x4765c2ad, 0x6c48916e, 0x7553a02f, 0x3a1236e8, 0x230907a9, + 0x0824546a, 0x113f652b, 0x96a779e4, 0x8fbc48a5, 0xa4911b66, + 0xbd8a2a27, 0xf2cbbce0, 0xebd08da1, 0xc0fdde62, 0xd9e6ef23, + 0x14bce1bd, 0x0da7d0fc, 0x268a833f, 0x3f91b27e, 0x70d024b9, + 0x69cb15f8, 0x42e6463b, 0x5bfd777a, 0xdc656bb5, 0xc57e5af4, + 0xee530937, 0xf7483876, 0xb809aeb1, 0xa1129ff0, 0x8a3fcc33, + 0x9324fd72}, + {0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, + 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, + 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, + 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, + 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856, + 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, + 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, + 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, + 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a, + 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, + 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, + 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, + 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, + 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e, + 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, + 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, + 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, + 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, + 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, + 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, + 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010, + 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, + 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, + 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, + 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, + 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344, + 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, + 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, + 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, + 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c, + 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, + 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, + 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, + 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, + 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c, + 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, + 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, + 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, + 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, + 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278, + 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, + 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66, + 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, + 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, + 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, + 0x2d02ef8d}}; + +local const z_word_t FAR crc_braid_big_table[][256] = { + {0x00000000, 0x96300777, 0x2c610eee, 0xba510999, 0x19c46d07, + 0x8ff46a70, 0x35a563e9, 0xa395649e, 0x3288db0e, 0xa4b8dc79, + 0x1ee9d5e0, 0x88d9d297, 0x2b4cb609, 0xbd7cb17e, 0x072db8e7, + 0x911dbf90, 0x6410b71d, 0xf220b06a, 0x4871b9f3, 0xde41be84, + 0x7dd4da1a, 0xebe4dd6d, 0x51b5d4f4, 0xc785d383, 0x56986c13, + 0xc0a86b64, 0x7af962fd, 0xecc9658a, 0x4f5c0114, 0xd96c0663, + 0x633d0ffa, 0xf50d088d, 0xc8206e3b, 0x5e10694c, 0xe44160d5, + 0x727167a2, 0xd1e4033c, 0x47d4044b, 0xfd850dd2, 0x6bb50aa5, + 0xfaa8b535, 0x6c98b242, 0xd6c9bbdb, 0x40f9bcac, 0xe36cd832, + 0x755cdf45, 0xcf0dd6dc, 0x593dd1ab, 0xac30d926, 0x3a00de51, + 0x8051d7c8, 0x1661d0bf, 0xb5f4b421, 0x23c4b356, 0x9995bacf, + 0x0fa5bdb8, 0x9eb80228, 0x0888055f, 0xb2d90cc6, 0x24e90bb1, + 0x877c6f2f, 0x114c6858, 0xab1d61c1, 0x3d2d66b6, 0x9041dc76, + 0x0671db01, 0xbc20d298, 0x2a10d5ef, 0x8985b171, 0x1fb5b606, + 0xa5e4bf9f, 0x33d4b8e8, 0xa2c90778, 0x34f9000f, 0x8ea80996, + 0x18980ee1, 0xbb0d6a7f, 0x2d3d6d08, 0x976c6491, 0x015c63e6, + 0xf4516b6b, 0x62616c1c, 0xd8306585, 0x4e0062f2, 0xed95066c, + 0x7ba5011b, 0xc1f40882, 0x57c40ff5, 0xc6d9b065, 0x50e9b712, + 0xeab8be8b, 0x7c88b9fc, 0xdf1ddd62, 0x492dda15, 0xf37cd38c, + 0x654cd4fb, 0x5861b24d, 0xce51b53a, 0x7400bca3, 0xe230bbd4, + 0x41a5df4a, 0xd795d83d, 0x6dc4d1a4, 0xfbf4d6d3, 0x6ae96943, + 0xfcd96e34, 0x468867ad, 0xd0b860da, 0x732d0444, 0xe51d0333, + 0x5f4c0aaa, 0xc97c0ddd, 0x3c710550, 0xaa410227, 0x10100bbe, + 0x86200cc9, 0x25b56857, 0xb3856f20, 0x09d466b9, 0x9fe461ce, + 0x0ef9de5e, 0x98c9d929, 0x2298d0b0, 0xb4a8d7c7, 0x173db359, + 0x810db42e, 0x3b5cbdb7, 0xad6cbac0, 0x2083b8ed, 0xb6b3bf9a, + 0x0ce2b603, 0x9ad2b174, 0x3947d5ea, 0xaf77d29d, 0x1526db04, + 0x8316dc73, 0x120b63e3, 0x843b6494, 0x3e6a6d0d, 0xa85a6a7a, + 0x0bcf0ee4, 0x9dff0993, 0x27ae000a, 0xb19e077d, 0x44930ff0, + 0xd2a30887, 0x68f2011e, 0xfec20669, 0x5d5762f7, 0xcb676580, + 0x71366c19, 0xe7066b6e, 0x761bd4fe, 0xe02bd389, 0x5a7ada10, + 0xcc4add67, 0x6fdfb9f9, 0xf9efbe8e, 0x43beb717, 0xd58eb060, + 0xe8a3d6d6, 0x7e93d1a1, 0xc4c2d838, 0x52f2df4f, 0xf167bbd1, + 0x6757bca6, 0xdd06b53f, 0x4b36b248, 0xda2b0dd8, 0x4c1b0aaf, + 0xf64a0336, 0x607a0441, 0xc3ef60df, 0x55df67a8, 0xef8e6e31, + 0x79be6946, 0x8cb361cb, 0x1a8366bc, 0xa0d26f25, 0x36e26852, + 0x95770ccc, 0x03470bbb, 0xb9160222, 0x2f260555, 0xbe3bbac5, + 0x280bbdb2, 0x925ab42b, 0x046ab35c, 0xa7ffd7c2, 0x31cfd0b5, + 0x8b9ed92c, 0x1daede5b, 0xb0c2649b, 0x26f263ec, 0x9ca36a75, + 0x0a936d02, 0xa906099c, 0x3f360eeb, 0x85670772, 0x13570005, + 0x824abf95, 0x147ab8e2, 0xae2bb17b, 0x381bb60c, 0x9b8ed292, + 0x0dbed5e5, 0xb7efdc7c, 0x21dfdb0b, 0xd4d2d386, 0x42e2d4f1, + 0xf8b3dd68, 0x6e83da1f, 0xcd16be81, 0x5b26b9f6, 0xe177b06f, + 0x7747b718, 0xe65a0888, 0x706a0fff, 0xca3b0666, 0x5c0b0111, + 0xff9e658f, 0x69ae62f8, 0xd3ff6b61, 0x45cf6c16, 0x78e20aa0, + 0xeed20dd7, 0x5483044e, 0xc2b30339, 0x612667a7, 0xf71660d0, + 0x4d476949, 0xdb776e3e, 0x4a6ad1ae, 0xdc5ad6d9, 0x660bdf40, + 0xf03bd837, 0x53aebca9, 0xc59ebbde, 0x7fcfb247, 0xe9ffb530, + 0x1cf2bdbd, 0x8ac2baca, 0x3093b353, 0xa6a3b424, 0x0536d0ba, + 0x9306d7cd, 0x2957de54, 0xbf67d923, 0x2e7a66b3, 0xb84a61c4, + 0x021b685d, 0x942b6f2a, 0x37be0bb4, 0xa18e0cc3, 0x1bdf055a, + 0x8def022d}, + {0x00000000, 0x41311b19, 0x82623632, 0xc3532d2b, 0x04c56c64, + 0x45f4777d, 0x86a75a56, 0xc796414f, 0x088ad9c8, 0x49bbc2d1, + 0x8ae8effa, 0xcbd9f4e3, 0x0c4fb5ac, 0x4d7eaeb5, 0x8e2d839e, + 0xcf1c9887, 0x5112c24a, 0x1023d953, 0xd370f478, 0x9241ef61, + 0x55d7ae2e, 0x14e6b537, 0xd7b5981c, 0x96848305, 0x59981b82, + 0x18a9009b, 0xdbfa2db0, 0x9acb36a9, 0x5d5d77e6, 0x1c6c6cff, + 0xdf3f41d4, 0x9e0e5acd, 0xa2248495, 0xe3159f8c, 0x2046b2a7, + 0x6177a9be, 0xa6e1e8f1, 0xe7d0f3e8, 0x2483dec3, 0x65b2c5da, + 0xaaae5d5d, 0xeb9f4644, 0x28cc6b6f, 0x69fd7076, 0xae6b3139, + 0xef5a2a20, 0x2c09070b, 0x6d381c12, 0xf33646df, 0xb2075dc6, + 0x715470ed, 0x30656bf4, 0xf7f32abb, 0xb6c231a2, 0x75911c89, + 0x34a00790, 0xfbbc9f17, 0xba8d840e, 0x79dea925, 0x38efb23c, + 0xff79f373, 0xbe48e86a, 0x7d1bc541, 0x3c2ade58, 0x054f79f0, + 0x447e62e9, 0x872d4fc2, 0xc61c54db, 0x018a1594, 0x40bb0e8d, + 0x83e823a6, 0xc2d938bf, 0x0dc5a038, 0x4cf4bb21, 0x8fa7960a, + 0xce968d13, 0x0900cc5c, 0x4831d745, 0x8b62fa6e, 0xca53e177, + 0x545dbbba, 0x156ca0a3, 0xd63f8d88, 0x970e9691, 0x5098d7de, + 0x11a9ccc7, 0xd2fae1ec, 0x93cbfaf5, 0x5cd76272, 0x1de6796b, + 0xdeb55440, 0x9f844f59, 0x58120e16, 0x1923150f, 0xda703824, + 0x9b41233d, 0xa76bfd65, 0xe65ae67c, 0x2509cb57, 0x6438d04e, + 0xa3ae9101, 0xe29f8a18, 0x21cca733, 0x60fdbc2a, 0xafe124ad, + 0xeed03fb4, 0x2d83129f, 0x6cb20986, 0xab2448c9, 0xea1553d0, + 0x29467efb, 0x687765e2, 0xf6793f2f, 0xb7482436, 0x741b091d, + 0x352a1204, 0xf2bc534b, 0xb38d4852, 0x70de6579, 0x31ef7e60, + 0xfef3e6e7, 0xbfc2fdfe, 0x7c91d0d5, 0x3da0cbcc, 0xfa368a83, + 0xbb07919a, 0x7854bcb1, 0x3965a7a8, 0x4b98833b, 0x0aa99822, + 0xc9fab509, 0x88cbae10, 0x4f5def5f, 0x0e6cf446, 0xcd3fd96d, + 0x8c0ec274, 0x43125af3, 0x022341ea, 0xc1706cc1, 0x804177d8, + 0x47d73697, 0x06e62d8e, 0xc5b500a5, 0x84841bbc, 0x1a8a4171, + 0x5bbb5a68, 0x98e87743, 0xd9d96c5a, 0x1e4f2d15, 0x5f7e360c, + 0x9c2d1b27, 0xdd1c003e, 0x120098b9, 0x533183a0, 0x9062ae8b, + 0xd153b592, 0x16c5f4dd, 0x57f4efc4, 0x94a7c2ef, 0xd596d9f6, + 0xe9bc07ae, 0xa88d1cb7, 0x6bde319c, 0x2aef2a85, 0xed796bca, + 0xac4870d3, 0x6f1b5df8, 0x2e2a46e1, 0xe136de66, 0xa007c57f, + 0x6354e854, 0x2265f34d, 0xe5f3b202, 0xa4c2a91b, 0x67918430, + 0x26a09f29, 0xb8aec5e4, 0xf99fdefd, 0x3accf3d6, 0x7bfde8cf, + 0xbc6ba980, 0xfd5ab299, 0x3e099fb2, 0x7f3884ab, 0xb0241c2c, + 0xf1150735, 0x32462a1e, 0x73773107, 0xb4e17048, 0xf5d06b51, + 0x3683467a, 0x77b25d63, 0x4ed7facb, 0x0fe6e1d2, 0xccb5ccf9, + 0x8d84d7e0, 0x4a1296af, 0x0b238db6, 0xc870a09d, 0x8941bb84, + 0x465d2303, 0x076c381a, 0xc43f1531, 0x850e0e28, 0x42984f67, + 0x03a9547e, 0xc0fa7955, 0x81cb624c, 0x1fc53881, 0x5ef42398, + 0x9da70eb3, 0xdc9615aa, 0x1b0054e5, 0x5a314ffc, 0x996262d7, + 0xd85379ce, 0x174fe149, 0x567efa50, 0x952dd77b, 0xd41ccc62, + 0x138a8d2d, 0x52bb9634, 0x91e8bb1f, 0xd0d9a006, 0xecf37e5e, + 0xadc26547, 0x6e91486c, 0x2fa05375, 0xe836123a, 0xa9070923, + 0x6a542408, 0x2b653f11, 0xe479a796, 0xa548bc8f, 0x661b91a4, + 0x272a8abd, 0xe0bccbf2, 0xa18dd0eb, 0x62defdc0, 0x23efe6d9, + 0xbde1bc14, 0xfcd0a70d, 0x3f838a26, 0x7eb2913f, 0xb924d070, + 0xf815cb69, 0x3b46e642, 0x7a77fd5b, 0xb56b65dc, 0xf45a7ec5, + 0x370953ee, 0x763848f7, 0xb1ae09b8, 0xf09f12a1, 0x33cc3f8a, + 0x72fd2493}, + {0x00000000, 0x376ac201, 0x6ed48403, 0x59be4602, 0xdca80907, + 0xebc2cb06, 0xb27c8d04, 0x85164f05, 0xb851130e, 0x8f3bd10f, + 0xd685970d, 0xe1ef550c, 0x64f91a09, 0x5393d808, 0x0a2d9e0a, + 0x3d475c0b, 0x70a3261c, 0x47c9e41d, 0x1e77a21f, 0x291d601e, + 0xac0b2f1b, 0x9b61ed1a, 0xc2dfab18, 0xf5b56919, 0xc8f23512, + 0xff98f713, 0xa626b111, 0x914c7310, 0x145a3c15, 0x2330fe14, + 0x7a8eb816, 0x4de47a17, 0xe0464d38, 0xd72c8f39, 0x8e92c93b, + 0xb9f80b3a, 0x3cee443f, 0x0b84863e, 0x523ac03c, 0x6550023d, + 0x58175e36, 0x6f7d9c37, 0x36c3da35, 0x01a91834, 0x84bf5731, + 0xb3d59530, 0xea6bd332, 0xdd011133, 0x90e56b24, 0xa78fa925, + 0xfe31ef27, 0xc95b2d26, 0x4c4d6223, 0x7b27a022, 0x2299e620, + 0x15f32421, 0x28b4782a, 0x1fdeba2b, 0x4660fc29, 0x710a3e28, + 0xf41c712d, 0xc376b32c, 0x9ac8f52e, 0xada2372f, 0xc08d9a70, + 0xf7e75871, 0xae591e73, 0x9933dc72, 0x1c259377, 0x2b4f5176, + 0x72f11774, 0x459bd575, 0x78dc897e, 0x4fb64b7f, 0x16080d7d, + 0x2162cf7c, 0xa4748079, 0x931e4278, 0xcaa0047a, 0xfdcac67b, + 0xb02ebc6c, 0x87447e6d, 0xdefa386f, 0xe990fa6e, 0x6c86b56b, + 0x5bec776a, 0x02523168, 0x3538f369, 0x087faf62, 0x3f156d63, + 0x66ab2b61, 0x51c1e960, 0xd4d7a665, 0xe3bd6464, 0xba032266, + 0x8d69e067, 0x20cbd748, 0x17a11549, 0x4e1f534b, 0x7975914a, + 0xfc63de4f, 0xcb091c4e, 0x92b75a4c, 0xa5dd984d, 0x989ac446, + 0xaff00647, 0xf64e4045, 0xc1248244, 0x4432cd41, 0x73580f40, + 0x2ae64942, 0x1d8c8b43, 0x5068f154, 0x67023355, 0x3ebc7557, + 0x09d6b756, 0x8cc0f853, 0xbbaa3a52, 0xe2147c50, 0xd57ebe51, + 0xe839e25a, 0xdf53205b, 0x86ed6659, 0xb187a458, 0x3491eb5d, + 0x03fb295c, 0x5a456f5e, 0x6d2fad5f, 0x801b35e1, 0xb771f7e0, + 0xeecfb1e2, 0xd9a573e3, 0x5cb33ce6, 0x6bd9fee7, 0x3267b8e5, + 0x050d7ae4, 0x384a26ef, 0x0f20e4ee, 0x569ea2ec, 0x61f460ed, + 0xe4e22fe8, 0xd388ede9, 0x8a36abeb, 0xbd5c69ea, 0xf0b813fd, + 0xc7d2d1fc, 0x9e6c97fe, 0xa90655ff, 0x2c101afa, 0x1b7ad8fb, + 0x42c49ef9, 0x75ae5cf8, 0x48e900f3, 0x7f83c2f2, 0x263d84f0, + 0x115746f1, 0x944109f4, 0xa32bcbf5, 0xfa958df7, 0xcdff4ff6, + 0x605d78d9, 0x5737bad8, 0x0e89fcda, 0x39e33edb, 0xbcf571de, + 0x8b9fb3df, 0xd221f5dd, 0xe54b37dc, 0xd80c6bd7, 0xef66a9d6, + 0xb6d8efd4, 0x81b22dd5, 0x04a462d0, 0x33cea0d1, 0x6a70e6d3, + 0x5d1a24d2, 0x10fe5ec5, 0x27949cc4, 0x7e2adac6, 0x494018c7, + 0xcc5657c2, 0xfb3c95c3, 0xa282d3c1, 0x95e811c0, 0xa8af4dcb, + 0x9fc58fca, 0xc67bc9c8, 0xf1110bc9, 0x740744cc, 0x436d86cd, + 0x1ad3c0cf, 0x2db902ce, 0x4096af91, 0x77fc6d90, 0x2e422b92, + 0x1928e993, 0x9c3ea696, 0xab546497, 0xf2ea2295, 0xc580e094, + 0xf8c7bc9f, 0xcfad7e9e, 0x9613389c, 0xa179fa9d, 0x246fb598, + 0x13057799, 0x4abb319b, 0x7dd1f39a, 0x3035898d, 0x075f4b8c, + 0x5ee10d8e, 0x698bcf8f, 0xec9d808a, 0xdbf7428b, 0x82490489, + 0xb523c688, 0x88649a83, 0xbf0e5882, 0xe6b01e80, 0xd1dadc81, + 0x54cc9384, 0x63a65185, 0x3a181787, 0x0d72d586, 0xa0d0e2a9, + 0x97ba20a8, 0xce0466aa, 0xf96ea4ab, 0x7c78ebae, 0x4b1229af, + 0x12ac6fad, 0x25c6adac, 0x1881f1a7, 0x2feb33a6, 0x765575a4, + 0x413fb7a5, 0xc429f8a0, 0xf3433aa1, 0xaafd7ca3, 0x9d97bea2, + 0xd073c4b5, 0xe71906b4, 0xbea740b6, 0x89cd82b7, 0x0cdbcdb2, + 0x3bb10fb3, 0x620f49b1, 0x55658bb0, 0x6822d7bb, 0x5f4815ba, + 0x06f653b8, 0x319c91b9, 0xb48adebc, 0x83e01cbd, 0xda5e5abf, + 0xed3498be}, + {0x00000000, 0x6567bcb8, 0x8bc809aa, 0xeeafb512, 0x5797628f, + 0x32f0de37, 0xdc5f6b25, 0xb938d79d, 0xef28b4c5, 0x8a4f087d, + 0x64e0bd6f, 0x018701d7, 0xb8bfd64a, 0xddd86af2, 0x3377dfe0, + 0x56106358, 0x9f571950, 0xfa30a5e8, 0x149f10fa, 0x71f8ac42, + 0xc8c07bdf, 0xada7c767, 0x43087275, 0x266fcecd, 0x707fad95, + 0x1518112d, 0xfbb7a43f, 0x9ed01887, 0x27e8cf1a, 0x428f73a2, + 0xac20c6b0, 0xc9477a08, 0x3eaf32a0, 0x5bc88e18, 0xb5673b0a, + 0xd00087b2, 0x6938502f, 0x0c5fec97, 0xe2f05985, 0x8797e53d, + 0xd1878665, 0xb4e03add, 0x5a4f8fcf, 0x3f283377, 0x8610e4ea, + 0xe3775852, 0x0dd8ed40, 0x68bf51f8, 0xa1f82bf0, 0xc49f9748, + 0x2a30225a, 0x4f579ee2, 0xf66f497f, 0x9308f5c7, 0x7da740d5, + 0x18c0fc6d, 0x4ed09f35, 0x2bb7238d, 0xc518969f, 0xa07f2a27, + 0x1947fdba, 0x7c204102, 0x928ff410, 0xf7e848a8, 0x3d58149b, + 0x583fa823, 0xb6901d31, 0xd3f7a189, 0x6acf7614, 0x0fa8caac, + 0xe1077fbe, 0x8460c306, 0xd270a05e, 0xb7171ce6, 0x59b8a9f4, + 0x3cdf154c, 0x85e7c2d1, 0xe0807e69, 0x0e2fcb7b, 0x6b4877c3, + 0xa20f0dcb, 0xc768b173, 0x29c70461, 0x4ca0b8d9, 0xf5986f44, + 0x90ffd3fc, 0x7e5066ee, 0x1b37da56, 0x4d27b90e, 0x284005b6, + 0xc6efb0a4, 0xa3880c1c, 0x1ab0db81, 0x7fd76739, 0x9178d22b, + 0xf41f6e93, 0x03f7263b, 0x66909a83, 0x883f2f91, 0xed589329, + 0x546044b4, 0x3107f80c, 0xdfa84d1e, 0xbacff1a6, 0xecdf92fe, + 0x89b82e46, 0x67179b54, 0x027027ec, 0xbb48f071, 0xde2f4cc9, + 0x3080f9db, 0x55e74563, 0x9ca03f6b, 0xf9c783d3, 0x176836c1, + 0x720f8a79, 0xcb375de4, 0xae50e15c, 0x40ff544e, 0x2598e8f6, + 0x73888bae, 0x16ef3716, 0xf8408204, 0x9d273ebc, 0x241fe921, + 0x41785599, 0xafd7e08b, 0xcab05c33, 0x3bb659ed, 0x5ed1e555, + 0xb07e5047, 0xd519ecff, 0x6c213b62, 0x094687da, 0xe7e932c8, + 0x828e8e70, 0xd49eed28, 0xb1f95190, 0x5f56e482, 0x3a31583a, + 0x83098fa7, 0xe66e331f, 0x08c1860d, 0x6da63ab5, 0xa4e140bd, + 0xc186fc05, 0x2f294917, 0x4a4ef5af, 0xf3762232, 0x96119e8a, + 0x78be2b98, 0x1dd99720, 0x4bc9f478, 0x2eae48c0, 0xc001fdd2, + 0xa566416a, 0x1c5e96f7, 0x79392a4f, 0x97969f5d, 0xf2f123e5, + 0x05196b4d, 0x607ed7f5, 0x8ed162e7, 0xebb6de5f, 0x528e09c2, + 0x37e9b57a, 0xd9460068, 0xbc21bcd0, 0xea31df88, 0x8f566330, + 0x61f9d622, 0x049e6a9a, 0xbda6bd07, 0xd8c101bf, 0x366eb4ad, + 0x53090815, 0x9a4e721d, 0xff29cea5, 0x11867bb7, 0x74e1c70f, + 0xcdd91092, 0xa8beac2a, 0x46111938, 0x2376a580, 0x7566c6d8, + 0x10017a60, 0xfeaecf72, 0x9bc973ca, 0x22f1a457, 0x479618ef, + 0xa939adfd, 0xcc5e1145, 0x06ee4d76, 0x6389f1ce, 0x8d2644dc, + 0xe841f864, 0x51792ff9, 0x341e9341, 0xdab12653, 0xbfd69aeb, + 0xe9c6f9b3, 0x8ca1450b, 0x620ef019, 0x07694ca1, 0xbe519b3c, + 0xdb362784, 0x35999296, 0x50fe2e2e, 0x99b95426, 0xfcdee89e, + 0x12715d8c, 0x7716e134, 0xce2e36a9, 0xab498a11, 0x45e63f03, + 0x208183bb, 0x7691e0e3, 0x13f65c5b, 0xfd59e949, 0x983e55f1, + 0x2106826c, 0x44613ed4, 0xaace8bc6, 0xcfa9377e, 0x38417fd6, + 0x5d26c36e, 0xb389767c, 0xd6eecac4, 0x6fd61d59, 0x0ab1a1e1, + 0xe41e14f3, 0x8179a84b, 0xd769cb13, 0xb20e77ab, 0x5ca1c2b9, + 0x39c67e01, 0x80fea99c, 0xe5991524, 0x0b36a036, 0x6e511c8e, + 0xa7166686, 0xc271da3e, 0x2cde6f2c, 0x49b9d394, 0xf0810409, + 0x95e6b8b1, 0x7b490da3, 0x1e2eb11b, 0x483ed243, 0x2d596efb, + 0xc3f6dbe9, 0xa6916751, 0x1fa9b0cc, 0x7ace0c74, 0x9461b966, + 0xf10605de}}; + +#endif + +#endif + +#if N == 2 + +#if W == 8 + +local const z_crc_t FAR crc_braid_table[][256] = { + {0x00000000, 0xae689191, 0x87a02563, 0x29c8b4f2, 0xd4314c87, + 0x7a59dd16, 0x539169e4, 0xfdf9f875, 0x73139f4f, 0xdd7b0ede, + 0xf4b3ba2c, 0x5adb2bbd, 0xa722d3c8, 0x094a4259, 0x2082f6ab, + 0x8eea673a, 0xe6273e9e, 0x484faf0f, 0x61871bfd, 0xcfef8a6c, + 0x32167219, 0x9c7ee388, 0xb5b6577a, 0x1bdec6eb, 0x9534a1d1, + 0x3b5c3040, 0x129484b2, 0xbcfc1523, 0x4105ed56, 0xef6d7cc7, + 0xc6a5c835, 0x68cd59a4, 0x173f7b7d, 0xb957eaec, 0x909f5e1e, + 0x3ef7cf8f, 0xc30e37fa, 0x6d66a66b, 0x44ae1299, 0xeac68308, + 0x642ce432, 0xca4475a3, 0xe38cc151, 0x4de450c0, 0xb01da8b5, + 0x1e753924, 0x37bd8dd6, 0x99d51c47, 0xf11845e3, 0x5f70d472, + 0x76b86080, 0xd8d0f111, 0x25290964, 0x8b4198f5, 0xa2892c07, + 0x0ce1bd96, 0x820bdaac, 0x2c634b3d, 0x05abffcf, 0xabc36e5e, + 0x563a962b, 0xf85207ba, 0xd19ab348, 0x7ff222d9, 0x2e7ef6fa, + 0x8016676b, 0xa9ded399, 0x07b64208, 0xfa4fba7d, 0x54272bec, + 0x7def9f1e, 0xd3870e8f, 0x5d6d69b5, 0xf305f824, 0xdacd4cd6, + 0x74a5dd47, 0x895c2532, 0x2734b4a3, 0x0efc0051, 0xa09491c0, + 0xc859c864, 0x663159f5, 0x4ff9ed07, 0xe1917c96, 0x1c6884e3, + 0xb2001572, 0x9bc8a180, 0x35a03011, 0xbb4a572b, 0x1522c6ba, + 0x3cea7248, 0x9282e3d9, 0x6f7b1bac, 0xc1138a3d, 0xe8db3ecf, + 0x46b3af5e, 0x39418d87, 0x97291c16, 0xbee1a8e4, 0x10893975, + 0xed70c100, 0x43185091, 0x6ad0e463, 0xc4b875f2, 0x4a5212c8, + 0xe43a8359, 0xcdf237ab, 0x639aa63a, 0x9e635e4f, 0x300bcfde, + 0x19c37b2c, 0xb7abeabd, 0xdf66b319, 0x710e2288, 0x58c6967a, + 0xf6ae07eb, 0x0b57ff9e, 0xa53f6e0f, 0x8cf7dafd, 0x229f4b6c, + 0xac752c56, 0x021dbdc7, 0x2bd50935, 0x85bd98a4, 0x784460d1, + 0xd62cf140, 0xffe445b2, 0x518cd423, 0x5cfdedf4, 0xf2957c65, + 0xdb5dc897, 0x75355906, 0x88cca173, 0x26a430e2, 0x0f6c8410, + 0xa1041581, 0x2fee72bb, 0x8186e32a, 0xa84e57d8, 0x0626c649, + 0xfbdf3e3c, 0x55b7afad, 0x7c7f1b5f, 0xd2178ace, 0xbadad36a, + 0x14b242fb, 0x3d7af609, 0x93126798, 0x6eeb9fed, 0xc0830e7c, + 0xe94bba8e, 0x47232b1f, 0xc9c94c25, 0x67a1ddb4, 0x4e696946, + 0xe001f8d7, 0x1df800a2, 0xb3909133, 0x9a5825c1, 0x3430b450, + 0x4bc29689, 0xe5aa0718, 0xcc62b3ea, 0x620a227b, 0x9ff3da0e, + 0x319b4b9f, 0x1853ff6d, 0xb63b6efc, 0x38d109c6, 0x96b99857, + 0xbf712ca5, 0x1119bd34, 0xece04541, 0x4288d4d0, 0x6b406022, + 0xc528f1b3, 0xade5a817, 0x038d3986, 0x2a458d74, 0x842d1ce5, + 0x79d4e490, 0xd7bc7501, 0xfe74c1f3, 0x501c5062, 0xdef63758, + 0x709ea6c9, 0x5956123b, 0xf73e83aa, 0x0ac77bdf, 0xa4afea4e, + 0x8d675ebc, 0x230fcf2d, 0x72831b0e, 0xdceb8a9f, 0xf5233e6d, + 0x5b4baffc, 0xa6b25789, 0x08dac618, 0x211272ea, 0x8f7ae37b, + 0x01908441, 0xaff815d0, 0x8630a122, 0x285830b3, 0xd5a1c8c6, + 0x7bc95957, 0x5201eda5, 0xfc697c34, 0x94a42590, 0x3accb401, + 0x130400f3, 0xbd6c9162, 0x40956917, 0xeefdf886, 0xc7354c74, + 0x695ddde5, 0xe7b7badf, 0x49df2b4e, 0x60179fbc, 0xce7f0e2d, + 0x3386f658, 0x9dee67c9, 0xb426d33b, 0x1a4e42aa, 0x65bc6073, + 0xcbd4f1e2, 0xe21c4510, 0x4c74d481, 0xb18d2cf4, 0x1fe5bd65, + 0x362d0997, 0x98459806, 0x16afff3c, 0xb8c76ead, 0x910fda5f, + 0x3f674bce, 0xc29eb3bb, 0x6cf6222a, 0x453e96d8, 0xeb560749, + 0x839b5eed, 0x2df3cf7c, 0x043b7b8e, 0xaa53ea1f, 0x57aa126a, + 0xf9c283fb, 0xd00a3709, 0x7e62a698, 0xf088c1a2, 0x5ee05033, + 0x7728e4c1, 0xd9407550, 0x24b98d25, 0x8ad11cb4, 0xa319a846, + 0x0d7139d7}, + {0x00000000, 0xb9fbdbe8, 0xa886b191, 0x117d6a79, 0x8a7c6563, + 0x3387be8b, 0x22fad4f2, 0x9b010f1a, 0xcf89cc87, 0x7672176f, + 0x670f7d16, 0xdef4a6fe, 0x45f5a9e4, 0xfc0e720c, 0xed731875, + 0x5488c39d, 0x44629f4f, 0xfd9944a7, 0xece42ede, 0x551ff536, + 0xce1efa2c, 0x77e521c4, 0x66984bbd, 0xdf639055, 0x8beb53c8, + 0x32108820, 0x236de259, 0x9a9639b1, 0x019736ab, 0xb86ced43, + 0xa911873a, 0x10ea5cd2, 0x88c53e9e, 0x313ee576, 0x20438f0f, + 0x99b854e7, 0x02b95bfd, 0xbb428015, 0xaa3fea6c, 0x13c43184, + 0x474cf219, 0xfeb729f1, 0xefca4388, 0x56319860, 0xcd30977a, + 0x74cb4c92, 0x65b626eb, 0xdc4dfd03, 0xcca7a1d1, 0x755c7a39, + 0x64211040, 0xdddacba8, 0x46dbc4b2, 0xff201f5a, 0xee5d7523, + 0x57a6aecb, 0x032e6d56, 0xbad5b6be, 0xaba8dcc7, 0x1253072f, + 0x89520835, 0x30a9d3dd, 0x21d4b9a4, 0x982f624c, 0xcafb7b7d, + 0x7300a095, 0x627dcaec, 0xdb861104, 0x40871e1e, 0xf97cc5f6, + 0xe801af8f, 0x51fa7467, 0x0572b7fa, 0xbc896c12, 0xadf4066b, + 0x140fdd83, 0x8f0ed299, 0x36f50971, 0x27886308, 0x9e73b8e0, + 0x8e99e432, 0x37623fda, 0x261f55a3, 0x9fe48e4b, 0x04e58151, + 0xbd1e5ab9, 0xac6330c0, 0x1598eb28, 0x411028b5, 0xf8ebf35d, + 0xe9969924, 0x506d42cc, 0xcb6c4dd6, 0x7297963e, 0x63eafc47, + 0xda1127af, 0x423e45e3, 0xfbc59e0b, 0xeab8f472, 0x53432f9a, + 0xc8422080, 0x71b9fb68, 0x60c49111, 0xd93f4af9, 0x8db78964, + 0x344c528c, 0x253138f5, 0x9ccae31d, 0x07cbec07, 0xbe3037ef, + 0xaf4d5d96, 0x16b6867e, 0x065cdaac, 0xbfa70144, 0xaeda6b3d, + 0x1721b0d5, 0x8c20bfcf, 0x35db6427, 0x24a60e5e, 0x9d5dd5b6, + 0xc9d5162b, 0x702ecdc3, 0x6153a7ba, 0xd8a87c52, 0x43a97348, + 0xfa52a8a0, 0xeb2fc2d9, 0x52d41931, 0x4e87f0bb, 0xf77c2b53, + 0xe601412a, 0x5ffa9ac2, 0xc4fb95d8, 0x7d004e30, 0x6c7d2449, + 0xd586ffa1, 0x810e3c3c, 0x38f5e7d4, 0x29888dad, 0x90735645, + 0x0b72595f, 0xb28982b7, 0xa3f4e8ce, 0x1a0f3326, 0x0ae56ff4, + 0xb31eb41c, 0xa263de65, 0x1b98058d, 0x80990a97, 0x3962d17f, + 0x281fbb06, 0x91e460ee, 0xc56ca373, 0x7c97789b, 0x6dea12e2, + 0xd411c90a, 0x4f10c610, 0xf6eb1df8, 0xe7967781, 0x5e6dac69, + 0xc642ce25, 0x7fb915cd, 0x6ec47fb4, 0xd73fa45c, 0x4c3eab46, + 0xf5c570ae, 0xe4b81ad7, 0x5d43c13f, 0x09cb02a2, 0xb030d94a, + 0xa14db333, 0x18b668db, 0x83b767c1, 0x3a4cbc29, 0x2b31d650, + 0x92ca0db8, 0x8220516a, 0x3bdb8a82, 0x2aa6e0fb, 0x935d3b13, + 0x085c3409, 0xb1a7efe1, 0xa0da8598, 0x19215e70, 0x4da99ded, + 0xf4524605, 0xe52f2c7c, 0x5cd4f794, 0xc7d5f88e, 0x7e2e2366, + 0x6f53491f, 0xd6a892f7, 0x847c8bc6, 0x3d87502e, 0x2cfa3a57, + 0x9501e1bf, 0x0e00eea5, 0xb7fb354d, 0xa6865f34, 0x1f7d84dc, + 0x4bf54741, 0xf20e9ca9, 0xe373f6d0, 0x5a882d38, 0xc1892222, + 0x7872f9ca, 0x690f93b3, 0xd0f4485b, 0xc01e1489, 0x79e5cf61, + 0x6898a518, 0xd1637ef0, 0x4a6271ea, 0xf399aa02, 0xe2e4c07b, + 0x5b1f1b93, 0x0f97d80e, 0xb66c03e6, 0xa711699f, 0x1eeab277, + 0x85ebbd6d, 0x3c106685, 0x2d6d0cfc, 0x9496d714, 0x0cb9b558, + 0xb5426eb0, 0xa43f04c9, 0x1dc4df21, 0x86c5d03b, 0x3f3e0bd3, + 0x2e4361aa, 0x97b8ba42, 0xc33079df, 0x7acba237, 0x6bb6c84e, + 0xd24d13a6, 0x494c1cbc, 0xf0b7c754, 0xe1caad2d, 0x583176c5, + 0x48db2a17, 0xf120f1ff, 0xe05d9b86, 0x59a6406e, 0xc2a74f74, + 0x7b5c949c, 0x6a21fee5, 0xd3da250d, 0x8752e690, 0x3ea93d78, + 0x2fd45701, 0x962f8ce9, 0x0d2e83f3, 0xb4d5581b, 0xa5a83262, + 0x1c53e98a}, + {0x00000000, 0x9d0fe176, 0xe16ec4ad, 0x7c6125db, 0x19ac8f1b, + 0x84a36e6d, 0xf8c24bb6, 0x65cdaac0, 0x33591e36, 0xae56ff40, + 0xd237da9b, 0x4f383bed, 0x2af5912d, 0xb7fa705b, 0xcb9b5580, + 0x5694b4f6, 0x66b23c6c, 0xfbbddd1a, 0x87dcf8c1, 0x1ad319b7, + 0x7f1eb377, 0xe2115201, 0x9e7077da, 0x037f96ac, 0x55eb225a, + 0xc8e4c32c, 0xb485e6f7, 0x298a0781, 0x4c47ad41, 0xd1484c37, + 0xad2969ec, 0x3026889a, 0xcd6478d8, 0x506b99ae, 0x2c0abc75, + 0xb1055d03, 0xd4c8f7c3, 0x49c716b5, 0x35a6336e, 0xa8a9d218, + 0xfe3d66ee, 0x63328798, 0x1f53a243, 0x825c4335, 0xe791e9f5, + 0x7a9e0883, 0x06ff2d58, 0x9bf0cc2e, 0xabd644b4, 0x36d9a5c2, + 0x4ab88019, 0xd7b7616f, 0xb27acbaf, 0x2f752ad9, 0x53140f02, + 0xce1bee74, 0x988f5a82, 0x0580bbf4, 0x79e19e2f, 0xe4ee7f59, + 0x8123d599, 0x1c2c34ef, 0x604d1134, 0xfd42f042, 0x41b9f7f1, + 0xdcb61687, 0xa0d7335c, 0x3dd8d22a, 0x581578ea, 0xc51a999c, + 0xb97bbc47, 0x24745d31, 0x72e0e9c7, 0xefef08b1, 0x938e2d6a, + 0x0e81cc1c, 0x6b4c66dc, 0xf64387aa, 0x8a22a271, 0x172d4307, + 0x270bcb9d, 0xba042aeb, 0xc6650f30, 0x5b6aee46, 0x3ea74486, + 0xa3a8a5f0, 0xdfc9802b, 0x42c6615d, 0x1452d5ab, 0x895d34dd, + 0xf53c1106, 0x6833f070, 0x0dfe5ab0, 0x90f1bbc6, 0xec909e1d, + 0x719f7f6b, 0x8cdd8f29, 0x11d26e5f, 0x6db34b84, 0xf0bcaaf2, + 0x95710032, 0x087ee144, 0x741fc49f, 0xe91025e9, 0xbf84911f, + 0x228b7069, 0x5eea55b2, 0xc3e5b4c4, 0xa6281e04, 0x3b27ff72, + 0x4746daa9, 0xda493bdf, 0xea6fb345, 0x77605233, 0x0b0177e8, + 0x960e969e, 0xf3c33c5e, 0x6eccdd28, 0x12adf8f3, 0x8fa21985, + 0xd936ad73, 0x44394c05, 0x385869de, 0xa55788a8, 0xc09a2268, + 0x5d95c31e, 0x21f4e6c5, 0xbcfb07b3, 0x8373efe2, 0x1e7c0e94, + 0x621d2b4f, 0xff12ca39, 0x9adf60f9, 0x07d0818f, 0x7bb1a454, + 0xe6be4522, 0xb02af1d4, 0x2d2510a2, 0x51443579, 0xcc4bd40f, + 0xa9867ecf, 0x34899fb9, 0x48e8ba62, 0xd5e75b14, 0xe5c1d38e, + 0x78ce32f8, 0x04af1723, 0x99a0f655, 0xfc6d5c95, 0x6162bde3, + 0x1d039838, 0x800c794e, 0xd698cdb8, 0x4b972cce, 0x37f60915, + 0xaaf9e863, 0xcf3442a3, 0x523ba3d5, 0x2e5a860e, 0xb3556778, + 0x4e17973a, 0xd318764c, 0xaf795397, 0x3276b2e1, 0x57bb1821, + 0xcab4f957, 0xb6d5dc8c, 0x2bda3dfa, 0x7d4e890c, 0xe041687a, + 0x9c204da1, 0x012facd7, 0x64e20617, 0xf9ede761, 0x858cc2ba, + 0x188323cc, 0x28a5ab56, 0xb5aa4a20, 0xc9cb6ffb, 0x54c48e8d, + 0x3109244d, 0xac06c53b, 0xd067e0e0, 0x4d680196, 0x1bfcb560, + 0x86f35416, 0xfa9271cd, 0x679d90bb, 0x02503a7b, 0x9f5fdb0d, + 0xe33efed6, 0x7e311fa0, 0xc2ca1813, 0x5fc5f965, 0x23a4dcbe, + 0xbeab3dc8, 0xdb669708, 0x4669767e, 0x3a0853a5, 0xa707b2d3, + 0xf1930625, 0x6c9ce753, 0x10fdc288, 0x8df223fe, 0xe83f893e, + 0x75306848, 0x09514d93, 0x945eace5, 0xa478247f, 0x3977c509, + 0x4516e0d2, 0xd81901a4, 0xbdd4ab64, 0x20db4a12, 0x5cba6fc9, + 0xc1b58ebf, 0x97213a49, 0x0a2edb3f, 0x764ffee4, 0xeb401f92, + 0x8e8db552, 0x13825424, 0x6fe371ff, 0xf2ec9089, 0x0fae60cb, + 0x92a181bd, 0xeec0a466, 0x73cf4510, 0x1602efd0, 0x8b0d0ea6, + 0xf76c2b7d, 0x6a63ca0b, 0x3cf77efd, 0xa1f89f8b, 0xdd99ba50, + 0x40965b26, 0x255bf1e6, 0xb8541090, 0xc435354b, 0x593ad43d, + 0x691c5ca7, 0xf413bdd1, 0x8872980a, 0x157d797c, 0x70b0d3bc, + 0xedbf32ca, 0x91de1711, 0x0cd1f667, 0x5a454291, 0xc74aa3e7, + 0xbb2b863c, 0x2624674a, 0x43e9cd8a, 0xdee62cfc, 0xa2870927, + 0x3f88e851}, + {0x00000000, 0xdd96d985, 0x605cb54b, 0xbdca6cce, 0xc0b96a96, + 0x1d2fb313, 0xa0e5dfdd, 0x7d730658, 0x5a03d36d, 0x87950ae8, + 0x3a5f6626, 0xe7c9bfa3, 0x9abab9fb, 0x472c607e, 0xfae60cb0, + 0x2770d535, 0xb407a6da, 0x69917f5f, 0xd45b1391, 0x09cdca14, + 0x74becc4c, 0xa92815c9, 0x14e27907, 0xc974a082, 0xee0475b7, + 0x3392ac32, 0x8e58c0fc, 0x53ce1979, 0x2ebd1f21, 0xf32bc6a4, + 0x4ee1aa6a, 0x937773ef, 0xb37e4bf5, 0x6ee89270, 0xd322febe, + 0x0eb4273b, 0x73c72163, 0xae51f8e6, 0x139b9428, 0xce0d4dad, + 0xe97d9898, 0x34eb411d, 0x89212dd3, 0x54b7f456, 0x29c4f20e, + 0xf4522b8b, 0x49984745, 0x940e9ec0, 0x0779ed2f, 0xdaef34aa, + 0x67255864, 0xbab381e1, 0xc7c087b9, 0x1a565e3c, 0xa79c32f2, + 0x7a0aeb77, 0x5d7a3e42, 0x80ece7c7, 0x3d268b09, 0xe0b0528c, + 0x9dc354d4, 0x40558d51, 0xfd9fe19f, 0x2009381a, 0xbd8d91ab, + 0x601b482e, 0xddd124e0, 0x0047fd65, 0x7d34fb3d, 0xa0a222b8, + 0x1d684e76, 0xc0fe97f3, 0xe78e42c6, 0x3a189b43, 0x87d2f78d, + 0x5a442e08, 0x27372850, 0xfaa1f1d5, 0x476b9d1b, 0x9afd449e, + 0x098a3771, 0xd41ceef4, 0x69d6823a, 0xb4405bbf, 0xc9335de7, + 0x14a58462, 0xa96fe8ac, 0x74f93129, 0x5389e41c, 0x8e1f3d99, + 0x33d55157, 0xee4388d2, 0x93308e8a, 0x4ea6570f, 0xf36c3bc1, + 0x2efae244, 0x0ef3da5e, 0xd36503db, 0x6eaf6f15, 0xb339b690, + 0xce4ab0c8, 0x13dc694d, 0xae160583, 0x7380dc06, 0x54f00933, + 0x8966d0b6, 0x34acbc78, 0xe93a65fd, 0x944963a5, 0x49dfba20, + 0xf415d6ee, 0x29830f6b, 0xbaf47c84, 0x6762a501, 0xdaa8c9cf, + 0x073e104a, 0x7a4d1612, 0xa7dbcf97, 0x1a11a359, 0xc7877adc, + 0xe0f7afe9, 0x3d61766c, 0x80ab1aa2, 0x5d3dc327, 0x204ec57f, + 0xfdd81cfa, 0x40127034, 0x9d84a9b1, 0xa06a2517, 0x7dfcfc92, + 0xc036905c, 0x1da049d9, 0x60d34f81, 0xbd459604, 0x008ffaca, + 0xdd19234f, 0xfa69f67a, 0x27ff2fff, 0x9a354331, 0x47a39ab4, + 0x3ad09cec, 0xe7464569, 0x5a8c29a7, 0x871af022, 0x146d83cd, + 0xc9fb5a48, 0x74313686, 0xa9a7ef03, 0xd4d4e95b, 0x094230de, + 0xb4885c10, 0x691e8595, 0x4e6e50a0, 0x93f88925, 0x2e32e5eb, + 0xf3a43c6e, 0x8ed73a36, 0x5341e3b3, 0xee8b8f7d, 0x331d56f8, + 0x13146ee2, 0xce82b767, 0x7348dba9, 0xaede022c, 0xd3ad0474, + 0x0e3bddf1, 0xb3f1b13f, 0x6e6768ba, 0x4917bd8f, 0x9481640a, + 0x294b08c4, 0xf4ddd141, 0x89aed719, 0x54380e9c, 0xe9f26252, + 0x3464bbd7, 0xa713c838, 0x7a8511bd, 0xc74f7d73, 0x1ad9a4f6, + 0x67aaa2ae, 0xba3c7b2b, 0x07f617e5, 0xda60ce60, 0xfd101b55, + 0x2086c2d0, 0x9d4cae1e, 0x40da779b, 0x3da971c3, 0xe03fa846, + 0x5df5c488, 0x80631d0d, 0x1de7b4bc, 0xc0716d39, 0x7dbb01f7, + 0xa02dd872, 0xdd5ede2a, 0x00c807af, 0xbd026b61, 0x6094b2e4, + 0x47e467d1, 0x9a72be54, 0x27b8d29a, 0xfa2e0b1f, 0x875d0d47, + 0x5acbd4c2, 0xe701b80c, 0x3a976189, 0xa9e01266, 0x7476cbe3, + 0xc9bca72d, 0x142a7ea8, 0x695978f0, 0xb4cfa175, 0x0905cdbb, + 0xd493143e, 0xf3e3c10b, 0x2e75188e, 0x93bf7440, 0x4e29adc5, + 0x335aab9d, 0xeecc7218, 0x53061ed6, 0x8e90c753, 0xae99ff49, + 0x730f26cc, 0xcec54a02, 0x13539387, 0x6e2095df, 0xb3b64c5a, + 0x0e7c2094, 0xd3eaf911, 0xf49a2c24, 0x290cf5a1, 0x94c6996f, + 0x495040ea, 0x342346b2, 0xe9b59f37, 0x547ff3f9, 0x89e92a7c, + 0x1a9e5993, 0xc7088016, 0x7ac2ecd8, 0xa754355d, 0xda273305, + 0x07b1ea80, 0xba7b864e, 0x67ed5fcb, 0x409d8afe, 0x9d0b537b, + 0x20c13fb5, 0xfd57e630, 0x8024e068, 0x5db239ed, 0xe0785523, + 0x3dee8ca6}, + {0x00000000, 0x9ba54c6f, 0xec3b9e9f, 0x779ed2f0, 0x03063b7f, + 0x98a37710, 0xef3da5e0, 0x7498e98f, 0x060c76fe, 0x9da93a91, + 0xea37e861, 0x7192a40e, 0x050a4d81, 0x9eaf01ee, 0xe931d31e, + 0x72949f71, 0x0c18edfc, 0x97bda193, 0xe0237363, 0x7b863f0c, + 0x0f1ed683, 0x94bb9aec, 0xe325481c, 0x78800473, 0x0a149b02, + 0x91b1d76d, 0xe62f059d, 0x7d8a49f2, 0x0912a07d, 0x92b7ec12, + 0xe5293ee2, 0x7e8c728d, 0x1831dbf8, 0x83949797, 0xf40a4567, + 0x6faf0908, 0x1b37e087, 0x8092ace8, 0xf70c7e18, 0x6ca93277, + 0x1e3dad06, 0x8598e169, 0xf2063399, 0x69a37ff6, 0x1d3b9679, + 0x869eda16, 0xf10008e6, 0x6aa54489, 0x14293604, 0x8f8c7a6b, + 0xf812a89b, 0x63b7e4f4, 0x172f0d7b, 0x8c8a4114, 0xfb1493e4, + 0x60b1df8b, 0x122540fa, 0x89800c95, 0xfe1ede65, 0x65bb920a, + 0x11237b85, 0x8a8637ea, 0xfd18e51a, 0x66bda975, 0x3063b7f0, + 0xabc6fb9f, 0xdc58296f, 0x47fd6500, 0x33658c8f, 0xa8c0c0e0, + 0xdf5e1210, 0x44fb5e7f, 0x366fc10e, 0xadca8d61, 0xda545f91, + 0x41f113fe, 0x3569fa71, 0xaeccb61e, 0xd95264ee, 0x42f72881, + 0x3c7b5a0c, 0xa7de1663, 0xd040c493, 0x4be588fc, 0x3f7d6173, + 0xa4d82d1c, 0xd346ffec, 0x48e3b383, 0x3a772cf2, 0xa1d2609d, + 0xd64cb26d, 0x4de9fe02, 0x3971178d, 0xa2d45be2, 0xd54a8912, + 0x4eefc57d, 0x28526c08, 0xb3f72067, 0xc469f297, 0x5fccbef8, + 0x2b545777, 0xb0f11b18, 0xc76fc9e8, 0x5cca8587, 0x2e5e1af6, + 0xb5fb5699, 0xc2658469, 0x59c0c806, 0x2d582189, 0xb6fd6de6, + 0xc163bf16, 0x5ac6f379, 0x244a81f4, 0xbfefcd9b, 0xc8711f6b, + 0x53d45304, 0x274cba8b, 0xbce9f6e4, 0xcb772414, 0x50d2687b, + 0x2246f70a, 0xb9e3bb65, 0xce7d6995, 0x55d825fa, 0x2140cc75, + 0xbae5801a, 0xcd7b52ea, 0x56de1e85, 0x60c76fe0, 0xfb62238f, + 0x8cfcf17f, 0x1759bd10, 0x63c1549f, 0xf86418f0, 0x8ffaca00, + 0x145f866f, 0x66cb191e, 0xfd6e5571, 0x8af08781, 0x1155cbee, + 0x65cd2261, 0xfe686e0e, 0x89f6bcfe, 0x1253f091, 0x6cdf821c, + 0xf77ace73, 0x80e41c83, 0x1b4150ec, 0x6fd9b963, 0xf47cf50c, + 0x83e227fc, 0x18476b93, 0x6ad3f4e2, 0xf176b88d, 0x86e86a7d, + 0x1d4d2612, 0x69d5cf9d, 0xf27083f2, 0x85ee5102, 0x1e4b1d6d, + 0x78f6b418, 0xe353f877, 0x94cd2a87, 0x0f6866e8, 0x7bf08f67, + 0xe055c308, 0x97cb11f8, 0x0c6e5d97, 0x7efac2e6, 0xe55f8e89, + 0x92c15c79, 0x09641016, 0x7dfcf999, 0xe659b5f6, 0x91c76706, + 0x0a622b69, 0x74ee59e4, 0xef4b158b, 0x98d5c77b, 0x03708b14, + 0x77e8629b, 0xec4d2ef4, 0x9bd3fc04, 0x0076b06b, 0x72e22f1a, + 0xe9476375, 0x9ed9b185, 0x057cfdea, 0x71e41465, 0xea41580a, + 0x9ddf8afa, 0x067ac695, 0x50a4d810, 0xcb01947f, 0xbc9f468f, + 0x273a0ae0, 0x53a2e36f, 0xc807af00, 0xbf997df0, 0x243c319f, + 0x56a8aeee, 0xcd0de281, 0xba933071, 0x21367c1e, 0x55ae9591, + 0xce0bd9fe, 0xb9950b0e, 0x22304761, 0x5cbc35ec, 0xc7197983, + 0xb087ab73, 0x2b22e71c, 0x5fba0e93, 0xc41f42fc, 0xb381900c, + 0x2824dc63, 0x5ab04312, 0xc1150f7d, 0xb68bdd8d, 0x2d2e91e2, + 0x59b6786d, 0xc2133402, 0xb58de6f2, 0x2e28aa9d, 0x489503e8, + 0xd3304f87, 0xa4ae9d77, 0x3f0bd118, 0x4b933897, 0xd03674f8, + 0xa7a8a608, 0x3c0dea67, 0x4e997516, 0xd53c3979, 0xa2a2eb89, + 0x3907a7e6, 0x4d9f4e69, 0xd63a0206, 0xa1a4d0f6, 0x3a019c99, + 0x448dee14, 0xdf28a27b, 0xa8b6708b, 0x33133ce4, 0x478bd56b, + 0xdc2e9904, 0xabb04bf4, 0x3015079b, 0x428198ea, 0xd924d485, + 0xaeba0675, 0x351f4a1a, 0x4187a395, 0xda22effa, 0xadbc3d0a, + 0x36197165}, + {0x00000000, 0xc18edfc0, 0x586cb9c1, 0x99e26601, 0xb0d97382, + 0x7157ac42, 0xe8b5ca43, 0x293b1583, 0xbac3e145, 0x7b4d3e85, + 0xe2af5884, 0x23218744, 0x0a1a92c7, 0xcb944d07, 0x52762b06, + 0x93f8f4c6, 0xaef6c4cb, 0x6f781b0b, 0xf69a7d0a, 0x3714a2ca, + 0x1e2fb749, 0xdfa16889, 0x46430e88, 0x87cdd148, 0x1435258e, + 0xd5bbfa4e, 0x4c599c4f, 0x8dd7438f, 0xa4ec560c, 0x656289cc, + 0xfc80efcd, 0x3d0e300d, 0x869c8fd7, 0x47125017, 0xdef03616, + 0x1f7ee9d6, 0x3645fc55, 0xf7cb2395, 0x6e294594, 0xafa79a54, + 0x3c5f6e92, 0xfdd1b152, 0x6433d753, 0xa5bd0893, 0x8c861d10, + 0x4d08c2d0, 0xd4eaa4d1, 0x15647b11, 0x286a4b1c, 0xe9e494dc, + 0x7006f2dd, 0xb1882d1d, 0x98b3389e, 0x593de75e, 0xc0df815f, + 0x01515e9f, 0x92a9aa59, 0x53277599, 0xcac51398, 0x0b4bcc58, + 0x2270d9db, 0xe3fe061b, 0x7a1c601a, 0xbb92bfda, 0xd64819ef, + 0x17c6c62f, 0x8e24a02e, 0x4faa7fee, 0x66916a6d, 0xa71fb5ad, + 0x3efdd3ac, 0xff730c6c, 0x6c8bf8aa, 0xad05276a, 0x34e7416b, + 0xf5699eab, 0xdc528b28, 0x1ddc54e8, 0x843e32e9, 0x45b0ed29, + 0x78bedd24, 0xb93002e4, 0x20d264e5, 0xe15cbb25, 0xc867aea6, + 0x09e97166, 0x900b1767, 0x5185c8a7, 0xc27d3c61, 0x03f3e3a1, + 0x9a1185a0, 0x5b9f5a60, 0x72a44fe3, 0xb32a9023, 0x2ac8f622, + 0xeb4629e2, 0x50d49638, 0x915a49f8, 0x08b82ff9, 0xc936f039, + 0xe00de5ba, 0x21833a7a, 0xb8615c7b, 0x79ef83bb, 0xea17777d, + 0x2b99a8bd, 0xb27bcebc, 0x73f5117c, 0x5ace04ff, 0x9b40db3f, + 0x02a2bd3e, 0xc32c62fe, 0xfe2252f3, 0x3fac8d33, 0xa64eeb32, + 0x67c034f2, 0x4efb2171, 0x8f75feb1, 0x169798b0, 0xd7194770, + 0x44e1b3b6, 0x856f6c76, 0x1c8d0a77, 0xdd03d5b7, 0xf438c034, + 0x35b61ff4, 0xac5479f5, 0x6ddaa635, 0x77e1359f, 0xb66fea5f, + 0x2f8d8c5e, 0xee03539e, 0xc738461d, 0x06b699dd, 0x9f54ffdc, + 0x5eda201c, 0xcd22d4da, 0x0cac0b1a, 0x954e6d1b, 0x54c0b2db, + 0x7dfba758, 0xbc757898, 0x25971e99, 0xe419c159, 0xd917f154, + 0x18992e94, 0x817b4895, 0x40f59755, 0x69ce82d6, 0xa8405d16, + 0x31a23b17, 0xf02ce4d7, 0x63d41011, 0xa25acfd1, 0x3bb8a9d0, + 0xfa367610, 0xd30d6393, 0x1283bc53, 0x8b61da52, 0x4aef0592, + 0xf17dba48, 0x30f36588, 0xa9110389, 0x689fdc49, 0x41a4c9ca, + 0x802a160a, 0x19c8700b, 0xd846afcb, 0x4bbe5b0d, 0x8a3084cd, + 0x13d2e2cc, 0xd25c3d0c, 0xfb67288f, 0x3ae9f74f, 0xa30b914e, + 0x62854e8e, 0x5f8b7e83, 0x9e05a143, 0x07e7c742, 0xc6691882, + 0xef520d01, 0x2edcd2c1, 0xb73eb4c0, 0x76b06b00, 0xe5489fc6, + 0x24c64006, 0xbd242607, 0x7caaf9c7, 0x5591ec44, 0x941f3384, + 0x0dfd5585, 0xcc738a45, 0xa1a92c70, 0x6027f3b0, 0xf9c595b1, + 0x384b4a71, 0x11705ff2, 0xd0fe8032, 0x491ce633, 0x889239f3, + 0x1b6acd35, 0xdae412f5, 0x430674f4, 0x8288ab34, 0xabb3beb7, + 0x6a3d6177, 0xf3df0776, 0x3251d8b6, 0x0f5fe8bb, 0xced1377b, + 0x5733517a, 0x96bd8eba, 0xbf869b39, 0x7e0844f9, 0xe7ea22f8, + 0x2664fd38, 0xb59c09fe, 0x7412d63e, 0xedf0b03f, 0x2c7e6fff, + 0x05457a7c, 0xc4cba5bc, 0x5d29c3bd, 0x9ca71c7d, 0x2735a3a7, + 0xe6bb7c67, 0x7f591a66, 0xbed7c5a6, 0x97ecd025, 0x56620fe5, + 0xcf8069e4, 0x0e0eb624, 0x9df642e2, 0x5c789d22, 0xc59afb23, + 0x041424e3, 0x2d2f3160, 0xeca1eea0, 0x754388a1, 0xb4cd5761, + 0x89c3676c, 0x484db8ac, 0xd1afdead, 0x1021016d, 0x391a14ee, + 0xf894cb2e, 0x6176ad2f, 0xa0f872ef, 0x33008629, 0xf28e59e9, + 0x6b6c3fe8, 0xaae2e028, 0x83d9f5ab, 0x42572a6b, 0xdbb54c6a, + 0x1a3b93aa}, + {0x00000000, 0xefc26b3e, 0x04f5d03d, 0xeb37bb03, 0x09eba07a, + 0xe629cb44, 0x0d1e7047, 0xe2dc1b79, 0x13d740f4, 0xfc152bca, + 0x172290c9, 0xf8e0fbf7, 0x1a3ce08e, 0xf5fe8bb0, 0x1ec930b3, + 0xf10b5b8d, 0x27ae81e8, 0xc86cead6, 0x235b51d5, 0xcc993aeb, + 0x2e452192, 0xc1874aac, 0x2ab0f1af, 0xc5729a91, 0x3479c11c, + 0xdbbbaa22, 0x308c1121, 0xdf4e7a1f, 0x3d926166, 0xd2500a58, + 0x3967b15b, 0xd6a5da65, 0x4f5d03d0, 0xa09f68ee, 0x4ba8d3ed, + 0xa46ab8d3, 0x46b6a3aa, 0xa974c894, 0x42437397, 0xad8118a9, + 0x5c8a4324, 0xb348281a, 0x587f9319, 0xb7bdf827, 0x5561e35e, + 0xbaa38860, 0x51943363, 0xbe56585d, 0x68f38238, 0x8731e906, + 0x6c065205, 0x83c4393b, 0x61182242, 0x8eda497c, 0x65edf27f, + 0x8a2f9941, 0x7b24c2cc, 0x94e6a9f2, 0x7fd112f1, 0x901379cf, + 0x72cf62b6, 0x9d0d0988, 0x763ab28b, 0x99f8d9b5, 0x9eba07a0, + 0x71786c9e, 0x9a4fd79d, 0x758dbca3, 0x9751a7da, 0x7893cce4, + 0x93a477e7, 0x7c661cd9, 0x8d6d4754, 0x62af2c6a, 0x89989769, + 0x665afc57, 0x8486e72e, 0x6b448c10, 0x80733713, 0x6fb15c2d, + 0xb9148648, 0x56d6ed76, 0xbde15675, 0x52233d4b, 0xb0ff2632, + 0x5f3d4d0c, 0xb40af60f, 0x5bc89d31, 0xaac3c6bc, 0x4501ad82, + 0xae361681, 0x41f47dbf, 0xa32866c6, 0x4cea0df8, 0xa7ddb6fb, + 0x481fddc5, 0xd1e70470, 0x3e256f4e, 0xd512d44d, 0x3ad0bf73, + 0xd80ca40a, 0x37cecf34, 0xdcf97437, 0x333b1f09, 0xc2304484, + 0x2df22fba, 0xc6c594b9, 0x2907ff87, 0xcbdbe4fe, 0x24198fc0, + 0xcf2e34c3, 0x20ec5ffd, 0xf6498598, 0x198beea6, 0xf2bc55a5, + 0x1d7e3e9b, 0xffa225e2, 0x10604edc, 0xfb57f5df, 0x14959ee1, + 0xe59ec56c, 0x0a5cae52, 0xe16b1551, 0x0ea97e6f, 0xec756516, + 0x03b70e28, 0xe880b52b, 0x0742de15, 0xe6050901, 0x09c7623f, + 0xe2f0d93c, 0x0d32b202, 0xefeea97b, 0x002cc245, 0xeb1b7946, + 0x04d91278, 0xf5d249f5, 0x1a1022cb, 0xf12799c8, 0x1ee5f2f6, + 0xfc39e98f, 0x13fb82b1, 0xf8cc39b2, 0x170e528c, 0xc1ab88e9, + 0x2e69e3d7, 0xc55e58d4, 0x2a9c33ea, 0xc8402893, 0x278243ad, + 0xccb5f8ae, 0x23779390, 0xd27cc81d, 0x3dbea323, 0xd6891820, + 0x394b731e, 0xdb976867, 0x34550359, 0xdf62b85a, 0x30a0d364, + 0xa9580ad1, 0x469a61ef, 0xadaddaec, 0x426fb1d2, 0xa0b3aaab, + 0x4f71c195, 0xa4467a96, 0x4b8411a8, 0xba8f4a25, 0x554d211b, + 0xbe7a9a18, 0x51b8f126, 0xb364ea5f, 0x5ca68161, 0xb7913a62, + 0x5853515c, 0x8ef68b39, 0x6134e007, 0x8a035b04, 0x65c1303a, + 0x871d2b43, 0x68df407d, 0x83e8fb7e, 0x6c2a9040, 0x9d21cbcd, + 0x72e3a0f3, 0x99d41bf0, 0x761670ce, 0x94ca6bb7, 0x7b080089, + 0x903fbb8a, 0x7ffdd0b4, 0x78bf0ea1, 0x977d659f, 0x7c4ade9c, + 0x9388b5a2, 0x7154aedb, 0x9e96c5e5, 0x75a17ee6, 0x9a6315d8, + 0x6b684e55, 0x84aa256b, 0x6f9d9e68, 0x805ff556, 0x6283ee2f, + 0x8d418511, 0x66763e12, 0x89b4552c, 0x5f118f49, 0xb0d3e477, + 0x5be45f74, 0xb426344a, 0x56fa2f33, 0xb938440d, 0x520fff0e, + 0xbdcd9430, 0x4cc6cfbd, 0xa304a483, 0x48331f80, 0xa7f174be, + 0x452d6fc7, 0xaaef04f9, 0x41d8bffa, 0xae1ad4c4, 0x37e20d71, + 0xd820664f, 0x3317dd4c, 0xdcd5b672, 0x3e09ad0b, 0xd1cbc635, + 0x3afc7d36, 0xd53e1608, 0x24354d85, 0xcbf726bb, 0x20c09db8, + 0xcf02f686, 0x2ddeedff, 0xc21c86c1, 0x292b3dc2, 0xc6e956fc, + 0x104c8c99, 0xff8ee7a7, 0x14b95ca4, 0xfb7b379a, 0x19a72ce3, + 0xf66547dd, 0x1d52fcde, 0xf29097e0, 0x039bcc6d, 0xec59a753, + 0x076e1c50, 0xe8ac776e, 0x0a706c17, 0xe5b20729, 0x0e85bc2a, + 0xe147d714}, + {0x00000000, 0x177b1443, 0x2ef62886, 0x398d3cc5, 0x5dec510c, + 0x4a97454f, 0x731a798a, 0x64616dc9, 0xbbd8a218, 0xaca3b65b, + 0x952e8a9e, 0x82559edd, 0xe634f314, 0xf14fe757, 0xc8c2db92, + 0xdfb9cfd1, 0xacc04271, 0xbbbb5632, 0x82366af7, 0x954d7eb4, + 0xf12c137d, 0xe657073e, 0xdfda3bfb, 0xc8a12fb8, 0x1718e069, + 0x0063f42a, 0x39eec8ef, 0x2e95dcac, 0x4af4b165, 0x5d8fa526, + 0x640299e3, 0x73798da0, 0x82f182a3, 0x958a96e0, 0xac07aa25, + 0xbb7cbe66, 0xdf1dd3af, 0xc866c7ec, 0xf1ebfb29, 0xe690ef6a, + 0x392920bb, 0x2e5234f8, 0x17df083d, 0x00a41c7e, 0x64c571b7, + 0x73be65f4, 0x4a335931, 0x5d484d72, 0x2e31c0d2, 0x394ad491, + 0x00c7e854, 0x17bcfc17, 0x73dd91de, 0x64a6859d, 0x5d2bb958, + 0x4a50ad1b, 0x95e962ca, 0x82927689, 0xbb1f4a4c, 0xac645e0f, + 0xc80533c6, 0xdf7e2785, 0xe6f31b40, 0xf1880f03, 0xde920307, + 0xc9e91744, 0xf0642b81, 0xe71f3fc2, 0x837e520b, 0x94054648, + 0xad887a8d, 0xbaf36ece, 0x654aa11f, 0x7231b55c, 0x4bbc8999, + 0x5cc79dda, 0x38a6f013, 0x2fdde450, 0x1650d895, 0x012bccd6, + 0x72524176, 0x65295535, 0x5ca469f0, 0x4bdf7db3, 0x2fbe107a, + 0x38c50439, 0x014838fc, 0x16332cbf, 0xc98ae36e, 0xdef1f72d, + 0xe77ccbe8, 0xf007dfab, 0x9466b262, 0x831da621, 0xba909ae4, + 0xadeb8ea7, 0x5c6381a4, 0x4b1895e7, 0x7295a922, 0x65eebd61, + 0x018fd0a8, 0x16f4c4eb, 0x2f79f82e, 0x3802ec6d, 0xe7bb23bc, + 0xf0c037ff, 0xc94d0b3a, 0xde361f79, 0xba5772b0, 0xad2c66f3, + 0x94a15a36, 0x83da4e75, 0xf0a3c3d5, 0xe7d8d796, 0xde55eb53, + 0xc92eff10, 0xad4f92d9, 0xba34869a, 0x83b9ba5f, 0x94c2ae1c, + 0x4b7b61cd, 0x5c00758e, 0x658d494b, 0x72f65d08, 0x169730c1, + 0x01ec2482, 0x38611847, 0x2f1a0c04, 0x6655004f, 0x712e140c, + 0x48a328c9, 0x5fd83c8a, 0x3bb95143, 0x2cc24500, 0x154f79c5, + 0x02346d86, 0xdd8da257, 0xcaf6b614, 0xf37b8ad1, 0xe4009e92, + 0x8061f35b, 0x971ae718, 0xae97dbdd, 0xb9eccf9e, 0xca95423e, + 0xddee567d, 0xe4636ab8, 0xf3187efb, 0x97791332, 0x80020771, + 0xb98f3bb4, 0xaef42ff7, 0x714de026, 0x6636f465, 0x5fbbc8a0, + 0x48c0dce3, 0x2ca1b12a, 0x3bdaa569, 0x025799ac, 0x152c8def, + 0xe4a482ec, 0xf3df96af, 0xca52aa6a, 0xdd29be29, 0xb948d3e0, + 0xae33c7a3, 0x97befb66, 0x80c5ef25, 0x5f7c20f4, 0x480734b7, + 0x718a0872, 0x66f11c31, 0x029071f8, 0x15eb65bb, 0x2c66597e, + 0x3b1d4d3d, 0x4864c09d, 0x5f1fd4de, 0x6692e81b, 0x71e9fc58, + 0x15889191, 0x02f385d2, 0x3b7eb917, 0x2c05ad54, 0xf3bc6285, + 0xe4c776c6, 0xdd4a4a03, 0xca315e40, 0xae503389, 0xb92b27ca, + 0x80a61b0f, 0x97dd0f4c, 0xb8c70348, 0xafbc170b, 0x96312bce, + 0x814a3f8d, 0xe52b5244, 0xf2504607, 0xcbdd7ac2, 0xdca66e81, + 0x031fa150, 0x1464b513, 0x2de989d6, 0x3a929d95, 0x5ef3f05c, + 0x4988e41f, 0x7005d8da, 0x677ecc99, 0x14074139, 0x037c557a, + 0x3af169bf, 0x2d8a7dfc, 0x49eb1035, 0x5e900476, 0x671d38b3, + 0x70662cf0, 0xafdfe321, 0xb8a4f762, 0x8129cba7, 0x9652dfe4, + 0xf233b22d, 0xe548a66e, 0xdcc59aab, 0xcbbe8ee8, 0x3a3681eb, + 0x2d4d95a8, 0x14c0a96d, 0x03bbbd2e, 0x67dad0e7, 0x70a1c4a4, + 0x492cf861, 0x5e57ec22, 0x81ee23f3, 0x969537b0, 0xaf180b75, + 0xb8631f36, 0xdc0272ff, 0xcb7966bc, 0xf2f45a79, 0xe58f4e3a, + 0x96f6c39a, 0x818dd7d9, 0xb800eb1c, 0xaf7bff5f, 0xcb1a9296, + 0xdc6186d5, 0xe5ecba10, 0xf297ae53, 0x2d2e6182, 0x3a5575c1, + 0x03d84904, 0x14a35d47, 0x70c2308e, 0x67b924cd, 0x5e341808, + 0x494f0c4b}}; + +local const z_word_t FAR crc_braid_big_table[][256] = { + {0x0000000000000000, 0x43147b1700000000, 0x8628f62e00000000, + 0xc53c8d3900000000, 0x0c51ec5d00000000, 0x4f45974a00000000, + 0x8a791a7300000000, 0xc96d616400000000, 0x18a2d8bb00000000, + 0x5bb6a3ac00000000, 0x9e8a2e9500000000, 0xdd9e558200000000, + 0x14f334e600000000, 0x57e74ff100000000, 0x92dbc2c800000000, + 0xd1cfb9df00000000, 0x7142c0ac00000000, 0x3256bbbb00000000, + 0xf76a368200000000, 0xb47e4d9500000000, 0x7d132cf100000000, + 0x3e0757e600000000, 0xfb3bdadf00000000, 0xb82fa1c800000000, + 0x69e0181700000000, 0x2af4630000000000, 0xefc8ee3900000000, + 0xacdc952e00000000, 0x65b1f44a00000000, 0x26a58f5d00000000, + 0xe399026400000000, 0xa08d797300000000, 0xa382f18200000000, + 0xe0968a9500000000, 0x25aa07ac00000000, 0x66be7cbb00000000, + 0xafd31ddf00000000, 0xecc766c800000000, 0x29fbebf100000000, + 0x6aef90e600000000, 0xbb20293900000000, 0xf834522e00000000, + 0x3d08df1700000000, 0x7e1ca40000000000, 0xb771c56400000000, + 0xf465be7300000000, 0x3159334a00000000, 0x724d485d00000000, + 0xd2c0312e00000000, 0x91d44a3900000000, 0x54e8c70000000000, + 0x17fcbc1700000000, 0xde91dd7300000000, 0x9d85a66400000000, + 0x58b92b5d00000000, 0x1bad504a00000000, 0xca62e99500000000, + 0x8976928200000000, 0x4c4a1fbb00000000, 0x0f5e64ac00000000, + 0xc63305c800000000, 0x85277edf00000000, 0x401bf3e600000000, + 0x030f88f100000000, 0x070392de00000000, 0x4417e9c900000000, + 0x812b64f000000000, 0xc23f1fe700000000, 0x0b527e8300000000, + 0x4846059400000000, 0x8d7a88ad00000000, 0xce6ef3ba00000000, + 0x1fa14a6500000000, 0x5cb5317200000000, 0x9989bc4b00000000, + 0xda9dc75c00000000, 0x13f0a63800000000, 0x50e4dd2f00000000, + 0x95d8501600000000, 0xd6cc2b0100000000, 0x7641527200000000, + 0x3555296500000000, 0xf069a45c00000000, 0xb37ddf4b00000000, + 0x7a10be2f00000000, 0x3904c53800000000, 0xfc38480100000000, + 0xbf2c331600000000, 0x6ee38ac900000000, 0x2df7f1de00000000, + 0xe8cb7ce700000000, 0xabdf07f000000000, 0x62b2669400000000, + 0x21a61d8300000000, 0xe49a90ba00000000, 0xa78eebad00000000, + 0xa481635c00000000, 0xe795184b00000000, 0x22a9957200000000, + 0x61bdee6500000000, 0xa8d08f0100000000, 0xebc4f41600000000, + 0x2ef8792f00000000, 0x6dec023800000000, 0xbc23bbe700000000, + 0xff37c0f000000000, 0x3a0b4dc900000000, 0x791f36de00000000, + 0xb07257ba00000000, 0xf3662cad00000000, 0x365aa19400000000, + 0x754eda8300000000, 0xd5c3a3f000000000, 0x96d7d8e700000000, + 0x53eb55de00000000, 0x10ff2ec900000000, 0xd9924fad00000000, + 0x9a8634ba00000000, 0x5fbab98300000000, 0x1caec29400000000, + 0xcd617b4b00000000, 0x8e75005c00000000, 0x4b498d6500000000, + 0x085df67200000000, 0xc130971600000000, 0x8224ec0100000000, + 0x4718613800000000, 0x040c1a2f00000000, 0x4f00556600000000, + 0x0c142e7100000000, 0xc928a34800000000, 0x8a3cd85f00000000, + 0x4351b93b00000000, 0x0045c22c00000000, 0xc5794f1500000000, + 0x866d340200000000, 0x57a28ddd00000000, 0x14b6f6ca00000000, + 0xd18a7bf300000000, 0x929e00e400000000, 0x5bf3618000000000, + 0x18e71a9700000000, 0xdddb97ae00000000, 0x9ecfecb900000000, + 0x3e4295ca00000000, 0x7d56eedd00000000, 0xb86a63e400000000, + 0xfb7e18f300000000, 0x3213799700000000, 0x7107028000000000, + 0xb43b8fb900000000, 0xf72ff4ae00000000, 0x26e04d7100000000, + 0x65f4366600000000, 0xa0c8bb5f00000000, 0xe3dcc04800000000, + 0x2ab1a12c00000000, 0x69a5da3b00000000, 0xac99570200000000, + 0xef8d2c1500000000, 0xec82a4e400000000, 0xaf96dff300000000, + 0x6aaa52ca00000000, 0x29be29dd00000000, 0xe0d348b900000000, + 0xa3c733ae00000000, 0x66fbbe9700000000, 0x25efc58000000000, + 0xf4207c5f00000000, 0xb734074800000000, 0x72088a7100000000, + 0x311cf16600000000, 0xf871900200000000, 0xbb65eb1500000000, + 0x7e59662c00000000, 0x3d4d1d3b00000000, 0x9dc0644800000000, + 0xded41f5f00000000, 0x1be8926600000000, 0x58fce97100000000, + 0x9191881500000000, 0xd285f30200000000, 0x17b97e3b00000000, + 0x54ad052c00000000, 0x8562bcf300000000, 0xc676c7e400000000, + 0x034a4add00000000, 0x405e31ca00000000, 0x893350ae00000000, + 0xca272bb900000000, 0x0f1ba68000000000, 0x4c0fdd9700000000, + 0x4803c7b800000000, 0x0b17bcaf00000000, 0xce2b319600000000, + 0x8d3f4a8100000000, 0x44522be500000000, 0x074650f200000000, + 0xc27addcb00000000, 0x816ea6dc00000000, 0x50a11f0300000000, + 0x13b5641400000000, 0xd689e92d00000000, 0x959d923a00000000, + 0x5cf0f35e00000000, 0x1fe4884900000000, 0xdad8057000000000, + 0x99cc7e6700000000, 0x3941071400000000, 0x7a557c0300000000, + 0xbf69f13a00000000, 0xfc7d8a2d00000000, 0x3510eb4900000000, + 0x7604905e00000000, 0xb3381d6700000000, 0xf02c667000000000, + 0x21e3dfaf00000000, 0x62f7a4b800000000, 0xa7cb298100000000, + 0xe4df529600000000, 0x2db233f200000000, 0x6ea648e500000000, + 0xab9ac5dc00000000, 0xe88ebecb00000000, 0xeb81363a00000000, + 0xa8954d2d00000000, 0x6da9c01400000000, 0x2ebdbb0300000000, + 0xe7d0da6700000000, 0xa4c4a17000000000, 0x61f82c4900000000, + 0x22ec575e00000000, 0xf323ee8100000000, 0xb037959600000000, + 0x750b18af00000000, 0x361f63b800000000, 0xff7202dc00000000, + 0xbc6679cb00000000, 0x795af4f200000000, 0x3a4e8fe500000000, + 0x9ac3f69600000000, 0xd9d78d8100000000, 0x1ceb00b800000000, + 0x5fff7baf00000000, 0x96921acb00000000, 0xd58661dc00000000, + 0x10baece500000000, 0x53ae97f200000000, 0x82612e2d00000000, + 0xc175553a00000000, 0x0449d80300000000, 0x475da31400000000, + 0x8e30c27000000000, 0xcd24b96700000000, 0x0818345e00000000, + 0x4b0c4f4900000000}, + {0x0000000000000000, 0x3e6bc2ef00000000, 0x3dd0f50400000000, + 0x03bb37eb00000000, 0x7aa0eb0900000000, 0x44cb29e600000000, + 0x47701e0d00000000, 0x791bdce200000000, 0xf440d71300000000, + 0xca2b15fc00000000, 0xc990221700000000, 0xf7fbe0f800000000, + 0x8ee03c1a00000000, 0xb08bfef500000000, 0xb330c91e00000000, + 0x8d5b0bf100000000, 0xe881ae2700000000, 0xd6ea6cc800000000, + 0xd5515b2300000000, 0xeb3a99cc00000000, 0x9221452e00000000, + 0xac4a87c100000000, 0xaff1b02a00000000, 0x919a72c500000000, + 0x1cc1793400000000, 0x22aabbdb00000000, 0x21118c3000000000, + 0x1f7a4edf00000000, 0x6661923d00000000, 0x580a50d200000000, + 0x5bb1673900000000, 0x65daa5d600000000, 0xd0035d4f00000000, + 0xee689fa000000000, 0xedd3a84b00000000, 0xd3b86aa400000000, + 0xaaa3b64600000000, 0x94c874a900000000, 0x9773434200000000, + 0xa91881ad00000000, 0x24438a5c00000000, 0x1a2848b300000000, + 0x19937f5800000000, 0x27f8bdb700000000, 0x5ee3615500000000, + 0x6088a3ba00000000, 0x6333945100000000, 0x5d5856be00000000, + 0x3882f36800000000, 0x06e9318700000000, 0x0552066c00000000, + 0x3b39c48300000000, 0x4222186100000000, 0x7c49da8e00000000, + 0x7ff2ed6500000000, 0x41992f8a00000000, 0xccc2247b00000000, + 0xf2a9e69400000000, 0xf112d17f00000000, 0xcf79139000000000, + 0xb662cf7200000000, 0x88090d9d00000000, 0x8bb23a7600000000, + 0xb5d9f89900000000, 0xa007ba9e00000000, 0x9e6c787100000000, + 0x9dd74f9a00000000, 0xa3bc8d7500000000, 0xdaa7519700000000, + 0xe4cc937800000000, 0xe777a49300000000, 0xd91c667c00000000, + 0x54476d8d00000000, 0x6a2caf6200000000, 0x6997988900000000, + 0x57fc5a6600000000, 0x2ee7868400000000, 0x108c446b00000000, + 0x1337738000000000, 0x2d5cb16f00000000, 0x488614b900000000, + 0x76edd65600000000, 0x7556e1bd00000000, 0x4b3d235200000000, + 0x3226ffb000000000, 0x0c4d3d5f00000000, 0x0ff60ab400000000, + 0x319dc85b00000000, 0xbcc6c3aa00000000, 0x82ad014500000000, + 0x811636ae00000000, 0xbf7df44100000000, 0xc66628a300000000, + 0xf80dea4c00000000, 0xfbb6dda700000000, 0xc5dd1f4800000000, + 0x7004e7d100000000, 0x4e6f253e00000000, 0x4dd412d500000000, + 0x73bfd03a00000000, 0x0aa40cd800000000, 0x34cfce3700000000, + 0x3774f9dc00000000, 0x091f3b3300000000, 0x844430c200000000, + 0xba2ff22d00000000, 0xb994c5c600000000, 0x87ff072900000000, + 0xfee4dbcb00000000, 0xc08f192400000000, 0xc3342ecf00000000, + 0xfd5fec2000000000, 0x988549f600000000, 0xa6ee8b1900000000, + 0xa555bcf200000000, 0x9b3e7e1d00000000, 0xe225a2ff00000000, + 0xdc4e601000000000, 0xdff557fb00000000, 0xe19e951400000000, + 0x6cc59ee500000000, 0x52ae5c0a00000000, 0x51156be100000000, + 0x6f7ea90e00000000, 0x166575ec00000000, 0x280eb70300000000, + 0x2bb580e800000000, 0x15de420700000000, 0x010905e600000000, + 0x3f62c70900000000, 0x3cd9f0e200000000, 0x02b2320d00000000, + 0x7ba9eeef00000000, 0x45c22c0000000000, 0x46791beb00000000, + 0x7812d90400000000, 0xf549d2f500000000, 0xcb22101a00000000, + 0xc89927f100000000, 0xf6f2e51e00000000, 0x8fe939fc00000000, + 0xb182fb1300000000, 0xb239ccf800000000, 0x8c520e1700000000, + 0xe988abc100000000, 0xd7e3692e00000000, 0xd4585ec500000000, + 0xea339c2a00000000, 0x932840c800000000, 0xad43822700000000, + 0xaef8b5cc00000000, 0x9093772300000000, 0x1dc87cd200000000, + 0x23a3be3d00000000, 0x201889d600000000, 0x1e734b3900000000, + 0x676897db00000000, 0x5903553400000000, 0x5ab862df00000000, + 0x64d3a03000000000, 0xd10a58a900000000, 0xef619a4600000000, + 0xecdaadad00000000, 0xd2b16f4200000000, 0xabaab3a000000000, + 0x95c1714f00000000, 0x967a46a400000000, 0xa811844b00000000, + 0x254a8fba00000000, 0x1b214d5500000000, 0x189a7abe00000000, + 0x26f1b85100000000, 0x5fea64b300000000, 0x6181a65c00000000, + 0x623a91b700000000, 0x5c51535800000000, 0x398bf68e00000000, + 0x07e0346100000000, 0x045b038a00000000, 0x3a30c16500000000, + 0x432b1d8700000000, 0x7d40df6800000000, 0x7efbe88300000000, + 0x40902a6c00000000, 0xcdcb219d00000000, 0xf3a0e37200000000, + 0xf01bd49900000000, 0xce70167600000000, 0xb76bca9400000000, + 0x8900087b00000000, 0x8abb3f9000000000, 0xb4d0fd7f00000000, + 0xa10ebf7800000000, 0x9f657d9700000000, 0x9cde4a7c00000000, + 0xa2b5889300000000, 0xdbae547100000000, 0xe5c5969e00000000, + 0xe67ea17500000000, 0xd815639a00000000, 0x554e686b00000000, + 0x6b25aa8400000000, 0x689e9d6f00000000, 0x56f55f8000000000, + 0x2fee836200000000, 0x1185418d00000000, 0x123e766600000000, + 0x2c55b48900000000, 0x498f115f00000000, 0x77e4d3b000000000, + 0x745fe45b00000000, 0x4a3426b400000000, 0x332ffa5600000000, + 0x0d4438b900000000, 0x0eff0f5200000000, 0x3094cdbd00000000, + 0xbdcfc64c00000000, 0x83a404a300000000, 0x801f334800000000, + 0xbe74f1a700000000, 0xc76f2d4500000000, 0xf904efaa00000000, + 0xfabfd84100000000, 0xc4d41aae00000000, 0x710de23700000000, + 0x4f6620d800000000, 0x4cdd173300000000, 0x72b6d5dc00000000, + 0x0bad093e00000000, 0x35c6cbd100000000, 0x367dfc3a00000000, + 0x08163ed500000000, 0x854d352400000000, 0xbb26f7cb00000000, + 0xb89dc02000000000, 0x86f602cf00000000, 0xffedde2d00000000, + 0xc1861cc200000000, 0xc23d2b2900000000, 0xfc56e9c600000000, + 0x998c4c1000000000, 0xa7e78eff00000000, 0xa45cb91400000000, + 0x9a377bfb00000000, 0xe32ca71900000000, 0xdd4765f600000000, + 0xdefc521d00000000, 0xe09790f200000000, 0x6dcc9b0300000000, + 0x53a759ec00000000, 0x501c6e0700000000, 0x6e77ace800000000, + 0x176c700a00000000, 0x2907b2e500000000, 0x2abc850e00000000, + 0x14d747e100000000}, + {0x0000000000000000, 0xc0df8ec100000000, 0xc1b96c5800000000, + 0x0166e29900000000, 0x8273d9b000000000, 0x42ac577100000000, + 0x43cab5e800000000, 0x83153b2900000000, 0x45e1c3ba00000000, + 0x853e4d7b00000000, 0x8458afe200000000, 0x4487212300000000, + 0xc7921a0a00000000, 0x074d94cb00000000, 0x062b765200000000, + 0xc6f4f89300000000, 0xcbc4f6ae00000000, 0x0b1b786f00000000, + 0x0a7d9af600000000, 0xcaa2143700000000, 0x49b72f1e00000000, + 0x8968a1df00000000, 0x880e434600000000, 0x48d1cd8700000000, + 0x8e25351400000000, 0x4efabbd500000000, 0x4f9c594c00000000, + 0x8f43d78d00000000, 0x0c56eca400000000, 0xcc89626500000000, + 0xcdef80fc00000000, 0x0d300e3d00000000, 0xd78f9c8600000000, + 0x1750124700000000, 0x1636f0de00000000, 0xd6e97e1f00000000, + 0x55fc453600000000, 0x9523cbf700000000, 0x9445296e00000000, + 0x549aa7af00000000, 0x926e5f3c00000000, 0x52b1d1fd00000000, + 0x53d7336400000000, 0x9308bda500000000, 0x101d868c00000000, + 0xd0c2084d00000000, 0xd1a4ead400000000, 0x117b641500000000, + 0x1c4b6a2800000000, 0xdc94e4e900000000, 0xddf2067000000000, + 0x1d2d88b100000000, 0x9e38b39800000000, 0x5ee73d5900000000, + 0x5f81dfc000000000, 0x9f5e510100000000, 0x59aaa99200000000, + 0x9975275300000000, 0x9813c5ca00000000, 0x58cc4b0b00000000, + 0xdbd9702200000000, 0x1b06fee300000000, 0x1a601c7a00000000, + 0xdabf92bb00000000, 0xef1948d600000000, 0x2fc6c61700000000, + 0x2ea0248e00000000, 0xee7faa4f00000000, 0x6d6a916600000000, + 0xadb51fa700000000, 0xacd3fd3e00000000, 0x6c0c73ff00000000, + 0xaaf88b6c00000000, 0x6a2705ad00000000, 0x6b41e73400000000, + 0xab9e69f500000000, 0x288b52dc00000000, 0xe854dc1d00000000, + 0xe9323e8400000000, 0x29edb04500000000, 0x24ddbe7800000000, + 0xe40230b900000000, 0xe564d22000000000, 0x25bb5ce100000000, + 0xa6ae67c800000000, 0x6671e90900000000, 0x67170b9000000000, + 0xa7c8855100000000, 0x613c7dc200000000, 0xa1e3f30300000000, + 0xa085119a00000000, 0x605a9f5b00000000, 0xe34fa47200000000, + 0x23902ab300000000, 0x22f6c82a00000000, 0xe22946eb00000000, + 0x3896d45000000000, 0xf8495a9100000000, 0xf92fb80800000000, + 0x39f036c900000000, 0xbae50de000000000, 0x7a3a832100000000, + 0x7b5c61b800000000, 0xbb83ef7900000000, 0x7d7717ea00000000, + 0xbda8992b00000000, 0xbcce7bb200000000, 0x7c11f57300000000, + 0xff04ce5a00000000, 0x3fdb409b00000000, 0x3ebda20200000000, + 0xfe622cc300000000, 0xf35222fe00000000, 0x338dac3f00000000, + 0x32eb4ea600000000, 0xf234c06700000000, 0x7121fb4e00000000, + 0xb1fe758f00000000, 0xb098971600000000, 0x704719d700000000, + 0xb6b3e14400000000, 0x766c6f8500000000, 0x770a8d1c00000000, + 0xb7d503dd00000000, 0x34c038f400000000, 0xf41fb63500000000, + 0xf57954ac00000000, 0x35a6da6d00000000, 0x9f35e17700000000, + 0x5fea6fb600000000, 0x5e8c8d2f00000000, 0x9e5303ee00000000, + 0x1d4638c700000000, 0xdd99b60600000000, 0xdcff549f00000000, + 0x1c20da5e00000000, 0xdad422cd00000000, 0x1a0bac0c00000000, + 0x1b6d4e9500000000, 0xdbb2c05400000000, 0x58a7fb7d00000000, + 0x987875bc00000000, 0x991e972500000000, 0x59c119e400000000, + 0x54f117d900000000, 0x942e991800000000, 0x95487b8100000000, + 0x5597f54000000000, 0xd682ce6900000000, 0x165d40a800000000, + 0x173ba23100000000, 0xd7e42cf000000000, 0x1110d46300000000, + 0xd1cf5aa200000000, 0xd0a9b83b00000000, 0x107636fa00000000, + 0x93630dd300000000, 0x53bc831200000000, 0x52da618b00000000, + 0x9205ef4a00000000, 0x48ba7df100000000, 0x8865f33000000000, + 0x890311a900000000, 0x49dc9f6800000000, 0xcac9a44100000000, + 0x0a162a8000000000, 0x0b70c81900000000, 0xcbaf46d800000000, + 0x0d5bbe4b00000000, 0xcd84308a00000000, 0xcce2d21300000000, + 0x0c3d5cd200000000, 0x8f2867fb00000000, 0x4ff7e93a00000000, + 0x4e910ba300000000, 0x8e4e856200000000, 0x837e8b5f00000000, + 0x43a1059e00000000, 0x42c7e70700000000, 0x821869c600000000, + 0x010d52ef00000000, 0xc1d2dc2e00000000, 0xc0b43eb700000000, + 0x006bb07600000000, 0xc69f48e500000000, 0x0640c62400000000, + 0x072624bd00000000, 0xc7f9aa7c00000000, 0x44ec915500000000, + 0x84331f9400000000, 0x8555fd0d00000000, 0x458a73cc00000000, + 0x702ca9a100000000, 0xb0f3276000000000, 0xb195c5f900000000, + 0x714a4b3800000000, 0xf25f701100000000, 0x3280fed000000000, + 0x33e61c4900000000, 0xf339928800000000, 0x35cd6a1b00000000, + 0xf512e4da00000000, 0xf474064300000000, 0x34ab888200000000, + 0xb7beb3ab00000000, 0x77613d6a00000000, 0x7607dff300000000, + 0xb6d8513200000000, 0xbbe85f0f00000000, 0x7b37d1ce00000000, + 0x7a51335700000000, 0xba8ebd9600000000, 0x399b86bf00000000, + 0xf944087e00000000, 0xf822eae700000000, 0x38fd642600000000, + 0xfe099cb500000000, 0x3ed6127400000000, 0x3fb0f0ed00000000, + 0xff6f7e2c00000000, 0x7c7a450500000000, 0xbca5cbc400000000, + 0xbdc3295d00000000, 0x7d1ca79c00000000, 0xa7a3352700000000, + 0x677cbbe600000000, 0x661a597f00000000, 0xa6c5d7be00000000, + 0x25d0ec9700000000, 0xe50f625600000000, 0xe46980cf00000000, + 0x24b60e0e00000000, 0xe242f69d00000000, 0x229d785c00000000, + 0x23fb9ac500000000, 0xe324140400000000, 0x60312f2d00000000, + 0xa0eea1ec00000000, 0xa188437500000000, 0x6157cdb400000000, + 0x6c67c38900000000, 0xacb84d4800000000, 0xaddeafd100000000, + 0x6d01211000000000, 0xee141a3900000000, 0x2ecb94f800000000, + 0x2fad766100000000, 0xef72f8a000000000, 0x2986003300000000, + 0xe9598ef200000000, 0xe83f6c6b00000000, 0x28e0e2aa00000000, + 0xabf5d98300000000, 0x6b2a574200000000, 0x6a4cb5db00000000, + 0xaa933b1a00000000}, + {0x0000000000000000, 0x6f4ca59b00000000, 0x9f9e3bec00000000, + 0xf0d29e7700000000, 0x7f3b060300000000, 0x1077a39800000000, + 0xe0a53def00000000, 0x8fe9987400000000, 0xfe760c0600000000, + 0x913aa99d00000000, 0x61e837ea00000000, 0x0ea4927100000000, + 0x814d0a0500000000, 0xee01af9e00000000, 0x1ed331e900000000, + 0x719f947200000000, 0xfced180c00000000, 0x93a1bd9700000000, + 0x637323e000000000, 0x0c3f867b00000000, 0x83d61e0f00000000, + 0xec9abb9400000000, 0x1c4825e300000000, 0x7304807800000000, + 0x029b140a00000000, 0x6dd7b19100000000, 0x9d052fe600000000, + 0xf2498a7d00000000, 0x7da0120900000000, 0x12ecb79200000000, + 0xe23e29e500000000, 0x8d728c7e00000000, 0xf8db311800000000, + 0x9797948300000000, 0x67450af400000000, 0x0809af6f00000000, + 0x87e0371b00000000, 0xe8ac928000000000, 0x187e0cf700000000, + 0x7732a96c00000000, 0x06ad3d1e00000000, 0x69e1988500000000, + 0x993306f200000000, 0xf67fa36900000000, 0x79963b1d00000000, + 0x16da9e8600000000, 0xe60800f100000000, 0x8944a56a00000000, + 0x0436291400000000, 0x6b7a8c8f00000000, 0x9ba812f800000000, + 0xf4e4b76300000000, 0x7b0d2f1700000000, 0x14418a8c00000000, + 0xe49314fb00000000, 0x8bdfb16000000000, 0xfa40251200000000, + 0x950c808900000000, 0x65de1efe00000000, 0x0a92bb6500000000, + 0x857b231100000000, 0xea37868a00000000, 0x1ae518fd00000000, + 0x75a9bd6600000000, 0xf0b7633000000000, 0x9ffbc6ab00000000, + 0x6f2958dc00000000, 0x0065fd4700000000, 0x8f8c653300000000, + 0xe0c0c0a800000000, 0x10125edf00000000, 0x7f5efb4400000000, + 0x0ec16f3600000000, 0x618dcaad00000000, 0x915f54da00000000, + 0xfe13f14100000000, 0x71fa693500000000, 0x1eb6ccae00000000, + 0xee6452d900000000, 0x8128f74200000000, 0x0c5a7b3c00000000, + 0x6316dea700000000, 0x93c440d000000000, 0xfc88e54b00000000, + 0x73617d3f00000000, 0x1c2dd8a400000000, 0xecff46d300000000, + 0x83b3e34800000000, 0xf22c773a00000000, 0x9d60d2a100000000, + 0x6db24cd600000000, 0x02fee94d00000000, 0x8d17713900000000, + 0xe25bd4a200000000, 0x12894ad500000000, 0x7dc5ef4e00000000, + 0x086c522800000000, 0x6720f7b300000000, 0x97f269c400000000, + 0xf8becc5f00000000, 0x7757542b00000000, 0x181bf1b000000000, + 0xe8c96fc700000000, 0x8785ca5c00000000, 0xf61a5e2e00000000, + 0x9956fbb500000000, 0x698465c200000000, 0x06c8c05900000000, + 0x8921582d00000000, 0xe66dfdb600000000, 0x16bf63c100000000, + 0x79f3c65a00000000, 0xf4814a2400000000, 0x9bcdefbf00000000, + 0x6b1f71c800000000, 0x0453d45300000000, 0x8bba4c2700000000, + 0xe4f6e9bc00000000, 0x142477cb00000000, 0x7b68d25000000000, + 0x0af7462200000000, 0x65bbe3b900000000, 0x95697dce00000000, + 0xfa25d85500000000, 0x75cc402100000000, 0x1a80e5ba00000000, + 0xea527bcd00000000, 0x851ede5600000000, 0xe06fc76000000000, + 0x8f2362fb00000000, 0x7ff1fc8c00000000, 0x10bd591700000000, + 0x9f54c16300000000, 0xf01864f800000000, 0x00cafa8f00000000, + 0x6f865f1400000000, 0x1e19cb6600000000, 0x71556efd00000000, + 0x8187f08a00000000, 0xeecb551100000000, 0x6122cd6500000000, + 0x0e6e68fe00000000, 0xfebcf68900000000, 0x91f0531200000000, + 0x1c82df6c00000000, 0x73ce7af700000000, 0x831ce48000000000, + 0xec50411b00000000, 0x63b9d96f00000000, 0x0cf57cf400000000, + 0xfc27e28300000000, 0x936b471800000000, 0xe2f4d36a00000000, + 0x8db876f100000000, 0x7d6ae88600000000, 0x12264d1d00000000, + 0x9dcfd56900000000, 0xf28370f200000000, 0x0251ee8500000000, + 0x6d1d4b1e00000000, 0x18b4f67800000000, 0x77f853e300000000, + 0x872acd9400000000, 0xe866680f00000000, 0x678ff07b00000000, + 0x08c355e000000000, 0xf811cb9700000000, 0x975d6e0c00000000, + 0xe6c2fa7e00000000, 0x898e5fe500000000, 0x795cc19200000000, + 0x1610640900000000, 0x99f9fc7d00000000, 0xf6b559e600000000, + 0x0667c79100000000, 0x692b620a00000000, 0xe459ee7400000000, + 0x8b154bef00000000, 0x7bc7d59800000000, 0x148b700300000000, + 0x9b62e87700000000, 0xf42e4dec00000000, 0x04fcd39b00000000, + 0x6bb0760000000000, 0x1a2fe27200000000, 0x756347e900000000, + 0x85b1d99e00000000, 0xeafd7c0500000000, 0x6514e47100000000, + 0x0a5841ea00000000, 0xfa8adf9d00000000, 0x95c67a0600000000, + 0x10d8a45000000000, 0x7f9401cb00000000, 0x8f469fbc00000000, + 0xe00a3a2700000000, 0x6fe3a25300000000, 0x00af07c800000000, + 0xf07d99bf00000000, 0x9f313c2400000000, 0xeeaea85600000000, + 0x81e20dcd00000000, 0x713093ba00000000, 0x1e7c362100000000, + 0x9195ae5500000000, 0xfed90bce00000000, 0x0e0b95b900000000, + 0x6147302200000000, 0xec35bc5c00000000, 0x837919c700000000, + 0x73ab87b000000000, 0x1ce7222b00000000, 0x930eba5f00000000, + 0xfc421fc400000000, 0x0c9081b300000000, 0x63dc242800000000, + 0x1243b05a00000000, 0x7d0f15c100000000, 0x8ddd8bb600000000, + 0xe2912e2d00000000, 0x6d78b65900000000, 0x023413c200000000, + 0xf2e68db500000000, 0x9daa282e00000000, 0xe803954800000000, + 0x874f30d300000000, 0x779daea400000000, 0x18d10b3f00000000, + 0x9738934b00000000, 0xf87436d000000000, 0x08a6a8a700000000, + 0x67ea0d3c00000000, 0x1675994e00000000, 0x79393cd500000000, + 0x89eba2a200000000, 0xe6a7073900000000, 0x694e9f4d00000000, + 0x06023ad600000000, 0xf6d0a4a100000000, 0x999c013a00000000, + 0x14ee8d4400000000, 0x7ba228df00000000, 0x8b70b6a800000000, + 0xe43c133300000000, 0x6bd58b4700000000, 0x04992edc00000000, + 0xf44bb0ab00000000, 0x9b07153000000000, 0xea98814200000000, + 0x85d424d900000000, 0x7506baae00000000, 0x1a4a1f3500000000, + 0x95a3874100000000, 0xfaef22da00000000, 0x0a3dbcad00000000, + 0x6571193600000000}, + {0x0000000000000000, 0x85d996dd00000000, 0x4bb55c6000000000, + 0xce6ccabd00000000, 0x966ab9c000000000, 0x13b32f1d00000000, + 0xdddfe5a000000000, 0x5806737d00000000, 0x6dd3035a00000000, + 0xe80a958700000000, 0x26665f3a00000000, 0xa3bfc9e700000000, + 0xfbb9ba9a00000000, 0x7e602c4700000000, 0xb00ce6fa00000000, + 0x35d5702700000000, 0xdaa607b400000000, 0x5f7f916900000000, + 0x91135bd400000000, 0x14cacd0900000000, 0x4cccbe7400000000, + 0xc91528a900000000, 0x0779e21400000000, 0x82a074c900000000, + 0xb77504ee00000000, 0x32ac923300000000, 0xfcc0588e00000000, + 0x7919ce5300000000, 0x211fbd2e00000000, 0xa4c62bf300000000, + 0x6aaae14e00000000, 0xef73779300000000, 0xf54b7eb300000000, + 0x7092e86e00000000, 0xbefe22d300000000, 0x3b27b40e00000000, + 0x6321c77300000000, 0xe6f851ae00000000, 0x28949b1300000000, + 0xad4d0dce00000000, 0x98987de900000000, 0x1d41eb3400000000, + 0xd32d218900000000, 0x56f4b75400000000, 0x0ef2c42900000000, + 0x8b2b52f400000000, 0x4547984900000000, 0xc09e0e9400000000, + 0x2fed790700000000, 0xaa34efda00000000, 0x6458256700000000, + 0xe181b3ba00000000, 0xb987c0c700000000, 0x3c5e561a00000000, + 0xf2329ca700000000, 0x77eb0a7a00000000, 0x423e7a5d00000000, + 0xc7e7ec8000000000, 0x098b263d00000000, 0x8c52b0e000000000, + 0xd454c39d00000000, 0x518d554000000000, 0x9fe19ffd00000000, + 0x1a38092000000000, 0xab918dbd00000000, 0x2e481b6000000000, + 0xe024d1dd00000000, 0x65fd470000000000, 0x3dfb347d00000000, + 0xb822a2a000000000, 0x764e681d00000000, 0xf397fec000000000, + 0xc6428ee700000000, 0x439b183a00000000, 0x8df7d28700000000, + 0x082e445a00000000, 0x5028372700000000, 0xd5f1a1fa00000000, + 0x1b9d6b4700000000, 0x9e44fd9a00000000, 0x71378a0900000000, + 0xf4ee1cd400000000, 0x3a82d66900000000, 0xbf5b40b400000000, + 0xe75d33c900000000, 0x6284a51400000000, 0xace86fa900000000, + 0x2931f97400000000, 0x1ce4895300000000, 0x993d1f8e00000000, + 0x5751d53300000000, 0xd28843ee00000000, 0x8a8e309300000000, + 0x0f57a64e00000000, 0xc13b6cf300000000, 0x44e2fa2e00000000, + 0x5edaf30e00000000, 0xdb0365d300000000, 0x156faf6e00000000, + 0x90b639b300000000, 0xc8b04ace00000000, 0x4d69dc1300000000, + 0x830516ae00000000, 0x06dc807300000000, 0x3309f05400000000, + 0xb6d0668900000000, 0x78bcac3400000000, 0xfd653ae900000000, + 0xa563499400000000, 0x20badf4900000000, 0xeed615f400000000, + 0x6b0f832900000000, 0x847cf4ba00000000, 0x01a5626700000000, + 0xcfc9a8da00000000, 0x4a103e0700000000, 0x12164d7a00000000, + 0x97cfdba700000000, 0x59a3111a00000000, 0xdc7a87c700000000, + 0xe9aff7e000000000, 0x6c76613d00000000, 0xa21aab8000000000, + 0x27c33d5d00000000, 0x7fc54e2000000000, 0xfa1cd8fd00000000, + 0x3470124000000000, 0xb1a9849d00000000, 0x17256aa000000000, + 0x92fcfc7d00000000, 0x5c9036c000000000, 0xd949a01d00000000, + 0x814fd36000000000, 0x049645bd00000000, 0xcafa8f0000000000, + 0x4f2319dd00000000, 0x7af669fa00000000, 0xff2fff2700000000, + 0x3143359a00000000, 0xb49aa34700000000, 0xec9cd03a00000000, + 0x694546e700000000, 0xa7298c5a00000000, 0x22f01a8700000000, + 0xcd836d1400000000, 0x485afbc900000000, 0x8636317400000000, + 0x03efa7a900000000, 0x5be9d4d400000000, 0xde30420900000000, + 0x105c88b400000000, 0x95851e6900000000, 0xa0506e4e00000000, + 0x2589f89300000000, 0xebe5322e00000000, 0x6e3ca4f300000000, + 0x363ad78e00000000, 0xb3e3415300000000, 0x7d8f8bee00000000, + 0xf8561d3300000000, 0xe26e141300000000, 0x67b782ce00000000, + 0xa9db487300000000, 0x2c02deae00000000, 0x7404add300000000, + 0xf1dd3b0e00000000, 0x3fb1f1b300000000, 0xba68676e00000000, + 0x8fbd174900000000, 0x0a64819400000000, 0xc4084b2900000000, + 0x41d1ddf400000000, 0x19d7ae8900000000, 0x9c0e385400000000, + 0x5262f2e900000000, 0xd7bb643400000000, 0x38c813a700000000, + 0xbd11857a00000000, 0x737d4fc700000000, 0xf6a4d91a00000000, + 0xaea2aa6700000000, 0x2b7b3cba00000000, 0xe517f60700000000, + 0x60ce60da00000000, 0x551b10fd00000000, 0xd0c2862000000000, + 0x1eae4c9d00000000, 0x9b77da4000000000, 0xc371a93d00000000, + 0x46a83fe000000000, 0x88c4f55d00000000, 0x0d1d638000000000, + 0xbcb4e71d00000000, 0x396d71c000000000, 0xf701bb7d00000000, + 0x72d82da000000000, 0x2ade5edd00000000, 0xaf07c80000000000, + 0x616b02bd00000000, 0xe4b2946000000000, 0xd167e44700000000, + 0x54be729a00000000, 0x9ad2b82700000000, 0x1f0b2efa00000000, + 0x470d5d8700000000, 0xc2d4cb5a00000000, 0x0cb801e700000000, + 0x8961973a00000000, 0x6612e0a900000000, 0xe3cb767400000000, + 0x2da7bcc900000000, 0xa87e2a1400000000, 0xf078596900000000, + 0x75a1cfb400000000, 0xbbcd050900000000, 0x3e1493d400000000, + 0x0bc1e3f300000000, 0x8e18752e00000000, 0x4074bf9300000000, + 0xc5ad294e00000000, 0x9dab5a3300000000, 0x1872ccee00000000, + 0xd61e065300000000, 0x53c7908e00000000, 0x49ff99ae00000000, + 0xcc260f7300000000, 0x024ac5ce00000000, 0x8793531300000000, + 0xdf95206e00000000, 0x5a4cb6b300000000, 0x94207c0e00000000, + 0x11f9ead300000000, 0x242c9af400000000, 0xa1f50c2900000000, + 0x6f99c69400000000, 0xea40504900000000, 0xb246233400000000, + 0x379fb5e900000000, 0xf9f37f5400000000, 0x7c2ae98900000000, + 0x93599e1a00000000, 0x168008c700000000, 0xd8ecc27a00000000, + 0x5d3554a700000000, 0x053327da00000000, 0x80eab10700000000, + 0x4e867bba00000000, 0xcb5fed6700000000, 0xfe8a9d4000000000, + 0x7b530b9d00000000, 0xb53fc12000000000, 0x30e657fd00000000, + 0x68e0248000000000, 0xed39b25d00000000, 0x235578e000000000, + 0xa68cee3d00000000}, + {0x0000000000000000, 0x76e10f9d00000000, 0xadc46ee100000000, + 0xdb25617c00000000, 0x1b8fac1900000000, 0x6d6ea38400000000, + 0xb64bc2f800000000, 0xc0aacd6500000000, 0x361e593300000000, + 0x40ff56ae00000000, 0x9bda37d200000000, 0xed3b384f00000000, + 0x2d91f52a00000000, 0x5b70fab700000000, 0x80559bcb00000000, + 0xf6b4945600000000, 0x6c3cb26600000000, 0x1addbdfb00000000, + 0xc1f8dc8700000000, 0xb719d31a00000000, 0x77b31e7f00000000, + 0x015211e200000000, 0xda77709e00000000, 0xac967f0300000000, + 0x5a22eb5500000000, 0x2cc3e4c800000000, 0xf7e685b400000000, + 0x81078a2900000000, 0x41ad474c00000000, 0x374c48d100000000, + 0xec6929ad00000000, 0x9a88263000000000, 0xd87864cd00000000, + 0xae996b5000000000, 0x75bc0a2c00000000, 0x035d05b100000000, + 0xc3f7c8d400000000, 0xb516c74900000000, 0x6e33a63500000000, + 0x18d2a9a800000000, 0xee663dfe00000000, 0x9887326300000000, + 0x43a2531f00000000, 0x35435c8200000000, 0xf5e991e700000000, + 0x83089e7a00000000, 0x582dff0600000000, 0x2eccf09b00000000, + 0xb444d6ab00000000, 0xc2a5d93600000000, 0x1980b84a00000000, + 0x6f61b7d700000000, 0xafcb7ab200000000, 0xd92a752f00000000, + 0x020f145300000000, 0x74ee1bce00000000, 0x825a8f9800000000, + 0xf4bb800500000000, 0x2f9ee17900000000, 0x597feee400000000, + 0x99d5238100000000, 0xef342c1c00000000, 0x34114d6000000000, + 0x42f042fd00000000, 0xf1f7b94100000000, 0x8716b6dc00000000, + 0x5c33d7a000000000, 0x2ad2d83d00000000, 0xea78155800000000, + 0x9c991ac500000000, 0x47bc7bb900000000, 0x315d742400000000, + 0xc7e9e07200000000, 0xb108efef00000000, 0x6a2d8e9300000000, + 0x1ccc810e00000000, 0xdc664c6b00000000, 0xaa8743f600000000, + 0x71a2228a00000000, 0x07432d1700000000, 0x9dcb0b2700000000, + 0xeb2a04ba00000000, 0x300f65c600000000, 0x46ee6a5b00000000, + 0x8644a73e00000000, 0xf0a5a8a300000000, 0x2b80c9df00000000, + 0x5d61c64200000000, 0xabd5521400000000, 0xdd345d8900000000, + 0x06113cf500000000, 0x70f0336800000000, 0xb05afe0d00000000, + 0xc6bbf19000000000, 0x1d9e90ec00000000, 0x6b7f9f7100000000, + 0x298fdd8c00000000, 0x5f6ed21100000000, 0x844bb36d00000000, + 0xf2aabcf000000000, 0x3200719500000000, 0x44e17e0800000000, + 0x9fc41f7400000000, 0xe92510e900000000, 0x1f9184bf00000000, + 0x69708b2200000000, 0xb255ea5e00000000, 0xc4b4e5c300000000, + 0x041e28a600000000, 0x72ff273b00000000, 0xa9da464700000000, + 0xdf3b49da00000000, 0x45b36fea00000000, 0x3352607700000000, + 0xe877010b00000000, 0x9e960e9600000000, 0x5e3cc3f300000000, + 0x28ddcc6e00000000, 0xf3f8ad1200000000, 0x8519a28f00000000, + 0x73ad36d900000000, 0x054c394400000000, 0xde69583800000000, + 0xa88857a500000000, 0x68229ac000000000, 0x1ec3955d00000000, + 0xc5e6f42100000000, 0xb307fbbc00000000, 0xe2ef738300000000, + 0x940e7c1e00000000, 0x4f2b1d6200000000, 0x39ca12ff00000000, + 0xf960df9a00000000, 0x8f81d00700000000, 0x54a4b17b00000000, + 0x2245bee600000000, 0xd4f12ab000000000, 0xa210252d00000000, + 0x7935445100000000, 0x0fd44bcc00000000, 0xcf7e86a900000000, + 0xb99f893400000000, 0x62bae84800000000, 0x145be7d500000000, + 0x8ed3c1e500000000, 0xf832ce7800000000, 0x2317af0400000000, + 0x55f6a09900000000, 0x955c6dfc00000000, 0xe3bd626100000000, + 0x3898031d00000000, 0x4e790c8000000000, 0xb8cd98d600000000, + 0xce2c974b00000000, 0x1509f63700000000, 0x63e8f9aa00000000, + 0xa34234cf00000000, 0xd5a33b5200000000, 0x0e865a2e00000000, + 0x786755b300000000, 0x3a97174e00000000, 0x4c7618d300000000, + 0x975379af00000000, 0xe1b2763200000000, 0x2118bb5700000000, + 0x57f9b4ca00000000, 0x8cdcd5b600000000, 0xfa3dda2b00000000, + 0x0c894e7d00000000, 0x7a6841e000000000, 0xa14d209c00000000, + 0xd7ac2f0100000000, 0x1706e26400000000, 0x61e7edf900000000, + 0xbac28c8500000000, 0xcc23831800000000, 0x56aba52800000000, + 0x204aaab500000000, 0xfb6fcbc900000000, 0x8d8ec45400000000, + 0x4d24093100000000, 0x3bc506ac00000000, 0xe0e067d000000000, + 0x9601684d00000000, 0x60b5fc1b00000000, 0x1654f38600000000, + 0xcd7192fa00000000, 0xbb909d6700000000, 0x7b3a500200000000, + 0x0ddb5f9f00000000, 0xd6fe3ee300000000, 0xa01f317e00000000, + 0x1318cac200000000, 0x65f9c55f00000000, 0xbedca42300000000, + 0xc83dabbe00000000, 0x089766db00000000, 0x7e76694600000000, + 0xa553083a00000000, 0xd3b207a700000000, 0x250693f100000000, + 0x53e79c6c00000000, 0x88c2fd1000000000, 0xfe23f28d00000000, + 0x3e893fe800000000, 0x4868307500000000, 0x934d510900000000, + 0xe5ac5e9400000000, 0x7f2478a400000000, 0x09c5773900000000, + 0xd2e0164500000000, 0xa40119d800000000, 0x64abd4bd00000000, + 0x124adb2000000000, 0xc96fba5c00000000, 0xbf8eb5c100000000, + 0x493a219700000000, 0x3fdb2e0a00000000, 0xe4fe4f7600000000, + 0x921f40eb00000000, 0x52b58d8e00000000, 0x2454821300000000, + 0xff71e36f00000000, 0x8990ecf200000000, 0xcb60ae0f00000000, + 0xbd81a19200000000, 0x66a4c0ee00000000, 0x1045cf7300000000, + 0xd0ef021600000000, 0xa60e0d8b00000000, 0x7d2b6cf700000000, + 0x0bca636a00000000, 0xfd7ef73c00000000, 0x8b9ff8a100000000, + 0x50ba99dd00000000, 0x265b964000000000, 0xe6f15b2500000000, + 0x901054b800000000, 0x4b3535c400000000, 0x3dd43a5900000000, + 0xa75c1c6900000000, 0xd1bd13f400000000, 0x0a98728800000000, + 0x7c797d1500000000, 0xbcd3b07000000000, 0xca32bfed00000000, + 0x1117de9100000000, 0x67f6d10c00000000, 0x9142455a00000000, + 0xe7a34ac700000000, 0x3c862bbb00000000, 0x4a67242600000000, + 0x8acde94300000000, 0xfc2ce6de00000000, 0x270987a200000000, + 0x51e8883f00000000}, + {0x0000000000000000, 0xe8dbfbb900000000, 0x91b186a800000000, + 0x796a7d1100000000, 0x63657c8a00000000, 0x8bbe873300000000, + 0xf2d4fa2200000000, 0x1a0f019b00000000, 0x87cc89cf00000000, + 0x6f17727600000000, 0x167d0f6700000000, 0xfea6f4de00000000, + 0xe4a9f54500000000, 0x0c720efc00000000, 0x751873ed00000000, + 0x9dc3885400000000, 0x4f9f624400000000, 0xa74499fd00000000, + 0xde2ee4ec00000000, 0x36f51f5500000000, 0x2cfa1ece00000000, + 0xc421e57700000000, 0xbd4b986600000000, 0x559063df00000000, + 0xc853eb8b00000000, 0x2088103200000000, 0x59e26d2300000000, + 0xb139969a00000000, 0xab36970100000000, 0x43ed6cb800000000, + 0x3a8711a900000000, 0xd25cea1000000000, 0x9e3ec58800000000, + 0x76e53e3100000000, 0x0f8f432000000000, 0xe754b89900000000, + 0xfd5bb90200000000, 0x158042bb00000000, 0x6cea3faa00000000, + 0x8431c41300000000, 0x19f24c4700000000, 0xf129b7fe00000000, + 0x8843caef00000000, 0x6098315600000000, 0x7a9730cd00000000, + 0x924ccb7400000000, 0xeb26b66500000000, 0x03fd4ddc00000000, + 0xd1a1a7cc00000000, 0x397a5c7500000000, 0x4010216400000000, + 0xa8cbdadd00000000, 0xb2c4db4600000000, 0x5a1f20ff00000000, + 0x23755dee00000000, 0xcbaea65700000000, 0x566d2e0300000000, + 0xbeb6d5ba00000000, 0xc7dca8ab00000000, 0x2f07531200000000, + 0x3508528900000000, 0xddd3a93000000000, 0xa4b9d42100000000, + 0x4c622f9800000000, 0x7d7bfbca00000000, 0x95a0007300000000, + 0xecca7d6200000000, 0x041186db00000000, 0x1e1e874000000000, + 0xf6c57cf900000000, 0x8faf01e800000000, 0x6774fa5100000000, + 0xfab7720500000000, 0x126c89bc00000000, 0x6b06f4ad00000000, + 0x83dd0f1400000000, 0x99d20e8f00000000, 0x7109f53600000000, + 0x0863882700000000, 0xe0b8739e00000000, 0x32e4998e00000000, + 0xda3f623700000000, 0xa3551f2600000000, 0x4b8ee49f00000000, + 0x5181e50400000000, 0xb95a1ebd00000000, 0xc03063ac00000000, + 0x28eb981500000000, 0xb528104100000000, 0x5df3ebf800000000, + 0x249996e900000000, 0xcc426d5000000000, 0xd64d6ccb00000000, + 0x3e96977200000000, 0x47fcea6300000000, 0xaf2711da00000000, + 0xe3453e4200000000, 0x0b9ec5fb00000000, 0x72f4b8ea00000000, + 0x9a2f435300000000, 0x802042c800000000, 0x68fbb97100000000, + 0x1191c46000000000, 0xf94a3fd900000000, 0x6489b78d00000000, + 0x8c524c3400000000, 0xf538312500000000, 0x1de3ca9c00000000, + 0x07eccb0700000000, 0xef3730be00000000, 0x965d4daf00000000, + 0x7e86b61600000000, 0xacda5c0600000000, 0x4401a7bf00000000, + 0x3d6bdaae00000000, 0xd5b0211700000000, 0xcfbf208c00000000, + 0x2764db3500000000, 0x5e0ea62400000000, 0xb6d55d9d00000000, + 0x2b16d5c900000000, 0xc3cd2e7000000000, 0xbaa7536100000000, + 0x527ca8d800000000, 0x4873a94300000000, 0xa0a852fa00000000, + 0xd9c22feb00000000, 0x3119d45200000000, 0xbbf0874e00000000, + 0x532b7cf700000000, 0x2a4101e600000000, 0xc29afa5f00000000, + 0xd895fbc400000000, 0x304e007d00000000, 0x49247d6c00000000, + 0xa1ff86d500000000, 0x3c3c0e8100000000, 0xd4e7f53800000000, + 0xad8d882900000000, 0x4556739000000000, 0x5f59720b00000000, + 0xb78289b200000000, 0xcee8f4a300000000, 0x26330f1a00000000, + 0xf46fe50a00000000, 0x1cb41eb300000000, 0x65de63a200000000, + 0x8d05981b00000000, 0x970a998000000000, 0x7fd1623900000000, + 0x06bb1f2800000000, 0xee60e49100000000, 0x73a36cc500000000, + 0x9b78977c00000000, 0xe212ea6d00000000, 0x0ac911d400000000, + 0x10c6104f00000000, 0xf81debf600000000, 0x817796e700000000, + 0x69ac6d5e00000000, 0x25ce42c600000000, 0xcd15b97f00000000, + 0xb47fc46e00000000, 0x5ca43fd700000000, 0x46ab3e4c00000000, + 0xae70c5f500000000, 0xd71ab8e400000000, 0x3fc1435d00000000, + 0xa202cb0900000000, 0x4ad930b000000000, 0x33b34da100000000, + 0xdb68b61800000000, 0xc167b78300000000, 0x29bc4c3a00000000, + 0x50d6312b00000000, 0xb80dca9200000000, 0x6a51208200000000, + 0x828adb3b00000000, 0xfbe0a62a00000000, 0x133b5d9300000000, + 0x09345c0800000000, 0xe1efa7b100000000, 0x9885daa000000000, + 0x705e211900000000, 0xed9da94d00000000, 0x054652f400000000, + 0x7c2c2fe500000000, 0x94f7d45c00000000, 0x8ef8d5c700000000, + 0x66232e7e00000000, 0x1f49536f00000000, 0xf792a8d600000000, + 0xc68b7c8400000000, 0x2e50873d00000000, 0x573afa2c00000000, + 0xbfe1019500000000, 0xa5ee000e00000000, 0x4d35fbb700000000, + 0x345f86a600000000, 0xdc847d1f00000000, 0x4147f54b00000000, + 0xa99c0ef200000000, 0xd0f673e300000000, 0x382d885a00000000, + 0x222289c100000000, 0xcaf9727800000000, 0xb3930f6900000000, + 0x5b48f4d000000000, 0x89141ec000000000, 0x61cfe57900000000, + 0x18a5986800000000, 0xf07e63d100000000, 0xea71624a00000000, + 0x02aa99f300000000, 0x7bc0e4e200000000, 0x931b1f5b00000000, + 0x0ed8970f00000000, 0xe6036cb600000000, 0x9f6911a700000000, + 0x77b2ea1e00000000, 0x6dbdeb8500000000, 0x8566103c00000000, + 0xfc0c6d2d00000000, 0x14d7969400000000, 0x58b5b90c00000000, + 0xb06e42b500000000, 0xc9043fa400000000, 0x21dfc41d00000000, + 0x3bd0c58600000000, 0xd30b3e3f00000000, 0xaa61432e00000000, + 0x42bab89700000000, 0xdf7930c300000000, 0x37a2cb7a00000000, + 0x4ec8b66b00000000, 0xa6134dd200000000, 0xbc1c4c4900000000, + 0x54c7b7f000000000, 0x2dadcae100000000, 0xc576315800000000, + 0x172adb4800000000, 0xfff120f100000000, 0x869b5de000000000, + 0x6e40a65900000000, 0x744fa7c200000000, 0x9c945c7b00000000, + 0xe5fe216a00000000, 0x0d25dad300000000, 0x90e6528700000000, + 0x783da93e00000000, 0x0157d42f00000000, 0xe98c2f9600000000, + 0xf3832e0d00000000, 0x1b58d5b400000000, 0x6232a8a500000000, + 0x8ae9531c00000000}, + {0x0000000000000000, 0x919168ae00000000, 0x6325a08700000000, + 0xf2b4c82900000000, 0x874c31d400000000, 0x16dd597a00000000, + 0xe469915300000000, 0x75f8f9fd00000000, 0x4f9f137300000000, + 0xde0e7bdd00000000, 0x2cbab3f400000000, 0xbd2bdb5a00000000, + 0xc8d322a700000000, 0x59424a0900000000, 0xabf6822000000000, + 0x3a67ea8e00000000, 0x9e3e27e600000000, 0x0faf4f4800000000, + 0xfd1b876100000000, 0x6c8aefcf00000000, 0x1972163200000000, + 0x88e37e9c00000000, 0x7a57b6b500000000, 0xebc6de1b00000000, + 0xd1a1349500000000, 0x40305c3b00000000, 0xb284941200000000, + 0x2315fcbc00000000, 0x56ed054100000000, 0xc77c6def00000000, + 0x35c8a5c600000000, 0xa459cd6800000000, 0x7d7b3f1700000000, + 0xecea57b900000000, 0x1e5e9f9000000000, 0x8fcff73e00000000, + 0xfa370ec300000000, 0x6ba6666d00000000, 0x9912ae4400000000, + 0x0883c6ea00000000, 0x32e42c6400000000, 0xa37544ca00000000, + 0x51c18ce300000000, 0xc050e44d00000000, 0xb5a81db000000000, + 0x2439751e00000000, 0xd68dbd3700000000, 0x471cd59900000000, + 0xe34518f100000000, 0x72d4705f00000000, 0x8060b87600000000, + 0x11f1d0d800000000, 0x6409292500000000, 0xf598418b00000000, + 0x072c89a200000000, 0x96bde10c00000000, 0xacda0b8200000000, + 0x3d4b632c00000000, 0xcfffab0500000000, 0x5e6ec3ab00000000, + 0x2b963a5600000000, 0xba0752f800000000, 0x48b39ad100000000, + 0xd922f27f00000000, 0xfaf67e2e00000000, 0x6b67168000000000, + 0x99d3dea900000000, 0x0842b60700000000, 0x7dba4ffa00000000, + 0xec2b275400000000, 0x1e9fef7d00000000, 0x8f0e87d300000000, + 0xb5696d5d00000000, 0x24f805f300000000, 0xd64ccdda00000000, + 0x47dda57400000000, 0x32255c8900000000, 0xa3b4342700000000, + 0x5100fc0e00000000, 0xc09194a000000000, 0x64c859c800000000, + 0xf559316600000000, 0x07edf94f00000000, 0x967c91e100000000, + 0xe384681c00000000, 0x721500b200000000, 0x80a1c89b00000000, + 0x1130a03500000000, 0x2b574abb00000000, 0xbac6221500000000, + 0x4872ea3c00000000, 0xd9e3829200000000, 0xac1b7b6f00000000, + 0x3d8a13c100000000, 0xcf3edbe800000000, 0x5eafb34600000000, + 0x878d413900000000, 0x161c299700000000, 0xe4a8e1be00000000, + 0x7539891000000000, 0x00c170ed00000000, 0x9150184300000000, + 0x63e4d06a00000000, 0xf275b8c400000000, 0xc812524a00000000, + 0x59833ae400000000, 0xab37f2cd00000000, 0x3aa69a6300000000, + 0x4f5e639e00000000, 0xdecf0b3000000000, 0x2c7bc31900000000, + 0xbdeaabb700000000, 0x19b366df00000000, 0x88220e7100000000, + 0x7a96c65800000000, 0xeb07aef600000000, 0x9eff570b00000000, + 0x0f6e3fa500000000, 0xfddaf78c00000000, 0x6c4b9f2200000000, + 0x562c75ac00000000, 0xc7bd1d0200000000, 0x3509d52b00000000, + 0xa498bd8500000000, 0xd160447800000000, 0x40f12cd600000000, + 0xb245e4ff00000000, 0x23d48c5100000000, 0xf4edfd5c00000000, + 0x657c95f200000000, 0x97c85ddb00000000, 0x0659357500000000, + 0x73a1cc8800000000, 0xe230a42600000000, 0x10846c0f00000000, + 0x811504a100000000, 0xbb72ee2f00000000, 0x2ae3868100000000, + 0xd8574ea800000000, 0x49c6260600000000, 0x3c3edffb00000000, + 0xadafb75500000000, 0x5f1b7f7c00000000, 0xce8a17d200000000, + 0x6ad3daba00000000, 0xfb42b21400000000, 0x09f67a3d00000000, + 0x9867129300000000, 0xed9feb6e00000000, 0x7c0e83c000000000, + 0x8eba4be900000000, 0x1f2b234700000000, 0x254cc9c900000000, + 0xb4dda16700000000, 0x4669694e00000000, 0xd7f801e000000000, + 0xa200f81d00000000, 0x339190b300000000, 0xc125589a00000000, + 0x50b4303400000000, 0x8996c24b00000000, 0x1807aae500000000, + 0xeab362cc00000000, 0x7b220a6200000000, 0x0edaf39f00000000, + 0x9f4b9b3100000000, 0x6dff531800000000, 0xfc6e3bb600000000, + 0xc609d13800000000, 0x5798b99600000000, 0xa52c71bf00000000, + 0x34bd191100000000, 0x4145e0ec00000000, 0xd0d4884200000000, + 0x2260406b00000000, 0xb3f128c500000000, 0x17a8e5ad00000000, + 0x86398d0300000000, 0x748d452a00000000, 0xe51c2d8400000000, + 0x90e4d47900000000, 0x0175bcd700000000, 0xf3c174fe00000000, + 0x62501c5000000000, 0x5837f6de00000000, 0xc9a69e7000000000, + 0x3b12565900000000, 0xaa833ef700000000, 0xdf7bc70a00000000, + 0x4eeaafa400000000, 0xbc5e678d00000000, 0x2dcf0f2300000000, + 0x0e1b837200000000, 0x9f8aebdc00000000, 0x6d3e23f500000000, + 0xfcaf4b5b00000000, 0x8957b2a600000000, 0x18c6da0800000000, + 0xea72122100000000, 0x7be37a8f00000000, 0x4184900100000000, + 0xd015f8af00000000, 0x22a1308600000000, 0xb330582800000000, + 0xc6c8a1d500000000, 0x5759c97b00000000, 0xa5ed015200000000, + 0x347c69fc00000000, 0x9025a49400000000, 0x01b4cc3a00000000, + 0xf300041300000000, 0x62916cbd00000000, 0x1769954000000000, + 0x86f8fdee00000000, 0x744c35c700000000, 0xe5dd5d6900000000, + 0xdfbab7e700000000, 0x4e2bdf4900000000, 0xbc9f176000000000, + 0x2d0e7fce00000000, 0x58f6863300000000, 0xc967ee9d00000000, + 0x3bd326b400000000, 0xaa424e1a00000000, 0x7360bc6500000000, + 0xe2f1d4cb00000000, 0x10451ce200000000, 0x81d4744c00000000, + 0xf42c8db100000000, 0x65bde51f00000000, 0x97092d3600000000, + 0x0698459800000000, 0x3cffaf1600000000, 0xad6ec7b800000000, + 0x5fda0f9100000000, 0xce4b673f00000000, 0xbbb39ec200000000, + 0x2a22f66c00000000, 0xd8963e4500000000, 0x490756eb00000000, + 0xed5e9b8300000000, 0x7ccff32d00000000, 0x8e7b3b0400000000, + 0x1fea53aa00000000, 0x6a12aa5700000000, 0xfb83c2f900000000, + 0x09370ad000000000, 0x98a6627e00000000, 0xa2c188f000000000, + 0x3350e05e00000000, 0xc1e4287700000000, 0x507540d900000000, + 0x258db92400000000, 0xb41cd18a00000000, 0x46a819a300000000, + 0xd739710d00000000}}; + +#else /* W == 4 */ + +local const z_crc_t FAR crc_braid_table[][256] = { + {0x00000000, 0xccaa009e, 0x4225077d, 0x8e8f07e3, 0x844a0efa, + 0x48e00e64, 0xc66f0987, 0x0ac50919, 0xd3e51bb5, 0x1f4f1b2b, + 0x91c01cc8, 0x5d6a1c56, 0x57af154f, 0x9b0515d1, 0x158a1232, + 0xd92012ac, 0x7cbb312b, 0xb01131b5, 0x3e9e3656, 0xf23436c8, + 0xf8f13fd1, 0x345b3f4f, 0xbad438ac, 0x767e3832, 0xaf5e2a9e, + 0x63f42a00, 0xed7b2de3, 0x21d12d7d, 0x2b142464, 0xe7be24fa, + 0x69312319, 0xa59b2387, 0xf9766256, 0x35dc62c8, 0xbb53652b, + 0x77f965b5, 0x7d3c6cac, 0xb1966c32, 0x3f196bd1, 0xf3b36b4f, + 0x2a9379e3, 0xe639797d, 0x68b67e9e, 0xa41c7e00, 0xaed97719, + 0x62737787, 0xecfc7064, 0x205670fa, 0x85cd537d, 0x496753e3, + 0xc7e85400, 0x0b42549e, 0x01875d87, 0xcd2d5d19, 0x43a25afa, + 0x8f085a64, 0x562848c8, 0x9a824856, 0x140d4fb5, 0xd8a74f2b, + 0xd2624632, 0x1ec846ac, 0x9047414f, 0x5ced41d1, 0x299dc2ed, + 0xe537c273, 0x6bb8c590, 0xa712c50e, 0xadd7cc17, 0x617dcc89, + 0xeff2cb6a, 0x2358cbf4, 0xfa78d958, 0x36d2d9c6, 0xb85dde25, + 0x74f7debb, 0x7e32d7a2, 0xb298d73c, 0x3c17d0df, 0xf0bdd041, + 0x5526f3c6, 0x998cf358, 0x1703f4bb, 0xdba9f425, 0xd16cfd3c, + 0x1dc6fda2, 0x9349fa41, 0x5fe3fadf, 0x86c3e873, 0x4a69e8ed, + 0xc4e6ef0e, 0x084cef90, 0x0289e689, 0xce23e617, 0x40ace1f4, + 0x8c06e16a, 0xd0eba0bb, 0x1c41a025, 0x92cea7c6, 0x5e64a758, + 0x54a1ae41, 0x980baedf, 0x1684a93c, 0xda2ea9a2, 0x030ebb0e, + 0xcfa4bb90, 0x412bbc73, 0x8d81bced, 0x8744b5f4, 0x4beeb56a, + 0xc561b289, 0x09cbb217, 0xac509190, 0x60fa910e, 0xee7596ed, + 0x22df9673, 0x281a9f6a, 0xe4b09ff4, 0x6a3f9817, 0xa6959889, + 0x7fb58a25, 0xb31f8abb, 0x3d908d58, 0xf13a8dc6, 0xfbff84df, + 0x37558441, 0xb9da83a2, 0x7570833c, 0x533b85da, 0x9f918544, + 0x111e82a7, 0xddb48239, 0xd7718b20, 0x1bdb8bbe, 0x95548c5d, + 0x59fe8cc3, 0x80de9e6f, 0x4c749ef1, 0xc2fb9912, 0x0e51998c, + 0x04949095, 0xc83e900b, 0x46b197e8, 0x8a1b9776, 0x2f80b4f1, + 0xe32ab46f, 0x6da5b38c, 0xa10fb312, 0xabcaba0b, 0x6760ba95, + 0xe9efbd76, 0x2545bde8, 0xfc65af44, 0x30cfafda, 0xbe40a839, + 0x72eaa8a7, 0x782fa1be, 0xb485a120, 0x3a0aa6c3, 0xf6a0a65d, + 0xaa4de78c, 0x66e7e712, 0xe868e0f1, 0x24c2e06f, 0x2e07e976, + 0xe2ade9e8, 0x6c22ee0b, 0xa088ee95, 0x79a8fc39, 0xb502fca7, + 0x3b8dfb44, 0xf727fbda, 0xfde2f2c3, 0x3148f25d, 0xbfc7f5be, + 0x736df520, 0xd6f6d6a7, 0x1a5cd639, 0x94d3d1da, 0x5879d144, + 0x52bcd85d, 0x9e16d8c3, 0x1099df20, 0xdc33dfbe, 0x0513cd12, + 0xc9b9cd8c, 0x4736ca6f, 0x8b9ccaf1, 0x8159c3e8, 0x4df3c376, + 0xc37cc495, 0x0fd6c40b, 0x7aa64737, 0xb60c47a9, 0x3883404a, + 0xf42940d4, 0xfeec49cd, 0x32464953, 0xbcc94eb0, 0x70634e2e, + 0xa9435c82, 0x65e95c1c, 0xeb665bff, 0x27cc5b61, 0x2d095278, + 0xe1a352e6, 0x6f2c5505, 0xa386559b, 0x061d761c, 0xcab77682, + 0x44387161, 0x889271ff, 0x825778e6, 0x4efd7878, 0xc0727f9b, + 0x0cd87f05, 0xd5f86da9, 0x19526d37, 0x97dd6ad4, 0x5b776a4a, + 0x51b26353, 0x9d1863cd, 0x1397642e, 0xdf3d64b0, 0x83d02561, + 0x4f7a25ff, 0xc1f5221c, 0x0d5f2282, 0x079a2b9b, 0xcb302b05, + 0x45bf2ce6, 0x89152c78, 0x50353ed4, 0x9c9f3e4a, 0x121039a9, + 0xdeba3937, 0xd47f302e, 0x18d530b0, 0x965a3753, 0x5af037cd, + 0xff6b144a, 0x33c114d4, 0xbd4e1337, 0x71e413a9, 0x7b211ab0, + 0xb78b1a2e, 0x39041dcd, 0xf5ae1d53, 0x2c8e0fff, 0xe0240f61, + 0x6eab0882, 0xa201081c, 0xa8c40105, 0x646e019b, 0xeae10678, + 0x264b06e6}, + {0x00000000, 0xa6770bb4, 0x979f1129, 0x31e81a9d, 0xf44f2413, + 0x52382fa7, 0x63d0353a, 0xc5a73e8e, 0x33ef4e67, 0x959845d3, + 0xa4705f4e, 0x020754fa, 0xc7a06a74, 0x61d761c0, 0x503f7b5d, + 0xf64870e9, 0x67de9cce, 0xc1a9977a, 0xf0418de7, 0x56368653, + 0x9391b8dd, 0x35e6b369, 0x040ea9f4, 0xa279a240, 0x5431d2a9, + 0xf246d91d, 0xc3aec380, 0x65d9c834, 0xa07ef6ba, 0x0609fd0e, + 0x37e1e793, 0x9196ec27, 0xcfbd399c, 0x69ca3228, 0x582228b5, + 0xfe552301, 0x3bf21d8f, 0x9d85163b, 0xac6d0ca6, 0x0a1a0712, + 0xfc5277fb, 0x5a257c4f, 0x6bcd66d2, 0xcdba6d66, 0x081d53e8, + 0xae6a585c, 0x9f8242c1, 0x39f54975, 0xa863a552, 0x0e14aee6, + 0x3ffcb47b, 0x998bbfcf, 0x5c2c8141, 0xfa5b8af5, 0xcbb39068, + 0x6dc49bdc, 0x9b8ceb35, 0x3dfbe081, 0x0c13fa1c, 0xaa64f1a8, + 0x6fc3cf26, 0xc9b4c492, 0xf85cde0f, 0x5e2bd5bb, 0x440b7579, + 0xe27c7ecd, 0xd3946450, 0x75e36fe4, 0xb044516a, 0x16335ade, + 0x27db4043, 0x81ac4bf7, 0x77e43b1e, 0xd19330aa, 0xe07b2a37, + 0x460c2183, 0x83ab1f0d, 0x25dc14b9, 0x14340e24, 0xb2430590, + 0x23d5e9b7, 0x85a2e203, 0xb44af89e, 0x123df32a, 0xd79acda4, + 0x71edc610, 0x4005dc8d, 0xe672d739, 0x103aa7d0, 0xb64dac64, + 0x87a5b6f9, 0x21d2bd4d, 0xe47583c3, 0x42028877, 0x73ea92ea, + 0xd59d995e, 0x8bb64ce5, 0x2dc14751, 0x1c295dcc, 0xba5e5678, + 0x7ff968f6, 0xd98e6342, 0xe86679df, 0x4e11726b, 0xb8590282, + 0x1e2e0936, 0x2fc613ab, 0x89b1181f, 0x4c162691, 0xea612d25, + 0xdb8937b8, 0x7dfe3c0c, 0xec68d02b, 0x4a1fdb9f, 0x7bf7c102, + 0xdd80cab6, 0x1827f438, 0xbe50ff8c, 0x8fb8e511, 0x29cfeea5, + 0xdf879e4c, 0x79f095f8, 0x48188f65, 0xee6f84d1, 0x2bc8ba5f, + 0x8dbfb1eb, 0xbc57ab76, 0x1a20a0c2, 0x8816eaf2, 0x2e61e146, + 0x1f89fbdb, 0xb9fef06f, 0x7c59cee1, 0xda2ec555, 0xebc6dfc8, + 0x4db1d47c, 0xbbf9a495, 0x1d8eaf21, 0x2c66b5bc, 0x8a11be08, + 0x4fb68086, 0xe9c18b32, 0xd82991af, 0x7e5e9a1b, 0xefc8763c, + 0x49bf7d88, 0x78576715, 0xde206ca1, 0x1b87522f, 0xbdf0599b, + 0x8c184306, 0x2a6f48b2, 0xdc27385b, 0x7a5033ef, 0x4bb82972, + 0xedcf22c6, 0x28681c48, 0x8e1f17fc, 0xbff70d61, 0x198006d5, + 0x47abd36e, 0xe1dcd8da, 0xd034c247, 0x7643c9f3, 0xb3e4f77d, + 0x1593fcc9, 0x247be654, 0x820cede0, 0x74449d09, 0xd23396bd, + 0xe3db8c20, 0x45ac8794, 0x800bb91a, 0x267cb2ae, 0x1794a833, + 0xb1e3a387, 0x20754fa0, 0x86024414, 0xb7ea5e89, 0x119d553d, + 0xd43a6bb3, 0x724d6007, 0x43a57a9a, 0xe5d2712e, 0x139a01c7, + 0xb5ed0a73, 0x840510ee, 0x22721b5a, 0xe7d525d4, 0x41a22e60, + 0x704a34fd, 0xd63d3f49, 0xcc1d9f8b, 0x6a6a943f, 0x5b828ea2, + 0xfdf58516, 0x3852bb98, 0x9e25b02c, 0xafcdaab1, 0x09baa105, + 0xfff2d1ec, 0x5985da58, 0x686dc0c5, 0xce1acb71, 0x0bbdf5ff, + 0xadcafe4b, 0x9c22e4d6, 0x3a55ef62, 0xabc30345, 0x0db408f1, + 0x3c5c126c, 0x9a2b19d8, 0x5f8c2756, 0xf9fb2ce2, 0xc813367f, + 0x6e643dcb, 0x982c4d22, 0x3e5b4696, 0x0fb35c0b, 0xa9c457bf, + 0x6c636931, 0xca146285, 0xfbfc7818, 0x5d8b73ac, 0x03a0a617, + 0xa5d7ada3, 0x943fb73e, 0x3248bc8a, 0xf7ef8204, 0x519889b0, + 0x6070932d, 0xc6079899, 0x304fe870, 0x9638e3c4, 0xa7d0f959, + 0x01a7f2ed, 0xc400cc63, 0x6277c7d7, 0x539fdd4a, 0xf5e8d6fe, + 0x647e3ad9, 0xc209316d, 0xf3e12bf0, 0x55962044, 0x90311eca, + 0x3646157e, 0x07ae0fe3, 0xa1d90457, 0x579174be, 0xf1e67f0a, + 0xc00e6597, 0x66796e23, 0xa3de50ad, 0x05a95b19, 0x34414184, + 0x92364a30}, + {0x00000000, 0xcb5cd3a5, 0x4dc8a10b, 0x869472ae, 0x9b914216, + 0x50cd91b3, 0xd659e31d, 0x1d0530b8, 0xec53826d, 0x270f51c8, + 0xa19b2366, 0x6ac7f0c3, 0x77c2c07b, 0xbc9e13de, 0x3a0a6170, + 0xf156b2d5, 0x03d6029b, 0xc88ad13e, 0x4e1ea390, 0x85427035, + 0x9847408d, 0x531b9328, 0xd58fe186, 0x1ed33223, 0xef8580f6, + 0x24d95353, 0xa24d21fd, 0x6911f258, 0x7414c2e0, 0xbf481145, + 0x39dc63eb, 0xf280b04e, 0x07ac0536, 0xccf0d693, 0x4a64a43d, + 0x81387798, 0x9c3d4720, 0x57619485, 0xd1f5e62b, 0x1aa9358e, + 0xebff875b, 0x20a354fe, 0xa6372650, 0x6d6bf5f5, 0x706ec54d, + 0xbb3216e8, 0x3da66446, 0xf6fab7e3, 0x047a07ad, 0xcf26d408, + 0x49b2a6a6, 0x82ee7503, 0x9feb45bb, 0x54b7961e, 0xd223e4b0, + 0x197f3715, 0xe82985c0, 0x23755665, 0xa5e124cb, 0x6ebdf76e, + 0x73b8c7d6, 0xb8e41473, 0x3e7066dd, 0xf52cb578, 0x0f580a6c, + 0xc404d9c9, 0x4290ab67, 0x89cc78c2, 0x94c9487a, 0x5f959bdf, + 0xd901e971, 0x125d3ad4, 0xe30b8801, 0x28575ba4, 0xaec3290a, + 0x659ffaaf, 0x789aca17, 0xb3c619b2, 0x35526b1c, 0xfe0eb8b9, + 0x0c8e08f7, 0xc7d2db52, 0x4146a9fc, 0x8a1a7a59, 0x971f4ae1, + 0x5c439944, 0xdad7ebea, 0x118b384f, 0xe0dd8a9a, 0x2b81593f, + 0xad152b91, 0x6649f834, 0x7b4cc88c, 0xb0101b29, 0x36846987, + 0xfdd8ba22, 0x08f40f5a, 0xc3a8dcff, 0x453cae51, 0x8e607df4, + 0x93654d4c, 0x58399ee9, 0xdeadec47, 0x15f13fe2, 0xe4a78d37, + 0x2ffb5e92, 0xa96f2c3c, 0x6233ff99, 0x7f36cf21, 0xb46a1c84, + 0x32fe6e2a, 0xf9a2bd8f, 0x0b220dc1, 0xc07ede64, 0x46eaacca, + 0x8db67f6f, 0x90b34fd7, 0x5bef9c72, 0xdd7beedc, 0x16273d79, + 0xe7718fac, 0x2c2d5c09, 0xaab92ea7, 0x61e5fd02, 0x7ce0cdba, + 0xb7bc1e1f, 0x31286cb1, 0xfa74bf14, 0x1eb014d8, 0xd5ecc77d, + 0x5378b5d3, 0x98246676, 0x852156ce, 0x4e7d856b, 0xc8e9f7c5, + 0x03b52460, 0xf2e396b5, 0x39bf4510, 0xbf2b37be, 0x7477e41b, + 0x6972d4a3, 0xa22e0706, 0x24ba75a8, 0xefe6a60d, 0x1d661643, + 0xd63ac5e6, 0x50aeb748, 0x9bf264ed, 0x86f75455, 0x4dab87f0, + 0xcb3ff55e, 0x006326fb, 0xf135942e, 0x3a69478b, 0xbcfd3525, + 0x77a1e680, 0x6aa4d638, 0xa1f8059d, 0x276c7733, 0xec30a496, + 0x191c11ee, 0xd240c24b, 0x54d4b0e5, 0x9f886340, 0x828d53f8, + 0x49d1805d, 0xcf45f2f3, 0x04192156, 0xf54f9383, 0x3e134026, + 0xb8873288, 0x73dbe12d, 0x6eded195, 0xa5820230, 0x2316709e, + 0xe84aa33b, 0x1aca1375, 0xd196c0d0, 0x5702b27e, 0x9c5e61db, + 0x815b5163, 0x4a0782c6, 0xcc93f068, 0x07cf23cd, 0xf6999118, + 0x3dc542bd, 0xbb513013, 0x700de3b6, 0x6d08d30e, 0xa65400ab, + 0x20c07205, 0xeb9ca1a0, 0x11e81eb4, 0xdab4cd11, 0x5c20bfbf, + 0x977c6c1a, 0x8a795ca2, 0x41258f07, 0xc7b1fda9, 0x0ced2e0c, + 0xfdbb9cd9, 0x36e74f7c, 0xb0733dd2, 0x7b2fee77, 0x662adecf, + 0xad760d6a, 0x2be27fc4, 0xe0beac61, 0x123e1c2f, 0xd962cf8a, + 0x5ff6bd24, 0x94aa6e81, 0x89af5e39, 0x42f38d9c, 0xc467ff32, + 0x0f3b2c97, 0xfe6d9e42, 0x35314de7, 0xb3a53f49, 0x78f9ecec, + 0x65fcdc54, 0xaea00ff1, 0x28347d5f, 0xe368aefa, 0x16441b82, + 0xdd18c827, 0x5b8cba89, 0x90d0692c, 0x8dd55994, 0x46898a31, + 0xc01df89f, 0x0b412b3a, 0xfa1799ef, 0x314b4a4a, 0xb7df38e4, + 0x7c83eb41, 0x6186dbf9, 0xaada085c, 0x2c4e7af2, 0xe712a957, + 0x15921919, 0xdececabc, 0x585ab812, 0x93066bb7, 0x8e035b0f, + 0x455f88aa, 0xc3cbfa04, 0x089729a1, 0xf9c19b74, 0x329d48d1, + 0xb4093a7f, 0x7f55e9da, 0x6250d962, 0xa90c0ac7, 0x2f987869, + 0xe4c4abcc}, + {0x00000000, 0x3d6029b0, 0x7ac05360, 0x47a07ad0, 0xf580a6c0, + 0xc8e08f70, 0x8f40f5a0, 0xb220dc10, 0x30704bc1, 0x0d106271, + 0x4ab018a1, 0x77d03111, 0xc5f0ed01, 0xf890c4b1, 0xbf30be61, + 0x825097d1, 0x60e09782, 0x5d80be32, 0x1a20c4e2, 0x2740ed52, + 0x95603142, 0xa80018f2, 0xefa06222, 0xd2c04b92, 0x5090dc43, + 0x6df0f5f3, 0x2a508f23, 0x1730a693, 0xa5107a83, 0x98705333, + 0xdfd029e3, 0xe2b00053, 0xc1c12f04, 0xfca106b4, 0xbb017c64, + 0x866155d4, 0x344189c4, 0x0921a074, 0x4e81daa4, 0x73e1f314, + 0xf1b164c5, 0xccd14d75, 0x8b7137a5, 0xb6111e15, 0x0431c205, + 0x3951ebb5, 0x7ef19165, 0x4391b8d5, 0xa121b886, 0x9c419136, + 0xdbe1ebe6, 0xe681c256, 0x54a11e46, 0x69c137f6, 0x2e614d26, + 0x13016496, 0x9151f347, 0xac31daf7, 0xeb91a027, 0xd6f18997, + 0x64d15587, 0x59b17c37, 0x1e1106e7, 0x23712f57, 0x58f35849, + 0x659371f9, 0x22330b29, 0x1f532299, 0xad73fe89, 0x9013d739, + 0xd7b3ade9, 0xead38459, 0x68831388, 0x55e33a38, 0x124340e8, + 0x2f236958, 0x9d03b548, 0xa0639cf8, 0xe7c3e628, 0xdaa3cf98, + 0x3813cfcb, 0x0573e67b, 0x42d39cab, 0x7fb3b51b, 0xcd93690b, + 0xf0f340bb, 0xb7533a6b, 0x8a3313db, 0x0863840a, 0x3503adba, + 0x72a3d76a, 0x4fc3feda, 0xfde322ca, 0xc0830b7a, 0x872371aa, + 0xba43581a, 0x9932774d, 0xa4525efd, 0xe3f2242d, 0xde920d9d, + 0x6cb2d18d, 0x51d2f83d, 0x167282ed, 0x2b12ab5d, 0xa9423c8c, + 0x9422153c, 0xd3826fec, 0xeee2465c, 0x5cc29a4c, 0x61a2b3fc, + 0x2602c92c, 0x1b62e09c, 0xf9d2e0cf, 0xc4b2c97f, 0x8312b3af, + 0xbe729a1f, 0x0c52460f, 0x31326fbf, 0x7692156f, 0x4bf23cdf, + 0xc9a2ab0e, 0xf4c282be, 0xb362f86e, 0x8e02d1de, 0x3c220dce, + 0x0142247e, 0x46e25eae, 0x7b82771e, 0xb1e6b092, 0x8c869922, + 0xcb26e3f2, 0xf646ca42, 0x44661652, 0x79063fe2, 0x3ea64532, + 0x03c66c82, 0x8196fb53, 0xbcf6d2e3, 0xfb56a833, 0xc6368183, + 0x74165d93, 0x49767423, 0x0ed60ef3, 0x33b62743, 0xd1062710, + 0xec660ea0, 0xabc67470, 0x96a65dc0, 0x248681d0, 0x19e6a860, + 0x5e46d2b0, 0x6326fb00, 0xe1766cd1, 0xdc164561, 0x9bb63fb1, + 0xa6d61601, 0x14f6ca11, 0x2996e3a1, 0x6e369971, 0x5356b0c1, + 0x70279f96, 0x4d47b626, 0x0ae7ccf6, 0x3787e546, 0x85a73956, + 0xb8c710e6, 0xff676a36, 0xc2074386, 0x4057d457, 0x7d37fde7, + 0x3a978737, 0x07f7ae87, 0xb5d77297, 0x88b75b27, 0xcf1721f7, + 0xf2770847, 0x10c70814, 0x2da721a4, 0x6a075b74, 0x576772c4, + 0xe547aed4, 0xd8278764, 0x9f87fdb4, 0xa2e7d404, 0x20b743d5, + 0x1dd76a65, 0x5a7710b5, 0x67173905, 0xd537e515, 0xe857cca5, + 0xaff7b675, 0x92979fc5, 0xe915e8db, 0xd475c16b, 0x93d5bbbb, + 0xaeb5920b, 0x1c954e1b, 0x21f567ab, 0x66551d7b, 0x5b3534cb, + 0xd965a31a, 0xe4058aaa, 0xa3a5f07a, 0x9ec5d9ca, 0x2ce505da, + 0x11852c6a, 0x562556ba, 0x6b457f0a, 0x89f57f59, 0xb49556e9, + 0xf3352c39, 0xce550589, 0x7c75d999, 0x4115f029, 0x06b58af9, + 0x3bd5a349, 0xb9853498, 0x84e51d28, 0xc34567f8, 0xfe254e48, + 0x4c059258, 0x7165bbe8, 0x36c5c138, 0x0ba5e888, 0x28d4c7df, + 0x15b4ee6f, 0x521494bf, 0x6f74bd0f, 0xdd54611f, 0xe03448af, + 0xa794327f, 0x9af41bcf, 0x18a48c1e, 0x25c4a5ae, 0x6264df7e, + 0x5f04f6ce, 0xed242ade, 0xd044036e, 0x97e479be, 0xaa84500e, + 0x4834505d, 0x755479ed, 0x32f4033d, 0x0f942a8d, 0xbdb4f69d, + 0x80d4df2d, 0xc774a5fd, 0xfa148c4d, 0x78441b9c, 0x4524322c, + 0x028448fc, 0x3fe4614c, 0x8dc4bd5c, 0xb0a494ec, 0xf704ee3c, + 0xca64c78c}}; + +local const z_word_t FAR crc_braid_big_table[][256] = { + {0x00000000, 0xb029603d, 0x6053c07a, 0xd07aa047, 0xc0a680f5, + 0x708fe0c8, 0xa0f5408f, 0x10dc20b2, 0xc14b7030, 0x7162100d, + 0xa118b04a, 0x1131d077, 0x01edf0c5, 0xb1c490f8, 0x61be30bf, + 0xd1975082, 0x8297e060, 0x32be805d, 0xe2c4201a, 0x52ed4027, + 0x42316095, 0xf21800a8, 0x2262a0ef, 0x924bc0d2, 0x43dc9050, + 0xf3f5f06d, 0x238f502a, 0x93a63017, 0x837a10a5, 0x33537098, + 0xe329d0df, 0x5300b0e2, 0x042fc1c1, 0xb406a1fc, 0x647c01bb, + 0xd4556186, 0xc4894134, 0x74a02109, 0xa4da814e, 0x14f3e173, + 0xc564b1f1, 0x754dd1cc, 0xa537718b, 0x151e11b6, 0x05c23104, + 0xb5eb5139, 0x6591f17e, 0xd5b89143, 0x86b821a1, 0x3691419c, + 0xe6ebe1db, 0x56c281e6, 0x461ea154, 0xf637c169, 0x264d612e, + 0x96640113, 0x47f35191, 0xf7da31ac, 0x27a091eb, 0x9789f1d6, + 0x8755d164, 0x377cb159, 0xe706111e, 0x572f7123, 0x4958f358, + 0xf9719365, 0x290b3322, 0x9922531f, 0x89fe73ad, 0x39d71390, + 0xe9adb3d7, 0x5984d3ea, 0x88138368, 0x383ae355, 0xe8404312, + 0x5869232f, 0x48b5039d, 0xf89c63a0, 0x28e6c3e7, 0x98cfa3da, + 0xcbcf1338, 0x7be67305, 0xab9cd342, 0x1bb5b37f, 0x0b6993cd, + 0xbb40f3f0, 0x6b3a53b7, 0xdb13338a, 0x0a846308, 0xbaad0335, + 0x6ad7a372, 0xdafec34f, 0xca22e3fd, 0x7a0b83c0, 0xaa712387, + 0x1a5843ba, 0x4d773299, 0xfd5e52a4, 0x2d24f2e3, 0x9d0d92de, + 0x8dd1b26c, 0x3df8d251, 0xed827216, 0x5dab122b, 0x8c3c42a9, + 0x3c152294, 0xec6f82d3, 0x5c46e2ee, 0x4c9ac25c, 0xfcb3a261, + 0x2cc90226, 0x9ce0621b, 0xcfe0d2f9, 0x7fc9b2c4, 0xafb31283, + 0x1f9a72be, 0x0f46520c, 0xbf6f3231, 0x6f159276, 0xdf3cf24b, + 0x0eaba2c9, 0xbe82c2f4, 0x6ef862b3, 0xded1028e, 0xce0d223c, + 0x7e244201, 0xae5ee246, 0x1e77827b, 0x92b0e6b1, 0x2299868c, + 0xf2e326cb, 0x42ca46f6, 0x52166644, 0xe23f0679, 0x3245a63e, + 0x826cc603, 0x53fb9681, 0xe3d2f6bc, 0x33a856fb, 0x838136c6, + 0x935d1674, 0x23747649, 0xf30ed60e, 0x4327b633, 0x102706d1, + 0xa00e66ec, 0x7074c6ab, 0xc05da696, 0xd0818624, 0x60a8e619, + 0xb0d2465e, 0x00fb2663, 0xd16c76e1, 0x614516dc, 0xb13fb69b, + 0x0116d6a6, 0x11caf614, 0xa1e39629, 0x7199366e, 0xc1b05653, + 0x969f2770, 0x26b6474d, 0xf6cce70a, 0x46e58737, 0x5639a785, + 0xe610c7b8, 0x366a67ff, 0x864307c2, 0x57d45740, 0xe7fd377d, + 0x3787973a, 0x87aef707, 0x9772d7b5, 0x275bb788, 0xf72117cf, + 0x470877f2, 0x1408c710, 0xa421a72d, 0x745b076a, 0xc4726757, + 0xd4ae47e5, 0x648727d8, 0xb4fd879f, 0x04d4e7a2, 0xd543b720, + 0x656ad71d, 0xb510775a, 0x05391767, 0x15e537d5, 0xa5cc57e8, + 0x75b6f7af, 0xc59f9792, 0xdbe815e9, 0x6bc175d4, 0xbbbbd593, + 0x0b92b5ae, 0x1b4e951c, 0xab67f521, 0x7b1d5566, 0xcb34355b, + 0x1aa365d9, 0xaa8a05e4, 0x7af0a5a3, 0xcad9c59e, 0xda05e52c, + 0x6a2c8511, 0xba562556, 0x0a7f456b, 0x597ff589, 0xe95695b4, + 0x392c35f3, 0x890555ce, 0x99d9757c, 0x29f01541, 0xf98ab506, + 0x49a3d53b, 0x983485b9, 0x281de584, 0xf86745c3, 0x484e25fe, + 0x5892054c, 0xe8bb6571, 0x38c1c536, 0x88e8a50b, 0xdfc7d428, + 0x6feeb415, 0xbf941452, 0x0fbd746f, 0x1f6154dd, 0xaf4834e0, + 0x7f3294a7, 0xcf1bf49a, 0x1e8ca418, 0xaea5c425, 0x7edf6462, + 0xcef6045f, 0xde2a24ed, 0x6e0344d0, 0xbe79e497, 0x0e5084aa, + 0x5d503448, 0xed795475, 0x3d03f432, 0x8d2a940f, 0x9df6b4bd, + 0x2ddfd480, 0xfda574c7, 0x4d8c14fa, 0x9c1b4478, 0x2c322445, + 0xfc488402, 0x4c61e43f, 0x5cbdc48d, 0xec94a4b0, 0x3cee04f7, + 0x8cc764ca}, + {0x00000000, 0xa5d35ccb, 0x0ba1c84d, 0xae729486, 0x1642919b, + 0xb391cd50, 0x1de359d6, 0xb830051d, 0x6d8253ec, 0xc8510f27, + 0x66239ba1, 0xc3f0c76a, 0x7bc0c277, 0xde139ebc, 0x70610a3a, + 0xd5b256f1, 0x9b02d603, 0x3ed18ac8, 0x90a31e4e, 0x35704285, + 0x8d404798, 0x28931b53, 0x86e18fd5, 0x2332d31e, 0xf68085ef, + 0x5353d924, 0xfd214da2, 0x58f21169, 0xe0c21474, 0x451148bf, + 0xeb63dc39, 0x4eb080f2, 0x3605ac07, 0x93d6f0cc, 0x3da4644a, + 0x98773881, 0x20473d9c, 0x85946157, 0x2be6f5d1, 0x8e35a91a, + 0x5b87ffeb, 0xfe54a320, 0x502637a6, 0xf5f56b6d, 0x4dc56e70, + 0xe81632bb, 0x4664a63d, 0xe3b7faf6, 0xad077a04, 0x08d426cf, + 0xa6a6b249, 0x0375ee82, 0xbb45eb9f, 0x1e96b754, 0xb0e423d2, + 0x15377f19, 0xc08529e8, 0x65567523, 0xcb24e1a5, 0x6ef7bd6e, + 0xd6c7b873, 0x7314e4b8, 0xdd66703e, 0x78b52cf5, 0x6c0a580f, + 0xc9d904c4, 0x67ab9042, 0xc278cc89, 0x7a48c994, 0xdf9b955f, + 0x71e901d9, 0xd43a5d12, 0x01880be3, 0xa45b5728, 0x0a29c3ae, + 0xaffa9f65, 0x17ca9a78, 0xb219c6b3, 0x1c6b5235, 0xb9b80efe, + 0xf7088e0c, 0x52dbd2c7, 0xfca94641, 0x597a1a8a, 0xe14a1f97, + 0x4499435c, 0xeaebd7da, 0x4f388b11, 0x9a8adde0, 0x3f59812b, + 0x912b15ad, 0x34f84966, 0x8cc84c7b, 0x291b10b0, 0x87698436, + 0x22bad8fd, 0x5a0ff408, 0xffdca8c3, 0x51ae3c45, 0xf47d608e, + 0x4c4d6593, 0xe99e3958, 0x47ecadde, 0xe23ff115, 0x378da7e4, + 0x925efb2f, 0x3c2c6fa9, 0x99ff3362, 0x21cf367f, 0x841c6ab4, + 0x2a6efe32, 0x8fbda2f9, 0xc10d220b, 0x64de7ec0, 0xcaacea46, + 0x6f7fb68d, 0xd74fb390, 0x729cef5b, 0xdcee7bdd, 0x793d2716, + 0xac8f71e7, 0x095c2d2c, 0xa72eb9aa, 0x02fde561, 0xbacde07c, + 0x1f1ebcb7, 0xb16c2831, 0x14bf74fa, 0xd814b01e, 0x7dc7ecd5, + 0xd3b57853, 0x76662498, 0xce562185, 0x6b857d4e, 0xc5f7e9c8, + 0x6024b503, 0xb596e3f2, 0x1045bf39, 0xbe372bbf, 0x1be47774, + 0xa3d47269, 0x06072ea2, 0xa875ba24, 0x0da6e6ef, 0x4316661d, + 0xe6c53ad6, 0x48b7ae50, 0xed64f29b, 0x5554f786, 0xf087ab4d, + 0x5ef53fcb, 0xfb266300, 0x2e9435f1, 0x8b47693a, 0x2535fdbc, + 0x80e6a177, 0x38d6a46a, 0x9d05f8a1, 0x33776c27, 0x96a430ec, + 0xee111c19, 0x4bc240d2, 0xe5b0d454, 0x4063889f, 0xf8538d82, + 0x5d80d149, 0xf3f245cf, 0x56211904, 0x83934ff5, 0x2640133e, + 0x883287b8, 0x2de1db73, 0x95d1de6e, 0x300282a5, 0x9e701623, + 0x3ba34ae8, 0x7513ca1a, 0xd0c096d1, 0x7eb20257, 0xdb615e9c, + 0x63515b81, 0xc682074a, 0x68f093cc, 0xcd23cf07, 0x189199f6, + 0xbd42c53d, 0x133051bb, 0xb6e30d70, 0x0ed3086d, 0xab0054a6, + 0x0572c020, 0xa0a19ceb, 0xb41ee811, 0x11cdb4da, 0xbfbf205c, + 0x1a6c7c97, 0xa25c798a, 0x078f2541, 0xa9fdb1c7, 0x0c2eed0c, + 0xd99cbbfd, 0x7c4fe736, 0xd23d73b0, 0x77ee2f7b, 0xcfde2a66, + 0x6a0d76ad, 0xc47fe22b, 0x61acbee0, 0x2f1c3e12, 0x8acf62d9, + 0x24bdf65f, 0x816eaa94, 0x395eaf89, 0x9c8df342, 0x32ff67c4, + 0x972c3b0f, 0x429e6dfe, 0xe74d3135, 0x493fa5b3, 0xececf978, + 0x54dcfc65, 0xf10fa0ae, 0x5f7d3428, 0xfaae68e3, 0x821b4416, + 0x27c818dd, 0x89ba8c5b, 0x2c69d090, 0x9459d58d, 0x318a8946, + 0x9ff81dc0, 0x3a2b410b, 0xef9917fa, 0x4a4a4b31, 0xe438dfb7, + 0x41eb837c, 0xf9db8661, 0x5c08daaa, 0xf27a4e2c, 0x57a912e7, + 0x19199215, 0xbccacede, 0x12b85a58, 0xb76b0693, 0x0f5b038e, + 0xaa885f45, 0x04facbc3, 0xa1299708, 0x749bc1f9, 0xd1489d32, + 0x7f3a09b4, 0xdae9557f, 0x62d95062, 0xc70a0ca9, 0x6978982f, + 0xccabc4e4}, + {0x00000000, 0xb40b77a6, 0x29119f97, 0x9d1ae831, 0x13244ff4, + 0xa72f3852, 0x3a35d063, 0x8e3ea7c5, 0x674eef33, 0xd3459895, + 0x4e5f70a4, 0xfa540702, 0x746aa0c7, 0xc061d761, 0x5d7b3f50, + 0xe97048f6, 0xce9cde67, 0x7a97a9c1, 0xe78d41f0, 0x53863656, + 0xddb89193, 0x69b3e635, 0xf4a90e04, 0x40a279a2, 0xa9d23154, + 0x1dd946f2, 0x80c3aec3, 0x34c8d965, 0xbaf67ea0, 0x0efd0906, + 0x93e7e137, 0x27ec9691, 0x9c39bdcf, 0x2832ca69, 0xb5282258, + 0x012355fe, 0x8f1df23b, 0x3b16859d, 0xa60c6dac, 0x12071a0a, + 0xfb7752fc, 0x4f7c255a, 0xd266cd6b, 0x666dbacd, 0xe8531d08, + 0x5c586aae, 0xc142829f, 0x7549f539, 0x52a563a8, 0xe6ae140e, + 0x7bb4fc3f, 0xcfbf8b99, 0x41812c5c, 0xf58a5bfa, 0x6890b3cb, + 0xdc9bc46d, 0x35eb8c9b, 0x81e0fb3d, 0x1cfa130c, 0xa8f164aa, + 0x26cfc36f, 0x92c4b4c9, 0x0fde5cf8, 0xbbd52b5e, 0x79750b44, + 0xcd7e7ce2, 0x506494d3, 0xe46fe375, 0x6a5144b0, 0xde5a3316, + 0x4340db27, 0xf74bac81, 0x1e3be477, 0xaa3093d1, 0x372a7be0, + 0x83210c46, 0x0d1fab83, 0xb914dc25, 0x240e3414, 0x900543b2, + 0xb7e9d523, 0x03e2a285, 0x9ef84ab4, 0x2af33d12, 0xa4cd9ad7, + 0x10c6ed71, 0x8ddc0540, 0x39d772e6, 0xd0a73a10, 0x64ac4db6, + 0xf9b6a587, 0x4dbdd221, 0xc38375e4, 0x77880242, 0xea92ea73, + 0x5e999dd5, 0xe54cb68b, 0x5147c12d, 0xcc5d291c, 0x78565eba, + 0xf668f97f, 0x42638ed9, 0xdf7966e8, 0x6b72114e, 0x820259b8, + 0x36092e1e, 0xab13c62f, 0x1f18b189, 0x9126164c, 0x252d61ea, + 0xb83789db, 0x0c3cfe7d, 0x2bd068ec, 0x9fdb1f4a, 0x02c1f77b, + 0xb6ca80dd, 0x38f42718, 0x8cff50be, 0x11e5b88f, 0xa5eecf29, + 0x4c9e87df, 0xf895f079, 0x658f1848, 0xd1846fee, 0x5fbac82b, + 0xebb1bf8d, 0x76ab57bc, 0xc2a0201a, 0xf2ea1688, 0x46e1612e, + 0xdbfb891f, 0x6ff0feb9, 0xe1ce597c, 0x55c52eda, 0xc8dfc6eb, + 0x7cd4b14d, 0x95a4f9bb, 0x21af8e1d, 0xbcb5662c, 0x08be118a, + 0x8680b64f, 0x328bc1e9, 0xaf9129d8, 0x1b9a5e7e, 0x3c76c8ef, + 0x887dbf49, 0x15675778, 0xa16c20de, 0x2f52871b, 0x9b59f0bd, + 0x0643188c, 0xb2486f2a, 0x5b3827dc, 0xef33507a, 0x7229b84b, + 0xc622cfed, 0x481c6828, 0xfc171f8e, 0x610df7bf, 0xd5068019, + 0x6ed3ab47, 0xdad8dce1, 0x47c234d0, 0xf3c94376, 0x7df7e4b3, + 0xc9fc9315, 0x54e67b24, 0xe0ed0c82, 0x099d4474, 0xbd9633d2, + 0x208cdbe3, 0x9487ac45, 0x1ab90b80, 0xaeb27c26, 0x33a89417, + 0x87a3e3b1, 0xa04f7520, 0x14440286, 0x895eeab7, 0x3d559d11, + 0xb36b3ad4, 0x07604d72, 0x9a7aa543, 0x2e71d2e5, 0xc7019a13, + 0x730aedb5, 0xee100584, 0x5a1b7222, 0xd425d5e7, 0x602ea241, + 0xfd344a70, 0x493f3dd6, 0x8b9f1dcc, 0x3f946a6a, 0xa28e825b, + 0x1685f5fd, 0x98bb5238, 0x2cb0259e, 0xb1aacdaf, 0x05a1ba09, + 0xecd1f2ff, 0x58da8559, 0xc5c06d68, 0x71cb1ace, 0xfff5bd0b, + 0x4bfecaad, 0xd6e4229c, 0x62ef553a, 0x4503c3ab, 0xf108b40d, + 0x6c125c3c, 0xd8192b9a, 0x56278c5f, 0xe22cfbf9, 0x7f3613c8, + 0xcb3d646e, 0x224d2c98, 0x96465b3e, 0x0b5cb30f, 0xbf57c4a9, + 0x3169636c, 0x856214ca, 0x1878fcfb, 0xac738b5d, 0x17a6a003, + 0xa3add7a5, 0x3eb73f94, 0x8abc4832, 0x0482eff7, 0xb0899851, + 0x2d937060, 0x999807c6, 0x70e84f30, 0xc4e33896, 0x59f9d0a7, + 0xedf2a701, 0x63cc00c4, 0xd7c77762, 0x4add9f53, 0xfed6e8f5, + 0xd93a7e64, 0x6d3109c2, 0xf02be1f3, 0x44209655, 0xca1e3190, + 0x7e154636, 0xe30fae07, 0x5704d9a1, 0xbe749157, 0x0a7fe6f1, + 0x97650ec0, 0x236e7966, 0xad50dea3, 0x195ba905, 0x84414134, + 0x304a3692}, + {0x00000000, 0x9e00aacc, 0x7d072542, 0xe3078f8e, 0xfa0e4a84, + 0x640ee048, 0x87096fc6, 0x1909c50a, 0xb51be5d3, 0x2b1b4f1f, + 0xc81cc091, 0x561c6a5d, 0x4f15af57, 0xd115059b, 0x32128a15, + 0xac1220d9, 0x2b31bb7c, 0xb53111b0, 0x56369e3e, 0xc83634f2, + 0xd13ff1f8, 0x4f3f5b34, 0xac38d4ba, 0x32387e76, 0x9e2a5eaf, + 0x002af463, 0xe32d7bed, 0x7d2dd121, 0x6424142b, 0xfa24bee7, + 0x19233169, 0x87239ba5, 0x566276f9, 0xc862dc35, 0x2b6553bb, + 0xb565f977, 0xac6c3c7d, 0x326c96b1, 0xd16b193f, 0x4f6bb3f3, + 0xe379932a, 0x7d7939e6, 0x9e7eb668, 0x007e1ca4, 0x1977d9ae, + 0x87777362, 0x6470fcec, 0xfa705620, 0x7d53cd85, 0xe3536749, + 0x0054e8c7, 0x9e54420b, 0x875d8701, 0x195d2dcd, 0xfa5aa243, + 0x645a088f, 0xc8482856, 0x5648829a, 0xb54f0d14, 0x2b4fa7d8, + 0x324662d2, 0xac46c81e, 0x4f414790, 0xd141ed5c, 0xedc29d29, + 0x73c237e5, 0x90c5b86b, 0x0ec512a7, 0x17ccd7ad, 0x89cc7d61, + 0x6acbf2ef, 0xf4cb5823, 0x58d978fa, 0xc6d9d236, 0x25de5db8, + 0xbbdef774, 0xa2d7327e, 0x3cd798b2, 0xdfd0173c, 0x41d0bdf0, + 0xc6f32655, 0x58f38c99, 0xbbf40317, 0x25f4a9db, 0x3cfd6cd1, + 0xa2fdc61d, 0x41fa4993, 0xdffae35f, 0x73e8c386, 0xede8694a, + 0x0eefe6c4, 0x90ef4c08, 0x89e68902, 0x17e623ce, 0xf4e1ac40, + 0x6ae1068c, 0xbba0ebd0, 0x25a0411c, 0xc6a7ce92, 0x58a7645e, + 0x41aea154, 0xdfae0b98, 0x3ca98416, 0xa2a92eda, 0x0ebb0e03, + 0x90bba4cf, 0x73bc2b41, 0xedbc818d, 0xf4b54487, 0x6ab5ee4b, + 0x89b261c5, 0x17b2cb09, 0x909150ac, 0x0e91fa60, 0xed9675ee, + 0x7396df22, 0x6a9f1a28, 0xf49fb0e4, 0x17983f6a, 0x899895a6, + 0x258ab57f, 0xbb8a1fb3, 0x588d903d, 0xc68d3af1, 0xdf84fffb, + 0x41845537, 0xa283dab9, 0x3c837075, 0xda853b53, 0x4485919f, + 0xa7821e11, 0x3982b4dd, 0x208b71d7, 0xbe8bdb1b, 0x5d8c5495, + 0xc38cfe59, 0x6f9ede80, 0xf19e744c, 0x1299fbc2, 0x8c99510e, + 0x95909404, 0x0b903ec8, 0xe897b146, 0x76971b8a, 0xf1b4802f, + 0x6fb42ae3, 0x8cb3a56d, 0x12b30fa1, 0x0bbacaab, 0x95ba6067, + 0x76bdefe9, 0xe8bd4525, 0x44af65fc, 0xdaafcf30, 0x39a840be, + 0xa7a8ea72, 0xbea12f78, 0x20a185b4, 0xc3a60a3a, 0x5da6a0f6, + 0x8ce74daa, 0x12e7e766, 0xf1e068e8, 0x6fe0c224, 0x76e9072e, + 0xe8e9ade2, 0x0bee226c, 0x95ee88a0, 0x39fca879, 0xa7fc02b5, + 0x44fb8d3b, 0xdafb27f7, 0xc3f2e2fd, 0x5df24831, 0xbef5c7bf, + 0x20f56d73, 0xa7d6f6d6, 0x39d65c1a, 0xdad1d394, 0x44d17958, + 0x5dd8bc52, 0xc3d8169e, 0x20df9910, 0xbedf33dc, 0x12cd1305, + 0x8ccdb9c9, 0x6fca3647, 0xf1ca9c8b, 0xe8c35981, 0x76c3f34d, + 0x95c47cc3, 0x0bc4d60f, 0x3747a67a, 0xa9470cb6, 0x4a408338, + 0xd44029f4, 0xcd49ecfe, 0x53494632, 0xb04ec9bc, 0x2e4e6370, + 0x825c43a9, 0x1c5ce965, 0xff5b66eb, 0x615bcc27, 0x7852092d, + 0xe652a3e1, 0x05552c6f, 0x9b5586a3, 0x1c761d06, 0x8276b7ca, + 0x61713844, 0xff719288, 0xe6785782, 0x7878fd4e, 0x9b7f72c0, + 0x057fd80c, 0xa96df8d5, 0x376d5219, 0xd46add97, 0x4a6a775b, + 0x5363b251, 0xcd63189d, 0x2e649713, 0xb0643ddf, 0x6125d083, + 0xff257a4f, 0x1c22f5c1, 0x82225f0d, 0x9b2b9a07, 0x052b30cb, + 0xe62cbf45, 0x782c1589, 0xd43e3550, 0x4a3e9f9c, 0xa9391012, + 0x3739bade, 0x2e307fd4, 0xb030d518, 0x53375a96, 0xcd37f05a, + 0x4a146bff, 0xd414c133, 0x37134ebd, 0xa913e471, 0xb01a217b, + 0x2e1a8bb7, 0xcd1d0439, 0x531daef5, 0xff0f8e2c, 0x610f24e0, + 0x8208ab6e, 0x1c0801a2, 0x0501c4a8, 0x9b016e64, 0x7806e1ea, + 0xe6064b26}}; + #endif - } -}; + +#endif + +#if N == 3 + +#if W == 8 + +local const z_crc_t FAR crc_braid_table[][256] = { + {0x00000000, 0x81256527, 0xd93bcc0f, 0x581ea928, 0x69069e5f, + 0xe823fb78, 0xb03d5250, 0x31183777, 0xd20d3cbe, 0x53285999, + 0x0b36f0b1, 0x8a139596, 0xbb0ba2e1, 0x3a2ec7c6, 0x62306eee, + 0xe3150bc9, 0x7f6b7f3d, 0xfe4e1a1a, 0xa650b332, 0x2775d615, + 0x166de162, 0x97488445, 0xcf562d6d, 0x4e73484a, 0xad664383, + 0x2c4326a4, 0x745d8f8c, 0xf578eaab, 0xc460dddc, 0x4545b8fb, + 0x1d5b11d3, 0x9c7e74f4, 0xfed6fe7a, 0x7ff39b5d, 0x27ed3275, + 0xa6c85752, 0x97d06025, 0x16f50502, 0x4eebac2a, 0xcfcec90d, + 0x2cdbc2c4, 0xadfea7e3, 0xf5e00ecb, 0x74c56bec, 0x45dd5c9b, + 0xc4f839bc, 0x9ce69094, 0x1dc3f5b3, 0x81bd8147, 0x0098e460, + 0x58864d48, 0xd9a3286f, 0xe8bb1f18, 0x699e7a3f, 0x3180d317, + 0xb0a5b630, 0x53b0bdf9, 0xd295d8de, 0x8a8b71f6, 0x0bae14d1, + 0x3ab623a6, 0xbb934681, 0xe38defa9, 0x62a88a8e, 0x26dcfab5, + 0xa7f99f92, 0xffe736ba, 0x7ec2539d, 0x4fda64ea, 0xceff01cd, + 0x96e1a8e5, 0x17c4cdc2, 0xf4d1c60b, 0x75f4a32c, 0x2dea0a04, + 0xaccf6f23, 0x9dd75854, 0x1cf23d73, 0x44ec945b, 0xc5c9f17c, + 0x59b78588, 0xd892e0af, 0x808c4987, 0x01a92ca0, 0x30b11bd7, + 0xb1947ef0, 0xe98ad7d8, 0x68afb2ff, 0x8bbab936, 0x0a9fdc11, + 0x52817539, 0xd3a4101e, 0xe2bc2769, 0x6399424e, 0x3b87eb66, + 0xbaa28e41, 0xd80a04cf, 0x592f61e8, 0x0131c8c0, 0x8014ade7, + 0xb10c9a90, 0x3029ffb7, 0x6837569f, 0xe91233b8, 0x0a073871, + 0x8b225d56, 0xd33cf47e, 0x52199159, 0x6301a62e, 0xe224c309, + 0xba3a6a21, 0x3b1f0f06, 0xa7617bf2, 0x26441ed5, 0x7e5ab7fd, + 0xff7fd2da, 0xce67e5ad, 0x4f42808a, 0x175c29a2, 0x96794c85, + 0x756c474c, 0xf449226b, 0xac578b43, 0x2d72ee64, 0x1c6ad913, + 0x9d4fbc34, 0xc551151c, 0x4474703b, 0x4db9f56a, 0xcc9c904d, + 0x94823965, 0x15a75c42, 0x24bf6b35, 0xa59a0e12, 0xfd84a73a, + 0x7ca1c21d, 0x9fb4c9d4, 0x1e91acf3, 0x468f05db, 0xc7aa60fc, + 0xf6b2578b, 0x779732ac, 0x2f899b84, 0xaeacfea3, 0x32d28a57, + 0xb3f7ef70, 0xebe94658, 0x6acc237f, 0x5bd41408, 0xdaf1712f, + 0x82efd807, 0x03cabd20, 0xe0dfb6e9, 0x61fad3ce, 0x39e47ae6, + 0xb8c11fc1, 0x89d928b6, 0x08fc4d91, 0x50e2e4b9, 0xd1c7819e, + 0xb36f0b10, 0x324a6e37, 0x6a54c71f, 0xeb71a238, 0xda69954f, + 0x5b4cf068, 0x03525940, 0x82773c67, 0x616237ae, 0xe0475289, + 0xb859fba1, 0x397c9e86, 0x0864a9f1, 0x8941ccd6, 0xd15f65fe, + 0x507a00d9, 0xcc04742d, 0x4d21110a, 0x153fb822, 0x941add05, + 0xa502ea72, 0x24278f55, 0x7c39267d, 0xfd1c435a, 0x1e094893, + 0x9f2c2db4, 0xc732849c, 0x4617e1bb, 0x770fd6cc, 0xf62ab3eb, + 0xae341ac3, 0x2f117fe4, 0x6b650fdf, 0xea406af8, 0xb25ec3d0, + 0x337ba6f7, 0x02639180, 0x8346f4a7, 0xdb585d8f, 0x5a7d38a8, + 0xb9683361, 0x384d5646, 0x6053ff6e, 0xe1769a49, 0xd06ead3e, + 0x514bc819, 0x09556131, 0x88700416, 0x140e70e2, 0x952b15c5, + 0xcd35bced, 0x4c10d9ca, 0x7d08eebd, 0xfc2d8b9a, 0xa43322b2, + 0x25164795, 0xc6034c5c, 0x4726297b, 0x1f388053, 0x9e1de574, + 0xaf05d203, 0x2e20b724, 0x763e1e0c, 0xf71b7b2b, 0x95b3f1a5, + 0x14969482, 0x4c883daa, 0xcdad588d, 0xfcb56ffa, 0x7d900add, + 0x258ea3f5, 0xa4abc6d2, 0x47becd1b, 0xc69ba83c, 0x9e850114, + 0x1fa06433, 0x2eb85344, 0xaf9d3663, 0xf7839f4b, 0x76a6fa6c, + 0xead88e98, 0x6bfdebbf, 0x33e34297, 0xb2c627b0, 0x83de10c7, + 0x02fb75e0, 0x5ae5dcc8, 0xdbc0b9ef, 0x38d5b226, 0xb9f0d701, + 0xe1ee7e29, 0x60cb1b0e, 0x51d32c79, 0xd0f6495e, 0x88e8e076, + 0x09cd8551}, + {0x00000000, 0x9b73ead4, 0xed96d3e9, 0x76e5393d, 0x005ca193, + 0x9b2f4b47, 0xedca727a, 0x76b998ae, 0x00b94326, 0x9bcaa9f2, + 0xed2f90cf, 0x765c7a1b, 0x00e5e2b5, 0x9b960861, 0xed73315c, + 0x7600db88, 0x0172864c, 0x9a016c98, 0xece455a5, 0x7797bf71, + 0x012e27df, 0x9a5dcd0b, 0xecb8f436, 0x77cb1ee2, 0x01cbc56a, + 0x9ab82fbe, 0xec5d1683, 0x772efc57, 0x019764f9, 0x9ae48e2d, + 0xec01b710, 0x77725dc4, 0x02e50c98, 0x9996e64c, 0xef73df71, + 0x740035a5, 0x02b9ad0b, 0x99ca47df, 0xef2f7ee2, 0x745c9436, + 0x025c4fbe, 0x992fa56a, 0xefca9c57, 0x74b97683, 0x0200ee2d, + 0x997304f9, 0xef963dc4, 0x74e5d710, 0x03978ad4, 0x98e46000, + 0xee01593d, 0x7572b3e9, 0x03cb2b47, 0x98b8c193, 0xee5df8ae, + 0x752e127a, 0x032ec9f2, 0x985d2326, 0xeeb81a1b, 0x75cbf0cf, + 0x03726861, 0x980182b5, 0xeee4bb88, 0x7597515c, 0x05ca1930, + 0x9eb9f3e4, 0xe85ccad9, 0x732f200d, 0x0596b8a3, 0x9ee55277, + 0xe8006b4a, 0x7373819e, 0x05735a16, 0x9e00b0c2, 0xe8e589ff, + 0x7396632b, 0x052ffb85, 0x9e5c1151, 0xe8b9286c, 0x73cac2b8, + 0x04b89f7c, 0x9fcb75a8, 0xe92e4c95, 0x725da641, 0x04e43eef, + 0x9f97d43b, 0xe972ed06, 0x720107d2, 0x0401dc5a, 0x9f72368e, + 0xe9970fb3, 0x72e4e567, 0x045d7dc9, 0x9f2e971d, 0xe9cbae20, + 0x72b844f4, 0x072f15a8, 0x9c5cff7c, 0xeab9c641, 0x71ca2c95, + 0x0773b43b, 0x9c005eef, 0xeae567d2, 0x71968d06, 0x0796568e, + 0x9ce5bc5a, 0xea008567, 0x71736fb3, 0x07caf71d, 0x9cb91dc9, + 0xea5c24f4, 0x712fce20, 0x065d93e4, 0x9d2e7930, 0xebcb400d, + 0x70b8aad9, 0x06013277, 0x9d72d8a3, 0xeb97e19e, 0x70e40b4a, + 0x06e4d0c2, 0x9d973a16, 0xeb72032b, 0x7001e9ff, 0x06b87151, + 0x9dcb9b85, 0xeb2ea2b8, 0x705d486c, 0x0b943260, 0x90e7d8b4, + 0xe602e189, 0x7d710b5d, 0x0bc893f3, 0x90bb7927, 0xe65e401a, + 0x7d2daace, 0x0b2d7146, 0x905e9b92, 0xe6bba2af, 0x7dc8487b, + 0x0b71d0d5, 0x90023a01, 0xe6e7033c, 0x7d94e9e8, 0x0ae6b42c, + 0x91955ef8, 0xe77067c5, 0x7c038d11, 0x0aba15bf, 0x91c9ff6b, + 0xe72cc656, 0x7c5f2c82, 0x0a5ff70a, 0x912c1dde, 0xe7c924e3, + 0x7cbace37, 0x0a035699, 0x9170bc4d, 0xe7958570, 0x7ce66fa4, + 0x09713ef8, 0x9202d42c, 0xe4e7ed11, 0x7f9407c5, 0x092d9f6b, + 0x925e75bf, 0xe4bb4c82, 0x7fc8a656, 0x09c87dde, 0x92bb970a, + 0xe45eae37, 0x7f2d44e3, 0x0994dc4d, 0x92e73699, 0xe4020fa4, + 0x7f71e570, 0x0803b8b4, 0x93705260, 0xe5956b5d, 0x7ee68189, + 0x085f1927, 0x932cf3f3, 0xe5c9cace, 0x7eba201a, 0x08bafb92, + 0x93c91146, 0xe52c287b, 0x7e5fc2af, 0x08e65a01, 0x9395b0d5, + 0xe57089e8, 0x7e03633c, 0x0e5e2b50, 0x952dc184, 0xe3c8f8b9, + 0x78bb126d, 0x0e028ac3, 0x95716017, 0xe394592a, 0x78e7b3fe, + 0x0ee76876, 0x959482a2, 0xe371bb9f, 0x7802514b, 0x0ebbc9e5, + 0x95c82331, 0xe32d1a0c, 0x785ef0d8, 0x0f2cad1c, 0x945f47c8, + 0xe2ba7ef5, 0x79c99421, 0x0f700c8f, 0x9403e65b, 0xe2e6df66, + 0x799535b2, 0x0f95ee3a, 0x94e604ee, 0xe2033dd3, 0x7970d707, + 0x0fc94fa9, 0x94baa57d, 0xe25f9c40, 0x792c7694, 0x0cbb27c8, + 0x97c8cd1c, 0xe12df421, 0x7a5e1ef5, 0x0ce7865b, 0x97946c8f, + 0xe17155b2, 0x7a02bf66, 0x0c0264ee, 0x97718e3a, 0xe194b707, + 0x7ae75dd3, 0x0c5ec57d, 0x972d2fa9, 0xe1c81694, 0x7abbfc40, + 0x0dc9a184, 0x96ba4b50, 0xe05f726d, 0x7b2c98b9, 0x0d950017, + 0x96e6eac3, 0xe003d3fe, 0x7b70392a, 0x0d70e2a2, 0x96030876, + 0xe0e6314b, 0x7b95db9f, 0x0d2c4331, 0x965fa9e5, 0xe0ba90d8, + 0x7bc97a0c}, + {0x00000000, 0x172864c0, 0x2e50c980, 0x3978ad40, 0x5ca19300, + 0x4b89f7c0, 0x72f15a80, 0x65d93e40, 0xb9432600, 0xae6b42c0, + 0x9713ef80, 0x803b8b40, 0xe5e2b500, 0xf2cad1c0, 0xcbb27c80, + 0xdc9a1840, 0xa9f74a41, 0xbedf2e81, 0x87a783c1, 0x908fe701, + 0xf556d941, 0xe27ebd81, 0xdb0610c1, 0xcc2e7401, 0x10b46c41, + 0x079c0881, 0x3ee4a5c1, 0x29ccc101, 0x4c15ff41, 0x5b3d9b81, + 0x624536c1, 0x756d5201, 0x889f92c3, 0x9fb7f603, 0xa6cf5b43, + 0xb1e73f83, 0xd43e01c3, 0xc3166503, 0xfa6ec843, 0xed46ac83, + 0x31dcb4c3, 0x26f4d003, 0x1f8c7d43, 0x08a41983, 0x6d7d27c3, + 0x7a554303, 0x432dee43, 0x54058a83, 0x2168d882, 0x3640bc42, + 0x0f381102, 0x181075c2, 0x7dc94b82, 0x6ae12f42, 0x53998202, + 0x44b1e6c2, 0x982bfe82, 0x8f039a42, 0xb67b3702, 0xa15353c2, + 0xc48a6d82, 0xd3a20942, 0xeadaa402, 0xfdf2c0c2, 0xca4e23c7, + 0xdd664707, 0xe41eea47, 0xf3368e87, 0x96efb0c7, 0x81c7d407, + 0xb8bf7947, 0xaf971d87, 0x730d05c7, 0x64256107, 0x5d5dcc47, + 0x4a75a887, 0x2fac96c7, 0x3884f207, 0x01fc5f47, 0x16d43b87, + 0x63b96986, 0x74910d46, 0x4de9a006, 0x5ac1c4c6, 0x3f18fa86, + 0x28309e46, 0x11483306, 0x066057c6, 0xdafa4f86, 0xcdd22b46, + 0xf4aa8606, 0xe382e2c6, 0x865bdc86, 0x9173b846, 0xa80b1506, + 0xbf2371c6, 0x42d1b104, 0x55f9d5c4, 0x6c817884, 0x7ba91c44, + 0x1e702204, 0x095846c4, 0x3020eb84, 0x27088f44, 0xfb929704, + 0xecbaf3c4, 0xd5c25e84, 0xc2ea3a44, 0xa7330404, 0xb01b60c4, + 0x8963cd84, 0x9e4ba944, 0xeb26fb45, 0xfc0e9f85, 0xc57632c5, + 0xd25e5605, 0xb7876845, 0xa0af0c85, 0x99d7a1c5, 0x8effc505, + 0x5265dd45, 0x454db985, 0x7c3514c5, 0x6b1d7005, 0x0ec44e45, + 0x19ec2a85, 0x209487c5, 0x37bce305, 0x4fed41cf, 0x58c5250f, + 0x61bd884f, 0x7695ec8f, 0x134cd2cf, 0x0464b60f, 0x3d1c1b4f, + 0x2a347f8f, 0xf6ae67cf, 0xe186030f, 0xd8feae4f, 0xcfd6ca8f, + 0xaa0ff4cf, 0xbd27900f, 0x845f3d4f, 0x9377598f, 0xe61a0b8e, + 0xf1326f4e, 0xc84ac20e, 0xdf62a6ce, 0xbabb988e, 0xad93fc4e, + 0x94eb510e, 0x83c335ce, 0x5f592d8e, 0x4871494e, 0x7109e40e, + 0x662180ce, 0x03f8be8e, 0x14d0da4e, 0x2da8770e, 0x3a8013ce, + 0xc772d30c, 0xd05ab7cc, 0xe9221a8c, 0xfe0a7e4c, 0x9bd3400c, + 0x8cfb24cc, 0xb583898c, 0xa2abed4c, 0x7e31f50c, 0x691991cc, + 0x50613c8c, 0x4749584c, 0x2290660c, 0x35b802cc, 0x0cc0af8c, + 0x1be8cb4c, 0x6e85994d, 0x79adfd8d, 0x40d550cd, 0x57fd340d, + 0x32240a4d, 0x250c6e8d, 0x1c74c3cd, 0x0b5ca70d, 0xd7c6bf4d, + 0xc0eedb8d, 0xf99676cd, 0xeebe120d, 0x8b672c4d, 0x9c4f488d, + 0xa537e5cd, 0xb21f810d, 0x85a36208, 0x928b06c8, 0xabf3ab88, + 0xbcdbcf48, 0xd902f108, 0xce2a95c8, 0xf7523888, 0xe07a5c48, + 0x3ce04408, 0x2bc820c8, 0x12b08d88, 0x0598e948, 0x6041d708, + 0x7769b3c8, 0x4e111e88, 0x59397a48, 0x2c542849, 0x3b7c4c89, + 0x0204e1c9, 0x152c8509, 0x70f5bb49, 0x67dddf89, 0x5ea572c9, + 0x498d1609, 0x95170e49, 0x823f6a89, 0xbb47c7c9, 0xac6fa309, + 0xc9b69d49, 0xde9ef989, 0xe7e654c9, 0xf0ce3009, 0x0d3cf0cb, + 0x1a14940b, 0x236c394b, 0x34445d8b, 0x519d63cb, 0x46b5070b, + 0x7fcdaa4b, 0x68e5ce8b, 0xb47fd6cb, 0xa357b20b, 0x9a2f1f4b, + 0x8d077b8b, 0xe8de45cb, 0xfff6210b, 0xc68e8c4b, 0xd1a6e88b, + 0xa4cbba8a, 0xb3e3de4a, 0x8a9b730a, 0x9db317ca, 0xf86a298a, + 0xef424d4a, 0xd63ae00a, 0xc11284ca, 0x1d889c8a, 0x0aa0f84a, + 0x33d8550a, 0x24f031ca, 0x41290f8a, 0x56016b4a, 0x6f79c60a, + 0x7851a2ca}, + {0x00000000, 0x9fda839e, 0xe4c4017d, 0x7b1e82e3, 0x12f904bb, + 0x8d238725, 0xf63d05c6, 0x69e78658, 0x25f20976, 0xba288ae8, + 0xc136080b, 0x5eec8b95, 0x370b0dcd, 0xa8d18e53, 0xd3cf0cb0, + 0x4c158f2e, 0x4be412ec, 0xd43e9172, 0xaf201391, 0x30fa900f, + 0x591d1657, 0xc6c795c9, 0xbdd9172a, 0x220394b4, 0x6e161b9a, + 0xf1cc9804, 0x8ad21ae7, 0x15089979, 0x7cef1f21, 0xe3359cbf, + 0x982b1e5c, 0x07f19dc2, 0x97c825d8, 0x0812a646, 0x730c24a5, + 0xecd6a73b, 0x85312163, 0x1aeba2fd, 0x61f5201e, 0xfe2fa380, + 0xb23a2cae, 0x2de0af30, 0x56fe2dd3, 0xc924ae4d, 0xa0c32815, + 0x3f19ab8b, 0x44072968, 0xdbddaaf6, 0xdc2c3734, 0x43f6b4aa, + 0x38e83649, 0xa732b5d7, 0xced5338f, 0x510fb011, 0x2a1132f2, + 0xb5cbb16c, 0xf9de3e42, 0x6604bddc, 0x1d1a3f3f, 0x82c0bca1, + 0xeb273af9, 0x74fdb967, 0x0fe33b84, 0x9039b81a, 0xf4e14df1, + 0x6b3bce6f, 0x10254c8c, 0x8fffcf12, 0xe618494a, 0x79c2cad4, + 0x02dc4837, 0x9d06cba9, 0xd1134487, 0x4ec9c719, 0x35d745fa, + 0xaa0dc664, 0xc3ea403c, 0x5c30c3a2, 0x272e4141, 0xb8f4c2df, + 0xbf055f1d, 0x20dfdc83, 0x5bc15e60, 0xc41bddfe, 0xadfc5ba6, + 0x3226d838, 0x49385adb, 0xd6e2d945, 0x9af7566b, 0x052dd5f5, + 0x7e335716, 0xe1e9d488, 0x880e52d0, 0x17d4d14e, 0x6cca53ad, + 0xf310d033, 0x63296829, 0xfcf3ebb7, 0x87ed6954, 0x1837eaca, + 0x71d06c92, 0xee0aef0c, 0x95146def, 0x0aceee71, 0x46db615f, + 0xd901e2c1, 0xa21f6022, 0x3dc5e3bc, 0x542265e4, 0xcbf8e67a, + 0xb0e66499, 0x2f3ce707, 0x28cd7ac5, 0xb717f95b, 0xcc097bb8, + 0x53d3f826, 0x3a347e7e, 0xa5eefde0, 0xdef07f03, 0x412afc9d, + 0x0d3f73b3, 0x92e5f02d, 0xe9fb72ce, 0x7621f150, 0x1fc67708, + 0x801cf496, 0xfb027675, 0x64d8f5eb, 0x32b39da3, 0xad691e3d, + 0xd6779cde, 0x49ad1f40, 0x204a9918, 0xbf901a86, 0xc48e9865, + 0x5b541bfb, 0x174194d5, 0x889b174b, 0xf38595a8, 0x6c5f1636, + 0x05b8906e, 0x9a6213f0, 0xe17c9113, 0x7ea6128d, 0x79578f4f, + 0xe68d0cd1, 0x9d938e32, 0x02490dac, 0x6bae8bf4, 0xf474086a, + 0x8f6a8a89, 0x10b00917, 0x5ca58639, 0xc37f05a7, 0xb8618744, + 0x27bb04da, 0x4e5c8282, 0xd186011c, 0xaa9883ff, 0x35420061, + 0xa57bb87b, 0x3aa13be5, 0x41bfb906, 0xde653a98, 0xb782bcc0, + 0x28583f5e, 0x5346bdbd, 0xcc9c3e23, 0x8089b10d, 0x1f533293, + 0x644db070, 0xfb9733ee, 0x9270b5b6, 0x0daa3628, 0x76b4b4cb, + 0xe96e3755, 0xee9faa97, 0x71452909, 0x0a5babea, 0x95812874, + 0xfc66ae2c, 0x63bc2db2, 0x18a2af51, 0x87782ccf, 0xcb6da3e1, + 0x54b7207f, 0x2fa9a29c, 0xb0732102, 0xd994a75a, 0x464e24c4, + 0x3d50a627, 0xa28a25b9, 0xc652d052, 0x598853cc, 0x2296d12f, + 0xbd4c52b1, 0xd4abd4e9, 0x4b715777, 0x306fd594, 0xafb5560a, + 0xe3a0d924, 0x7c7a5aba, 0x0764d859, 0x98be5bc7, 0xf159dd9f, + 0x6e835e01, 0x159ddce2, 0x8a475f7c, 0x8db6c2be, 0x126c4120, + 0x6972c3c3, 0xf6a8405d, 0x9f4fc605, 0x0095459b, 0x7b8bc778, + 0xe45144e6, 0xa844cbc8, 0x379e4856, 0x4c80cab5, 0xd35a492b, + 0xbabdcf73, 0x25674ced, 0x5e79ce0e, 0xc1a34d90, 0x519af58a, + 0xce407614, 0xb55ef4f7, 0x2a847769, 0x4363f131, 0xdcb972af, + 0xa7a7f04c, 0x387d73d2, 0x7468fcfc, 0xebb27f62, 0x90acfd81, + 0x0f767e1f, 0x6691f847, 0xf94b7bd9, 0x8255f93a, 0x1d8f7aa4, + 0x1a7ee766, 0x85a464f8, 0xfebae61b, 0x61606585, 0x0887e3dd, + 0x975d6043, 0xec43e2a0, 0x7399613e, 0x3f8cee10, 0xa0566d8e, + 0xdb48ef6d, 0x44926cf3, 0x2d75eaab, 0xb2af6935, 0xc9b1ebd6, + 0x566b6848}, + {0x00000000, 0x65673b46, 0xcace768c, 0xafa94dca, 0x4eedeb59, + 0x2b8ad01f, 0x84239dd5, 0xe144a693, 0x9ddbd6b2, 0xf8bcedf4, + 0x5715a03e, 0x32729b78, 0xd3363deb, 0xb65106ad, 0x19f84b67, + 0x7c9f7021, 0xe0c6ab25, 0x85a19063, 0x2a08dda9, 0x4f6fe6ef, + 0xae2b407c, 0xcb4c7b3a, 0x64e536f0, 0x01820db6, 0x7d1d7d97, + 0x187a46d1, 0xb7d30b1b, 0xd2b4305d, 0x33f096ce, 0x5697ad88, + 0xf93ee042, 0x9c59db04, 0x1afc500b, 0x7f9b6b4d, 0xd0322687, + 0xb5551dc1, 0x5411bb52, 0x31768014, 0x9edfcdde, 0xfbb8f698, + 0x872786b9, 0xe240bdff, 0x4de9f035, 0x288ecb73, 0xc9ca6de0, + 0xacad56a6, 0x03041b6c, 0x6663202a, 0xfa3afb2e, 0x9f5dc068, + 0x30f48da2, 0x5593b6e4, 0xb4d71077, 0xd1b02b31, 0x7e1966fb, + 0x1b7e5dbd, 0x67e12d9c, 0x028616da, 0xad2f5b10, 0xc8486056, + 0x290cc6c5, 0x4c6bfd83, 0xe3c2b049, 0x86a58b0f, 0x35f8a016, + 0x509f9b50, 0xff36d69a, 0x9a51eddc, 0x7b154b4f, 0x1e727009, + 0xb1db3dc3, 0xd4bc0685, 0xa82376a4, 0xcd444de2, 0x62ed0028, + 0x078a3b6e, 0xe6ce9dfd, 0x83a9a6bb, 0x2c00eb71, 0x4967d037, + 0xd53e0b33, 0xb0593075, 0x1ff07dbf, 0x7a9746f9, 0x9bd3e06a, + 0xfeb4db2c, 0x511d96e6, 0x347aada0, 0x48e5dd81, 0x2d82e6c7, + 0x822bab0d, 0xe74c904b, 0x060836d8, 0x636f0d9e, 0xccc64054, + 0xa9a17b12, 0x2f04f01d, 0x4a63cb5b, 0xe5ca8691, 0x80adbdd7, + 0x61e91b44, 0x048e2002, 0xab276dc8, 0xce40568e, 0xb2df26af, + 0xd7b81de9, 0x78115023, 0x1d766b65, 0xfc32cdf6, 0x9955f6b0, + 0x36fcbb7a, 0x539b803c, 0xcfc25b38, 0xaaa5607e, 0x050c2db4, + 0x606b16f2, 0x812fb061, 0xe4488b27, 0x4be1c6ed, 0x2e86fdab, + 0x52198d8a, 0x377eb6cc, 0x98d7fb06, 0xfdb0c040, 0x1cf466d3, + 0x79935d95, 0xd63a105f, 0xb35d2b19, 0x6bf1402c, 0x0e967b6a, + 0xa13f36a0, 0xc4580de6, 0x251cab75, 0x407b9033, 0xefd2ddf9, + 0x8ab5e6bf, 0xf62a969e, 0x934dadd8, 0x3ce4e012, 0x5983db54, + 0xb8c77dc7, 0xdda04681, 0x72090b4b, 0x176e300d, 0x8b37eb09, + 0xee50d04f, 0x41f99d85, 0x249ea6c3, 0xc5da0050, 0xa0bd3b16, + 0x0f1476dc, 0x6a734d9a, 0x16ec3dbb, 0x738b06fd, 0xdc224b37, + 0xb9457071, 0x5801d6e2, 0x3d66eda4, 0x92cfa06e, 0xf7a89b28, + 0x710d1027, 0x146a2b61, 0xbbc366ab, 0xdea45ded, 0x3fe0fb7e, + 0x5a87c038, 0xf52e8df2, 0x9049b6b4, 0xecd6c695, 0x89b1fdd3, + 0x2618b019, 0x437f8b5f, 0xa23b2dcc, 0xc75c168a, 0x68f55b40, + 0x0d926006, 0x91cbbb02, 0xf4ac8044, 0x5b05cd8e, 0x3e62f6c8, + 0xdf26505b, 0xba416b1d, 0x15e826d7, 0x708f1d91, 0x0c106db0, + 0x697756f6, 0xc6de1b3c, 0xa3b9207a, 0x42fd86e9, 0x279abdaf, + 0x8833f065, 0xed54cb23, 0x5e09e03a, 0x3b6edb7c, 0x94c796b6, + 0xf1a0adf0, 0x10e40b63, 0x75833025, 0xda2a7def, 0xbf4d46a9, + 0xc3d23688, 0xa6b50dce, 0x091c4004, 0x6c7b7b42, 0x8d3fddd1, + 0xe858e697, 0x47f1ab5d, 0x2296901b, 0xbecf4b1f, 0xdba87059, + 0x74013d93, 0x116606d5, 0xf022a046, 0x95459b00, 0x3aecd6ca, + 0x5f8bed8c, 0x23149dad, 0x4673a6eb, 0xe9daeb21, 0x8cbdd067, + 0x6df976f4, 0x089e4db2, 0xa7370078, 0xc2503b3e, 0x44f5b031, + 0x21928b77, 0x8e3bc6bd, 0xeb5cfdfb, 0x0a185b68, 0x6f7f602e, + 0xc0d62de4, 0xa5b116a2, 0xd92e6683, 0xbc495dc5, 0x13e0100f, + 0x76872b49, 0x97c38dda, 0xf2a4b69c, 0x5d0dfb56, 0x386ac010, + 0xa4331b14, 0xc1542052, 0x6efd6d98, 0x0b9a56de, 0xeadef04d, + 0x8fb9cb0b, 0x201086c1, 0x4577bd87, 0x39e8cda6, 0x5c8ff6e0, + 0xf326bb2a, 0x9641806c, 0x770526ff, 0x12621db9, 0xbdcb5073, + 0xd8ac6b35}, + {0x00000000, 0xd7e28058, 0x74b406f1, 0xa35686a9, 0xe9680de2, + 0x3e8a8dba, 0x9ddc0b13, 0x4a3e8b4b, 0x09a11d85, 0xde439ddd, + 0x7d151b74, 0xaaf79b2c, 0xe0c91067, 0x372b903f, 0x947d1696, + 0x439f96ce, 0x13423b0a, 0xc4a0bb52, 0x67f63dfb, 0xb014bda3, + 0xfa2a36e8, 0x2dc8b6b0, 0x8e9e3019, 0x597cb041, 0x1ae3268f, + 0xcd01a6d7, 0x6e57207e, 0xb9b5a026, 0xf38b2b6d, 0x2469ab35, + 0x873f2d9c, 0x50ddadc4, 0x26847614, 0xf166f64c, 0x523070e5, + 0x85d2f0bd, 0xcfec7bf6, 0x180efbae, 0xbb587d07, 0x6cbafd5f, + 0x2f256b91, 0xf8c7ebc9, 0x5b916d60, 0x8c73ed38, 0xc64d6673, + 0x11afe62b, 0xb2f96082, 0x651be0da, 0x35c64d1e, 0xe224cd46, + 0x41724bef, 0x9690cbb7, 0xdcae40fc, 0x0b4cc0a4, 0xa81a460d, + 0x7ff8c655, 0x3c67509b, 0xeb85d0c3, 0x48d3566a, 0x9f31d632, + 0xd50f5d79, 0x02eddd21, 0xa1bb5b88, 0x7659dbd0, 0x4d08ec28, + 0x9aea6c70, 0x39bcead9, 0xee5e6a81, 0xa460e1ca, 0x73826192, + 0xd0d4e73b, 0x07366763, 0x44a9f1ad, 0x934b71f5, 0x301df75c, + 0xe7ff7704, 0xadc1fc4f, 0x7a237c17, 0xd975fabe, 0x0e977ae6, + 0x5e4ad722, 0x89a8577a, 0x2afed1d3, 0xfd1c518b, 0xb722dac0, + 0x60c05a98, 0xc396dc31, 0x14745c69, 0x57ebcaa7, 0x80094aff, + 0x235fcc56, 0xf4bd4c0e, 0xbe83c745, 0x6961471d, 0xca37c1b4, + 0x1dd541ec, 0x6b8c9a3c, 0xbc6e1a64, 0x1f389ccd, 0xc8da1c95, + 0x82e497de, 0x55061786, 0xf650912f, 0x21b21177, 0x622d87b9, + 0xb5cf07e1, 0x16998148, 0xc17b0110, 0x8b458a5b, 0x5ca70a03, + 0xfff18caa, 0x28130cf2, 0x78cea136, 0xaf2c216e, 0x0c7aa7c7, + 0xdb98279f, 0x91a6acd4, 0x46442c8c, 0xe512aa25, 0x32f02a7d, + 0x716fbcb3, 0xa68d3ceb, 0x05dbba42, 0xd2393a1a, 0x9807b151, + 0x4fe53109, 0xecb3b7a0, 0x3b5137f8, 0x9a11d850, 0x4df35808, + 0xeea5dea1, 0x39475ef9, 0x7379d5b2, 0xa49b55ea, 0x07cdd343, + 0xd02f531b, 0x93b0c5d5, 0x4452458d, 0xe704c324, 0x30e6437c, + 0x7ad8c837, 0xad3a486f, 0x0e6ccec6, 0xd98e4e9e, 0x8953e35a, + 0x5eb16302, 0xfde7e5ab, 0x2a0565f3, 0x603beeb8, 0xb7d96ee0, + 0x148fe849, 0xc36d6811, 0x80f2fedf, 0x57107e87, 0xf446f82e, + 0x23a47876, 0x699af33d, 0xbe787365, 0x1d2ef5cc, 0xcacc7594, + 0xbc95ae44, 0x6b772e1c, 0xc821a8b5, 0x1fc328ed, 0x55fda3a6, + 0x821f23fe, 0x2149a557, 0xf6ab250f, 0xb534b3c1, 0x62d63399, + 0xc180b530, 0x16623568, 0x5c5cbe23, 0x8bbe3e7b, 0x28e8b8d2, + 0xff0a388a, 0xafd7954e, 0x78351516, 0xdb6393bf, 0x0c8113e7, + 0x46bf98ac, 0x915d18f4, 0x320b9e5d, 0xe5e91e05, 0xa67688cb, + 0x71940893, 0xd2c28e3a, 0x05200e62, 0x4f1e8529, 0x98fc0571, + 0x3baa83d8, 0xec480380, 0xd7193478, 0x00fbb420, 0xa3ad3289, + 0x744fb2d1, 0x3e71399a, 0xe993b9c2, 0x4ac53f6b, 0x9d27bf33, + 0xdeb829fd, 0x095aa9a5, 0xaa0c2f0c, 0x7deeaf54, 0x37d0241f, + 0xe032a447, 0x436422ee, 0x9486a2b6, 0xc45b0f72, 0x13b98f2a, + 0xb0ef0983, 0x670d89db, 0x2d330290, 0xfad182c8, 0x59870461, + 0x8e658439, 0xcdfa12f7, 0x1a1892af, 0xb94e1406, 0x6eac945e, + 0x24921f15, 0xf3709f4d, 0x502619e4, 0x87c499bc, 0xf19d426c, + 0x267fc234, 0x8529449d, 0x52cbc4c5, 0x18f54f8e, 0xcf17cfd6, + 0x6c41497f, 0xbba3c927, 0xf83c5fe9, 0x2fdedfb1, 0x8c885918, + 0x5b6ad940, 0x1154520b, 0xc6b6d253, 0x65e054fa, 0xb202d4a2, + 0xe2df7966, 0x353df93e, 0x966b7f97, 0x4189ffcf, 0x0bb77484, + 0xdc55f4dc, 0x7f037275, 0xa8e1f22d, 0xeb7e64e3, 0x3c9ce4bb, + 0x9fca6212, 0x4828e24a, 0x02166901, 0xd5f4e959, 0x76a26ff0, + 0xa140efa8}, + {0x00000000, 0xef52b6e1, 0x05d46b83, 0xea86dd62, 0x0ba8d706, + 0xe4fa61e7, 0x0e7cbc85, 0xe12e0a64, 0x1751ae0c, 0xf80318ed, + 0x1285c58f, 0xfdd7736e, 0x1cf9790a, 0xf3abcfeb, 0x192d1289, + 0xf67fa468, 0x2ea35c18, 0xc1f1eaf9, 0x2b77379b, 0xc425817a, + 0x250b8b1e, 0xca593dff, 0x20dfe09d, 0xcf8d567c, 0x39f2f214, + 0xd6a044f5, 0x3c269997, 0xd3742f76, 0x325a2512, 0xdd0893f3, + 0x378e4e91, 0xd8dcf870, 0x5d46b830, 0xb2140ed1, 0x5892d3b3, + 0xb7c06552, 0x56ee6f36, 0xb9bcd9d7, 0x533a04b5, 0xbc68b254, + 0x4a17163c, 0xa545a0dd, 0x4fc37dbf, 0xa091cb5e, 0x41bfc13a, + 0xaeed77db, 0x446baab9, 0xab391c58, 0x73e5e428, 0x9cb752c9, + 0x76318fab, 0x9963394a, 0x784d332e, 0x971f85cf, 0x7d9958ad, + 0x92cbee4c, 0x64b44a24, 0x8be6fcc5, 0x616021a7, 0x8e329746, + 0x6f1c9d22, 0x804e2bc3, 0x6ac8f6a1, 0x859a4040, 0xba8d7060, + 0x55dfc681, 0xbf591be3, 0x500bad02, 0xb125a766, 0x5e771187, + 0xb4f1cce5, 0x5ba37a04, 0xaddcde6c, 0x428e688d, 0xa808b5ef, + 0x475a030e, 0xa674096a, 0x4926bf8b, 0xa3a062e9, 0x4cf2d408, + 0x942e2c78, 0x7b7c9a99, 0x91fa47fb, 0x7ea8f11a, 0x9f86fb7e, + 0x70d44d9f, 0x9a5290fd, 0x7500261c, 0x837f8274, 0x6c2d3495, + 0x86abe9f7, 0x69f95f16, 0x88d75572, 0x6785e393, 0x8d033ef1, + 0x62518810, 0xe7cbc850, 0x08997eb1, 0xe21fa3d3, 0x0d4d1532, + 0xec631f56, 0x0331a9b7, 0xe9b774d5, 0x06e5c234, 0xf09a665c, + 0x1fc8d0bd, 0xf54e0ddf, 0x1a1cbb3e, 0xfb32b15a, 0x146007bb, + 0xfee6dad9, 0x11b46c38, 0xc9689448, 0x263a22a9, 0xccbcffcb, + 0x23ee492a, 0xc2c0434e, 0x2d92f5af, 0xc71428cd, 0x28469e2c, + 0xde393a44, 0x316b8ca5, 0xdbed51c7, 0x34bfe726, 0xd591ed42, + 0x3ac35ba3, 0xd04586c1, 0x3f173020, 0xae6be681, 0x41395060, + 0xabbf8d02, 0x44ed3be3, 0xa5c33187, 0x4a918766, 0xa0175a04, + 0x4f45ece5, 0xb93a488d, 0x5668fe6c, 0xbcee230e, 0x53bc95ef, + 0xb2929f8b, 0x5dc0296a, 0xb746f408, 0x581442e9, 0x80c8ba99, + 0x6f9a0c78, 0x851cd11a, 0x6a4e67fb, 0x8b606d9f, 0x6432db7e, + 0x8eb4061c, 0x61e6b0fd, 0x97991495, 0x78cba274, 0x924d7f16, + 0x7d1fc9f7, 0x9c31c393, 0x73637572, 0x99e5a810, 0x76b71ef1, + 0xf32d5eb1, 0x1c7fe850, 0xf6f93532, 0x19ab83d3, 0xf88589b7, + 0x17d73f56, 0xfd51e234, 0x120354d5, 0xe47cf0bd, 0x0b2e465c, + 0xe1a89b3e, 0x0efa2ddf, 0xefd427bb, 0x0086915a, 0xea004c38, + 0x0552fad9, 0xdd8e02a9, 0x32dcb448, 0xd85a692a, 0x3708dfcb, + 0xd626d5af, 0x3974634e, 0xd3f2be2c, 0x3ca008cd, 0xcadfaca5, + 0x258d1a44, 0xcf0bc726, 0x205971c7, 0xc1777ba3, 0x2e25cd42, + 0xc4a31020, 0x2bf1a6c1, 0x14e696e1, 0xfbb42000, 0x1132fd62, + 0xfe604b83, 0x1f4e41e7, 0xf01cf706, 0x1a9a2a64, 0xf5c89c85, + 0x03b738ed, 0xece58e0c, 0x0663536e, 0xe931e58f, 0x081fefeb, + 0xe74d590a, 0x0dcb8468, 0xe2993289, 0x3a45caf9, 0xd5177c18, + 0x3f91a17a, 0xd0c3179b, 0x31ed1dff, 0xdebfab1e, 0x3439767c, + 0xdb6bc09d, 0x2d1464f5, 0xc246d214, 0x28c00f76, 0xc792b997, + 0x26bcb3f3, 0xc9ee0512, 0x2368d870, 0xcc3a6e91, 0x49a02ed1, + 0xa6f29830, 0x4c744552, 0xa326f3b3, 0x4208f9d7, 0xad5a4f36, + 0x47dc9254, 0xa88e24b5, 0x5ef180dd, 0xb1a3363c, 0x5b25eb5e, + 0xb4775dbf, 0x555957db, 0xba0be13a, 0x508d3c58, 0xbfdf8ab9, + 0x670372c9, 0x8851c428, 0x62d7194a, 0x8d85afab, 0x6caba5cf, + 0x83f9132e, 0x697fce4c, 0x862d78ad, 0x7052dcc5, 0x9f006a24, + 0x7586b746, 0x9ad401a7, 0x7bfa0bc3, 0x94a8bd22, 0x7e2e6040, + 0x917cd6a1}, + {0x00000000, 0x87a6cb43, 0xd43c90c7, 0x539a5b84, 0x730827cf, + 0xf4aeec8c, 0xa734b708, 0x20927c4b, 0xe6104f9e, 0x61b684dd, + 0x322cdf59, 0xb58a141a, 0x95186851, 0x12bea312, 0x4124f896, + 0xc68233d5, 0x1751997d, 0x90f7523e, 0xc36d09ba, 0x44cbc2f9, + 0x6459beb2, 0xe3ff75f1, 0xb0652e75, 0x37c3e536, 0xf141d6e3, + 0x76e71da0, 0x257d4624, 0xa2db8d67, 0x8249f12c, 0x05ef3a6f, + 0x567561eb, 0xd1d3aaa8, 0x2ea332fa, 0xa905f9b9, 0xfa9fa23d, + 0x7d39697e, 0x5dab1535, 0xda0dde76, 0x899785f2, 0x0e314eb1, + 0xc8b37d64, 0x4f15b627, 0x1c8feda3, 0x9b2926e0, 0xbbbb5aab, + 0x3c1d91e8, 0x6f87ca6c, 0xe821012f, 0x39f2ab87, 0xbe5460c4, + 0xedce3b40, 0x6a68f003, 0x4afa8c48, 0xcd5c470b, 0x9ec61c8f, + 0x1960d7cc, 0xdfe2e419, 0x58442f5a, 0x0bde74de, 0x8c78bf9d, + 0xaceac3d6, 0x2b4c0895, 0x78d65311, 0xff709852, 0x5d4665f4, + 0xdae0aeb7, 0x897af533, 0x0edc3e70, 0x2e4e423b, 0xa9e88978, + 0xfa72d2fc, 0x7dd419bf, 0xbb562a6a, 0x3cf0e129, 0x6f6abaad, + 0xe8cc71ee, 0xc85e0da5, 0x4ff8c6e6, 0x1c629d62, 0x9bc45621, + 0x4a17fc89, 0xcdb137ca, 0x9e2b6c4e, 0x198da70d, 0x391fdb46, + 0xbeb91005, 0xed234b81, 0x6a8580c2, 0xac07b317, 0x2ba17854, + 0x783b23d0, 0xff9de893, 0xdf0f94d8, 0x58a95f9b, 0x0b33041f, + 0x8c95cf5c, 0x73e5570e, 0xf4439c4d, 0xa7d9c7c9, 0x207f0c8a, + 0x00ed70c1, 0x874bbb82, 0xd4d1e006, 0x53772b45, 0x95f51890, + 0x1253d3d3, 0x41c98857, 0xc66f4314, 0xe6fd3f5f, 0x615bf41c, + 0x32c1af98, 0xb56764db, 0x64b4ce73, 0xe3120530, 0xb0885eb4, + 0x372e95f7, 0x17bce9bc, 0x901a22ff, 0xc380797b, 0x4426b238, + 0x82a481ed, 0x05024aae, 0x5698112a, 0xd13eda69, 0xf1aca622, + 0x760a6d61, 0x259036e5, 0xa236fda6, 0xba8ccbe8, 0x3d2a00ab, + 0x6eb05b2f, 0xe916906c, 0xc984ec27, 0x4e222764, 0x1db87ce0, + 0x9a1eb7a3, 0x5c9c8476, 0xdb3a4f35, 0x88a014b1, 0x0f06dff2, + 0x2f94a3b9, 0xa83268fa, 0xfba8337e, 0x7c0ef83d, 0xaddd5295, + 0x2a7b99d6, 0x79e1c252, 0xfe470911, 0xded5755a, 0x5973be19, + 0x0ae9e59d, 0x8d4f2ede, 0x4bcd1d0b, 0xcc6bd648, 0x9ff18dcc, + 0x1857468f, 0x38c53ac4, 0xbf63f187, 0xecf9aa03, 0x6b5f6140, + 0x942ff912, 0x13893251, 0x401369d5, 0xc7b5a296, 0xe727dedd, + 0x6081159e, 0x331b4e1a, 0xb4bd8559, 0x723fb68c, 0xf5997dcf, + 0xa603264b, 0x21a5ed08, 0x01379143, 0x86915a00, 0xd50b0184, + 0x52adcac7, 0x837e606f, 0x04d8ab2c, 0x5742f0a8, 0xd0e43beb, + 0xf07647a0, 0x77d08ce3, 0x244ad767, 0xa3ec1c24, 0x656e2ff1, + 0xe2c8e4b2, 0xb152bf36, 0x36f47475, 0x1666083e, 0x91c0c37d, + 0xc25a98f9, 0x45fc53ba, 0xe7caae1c, 0x606c655f, 0x33f63edb, + 0xb450f598, 0x94c289d3, 0x13644290, 0x40fe1914, 0xc758d257, + 0x01dae182, 0x867c2ac1, 0xd5e67145, 0x5240ba06, 0x72d2c64d, + 0xf5740d0e, 0xa6ee568a, 0x21489dc9, 0xf09b3761, 0x773dfc22, + 0x24a7a7a6, 0xa3016ce5, 0x839310ae, 0x0435dbed, 0x57af8069, + 0xd0094b2a, 0x168b78ff, 0x912db3bc, 0xc2b7e838, 0x4511237b, + 0x65835f30, 0xe2259473, 0xb1bfcff7, 0x361904b4, 0xc9699ce6, + 0x4ecf57a5, 0x1d550c21, 0x9af3c762, 0xba61bb29, 0x3dc7706a, + 0x6e5d2bee, 0xe9fbe0ad, 0x2f79d378, 0xa8df183b, 0xfb4543bf, + 0x7ce388fc, 0x5c71f4b7, 0xdbd73ff4, 0x884d6470, 0x0febaf33, + 0xde38059b, 0x599eced8, 0x0a04955c, 0x8da25e1f, 0xad302254, + 0x2a96e917, 0x790cb293, 0xfeaa79d0, 0x38284a05, 0xbf8e8146, + 0xec14dac2, 0x6bb21181, 0x4b206dca, 0xcc86a689, 0x9f1cfd0d, + 0x18ba364e}}; + +local const z_word_t FAR crc_braid_big_table[][256] = { + {0x0000000000000000, 0x43cba68700000000, 0xc7903cd400000000, + 0x845b9a5300000000, 0xcf27087300000000, 0x8cecaef400000000, + 0x08b734a700000000, 0x4b7c922000000000, 0x9e4f10e600000000, + 0xdd84b66100000000, 0x59df2c3200000000, 0x1a148ab500000000, + 0x5168189500000000, 0x12a3be1200000000, 0x96f8244100000000, + 0xd53382c600000000, 0x7d99511700000000, 0x3e52f79000000000, + 0xba096dc300000000, 0xf9c2cb4400000000, 0xb2be596400000000, + 0xf175ffe300000000, 0x752e65b000000000, 0x36e5c33700000000, + 0xe3d641f100000000, 0xa01de77600000000, 0x24467d2500000000, + 0x678ddba200000000, 0x2cf1498200000000, 0x6f3aef0500000000, + 0xeb61755600000000, 0xa8aad3d100000000, 0xfa32a32e00000000, + 0xb9f905a900000000, 0x3da29ffa00000000, 0x7e69397d00000000, + 0x3515ab5d00000000, 0x76de0dda00000000, 0xf285978900000000, + 0xb14e310e00000000, 0x647db3c800000000, 0x27b6154f00000000, + 0xa3ed8f1c00000000, 0xe026299b00000000, 0xab5abbbb00000000, + 0xe8911d3c00000000, 0x6cca876f00000000, 0x2f0121e800000000, + 0x87abf23900000000, 0xc46054be00000000, 0x403bceed00000000, + 0x03f0686a00000000, 0x488cfa4a00000000, 0x0b475ccd00000000, + 0x8f1cc69e00000000, 0xccd7601900000000, 0x19e4e2df00000000, + 0x5a2f445800000000, 0xde74de0b00000000, 0x9dbf788c00000000, + 0xd6c3eaac00000000, 0x95084c2b00000000, 0x1153d67800000000, + 0x529870ff00000000, 0xf465465d00000000, 0xb7aee0da00000000, + 0x33f57a8900000000, 0x703edc0e00000000, 0x3b424e2e00000000, + 0x7889e8a900000000, 0xfcd272fa00000000, 0xbf19d47d00000000, + 0x6a2a56bb00000000, 0x29e1f03c00000000, 0xadba6a6f00000000, + 0xee71cce800000000, 0xa50d5ec800000000, 0xe6c6f84f00000000, + 0x629d621c00000000, 0x2156c49b00000000, 0x89fc174a00000000, + 0xca37b1cd00000000, 0x4e6c2b9e00000000, 0x0da78d1900000000, + 0x46db1f3900000000, 0x0510b9be00000000, 0x814b23ed00000000, + 0xc280856a00000000, 0x17b307ac00000000, 0x5478a12b00000000, + 0xd0233b7800000000, 0x93e89dff00000000, 0xd8940fdf00000000, + 0x9b5fa95800000000, 0x1f04330b00000000, 0x5ccf958c00000000, + 0x0e57e57300000000, 0x4d9c43f400000000, 0xc9c7d9a700000000, + 0x8a0c7f2000000000, 0xc170ed0000000000, 0x82bb4b8700000000, + 0x06e0d1d400000000, 0x452b775300000000, 0x9018f59500000000, + 0xd3d3531200000000, 0x5788c94100000000, 0x14436fc600000000, + 0x5f3ffde600000000, 0x1cf45b6100000000, 0x98afc13200000000, + 0xdb6467b500000000, 0x73ceb46400000000, 0x300512e300000000, + 0xb45e88b000000000, 0xf7952e3700000000, 0xbce9bc1700000000, + 0xff221a9000000000, 0x7b7980c300000000, 0x38b2264400000000, + 0xed81a48200000000, 0xae4a020500000000, 0x2a11985600000000, + 0x69da3ed100000000, 0x22a6acf100000000, 0x616d0a7600000000, + 0xe536902500000000, 0xa6fd36a200000000, 0xe8cb8cba00000000, + 0xab002a3d00000000, 0x2f5bb06e00000000, 0x6c9016e900000000, + 0x27ec84c900000000, 0x6427224e00000000, 0xe07cb81d00000000, + 0xa3b71e9a00000000, 0x76849c5c00000000, 0x354f3adb00000000, + 0xb114a08800000000, 0xf2df060f00000000, 0xb9a3942f00000000, + 0xfa6832a800000000, 0x7e33a8fb00000000, 0x3df80e7c00000000, + 0x9552ddad00000000, 0xd6997b2a00000000, 0x52c2e17900000000, + 0x110947fe00000000, 0x5a75d5de00000000, 0x19be735900000000, + 0x9de5e90a00000000, 0xde2e4f8d00000000, 0x0b1dcd4b00000000, + 0x48d66bcc00000000, 0xcc8df19f00000000, 0x8f46571800000000, + 0xc43ac53800000000, 0x87f163bf00000000, 0x03aaf9ec00000000, + 0x40615f6b00000000, 0x12f92f9400000000, 0x5132891300000000, + 0xd569134000000000, 0x96a2b5c700000000, 0xddde27e700000000, + 0x9e15816000000000, 0x1a4e1b3300000000, 0x5985bdb400000000, + 0x8cb63f7200000000, 0xcf7d99f500000000, 0x4b2603a600000000, + 0x08eda52100000000, 0x4391370100000000, 0x005a918600000000, + 0x84010bd500000000, 0xc7caad5200000000, 0x6f607e8300000000, + 0x2cabd80400000000, 0xa8f0425700000000, 0xeb3be4d000000000, + 0xa04776f000000000, 0xe38cd07700000000, 0x67d74a2400000000, + 0x241ceca300000000, 0xf12f6e6500000000, 0xb2e4c8e200000000, + 0x36bf52b100000000, 0x7574f43600000000, 0x3e08661600000000, + 0x7dc3c09100000000, 0xf9985ac200000000, 0xba53fc4500000000, + 0x1caecae700000000, 0x5f656c6000000000, 0xdb3ef63300000000, + 0x98f550b400000000, 0xd389c29400000000, 0x9042641300000000, + 0x1419fe4000000000, 0x57d258c700000000, 0x82e1da0100000000, + 0xc12a7c8600000000, 0x4571e6d500000000, 0x06ba405200000000, + 0x4dc6d27200000000, 0x0e0d74f500000000, 0x8a56eea600000000, + 0xc99d482100000000, 0x61379bf000000000, 0x22fc3d7700000000, + 0xa6a7a72400000000, 0xe56c01a300000000, 0xae10938300000000, + 0xeddb350400000000, 0x6980af5700000000, 0x2a4b09d000000000, + 0xff788b1600000000, 0xbcb32d9100000000, 0x38e8b7c200000000, + 0x7b23114500000000, 0x305f836500000000, 0x739425e200000000, + 0xf7cfbfb100000000, 0xb404193600000000, 0xe69c69c900000000, + 0xa557cf4e00000000, 0x210c551d00000000, 0x62c7f39a00000000, + 0x29bb61ba00000000, 0x6a70c73d00000000, 0xee2b5d6e00000000, + 0xade0fbe900000000, 0x78d3792f00000000, 0x3b18dfa800000000, + 0xbf4345fb00000000, 0xfc88e37c00000000, 0xb7f4715c00000000, + 0xf43fd7db00000000, 0x70644d8800000000, 0x33afeb0f00000000, + 0x9b0538de00000000, 0xd8ce9e5900000000, 0x5c95040a00000000, + 0x1f5ea28d00000000, 0x542230ad00000000, 0x17e9962a00000000, + 0x93b20c7900000000, 0xd079aafe00000000, 0x054a283800000000, + 0x46818ebf00000000, 0xc2da14ec00000000, 0x8111b26b00000000, + 0xca6d204b00000000, 0x89a686cc00000000, 0x0dfd1c9f00000000, + 0x4e36ba1800000000}, + {0x0000000000000000, 0xe1b652ef00000000, 0x836bd40500000000, + 0x62dd86ea00000000, 0x06d7a80b00000000, 0xe761fae400000000, + 0x85bc7c0e00000000, 0x640a2ee100000000, 0x0cae511700000000, + 0xed1803f800000000, 0x8fc5851200000000, 0x6e73d7fd00000000, + 0x0a79f91c00000000, 0xebcfabf300000000, 0x89122d1900000000, + 0x68a47ff600000000, 0x185ca32e00000000, 0xf9eaf1c100000000, + 0x9b37772b00000000, 0x7a8125c400000000, 0x1e8b0b2500000000, + 0xff3d59ca00000000, 0x9de0df2000000000, 0x7c568dcf00000000, + 0x14f2f23900000000, 0xf544a0d600000000, 0x9799263c00000000, + 0x762f74d300000000, 0x12255a3200000000, 0xf39308dd00000000, + 0x914e8e3700000000, 0x70f8dcd800000000, 0x30b8465d00000000, + 0xd10e14b200000000, 0xb3d3925800000000, 0x5265c0b700000000, + 0x366fee5600000000, 0xd7d9bcb900000000, 0xb5043a5300000000, + 0x54b268bc00000000, 0x3c16174a00000000, 0xdda045a500000000, + 0xbf7dc34f00000000, 0x5ecb91a000000000, 0x3ac1bf4100000000, + 0xdb77edae00000000, 0xb9aa6b4400000000, 0x581c39ab00000000, + 0x28e4e57300000000, 0xc952b79c00000000, 0xab8f317600000000, + 0x4a39639900000000, 0x2e334d7800000000, 0xcf851f9700000000, + 0xad58997d00000000, 0x4ceecb9200000000, 0x244ab46400000000, + 0xc5fce68b00000000, 0xa721606100000000, 0x4697328e00000000, + 0x229d1c6f00000000, 0xc32b4e8000000000, 0xa1f6c86a00000000, + 0x40409a8500000000, 0x60708dba00000000, 0x81c6df5500000000, + 0xe31b59bf00000000, 0x02ad0b5000000000, 0x66a725b100000000, + 0x8711775e00000000, 0xe5ccf1b400000000, 0x047aa35b00000000, + 0x6cdedcad00000000, 0x8d688e4200000000, 0xefb508a800000000, + 0x0e035a4700000000, 0x6a0974a600000000, 0x8bbf264900000000, + 0xe962a0a300000000, 0x08d4f24c00000000, 0x782c2e9400000000, + 0x999a7c7b00000000, 0xfb47fa9100000000, 0x1af1a87e00000000, + 0x7efb869f00000000, 0x9f4dd47000000000, 0xfd90529a00000000, + 0x1c26007500000000, 0x74827f8300000000, 0x95342d6c00000000, + 0xf7e9ab8600000000, 0x165ff96900000000, 0x7255d78800000000, + 0x93e3856700000000, 0xf13e038d00000000, 0x1088516200000000, + 0x50c8cbe700000000, 0xb17e990800000000, 0xd3a31fe200000000, + 0x32154d0d00000000, 0x561f63ec00000000, 0xb7a9310300000000, + 0xd574b7e900000000, 0x34c2e50600000000, 0x5c669af000000000, + 0xbdd0c81f00000000, 0xdf0d4ef500000000, 0x3ebb1c1a00000000, + 0x5ab132fb00000000, 0xbb07601400000000, 0xd9dae6fe00000000, + 0x386cb41100000000, 0x489468c900000000, 0xa9223a2600000000, + 0xcbffbccc00000000, 0x2a49ee2300000000, 0x4e43c0c200000000, + 0xaff5922d00000000, 0xcd2814c700000000, 0x2c9e462800000000, + 0x443a39de00000000, 0xa58c6b3100000000, 0xc751eddb00000000, + 0x26e7bf3400000000, 0x42ed91d500000000, 0xa35bc33a00000000, + 0xc18645d000000000, 0x2030173f00000000, 0x81e66bae00000000, + 0x6050394100000000, 0x028dbfab00000000, 0xe33bed4400000000, + 0x8731c3a500000000, 0x6687914a00000000, 0x045a17a000000000, + 0xe5ec454f00000000, 0x8d483ab900000000, 0x6cfe685600000000, + 0x0e23eebc00000000, 0xef95bc5300000000, 0x8b9f92b200000000, + 0x6a29c05d00000000, 0x08f446b700000000, 0xe942145800000000, + 0x99bac88000000000, 0x780c9a6f00000000, 0x1ad11c8500000000, + 0xfb674e6a00000000, 0x9f6d608b00000000, 0x7edb326400000000, + 0x1c06b48e00000000, 0xfdb0e66100000000, 0x9514999700000000, + 0x74a2cb7800000000, 0x167f4d9200000000, 0xf7c91f7d00000000, + 0x93c3319c00000000, 0x7275637300000000, 0x10a8e59900000000, + 0xf11eb77600000000, 0xb15e2df300000000, 0x50e87f1c00000000, + 0x3235f9f600000000, 0xd383ab1900000000, 0xb78985f800000000, + 0x563fd71700000000, 0x34e251fd00000000, 0xd554031200000000, + 0xbdf07ce400000000, 0x5c462e0b00000000, 0x3e9ba8e100000000, + 0xdf2dfa0e00000000, 0xbb27d4ef00000000, 0x5a91860000000000, + 0x384c00ea00000000, 0xd9fa520500000000, 0xa9028edd00000000, + 0x48b4dc3200000000, 0x2a695ad800000000, 0xcbdf083700000000, + 0xafd526d600000000, 0x4e63743900000000, 0x2cbef2d300000000, + 0xcd08a03c00000000, 0xa5acdfca00000000, 0x441a8d2500000000, + 0x26c70bcf00000000, 0xc771592000000000, 0xa37b77c100000000, + 0x42cd252e00000000, 0x2010a3c400000000, 0xc1a6f12b00000000, + 0xe196e61400000000, 0x0020b4fb00000000, 0x62fd321100000000, + 0x834b60fe00000000, 0xe7414e1f00000000, 0x06f71cf000000000, + 0x642a9a1a00000000, 0x859cc8f500000000, 0xed38b70300000000, + 0x0c8ee5ec00000000, 0x6e53630600000000, 0x8fe531e900000000, + 0xebef1f0800000000, 0x0a594de700000000, 0x6884cb0d00000000, + 0x893299e200000000, 0xf9ca453a00000000, 0x187c17d500000000, + 0x7aa1913f00000000, 0x9b17c3d000000000, 0xff1ded3100000000, + 0x1eabbfde00000000, 0x7c76393400000000, 0x9dc06bdb00000000, + 0xf564142d00000000, 0x14d246c200000000, 0x760fc02800000000, + 0x97b992c700000000, 0xf3b3bc2600000000, 0x1205eec900000000, + 0x70d8682300000000, 0x916e3acc00000000, 0xd12ea04900000000, + 0x3098f2a600000000, 0x5245744c00000000, 0xb3f326a300000000, + 0xd7f9084200000000, 0x364f5aad00000000, 0x5492dc4700000000, + 0xb5248ea800000000, 0xdd80f15e00000000, 0x3c36a3b100000000, + 0x5eeb255b00000000, 0xbf5d77b400000000, 0xdb57595500000000, + 0x3ae10bba00000000, 0x583c8d5000000000, 0xb98adfbf00000000, + 0xc972036700000000, 0x28c4518800000000, 0x4a19d76200000000, + 0xabaf858d00000000, 0xcfa5ab6c00000000, 0x2e13f98300000000, + 0x4cce7f6900000000, 0xad782d8600000000, 0xc5dc527000000000, + 0x246a009f00000000, 0x46b7867500000000, 0xa701d49a00000000, + 0xc30bfa7b00000000, 0x22bda89400000000, 0x40602e7e00000000, + 0xa1d67c9100000000}, + {0x0000000000000000, 0x5880e2d700000000, 0xf106b47400000000, + 0xa98656a300000000, 0xe20d68e900000000, 0xba8d8a3e00000000, + 0x130bdc9d00000000, 0x4b8b3e4a00000000, 0x851da10900000000, + 0xdd9d43de00000000, 0x741b157d00000000, 0x2c9bf7aa00000000, + 0x6710c9e000000000, 0x3f902b3700000000, 0x96167d9400000000, + 0xce969f4300000000, 0x0a3b421300000000, 0x52bba0c400000000, + 0xfb3df66700000000, 0xa3bd14b000000000, 0xe8362afa00000000, + 0xb0b6c82d00000000, 0x19309e8e00000000, 0x41b07c5900000000, + 0x8f26e31a00000000, 0xd7a601cd00000000, 0x7e20576e00000000, + 0x26a0b5b900000000, 0x6d2b8bf300000000, 0x35ab692400000000, + 0x9c2d3f8700000000, 0xc4addd5000000000, 0x1476842600000000, + 0x4cf666f100000000, 0xe570305200000000, 0xbdf0d28500000000, + 0xf67beccf00000000, 0xaefb0e1800000000, 0x077d58bb00000000, + 0x5ffdba6c00000000, 0x916b252f00000000, 0xc9ebc7f800000000, + 0x606d915b00000000, 0x38ed738c00000000, 0x73664dc600000000, + 0x2be6af1100000000, 0x8260f9b200000000, 0xdae01b6500000000, + 0x1e4dc63500000000, 0x46cd24e200000000, 0xef4b724100000000, + 0xb7cb909600000000, 0xfc40aedc00000000, 0xa4c04c0b00000000, + 0x0d461aa800000000, 0x55c6f87f00000000, 0x9b50673c00000000, + 0xc3d085eb00000000, 0x6a56d34800000000, 0x32d6319f00000000, + 0x795d0fd500000000, 0x21dded0200000000, 0x885bbba100000000, + 0xd0db597600000000, 0x28ec084d00000000, 0x706cea9a00000000, + 0xd9eabc3900000000, 0x816a5eee00000000, 0xcae160a400000000, + 0x9261827300000000, 0x3be7d4d000000000, 0x6367360700000000, + 0xadf1a94400000000, 0xf5714b9300000000, 0x5cf71d3000000000, + 0x0477ffe700000000, 0x4ffcc1ad00000000, 0x177c237a00000000, + 0xbefa75d900000000, 0xe67a970e00000000, 0x22d74a5e00000000, + 0x7a57a88900000000, 0xd3d1fe2a00000000, 0x8b511cfd00000000, + 0xc0da22b700000000, 0x985ac06000000000, 0x31dc96c300000000, + 0x695c741400000000, 0xa7caeb5700000000, 0xff4a098000000000, + 0x56cc5f2300000000, 0x0e4cbdf400000000, 0x45c783be00000000, + 0x1d47616900000000, 0xb4c137ca00000000, 0xec41d51d00000000, + 0x3c9a8c6b00000000, 0x641a6ebc00000000, 0xcd9c381f00000000, + 0x951cdac800000000, 0xde97e48200000000, 0x8617065500000000, + 0x2f9150f600000000, 0x7711b22100000000, 0xb9872d6200000000, + 0xe107cfb500000000, 0x4881991600000000, 0x10017bc100000000, + 0x5b8a458b00000000, 0x030aa75c00000000, 0xaa8cf1ff00000000, + 0xf20c132800000000, 0x36a1ce7800000000, 0x6e212caf00000000, + 0xc7a77a0c00000000, 0x9f2798db00000000, 0xd4aca69100000000, + 0x8c2c444600000000, 0x25aa12e500000000, 0x7d2af03200000000, + 0xb3bc6f7100000000, 0xeb3c8da600000000, 0x42badb0500000000, + 0x1a3a39d200000000, 0x51b1079800000000, 0x0931e54f00000000, + 0xa0b7b3ec00000000, 0xf837513b00000000, 0x50d8119a00000000, + 0x0858f34d00000000, 0xa1dea5ee00000000, 0xf95e473900000000, + 0xb2d5797300000000, 0xea559ba400000000, 0x43d3cd0700000000, + 0x1b532fd000000000, 0xd5c5b09300000000, 0x8d45524400000000, + 0x24c304e700000000, 0x7c43e63000000000, 0x37c8d87a00000000, + 0x6f483aad00000000, 0xc6ce6c0e00000000, 0x9e4e8ed900000000, + 0x5ae3538900000000, 0x0263b15e00000000, 0xabe5e7fd00000000, + 0xf365052a00000000, 0xb8ee3b6000000000, 0xe06ed9b700000000, + 0x49e88f1400000000, 0x11686dc300000000, 0xdffef28000000000, + 0x877e105700000000, 0x2ef846f400000000, 0x7678a42300000000, + 0x3df39a6900000000, 0x657378be00000000, 0xccf52e1d00000000, + 0x9475ccca00000000, 0x44ae95bc00000000, 0x1c2e776b00000000, + 0xb5a821c800000000, 0xed28c31f00000000, 0xa6a3fd5500000000, + 0xfe231f8200000000, 0x57a5492100000000, 0x0f25abf600000000, + 0xc1b334b500000000, 0x9933d66200000000, 0x30b580c100000000, + 0x6835621600000000, 0x23be5c5c00000000, 0x7b3ebe8b00000000, + 0xd2b8e82800000000, 0x8a380aff00000000, 0x4e95d7af00000000, + 0x1615357800000000, 0xbf9363db00000000, 0xe713810c00000000, + 0xac98bf4600000000, 0xf4185d9100000000, 0x5d9e0b3200000000, + 0x051ee9e500000000, 0xcb8876a600000000, 0x9308947100000000, + 0x3a8ec2d200000000, 0x620e200500000000, 0x29851e4f00000000, + 0x7105fc9800000000, 0xd883aa3b00000000, 0x800348ec00000000, + 0x783419d700000000, 0x20b4fb0000000000, 0x8932ada300000000, + 0xd1b24f7400000000, 0x9a39713e00000000, 0xc2b993e900000000, + 0x6b3fc54a00000000, 0x33bf279d00000000, 0xfd29b8de00000000, + 0xa5a95a0900000000, 0x0c2f0caa00000000, 0x54afee7d00000000, + 0x1f24d03700000000, 0x47a432e000000000, 0xee22644300000000, + 0xb6a2869400000000, 0x720f5bc400000000, 0x2a8fb91300000000, + 0x8309efb000000000, 0xdb890d6700000000, 0x9002332d00000000, + 0xc882d1fa00000000, 0x6104875900000000, 0x3984658e00000000, + 0xf712facd00000000, 0xaf92181a00000000, 0x06144eb900000000, + 0x5e94ac6e00000000, 0x151f922400000000, 0x4d9f70f300000000, + 0xe419265000000000, 0xbc99c48700000000, 0x6c429df100000000, + 0x34c27f2600000000, 0x9d44298500000000, 0xc5c4cb5200000000, + 0x8e4ff51800000000, 0xd6cf17cf00000000, 0x7f49416c00000000, + 0x27c9a3bb00000000, 0xe95f3cf800000000, 0xb1dfde2f00000000, + 0x1859888c00000000, 0x40d96a5b00000000, 0x0b52541100000000, + 0x53d2b6c600000000, 0xfa54e06500000000, 0xa2d402b200000000, + 0x6679dfe200000000, 0x3ef93d3500000000, 0x977f6b9600000000, + 0xcfff894100000000, 0x8474b70b00000000, 0xdcf455dc00000000, + 0x7572037f00000000, 0x2df2e1a800000000, 0xe3647eeb00000000, + 0xbbe49c3c00000000, 0x1262ca9f00000000, 0x4ae2284800000000, + 0x0169160200000000, 0x59e9f4d500000000, 0xf06fa27600000000, + 0xa8ef40a100000000}, + {0x0000000000000000, 0x463b676500000000, 0x8c76ceca00000000, + 0xca4da9af00000000, 0x59ebed4e00000000, 0x1fd08a2b00000000, + 0xd59d238400000000, 0x93a644e100000000, 0xb2d6db9d00000000, + 0xf4edbcf800000000, 0x3ea0155700000000, 0x789b723200000000, + 0xeb3d36d300000000, 0xad0651b600000000, 0x674bf81900000000, + 0x21709f7c00000000, 0x25abc6e000000000, 0x6390a18500000000, + 0xa9dd082a00000000, 0xefe66f4f00000000, 0x7c402bae00000000, + 0x3a7b4ccb00000000, 0xf036e56400000000, 0xb60d820100000000, + 0x977d1d7d00000000, 0xd1467a1800000000, 0x1b0bd3b700000000, + 0x5d30b4d200000000, 0xce96f03300000000, 0x88ad975600000000, + 0x42e03ef900000000, 0x04db599c00000000, 0x0b50fc1a00000000, + 0x4d6b9b7f00000000, 0x872632d000000000, 0xc11d55b500000000, + 0x52bb115400000000, 0x1480763100000000, 0xdecddf9e00000000, + 0x98f6b8fb00000000, 0xb986278700000000, 0xffbd40e200000000, + 0x35f0e94d00000000, 0x73cb8e2800000000, 0xe06dcac900000000, + 0xa656adac00000000, 0x6c1b040300000000, 0x2a20636600000000, + 0x2efb3afa00000000, 0x68c05d9f00000000, 0xa28df43000000000, + 0xe4b6935500000000, 0x7710d7b400000000, 0x312bb0d100000000, + 0xfb66197e00000000, 0xbd5d7e1b00000000, 0x9c2de16700000000, + 0xda16860200000000, 0x105b2fad00000000, 0x566048c800000000, + 0xc5c60c2900000000, 0x83fd6b4c00000000, 0x49b0c2e300000000, + 0x0f8ba58600000000, 0x16a0f83500000000, 0x509b9f5000000000, + 0x9ad636ff00000000, 0xdced519a00000000, 0x4f4b157b00000000, + 0x0970721e00000000, 0xc33ddbb100000000, 0x8506bcd400000000, + 0xa47623a800000000, 0xe24d44cd00000000, 0x2800ed6200000000, + 0x6e3b8a0700000000, 0xfd9dcee600000000, 0xbba6a98300000000, + 0x71eb002c00000000, 0x37d0674900000000, 0x330b3ed500000000, + 0x753059b000000000, 0xbf7df01f00000000, 0xf946977a00000000, + 0x6ae0d39b00000000, 0x2cdbb4fe00000000, 0xe6961d5100000000, + 0xa0ad7a3400000000, 0x81dde54800000000, 0xc7e6822d00000000, + 0x0dab2b8200000000, 0x4b904ce700000000, 0xd836080600000000, + 0x9e0d6f6300000000, 0x5440c6cc00000000, 0x127ba1a900000000, + 0x1df0042f00000000, 0x5bcb634a00000000, 0x9186cae500000000, + 0xd7bdad8000000000, 0x441be96100000000, 0x02208e0400000000, + 0xc86d27ab00000000, 0x8e5640ce00000000, 0xaf26dfb200000000, + 0xe91db8d700000000, 0x2350117800000000, 0x656b761d00000000, + 0xf6cd32fc00000000, 0xb0f6559900000000, 0x7abbfc3600000000, + 0x3c809b5300000000, 0x385bc2cf00000000, 0x7e60a5aa00000000, + 0xb42d0c0500000000, 0xf2166b6000000000, 0x61b02f8100000000, + 0x278b48e400000000, 0xedc6e14b00000000, 0xabfd862e00000000, + 0x8a8d195200000000, 0xccb67e3700000000, 0x06fbd79800000000, + 0x40c0b0fd00000000, 0xd366f41c00000000, 0x955d937900000000, + 0x5f103ad600000000, 0x192b5db300000000, 0x2c40f16b00000000, + 0x6a7b960e00000000, 0xa0363fa100000000, 0xe60d58c400000000, + 0x75ab1c2500000000, 0x33907b4000000000, 0xf9ddd2ef00000000, + 0xbfe6b58a00000000, 0x9e962af600000000, 0xd8ad4d9300000000, + 0x12e0e43c00000000, 0x54db835900000000, 0xc77dc7b800000000, + 0x8146a0dd00000000, 0x4b0b097200000000, 0x0d306e1700000000, + 0x09eb378b00000000, 0x4fd050ee00000000, 0x859df94100000000, + 0xc3a69e2400000000, 0x5000dac500000000, 0x163bbda000000000, + 0xdc76140f00000000, 0x9a4d736a00000000, 0xbb3dec1600000000, + 0xfd068b7300000000, 0x374b22dc00000000, 0x717045b900000000, + 0xe2d6015800000000, 0xa4ed663d00000000, 0x6ea0cf9200000000, + 0x289ba8f700000000, 0x27100d7100000000, 0x612b6a1400000000, + 0xab66c3bb00000000, 0xed5da4de00000000, 0x7efbe03f00000000, + 0x38c0875a00000000, 0xf28d2ef500000000, 0xb4b6499000000000, + 0x95c6d6ec00000000, 0xd3fdb18900000000, 0x19b0182600000000, + 0x5f8b7f4300000000, 0xcc2d3ba200000000, 0x8a165cc700000000, + 0x405bf56800000000, 0x0660920d00000000, 0x02bbcb9100000000, + 0x4480acf400000000, 0x8ecd055b00000000, 0xc8f6623e00000000, + 0x5b5026df00000000, 0x1d6b41ba00000000, 0xd726e81500000000, + 0x911d8f7000000000, 0xb06d100c00000000, 0xf656776900000000, + 0x3c1bdec600000000, 0x7a20b9a300000000, 0xe986fd4200000000, + 0xafbd9a2700000000, 0x65f0338800000000, 0x23cb54ed00000000, + 0x3ae0095e00000000, 0x7cdb6e3b00000000, 0xb696c79400000000, + 0xf0ada0f100000000, 0x630be41000000000, 0x2530837500000000, + 0xef7d2ada00000000, 0xa9464dbf00000000, 0x8836d2c300000000, + 0xce0db5a600000000, 0x04401c0900000000, 0x427b7b6c00000000, + 0xd1dd3f8d00000000, 0x97e658e800000000, 0x5dabf14700000000, + 0x1b90962200000000, 0x1f4bcfbe00000000, 0x5970a8db00000000, + 0x933d017400000000, 0xd506661100000000, 0x46a022f000000000, + 0x009b459500000000, 0xcad6ec3a00000000, 0x8ced8b5f00000000, + 0xad9d142300000000, 0xeba6734600000000, 0x21ebdae900000000, + 0x67d0bd8c00000000, 0xf476f96d00000000, 0xb24d9e0800000000, + 0x780037a700000000, 0x3e3b50c200000000, 0x31b0f54400000000, + 0x778b922100000000, 0xbdc63b8e00000000, 0xfbfd5ceb00000000, + 0x685b180a00000000, 0x2e607f6f00000000, 0xe42dd6c000000000, + 0xa216b1a500000000, 0x83662ed900000000, 0xc55d49bc00000000, + 0x0f10e01300000000, 0x492b877600000000, 0xda8dc39700000000, + 0x9cb6a4f200000000, 0x56fb0d5d00000000, 0x10c06a3800000000, + 0x141b33a400000000, 0x522054c100000000, 0x986dfd6e00000000, + 0xde569a0b00000000, 0x4df0deea00000000, 0x0bcbb98f00000000, + 0xc186102000000000, 0x87bd774500000000, 0xa6cde83900000000, + 0xe0f68f5c00000000, 0x2abb26f300000000, 0x6c80419600000000, + 0xff26057700000000, 0xb91d621200000000, 0x7350cbbd00000000, + 0x356bacd800000000}, + {0x0000000000000000, 0x9e83da9f00000000, 0x7d01c4e400000000, + 0xe3821e7b00000000, 0xbb04f91200000000, 0x2587238d00000000, + 0xc6053df600000000, 0x5886e76900000000, 0x7609f22500000000, + 0xe88a28ba00000000, 0x0b0836c100000000, 0x958bec5e00000000, + 0xcd0d0b3700000000, 0x538ed1a800000000, 0xb00ccfd300000000, + 0x2e8f154c00000000, 0xec12e44b00000000, 0x72913ed400000000, + 0x911320af00000000, 0x0f90fa3000000000, 0x57161d5900000000, + 0xc995c7c600000000, 0x2a17d9bd00000000, 0xb494032200000000, + 0x9a1b166e00000000, 0x0498ccf100000000, 0xe71ad28a00000000, + 0x7999081500000000, 0x211fef7c00000000, 0xbf9c35e300000000, + 0x5c1e2b9800000000, 0xc29df10700000000, 0xd825c89700000000, + 0x46a6120800000000, 0xa5240c7300000000, 0x3ba7d6ec00000000, + 0x6321318500000000, 0xfda2eb1a00000000, 0x1e20f56100000000, + 0x80a32ffe00000000, 0xae2c3ab200000000, 0x30afe02d00000000, + 0xd32dfe5600000000, 0x4dae24c900000000, 0x1528c3a000000000, + 0x8bab193f00000000, 0x6829074400000000, 0xf6aadddb00000000, + 0x34372cdc00000000, 0xaab4f64300000000, 0x4936e83800000000, + 0xd7b532a700000000, 0x8f33d5ce00000000, 0x11b00f5100000000, + 0xf232112a00000000, 0x6cb1cbb500000000, 0x423edef900000000, + 0xdcbd046600000000, 0x3f3f1a1d00000000, 0xa1bcc08200000000, + 0xf93a27eb00000000, 0x67b9fd7400000000, 0x843be30f00000000, + 0x1ab8399000000000, 0xf14de1f400000000, 0x6fce3b6b00000000, + 0x8c4c251000000000, 0x12cfff8f00000000, 0x4a4918e600000000, + 0xd4cac27900000000, 0x3748dc0200000000, 0xa9cb069d00000000, + 0x874413d100000000, 0x19c7c94e00000000, 0xfa45d73500000000, + 0x64c60daa00000000, 0x3c40eac300000000, 0xa2c3305c00000000, + 0x41412e2700000000, 0xdfc2f4b800000000, 0x1d5f05bf00000000, + 0x83dcdf2000000000, 0x605ec15b00000000, 0xfedd1bc400000000, + 0xa65bfcad00000000, 0x38d8263200000000, 0xdb5a384900000000, + 0x45d9e2d600000000, 0x6b56f79a00000000, 0xf5d52d0500000000, + 0x1657337e00000000, 0x88d4e9e100000000, 0xd0520e8800000000, + 0x4ed1d41700000000, 0xad53ca6c00000000, 0x33d010f300000000, + 0x2968296300000000, 0xb7ebf3fc00000000, 0x5469ed8700000000, + 0xcaea371800000000, 0x926cd07100000000, 0x0cef0aee00000000, + 0xef6d149500000000, 0x71eece0a00000000, 0x5f61db4600000000, + 0xc1e201d900000000, 0x22601fa200000000, 0xbce3c53d00000000, + 0xe465225400000000, 0x7ae6f8cb00000000, 0x9964e6b000000000, + 0x07e73c2f00000000, 0xc57acd2800000000, 0x5bf917b700000000, + 0xb87b09cc00000000, 0x26f8d35300000000, 0x7e7e343a00000000, + 0xe0fdeea500000000, 0x037ff0de00000000, 0x9dfc2a4100000000, + 0xb3733f0d00000000, 0x2df0e59200000000, 0xce72fbe900000000, + 0x50f1217600000000, 0x0877c61f00000000, 0x96f41c8000000000, + 0x757602fb00000000, 0xebf5d86400000000, 0xa39db33200000000, + 0x3d1e69ad00000000, 0xde9c77d600000000, 0x401fad4900000000, + 0x18994a2000000000, 0x861a90bf00000000, 0x65988ec400000000, + 0xfb1b545b00000000, 0xd594411700000000, 0x4b179b8800000000, + 0xa89585f300000000, 0x36165f6c00000000, 0x6e90b80500000000, + 0xf013629a00000000, 0x13917ce100000000, 0x8d12a67e00000000, + 0x4f8f577900000000, 0xd10c8de600000000, 0x328e939d00000000, + 0xac0d490200000000, 0xf48bae6b00000000, 0x6a0874f400000000, + 0x898a6a8f00000000, 0x1709b01000000000, 0x3986a55c00000000, + 0xa7057fc300000000, 0x448761b800000000, 0xda04bb2700000000, + 0x82825c4e00000000, 0x1c0186d100000000, 0xff8398aa00000000, + 0x6100423500000000, 0x7bb87ba500000000, 0xe53ba13a00000000, + 0x06b9bf4100000000, 0x983a65de00000000, 0xc0bc82b700000000, + 0x5e3f582800000000, 0xbdbd465300000000, 0x233e9ccc00000000, + 0x0db1898000000000, 0x9332531f00000000, 0x70b04d6400000000, + 0xee3397fb00000000, 0xb6b5709200000000, 0x2836aa0d00000000, + 0xcbb4b47600000000, 0x55376ee900000000, 0x97aa9fee00000000, + 0x0929457100000000, 0xeaab5b0a00000000, 0x7428819500000000, + 0x2cae66fc00000000, 0xb22dbc6300000000, 0x51afa21800000000, + 0xcf2c788700000000, 0xe1a36dcb00000000, 0x7f20b75400000000, + 0x9ca2a92f00000000, 0x022173b000000000, 0x5aa794d900000000, + 0xc4244e4600000000, 0x27a6503d00000000, 0xb9258aa200000000, + 0x52d052c600000000, 0xcc53885900000000, 0x2fd1962200000000, + 0xb1524cbd00000000, 0xe9d4abd400000000, 0x7757714b00000000, + 0x94d56f3000000000, 0x0a56b5af00000000, 0x24d9a0e300000000, + 0xba5a7a7c00000000, 0x59d8640700000000, 0xc75bbe9800000000, + 0x9fdd59f100000000, 0x015e836e00000000, 0xe2dc9d1500000000, + 0x7c5f478a00000000, 0xbec2b68d00000000, 0x20416c1200000000, + 0xc3c3726900000000, 0x5d40a8f600000000, 0x05c64f9f00000000, + 0x9b45950000000000, 0x78c78b7b00000000, 0xe64451e400000000, + 0xc8cb44a800000000, 0x56489e3700000000, 0xb5ca804c00000000, + 0x2b495ad300000000, 0x73cfbdba00000000, 0xed4c672500000000, + 0x0ece795e00000000, 0x904da3c100000000, 0x8af59a5100000000, + 0x147640ce00000000, 0xf7f45eb500000000, 0x6977842a00000000, + 0x31f1634300000000, 0xaf72b9dc00000000, 0x4cf0a7a700000000, + 0xd2737d3800000000, 0xfcfc687400000000, 0x627fb2eb00000000, + 0x81fdac9000000000, 0x1f7e760f00000000, 0x47f8916600000000, + 0xd97b4bf900000000, 0x3af9558200000000, 0xa47a8f1d00000000, + 0x66e77e1a00000000, 0xf864a48500000000, 0x1be6bafe00000000, + 0x8565606100000000, 0xdde3870800000000, 0x43605d9700000000, + 0xa0e243ec00000000, 0x3e61997300000000, 0x10ee8c3f00000000, + 0x8e6d56a000000000, 0x6def48db00000000, 0xf36c924400000000, + 0xabea752d00000000, 0x3569afb200000000, 0xd6ebb1c900000000, + 0x48686b5600000000}, + {0x0000000000000000, 0xc064281700000000, 0x80c9502e00000000, + 0x40ad783900000000, 0x0093a15c00000000, 0xc0f7894b00000000, + 0x805af17200000000, 0x403ed96500000000, 0x002643b900000000, + 0xc0426bae00000000, 0x80ef139700000000, 0x408b3b8000000000, + 0x00b5e2e500000000, 0xc0d1caf200000000, 0x807cb2cb00000000, + 0x40189adc00000000, 0x414af7a900000000, 0x812edfbe00000000, + 0xc183a78700000000, 0x01e78f9000000000, 0x41d956f500000000, + 0x81bd7ee200000000, 0xc11006db00000000, 0x01742ecc00000000, + 0x416cb41000000000, 0x81089c0700000000, 0xc1a5e43e00000000, + 0x01c1cc2900000000, 0x41ff154c00000000, 0x819b3d5b00000000, + 0xc136456200000000, 0x01526d7500000000, 0xc3929f8800000000, + 0x03f6b79f00000000, 0x435bcfa600000000, 0x833fe7b100000000, + 0xc3013ed400000000, 0x036516c300000000, 0x43c86efa00000000, + 0x83ac46ed00000000, 0xc3b4dc3100000000, 0x03d0f42600000000, + 0x437d8c1f00000000, 0x8319a40800000000, 0xc3277d6d00000000, + 0x0343557a00000000, 0x43ee2d4300000000, 0x838a055400000000, + 0x82d8682100000000, 0x42bc403600000000, 0x0211380f00000000, + 0xc275101800000000, 0x824bc97d00000000, 0x422fe16a00000000, + 0x0282995300000000, 0xc2e6b14400000000, 0x82fe2b9800000000, + 0x429a038f00000000, 0x02377bb600000000, 0xc25353a100000000, + 0x826d8ac400000000, 0x4209a2d300000000, 0x02a4daea00000000, + 0xc2c0f2fd00000000, 0xc7234eca00000000, 0x074766dd00000000, + 0x47ea1ee400000000, 0x878e36f300000000, 0xc7b0ef9600000000, + 0x07d4c78100000000, 0x4779bfb800000000, 0x871d97af00000000, + 0xc7050d7300000000, 0x0761256400000000, 0x47cc5d5d00000000, + 0x87a8754a00000000, 0xc796ac2f00000000, 0x07f2843800000000, + 0x475ffc0100000000, 0x873bd41600000000, 0x8669b96300000000, + 0x460d917400000000, 0x06a0e94d00000000, 0xc6c4c15a00000000, + 0x86fa183f00000000, 0x469e302800000000, 0x0633481100000000, + 0xc657600600000000, 0x864ffada00000000, 0x462bd2cd00000000, + 0x0686aaf400000000, 0xc6e282e300000000, 0x86dc5b8600000000, + 0x46b8739100000000, 0x06150ba800000000, 0xc67123bf00000000, + 0x04b1d14200000000, 0xc4d5f95500000000, 0x8478816c00000000, + 0x441ca97b00000000, 0x0422701e00000000, 0xc446580900000000, + 0x84eb203000000000, 0x448f082700000000, 0x049792fb00000000, + 0xc4f3baec00000000, 0x845ec2d500000000, 0x443aeac200000000, + 0x040433a700000000, 0xc4601bb000000000, 0x84cd638900000000, + 0x44a94b9e00000000, 0x45fb26eb00000000, 0x859f0efc00000000, + 0xc53276c500000000, 0x05565ed200000000, 0x456887b700000000, + 0x850cafa000000000, 0xc5a1d79900000000, 0x05c5ff8e00000000, + 0x45dd655200000000, 0x85b94d4500000000, 0xc514357c00000000, + 0x05701d6b00000000, 0x454ec40e00000000, 0x852aec1900000000, + 0xc587942000000000, 0x05e3bc3700000000, 0xcf41ed4f00000000, + 0x0f25c55800000000, 0x4f88bd6100000000, 0x8fec957600000000, + 0xcfd24c1300000000, 0x0fb6640400000000, 0x4f1b1c3d00000000, + 0x8f7f342a00000000, 0xcf67aef600000000, 0x0f0386e100000000, + 0x4faefed800000000, 0x8fcad6cf00000000, 0xcff40faa00000000, + 0x0f9027bd00000000, 0x4f3d5f8400000000, 0x8f59779300000000, + 0x8e0b1ae600000000, 0x4e6f32f100000000, 0x0ec24ac800000000, + 0xcea662df00000000, 0x8e98bbba00000000, 0x4efc93ad00000000, + 0x0e51eb9400000000, 0xce35c38300000000, 0x8e2d595f00000000, + 0x4e49714800000000, 0x0ee4097100000000, 0xce80216600000000, + 0x8ebef80300000000, 0x4edad01400000000, 0x0e77a82d00000000, + 0xce13803a00000000, 0x0cd372c700000000, 0xccb75ad000000000, + 0x8c1a22e900000000, 0x4c7e0afe00000000, 0x0c40d39b00000000, + 0xcc24fb8c00000000, 0x8c8983b500000000, 0x4cedaba200000000, + 0x0cf5317e00000000, 0xcc91196900000000, 0x8c3c615000000000, + 0x4c58494700000000, 0x0c66902200000000, 0xcc02b83500000000, + 0x8cafc00c00000000, 0x4ccbe81b00000000, 0x4d99856e00000000, + 0x8dfdad7900000000, 0xcd50d54000000000, 0x0d34fd5700000000, + 0x4d0a243200000000, 0x8d6e0c2500000000, 0xcdc3741c00000000, + 0x0da75c0b00000000, 0x4dbfc6d700000000, 0x8ddbeec000000000, + 0xcd7696f900000000, 0x0d12beee00000000, 0x4d2c678b00000000, + 0x8d484f9c00000000, 0xcde537a500000000, 0x0d811fb200000000, + 0x0862a38500000000, 0xc8068b9200000000, 0x88abf3ab00000000, + 0x48cfdbbc00000000, 0x08f102d900000000, 0xc8952ace00000000, + 0x883852f700000000, 0x485c7ae000000000, 0x0844e03c00000000, + 0xc820c82b00000000, 0x888db01200000000, 0x48e9980500000000, + 0x08d7416000000000, 0xc8b3697700000000, 0x881e114e00000000, + 0x487a395900000000, 0x4928542c00000000, 0x894c7c3b00000000, + 0xc9e1040200000000, 0x09852c1500000000, 0x49bbf57000000000, + 0x89dfdd6700000000, 0xc972a55e00000000, 0x09168d4900000000, + 0x490e179500000000, 0x896a3f8200000000, 0xc9c747bb00000000, + 0x09a36fac00000000, 0x499db6c900000000, 0x89f99ede00000000, + 0xc954e6e700000000, 0x0930cef000000000, 0xcbf03c0d00000000, + 0x0b94141a00000000, 0x4b396c2300000000, 0x8b5d443400000000, + 0xcb639d5100000000, 0x0b07b54600000000, 0x4baacd7f00000000, + 0x8bcee56800000000, 0xcbd67fb400000000, 0x0bb257a300000000, + 0x4b1f2f9a00000000, 0x8b7b078d00000000, 0xcb45dee800000000, + 0x0b21f6ff00000000, 0x4b8c8ec600000000, 0x8be8a6d100000000, + 0x8abacba400000000, 0x4adee3b300000000, 0x0a739b8a00000000, + 0xca17b39d00000000, 0x8a296af800000000, 0x4a4d42ef00000000, + 0x0ae03ad600000000, 0xca8412c100000000, 0x8a9c881d00000000, + 0x4af8a00a00000000, 0x0a55d83300000000, 0xca31f02400000000, + 0x8a0f294100000000, 0x4a6b015600000000, 0x0ac6796f00000000, + 0xcaa2517800000000}, + {0x0000000000000000, 0xd4ea739b00000000, 0xe9d396ed00000000, + 0x3d39e57600000000, 0x93a15c0000000000, 0x474b2f9b00000000, + 0x7a72caed00000000, 0xae98b97600000000, 0x2643b90000000000, + 0xf2a9ca9b00000000, 0xcf902fed00000000, 0x1b7a5c7600000000, + 0xb5e2e50000000000, 0x6108969b00000000, 0x5c3173ed00000000, + 0x88db007600000000, 0x4c86720100000000, 0x986c019a00000000, + 0xa555e4ec00000000, 0x71bf977700000000, 0xdf272e0100000000, + 0x0bcd5d9a00000000, 0x36f4b8ec00000000, 0xe21ecb7700000000, + 0x6ac5cb0100000000, 0xbe2fb89a00000000, 0x83165dec00000000, + 0x57fc2e7700000000, 0xf964970100000000, 0x2d8ee49a00000000, + 0x10b701ec00000000, 0xc45d727700000000, 0x980ce50200000000, + 0x4ce6969900000000, 0x71df73ef00000000, 0xa535007400000000, + 0x0badb90200000000, 0xdf47ca9900000000, 0xe27e2fef00000000, + 0x36945c7400000000, 0xbe4f5c0200000000, 0x6aa52f9900000000, + 0x579ccaef00000000, 0x8376b97400000000, 0x2dee000200000000, + 0xf904739900000000, 0xc43d96ef00000000, 0x10d7e57400000000, + 0xd48a970300000000, 0x0060e49800000000, 0x3d5901ee00000000, + 0xe9b3727500000000, 0x472bcb0300000000, 0x93c1b89800000000, + 0xaef85dee00000000, 0x7a122e7500000000, 0xf2c92e0300000000, + 0x26235d9800000000, 0x1b1ab8ee00000000, 0xcff0cb7500000000, + 0x6168720300000000, 0xb582019800000000, 0x88bbe4ee00000000, + 0x5c51977500000000, 0x3019ca0500000000, 0xe4f3b99e00000000, + 0xd9ca5ce800000000, 0x0d202f7300000000, 0xa3b8960500000000, + 0x7752e59e00000000, 0x4a6b00e800000000, 0x9e81737300000000, + 0x165a730500000000, 0xc2b0009e00000000, 0xff89e5e800000000, + 0x2b63967300000000, 0x85fb2f0500000000, 0x51115c9e00000000, + 0x6c28b9e800000000, 0xb8c2ca7300000000, 0x7c9fb80400000000, + 0xa875cb9f00000000, 0x954c2ee900000000, 0x41a65d7200000000, + 0xef3ee40400000000, 0x3bd4979f00000000, 0x06ed72e900000000, + 0xd207017200000000, 0x5adc010400000000, 0x8e36729f00000000, + 0xb30f97e900000000, 0x67e5e47200000000, 0xc97d5d0400000000, + 0x1d972e9f00000000, 0x20aecbe900000000, 0xf444b87200000000, + 0xa8152f0700000000, 0x7cff5c9c00000000, 0x41c6b9ea00000000, + 0x952cca7100000000, 0x3bb4730700000000, 0xef5e009c00000000, + 0xd267e5ea00000000, 0x068d967100000000, 0x8e56960700000000, + 0x5abce59c00000000, 0x678500ea00000000, 0xb36f737100000000, + 0x1df7ca0700000000, 0xc91db99c00000000, 0xf4245cea00000000, + 0x20ce2f7100000000, 0xe4935d0600000000, 0x30792e9d00000000, + 0x0d40cbeb00000000, 0xd9aab87000000000, 0x7732010600000000, + 0xa3d8729d00000000, 0x9ee197eb00000000, 0x4a0be47000000000, + 0xc2d0e40600000000, 0x163a979d00000000, 0x2b0372eb00000000, + 0xffe9017000000000, 0x5171b80600000000, 0x859bcb9d00000000, + 0xb8a22eeb00000000, 0x6c485d7000000000, 0x6032940b00000000, + 0xb4d8e79000000000, 0x89e102e600000000, 0x5d0b717d00000000, + 0xf393c80b00000000, 0x2779bb9000000000, 0x1a405ee600000000, + 0xceaa2d7d00000000, 0x46712d0b00000000, 0x929b5e9000000000, + 0xafa2bbe600000000, 0x7b48c87d00000000, 0xd5d0710b00000000, + 0x013a029000000000, 0x3c03e7e600000000, 0xe8e9947d00000000, + 0x2cb4e60a00000000, 0xf85e959100000000, 0xc56770e700000000, + 0x118d037c00000000, 0xbf15ba0a00000000, 0x6bffc99100000000, + 0x56c62ce700000000, 0x822c5f7c00000000, 0x0af75f0a00000000, + 0xde1d2c9100000000, 0xe324c9e700000000, 0x37ceba7c00000000, + 0x9956030a00000000, 0x4dbc709100000000, 0x708595e700000000, + 0xa46fe67c00000000, 0xf83e710900000000, 0x2cd4029200000000, + 0x11ede7e400000000, 0xc507947f00000000, 0x6b9f2d0900000000, + 0xbf755e9200000000, 0x824cbbe400000000, 0x56a6c87f00000000, + 0xde7dc80900000000, 0x0a97bb9200000000, 0x37ae5ee400000000, + 0xe3442d7f00000000, 0x4ddc940900000000, 0x9936e79200000000, + 0xa40f02e400000000, 0x70e5717f00000000, 0xb4b8030800000000, + 0x6052709300000000, 0x5d6b95e500000000, 0x8981e67e00000000, + 0x27195f0800000000, 0xf3f32c9300000000, 0xcecac9e500000000, + 0x1a20ba7e00000000, 0x92fbba0800000000, 0x4611c99300000000, + 0x7b282ce500000000, 0xafc25f7e00000000, 0x015ae60800000000, + 0xd5b0959300000000, 0xe88970e500000000, 0x3c63037e00000000, + 0x502b5e0e00000000, 0x84c12d9500000000, 0xb9f8c8e300000000, + 0x6d12bb7800000000, 0xc38a020e00000000, 0x1760719500000000, + 0x2a5994e300000000, 0xfeb3e77800000000, 0x7668e70e00000000, + 0xa282949500000000, 0x9fbb71e300000000, 0x4b51027800000000, + 0xe5c9bb0e00000000, 0x3123c89500000000, 0x0c1a2de300000000, + 0xd8f05e7800000000, 0x1cad2c0f00000000, 0xc8475f9400000000, + 0xf57ebae200000000, 0x2194c97900000000, 0x8f0c700f00000000, + 0x5be6039400000000, 0x66dfe6e200000000, 0xb235957900000000, + 0x3aee950f00000000, 0xee04e69400000000, 0xd33d03e200000000, + 0x07d7707900000000, 0xa94fc90f00000000, 0x7da5ba9400000000, + 0x409c5fe200000000, 0x94762c7900000000, 0xc827bb0c00000000, + 0x1ccdc89700000000, 0x21f42de100000000, 0xf51e5e7a00000000, + 0x5b86e70c00000000, 0x8f6c949700000000, 0xb25571e100000000, + 0x66bf027a00000000, 0xee64020c00000000, 0x3a8e719700000000, + 0x07b794e100000000, 0xd35de77a00000000, 0x7dc55e0c00000000, + 0xa92f2d9700000000, 0x9416c8e100000000, 0x40fcbb7a00000000, + 0x84a1c90d00000000, 0x504bba9600000000, 0x6d725fe000000000, + 0xb9982c7b00000000, 0x1700950d00000000, 0xc3eae69600000000, + 0xfed303e000000000, 0x2a39707b00000000, 0xa2e2700d00000000, + 0x7608039600000000, 0x4b31e6e000000000, 0x9fdb957b00000000, + 0x31432c0d00000000, 0xe5a95f9600000000, 0xd890bae000000000, + 0x0c7ac97b00000000}, + {0x0000000000000000, 0x2765258100000000, 0x0fcc3bd900000000, + 0x28a91e5800000000, 0x5f9e066900000000, 0x78fb23e800000000, + 0x50523db000000000, 0x7737183100000000, 0xbe3c0dd200000000, + 0x9959285300000000, 0xb1f0360b00000000, 0x9695138a00000000, + 0xe1a20bbb00000000, 0xc6c72e3a00000000, 0xee6e306200000000, + 0xc90b15e300000000, 0x3d7f6b7f00000000, 0x1a1a4efe00000000, + 0x32b350a600000000, 0x15d6752700000000, 0x62e16d1600000000, + 0x4584489700000000, 0x6d2d56cf00000000, 0x4a48734e00000000, + 0x834366ad00000000, 0xa426432c00000000, 0x8c8f5d7400000000, + 0xabea78f500000000, 0xdcdd60c400000000, 0xfbb8454500000000, + 0xd3115b1d00000000, 0xf4747e9c00000000, 0x7afed6fe00000000, + 0x5d9bf37f00000000, 0x7532ed2700000000, 0x5257c8a600000000, + 0x2560d09700000000, 0x0205f51600000000, 0x2aaceb4e00000000, + 0x0dc9cecf00000000, 0xc4c2db2c00000000, 0xe3a7fead00000000, + 0xcb0ee0f500000000, 0xec6bc57400000000, 0x9b5cdd4500000000, + 0xbc39f8c400000000, 0x9490e69c00000000, 0xb3f5c31d00000000, + 0x4781bd8100000000, 0x60e4980000000000, 0x484d865800000000, + 0x6f28a3d900000000, 0x181fbbe800000000, 0x3f7a9e6900000000, + 0x17d3803100000000, 0x30b6a5b000000000, 0xf9bdb05300000000, + 0xded895d200000000, 0xf6718b8a00000000, 0xd114ae0b00000000, + 0xa623b63a00000000, 0x814693bb00000000, 0xa9ef8de300000000, + 0x8e8aa86200000000, 0xb5fadc2600000000, 0x929ff9a700000000, + 0xba36e7ff00000000, 0x9d53c27e00000000, 0xea64da4f00000000, + 0xcd01ffce00000000, 0xe5a8e19600000000, 0xc2cdc41700000000, + 0x0bc6d1f400000000, 0x2ca3f47500000000, 0x040aea2d00000000, + 0x236fcfac00000000, 0x5458d79d00000000, 0x733df21c00000000, + 0x5b94ec4400000000, 0x7cf1c9c500000000, 0x8885b75900000000, + 0xafe092d800000000, 0x87498c8000000000, 0xa02ca90100000000, + 0xd71bb13000000000, 0xf07e94b100000000, 0xd8d78ae900000000, + 0xffb2af6800000000, 0x36b9ba8b00000000, 0x11dc9f0a00000000, + 0x3975815200000000, 0x1e10a4d300000000, 0x6927bce200000000, + 0x4e42996300000000, 0x66eb873b00000000, 0x418ea2ba00000000, + 0xcf040ad800000000, 0xe8612f5900000000, 0xc0c8310100000000, + 0xe7ad148000000000, 0x909a0cb100000000, 0xb7ff293000000000, + 0x9f56376800000000, 0xb83312e900000000, 0x7138070a00000000, + 0x565d228b00000000, 0x7ef43cd300000000, 0x5991195200000000, + 0x2ea6016300000000, 0x09c324e200000000, 0x216a3aba00000000, + 0x060f1f3b00000000, 0xf27b61a700000000, 0xd51e442600000000, + 0xfdb75a7e00000000, 0xdad27fff00000000, 0xade567ce00000000, + 0x8a80424f00000000, 0xa2295c1700000000, 0x854c799600000000, + 0x4c476c7500000000, 0x6b2249f400000000, 0x438b57ac00000000, + 0x64ee722d00000000, 0x13d96a1c00000000, 0x34bc4f9d00000000, + 0x1c1551c500000000, 0x3b70744400000000, 0x6af5b94d00000000, + 0x4d909ccc00000000, 0x6539829400000000, 0x425ca71500000000, + 0x356bbf2400000000, 0x120e9aa500000000, 0x3aa784fd00000000, + 0x1dc2a17c00000000, 0xd4c9b49f00000000, 0xf3ac911e00000000, + 0xdb058f4600000000, 0xfc60aac700000000, 0x8b57b2f600000000, + 0xac32977700000000, 0x849b892f00000000, 0xa3feacae00000000, + 0x578ad23200000000, 0x70eff7b300000000, 0x5846e9eb00000000, + 0x7f23cc6a00000000, 0x0814d45b00000000, 0x2f71f1da00000000, + 0x07d8ef8200000000, 0x20bdca0300000000, 0xe9b6dfe000000000, + 0xced3fa6100000000, 0xe67ae43900000000, 0xc11fc1b800000000, + 0xb628d98900000000, 0x914dfc0800000000, 0xb9e4e25000000000, + 0x9e81c7d100000000, 0x100b6fb300000000, 0x376e4a3200000000, + 0x1fc7546a00000000, 0x38a271eb00000000, 0x4f9569da00000000, + 0x68f04c5b00000000, 0x4059520300000000, 0x673c778200000000, + 0xae37626100000000, 0x895247e000000000, 0xa1fb59b800000000, + 0x869e7c3900000000, 0xf1a9640800000000, 0xd6cc418900000000, + 0xfe655fd100000000, 0xd9007a5000000000, 0x2d7404cc00000000, + 0x0a11214d00000000, 0x22b83f1500000000, 0x05dd1a9400000000, + 0x72ea02a500000000, 0x558f272400000000, 0x7d26397c00000000, + 0x5a431cfd00000000, 0x9348091e00000000, 0xb42d2c9f00000000, + 0x9c8432c700000000, 0xbbe1174600000000, 0xccd60f7700000000, + 0xebb32af600000000, 0xc31a34ae00000000, 0xe47f112f00000000, + 0xdf0f656b00000000, 0xf86a40ea00000000, 0xd0c35eb200000000, + 0xf7a67b3300000000, 0x8091630200000000, 0xa7f4468300000000, + 0x8f5d58db00000000, 0xa8387d5a00000000, 0x613368b900000000, + 0x46564d3800000000, 0x6eff536000000000, 0x499a76e100000000, + 0x3ead6ed000000000, 0x19c84b5100000000, 0x3161550900000000, + 0x1604708800000000, 0xe2700e1400000000, 0xc5152b9500000000, + 0xedbc35cd00000000, 0xcad9104c00000000, 0xbdee087d00000000, + 0x9a8b2dfc00000000, 0xb22233a400000000, 0x9547162500000000, + 0x5c4c03c600000000, 0x7b29264700000000, 0x5380381f00000000, + 0x74e51d9e00000000, 0x03d205af00000000, 0x24b7202e00000000, + 0x0c1e3e7600000000, 0x2b7b1bf700000000, 0xa5f1b39500000000, + 0x8294961400000000, 0xaa3d884c00000000, 0x8d58adcd00000000, + 0xfa6fb5fc00000000, 0xdd0a907d00000000, 0xf5a38e2500000000, + 0xd2c6aba400000000, 0x1bcdbe4700000000, 0x3ca89bc600000000, + 0x1401859e00000000, 0x3364a01f00000000, 0x4453b82e00000000, + 0x63369daf00000000, 0x4b9f83f700000000, 0x6cfaa67600000000, + 0x988ed8ea00000000, 0xbfebfd6b00000000, 0x9742e33300000000, + 0xb027c6b200000000, 0xc710de8300000000, 0xe075fb0200000000, + 0xc8dce55a00000000, 0xefb9c0db00000000, 0x26b2d53800000000, + 0x01d7f0b900000000, 0x297eeee100000000, 0x0e1bcb6000000000, + 0x792cd35100000000, 0x5e49f6d000000000, 0x76e0e88800000000, + 0x5185cd0900000000}}; + +#else /* W == 4 */ + +local const z_crc_t FAR crc_braid_table[][256] = { + {0x00000000, 0x9ba54c6f, 0xec3b9e9f, 0x779ed2f0, 0x03063b7f, + 0x98a37710, 0xef3da5e0, 0x7498e98f, 0x060c76fe, 0x9da93a91, + 0xea37e861, 0x7192a40e, 0x050a4d81, 0x9eaf01ee, 0xe931d31e, + 0x72949f71, 0x0c18edfc, 0x97bda193, 0xe0237363, 0x7b863f0c, + 0x0f1ed683, 0x94bb9aec, 0xe325481c, 0x78800473, 0x0a149b02, + 0x91b1d76d, 0xe62f059d, 0x7d8a49f2, 0x0912a07d, 0x92b7ec12, + 0xe5293ee2, 0x7e8c728d, 0x1831dbf8, 0x83949797, 0xf40a4567, + 0x6faf0908, 0x1b37e087, 0x8092ace8, 0xf70c7e18, 0x6ca93277, + 0x1e3dad06, 0x8598e169, 0xf2063399, 0x69a37ff6, 0x1d3b9679, + 0x869eda16, 0xf10008e6, 0x6aa54489, 0x14293604, 0x8f8c7a6b, + 0xf812a89b, 0x63b7e4f4, 0x172f0d7b, 0x8c8a4114, 0xfb1493e4, + 0x60b1df8b, 0x122540fa, 0x89800c95, 0xfe1ede65, 0x65bb920a, + 0x11237b85, 0x8a8637ea, 0xfd18e51a, 0x66bda975, 0x3063b7f0, + 0xabc6fb9f, 0xdc58296f, 0x47fd6500, 0x33658c8f, 0xa8c0c0e0, + 0xdf5e1210, 0x44fb5e7f, 0x366fc10e, 0xadca8d61, 0xda545f91, + 0x41f113fe, 0x3569fa71, 0xaeccb61e, 0xd95264ee, 0x42f72881, + 0x3c7b5a0c, 0xa7de1663, 0xd040c493, 0x4be588fc, 0x3f7d6173, + 0xa4d82d1c, 0xd346ffec, 0x48e3b383, 0x3a772cf2, 0xa1d2609d, + 0xd64cb26d, 0x4de9fe02, 0x3971178d, 0xa2d45be2, 0xd54a8912, + 0x4eefc57d, 0x28526c08, 0xb3f72067, 0xc469f297, 0x5fccbef8, + 0x2b545777, 0xb0f11b18, 0xc76fc9e8, 0x5cca8587, 0x2e5e1af6, + 0xb5fb5699, 0xc2658469, 0x59c0c806, 0x2d582189, 0xb6fd6de6, + 0xc163bf16, 0x5ac6f379, 0x244a81f4, 0xbfefcd9b, 0xc8711f6b, + 0x53d45304, 0x274cba8b, 0xbce9f6e4, 0xcb772414, 0x50d2687b, + 0x2246f70a, 0xb9e3bb65, 0xce7d6995, 0x55d825fa, 0x2140cc75, + 0xbae5801a, 0xcd7b52ea, 0x56de1e85, 0x60c76fe0, 0xfb62238f, + 0x8cfcf17f, 0x1759bd10, 0x63c1549f, 0xf86418f0, 0x8ffaca00, + 0x145f866f, 0x66cb191e, 0xfd6e5571, 0x8af08781, 0x1155cbee, + 0x65cd2261, 0xfe686e0e, 0x89f6bcfe, 0x1253f091, 0x6cdf821c, + 0xf77ace73, 0x80e41c83, 0x1b4150ec, 0x6fd9b963, 0xf47cf50c, + 0x83e227fc, 0x18476b93, 0x6ad3f4e2, 0xf176b88d, 0x86e86a7d, + 0x1d4d2612, 0x69d5cf9d, 0xf27083f2, 0x85ee5102, 0x1e4b1d6d, + 0x78f6b418, 0xe353f877, 0x94cd2a87, 0x0f6866e8, 0x7bf08f67, + 0xe055c308, 0x97cb11f8, 0x0c6e5d97, 0x7efac2e6, 0xe55f8e89, + 0x92c15c79, 0x09641016, 0x7dfcf999, 0xe659b5f6, 0x91c76706, + 0x0a622b69, 0x74ee59e4, 0xef4b158b, 0x98d5c77b, 0x03708b14, + 0x77e8629b, 0xec4d2ef4, 0x9bd3fc04, 0x0076b06b, 0x72e22f1a, + 0xe9476375, 0x9ed9b185, 0x057cfdea, 0x71e41465, 0xea41580a, + 0x9ddf8afa, 0x067ac695, 0x50a4d810, 0xcb01947f, 0xbc9f468f, + 0x273a0ae0, 0x53a2e36f, 0xc807af00, 0xbf997df0, 0x243c319f, + 0x56a8aeee, 0xcd0de281, 0xba933071, 0x21367c1e, 0x55ae9591, + 0xce0bd9fe, 0xb9950b0e, 0x22304761, 0x5cbc35ec, 0xc7197983, + 0xb087ab73, 0x2b22e71c, 0x5fba0e93, 0xc41f42fc, 0xb381900c, + 0x2824dc63, 0x5ab04312, 0xc1150f7d, 0xb68bdd8d, 0x2d2e91e2, + 0x59b6786d, 0xc2133402, 0xb58de6f2, 0x2e28aa9d, 0x489503e8, + 0xd3304f87, 0xa4ae9d77, 0x3f0bd118, 0x4b933897, 0xd03674f8, + 0xa7a8a608, 0x3c0dea67, 0x4e997516, 0xd53c3979, 0xa2a2eb89, + 0x3907a7e6, 0x4d9f4e69, 0xd63a0206, 0xa1a4d0f6, 0x3a019c99, + 0x448dee14, 0xdf28a27b, 0xa8b6708b, 0x33133ce4, 0x478bd56b, + 0xdc2e9904, 0xabb04bf4, 0x3015079b, 0x428198ea, 0xd924d485, + 0xaeba0675, 0x351f4a1a, 0x4187a395, 0xda22effa, 0xadbc3d0a, + 0x36197165}, + {0x00000000, 0xc18edfc0, 0x586cb9c1, 0x99e26601, 0xb0d97382, + 0x7157ac42, 0xe8b5ca43, 0x293b1583, 0xbac3e145, 0x7b4d3e85, + 0xe2af5884, 0x23218744, 0x0a1a92c7, 0xcb944d07, 0x52762b06, + 0x93f8f4c6, 0xaef6c4cb, 0x6f781b0b, 0xf69a7d0a, 0x3714a2ca, + 0x1e2fb749, 0xdfa16889, 0x46430e88, 0x87cdd148, 0x1435258e, + 0xd5bbfa4e, 0x4c599c4f, 0x8dd7438f, 0xa4ec560c, 0x656289cc, + 0xfc80efcd, 0x3d0e300d, 0x869c8fd7, 0x47125017, 0xdef03616, + 0x1f7ee9d6, 0x3645fc55, 0xf7cb2395, 0x6e294594, 0xafa79a54, + 0x3c5f6e92, 0xfdd1b152, 0x6433d753, 0xa5bd0893, 0x8c861d10, + 0x4d08c2d0, 0xd4eaa4d1, 0x15647b11, 0x286a4b1c, 0xe9e494dc, + 0x7006f2dd, 0xb1882d1d, 0x98b3389e, 0x593de75e, 0xc0df815f, + 0x01515e9f, 0x92a9aa59, 0x53277599, 0xcac51398, 0x0b4bcc58, + 0x2270d9db, 0xe3fe061b, 0x7a1c601a, 0xbb92bfda, 0xd64819ef, + 0x17c6c62f, 0x8e24a02e, 0x4faa7fee, 0x66916a6d, 0xa71fb5ad, + 0x3efdd3ac, 0xff730c6c, 0x6c8bf8aa, 0xad05276a, 0x34e7416b, + 0xf5699eab, 0xdc528b28, 0x1ddc54e8, 0x843e32e9, 0x45b0ed29, + 0x78bedd24, 0xb93002e4, 0x20d264e5, 0xe15cbb25, 0xc867aea6, + 0x09e97166, 0x900b1767, 0x5185c8a7, 0xc27d3c61, 0x03f3e3a1, + 0x9a1185a0, 0x5b9f5a60, 0x72a44fe3, 0xb32a9023, 0x2ac8f622, + 0xeb4629e2, 0x50d49638, 0x915a49f8, 0x08b82ff9, 0xc936f039, + 0xe00de5ba, 0x21833a7a, 0xb8615c7b, 0x79ef83bb, 0xea17777d, + 0x2b99a8bd, 0xb27bcebc, 0x73f5117c, 0x5ace04ff, 0x9b40db3f, + 0x02a2bd3e, 0xc32c62fe, 0xfe2252f3, 0x3fac8d33, 0xa64eeb32, + 0x67c034f2, 0x4efb2171, 0x8f75feb1, 0x169798b0, 0xd7194770, + 0x44e1b3b6, 0x856f6c76, 0x1c8d0a77, 0xdd03d5b7, 0xf438c034, + 0x35b61ff4, 0xac5479f5, 0x6ddaa635, 0x77e1359f, 0xb66fea5f, + 0x2f8d8c5e, 0xee03539e, 0xc738461d, 0x06b699dd, 0x9f54ffdc, + 0x5eda201c, 0xcd22d4da, 0x0cac0b1a, 0x954e6d1b, 0x54c0b2db, + 0x7dfba758, 0xbc757898, 0x25971e99, 0xe419c159, 0xd917f154, + 0x18992e94, 0x817b4895, 0x40f59755, 0x69ce82d6, 0xa8405d16, + 0x31a23b17, 0xf02ce4d7, 0x63d41011, 0xa25acfd1, 0x3bb8a9d0, + 0xfa367610, 0xd30d6393, 0x1283bc53, 0x8b61da52, 0x4aef0592, + 0xf17dba48, 0x30f36588, 0xa9110389, 0x689fdc49, 0x41a4c9ca, + 0x802a160a, 0x19c8700b, 0xd846afcb, 0x4bbe5b0d, 0x8a3084cd, + 0x13d2e2cc, 0xd25c3d0c, 0xfb67288f, 0x3ae9f74f, 0xa30b914e, + 0x62854e8e, 0x5f8b7e83, 0x9e05a143, 0x07e7c742, 0xc6691882, + 0xef520d01, 0x2edcd2c1, 0xb73eb4c0, 0x76b06b00, 0xe5489fc6, + 0x24c64006, 0xbd242607, 0x7caaf9c7, 0x5591ec44, 0x941f3384, + 0x0dfd5585, 0xcc738a45, 0xa1a92c70, 0x6027f3b0, 0xf9c595b1, + 0x384b4a71, 0x11705ff2, 0xd0fe8032, 0x491ce633, 0x889239f3, + 0x1b6acd35, 0xdae412f5, 0x430674f4, 0x8288ab34, 0xabb3beb7, + 0x6a3d6177, 0xf3df0776, 0x3251d8b6, 0x0f5fe8bb, 0xced1377b, + 0x5733517a, 0x96bd8eba, 0xbf869b39, 0x7e0844f9, 0xe7ea22f8, + 0x2664fd38, 0xb59c09fe, 0x7412d63e, 0xedf0b03f, 0x2c7e6fff, + 0x05457a7c, 0xc4cba5bc, 0x5d29c3bd, 0x9ca71c7d, 0x2735a3a7, + 0xe6bb7c67, 0x7f591a66, 0xbed7c5a6, 0x97ecd025, 0x56620fe5, + 0xcf8069e4, 0x0e0eb624, 0x9df642e2, 0x5c789d22, 0xc59afb23, + 0x041424e3, 0x2d2f3160, 0xeca1eea0, 0x754388a1, 0xb4cd5761, + 0x89c3676c, 0x484db8ac, 0xd1afdead, 0x1021016d, 0x391a14ee, + 0xf894cb2e, 0x6176ad2f, 0xa0f872ef, 0x33008629, 0xf28e59e9, + 0x6b6c3fe8, 0xaae2e028, 0x83d9f5ab, 0x42572a6b, 0xdbb54c6a, + 0x1a3b93aa}, + {0x00000000, 0xefc26b3e, 0x04f5d03d, 0xeb37bb03, 0x09eba07a, + 0xe629cb44, 0x0d1e7047, 0xe2dc1b79, 0x13d740f4, 0xfc152bca, + 0x172290c9, 0xf8e0fbf7, 0x1a3ce08e, 0xf5fe8bb0, 0x1ec930b3, + 0xf10b5b8d, 0x27ae81e8, 0xc86cead6, 0x235b51d5, 0xcc993aeb, + 0x2e452192, 0xc1874aac, 0x2ab0f1af, 0xc5729a91, 0x3479c11c, + 0xdbbbaa22, 0x308c1121, 0xdf4e7a1f, 0x3d926166, 0xd2500a58, + 0x3967b15b, 0xd6a5da65, 0x4f5d03d0, 0xa09f68ee, 0x4ba8d3ed, + 0xa46ab8d3, 0x46b6a3aa, 0xa974c894, 0x42437397, 0xad8118a9, + 0x5c8a4324, 0xb348281a, 0x587f9319, 0xb7bdf827, 0x5561e35e, + 0xbaa38860, 0x51943363, 0xbe56585d, 0x68f38238, 0x8731e906, + 0x6c065205, 0x83c4393b, 0x61182242, 0x8eda497c, 0x65edf27f, + 0x8a2f9941, 0x7b24c2cc, 0x94e6a9f2, 0x7fd112f1, 0x901379cf, + 0x72cf62b6, 0x9d0d0988, 0x763ab28b, 0x99f8d9b5, 0x9eba07a0, + 0x71786c9e, 0x9a4fd79d, 0x758dbca3, 0x9751a7da, 0x7893cce4, + 0x93a477e7, 0x7c661cd9, 0x8d6d4754, 0x62af2c6a, 0x89989769, + 0x665afc57, 0x8486e72e, 0x6b448c10, 0x80733713, 0x6fb15c2d, + 0xb9148648, 0x56d6ed76, 0xbde15675, 0x52233d4b, 0xb0ff2632, + 0x5f3d4d0c, 0xb40af60f, 0x5bc89d31, 0xaac3c6bc, 0x4501ad82, + 0xae361681, 0x41f47dbf, 0xa32866c6, 0x4cea0df8, 0xa7ddb6fb, + 0x481fddc5, 0xd1e70470, 0x3e256f4e, 0xd512d44d, 0x3ad0bf73, + 0xd80ca40a, 0x37cecf34, 0xdcf97437, 0x333b1f09, 0xc2304484, + 0x2df22fba, 0xc6c594b9, 0x2907ff87, 0xcbdbe4fe, 0x24198fc0, + 0xcf2e34c3, 0x20ec5ffd, 0xf6498598, 0x198beea6, 0xf2bc55a5, + 0x1d7e3e9b, 0xffa225e2, 0x10604edc, 0xfb57f5df, 0x14959ee1, + 0xe59ec56c, 0x0a5cae52, 0xe16b1551, 0x0ea97e6f, 0xec756516, + 0x03b70e28, 0xe880b52b, 0x0742de15, 0xe6050901, 0x09c7623f, + 0xe2f0d93c, 0x0d32b202, 0xefeea97b, 0x002cc245, 0xeb1b7946, + 0x04d91278, 0xf5d249f5, 0x1a1022cb, 0xf12799c8, 0x1ee5f2f6, + 0xfc39e98f, 0x13fb82b1, 0xf8cc39b2, 0x170e528c, 0xc1ab88e9, + 0x2e69e3d7, 0xc55e58d4, 0x2a9c33ea, 0xc8402893, 0x278243ad, + 0xccb5f8ae, 0x23779390, 0xd27cc81d, 0x3dbea323, 0xd6891820, + 0x394b731e, 0xdb976867, 0x34550359, 0xdf62b85a, 0x30a0d364, + 0xa9580ad1, 0x469a61ef, 0xadaddaec, 0x426fb1d2, 0xa0b3aaab, + 0x4f71c195, 0xa4467a96, 0x4b8411a8, 0xba8f4a25, 0x554d211b, + 0xbe7a9a18, 0x51b8f126, 0xb364ea5f, 0x5ca68161, 0xb7913a62, + 0x5853515c, 0x8ef68b39, 0x6134e007, 0x8a035b04, 0x65c1303a, + 0x871d2b43, 0x68df407d, 0x83e8fb7e, 0x6c2a9040, 0x9d21cbcd, + 0x72e3a0f3, 0x99d41bf0, 0x761670ce, 0x94ca6bb7, 0x7b080089, + 0x903fbb8a, 0x7ffdd0b4, 0x78bf0ea1, 0x977d659f, 0x7c4ade9c, + 0x9388b5a2, 0x7154aedb, 0x9e96c5e5, 0x75a17ee6, 0x9a6315d8, + 0x6b684e55, 0x84aa256b, 0x6f9d9e68, 0x805ff556, 0x6283ee2f, + 0x8d418511, 0x66763e12, 0x89b4552c, 0x5f118f49, 0xb0d3e477, + 0x5be45f74, 0xb426344a, 0x56fa2f33, 0xb938440d, 0x520fff0e, + 0xbdcd9430, 0x4cc6cfbd, 0xa304a483, 0x48331f80, 0xa7f174be, + 0x452d6fc7, 0xaaef04f9, 0x41d8bffa, 0xae1ad4c4, 0x37e20d71, + 0xd820664f, 0x3317dd4c, 0xdcd5b672, 0x3e09ad0b, 0xd1cbc635, + 0x3afc7d36, 0xd53e1608, 0x24354d85, 0xcbf726bb, 0x20c09db8, + 0xcf02f686, 0x2ddeedff, 0xc21c86c1, 0x292b3dc2, 0xc6e956fc, + 0x104c8c99, 0xff8ee7a7, 0x14b95ca4, 0xfb7b379a, 0x19a72ce3, + 0xf66547dd, 0x1d52fcde, 0xf29097e0, 0x039bcc6d, 0xec59a753, + 0x076e1c50, 0xe8ac776e, 0x0a706c17, 0xe5b20729, 0x0e85bc2a, + 0xe147d714}, + {0x00000000, 0x177b1443, 0x2ef62886, 0x398d3cc5, 0x5dec510c, + 0x4a97454f, 0x731a798a, 0x64616dc9, 0xbbd8a218, 0xaca3b65b, + 0x952e8a9e, 0x82559edd, 0xe634f314, 0xf14fe757, 0xc8c2db92, + 0xdfb9cfd1, 0xacc04271, 0xbbbb5632, 0x82366af7, 0x954d7eb4, + 0xf12c137d, 0xe657073e, 0xdfda3bfb, 0xc8a12fb8, 0x1718e069, + 0x0063f42a, 0x39eec8ef, 0x2e95dcac, 0x4af4b165, 0x5d8fa526, + 0x640299e3, 0x73798da0, 0x82f182a3, 0x958a96e0, 0xac07aa25, + 0xbb7cbe66, 0xdf1dd3af, 0xc866c7ec, 0xf1ebfb29, 0xe690ef6a, + 0x392920bb, 0x2e5234f8, 0x17df083d, 0x00a41c7e, 0x64c571b7, + 0x73be65f4, 0x4a335931, 0x5d484d72, 0x2e31c0d2, 0x394ad491, + 0x00c7e854, 0x17bcfc17, 0x73dd91de, 0x64a6859d, 0x5d2bb958, + 0x4a50ad1b, 0x95e962ca, 0x82927689, 0xbb1f4a4c, 0xac645e0f, + 0xc80533c6, 0xdf7e2785, 0xe6f31b40, 0xf1880f03, 0xde920307, + 0xc9e91744, 0xf0642b81, 0xe71f3fc2, 0x837e520b, 0x94054648, + 0xad887a8d, 0xbaf36ece, 0x654aa11f, 0x7231b55c, 0x4bbc8999, + 0x5cc79dda, 0x38a6f013, 0x2fdde450, 0x1650d895, 0x012bccd6, + 0x72524176, 0x65295535, 0x5ca469f0, 0x4bdf7db3, 0x2fbe107a, + 0x38c50439, 0x014838fc, 0x16332cbf, 0xc98ae36e, 0xdef1f72d, + 0xe77ccbe8, 0xf007dfab, 0x9466b262, 0x831da621, 0xba909ae4, + 0xadeb8ea7, 0x5c6381a4, 0x4b1895e7, 0x7295a922, 0x65eebd61, + 0x018fd0a8, 0x16f4c4eb, 0x2f79f82e, 0x3802ec6d, 0xe7bb23bc, + 0xf0c037ff, 0xc94d0b3a, 0xde361f79, 0xba5772b0, 0xad2c66f3, + 0x94a15a36, 0x83da4e75, 0xf0a3c3d5, 0xe7d8d796, 0xde55eb53, + 0xc92eff10, 0xad4f92d9, 0xba34869a, 0x83b9ba5f, 0x94c2ae1c, + 0x4b7b61cd, 0x5c00758e, 0x658d494b, 0x72f65d08, 0x169730c1, + 0x01ec2482, 0x38611847, 0x2f1a0c04, 0x6655004f, 0x712e140c, + 0x48a328c9, 0x5fd83c8a, 0x3bb95143, 0x2cc24500, 0x154f79c5, + 0x02346d86, 0xdd8da257, 0xcaf6b614, 0xf37b8ad1, 0xe4009e92, + 0x8061f35b, 0x971ae718, 0xae97dbdd, 0xb9eccf9e, 0xca95423e, + 0xddee567d, 0xe4636ab8, 0xf3187efb, 0x97791332, 0x80020771, + 0xb98f3bb4, 0xaef42ff7, 0x714de026, 0x6636f465, 0x5fbbc8a0, + 0x48c0dce3, 0x2ca1b12a, 0x3bdaa569, 0x025799ac, 0x152c8def, + 0xe4a482ec, 0xf3df96af, 0xca52aa6a, 0xdd29be29, 0xb948d3e0, + 0xae33c7a3, 0x97befb66, 0x80c5ef25, 0x5f7c20f4, 0x480734b7, + 0x718a0872, 0x66f11c31, 0x029071f8, 0x15eb65bb, 0x2c66597e, + 0x3b1d4d3d, 0x4864c09d, 0x5f1fd4de, 0x6692e81b, 0x71e9fc58, + 0x15889191, 0x02f385d2, 0x3b7eb917, 0x2c05ad54, 0xf3bc6285, + 0xe4c776c6, 0xdd4a4a03, 0xca315e40, 0xae503389, 0xb92b27ca, + 0x80a61b0f, 0x97dd0f4c, 0xb8c70348, 0xafbc170b, 0x96312bce, + 0x814a3f8d, 0xe52b5244, 0xf2504607, 0xcbdd7ac2, 0xdca66e81, + 0x031fa150, 0x1464b513, 0x2de989d6, 0x3a929d95, 0x5ef3f05c, + 0x4988e41f, 0x7005d8da, 0x677ecc99, 0x14074139, 0x037c557a, + 0x3af169bf, 0x2d8a7dfc, 0x49eb1035, 0x5e900476, 0x671d38b3, + 0x70662cf0, 0xafdfe321, 0xb8a4f762, 0x8129cba7, 0x9652dfe4, + 0xf233b22d, 0xe548a66e, 0xdcc59aab, 0xcbbe8ee8, 0x3a3681eb, + 0x2d4d95a8, 0x14c0a96d, 0x03bbbd2e, 0x67dad0e7, 0x70a1c4a4, + 0x492cf861, 0x5e57ec22, 0x81ee23f3, 0x969537b0, 0xaf180b75, + 0xb8631f36, 0xdc0272ff, 0xcb7966bc, 0xf2f45a79, 0xe58f4e3a, + 0x96f6c39a, 0x818dd7d9, 0xb800eb1c, 0xaf7bff5f, 0xcb1a9296, + 0xdc6186d5, 0xe5ecba10, 0xf297ae53, 0x2d2e6182, 0x3a5575c1, + 0x03d84904, 0x14a35d47, 0x70c2308e, 0x67b924cd, 0x5e341808, + 0x494f0c4b}}; + +local const z_word_t FAR crc_braid_big_table[][256] = { + {0x00000000, 0x43147b17, 0x8628f62e, 0xc53c8d39, 0x0c51ec5d, + 0x4f45974a, 0x8a791a73, 0xc96d6164, 0x18a2d8bb, 0x5bb6a3ac, + 0x9e8a2e95, 0xdd9e5582, 0x14f334e6, 0x57e74ff1, 0x92dbc2c8, + 0xd1cfb9df, 0x7142c0ac, 0x3256bbbb, 0xf76a3682, 0xb47e4d95, + 0x7d132cf1, 0x3e0757e6, 0xfb3bdadf, 0xb82fa1c8, 0x69e01817, + 0x2af46300, 0xefc8ee39, 0xacdc952e, 0x65b1f44a, 0x26a58f5d, + 0xe3990264, 0xa08d7973, 0xa382f182, 0xe0968a95, 0x25aa07ac, + 0x66be7cbb, 0xafd31ddf, 0xecc766c8, 0x29fbebf1, 0x6aef90e6, + 0xbb202939, 0xf834522e, 0x3d08df17, 0x7e1ca400, 0xb771c564, + 0xf465be73, 0x3159334a, 0x724d485d, 0xd2c0312e, 0x91d44a39, + 0x54e8c700, 0x17fcbc17, 0xde91dd73, 0x9d85a664, 0x58b92b5d, + 0x1bad504a, 0xca62e995, 0x89769282, 0x4c4a1fbb, 0x0f5e64ac, + 0xc63305c8, 0x85277edf, 0x401bf3e6, 0x030f88f1, 0x070392de, + 0x4417e9c9, 0x812b64f0, 0xc23f1fe7, 0x0b527e83, 0x48460594, + 0x8d7a88ad, 0xce6ef3ba, 0x1fa14a65, 0x5cb53172, 0x9989bc4b, + 0xda9dc75c, 0x13f0a638, 0x50e4dd2f, 0x95d85016, 0xd6cc2b01, + 0x76415272, 0x35552965, 0xf069a45c, 0xb37ddf4b, 0x7a10be2f, + 0x3904c538, 0xfc384801, 0xbf2c3316, 0x6ee38ac9, 0x2df7f1de, + 0xe8cb7ce7, 0xabdf07f0, 0x62b26694, 0x21a61d83, 0xe49a90ba, + 0xa78eebad, 0xa481635c, 0xe795184b, 0x22a99572, 0x61bdee65, + 0xa8d08f01, 0xebc4f416, 0x2ef8792f, 0x6dec0238, 0xbc23bbe7, + 0xff37c0f0, 0x3a0b4dc9, 0x791f36de, 0xb07257ba, 0xf3662cad, + 0x365aa194, 0x754eda83, 0xd5c3a3f0, 0x96d7d8e7, 0x53eb55de, + 0x10ff2ec9, 0xd9924fad, 0x9a8634ba, 0x5fbab983, 0x1caec294, + 0xcd617b4b, 0x8e75005c, 0x4b498d65, 0x085df672, 0xc1309716, + 0x8224ec01, 0x47186138, 0x040c1a2f, 0x4f005566, 0x0c142e71, + 0xc928a348, 0x8a3cd85f, 0x4351b93b, 0x0045c22c, 0xc5794f15, + 0x866d3402, 0x57a28ddd, 0x14b6f6ca, 0xd18a7bf3, 0x929e00e4, + 0x5bf36180, 0x18e71a97, 0xdddb97ae, 0x9ecfecb9, 0x3e4295ca, + 0x7d56eedd, 0xb86a63e4, 0xfb7e18f3, 0x32137997, 0x71070280, + 0xb43b8fb9, 0xf72ff4ae, 0x26e04d71, 0x65f43666, 0xa0c8bb5f, + 0xe3dcc048, 0x2ab1a12c, 0x69a5da3b, 0xac995702, 0xef8d2c15, + 0xec82a4e4, 0xaf96dff3, 0x6aaa52ca, 0x29be29dd, 0xe0d348b9, + 0xa3c733ae, 0x66fbbe97, 0x25efc580, 0xf4207c5f, 0xb7340748, + 0x72088a71, 0x311cf166, 0xf8719002, 0xbb65eb15, 0x7e59662c, + 0x3d4d1d3b, 0x9dc06448, 0xded41f5f, 0x1be89266, 0x58fce971, + 0x91918815, 0xd285f302, 0x17b97e3b, 0x54ad052c, 0x8562bcf3, + 0xc676c7e4, 0x034a4add, 0x405e31ca, 0x893350ae, 0xca272bb9, + 0x0f1ba680, 0x4c0fdd97, 0x4803c7b8, 0x0b17bcaf, 0xce2b3196, + 0x8d3f4a81, 0x44522be5, 0x074650f2, 0xc27addcb, 0x816ea6dc, + 0x50a11f03, 0x13b56414, 0xd689e92d, 0x959d923a, 0x5cf0f35e, + 0x1fe48849, 0xdad80570, 0x99cc7e67, 0x39410714, 0x7a557c03, + 0xbf69f13a, 0xfc7d8a2d, 0x3510eb49, 0x7604905e, 0xb3381d67, + 0xf02c6670, 0x21e3dfaf, 0x62f7a4b8, 0xa7cb2981, 0xe4df5296, + 0x2db233f2, 0x6ea648e5, 0xab9ac5dc, 0xe88ebecb, 0xeb81363a, + 0xa8954d2d, 0x6da9c014, 0x2ebdbb03, 0xe7d0da67, 0xa4c4a170, + 0x61f82c49, 0x22ec575e, 0xf323ee81, 0xb0379596, 0x750b18af, + 0x361f63b8, 0xff7202dc, 0xbc6679cb, 0x795af4f2, 0x3a4e8fe5, + 0x9ac3f696, 0xd9d78d81, 0x1ceb00b8, 0x5fff7baf, 0x96921acb, + 0xd58661dc, 0x10baece5, 0x53ae97f2, 0x82612e2d, 0xc175553a, + 0x0449d803, 0x475da314, 0x8e30c270, 0xcd24b967, 0x0818345e, + 0x4b0c4f49}, + {0x00000000, 0x3e6bc2ef, 0x3dd0f504, 0x03bb37eb, 0x7aa0eb09, + 0x44cb29e6, 0x47701e0d, 0x791bdce2, 0xf440d713, 0xca2b15fc, + 0xc9902217, 0xf7fbe0f8, 0x8ee03c1a, 0xb08bfef5, 0xb330c91e, + 0x8d5b0bf1, 0xe881ae27, 0xd6ea6cc8, 0xd5515b23, 0xeb3a99cc, + 0x9221452e, 0xac4a87c1, 0xaff1b02a, 0x919a72c5, 0x1cc17934, + 0x22aabbdb, 0x21118c30, 0x1f7a4edf, 0x6661923d, 0x580a50d2, + 0x5bb16739, 0x65daa5d6, 0xd0035d4f, 0xee689fa0, 0xedd3a84b, + 0xd3b86aa4, 0xaaa3b646, 0x94c874a9, 0x97734342, 0xa91881ad, + 0x24438a5c, 0x1a2848b3, 0x19937f58, 0x27f8bdb7, 0x5ee36155, + 0x6088a3ba, 0x63339451, 0x5d5856be, 0x3882f368, 0x06e93187, + 0x0552066c, 0x3b39c483, 0x42221861, 0x7c49da8e, 0x7ff2ed65, + 0x41992f8a, 0xccc2247b, 0xf2a9e694, 0xf112d17f, 0xcf791390, + 0xb662cf72, 0x88090d9d, 0x8bb23a76, 0xb5d9f899, 0xa007ba9e, + 0x9e6c7871, 0x9dd74f9a, 0xa3bc8d75, 0xdaa75197, 0xe4cc9378, + 0xe777a493, 0xd91c667c, 0x54476d8d, 0x6a2caf62, 0x69979889, + 0x57fc5a66, 0x2ee78684, 0x108c446b, 0x13377380, 0x2d5cb16f, + 0x488614b9, 0x76edd656, 0x7556e1bd, 0x4b3d2352, 0x3226ffb0, + 0x0c4d3d5f, 0x0ff60ab4, 0x319dc85b, 0xbcc6c3aa, 0x82ad0145, + 0x811636ae, 0xbf7df441, 0xc66628a3, 0xf80dea4c, 0xfbb6dda7, + 0xc5dd1f48, 0x7004e7d1, 0x4e6f253e, 0x4dd412d5, 0x73bfd03a, + 0x0aa40cd8, 0x34cfce37, 0x3774f9dc, 0x091f3b33, 0x844430c2, + 0xba2ff22d, 0xb994c5c6, 0x87ff0729, 0xfee4dbcb, 0xc08f1924, + 0xc3342ecf, 0xfd5fec20, 0x988549f6, 0xa6ee8b19, 0xa555bcf2, + 0x9b3e7e1d, 0xe225a2ff, 0xdc4e6010, 0xdff557fb, 0xe19e9514, + 0x6cc59ee5, 0x52ae5c0a, 0x51156be1, 0x6f7ea90e, 0x166575ec, + 0x280eb703, 0x2bb580e8, 0x15de4207, 0x010905e6, 0x3f62c709, + 0x3cd9f0e2, 0x02b2320d, 0x7ba9eeef, 0x45c22c00, 0x46791beb, + 0x7812d904, 0xf549d2f5, 0xcb22101a, 0xc89927f1, 0xf6f2e51e, + 0x8fe939fc, 0xb182fb13, 0xb239ccf8, 0x8c520e17, 0xe988abc1, + 0xd7e3692e, 0xd4585ec5, 0xea339c2a, 0x932840c8, 0xad438227, + 0xaef8b5cc, 0x90937723, 0x1dc87cd2, 0x23a3be3d, 0x201889d6, + 0x1e734b39, 0x676897db, 0x59035534, 0x5ab862df, 0x64d3a030, + 0xd10a58a9, 0xef619a46, 0xecdaadad, 0xd2b16f42, 0xabaab3a0, + 0x95c1714f, 0x967a46a4, 0xa811844b, 0x254a8fba, 0x1b214d55, + 0x189a7abe, 0x26f1b851, 0x5fea64b3, 0x6181a65c, 0x623a91b7, + 0x5c515358, 0x398bf68e, 0x07e03461, 0x045b038a, 0x3a30c165, + 0x432b1d87, 0x7d40df68, 0x7efbe883, 0x40902a6c, 0xcdcb219d, + 0xf3a0e372, 0xf01bd499, 0xce701676, 0xb76bca94, 0x8900087b, + 0x8abb3f90, 0xb4d0fd7f, 0xa10ebf78, 0x9f657d97, 0x9cde4a7c, + 0xa2b58893, 0xdbae5471, 0xe5c5969e, 0xe67ea175, 0xd815639a, + 0x554e686b, 0x6b25aa84, 0x689e9d6f, 0x56f55f80, 0x2fee8362, + 0x1185418d, 0x123e7666, 0x2c55b489, 0x498f115f, 0x77e4d3b0, + 0x745fe45b, 0x4a3426b4, 0x332ffa56, 0x0d4438b9, 0x0eff0f52, + 0x3094cdbd, 0xbdcfc64c, 0x83a404a3, 0x801f3348, 0xbe74f1a7, + 0xc76f2d45, 0xf904efaa, 0xfabfd841, 0xc4d41aae, 0x710de237, + 0x4f6620d8, 0x4cdd1733, 0x72b6d5dc, 0x0bad093e, 0x35c6cbd1, + 0x367dfc3a, 0x08163ed5, 0x854d3524, 0xbb26f7cb, 0xb89dc020, + 0x86f602cf, 0xffedde2d, 0xc1861cc2, 0xc23d2b29, 0xfc56e9c6, + 0x998c4c10, 0xa7e78eff, 0xa45cb914, 0x9a377bfb, 0xe32ca719, + 0xdd4765f6, 0xdefc521d, 0xe09790f2, 0x6dcc9b03, 0x53a759ec, + 0x501c6e07, 0x6e77ace8, 0x176c700a, 0x2907b2e5, 0x2abc850e, + 0x14d747e1}, + {0x00000000, 0xc0df8ec1, 0xc1b96c58, 0x0166e299, 0x8273d9b0, + 0x42ac5771, 0x43cab5e8, 0x83153b29, 0x45e1c3ba, 0x853e4d7b, + 0x8458afe2, 0x44872123, 0xc7921a0a, 0x074d94cb, 0x062b7652, + 0xc6f4f893, 0xcbc4f6ae, 0x0b1b786f, 0x0a7d9af6, 0xcaa21437, + 0x49b72f1e, 0x8968a1df, 0x880e4346, 0x48d1cd87, 0x8e253514, + 0x4efabbd5, 0x4f9c594c, 0x8f43d78d, 0x0c56eca4, 0xcc896265, + 0xcdef80fc, 0x0d300e3d, 0xd78f9c86, 0x17501247, 0x1636f0de, + 0xd6e97e1f, 0x55fc4536, 0x9523cbf7, 0x9445296e, 0x549aa7af, + 0x926e5f3c, 0x52b1d1fd, 0x53d73364, 0x9308bda5, 0x101d868c, + 0xd0c2084d, 0xd1a4ead4, 0x117b6415, 0x1c4b6a28, 0xdc94e4e9, + 0xddf20670, 0x1d2d88b1, 0x9e38b398, 0x5ee73d59, 0x5f81dfc0, + 0x9f5e5101, 0x59aaa992, 0x99752753, 0x9813c5ca, 0x58cc4b0b, + 0xdbd97022, 0x1b06fee3, 0x1a601c7a, 0xdabf92bb, 0xef1948d6, + 0x2fc6c617, 0x2ea0248e, 0xee7faa4f, 0x6d6a9166, 0xadb51fa7, + 0xacd3fd3e, 0x6c0c73ff, 0xaaf88b6c, 0x6a2705ad, 0x6b41e734, + 0xab9e69f5, 0x288b52dc, 0xe854dc1d, 0xe9323e84, 0x29edb045, + 0x24ddbe78, 0xe40230b9, 0xe564d220, 0x25bb5ce1, 0xa6ae67c8, + 0x6671e909, 0x67170b90, 0xa7c88551, 0x613c7dc2, 0xa1e3f303, + 0xa085119a, 0x605a9f5b, 0xe34fa472, 0x23902ab3, 0x22f6c82a, + 0xe22946eb, 0x3896d450, 0xf8495a91, 0xf92fb808, 0x39f036c9, + 0xbae50de0, 0x7a3a8321, 0x7b5c61b8, 0xbb83ef79, 0x7d7717ea, + 0xbda8992b, 0xbcce7bb2, 0x7c11f573, 0xff04ce5a, 0x3fdb409b, + 0x3ebda202, 0xfe622cc3, 0xf35222fe, 0x338dac3f, 0x32eb4ea6, + 0xf234c067, 0x7121fb4e, 0xb1fe758f, 0xb0989716, 0x704719d7, + 0xb6b3e144, 0x766c6f85, 0x770a8d1c, 0xb7d503dd, 0x34c038f4, + 0xf41fb635, 0xf57954ac, 0x35a6da6d, 0x9f35e177, 0x5fea6fb6, + 0x5e8c8d2f, 0x9e5303ee, 0x1d4638c7, 0xdd99b606, 0xdcff549f, + 0x1c20da5e, 0xdad422cd, 0x1a0bac0c, 0x1b6d4e95, 0xdbb2c054, + 0x58a7fb7d, 0x987875bc, 0x991e9725, 0x59c119e4, 0x54f117d9, + 0x942e9918, 0x95487b81, 0x5597f540, 0xd682ce69, 0x165d40a8, + 0x173ba231, 0xd7e42cf0, 0x1110d463, 0xd1cf5aa2, 0xd0a9b83b, + 0x107636fa, 0x93630dd3, 0x53bc8312, 0x52da618b, 0x9205ef4a, + 0x48ba7df1, 0x8865f330, 0x890311a9, 0x49dc9f68, 0xcac9a441, + 0x0a162a80, 0x0b70c819, 0xcbaf46d8, 0x0d5bbe4b, 0xcd84308a, + 0xcce2d213, 0x0c3d5cd2, 0x8f2867fb, 0x4ff7e93a, 0x4e910ba3, + 0x8e4e8562, 0x837e8b5f, 0x43a1059e, 0x42c7e707, 0x821869c6, + 0x010d52ef, 0xc1d2dc2e, 0xc0b43eb7, 0x006bb076, 0xc69f48e5, + 0x0640c624, 0x072624bd, 0xc7f9aa7c, 0x44ec9155, 0x84331f94, + 0x8555fd0d, 0x458a73cc, 0x702ca9a1, 0xb0f32760, 0xb195c5f9, + 0x714a4b38, 0xf25f7011, 0x3280fed0, 0x33e61c49, 0xf3399288, + 0x35cd6a1b, 0xf512e4da, 0xf4740643, 0x34ab8882, 0xb7beb3ab, + 0x77613d6a, 0x7607dff3, 0xb6d85132, 0xbbe85f0f, 0x7b37d1ce, + 0x7a513357, 0xba8ebd96, 0x399b86bf, 0xf944087e, 0xf822eae7, + 0x38fd6426, 0xfe099cb5, 0x3ed61274, 0x3fb0f0ed, 0xff6f7e2c, + 0x7c7a4505, 0xbca5cbc4, 0xbdc3295d, 0x7d1ca79c, 0xa7a33527, + 0x677cbbe6, 0x661a597f, 0xa6c5d7be, 0x25d0ec97, 0xe50f6256, + 0xe46980cf, 0x24b60e0e, 0xe242f69d, 0x229d785c, 0x23fb9ac5, + 0xe3241404, 0x60312f2d, 0xa0eea1ec, 0xa1884375, 0x6157cdb4, + 0x6c67c389, 0xacb84d48, 0xaddeafd1, 0x6d012110, 0xee141a39, + 0x2ecb94f8, 0x2fad7661, 0xef72f8a0, 0x29860033, 0xe9598ef2, + 0xe83f6c6b, 0x28e0e2aa, 0xabf5d983, 0x6b2a5742, 0x6a4cb5db, + 0xaa933b1a}, + {0x00000000, 0x6f4ca59b, 0x9f9e3bec, 0xf0d29e77, 0x7f3b0603, + 0x1077a398, 0xe0a53def, 0x8fe99874, 0xfe760c06, 0x913aa99d, + 0x61e837ea, 0x0ea49271, 0x814d0a05, 0xee01af9e, 0x1ed331e9, + 0x719f9472, 0xfced180c, 0x93a1bd97, 0x637323e0, 0x0c3f867b, + 0x83d61e0f, 0xec9abb94, 0x1c4825e3, 0x73048078, 0x029b140a, + 0x6dd7b191, 0x9d052fe6, 0xf2498a7d, 0x7da01209, 0x12ecb792, + 0xe23e29e5, 0x8d728c7e, 0xf8db3118, 0x97979483, 0x67450af4, + 0x0809af6f, 0x87e0371b, 0xe8ac9280, 0x187e0cf7, 0x7732a96c, + 0x06ad3d1e, 0x69e19885, 0x993306f2, 0xf67fa369, 0x79963b1d, + 0x16da9e86, 0xe60800f1, 0x8944a56a, 0x04362914, 0x6b7a8c8f, + 0x9ba812f8, 0xf4e4b763, 0x7b0d2f17, 0x14418a8c, 0xe49314fb, + 0x8bdfb160, 0xfa402512, 0x950c8089, 0x65de1efe, 0x0a92bb65, + 0x857b2311, 0xea37868a, 0x1ae518fd, 0x75a9bd66, 0xf0b76330, + 0x9ffbc6ab, 0x6f2958dc, 0x0065fd47, 0x8f8c6533, 0xe0c0c0a8, + 0x10125edf, 0x7f5efb44, 0x0ec16f36, 0x618dcaad, 0x915f54da, + 0xfe13f141, 0x71fa6935, 0x1eb6ccae, 0xee6452d9, 0x8128f742, + 0x0c5a7b3c, 0x6316dea7, 0x93c440d0, 0xfc88e54b, 0x73617d3f, + 0x1c2dd8a4, 0xecff46d3, 0x83b3e348, 0xf22c773a, 0x9d60d2a1, + 0x6db24cd6, 0x02fee94d, 0x8d177139, 0xe25bd4a2, 0x12894ad5, + 0x7dc5ef4e, 0x086c5228, 0x6720f7b3, 0x97f269c4, 0xf8becc5f, + 0x7757542b, 0x181bf1b0, 0xe8c96fc7, 0x8785ca5c, 0xf61a5e2e, + 0x9956fbb5, 0x698465c2, 0x06c8c059, 0x8921582d, 0xe66dfdb6, + 0x16bf63c1, 0x79f3c65a, 0xf4814a24, 0x9bcdefbf, 0x6b1f71c8, + 0x0453d453, 0x8bba4c27, 0xe4f6e9bc, 0x142477cb, 0x7b68d250, + 0x0af74622, 0x65bbe3b9, 0x95697dce, 0xfa25d855, 0x75cc4021, + 0x1a80e5ba, 0xea527bcd, 0x851ede56, 0xe06fc760, 0x8f2362fb, + 0x7ff1fc8c, 0x10bd5917, 0x9f54c163, 0xf01864f8, 0x00cafa8f, + 0x6f865f14, 0x1e19cb66, 0x71556efd, 0x8187f08a, 0xeecb5511, + 0x6122cd65, 0x0e6e68fe, 0xfebcf689, 0x91f05312, 0x1c82df6c, + 0x73ce7af7, 0x831ce480, 0xec50411b, 0x63b9d96f, 0x0cf57cf4, + 0xfc27e283, 0x936b4718, 0xe2f4d36a, 0x8db876f1, 0x7d6ae886, + 0x12264d1d, 0x9dcfd569, 0xf28370f2, 0x0251ee85, 0x6d1d4b1e, + 0x18b4f678, 0x77f853e3, 0x872acd94, 0xe866680f, 0x678ff07b, + 0x08c355e0, 0xf811cb97, 0x975d6e0c, 0xe6c2fa7e, 0x898e5fe5, + 0x795cc192, 0x16106409, 0x99f9fc7d, 0xf6b559e6, 0x0667c791, + 0x692b620a, 0xe459ee74, 0x8b154bef, 0x7bc7d598, 0x148b7003, + 0x9b62e877, 0xf42e4dec, 0x04fcd39b, 0x6bb07600, 0x1a2fe272, + 0x756347e9, 0x85b1d99e, 0xeafd7c05, 0x6514e471, 0x0a5841ea, + 0xfa8adf9d, 0x95c67a06, 0x10d8a450, 0x7f9401cb, 0x8f469fbc, + 0xe00a3a27, 0x6fe3a253, 0x00af07c8, 0xf07d99bf, 0x9f313c24, + 0xeeaea856, 0x81e20dcd, 0x713093ba, 0x1e7c3621, 0x9195ae55, + 0xfed90bce, 0x0e0b95b9, 0x61473022, 0xec35bc5c, 0x837919c7, + 0x73ab87b0, 0x1ce7222b, 0x930eba5f, 0xfc421fc4, 0x0c9081b3, + 0x63dc2428, 0x1243b05a, 0x7d0f15c1, 0x8ddd8bb6, 0xe2912e2d, + 0x6d78b659, 0x023413c2, 0xf2e68db5, 0x9daa282e, 0xe8039548, + 0x874f30d3, 0x779daea4, 0x18d10b3f, 0x9738934b, 0xf87436d0, + 0x08a6a8a7, 0x67ea0d3c, 0x1675994e, 0x79393cd5, 0x89eba2a2, + 0xe6a70739, 0x694e9f4d, 0x06023ad6, 0xf6d0a4a1, 0x999c013a, + 0x14ee8d44, 0x7ba228df, 0x8b70b6a8, 0xe43c1333, 0x6bd58b47, + 0x04992edc, 0xf44bb0ab, 0x9b071530, 0xea988142, 0x85d424d9, + 0x7506baae, 0x1a4a1f35, 0x95a38741, 0xfaef22da, 0x0a3dbcad, + 0x65711936}}; + +#endif + +#endif + +#if N == 4 + +#if W == 8 + +local const z_crc_t FAR crc_braid_table[][256] = { + {0x00000000, 0xf1da05aa, 0x38c50d15, 0xc91f08bf, 0x718a1a2a, + 0x80501f80, 0x494f173f, 0xb8951295, 0xe3143454, 0x12ce31fe, + 0xdbd13941, 0x2a0b3ceb, 0x929e2e7e, 0x63442bd4, 0xaa5b236b, + 0x5b8126c1, 0x1d596ee9, 0xec836b43, 0x259c63fc, 0xd4466656, + 0x6cd374c3, 0x9d097169, 0x541679d6, 0xa5cc7c7c, 0xfe4d5abd, + 0x0f975f17, 0xc68857a8, 0x37525202, 0x8fc74097, 0x7e1d453d, + 0xb7024d82, 0x46d84828, 0x3ab2ddd2, 0xcb68d878, 0x0277d0c7, + 0xf3add56d, 0x4b38c7f8, 0xbae2c252, 0x73fdcaed, 0x8227cf47, + 0xd9a6e986, 0x287cec2c, 0xe163e493, 0x10b9e139, 0xa82cf3ac, + 0x59f6f606, 0x90e9feb9, 0x6133fb13, 0x27ebb33b, 0xd631b691, + 0x1f2ebe2e, 0xeef4bb84, 0x5661a911, 0xa7bbacbb, 0x6ea4a404, + 0x9f7ea1ae, 0xc4ff876f, 0x352582c5, 0xfc3a8a7a, 0x0de08fd0, + 0xb5759d45, 0x44af98ef, 0x8db09050, 0x7c6a95fa, 0x7565bba4, + 0x84bfbe0e, 0x4da0b6b1, 0xbc7ab31b, 0x04efa18e, 0xf535a424, + 0x3c2aac9b, 0xcdf0a931, 0x96718ff0, 0x67ab8a5a, 0xaeb482e5, + 0x5f6e874f, 0xe7fb95da, 0x16219070, 0xdf3e98cf, 0x2ee49d65, + 0x683cd54d, 0x99e6d0e7, 0x50f9d858, 0xa123ddf2, 0x19b6cf67, + 0xe86ccacd, 0x2173c272, 0xd0a9c7d8, 0x8b28e119, 0x7af2e4b3, + 0xb3edec0c, 0x4237e9a6, 0xfaa2fb33, 0x0b78fe99, 0xc267f626, + 0x33bdf38c, 0x4fd76676, 0xbe0d63dc, 0x77126b63, 0x86c86ec9, + 0x3e5d7c5c, 0xcf8779f6, 0x06987149, 0xf74274e3, 0xacc35222, + 0x5d195788, 0x94065f37, 0x65dc5a9d, 0xdd494808, 0x2c934da2, + 0xe58c451d, 0x145640b7, 0x528e089f, 0xa3540d35, 0x6a4b058a, + 0x9b910020, 0x230412b5, 0xd2de171f, 0x1bc11fa0, 0xea1b1a0a, + 0xb19a3ccb, 0x40403961, 0x895f31de, 0x78853474, 0xc01026e1, + 0x31ca234b, 0xf8d52bf4, 0x090f2e5e, 0xeacb7748, 0x1b1172e2, + 0xd20e7a5d, 0x23d47ff7, 0x9b416d62, 0x6a9b68c8, 0xa3846077, + 0x525e65dd, 0x09df431c, 0xf80546b6, 0x311a4e09, 0xc0c04ba3, + 0x78555936, 0x898f5c9c, 0x40905423, 0xb14a5189, 0xf79219a1, + 0x06481c0b, 0xcf5714b4, 0x3e8d111e, 0x8618038b, 0x77c20621, + 0xbedd0e9e, 0x4f070b34, 0x14862df5, 0xe55c285f, 0x2c4320e0, + 0xdd99254a, 0x650c37df, 0x94d63275, 0x5dc93aca, 0xac133f60, + 0xd079aa9a, 0x21a3af30, 0xe8bca78f, 0x1966a225, 0xa1f3b0b0, + 0x5029b51a, 0x9936bda5, 0x68ecb80f, 0x336d9ece, 0xc2b79b64, + 0x0ba893db, 0xfa729671, 0x42e784e4, 0xb33d814e, 0x7a2289f1, + 0x8bf88c5b, 0xcd20c473, 0x3cfac1d9, 0xf5e5c966, 0x043fcccc, + 0xbcaade59, 0x4d70dbf3, 0x846fd34c, 0x75b5d6e6, 0x2e34f027, + 0xdfeef58d, 0x16f1fd32, 0xe72bf898, 0x5fbeea0d, 0xae64efa7, + 0x677be718, 0x96a1e2b2, 0x9faeccec, 0x6e74c946, 0xa76bc1f9, + 0x56b1c453, 0xee24d6c6, 0x1ffed36c, 0xd6e1dbd3, 0x273bde79, + 0x7cbaf8b8, 0x8d60fd12, 0x447ff5ad, 0xb5a5f007, 0x0d30e292, + 0xfceae738, 0x35f5ef87, 0xc42fea2d, 0x82f7a205, 0x732da7af, + 0xba32af10, 0x4be8aaba, 0xf37db82f, 0x02a7bd85, 0xcbb8b53a, + 0x3a62b090, 0x61e39651, 0x903993fb, 0x59269b44, 0xa8fc9eee, + 0x10698c7b, 0xe1b389d1, 0x28ac816e, 0xd97684c4, 0xa51c113e, + 0x54c61494, 0x9dd91c2b, 0x6c031981, 0xd4960b14, 0x254c0ebe, + 0xec530601, 0x1d8903ab, 0x4608256a, 0xb7d220c0, 0x7ecd287f, + 0x8f172dd5, 0x37823f40, 0xc6583aea, 0x0f473255, 0xfe9d37ff, + 0xb8457fd7, 0x499f7a7d, 0x808072c2, 0x715a7768, 0xc9cf65fd, + 0x38156057, 0xf10a68e8, 0x00d06d42, 0x5b514b83, 0xaa8b4e29, + 0x63944696, 0x924e433c, 0x2adb51a9, 0xdb015403, 0x121e5cbc, + 0xe3c45916}, + {0x00000000, 0x0ee7e8d1, 0x1dcfd1a2, 0x13283973, 0x3b9fa344, + 0x35784b95, 0x265072e6, 0x28b79a37, 0x773f4688, 0x79d8ae59, + 0x6af0972a, 0x64177ffb, 0x4ca0e5cc, 0x42470d1d, 0x516f346e, + 0x5f88dcbf, 0xee7e8d10, 0xe09965c1, 0xf3b15cb2, 0xfd56b463, + 0xd5e12e54, 0xdb06c685, 0xc82efff6, 0xc6c91727, 0x9941cb98, + 0x97a62349, 0x848e1a3a, 0x8a69f2eb, 0xa2de68dc, 0xac39800d, + 0xbf11b97e, 0xb1f651af, 0x078c1c61, 0x096bf4b0, 0x1a43cdc3, + 0x14a42512, 0x3c13bf25, 0x32f457f4, 0x21dc6e87, 0x2f3b8656, + 0x70b35ae9, 0x7e54b238, 0x6d7c8b4b, 0x639b639a, 0x4b2cf9ad, + 0x45cb117c, 0x56e3280f, 0x5804c0de, 0xe9f29171, 0xe71579a0, + 0xf43d40d3, 0xfadaa802, 0xd26d3235, 0xdc8adae4, 0xcfa2e397, + 0xc1450b46, 0x9ecdd7f9, 0x902a3f28, 0x8302065b, 0x8de5ee8a, + 0xa55274bd, 0xabb59c6c, 0xb89da51f, 0xb67a4dce, 0x0f1838c2, + 0x01ffd013, 0x12d7e960, 0x1c3001b1, 0x34879b86, 0x3a607357, + 0x29484a24, 0x27afa2f5, 0x78277e4a, 0x76c0969b, 0x65e8afe8, + 0x6b0f4739, 0x43b8dd0e, 0x4d5f35df, 0x5e770cac, 0x5090e47d, + 0xe166b5d2, 0xef815d03, 0xfca96470, 0xf24e8ca1, 0xdaf91696, + 0xd41efe47, 0xc736c734, 0xc9d12fe5, 0x9659f35a, 0x98be1b8b, + 0x8b9622f8, 0x8571ca29, 0xadc6501e, 0xa321b8cf, 0xb00981bc, + 0xbeee696d, 0x089424a3, 0x0673cc72, 0x155bf501, 0x1bbc1dd0, + 0x330b87e7, 0x3dec6f36, 0x2ec45645, 0x2023be94, 0x7fab622b, + 0x714c8afa, 0x6264b389, 0x6c835b58, 0x4434c16f, 0x4ad329be, + 0x59fb10cd, 0x571cf81c, 0xe6eaa9b3, 0xe80d4162, 0xfb257811, + 0xf5c290c0, 0xdd750af7, 0xd392e226, 0xc0badb55, 0xce5d3384, + 0x91d5ef3b, 0x9f3207ea, 0x8c1a3e99, 0x82fdd648, 0xaa4a4c7f, + 0xa4ada4ae, 0xb7859ddd, 0xb962750c, 0x1e307184, 0x10d79955, + 0x03ffa026, 0x0d1848f7, 0x25afd2c0, 0x2b483a11, 0x38600362, + 0x3687ebb3, 0x690f370c, 0x67e8dfdd, 0x74c0e6ae, 0x7a270e7f, + 0x52909448, 0x5c777c99, 0x4f5f45ea, 0x41b8ad3b, 0xf04efc94, + 0xfea91445, 0xed812d36, 0xe366c5e7, 0xcbd15fd0, 0xc536b701, + 0xd61e8e72, 0xd8f966a3, 0x8771ba1c, 0x899652cd, 0x9abe6bbe, + 0x9459836f, 0xbcee1958, 0xb209f189, 0xa121c8fa, 0xafc6202b, + 0x19bc6de5, 0x175b8534, 0x0473bc47, 0x0a945496, 0x2223cea1, + 0x2cc42670, 0x3fec1f03, 0x310bf7d2, 0x6e832b6d, 0x6064c3bc, + 0x734cfacf, 0x7dab121e, 0x551c8829, 0x5bfb60f8, 0x48d3598b, + 0x4634b15a, 0xf7c2e0f5, 0xf9250824, 0xea0d3157, 0xe4ead986, + 0xcc5d43b1, 0xc2baab60, 0xd1929213, 0xdf757ac2, 0x80fda67d, + 0x8e1a4eac, 0x9d3277df, 0x93d59f0e, 0xbb620539, 0xb585ede8, + 0xa6add49b, 0xa84a3c4a, 0x11284946, 0x1fcfa197, 0x0ce798e4, + 0x02007035, 0x2ab7ea02, 0x245002d3, 0x37783ba0, 0x399fd371, + 0x66170fce, 0x68f0e71f, 0x7bd8de6c, 0x753f36bd, 0x5d88ac8a, + 0x536f445b, 0x40477d28, 0x4ea095f9, 0xff56c456, 0xf1b12c87, + 0xe29915f4, 0xec7efd25, 0xc4c96712, 0xca2e8fc3, 0xd906b6b0, + 0xd7e15e61, 0x886982de, 0x868e6a0f, 0x95a6537c, 0x9b41bbad, + 0xb3f6219a, 0xbd11c94b, 0xae39f038, 0xa0de18e9, 0x16a45527, + 0x1843bdf6, 0x0b6b8485, 0x058c6c54, 0x2d3bf663, 0x23dc1eb2, + 0x30f427c1, 0x3e13cf10, 0x619b13af, 0x6f7cfb7e, 0x7c54c20d, + 0x72b32adc, 0x5a04b0eb, 0x54e3583a, 0x47cb6149, 0x492c8998, + 0xf8dad837, 0xf63d30e6, 0xe5150995, 0xebf2e144, 0xc3457b73, + 0xcda293a2, 0xde8aaad1, 0xd06d4200, 0x8fe59ebf, 0x8102766e, + 0x922a4f1d, 0x9ccda7cc, 0xb47a3dfb, 0xba9dd52a, 0xa9b5ec59, + 0xa7520488}, + {0x00000000, 0x3c60e308, 0x78c1c610, 0x44a12518, 0xf1838c20, + 0xcde36f28, 0x89424a30, 0xb522a938, 0x38761e01, 0x0416fd09, + 0x40b7d811, 0x7cd73b19, 0xc9f59221, 0xf5957129, 0xb1345431, + 0x8d54b739, 0x70ec3c02, 0x4c8cdf0a, 0x082dfa12, 0x344d191a, + 0x816fb022, 0xbd0f532a, 0xf9ae7632, 0xc5ce953a, 0x489a2203, + 0x74fac10b, 0x305be413, 0x0c3b071b, 0xb919ae23, 0x85794d2b, + 0xc1d86833, 0xfdb88b3b, 0xe1d87804, 0xddb89b0c, 0x9919be14, + 0xa5795d1c, 0x105bf424, 0x2c3b172c, 0x689a3234, 0x54fad13c, + 0xd9ae6605, 0xe5ce850d, 0xa16fa015, 0x9d0f431d, 0x282dea25, + 0x144d092d, 0x50ec2c35, 0x6c8ccf3d, 0x91344406, 0xad54a70e, + 0xe9f58216, 0xd595611e, 0x60b7c826, 0x5cd72b2e, 0x18760e36, + 0x2416ed3e, 0xa9425a07, 0x9522b90f, 0xd1839c17, 0xede37f1f, + 0x58c1d627, 0x64a1352f, 0x20001037, 0x1c60f33f, 0x18c1f649, + 0x24a11541, 0x60003059, 0x5c60d351, 0xe9427a69, 0xd5229961, + 0x9183bc79, 0xade35f71, 0x20b7e848, 0x1cd70b40, 0x58762e58, + 0x6416cd50, 0xd1346468, 0xed548760, 0xa9f5a278, 0x95954170, + 0x682dca4b, 0x544d2943, 0x10ec0c5b, 0x2c8cef53, 0x99ae466b, + 0xa5cea563, 0xe16f807b, 0xdd0f6373, 0x505bd44a, 0x6c3b3742, + 0x289a125a, 0x14faf152, 0xa1d8586a, 0x9db8bb62, 0xd9199e7a, + 0xe5797d72, 0xf9198e4d, 0xc5796d45, 0x81d8485d, 0xbdb8ab55, + 0x089a026d, 0x34fae165, 0x705bc47d, 0x4c3b2775, 0xc16f904c, + 0xfd0f7344, 0xb9ae565c, 0x85ceb554, 0x30ec1c6c, 0x0c8cff64, + 0x482dda7c, 0x744d3974, 0x89f5b24f, 0xb5955147, 0xf134745f, + 0xcd549757, 0x78763e6f, 0x4416dd67, 0x00b7f87f, 0x3cd71b77, + 0xb183ac4e, 0x8de34f46, 0xc9426a5e, 0xf5228956, 0x4000206e, + 0x7c60c366, 0x38c1e67e, 0x04a10576, 0x3183ec92, 0x0de30f9a, + 0x49422a82, 0x7522c98a, 0xc00060b2, 0xfc6083ba, 0xb8c1a6a2, + 0x84a145aa, 0x09f5f293, 0x3595119b, 0x71343483, 0x4d54d78b, + 0xf8767eb3, 0xc4169dbb, 0x80b7b8a3, 0xbcd75bab, 0x416fd090, + 0x7d0f3398, 0x39ae1680, 0x05cef588, 0xb0ec5cb0, 0x8c8cbfb8, + 0xc82d9aa0, 0xf44d79a8, 0x7919ce91, 0x45792d99, 0x01d80881, + 0x3db8eb89, 0x889a42b1, 0xb4faa1b9, 0xf05b84a1, 0xcc3b67a9, + 0xd05b9496, 0xec3b779e, 0xa89a5286, 0x94fab18e, 0x21d818b6, + 0x1db8fbbe, 0x5919dea6, 0x65793dae, 0xe82d8a97, 0xd44d699f, + 0x90ec4c87, 0xac8caf8f, 0x19ae06b7, 0x25cee5bf, 0x616fc0a7, + 0x5d0f23af, 0xa0b7a894, 0x9cd74b9c, 0xd8766e84, 0xe4168d8c, + 0x513424b4, 0x6d54c7bc, 0x29f5e2a4, 0x159501ac, 0x98c1b695, + 0xa4a1559d, 0xe0007085, 0xdc60938d, 0x69423ab5, 0x5522d9bd, + 0x1183fca5, 0x2de31fad, 0x29421adb, 0x1522f9d3, 0x5183dccb, + 0x6de33fc3, 0xd8c196fb, 0xe4a175f3, 0xa00050eb, 0x9c60b3e3, + 0x113404da, 0x2d54e7d2, 0x69f5c2ca, 0x559521c2, 0xe0b788fa, + 0xdcd76bf2, 0x98764eea, 0xa416ade2, 0x59ae26d9, 0x65cec5d1, + 0x216fe0c9, 0x1d0f03c1, 0xa82daaf9, 0x944d49f1, 0xd0ec6ce9, + 0xec8c8fe1, 0x61d838d8, 0x5db8dbd0, 0x1919fec8, 0x25791dc0, + 0x905bb4f8, 0xac3b57f0, 0xe89a72e8, 0xd4fa91e0, 0xc89a62df, + 0xf4fa81d7, 0xb05ba4cf, 0x8c3b47c7, 0x3919eeff, 0x05790df7, + 0x41d828ef, 0x7db8cbe7, 0xf0ec7cde, 0xcc8c9fd6, 0x882dbace, + 0xb44d59c6, 0x016ff0fe, 0x3d0f13f6, 0x79ae36ee, 0x45ced5e6, + 0xb8765edd, 0x8416bdd5, 0xc0b798cd, 0xfcd77bc5, 0x49f5d2fd, + 0x759531f5, 0x313414ed, 0x0d54f7e5, 0x800040dc, 0xbc60a3d4, + 0xf8c186cc, 0xc4a165c4, 0x7183ccfc, 0x4de32ff4, 0x09420aec, + 0x3522e9e4}, + {0x00000000, 0x6307d924, 0xc60fb248, 0xa5086b6c, 0x576e62d1, + 0x3469bbf5, 0x9161d099, 0xf26609bd, 0xaedcc5a2, 0xcddb1c86, + 0x68d377ea, 0x0bd4aece, 0xf9b2a773, 0x9ab57e57, 0x3fbd153b, + 0x5cbacc1f, 0x86c88d05, 0xe5cf5421, 0x40c73f4d, 0x23c0e669, + 0xd1a6efd4, 0xb2a136f0, 0x17a95d9c, 0x74ae84b8, 0x281448a7, + 0x4b139183, 0xee1bfaef, 0x8d1c23cb, 0x7f7a2a76, 0x1c7df352, + 0xb975983e, 0xda72411a, 0xd6e01c4b, 0xb5e7c56f, 0x10efae03, + 0x73e87727, 0x818e7e9a, 0xe289a7be, 0x4781ccd2, 0x248615f6, + 0x783cd9e9, 0x1b3b00cd, 0xbe336ba1, 0xdd34b285, 0x2f52bb38, + 0x4c55621c, 0xe95d0970, 0x8a5ad054, 0x5028914e, 0x332f486a, + 0x96272306, 0xf520fa22, 0x0746f39f, 0x64412abb, 0xc14941d7, + 0xa24e98f3, 0xfef454ec, 0x9df38dc8, 0x38fbe6a4, 0x5bfc3f80, + 0xa99a363d, 0xca9def19, 0x6f958475, 0x0c925d51, 0x76b13ed7, + 0x15b6e7f3, 0xb0be8c9f, 0xd3b955bb, 0x21df5c06, 0x42d88522, + 0xe7d0ee4e, 0x84d7376a, 0xd86dfb75, 0xbb6a2251, 0x1e62493d, + 0x7d659019, 0x8f0399a4, 0xec044080, 0x490c2bec, 0x2a0bf2c8, + 0xf079b3d2, 0x937e6af6, 0x3676019a, 0x5571d8be, 0xa717d103, + 0xc4100827, 0x6118634b, 0x021fba6f, 0x5ea57670, 0x3da2af54, + 0x98aac438, 0xfbad1d1c, 0x09cb14a1, 0x6acccd85, 0xcfc4a6e9, + 0xacc37fcd, 0xa051229c, 0xc356fbb8, 0x665e90d4, 0x055949f0, + 0xf73f404d, 0x94389969, 0x3130f205, 0x52372b21, 0x0e8de73e, + 0x6d8a3e1a, 0xc8825576, 0xab858c52, 0x59e385ef, 0x3ae45ccb, + 0x9fec37a7, 0xfcebee83, 0x2699af99, 0x459e76bd, 0xe0961dd1, + 0x8391c4f5, 0x71f7cd48, 0x12f0146c, 0xb7f87f00, 0xd4ffa624, + 0x88456a3b, 0xeb42b31f, 0x4e4ad873, 0x2d4d0157, 0xdf2b08ea, + 0xbc2cd1ce, 0x1924baa2, 0x7a236386, 0xed627dae, 0x8e65a48a, + 0x2b6dcfe6, 0x486a16c2, 0xba0c1f7f, 0xd90bc65b, 0x7c03ad37, + 0x1f047413, 0x43beb80c, 0x20b96128, 0x85b10a44, 0xe6b6d360, + 0x14d0dadd, 0x77d703f9, 0xd2df6895, 0xb1d8b1b1, 0x6baaf0ab, + 0x08ad298f, 0xada542e3, 0xcea29bc7, 0x3cc4927a, 0x5fc34b5e, + 0xfacb2032, 0x99ccf916, 0xc5763509, 0xa671ec2d, 0x03798741, + 0x607e5e65, 0x921857d8, 0xf11f8efc, 0x5417e590, 0x37103cb4, + 0x3b8261e5, 0x5885b8c1, 0xfd8dd3ad, 0x9e8a0a89, 0x6cec0334, + 0x0febda10, 0xaae3b17c, 0xc9e46858, 0x955ea447, 0xf6597d63, + 0x5351160f, 0x3056cf2b, 0xc230c696, 0xa1371fb2, 0x043f74de, + 0x6738adfa, 0xbd4aece0, 0xde4d35c4, 0x7b455ea8, 0x1842878c, + 0xea248e31, 0x89235715, 0x2c2b3c79, 0x4f2ce55d, 0x13962942, + 0x7091f066, 0xd5999b0a, 0xb69e422e, 0x44f84b93, 0x27ff92b7, + 0x82f7f9db, 0xe1f020ff, 0x9bd34379, 0xf8d49a5d, 0x5ddcf131, + 0x3edb2815, 0xccbd21a8, 0xafbaf88c, 0x0ab293e0, 0x69b54ac4, + 0x350f86db, 0x56085fff, 0xf3003493, 0x9007edb7, 0x6261e40a, + 0x01663d2e, 0xa46e5642, 0xc7698f66, 0x1d1bce7c, 0x7e1c1758, + 0xdb147c34, 0xb813a510, 0x4a75acad, 0x29727589, 0x8c7a1ee5, + 0xef7dc7c1, 0xb3c70bde, 0xd0c0d2fa, 0x75c8b996, 0x16cf60b2, + 0xe4a9690f, 0x87aeb02b, 0x22a6db47, 0x41a10263, 0x4d335f32, + 0x2e348616, 0x8b3ced7a, 0xe83b345e, 0x1a5d3de3, 0x795ae4c7, + 0xdc528fab, 0xbf55568f, 0xe3ef9a90, 0x80e843b4, 0x25e028d8, + 0x46e7f1fc, 0xb481f841, 0xd7862165, 0x728e4a09, 0x1189932d, + 0xcbfbd237, 0xa8fc0b13, 0x0df4607f, 0x6ef3b95b, 0x9c95b0e6, + 0xff9269c2, 0x5a9a02ae, 0x399ddb8a, 0x65271795, 0x0620ceb1, + 0xa328a5dd, 0xc02f7cf9, 0x32497544, 0x514eac60, 0xf446c70c, + 0x97411e28}, + {0x00000000, 0x01b5fd1d, 0x036bfa3a, 0x02de0727, 0x06d7f474, + 0x07620969, 0x05bc0e4e, 0x0409f353, 0x0dafe8e8, 0x0c1a15f5, + 0x0ec412d2, 0x0f71efcf, 0x0b781c9c, 0x0acde181, 0x0813e6a6, + 0x09a61bbb, 0x1b5fd1d0, 0x1aea2ccd, 0x18342bea, 0x1981d6f7, + 0x1d8825a4, 0x1c3dd8b9, 0x1ee3df9e, 0x1f562283, 0x16f03938, + 0x1745c425, 0x159bc302, 0x142e3e1f, 0x1027cd4c, 0x11923051, + 0x134c3776, 0x12f9ca6b, 0x36bfa3a0, 0x370a5ebd, 0x35d4599a, + 0x3461a487, 0x306857d4, 0x31ddaac9, 0x3303adee, 0x32b650f3, + 0x3b104b48, 0x3aa5b655, 0x387bb172, 0x39ce4c6f, 0x3dc7bf3c, + 0x3c724221, 0x3eac4506, 0x3f19b81b, 0x2de07270, 0x2c558f6d, + 0x2e8b884a, 0x2f3e7557, 0x2b378604, 0x2a827b19, 0x285c7c3e, + 0x29e98123, 0x204f9a98, 0x21fa6785, 0x232460a2, 0x22919dbf, + 0x26986eec, 0x272d93f1, 0x25f394d6, 0x244669cb, 0x6d7f4740, + 0x6ccaba5d, 0x6e14bd7a, 0x6fa14067, 0x6ba8b334, 0x6a1d4e29, + 0x68c3490e, 0x6976b413, 0x60d0afa8, 0x616552b5, 0x63bb5592, + 0x620ea88f, 0x66075bdc, 0x67b2a6c1, 0x656ca1e6, 0x64d95cfb, + 0x76209690, 0x77956b8d, 0x754b6caa, 0x74fe91b7, 0x70f762e4, + 0x71429ff9, 0x739c98de, 0x722965c3, 0x7b8f7e78, 0x7a3a8365, + 0x78e48442, 0x7951795f, 0x7d588a0c, 0x7ced7711, 0x7e337036, + 0x7f868d2b, 0x5bc0e4e0, 0x5a7519fd, 0x58ab1eda, 0x591ee3c7, + 0x5d171094, 0x5ca2ed89, 0x5e7ceaae, 0x5fc917b3, 0x566f0c08, + 0x57daf115, 0x5504f632, 0x54b10b2f, 0x50b8f87c, 0x510d0561, + 0x53d30246, 0x5266ff5b, 0x409f3530, 0x412ac82d, 0x43f4cf0a, + 0x42413217, 0x4648c144, 0x47fd3c59, 0x45233b7e, 0x4496c663, + 0x4d30ddd8, 0x4c8520c5, 0x4e5b27e2, 0x4feedaff, 0x4be729ac, + 0x4a52d4b1, 0x488cd396, 0x49392e8b, 0xdafe8e80, 0xdb4b739d, + 0xd99574ba, 0xd82089a7, 0xdc297af4, 0xdd9c87e9, 0xdf4280ce, + 0xdef77dd3, 0xd7516668, 0xd6e49b75, 0xd43a9c52, 0xd58f614f, + 0xd186921c, 0xd0336f01, 0xd2ed6826, 0xd358953b, 0xc1a15f50, + 0xc014a24d, 0xc2caa56a, 0xc37f5877, 0xc776ab24, 0xc6c35639, + 0xc41d511e, 0xc5a8ac03, 0xcc0eb7b8, 0xcdbb4aa5, 0xcf654d82, + 0xced0b09f, 0xcad943cc, 0xcb6cbed1, 0xc9b2b9f6, 0xc80744eb, + 0xec412d20, 0xedf4d03d, 0xef2ad71a, 0xee9f2a07, 0xea96d954, + 0xeb232449, 0xe9fd236e, 0xe848de73, 0xe1eec5c8, 0xe05b38d5, + 0xe2853ff2, 0xe330c2ef, 0xe73931bc, 0xe68ccca1, 0xe452cb86, + 0xe5e7369b, 0xf71efcf0, 0xf6ab01ed, 0xf47506ca, 0xf5c0fbd7, + 0xf1c90884, 0xf07cf599, 0xf2a2f2be, 0xf3170fa3, 0xfab11418, + 0xfb04e905, 0xf9daee22, 0xf86f133f, 0xfc66e06c, 0xfdd31d71, + 0xff0d1a56, 0xfeb8e74b, 0xb781c9c0, 0xb63434dd, 0xb4ea33fa, + 0xb55fcee7, 0xb1563db4, 0xb0e3c0a9, 0xb23dc78e, 0xb3883a93, + 0xba2e2128, 0xbb9bdc35, 0xb945db12, 0xb8f0260f, 0xbcf9d55c, + 0xbd4c2841, 0xbf922f66, 0xbe27d27b, 0xacde1810, 0xad6be50d, + 0xafb5e22a, 0xae001f37, 0xaa09ec64, 0xabbc1179, 0xa962165e, + 0xa8d7eb43, 0xa171f0f8, 0xa0c40de5, 0xa21a0ac2, 0xa3aff7df, + 0xa7a6048c, 0xa613f991, 0xa4cdfeb6, 0xa57803ab, 0x813e6a60, + 0x808b977d, 0x8255905a, 0x83e06d47, 0x87e99e14, 0x865c6309, + 0x8482642e, 0x85379933, 0x8c918288, 0x8d247f95, 0x8ffa78b2, + 0x8e4f85af, 0x8a4676fc, 0x8bf38be1, 0x892d8cc6, 0x889871db, + 0x9a61bbb0, 0x9bd446ad, 0x990a418a, 0x98bfbc97, 0x9cb64fc4, + 0x9d03b2d9, 0x9fddb5fe, 0x9e6848e3, 0x97ce5358, 0x967bae45, + 0x94a5a962, 0x9510547f, 0x9119a72c, 0x90ac5a31, 0x92725d16, + 0x93c7a00b}, + {0x00000000, 0x6e8c1b41, 0xdd183682, 0xb3942dc3, 0x61416b45, + 0x0fcd7004, 0xbc595dc7, 0xd2d54686, 0xc282d68a, 0xac0ecdcb, + 0x1f9ae008, 0x7116fb49, 0xa3c3bdcf, 0xcd4fa68e, 0x7edb8b4d, + 0x1057900c, 0x5e74ab55, 0x30f8b014, 0x836c9dd7, 0xede08696, + 0x3f35c010, 0x51b9db51, 0xe22df692, 0x8ca1edd3, 0x9cf67ddf, + 0xf27a669e, 0x41ee4b5d, 0x2f62501c, 0xfdb7169a, 0x933b0ddb, + 0x20af2018, 0x4e233b59, 0xbce956aa, 0xd2654deb, 0x61f16028, + 0x0f7d7b69, 0xdda83def, 0xb32426ae, 0x00b00b6d, 0x6e3c102c, + 0x7e6b8020, 0x10e79b61, 0xa373b6a2, 0xcdffade3, 0x1f2aeb65, + 0x71a6f024, 0xc232dde7, 0xacbec6a6, 0xe29dfdff, 0x8c11e6be, + 0x3f85cb7d, 0x5109d03c, 0x83dc96ba, 0xed508dfb, 0x5ec4a038, + 0x3048bb79, 0x201f2b75, 0x4e933034, 0xfd071df7, 0x938b06b6, + 0x415e4030, 0x2fd25b71, 0x9c4676b2, 0xf2ca6df3, 0xa2a3ab15, + 0xcc2fb054, 0x7fbb9d97, 0x113786d6, 0xc3e2c050, 0xad6edb11, + 0x1efaf6d2, 0x7076ed93, 0x60217d9f, 0x0ead66de, 0xbd394b1d, + 0xd3b5505c, 0x016016da, 0x6fec0d9b, 0xdc782058, 0xb2f43b19, + 0xfcd70040, 0x925b1b01, 0x21cf36c2, 0x4f432d83, 0x9d966b05, + 0xf31a7044, 0x408e5d87, 0x2e0246c6, 0x3e55d6ca, 0x50d9cd8b, + 0xe34de048, 0x8dc1fb09, 0x5f14bd8f, 0x3198a6ce, 0x820c8b0d, + 0xec80904c, 0x1e4afdbf, 0x70c6e6fe, 0xc352cb3d, 0xadded07c, + 0x7f0b96fa, 0x11878dbb, 0xa213a078, 0xcc9fbb39, 0xdcc82b35, + 0xb2443074, 0x01d01db7, 0x6f5c06f6, 0xbd894070, 0xd3055b31, + 0x609176f2, 0x0e1d6db3, 0x403e56ea, 0x2eb24dab, 0x9d266068, + 0xf3aa7b29, 0x217f3daf, 0x4ff326ee, 0xfc670b2d, 0x92eb106c, + 0x82bc8060, 0xec309b21, 0x5fa4b6e2, 0x3128ada3, 0xe3fdeb25, + 0x8d71f064, 0x3ee5dda7, 0x5069c6e6, 0x9e36506b, 0xf0ba4b2a, + 0x432e66e9, 0x2da27da8, 0xff773b2e, 0x91fb206f, 0x226f0dac, + 0x4ce316ed, 0x5cb486e1, 0x32389da0, 0x81acb063, 0xef20ab22, + 0x3df5eda4, 0x5379f6e5, 0xe0eddb26, 0x8e61c067, 0xc042fb3e, + 0xaecee07f, 0x1d5acdbc, 0x73d6d6fd, 0xa103907b, 0xcf8f8b3a, + 0x7c1ba6f9, 0x1297bdb8, 0x02c02db4, 0x6c4c36f5, 0xdfd81b36, + 0xb1540077, 0x638146f1, 0x0d0d5db0, 0xbe997073, 0xd0156b32, + 0x22df06c1, 0x4c531d80, 0xffc73043, 0x914b2b02, 0x439e6d84, + 0x2d1276c5, 0x9e865b06, 0xf00a4047, 0xe05dd04b, 0x8ed1cb0a, + 0x3d45e6c9, 0x53c9fd88, 0x811cbb0e, 0xef90a04f, 0x5c048d8c, + 0x328896cd, 0x7cabad94, 0x1227b6d5, 0xa1b39b16, 0xcf3f8057, + 0x1deac6d1, 0x7366dd90, 0xc0f2f053, 0xae7eeb12, 0xbe297b1e, + 0xd0a5605f, 0x63314d9c, 0x0dbd56dd, 0xdf68105b, 0xb1e40b1a, + 0x027026d9, 0x6cfc3d98, 0x3c95fb7e, 0x5219e03f, 0xe18dcdfc, + 0x8f01d6bd, 0x5dd4903b, 0x33588b7a, 0x80cca6b9, 0xee40bdf8, + 0xfe172df4, 0x909b36b5, 0x230f1b76, 0x4d830037, 0x9f5646b1, + 0xf1da5df0, 0x424e7033, 0x2cc26b72, 0x62e1502b, 0x0c6d4b6a, + 0xbff966a9, 0xd1757de8, 0x03a03b6e, 0x6d2c202f, 0xdeb80dec, + 0xb03416ad, 0xa06386a1, 0xceef9de0, 0x7d7bb023, 0x13f7ab62, + 0xc122ede4, 0xafaef6a5, 0x1c3adb66, 0x72b6c027, 0x807cadd4, + 0xeef0b695, 0x5d649b56, 0x33e88017, 0xe13dc691, 0x8fb1ddd0, + 0x3c25f013, 0x52a9eb52, 0x42fe7b5e, 0x2c72601f, 0x9fe64ddc, + 0xf16a569d, 0x23bf101b, 0x4d330b5a, 0xfea72699, 0x902b3dd8, + 0xde080681, 0xb0841dc0, 0x03103003, 0x6d9c2b42, 0xbf496dc4, + 0xd1c57685, 0x62515b46, 0x0cdd4007, 0x1c8ad00b, 0x7206cb4a, + 0xc192e689, 0xaf1efdc8, 0x7dcbbb4e, 0x1347a00f, 0xa0d38dcc, + 0xce5f968d}, + {0x00000000, 0xe71da697, 0x154a4b6f, 0xf257edf8, 0x2a9496de, + 0xcd893049, 0x3fdeddb1, 0xd8c37b26, 0x55292dbc, 0xb2348b2b, + 0x406366d3, 0xa77ec044, 0x7fbdbb62, 0x98a01df5, 0x6af7f00d, + 0x8dea569a, 0xaa525b78, 0x4d4ffdef, 0xbf181017, 0x5805b680, + 0x80c6cda6, 0x67db6b31, 0x958c86c9, 0x7291205e, 0xff7b76c4, + 0x1866d053, 0xea313dab, 0x0d2c9b3c, 0xd5efe01a, 0x32f2468d, + 0xc0a5ab75, 0x27b80de2, 0x8fd5b0b1, 0x68c81626, 0x9a9ffbde, + 0x7d825d49, 0xa541266f, 0x425c80f8, 0xb00b6d00, 0x5716cb97, + 0xdafc9d0d, 0x3de13b9a, 0xcfb6d662, 0x28ab70f5, 0xf0680bd3, + 0x1775ad44, 0xe52240bc, 0x023fe62b, 0x2587ebc9, 0xc29a4d5e, + 0x30cda0a6, 0xd7d00631, 0x0f137d17, 0xe80edb80, 0x1a593678, + 0xfd4490ef, 0x70aec675, 0x97b360e2, 0x65e48d1a, 0x82f92b8d, + 0x5a3a50ab, 0xbd27f63c, 0x4f701bc4, 0xa86dbd53, 0xc4da6723, + 0x23c7c1b4, 0xd1902c4c, 0x368d8adb, 0xee4ef1fd, 0x0953576a, + 0xfb04ba92, 0x1c191c05, 0x91f34a9f, 0x76eeec08, 0x84b901f0, + 0x63a4a767, 0xbb67dc41, 0x5c7a7ad6, 0xae2d972e, 0x493031b9, + 0x6e883c5b, 0x89959acc, 0x7bc27734, 0x9cdfd1a3, 0x441caa85, + 0xa3010c12, 0x5156e1ea, 0xb64b477d, 0x3ba111e7, 0xdcbcb770, + 0x2eeb5a88, 0xc9f6fc1f, 0x11358739, 0xf62821ae, 0x047fcc56, + 0xe3626ac1, 0x4b0fd792, 0xac127105, 0x5e459cfd, 0xb9583a6a, + 0x619b414c, 0x8686e7db, 0x74d10a23, 0x93ccacb4, 0x1e26fa2e, + 0xf93b5cb9, 0x0b6cb141, 0xec7117d6, 0x34b26cf0, 0xd3afca67, + 0x21f8279f, 0xc6e58108, 0xe15d8cea, 0x06402a7d, 0xf417c785, + 0x130a6112, 0xcbc91a34, 0x2cd4bca3, 0xde83515b, 0x399ef7cc, + 0xb474a156, 0x536907c1, 0xa13eea39, 0x46234cae, 0x9ee03788, + 0x79fd911f, 0x8baa7ce7, 0x6cb7da70, 0x52c5c807, 0xb5d86e90, + 0x478f8368, 0xa09225ff, 0x78515ed9, 0x9f4cf84e, 0x6d1b15b6, + 0x8a06b321, 0x07ece5bb, 0xe0f1432c, 0x12a6aed4, 0xf5bb0843, + 0x2d787365, 0xca65d5f2, 0x3832380a, 0xdf2f9e9d, 0xf897937f, + 0x1f8a35e8, 0xedddd810, 0x0ac07e87, 0xd20305a1, 0x351ea336, + 0xc7494ece, 0x2054e859, 0xadbebec3, 0x4aa31854, 0xb8f4f5ac, + 0x5fe9533b, 0x872a281d, 0x60378e8a, 0x92606372, 0x757dc5e5, + 0xdd1078b6, 0x3a0dde21, 0xc85a33d9, 0x2f47954e, 0xf784ee68, + 0x109948ff, 0xe2cea507, 0x05d30390, 0x8839550a, 0x6f24f39d, + 0x9d731e65, 0x7a6eb8f2, 0xa2adc3d4, 0x45b06543, 0xb7e788bb, + 0x50fa2e2c, 0x774223ce, 0x905f8559, 0x620868a1, 0x8515ce36, + 0x5dd6b510, 0xbacb1387, 0x489cfe7f, 0xaf8158e8, 0x226b0e72, + 0xc576a8e5, 0x3721451d, 0xd03ce38a, 0x08ff98ac, 0xefe23e3b, + 0x1db5d3c3, 0xfaa87554, 0x961faf24, 0x710209b3, 0x8355e44b, + 0x644842dc, 0xbc8b39fa, 0x5b969f6d, 0xa9c17295, 0x4edcd402, + 0xc3368298, 0x242b240f, 0xd67cc9f7, 0x31616f60, 0xe9a21446, + 0x0ebfb2d1, 0xfce85f29, 0x1bf5f9be, 0x3c4df45c, 0xdb5052cb, + 0x2907bf33, 0xce1a19a4, 0x16d96282, 0xf1c4c415, 0x039329ed, + 0xe48e8f7a, 0x6964d9e0, 0x8e797f77, 0x7c2e928f, 0x9b333418, + 0x43f04f3e, 0xa4ede9a9, 0x56ba0451, 0xb1a7a2c6, 0x19ca1f95, + 0xfed7b902, 0x0c8054fa, 0xeb9df26d, 0x335e894b, 0xd4432fdc, + 0x2614c224, 0xc10964b3, 0x4ce33229, 0xabfe94be, 0x59a97946, + 0xbeb4dfd1, 0x6677a4f7, 0x816a0260, 0x733def98, 0x9420490f, + 0xb39844ed, 0x5485e27a, 0xa6d20f82, 0x41cfa915, 0x990cd233, + 0x7e1174a4, 0x8c46995c, 0x6b5b3fcb, 0xe6b16951, 0x01accfc6, + 0xf3fb223e, 0x14e684a9, 0xcc25ff8f, 0x2b385918, 0xd96fb4e0, + 0x3e721277}, + {0x00000000, 0xa58b900e, 0x9066265d, 0x35edb653, 0xfbbd4afb, + 0x5e36daf5, 0x6bdb6ca6, 0xce50fca8, 0x2c0b93b7, 0x898003b9, + 0xbc6db5ea, 0x19e625e4, 0xd7b6d94c, 0x723d4942, 0x47d0ff11, + 0xe25b6f1f, 0x5817276e, 0xfd9cb760, 0xc8710133, 0x6dfa913d, + 0xa3aa6d95, 0x0621fd9b, 0x33cc4bc8, 0x9647dbc6, 0x741cb4d9, + 0xd19724d7, 0xe47a9284, 0x41f1028a, 0x8fa1fe22, 0x2a2a6e2c, + 0x1fc7d87f, 0xba4c4871, 0xb02e4edc, 0x15a5ded2, 0x20486881, + 0x85c3f88f, 0x4b930427, 0xee189429, 0xdbf5227a, 0x7e7eb274, + 0x9c25dd6b, 0x39ae4d65, 0x0c43fb36, 0xa9c86b38, 0x67989790, + 0xc213079e, 0xf7feb1cd, 0x527521c3, 0xe83969b2, 0x4db2f9bc, + 0x785f4fef, 0xddd4dfe1, 0x13842349, 0xb60fb347, 0x83e20514, + 0x2669951a, 0xc432fa05, 0x61b96a0b, 0x5454dc58, 0xf1df4c56, + 0x3f8fb0fe, 0x9a0420f0, 0xafe996a3, 0x0a6206ad, 0xbb2d9bf9, + 0x1ea60bf7, 0x2b4bbda4, 0x8ec02daa, 0x4090d102, 0xe51b410c, + 0xd0f6f75f, 0x757d6751, 0x9726084e, 0x32ad9840, 0x07402e13, + 0xa2cbbe1d, 0x6c9b42b5, 0xc910d2bb, 0xfcfd64e8, 0x5976f4e6, + 0xe33abc97, 0x46b12c99, 0x735c9aca, 0xd6d70ac4, 0x1887f66c, + 0xbd0c6662, 0x88e1d031, 0x2d6a403f, 0xcf312f20, 0x6ababf2e, + 0x5f57097d, 0xfadc9973, 0x348c65db, 0x9107f5d5, 0xa4ea4386, + 0x0161d388, 0x0b03d525, 0xae88452b, 0x9b65f378, 0x3eee6376, + 0xf0be9fde, 0x55350fd0, 0x60d8b983, 0xc553298d, 0x27084692, + 0x8283d69c, 0xb76e60cf, 0x12e5f0c1, 0xdcb50c69, 0x793e9c67, + 0x4cd32a34, 0xe958ba3a, 0x5314f24b, 0xf69f6245, 0xc372d416, + 0x66f94418, 0xa8a9b8b0, 0x0d2228be, 0x38cf9eed, 0x9d440ee3, + 0x7f1f61fc, 0xda94f1f2, 0xef7947a1, 0x4af2d7af, 0x84a22b07, + 0x2129bb09, 0x14c40d5a, 0xb14f9d54, 0xad2a31b3, 0x08a1a1bd, + 0x3d4c17ee, 0x98c787e0, 0x56977b48, 0xf31ceb46, 0xc6f15d15, + 0x637acd1b, 0x8121a204, 0x24aa320a, 0x11478459, 0xb4cc1457, + 0x7a9ce8ff, 0xdf1778f1, 0xeafacea2, 0x4f715eac, 0xf53d16dd, + 0x50b686d3, 0x655b3080, 0xc0d0a08e, 0x0e805c26, 0xab0bcc28, + 0x9ee67a7b, 0x3b6dea75, 0xd936856a, 0x7cbd1564, 0x4950a337, + 0xecdb3339, 0x228bcf91, 0x87005f9f, 0xb2ede9cc, 0x176679c2, + 0x1d047f6f, 0xb88fef61, 0x8d625932, 0x28e9c93c, 0xe6b93594, + 0x4332a59a, 0x76df13c9, 0xd35483c7, 0x310fecd8, 0x94847cd6, + 0xa169ca85, 0x04e25a8b, 0xcab2a623, 0x6f39362d, 0x5ad4807e, + 0xff5f1070, 0x45135801, 0xe098c80f, 0xd5757e5c, 0x70feee52, + 0xbeae12fa, 0x1b2582f4, 0x2ec834a7, 0x8b43a4a9, 0x6918cbb6, + 0xcc935bb8, 0xf97eedeb, 0x5cf57de5, 0x92a5814d, 0x372e1143, + 0x02c3a710, 0xa748371e, 0x1607aa4a, 0xb38c3a44, 0x86618c17, + 0x23ea1c19, 0xedbae0b1, 0x483170bf, 0x7ddcc6ec, 0xd85756e2, + 0x3a0c39fd, 0x9f87a9f3, 0xaa6a1fa0, 0x0fe18fae, 0xc1b17306, + 0x643ae308, 0x51d7555b, 0xf45cc555, 0x4e108d24, 0xeb9b1d2a, + 0xde76ab79, 0x7bfd3b77, 0xb5adc7df, 0x102657d1, 0x25cbe182, + 0x8040718c, 0x621b1e93, 0xc7908e9d, 0xf27d38ce, 0x57f6a8c0, + 0x99a65468, 0x3c2dc466, 0x09c07235, 0xac4be23b, 0xa629e496, + 0x03a27498, 0x364fc2cb, 0x93c452c5, 0x5d94ae6d, 0xf81f3e63, + 0xcdf28830, 0x6879183e, 0x8a227721, 0x2fa9e72f, 0x1a44517c, + 0xbfcfc172, 0x719f3dda, 0xd414add4, 0xe1f91b87, 0x44728b89, + 0xfe3ec3f8, 0x5bb553f6, 0x6e58e5a5, 0xcbd375ab, 0x05838903, + 0xa008190d, 0x95e5af5e, 0x306e3f50, 0xd235504f, 0x77bec041, + 0x42537612, 0xe7d8e61c, 0x29881ab4, 0x8c038aba, 0xb9ee3ce9, + 0x1c65ace7}}; + +local const z_word_t FAR crc_braid_big_table[][256] = { + {0x0000000000000000, 0x0e908ba500000000, 0x5d26669000000000, + 0x53b6ed3500000000, 0xfb4abdfb00000000, 0xf5da365e00000000, + 0xa66cdb6b00000000, 0xa8fc50ce00000000, 0xb7930b2c00000000, + 0xb903808900000000, 0xeab56dbc00000000, 0xe425e61900000000, + 0x4cd9b6d700000000, 0x42493d7200000000, 0x11ffd04700000000, + 0x1f6f5be200000000, 0x6e27175800000000, 0x60b79cfd00000000, + 0x330171c800000000, 0x3d91fa6d00000000, 0x956daaa300000000, + 0x9bfd210600000000, 0xc84bcc3300000000, 0xc6db479600000000, + 0xd9b41c7400000000, 0xd72497d100000000, 0x84927ae400000000, + 0x8a02f14100000000, 0x22fea18f00000000, 0x2c6e2a2a00000000, + 0x7fd8c71f00000000, 0x71484cba00000000, 0xdc4e2eb000000000, + 0xd2dea51500000000, 0x8168482000000000, 0x8ff8c38500000000, + 0x2704934b00000000, 0x299418ee00000000, 0x7a22f5db00000000, + 0x74b27e7e00000000, 0x6bdd259c00000000, 0x654dae3900000000, + 0x36fb430c00000000, 0x386bc8a900000000, 0x9097986700000000, + 0x9e0713c200000000, 0xcdb1fef700000000, 0xc321755200000000, + 0xb26939e800000000, 0xbcf9b24d00000000, 0xef4f5f7800000000, + 0xe1dfd4dd00000000, 0x4923841300000000, 0x47b30fb600000000, + 0x1405e28300000000, 0x1a95692600000000, 0x05fa32c400000000, + 0x0b6ab96100000000, 0x58dc545400000000, 0x564cdff100000000, + 0xfeb08f3f00000000, 0xf020049a00000000, 0xa396e9af00000000, + 0xad06620a00000000, 0xf99b2dbb00000000, 0xf70ba61e00000000, + 0xa4bd4b2b00000000, 0xaa2dc08e00000000, 0x02d1904000000000, + 0x0c411be500000000, 0x5ff7f6d000000000, 0x51677d7500000000, + 0x4e08269700000000, 0x4098ad3200000000, 0x132e400700000000, + 0x1dbecba200000000, 0xb5429b6c00000000, 0xbbd210c900000000, + 0xe864fdfc00000000, 0xe6f4765900000000, 0x97bc3ae300000000, + 0x992cb14600000000, 0xca9a5c7300000000, 0xc40ad7d600000000, + 0x6cf6871800000000, 0x62660cbd00000000, 0x31d0e18800000000, + 0x3f406a2d00000000, 0x202f31cf00000000, 0x2ebfba6a00000000, + 0x7d09575f00000000, 0x7399dcfa00000000, 0xdb658c3400000000, + 0xd5f5079100000000, 0x8643eaa400000000, 0x88d3610100000000, + 0x25d5030b00000000, 0x2b4588ae00000000, 0x78f3659b00000000, + 0x7663ee3e00000000, 0xde9fbef000000000, 0xd00f355500000000, + 0x83b9d86000000000, 0x8d2953c500000000, 0x9246082700000000, + 0x9cd6838200000000, 0xcf606eb700000000, 0xc1f0e51200000000, + 0x690cb5dc00000000, 0x679c3e7900000000, 0x342ad34c00000000, + 0x3aba58e900000000, 0x4bf2145300000000, 0x45629ff600000000, + 0x16d472c300000000, 0x1844f96600000000, 0xb0b8a9a800000000, + 0xbe28220d00000000, 0xed9ecf3800000000, 0xe30e449d00000000, + 0xfc611f7f00000000, 0xf2f194da00000000, 0xa14779ef00000000, + 0xafd7f24a00000000, 0x072ba28400000000, 0x09bb292100000000, + 0x5a0dc41400000000, 0x549d4fb100000000, 0xb3312aad00000000, + 0xbda1a10800000000, 0xee174c3d00000000, 0xe087c79800000000, + 0x487b975600000000, 0x46eb1cf300000000, 0x155df1c600000000, + 0x1bcd7a6300000000, 0x04a2218100000000, 0x0a32aa2400000000, + 0x5984471100000000, 0x5714ccb400000000, 0xffe89c7a00000000, + 0xf17817df00000000, 0xa2cefaea00000000, 0xac5e714f00000000, + 0xdd163df500000000, 0xd386b65000000000, 0x80305b6500000000, + 0x8ea0d0c000000000, 0x265c800e00000000, 0x28cc0bab00000000, + 0x7b7ae69e00000000, 0x75ea6d3b00000000, 0x6a8536d900000000, + 0x6415bd7c00000000, 0x37a3504900000000, 0x3933dbec00000000, + 0x91cf8b2200000000, 0x9f5f008700000000, 0xcce9edb200000000, + 0xc279661700000000, 0x6f7f041d00000000, 0x61ef8fb800000000, + 0x3259628d00000000, 0x3cc9e92800000000, 0x9435b9e600000000, + 0x9aa5324300000000, 0xc913df7600000000, 0xc78354d300000000, + 0xd8ec0f3100000000, 0xd67c849400000000, 0x85ca69a100000000, + 0x8b5ae20400000000, 0x23a6b2ca00000000, 0x2d36396f00000000, + 0x7e80d45a00000000, 0x70105fff00000000, 0x0158134500000000, + 0x0fc898e000000000, 0x5c7e75d500000000, 0x52eefe7000000000, + 0xfa12aebe00000000, 0xf482251b00000000, 0xa734c82e00000000, + 0xa9a4438b00000000, 0xb6cb186900000000, 0xb85b93cc00000000, + 0xebed7ef900000000, 0xe57df55c00000000, 0x4d81a59200000000, + 0x43112e3700000000, 0x10a7c30200000000, 0x1e3748a700000000, + 0x4aaa071600000000, 0x443a8cb300000000, 0x178c618600000000, + 0x191cea2300000000, 0xb1e0baed00000000, 0xbf70314800000000, + 0xecc6dc7d00000000, 0xe25657d800000000, 0xfd390c3a00000000, + 0xf3a9879f00000000, 0xa01f6aaa00000000, 0xae8fe10f00000000, + 0x0673b1c100000000, 0x08e33a6400000000, 0x5b55d75100000000, + 0x55c55cf400000000, 0x248d104e00000000, 0x2a1d9beb00000000, + 0x79ab76de00000000, 0x773bfd7b00000000, 0xdfc7adb500000000, + 0xd157261000000000, 0x82e1cb2500000000, 0x8c71408000000000, + 0x931e1b6200000000, 0x9d8e90c700000000, 0xce387df200000000, + 0xc0a8f65700000000, 0x6854a69900000000, 0x66c42d3c00000000, + 0x3572c00900000000, 0x3be24bac00000000, 0x96e429a600000000, + 0x9874a20300000000, 0xcbc24f3600000000, 0xc552c49300000000, + 0x6dae945d00000000, 0x633e1ff800000000, 0x3088f2cd00000000, + 0x3e18796800000000, 0x2177228a00000000, 0x2fe7a92f00000000, + 0x7c51441a00000000, 0x72c1cfbf00000000, 0xda3d9f7100000000, + 0xd4ad14d400000000, 0x871bf9e100000000, 0x898b724400000000, + 0xf8c33efe00000000, 0xf653b55b00000000, 0xa5e5586e00000000, + 0xab75d3cb00000000, 0x0389830500000000, 0x0d1908a000000000, + 0x5eafe59500000000, 0x503f6e3000000000, 0x4f5035d200000000, + 0x41c0be7700000000, 0x1276534200000000, 0x1ce6d8e700000000, + 0xb41a882900000000, 0xba8a038c00000000, 0xe93ceeb900000000, + 0xe7ac651c00000000}, + {0x0000000000000000, 0x97a61de700000000, 0x6f4b4a1500000000, + 0xf8ed57f200000000, 0xde96942a00000000, 0x493089cd00000000, + 0xb1ddde3f00000000, 0x267bc3d800000000, 0xbc2d295500000000, + 0x2b8b34b200000000, 0xd366634000000000, 0x44c07ea700000000, + 0x62bbbd7f00000000, 0xf51da09800000000, 0x0df0f76a00000000, + 0x9a56ea8d00000000, 0x785b52aa00000000, 0xeffd4f4d00000000, + 0x171018bf00000000, 0x80b6055800000000, 0xa6cdc68000000000, + 0x316bdb6700000000, 0xc9868c9500000000, 0x5e20917200000000, + 0xc4767bff00000000, 0x53d0661800000000, 0xab3d31ea00000000, + 0x3c9b2c0d00000000, 0x1ae0efd500000000, 0x8d46f23200000000, + 0x75aba5c000000000, 0xe20db82700000000, 0xb1b0d58f00000000, + 0x2616c86800000000, 0xdefb9f9a00000000, 0x495d827d00000000, + 0x6f2641a500000000, 0xf8805c4200000000, 0x006d0bb000000000, + 0x97cb165700000000, 0x0d9dfcda00000000, 0x9a3be13d00000000, + 0x62d6b6cf00000000, 0xf570ab2800000000, 0xd30b68f000000000, + 0x44ad751700000000, 0xbc4022e500000000, 0x2be63f0200000000, + 0xc9eb872500000000, 0x5e4d9ac200000000, 0xa6a0cd3000000000, + 0x3106d0d700000000, 0x177d130f00000000, 0x80db0ee800000000, + 0x7836591a00000000, 0xef9044fd00000000, 0x75c6ae7000000000, + 0xe260b39700000000, 0x1a8de46500000000, 0x8d2bf98200000000, + 0xab503a5a00000000, 0x3cf627bd00000000, 0xc41b704f00000000, + 0x53bd6da800000000, 0x2367dac400000000, 0xb4c1c72300000000, + 0x4c2c90d100000000, 0xdb8a8d3600000000, 0xfdf14eee00000000, + 0x6a57530900000000, 0x92ba04fb00000000, 0x051c191c00000000, + 0x9f4af39100000000, 0x08ecee7600000000, 0xf001b98400000000, + 0x67a7a46300000000, 0x41dc67bb00000000, 0xd67a7a5c00000000, + 0x2e972dae00000000, 0xb931304900000000, 0x5b3c886e00000000, + 0xcc9a958900000000, 0x3477c27b00000000, 0xa3d1df9c00000000, + 0x85aa1c4400000000, 0x120c01a300000000, 0xeae1565100000000, + 0x7d474bb600000000, 0xe711a13b00000000, 0x70b7bcdc00000000, + 0x885aeb2e00000000, 0x1ffcf6c900000000, 0x3987351100000000, + 0xae2128f600000000, 0x56cc7f0400000000, 0xc16a62e300000000, + 0x92d70f4b00000000, 0x057112ac00000000, 0xfd9c455e00000000, + 0x6a3a58b900000000, 0x4c419b6100000000, 0xdbe7868600000000, + 0x230ad17400000000, 0xb4accc9300000000, 0x2efa261e00000000, + 0xb95c3bf900000000, 0x41b16c0b00000000, 0xd61771ec00000000, + 0xf06cb23400000000, 0x67caafd300000000, 0x9f27f82100000000, + 0x0881e5c600000000, 0xea8c5de100000000, 0x7d2a400600000000, + 0x85c717f400000000, 0x12610a1300000000, 0x341ac9cb00000000, + 0xa3bcd42c00000000, 0x5b5183de00000000, 0xccf79e3900000000, + 0x56a174b400000000, 0xc107695300000000, 0x39ea3ea100000000, + 0xae4c234600000000, 0x8837e09e00000000, 0x1f91fd7900000000, + 0xe77caa8b00000000, 0x70dab76c00000000, 0x07c8c55200000000, + 0x906ed8b500000000, 0x68838f4700000000, 0xff2592a000000000, + 0xd95e517800000000, 0x4ef84c9f00000000, 0xb6151b6d00000000, + 0x21b3068a00000000, 0xbbe5ec0700000000, 0x2c43f1e000000000, + 0xd4aea61200000000, 0x4308bbf500000000, 0x6573782d00000000, + 0xf2d565ca00000000, 0x0a38323800000000, 0x9d9e2fdf00000000, + 0x7f9397f800000000, 0xe8358a1f00000000, 0x10d8dded00000000, + 0x877ec00a00000000, 0xa10503d200000000, 0x36a31e3500000000, + 0xce4e49c700000000, 0x59e8542000000000, 0xc3bebead00000000, + 0x5418a34a00000000, 0xacf5f4b800000000, 0x3b53e95f00000000, + 0x1d282a8700000000, 0x8a8e376000000000, 0x7263609200000000, + 0xe5c57d7500000000, 0xb67810dd00000000, 0x21de0d3a00000000, + 0xd9335ac800000000, 0x4e95472f00000000, 0x68ee84f700000000, + 0xff48991000000000, 0x07a5cee200000000, 0x9003d30500000000, + 0x0a55398800000000, 0x9df3246f00000000, 0x651e739d00000000, + 0xf2b86e7a00000000, 0xd4c3ada200000000, 0x4365b04500000000, + 0xbb88e7b700000000, 0x2c2efa5000000000, 0xce23427700000000, + 0x59855f9000000000, 0xa168086200000000, 0x36ce158500000000, + 0x10b5d65d00000000, 0x8713cbba00000000, 0x7ffe9c4800000000, + 0xe85881af00000000, 0x720e6b2200000000, 0xe5a876c500000000, + 0x1d45213700000000, 0x8ae33cd000000000, 0xac98ff0800000000, + 0x3b3ee2ef00000000, 0xc3d3b51d00000000, 0x5475a8fa00000000, + 0x24af1f9600000000, 0xb309027100000000, 0x4be4558300000000, + 0xdc42486400000000, 0xfa398bbc00000000, 0x6d9f965b00000000, + 0x9572c1a900000000, 0x02d4dc4e00000000, 0x988236c300000000, + 0x0f242b2400000000, 0xf7c97cd600000000, 0x606f613100000000, + 0x4614a2e900000000, 0xd1b2bf0e00000000, 0x295fe8fc00000000, + 0xbef9f51b00000000, 0x5cf44d3c00000000, 0xcb5250db00000000, + 0x33bf072900000000, 0xa4191ace00000000, 0x8262d91600000000, + 0x15c4c4f100000000, 0xed29930300000000, 0x7a8f8ee400000000, + 0xe0d9646900000000, 0x777f798e00000000, 0x8f922e7c00000000, + 0x1834339b00000000, 0x3e4ff04300000000, 0xa9e9eda400000000, + 0x5104ba5600000000, 0xc6a2a7b100000000, 0x951fca1900000000, + 0x02b9d7fe00000000, 0xfa54800c00000000, 0x6df29deb00000000, + 0x4b895e3300000000, 0xdc2f43d400000000, 0x24c2142600000000, + 0xb36409c100000000, 0x2932e34c00000000, 0xbe94feab00000000, + 0x4679a95900000000, 0xd1dfb4be00000000, 0xf7a4776600000000, + 0x60026a8100000000, 0x98ef3d7300000000, 0x0f49209400000000, + 0xed4498b300000000, 0x7ae2855400000000, 0x820fd2a600000000, + 0x15a9cf4100000000, 0x33d20c9900000000, 0xa474117e00000000, + 0x5c99468c00000000, 0xcb3f5b6b00000000, 0x5169b1e600000000, + 0xc6cfac0100000000, 0x3e22fbf300000000, 0xa984e61400000000, + 0x8fff25cc00000000, 0x1859382b00000000, 0xe0b46fd900000000, + 0x7712723e00000000}, + {0x0000000000000000, 0x411b8c6e00000000, 0x823618dd00000000, + 0xc32d94b300000000, 0x456b416100000000, 0x0470cd0f00000000, + 0xc75d59bc00000000, 0x8646d5d200000000, 0x8ad682c200000000, + 0xcbcd0eac00000000, 0x08e09a1f00000000, 0x49fb167100000000, + 0xcfbdc3a300000000, 0x8ea64fcd00000000, 0x4d8bdb7e00000000, + 0x0c90571000000000, 0x55ab745e00000000, 0x14b0f83000000000, + 0xd79d6c8300000000, 0x9686e0ed00000000, 0x10c0353f00000000, + 0x51dbb95100000000, 0x92f62de200000000, 0xd3eda18c00000000, + 0xdf7df69c00000000, 0x9e667af200000000, 0x5d4bee4100000000, + 0x1c50622f00000000, 0x9a16b7fd00000000, 0xdb0d3b9300000000, + 0x1820af2000000000, 0x593b234e00000000, 0xaa56e9bc00000000, + 0xeb4d65d200000000, 0x2860f16100000000, 0x697b7d0f00000000, + 0xef3da8dd00000000, 0xae2624b300000000, 0x6d0bb00000000000, + 0x2c103c6e00000000, 0x20806b7e00000000, 0x619be71000000000, + 0xa2b673a300000000, 0xe3adffcd00000000, 0x65eb2a1f00000000, + 0x24f0a67100000000, 0xe7dd32c200000000, 0xa6c6beac00000000, + 0xfffd9de200000000, 0xbee6118c00000000, 0x7dcb853f00000000, + 0x3cd0095100000000, 0xba96dc8300000000, 0xfb8d50ed00000000, + 0x38a0c45e00000000, 0x79bb483000000000, 0x752b1f2000000000, + 0x3430934e00000000, 0xf71d07fd00000000, 0xb6068b9300000000, + 0x30405e4100000000, 0x715bd22f00000000, 0xb276469c00000000, + 0xf36dcaf200000000, 0x15aba3a200000000, 0x54b02fcc00000000, + 0x979dbb7f00000000, 0xd686371100000000, 0x50c0e2c300000000, + 0x11db6ead00000000, 0xd2f6fa1e00000000, 0x93ed767000000000, + 0x9f7d216000000000, 0xde66ad0e00000000, 0x1d4b39bd00000000, + 0x5c50b5d300000000, 0xda16600100000000, 0x9b0dec6f00000000, + 0x582078dc00000000, 0x193bf4b200000000, 0x4000d7fc00000000, + 0x011b5b9200000000, 0xc236cf2100000000, 0x832d434f00000000, + 0x056b969d00000000, 0x44701af300000000, 0x875d8e4000000000, + 0xc646022e00000000, 0xcad6553e00000000, 0x8bcdd95000000000, + 0x48e04de300000000, 0x09fbc18d00000000, 0x8fbd145f00000000, + 0xcea6983100000000, 0x0d8b0c8200000000, 0x4c9080ec00000000, + 0xbffd4a1e00000000, 0xfee6c67000000000, 0x3dcb52c300000000, + 0x7cd0dead00000000, 0xfa960b7f00000000, 0xbb8d871100000000, + 0x78a013a200000000, 0x39bb9fcc00000000, 0x352bc8dc00000000, + 0x743044b200000000, 0xb71dd00100000000, 0xf6065c6f00000000, + 0x704089bd00000000, 0x315b05d300000000, 0xf276916000000000, + 0xb36d1d0e00000000, 0xea563e4000000000, 0xab4db22e00000000, + 0x6860269d00000000, 0x297baaf300000000, 0xaf3d7f2100000000, + 0xee26f34f00000000, 0x2d0b67fc00000000, 0x6c10eb9200000000, + 0x6080bc8200000000, 0x219b30ec00000000, 0xe2b6a45f00000000, + 0xa3ad283100000000, 0x25ebfde300000000, 0x64f0718d00000000, + 0xa7dde53e00000000, 0xe6c6695000000000, 0x6b50369e00000000, + 0x2a4bbaf000000000, 0xe9662e4300000000, 0xa87da22d00000000, + 0x2e3b77ff00000000, 0x6f20fb9100000000, 0xac0d6f2200000000, + 0xed16e34c00000000, 0xe186b45c00000000, 0xa09d383200000000, + 0x63b0ac8100000000, 0x22ab20ef00000000, 0xa4edf53d00000000, + 0xe5f6795300000000, 0x26dbede000000000, 0x67c0618e00000000, + 0x3efb42c000000000, 0x7fe0ceae00000000, 0xbccd5a1d00000000, + 0xfdd6d67300000000, 0x7b9003a100000000, 0x3a8b8fcf00000000, + 0xf9a61b7c00000000, 0xb8bd971200000000, 0xb42dc00200000000, + 0xf5364c6c00000000, 0x361bd8df00000000, 0x770054b100000000, + 0xf146816300000000, 0xb05d0d0d00000000, 0x737099be00000000, + 0x326b15d000000000, 0xc106df2200000000, 0x801d534c00000000, + 0x4330c7ff00000000, 0x022b4b9100000000, 0x846d9e4300000000, + 0xc576122d00000000, 0x065b869e00000000, 0x47400af000000000, + 0x4bd05de000000000, 0x0acbd18e00000000, 0xc9e6453d00000000, + 0x88fdc95300000000, 0x0ebb1c8100000000, 0x4fa090ef00000000, + 0x8c8d045c00000000, 0xcd96883200000000, 0x94adab7c00000000, + 0xd5b6271200000000, 0x169bb3a100000000, 0x57803fcf00000000, + 0xd1c6ea1d00000000, 0x90dd667300000000, 0x53f0f2c000000000, + 0x12eb7eae00000000, 0x1e7b29be00000000, 0x5f60a5d000000000, + 0x9c4d316300000000, 0xdd56bd0d00000000, 0x5b1068df00000000, + 0x1a0be4b100000000, 0xd926700200000000, 0x983dfc6c00000000, + 0x7efb953c00000000, 0x3fe0195200000000, 0xfccd8de100000000, + 0xbdd6018f00000000, 0x3b90d45d00000000, 0x7a8b583300000000, + 0xb9a6cc8000000000, 0xf8bd40ee00000000, 0xf42d17fe00000000, + 0xb5369b9000000000, 0x761b0f2300000000, 0x3700834d00000000, + 0xb146569f00000000, 0xf05ddaf100000000, 0x33704e4200000000, + 0x726bc22c00000000, 0x2b50e16200000000, 0x6a4b6d0c00000000, + 0xa966f9bf00000000, 0xe87d75d100000000, 0x6e3ba00300000000, + 0x2f202c6d00000000, 0xec0db8de00000000, 0xad1634b000000000, + 0xa18663a000000000, 0xe09defce00000000, 0x23b07b7d00000000, + 0x62abf71300000000, 0xe4ed22c100000000, 0xa5f6aeaf00000000, + 0x66db3a1c00000000, 0x27c0b67200000000, 0xd4ad7c8000000000, + 0x95b6f0ee00000000, 0x569b645d00000000, 0x1780e83300000000, + 0x91c63de100000000, 0xd0ddb18f00000000, 0x13f0253c00000000, + 0x52eba95200000000, 0x5e7bfe4200000000, 0x1f60722c00000000, + 0xdc4de69f00000000, 0x9d566af100000000, 0x1b10bf2300000000, + 0x5a0b334d00000000, 0x9926a7fe00000000, 0xd83d2b9000000000, + 0x810608de00000000, 0xc01d84b000000000, 0x0330100300000000, + 0x422b9c6d00000000, 0xc46d49bf00000000, 0x8576c5d100000000, + 0x465b516200000000, 0x0740dd0c00000000, 0x0bd08a1c00000000, + 0x4acb067200000000, 0x89e692c100000000, 0xc8fd1eaf00000000, + 0x4ebbcb7d00000000, 0x0fa0471300000000, 0xcc8dd3a000000000, + 0x8d965fce00000000}, + {0x0000000000000000, 0x1dfdb50100000000, 0x3afa6b0300000000, + 0x2707de0200000000, 0x74f4d70600000000, 0x6909620700000000, + 0x4e0ebc0500000000, 0x53f3090400000000, 0xe8e8af0d00000000, + 0xf5151a0c00000000, 0xd212c40e00000000, 0xcfef710f00000000, + 0x9c1c780b00000000, 0x81e1cd0a00000000, 0xa6e6130800000000, + 0xbb1ba60900000000, 0xd0d15f1b00000000, 0xcd2cea1a00000000, + 0xea2b341800000000, 0xf7d6811900000000, 0xa425881d00000000, + 0xb9d83d1c00000000, 0x9edfe31e00000000, 0x8322561f00000000, + 0x3839f01600000000, 0x25c4451700000000, 0x02c39b1500000000, + 0x1f3e2e1400000000, 0x4ccd271000000000, 0x5130921100000000, + 0x76374c1300000000, 0x6bcaf91200000000, 0xa0a3bf3600000000, + 0xbd5e0a3700000000, 0x9a59d43500000000, 0x87a4613400000000, + 0xd457683000000000, 0xc9aadd3100000000, 0xeead033300000000, + 0xf350b63200000000, 0x484b103b00000000, 0x55b6a53a00000000, + 0x72b17b3800000000, 0x6f4cce3900000000, 0x3cbfc73d00000000, + 0x2142723c00000000, 0x0645ac3e00000000, 0x1bb8193f00000000, + 0x7072e02d00000000, 0x6d8f552c00000000, 0x4a888b2e00000000, + 0x57753e2f00000000, 0x0486372b00000000, 0x197b822a00000000, + 0x3e7c5c2800000000, 0x2381e92900000000, 0x989a4f2000000000, + 0x8567fa2100000000, 0xa260242300000000, 0xbf9d912200000000, + 0xec6e982600000000, 0xf1932d2700000000, 0xd694f32500000000, + 0xcb69462400000000, 0x40477f6d00000000, 0x5dbaca6c00000000, + 0x7abd146e00000000, 0x6740a16f00000000, 0x34b3a86b00000000, + 0x294e1d6a00000000, 0x0e49c36800000000, 0x13b4766900000000, + 0xa8afd06000000000, 0xb552656100000000, 0x9255bb6300000000, + 0x8fa80e6200000000, 0xdc5b076600000000, 0xc1a6b26700000000, + 0xe6a16c6500000000, 0xfb5cd96400000000, 0x9096207600000000, + 0x8d6b957700000000, 0xaa6c4b7500000000, 0xb791fe7400000000, + 0xe462f77000000000, 0xf99f427100000000, 0xde989c7300000000, + 0xc365297200000000, 0x787e8f7b00000000, 0x65833a7a00000000, + 0x4284e47800000000, 0x5f79517900000000, 0x0c8a587d00000000, + 0x1177ed7c00000000, 0x3670337e00000000, 0x2b8d867f00000000, + 0xe0e4c05b00000000, 0xfd19755a00000000, 0xda1eab5800000000, + 0xc7e31e5900000000, 0x9410175d00000000, 0x89eda25c00000000, + 0xaeea7c5e00000000, 0xb317c95f00000000, 0x080c6f5600000000, + 0x15f1da5700000000, 0x32f6045500000000, 0x2f0bb15400000000, + 0x7cf8b85000000000, 0x61050d5100000000, 0x4602d35300000000, + 0x5bff665200000000, 0x30359f4000000000, 0x2dc82a4100000000, + 0x0acff44300000000, 0x1732414200000000, 0x44c1484600000000, + 0x593cfd4700000000, 0x7e3b234500000000, 0x63c6964400000000, + 0xd8dd304d00000000, 0xc520854c00000000, 0xe2275b4e00000000, + 0xffdaee4f00000000, 0xac29e74b00000000, 0xb1d4524a00000000, + 0x96d38c4800000000, 0x8b2e394900000000, 0x808efeda00000000, + 0x9d734bdb00000000, 0xba7495d900000000, 0xa78920d800000000, + 0xf47a29dc00000000, 0xe9879cdd00000000, 0xce8042df00000000, + 0xd37df7de00000000, 0x686651d700000000, 0x759be4d600000000, + 0x529c3ad400000000, 0x4f618fd500000000, 0x1c9286d100000000, + 0x016f33d000000000, 0x2668edd200000000, 0x3b9558d300000000, + 0x505fa1c100000000, 0x4da214c000000000, 0x6aa5cac200000000, + 0x77587fc300000000, 0x24ab76c700000000, 0x3956c3c600000000, + 0x1e511dc400000000, 0x03aca8c500000000, 0xb8b70ecc00000000, + 0xa54abbcd00000000, 0x824d65cf00000000, 0x9fb0d0ce00000000, + 0xcc43d9ca00000000, 0xd1be6ccb00000000, 0xf6b9b2c900000000, + 0xeb4407c800000000, 0x202d41ec00000000, 0x3dd0f4ed00000000, + 0x1ad72aef00000000, 0x072a9fee00000000, 0x54d996ea00000000, + 0x492423eb00000000, 0x6e23fde900000000, 0x73de48e800000000, + 0xc8c5eee100000000, 0xd5385be000000000, 0xf23f85e200000000, + 0xefc230e300000000, 0xbc3139e700000000, 0xa1cc8ce600000000, + 0x86cb52e400000000, 0x9b36e7e500000000, 0xf0fc1ef700000000, + 0xed01abf600000000, 0xca0675f400000000, 0xd7fbc0f500000000, + 0x8408c9f100000000, 0x99f57cf000000000, 0xbef2a2f200000000, + 0xa30f17f300000000, 0x1814b1fa00000000, 0x05e904fb00000000, + 0x22eedaf900000000, 0x3f136ff800000000, 0x6ce066fc00000000, + 0x711dd3fd00000000, 0x561a0dff00000000, 0x4be7b8fe00000000, + 0xc0c981b700000000, 0xdd3434b600000000, 0xfa33eab400000000, + 0xe7ce5fb500000000, 0xb43d56b100000000, 0xa9c0e3b000000000, + 0x8ec73db200000000, 0x933a88b300000000, 0x28212eba00000000, + 0x35dc9bbb00000000, 0x12db45b900000000, 0x0f26f0b800000000, + 0x5cd5f9bc00000000, 0x41284cbd00000000, 0x662f92bf00000000, + 0x7bd227be00000000, 0x1018deac00000000, 0x0de56bad00000000, + 0x2ae2b5af00000000, 0x371f00ae00000000, 0x64ec09aa00000000, + 0x7911bcab00000000, 0x5e1662a900000000, 0x43ebd7a800000000, + 0xf8f071a100000000, 0xe50dc4a000000000, 0xc20a1aa200000000, + 0xdff7afa300000000, 0x8c04a6a700000000, 0x91f913a600000000, + 0xb6fecda400000000, 0xab0378a500000000, 0x606a3e8100000000, + 0x7d978b8000000000, 0x5a90558200000000, 0x476de08300000000, + 0x149ee98700000000, 0x09635c8600000000, 0x2e64828400000000, + 0x3399378500000000, 0x8882918c00000000, 0x957f248d00000000, + 0xb278fa8f00000000, 0xaf854f8e00000000, 0xfc76468a00000000, + 0xe18bf38b00000000, 0xc68c2d8900000000, 0xdb71988800000000, + 0xb0bb619a00000000, 0xad46d49b00000000, 0x8a410a9900000000, + 0x97bcbf9800000000, 0xc44fb69c00000000, 0xd9b2039d00000000, + 0xfeb5dd9f00000000, 0xe348689e00000000, 0x5853ce9700000000, + 0x45ae7b9600000000, 0x62a9a59400000000, 0x7f54109500000000, + 0x2ca7199100000000, 0x315aac9000000000, 0x165d729200000000, + 0x0ba0c79300000000}, + {0x0000000000000000, 0x24d9076300000000, 0x48b20fc600000000, + 0x6c6b08a500000000, 0xd1626e5700000000, 0xf5bb693400000000, + 0x99d0619100000000, 0xbd0966f200000000, 0xa2c5dcae00000000, + 0x861cdbcd00000000, 0xea77d36800000000, 0xceaed40b00000000, + 0x73a7b2f900000000, 0x577eb59a00000000, 0x3b15bd3f00000000, + 0x1fccba5c00000000, 0x058dc88600000000, 0x2154cfe500000000, + 0x4d3fc74000000000, 0x69e6c02300000000, 0xd4efa6d100000000, + 0xf036a1b200000000, 0x9c5da91700000000, 0xb884ae7400000000, + 0xa748142800000000, 0x8391134b00000000, 0xeffa1bee00000000, + 0xcb231c8d00000000, 0x762a7a7f00000000, 0x52f37d1c00000000, + 0x3e9875b900000000, 0x1a4172da00000000, 0x4b1ce0d600000000, + 0x6fc5e7b500000000, 0x03aeef1000000000, 0x2777e87300000000, + 0x9a7e8e8100000000, 0xbea789e200000000, 0xd2cc814700000000, + 0xf615862400000000, 0xe9d93c7800000000, 0xcd003b1b00000000, + 0xa16b33be00000000, 0x85b234dd00000000, 0x38bb522f00000000, + 0x1c62554c00000000, 0x70095de900000000, 0x54d05a8a00000000, + 0x4e91285000000000, 0x6a482f3300000000, 0x0623279600000000, + 0x22fa20f500000000, 0x9ff3460700000000, 0xbb2a416400000000, + 0xd74149c100000000, 0xf3984ea200000000, 0xec54f4fe00000000, + 0xc88df39d00000000, 0xa4e6fb3800000000, 0x803ffc5b00000000, + 0x3d369aa900000000, 0x19ef9dca00000000, 0x7584956f00000000, + 0x515d920c00000000, 0xd73eb17600000000, 0xf3e7b61500000000, + 0x9f8cbeb000000000, 0xbb55b9d300000000, 0x065cdf2100000000, + 0x2285d84200000000, 0x4eeed0e700000000, 0x6a37d78400000000, + 0x75fb6dd800000000, 0x51226abb00000000, 0x3d49621e00000000, + 0x1990657d00000000, 0xa499038f00000000, 0x804004ec00000000, + 0xec2b0c4900000000, 0xc8f20b2a00000000, 0xd2b379f000000000, + 0xf66a7e9300000000, 0x9a01763600000000, 0xbed8715500000000, + 0x03d117a700000000, 0x270810c400000000, 0x4b63186100000000, + 0x6fba1f0200000000, 0x7076a55e00000000, 0x54afa23d00000000, + 0x38c4aa9800000000, 0x1c1dadfb00000000, 0xa114cb0900000000, + 0x85cdcc6a00000000, 0xe9a6c4cf00000000, 0xcd7fc3ac00000000, + 0x9c2251a000000000, 0xb8fb56c300000000, 0xd4905e6600000000, + 0xf049590500000000, 0x4d403ff700000000, 0x6999389400000000, + 0x05f2303100000000, 0x212b375200000000, 0x3ee78d0e00000000, + 0x1a3e8a6d00000000, 0x765582c800000000, 0x528c85ab00000000, + 0xef85e35900000000, 0xcb5ce43a00000000, 0xa737ec9f00000000, + 0x83eeebfc00000000, 0x99af992600000000, 0xbd769e4500000000, + 0xd11d96e000000000, 0xf5c4918300000000, 0x48cdf77100000000, + 0x6c14f01200000000, 0x007ff8b700000000, 0x24a6ffd400000000, + 0x3b6a458800000000, 0x1fb342eb00000000, 0x73d84a4e00000000, + 0x57014d2d00000000, 0xea082bdf00000000, 0xced12cbc00000000, + 0xa2ba241900000000, 0x8663237a00000000, 0xae7d62ed00000000, + 0x8aa4658e00000000, 0xe6cf6d2b00000000, 0xc2166a4800000000, + 0x7f1f0cba00000000, 0x5bc60bd900000000, 0x37ad037c00000000, + 0x1374041f00000000, 0x0cb8be4300000000, 0x2861b92000000000, + 0x440ab18500000000, 0x60d3b6e600000000, 0xdddad01400000000, + 0xf903d77700000000, 0x9568dfd200000000, 0xb1b1d8b100000000, + 0xabf0aa6b00000000, 0x8f29ad0800000000, 0xe342a5ad00000000, + 0xc79ba2ce00000000, 0x7a92c43c00000000, 0x5e4bc35f00000000, + 0x3220cbfa00000000, 0x16f9cc9900000000, 0x093576c500000000, + 0x2dec71a600000000, 0x4187790300000000, 0x655e7e6000000000, + 0xd857189200000000, 0xfc8e1ff100000000, 0x90e5175400000000, + 0xb43c103700000000, 0xe561823b00000000, 0xc1b8855800000000, + 0xadd38dfd00000000, 0x890a8a9e00000000, 0x3403ec6c00000000, + 0x10daeb0f00000000, 0x7cb1e3aa00000000, 0x5868e4c900000000, + 0x47a45e9500000000, 0x637d59f600000000, 0x0f16515300000000, + 0x2bcf563000000000, 0x96c630c200000000, 0xb21f37a100000000, + 0xde743f0400000000, 0xfaad386700000000, 0xe0ec4abd00000000, + 0xc4354dde00000000, 0xa85e457b00000000, 0x8c87421800000000, + 0x318e24ea00000000, 0x1557238900000000, 0x793c2b2c00000000, + 0x5de52c4f00000000, 0x4229961300000000, 0x66f0917000000000, + 0x0a9b99d500000000, 0x2e429eb600000000, 0x934bf84400000000, + 0xb792ff2700000000, 0xdbf9f78200000000, 0xff20f0e100000000, + 0x7943d39b00000000, 0x5d9ad4f800000000, 0x31f1dc5d00000000, + 0x1528db3e00000000, 0xa821bdcc00000000, 0x8cf8baaf00000000, + 0xe093b20a00000000, 0xc44ab56900000000, 0xdb860f3500000000, + 0xff5f085600000000, 0x933400f300000000, 0xb7ed079000000000, + 0x0ae4616200000000, 0x2e3d660100000000, 0x42566ea400000000, + 0x668f69c700000000, 0x7cce1b1d00000000, 0x58171c7e00000000, + 0x347c14db00000000, 0x10a513b800000000, 0xadac754a00000000, + 0x8975722900000000, 0xe51e7a8c00000000, 0xc1c77def00000000, + 0xde0bc7b300000000, 0xfad2c0d000000000, 0x96b9c87500000000, + 0xb260cf1600000000, 0x0f69a9e400000000, 0x2bb0ae8700000000, + 0x47dba62200000000, 0x6302a14100000000, 0x325f334d00000000, + 0x1686342e00000000, 0x7aed3c8b00000000, 0x5e343be800000000, + 0xe33d5d1a00000000, 0xc7e45a7900000000, 0xab8f52dc00000000, + 0x8f5655bf00000000, 0x909aefe300000000, 0xb443e88000000000, + 0xd828e02500000000, 0xfcf1e74600000000, 0x41f881b400000000, + 0x652186d700000000, 0x094a8e7200000000, 0x2d93891100000000, + 0x37d2fbcb00000000, 0x130bfca800000000, 0x7f60f40d00000000, + 0x5bb9f36e00000000, 0xe6b0959c00000000, 0xc26992ff00000000, + 0xae029a5a00000000, 0x8adb9d3900000000, 0x9517276500000000, + 0xb1ce200600000000, 0xdda528a300000000, 0xf97c2fc000000000, + 0x4475493200000000, 0x60ac4e5100000000, 0x0cc746f400000000, + 0x281e419700000000}, + {0x0000000000000000, 0x08e3603c00000000, 0x10c6c17800000000, + 0x1825a14400000000, 0x208c83f100000000, 0x286fe3cd00000000, + 0x304a428900000000, 0x38a922b500000000, 0x011e763800000000, + 0x09fd160400000000, 0x11d8b74000000000, 0x193bd77c00000000, + 0x2192f5c900000000, 0x297195f500000000, 0x315434b100000000, + 0x39b7548d00000000, 0x023cec7000000000, 0x0adf8c4c00000000, + 0x12fa2d0800000000, 0x1a194d3400000000, 0x22b06f8100000000, + 0x2a530fbd00000000, 0x3276aef900000000, 0x3a95cec500000000, + 0x03229a4800000000, 0x0bc1fa7400000000, 0x13e45b3000000000, + 0x1b073b0c00000000, 0x23ae19b900000000, 0x2b4d798500000000, + 0x3368d8c100000000, 0x3b8bb8fd00000000, 0x0478d8e100000000, + 0x0c9bb8dd00000000, 0x14be199900000000, 0x1c5d79a500000000, + 0x24f45b1000000000, 0x2c173b2c00000000, 0x34329a6800000000, + 0x3cd1fa5400000000, 0x0566aed900000000, 0x0d85cee500000000, + 0x15a06fa100000000, 0x1d430f9d00000000, 0x25ea2d2800000000, + 0x2d094d1400000000, 0x352cec5000000000, 0x3dcf8c6c00000000, + 0x0644349100000000, 0x0ea754ad00000000, 0x1682f5e900000000, + 0x1e6195d500000000, 0x26c8b76000000000, 0x2e2bd75c00000000, + 0x360e761800000000, 0x3eed162400000000, 0x075a42a900000000, + 0x0fb9229500000000, 0x179c83d100000000, 0x1f7fe3ed00000000, + 0x27d6c15800000000, 0x2f35a16400000000, 0x3710002000000000, + 0x3ff3601c00000000, 0x49f6c11800000000, 0x4115a12400000000, + 0x5930006000000000, 0x51d3605c00000000, 0x697a42e900000000, + 0x619922d500000000, 0x79bc839100000000, 0x715fe3ad00000000, + 0x48e8b72000000000, 0x400bd71c00000000, 0x582e765800000000, + 0x50cd166400000000, 0x686434d100000000, 0x608754ed00000000, + 0x78a2f5a900000000, 0x7041959500000000, 0x4bca2d6800000000, + 0x43294d5400000000, 0x5b0cec1000000000, 0x53ef8c2c00000000, + 0x6b46ae9900000000, 0x63a5cea500000000, 0x7b806fe100000000, + 0x73630fdd00000000, 0x4ad45b5000000000, 0x42373b6c00000000, + 0x5a129a2800000000, 0x52f1fa1400000000, 0x6a58d8a100000000, + 0x62bbb89d00000000, 0x7a9e19d900000000, 0x727d79e500000000, + 0x4d8e19f900000000, 0x456d79c500000000, 0x5d48d88100000000, + 0x55abb8bd00000000, 0x6d029a0800000000, 0x65e1fa3400000000, + 0x7dc45b7000000000, 0x75273b4c00000000, 0x4c906fc100000000, + 0x44730ffd00000000, 0x5c56aeb900000000, 0x54b5ce8500000000, + 0x6c1cec3000000000, 0x64ff8c0c00000000, 0x7cda2d4800000000, + 0x74394d7400000000, 0x4fb2f58900000000, 0x475195b500000000, + 0x5f7434f100000000, 0x579754cd00000000, 0x6f3e767800000000, + 0x67dd164400000000, 0x7ff8b70000000000, 0x771bd73c00000000, + 0x4eac83b100000000, 0x464fe38d00000000, 0x5e6a42c900000000, + 0x568922f500000000, 0x6e20004000000000, 0x66c3607c00000000, + 0x7ee6c13800000000, 0x7605a10400000000, 0x92ec833100000000, + 0x9a0fe30d00000000, 0x822a424900000000, 0x8ac9227500000000, + 0xb26000c000000000, 0xba8360fc00000000, 0xa2a6c1b800000000, + 0xaa45a18400000000, 0x93f2f50900000000, 0x9b11953500000000, + 0x8334347100000000, 0x8bd7544d00000000, 0xb37e76f800000000, + 0xbb9d16c400000000, 0xa3b8b78000000000, 0xab5bd7bc00000000, + 0x90d06f4100000000, 0x98330f7d00000000, 0x8016ae3900000000, + 0x88f5ce0500000000, 0xb05cecb000000000, 0xb8bf8c8c00000000, + 0xa09a2dc800000000, 0xa8794df400000000, 0x91ce197900000000, + 0x992d794500000000, 0x8108d80100000000, 0x89ebb83d00000000, + 0xb1429a8800000000, 0xb9a1fab400000000, 0xa1845bf000000000, + 0xa9673bcc00000000, 0x96945bd000000000, 0x9e773bec00000000, + 0x86529aa800000000, 0x8eb1fa9400000000, 0xb618d82100000000, + 0xbefbb81d00000000, 0xa6de195900000000, 0xae3d796500000000, + 0x978a2de800000000, 0x9f694dd400000000, 0x874cec9000000000, + 0x8faf8cac00000000, 0xb706ae1900000000, 0xbfe5ce2500000000, + 0xa7c06f6100000000, 0xaf230f5d00000000, 0x94a8b7a000000000, + 0x9c4bd79c00000000, 0x846e76d800000000, 0x8c8d16e400000000, + 0xb424345100000000, 0xbcc7546d00000000, 0xa4e2f52900000000, + 0xac01951500000000, 0x95b6c19800000000, 0x9d55a1a400000000, + 0x857000e000000000, 0x8d9360dc00000000, 0xb53a426900000000, + 0xbdd9225500000000, 0xa5fc831100000000, 0xad1fe32d00000000, + 0xdb1a422900000000, 0xd3f9221500000000, 0xcbdc835100000000, + 0xc33fe36d00000000, 0xfb96c1d800000000, 0xf375a1e400000000, + 0xeb5000a000000000, 0xe3b3609c00000000, 0xda04341100000000, + 0xd2e7542d00000000, 0xcac2f56900000000, 0xc221955500000000, + 0xfa88b7e000000000, 0xf26bd7dc00000000, 0xea4e769800000000, + 0xe2ad16a400000000, 0xd926ae5900000000, 0xd1c5ce6500000000, + 0xc9e06f2100000000, 0xc1030f1d00000000, 0xf9aa2da800000000, + 0xf1494d9400000000, 0xe96cecd000000000, 0xe18f8cec00000000, + 0xd838d86100000000, 0xd0dbb85d00000000, 0xc8fe191900000000, + 0xc01d792500000000, 0xf8b45b9000000000, 0xf0573bac00000000, + 0xe8729ae800000000, 0xe091fad400000000, 0xdf629ac800000000, + 0xd781faf400000000, 0xcfa45bb000000000, 0xc7473b8c00000000, + 0xffee193900000000, 0xf70d790500000000, 0xef28d84100000000, + 0xe7cbb87d00000000, 0xde7cecf000000000, 0xd69f8ccc00000000, + 0xceba2d8800000000, 0xc6594db400000000, 0xfef06f0100000000, + 0xf6130f3d00000000, 0xee36ae7900000000, 0xe6d5ce4500000000, + 0xdd5e76b800000000, 0xd5bd168400000000, 0xcd98b7c000000000, + 0xc57bd7fc00000000, 0xfdd2f54900000000, 0xf531957500000000, + 0xed14343100000000, 0xe5f7540d00000000, 0xdc40008000000000, + 0xd4a360bc00000000, 0xcc86c1f800000000, 0xc465a1c400000000, + 0xfccc837100000000, 0xf42fe34d00000000, 0xec0a420900000000, + 0xe4e9223500000000}, + {0x0000000000000000, 0xd1e8e70e00000000, 0xa2d1cf1d00000000, + 0x7339281300000000, 0x44a39f3b00000000, 0x954b783500000000, + 0xe672502600000000, 0x379ab72800000000, 0x88463f7700000000, + 0x59aed87900000000, 0x2a97f06a00000000, 0xfb7f176400000000, + 0xcce5a04c00000000, 0x1d0d474200000000, 0x6e346f5100000000, + 0xbfdc885f00000000, 0x108d7eee00000000, 0xc16599e000000000, + 0xb25cb1f300000000, 0x63b456fd00000000, 0x542ee1d500000000, + 0x85c606db00000000, 0xf6ff2ec800000000, 0x2717c9c600000000, + 0x98cb419900000000, 0x4923a69700000000, 0x3a1a8e8400000000, + 0xebf2698a00000000, 0xdc68dea200000000, 0x0d8039ac00000000, + 0x7eb911bf00000000, 0xaf51f6b100000000, 0x611c8c0700000000, + 0xb0f46b0900000000, 0xc3cd431a00000000, 0x1225a41400000000, + 0x25bf133c00000000, 0xf457f43200000000, 0x876edc2100000000, + 0x56863b2f00000000, 0xe95ab37000000000, 0x38b2547e00000000, + 0x4b8b7c6d00000000, 0x9a639b6300000000, 0xadf92c4b00000000, + 0x7c11cb4500000000, 0x0f28e35600000000, 0xdec0045800000000, + 0x7191f2e900000000, 0xa07915e700000000, 0xd3403df400000000, + 0x02a8dafa00000000, 0x35326dd200000000, 0xe4da8adc00000000, + 0x97e3a2cf00000000, 0x460b45c100000000, 0xf9d7cd9e00000000, + 0x283f2a9000000000, 0x5b06028300000000, 0x8aeee58d00000000, + 0xbd7452a500000000, 0x6c9cb5ab00000000, 0x1fa59db800000000, + 0xce4d7ab600000000, 0xc238180f00000000, 0x13d0ff0100000000, + 0x60e9d71200000000, 0xb101301c00000000, 0x869b873400000000, + 0x5773603a00000000, 0x244a482900000000, 0xf5a2af2700000000, + 0x4a7e277800000000, 0x9b96c07600000000, 0xe8afe86500000000, + 0x39470f6b00000000, 0x0eddb84300000000, 0xdf355f4d00000000, + 0xac0c775e00000000, 0x7de4905000000000, 0xd2b566e100000000, + 0x035d81ef00000000, 0x7064a9fc00000000, 0xa18c4ef200000000, + 0x9616f9da00000000, 0x47fe1ed400000000, 0x34c736c700000000, + 0xe52fd1c900000000, 0x5af3599600000000, 0x8b1bbe9800000000, + 0xf822968b00000000, 0x29ca718500000000, 0x1e50c6ad00000000, + 0xcfb821a300000000, 0xbc8109b000000000, 0x6d69eebe00000000, + 0xa324940800000000, 0x72cc730600000000, 0x01f55b1500000000, + 0xd01dbc1b00000000, 0xe7870b3300000000, 0x366fec3d00000000, + 0x4556c42e00000000, 0x94be232000000000, 0x2b62ab7f00000000, + 0xfa8a4c7100000000, 0x89b3646200000000, 0x585b836c00000000, + 0x6fc1344400000000, 0xbe29d34a00000000, 0xcd10fb5900000000, + 0x1cf81c5700000000, 0xb3a9eae600000000, 0x62410de800000000, + 0x117825fb00000000, 0xc090c2f500000000, 0xf70a75dd00000000, + 0x26e292d300000000, 0x55dbbac000000000, 0x84335dce00000000, + 0x3befd59100000000, 0xea07329f00000000, 0x993e1a8c00000000, + 0x48d6fd8200000000, 0x7f4c4aaa00000000, 0xaea4ada400000000, + 0xdd9d85b700000000, 0x0c7562b900000000, 0x8471301e00000000, + 0x5599d71000000000, 0x26a0ff0300000000, 0xf748180d00000000, + 0xc0d2af2500000000, 0x113a482b00000000, 0x6203603800000000, + 0xb3eb873600000000, 0x0c370f6900000000, 0xdddfe86700000000, + 0xaee6c07400000000, 0x7f0e277a00000000, 0x4894905200000000, + 0x997c775c00000000, 0xea455f4f00000000, 0x3badb84100000000, + 0x94fc4ef000000000, 0x4514a9fe00000000, 0x362d81ed00000000, + 0xe7c566e300000000, 0xd05fd1cb00000000, 0x01b736c500000000, + 0x728e1ed600000000, 0xa366f9d800000000, 0x1cba718700000000, + 0xcd52968900000000, 0xbe6bbe9a00000000, 0x6f83599400000000, + 0x5819eebc00000000, 0x89f109b200000000, 0xfac821a100000000, + 0x2b20c6af00000000, 0xe56dbc1900000000, 0x34855b1700000000, + 0x47bc730400000000, 0x9654940a00000000, 0xa1ce232200000000, + 0x7026c42c00000000, 0x031fec3f00000000, 0xd2f70b3100000000, + 0x6d2b836e00000000, 0xbcc3646000000000, 0xcffa4c7300000000, + 0x1e12ab7d00000000, 0x29881c5500000000, 0xf860fb5b00000000, + 0x8b59d34800000000, 0x5ab1344600000000, 0xf5e0c2f700000000, + 0x240825f900000000, 0x57310dea00000000, 0x86d9eae400000000, + 0xb1435dcc00000000, 0x60abbac200000000, 0x139292d100000000, + 0xc27a75df00000000, 0x7da6fd8000000000, 0xac4e1a8e00000000, + 0xdf77329d00000000, 0x0e9fd59300000000, 0x390562bb00000000, + 0xe8ed85b500000000, 0x9bd4ada600000000, 0x4a3c4aa800000000, + 0x4649281100000000, 0x97a1cf1f00000000, 0xe498e70c00000000, + 0x3570000200000000, 0x02eab72a00000000, 0xd302502400000000, + 0xa03b783700000000, 0x71d39f3900000000, 0xce0f176600000000, + 0x1fe7f06800000000, 0x6cded87b00000000, 0xbd363f7500000000, + 0x8aac885d00000000, 0x5b446f5300000000, 0x287d474000000000, + 0xf995a04e00000000, 0x56c456ff00000000, 0x872cb1f100000000, + 0xf41599e200000000, 0x25fd7eec00000000, 0x1267c9c400000000, + 0xc38f2eca00000000, 0xb0b606d900000000, 0x615ee1d700000000, + 0xde82698800000000, 0x0f6a8e8600000000, 0x7c53a69500000000, + 0xadbb419b00000000, 0x9a21f6b300000000, 0x4bc911bd00000000, + 0x38f039ae00000000, 0xe918dea000000000, 0x2755a41600000000, + 0xf6bd431800000000, 0x85846b0b00000000, 0x546c8c0500000000, + 0x63f63b2d00000000, 0xb21edc2300000000, 0xc127f43000000000, + 0x10cf133e00000000, 0xaf139b6100000000, 0x7efb7c6f00000000, + 0x0dc2547c00000000, 0xdc2ab37200000000, 0xebb0045a00000000, + 0x3a58e35400000000, 0x4961cb4700000000, 0x98892c4900000000, + 0x37d8daf800000000, 0xe6303df600000000, 0x950915e500000000, + 0x44e1f2eb00000000, 0x737b45c300000000, 0xa293a2cd00000000, + 0xd1aa8ade00000000, 0x00426dd000000000, 0xbf9ee58f00000000, + 0x6e76028100000000, 0x1d4f2a9200000000, 0xcca7cd9c00000000, + 0xfb3d7ab400000000, 0x2ad59dba00000000, 0x59ecb5a900000000, + 0x880452a700000000}, + {0x0000000000000000, 0xaa05daf100000000, 0x150dc53800000000, + 0xbf081fc900000000, 0x2a1a8a7100000000, 0x801f508000000000, + 0x3f174f4900000000, 0x951295b800000000, 0x543414e300000000, + 0xfe31ce1200000000, 0x4139d1db00000000, 0xeb3c0b2a00000000, + 0x7e2e9e9200000000, 0xd42b446300000000, 0x6b235baa00000000, + 0xc126815b00000000, 0xe96e591d00000000, 0x436b83ec00000000, + 0xfc639c2500000000, 0x566646d400000000, 0xc374d36c00000000, + 0x6971099d00000000, 0xd679165400000000, 0x7c7ccca500000000, + 0xbd5a4dfe00000000, 0x175f970f00000000, 0xa85788c600000000, + 0x0252523700000000, 0x9740c78f00000000, 0x3d451d7e00000000, + 0x824d02b700000000, 0x2848d84600000000, 0xd2ddb23a00000000, + 0x78d868cb00000000, 0xc7d0770200000000, 0x6dd5adf300000000, + 0xf8c7384b00000000, 0x52c2e2ba00000000, 0xedcafd7300000000, + 0x47cf278200000000, 0x86e9a6d900000000, 0x2cec7c2800000000, + 0x93e463e100000000, 0x39e1b91000000000, 0xacf32ca800000000, + 0x06f6f65900000000, 0xb9fee99000000000, 0x13fb336100000000, + 0x3bb3eb2700000000, 0x91b631d600000000, 0x2ebe2e1f00000000, + 0x84bbf4ee00000000, 0x11a9615600000000, 0xbbacbba700000000, + 0x04a4a46e00000000, 0xaea17e9f00000000, 0x6f87ffc400000000, + 0xc582253500000000, 0x7a8a3afc00000000, 0xd08fe00d00000000, + 0x459d75b500000000, 0xef98af4400000000, 0x5090b08d00000000, + 0xfa956a7c00000000, 0xa4bb657500000000, 0x0ebebf8400000000, + 0xb1b6a04d00000000, 0x1bb37abc00000000, 0x8ea1ef0400000000, + 0x24a435f500000000, 0x9bac2a3c00000000, 0x31a9f0cd00000000, + 0xf08f719600000000, 0x5a8aab6700000000, 0xe582b4ae00000000, + 0x4f876e5f00000000, 0xda95fbe700000000, 0x7090211600000000, + 0xcf983edf00000000, 0x659de42e00000000, 0x4dd53c6800000000, + 0xe7d0e69900000000, 0x58d8f95000000000, 0xf2dd23a100000000, + 0x67cfb61900000000, 0xcdca6ce800000000, 0x72c2732100000000, + 0xd8c7a9d000000000, 0x19e1288b00000000, 0xb3e4f27a00000000, + 0x0cecedb300000000, 0xa6e9374200000000, 0x33fba2fa00000000, + 0x99fe780b00000000, 0x26f667c200000000, 0x8cf3bd3300000000, + 0x7666d74f00000000, 0xdc630dbe00000000, 0x636b127700000000, + 0xc96ec88600000000, 0x5c7c5d3e00000000, 0xf67987cf00000000, + 0x4971980600000000, 0xe37442f700000000, 0x2252c3ac00000000, + 0x8857195d00000000, 0x375f069400000000, 0x9d5adc6500000000, + 0x084849dd00000000, 0xa24d932c00000000, 0x1d458ce500000000, + 0xb740561400000000, 0x9f088e5200000000, 0x350d54a300000000, + 0x8a054b6a00000000, 0x2000919b00000000, 0xb512042300000000, + 0x1f17ded200000000, 0xa01fc11b00000000, 0x0a1a1bea00000000, + 0xcb3c9ab100000000, 0x6139404000000000, 0xde315f8900000000, + 0x7434857800000000, 0xe12610c000000000, 0x4b23ca3100000000, + 0xf42bd5f800000000, 0x5e2e0f0900000000, 0x4877cbea00000000, + 0xe272111b00000000, 0x5d7a0ed200000000, 0xf77fd42300000000, + 0x626d419b00000000, 0xc8689b6a00000000, 0x776084a300000000, + 0xdd655e5200000000, 0x1c43df0900000000, 0xb64605f800000000, + 0x094e1a3100000000, 0xa34bc0c000000000, 0x3659557800000000, + 0x9c5c8f8900000000, 0x2354904000000000, 0x89514ab100000000, + 0xa11992f700000000, 0x0b1c480600000000, 0xb41457cf00000000, + 0x1e118d3e00000000, 0x8b03188600000000, 0x2106c27700000000, + 0x9e0eddbe00000000, 0x340b074f00000000, 0xf52d861400000000, + 0x5f285ce500000000, 0xe020432c00000000, 0x4a2599dd00000000, + 0xdf370c6500000000, 0x7532d69400000000, 0xca3ac95d00000000, + 0x603f13ac00000000, 0x9aaa79d000000000, 0x30afa32100000000, + 0x8fa7bce800000000, 0x25a2661900000000, 0xb0b0f3a100000000, + 0x1ab5295000000000, 0xa5bd369900000000, 0x0fb8ec6800000000, + 0xce9e6d3300000000, 0x649bb7c200000000, 0xdb93a80b00000000, + 0x719672fa00000000, 0xe484e74200000000, 0x4e813db300000000, + 0xf189227a00000000, 0x5b8cf88b00000000, 0x73c420cd00000000, + 0xd9c1fa3c00000000, 0x66c9e5f500000000, 0xcccc3f0400000000, + 0x59deaabc00000000, 0xf3db704d00000000, 0x4cd36f8400000000, + 0xe6d6b57500000000, 0x27f0342e00000000, 0x8df5eedf00000000, + 0x32fdf11600000000, 0x98f82be700000000, 0x0deabe5f00000000, + 0xa7ef64ae00000000, 0x18e77b6700000000, 0xb2e2a19600000000, + 0xecccae9f00000000, 0x46c9746e00000000, 0xf9c16ba700000000, + 0x53c4b15600000000, 0xc6d624ee00000000, 0x6cd3fe1f00000000, + 0xd3dbe1d600000000, 0x79de3b2700000000, 0xb8f8ba7c00000000, + 0x12fd608d00000000, 0xadf57f4400000000, 0x07f0a5b500000000, + 0x92e2300d00000000, 0x38e7eafc00000000, 0x87eff53500000000, + 0x2dea2fc400000000, 0x05a2f78200000000, 0xafa72d7300000000, + 0x10af32ba00000000, 0xbaaae84b00000000, 0x2fb87df300000000, + 0x85bda70200000000, 0x3ab5b8cb00000000, 0x90b0623a00000000, + 0x5196e36100000000, 0xfb93399000000000, 0x449b265900000000, + 0xee9efca800000000, 0x7b8c691000000000, 0xd189b3e100000000, + 0x6e81ac2800000000, 0xc48476d900000000, 0x3e111ca500000000, + 0x9414c65400000000, 0x2b1cd99d00000000, 0x8119036c00000000, + 0x140b96d400000000, 0xbe0e4c2500000000, 0x010653ec00000000, + 0xab03891d00000000, 0x6a25084600000000, 0xc020d2b700000000, + 0x7f28cd7e00000000, 0xd52d178f00000000, 0x403f823700000000, + 0xea3a58c600000000, 0x5532470f00000000, 0xff379dfe00000000, + 0xd77f45b800000000, 0x7d7a9f4900000000, 0xc272808000000000, + 0x68775a7100000000, 0xfd65cfc900000000, 0x5760153800000000, + 0xe8680af100000000, 0x426dd00000000000, 0x834b515b00000000, + 0x294e8baa00000000, 0x9646946300000000, 0x3c434e9200000000, + 0xa951db2a00000000, 0x035401db00000000, 0xbc5c1e1200000000, + 0x1659c4e300000000}}; + +#else /* W == 4 */ + +local const z_crc_t FAR crc_braid_table[][256] = { + {0x00000000, 0xae689191, 0x87a02563, 0x29c8b4f2, 0xd4314c87, + 0x7a59dd16, 0x539169e4, 0xfdf9f875, 0x73139f4f, 0xdd7b0ede, + 0xf4b3ba2c, 0x5adb2bbd, 0xa722d3c8, 0x094a4259, 0x2082f6ab, + 0x8eea673a, 0xe6273e9e, 0x484faf0f, 0x61871bfd, 0xcfef8a6c, + 0x32167219, 0x9c7ee388, 0xb5b6577a, 0x1bdec6eb, 0x9534a1d1, + 0x3b5c3040, 0x129484b2, 0xbcfc1523, 0x4105ed56, 0xef6d7cc7, + 0xc6a5c835, 0x68cd59a4, 0x173f7b7d, 0xb957eaec, 0x909f5e1e, + 0x3ef7cf8f, 0xc30e37fa, 0x6d66a66b, 0x44ae1299, 0xeac68308, + 0x642ce432, 0xca4475a3, 0xe38cc151, 0x4de450c0, 0xb01da8b5, + 0x1e753924, 0x37bd8dd6, 0x99d51c47, 0xf11845e3, 0x5f70d472, + 0x76b86080, 0xd8d0f111, 0x25290964, 0x8b4198f5, 0xa2892c07, + 0x0ce1bd96, 0x820bdaac, 0x2c634b3d, 0x05abffcf, 0xabc36e5e, + 0x563a962b, 0xf85207ba, 0xd19ab348, 0x7ff222d9, 0x2e7ef6fa, + 0x8016676b, 0xa9ded399, 0x07b64208, 0xfa4fba7d, 0x54272bec, + 0x7def9f1e, 0xd3870e8f, 0x5d6d69b5, 0xf305f824, 0xdacd4cd6, + 0x74a5dd47, 0x895c2532, 0x2734b4a3, 0x0efc0051, 0xa09491c0, + 0xc859c864, 0x663159f5, 0x4ff9ed07, 0xe1917c96, 0x1c6884e3, + 0xb2001572, 0x9bc8a180, 0x35a03011, 0xbb4a572b, 0x1522c6ba, + 0x3cea7248, 0x9282e3d9, 0x6f7b1bac, 0xc1138a3d, 0xe8db3ecf, + 0x46b3af5e, 0x39418d87, 0x97291c16, 0xbee1a8e4, 0x10893975, + 0xed70c100, 0x43185091, 0x6ad0e463, 0xc4b875f2, 0x4a5212c8, + 0xe43a8359, 0xcdf237ab, 0x639aa63a, 0x9e635e4f, 0x300bcfde, + 0x19c37b2c, 0xb7abeabd, 0xdf66b319, 0x710e2288, 0x58c6967a, + 0xf6ae07eb, 0x0b57ff9e, 0xa53f6e0f, 0x8cf7dafd, 0x229f4b6c, + 0xac752c56, 0x021dbdc7, 0x2bd50935, 0x85bd98a4, 0x784460d1, + 0xd62cf140, 0xffe445b2, 0x518cd423, 0x5cfdedf4, 0xf2957c65, + 0xdb5dc897, 0x75355906, 0x88cca173, 0x26a430e2, 0x0f6c8410, + 0xa1041581, 0x2fee72bb, 0x8186e32a, 0xa84e57d8, 0x0626c649, + 0xfbdf3e3c, 0x55b7afad, 0x7c7f1b5f, 0xd2178ace, 0xbadad36a, + 0x14b242fb, 0x3d7af609, 0x93126798, 0x6eeb9fed, 0xc0830e7c, + 0xe94bba8e, 0x47232b1f, 0xc9c94c25, 0x67a1ddb4, 0x4e696946, + 0xe001f8d7, 0x1df800a2, 0xb3909133, 0x9a5825c1, 0x3430b450, + 0x4bc29689, 0xe5aa0718, 0xcc62b3ea, 0x620a227b, 0x9ff3da0e, + 0x319b4b9f, 0x1853ff6d, 0xb63b6efc, 0x38d109c6, 0x96b99857, + 0xbf712ca5, 0x1119bd34, 0xece04541, 0x4288d4d0, 0x6b406022, + 0xc528f1b3, 0xade5a817, 0x038d3986, 0x2a458d74, 0x842d1ce5, + 0x79d4e490, 0xd7bc7501, 0xfe74c1f3, 0x501c5062, 0xdef63758, + 0x709ea6c9, 0x5956123b, 0xf73e83aa, 0x0ac77bdf, 0xa4afea4e, + 0x8d675ebc, 0x230fcf2d, 0x72831b0e, 0xdceb8a9f, 0xf5233e6d, + 0x5b4baffc, 0xa6b25789, 0x08dac618, 0x211272ea, 0x8f7ae37b, + 0x01908441, 0xaff815d0, 0x8630a122, 0x285830b3, 0xd5a1c8c6, + 0x7bc95957, 0x5201eda5, 0xfc697c34, 0x94a42590, 0x3accb401, + 0x130400f3, 0xbd6c9162, 0x40956917, 0xeefdf886, 0xc7354c74, + 0x695ddde5, 0xe7b7badf, 0x49df2b4e, 0x60179fbc, 0xce7f0e2d, + 0x3386f658, 0x9dee67c9, 0xb426d33b, 0x1a4e42aa, 0x65bc6073, + 0xcbd4f1e2, 0xe21c4510, 0x4c74d481, 0xb18d2cf4, 0x1fe5bd65, + 0x362d0997, 0x98459806, 0x16afff3c, 0xb8c76ead, 0x910fda5f, + 0x3f674bce, 0xc29eb3bb, 0x6cf6222a, 0x453e96d8, 0xeb560749, + 0x839b5eed, 0x2df3cf7c, 0x043b7b8e, 0xaa53ea1f, 0x57aa126a, + 0xf9c283fb, 0xd00a3709, 0x7e62a698, 0xf088c1a2, 0x5ee05033, + 0x7728e4c1, 0xd9407550, 0x24b98d25, 0x8ad11cb4, 0xa319a846, + 0x0d7139d7}, + {0x00000000, 0xb9fbdbe8, 0xa886b191, 0x117d6a79, 0x8a7c6563, + 0x3387be8b, 0x22fad4f2, 0x9b010f1a, 0xcf89cc87, 0x7672176f, + 0x670f7d16, 0xdef4a6fe, 0x45f5a9e4, 0xfc0e720c, 0xed731875, + 0x5488c39d, 0x44629f4f, 0xfd9944a7, 0xece42ede, 0x551ff536, + 0xce1efa2c, 0x77e521c4, 0x66984bbd, 0xdf639055, 0x8beb53c8, + 0x32108820, 0x236de259, 0x9a9639b1, 0x019736ab, 0xb86ced43, + 0xa911873a, 0x10ea5cd2, 0x88c53e9e, 0x313ee576, 0x20438f0f, + 0x99b854e7, 0x02b95bfd, 0xbb428015, 0xaa3fea6c, 0x13c43184, + 0x474cf219, 0xfeb729f1, 0xefca4388, 0x56319860, 0xcd30977a, + 0x74cb4c92, 0x65b626eb, 0xdc4dfd03, 0xcca7a1d1, 0x755c7a39, + 0x64211040, 0xdddacba8, 0x46dbc4b2, 0xff201f5a, 0xee5d7523, + 0x57a6aecb, 0x032e6d56, 0xbad5b6be, 0xaba8dcc7, 0x1253072f, + 0x89520835, 0x30a9d3dd, 0x21d4b9a4, 0x982f624c, 0xcafb7b7d, + 0x7300a095, 0x627dcaec, 0xdb861104, 0x40871e1e, 0xf97cc5f6, + 0xe801af8f, 0x51fa7467, 0x0572b7fa, 0xbc896c12, 0xadf4066b, + 0x140fdd83, 0x8f0ed299, 0x36f50971, 0x27886308, 0x9e73b8e0, + 0x8e99e432, 0x37623fda, 0x261f55a3, 0x9fe48e4b, 0x04e58151, + 0xbd1e5ab9, 0xac6330c0, 0x1598eb28, 0x411028b5, 0xf8ebf35d, + 0xe9969924, 0x506d42cc, 0xcb6c4dd6, 0x7297963e, 0x63eafc47, + 0xda1127af, 0x423e45e3, 0xfbc59e0b, 0xeab8f472, 0x53432f9a, + 0xc8422080, 0x71b9fb68, 0x60c49111, 0xd93f4af9, 0x8db78964, + 0x344c528c, 0x253138f5, 0x9ccae31d, 0x07cbec07, 0xbe3037ef, + 0xaf4d5d96, 0x16b6867e, 0x065cdaac, 0xbfa70144, 0xaeda6b3d, + 0x1721b0d5, 0x8c20bfcf, 0x35db6427, 0x24a60e5e, 0x9d5dd5b6, + 0xc9d5162b, 0x702ecdc3, 0x6153a7ba, 0xd8a87c52, 0x43a97348, + 0xfa52a8a0, 0xeb2fc2d9, 0x52d41931, 0x4e87f0bb, 0xf77c2b53, + 0xe601412a, 0x5ffa9ac2, 0xc4fb95d8, 0x7d004e30, 0x6c7d2449, + 0xd586ffa1, 0x810e3c3c, 0x38f5e7d4, 0x29888dad, 0x90735645, + 0x0b72595f, 0xb28982b7, 0xa3f4e8ce, 0x1a0f3326, 0x0ae56ff4, + 0xb31eb41c, 0xa263de65, 0x1b98058d, 0x80990a97, 0x3962d17f, + 0x281fbb06, 0x91e460ee, 0xc56ca373, 0x7c97789b, 0x6dea12e2, + 0xd411c90a, 0x4f10c610, 0xf6eb1df8, 0xe7967781, 0x5e6dac69, + 0xc642ce25, 0x7fb915cd, 0x6ec47fb4, 0xd73fa45c, 0x4c3eab46, + 0xf5c570ae, 0xe4b81ad7, 0x5d43c13f, 0x09cb02a2, 0xb030d94a, + 0xa14db333, 0x18b668db, 0x83b767c1, 0x3a4cbc29, 0x2b31d650, + 0x92ca0db8, 0x8220516a, 0x3bdb8a82, 0x2aa6e0fb, 0x935d3b13, + 0x085c3409, 0xb1a7efe1, 0xa0da8598, 0x19215e70, 0x4da99ded, + 0xf4524605, 0xe52f2c7c, 0x5cd4f794, 0xc7d5f88e, 0x7e2e2366, + 0x6f53491f, 0xd6a892f7, 0x847c8bc6, 0x3d87502e, 0x2cfa3a57, + 0x9501e1bf, 0x0e00eea5, 0xb7fb354d, 0xa6865f34, 0x1f7d84dc, + 0x4bf54741, 0xf20e9ca9, 0xe373f6d0, 0x5a882d38, 0xc1892222, + 0x7872f9ca, 0x690f93b3, 0xd0f4485b, 0xc01e1489, 0x79e5cf61, + 0x6898a518, 0xd1637ef0, 0x4a6271ea, 0xf399aa02, 0xe2e4c07b, + 0x5b1f1b93, 0x0f97d80e, 0xb66c03e6, 0xa711699f, 0x1eeab277, + 0x85ebbd6d, 0x3c106685, 0x2d6d0cfc, 0x9496d714, 0x0cb9b558, + 0xb5426eb0, 0xa43f04c9, 0x1dc4df21, 0x86c5d03b, 0x3f3e0bd3, + 0x2e4361aa, 0x97b8ba42, 0xc33079df, 0x7acba237, 0x6bb6c84e, + 0xd24d13a6, 0x494c1cbc, 0xf0b7c754, 0xe1caad2d, 0x583176c5, + 0x48db2a17, 0xf120f1ff, 0xe05d9b86, 0x59a6406e, 0xc2a74f74, + 0x7b5c949c, 0x6a21fee5, 0xd3da250d, 0x8752e690, 0x3ea93d78, + 0x2fd45701, 0x962f8ce9, 0x0d2e83f3, 0xb4d5581b, 0xa5a83262, + 0x1c53e98a}, + {0x00000000, 0x9d0fe176, 0xe16ec4ad, 0x7c6125db, 0x19ac8f1b, + 0x84a36e6d, 0xf8c24bb6, 0x65cdaac0, 0x33591e36, 0xae56ff40, + 0xd237da9b, 0x4f383bed, 0x2af5912d, 0xb7fa705b, 0xcb9b5580, + 0x5694b4f6, 0x66b23c6c, 0xfbbddd1a, 0x87dcf8c1, 0x1ad319b7, + 0x7f1eb377, 0xe2115201, 0x9e7077da, 0x037f96ac, 0x55eb225a, + 0xc8e4c32c, 0xb485e6f7, 0x298a0781, 0x4c47ad41, 0xd1484c37, + 0xad2969ec, 0x3026889a, 0xcd6478d8, 0x506b99ae, 0x2c0abc75, + 0xb1055d03, 0xd4c8f7c3, 0x49c716b5, 0x35a6336e, 0xa8a9d218, + 0xfe3d66ee, 0x63328798, 0x1f53a243, 0x825c4335, 0xe791e9f5, + 0x7a9e0883, 0x06ff2d58, 0x9bf0cc2e, 0xabd644b4, 0x36d9a5c2, + 0x4ab88019, 0xd7b7616f, 0xb27acbaf, 0x2f752ad9, 0x53140f02, + 0xce1bee74, 0x988f5a82, 0x0580bbf4, 0x79e19e2f, 0xe4ee7f59, + 0x8123d599, 0x1c2c34ef, 0x604d1134, 0xfd42f042, 0x41b9f7f1, + 0xdcb61687, 0xa0d7335c, 0x3dd8d22a, 0x581578ea, 0xc51a999c, + 0xb97bbc47, 0x24745d31, 0x72e0e9c7, 0xefef08b1, 0x938e2d6a, + 0x0e81cc1c, 0x6b4c66dc, 0xf64387aa, 0x8a22a271, 0x172d4307, + 0x270bcb9d, 0xba042aeb, 0xc6650f30, 0x5b6aee46, 0x3ea74486, + 0xa3a8a5f0, 0xdfc9802b, 0x42c6615d, 0x1452d5ab, 0x895d34dd, + 0xf53c1106, 0x6833f070, 0x0dfe5ab0, 0x90f1bbc6, 0xec909e1d, + 0x719f7f6b, 0x8cdd8f29, 0x11d26e5f, 0x6db34b84, 0xf0bcaaf2, + 0x95710032, 0x087ee144, 0x741fc49f, 0xe91025e9, 0xbf84911f, + 0x228b7069, 0x5eea55b2, 0xc3e5b4c4, 0xa6281e04, 0x3b27ff72, + 0x4746daa9, 0xda493bdf, 0xea6fb345, 0x77605233, 0x0b0177e8, + 0x960e969e, 0xf3c33c5e, 0x6eccdd28, 0x12adf8f3, 0x8fa21985, + 0xd936ad73, 0x44394c05, 0x385869de, 0xa55788a8, 0xc09a2268, + 0x5d95c31e, 0x21f4e6c5, 0xbcfb07b3, 0x8373efe2, 0x1e7c0e94, + 0x621d2b4f, 0xff12ca39, 0x9adf60f9, 0x07d0818f, 0x7bb1a454, + 0xe6be4522, 0xb02af1d4, 0x2d2510a2, 0x51443579, 0xcc4bd40f, + 0xa9867ecf, 0x34899fb9, 0x48e8ba62, 0xd5e75b14, 0xe5c1d38e, + 0x78ce32f8, 0x04af1723, 0x99a0f655, 0xfc6d5c95, 0x6162bde3, + 0x1d039838, 0x800c794e, 0xd698cdb8, 0x4b972cce, 0x37f60915, + 0xaaf9e863, 0xcf3442a3, 0x523ba3d5, 0x2e5a860e, 0xb3556778, + 0x4e17973a, 0xd318764c, 0xaf795397, 0x3276b2e1, 0x57bb1821, + 0xcab4f957, 0xb6d5dc8c, 0x2bda3dfa, 0x7d4e890c, 0xe041687a, + 0x9c204da1, 0x012facd7, 0x64e20617, 0xf9ede761, 0x858cc2ba, + 0x188323cc, 0x28a5ab56, 0xb5aa4a20, 0xc9cb6ffb, 0x54c48e8d, + 0x3109244d, 0xac06c53b, 0xd067e0e0, 0x4d680196, 0x1bfcb560, + 0x86f35416, 0xfa9271cd, 0x679d90bb, 0x02503a7b, 0x9f5fdb0d, + 0xe33efed6, 0x7e311fa0, 0xc2ca1813, 0x5fc5f965, 0x23a4dcbe, + 0xbeab3dc8, 0xdb669708, 0x4669767e, 0x3a0853a5, 0xa707b2d3, + 0xf1930625, 0x6c9ce753, 0x10fdc288, 0x8df223fe, 0xe83f893e, + 0x75306848, 0x09514d93, 0x945eace5, 0xa478247f, 0x3977c509, + 0x4516e0d2, 0xd81901a4, 0xbdd4ab64, 0x20db4a12, 0x5cba6fc9, + 0xc1b58ebf, 0x97213a49, 0x0a2edb3f, 0x764ffee4, 0xeb401f92, + 0x8e8db552, 0x13825424, 0x6fe371ff, 0xf2ec9089, 0x0fae60cb, + 0x92a181bd, 0xeec0a466, 0x73cf4510, 0x1602efd0, 0x8b0d0ea6, + 0xf76c2b7d, 0x6a63ca0b, 0x3cf77efd, 0xa1f89f8b, 0xdd99ba50, + 0x40965b26, 0x255bf1e6, 0xb8541090, 0xc435354b, 0x593ad43d, + 0x691c5ca7, 0xf413bdd1, 0x8872980a, 0x157d797c, 0x70b0d3bc, + 0xedbf32ca, 0x91de1711, 0x0cd1f667, 0x5a454291, 0xc74aa3e7, + 0xbb2b863c, 0x2624674a, 0x43e9cd8a, 0xdee62cfc, 0xa2870927, + 0x3f88e851}, + {0x00000000, 0xdd96d985, 0x605cb54b, 0xbdca6cce, 0xc0b96a96, + 0x1d2fb313, 0xa0e5dfdd, 0x7d730658, 0x5a03d36d, 0x87950ae8, + 0x3a5f6626, 0xe7c9bfa3, 0x9abab9fb, 0x472c607e, 0xfae60cb0, + 0x2770d535, 0xb407a6da, 0x69917f5f, 0xd45b1391, 0x09cdca14, + 0x74becc4c, 0xa92815c9, 0x14e27907, 0xc974a082, 0xee0475b7, + 0x3392ac32, 0x8e58c0fc, 0x53ce1979, 0x2ebd1f21, 0xf32bc6a4, + 0x4ee1aa6a, 0x937773ef, 0xb37e4bf5, 0x6ee89270, 0xd322febe, + 0x0eb4273b, 0x73c72163, 0xae51f8e6, 0x139b9428, 0xce0d4dad, + 0xe97d9898, 0x34eb411d, 0x89212dd3, 0x54b7f456, 0x29c4f20e, + 0xf4522b8b, 0x49984745, 0x940e9ec0, 0x0779ed2f, 0xdaef34aa, + 0x67255864, 0xbab381e1, 0xc7c087b9, 0x1a565e3c, 0xa79c32f2, + 0x7a0aeb77, 0x5d7a3e42, 0x80ece7c7, 0x3d268b09, 0xe0b0528c, + 0x9dc354d4, 0x40558d51, 0xfd9fe19f, 0x2009381a, 0xbd8d91ab, + 0x601b482e, 0xddd124e0, 0x0047fd65, 0x7d34fb3d, 0xa0a222b8, + 0x1d684e76, 0xc0fe97f3, 0xe78e42c6, 0x3a189b43, 0x87d2f78d, + 0x5a442e08, 0x27372850, 0xfaa1f1d5, 0x476b9d1b, 0x9afd449e, + 0x098a3771, 0xd41ceef4, 0x69d6823a, 0xb4405bbf, 0xc9335de7, + 0x14a58462, 0xa96fe8ac, 0x74f93129, 0x5389e41c, 0x8e1f3d99, + 0x33d55157, 0xee4388d2, 0x93308e8a, 0x4ea6570f, 0xf36c3bc1, + 0x2efae244, 0x0ef3da5e, 0xd36503db, 0x6eaf6f15, 0xb339b690, + 0xce4ab0c8, 0x13dc694d, 0xae160583, 0x7380dc06, 0x54f00933, + 0x8966d0b6, 0x34acbc78, 0xe93a65fd, 0x944963a5, 0x49dfba20, + 0xf415d6ee, 0x29830f6b, 0xbaf47c84, 0x6762a501, 0xdaa8c9cf, + 0x073e104a, 0x7a4d1612, 0xa7dbcf97, 0x1a11a359, 0xc7877adc, + 0xe0f7afe9, 0x3d61766c, 0x80ab1aa2, 0x5d3dc327, 0x204ec57f, + 0xfdd81cfa, 0x40127034, 0x9d84a9b1, 0xa06a2517, 0x7dfcfc92, + 0xc036905c, 0x1da049d9, 0x60d34f81, 0xbd459604, 0x008ffaca, + 0xdd19234f, 0xfa69f67a, 0x27ff2fff, 0x9a354331, 0x47a39ab4, + 0x3ad09cec, 0xe7464569, 0x5a8c29a7, 0x871af022, 0x146d83cd, + 0xc9fb5a48, 0x74313686, 0xa9a7ef03, 0xd4d4e95b, 0x094230de, + 0xb4885c10, 0x691e8595, 0x4e6e50a0, 0x93f88925, 0x2e32e5eb, + 0xf3a43c6e, 0x8ed73a36, 0x5341e3b3, 0xee8b8f7d, 0x331d56f8, + 0x13146ee2, 0xce82b767, 0x7348dba9, 0xaede022c, 0xd3ad0474, + 0x0e3bddf1, 0xb3f1b13f, 0x6e6768ba, 0x4917bd8f, 0x9481640a, + 0x294b08c4, 0xf4ddd141, 0x89aed719, 0x54380e9c, 0xe9f26252, + 0x3464bbd7, 0xa713c838, 0x7a8511bd, 0xc74f7d73, 0x1ad9a4f6, + 0x67aaa2ae, 0xba3c7b2b, 0x07f617e5, 0xda60ce60, 0xfd101b55, + 0x2086c2d0, 0x9d4cae1e, 0x40da779b, 0x3da971c3, 0xe03fa846, + 0x5df5c488, 0x80631d0d, 0x1de7b4bc, 0xc0716d39, 0x7dbb01f7, + 0xa02dd872, 0xdd5ede2a, 0x00c807af, 0xbd026b61, 0x6094b2e4, + 0x47e467d1, 0x9a72be54, 0x27b8d29a, 0xfa2e0b1f, 0x875d0d47, + 0x5acbd4c2, 0xe701b80c, 0x3a976189, 0xa9e01266, 0x7476cbe3, + 0xc9bca72d, 0x142a7ea8, 0x695978f0, 0xb4cfa175, 0x0905cdbb, + 0xd493143e, 0xf3e3c10b, 0x2e75188e, 0x93bf7440, 0x4e29adc5, + 0x335aab9d, 0xeecc7218, 0x53061ed6, 0x8e90c753, 0xae99ff49, + 0x730f26cc, 0xcec54a02, 0x13539387, 0x6e2095df, 0xb3b64c5a, + 0x0e7c2094, 0xd3eaf911, 0xf49a2c24, 0x290cf5a1, 0x94c6996f, + 0x495040ea, 0x342346b2, 0xe9b59f37, 0x547ff3f9, 0x89e92a7c, + 0x1a9e5993, 0xc7088016, 0x7ac2ecd8, 0xa754355d, 0xda273305, + 0x07b1ea80, 0xba7b864e, 0x67ed5fcb, 0x409d8afe, 0x9d0b537b, + 0x20c13fb5, 0xfd57e630, 0x8024e068, 0x5db239ed, 0xe0785523, + 0x3dee8ca6}}; + +local const z_word_t FAR crc_braid_big_table[][256] = { + {0x00000000, 0x85d996dd, 0x4bb55c60, 0xce6ccabd, 0x966ab9c0, + 0x13b32f1d, 0xdddfe5a0, 0x5806737d, 0x6dd3035a, 0xe80a9587, + 0x26665f3a, 0xa3bfc9e7, 0xfbb9ba9a, 0x7e602c47, 0xb00ce6fa, + 0x35d57027, 0xdaa607b4, 0x5f7f9169, 0x91135bd4, 0x14cacd09, + 0x4cccbe74, 0xc91528a9, 0x0779e214, 0x82a074c9, 0xb77504ee, + 0x32ac9233, 0xfcc0588e, 0x7919ce53, 0x211fbd2e, 0xa4c62bf3, + 0x6aaae14e, 0xef737793, 0xf54b7eb3, 0x7092e86e, 0xbefe22d3, + 0x3b27b40e, 0x6321c773, 0xe6f851ae, 0x28949b13, 0xad4d0dce, + 0x98987de9, 0x1d41eb34, 0xd32d2189, 0x56f4b754, 0x0ef2c429, + 0x8b2b52f4, 0x45479849, 0xc09e0e94, 0x2fed7907, 0xaa34efda, + 0x64582567, 0xe181b3ba, 0xb987c0c7, 0x3c5e561a, 0xf2329ca7, + 0x77eb0a7a, 0x423e7a5d, 0xc7e7ec80, 0x098b263d, 0x8c52b0e0, + 0xd454c39d, 0x518d5540, 0x9fe19ffd, 0x1a380920, 0xab918dbd, + 0x2e481b60, 0xe024d1dd, 0x65fd4700, 0x3dfb347d, 0xb822a2a0, + 0x764e681d, 0xf397fec0, 0xc6428ee7, 0x439b183a, 0x8df7d287, + 0x082e445a, 0x50283727, 0xd5f1a1fa, 0x1b9d6b47, 0x9e44fd9a, + 0x71378a09, 0xf4ee1cd4, 0x3a82d669, 0xbf5b40b4, 0xe75d33c9, + 0x6284a514, 0xace86fa9, 0x2931f974, 0x1ce48953, 0x993d1f8e, + 0x5751d533, 0xd28843ee, 0x8a8e3093, 0x0f57a64e, 0xc13b6cf3, + 0x44e2fa2e, 0x5edaf30e, 0xdb0365d3, 0x156faf6e, 0x90b639b3, + 0xc8b04ace, 0x4d69dc13, 0x830516ae, 0x06dc8073, 0x3309f054, + 0xb6d06689, 0x78bcac34, 0xfd653ae9, 0xa5634994, 0x20badf49, + 0xeed615f4, 0x6b0f8329, 0x847cf4ba, 0x01a56267, 0xcfc9a8da, + 0x4a103e07, 0x12164d7a, 0x97cfdba7, 0x59a3111a, 0xdc7a87c7, + 0xe9aff7e0, 0x6c76613d, 0xa21aab80, 0x27c33d5d, 0x7fc54e20, + 0xfa1cd8fd, 0x34701240, 0xb1a9849d, 0x17256aa0, 0x92fcfc7d, + 0x5c9036c0, 0xd949a01d, 0x814fd360, 0x049645bd, 0xcafa8f00, + 0x4f2319dd, 0x7af669fa, 0xff2fff27, 0x3143359a, 0xb49aa347, + 0xec9cd03a, 0x694546e7, 0xa7298c5a, 0x22f01a87, 0xcd836d14, + 0x485afbc9, 0x86363174, 0x03efa7a9, 0x5be9d4d4, 0xde304209, + 0x105c88b4, 0x95851e69, 0xa0506e4e, 0x2589f893, 0xebe5322e, + 0x6e3ca4f3, 0x363ad78e, 0xb3e34153, 0x7d8f8bee, 0xf8561d33, + 0xe26e1413, 0x67b782ce, 0xa9db4873, 0x2c02deae, 0x7404add3, + 0xf1dd3b0e, 0x3fb1f1b3, 0xba68676e, 0x8fbd1749, 0x0a648194, + 0xc4084b29, 0x41d1ddf4, 0x19d7ae89, 0x9c0e3854, 0x5262f2e9, + 0xd7bb6434, 0x38c813a7, 0xbd11857a, 0x737d4fc7, 0xf6a4d91a, + 0xaea2aa67, 0x2b7b3cba, 0xe517f607, 0x60ce60da, 0x551b10fd, + 0xd0c28620, 0x1eae4c9d, 0x9b77da40, 0xc371a93d, 0x46a83fe0, + 0x88c4f55d, 0x0d1d6380, 0xbcb4e71d, 0x396d71c0, 0xf701bb7d, + 0x72d82da0, 0x2ade5edd, 0xaf07c800, 0x616b02bd, 0xe4b29460, + 0xd167e447, 0x54be729a, 0x9ad2b827, 0x1f0b2efa, 0x470d5d87, + 0xc2d4cb5a, 0x0cb801e7, 0x8961973a, 0x6612e0a9, 0xe3cb7674, + 0x2da7bcc9, 0xa87e2a14, 0xf0785969, 0x75a1cfb4, 0xbbcd0509, + 0x3e1493d4, 0x0bc1e3f3, 0x8e18752e, 0x4074bf93, 0xc5ad294e, + 0x9dab5a33, 0x1872ccee, 0xd61e0653, 0x53c7908e, 0x49ff99ae, + 0xcc260f73, 0x024ac5ce, 0x87935313, 0xdf95206e, 0x5a4cb6b3, + 0x94207c0e, 0x11f9ead3, 0x242c9af4, 0xa1f50c29, 0x6f99c694, + 0xea405049, 0xb2462334, 0x379fb5e9, 0xf9f37f54, 0x7c2ae989, + 0x93599e1a, 0x168008c7, 0xd8ecc27a, 0x5d3554a7, 0x053327da, + 0x80eab107, 0x4e867bba, 0xcb5fed67, 0xfe8a9d40, 0x7b530b9d, + 0xb53fc120, 0x30e657fd, 0x68e02480, 0xed39b25d, 0x235578e0, + 0xa68cee3d}, + {0x00000000, 0x76e10f9d, 0xadc46ee1, 0xdb25617c, 0x1b8fac19, + 0x6d6ea384, 0xb64bc2f8, 0xc0aacd65, 0x361e5933, 0x40ff56ae, + 0x9bda37d2, 0xed3b384f, 0x2d91f52a, 0x5b70fab7, 0x80559bcb, + 0xf6b49456, 0x6c3cb266, 0x1addbdfb, 0xc1f8dc87, 0xb719d31a, + 0x77b31e7f, 0x015211e2, 0xda77709e, 0xac967f03, 0x5a22eb55, + 0x2cc3e4c8, 0xf7e685b4, 0x81078a29, 0x41ad474c, 0x374c48d1, + 0xec6929ad, 0x9a882630, 0xd87864cd, 0xae996b50, 0x75bc0a2c, + 0x035d05b1, 0xc3f7c8d4, 0xb516c749, 0x6e33a635, 0x18d2a9a8, + 0xee663dfe, 0x98873263, 0x43a2531f, 0x35435c82, 0xf5e991e7, + 0x83089e7a, 0x582dff06, 0x2eccf09b, 0xb444d6ab, 0xc2a5d936, + 0x1980b84a, 0x6f61b7d7, 0xafcb7ab2, 0xd92a752f, 0x020f1453, + 0x74ee1bce, 0x825a8f98, 0xf4bb8005, 0x2f9ee179, 0x597feee4, + 0x99d52381, 0xef342c1c, 0x34114d60, 0x42f042fd, 0xf1f7b941, + 0x8716b6dc, 0x5c33d7a0, 0x2ad2d83d, 0xea781558, 0x9c991ac5, + 0x47bc7bb9, 0x315d7424, 0xc7e9e072, 0xb108efef, 0x6a2d8e93, + 0x1ccc810e, 0xdc664c6b, 0xaa8743f6, 0x71a2228a, 0x07432d17, + 0x9dcb0b27, 0xeb2a04ba, 0x300f65c6, 0x46ee6a5b, 0x8644a73e, + 0xf0a5a8a3, 0x2b80c9df, 0x5d61c642, 0xabd55214, 0xdd345d89, + 0x06113cf5, 0x70f03368, 0xb05afe0d, 0xc6bbf190, 0x1d9e90ec, + 0x6b7f9f71, 0x298fdd8c, 0x5f6ed211, 0x844bb36d, 0xf2aabcf0, + 0x32007195, 0x44e17e08, 0x9fc41f74, 0xe92510e9, 0x1f9184bf, + 0x69708b22, 0xb255ea5e, 0xc4b4e5c3, 0x041e28a6, 0x72ff273b, + 0xa9da4647, 0xdf3b49da, 0x45b36fea, 0x33526077, 0xe877010b, + 0x9e960e96, 0x5e3cc3f3, 0x28ddcc6e, 0xf3f8ad12, 0x8519a28f, + 0x73ad36d9, 0x054c3944, 0xde695838, 0xa88857a5, 0x68229ac0, + 0x1ec3955d, 0xc5e6f421, 0xb307fbbc, 0xe2ef7383, 0x940e7c1e, + 0x4f2b1d62, 0x39ca12ff, 0xf960df9a, 0x8f81d007, 0x54a4b17b, + 0x2245bee6, 0xd4f12ab0, 0xa210252d, 0x79354451, 0x0fd44bcc, + 0xcf7e86a9, 0xb99f8934, 0x62bae848, 0x145be7d5, 0x8ed3c1e5, + 0xf832ce78, 0x2317af04, 0x55f6a099, 0x955c6dfc, 0xe3bd6261, + 0x3898031d, 0x4e790c80, 0xb8cd98d6, 0xce2c974b, 0x1509f637, + 0x63e8f9aa, 0xa34234cf, 0xd5a33b52, 0x0e865a2e, 0x786755b3, + 0x3a97174e, 0x4c7618d3, 0x975379af, 0xe1b27632, 0x2118bb57, + 0x57f9b4ca, 0x8cdcd5b6, 0xfa3dda2b, 0x0c894e7d, 0x7a6841e0, + 0xa14d209c, 0xd7ac2f01, 0x1706e264, 0x61e7edf9, 0xbac28c85, + 0xcc238318, 0x56aba528, 0x204aaab5, 0xfb6fcbc9, 0x8d8ec454, + 0x4d240931, 0x3bc506ac, 0xe0e067d0, 0x9601684d, 0x60b5fc1b, + 0x1654f386, 0xcd7192fa, 0xbb909d67, 0x7b3a5002, 0x0ddb5f9f, + 0xd6fe3ee3, 0xa01f317e, 0x1318cac2, 0x65f9c55f, 0xbedca423, + 0xc83dabbe, 0x089766db, 0x7e766946, 0xa553083a, 0xd3b207a7, + 0x250693f1, 0x53e79c6c, 0x88c2fd10, 0xfe23f28d, 0x3e893fe8, + 0x48683075, 0x934d5109, 0xe5ac5e94, 0x7f2478a4, 0x09c57739, + 0xd2e01645, 0xa40119d8, 0x64abd4bd, 0x124adb20, 0xc96fba5c, + 0xbf8eb5c1, 0x493a2197, 0x3fdb2e0a, 0xe4fe4f76, 0x921f40eb, + 0x52b58d8e, 0x24548213, 0xff71e36f, 0x8990ecf2, 0xcb60ae0f, + 0xbd81a192, 0x66a4c0ee, 0x1045cf73, 0xd0ef0216, 0xa60e0d8b, + 0x7d2b6cf7, 0x0bca636a, 0xfd7ef73c, 0x8b9ff8a1, 0x50ba99dd, + 0x265b9640, 0xe6f15b25, 0x901054b8, 0x4b3535c4, 0x3dd43a59, + 0xa75c1c69, 0xd1bd13f4, 0x0a987288, 0x7c797d15, 0xbcd3b070, + 0xca32bfed, 0x1117de91, 0x67f6d10c, 0x9142455a, 0xe7a34ac7, + 0x3c862bbb, 0x4a672426, 0x8acde943, 0xfc2ce6de, 0x270987a2, + 0x51e8883f}, + {0x00000000, 0xe8dbfbb9, 0x91b186a8, 0x796a7d11, 0x63657c8a, + 0x8bbe8733, 0xf2d4fa22, 0x1a0f019b, 0x87cc89cf, 0x6f177276, + 0x167d0f67, 0xfea6f4de, 0xe4a9f545, 0x0c720efc, 0x751873ed, + 0x9dc38854, 0x4f9f6244, 0xa74499fd, 0xde2ee4ec, 0x36f51f55, + 0x2cfa1ece, 0xc421e577, 0xbd4b9866, 0x559063df, 0xc853eb8b, + 0x20881032, 0x59e26d23, 0xb139969a, 0xab369701, 0x43ed6cb8, + 0x3a8711a9, 0xd25cea10, 0x9e3ec588, 0x76e53e31, 0x0f8f4320, + 0xe754b899, 0xfd5bb902, 0x158042bb, 0x6cea3faa, 0x8431c413, + 0x19f24c47, 0xf129b7fe, 0x8843caef, 0x60983156, 0x7a9730cd, + 0x924ccb74, 0xeb26b665, 0x03fd4ddc, 0xd1a1a7cc, 0x397a5c75, + 0x40102164, 0xa8cbdadd, 0xb2c4db46, 0x5a1f20ff, 0x23755dee, + 0xcbaea657, 0x566d2e03, 0xbeb6d5ba, 0xc7dca8ab, 0x2f075312, + 0x35085289, 0xddd3a930, 0xa4b9d421, 0x4c622f98, 0x7d7bfbca, + 0x95a00073, 0xecca7d62, 0x041186db, 0x1e1e8740, 0xf6c57cf9, + 0x8faf01e8, 0x6774fa51, 0xfab77205, 0x126c89bc, 0x6b06f4ad, + 0x83dd0f14, 0x99d20e8f, 0x7109f536, 0x08638827, 0xe0b8739e, + 0x32e4998e, 0xda3f6237, 0xa3551f26, 0x4b8ee49f, 0x5181e504, + 0xb95a1ebd, 0xc03063ac, 0x28eb9815, 0xb5281041, 0x5df3ebf8, + 0x249996e9, 0xcc426d50, 0xd64d6ccb, 0x3e969772, 0x47fcea63, + 0xaf2711da, 0xe3453e42, 0x0b9ec5fb, 0x72f4b8ea, 0x9a2f4353, + 0x802042c8, 0x68fbb971, 0x1191c460, 0xf94a3fd9, 0x6489b78d, + 0x8c524c34, 0xf5383125, 0x1de3ca9c, 0x07eccb07, 0xef3730be, + 0x965d4daf, 0x7e86b616, 0xacda5c06, 0x4401a7bf, 0x3d6bdaae, + 0xd5b02117, 0xcfbf208c, 0x2764db35, 0x5e0ea624, 0xb6d55d9d, + 0x2b16d5c9, 0xc3cd2e70, 0xbaa75361, 0x527ca8d8, 0x4873a943, + 0xa0a852fa, 0xd9c22feb, 0x3119d452, 0xbbf0874e, 0x532b7cf7, + 0x2a4101e6, 0xc29afa5f, 0xd895fbc4, 0x304e007d, 0x49247d6c, + 0xa1ff86d5, 0x3c3c0e81, 0xd4e7f538, 0xad8d8829, 0x45567390, + 0x5f59720b, 0xb78289b2, 0xcee8f4a3, 0x26330f1a, 0xf46fe50a, + 0x1cb41eb3, 0x65de63a2, 0x8d05981b, 0x970a9980, 0x7fd16239, + 0x06bb1f28, 0xee60e491, 0x73a36cc5, 0x9b78977c, 0xe212ea6d, + 0x0ac911d4, 0x10c6104f, 0xf81debf6, 0x817796e7, 0x69ac6d5e, + 0x25ce42c6, 0xcd15b97f, 0xb47fc46e, 0x5ca43fd7, 0x46ab3e4c, + 0xae70c5f5, 0xd71ab8e4, 0x3fc1435d, 0xa202cb09, 0x4ad930b0, + 0x33b34da1, 0xdb68b618, 0xc167b783, 0x29bc4c3a, 0x50d6312b, + 0xb80dca92, 0x6a512082, 0x828adb3b, 0xfbe0a62a, 0x133b5d93, + 0x09345c08, 0xe1efa7b1, 0x9885daa0, 0x705e2119, 0xed9da94d, + 0x054652f4, 0x7c2c2fe5, 0x94f7d45c, 0x8ef8d5c7, 0x66232e7e, + 0x1f49536f, 0xf792a8d6, 0xc68b7c84, 0x2e50873d, 0x573afa2c, + 0xbfe10195, 0xa5ee000e, 0x4d35fbb7, 0x345f86a6, 0xdc847d1f, + 0x4147f54b, 0xa99c0ef2, 0xd0f673e3, 0x382d885a, 0x222289c1, + 0xcaf97278, 0xb3930f69, 0x5b48f4d0, 0x89141ec0, 0x61cfe579, + 0x18a59868, 0xf07e63d1, 0xea71624a, 0x02aa99f3, 0x7bc0e4e2, + 0x931b1f5b, 0x0ed8970f, 0xe6036cb6, 0x9f6911a7, 0x77b2ea1e, + 0x6dbdeb85, 0x8566103c, 0xfc0c6d2d, 0x14d79694, 0x58b5b90c, + 0xb06e42b5, 0xc9043fa4, 0x21dfc41d, 0x3bd0c586, 0xd30b3e3f, + 0xaa61432e, 0x42bab897, 0xdf7930c3, 0x37a2cb7a, 0x4ec8b66b, + 0xa6134dd2, 0xbc1c4c49, 0x54c7b7f0, 0x2dadcae1, 0xc5763158, + 0x172adb48, 0xfff120f1, 0x869b5de0, 0x6e40a659, 0x744fa7c2, + 0x9c945c7b, 0xe5fe216a, 0x0d25dad3, 0x90e65287, 0x783da93e, + 0x0157d42f, 0xe98c2f96, 0xf3832e0d, 0x1b58d5b4, 0x6232a8a5, + 0x8ae9531c}, + {0x00000000, 0x919168ae, 0x6325a087, 0xf2b4c829, 0x874c31d4, + 0x16dd597a, 0xe4699153, 0x75f8f9fd, 0x4f9f1373, 0xde0e7bdd, + 0x2cbab3f4, 0xbd2bdb5a, 0xc8d322a7, 0x59424a09, 0xabf68220, + 0x3a67ea8e, 0x9e3e27e6, 0x0faf4f48, 0xfd1b8761, 0x6c8aefcf, + 0x19721632, 0x88e37e9c, 0x7a57b6b5, 0xebc6de1b, 0xd1a13495, + 0x40305c3b, 0xb2849412, 0x2315fcbc, 0x56ed0541, 0xc77c6def, + 0x35c8a5c6, 0xa459cd68, 0x7d7b3f17, 0xecea57b9, 0x1e5e9f90, + 0x8fcff73e, 0xfa370ec3, 0x6ba6666d, 0x9912ae44, 0x0883c6ea, + 0x32e42c64, 0xa37544ca, 0x51c18ce3, 0xc050e44d, 0xb5a81db0, + 0x2439751e, 0xd68dbd37, 0x471cd599, 0xe34518f1, 0x72d4705f, + 0x8060b876, 0x11f1d0d8, 0x64092925, 0xf598418b, 0x072c89a2, + 0x96bde10c, 0xacda0b82, 0x3d4b632c, 0xcfffab05, 0x5e6ec3ab, + 0x2b963a56, 0xba0752f8, 0x48b39ad1, 0xd922f27f, 0xfaf67e2e, + 0x6b671680, 0x99d3dea9, 0x0842b607, 0x7dba4ffa, 0xec2b2754, + 0x1e9fef7d, 0x8f0e87d3, 0xb5696d5d, 0x24f805f3, 0xd64ccdda, + 0x47dda574, 0x32255c89, 0xa3b43427, 0x5100fc0e, 0xc09194a0, + 0x64c859c8, 0xf5593166, 0x07edf94f, 0x967c91e1, 0xe384681c, + 0x721500b2, 0x80a1c89b, 0x1130a035, 0x2b574abb, 0xbac62215, + 0x4872ea3c, 0xd9e38292, 0xac1b7b6f, 0x3d8a13c1, 0xcf3edbe8, + 0x5eafb346, 0x878d4139, 0x161c2997, 0xe4a8e1be, 0x75398910, + 0x00c170ed, 0x91501843, 0x63e4d06a, 0xf275b8c4, 0xc812524a, + 0x59833ae4, 0xab37f2cd, 0x3aa69a63, 0x4f5e639e, 0xdecf0b30, + 0x2c7bc319, 0xbdeaabb7, 0x19b366df, 0x88220e71, 0x7a96c658, + 0xeb07aef6, 0x9eff570b, 0x0f6e3fa5, 0xfddaf78c, 0x6c4b9f22, + 0x562c75ac, 0xc7bd1d02, 0x3509d52b, 0xa498bd85, 0xd1604478, + 0x40f12cd6, 0xb245e4ff, 0x23d48c51, 0xf4edfd5c, 0x657c95f2, + 0x97c85ddb, 0x06593575, 0x73a1cc88, 0xe230a426, 0x10846c0f, + 0x811504a1, 0xbb72ee2f, 0x2ae38681, 0xd8574ea8, 0x49c62606, + 0x3c3edffb, 0xadafb755, 0x5f1b7f7c, 0xce8a17d2, 0x6ad3daba, + 0xfb42b214, 0x09f67a3d, 0x98671293, 0xed9feb6e, 0x7c0e83c0, + 0x8eba4be9, 0x1f2b2347, 0x254cc9c9, 0xb4dda167, 0x4669694e, + 0xd7f801e0, 0xa200f81d, 0x339190b3, 0xc125589a, 0x50b43034, + 0x8996c24b, 0x1807aae5, 0xeab362cc, 0x7b220a62, 0x0edaf39f, + 0x9f4b9b31, 0x6dff5318, 0xfc6e3bb6, 0xc609d138, 0x5798b996, + 0xa52c71bf, 0x34bd1911, 0x4145e0ec, 0xd0d48842, 0x2260406b, + 0xb3f128c5, 0x17a8e5ad, 0x86398d03, 0x748d452a, 0xe51c2d84, + 0x90e4d479, 0x0175bcd7, 0xf3c174fe, 0x62501c50, 0x5837f6de, + 0xc9a69e70, 0x3b125659, 0xaa833ef7, 0xdf7bc70a, 0x4eeaafa4, + 0xbc5e678d, 0x2dcf0f23, 0x0e1b8372, 0x9f8aebdc, 0x6d3e23f5, + 0xfcaf4b5b, 0x8957b2a6, 0x18c6da08, 0xea721221, 0x7be37a8f, + 0x41849001, 0xd015f8af, 0x22a13086, 0xb3305828, 0xc6c8a1d5, + 0x5759c97b, 0xa5ed0152, 0x347c69fc, 0x9025a494, 0x01b4cc3a, + 0xf3000413, 0x62916cbd, 0x17699540, 0x86f8fdee, 0x744c35c7, + 0xe5dd5d69, 0xdfbab7e7, 0x4e2bdf49, 0xbc9f1760, 0x2d0e7fce, + 0x58f68633, 0xc967ee9d, 0x3bd326b4, 0xaa424e1a, 0x7360bc65, + 0xe2f1d4cb, 0x10451ce2, 0x81d4744c, 0xf42c8db1, 0x65bde51f, + 0x97092d36, 0x06984598, 0x3cffaf16, 0xad6ec7b8, 0x5fda0f91, + 0xce4b673f, 0xbbb39ec2, 0x2a22f66c, 0xd8963e45, 0x490756eb, + 0xed5e9b83, 0x7ccff32d, 0x8e7b3b04, 0x1fea53aa, 0x6a12aa57, + 0xfb83c2f9, 0x09370ad0, 0x98a6627e, 0xa2c188f0, 0x3350e05e, + 0xc1e42877, 0x507540d9, 0x258db924, 0xb41cd18a, 0x46a819a3, + 0xd739710d}}; + +#endif + +#endif + +#if N == 5 + +#if W == 8 + +local const z_crc_t FAR crc_braid_table[][256] = { + {0x00000000, 0xaf449247, 0x85f822cf, 0x2abcb088, 0xd08143df, + 0x7fc5d198, 0x55796110, 0xfa3df357, 0x7a7381ff, 0xd53713b8, + 0xff8ba330, 0x50cf3177, 0xaaf2c220, 0x05b65067, 0x2f0ae0ef, + 0x804e72a8, 0xf4e703fe, 0x5ba391b9, 0x711f2131, 0xde5bb376, + 0x24664021, 0x8b22d266, 0xa19e62ee, 0x0edaf0a9, 0x8e948201, + 0x21d01046, 0x0b6ca0ce, 0xa4283289, 0x5e15c1de, 0xf1515399, + 0xdbede311, 0x74a97156, 0x32bf01bd, 0x9dfb93fa, 0xb7472372, + 0x1803b135, 0xe23e4262, 0x4d7ad025, 0x67c660ad, 0xc882f2ea, + 0x48cc8042, 0xe7881205, 0xcd34a28d, 0x627030ca, 0x984dc39d, + 0x370951da, 0x1db5e152, 0xb2f17315, 0xc6580243, 0x691c9004, + 0x43a0208c, 0xece4b2cb, 0x16d9419c, 0xb99dd3db, 0x93216353, + 0x3c65f114, 0xbc2b83bc, 0x136f11fb, 0x39d3a173, 0x96973334, + 0x6caac063, 0xc3ee5224, 0xe952e2ac, 0x461670eb, 0x657e037a, + 0xca3a913d, 0xe08621b5, 0x4fc2b3f2, 0xb5ff40a5, 0x1abbd2e2, + 0x3007626a, 0x9f43f02d, 0x1f0d8285, 0xb04910c2, 0x9af5a04a, + 0x35b1320d, 0xcf8cc15a, 0x60c8531d, 0x4a74e395, 0xe53071d2, + 0x91990084, 0x3edd92c3, 0x1461224b, 0xbb25b00c, 0x4118435b, + 0xee5cd11c, 0xc4e06194, 0x6ba4f3d3, 0xebea817b, 0x44ae133c, + 0x6e12a3b4, 0xc15631f3, 0x3b6bc2a4, 0x942f50e3, 0xbe93e06b, + 0x11d7722c, 0x57c102c7, 0xf8859080, 0xd2392008, 0x7d7db24f, + 0x87404118, 0x2804d35f, 0x02b863d7, 0xadfcf190, 0x2db28338, + 0x82f6117f, 0xa84aa1f7, 0x070e33b0, 0xfd33c0e7, 0x527752a0, + 0x78cbe228, 0xd78f706f, 0xa3260139, 0x0c62937e, 0x26de23f6, + 0x899ab1b1, 0x73a742e6, 0xdce3d0a1, 0xf65f6029, 0x591bf26e, + 0xd95580c6, 0x76111281, 0x5cada209, 0xf3e9304e, 0x09d4c319, + 0xa690515e, 0x8c2ce1d6, 0x23687391, 0xcafc06f4, 0x65b894b3, + 0x4f04243b, 0xe040b67c, 0x1a7d452b, 0xb539d76c, 0x9f8567e4, + 0x30c1f5a3, 0xb08f870b, 0x1fcb154c, 0x3577a5c4, 0x9a333783, + 0x600ec4d4, 0xcf4a5693, 0xe5f6e61b, 0x4ab2745c, 0x3e1b050a, + 0x915f974d, 0xbbe327c5, 0x14a7b582, 0xee9a46d5, 0x41ded492, + 0x6b62641a, 0xc426f65d, 0x446884f5, 0xeb2c16b2, 0xc190a63a, + 0x6ed4347d, 0x94e9c72a, 0x3bad556d, 0x1111e5e5, 0xbe5577a2, + 0xf8430749, 0x5707950e, 0x7dbb2586, 0xd2ffb7c1, 0x28c24496, + 0x8786d6d1, 0xad3a6659, 0x027ef41e, 0x823086b6, 0x2d7414f1, + 0x07c8a479, 0xa88c363e, 0x52b1c569, 0xfdf5572e, 0xd749e7a6, + 0x780d75e1, 0x0ca404b7, 0xa3e096f0, 0x895c2678, 0x2618b43f, + 0xdc254768, 0x7361d52f, 0x59dd65a7, 0xf699f7e0, 0x76d78548, + 0xd993170f, 0xf32fa787, 0x5c6b35c0, 0xa656c697, 0x091254d0, + 0x23aee458, 0x8cea761f, 0xaf82058e, 0x00c697c9, 0x2a7a2741, + 0x853eb506, 0x7f034651, 0xd047d416, 0xfafb649e, 0x55bff6d9, + 0xd5f18471, 0x7ab51636, 0x5009a6be, 0xff4d34f9, 0x0570c7ae, + 0xaa3455e9, 0x8088e561, 0x2fcc7726, 0x5b650670, 0xf4219437, + 0xde9d24bf, 0x71d9b6f8, 0x8be445af, 0x24a0d7e8, 0x0e1c6760, + 0xa158f527, 0x2116878f, 0x8e5215c8, 0xa4eea540, 0x0baa3707, + 0xf197c450, 0x5ed35617, 0x746fe69f, 0xdb2b74d8, 0x9d3d0433, + 0x32799674, 0x18c526fc, 0xb781b4bb, 0x4dbc47ec, 0xe2f8d5ab, + 0xc8446523, 0x6700f764, 0xe74e85cc, 0x480a178b, 0x62b6a703, + 0xcdf23544, 0x37cfc613, 0x988b5454, 0xb237e4dc, 0x1d73769b, + 0x69da07cd, 0xc69e958a, 0xec222502, 0x4366b745, 0xb95b4412, + 0x161fd655, 0x3ca366dd, 0x93e7f49a, 0x13a98632, 0xbced1475, + 0x9651a4fd, 0x391536ba, 0xc328c5ed, 0x6c6c57aa, 0x46d0e722, + 0xe9947565}, + {0x00000000, 0x4e890ba9, 0x9d121752, 0xd39b1cfb, 0xe15528e5, + 0xafdc234c, 0x7c473fb7, 0x32ce341e, 0x19db578b, 0x57525c22, + 0x84c940d9, 0xca404b70, 0xf88e7f6e, 0xb60774c7, 0x659c683c, + 0x2b156395, 0x33b6af16, 0x7d3fa4bf, 0xaea4b844, 0xe02db3ed, + 0xd2e387f3, 0x9c6a8c5a, 0x4ff190a1, 0x01789b08, 0x2a6df89d, + 0x64e4f334, 0xb77fefcf, 0xf9f6e466, 0xcb38d078, 0x85b1dbd1, + 0x562ac72a, 0x18a3cc83, 0x676d5e2c, 0x29e45585, 0xfa7f497e, + 0xb4f642d7, 0x863876c9, 0xc8b17d60, 0x1b2a619b, 0x55a36a32, + 0x7eb609a7, 0x303f020e, 0xe3a41ef5, 0xad2d155c, 0x9fe32142, + 0xd16a2aeb, 0x02f13610, 0x4c783db9, 0x54dbf13a, 0x1a52fa93, + 0xc9c9e668, 0x8740edc1, 0xb58ed9df, 0xfb07d276, 0x289cce8d, + 0x6615c524, 0x4d00a6b1, 0x0389ad18, 0xd012b1e3, 0x9e9bba4a, + 0xac558e54, 0xe2dc85fd, 0x31479906, 0x7fce92af, 0xcedabc58, + 0x8053b7f1, 0x53c8ab0a, 0x1d41a0a3, 0x2f8f94bd, 0x61069f14, + 0xb29d83ef, 0xfc148846, 0xd701ebd3, 0x9988e07a, 0x4a13fc81, + 0x049af728, 0x3654c336, 0x78ddc89f, 0xab46d464, 0xe5cfdfcd, + 0xfd6c134e, 0xb3e518e7, 0x607e041c, 0x2ef70fb5, 0x1c393bab, + 0x52b03002, 0x812b2cf9, 0xcfa22750, 0xe4b744c5, 0xaa3e4f6c, + 0x79a55397, 0x372c583e, 0x05e26c20, 0x4b6b6789, 0x98f07b72, + 0xd67970db, 0xa9b7e274, 0xe73ee9dd, 0x34a5f526, 0x7a2cfe8f, + 0x48e2ca91, 0x066bc138, 0xd5f0ddc3, 0x9b79d66a, 0xb06cb5ff, + 0xfee5be56, 0x2d7ea2ad, 0x63f7a904, 0x51399d1a, 0x1fb096b3, + 0xcc2b8a48, 0x82a281e1, 0x9a014d62, 0xd48846cb, 0x07135a30, + 0x499a5199, 0x7b546587, 0x35dd6e2e, 0xe64672d5, 0xa8cf797c, + 0x83da1ae9, 0xcd531140, 0x1ec80dbb, 0x50410612, 0x628f320c, + 0x2c0639a5, 0xff9d255e, 0xb1142ef7, 0x46c47ef1, 0x084d7558, + 0xdbd669a3, 0x955f620a, 0xa7915614, 0xe9185dbd, 0x3a834146, + 0x740a4aef, 0x5f1f297a, 0x119622d3, 0xc20d3e28, 0x8c843581, + 0xbe4a019f, 0xf0c30a36, 0x235816cd, 0x6dd11d64, 0x7572d1e7, + 0x3bfbda4e, 0xe860c6b5, 0xa6e9cd1c, 0x9427f902, 0xdaaef2ab, + 0x0935ee50, 0x47bce5f9, 0x6ca9866c, 0x22208dc5, 0xf1bb913e, + 0xbf329a97, 0x8dfcae89, 0xc375a520, 0x10eeb9db, 0x5e67b272, + 0x21a920dd, 0x6f202b74, 0xbcbb378f, 0xf2323c26, 0xc0fc0838, + 0x8e750391, 0x5dee1f6a, 0x136714c3, 0x38727756, 0x76fb7cff, + 0xa5606004, 0xebe96bad, 0xd9275fb3, 0x97ae541a, 0x443548e1, + 0x0abc4348, 0x121f8fcb, 0x5c968462, 0x8f0d9899, 0xc1849330, + 0xf34aa72e, 0xbdc3ac87, 0x6e58b07c, 0x20d1bbd5, 0x0bc4d840, + 0x454dd3e9, 0x96d6cf12, 0xd85fc4bb, 0xea91f0a5, 0xa418fb0c, + 0x7783e7f7, 0x390aec5e, 0x881ec2a9, 0xc697c900, 0x150cd5fb, + 0x5b85de52, 0x694bea4c, 0x27c2e1e5, 0xf459fd1e, 0xbad0f6b7, + 0x91c59522, 0xdf4c9e8b, 0x0cd78270, 0x425e89d9, 0x7090bdc7, + 0x3e19b66e, 0xed82aa95, 0xa30ba13c, 0xbba86dbf, 0xf5216616, + 0x26ba7aed, 0x68337144, 0x5afd455a, 0x14744ef3, 0xc7ef5208, + 0x896659a1, 0xa2733a34, 0xecfa319d, 0x3f612d66, 0x71e826cf, + 0x432612d1, 0x0daf1978, 0xde340583, 0x90bd0e2a, 0xef739c85, + 0xa1fa972c, 0x72618bd7, 0x3ce8807e, 0x0e26b460, 0x40afbfc9, + 0x9334a332, 0xddbda89b, 0xf6a8cb0e, 0xb821c0a7, 0x6bbadc5c, + 0x2533d7f5, 0x17fde3eb, 0x5974e842, 0x8aeff4b9, 0xc466ff10, + 0xdcc53393, 0x924c383a, 0x41d724c1, 0x0f5e2f68, 0x3d901b76, + 0x731910df, 0xa0820c24, 0xee0b078d, 0xc51e6418, 0x8b976fb1, + 0x580c734a, 0x168578e3, 0x244b4cfd, 0x6ac24754, 0xb9595baf, + 0xf7d05006}, + {0x00000000, 0x8d88fde2, 0xc060fd85, 0x4de80067, 0x5bb0fd4b, + 0xd63800a9, 0x9bd000ce, 0x1658fd2c, 0xb761fa96, 0x3ae90774, + 0x77010713, 0xfa89faf1, 0xecd107dd, 0x6159fa3f, 0x2cb1fa58, + 0xa13907ba, 0xb5b2f36d, 0x383a0e8f, 0x75d20ee8, 0xf85af30a, + 0xee020e26, 0x638af3c4, 0x2e62f3a3, 0xa3ea0e41, 0x02d309fb, + 0x8f5bf419, 0xc2b3f47e, 0x4f3b099c, 0x5963f4b0, 0xd4eb0952, + 0x99030935, 0x148bf4d7, 0xb014e09b, 0x3d9c1d79, 0x70741d1e, + 0xfdfce0fc, 0xeba41dd0, 0x662ce032, 0x2bc4e055, 0xa64c1db7, + 0x07751a0d, 0x8afde7ef, 0xc715e788, 0x4a9d1a6a, 0x5cc5e746, + 0xd14d1aa4, 0x9ca51ac3, 0x112de721, 0x05a613f6, 0x882eee14, + 0xc5c6ee73, 0x484e1391, 0x5e16eebd, 0xd39e135f, 0x9e761338, + 0x13feeeda, 0xb2c7e960, 0x3f4f1482, 0x72a714e5, 0xff2fe907, + 0xe977142b, 0x64ffe9c9, 0x2917e9ae, 0xa49f144c, 0xbb58c777, + 0x36d03a95, 0x7b383af2, 0xf6b0c710, 0xe0e83a3c, 0x6d60c7de, + 0x2088c7b9, 0xad003a5b, 0x0c393de1, 0x81b1c003, 0xcc59c064, + 0x41d13d86, 0x5789c0aa, 0xda013d48, 0x97e93d2f, 0x1a61c0cd, + 0x0eea341a, 0x8362c9f8, 0xce8ac99f, 0x4302347d, 0x555ac951, + 0xd8d234b3, 0x953a34d4, 0x18b2c936, 0xb98bce8c, 0x3403336e, + 0x79eb3309, 0xf463ceeb, 0xe23b33c7, 0x6fb3ce25, 0x225bce42, + 0xafd333a0, 0x0b4c27ec, 0x86c4da0e, 0xcb2cda69, 0x46a4278b, + 0x50fcdaa7, 0xdd742745, 0x909c2722, 0x1d14dac0, 0xbc2ddd7a, + 0x31a52098, 0x7c4d20ff, 0xf1c5dd1d, 0xe79d2031, 0x6a15ddd3, + 0x27fdddb4, 0xaa752056, 0xbefed481, 0x33762963, 0x7e9e2904, + 0xf316d4e6, 0xe54e29ca, 0x68c6d428, 0x252ed44f, 0xa8a629ad, + 0x099f2e17, 0x8417d3f5, 0xc9ffd392, 0x44772e70, 0x522fd35c, + 0xdfa72ebe, 0x924f2ed9, 0x1fc7d33b, 0xadc088af, 0x2048754d, + 0x6da0752a, 0xe02888c8, 0xf67075e4, 0x7bf88806, 0x36108861, + 0xbb987583, 0x1aa17239, 0x97298fdb, 0xdac18fbc, 0x5749725e, + 0x41118f72, 0xcc997290, 0x817172f7, 0x0cf98f15, 0x18727bc2, + 0x95fa8620, 0xd8128647, 0x559a7ba5, 0x43c28689, 0xce4a7b6b, + 0x83a27b0c, 0x0e2a86ee, 0xaf138154, 0x229b7cb6, 0x6f737cd1, + 0xe2fb8133, 0xf4a37c1f, 0x792b81fd, 0x34c3819a, 0xb94b7c78, + 0x1dd46834, 0x905c95d6, 0xddb495b1, 0x503c6853, 0x4664957f, + 0xcbec689d, 0x860468fa, 0x0b8c9518, 0xaab592a2, 0x273d6f40, + 0x6ad56f27, 0xe75d92c5, 0xf1056fe9, 0x7c8d920b, 0x3165926c, + 0xbced6f8e, 0xa8669b59, 0x25ee66bb, 0x680666dc, 0xe58e9b3e, + 0xf3d66612, 0x7e5e9bf0, 0x33b69b97, 0xbe3e6675, 0x1f0761cf, + 0x928f9c2d, 0xdf679c4a, 0x52ef61a8, 0x44b79c84, 0xc93f6166, + 0x84d76101, 0x095f9ce3, 0x16984fd8, 0x9b10b23a, 0xd6f8b25d, + 0x5b704fbf, 0x4d28b293, 0xc0a04f71, 0x8d484f16, 0x00c0b2f4, + 0xa1f9b54e, 0x2c7148ac, 0x619948cb, 0xec11b529, 0xfa494805, + 0x77c1b5e7, 0x3a29b580, 0xb7a14862, 0xa32abcb5, 0x2ea24157, + 0x634a4130, 0xeec2bcd2, 0xf89a41fe, 0x7512bc1c, 0x38fabc7b, + 0xb5724199, 0x144b4623, 0x99c3bbc1, 0xd42bbba6, 0x59a34644, + 0x4ffbbb68, 0xc273468a, 0x8f9b46ed, 0x0213bb0f, 0xa68caf43, + 0x2b0452a1, 0x66ec52c6, 0xeb64af24, 0xfd3c5208, 0x70b4afea, + 0x3d5caf8d, 0xb0d4526f, 0x11ed55d5, 0x9c65a837, 0xd18da850, + 0x5c0555b2, 0x4a5da89e, 0xc7d5557c, 0x8a3d551b, 0x07b5a8f9, + 0x133e5c2e, 0x9eb6a1cc, 0xd35ea1ab, 0x5ed65c49, 0x488ea165, + 0xc5065c87, 0x88ee5ce0, 0x0566a102, 0xa45fa6b8, 0x29d75b5a, + 0x643f5b3d, 0xe9b7a6df, 0xffef5bf3, 0x7267a611, 0x3f8fa676, + 0xb2075b94}, + {0x00000000, 0x80f0171f, 0xda91287f, 0x5a613f60, 0x6e5356bf, + 0xeea341a0, 0xb4c27ec0, 0x343269df, 0xdca6ad7e, 0x5c56ba61, + 0x06378501, 0x86c7921e, 0xb2f5fbc1, 0x3205ecde, 0x6864d3be, + 0xe894c4a1, 0x623c5cbd, 0xe2cc4ba2, 0xb8ad74c2, 0x385d63dd, + 0x0c6f0a02, 0x8c9f1d1d, 0xd6fe227d, 0x560e3562, 0xbe9af1c3, + 0x3e6ae6dc, 0x640bd9bc, 0xe4fbcea3, 0xd0c9a77c, 0x5039b063, + 0x0a588f03, 0x8aa8981c, 0xc478b97a, 0x4488ae65, 0x1ee99105, + 0x9e19861a, 0xaa2befc5, 0x2adbf8da, 0x70bac7ba, 0xf04ad0a5, + 0x18de1404, 0x982e031b, 0xc24f3c7b, 0x42bf2b64, 0x768d42bb, + 0xf67d55a4, 0xac1c6ac4, 0x2cec7ddb, 0xa644e5c7, 0x26b4f2d8, + 0x7cd5cdb8, 0xfc25daa7, 0xc817b378, 0x48e7a467, 0x12869b07, + 0x92768c18, 0x7ae248b9, 0xfa125fa6, 0xa07360c6, 0x208377d9, + 0x14b11e06, 0x94410919, 0xce203679, 0x4ed02166, 0x538074b5, + 0xd37063aa, 0x89115cca, 0x09e14bd5, 0x3dd3220a, 0xbd233515, + 0xe7420a75, 0x67b21d6a, 0x8f26d9cb, 0x0fd6ced4, 0x55b7f1b4, + 0xd547e6ab, 0xe1758f74, 0x6185986b, 0x3be4a70b, 0xbb14b014, + 0x31bc2808, 0xb14c3f17, 0xeb2d0077, 0x6bdd1768, 0x5fef7eb7, + 0xdf1f69a8, 0x857e56c8, 0x058e41d7, 0xed1a8576, 0x6dea9269, + 0x378bad09, 0xb77bba16, 0x8349d3c9, 0x03b9c4d6, 0x59d8fbb6, + 0xd928eca9, 0x97f8cdcf, 0x1708dad0, 0x4d69e5b0, 0xcd99f2af, + 0xf9ab9b70, 0x795b8c6f, 0x233ab30f, 0xa3caa410, 0x4b5e60b1, + 0xcbae77ae, 0x91cf48ce, 0x113f5fd1, 0x250d360e, 0xa5fd2111, + 0xff9c1e71, 0x7f6c096e, 0xf5c49172, 0x7534866d, 0x2f55b90d, + 0xafa5ae12, 0x9b97c7cd, 0x1b67d0d2, 0x4106efb2, 0xc1f6f8ad, + 0x29623c0c, 0xa9922b13, 0xf3f31473, 0x7303036c, 0x47316ab3, + 0xc7c17dac, 0x9da042cc, 0x1d5055d3, 0xa700e96a, 0x27f0fe75, + 0x7d91c115, 0xfd61d60a, 0xc953bfd5, 0x49a3a8ca, 0x13c297aa, + 0x933280b5, 0x7ba64414, 0xfb56530b, 0xa1376c6b, 0x21c77b74, + 0x15f512ab, 0x950505b4, 0xcf643ad4, 0x4f942dcb, 0xc53cb5d7, + 0x45cca2c8, 0x1fad9da8, 0x9f5d8ab7, 0xab6fe368, 0x2b9ff477, + 0x71fecb17, 0xf10edc08, 0x199a18a9, 0x996a0fb6, 0xc30b30d6, + 0x43fb27c9, 0x77c94e16, 0xf7395909, 0xad586669, 0x2da87176, + 0x63785010, 0xe388470f, 0xb9e9786f, 0x39196f70, 0x0d2b06af, + 0x8ddb11b0, 0xd7ba2ed0, 0x574a39cf, 0xbfdefd6e, 0x3f2eea71, + 0x654fd511, 0xe5bfc20e, 0xd18dabd1, 0x517dbcce, 0x0b1c83ae, + 0x8bec94b1, 0x01440cad, 0x81b41bb2, 0xdbd524d2, 0x5b2533cd, + 0x6f175a12, 0xefe74d0d, 0xb586726d, 0x35766572, 0xdde2a1d3, + 0x5d12b6cc, 0x077389ac, 0x87839eb3, 0xb3b1f76c, 0x3341e073, + 0x6920df13, 0xe9d0c80c, 0xf4809ddf, 0x74708ac0, 0x2e11b5a0, + 0xaee1a2bf, 0x9ad3cb60, 0x1a23dc7f, 0x4042e31f, 0xc0b2f400, + 0x282630a1, 0xa8d627be, 0xf2b718de, 0x72470fc1, 0x4675661e, + 0xc6857101, 0x9ce44e61, 0x1c14597e, 0x96bcc162, 0x164cd67d, + 0x4c2de91d, 0xccddfe02, 0xf8ef97dd, 0x781f80c2, 0x227ebfa2, + 0xa28ea8bd, 0x4a1a6c1c, 0xcaea7b03, 0x908b4463, 0x107b537c, + 0x24493aa3, 0xa4b92dbc, 0xfed812dc, 0x7e2805c3, 0x30f824a5, + 0xb00833ba, 0xea690cda, 0x6a991bc5, 0x5eab721a, 0xde5b6505, + 0x843a5a65, 0x04ca4d7a, 0xec5e89db, 0x6cae9ec4, 0x36cfa1a4, + 0xb63fb6bb, 0x820ddf64, 0x02fdc87b, 0x589cf71b, 0xd86ce004, + 0x52c47818, 0xd2346f07, 0x88555067, 0x08a54778, 0x3c972ea7, + 0xbc6739b8, 0xe60606d8, 0x66f611c7, 0x8e62d566, 0x0e92c279, + 0x54f3fd19, 0xd403ea06, 0xe03183d9, 0x60c194c6, 0x3aa0aba6, + 0xba50bcb9}, + {0x00000000, 0x9570d495, 0xf190af6b, 0x64e07bfe, 0x38505897, + 0xad208c02, 0xc9c0f7fc, 0x5cb02369, 0x70a0b12e, 0xe5d065bb, + 0x81301e45, 0x1440cad0, 0x48f0e9b9, 0xdd803d2c, 0xb96046d2, + 0x2c109247, 0xe141625c, 0x7431b6c9, 0x10d1cd37, 0x85a119a2, + 0xd9113acb, 0x4c61ee5e, 0x288195a0, 0xbdf14135, 0x91e1d372, + 0x049107e7, 0x60717c19, 0xf501a88c, 0xa9b18be5, 0x3cc15f70, + 0x5821248e, 0xcd51f01b, 0x19f3c2f9, 0x8c83166c, 0xe8636d92, + 0x7d13b907, 0x21a39a6e, 0xb4d34efb, 0xd0333505, 0x4543e190, + 0x695373d7, 0xfc23a742, 0x98c3dcbc, 0x0db30829, 0x51032b40, + 0xc473ffd5, 0xa093842b, 0x35e350be, 0xf8b2a0a5, 0x6dc27430, + 0x09220fce, 0x9c52db5b, 0xc0e2f832, 0x55922ca7, 0x31725759, + 0xa40283cc, 0x8812118b, 0x1d62c51e, 0x7982bee0, 0xecf26a75, + 0xb042491c, 0x25329d89, 0x41d2e677, 0xd4a232e2, 0x33e785f2, + 0xa6975167, 0xc2772a99, 0x5707fe0c, 0x0bb7dd65, 0x9ec709f0, + 0xfa27720e, 0x6f57a69b, 0x434734dc, 0xd637e049, 0xb2d79bb7, + 0x27a74f22, 0x7b176c4b, 0xee67b8de, 0x8a87c320, 0x1ff717b5, + 0xd2a6e7ae, 0x47d6333b, 0x233648c5, 0xb6469c50, 0xeaf6bf39, + 0x7f866bac, 0x1b661052, 0x8e16c4c7, 0xa2065680, 0x37768215, + 0x5396f9eb, 0xc6e62d7e, 0x9a560e17, 0x0f26da82, 0x6bc6a17c, + 0xfeb675e9, 0x2a14470b, 0xbf64939e, 0xdb84e860, 0x4ef43cf5, + 0x12441f9c, 0x8734cb09, 0xe3d4b0f7, 0x76a46462, 0x5ab4f625, + 0xcfc422b0, 0xab24594e, 0x3e548ddb, 0x62e4aeb2, 0xf7947a27, + 0x937401d9, 0x0604d54c, 0xcb552557, 0x5e25f1c2, 0x3ac58a3c, + 0xafb55ea9, 0xf3057dc0, 0x6675a955, 0x0295d2ab, 0x97e5063e, + 0xbbf59479, 0x2e8540ec, 0x4a653b12, 0xdf15ef87, 0x83a5ccee, + 0x16d5187b, 0x72356385, 0xe745b710, 0x67cf0be4, 0xf2bfdf71, + 0x965fa48f, 0x032f701a, 0x5f9f5373, 0xcaef87e6, 0xae0ffc18, + 0x3b7f288d, 0x176fbaca, 0x821f6e5f, 0xe6ff15a1, 0x738fc134, + 0x2f3fe25d, 0xba4f36c8, 0xdeaf4d36, 0x4bdf99a3, 0x868e69b8, + 0x13febd2d, 0x771ec6d3, 0xe26e1246, 0xbede312f, 0x2baee5ba, + 0x4f4e9e44, 0xda3e4ad1, 0xf62ed896, 0x635e0c03, 0x07be77fd, + 0x92cea368, 0xce7e8001, 0x5b0e5494, 0x3fee2f6a, 0xaa9efbff, + 0x7e3cc91d, 0xeb4c1d88, 0x8fac6676, 0x1adcb2e3, 0x466c918a, + 0xd31c451f, 0xb7fc3ee1, 0x228cea74, 0x0e9c7833, 0x9becaca6, + 0xff0cd758, 0x6a7c03cd, 0x36cc20a4, 0xa3bcf431, 0xc75c8fcf, + 0x522c5b5a, 0x9f7dab41, 0x0a0d7fd4, 0x6eed042a, 0xfb9dd0bf, + 0xa72df3d6, 0x325d2743, 0x56bd5cbd, 0xc3cd8828, 0xefdd1a6f, + 0x7aadcefa, 0x1e4db504, 0x8b3d6191, 0xd78d42f8, 0x42fd966d, + 0x261ded93, 0xb36d3906, 0x54288e16, 0xc1585a83, 0xa5b8217d, + 0x30c8f5e8, 0x6c78d681, 0xf9080214, 0x9de879ea, 0x0898ad7f, + 0x24883f38, 0xb1f8ebad, 0xd5189053, 0x406844c6, 0x1cd867af, + 0x89a8b33a, 0xed48c8c4, 0x78381c51, 0xb569ec4a, 0x201938df, + 0x44f94321, 0xd18997b4, 0x8d39b4dd, 0x18496048, 0x7ca91bb6, + 0xe9d9cf23, 0xc5c95d64, 0x50b989f1, 0x3459f20f, 0xa129269a, + 0xfd9905f3, 0x68e9d166, 0x0c09aa98, 0x99797e0d, 0x4ddb4cef, + 0xd8ab987a, 0xbc4be384, 0x293b3711, 0x758b1478, 0xe0fbc0ed, + 0x841bbb13, 0x116b6f86, 0x3d7bfdc1, 0xa80b2954, 0xcceb52aa, + 0x599b863f, 0x052ba556, 0x905b71c3, 0xf4bb0a3d, 0x61cbdea8, + 0xac9a2eb3, 0x39eafa26, 0x5d0a81d8, 0xc87a554d, 0x94ca7624, + 0x01baa2b1, 0x655ad94f, 0xf02a0dda, 0xdc3a9f9d, 0x494a4b08, + 0x2daa30f6, 0xb8dae463, 0xe46ac70a, 0x711a139f, 0x15fa6861, + 0x808abcf4}, + {0x00000000, 0xcf9e17c8, 0x444d29d1, 0x8bd33e19, 0x889a53a2, + 0x4704446a, 0xccd77a73, 0x03496dbb, 0xca45a105, 0x05dbb6cd, + 0x8e0888d4, 0x41969f1c, 0x42dff2a7, 0x8d41e56f, 0x0692db76, + 0xc90cccbe, 0x4ffa444b, 0x80645383, 0x0bb76d9a, 0xc4297a52, + 0xc76017e9, 0x08fe0021, 0x832d3e38, 0x4cb329f0, 0x85bfe54e, + 0x4a21f286, 0xc1f2cc9f, 0x0e6cdb57, 0x0d25b6ec, 0xc2bba124, + 0x49689f3d, 0x86f688f5, 0x9ff48896, 0x506a9f5e, 0xdbb9a147, + 0x1427b68f, 0x176edb34, 0xd8f0ccfc, 0x5323f2e5, 0x9cbde52d, + 0x55b12993, 0x9a2f3e5b, 0x11fc0042, 0xde62178a, 0xdd2b7a31, + 0x12b56df9, 0x996653e0, 0x56f84428, 0xd00eccdd, 0x1f90db15, + 0x9443e50c, 0x5bddf2c4, 0x58949f7f, 0x970a88b7, 0x1cd9b6ae, + 0xd347a166, 0x1a4b6dd8, 0xd5d57a10, 0x5e064409, 0x919853c1, + 0x92d13e7a, 0x5d4f29b2, 0xd69c17ab, 0x19020063, 0xe498176d, + 0x2b0600a5, 0xa0d53ebc, 0x6f4b2974, 0x6c0244cf, 0xa39c5307, + 0x284f6d1e, 0xe7d17ad6, 0x2eddb668, 0xe143a1a0, 0x6a909fb9, + 0xa50e8871, 0xa647e5ca, 0x69d9f202, 0xe20acc1b, 0x2d94dbd3, + 0xab625326, 0x64fc44ee, 0xef2f7af7, 0x20b16d3f, 0x23f80084, + 0xec66174c, 0x67b52955, 0xa82b3e9d, 0x6127f223, 0xaeb9e5eb, + 0x256adbf2, 0xeaf4cc3a, 0xe9bda181, 0x2623b649, 0xadf08850, + 0x626e9f98, 0x7b6c9ffb, 0xb4f28833, 0x3f21b62a, 0xf0bfa1e2, + 0xf3f6cc59, 0x3c68db91, 0xb7bbe588, 0x7825f240, 0xb1293efe, + 0x7eb72936, 0xf564172f, 0x3afa00e7, 0x39b36d5c, 0xf62d7a94, + 0x7dfe448d, 0xb2605345, 0x3496dbb0, 0xfb08cc78, 0x70dbf261, + 0xbf45e5a9, 0xbc0c8812, 0x73929fda, 0xf841a1c3, 0x37dfb60b, + 0xfed37ab5, 0x314d6d7d, 0xba9e5364, 0x750044ac, 0x76492917, + 0xb9d73edf, 0x320400c6, 0xfd9a170e, 0x1241289b, 0xdddf3f53, + 0x560c014a, 0x99921682, 0x9adb7b39, 0x55456cf1, 0xde9652e8, + 0x11084520, 0xd804899e, 0x179a9e56, 0x9c49a04f, 0x53d7b787, + 0x509eda3c, 0x9f00cdf4, 0x14d3f3ed, 0xdb4de425, 0x5dbb6cd0, + 0x92257b18, 0x19f64501, 0xd66852c9, 0xd5213f72, 0x1abf28ba, + 0x916c16a3, 0x5ef2016b, 0x97fecdd5, 0x5860da1d, 0xd3b3e404, + 0x1c2df3cc, 0x1f649e77, 0xd0fa89bf, 0x5b29b7a6, 0x94b7a06e, + 0x8db5a00d, 0x422bb7c5, 0xc9f889dc, 0x06669e14, 0x052ff3af, + 0xcab1e467, 0x4162da7e, 0x8efccdb6, 0x47f00108, 0x886e16c0, + 0x03bd28d9, 0xcc233f11, 0xcf6a52aa, 0x00f44562, 0x8b277b7b, + 0x44b96cb3, 0xc24fe446, 0x0dd1f38e, 0x8602cd97, 0x499cda5f, + 0x4ad5b7e4, 0x854ba02c, 0x0e989e35, 0xc10689fd, 0x080a4543, + 0xc794528b, 0x4c476c92, 0x83d97b5a, 0x809016e1, 0x4f0e0129, + 0xc4dd3f30, 0x0b4328f8, 0xf6d93ff6, 0x3947283e, 0xb2941627, + 0x7d0a01ef, 0x7e436c54, 0xb1dd7b9c, 0x3a0e4585, 0xf590524d, + 0x3c9c9ef3, 0xf302893b, 0x78d1b722, 0xb74fa0ea, 0xb406cd51, + 0x7b98da99, 0xf04be480, 0x3fd5f348, 0xb9237bbd, 0x76bd6c75, + 0xfd6e526c, 0x32f045a4, 0x31b9281f, 0xfe273fd7, 0x75f401ce, + 0xba6a1606, 0x7366dab8, 0xbcf8cd70, 0x372bf369, 0xf8b5e4a1, + 0xfbfc891a, 0x34629ed2, 0xbfb1a0cb, 0x702fb703, 0x692db760, + 0xa6b3a0a8, 0x2d609eb1, 0xe2fe8979, 0xe1b7e4c2, 0x2e29f30a, + 0xa5facd13, 0x6a64dadb, 0xa3681665, 0x6cf601ad, 0xe7253fb4, + 0x28bb287c, 0x2bf245c7, 0xe46c520f, 0x6fbf6c16, 0xa0217bde, + 0x26d7f32b, 0xe949e4e3, 0x629adafa, 0xad04cd32, 0xae4da089, + 0x61d3b741, 0xea008958, 0x259e9e90, 0xec92522e, 0x230c45e6, + 0xa8df7bff, 0x67416c37, 0x6408018c, 0xab961644, 0x2045285d, + 0xefdb3f95}, + {0x00000000, 0x24825136, 0x4904a26c, 0x6d86f35a, 0x920944d8, + 0xb68b15ee, 0xdb0de6b4, 0xff8fb782, 0xff638ff1, 0xdbe1dec7, + 0xb6672d9d, 0x92e57cab, 0x6d6acb29, 0x49e89a1f, 0x246e6945, + 0x00ec3873, 0x25b619a3, 0x01344895, 0x6cb2bbcf, 0x4830eaf9, + 0xb7bf5d7b, 0x933d0c4d, 0xfebbff17, 0xda39ae21, 0xdad59652, + 0xfe57c764, 0x93d1343e, 0xb7536508, 0x48dcd28a, 0x6c5e83bc, + 0x01d870e6, 0x255a21d0, 0x4b6c3346, 0x6fee6270, 0x0268912a, + 0x26eac01c, 0xd965779e, 0xfde726a8, 0x9061d5f2, 0xb4e384c4, + 0xb40fbcb7, 0x908ded81, 0xfd0b1edb, 0xd9894fed, 0x2606f86f, + 0x0284a959, 0x6f025a03, 0x4b800b35, 0x6eda2ae5, 0x4a587bd3, + 0x27de8889, 0x035cd9bf, 0xfcd36e3d, 0xd8513f0b, 0xb5d7cc51, + 0x91559d67, 0x91b9a514, 0xb53bf422, 0xd8bd0778, 0xfc3f564e, + 0x03b0e1cc, 0x2732b0fa, 0x4ab443a0, 0x6e361296, 0x96d8668c, + 0xb25a37ba, 0xdfdcc4e0, 0xfb5e95d6, 0x04d12254, 0x20537362, + 0x4dd58038, 0x6957d10e, 0x69bbe97d, 0x4d39b84b, 0x20bf4b11, + 0x043d1a27, 0xfbb2ada5, 0xdf30fc93, 0xb2b60fc9, 0x96345eff, + 0xb36e7f2f, 0x97ec2e19, 0xfa6add43, 0xdee88c75, 0x21673bf7, + 0x05e56ac1, 0x6863999b, 0x4ce1c8ad, 0x4c0df0de, 0x688fa1e8, + 0x050952b2, 0x218b0384, 0xde04b406, 0xfa86e530, 0x9700166a, + 0xb382475c, 0xddb455ca, 0xf93604fc, 0x94b0f7a6, 0xb032a690, + 0x4fbd1112, 0x6b3f4024, 0x06b9b37e, 0x223be248, 0x22d7da3b, + 0x06558b0d, 0x6bd37857, 0x4f512961, 0xb0de9ee3, 0x945ccfd5, + 0xf9da3c8f, 0xdd586db9, 0xf8024c69, 0xdc801d5f, 0xb106ee05, + 0x9584bf33, 0x6a0b08b1, 0x4e895987, 0x230faadd, 0x078dfbeb, + 0x0761c398, 0x23e392ae, 0x4e6561f4, 0x6ae730c2, 0x95688740, + 0xb1ead676, 0xdc6c252c, 0xf8ee741a, 0xf6c1cb59, 0xd2439a6f, + 0xbfc56935, 0x9b473803, 0x64c88f81, 0x404adeb7, 0x2dcc2ded, + 0x094e7cdb, 0x09a244a8, 0x2d20159e, 0x40a6e6c4, 0x6424b7f2, + 0x9bab0070, 0xbf295146, 0xd2afa21c, 0xf62df32a, 0xd377d2fa, + 0xf7f583cc, 0x9a737096, 0xbef121a0, 0x417e9622, 0x65fcc714, + 0x087a344e, 0x2cf86578, 0x2c145d0b, 0x08960c3d, 0x6510ff67, + 0x4192ae51, 0xbe1d19d3, 0x9a9f48e5, 0xf719bbbf, 0xd39bea89, + 0xbdadf81f, 0x992fa929, 0xf4a95a73, 0xd02b0b45, 0x2fa4bcc7, + 0x0b26edf1, 0x66a01eab, 0x42224f9d, 0x42ce77ee, 0x664c26d8, + 0x0bcad582, 0x2f4884b4, 0xd0c73336, 0xf4456200, 0x99c3915a, + 0xbd41c06c, 0x981be1bc, 0xbc99b08a, 0xd11f43d0, 0xf59d12e6, + 0x0a12a564, 0x2e90f452, 0x43160708, 0x6794563e, 0x67786e4d, + 0x43fa3f7b, 0x2e7ccc21, 0x0afe9d17, 0xf5712a95, 0xd1f37ba3, + 0xbc7588f9, 0x98f7d9cf, 0x6019add5, 0x449bfce3, 0x291d0fb9, + 0x0d9f5e8f, 0xf210e90d, 0xd692b83b, 0xbb144b61, 0x9f961a57, + 0x9f7a2224, 0xbbf87312, 0xd67e8048, 0xf2fcd17e, 0x0d7366fc, + 0x29f137ca, 0x4477c490, 0x60f595a6, 0x45afb476, 0x612de540, + 0x0cab161a, 0x2829472c, 0xd7a6f0ae, 0xf324a198, 0x9ea252c2, + 0xba2003f4, 0xbacc3b87, 0x9e4e6ab1, 0xf3c899eb, 0xd74ac8dd, + 0x28c57f5f, 0x0c472e69, 0x61c1dd33, 0x45438c05, 0x2b759e93, + 0x0ff7cfa5, 0x62713cff, 0x46f36dc9, 0xb97cda4b, 0x9dfe8b7d, + 0xf0787827, 0xd4fa2911, 0xd4161162, 0xf0944054, 0x9d12b30e, + 0xb990e238, 0x461f55ba, 0x629d048c, 0x0f1bf7d6, 0x2b99a6e0, + 0x0ec38730, 0x2a41d606, 0x47c7255c, 0x6345746a, 0x9ccac3e8, + 0xb84892de, 0xd5ce6184, 0xf14c30b2, 0xf1a008c1, 0xd52259f7, + 0xb8a4aaad, 0x9c26fb9b, 0x63a94c19, 0x472b1d2f, 0x2aadee75, + 0x0e2fbf43}, + {0x00000000, 0x36f290f3, 0x6de521e6, 0x5b17b115, 0xdbca43cc, + 0xed38d33f, 0xb62f622a, 0x80ddf2d9, 0x6ce581d9, 0x5a17112a, + 0x0100a03f, 0x37f230cc, 0xb72fc215, 0x81dd52e6, 0xdacae3f3, + 0xec387300, 0xd9cb03b2, 0xef399341, 0xb42e2254, 0x82dcb2a7, + 0x0201407e, 0x34f3d08d, 0x6fe46198, 0x5916f16b, 0xb52e826b, + 0x83dc1298, 0xd8cba38d, 0xee39337e, 0x6ee4c1a7, 0x58165154, + 0x0301e041, 0x35f370b2, 0x68e70125, 0x5e1591d6, 0x050220c3, + 0x33f0b030, 0xb32d42e9, 0x85dfd21a, 0xdec8630f, 0xe83af3fc, + 0x040280fc, 0x32f0100f, 0x69e7a11a, 0x5f1531e9, 0xdfc8c330, + 0xe93a53c3, 0xb22de2d6, 0x84df7225, 0xb12c0297, 0x87de9264, + 0xdcc92371, 0xea3bb382, 0x6ae6415b, 0x5c14d1a8, 0x070360bd, + 0x31f1f04e, 0xddc9834e, 0xeb3b13bd, 0xb02ca2a8, 0x86de325b, + 0x0603c082, 0x30f15071, 0x6be6e164, 0x5d147197, 0xd1ce024a, + 0xe73c92b9, 0xbc2b23ac, 0x8ad9b35f, 0x0a044186, 0x3cf6d175, + 0x67e16060, 0x5113f093, 0xbd2b8393, 0x8bd91360, 0xd0cea275, + 0xe63c3286, 0x66e1c05f, 0x501350ac, 0x0b04e1b9, 0x3df6714a, + 0x080501f8, 0x3ef7910b, 0x65e0201e, 0x5312b0ed, 0xd3cf4234, + 0xe53dd2c7, 0xbe2a63d2, 0x88d8f321, 0x64e08021, 0x521210d2, + 0x0905a1c7, 0x3ff73134, 0xbf2ac3ed, 0x89d8531e, 0xd2cfe20b, + 0xe43d72f8, 0xb929036f, 0x8fdb939c, 0xd4cc2289, 0xe23eb27a, + 0x62e340a3, 0x5411d050, 0x0f066145, 0x39f4f1b6, 0xd5cc82b6, + 0xe33e1245, 0xb829a350, 0x8edb33a3, 0x0e06c17a, 0x38f45189, + 0x63e3e09c, 0x5511706f, 0x60e200dd, 0x5610902e, 0x0d07213b, + 0x3bf5b1c8, 0xbb284311, 0x8ddad3e2, 0xd6cd62f7, 0xe03ff204, + 0x0c078104, 0x3af511f7, 0x61e2a0e2, 0x57103011, 0xd7cdc2c8, + 0xe13f523b, 0xba28e32e, 0x8cda73dd, 0x78ed02d5, 0x4e1f9226, + 0x15082333, 0x23fab3c0, 0xa3274119, 0x95d5d1ea, 0xcec260ff, + 0xf830f00c, 0x1408830c, 0x22fa13ff, 0x79eda2ea, 0x4f1f3219, + 0xcfc2c0c0, 0xf9305033, 0xa227e126, 0x94d571d5, 0xa1260167, + 0x97d49194, 0xccc32081, 0xfa31b072, 0x7aec42ab, 0x4c1ed258, + 0x1709634d, 0x21fbf3be, 0xcdc380be, 0xfb31104d, 0xa026a158, + 0x96d431ab, 0x1609c372, 0x20fb5381, 0x7bece294, 0x4d1e7267, + 0x100a03f0, 0x26f89303, 0x7def2216, 0x4b1db2e5, 0xcbc0403c, + 0xfd32d0cf, 0xa62561da, 0x90d7f129, 0x7cef8229, 0x4a1d12da, + 0x110aa3cf, 0x27f8333c, 0xa725c1e5, 0x91d75116, 0xcac0e003, + 0xfc3270f0, 0xc9c10042, 0xff3390b1, 0xa42421a4, 0x92d6b157, + 0x120b438e, 0x24f9d37d, 0x7fee6268, 0x491cf29b, 0xa524819b, + 0x93d61168, 0xc8c1a07d, 0xfe33308e, 0x7eeec257, 0x481c52a4, + 0x130be3b1, 0x25f97342, 0xa923009f, 0x9fd1906c, 0xc4c62179, + 0xf234b18a, 0x72e94353, 0x441bd3a0, 0x1f0c62b5, 0x29fef246, + 0xc5c68146, 0xf33411b5, 0xa823a0a0, 0x9ed13053, 0x1e0cc28a, + 0x28fe5279, 0x73e9e36c, 0x451b739f, 0x70e8032d, 0x461a93de, + 0x1d0d22cb, 0x2bffb238, 0xab2240e1, 0x9dd0d012, 0xc6c76107, + 0xf035f1f4, 0x1c0d82f4, 0x2aff1207, 0x71e8a312, 0x471a33e1, + 0xc7c7c138, 0xf13551cb, 0xaa22e0de, 0x9cd0702d, 0xc1c401ba, + 0xf7369149, 0xac21205c, 0x9ad3b0af, 0x1a0e4276, 0x2cfcd285, + 0x77eb6390, 0x4119f363, 0xad218063, 0x9bd31090, 0xc0c4a185, + 0xf6363176, 0x76ebc3af, 0x4019535c, 0x1b0ee249, 0x2dfc72ba, + 0x180f0208, 0x2efd92fb, 0x75ea23ee, 0x4318b31d, 0xc3c541c4, + 0xf537d137, 0xae206022, 0x98d2f0d1, 0x74ea83d1, 0x42181322, + 0x190fa237, 0x2ffd32c4, 0xaf20c01d, 0x99d250ee, 0xc2c5e1fb, + 0xf4377108}}; + +local const z_word_t FAR crc_braid_big_table[][256] = { + {0x0000000000000000, 0xf390f23600000000, 0xe621e56d00000000, + 0x15b1175b00000000, 0xcc43cadb00000000, 0x3fd338ed00000000, + 0x2a622fb600000000, 0xd9f2dd8000000000, 0xd981e56c00000000, + 0x2a11175a00000000, 0x3fa0000100000000, 0xcc30f23700000000, + 0x15c22fb700000000, 0xe652dd8100000000, 0xf3e3cada00000000, + 0x007338ec00000000, 0xb203cbd900000000, 0x419339ef00000000, + 0x54222eb400000000, 0xa7b2dc8200000000, 0x7e40010200000000, + 0x8dd0f33400000000, 0x9861e46f00000000, 0x6bf1165900000000, + 0x6b822eb500000000, 0x9812dc8300000000, 0x8da3cbd800000000, + 0x7e3339ee00000000, 0xa7c1e46e00000000, 0x5451165800000000, + 0x41e0010300000000, 0xb270f33500000000, 0x2501e76800000000, + 0xd691155e00000000, 0xc320020500000000, 0x30b0f03300000000, + 0xe9422db300000000, 0x1ad2df8500000000, 0x0f63c8de00000000, + 0xfcf33ae800000000, 0xfc80020400000000, 0x0f10f03200000000, + 0x1aa1e76900000000, 0xe931155f00000000, 0x30c3c8df00000000, + 0xc3533ae900000000, 0xd6e22db200000000, 0x2572df8400000000, + 0x97022cb100000000, 0x6492de8700000000, 0x7123c9dc00000000, + 0x82b33bea00000000, 0x5b41e66a00000000, 0xa8d1145c00000000, + 0xbd60030700000000, 0x4ef0f13100000000, 0x4e83c9dd00000000, + 0xbd133beb00000000, 0xa8a22cb000000000, 0x5b32de8600000000, + 0x82c0030600000000, 0x7150f13000000000, 0x64e1e66b00000000, + 0x9771145d00000000, 0x4a02ced100000000, 0xb9923ce700000000, + 0xac232bbc00000000, 0x5fb3d98a00000000, 0x8641040a00000000, + 0x75d1f63c00000000, 0x6060e16700000000, 0x93f0135100000000, + 0x93832bbd00000000, 0x6013d98b00000000, 0x75a2ced000000000, + 0x86323ce600000000, 0x5fc0e16600000000, 0xac50135000000000, + 0xb9e1040b00000000, 0x4a71f63d00000000, 0xf801050800000000, + 0x0b91f73e00000000, 0x1e20e06500000000, 0xedb0125300000000, + 0x3442cfd300000000, 0xc7d23de500000000, 0xd2632abe00000000, + 0x21f3d88800000000, 0x2180e06400000000, 0xd210125200000000, + 0xc7a1050900000000, 0x3431f73f00000000, 0xedc32abf00000000, + 0x1e53d88900000000, 0x0be2cfd200000000, 0xf8723de400000000, + 0x6f0329b900000000, 0x9c93db8f00000000, 0x8922ccd400000000, + 0x7ab23ee200000000, 0xa340e36200000000, 0x50d0115400000000, + 0x4561060f00000000, 0xb6f1f43900000000, 0xb682ccd500000000, + 0x45123ee300000000, 0x50a329b800000000, 0xa333db8e00000000, + 0x7ac1060e00000000, 0x8951f43800000000, 0x9ce0e36300000000, + 0x6f70115500000000, 0xdd00e26000000000, 0x2e90105600000000, + 0x3b21070d00000000, 0xc8b1f53b00000000, 0x114328bb00000000, + 0xe2d3da8d00000000, 0xf762cdd600000000, 0x04f23fe000000000, + 0x0481070c00000000, 0xf711f53a00000000, 0xe2a0e26100000000, + 0x1130105700000000, 0xc8c2cdd700000000, 0x3b523fe100000000, + 0x2ee328ba00000000, 0xdd73da8c00000000, 0xd502ed7800000000, + 0x26921f4e00000000, 0x3323081500000000, 0xc0b3fa2300000000, + 0x194127a300000000, 0xead1d59500000000, 0xff60c2ce00000000, + 0x0cf030f800000000, 0x0c83081400000000, 0xff13fa2200000000, + 0xeaa2ed7900000000, 0x19321f4f00000000, 0xc0c0c2cf00000000, + 0x335030f900000000, 0x26e127a200000000, 0xd571d59400000000, + 0x670126a100000000, 0x9491d49700000000, 0x8120c3cc00000000, + 0x72b031fa00000000, 0xab42ec7a00000000, 0x58d21e4c00000000, + 0x4d63091700000000, 0xbef3fb2100000000, 0xbe80c3cd00000000, + 0x4d1031fb00000000, 0x58a126a000000000, 0xab31d49600000000, + 0x72c3091600000000, 0x8153fb2000000000, 0x94e2ec7b00000000, + 0x67721e4d00000000, 0xf0030a1000000000, 0x0393f82600000000, + 0x1622ef7d00000000, 0xe5b21d4b00000000, 0x3c40c0cb00000000, + 0xcfd032fd00000000, 0xda6125a600000000, 0x29f1d79000000000, + 0x2982ef7c00000000, 0xda121d4a00000000, 0xcfa30a1100000000, + 0x3c33f82700000000, 0xe5c125a700000000, 0x1651d79100000000, + 0x03e0c0ca00000000, 0xf07032fc00000000, 0x4200c1c900000000, + 0xb19033ff00000000, 0xa42124a400000000, 0x57b1d69200000000, + 0x8e430b1200000000, 0x7dd3f92400000000, 0x6862ee7f00000000, + 0x9bf21c4900000000, 0x9b8124a500000000, 0x6811d69300000000, + 0x7da0c1c800000000, 0x8e3033fe00000000, 0x57c2ee7e00000000, + 0xa4521c4800000000, 0xb1e30b1300000000, 0x4273f92500000000, + 0x9f0023a900000000, 0x6c90d19f00000000, 0x7921c6c400000000, + 0x8ab134f200000000, 0x5343e97200000000, 0xa0d31b4400000000, + 0xb5620c1f00000000, 0x46f2fe2900000000, 0x4681c6c500000000, + 0xb51134f300000000, 0xa0a023a800000000, 0x5330d19e00000000, + 0x8ac20c1e00000000, 0x7952fe2800000000, 0x6ce3e97300000000, + 0x9f731b4500000000, 0x2d03e87000000000, 0xde931a4600000000, + 0xcb220d1d00000000, 0x38b2ff2b00000000, 0xe14022ab00000000, + 0x12d0d09d00000000, 0x0761c7c600000000, 0xf4f135f000000000, + 0xf4820d1c00000000, 0x0712ff2a00000000, 0x12a3e87100000000, + 0xe1331a4700000000, 0x38c1c7c700000000, 0xcb5135f100000000, + 0xdee022aa00000000, 0x2d70d09c00000000, 0xba01c4c100000000, + 0x499136f700000000, 0x5c2021ac00000000, 0xafb0d39a00000000, + 0x76420e1a00000000, 0x85d2fc2c00000000, 0x9063eb7700000000, + 0x63f3194100000000, 0x638021ad00000000, 0x9010d39b00000000, + 0x85a1c4c000000000, 0x763136f600000000, 0xafc3eb7600000000, + 0x5c53194000000000, 0x49e20e1b00000000, 0xba72fc2d00000000, + 0x08020f1800000000, 0xfb92fd2e00000000, 0xee23ea7500000000, + 0x1db3184300000000, 0xc441c5c300000000, 0x37d137f500000000, + 0x226020ae00000000, 0xd1f0d29800000000, 0xd183ea7400000000, + 0x2213184200000000, 0x37a20f1900000000, 0xc432fd2f00000000, + 0x1dc020af00000000, 0xee50d29900000000, 0xfbe1c5c200000000, + 0x087137f400000000}, + {0x0000000000000000, 0x3651822400000000, 0x6ca2044900000000, + 0x5af3866d00000000, 0xd844099200000000, 0xee158bb600000000, + 0xb4e60ddb00000000, 0x82b78fff00000000, 0xf18f63ff00000000, + 0xc7dee1db00000000, 0x9d2d67b600000000, 0xab7ce59200000000, + 0x29cb6a6d00000000, 0x1f9ae84900000000, 0x45696e2400000000, + 0x7338ec0000000000, 0xa319b62500000000, 0x9548340100000000, + 0xcfbbb26c00000000, 0xf9ea304800000000, 0x7b5dbfb700000000, + 0x4d0c3d9300000000, 0x17ffbbfe00000000, 0x21ae39da00000000, + 0x5296d5da00000000, 0x64c757fe00000000, 0x3e34d19300000000, + 0x086553b700000000, 0x8ad2dc4800000000, 0xbc835e6c00000000, + 0xe670d80100000000, 0xd0215a2500000000, 0x46336c4b00000000, + 0x7062ee6f00000000, 0x2a91680200000000, 0x1cc0ea2600000000, + 0x9e7765d900000000, 0xa826e7fd00000000, 0xf2d5619000000000, + 0xc484e3b400000000, 0xb7bc0fb400000000, 0x81ed8d9000000000, + 0xdb1e0bfd00000000, 0xed4f89d900000000, 0x6ff8062600000000, + 0x59a9840200000000, 0x035a026f00000000, 0x350b804b00000000, + 0xe52ada6e00000000, 0xd37b584a00000000, 0x8988de2700000000, + 0xbfd95c0300000000, 0x3d6ed3fc00000000, 0x0b3f51d800000000, + 0x51ccd7b500000000, 0x679d559100000000, 0x14a5b99100000000, + 0x22f43bb500000000, 0x7807bdd800000000, 0x4e563ffc00000000, + 0xcce1b00300000000, 0xfab0322700000000, 0xa043b44a00000000, + 0x9612366e00000000, 0x8c66d89600000000, 0xba375ab200000000, + 0xe0c4dcdf00000000, 0xd6955efb00000000, 0x5422d10400000000, + 0x6273532000000000, 0x3880d54d00000000, 0x0ed1576900000000, + 0x7de9bb6900000000, 0x4bb8394d00000000, 0x114bbf2000000000, + 0x271a3d0400000000, 0xa5adb2fb00000000, 0x93fc30df00000000, + 0xc90fb6b200000000, 0xff5e349600000000, 0x2f7f6eb300000000, + 0x192eec9700000000, 0x43dd6afa00000000, 0x758ce8de00000000, + 0xf73b672100000000, 0xc16ae50500000000, 0x9b99636800000000, + 0xadc8e14c00000000, 0xdef00d4c00000000, 0xe8a18f6800000000, + 0xb252090500000000, 0x84038b2100000000, 0x06b404de00000000, + 0x30e586fa00000000, 0x6a16009700000000, 0x5c4782b300000000, + 0xca55b4dd00000000, 0xfc0436f900000000, 0xa6f7b09400000000, + 0x90a632b000000000, 0x1211bd4f00000000, 0x24403f6b00000000, + 0x7eb3b90600000000, 0x48e23b2200000000, 0x3bdad72200000000, + 0x0d8b550600000000, 0x5778d36b00000000, 0x6129514f00000000, + 0xe39edeb000000000, 0xd5cf5c9400000000, 0x8f3cdaf900000000, + 0xb96d58dd00000000, 0x694c02f800000000, 0x5f1d80dc00000000, + 0x05ee06b100000000, 0x33bf849500000000, 0xb1080b6a00000000, + 0x8759894e00000000, 0xddaa0f2300000000, 0xebfb8d0700000000, + 0x98c3610700000000, 0xae92e32300000000, 0xf461654e00000000, + 0xc230e76a00000000, 0x4087689500000000, 0x76d6eab100000000, + 0x2c256cdc00000000, 0x1a74eef800000000, 0x59cbc1f600000000, + 0x6f9a43d200000000, 0x3569c5bf00000000, 0x0338479b00000000, + 0x818fc86400000000, 0xb7de4a4000000000, 0xed2dcc2d00000000, + 0xdb7c4e0900000000, 0xa844a20900000000, 0x9e15202d00000000, + 0xc4e6a64000000000, 0xf2b7246400000000, 0x7000ab9b00000000, + 0x465129bf00000000, 0x1ca2afd200000000, 0x2af32df600000000, + 0xfad277d300000000, 0xcc83f5f700000000, 0x9670739a00000000, + 0xa021f1be00000000, 0x22967e4100000000, 0x14c7fc6500000000, + 0x4e347a0800000000, 0x7865f82c00000000, 0x0b5d142c00000000, + 0x3d0c960800000000, 0x67ff106500000000, 0x51ae924100000000, + 0xd3191dbe00000000, 0xe5489f9a00000000, 0xbfbb19f700000000, + 0x89ea9bd300000000, 0x1ff8adbd00000000, 0x29a92f9900000000, + 0x735aa9f400000000, 0x450b2bd000000000, 0xc7bca42f00000000, + 0xf1ed260b00000000, 0xab1ea06600000000, 0x9d4f224200000000, + 0xee77ce4200000000, 0xd8264c6600000000, 0x82d5ca0b00000000, + 0xb484482f00000000, 0x3633c7d000000000, 0x006245f400000000, + 0x5a91c39900000000, 0x6cc041bd00000000, 0xbce11b9800000000, + 0x8ab099bc00000000, 0xd0431fd100000000, 0xe6129df500000000, + 0x64a5120a00000000, 0x52f4902e00000000, 0x0807164300000000, + 0x3e56946700000000, 0x4d6e786700000000, 0x7b3ffa4300000000, + 0x21cc7c2e00000000, 0x179dfe0a00000000, 0x952a71f500000000, + 0xa37bf3d100000000, 0xf98875bc00000000, 0xcfd9f79800000000, + 0xd5ad196000000000, 0xe3fc9b4400000000, 0xb90f1d2900000000, + 0x8f5e9f0d00000000, 0x0de910f200000000, 0x3bb892d600000000, + 0x614b14bb00000000, 0x571a969f00000000, 0x24227a9f00000000, + 0x1273f8bb00000000, 0x48807ed600000000, 0x7ed1fcf200000000, + 0xfc66730d00000000, 0xca37f12900000000, 0x90c4774400000000, + 0xa695f56000000000, 0x76b4af4500000000, 0x40e52d6100000000, + 0x1a16ab0c00000000, 0x2c47292800000000, 0xaef0a6d700000000, + 0x98a124f300000000, 0xc252a29e00000000, 0xf40320ba00000000, + 0x873bccba00000000, 0xb16a4e9e00000000, 0xeb99c8f300000000, + 0xddc84ad700000000, 0x5f7fc52800000000, 0x692e470c00000000, + 0x33ddc16100000000, 0x058c434500000000, 0x939e752b00000000, + 0xa5cff70f00000000, 0xff3c716200000000, 0xc96df34600000000, + 0x4bda7cb900000000, 0x7d8bfe9d00000000, 0x277878f000000000, + 0x1129fad400000000, 0x621116d400000000, 0x544094f000000000, + 0x0eb3129d00000000, 0x38e290b900000000, 0xba551f4600000000, + 0x8c049d6200000000, 0xd6f71b0f00000000, 0xe0a6992b00000000, + 0x3087c30e00000000, 0x06d6412a00000000, 0x5c25c74700000000, + 0x6a74456300000000, 0xe8c3ca9c00000000, 0xde9248b800000000, + 0x8461ced500000000, 0xb2304cf100000000, 0xc108a0f100000000, + 0xf75922d500000000, 0xadaaa4b800000000, 0x9bfb269c00000000, + 0x194ca96300000000, 0x2f1d2b4700000000, 0x75eead2a00000000, + 0x43bf2f0e00000000}, + {0x0000000000000000, 0xc8179ecf00000000, 0xd1294d4400000000, + 0x193ed38b00000000, 0xa2539a8800000000, 0x6a44044700000000, + 0x737ad7cc00000000, 0xbb6d490300000000, 0x05a145ca00000000, + 0xcdb6db0500000000, 0xd488088e00000000, 0x1c9f964100000000, + 0xa7f2df4200000000, 0x6fe5418d00000000, 0x76db920600000000, + 0xbecc0cc900000000, 0x4b44fa4f00000000, 0x8353648000000000, + 0x9a6db70b00000000, 0x527a29c400000000, 0xe91760c700000000, + 0x2100fe0800000000, 0x383e2d8300000000, 0xf029b34c00000000, + 0x4ee5bf8500000000, 0x86f2214a00000000, 0x9fccf2c100000000, + 0x57db6c0e00000000, 0xecb6250d00000000, 0x24a1bbc200000000, + 0x3d9f684900000000, 0xf588f68600000000, 0x9688f49f00000000, + 0x5e9f6a5000000000, 0x47a1b9db00000000, 0x8fb6271400000000, + 0x34db6e1700000000, 0xfcccf0d800000000, 0xe5f2235300000000, + 0x2de5bd9c00000000, 0x9329b15500000000, 0x5b3e2f9a00000000, + 0x4200fc1100000000, 0x8a1762de00000000, 0x317a2bdd00000000, + 0xf96db51200000000, 0xe053669900000000, 0x2844f85600000000, + 0xddcc0ed000000000, 0x15db901f00000000, 0x0ce5439400000000, + 0xc4f2dd5b00000000, 0x7f9f945800000000, 0xb7880a9700000000, + 0xaeb6d91c00000000, 0x66a147d300000000, 0xd86d4b1a00000000, + 0x107ad5d500000000, 0x0944065e00000000, 0xc153989100000000, + 0x7a3ed19200000000, 0xb2294f5d00000000, 0xab179cd600000000, + 0x6300021900000000, 0x6d1798e400000000, 0xa500062b00000000, + 0xbc3ed5a000000000, 0x74294b6f00000000, 0xcf44026c00000000, + 0x07539ca300000000, 0x1e6d4f2800000000, 0xd67ad1e700000000, + 0x68b6dd2e00000000, 0xa0a143e100000000, 0xb99f906a00000000, + 0x71880ea500000000, 0xcae547a600000000, 0x02f2d96900000000, + 0x1bcc0ae200000000, 0xd3db942d00000000, 0x265362ab00000000, + 0xee44fc6400000000, 0xf77a2fef00000000, 0x3f6db12000000000, + 0x8400f82300000000, 0x4c1766ec00000000, 0x5529b56700000000, + 0x9d3e2ba800000000, 0x23f2276100000000, 0xebe5b9ae00000000, + 0xf2db6a2500000000, 0x3accf4ea00000000, 0x81a1bde900000000, + 0x49b6232600000000, 0x5088f0ad00000000, 0x989f6e6200000000, + 0xfb9f6c7b00000000, 0x3388f2b400000000, 0x2ab6213f00000000, + 0xe2a1bff000000000, 0x59ccf6f300000000, 0x91db683c00000000, + 0x88e5bbb700000000, 0x40f2257800000000, 0xfe3e29b100000000, + 0x3629b77e00000000, 0x2f1764f500000000, 0xe700fa3a00000000, + 0x5c6db33900000000, 0x947a2df600000000, 0x8d44fe7d00000000, + 0x455360b200000000, 0xb0db963400000000, 0x78cc08fb00000000, + 0x61f2db7000000000, 0xa9e545bf00000000, 0x12880cbc00000000, + 0xda9f927300000000, 0xc3a141f800000000, 0x0bb6df3700000000, + 0xb57ad3fe00000000, 0x7d6d4d3100000000, 0x64539eba00000000, + 0xac44007500000000, 0x1729497600000000, 0xdf3ed7b900000000, + 0xc600043200000000, 0x0e179afd00000000, 0x9b28411200000000, + 0x533fdfdd00000000, 0x4a010c5600000000, 0x8216929900000000, + 0x397bdb9a00000000, 0xf16c455500000000, 0xe85296de00000000, + 0x2045081100000000, 0x9e8904d800000000, 0x569e9a1700000000, + 0x4fa0499c00000000, 0x87b7d75300000000, 0x3cda9e5000000000, + 0xf4cd009f00000000, 0xedf3d31400000000, 0x25e44ddb00000000, + 0xd06cbb5d00000000, 0x187b259200000000, 0x0145f61900000000, + 0xc95268d600000000, 0x723f21d500000000, 0xba28bf1a00000000, + 0xa3166c9100000000, 0x6b01f25e00000000, 0xd5cdfe9700000000, + 0x1dda605800000000, 0x04e4b3d300000000, 0xccf32d1c00000000, + 0x779e641f00000000, 0xbf89fad000000000, 0xa6b7295b00000000, + 0x6ea0b79400000000, 0x0da0b58d00000000, 0xc5b72b4200000000, + 0xdc89f8c900000000, 0x149e660600000000, 0xaff32f0500000000, + 0x67e4b1ca00000000, 0x7eda624100000000, 0xb6cdfc8e00000000, + 0x0801f04700000000, 0xc0166e8800000000, 0xd928bd0300000000, + 0x113f23cc00000000, 0xaa526acf00000000, 0x6245f40000000000, + 0x7b7b278b00000000, 0xb36cb94400000000, 0x46e44fc200000000, + 0x8ef3d10d00000000, 0x97cd028600000000, 0x5fda9c4900000000, + 0xe4b7d54a00000000, 0x2ca04b8500000000, 0x359e980e00000000, + 0xfd8906c100000000, 0x43450a0800000000, 0x8b5294c700000000, + 0x926c474c00000000, 0x5a7bd98300000000, 0xe116908000000000, + 0x29010e4f00000000, 0x303fddc400000000, 0xf828430b00000000, + 0xf63fd9f600000000, 0x3e28473900000000, 0x271694b200000000, + 0xef010a7d00000000, 0x546c437e00000000, 0x9c7bddb100000000, + 0x85450e3a00000000, 0x4d5290f500000000, 0xf39e9c3c00000000, + 0x3b8902f300000000, 0x22b7d17800000000, 0xeaa04fb700000000, + 0x51cd06b400000000, 0x99da987b00000000, 0x80e44bf000000000, + 0x48f3d53f00000000, 0xbd7b23b900000000, 0x756cbd7600000000, + 0x6c526efd00000000, 0xa445f03200000000, 0x1f28b93100000000, + 0xd73f27fe00000000, 0xce01f47500000000, 0x06166aba00000000, + 0xb8da667300000000, 0x70cdf8bc00000000, 0x69f32b3700000000, + 0xa1e4b5f800000000, 0x1a89fcfb00000000, 0xd29e623400000000, + 0xcba0b1bf00000000, 0x03b72f7000000000, 0x60b72d6900000000, + 0xa8a0b3a600000000, 0xb19e602d00000000, 0x7989fee200000000, + 0xc2e4b7e100000000, 0x0af3292e00000000, 0x13cdfaa500000000, + 0xdbda646a00000000, 0x651668a300000000, 0xad01f66c00000000, + 0xb43f25e700000000, 0x7c28bb2800000000, 0xc745f22b00000000, + 0x0f526ce400000000, 0x166cbf6f00000000, 0xde7b21a000000000, + 0x2bf3d72600000000, 0xe3e449e900000000, 0xfada9a6200000000, + 0x32cd04ad00000000, 0x89a04dae00000000, 0x41b7d36100000000, + 0x588900ea00000000, 0x909e9e2500000000, 0x2e5292ec00000000, + 0xe6450c2300000000, 0xff7bdfa800000000, 0x376c416700000000, + 0x8c01086400000000, 0x441696ab00000000, 0x5d28452000000000, + 0x953fdbef00000000}, + {0x0000000000000000, 0x95d4709500000000, 0x6baf90f100000000, + 0xfe7be06400000000, 0x9758503800000000, 0x028c20ad00000000, + 0xfcf7c0c900000000, 0x6923b05c00000000, 0x2eb1a07000000000, + 0xbb65d0e500000000, 0x451e308100000000, 0xd0ca401400000000, + 0xb9e9f04800000000, 0x2c3d80dd00000000, 0xd24660b900000000, + 0x4792102c00000000, 0x5c6241e100000000, 0xc9b6317400000000, + 0x37cdd11000000000, 0xa219a18500000000, 0xcb3a11d900000000, + 0x5eee614c00000000, 0xa095812800000000, 0x3541f1bd00000000, + 0x72d3e19100000000, 0xe707910400000000, 0x197c716000000000, + 0x8ca801f500000000, 0xe58bb1a900000000, 0x705fc13c00000000, + 0x8e24215800000000, 0x1bf051cd00000000, 0xf9c2f31900000000, + 0x6c16838c00000000, 0x926d63e800000000, 0x07b9137d00000000, + 0x6e9aa32100000000, 0xfb4ed3b400000000, 0x053533d000000000, + 0x90e1434500000000, 0xd773536900000000, 0x42a723fc00000000, + 0xbcdcc39800000000, 0x2908b30d00000000, 0x402b035100000000, + 0xd5ff73c400000000, 0x2b8493a000000000, 0xbe50e33500000000, + 0xa5a0b2f800000000, 0x3074c26d00000000, 0xce0f220900000000, + 0x5bdb529c00000000, 0x32f8e2c000000000, 0xa72c925500000000, + 0x5957723100000000, 0xcc8302a400000000, 0x8b11128800000000, + 0x1ec5621d00000000, 0xe0be827900000000, 0x756af2ec00000000, + 0x1c4942b000000000, 0x899d322500000000, 0x77e6d24100000000, + 0xe232a2d400000000, 0xf285e73300000000, 0x675197a600000000, + 0x992a77c200000000, 0x0cfe075700000000, 0x65ddb70b00000000, + 0xf009c79e00000000, 0x0e7227fa00000000, 0x9ba6576f00000000, + 0xdc34474300000000, 0x49e037d600000000, 0xb79bd7b200000000, + 0x224fa72700000000, 0x4b6c177b00000000, 0xdeb867ee00000000, + 0x20c3878a00000000, 0xb517f71f00000000, 0xaee7a6d200000000, + 0x3b33d64700000000, 0xc548362300000000, 0x509c46b600000000, + 0x39bff6ea00000000, 0xac6b867f00000000, 0x5210661b00000000, + 0xc7c4168e00000000, 0x805606a200000000, 0x1582763700000000, + 0xebf9965300000000, 0x7e2de6c600000000, 0x170e569a00000000, + 0x82da260f00000000, 0x7ca1c66b00000000, 0xe975b6fe00000000, + 0x0b47142a00000000, 0x9e9364bf00000000, 0x60e884db00000000, + 0xf53cf44e00000000, 0x9c1f441200000000, 0x09cb348700000000, + 0xf7b0d4e300000000, 0x6264a47600000000, 0x25f6b45a00000000, + 0xb022c4cf00000000, 0x4e5924ab00000000, 0xdb8d543e00000000, + 0xb2aee46200000000, 0x277a94f700000000, 0xd901749300000000, + 0x4cd5040600000000, 0x572555cb00000000, 0xc2f1255e00000000, + 0x3c8ac53a00000000, 0xa95eb5af00000000, 0xc07d05f300000000, + 0x55a9756600000000, 0xabd2950200000000, 0x3e06e59700000000, + 0x7994f5bb00000000, 0xec40852e00000000, 0x123b654a00000000, + 0x87ef15df00000000, 0xeecca58300000000, 0x7b18d51600000000, + 0x8563357200000000, 0x10b745e700000000, 0xe40bcf6700000000, + 0x71dfbff200000000, 0x8fa45f9600000000, 0x1a702f0300000000, + 0x73539f5f00000000, 0xe687efca00000000, 0x18fc0fae00000000, + 0x8d287f3b00000000, 0xcaba6f1700000000, 0x5f6e1f8200000000, + 0xa115ffe600000000, 0x34c18f7300000000, 0x5de23f2f00000000, + 0xc8364fba00000000, 0x364dafde00000000, 0xa399df4b00000000, + 0xb8698e8600000000, 0x2dbdfe1300000000, 0xd3c61e7700000000, + 0x46126ee200000000, 0x2f31debe00000000, 0xbae5ae2b00000000, + 0x449e4e4f00000000, 0xd14a3eda00000000, 0x96d82ef600000000, + 0x030c5e6300000000, 0xfd77be0700000000, 0x68a3ce9200000000, + 0x01807ece00000000, 0x94540e5b00000000, 0x6a2fee3f00000000, + 0xfffb9eaa00000000, 0x1dc93c7e00000000, 0x881d4ceb00000000, + 0x7666ac8f00000000, 0xe3b2dc1a00000000, 0x8a916c4600000000, + 0x1f451cd300000000, 0xe13efcb700000000, 0x74ea8c2200000000, + 0x33789c0e00000000, 0xa6acec9b00000000, 0x58d70cff00000000, + 0xcd037c6a00000000, 0xa420cc3600000000, 0x31f4bca300000000, + 0xcf8f5cc700000000, 0x5a5b2c5200000000, 0x41ab7d9f00000000, + 0xd47f0d0a00000000, 0x2a04ed6e00000000, 0xbfd09dfb00000000, + 0xd6f32da700000000, 0x43275d3200000000, 0xbd5cbd5600000000, + 0x2888cdc300000000, 0x6f1addef00000000, 0xfacead7a00000000, + 0x04b54d1e00000000, 0x91613d8b00000000, 0xf8428dd700000000, + 0x6d96fd4200000000, 0x93ed1d2600000000, 0x06396db300000000, + 0x168e285400000000, 0x835a58c100000000, 0x7d21b8a500000000, + 0xe8f5c83000000000, 0x81d6786c00000000, 0x140208f900000000, + 0xea79e89d00000000, 0x7fad980800000000, 0x383f882400000000, + 0xadebf8b100000000, 0x539018d500000000, 0xc644684000000000, + 0xaf67d81c00000000, 0x3ab3a88900000000, 0xc4c848ed00000000, + 0x511c387800000000, 0x4aec69b500000000, 0xdf38192000000000, + 0x2143f94400000000, 0xb49789d100000000, 0xddb4398d00000000, + 0x4860491800000000, 0xb61ba97c00000000, 0x23cfd9e900000000, + 0x645dc9c500000000, 0xf189b95000000000, 0x0ff2593400000000, + 0x9a2629a100000000, 0xf30599fd00000000, 0x66d1e96800000000, + 0x98aa090c00000000, 0x0d7e799900000000, 0xef4cdb4d00000000, + 0x7a98abd800000000, 0x84e34bbc00000000, 0x11373b2900000000, + 0x78148b7500000000, 0xedc0fbe000000000, 0x13bb1b8400000000, + 0x866f6b1100000000, 0xc1fd7b3d00000000, 0x54290ba800000000, + 0xaa52ebcc00000000, 0x3f869b5900000000, 0x56a52b0500000000, + 0xc3715b9000000000, 0x3d0abbf400000000, 0xa8decb6100000000, + 0xb32e9aac00000000, 0x26faea3900000000, 0xd8810a5d00000000, + 0x4d557ac800000000, 0x2476ca9400000000, 0xb1a2ba0100000000, + 0x4fd95a6500000000, 0xda0d2af000000000, 0x9d9f3adc00000000, + 0x084b4a4900000000, 0xf630aa2d00000000, 0x63e4dab800000000, + 0x0ac76ae400000000, 0x9f131a7100000000, 0x6168fa1500000000, + 0xf4bc8a8000000000}, + {0x0000000000000000, 0x1f17f08000000000, 0x7f2891da00000000, + 0x603f615a00000000, 0xbf56536e00000000, 0xa041a3ee00000000, + 0xc07ec2b400000000, 0xdf69323400000000, 0x7eada6dc00000000, + 0x61ba565c00000000, 0x0185370600000000, 0x1e92c78600000000, + 0xc1fbf5b200000000, 0xdeec053200000000, 0xbed3646800000000, + 0xa1c494e800000000, 0xbd5c3c6200000000, 0xa24bcce200000000, + 0xc274adb800000000, 0xdd635d3800000000, 0x020a6f0c00000000, + 0x1d1d9f8c00000000, 0x7d22fed600000000, 0x62350e5600000000, + 0xc3f19abe00000000, 0xdce66a3e00000000, 0xbcd90b6400000000, + 0xa3cefbe400000000, 0x7ca7c9d000000000, 0x63b0395000000000, + 0x038f580a00000000, 0x1c98a88a00000000, 0x7ab978c400000000, + 0x65ae884400000000, 0x0591e91e00000000, 0x1a86199e00000000, + 0xc5ef2baa00000000, 0xdaf8db2a00000000, 0xbac7ba7000000000, + 0xa5d04af000000000, 0x0414de1800000000, 0x1b032e9800000000, + 0x7b3c4fc200000000, 0x642bbf4200000000, 0xbb428d7600000000, + 0xa4557df600000000, 0xc46a1cac00000000, 0xdb7dec2c00000000, + 0xc7e544a600000000, 0xd8f2b42600000000, 0xb8cdd57c00000000, + 0xa7da25fc00000000, 0x78b317c800000000, 0x67a4e74800000000, + 0x079b861200000000, 0x188c769200000000, 0xb948e27a00000000, + 0xa65f12fa00000000, 0xc66073a000000000, 0xd977832000000000, + 0x061eb11400000000, 0x1909419400000000, 0x793620ce00000000, + 0x6621d04e00000000, 0xb574805300000000, 0xaa6370d300000000, + 0xca5c118900000000, 0xd54be10900000000, 0x0a22d33d00000000, + 0x153523bd00000000, 0x750a42e700000000, 0x6a1db26700000000, + 0xcbd9268f00000000, 0xd4ced60f00000000, 0xb4f1b75500000000, + 0xabe647d500000000, 0x748f75e100000000, 0x6b98856100000000, + 0x0ba7e43b00000000, 0x14b014bb00000000, 0x0828bc3100000000, + 0x173f4cb100000000, 0x77002deb00000000, 0x6817dd6b00000000, + 0xb77eef5f00000000, 0xa8691fdf00000000, 0xc8567e8500000000, + 0xd7418e0500000000, 0x76851aed00000000, 0x6992ea6d00000000, + 0x09ad8b3700000000, 0x16ba7bb700000000, 0xc9d3498300000000, + 0xd6c4b90300000000, 0xb6fbd85900000000, 0xa9ec28d900000000, + 0xcfcdf89700000000, 0xd0da081700000000, 0xb0e5694d00000000, + 0xaff299cd00000000, 0x709babf900000000, 0x6f8c5b7900000000, + 0x0fb33a2300000000, 0x10a4caa300000000, 0xb1605e4b00000000, + 0xae77aecb00000000, 0xce48cf9100000000, 0xd15f3f1100000000, + 0x0e360d2500000000, 0x1121fda500000000, 0x711e9cff00000000, + 0x6e096c7f00000000, 0x7291c4f500000000, 0x6d86347500000000, + 0x0db9552f00000000, 0x12aea5af00000000, 0xcdc7979b00000000, + 0xd2d0671b00000000, 0xb2ef064100000000, 0xadf8f6c100000000, + 0x0c3c622900000000, 0x132b92a900000000, 0x7314f3f300000000, + 0x6c03037300000000, 0xb36a314700000000, 0xac7dc1c700000000, + 0xcc42a09d00000000, 0xd355501d00000000, 0x6ae900a700000000, + 0x75fef02700000000, 0x15c1917d00000000, 0x0ad661fd00000000, + 0xd5bf53c900000000, 0xcaa8a34900000000, 0xaa97c21300000000, + 0xb580329300000000, 0x1444a67b00000000, 0x0b5356fb00000000, + 0x6b6c37a100000000, 0x747bc72100000000, 0xab12f51500000000, + 0xb405059500000000, 0xd43a64cf00000000, 0xcb2d944f00000000, + 0xd7b53cc500000000, 0xc8a2cc4500000000, 0xa89dad1f00000000, + 0xb78a5d9f00000000, 0x68e36fab00000000, 0x77f49f2b00000000, + 0x17cbfe7100000000, 0x08dc0ef100000000, 0xa9189a1900000000, + 0xb60f6a9900000000, 0xd6300bc300000000, 0xc927fb4300000000, + 0x164ec97700000000, 0x095939f700000000, 0x696658ad00000000, + 0x7671a82d00000000, 0x1050786300000000, 0x0f4788e300000000, + 0x6f78e9b900000000, 0x706f193900000000, 0xaf062b0d00000000, + 0xb011db8d00000000, 0xd02ebad700000000, 0xcf394a5700000000, + 0x6efddebf00000000, 0x71ea2e3f00000000, 0x11d54f6500000000, + 0x0ec2bfe500000000, 0xd1ab8dd100000000, 0xcebc7d5100000000, + 0xae831c0b00000000, 0xb194ec8b00000000, 0xad0c440100000000, + 0xb21bb48100000000, 0xd224d5db00000000, 0xcd33255b00000000, + 0x125a176f00000000, 0x0d4de7ef00000000, 0x6d7286b500000000, + 0x7265763500000000, 0xd3a1e2dd00000000, 0xccb6125d00000000, + 0xac89730700000000, 0xb39e838700000000, 0x6cf7b1b300000000, + 0x73e0413300000000, 0x13df206900000000, 0x0cc8d0e900000000, + 0xdf9d80f400000000, 0xc08a707400000000, 0xa0b5112e00000000, + 0xbfa2e1ae00000000, 0x60cbd39a00000000, 0x7fdc231a00000000, + 0x1fe3424000000000, 0x00f4b2c000000000, 0xa130262800000000, + 0xbe27d6a800000000, 0xde18b7f200000000, 0xc10f477200000000, + 0x1e66754600000000, 0x017185c600000000, 0x614ee49c00000000, + 0x7e59141c00000000, 0x62c1bc9600000000, 0x7dd64c1600000000, + 0x1de92d4c00000000, 0x02feddcc00000000, 0xdd97eff800000000, + 0xc2801f7800000000, 0xa2bf7e2200000000, 0xbda88ea200000000, + 0x1c6c1a4a00000000, 0x037beaca00000000, 0x63448b9000000000, + 0x7c537b1000000000, 0xa33a492400000000, 0xbc2db9a400000000, + 0xdc12d8fe00000000, 0xc305287e00000000, 0xa524f83000000000, + 0xba3308b000000000, 0xda0c69ea00000000, 0xc51b996a00000000, + 0x1a72ab5e00000000, 0x05655bde00000000, 0x655a3a8400000000, + 0x7a4dca0400000000, 0xdb895eec00000000, 0xc49eae6c00000000, + 0xa4a1cf3600000000, 0xbbb63fb600000000, 0x64df0d8200000000, + 0x7bc8fd0200000000, 0x1bf79c5800000000, 0x04e06cd800000000, + 0x1878c45200000000, 0x076f34d200000000, 0x6750558800000000, + 0x7847a50800000000, 0xa72e973c00000000, 0xb83967bc00000000, + 0xd80606e600000000, 0xc711f66600000000, 0x66d5628e00000000, + 0x79c2920e00000000, 0x19fdf35400000000, 0x06ea03d400000000, + 0xd98331e000000000, 0xc694c16000000000, 0xa6aba03a00000000, + 0xb9bc50ba00000000}, + {0x0000000000000000, 0xe2fd888d00000000, 0x85fd60c000000000, + 0x6700e84d00000000, 0x4bfdb05b00000000, 0xa90038d600000000, + 0xce00d09b00000000, 0x2cfd581600000000, 0x96fa61b700000000, + 0x7407e93a00000000, 0x1307017700000000, 0xf1fa89fa00000000, + 0xdd07d1ec00000000, 0x3ffa596100000000, 0x58fab12c00000000, + 0xba0739a100000000, 0x6df3b2b500000000, 0x8f0e3a3800000000, + 0xe80ed27500000000, 0x0af35af800000000, 0x260e02ee00000000, + 0xc4f38a6300000000, 0xa3f3622e00000000, 0x410eeaa300000000, + 0xfb09d30200000000, 0x19f45b8f00000000, 0x7ef4b3c200000000, + 0x9c093b4f00000000, 0xb0f4635900000000, 0x5209ebd400000000, + 0x3509039900000000, 0xd7f48b1400000000, 0x9be014b000000000, + 0x791d9c3d00000000, 0x1e1d747000000000, 0xfce0fcfd00000000, + 0xd01da4eb00000000, 0x32e02c6600000000, 0x55e0c42b00000000, + 0xb71d4ca600000000, 0x0d1a750700000000, 0xefe7fd8a00000000, + 0x88e715c700000000, 0x6a1a9d4a00000000, 0x46e7c55c00000000, + 0xa41a4dd100000000, 0xc31aa59c00000000, 0x21e72d1100000000, + 0xf613a60500000000, 0x14ee2e8800000000, 0x73eec6c500000000, + 0x91134e4800000000, 0xbdee165e00000000, 0x5f139ed300000000, + 0x3813769e00000000, 0xdaeefe1300000000, 0x60e9c7b200000000, + 0x82144f3f00000000, 0xe514a77200000000, 0x07e92fff00000000, + 0x2b1477e900000000, 0xc9e9ff6400000000, 0xaee9172900000000, + 0x4c149fa400000000, 0x77c758bb00000000, 0x953ad03600000000, + 0xf23a387b00000000, 0x10c7b0f600000000, 0x3c3ae8e000000000, + 0xdec7606d00000000, 0xb9c7882000000000, 0x5b3a00ad00000000, + 0xe13d390c00000000, 0x03c0b18100000000, 0x64c059cc00000000, + 0x863dd14100000000, 0xaac0895700000000, 0x483d01da00000000, + 0x2f3de99700000000, 0xcdc0611a00000000, 0x1a34ea0e00000000, + 0xf8c9628300000000, 0x9fc98ace00000000, 0x7d34024300000000, + 0x51c95a5500000000, 0xb334d2d800000000, 0xd4343a9500000000, + 0x36c9b21800000000, 0x8cce8bb900000000, 0x6e33033400000000, + 0x0933eb7900000000, 0xebce63f400000000, 0xc7333be200000000, + 0x25ceb36f00000000, 0x42ce5b2200000000, 0xa033d3af00000000, + 0xec274c0b00000000, 0x0edac48600000000, 0x69da2ccb00000000, + 0x8b27a44600000000, 0xa7dafc5000000000, 0x452774dd00000000, + 0x22279c9000000000, 0xc0da141d00000000, 0x7add2dbc00000000, + 0x9820a53100000000, 0xff204d7c00000000, 0x1dddc5f100000000, + 0x31209de700000000, 0xd3dd156a00000000, 0xb4ddfd2700000000, + 0x562075aa00000000, 0x81d4febe00000000, 0x6329763300000000, + 0x04299e7e00000000, 0xe6d416f300000000, 0xca294ee500000000, + 0x28d4c66800000000, 0x4fd42e2500000000, 0xad29a6a800000000, + 0x172e9f0900000000, 0xf5d3178400000000, 0x92d3ffc900000000, + 0x702e774400000000, 0x5cd32f5200000000, 0xbe2ea7df00000000, + 0xd92e4f9200000000, 0x3bd3c71f00000000, 0xaf88c0ad00000000, + 0x4d75482000000000, 0x2a75a06d00000000, 0xc88828e000000000, + 0xe47570f600000000, 0x0688f87b00000000, 0x6188103600000000, + 0x837598bb00000000, 0x3972a11a00000000, 0xdb8f299700000000, + 0xbc8fc1da00000000, 0x5e72495700000000, 0x728f114100000000, + 0x907299cc00000000, 0xf772718100000000, 0x158ff90c00000000, + 0xc27b721800000000, 0x2086fa9500000000, 0x478612d800000000, + 0xa57b9a5500000000, 0x8986c24300000000, 0x6b7b4ace00000000, + 0x0c7ba28300000000, 0xee862a0e00000000, 0x548113af00000000, + 0xb67c9b2200000000, 0xd17c736f00000000, 0x3381fbe200000000, + 0x1f7ca3f400000000, 0xfd812b7900000000, 0x9a81c33400000000, + 0x787c4bb900000000, 0x3468d41d00000000, 0xd6955c9000000000, + 0xb195b4dd00000000, 0x53683c5000000000, 0x7f95644600000000, + 0x9d68eccb00000000, 0xfa68048600000000, 0x18958c0b00000000, + 0xa292b5aa00000000, 0x406f3d2700000000, 0x276fd56a00000000, + 0xc5925de700000000, 0xe96f05f100000000, 0x0b928d7c00000000, + 0x6c92653100000000, 0x8e6fedbc00000000, 0x599b66a800000000, + 0xbb66ee2500000000, 0xdc66066800000000, 0x3e9b8ee500000000, + 0x1266d6f300000000, 0xf09b5e7e00000000, 0x979bb63300000000, + 0x75663ebe00000000, 0xcf61071f00000000, 0x2d9c8f9200000000, + 0x4a9c67df00000000, 0xa861ef5200000000, 0x849cb74400000000, + 0x66613fc900000000, 0x0161d78400000000, 0xe39c5f0900000000, + 0xd84f981600000000, 0x3ab2109b00000000, 0x5db2f8d600000000, + 0xbf4f705b00000000, 0x93b2284d00000000, 0x714fa0c000000000, + 0x164f488d00000000, 0xf4b2c00000000000, 0x4eb5f9a100000000, + 0xac48712c00000000, 0xcb48996100000000, 0x29b511ec00000000, + 0x054849fa00000000, 0xe7b5c17700000000, 0x80b5293a00000000, + 0x6248a1b700000000, 0xb5bc2aa300000000, 0x5741a22e00000000, + 0x30414a6300000000, 0xd2bcc2ee00000000, 0xfe419af800000000, + 0x1cbc127500000000, 0x7bbcfa3800000000, 0x994172b500000000, + 0x23464b1400000000, 0xc1bbc39900000000, 0xa6bb2bd400000000, + 0x4446a35900000000, 0x68bbfb4f00000000, 0x8a4673c200000000, + 0xed469b8f00000000, 0x0fbb130200000000, 0x43af8ca600000000, + 0xa152042b00000000, 0xc652ec6600000000, 0x24af64eb00000000, + 0x08523cfd00000000, 0xeaafb47000000000, 0x8daf5c3d00000000, + 0x6f52d4b000000000, 0xd555ed1100000000, 0x37a8659c00000000, + 0x50a88dd100000000, 0xb255055c00000000, 0x9ea85d4a00000000, + 0x7c55d5c700000000, 0x1b553d8a00000000, 0xf9a8b50700000000, + 0x2e5c3e1300000000, 0xcca1b69e00000000, 0xaba15ed300000000, + 0x495cd65e00000000, 0x65a18e4800000000, 0x875c06c500000000, + 0xe05cee8800000000, 0x02a1660500000000, 0xb8a65fa400000000, + 0x5a5bd72900000000, 0x3d5b3f6400000000, 0xdfa6b7e900000000, + 0xf35befff00000000, 0x11a6677200000000, 0x76a68f3f00000000, + 0x945b07b200000000}, + {0x0000000000000000, 0xa90b894e00000000, 0x5217129d00000000, + 0xfb1c9bd300000000, 0xe52855e100000000, 0x4c23dcaf00000000, + 0xb73f477c00000000, 0x1e34ce3200000000, 0x8b57db1900000000, + 0x225c525700000000, 0xd940c98400000000, 0x704b40ca00000000, + 0x6e7f8ef800000000, 0xc77407b600000000, 0x3c689c6500000000, + 0x9563152b00000000, 0x16afb63300000000, 0xbfa43f7d00000000, + 0x44b8a4ae00000000, 0xedb32de000000000, 0xf387e3d200000000, + 0x5a8c6a9c00000000, 0xa190f14f00000000, 0x089b780100000000, + 0x9df86d2a00000000, 0x34f3e46400000000, 0xcfef7fb700000000, + 0x66e4f6f900000000, 0x78d038cb00000000, 0xd1dbb18500000000, + 0x2ac72a5600000000, 0x83cca31800000000, 0x2c5e6d6700000000, + 0x8555e42900000000, 0x7e497ffa00000000, 0xd742f6b400000000, + 0xc976388600000000, 0x607db1c800000000, 0x9b612a1b00000000, + 0x326aa35500000000, 0xa709b67e00000000, 0x0e023f3000000000, + 0xf51ea4e300000000, 0x5c152dad00000000, 0x4221e39f00000000, + 0xeb2a6ad100000000, 0x1036f10200000000, 0xb93d784c00000000, + 0x3af1db5400000000, 0x93fa521a00000000, 0x68e6c9c900000000, + 0xc1ed408700000000, 0xdfd98eb500000000, 0x76d207fb00000000, + 0x8dce9c2800000000, 0x24c5156600000000, 0xb1a6004d00000000, + 0x18ad890300000000, 0xe3b112d000000000, 0x4aba9b9e00000000, + 0x548e55ac00000000, 0xfd85dce200000000, 0x0699473100000000, + 0xaf92ce7f00000000, 0x58bcdace00000000, 0xf1b7538000000000, + 0x0aabc85300000000, 0xa3a0411d00000000, 0xbd948f2f00000000, + 0x149f066100000000, 0xef839db200000000, 0x468814fc00000000, + 0xd3eb01d700000000, 0x7ae0889900000000, 0x81fc134a00000000, + 0x28f79a0400000000, 0x36c3543600000000, 0x9fc8dd7800000000, + 0x64d446ab00000000, 0xcddfcfe500000000, 0x4e136cfd00000000, + 0xe718e5b300000000, 0x1c047e6000000000, 0xb50ff72e00000000, + 0xab3b391c00000000, 0x0230b05200000000, 0xf92c2b8100000000, + 0x5027a2cf00000000, 0xc544b7e400000000, 0x6c4f3eaa00000000, + 0x9753a57900000000, 0x3e582c3700000000, 0x206ce20500000000, + 0x89676b4b00000000, 0x727bf09800000000, 0xdb7079d600000000, + 0x74e2b7a900000000, 0xdde93ee700000000, 0x26f5a53400000000, + 0x8ffe2c7a00000000, 0x91cae24800000000, 0x38c16b0600000000, + 0xc3ddf0d500000000, 0x6ad6799b00000000, 0xffb56cb000000000, + 0x56bee5fe00000000, 0xada27e2d00000000, 0x04a9f76300000000, + 0x1a9d395100000000, 0xb396b01f00000000, 0x488a2bcc00000000, + 0xe181a28200000000, 0x624d019a00000000, 0xcb4688d400000000, + 0x305a130700000000, 0x99519a4900000000, 0x8765547b00000000, + 0x2e6edd3500000000, 0xd57246e600000000, 0x7c79cfa800000000, + 0xe91ada8300000000, 0x401153cd00000000, 0xbb0dc81e00000000, + 0x1206415000000000, 0x0c328f6200000000, 0xa539062c00000000, + 0x5e259dff00000000, 0xf72e14b100000000, 0xf17ec44600000000, + 0x58754d0800000000, 0xa369d6db00000000, 0x0a625f9500000000, + 0x145691a700000000, 0xbd5d18e900000000, 0x4641833a00000000, + 0xef4a0a7400000000, 0x7a291f5f00000000, 0xd322961100000000, + 0x283e0dc200000000, 0x8135848c00000000, 0x9f014abe00000000, + 0x360ac3f000000000, 0xcd16582300000000, 0x641dd16d00000000, + 0xe7d1727500000000, 0x4edafb3b00000000, 0xb5c660e800000000, + 0x1ccde9a600000000, 0x02f9279400000000, 0xabf2aeda00000000, + 0x50ee350900000000, 0xf9e5bc4700000000, 0x6c86a96c00000000, + 0xc58d202200000000, 0x3e91bbf100000000, 0x979a32bf00000000, + 0x89aefc8d00000000, 0x20a575c300000000, 0xdbb9ee1000000000, + 0x72b2675e00000000, 0xdd20a92100000000, 0x742b206f00000000, + 0x8f37bbbc00000000, 0x263c32f200000000, 0x3808fcc000000000, + 0x9103758e00000000, 0x6a1fee5d00000000, 0xc314671300000000, + 0x5677723800000000, 0xff7cfb7600000000, 0x046060a500000000, + 0xad6be9eb00000000, 0xb35f27d900000000, 0x1a54ae9700000000, + 0xe148354400000000, 0x4843bc0a00000000, 0xcb8f1f1200000000, + 0x6284965c00000000, 0x99980d8f00000000, 0x309384c100000000, + 0x2ea74af300000000, 0x87acc3bd00000000, 0x7cb0586e00000000, + 0xd5bbd12000000000, 0x40d8c40b00000000, 0xe9d34d4500000000, + 0x12cfd69600000000, 0xbbc45fd800000000, 0xa5f091ea00000000, + 0x0cfb18a400000000, 0xf7e7837700000000, 0x5eec0a3900000000, + 0xa9c21e8800000000, 0x00c997c600000000, 0xfbd50c1500000000, + 0x52de855b00000000, 0x4cea4b6900000000, 0xe5e1c22700000000, + 0x1efd59f400000000, 0xb7f6d0ba00000000, 0x2295c59100000000, + 0x8b9e4cdf00000000, 0x7082d70c00000000, 0xd9895e4200000000, + 0xc7bd907000000000, 0x6eb6193e00000000, 0x95aa82ed00000000, + 0x3ca10ba300000000, 0xbf6da8bb00000000, 0x166621f500000000, + 0xed7aba2600000000, 0x4471336800000000, 0x5a45fd5a00000000, + 0xf34e741400000000, 0x0852efc700000000, 0xa159668900000000, + 0x343a73a200000000, 0x9d31faec00000000, 0x662d613f00000000, + 0xcf26e87100000000, 0xd112264300000000, 0x7819af0d00000000, + 0x830534de00000000, 0x2a0ebd9000000000, 0x859c73ef00000000, + 0x2c97faa100000000, 0xd78b617200000000, 0x7e80e83c00000000, + 0x60b4260e00000000, 0xc9bfaf4000000000, 0x32a3349300000000, + 0x9ba8bddd00000000, 0x0ecba8f600000000, 0xa7c021b800000000, + 0x5cdcba6b00000000, 0xf5d7332500000000, 0xebe3fd1700000000, + 0x42e8745900000000, 0xb9f4ef8a00000000, 0x10ff66c400000000, + 0x9333c5dc00000000, 0x3a384c9200000000, 0xc124d74100000000, + 0x682f5e0f00000000, 0x761b903d00000000, 0xdf10197300000000, + 0x240c82a000000000, 0x8d070bee00000000, 0x18641ec500000000, + 0xb16f978b00000000, 0x4a730c5800000000, 0xe378851600000000, + 0xfd4c4b2400000000, 0x5447c26a00000000, 0xaf5b59b900000000, + 0x0650d0f700000000}, + {0x0000000000000000, 0x479244af00000000, 0xcf22f88500000000, + 0x88b0bc2a00000000, 0xdf4381d000000000, 0x98d1c57f00000000, + 0x1061795500000000, 0x57f33dfa00000000, 0xff81737a00000000, + 0xb81337d500000000, 0x30a38bff00000000, 0x7731cf5000000000, + 0x20c2f2aa00000000, 0x6750b60500000000, 0xefe00a2f00000000, + 0xa8724e8000000000, 0xfe03e7f400000000, 0xb991a35b00000000, + 0x31211f7100000000, 0x76b35bde00000000, 0x2140662400000000, + 0x66d2228b00000000, 0xee629ea100000000, 0xa9f0da0e00000000, + 0x0182948e00000000, 0x4610d02100000000, 0xcea06c0b00000000, + 0x893228a400000000, 0xdec1155e00000000, 0x995351f100000000, + 0x11e3eddb00000000, 0x5671a97400000000, 0xbd01bf3200000000, + 0xfa93fb9d00000000, 0x722347b700000000, 0x35b1031800000000, + 0x62423ee200000000, 0x25d07a4d00000000, 0xad60c66700000000, + 0xeaf282c800000000, 0x4280cc4800000000, 0x051288e700000000, + 0x8da234cd00000000, 0xca30706200000000, 0x9dc34d9800000000, + 0xda51093700000000, 0x52e1b51d00000000, 0x1573f1b200000000, + 0x430258c600000000, 0x04901c6900000000, 0x8c20a04300000000, + 0xcbb2e4ec00000000, 0x9c41d91600000000, 0xdbd39db900000000, + 0x5363219300000000, 0x14f1653c00000000, 0xbc832bbc00000000, + 0xfb116f1300000000, 0x73a1d33900000000, 0x3433979600000000, + 0x63c0aa6c00000000, 0x2452eec300000000, 0xace252e900000000, + 0xeb70164600000000, 0x7a037e6500000000, 0x3d913aca00000000, + 0xb52186e000000000, 0xf2b3c24f00000000, 0xa540ffb500000000, + 0xe2d2bb1a00000000, 0x6a62073000000000, 0x2df0439f00000000, + 0x85820d1f00000000, 0xc21049b000000000, 0x4aa0f59a00000000, + 0x0d32b13500000000, 0x5ac18ccf00000000, 0x1d53c86000000000, + 0x95e3744a00000000, 0xd27130e500000000, 0x8400999100000000, + 0xc392dd3e00000000, 0x4b22611400000000, 0x0cb025bb00000000, + 0x5b43184100000000, 0x1cd15cee00000000, 0x9461e0c400000000, + 0xd3f3a46b00000000, 0x7b81eaeb00000000, 0x3c13ae4400000000, + 0xb4a3126e00000000, 0xf33156c100000000, 0xa4c26b3b00000000, + 0xe3502f9400000000, 0x6be093be00000000, 0x2c72d71100000000, + 0xc702c15700000000, 0x809085f800000000, 0x082039d200000000, + 0x4fb27d7d00000000, 0x1841408700000000, 0x5fd3042800000000, + 0xd763b80200000000, 0x90f1fcad00000000, 0x3883b22d00000000, + 0x7f11f68200000000, 0xf7a14aa800000000, 0xb0330e0700000000, + 0xe7c033fd00000000, 0xa052775200000000, 0x28e2cb7800000000, + 0x6f708fd700000000, 0x390126a300000000, 0x7e93620c00000000, + 0xf623de2600000000, 0xb1b19a8900000000, 0xe642a77300000000, + 0xa1d0e3dc00000000, 0x29605ff600000000, 0x6ef21b5900000000, + 0xc68055d900000000, 0x8112117600000000, 0x09a2ad5c00000000, + 0x4e30e9f300000000, 0x19c3d40900000000, 0x5e5190a600000000, + 0xd6e12c8c00000000, 0x9173682300000000, 0xf406fcca00000000, + 0xb394b86500000000, 0x3b24044f00000000, 0x7cb640e000000000, + 0x2b457d1a00000000, 0x6cd739b500000000, 0xe467859f00000000, + 0xa3f5c13000000000, 0x0b878fb000000000, 0x4c15cb1f00000000, + 0xc4a5773500000000, 0x8337339a00000000, 0xd4c40e6000000000, + 0x93564acf00000000, 0x1be6f6e500000000, 0x5c74b24a00000000, + 0x0a051b3e00000000, 0x4d975f9100000000, 0xc527e3bb00000000, + 0x82b5a71400000000, 0xd5469aee00000000, 0x92d4de4100000000, + 0x1a64626b00000000, 0x5df626c400000000, 0xf584684400000000, + 0xb2162ceb00000000, 0x3aa690c100000000, 0x7d34d46e00000000, + 0x2ac7e99400000000, 0x6d55ad3b00000000, 0xe5e5111100000000, + 0xa27755be00000000, 0x490743f800000000, 0x0e95075700000000, + 0x8625bb7d00000000, 0xc1b7ffd200000000, 0x9644c22800000000, + 0xd1d6868700000000, 0x59663aad00000000, 0x1ef47e0200000000, + 0xb686308200000000, 0xf114742d00000000, 0x79a4c80700000000, + 0x3e368ca800000000, 0x69c5b15200000000, 0x2e57f5fd00000000, + 0xa6e749d700000000, 0xe1750d7800000000, 0xb704a40c00000000, + 0xf096e0a300000000, 0x78265c8900000000, 0x3fb4182600000000, + 0x684725dc00000000, 0x2fd5617300000000, 0xa765dd5900000000, + 0xe0f799f600000000, 0x4885d77600000000, 0x0f1793d900000000, + 0x87a72ff300000000, 0xc0356b5c00000000, 0x97c656a600000000, + 0xd054120900000000, 0x58e4ae2300000000, 0x1f76ea8c00000000, + 0x8e0582af00000000, 0xc997c60000000000, 0x41277a2a00000000, + 0x06b53e8500000000, 0x5146037f00000000, 0x16d447d000000000, + 0x9e64fbfa00000000, 0xd9f6bf5500000000, 0x7184f1d500000000, + 0x3616b57a00000000, 0xbea6095000000000, 0xf9344dff00000000, + 0xaec7700500000000, 0xe95534aa00000000, 0x61e5888000000000, + 0x2677cc2f00000000, 0x7006655b00000000, 0x379421f400000000, + 0xbf249dde00000000, 0xf8b6d97100000000, 0xaf45e48b00000000, + 0xe8d7a02400000000, 0x60671c0e00000000, 0x27f558a100000000, + 0x8f87162100000000, 0xc815528e00000000, 0x40a5eea400000000, + 0x0737aa0b00000000, 0x50c497f100000000, 0x1756d35e00000000, + 0x9fe66f7400000000, 0xd8742bdb00000000, 0x33043d9d00000000, + 0x7496793200000000, 0xfc26c51800000000, 0xbbb481b700000000, + 0xec47bc4d00000000, 0xabd5f8e200000000, 0x236544c800000000, + 0x64f7006700000000, 0xcc854ee700000000, 0x8b170a4800000000, + 0x03a7b66200000000, 0x4435f2cd00000000, 0x13c6cf3700000000, + 0x54548b9800000000, 0xdce437b200000000, 0x9b76731d00000000, + 0xcd07da6900000000, 0x8a959ec600000000, 0x022522ec00000000, + 0x45b7664300000000, 0x12445bb900000000, 0x55d61f1600000000, + 0xdd66a33c00000000, 0x9af4e79300000000, 0x3286a91300000000, + 0x7514edbc00000000, 0xfda4519600000000, 0xba36153900000000, + 0xedc528c300000000, 0xaa576c6c00000000, 0x22e7d04600000000, + 0x657594e900000000}}; + +#else /* W == 4 */ + +local const z_crc_t FAR crc_braid_table[][256] = { + {0x00000000, 0x65673b46, 0xcace768c, 0xafa94dca, 0x4eedeb59, + 0x2b8ad01f, 0x84239dd5, 0xe144a693, 0x9ddbd6b2, 0xf8bcedf4, + 0x5715a03e, 0x32729b78, 0xd3363deb, 0xb65106ad, 0x19f84b67, + 0x7c9f7021, 0xe0c6ab25, 0x85a19063, 0x2a08dda9, 0x4f6fe6ef, + 0xae2b407c, 0xcb4c7b3a, 0x64e536f0, 0x01820db6, 0x7d1d7d97, + 0x187a46d1, 0xb7d30b1b, 0xd2b4305d, 0x33f096ce, 0x5697ad88, + 0xf93ee042, 0x9c59db04, 0x1afc500b, 0x7f9b6b4d, 0xd0322687, + 0xb5551dc1, 0x5411bb52, 0x31768014, 0x9edfcdde, 0xfbb8f698, + 0x872786b9, 0xe240bdff, 0x4de9f035, 0x288ecb73, 0xc9ca6de0, + 0xacad56a6, 0x03041b6c, 0x6663202a, 0xfa3afb2e, 0x9f5dc068, + 0x30f48da2, 0x5593b6e4, 0xb4d71077, 0xd1b02b31, 0x7e1966fb, + 0x1b7e5dbd, 0x67e12d9c, 0x028616da, 0xad2f5b10, 0xc8486056, + 0x290cc6c5, 0x4c6bfd83, 0xe3c2b049, 0x86a58b0f, 0x35f8a016, + 0x509f9b50, 0xff36d69a, 0x9a51eddc, 0x7b154b4f, 0x1e727009, + 0xb1db3dc3, 0xd4bc0685, 0xa82376a4, 0xcd444de2, 0x62ed0028, + 0x078a3b6e, 0xe6ce9dfd, 0x83a9a6bb, 0x2c00eb71, 0x4967d037, + 0xd53e0b33, 0xb0593075, 0x1ff07dbf, 0x7a9746f9, 0x9bd3e06a, + 0xfeb4db2c, 0x511d96e6, 0x347aada0, 0x48e5dd81, 0x2d82e6c7, + 0x822bab0d, 0xe74c904b, 0x060836d8, 0x636f0d9e, 0xccc64054, + 0xa9a17b12, 0x2f04f01d, 0x4a63cb5b, 0xe5ca8691, 0x80adbdd7, + 0x61e91b44, 0x048e2002, 0xab276dc8, 0xce40568e, 0xb2df26af, + 0xd7b81de9, 0x78115023, 0x1d766b65, 0xfc32cdf6, 0x9955f6b0, + 0x36fcbb7a, 0x539b803c, 0xcfc25b38, 0xaaa5607e, 0x050c2db4, + 0x606b16f2, 0x812fb061, 0xe4488b27, 0x4be1c6ed, 0x2e86fdab, + 0x52198d8a, 0x377eb6cc, 0x98d7fb06, 0xfdb0c040, 0x1cf466d3, + 0x79935d95, 0xd63a105f, 0xb35d2b19, 0x6bf1402c, 0x0e967b6a, + 0xa13f36a0, 0xc4580de6, 0x251cab75, 0x407b9033, 0xefd2ddf9, + 0x8ab5e6bf, 0xf62a969e, 0x934dadd8, 0x3ce4e012, 0x5983db54, + 0xb8c77dc7, 0xdda04681, 0x72090b4b, 0x176e300d, 0x8b37eb09, + 0xee50d04f, 0x41f99d85, 0x249ea6c3, 0xc5da0050, 0xa0bd3b16, + 0x0f1476dc, 0x6a734d9a, 0x16ec3dbb, 0x738b06fd, 0xdc224b37, + 0xb9457071, 0x5801d6e2, 0x3d66eda4, 0x92cfa06e, 0xf7a89b28, + 0x710d1027, 0x146a2b61, 0xbbc366ab, 0xdea45ded, 0x3fe0fb7e, + 0x5a87c038, 0xf52e8df2, 0x9049b6b4, 0xecd6c695, 0x89b1fdd3, + 0x2618b019, 0x437f8b5f, 0xa23b2dcc, 0xc75c168a, 0x68f55b40, + 0x0d926006, 0x91cbbb02, 0xf4ac8044, 0x5b05cd8e, 0x3e62f6c8, + 0xdf26505b, 0xba416b1d, 0x15e826d7, 0x708f1d91, 0x0c106db0, + 0x697756f6, 0xc6de1b3c, 0xa3b9207a, 0x42fd86e9, 0x279abdaf, + 0x8833f065, 0xed54cb23, 0x5e09e03a, 0x3b6edb7c, 0x94c796b6, + 0xf1a0adf0, 0x10e40b63, 0x75833025, 0xda2a7def, 0xbf4d46a9, + 0xc3d23688, 0xa6b50dce, 0x091c4004, 0x6c7b7b42, 0x8d3fddd1, + 0xe858e697, 0x47f1ab5d, 0x2296901b, 0xbecf4b1f, 0xdba87059, + 0x74013d93, 0x116606d5, 0xf022a046, 0x95459b00, 0x3aecd6ca, + 0x5f8bed8c, 0x23149dad, 0x4673a6eb, 0xe9daeb21, 0x8cbdd067, + 0x6df976f4, 0x089e4db2, 0xa7370078, 0xc2503b3e, 0x44f5b031, + 0x21928b77, 0x8e3bc6bd, 0xeb5cfdfb, 0x0a185b68, 0x6f7f602e, + 0xc0d62de4, 0xa5b116a2, 0xd92e6683, 0xbc495dc5, 0x13e0100f, + 0x76872b49, 0x97c38dda, 0xf2a4b69c, 0x5d0dfb56, 0x386ac010, + 0xa4331b14, 0xc1542052, 0x6efd6d98, 0x0b9a56de, 0xeadef04d, + 0x8fb9cb0b, 0x201086c1, 0x4577bd87, 0x39e8cda6, 0x5c8ff6e0, + 0xf326bb2a, 0x9641806c, 0x770526ff, 0x12621db9, 0xbdcb5073, + 0xd8ac6b35}, + {0x00000000, 0xd7e28058, 0x74b406f1, 0xa35686a9, 0xe9680de2, + 0x3e8a8dba, 0x9ddc0b13, 0x4a3e8b4b, 0x09a11d85, 0xde439ddd, + 0x7d151b74, 0xaaf79b2c, 0xe0c91067, 0x372b903f, 0x947d1696, + 0x439f96ce, 0x13423b0a, 0xc4a0bb52, 0x67f63dfb, 0xb014bda3, + 0xfa2a36e8, 0x2dc8b6b0, 0x8e9e3019, 0x597cb041, 0x1ae3268f, + 0xcd01a6d7, 0x6e57207e, 0xb9b5a026, 0xf38b2b6d, 0x2469ab35, + 0x873f2d9c, 0x50ddadc4, 0x26847614, 0xf166f64c, 0x523070e5, + 0x85d2f0bd, 0xcfec7bf6, 0x180efbae, 0xbb587d07, 0x6cbafd5f, + 0x2f256b91, 0xf8c7ebc9, 0x5b916d60, 0x8c73ed38, 0xc64d6673, + 0x11afe62b, 0xb2f96082, 0x651be0da, 0x35c64d1e, 0xe224cd46, + 0x41724bef, 0x9690cbb7, 0xdcae40fc, 0x0b4cc0a4, 0xa81a460d, + 0x7ff8c655, 0x3c67509b, 0xeb85d0c3, 0x48d3566a, 0x9f31d632, + 0xd50f5d79, 0x02eddd21, 0xa1bb5b88, 0x7659dbd0, 0x4d08ec28, + 0x9aea6c70, 0x39bcead9, 0xee5e6a81, 0xa460e1ca, 0x73826192, + 0xd0d4e73b, 0x07366763, 0x44a9f1ad, 0x934b71f5, 0x301df75c, + 0xe7ff7704, 0xadc1fc4f, 0x7a237c17, 0xd975fabe, 0x0e977ae6, + 0x5e4ad722, 0x89a8577a, 0x2afed1d3, 0xfd1c518b, 0xb722dac0, + 0x60c05a98, 0xc396dc31, 0x14745c69, 0x57ebcaa7, 0x80094aff, + 0x235fcc56, 0xf4bd4c0e, 0xbe83c745, 0x6961471d, 0xca37c1b4, + 0x1dd541ec, 0x6b8c9a3c, 0xbc6e1a64, 0x1f389ccd, 0xc8da1c95, + 0x82e497de, 0x55061786, 0xf650912f, 0x21b21177, 0x622d87b9, + 0xb5cf07e1, 0x16998148, 0xc17b0110, 0x8b458a5b, 0x5ca70a03, + 0xfff18caa, 0x28130cf2, 0x78cea136, 0xaf2c216e, 0x0c7aa7c7, + 0xdb98279f, 0x91a6acd4, 0x46442c8c, 0xe512aa25, 0x32f02a7d, + 0x716fbcb3, 0xa68d3ceb, 0x05dbba42, 0xd2393a1a, 0x9807b151, + 0x4fe53109, 0xecb3b7a0, 0x3b5137f8, 0x9a11d850, 0x4df35808, + 0xeea5dea1, 0x39475ef9, 0x7379d5b2, 0xa49b55ea, 0x07cdd343, + 0xd02f531b, 0x93b0c5d5, 0x4452458d, 0xe704c324, 0x30e6437c, + 0x7ad8c837, 0xad3a486f, 0x0e6ccec6, 0xd98e4e9e, 0x8953e35a, + 0x5eb16302, 0xfde7e5ab, 0x2a0565f3, 0x603beeb8, 0xb7d96ee0, + 0x148fe849, 0xc36d6811, 0x80f2fedf, 0x57107e87, 0xf446f82e, + 0x23a47876, 0x699af33d, 0xbe787365, 0x1d2ef5cc, 0xcacc7594, + 0xbc95ae44, 0x6b772e1c, 0xc821a8b5, 0x1fc328ed, 0x55fda3a6, + 0x821f23fe, 0x2149a557, 0xf6ab250f, 0xb534b3c1, 0x62d63399, + 0xc180b530, 0x16623568, 0x5c5cbe23, 0x8bbe3e7b, 0x28e8b8d2, + 0xff0a388a, 0xafd7954e, 0x78351516, 0xdb6393bf, 0x0c8113e7, + 0x46bf98ac, 0x915d18f4, 0x320b9e5d, 0xe5e91e05, 0xa67688cb, + 0x71940893, 0xd2c28e3a, 0x05200e62, 0x4f1e8529, 0x98fc0571, + 0x3baa83d8, 0xec480380, 0xd7193478, 0x00fbb420, 0xa3ad3289, + 0x744fb2d1, 0x3e71399a, 0xe993b9c2, 0x4ac53f6b, 0x9d27bf33, + 0xdeb829fd, 0x095aa9a5, 0xaa0c2f0c, 0x7deeaf54, 0x37d0241f, + 0xe032a447, 0x436422ee, 0x9486a2b6, 0xc45b0f72, 0x13b98f2a, + 0xb0ef0983, 0x670d89db, 0x2d330290, 0xfad182c8, 0x59870461, + 0x8e658439, 0xcdfa12f7, 0x1a1892af, 0xb94e1406, 0x6eac945e, + 0x24921f15, 0xf3709f4d, 0x502619e4, 0x87c499bc, 0xf19d426c, + 0x267fc234, 0x8529449d, 0x52cbc4c5, 0x18f54f8e, 0xcf17cfd6, + 0x6c41497f, 0xbba3c927, 0xf83c5fe9, 0x2fdedfb1, 0x8c885918, + 0x5b6ad940, 0x1154520b, 0xc6b6d253, 0x65e054fa, 0xb202d4a2, + 0xe2df7966, 0x353df93e, 0x966b7f97, 0x4189ffcf, 0x0bb77484, + 0xdc55f4dc, 0x7f037275, 0xa8e1f22d, 0xeb7e64e3, 0x3c9ce4bb, + 0x9fca6212, 0x4828e24a, 0x02166901, 0xd5f4e959, 0x76a26ff0, + 0xa140efa8}, + {0x00000000, 0xef52b6e1, 0x05d46b83, 0xea86dd62, 0x0ba8d706, + 0xe4fa61e7, 0x0e7cbc85, 0xe12e0a64, 0x1751ae0c, 0xf80318ed, + 0x1285c58f, 0xfdd7736e, 0x1cf9790a, 0xf3abcfeb, 0x192d1289, + 0xf67fa468, 0x2ea35c18, 0xc1f1eaf9, 0x2b77379b, 0xc425817a, + 0x250b8b1e, 0xca593dff, 0x20dfe09d, 0xcf8d567c, 0x39f2f214, + 0xd6a044f5, 0x3c269997, 0xd3742f76, 0x325a2512, 0xdd0893f3, + 0x378e4e91, 0xd8dcf870, 0x5d46b830, 0xb2140ed1, 0x5892d3b3, + 0xb7c06552, 0x56ee6f36, 0xb9bcd9d7, 0x533a04b5, 0xbc68b254, + 0x4a17163c, 0xa545a0dd, 0x4fc37dbf, 0xa091cb5e, 0x41bfc13a, + 0xaeed77db, 0x446baab9, 0xab391c58, 0x73e5e428, 0x9cb752c9, + 0x76318fab, 0x9963394a, 0x784d332e, 0x971f85cf, 0x7d9958ad, + 0x92cbee4c, 0x64b44a24, 0x8be6fcc5, 0x616021a7, 0x8e329746, + 0x6f1c9d22, 0x804e2bc3, 0x6ac8f6a1, 0x859a4040, 0xba8d7060, + 0x55dfc681, 0xbf591be3, 0x500bad02, 0xb125a766, 0x5e771187, + 0xb4f1cce5, 0x5ba37a04, 0xaddcde6c, 0x428e688d, 0xa808b5ef, + 0x475a030e, 0xa674096a, 0x4926bf8b, 0xa3a062e9, 0x4cf2d408, + 0x942e2c78, 0x7b7c9a99, 0x91fa47fb, 0x7ea8f11a, 0x9f86fb7e, + 0x70d44d9f, 0x9a5290fd, 0x7500261c, 0x837f8274, 0x6c2d3495, + 0x86abe9f7, 0x69f95f16, 0x88d75572, 0x6785e393, 0x8d033ef1, + 0x62518810, 0xe7cbc850, 0x08997eb1, 0xe21fa3d3, 0x0d4d1532, + 0xec631f56, 0x0331a9b7, 0xe9b774d5, 0x06e5c234, 0xf09a665c, + 0x1fc8d0bd, 0xf54e0ddf, 0x1a1cbb3e, 0xfb32b15a, 0x146007bb, + 0xfee6dad9, 0x11b46c38, 0xc9689448, 0x263a22a9, 0xccbcffcb, + 0x23ee492a, 0xc2c0434e, 0x2d92f5af, 0xc71428cd, 0x28469e2c, + 0xde393a44, 0x316b8ca5, 0xdbed51c7, 0x34bfe726, 0xd591ed42, + 0x3ac35ba3, 0xd04586c1, 0x3f173020, 0xae6be681, 0x41395060, + 0xabbf8d02, 0x44ed3be3, 0xa5c33187, 0x4a918766, 0xa0175a04, + 0x4f45ece5, 0xb93a488d, 0x5668fe6c, 0xbcee230e, 0x53bc95ef, + 0xb2929f8b, 0x5dc0296a, 0xb746f408, 0x581442e9, 0x80c8ba99, + 0x6f9a0c78, 0x851cd11a, 0x6a4e67fb, 0x8b606d9f, 0x6432db7e, + 0x8eb4061c, 0x61e6b0fd, 0x97991495, 0x78cba274, 0x924d7f16, + 0x7d1fc9f7, 0x9c31c393, 0x73637572, 0x99e5a810, 0x76b71ef1, + 0xf32d5eb1, 0x1c7fe850, 0xf6f93532, 0x19ab83d3, 0xf88589b7, + 0x17d73f56, 0xfd51e234, 0x120354d5, 0xe47cf0bd, 0x0b2e465c, + 0xe1a89b3e, 0x0efa2ddf, 0xefd427bb, 0x0086915a, 0xea004c38, + 0x0552fad9, 0xdd8e02a9, 0x32dcb448, 0xd85a692a, 0x3708dfcb, + 0xd626d5af, 0x3974634e, 0xd3f2be2c, 0x3ca008cd, 0xcadfaca5, + 0x258d1a44, 0xcf0bc726, 0x205971c7, 0xc1777ba3, 0x2e25cd42, + 0xc4a31020, 0x2bf1a6c1, 0x14e696e1, 0xfbb42000, 0x1132fd62, + 0xfe604b83, 0x1f4e41e7, 0xf01cf706, 0x1a9a2a64, 0xf5c89c85, + 0x03b738ed, 0xece58e0c, 0x0663536e, 0xe931e58f, 0x081fefeb, + 0xe74d590a, 0x0dcb8468, 0xe2993289, 0x3a45caf9, 0xd5177c18, + 0x3f91a17a, 0xd0c3179b, 0x31ed1dff, 0xdebfab1e, 0x3439767c, + 0xdb6bc09d, 0x2d1464f5, 0xc246d214, 0x28c00f76, 0xc792b997, + 0x26bcb3f3, 0xc9ee0512, 0x2368d870, 0xcc3a6e91, 0x49a02ed1, + 0xa6f29830, 0x4c744552, 0xa326f3b3, 0x4208f9d7, 0xad5a4f36, + 0x47dc9254, 0xa88e24b5, 0x5ef180dd, 0xb1a3363c, 0x5b25eb5e, + 0xb4775dbf, 0x555957db, 0xba0be13a, 0x508d3c58, 0xbfdf8ab9, + 0x670372c9, 0x8851c428, 0x62d7194a, 0x8d85afab, 0x6caba5cf, + 0x83f9132e, 0x697fce4c, 0x862d78ad, 0x7052dcc5, 0x9f006a24, + 0x7586b746, 0x9ad401a7, 0x7bfa0bc3, 0x94a8bd22, 0x7e2e6040, + 0x917cd6a1}, + {0x00000000, 0x87a6cb43, 0xd43c90c7, 0x539a5b84, 0x730827cf, + 0xf4aeec8c, 0xa734b708, 0x20927c4b, 0xe6104f9e, 0x61b684dd, + 0x322cdf59, 0xb58a141a, 0x95186851, 0x12bea312, 0x4124f896, + 0xc68233d5, 0x1751997d, 0x90f7523e, 0xc36d09ba, 0x44cbc2f9, + 0x6459beb2, 0xe3ff75f1, 0xb0652e75, 0x37c3e536, 0xf141d6e3, + 0x76e71da0, 0x257d4624, 0xa2db8d67, 0x8249f12c, 0x05ef3a6f, + 0x567561eb, 0xd1d3aaa8, 0x2ea332fa, 0xa905f9b9, 0xfa9fa23d, + 0x7d39697e, 0x5dab1535, 0xda0dde76, 0x899785f2, 0x0e314eb1, + 0xc8b37d64, 0x4f15b627, 0x1c8feda3, 0x9b2926e0, 0xbbbb5aab, + 0x3c1d91e8, 0x6f87ca6c, 0xe821012f, 0x39f2ab87, 0xbe5460c4, + 0xedce3b40, 0x6a68f003, 0x4afa8c48, 0xcd5c470b, 0x9ec61c8f, + 0x1960d7cc, 0xdfe2e419, 0x58442f5a, 0x0bde74de, 0x8c78bf9d, + 0xaceac3d6, 0x2b4c0895, 0x78d65311, 0xff709852, 0x5d4665f4, + 0xdae0aeb7, 0x897af533, 0x0edc3e70, 0x2e4e423b, 0xa9e88978, + 0xfa72d2fc, 0x7dd419bf, 0xbb562a6a, 0x3cf0e129, 0x6f6abaad, + 0xe8cc71ee, 0xc85e0da5, 0x4ff8c6e6, 0x1c629d62, 0x9bc45621, + 0x4a17fc89, 0xcdb137ca, 0x9e2b6c4e, 0x198da70d, 0x391fdb46, + 0xbeb91005, 0xed234b81, 0x6a8580c2, 0xac07b317, 0x2ba17854, + 0x783b23d0, 0xff9de893, 0xdf0f94d8, 0x58a95f9b, 0x0b33041f, + 0x8c95cf5c, 0x73e5570e, 0xf4439c4d, 0xa7d9c7c9, 0x207f0c8a, + 0x00ed70c1, 0x874bbb82, 0xd4d1e006, 0x53772b45, 0x95f51890, + 0x1253d3d3, 0x41c98857, 0xc66f4314, 0xe6fd3f5f, 0x615bf41c, + 0x32c1af98, 0xb56764db, 0x64b4ce73, 0xe3120530, 0xb0885eb4, + 0x372e95f7, 0x17bce9bc, 0x901a22ff, 0xc380797b, 0x4426b238, + 0x82a481ed, 0x05024aae, 0x5698112a, 0xd13eda69, 0xf1aca622, + 0x760a6d61, 0x259036e5, 0xa236fda6, 0xba8ccbe8, 0x3d2a00ab, + 0x6eb05b2f, 0xe916906c, 0xc984ec27, 0x4e222764, 0x1db87ce0, + 0x9a1eb7a3, 0x5c9c8476, 0xdb3a4f35, 0x88a014b1, 0x0f06dff2, + 0x2f94a3b9, 0xa83268fa, 0xfba8337e, 0x7c0ef83d, 0xaddd5295, + 0x2a7b99d6, 0x79e1c252, 0xfe470911, 0xded5755a, 0x5973be19, + 0x0ae9e59d, 0x8d4f2ede, 0x4bcd1d0b, 0xcc6bd648, 0x9ff18dcc, + 0x1857468f, 0x38c53ac4, 0xbf63f187, 0xecf9aa03, 0x6b5f6140, + 0x942ff912, 0x13893251, 0x401369d5, 0xc7b5a296, 0xe727dedd, + 0x6081159e, 0x331b4e1a, 0xb4bd8559, 0x723fb68c, 0xf5997dcf, + 0xa603264b, 0x21a5ed08, 0x01379143, 0x86915a00, 0xd50b0184, + 0x52adcac7, 0x837e606f, 0x04d8ab2c, 0x5742f0a8, 0xd0e43beb, + 0xf07647a0, 0x77d08ce3, 0x244ad767, 0xa3ec1c24, 0x656e2ff1, + 0xe2c8e4b2, 0xb152bf36, 0x36f47475, 0x1666083e, 0x91c0c37d, + 0xc25a98f9, 0x45fc53ba, 0xe7caae1c, 0x606c655f, 0x33f63edb, + 0xb450f598, 0x94c289d3, 0x13644290, 0x40fe1914, 0xc758d257, + 0x01dae182, 0x867c2ac1, 0xd5e67145, 0x5240ba06, 0x72d2c64d, + 0xf5740d0e, 0xa6ee568a, 0x21489dc9, 0xf09b3761, 0x773dfc22, + 0x24a7a7a6, 0xa3016ce5, 0x839310ae, 0x0435dbed, 0x57af8069, + 0xd0094b2a, 0x168b78ff, 0x912db3bc, 0xc2b7e838, 0x4511237b, + 0x65835f30, 0xe2259473, 0xb1bfcff7, 0x361904b4, 0xc9699ce6, + 0x4ecf57a5, 0x1d550c21, 0x9af3c762, 0xba61bb29, 0x3dc7706a, + 0x6e5d2bee, 0xe9fbe0ad, 0x2f79d378, 0xa8df183b, 0xfb4543bf, + 0x7ce388fc, 0x5c71f4b7, 0xdbd73ff4, 0x884d6470, 0x0febaf33, + 0xde38059b, 0x599eced8, 0x0a04955c, 0x8da25e1f, 0xad302254, + 0x2a96e917, 0x790cb293, 0xfeaa79d0, 0x38284a05, 0xbf8e8146, + 0xec14dac2, 0x6bb21181, 0x4b206dca, 0xcc86a689, 0x9f1cfd0d, + 0x18ba364e}}; + +local const z_word_t FAR crc_braid_big_table[][256] = { + {0x00000000, 0x43cba687, 0xc7903cd4, 0x845b9a53, 0xcf270873, + 0x8cecaef4, 0x08b734a7, 0x4b7c9220, 0x9e4f10e6, 0xdd84b661, + 0x59df2c32, 0x1a148ab5, 0x51681895, 0x12a3be12, 0x96f82441, + 0xd53382c6, 0x7d995117, 0x3e52f790, 0xba096dc3, 0xf9c2cb44, + 0xb2be5964, 0xf175ffe3, 0x752e65b0, 0x36e5c337, 0xe3d641f1, + 0xa01de776, 0x24467d25, 0x678ddba2, 0x2cf14982, 0x6f3aef05, + 0xeb617556, 0xa8aad3d1, 0xfa32a32e, 0xb9f905a9, 0x3da29ffa, + 0x7e69397d, 0x3515ab5d, 0x76de0dda, 0xf2859789, 0xb14e310e, + 0x647db3c8, 0x27b6154f, 0xa3ed8f1c, 0xe026299b, 0xab5abbbb, + 0xe8911d3c, 0x6cca876f, 0x2f0121e8, 0x87abf239, 0xc46054be, + 0x403bceed, 0x03f0686a, 0x488cfa4a, 0x0b475ccd, 0x8f1cc69e, + 0xccd76019, 0x19e4e2df, 0x5a2f4458, 0xde74de0b, 0x9dbf788c, + 0xd6c3eaac, 0x95084c2b, 0x1153d678, 0x529870ff, 0xf465465d, + 0xb7aee0da, 0x33f57a89, 0x703edc0e, 0x3b424e2e, 0x7889e8a9, + 0xfcd272fa, 0xbf19d47d, 0x6a2a56bb, 0x29e1f03c, 0xadba6a6f, + 0xee71cce8, 0xa50d5ec8, 0xe6c6f84f, 0x629d621c, 0x2156c49b, + 0x89fc174a, 0xca37b1cd, 0x4e6c2b9e, 0x0da78d19, 0x46db1f39, + 0x0510b9be, 0x814b23ed, 0xc280856a, 0x17b307ac, 0x5478a12b, + 0xd0233b78, 0x93e89dff, 0xd8940fdf, 0x9b5fa958, 0x1f04330b, + 0x5ccf958c, 0x0e57e573, 0x4d9c43f4, 0xc9c7d9a7, 0x8a0c7f20, + 0xc170ed00, 0x82bb4b87, 0x06e0d1d4, 0x452b7753, 0x9018f595, + 0xd3d35312, 0x5788c941, 0x14436fc6, 0x5f3ffde6, 0x1cf45b61, + 0x98afc132, 0xdb6467b5, 0x73ceb464, 0x300512e3, 0xb45e88b0, + 0xf7952e37, 0xbce9bc17, 0xff221a90, 0x7b7980c3, 0x38b22644, + 0xed81a482, 0xae4a0205, 0x2a119856, 0x69da3ed1, 0x22a6acf1, + 0x616d0a76, 0xe5369025, 0xa6fd36a2, 0xe8cb8cba, 0xab002a3d, + 0x2f5bb06e, 0x6c9016e9, 0x27ec84c9, 0x6427224e, 0xe07cb81d, + 0xa3b71e9a, 0x76849c5c, 0x354f3adb, 0xb114a088, 0xf2df060f, + 0xb9a3942f, 0xfa6832a8, 0x7e33a8fb, 0x3df80e7c, 0x9552ddad, + 0xd6997b2a, 0x52c2e179, 0x110947fe, 0x5a75d5de, 0x19be7359, + 0x9de5e90a, 0xde2e4f8d, 0x0b1dcd4b, 0x48d66bcc, 0xcc8df19f, + 0x8f465718, 0xc43ac538, 0x87f163bf, 0x03aaf9ec, 0x40615f6b, + 0x12f92f94, 0x51328913, 0xd5691340, 0x96a2b5c7, 0xddde27e7, + 0x9e158160, 0x1a4e1b33, 0x5985bdb4, 0x8cb63f72, 0xcf7d99f5, + 0x4b2603a6, 0x08eda521, 0x43913701, 0x005a9186, 0x84010bd5, + 0xc7caad52, 0x6f607e83, 0x2cabd804, 0xa8f04257, 0xeb3be4d0, + 0xa04776f0, 0xe38cd077, 0x67d74a24, 0x241ceca3, 0xf12f6e65, + 0xb2e4c8e2, 0x36bf52b1, 0x7574f436, 0x3e086616, 0x7dc3c091, + 0xf9985ac2, 0xba53fc45, 0x1caecae7, 0x5f656c60, 0xdb3ef633, + 0x98f550b4, 0xd389c294, 0x90426413, 0x1419fe40, 0x57d258c7, + 0x82e1da01, 0xc12a7c86, 0x4571e6d5, 0x06ba4052, 0x4dc6d272, + 0x0e0d74f5, 0x8a56eea6, 0xc99d4821, 0x61379bf0, 0x22fc3d77, + 0xa6a7a724, 0xe56c01a3, 0xae109383, 0xeddb3504, 0x6980af57, + 0x2a4b09d0, 0xff788b16, 0xbcb32d91, 0x38e8b7c2, 0x7b231145, + 0x305f8365, 0x739425e2, 0xf7cfbfb1, 0xb4041936, 0xe69c69c9, + 0xa557cf4e, 0x210c551d, 0x62c7f39a, 0x29bb61ba, 0x6a70c73d, + 0xee2b5d6e, 0xade0fbe9, 0x78d3792f, 0x3b18dfa8, 0xbf4345fb, + 0xfc88e37c, 0xb7f4715c, 0xf43fd7db, 0x70644d88, 0x33afeb0f, + 0x9b0538de, 0xd8ce9e59, 0x5c95040a, 0x1f5ea28d, 0x542230ad, + 0x17e9962a, 0x93b20c79, 0xd079aafe, 0x054a2838, 0x46818ebf, + 0xc2da14ec, 0x8111b26b, 0xca6d204b, 0x89a686cc, 0x0dfd1c9f, + 0x4e36ba18}, + {0x00000000, 0xe1b652ef, 0x836bd405, 0x62dd86ea, 0x06d7a80b, + 0xe761fae4, 0x85bc7c0e, 0x640a2ee1, 0x0cae5117, 0xed1803f8, + 0x8fc58512, 0x6e73d7fd, 0x0a79f91c, 0xebcfabf3, 0x89122d19, + 0x68a47ff6, 0x185ca32e, 0xf9eaf1c1, 0x9b37772b, 0x7a8125c4, + 0x1e8b0b25, 0xff3d59ca, 0x9de0df20, 0x7c568dcf, 0x14f2f239, + 0xf544a0d6, 0x9799263c, 0x762f74d3, 0x12255a32, 0xf39308dd, + 0x914e8e37, 0x70f8dcd8, 0x30b8465d, 0xd10e14b2, 0xb3d39258, + 0x5265c0b7, 0x366fee56, 0xd7d9bcb9, 0xb5043a53, 0x54b268bc, + 0x3c16174a, 0xdda045a5, 0xbf7dc34f, 0x5ecb91a0, 0x3ac1bf41, + 0xdb77edae, 0xb9aa6b44, 0x581c39ab, 0x28e4e573, 0xc952b79c, + 0xab8f3176, 0x4a396399, 0x2e334d78, 0xcf851f97, 0xad58997d, + 0x4ceecb92, 0x244ab464, 0xc5fce68b, 0xa7216061, 0x4697328e, + 0x229d1c6f, 0xc32b4e80, 0xa1f6c86a, 0x40409a85, 0x60708dba, + 0x81c6df55, 0xe31b59bf, 0x02ad0b50, 0x66a725b1, 0x8711775e, + 0xe5ccf1b4, 0x047aa35b, 0x6cdedcad, 0x8d688e42, 0xefb508a8, + 0x0e035a47, 0x6a0974a6, 0x8bbf2649, 0xe962a0a3, 0x08d4f24c, + 0x782c2e94, 0x999a7c7b, 0xfb47fa91, 0x1af1a87e, 0x7efb869f, + 0x9f4dd470, 0xfd90529a, 0x1c260075, 0x74827f83, 0x95342d6c, + 0xf7e9ab86, 0x165ff969, 0x7255d788, 0x93e38567, 0xf13e038d, + 0x10885162, 0x50c8cbe7, 0xb17e9908, 0xd3a31fe2, 0x32154d0d, + 0x561f63ec, 0xb7a93103, 0xd574b7e9, 0x34c2e506, 0x5c669af0, + 0xbdd0c81f, 0xdf0d4ef5, 0x3ebb1c1a, 0x5ab132fb, 0xbb076014, + 0xd9dae6fe, 0x386cb411, 0x489468c9, 0xa9223a26, 0xcbffbccc, + 0x2a49ee23, 0x4e43c0c2, 0xaff5922d, 0xcd2814c7, 0x2c9e4628, + 0x443a39de, 0xa58c6b31, 0xc751eddb, 0x26e7bf34, 0x42ed91d5, + 0xa35bc33a, 0xc18645d0, 0x2030173f, 0x81e66bae, 0x60503941, + 0x028dbfab, 0xe33bed44, 0x8731c3a5, 0x6687914a, 0x045a17a0, + 0xe5ec454f, 0x8d483ab9, 0x6cfe6856, 0x0e23eebc, 0xef95bc53, + 0x8b9f92b2, 0x6a29c05d, 0x08f446b7, 0xe9421458, 0x99bac880, + 0x780c9a6f, 0x1ad11c85, 0xfb674e6a, 0x9f6d608b, 0x7edb3264, + 0x1c06b48e, 0xfdb0e661, 0x95149997, 0x74a2cb78, 0x167f4d92, + 0xf7c91f7d, 0x93c3319c, 0x72756373, 0x10a8e599, 0xf11eb776, + 0xb15e2df3, 0x50e87f1c, 0x3235f9f6, 0xd383ab19, 0xb78985f8, + 0x563fd717, 0x34e251fd, 0xd5540312, 0xbdf07ce4, 0x5c462e0b, + 0x3e9ba8e1, 0xdf2dfa0e, 0xbb27d4ef, 0x5a918600, 0x384c00ea, + 0xd9fa5205, 0xa9028edd, 0x48b4dc32, 0x2a695ad8, 0xcbdf0837, + 0xafd526d6, 0x4e637439, 0x2cbef2d3, 0xcd08a03c, 0xa5acdfca, + 0x441a8d25, 0x26c70bcf, 0xc7715920, 0xa37b77c1, 0x42cd252e, + 0x2010a3c4, 0xc1a6f12b, 0xe196e614, 0x0020b4fb, 0x62fd3211, + 0x834b60fe, 0xe7414e1f, 0x06f71cf0, 0x642a9a1a, 0x859cc8f5, + 0xed38b703, 0x0c8ee5ec, 0x6e536306, 0x8fe531e9, 0xebef1f08, + 0x0a594de7, 0x6884cb0d, 0x893299e2, 0xf9ca453a, 0x187c17d5, + 0x7aa1913f, 0x9b17c3d0, 0xff1ded31, 0x1eabbfde, 0x7c763934, + 0x9dc06bdb, 0xf564142d, 0x14d246c2, 0x760fc028, 0x97b992c7, + 0xf3b3bc26, 0x1205eec9, 0x70d86823, 0x916e3acc, 0xd12ea049, + 0x3098f2a6, 0x5245744c, 0xb3f326a3, 0xd7f90842, 0x364f5aad, + 0x5492dc47, 0xb5248ea8, 0xdd80f15e, 0x3c36a3b1, 0x5eeb255b, + 0xbf5d77b4, 0xdb575955, 0x3ae10bba, 0x583c8d50, 0xb98adfbf, + 0xc9720367, 0x28c45188, 0x4a19d762, 0xabaf858d, 0xcfa5ab6c, + 0x2e13f983, 0x4cce7f69, 0xad782d86, 0xc5dc5270, 0x246a009f, + 0x46b78675, 0xa701d49a, 0xc30bfa7b, 0x22bda894, 0x40602e7e, + 0xa1d67c91}, + {0x00000000, 0x5880e2d7, 0xf106b474, 0xa98656a3, 0xe20d68e9, + 0xba8d8a3e, 0x130bdc9d, 0x4b8b3e4a, 0x851da109, 0xdd9d43de, + 0x741b157d, 0x2c9bf7aa, 0x6710c9e0, 0x3f902b37, 0x96167d94, + 0xce969f43, 0x0a3b4213, 0x52bba0c4, 0xfb3df667, 0xa3bd14b0, + 0xe8362afa, 0xb0b6c82d, 0x19309e8e, 0x41b07c59, 0x8f26e31a, + 0xd7a601cd, 0x7e20576e, 0x26a0b5b9, 0x6d2b8bf3, 0x35ab6924, + 0x9c2d3f87, 0xc4addd50, 0x14768426, 0x4cf666f1, 0xe5703052, + 0xbdf0d285, 0xf67beccf, 0xaefb0e18, 0x077d58bb, 0x5ffdba6c, + 0x916b252f, 0xc9ebc7f8, 0x606d915b, 0x38ed738c, 0x73664dc6, + 0x2be6af11, 0x8260f9b2, 0xdae01b65, 0x1e4dc635, 0x46cd24e2, + 0xef4b7241, 0xb7cb9096, 0xfc40aedc, 0xa4c04c0b, 0x0d461aa8, + 0x55c6f87f, 0x9b50673c, 0xc3d085eb, 0x6a56d348, 0x32d6319f, + 0x795d0fd5, 0x21dded02, 0x885bbba1, 0xd0db5976, 0x28ec084d, + 0x706cea9a, 0xd9eabc39, 0x816a5eee, 0xcae160a4, 0x92618273, + 0x3be7d4d0, 0x63673607, 0xadf1a944, 0xf5714b93, 0x5cf71d30, + 0x0477ffe7, 0x4ffcc1ad, 0x177c237a, 0xbefa75d9, 0xe67a970e, + 0x22d74a5e, 0x7a57a889, 0xd3d1fe2a, 0x8b511cfd, 0xc0da22b7, + 0x985ac060, 0x31dc96c3, 0x695c7414, 0xa7caeb57, 0xff4a0980, + 0x56cc5f23, 0x0e4cbdf4, 0x45c783be, 0x1d476169, 0xb4c137ca, + 0xec41d51d, 0x3c9a8c6b, 0x641a6ebc, 0xcd9c381f, 0x951cdac8, + 0xde97e482, 0x86170655, 0x2f9150f6, 0x7711b221, 0xb9872d62, + 0xe107cfb5, 0x48819916, 0x10017bc1, 0x5b8a458b, 0x030aa75c, + 0xaa8cf1ff, 0xf20c1328, 0x36a1ce78, 0x6e212caf, 0xc7a77a0c, + 0x9f2798db, 0xd4aca691, 0x8c2c4446, 0x25aa12e5, 0x7d2af032, + 0xb3bc6f71, 0xeb3c8da6, 0x42badb05, 0x1a3a39d2, 0x51b10798, + 0x0931e54f, 0xa0b7b3ec, 0xf837513b, 0x50d8119a, 0x0858f34d, + 0xa1dea5ee, 0xf95e4739, 0xb2d57973, 0xea559ba4, 0x43d3cd07, + 0x1b532fd0, 0xd5c5b093, 0x8d455244, 0x24c304e7, 0x7c43e630, + 0x37c8d87a, 0x6f483aad, 0xc6ce6c0e, 0x9e4e8ed9, 0x5ae35389, + 0x0263b15e, 0xabe5e7fd, 0xf365052a, 0xb8ee3b60, 0xe06ed9b7, + 0x49e88f14, 0x11686dc3, 0xdffef280, 0x877e1057, 0x2ef846f4, + 0x7678a423, 0x3df39a69, 0x657378be, 0xccf52e1d, 0x9475ccca, + 0x44ae95bc, 0x1c2e776b, 0xb5a821c8, 0xed28c31f, 0xa6a3fd55, + 0xfe231f82, 0x57a54921, 0x0f25abf6, 0xc1b334b5, 0x9933d662, + 0x30b580c1, 0x68356216, 0x23be5c5c, 0x7b3ebe8b, 0xd2b8e828, + 0x8a380aff, 0x4e95d7af, 0x16153578, 0xbf9363db, 0xe713810c, + 0xac98bf46, 0xf4185d91, 0x5d9e0b32, 0x051ee9e5, 0xcb8876a6, + 0x93089471, 0x3a8ec2d2, 0x620e2005, 0x29851e4f, 0x7105fc98, + 0xd883aa3b, 0x800348ec, 0x783419d7, 0x20b4fb00, 0x8932ada3, + 0xd1b24f74, 0x9a39713e, 0xc2b993e9, 0x6b3fc54a, 0x33bf279d, + 0xfd29b8de, 0xa5a95a09, 0x0c2f0caa, 0x54afee7d, 0x1f24d037, + 0x47a432e0, 0xee226443, 0xb6a28694, 0x720f5bc4, 0x2a8fb913, + 0x8309efb0, 0xdb890d67, 0x9002332d, 0xc882d1fa, 0x61048759, + 0x3984658e, 0xf712facd, 0xaf92181a, 0x06144eb9, 0x5e94ac6e, + 0x151f9224, 0x4d9f70f3, 0xe4192650, 0xbc99c487, 0x6c429df1, + 0x34c27f26, 0x9d442985, 0xc5c4cb52, 0x8e4ff518, 0xd6cf17cf, + 0x7f49416c, 0x27c9a3bb, 0xe95f3cf8, 0xb1dfde2f, 0x1859888c, + 0x40d96a5b, 0x0b525411, 0x53d2b6c6, 0xfa54e065, 0xa2d402b2, + 0x6679dfe2, 0x3ef93d35, 0x977f6b96, 0xcfff8941, 0x8474b70b, + 0xdcf455dc, 0x7572037f, 0x2df2e1a8, 0xe3647eeb, 0xbbe49c3c, + 0x1262ca9f, 0x4ae22848, 0x01691602, 0x59e9f4d5, 0xf06fa276, + 0xa8ef40a1}, + {0x00000000, 0x463b6765, 0x8c76ceca, 0xca4da9af, 0x59ebed4e, + 0x1fd08a2b, 0xd59d2384, 0x93a644e1, 0xb2d6db9d, 0xf4edbcf8, + 0x3ea01557, 0x789b7232, 0xeb3d36d3, 0xad0651b6, 0x674bf819, + 0x21709f7c, 0x25abc6e0, 0x6390a185, 0xa9dd082a, 0xefe66f4f, + 0x7c402bae, 0x3a7b4ccb, 0xf036e564, 0xb60d8201, 0x977d1d7d, + 0xd1467a18, 0x1b0bd3b7, 0x5d30b4d2, 0xce96f033, 0x88ad9756, + 0x42e03ef9, 0x04db599c, 0x0b50fc1a, 0x4d6b9b7f, 0x872632d0, + 0xc11d55b5, 0x52bb1154, 0x14807631, 0xdecddf9e, 0x98f6b8fb, + 0xb9862787, 0xffbd40e2, 0x35f0e94d, 0x73cb8e28, 0xe06dcac9, + 0xa656adac, 0x6c1b0403, 0x2a206366, 0x2efb3afa, 0x68c05d9f, + 0xa28df430, 0xe4b69355, 0x7710d7b4, 0x312bb0d1, 0xfb66197e, + 0xbd5d7e1b, 0x9c2de167, 0xda168602, 0x105b2fad, 0x566048c8, + 0xc5c60c29, 0x83fd6b4c, 0x49b0c2e3, 0x0f8ba586, 0x16a0f835, + 0x509b9f50, 0x9ad636ff, 0xdced519a, 0x4f4b157b, 0x0970721e, + 0xc33ddbb1, 0x8506bcd4, 0xa47623a8, 0xe24d44cd, 0x2800ed62, + 0x6e3b8a07, 0xfd9dcee6, 0xbba6a983, 0x71eb002c, 0x37d06749, + 0x330b3ed5, 0x753059b0, 0xbf7df01f, 0xf946977a, 0x6ae0d39b, + 0x2cdbb4fe, 0xe6961d51, 0xa0ad7a34, 0x81dde548, 0xc7e6822d, + 0x0dab2b82, 0x4b904ce7, 0xd8360806, 0x9e0d6f63, 0x5440c6cc, + 0x127ba1a9, 0x1df0042f, 0x5bcb634a, 0x9186cae5, 0xd7bdad80, + 0x441be961, 0x02208e04, 0xc86d27ab, 0x8e5640ce, 0xaf26dfb2, + 0xe91db8d7, 0x23501178, 0x656b761d, 0xf6cd32fc, 0xb0f65599, + 0x7abbfc36, 0x3c809b53, 0x385bc2cf, 0x7e60a5aa, 0xb42d0c05, + 0xf2166b60, 0x61b02f81, 0x278b48e4, 0xedc6e14b, 0xabfd862e, + 0x8a8d1952, 0xccb67e37, 0x06fbd798, 0x40c0b0fd, 0xd366f41c, + 0x955d9379, 0x5f103ad6, 0x192b5db3, 0x2c40f16b, 0x6a7b960e, + 0xa0363fa1, 0xe60d58c4, 0x75ab1c25, 0x33907b40, 0xf9ddd2ef, + 0xbfe6b58a, 0x9e962af6, 0xd8ad4d93, 0x12e0e43c, 0x54db8359, + 0xc77dc7b8, 0x8146a0dd, 0x4b0b0972, 0x0d306e17, 0x09eb378b, + 0x4fd050ee, 0x859df941, 0xc3a69e24, 0x5000dac5, 0x163bbda0, + 0xdc76140f, 0x9a4d736a, 0xbb3dec16, 0xfd068b73, 0x374b22dc, + 0x717045b9, 0xe2d60158, 0xa4ed663d, 0x6ea0cf92, 0x289ba8f7, + 0x27100d71, 0x612b6a14, 0xab66c3bb, 0xed5da4de, 0x7efbe03f, + 0x38c0875a, 0xf28d2ef5, 0xb4b64990, 0x95c6d6ec, 0xd3fdb189, + 0x19b01826, 0x5f8b7f43, 0xcc2d3ba2, 0x8a165cc7, 0x405bf568, + 0x0660920d, 0x02bbcb91, 0x4480acf4, 0x8ecd055b, 0xc8f6623e, + 0x5b5026df, 0x1d6b41ba, 0xd726e815, 0x911d8f70, 0xb06d100c, + 0xf6567769, 0x3c1bdec6, 0x7a20b9a3, 0xe986fd42, 0xafbd9a27, + 0x65f03388, 0x23cb54ed, 0x3ae0095e, 0x7cdb6e3b, 0xb696c794, + 0xf0ada0f1, 0x630be410, 0x25308375, 0xef7d2ada, 0xa9464dbf, + 0x8836d2c3, 0xce0db5a6, 0x04401c09, 0x427b7b6c, 0xd1dd3f8d, + 0x97e658e8, 0x5dabf147, 0x1b909622, 0x1f4bcfbe, 0x5970a8db, + 0x933d0174, 0xd5066611, 0x46a022f0, 0x009b4595, 0xcad6ec3a, + 0x8ced8b5f, 0xad9d1423, 0xeba67346, 0x21ebdae9, 0x67d0bd8c, + 0xf476f96d, 0xb24d9e08, 0x780037a7, 0x3e3b50c2, 0x31b0f544, + 0x778b9221, 0xbdc63b8e, 0xfbfd5ceb, 0x685b180a, 0x2e607f6f, + 0xe42dd6c0, 0xa216b1a5, 0x83662ed9, 0xc55d49bc, 0x0f10e013, + 0x492b8776, 0xda8dc397, 0x9cb6a4f2, 0x56fb0d5d, 0x10c06a38, + 0x141b33a4, 0x522054c1, 0x986dfd6e, 0xde569a0b, 0x4df0deea, + 0x0bcbb98f, 0xc1861020, 0x87bd7745, 0xa6cde839, 0xe0f68f5c, + 0x2abb26f3, 0x6c804196, 0xff260577, 0xb91d6212, 0x7350cbbd, + 0x356bacd8}}; + +#endif + +#endif + +#if N == 6 + +#if W == 8 + +local const z_crc_t FAR crc_braid_table[][256] = { + {0x00000000, 0x3db1ecdc, 0x7b63d9b8, 0x46d23564, 0xf6c7b370, + 0xcb765fac, 0x8da46ac8, 0xb0158614, 0x36fe60a1, 0x0b4f8c7d, + 0x4d9db919, 0x702c55c5, 0xc039d3d1, 0xfd883f0d, 0xbb5a0a69, + 0x86ebe6b5, 0x6dfcc142, 0x504d2d9e, 0x169f18fa, 0x2b2ef426, + 0x9b3b7232, 0xa68a9eee, 0xe058ab8a, 0xdde94756, 0x5b02a1e3, + 0x66b34d3f, 0x2061785b, 0x1dd09487, 0xadc51293, 0x9074fe4f, + 0xd6a6cb2b, 0xeb1727f7, 0xdbf98284, 0xe6486e58, 0xa09a5b3c, + 0x9d2bb7e0, 0x2d3e31f4, 0x108fdd28, 0x565de84c, 0x6bec0490, + 0xed07e225, 0xd0b60ef9, 0x96643b9d, 0xabd5d741, 0x1bc05155, + 0x2671bd89, 0x60a388ed, 0x5d126431, 0xb60543c6, 0x8bb4af1a, + 0xcd669a7e, 0xf0d776a2, 0x40c2f0b6, 0x7d731c6a, 0x3ba1290e, + 0x0610c5d2, 0x80fb2367, 0xbd4acfbb, 0xfb98fadf, 0xc6291603, + 0x763c9017, 0x4b8d7ccb, 0x0d5f49af, 0x30eea573, 0x6c820349, + 0x5133ef95, 0x17e1daf1, 0x2a50362d, 0x9a45b039, 0xa7f45ce5, + 0xe1266981, 0xdc97855d, 0x5a7c63e8, 0x67cd8f34, 0x211fba50, + 0x1cae568c, 0xacbbd098, 0x910a3c44, 0xd7d80920, 0xea69e5fc, + 0x017ec20b, 0x3ccf2ed7, 0x7a1d1bb3, 0x47acf76f, 0xf7b9717b, + 0xca089da7, 0x8cdaa8c3, 0xb16b441f, 0x3780a2aa, 0x0a314e76, + 0x4ce37b12, 0x715297ce, 0xc14711da, 0xfcf6fd06, 0xba24c862, + 0x879524be, 0xb77b81cd, 0x8aca6d11, 0xcc185875, 0xf1a9b4a9, + 0x41bc32bd, 0x7c0dde61, 0x3adfeb05, 0x076e07d9, 0x8185e16c, + 0xbc340db0, 0xfae638d4, 0xc757d408, 0x7742521c, 0x4af3bec0, + 0x0c218ba4, 0x31906778, 0xda87408f, 0xe736ac53, 0xa1e49937, + 0x9c5575eb, 0x2c40f3ff, 0x11f11f23, 0x57232a47, 0x6a92c69b, + 0xec79202e, 0xd1c8ccf2, 0x971af996, 0xaaab154a, 0x1abe935e, + 0x270f7f82, 0x61dd4ae6, 0x5c6ca63a, 0xd9040692, 0xe4b5ea4e, + 0xa267df2a, 0x9fd633f6, 0x2fc3b5e2, 0x1272593e, 0x54a06c5a, + 0x69118086, 0xeffa6633, 0xd24b8aef, 0x9499bf8b, 0xa9285357, + 0x193dd543, 0x248c399f, 0x625e0cfb, 0x5fefe027, 0xb4f8c7d0, + 0x89492b0c, 0xcf9b1e68, 0xf22af2b4, 0x423f74a0, 0x7f8e987c, + 0x395cad18, 0x04ed41c4, 0x8206a771, 0xbfb74bad, 0xf9657ec9, + 0xc4d49215, 0x74c11401, 0x4970f8dd, 0x0fa2cdb9, 0x32132165, + 0x02fd8416, 0x3f4c68ca, 0x799e5dae, 0x442fb172, 0xf43a3766, + 0xc98bdbba, 0x8f59eede, 0xb2e80202, 0x3403e4b7, 0x09b2086b, + 0x4f603d0f, 0x72d1d1d3, 0xc2c457c7, 0xff75bb1b, 0xb9a78e7f, + 0x841662a3, 0x6f014554, 0x52b0a988, 0x14629cec, 0x29d37030, + 0x99c6f624, 0xa4771af8, 0xe2a52f9c, 0xdf14c340, 0x59ff25f5, + 0x644ec929, 0x229cfc4d, 0x1f2d1091, 0xaf389685, 0x92897a59, + 0xd45b4f3d, 0xe9eaa3e1, 0xb58605db, 0x8837e907, 0xcee5dc63, + 0xf35430bf, 0x4341b6ab, 0x7ef05a77, 0x38226f13, 0x059383cf, + 0x8378657a, 0xbec989a6, 0xf81bbcc2, 0xc5aa501e, 0x75bfd60a, + 0x480e3ad6, 0x0edc0fb2, 0x336de36e, 0xd87ac499, 0xe5cb2845, + 0xa3191d21, 0x9ea8f1fd, 0x2ebd77e9, 0x130c9b35, 0x55deae51, + 0x686f428d, 0xee84a438, 0xd33548e4, 0x95e77d80, 0xa856915c, + 0x18431748, 0x25f2fb94, 0x6320cef0, 0x5e91222c, 0x6e7f875f, + 0x53ce6b83, 0x151c5ee7, 0x28adb23b, 0x98b8342f, 0xa509d8f3, + 0xe3dbed97, 0xde6a014b, 0x5881e7fe, 0x65300b22, 0x23e23e46, + 0x1e53d29a, 0xae46548e, 0x93f7b852, 0xd5258d36, 0xe89461ea, + 0x0383461d, 0x3e32aac1, 0x78e09fa5, 0x45517379, 0xf544f56d, + 0xc8f519b1, 0x8e272cd5, 0xb396c009, 0x357d26bc, 0x08ccca60, + 0x4e1eff04, 0x73af13d8, 0xc3ba95cc, 0xfe0b7910, 0xb8d94c74, + 0x8568a0a8}, + {0x00000000, 0x69790b65, 0xd2f216ca, 0xbb8b1daf, 0x7e952bd5, + 0x17ec20b0, 0xac673d1f, 0xc51e367a, 0xfd2a57aa, 0x94535ccf, + 0x2fd84160, 0x46a14a05, 0x83bf7c7f, 0xeac6771a, 0x514d6ab5, + 0x383461d0, 0x2125a915, 0x485ca270, 0xf3d7bfdf, 0x9aaeb4ba, + 0x5fb082c0, 0x36c989a5, 0x8d42940a, 0xe43b9f6f, 0xdc0ffebf, + 0xb576f5da, 0x0efde875, 0x6784e310, 0xa29ad56a, 0xcbe3de0f, + 0x7068c3a0, 0x1911c8c5, 0x424b522a, 0x2b32594f, 0x90b944e0, + 0xf9c04f85, 0x3cde79ff, 0x55a7729a, 0xee2c6f35, 0x87556450, + 0xbf610580, 0xd6180ee5, 0x6d93134a, 0x04ea182f, 0xc1f42e55, + 0xa88d2530, 0x1306389f, 0x7a7f33fa, 0x636efb3f, 0x0a17f05a, + 0xb19cedf5, 0xd8e5e690, 0x1dfbd0ea, 0x7482db8f, 0xcf09c620, + 0xa670cd45, 0x9e44ac95, 0xf73da7f0, 0x4cb6ba5f, 0x25cfb13a, + 0xe0d18740, 0x89a88c25, 0x3223918a, 0x5b5a9aef, 0x8496a454, + 0xedefaf31, 0x5664b29e, 0x3f1db9fb, 0xfa038f81, 0x937a84e4, + 0x28f1994b, 0x4188922e, 0x79bcf3fe, 0x10c5f89b, 0xab4ee534, + 0xc237ee51, 0x0729d82b, 0x6e50d34e, 0xd5dbcee1, 0xbca2c584, + 0xa5b30d41, 0xccca0624, 0x77411b8b, 0x1e3810ee, 0xdb262694, + 0xb25f2df1, 0x09d4305e, 0x60ad3b3b, 0x58995aeb, 0x31e0518e, + 0x8a6b4c21, 0xe3124744, 0x260c713e, 0x4f757a5b, 0xf4fe67f4, + 0x9d876c91, 0xc6ddf67e, 0xafa4fd1b, 0x142fe0b4, 0x7d56ebd1, + 0xb848ddab, 0xd131d6ce, 0x6abacb61, 0x03c3c004, 0x3bf7a1d4, + 0x528eaab1, 0xe905b71e, 0x807cbc7b, 0x45628a01, 0x2c1b8164, + 0x97909ccb, 0xfee997ae, 0xe7f85f6b, 0x8e81540e, 0x350a49a1, + 0x5c7342c4, 0x996d74be, 0xf0147fdb, 0x4b9f6274, 0x22e66911, + 0x1ad208c1, 0x73ab03a4, 0xc8201e0b, 0xa159156e, 0x64472314, + 0x0d3e2871, 0xb6b535de, 0xdfcc3ebb, 0xd25c4ee9, 0xbb25458c, + 0x00ae5823, 0x69d75346, 0xacc9653c, 0xc5b06e59, 0x7e3b73f6, + 0x17427893, 0x2f761943, 0x460f1226, 0xfd840f89, 0x94fd04ec, + 0x51e33296, 0x389a39f3, 0x8311245c, 0xea682f39, 0xf379e7fc, + 0x9a00ec99, 0x218bf136, 0x48f2fa53, 0x8deccc29, 0xe495c74c, + 0x5f1edae3, 0x3667d186, 0x0e53b056, 0x672abb33, 0xdca1a69c, + 0xb5d8adf9, 0x70c69b83, 0x19bf90e6, 0xa2348d49, 0xcb4d862c, + 0x90171cc3, 0xf96e17a6, 0x42e50a09, 0x2b9c016c, 0xee823716, + 0x87fb3c73, 0x3c7021dc, 0x55092ab9, 0x6d3d4b69, 0x0444400c, + 0xbfcf5da3, 0xd6b656c6, 0x13a860bc, 0x7ad16bd9, 0xc15a7676, + 0xa8237d13, 0xb132b5d6, 0xd84bbeb3, 0x63c0a31c, 0x0ab9a879, + 0xcfa79e03, 0xa6de9566, 0x1d5588c9, 0x742c83ac, 0x4c18e27c, + 0x2561e919, 0x9eeaf4b6, 0xf793ffd3, 0x328dc9a9, 0x5bf4c2cc, + 0xe07fdf63, 0x8906d406, 0x56caeabd, 0x3fb3e1d8, 0x8438fc77, + 0xed41f712, 0x285fc168, 0x4126ca0d, 0xfaadd7a2, 0x93d4dcc7, + 0xabe0bd17, 0xc299b672, 0x7912abdd, 0x106ba0b8, 0xd57596c2, + 0xbc0c9da7, 0x07878008, 0x6efe8b6d, 0x77ef43a8, 0x1e9648cd, + 0xa51d5562, 0xcc645e07, 0x097a687d, 0x60036318, 0xdb887eb7, + 0xb2f175d2, 0x8ac51402, 0xe3bc1f67, 0x583702c8, 0x314e09ad, + 0xf4503fd7, 0x9d2934b2, 0x26a2291d, 0x4fdb2278, 0x1481b897, + 0x7df8b3f2, 0xc673ae5d, 0xaf0aa538, 0x6a149342, 0x036d9827, + 0xb8e68588, 0xd19f8eed, 0xe9abef3d, 0x80d2e458, 0x3b59f9f7, + 0x5220f292, 0x973ec4e8, 0xfe47cf8d, 0x45ccd222, 0x2cb5d947, + 0x35a41182, 0x5cdd1ae7, 0xe7560748, 0x8e2f0c2d, 0x4b313a57, + 0x22483132, 0x99c32c9d, 0xf0ba27f8, 0xc88e4628, 0xa1f74d4d, + 0x1a7c50e2, 0x73055b87, 0xb61b6dfd, 0xdf626698, 0x64e97b37, + 0x0d907052}, + {0x00000000, 0x7fc99b93, 0xff933726, 0x805aacb5, 0x2457680d, + 0x5b9ef39e, 0xdbc45f2b, 0xa40dc4b8, 0x48aed01a, 0x37674b89, + 0xb73de73c, 0xc8f47caf, 0x6cf9b817, 0x13302384, 0x936a8f31, + 0xeca314a2, 0x915da034, 0xee943ba7, 0x6ece9712, 0x11070c81, + 0xb50ac839, 0xcac353aa, 0x4a99ff1f, 0x3550648c, 0xd9f3702e, + 0xa63aebbd, 0x26604708, 0x59a9dc9b, 0xfda41823, 0x826d83b0, + 0x02372f05, 0x7dfeb496, 0xf9ca4629, 0x8603ddba, 0x0659710f, + 0x7990ea9c, 0xdd9d2e24, 0xa254b5b7, 0x220e1902, 0x5dc78291, + 0xb1649633, 0xcead0da0, 0x4ef7a115, 0x313e3a86, 0x9533fe3e, + 0xeafa65ad, 0x6aa0c918, 0x1569528b, 0x6897e61d, 0x175e7d8e, + 0x9704d13b, 0xe8cd4aa8, 0x4cc08e10, 0x33091583, 0xb353b936, + 0xcc9a22a5, 0x20393607, 0x5ff0ad94, 0xdfaa0121, 0xa0639ab2, + 0x046e5e0a, 0x7ba7c599, 0xfbfd692c, 0x8434f2bf, 0x28e58a13, + 0x572c1180, 0xd776bd35, 0xa8bf26a6, 0x0cb2e21e, 0x737b798d, + 0xf321d538, 0x8ce84eab, 0x604b5a09, 0x1f82c19a, 0x9fd86d2f, + 0xe011f6bc, 0x441c3204, 0x3bd5a997, 0xbb8f0522, 0xc4469eb1, + 0xb9b82a27, 0xc671b1b4, 0x462b1d01, 0x39e28692, 0x9def422a, + 0xe226d9b9, 0x627c750c, 0x1db5ee9f, 0xf116fa3d, 0x8edf61ae, + 0x0e85cd1b, 0x714c5688, 0xd5419230, 0xaa8809a3, 0x2ad2a516, + 0x551b3e85, 0xd12fcc3a, 0xaee657a9, 0x2ebcfb1c, 0x5175608f, + 0xf578a437, 0x8ab13fa4, 0x0aeb9311, 0x75220882, 0x99811c20, + 0xe64887b3, 0x66122b06, 0x19dbb095, 0xbdd6742d, 0xc21fefbe, + 0x4245430b, 0x3d8cd898, 0x40726c0e, 0x3fbbf79d, 0xbfe15b28, + 0xc028c0bb, 0x64250403, 0x1bec9f90, 0x9bb63325, 0xe47fa8b6, + 0x08dcbc14, 0x77152787, 0xf74f8b32, 0x888610a1, 0x2c8bd419, + 0x53424f8a, 0xd318e33f, 0xacd178ac, 0x51cb1426, 0x2e028fb5, + 0xae582300, 0xd191b893, 0x759c7c2b, 0x0a55e7b8, 0x8a0f4b0d, + 0xf5c6d09e, 0x1965c43c, 0x66ac5faf, 0xe6f6f31a, 0x993f6889, + 0x3d32ac31, 0x42fb37a2, 0xc2a19b17, 0xbd680084, 0xc096b412, + 0xbf5f2f81, 0x3f058334, 0x40cc18a7, 0xe4c1dc1f, 0x9b08478c, + 0x1b52eb39, 0x649b70aa, 0x88386408, 0xf7f1ff9b, 0x77ab532e, + 0x0862c8bd, 0xac6f0c05, 0xd3a69796, 0x53fc3b23, 0x2c35a0b0, + 0xa801520f, 0xd7c8c99c, 0x57926529, 0x285bfeba, 0x8c563a02, + 0xf39fa191, 0x73c50d24, 0x0c0c96b7, 0xe0af8215, 0x9f661986, + 0x1f3cb533, 0x60f52ea0, 0xc4f8ea18, 0xbb31718b, 0x3b6bdd3e, + 0x44a246ad, 0x395cf23b, 0x469569a8, 0xc6cfc51d, 0xb9065e8e, + 0x1d0b9a36, 0x62c201a5, 0xe298ad10, 0x9d513683, 0x71f22221, + 0x0e3bb9b2, 0x8e611507, 0xf1a88e94, 0x55a54a2c, 0x2a6cd1bf, + 0xaa367d0a, 0xd5ffe699, 0x792e9e35, 0x06e705a6, 0x86bda913, + 0xf9743280, 0x5d79f638, 0x22b06dab, 0xa2eac11e, 0xdd235a8d, + 0x31804e2f, 0x4e49d5bc, 0xce137909, 0xb1dae29a, 0x15d72622, + 0x6a1ebdb1, 0xea441104, 0x958d8a97, 0xe8733e01, 0x97baa592, + 0x17e00927, 0x682992b4, 0xcc24560c, 0xb3edcd9f, 0x33b7612a, + 0x4c7efab9, 0xa0ddee1b, 0xdf147588, 0x5f4ed93d, 0x208742ae, + 0x848a8616, 0xfb431d85, 0x7b19b130, 0x04d02aa3, 0x80e4d81c, + 0xff2d438f, 0x7f77ef3a, 0x00be74a9, 0xa4b3b011, 0xdb7a2b82, + 0x5b208737, 0x24e91ca4, 0xc84a0806, 0xb7839395, 0x37d93f20, + 0x4810a4b3, 0xec1d600b, 0x93d4fb98, 0x138e572d, 0x6c47ccbe, + 0x11b97828, 0x6e70e3bb, 0xee2a4f0e, 0x91e3d49d, 0x35ee1025, + 0x4a278bb6, 0xca7d2703, 0xb5b4bc90, 0x5917a832, 0x26de33a1, + 0xa6849f14, 0xd94d0487, 0x7d40c03f, 0x02895bac, 0x82d3f719, + 0xfd1a6c8a}, + {0x00000000, 0xa396284c, 0x9c5d56d9, 0x3fcb7e95, 0xe3cbabf3, + 0x405d83bf, 0x7f96fd2a, 0xdc00d566, 0x1ce651a7, 0xbf7079eb, + 0x80bb077e, 0x232d2f32, 0xff2dfa54, 0x5cbbd218, 0x6370ac8d, + 0xc0e684c1, 0x39cca34e, 0x9a5a8b02, 0xa591f597, 0x0607dddb, + 0xda0708bd, 0x799120f1, 0x465a5e64, 0xe5cc7628, 0x252af2e9, + 0x86bcdaa5, 0xb977a430, 0x1ae18c7c, 0xc6e1591a, 0x65777156, + 0x5abc0fc3, 0xf92a278f, 0x7399469c, 0xd00f6ed0, 0xefc41045, + 0x4c523809, 0x9052ed6f, 0x33c4c523, 0x0c0fbbb6, 0xaf9993fa, + 0x6f7f173b, 0xcce93f77, 0xf32241e2, 0x50b469ae, 0x8cb4bcc8, + 0x2f229484, 0x10e9ea11, 0xb37fc25d, 0x4a55e5d2, 0xe9c3cd9e, + 0xd608b30b, 0x759e9b47, 0xa99e4e21, 0x0a08666d, 0x35c318f8, + 0x965530b4, 0x56b3b475, 0xf5259c39, 0xcaeee2ac, 0x6978cae0, + 0xb5781f86, 0x16ee37ca, 0x2925495f, 0x8ab36113, 0xe7328d38, + 0x44a4a574, 0x7b6fdbe1, 0xd8f9f3ad, 0x04f926cb, 0xa76f0e87, + 0x98a47012, 0x3b32585e, 0xfbd4dc9f, 0x5842f4d3, 0x67898a46, + 0xc41fa20a, 0x181f776c, 0xbb895f20, 0x844221b5, 0x27d409f9, + 0xdefe2e76, 0x7d68063a, 0x42a378af, 0xe13550e3, 0x3d358585, + 0x9ea3adc9, 0xa168d35c, 0x02fefb10, 0xc2187fd1, 0x618e579d, + 0x5e452908, 0xfdd30144, 0x21d3d422, 0x8245fc6e, 0xbd8e82fb, + 0x1e18aab7, 0x94abcba4, 0x373de3e8, 0x08f69d7d, 0xab60b531, + 0x77606057, 0xd4f6481b, 0xeb3d368e, 0x48ab1ec2, 0x884d9a03, + 0x2bdbb24f, 0x1410ccda, 0xb786e496, 0x6b8631f0, 0xc81019bc, + 0xf7db6729, 0x544d4f65, 0xad6768ea, 0x0ef140a6, 0x313a3e33, + 0x92ac167f, 0x4eacc319, 0xed3aeb55, 0xd2f195c0, 0x7167bd8c, + 0xb181394d, 0x12171101, 0x2ddc6f94, 0x8e4a47d8, 0x524a92be, + 0xf1dcbaf2, 0xce17c467, 0x6d81ec2b, 0x15141c31, 0xb682347d, + 0x89494ae8, 0x2adf62a4, 0xf6dfb7c2, 0x55499f8e, 0x6a82e11b, + 0xc914c957, 0x09f24d96, 0xaa6465da, 0x95af1b4f, 0x36393303, + 0xea39e665, 0x49afce29, 0x7664b0bc, 0xd5f298f0, 0x2cd8bf7f, + 0x8f4e9733, 0xb085e9a6, 0x1313c1ea, 0xcf13148c, 0x6c853cc0, + 0x534e4255, 0xf0d86a19, 0x303eeed8, 0x93a8c694, 0xac63b801, + 0x0ff5904d, 0xd3f5452b, 0x70636d67, 0x4fa813f2, 0xec3e3bbe, + 0x668d5aad, 0xc51b72e1, 0xfad00c74, 0x59462438, 0x8546f15e, + 0x26d0d912, 0x191ba787, 0xba8d8fcb, 0x7a6b0b0a, 0xd9fd2346, + 0xe6365dd3, 0x45a0759f, 0x99a0a0f9, 0x3a3688b5, 0x05fdf620, + 0xa66bde6c, 0x5f41f9e3, 0xfcd7d1af, 0xc31caf3a, 0x608a8776, + 0xbc8a5210, 0x1f1c7a5c, 0x20d704c9, 0x83412c85, 0x43a7a844, + 0xe0318008, 0xdffafe9d, 0x7c6cd6d1, 0xa06c03b7, 0x03fa2bfb, + 0x3c31556e, 0x9fa77d22, 0xf2269109, 0x51b0b945, 0x6e7bc7d0, + 0xcdedef9c, 0x11ed3afa, 0xb27b12b6, 0x8db06c23, 0x2e26446f, + 0xeec0c0ae, 0x4d56e8e2, 0x729d9677, 0xd10bbe3b, 0x0d0b6b5d, + 0xae9d4311, 0x91563d84, 0x32c015c8, 0xcbea3247, 0x687c1a0b, + 0x57b7649e, 0xf4214cd2, 0x282199b4, 0x8bb7b1f8, 0xb47ccf6d, + 0x17eae721, 0xd70c63e0, 0x749a4bac, 0x4b513539, 0xe8c71d75, + 0x34c7c813, 0x9751e05f, 0xa89a9eca, 0x0b0cb686, 0x81bfd795, + 0x2229ffd9, 0x1de2814c, 0xbe74a900, 0x62747c66, 0xc1e2542a, + 0xfe292abf, 0x5dbf02f3, 0x9d598632, 0x3ecfae7e, 0x0104d0eb, + 0xa292f8a7, 0x7e922dc1, 0xdd04058d, 0xe2cf7b18, 0x41595354, + 0xb87374db, 0x1be55c97, 0x242e2202, 0x87b80a4e, 0x5bb8df28, + 0xf82ef764, 0xc7e589f1, 0x6473a1bd, 0xa495257c, 0x07030d30, + 0x38c873a5, 0x9b5e5be9, 0x475e8e8f, 0xe4c8a6c3, 0xdb03d856, + 0x7895f01a}, + {0x00000000, 0x2a283862, 0x545070c4, 0x7e7848a6, 0xa8a0e188, + 0x8288d9ea, 0xfcf0914c, 0xd6d8a92e, 0x8a30c551, 0xa018fd33, + 0xde60b595, 0xf4488df7, 0x229024d9, 0x08b81cbb, 0x76c0541d, + 0x5ce86c7f, 0xcf108ce3, 0xe538b481, 0x9b40fc27, 0xb168c445, + 0x67b06d6b, 0x4d985509, 0x33e01daf, 0x19c825cd, 0x452049b2, + 0x6f0871d0, 0x11703976, 0x3b580114, 0xed80a83a, 0xc7a89058, + 0xb9d0d8fe, 0x93f8e09c, 0x45501f87, 0x6f7827e5, 0x11006f43, + 0x3b285721, 0xedf0fe0f, 0xc7d8c66d, 0xb9a08ecb, 0x9388b6a9, + 0xcf60dad6, 0xe548e2b4, 0x9b30aa12, 0xb1189270, 0x67c03b5e, + 0x4de8033c, 0x33904b9a, 0x19b873f8, 0x8a409364, 0xa068ab06, + 0xde10e3a0, 0xf438dbc2, 0x22e072ec, 0x08c84a8e, 0x76b00228, + 0x5c983a4a, 0x00705635, 0x2a586e57, 0x542026f1, 0x7e081e93, + 0xa8d0b7bd, 0x82f88fdf, 0xfc80c779, 0xd6a8ff1b, 0x8aa03f0e, + 0xa088076c, 0xdef04fca, 0xf4d877a8, 0x2200de86, 0x0828e6e4, + 0x7650ae42, 0x5c789620, 0x0090fa5f, 0x2ab8c23d, 0x54c08a9b, + 0x7ee8b2f9, 0xa8301bd7, 0x821823b5, 0xfc606b13, 0xd6485371, + 0x45b0b3ed, 0x6f988b8f, 0x11e0c329, 0x3bc8fb4b, 0xed105265, + 0xc7386a07, 0xb94022a1, 0x93681ac3, 0xcf8076bc, 0xe5a84ede, + 0x9bd00678, 0xb1f83e1a, 0x67209734, 0x4d08af56, 0x3370e7f0, + 0x1958df92, 0xcff02089, 0xe5d818eb, 0x9ba0504d, 0xb188682f, + 0x6750c101, 0x4d78f963, 0x3300b1c5, 0x192889a7, 0x45c0e5d8, + 0x6fe8ddba, 0x1190951c, 0x3bb8ad7e, 0xed600450, 0xc7483c32, + 0xb9307494, 0x93184cf6, 0x00e0ac6a, 0x2ac89408, 0x54b0dcae, + 0x7e98e4cc, 0xa8404de2, 0x82687580, 0xfc103d26, 0xd6380544, + 0x8ad0693b, 0xa0f85159, 0xde8019ff, 0xf4a8219d, 0x227088b3, + 0x0858b0d1, 0x7620f877, 0x5c08c015, 0xce31785d, 0xe419403f, + 0x9a610899, 0xb04930fb, 0x669199d5, 0x4cb9a1b7, 0x32c1e911, + 0x18e9d173, 0x4401bd0c, 0x6e29856e, 0x1051cdc8, 0x3a79f5aa, + 0xeca15c84, 0xc68964e6, 0xb8f12c40, 0x92d91422, 0x0121f4be, + 0x2b09ccdc, 0x5571847a, 0x7f59bc18, 0xa9811536, 0x83a92d54, + 0xfdd165f2, 0xd7f95d90, 0x8b1131ef, 0xa139098d, 0xdf41412b, + 0xf5697949, 0x23b1d067, 0x0999e805, 0x77e1a0a3, 0x5dc998c1, + 0x8b6167da, 0xa1495fb8, 0xdf31171e, 0xf5192f7c, 0x23c18652, + 0x09e9be30, 0x7791f696, 0x5db9cef4, 0x0151a28b, 0x2b799ae9, + 0x5501d24f, 0x7f29ea2d, 0xa9f14303, 0x83d97b61, 0xfda133c7, + 0xd7890ba5, 0x4471eb39, 0x6e59d35b, 0x10219bfd, 0x3a09a39f, + 0xecd10ab1, 0xc6f932d3, 0xb8817a75, 0x92a94217, 0xce412e68, + 0xe469160a, 0x9a115eac, 0xb03966ce, 0x66e1cfe0, 0x4cc9f782, + 0x32b1bf24, 0x18998746, 0x44914753, 0x6eb97f31, 0x10c13797, + 0x3ae90ff5, 0xec31a6db, 0xc6199eb9, 0xb861d61f, 0x9249ee7d, + 0xcea18202, 0xe489ba60, 0x9af1f2c6, 0xb0d9caa4, 0x6601638a, + 0x4c295be8, 0x3251134e, 0x18792b2c, 0x8b81cbb0, 0xa1a9f3d2, + 0xdfd1bb74, 0xf5f98316, 0x23212a38, 0x0909125a, 0x77715afc, + 0x5d59629e, 0x01b10ee1, 0x2b993683, 0x55e17e25, 0x7fc94647, + 0xa911ef69, 0x8339d70b, 0xfd419fad, 0xd769a7cf, 0x01c158d4, + 0x2be960b6, 0x55912810, 0x7fb91072, 0xa961b95c, 0x8349813e, + 0xfd31c998, 0xd719f1fa, 0x8bf19d85, 0xa1d9a5e7, 0xdfa1ed41, + 0xf589d523, 0x23517c0d, 0x0979446f, 0x77010cc9, 0x5d2934ab, + 0xced1d437, 0xe4f9ec55, 0x9a81a4f3, 0xb0a99c91, 0x667135bf, + 0x4c590ddd, 0x3221457b, 0x18097d19, 0x44e11166, 0x6ec92904, + 0x10b161a2, 0x3a9959c0, 0xec41f0ee, 0xc669c88c, 0xb811802a, + 0x9239b848}, + {0x00000000, 0x4713f6fb, 0x8e27edf6, 0xc9341b0d, 0xc73eddad, + 0x802d2b56, 0x4919305b, 0x0e0ac6a0, 0x550cbd1b, 0x121f4be0, + 0xdb2b50ed, 0x9c38a616, 0x923260b6, 0xd521964d, 0x1c158d40, + 0x5b067bbb, 0xaa197a36, 0xed0a8ccd, 0x243e97c0, 0x632d613b, + 0x6d27a79b, 0x2a345160, 0xe3004a6d, 0xa413bc96, 0xff15c72d, + 0xb80631d6, 0x71322adb, 0x3621dc20, 0x382b1a80, 0x7f38ec7b, + 0xb60cf776, 0xf11f018d, 0x8f43f22d, 0xc85004d6, 0x01641fdb, + 0x4677e920, 0x487d2f80, 0x0f6ed97b, 0xc65ac276, 0x8149348d, + 0xda4f4f36, 0x9d5cb9cd, 0x5468a2c0, 0x137b543b, 0x1d71929b, + 0x5a626460, 0x93567f6d, 0xd4458996, 0x255a881b, 0x62497ee0, + 0xab7d65ed, 0xec6e9316, 0xe26455b6, 0xa577a34d, 0x6c43b840, + 0x2b504ebb, 0x70563500, 0x3745c3fb, 0xfe71d8f6, 0xb9622e0d, + 0xb768e8ad, 0xf07b1e56, 0x394f055b, 0x7e5cf3a0, 0xc5f6e21b, + 0x82e514e0, 0x4bd10fed, 0x0cc2f916, 0x02c83fb6, 0x45dbc94d, + 0x8cefd240, 0xcbfc24bb, 0x90fa5f00, 0xd7e9a9fb, 0x1eddb2f6, + 0x59ce440d, 0x57c482ad, 0x10d77456, 0xd9e36f5b, 0x9ef099a0, + 0x6fef982d, 0x28fc6ed6, 0xe1c875db, 0xa6db8320, 0xa8d14580, + 0xefc2b37b, 0x26f6a876, 0x61e55e8d, 0x3ae32536, 0x7df0d3cd, + 0xb4c4c8c0, 0xf3d73e3b, 0xfdddf89b, 0xbace0e60, 0x73fa156d, + 0x34e9e396, 0x4ab51036, 0x0da6e6cd, 0xc492fdc0, 0x83810b3b, + 0x8d8bcd9b, 0xca983b60, 0x03ac206d, 0x44bfd696, 0x1fb9ad2d, + 0x58aa5bd6, 0x919e40db, 0xd68db620, 0xd8877080, 0x9f94867b, + 0x56a09d76, 0x11b36b8d, 0xe0ac6a00, 0xa7bf9cfb, 0x6e8b87f6, + 0x2998710d, 0x2792b7ad, 0x60814156, 0xa9b55a5b, 0xeea6aca0, + 0xb5a0d71b, 0xf2b321e0, 0x3b873aed, 0x7c94cc16, 0x729e0ab6, + 0x358dfc4d, 0xfcb9e740, 0xbbaa11bb, 0x509cc277, 0x178f348c, + 0xdebb2f81, 0x99a8d97a, 0x97a21fda, 0xd0b1e921, 0x1985f22c, + 0x5e9604d7, 0x05907f6c, 0x42838997, 0x8bb7929a, 0xcca46461, + 0xc2aea2c1, 0x85bd543a, 0x4c894f37, 0x0b9ab9cc, 0xfa85b841, + 0xbd964eba, 0x74a255b7, 0x33b1a34c, 0x3dbb65ec, 0x7aa89317, + 0xb39c881a, 0xf48f7ee1, 0xaf89055a, 0xe89af3a1, 0x21aee8ac, + 0x66bd1e57, 0x68b7d8f7, 0x2fa42e0c, 0xe6903501, 0xa183c3fa, + 0xdfdf305a, 0x98ccc6a1, 0x51f8ddac, 0x16eb2b57, 0x18e1edf7, + 0x5ff21b0c, 0x96c60001, 0xd1d5f6fa, 0x8ad38d41, 0xcdc07bba, + 0x04f460b7, 0x43e7964c, 0x4ded50ec, 0x0afea617, 0xc3cabd1a, + 0x84d94be1, 0x75c64a6c, 0x32d5bc97, 0xfbe1a79a, 0xbcf25161, + 0xb2f897c1, 0xf5eb613a, 0x3cdf7a37, 0x7bcc8ccc, 0x20caf777, + 0x67d9018c, 0xaeed1a81, 0xe9feec7a, 0xe7f42ada, 0xa0e7dc21, + 0x69d3c72c, 0x2ec031d7, 0x956a206c, 0xd279d697, 0x1b4dcd9a, + 0x5c5e3b61, 0x5254fdc1, 0x15470b3a, 0xdc731037, 0x9b60e6cc, + 0xc0669d77, 0x87756b8c, 0x4e417081, 0x0952867a, 0x075840da, + 0x404bb621, 0x897fad2c, 0xce6c5bd7, 0x3f735a5a, 0x7860aca1, + 0xb154b7ac, 0xf6474157, 0xf84d87f7, 0xbf5e710c, 0x766a6a01, + 0x31799cfa, 0x6a7fe741, 0x2d6c11ba, 0xe4580ab7, 0xa34bfc4c, + 0xad413aec, 0xea52cc17, 0x2366d71a, 0x647521e1, 0x1a29d241, + 0x5d3a24ba, 0x940e3fb7, 0xd31dc94c, 0xdd170fec, 0x9a04f917, + 0x5330e21a, 0x142314e1, 0x4f256f5a, 0x083699a1, 0xc10282ac, + 0x86117457, 0x881bb2f7, 0xcf08440c, 0x063c5f01, 0x412fa9fa, + 0xb030a877, 0xf7235e8c, 0x3e174581, 0x7904b37a, 0x770e75da, + 0x301d8321, 0xf929982c, 0xbe3a6ed7, 0xe53c156c, 0xa22fe397, + 0x6b1bf89a, 0x2c080e61, 0x2202c8c1, 0x65113e3a, 0xac252537, + 0xeb36d3cc}, + {0x00000000, 0xa13984ee, 0x99020f9d, 0x383b8b73, 0xe975197b, + 0x484c9d95, 0x707716e6, 0xd14e9208, 0x099b34b7, 0xa8a2b059, + 0x90993b2a, 0x31a0bfc4, 0xe0ee2dcc, 0x41d7a922, 0x79ec2251, + 0xd8d5a6bf, 0x1336696e, 0xb20fed80, 0x8a3466f3, 0x2b0de21d, + 0xfa437015, 0x5b7af4fb, 0x63417f88, 0xc278fb66, 0x1aad5dd9, + 0xbb94d937, 0x83af5244, 0x2296d6aa, 0xf3d844a2, 0x52e1c04c, + 0x6ada4b3f, 0xcbe3cfd1, 0x266cd2dc, 0x87555632, 0xbf6edd41, + 0x1e5759af, 0xcf19cba7, 0x6e204f49, 0x561bc43a, 0xf72240d4, + 0x2ff7e66b, 0x8ece6285, 0xb6f5e9f6, 0x17cc6d18, 0xc682ff10, + 0x67bb7bfe, 0x5f80f08d, 0xfeb97463, 0x355abbb2, 0x94633f5c, + 0xac58b42f, 0x0d6130c1, 0xdc2fa2c9, 0x7d162627, 0x452dad54, + 0xe41429ba, 0x3cc18f05, 0x9df80beb, 0xa5c38098, 0x04fa0476, + 0xd5b4967e, 0x748d1290, 0x4cb699e3, 0xed8f1d0d, 0x4cd9a5b8, + 0xede02156, 0xd5dbaa25, 0x74e22ecb, 0xa5acbcc3, 0x0495382d, + 0x3caeb35e, 0x9d9737b0, 0x4542910f, 0xe47b15e1, 0xdc409e92, + 0x7d791a7c, 0xac378874, 0x0d0e0c9a, 0x353587e9, 0x940c0307, + 0x5fefccd6, 0xfed64838, 0xc6edc34b, 0x67d447a5, 0xb69ad5ad, + 0x17a35143, 0x2f98da30, 0x8ea15ede, 0x5674f861, 0xf74d7c8f, + 0xcf76f7fc, 0x6e4f7312, 0xbf01e11a, 0x1e3865f4, 0x2603ee87, + 0x873a6a69, 0x6ab57764, 0xcb8cf38a, 0xf3b778f9, 0x528efc17, + 0x83c06e1f, 0x22f9eaf1, 0x1ac26182, 0xbbfbe56c, 0x632e43d3, + 0xc217c73d, 0xfa2c4c4e, 0x5b15c8a0, 0x8a5b5aa8, 0x2b62de46, + 0x13595535, 0xb260d1db, 0x79831e0a, 0xd8ba9ae4, 0xe0811197, + 0x41b89579, 0x90f60771, 0x31cf839f, 0x09f408ec, 0xa8cd8c02, + 0x70182abd, 0xd121ae53, 0xe91a2520, 0x4823a1ce, 0x996d33c6, + 0x3854b728, 0x006f3c5b, 0xa156b8b5, 0x99b34b70, 0x388acf9e, + 0x00b144ed, 0xa188c003, 0x70c6520b, 0xd1ffd6e5, 0xe9c45d96, + 0x48fdd978, 0x90287fc7, 0x3111fb29, 0x092a705a, 0xa813f4b4, + 0x795d66bc, 0xd864e252, 0xe05f6921, 0x4166edcf, 0x8a85221e, + 0x2bbca6f0, 0x13872d83, 0xb2bea96d, 0x63f03b65, 0xc2c9bf8b, + 0xfaf234f8, 0x5bcbb016, 0x831e16a9, 0x22279247, 0x1a1c1934, + 0xbb259dda, 0x6a6b0fd2, 0xcb528b3c, 0xf369004f, 0x525084a1, + 0xbfdf99ac, 0x1ee61d42, 0x26dd9631, 0x87e412df, 0x56aa80d7, + 0xf7930439, 0xcfa88f4a, 0x6e910ba4, 0xb644ad1b, 0x177d29f5, + 0x2f46a286, 0x8e7f2668, 0x5f31b460, 0xfe08308e, 0xc633bbfd, + 0x670a3f13, 0xace9f0c2, 0x0dd0742c, 0x35ebff5f, 0x94d27bb1, + 0x459ce9b9, 0xe4a56d57, 0xdc9ee624, 0x7da762ca, 0xa572c475, + 0x044b409b, 0x3c70cbe8, 0x9d494f06, 0x4c07dd0e, 0xed3e59e0, + 0xd505d293, 0x743c567d, 0xd56aeec8, 0x74536a26, 0x4c68e155, + 0xed5165bb, 0x3c1ff7b3, 0x9d26735d, 0xa51df82e, 0x04247cc0, + 0xdcf1da7f, 0x7dc85e91, 0x45f3d5e2, 0xe4ca510c, 0x3584c304, + 0x94bd47ea, 0xac86cc99, 0x0dbf4877, 0xc65c87a6, 0x67650348, + 0x5f5e883b, 0xfe670cd5, 0x2f299edd, 0x8e101a33, 0xb62b9140, + 0x171215ae, 0xcfc7b311, 0x6efe37ff, 0x56c5bc8c, 0xf7fc3862, + 0x26b2aa6a, 0x878b2e84, 0xbfb0a5f7, 0x1e892119, 0xf3063c14, + 0x523fb8fa, 0x6a043389, 0xcb3db767, 0x1a73256f, 0xbb4aa181, + 0x83712af2, 0x2248ae1c, 0xfa9d08a3, 0x5ba48c4d, 0x639f073e, + 0xc2a683d0, 0x13e811d8, 0xb2d19536, 0x8aea1e45, 0x2bd39aab, + 0xe030557a, 0x4109d194, 0x79325ae7, 0xd80bde09, 0x09454c01, + 0xa87cc8ef, 0x9047439c, 0x317ec772, 0xe9ab61cd, 0x4892e523, + 0x70a96e50, 0xd190eabe, 0x00de78b6, 0xa1e7fc58, 0x99dc772b, + 0x38e5f3c5}, + {0x00000000, 0xe81790a1, 0x0b5e2703, 0xe349b7a2, 0x16bc4e06, + 0xfeabdea7, 0x1de26905, 0xf5f5f9a4, 0x2d789c0c, 0xc56f0cad, + 0x2626bb0f, 0xce312bae, 0x3bc4d20a, 0xd3d342ab, 0x309af509, + 0xd88d65a8, 0x5af13818, 0xb2e6a8b9, 0x51af1f1b, 0xb9b88fba, + 0x4c4d761e, 0xa45ae6bf, 0x4713511d, 0xaf04c1bc, 0x7789a414, + 0x9f9e34b5, 0x7cd78317, 0x94c013b6, 0x6135ea12, 0x89227ab3, + 0x6a6bcd11, 0x827c5db0, 0xb5e27030, 0x5df5e091, 0xbebc5733, + 0x56abc792, 0xa35e3e36, 0x4b49ae97, 0xa8001935, 0x40178994, + 0x989aec3c, 0x708d7c9d, 0x93c4cb3f, 0x7bd35b9e, 0x8e26a23a, + 0x6631329b, 0x85788539, 0x6d6f1598, 0xef134828, 0x0704d889, + 0xe44d6f2b, 0x0c5aff8a, 0xf9af062e, 0x11b8968f, 0xf2f1212d, + 0x1ae6b18c, 0xc26bd424, 0x2a7c4485, 0xc935f327, 0x21226386, + 0xd4d79a22, 0x3cc00a83, 0xdf89bd21, 0x379e2d80, 0xb0b5e621, + 0x58a27680, 0xbbebc122, 0x53fc5183, 0xa609a827, 0x4e1e3886, + 0xad578f24, 0x45401f85, 0x9dcd7a2d, 0x75daea8c, 0x96935d2e, + 0x7e84cd8f, 0x8b71342b, 0x6366a48a, 0x802f1328, 0x68388389, + 0xea44de39, 0x02534e98, 0xe11af93a, 0x090d699b, 0xfcf8903f, + 0x14ef009e, 0xf7a6b73c, 0x1fb1279d, 0xc73c4235, 0x2f2bd294, + 0xcc626536, 0x2475f597, 0xd1800c33, 0x39979c92, 0xdade2b30, + 0x32c9bb91, 0x05579611, 0xed4006b0, 0x0e09b112, 0xe61e21b3, + 0x13ebd817, 0xfbfc48b6, 0x18b5ff14, 0xf0a26fb5, 0x282f0a1d, + 0xc0389abc, 0x23712d1e, 0xcb66bdbf, 0x3e93441b, 0xd684d4ba, + 0x35cd6318, 0xdddaf3b9, 0x5fa6ae09, 0xb7b13ea8, 0x54f8890a, + 0xbcef19ab, 0x491ae00f, 0xa10d70ae, 0x4244c70c, 0xaa5357ad, + 0x72de3205, 0x9ac9a2a4, 0x79801506, 0x919785a7, 0x64627c03, + 0x8c75eca2, 0x6f3c5b00, 0x872bcba1, 0xba1aca03, 0x520d5aa2, + 0xb144ed00, 0x59537da1, 0xaca68405, 0x44b114a4, 0xa7f8a306, + 0x4fef33a7, 0x9762560f, 0x7f75c6ae, 0x9c3c710c, 0x742be1ad, + 0x81de1809, 0x69c988a8, 0x8a803f0a, 0x6297afab, 0xe0ebf21b, + 0x08fc62ba, 0xebb5d518, 0x03a245b9, 0xf657bc1d, 0x1e402cbc, + 0xfd099b1e, 0x151e0bbf, 0xcd936e17, 0x2584feb6, 0xc6cd4914, + 0x2edad9b5, 0xdb2f2011, 0x3338b0b0, 0xd0710712, 0x386697b3, + 0x0ff8ba33, 0xe7ef2a92, 0x04a69d30, 0xecb10d91, 0x1944f435, + 0xf1536494, 0x121ad336, 0xfa0d4397, 0x2280263f, 0xca97b69e, + 0x29de013c, 0xc1c9919d, 0x343c6839, 0xdc2bf898, 0x3f624f3a, + 0xd775df9b, 0x5509822b, 0xbd1e128a, 0x5e57a528, 0xb6403589, + 0x43b5cc2d, 0xaba25c8c, 0x48ebeb2e, 0xa0fc7b8f, 0x78711e27, + 0x90668e86, 0x732f3924, 0x9b38a985, 0x6ecd5021, 0x86dac080, + 0x65937722, 0x8d84e783, 0x0aaf2c22, 0xe2b8bc83, 0x01f10b21, + 0xe9e69b80, 0x1c136224, 0xf404f285, 0x174d4527, 0xff5ad586, + 0x27d7b02e, 0xcfc0208f, 0x2c89972d, 0xc49e078c, 0x316bfe28, + 0xd97c6e89, 0x3a35d92b, 0xd222498a, 0x505e143a, 0xb849849b, + 0x5b003339, 0xb317a398, 0x46e25a3c, 0xaef5ca9d, 0x4dbc7d3f, + 0xa5abed9e, 0x7d268836, 0x95311897, 0x7678af35, 0x9e6f3f94, + 0x6b9ac630, 0x838d5691, 0x60c4e133, 0x88d37192, 0xbf4d5c12, + 0x575accb3, 0xb4137b11, 0x5c04ebb0, 0xa9f11214, 0x41e682b5, + 0xa2af3517, 0x4ab8a5b6, 0x9235c01e, 0x7a2250bf, 0x996be71d, + 0x717c77bc, 0x84898e18, 0x6c9e1eb9, 0x8fd7a91b, 0x67c039ba, + 0xe5bc640a, 0x0dabf4ab, 0xeee24309, 0x06f5d3a8, 0xf3002a0c, + 0x1b17baad, 0xf85e0d0f, 0x10499dae, 0xc8c4f806, 0x20d368a7, + 0xc39adf05, 0x2b8d4fa4, 0xde78b600, 0x366f26a1, 0xd5269103, + 0x3d3101a2}}; + +local const z_word_t FAR crc_braid_big_table[][256] = { + {0x0000000000000000, 0xa19017e800000000, 0x03275e0b00000000, + 0xa2b749e300000000, 0x064ebc1600000000, 0xa7deabfe00000000, + 0x0569e21d00000000, 0xa4f9f5f500000000, 0x0c9c782d00000000, + 0xad0c6fc500000000, 0x0fbb262600000000, 0xae2b31ce00000000, + 0x0ad2c43b00000000, 0xab42d3d300000000, 0x09f59a3000000000, + 0xa8658dd800000000, 0x1838f15a00000000, 0xb9a8e6b200000000, + 0x1b1faf5100000000, 0xba8fb8b900000000, 0x1e764d4c00000000, + 0xbfe65aa400000000, 0x1d51134700000000, 0xbcc104af00000000, + 0x14a4897700000000, 0xb5349e9f00000000, 0x1783d77c00000000, + 0xb613c09400000000, 0x12ea356100000000, 0xb37a228900000000, + 0x11cd6b6a00000000, 0xb05d7c8200000000, 0x3070e2b500000000, + 0x91e0f55d00000000, 0x3357bcbe00000000, 0x92c7ab5600000000, + 0x363e5ea300000000, 0x97ae494b00000000, 0x351900a800000000, + 0x9489174000000000, 0x3cec9a9800000000, 0x9d7c8d7000000000, + 0x3fcbc49300000000, 0x9e5bd37b00000000, 0x3aa2268e00000000, + 0x9b32316600000000, 0x3985788500000000, 0x98156f6d00000000, + 0x284813ef00000000, 0x89d8040700000000, 0x2b6f4de400000000, + 0x8aff5a0c00000000, 0x2e06aff900000000, 0x8f96b81100000000, + 0x2d21f1f200000000, 0x8cb1e61a00000000, 0x24d46bc200000000, + 0x85447c2a00000000, 0x27f335c900000000, 0x8663222100000000, + 0x229ad7d400000000, 0x830ac03c00000000, 0x21bd89df00000000, + 0x802d9e3700000000, 0x21e6b5b000000000, 0x8076a25800000000, + 0x22c1ebbb00000000, 0x8351fc5300000000, 0x27a809a600000000, + 0x86381e4e00000000, 0x248f57ad00000000, 0x851f404500000000, + 0x2d7acd9d00000000, 0x8ceada7500000000, 0x2e5d939600000000, + 0x8fcd847e00000000, 0x2b34718b00000000, 0x8aa4666300000000, + 0x28132f8000000000, 0x8983386800000000, 0x39de44ea00000000, + 0x984e530200000000, 0x3af91ae100000000, 0x9b690d0900000000, + 0x3f90f8fc00000000, 0x9e00ef1400000000, 0x3cb7a6f700000000, + 0x9d27b11f00000000, 0x35423cc700000000, 0x94d22b2f00000000, + 0x366562cc00000000, 0x97f5752400000000, 0x330c80d100000000, + 0x929c973900000000, 0x302bdeda00000000, 0x91bbc93200000000, + 0x1196570500000000, 0xb00640ed00000000, 0x12b1090e00000000, + 0xb3211ee600000000, 0x17d8eb1300000000, 0xb648fcfb00000000, + 0x14ffb51800000000, 0xb56fa2f000000000, 0x1d0a2f2800000000, + 0xbc9a38c000000000, 0x1e2d712300000000, 0xbfbd66cb00000000, + 0x1b44933e00000000, 0xbad484d600000000, 0x1863cd3500000000, + 0xb9f3dadd00000000, 0x09aea65f00000000, 0xa83eb1b700000000, + 0x0a89f85400000000, 0xab19efbc00000000, 0x0fe01a4900000000, + 0xae700da100000000, 0x0cc7444200000000, 0xad5753aa00000000, + 0x0532de7200000000, 0xa4a2c99a00000000, 0x0615807900000000, + 0xa785979100000000, 0x037c626400000000, 0xa2ec758c00000000, + 0x005b3c6f00000000, 0xa1cb2b8700000000, 0x03ca1aba00000000, + 0xa25a0d5200000000, 0x00ed44b100000000, 0xa17d535900000000, + 0x0584a6ac00000000, 0xa414b14400000000, 0x06a3f8a700000000, + 0xa733ef4f00000000, 0x0f56629700000000, 0xaec6757f00000000, + 0x0c713c9c00000000, 0xade12b7400000000, 0x0918de8100000000, + 0xa888c96900000000, 0x0a3f808a00000000, 0xabaf976200000000, + 0x1bf2ebe000000000, 0xba62fc0800000000, 0x18d5b5eb00000000, + 0xb945a20300000000, 0x1dbc57f600000000, 0xbc2c401e00000000, + 0x1e9b09fd00000000, 0xbf0b1e1500000000, 0x176e93cd00000000, + 0xb6fe842500000000, 0x1449cdc600000000, 0xb5d9da2e00000000, + 0x11202fdb00000000, 0xb0b0383300000000, 0x120771d000000000, + 0xb397663800000000, 0x33baf80f00000000, 0x922aefe700000000, + 0x309da60400000000, 0x910db1ec00000000, 0x35f4441900000000, + 0x946453f100000000, 0x36d31a1200000000, 0x97430dfa00000000, + 0x3f26802200000000, 0x9eb697ca00000000, 0x3c01de2900000000, + 0x9d91c9c100000000, 0x39683c3400000000, 0x98f82bdc00000000, + 0x3a4f623f00000000, 0x9bdf75d700000000, 0x2b82095500000000, + 0x8a121ebd00000000, 0x28a5575e00000000, 0x893540b600000000, + 0x2dccb54300000000, 0x8c5ca2ab00000000, 0x2eebeb4800000000, + 0x8f7bfca000000000, 0x271e717800000000, 0x868e669000000000, + 0x24392f7300000000, 0x85a9389b00000000, 0x2150cd6e00000000, + 0x80c0da8600000000, 0x2277936500000000, 0x83e7848d00000000, + 0x222caf0a00000000, 0x83bcb8e200000000, 0x210bf10100000000, + 0x809be6e900000000, 0x2462131c00000000, 0x85f204f400000000, + 0x27454d1700000000, 0x86d55aff00000000, 0x2eb0d72700000000, + 0x8f20c0cf00000000, 0x2d97892c00000000, 0x8c079ec400000000, + 0x28fe6b3100000000, 0x896e7cd900000000, 0x2bd9353a00000000, + 0x8a4922d200000000, 0x3a145e5000000000, 0x9b8449b800000000, + 0x3933005b00000000, 0x98a317b300000000, 0x3c5ae24600000000, + 0x9dcaf5ae00000000, 0x3f7dbc4d00000000, 0x9eedaba500000000, + 0x3688267d00000000, 0x9718319500000000, 0x35af787600000000, + 0x943f6f9e00000000, 0x30c69a6b00000000, 0x91568d8300000000, + 0x33e1c46000000000, 0x9271d38800000000, 0x125c4dbf00000000, + 0xb3cc5a5700000000, 0x117b13b400000000, 0xb0eb045c00000000, + 0x1412f1a900000000, 0xb582e64100000000, 0x1735afa200000000, + 0xb6a5b84a00000000, 0x1ec0359200000000, 0xbf50227a00000000, + 0x1de76b9900000000, 0xbc777c7100000000, 0x188e898400000000, + 0xb91e9e6c00000000, 0x1ba9d78f00000000, 0xba39c06700000000, + 0x0a64bce500000000, 0xabf4ab0d00000000, 0x0943e2ee00000000, + 0xa8d3f50600000000, 0x0c2a00f300000000, 0xadba171b00000000, + 0x0f0d5ef800000000, 0xae9d491000000000, 0x06f8c4c800000000, + 0xa768d32000000000, 0x05df9ac300000000, 0xa44f8d2b00000000, + 0x00b678de00000000, 0xa1266f3600000000, 0x039126d500000000, + 0xa201313d00000000}, + {0x0000000000000000, 0xee8439a100000000, 0x9d0f029900000000, + 0x738b3b3800000000, 0x7b1975e900000000, 0x959d4c4800000000, + 0xe616777000000000, 0x08924ed100000000, 0xb7349b0900000000, + 0x59b0a2a800000000, 0x2a3b999000000000, 0xc4bfa03100000000, + 0xcc2deee000000000, 0x22a9d74100000000, 0x5122ec7900000000, + 0xbfa6d5d800000000, 0x6e69361300000000, 0x80ed0fb200000000, + 0xf366348a00000000, 0x1de20d2b00000000, 0x157043fa00000000, + 0xfbf47a5b00000000, 0x887f416300000000, 0x66fb78c200000000, + 0xd95dad1a00000000, 0x37d994bb00000000, 0x4452af8300000000, + 0xaad6962200000000, 0xa244d8f300000000, 0x4cc0e15200000000, + 0x3f4bda6a00000000, 0xd1cfe3cb00000000, 0xdcd26c2600000000, + 0x3256558700000000, 0x41dd6ebf00000000, 0xaf59571e00000000, + 0xa7cb19cf00000000, 0x494f206e00000000, 0x3ac41b5600000000, + 0xd44022f700000000, 0x6be6f72f00000000, 0x8562ce8e00000000, + 0xf6e9f5b600000000, 0x186dcc1700000000, 0x10ff82c600000000, + 0xfe7bbb6700000000, 0x8df0805f00000000, 0x6374b9fe00000000, + 0xb2bb5a3500000000, 0x5c3f639400000000, 0x2fb458ac00000000, + 0xc130610d00000000, 0xc9a22fdc00000000, 0x2726167d00000000, + 0x54ad2d4500000000, 0xba2914e400000000, 0x058fc13c00000000, + 0xeb0bf89d00000000, 0x9880c3a500000000, 0x7604fa0400000000, + 0x7e96b4d500000000, 0x90128d7400000000, 0xe399b64c00000000, + 0x0d1d8fed00000000, 0xb8a5d94c00000000, 0x5621e0ed00000000, + 0x25aadbd500000000, 0xcb2ee27400000000, 0xc3bcaca500000000, + 0x2d38950400000000, 0x5eb3ae3c00000000, 0xb037979d00000000, + 0x0f91424500000000, 0xe1157be400000000, 0x929e40dc00000000, + 0x7c1a797d00000000, 0x748837ac00000000, 0x9a0c0e0d00000000, + 0xe987353500000000, 0x07030c9400000000, 0xd6ccef5f00000000, + 0x3848d6fe00000000, 0x4bc3edc600000000, 0xa547d46700000000, + 0xadd59ab600000000, 0x4351a31700000000, 0x30da982f00000000, + 0xde5ea18e00000000, 0x61f8745600000000, 0x8f7c4df700000000, + 0xfcf776cf00000000, 0x12734f6e00000000, 0x1ae101bf00000000, + 0xf465381e00000000, 0x87ee032600000000, 0x696a3a8700000000, + 0x6477b56a00000000, 0x8af38ccb00000000, 0xf978b7f300000000, + 0x17fc8e5200000000, 0x1f6ec08300000000, 0xf1eaf92200000000, + 0x8261c21a00000000, 0x6ce5fbbb00000000, 0xd3432e6300000000, + 0x3dc717c200000000, 0x4e4c2cfa00000000, 0xa0c8155b00000000, + 0xa85a5b8a00000000, 0x46de622b00000000, 0x3555591300000000, + 0xdbd160b200000000, 0x0a1e837900000000, 0xe49abad800000000, + 0x971181e000000000, 0x7995b84100000000, 0x7107f69000000000, + 0x9f83cf3100000000, 0xec08f40900000000, 0x028ccda800000000, + 0xbd2a187000000000, 0x53ae21d100000000, 0x20251ae900000000, + 0xcea1234800000000, 0xc6336d9900000000, 0x28b7543800000000, + 0x5b3c6f0000000000, 0xb5b856a100000000, 0x704bb39900000000, + 0x9ecf8a3800000000, 0xed44b10000000000, 0x03c088a100000000, + 0x0b52c67000000000, 0xe5d6ffd100000000, 0x965dc4e900000000, + 0x78d9fd4800000000, 0xc77f289000000000, 0x29fb113100000000, + 0x5a702a0900000000, 0xb4f413a800000000, 0xbc665d7900000000, + 0x52e264d800000000, 0x21695fe000000000, 0xcfed664100000000, + 0x1e22858a00000000, 0xf0a6bc2b00000000, 0x832d871300000000, + 0x6da9beb200000000, 0x653bf06300000000, 0x8bbfc9c200000000, + 0xf834f2fa00000000, 0x16b0cb5b00000000, 0xa9161e8300000000, + 0x4792272200000000, 0x34191c1a00000000, 0xda9d25bb00000000, + 0xd20f6b6a00000000, 0x3c8b52cb00000000, 0x4f0069f300000000, + 0xa184505200000000, 0xac99dfbf00000000, 0x421de61e00000000, + 0x3196dd2600000000, 0xdf12e48700000000, 0xd780aa5600000000, + 0x390493f700000000, 0x4a8fa8cf00000000, 0xa40b916e00000000, + 0x1bad44b600000000, 0xf5297d1700000000, 0x86a2462f00000000, + 0x68267f8e00000000, 0x60b4315f00000000, 0x8e3008fe00000000, + 0xfdbb33c600000000, 0x133f0a6700000000, 0xc2f0e9ac00000000, + 0x2c74d00d00000000, 0x5fffeb3500000000, 0xb17bd29400000000, + 0xb9e99c4500000000, 0x576da5e400000000, 0x24e69edc00000000, + 0xca62a77d00000000, 0x75c472a500000000, 0x9b404b0400000000, + 0xe8cb703c00000000, 0x064f499d00000000, 0x0edd074c00000000, + 0xe0593eed00000000, 0x93d205d500000000, 0x7d563c7400000000, + 0xc8ee6ad500000000, 0x266a537400000000, 0x55e1684c00000000, + 0xbb6551ed00000000, 0xb3f71f3c00000000, 0x5d73269d00000000, + 0x2ef81da500000000, 0xc07c240400000000, 0x7fdaf1dc00000000, + 0x915ec87d00000000, 0xe2d5f34500000000, 0x0c51cae400000000, + 0x04c3843500000000, 0xea47bd9400000000, 0x99cc86ac00000000, + 0x7748bf0d00000000, 0xa6875cc600000000, 0x4803656700000000, + 0x3b885e5f00000000, 0xd50c67fe00000000, 0xdd9e292f00000000, + 0x331a108e00000000, 0x40912bb600000000, 0xae15121700000000, + 0x11b3c7cf00000000, 0xff37fe6e00000000, 0x8cbcc55600000000, + 0x6238fcf700000000, 0x6aaab22600000000, 0x842e8b8700000000, + 0xf7a5b0bf00000000, 0x1921891e00000000, 0x143c06f300000000, + 0xfab83f5200000000, 0x8933046a00000000, 0x67b73dcb00000000, + 0x6f25731a00000000, 0x81a14abb00000000, 0xf22a718300000000, + 0x1cae482200000000, 0xa3089dfa00000000, 0x4d8ca45b00000000, + 0x3e079f6300000000, 0xd083a6c200000000, 0xd811e81300000000, + 0x3695d1b200000000, 0x451eea8a00000000, 0xab9ad32b00000000, + 0x7a5530e000000000, 0x94d1094100000000, 0xe75a327900000000, + 0x09de0bd800000000, 0x014c450900000000, 0xefc87ca800000000, + 0x9c43479000000000, 0x72c77e3100000000, 0xcd61abe900000000, + 0x23e5924800000000, 0x506ea97000000000, 0xbeea90d100000000, + 0xb678de0000000000, 0x58fce7a100000000, 0x2b77dc9900000000, + 0xc5f3e53800000000}, + {0x0000000000000000, 0xfbf6134700000000, 0xf6ed278e00000000, + 0x0d1b34c900000000, 0xaddd3ec700000000, 0x562b2d8000000000, + 0x5b30194900000000, 0xa0c60a0e00000000, 0x1bbd0c5500000000, + 0xe04b1f1200000000, 0xed502bdb00000000, 0x16a6389c00000000, + 0xb660329200000000, 0x4d9621d500000000, 0x408d151c00000000, + 0xbb7b065b00000000, 0x367a19aa00000000, 0xcd8c0aed00000000, + 0xc0973e2400000000, 0x3b612d6300000000, 0x9ba7276d00000000, + 0x6051342a00000000, 0x6d4a00e300000000, 0x96bc13a400000000, + 0x2dc715ff00000000, 0xd63106b800000000, 0xdb2a327100000000, + 0x20dc213600000000, 0x801a2b3800000000, 0x7bec387f00000000, + 0x76f70cb600000000, 0x8d011ff100000000, 0x2df2438f00000000, + 0xd60450c800000000, 0xdb1f640100000000, 0x20e9774600000000, + 0x802f7d4800000000, 0x7bd96e0f00000000, 0x76c25ac600000000, + 0x8d34498100000000, 0x364f4fda00000000, 0xcdb95c9d00000000, + 0xc0a2685400000000, 0x3b547b1300000000, 0x9b92711d00000000, + 0x6064625a00000000, 0x6d7f569300000000, 0x968945d400000000, + 0x1b885a2500000000, 0xe07e496200000000, 0xed657dab00000000, + 0x16936eec00000000, 0xb65564e200000000, 0x4da377a500000000, + 0x40b8436c00000000, 0xbb4e502b00000000, 0x0035567000000000, + 0xfbc3453700000000, 0xf6d871fe00000000, 0x0d2e62b900000000, + 0xade868b700000000, 0x561e7bf000000000, 0x5b054f3900000000, + 0xa0f35c7e00000000, 0x1be2f6c500000000, 0xe014e58200000000, + 0xed0fd14b00000000, 0x16f9c20c00000000, 0xb63fc80200000000, + 0x4dc9db4500000000, 0x40d2ef8c00000000, 0xbb24fccb00000000, + 0x005ffa9000000000, 0xfba9e9d700000000, 0xf6b2dd1e00000000, + 0x0d44ce5900000000, 0xad82c45700000000, 0x5674d71000000000, + 0x5b6fe3d900000000, 0xa099f09e00000000, 0x2d98ef6f00000000, + 0xd66efc2800000000, 0xdb75c8e100000000, 0x2083dba600000000, + 0x8045d1a800000000, 0x7bb3c2ef00000000, 0x76a8f62600000000, + 0x8d5ee56100000000, 0x3625e33a00000000, 0xcdd3f07d00000000, + 0xc0c8c4b400000000, 0x3b3ed7f300000000, 0x9bf8ddfd00000000, + 0x600eceba00000000, 0x6d15fa7300000000, 0x96e3e93400000000, + 0x3610b54a00000000, 0xcde6a60d00000000, 0xc0fd92c400000000, + 0x3b0b818300000000, 0x9bcd8b8d00000000, 0x603b98ca00000000, + 0x6d20ac0300000000, 0x96d6bf4400000000, 0x2dadb91f00000000, + 0xd65baa5800000000, 0xdb409e9100000000, 0x20b68dd600000000, + 0x807087d800000000, 0x7b86949f00000000, 0x769da05600000000, + 0x8d6bb31100000000, 0x006aace000000000, 0xfb9cbfa700000000, + 0xf6878b6e00000000, 0x0d71982900000000, 0xadb7922700000000, + 0x5641816000000000, 0x5b5ab5a900000000, 0xa0aca6ee00000000, + 0x1bd7a0b500000000, 0xe021b3f200000000, 0xed3a873b00000000, + 0x16cc947c00000000, 0xb60a9e7200000000, 0x4dfc8d3500000000, + 0x40e7b9fc00000000, 0xbb11aabb00000000, 0x77c29c5000000000, + 0x8c348f1700000000, 0x812fbbde00000000, 0x7ad9a89900000000, + 0xda1fa29700000000, 0x21e9b1d000000000, 0x2cf2851900000000, + 0xd704965e00000000, 0x6c7f900500000000, 0x9789834200000000, + 0x9a92b78b00000000, 0x6164a4cc00000000, 0xc1a2aec200000000, + 0x3a54bd8500000000, 0x374f894c00000000, 0xccb99a0b00000000, + 0x41b885fa00000000, 0xba4e96bd00000000, 0xb755a27400000000, + 0x4ca3b13300000000, 0xec65bb3d00000000, 0x1793a87a00000000, + 0x1a889cb300000000, 0xe17e8ff400000000, 0x5a0589af00000000, + 0xa1f39ae800000000, 0xace8ae2100000000, 0x571ebd6600000000, + 0xf7d8b76800000000, 0x0c2ea42f00000000, 0x013590e600000000, + 0xfac383a100000000, 0x5a30dfdf00000000, 0xa1c6cc9800000000, + 0xacddf85100000000, 0x572beb1600000000, 0xf7ede11800000000, + 0x0c1bf25f00000000, 0x0100c69600000000, 0xfaf6d5d100000000, + 0x418dd38a00000000, 0xba7bc0cd00000000, 0xb760f40400000000, + 0x4c96e74300000000, 0xec50ed4d00000000, 0x17a6fe0a00000000, + 0x1abdcac300000000, 0xe14bd98400000000, 0x6c4ac67500000000, + 0x97bcd53200000000, 0x9aa7e1fb00000000, 0x6151f2bc00000000, + 0xc197f8b200000000, 0x3a61ebf500000000, 0x377adf3c00000000, + 0xcc8ccc7b00000000, 0x77f7ca2000000000, 0x8c01d96700000000, + 0x811aedae00000000, 0x7aecfee900000000, 0xda2af4e700000000, + 0x21dce7a000000000, 0x2cc7d36900000000, 0xd731c02e00000000, + 0x6c206a9500000000, 0x97d679d200000000, 0x9acd4d1b00000000, + 0x613b5e5c00000000, 0xc1fd545200000000, 0x3a0b471500000000, + 0x371073dc00000000, 0xcce6609b00000000, 0x779d66c000000000, + 0x8c6b758700000000, 0x8170414e00000000, 0x7a86520900000000, + 0xda40580700000000, 0x21b64b4000000000, 0x2cad7f8900000000, + 0xd75b6cce00000000, 0x5a5a733f00000000, 0xa1ac607800000000, + 0xacb754b100000000, 0x574147f600000000, 0xf7874df800000000, + 0x0c715ebf00000000, 0x016a6a7600000000, 0xfa9c793100000000, + 0x41e77f6a00000000, 0xba116c2d00000000, 0xb70a58e400000000, + 0x4cfc4ba300000000, 0xec3a41ad00000000, 0x17cc52ea00000000, + 0x1ad7662300000000, 0xe121756400000000, 0x41d2291a00000000, + 0xba243a5d00000000, 0xb73f0e9400000000, 0x4cc91dd300000000, + 0xec0f17dd00000000, 0x17f9049a00000000, 0x1ae2305300000000, + 0xe114231400000000, 0x5a6f254f00000000, 0xa199360800000000, + 0xac8202c100000000, 0x5774118600000000, 0xf7b21b8800000000, + 0x0c4408cf00000000, 0x015f3c0600000000, 0xfaa92f4100000000, + 0x77a830b000000000, 0x8c5e23f700000000, 0x8145173e00000000, + 0x7ab3047900000000, 0xda750e7700000000, 0x21831d3000000000, + 0x2c9829f900000000, 0xd76e3abe00000000, 0x6c153ce500000000, + 0x97e32fa200000000, 0x9af81b6b00000000, 0x610e082c00000000, + 0xc1c8022200000000, 0x3a3e116500000000, 0x372525ac00000000, + 0xccd336eb00000000}, + {0x0000000000000000, 0x6238282a00000000, 0xc470505400000000, + 0xa648787e00000000, 0x88e1a0a800000000, 0xead9888200000000, + 0x4c91f0fc00000000, 0x2ea9d8d600000000, 0x51c5308a00000000, + 0x33fd18a000000000, 0x95b560de00000000, 0xf78d48f400000000, + 0xd924902200000000, 0xbb1cb80800000000, 0x1d54c07600000000, + 0x7f6ce85c00000000, 0xe38c10cf00000000, 0x81b438e500000000, + 0x27fc409b00000000, 0x45c468b100000000, 0x6b6db06700000000, + 0x0955984d00000000, 0xaf1de03300000000, 0xcd25c81900000000, + 0xb249204500000000, 0xd071086f00000000, 0x7639701100000000, + 0x1401583b00000000, 0x3aa880ed00000000, 0x5890a8c700000000, + 0xfed8d0b900000000, 0x9ce0f89300000000, 0x871f504500000000, + 0xe527786f00000000, 0x436f001100000000, 0x2157283b00000000, + 0x0ffef0ed00000000, 0x6dc6d8c700000000, 0xcb8ea0b900000000, + 0xa9b6889300000000, 0xd6da60cf00000000, 0xb4e248e500000000, + 0x12aa309b00000000, 0x709218b100000000, 0x5e3bc06700000000, + 0x3c03e84d00000000, 0x9a4b903300000000, 0xf873b81900000000, + 0x6493408a00000000, 0x06ab68a000000000, 0xa0e310de00000000, + 0xc2db38f400000000, 0xec72e02200000000, 0x8e4ac80800000000, + 0x2802b07600000000, 0x4a3a985c00000000, 0x3556700000000000, + 0x576e582a00000000, 0xf126205400000000, 0x931e087e00000000, + 0xbdb7d0a800000000, 0xdf8ff88200000000, 0x79c780fc00000000, + 0x1bffa8d600000000, 0x0e3fa08a00000000, 0x6c0788a000000000, + 0xca4ff0de00000000, 0xa877d8f400000000, 0x86de002200000000, + 0xe4e6280800000000, 0x42ae507600000000, 0x2096785c00000000, + 0x5ffa900000000000, 0x3dc2b82a00000000, 0x9b8ac05400000000, + 0xf9b2e87e00000000, 0xd71b30a800000000, 0xb523188200000000, + 0x136b60fc00000000, 0x715348d600000000, 0xedb3b04500000000, + 0x8f8b986f00000000, 0x29c3e01100000000, 0x4bfbc83b00000000, + 0x655210ed00000000, 0x076a38c700000000, 0xa12240b900000000, + 0xc31a689300000000, 0xbc7680cf00000000, 0xde4ea8e500000000, + 0x7806d09b00000000, 0x1a3ef8b100000000, 0x3497206700000000, + 0x56af084d00000000, 0xf0e7703300000000, 0x92df581900000000, + 0x8920f0cf00000000, 0xeb18d8e500000000, 0x4d50a09b00000000, + 0x2f6888b100000000, 0x01c1506700000000, 0x63f9784d00000000, + 0xc5b1003300000000, 0xa789281900000000, 0xd8e5c04500000000, + 0xbadde86f00000000, 0x1c95901100000000, 0x7eadb83b00000000, + 0x500460ed00000000, 0x323c48c700000000, 0x947430b900000000, + 0xf64c189300000000, 0x6aace00000000000, 0x0894c82a00000000, + 0xaedcb05400000000, 0xcce4987e00000000, 0xe24d40a800000000, + 0x8075688200000000, 0x263d10fc00000000, 0x440538d600000000, + 0x3b69d08a00000000, 0x5951f8a000000000, 0xff1980de00000000, + 0x9d21a8f400000000, 0xb388702200000000, 0xd1b0580800000000, + 0x77f8207600000000, 0x15c0085c00000000, 0x5d7831ce00000000, + 0x3f4019e400000000, 0x9908619a00000000, 0xfb3049b000000000, + 0xd599916600000000, 0xb7a1b94c00000000, 0x11e9c13200000000, + 0x73d1e91800000000, 0x0cbd014400000000, 0x6e85296e00000000, + 0xc8cd511000000000, 0xaaf5793a00000000, 0x845ca1ec00000000, + 0xe66489c600000000, 0x402cf1b800000000, 0x2214d99200000000, + 0xbef4210100000000, 0xdccc092b00000000, 0x7a84715500000000, + 0x18bc597f00000000, 0x361581a900000000, 0x542da98300000000, + 0xf265d1fd00000000, 0x905df9d700000000, 0xef31118b00000000, + 0x8d0939a100000000, 0x2b4141df00000000, 0x497969f500000000, + 0x67d0b12300000000, 0x05e8990900000000, 0xa3a0e17700000000, + 0xc198c95d00000000, 0xda67618b00000000, 0xb85f49a100000000, + 0x1e1731df00000000, 0x7c2f19f500000000, 0x5286c12300000000, + 0x30bee90900000000, 0x96f6917700000000, 0xf4ceb95d00000000, + 0x8ba2510100000000, 0xe99a792b00000000, 0x4fd2015500000000, + 0x2dea297f00000000, 0x0343f1a900000000, 0x617bd98300000000, + 0xc733a1fd00000000, 0xa50b89d700000000, 0x39eb714400000000, + 0x5bd3596e00000000, 0xfd9b211000000000, 0x9fa3093a00000000, + 0xb10ad1ec00000000, 0xd332f9c600000000, 0x757a81b800000000, + 0x1742a99200000000, 0x682e41ce00000000, 0x0a1669e400000000, + 0xac5e119a00000000, 0xce6639b000000000, 0xe0cfe16600000000, + 0x82f7c94c00000000, 0x24bfb13200000000, 0x4687991800000000, + 0x5347914400000000, 0x317fb96e00000000, 0x9737c11000000000, + 0xf50fe93a00000000, 0xdba631ec00000000, 0xb99e19c600000000, + 0x1fd661b800000000, 0x7dee499200000000, 0x0282a1ce00000000, + 0x60ba89e400000000, 0xc6f2f19a00000000, 0xa4cad9b000000000, + 0x8a63016600000000, 0xe85b294c00000000, 0x4e13513200000000, + 0x2c2b791800000000, 0xb0cb818b00000000, 0xd2f3a9a100000000, + 0x74bbd1df00000000, 0x1683f9f500000000, 0x382a212300000000, + 0x5a12090900000000, 0xfc5a717700000000, 0x9e62595d00000000, + 0xe10eb10100000000, 0x8336992b00000000, 0x257ee15500000000, + 0x4746c97f00000000, 0x69ef11a900000000, 0x0bd7398300000000, + 0xad9f41fd00000000, 0xcfa769d700000000, 0xd458c10100000000, + 0xb660e92b00000000, 0x1028915500000000, 0x7210b97f00000000, + 0x5cb961a900000000, 0x3e81498300000000, 0x98c931fd00000000, + 0xfaf119d700000000, 0x859df18b00000000, 0xe7a5d9a100000000, + 0x41eda1df00000000, 0x23d589f500000000, 0x0d7c512300000000, + 0x6f44790900000000, 0xc90c017700000000, 0xab34295d00000000, + 0x37d4d1ce00000000, 0x55ecf9e400000000, 0xf3a4819a00000000, + 0x919ca9b000000000, 0xbf35716600000000, 0xdd0d594c00000000, + 0x7b45213200000000, 0x197d091800000000, 0x6611e14400000000, + 0x0429c96e00000000, 0xa261b11000000000, 0xc059993a00000000, + 0xeef041ec00000000, 0x8cc869c600000000, 0x2a8011b800000000, + 0x48b8399200000000}, + {0x0000000000000000, 0x4c2896a300000000, 0xd9565d9c00000000, + 0x957ecb3f00000000, 0xf3abcbe300000000, 0xbf835d4000000000, + 0x2afd967f00000000, 0x66d500dc00000000, 0xa751e61c00000000, + 0xeb7970bf00000000, 0x7e07bb8000000000, 0x322f2d2300000000, + 0x54fa2dff00000000, 0x18d2bb5c00000000, 0x8dac706300000000, + 0xc184e6c000000000, 0x4ea3cc3900000000, 0x028b5a9a00000000, + 0x97f591a500000000, 0xdbdd070600000000, 0xbd0807da00000000, + 0xf120917900000000, 0x645e5a4600000000, 0x2876cce500000000, + 0xe9f22a2500000000, 0xa5dabc8600000000, 0x30a477b900000000, + 0x7c8ce11a00000000, 0x1a59e1c600000000, 0x5671776500000000, + 0xc30fbc5a00000000, 0x8f272af900000000, 0x9c46997300000000, + 0xd06e0fd000000000, 0x4510c4ef00000000, 0x0938524c00000000, + 0x6fed529000000000, 0x23c5c43300000000, 0xb6bb0f0c00000000, + 0xfa9399af00000000, 0x3b177f6f00000000, 0x773fe9cc00000000, + 0xe24122f300000000, 0xae69b45000000000, 0xc8bcb48c00000000, + 0x8494222f00000000, 0x11eae91000000000, 0x5dc27fb300000000, + 0xd2e5554a00000000, 0x9ecdc3e900000000, 0x0bb308d600000000, + 0x479b9e7500000000, 0x214e9ea900000000, 0x6d66080a00000000, + 0xf818c33500000000, 0xb430559600000000, 0x75b4b35600000000, + 0x399c25f500000000, 0xace2eeca00000000, 0xe0ca786900000000, + 0x861f78b500000000, 0xca37ee1600000000, 0x5f49252900000000, + 0x1361b38a00000000, 0x388d32e700000000, 0x74a5a44400000000, + 0xe1db6f7b00000000, 0xadf3f9d800000000, 0xcb26f90400000000, + 0x870e6fa700000000, 0x1270a49800000000, 0x5e58323b00000000, + 0x9fdcd4fb00000000, 0xd3f4425800000000, 0x468a896700000000, + 0x0aa21fc400000000, 0x6c771f1800000000, 0x205f89bb00000000, + 0xb521428400000000, 0xf909d42700000000, 0x762efede00000000, + 0x3a06687d00000000, 0xaf78a34200000000, 0xe35035e100000000, + 0x8585353d00000000, 0xc9ada39e00000000, 0x5cd368a100000000, + 0x10fbfe0200000000, 0xd17f18c200000000, 0x9d578e6100000000, + 0x0829455e00000000, 0x4401d3fd00000000, 0x22d4d32100000000, + 0x6efc458200000000, 0xfb828ebd00000000, 0xb7aa181e00000000, + 0xa4cbab9400000000, 0xe8e33d3700000000, 0x7d9df60800000000, + 0x31b560ab00000000, 0x5760607700000000, 0x1b48f6d400000000, + 0x8e363deb00000000, 0xc21eab4800000000, 0x039a4d8800000000, + 0x4fb2db2b00000000, 0xdacc101400000000, 0x96e486b700000000, + 0xf031866b00000000, 0xbc1910c800000000, 0x2967dbf700000000, + 0x654f4d5400000000, 0xea6867ad00000000, 0xa640f10e00000000, + 0x333e3a3100000000, 0x7f16ac9200000000, 0x19c3ac4e00000000, + 0x55eb3aed00000000, 0xc095f1d200000000, 0x8cbd677100000000, + 0x4d3981b100000000, 0x0111171200000000, 0x946fdc2d00000000, + 0xd8474a8e00000000, 0xbe924a5200000000, 0xf2badcf100000000, + 0x67c417ce00000000, 0x2bec816d00000000, 0x311c141500000000, + 0x7d3482b600000000, 0xe84a498900000000, 0xa462df2a00000000, + 0xc2b7dff600000000, 0x8e9f495500000000, 0x1be1826a00000000, + 0x57c914c900000000, 0x964df20900000000, 0xda6564aa00000000, + 0x4f1baf9500000000, 0x0333393600000000, 0x65e639ea00000000, + 0x29ceaf4900000000, 0xbcb0647600000000, 0xf098f2d500000000, + 0x7fbfd82c00000000, 0x33974e8f00000000, 0xa6e985b000000000, + 0xeac1131300000000, 0x8c1413cf00000000, 0xc03c856c00000000, + 0x55424e5300000000, 0x196ad8f000000000, 0xd8ee3e3000000000, + 0x94c6a89300000000, 0x01b863ac00000000, 0x4d90f50f00000000, + 0x2b45f5d300000000, 0x676d637000000000, 0xf213a84f00000000, + 0xbe3b3eec00000000, 0xad5a8d6600000000, 0xe1721bc500000000, + 0x740cd0fa00000000, 0x3824465900000000, 0x5ef1468500000000, + 0x12d9d02600000000, 0x87a71b1900000000, 0xcb8f8dba00000000, + 0x0a0b6b7a00000000, 0x4623fdd900000000, 0xd35d36e600000000, + 0x9f75a04500000000, 0xf9a0a09900000000, 0xb588363a00000000, + 0x20f6fd0500000000, 0x6cde6ba600000000, 0xe3f9415f00000000, + 0xafd1d7fc00000000, 0x3aaf1cc300000000, 0x76878a6000000000, + 0x10528abc00000000, 0x5c7a1c1f00000000, 0xc904d72000000000, + 0x852c418300000000, 0x44a8a74300000000, 0x088031e000000000, + 0x9dfefadf00000000, 0xd1d66c7c00000000, 0xb7036ca000000000, + 0xfb2bfa0300000000, 0x6e55313c00000000, 0x227da79f00000000, + 0x099126f200000000, 0x45b9b05100000000, 0xd0c77b6e00000000, + 0x9cefedcd00000000, 0xfa3aed1100000000, 0xb6127bb200000000, + 0x236cb08d00000000, 0x6f44262e00000000, 0xaec0c0ee00000000, + 0xe2e8564d00000000, 0x77969d7200000000, 0x3bbe0bd100000000, + 0x5d6b0b0d00000000, 0x11439dae00000000, 0x843d569100000000, + 0xc815c03200000000, 0x4732eacb00000000, 0x0b1a7c6800000000, + 0x9e64b75700000000, 0xd24c21f400000000, 0xb499212800000000, + 0xf8b1b78b00000000, 0x6dcf7cb400000000, 0x21e7ea1700000000, + 0xe0630cd700000000, 0xac4b9a7400000000, 0x3935514b00000000, + 0x751dc7e800000000, 0x13c8c73400000000, 0x5fe0519700000000, + 0xca9e9aa800000000, 0x86b60c0b00000000, 0x95d7bf8100000000, + 0xd9ff292200000000, 0x4c81e21d00000000, 0x00a974be00000000, + 0x667c746200000000, 0x2a54e2c100000000, 0xbf2a29fe00000000, + 0xf302bf5d00000000, 0x3286599d00000000, 0x7eaecf3e00000000, + 0xebd0040100000000, 0xa7f892a200000000, 0xc12d927e00000000, + 0x8d0504dd00000000, 0x187bcfe200000000, 0x5453594100000000, + 0xdb7473b800000000, 0x975ce51b00000000, 0x02222e2400000000, + 0x4e0ab88700000000, 0x28dfb85b00000000, 0x64f72ef800000000, + 0xf189e5c700000000, 0xbda1736400000000, 0x7c2595a400000000, + 0x300d030700000000, 0xa573c83800000000, 0xe95b5e9b00000000, + 0x8f8e5e4700000000, 0xc3a6c8e400000000, 0x56d803db00000000, + 0x1af0957800000000}, + {0x0000000000000000, 0x939bc97f00000000, 0x263793ff00000000, + 0xb5ac5a8000000000, 0x0d68572400000000, 0x9ef39e5b00000000, + 0x2b5fc4db00000000, 0xb8c40da400000000, 0x1ad0ae4800000000, + 0x894b673700000000, 0x3ce73db700000000, 0xaf7cf4c800000000, + 0x17b8f96c00000000, 0x8423301300000000, 0x318f6a9300000000, + 0xa214a3ec00000000, 0x34a05d9100000000, 0xa73b94ee00000000, + 0x1297ce6e00000000, 0x810c071100000000, 0x39c80ab500000000, + 0xaa53c3ca00000000, 0x1fff994a00000000, 0x8c64503500000000, + 0x2e70f3d900000000, 0xbdeb3aa600000000, 0x0847602600000000, + 0x9bdca95900000000, 0x2318a4fd00000000, 0xb0836d8200000000, + 0x052f370200000000, 0x96b4fe7d00000000, 0x2946caf900000000, + 0xbadd038600000000, 0x0f71590600000000, 0x9cea907900000000, + 0x242e9ddd00000000, 0xb7b554a200000000, 0x02190e2200000000, + 0x9182c75d00000000, 0x339664b100000000, 0xa00dadce00000000, + 0x15a1f74e00000000, 0x863a3e3100000000, 0x3efe339500000000, + 0xad65faea00000000, 0x18c9a06a00000000, 0x8b52691500000000, + 0x1de6976800000000, 0x8e7d5e1700000000, 0x3bd1049700000000, + 0xa84acde800000000, 0x108ec04c00000000, 0x8315093300000000, + 0x36b953b300000000, 0xa5229acc00000000, 0x0736392000000000, + 0x94adf05f00000000, 0x2101aadf00000000, 0xb29a63a000000000, + 0x0a5e6e0400000000, 0x99c5a77b00000000, 0x2c69fdfb00000000, + 0xbff2348400000000, 0x138ae52800000000, 0x80112c5700000000, + 0x35bd76d700000000, 0xa626bfa800000000, 0x1ee2b20c00000000, + 0x8d797b7300000000, 0x38d521f300000000, 0xab4ee88c00000000, + 0x095a4b6000000000, 0x9ac1821f00000000, 0x2f6dd89f00000000, + 0xbcf611e000000000, 0x04321c4400000000, 0x97a9d53b00000000, + 0x22058fbb00000000, 0xb19e46c400000000, 0x272ab8b900000000, + 0xb4b171c600000000, 0x011d2b4600000000, 0x9286e23900000000, + 0x2a42ef9d00000000, 0xb9d926e200000000, 0x0c757c6200000000, + 0x9feeb51d00000000, 0x3dfa16f100000000, 0xae61df8e00000000, + 0x1bcd850e00000000, 0x88564c7100000000, 0x309241d500000000, + 0xa30988aa00000000, 0x16a5d22a00000000, 0x853e1b5500000000, + 0x3acc2fd100000000, 0xa957e6ae00000000, 0x1cfbbc2e00000000, + 0x8f60755100000000, 0x37a478f500000000, 0xa43fb18a00000000, + 0x1193eb0a00000000, 0x8208227500000000, 0x201c819900000000, + 0xb38748e600000000, 0x062b126600000000, 0x95b0db1900000000, + 0x2d74d6bd00000000, 0xbeef1fc200000000, 0x0b43454200000000, + 0x98d88c3d00000000, 0x0e6c724000000000, 0x9df7bb3f00000000, + 0x285be1bf00000000, 0xbbc028c000000000, 0x0304256400000000, + 0x909fec1b00000000, 0x2533b69b00000000, 0xb6a87fe400000000, + 0x14bcdc0800000000, 0x8727157700000000, 0x328b4ff700000000, + 0xa110868800000000, 0x19d48b2c00000000, 0x8a4f425300000000, + 0x3fe318d300000000, 0xac78d1ac00000000, 0x2614cb5100000000, + 0xb58f022e00000000, 0x002358ae00000000, 0x93b891d100000000, + 0x2b7c9c7500000000, 0xb8e7550a00000000, 0x0d4b0f8a00000000, + 0x9ed0c6f500000000, 0x3cc4651900000000, 0xaf5fac6600000000, + 0x1af3f6e600000000, 0x89683f9900000000, 0x31ac323d00000000, + 0xa237fb4200000000, 0x179ba1c200000000, 0x840068bd00000000, + 0x12b496c000000000, 0x812f5fbf00000000, 0x3483053f00000000, + 0xa718cc4000000000, 0x1fdcc1e400000000, 0x8c47089b00000000, + 0x39eb521b00000000, 0xaa709b6400000000, 0x0864388800000000, + 0x9bfff1f700000000, 0x2e53ab7700000000, 0xbdc8620800000000, + 0x050c6fac00000000, 0x9697a6d300000000, 0x233bfc5300000000, + 0xb0a0352c00000000, 0x0f5201a800000000, 0x9cc9c8d700000000, + 0x2965925700000000, 0xbafe5b2800000000, 0x023a568c00000000, + 0x91a19ff300000000, 0x240dc57300000000, 0xb7960c0c00000000, + 0x1582afe000000000, 0x8619669f00000000, 0x33b53c1f00000000, + 0xa02ef56000000000, 0x18eaf8c400000000, 0x8b7131bb00000000, + 0x3edd6b3b00000000, 0xad46a24400000000, 0x3bf25c3900000000, + 0xa869954600000000, 0x1dc5cfc600000000, 0x8e5e06b900000000, + 0x369a0b1d00000000, 0xa501c26200000000, 0x10ad98e200000000, + 0x8336519d00000000, 0x2122f27100000000, 0xb2b93b0e00000000, + 0x0715618e00000000, 0x948ea8f100000000, 0x2c4aa55500000000, + 0xbfd16c2a00000000, 0x0a7d36aa00000000, 0x99e6ffd500000000, + 0x359e2e7900000000, 0xa605e70600000000, 0x13a9bd8600000000, + 0x803274f900000000, 0x38f6795d00000000, 0xab6db02200000000, + 0x1ec1eaa200000000, 0x8d5a23dd00000000, 0x2f4e803100000000, + 0xbcd5494e00000000, 0x097913ce00000000, 0x9ae2dab100000000, + 0x2226d71500000000, 0xb1bd1e6a00000000, 0x041144ea00000000, + 0x978a8d9500000000, 0x013e73e800000000, 0x92a5ba9700000000, + 0x2709e01700000000, 0xb492296800000000, 0x0c5624cc00000000, + 0x9fcdedb300000000, 0x2a61b73300000000, 0xb9fa7e4c00000000, + 0x1beedda000000000, 0x887514df00000000, 0x3dd94e5f00000000, + 0xae42872000000000, 0x16868a8400000000, 0x851d43fb00000000, + 0x30b1197b00000000, 0xa32ad00400000000, 0x1cd8e48000000000, + 0x8f432dff00000000, 0x3aef777f00000000, 0xa974be0000000000, + 0x11b0b3a400000000, 0x822b7adb00000000, 0x3787205b00000000, + 0xa41ce92400000000, 0x06084ac800000000, 0x959383b700000000, + 0x203fd93700000000, 0xb3a4104800000000, 0x0b601dec00000000, + 0x98fbd49300000000, 0x2d578e1300000000, 0xbecc476c00000000, + 0x2878b91100000000, 0xbbe3706e00000000, 0x0e4f2aee00000000, + 0x9dd4e39100000000, 0x2510ee3500000000, 0xb68b274a00000000, + 0x03277dca00000000, 0x90bcb4b500000000, 0x32a8175900000000, + 0xa133de2600000000, 0x149f84a600000000, 0x87044dd900000000, + 0x3fc0407d00000000, 0xac5b890200000000, 0x19f7d38200000000, + 0x8a6c1afd00000000}, + {0x0000000000000000, 0x650b796900000000, 0xca16f2d200000000, + 0xaf1d8bbb00000000, 0xd52b957e00000000, 0xb020ec1700000000, + 0x1f3d67ac00000000, 0x7a361ec500000000, 0xaa572afd00000000, + 0xcf5c539400000000, 0x6041d82f00000000, 0x054aa14600000000, + 0x7f7cbf8300000000, 0x1a77c6ea00000000, 0xb56a4d5100000000, + 0xd061343800000000, 0x15a9252100000000, 0x70a25c4800000000, + 0xdfbfd7f300000000, 0xbab4ae9a00000000, 0xc082b05f00000000, + 0xa589c93600000000, 0x0a94428d00000000, 0x6f9f3be400000000, + 0xbffe0fdc00000000, 0xdaf576b500000000, 0x75e8fd0e00000000, + 0x10e3846700000000, 0x6ad59aa200000000, 0x0fdee3cb00000000, + 0xa0c3687000000000, 0xc5c8111900000000, 0x2a524b4200000000, + 0x4f59322b00000000, 0xe044b99000000000, 0x854fc0f900000000, + 0xff79de3c00000000, 0x9a72a75500000000, 0x356f2cee00000000, + 0x5064558700000000, 0x800561bf00000000, 0xe50e18d600000000, + 0x4a13936d00000000, 0x2f18ea0400000000, 0x552ef4c100000000, + 0x30258da800000000, 0x9f38061300000000, 0xfa337f7a00000000, + 0x3ffb6e6300000000, 0x5af0170a00000000, 0xf5ed9cb100000000, + 0x90e6e5d800000000, 0xead0fb1d00000000, 0x8fdb827400000000, + 0x20c609cf00000000, 0x45cd70a600000000, 0x95ac449e00000000, + 0xf0a73df700000000, 0x5fbab64c00000000, 0x3ab1cf2500000000, + 0x4087d1e000000000, 0x258ca88900000000, 0x8a91233200000000, + 0xef9a5a5b00000000, 0x54a4968400000000, 0x31afefed00000000, + 0x9eb2645600000000, 0xfbb91d3f00000000, 0x818f03fa00000000, + 0xe4847a9300000000, 0x4b99f12800000000, 0x2e92884100000000, + 0xfef3bc7900000000, 0x9bf8c51000000000, 0x34e54eab00000000, + 0x51ee37c200000000, 0x2bd8290700000000, 0x4ed3506e00000000, + 0xe1cedbd500000000, 0x84c5a2bc00000000, 0x410db3a500000000, + 0x2406cacc00000000, 0x8b1b417700000000, 0xee10381e00000000, + 0x942626db00000000, 0xf12d5fb200000000, 0x5e30d40900000000, + 0x3b3bad6000000000, 0xeb5a995800000000, 0x8e51e03100000000, + 0x214c6b8a00000000, 0x444712e300000000, 0x3e710c2600000000, + 0x5b7a754f00000000, 0xf467fef400000000, 0x916c879d00000000, + 0x7ef6ddc600000000, 0x1bfda4af00000000, 0xb4e02f1400000000, + 0xd1eb567d00000000, 0xabdd48b800000000, 0xced631d100000000, + 0x61cbba6a00000000, 0x04c0c30300000000, 0xd4a1f73b00000000, + 0xb1aa8e5200000000, 0x1eb705e900000000, 0x7bbc7c8000000000, + 0x018a624500000000, 0x64811b2c00000000, 0xcb9c909700000000, + 0xae97e9fe00000000, 0x6b5ff8e700000000, 0x0e54818e00000000, + 0xa1490a3500000000, 0xc442735c00000000, 0xbe746d9900000000, + 0xdb7f14f000000000, 0x74629f4b00000000, 0x1169e62200000000, + 0xc108d21a00000000, 0xa403ab7300000000, 0x0b1e20c800000000, + 0x6e1559a100000000, 0x1423476400000000, 0x71283e0d00000000, + 0xde35b5b600000000, 0xbb3eccdf00000000, 0xe94e5cd200000000, + 0x8c4525bb00000000, 0x2358ae0000000000, 0x4653d76900000000, + 0x3c65c9ac00000000, 0x596eb0c500000000, 0xf6733b7e00000000, + 0x9378421700000000, 0x4319762f00000000, 0x26120f4600000000, + 0x890f84fd00000000, 0xec04fd9400000000, 0x9632e35100000000, + 0xf3399a3800000000, 0x5c24118300000000, 0x392f68ea00000000, + 0xfce779f300000000, 0x99ec009a00000000, 0x36f18b2100000000, + 0x53faf24800000000, 0x29ccec8d00000000, 0x4cc795e400000000, + 0xe3da1e5f00000000, 0x86d1673600000000, 0x56b0530e00000000, + 0x33bb2a6700000000, 0x9ca6a1dc00000000, 0xf9add8b500000000, + 0x839bc67000000000, 0xe690bf1900000000, 0x498d34a200000000, + 0x2c864dcb00000000, 0xc31c179000000000, 0xa6176ef900000000, + 0x090ae54200000000, 0x6c019c2b00000000, 0x163782ee00000000, + 0x733cfb8700000000, 0xdc21703c00000000, 0xb92a095500000000, + 0x694b3d6d00000000, 0x0c40440400000000, 0xa35dcfbf00000000, + 0xc656b6d600000000, 0xbc60a81300000000, 0xd96bd17a00000000, + 0x76765ac100000000, 0x137d23a800000000, 0xd6b532b100000000, + 0xb3be4bd800000000, 0x1ca3c06300000000, 0x79a8b90a00000000, + 0x039ea7cf00000000, 0x6695dea600000000, 0xc988551d00000000, + 0xac832c7400000000, 0x7ce2184c00000000, 0x19e9612500000000, + 0xb6f4ea9e00000000, 0xd3ff93f700000000, 0xa9c98d3200000000, + 0xccc2f45b00000000, 0x63df7fe000000000, 0x06d4068900000000, + 0xbdeaca5600000000, 0xd8e1b33f00000000, 0x77fc388400000000, + 0x12f741ed00000000, 0x68c15f2800000000, 0x0dca264100000000, + 0xa2d7adfa00000000, 0xc7dcd49300000000, 0x17bde0ab00000000, + 0x72b699c200000000, 0xddab127900000000, 0xb8a06b1000000000, + 0xc29675d500000000, 0xa79d0cbc00000000, 0x0880870700000000, + 0x6d8bfe6e00000000, 0xa843ef7700000000, 0xcd48961e00000000, + 0x62551da500000000, 0x075e64cc00000000, 0x7d687a0900000000, + 0x1863036000000000, 0xb77e88db00000000, 0xd275f1b200000000, + 0x0214c58a00000000, 0x671fbce300000000, 0xc802375800000000, + 0xad094e3100000000, 0xd73f50f400000000, 0xb234299d00000000, + 0x1d29a22600000000, 0x7822db4f00000000, 0x97b8811400000000, + 0xf2b3f87d00000000, 0x5dae73c600000000, 0x38a50aaf00000000, + 0x4293146a00000000, 0x27986d0300000000, 0x8885e6b800000000, + 0xed8e9fd100000000, 0x3defabe900000000, 0x58e4d28000000000, + 0xf7f9593b00000000, 0x92f2205200000000, 0xe8c43e9700000000, + 0x8dcf47fe00000000, 0x22d2cc4500000000, 0x47d9b52c00000000, + 0x8211a43500000000, 0xe71add5c00000000, 0x480756e700000000, + 0x2d0c2f8e00000000, 0x573a314b00000000, 0x3231482200000000, + 0x9d2cc39900000000, 0xf827baf000000000, 0x28468ec800000000, + 0x4d4df7a100000000, 0xe2507c1a00000000, 0x875b057300000000, + 0xfd6d1bb600000000, 0x986662df00000000, 0x377be96400000000, + 0x5270900d00000000}, + {0x0000000000000000, 0xdcecb13d00000000, 0xb8d9637b00000000, + 0x6435d24600000000, 0x70b3c7f600000000, 0xac5f76cb00000000, + 0xc86aa48d00000000, 0x148615b000000000, 0xa160fe3600000000, + 0x7d8c4f0b00000000, 0x19b99d4d00000000, 0xc5552c7000000000, + 0xd1d339c000000000, 0x0d3f88fd00000000, 0x690a5abb00000000, + 0xb5e6eb8600000000, 0x42c1fc6d00000000, 0x9e2d4d5000000000, + 0xfa189f1600000000, 0x26f42e2b00000000, 0x32723b9b00000000, + 0xee9e8aa600000000, 0x8aab58e000000000, 0x5647e9dd00000000, + 0xe3a1025b00000000, 0x3f4db36600000000, 0x5b78612000000000, + 0x8794d01d00000000, 0x9312c5ad00000000, 0x4ffe749000000000, + 0x2bcba6d600000000, 0xf72717eb00000000, 0x8482f9db00000000, + 0x586e48e600000000, 0x3c5b9aa000000000, 0xe0b72b9d00000000, + 0xf4313e2d00000000, 0x28dd8f1000000000, 0x4ce85d5600000000, + 0x9004ec6b00000000, 0x25e207ed00000000, 0xf90eb6d000000000, + 0x9d3b649600000000, 0x41d7d5ab00000000, 0x5551c01b00000000, + 0x89bd712600000000, 0xed88a36000000000, 0x3164125d00000000, + 0xc64305b600000000, 0x1aafb48b00000000, 0x7e9a66cd00000000, + 0xa276d7f000000000, 0xb6f0c24000000000, 0x6a1c737d00000000, + 0x0e29a13b00000000, 0xd2c5100600000000, 0x6723fb8000000000, + 0xbbcf4abd00000000, 0xdffa98fb00000000, 0x031629c600000000, + 0x17903c7600000000, 0xcb7c8d4b00000000, 0xaf495f0d00000000, + 0x73a5ee3000000000, 0x4903826c00000000, 0x95ef335100000000, + 0xf1dae11700000000, 0x2d36502a00000000, 0x39b0459a00000000, + 0xe55cf4a700000000, 0x816926e100000000, 0x5d8597dc00000000, + 0xe8637c5a00000000, 0x348fcd6700000000, 0x50ba1f2100000000, + 0x8c56ae1c00000000, 0x98d0bbac00000000, 0x443c0a9100000000, + 0x2009d8d700000000, 0xfce569ea00000000, 0x0bc27e0100000000, + 0xd72ecf3c00000000, 0xb31b1d7a00000000, 0x6ff7ac4700000000, + 0x7b71b9f700000000, 0xa79d08ca00000000, 0xc3a8da8c00000000, + 0x1f446bb100000000, 0xaaa2803700000000, 0x764e310a00000000, + 0x127be34c00000000, 0xce97527100000000, 0xda1147c100000000, + 0x06fdf6fc00000000, 0x62c824ba00000000, 0xbe24958700000000, + 0xcd817bb700000000, 0x116dca8a00000000, 0x755818cc00000000, + 0xa9b4a9f100000000, 0xbd32bc4100000000, 0x61de0d7c00000000, + 0x05ebdf3a00000000, 0xd9076e0700000000, 0x6ce1858100000000, + 0xb00d34bc00000000, 0xd438e6fa00000000, 0x08d457c700000000, + 0x1c52427700000000, 0xc0bef34a00000000, 0xa48b210c00000000, + 0x7867903100000000, 0x8f4087da00000000, 0x53ac36e700000000, + 0x3799e4a100000000, 0xeb75559c00000000, 0xfff3402c00000000, + 0x231ff11100000000, 0x472a235700000000, 0x9bc6926a00000000, + 0x2e2079ec00000000, 0xf2ccc8d100000000, 0x96f91a9700000000, + 0x4a15abaa00000000, 0x5e93be1a00000000, 0x827f0f2700000000, + 0xe64add6100000000, 0x3aa66c5c00000000, 0x920604d900000000, + 0x4eeab5e400000000, 0x2adf67a200000000, 0xf633d69f00000000, + 0xe2b5c32f00000000, 0x3e59721200000000, 0x5a6ca05400000000, + 0x8680116900000000, 0x3366faef00000000, 0xef8a4bd200000000, + 0x8bbf999400000000, 0x575328a900000000, 0x43d53d1900000000, + 0x9f398c2400000000, 0xfb0c5e6200000000, 0x27e0ef5f00000000, + 0xd0c7f8b400000000, 0x0c2b498900000000, 0x681e9bcf00000000, + 0xb4f22af200000000, 0xa0743f4200000000, 0x7c988e7f00000000, + 0x18ad5c3900000000, 0xc441ed0400000000, 0x71a7068200000000, + 0xad4bb7bf00000000, 0xc97e65f900000000, 0x1592d4c400000000, + 0x0114c17400000000, 0xddf8704900000000, 0xb9cda20f00000000, + 0x6521133200000000, 0x1684fd0200000000, 0xca684c3f00000000, + 0xae5d9e7900000000, 0x72b12f4400000000, 0x66373af400000000, + 0xbadb8bc900000000, 0xdeee598f00000000, 0x0202e8b200000000, + 0xb7e4033400000000, 0x6b08b20900000000, 0x0f3d604f00000000, + 0xd3d1d17200000000, 0xc757c4c200000000, 0x1bbb75ff00000000, + 0x7f8ea7b900000000, 0xa362168400000000, 0x5445016f00000000, + 0x88a9b05200000000, 0xec9c621400000000, 0x3070d32900000000, + 0x24f6c69900000000, 0xf81a77a400000000, 0x9c2fa5e200000000, + 0x40c314df00000000, 0xf525ff5900000000, 0x29c94e6400000000, + 0x4dfc9c2200000000, 0x91102d1f00000000, 0x859638af00000000, + 0x597a899200000000, 0x3d4f5bd400000000, 0xe1a3eae900000000, + 0xdb0586b500000000, 0x07e9378800000000, 0x63dce5ce00000000, + 0xbf3054f300000000, 0xabb6414300000000, 0x775af07e00000000, + 0x136f223800000000, 0xcf83930500000000, 0x7a65788300000000, + 0xa689c9be00000000, 0xc2bc1bf800000000, 0x1e50aac500000000, + 0x0ad6bf7500000000, 0xd63a0e4800000000, 0xb20fdc0e00000000, + 0x6ee36d3300000000, 0x99c47ad800000000, 0x4528cbe500000000, + 0x211d19a300000000, 0xfdf1a89e00000000, 0xe977bd2e00000000, + 0x359b0c1300000000, 0x51aede5500000000, 0x8d426f6800000000, + 0x38a484ee00000000, 0xe44835d300000000, 0x807de79500000000, + 0x5c9156a800000000, 0x4817431800000000, 0x94fbf22500000000, + 0xf0ce206300000000, 0x2c22915e00000000, 0x5f877f6e00000000, + 0x836bce5300000000, 0xe75e1c1500000000, 0x3bb2ad2800000000, + 0x2f34b89800000000, 0xf3d809a500000000, 0x97eddbe300000000, + 0x4b016ade00000000, 0xfee7815800000000, 0x220b306500000000, + 0x463ee22300000000, 0x9ad2531e00000000, 0x8e5446ae00000000, + 0x52b8f79300000000, 0x368d25d500000000, 0xea6194e800000000, + 0x1d46830300000000, 0xc1aa323e00000000, 0xa59fe07800000000, + 0x7973514500000000, 0x6df544f500000000, 0xb119f5c800000000, + 0xd52c278e00000000, 0x09c096b300000000, 0xbc267d3500000000, + 0x60cacc0800000000, 0x04ff1e4e00000000, 0xd813af7300000000, + 0xcc95bac300000000, 0x10790bfe00000000, 0x744cd9b800000000, + 0xa8a0688500000000}}; + +#else /* W == 4 */ + +local const z_crc_t FAR crc_braid_table[][256] = { + {0x00000000, 0x81256527, 0xd93bcc0f, 0x581ea928, 0x69069e5f, + 0xe823fb78, 0xb03d5250, 0x31183777, 0xd20d3cbe, 0x53285999, + 0x0b36f0b1, 0x8a139596, 0xbb0ba2e1, 0x3a2ec7c6, 0x62306eee, + 0xe3150bc9, 0x7f6b7f3d, 0xfe4e1a1a, 0xa650b332, 0x2775d615, + 0x166de162, 0x97488445, 0xcf562d6d, 0x4e73484a, 0xad664383, + 0x2c4326a4, 0x745d8f8c, 0xf578eaab, 0xc460dddc, 0x4545b8fb, + 0x1d5b11d3, 0x9c7e74f4, 0xfed6fe7a, 0x7ff39b5d, 0x27ed3275, + 0xa6c85752, 0x97d06025, 0x16f50502, 0x4eebac2a, 0xcfcec90d, + 0x2cdbc2c4, 0xadfea7e3, 0xf5e00ecb, 0x74c56bec, 0x45dd5c9b, + 0xc4f839bc, 0x9ce69094, 0x1dc3f5b3, 0x81bd8147, 0x0098e460, + 0x58864d48, 0xd9a3286f, 0xe8bb1f18, 0x699e7a3f, 0x3180d317, + 0xb0a5b630, 0x53b0bdf9, 0xd295d8de, 0x8a8b71f6, 0x0bae14d1, + 0x3ab623a6, 0xbb934681, 0xe38defa9, 0x62a88a8e, 0x26dcfab5, + 0xa7f99f92, 0xffe736ba, 0x7ec2539d, 0x4fda64ea, 0xceff01cd, + 0x96e1a8e5, 0x17c4cdc2, 0xf4d1c60b, 0x75f4a32c, 0x2dea0a04, + 0xaccf6f23, 0x9dd75854, 0x1cf23d73, 0x44ec945b, 0xc5c9f17c, + 0x59b78588, 0xd892e0af, 0x808c4987, 0x01a92ca0, 0x30b11bd7, + 0xb1947ef0, 0xe98ad7d8, 0x68afb2ff, 0x8bbab936, 0x0a9fdc11, + 0x52817539, 0xd3a4101e, 0xe2bc2769, 0x6399424e, 0x3b87eb66, + 0xbaa28e41, 0xd80a04cf, 0x592f61e8, 0x0131c8c0, 0x8014ade7, + 0xb10c9a90, 0x3029ffb7, 0x6837569f, 0xe91233b8, 0x0a073871, + 0x8b225d56, 0xd33cf47e, 0x52199159, 0x6301a62e, 0xe224c309, + 0xba3a6a21, 0x3b1f0f06, 0xa7617bf2, 0x26441ed5, 0x7e5ab7fd, + 0xff7fd2da, 0xce67e5ad, 0x4f42808a, 0x175c29a2, 0x96794c85, + 0x756c474c, 0xf449226b, 0xac578b43, 0x2d72ee64, 0x1c6ad913, + 0x9d4fbc34, 0xc551151c, 0x4474703b, 0x4db9f56a, 0xcc9c904d, + 0x94823965, 0x15a75c42, 0x24bf6b35, 0xa59a0e12, 0xfd84a73a, + 0x7ca1c21d, 0x9fb4c9d4, 0x1e91acf3, 0x468f05db, 0xc7aa60fc, + 0xf6b2578b, 0x779732ac, 0x2f899b84, 0xaeacfea3, 0x32d28a57, + 0xb3f7ef70, 0xebe94658, 0x6acc237f, 0x5bd41408, 0xdaf1712f, + 0x82efd807, 0x03cabd20, 0xe0dfb6e9, 0x61fad3ce, 0x39e47ae6, + 0xb8c11fc1, 0x89d928b6, 0x08fc4d91, 0x50e2e4b9, 0xd1c7819e, + 0xb36f0b10, 0x324a6e37, 0x6a54c71f, 0xeb71a238, 0xda69954f, + 0x5b4cf068, 0x03525940, 0x82773c67, 0x616237ae, 0xe0475289, + 0xb859fba1, 0x397c9e86, 0x0864a9f1, 0x8941ccd6, 0xd15f65fe, + 0x507a00d9, 0xcc04742d, 0x4d21110a, 0x153fb822, 0x941add05, + 0xa502ea72, 0x24278f55, 0x7c39267d, 0xfd1c435a, 0x1e094893, + 0x9f2c2db4, 0xc732849c, 0x4617e1bb, 0x770fd6cc, 0xf62ab3eb, + 0xae341ac3, 0x2f117fe4, 0x6b650fdf, 0xea406af8, 0xb25ec3d0, + 0x337ba6f7, 0x02639180, 0x8346f4a7, 0xdb585d8f, 0x5a7d38a8, + 0xb9683361, 0x384d5646, 0x6053ff6e, 0xe1769a49, 0xd06ead3e, + 0x514bc819, 0x09556131, 0x88700416, 0x140e70e2, 0x952b15c5, + 0xcd35bced, 0x4c10d9ca, 0x7d08eebd, 0xfc2d8b9a, 0xa43322b2, + 0x25164795, 0xc6034c5c, 0x4726297b, 0x1f388053, 0x9e1de574, + 0xaf05d203, 0x2e20b724, 0x763e1e0c, 0xf71b7b2b, 0x95b3f1a5, + 0x14969482, 0x4c883daa, 0xcdad588d, 0xfcb56ffa, 0x7d900add, + 0x258ea3f5, 0xa4abc6d2, 0x47becd1b, 0xc69ba83c, 0x9e850114, + 0x1fa06433, 0x2eb85344, 0xaf9d3663, 0xf7839f4b, 0x76a6fa6c, + 0xead88e98, 0x6bfdebbf, 0x33e34297, 0xb2c627b0, 0x83de10c7, + 0x02fb75e0, 0x5ae5dcc8, 0xdbc0b9ef, 0x38d5b226, 0xb9f0d701, + 0xe1ee7e29, 0x60cb1b0e, 0x51d32c79, 0xd0f6495e, 0x88e8e076, + 0x09cd8551}, + {0x00000000, 0x9b73ead4, 0xed96d3e9, 0x76e5393d, 0x005ca193, + 0x9b2f4b47, 0xedca727a, 0x76b998ae, 0x00b94326, 0x9bcaa9f2, + 0xed2f90cf, 0x765c7a1b, 0x00e5e2b5, 0x9b960861, 0xed73315c, + 0x7600db88, 0x0172864c, 0x9a016c98, 0xece455a5, 0x7797bf71, + 0x012e27df, 0x9a5dcd0b, 0xecb8f436, 0x77cb1ee2, 0x01cbc56a, + 0x9ab82fbe, 0xec5d1683, 0x772efc57, 0x019764f9, 0x9ae48e2d, + 0xec01b710, 0x77725dc4, 0x02e50c98, 0x9996e64c, 0xef73df71, + 0x740035a5, 0x02b9ad0b, 0x99ca47df, 0xef2f7ee2, 0x745c9436, + 0x025c4fbe, 0x992fa56a, 0xefca9c57, 0x74b97683, 0x0200ee2d, + 0x997304f9, 0xef963dc4, 0x74e5d710, 0x03978ad4, 0x98e46000, + 0xee01593d, 0x7572b3e9, 0x03cb2b47, 0x98b8c193, 0xee5df8ae, + 0x752e127a, 0x032ec9f2, 0x985d2326, 0xeeb81a1b, 0x75cbf0cf, + 0x03726861, 0x980182b5, 0xeee4bb88, 0x7597515c, 0x05ca1930, + 0x9eb9f3e4, 0xe85ccad9, 0x732f200d, 0x0596b8a3, 0x9ee55277, + 0xe8006b4a, 0x7373819e, 0x05735a16, 0x9e00b0c2, 0xe8e589ff, + 0x7396632b, 0x052ffb85, 0x9e5c1151, 0xe8b9286c, 0x73cac2b8, + 0x04b89f7c, 0x9fcb75a8, 0xe92e4c95, 0x725da641, 0x04e43eef, + 0x9f97d43b, 0xe972ed06, 0x720107d2, 0x0401dc5a, 0x9f72368e, + 0xe9970fb3, 0x72e4e567, 0x045d7dc9, 0x9f2e971d, 0xe9cbae20, + 0x72b844f4, 0x072f15a8, 0x9c5cff7c, 0xeab9c641, 0x71ca2c95, + 0x0773b43b, 0x9c005eef, 0xeae567d2, 0x71968d06, 0x0796568e, + 0x9ce5bc5a, 0xea008567, 0x71736fb3, 0x07caf71d, 0x9cb91dc9, + 0xea5c24f4, 0x712fce20, 0x065d93e4, 0x9d2e7930, 0xebcb400d, + 0x70b8aad9, 0x06013277, 0x9d72d8a3, 0xeb97e19e, 0x70e40b4a, + 0x06e4d0c2, 0x9d973a16, 0xeb72032b, 0x7001e9ff, 0x06b87151, + 0x9dcb9b85, 0xeb2ea2b8, 0x705d486c, 0x0b943260, 0x90e7d8b4, + 0xe602e189, 0x7d710b5d, 0x0bc893f3, 0x90bb7927, 0xe65e401a, + 0x7d2daace, 0x0b2d7146, 0x905e9b92, 0xe6bba2af, 0x7dc8487b, + 0x0b71d0d5, 0x90023a01, 0xe6e7033c, 0x7d94e9e8, 0x0ae6b42c, + 0x91955ef8, 0xe77067c5, 0x7c038d11, 0x0aba15bf, 0x91c9ff6b, + 0xe72cc656, 0x7c5f2c82, 0x0a5ff70a, 0x912c1dde, 0xe7c924e3, + 0x7cbace37, 0x0a035699, 0x9170bc4d, 0xe7958570, 0x7ce66fa4, + 0x09713ef8, 0x9202d42c, 0xe4e7ed11, 0x7f9407c5, 0x092d9f6b, + 0x925e75bf, 0xe4bb4c82, 0x7fc8a656, 0x09c87dde, 0x92bb970a, + 0xe45eae37, 0x7f2d44e3, 0x0994dc4d, 0x92e73699, 0xe4020fa4, + 0x7f71e570, 0x0803b8b4, 0x93705260, 0xe5956b5d, 0x7ee68189, + 0x085f1927, 0x932cf3f3, 0xe5c9cace, 0x7eba201a, 0x08bafb92, + 0x93c91146, 0xe52c287b, 0x7e5fc2af, 0x08e65a01, 0x9395b0d5, + 0xe57089e8, 0x7e03633c, 0x0e5e2b50, 0x952dc184, 0xe3c8f8b9, + 0x78bb126d, 0x0e028ac3, 0x95716017, 0xe394592a, 0x78e7b3fe, + 0x0ee76876, 0x959482a2, 0xe371bb9f, 0x7802514b, 0x0ebbc9e5, + 0x95c82331, 0xe32d1a0c, 0x785ef0d8, 0x0f2cad1c, 0x945f47c8, + 0xe2ba7ef5, 0x79c99421, 0x0f700c8f, 0x9403e65b, 0xe2e6df66, + 0x799535b2, 0x0f95ee3a, 0x94e604ee, 0xe2033dd3, 0x7970d707, + 0x0fc94fa9, 0x94baa57d, 0xe25f9c40, 0x792c7694, 0x0cbb27c8, + 0x97c8cd1c, 0xe12df421, 0x7a5e1ef5, 0x0ce7865b, 0x97946c8f, + 0xe17155b2, 0x7a02bf66, 0x0c0264ee, 0x97718e3a, 0xe194b707, + 0x7ae75dd3, 0x0c5ec57d, 0x972d2fa9, 0xe1c81694, 0x7abbfc40, + 0x0dc9a184, 0x96ba4b50, 0xe05f726d, 0x7b2c98b9, 0x0d950017, + 0x96e6eac3, 0xe003d3fe, 0x7b70392a, 0x0d70e2a2, 0x96030876, + 0xe0e6314b, 0x7b95db9f, 0x0d2c4331, 0x965fa9e5, 0xe0ba90d8, + 0x7bc97a0c}, + {0x00000000, 0x172864c0, 0x2e50c980, 0x3978ad40, 0x5ca19300, + 0x4b89f7c0, 0x72f15a80, 0x65d93e40, 0xb9432600, 0xae6b42c0, + 0x9713ef80, 0x803b8b40, 0xe5e2b500, 0xf2cad1c0, 0xcbb27c80, + 0xdc9a1840, 0xa9f74a41, 0xbedf2e81, 0x87a783c1, 0x908fe701, + 0xf556d941, 0xe27ebd81, 0xdb0610c1, 0xcc2e7401, 0x10b46c41, + 0x079c0881, 0x3ee4a5c1, 0x29ccc101, 0x4c15ff41, 0x5b3d9b81, + 0x624536c1, 0x756d5201, 0x889f92c3, 0x9fb7f603, 0xa6cf5b43, + 0xb1e73f83, 0xd43e01c3, 0xc3166503, 0xfa6ec843, 0xed46ac83, + 0x31dcb4c3, 0x26f4d003, 0x1f8c7d43, 0x08a41983, 0x6d7d27c3, + 0x7a554303, 0x432dee43, 0x54058a83, 0x2168d882, 0x3640bc42, + 0x0f381102, 0x181075c2, 0x7dc94b82, 0x6ae12f42, 0x53998202, + 0x44b1e6c2, 0x982bfe82, 0x8f039a42, 0xb67b3702, 0xa15353c2, + 0xc48a6d82, 0xd3a20942, 0xeadaa402, 0xfdf2c0c2, 0xca4e23c7, + 0xdd664707, 0xe41eea47, 0xf3368e87, 0x96efb0c7, 0x81c7d407, + 0xb8bf7947, 0xaf971d87, 0x730d05c7, 0x64256107, 0x5d5dcc47, + 0x4a75a887, 0x2fac96c7, 0x3884f207, 0x01fc5f47, 0x16d43b87, + 0x63b96986, 0x74910d46, 0x4de9a006, 0x5ac1c4c6, 0x3f18fa86, + 0x28309e46, 0x11483306, 0x066057c6, 0xdafa4f86, 0xcdd22b46, + 0xf4aa8606, 0xe382e2c6, 0x865bdc86, 0x9173b846, 0xa80b1506, + 0xbf2371c6, 0x42d1b104, 0x55f9d5c4, 0x6c817884, 0x7ba91c44, + 0x1e702204, 0x095846c4, 0x3020eb84, 0x27088f44, 0xfb929704, + 0xecbaf3c4, 0xd5c25e84, 0xc2ea3a44, 0xa7330404, 0xb01b60c4, + 0x8963cd84, 0x9e4ba944, 0xeb26fb45, 0xfc0e9f85, 0xc57632c5, + 0xd25e5605, 0xb7876845, 0xa0af0c85, 0x99d7a1c5, 0x8effc505, + 0x5265dd45, 0x454db985, 0x7c3514c5, 0x6b1d7005, 0x0ec44e45, + 0x19ec2a85, 0x209487c5, 0x37bce305, 0x4fed41cf, 0x58c5250f, + 0x61bd884f, 0x7695ec8f, 0x134cd2cf, 0x0464b60f, 0x3d1c1b4f, + 0x2a347f8f, 0xf6ae67cf, 0xe186030f, 0xd8feae4f, 0xcfd6ca8f, + 0xaa0ff4cf, 0xbd27900f, 0x845f3d4f, 0x9377598f, 0xe61a0b8e, + 0xf1326f4e, 0xc84ac20e, 0xdf62a6ce, 0xbabb988e, 0xad93fc4e, + 0x94eb510e, 0x83c335ce, 0x5f592d8e, 0x4871494e, 0x7109e40e, + 0x662180ce, 0x03f8be8e, 0x14d0da4e, 0x2da8770e, 0x3a8013ce, + 0xc772d30c, 0xd05ab7cc, 0xe9221a8c, 0xfe0a7e4c, 0x9bd3400c, + 0x8cfb24cc, 0xb583898c, 0xa2abed4c, 0x7e31f50c, 0x691991cc, + 0x50613c8c, 0x4749584c, 0x2290660c, 0x35b802cc, 0x0cc0af8c, + 0x1be8cb4c, 0x6e85994d, 0x79adfd8d, 0x40d550cd, 0x57fd340d, + 0x32240a4d, 0x250c6e8d, 0x1c74c3cd, 0x0b5ca70d, 0xd7c6bf4d, + 0xc0eedb8d, 0xf99676cd, 0xeebe120d, 0x8b672c4d, 0x9c4f488d, + 0xa537e5cd, 0xb21f810d, 0x85a36208, 0x928b06c8, 0xabf3ab88, + 0xbcdbcf48, 0xd902f108, 0xce2a95c8, 0xf7523888, 0xe07a5c48, + 0x3ce04408, 0x2bc820c8, 0x12b08d88, 0x0598e948, 0x6041d708, + 0x7769b3c8, 0x4e111e88, 0x59397a48, 0x2c542849, 0x3b7c4c89, + 0x0204e1c9, 0x152c8509, 0x70f5bb49, 0x67dddf89, 0x5ea572c9, + 0x498d1609, 0x95170e49, 0x823f6a89, 0xbb47c7c9, 0xac6fa309, + 0xc9b69d49, 0xde9ef989, 0xe7e654c9, 0xf0ce3009, 0x0d3cf0cb, + 0x1a14940b, 0x236c394b, 0x34445d8b, 0x519d63cb, 0x46b5070b, + 0x7fcdaa4b, 0x68e5ce8b, 0xb47fd6cb, 0xa357b20b, 0x9a2f1f4b, + 0x8d077b8b, 0xe8de45cb, 0xfff6210b, 0xc68e8c4b, 0xd1a6e88b, + 0xa4cbba8a, 0xb3e3de4a, 0x8a9b730a, 0x9db317ca, 0xf86a298a, + 0xef424d4a, 0xd63ae00a, 0xc11284ca, 0x1d889c8a, 0x0aa0f84a, + 0x33d8550a, 0x24f031ca, 0x41290f8a, 0x56016b4a, 0x6f79c60a, + 0x7851a2ca}, + {0x00000000, 0x9fda839e, 0xe4c4017d, 0x7b1e82e3, 0x12f904bb, + 0x8d238725, 0xf63d05c6, 0x69e78658, 0x25f20976, 0xba288ae8, + 0xc136080b, 0x5eec8b95, 0x370b0dcd, 0xa8d18e53, 0xd3cf0cb0, + 0x4c158f2e, 0x4be412ec, 0xd43e9172, 0xaf201391, 0x30fa900f, + 0x591d1657, 0xc6c795c9, 0xbdd9172a, 0x220394b4, 0x6e161b9a, + 0xf1cc9804, 0x8ad21ae7, 0x15089979, 0x7cef1f21, 0xe3359cbf, + 0x982b1e5c, 0x07f19dc2, 0x97c825d8, 0x0812a646, 0x730c24a5, + 0xecd6a73b, 0x85312163, 0x1aeba2fd, 0x61f5201e, 0xfe2fa380, + 0xb23a2cae, 0x2de0af30, 0x56fe2dd3, 0xc924ae4d, 0xa0c32815, + 0x3f19ab8b, 0x44072968, 0xdbddaaf6, 0xdc2c3734, 0x43f6b4aa, + 0x38e83649, 0xa732b5d7, 0xced5338f, 0x510fb011, 0x2a1132f2, + 0xb5cbb16c, 0xf9de3e42, 0x6604bddc, 0x1d1a3f3f, 0x82c0bca1, + 0xeb273af9, 0x74fdb967, 0x0fe33b84, 0x9039b81a, 0xf4e14df1, + 0x6b3bce6f, 0x10254c8c, 0x8fffcf12, 0xe618494a, 0x79c2cad4, + 0x02dc4837, 0x9d06cba9, 0xd1134487, 0x4ec9c719, 0x35d745fa, + 0xaa0dc664, 0xc3ea403c, 0x5c30c3a2, 0x272e4141, 0xb8f4c2df, + 0xbf055f1d, 0x20dfdc83, 0x5bc15e60, 0xc41bddfe, 0xadfc5ba6, + 0x3226d838, 0x49385adb, 0xd6e2d945, 0x9af7566b, 0x052dd5f5, + 0x7e335716, 0xe1e9d488, 0x880e52d0, 0x17d4d14e, 0x6cca53ad, + 0xf310d033, 0x63296829, 0xfcf3ebb7, 0x87ed6954, 0x1837eaca, + 0x71d06c92, 0xee0aef0c, 0x95146def, 0x0aceee71, 0x46db615f, + 0xd901e2c1, 0xa21f6022, 0x3dc5e3bc, 0x542265e4, 0xcbf8e67a, + 0xb0e66499, 0x2f3ce707, 0x28cd7ac5, 0xb717f95b, 0xcc097bb8, + 0x53d3f826, 0x3a347e7e, 0xa5eefde0, 0xdef07f03, 0x412afc9d, + 0x0d3f73b3, 0x92e5f02d, 0xe9fb72ce, 0x7621f150, 0x1fc67708, + 0x801cf496, 0xfb027675, 0x64d8f5eb, 0x32b39da3, 0xad691e3d, + 0xd6779cde, 0x49ad1f40, 0x204a9918, 0xbf901a86, 0xc48e9865, + 0x5b541bfb, 0x174194d5, 0x889b174b, 0xf38595a8, 0x6c5f1636, + 0x05b8906e, 0x9a6213f0, 0xe17c9113, 0x7ea6128d, 0x79578f4f, + 0xe68d0cd1, 0x9d938e32, 0x02490dac, 0x6bae8bf4, 0xf474086a, + 0x8f6a8a89, 0x10b00917, 0x5ca58639, 0xc37f05a7, 0xb8618744, + 0x27bb04da, 0x4e5c8282, 0xd186011c, 0xaa9883ff, 0x35420061, + 0xa57bb87b, 0x3aa13be5, 0x41bfb906, 0xde653a98, 0xb782bcc0, + 0x28583f5e, 0x5346bdbd, 0xcc9c3e23, 0x8089b10d, 0x1f533293, + 0x644db070, 0xfb9733ee, 0x9270b5b6, 0x0daa3628, 0x76b4b4cb, + 0xe96e3755, 0xee9faa97, 0x71452909, 0x0a5babea, 0x95812874, + 0xfc66ae2c, 0x63bc2db2, 0x18a2af51, 0x87782ccf, 0xcb6da3e1, + 0x54b7207f, 0x2fa9a29c, 0xb0732102, 0xd994a75a, 0x464e24c4, + 0x3d50a627, 0xa28a25b9, 0xc652d052, 0x598853cc, 0x2296d12f, + 0xbd4c52b1, 0xd4abd4e9, 0x4b715777, 0x306fd594, 0xafb5560a, + 0xe3a0d924, 0x7c7a5aba, 0x0764d859, 0x98be5bc7, 0xf159dd9f, + 0x6e835e01, 0x159ddce2, 0x8a475f7c, 0x8db6c2be, 0x126c4120, + 0x6972c3c3, 0xf6a8405d, 0x9f4fc605, 0x0095459b, 0x7b8bc778, + 0xe45144e6, 0xa844cbc8, 0x379e4856, 0x4c80cab5, 0xd35a492b, + 0xbabdcf73, 0x25674ced, 0x5e79ce0e, 0xc1a34d90, 0x519af58a, + 0xce407614, 0xb55ef4f7, 0x2a847769, 0x4363f131, 0xdcb972af, + 0xa7a7f04c, 0x387d73d2, 0x7468fcfc, 0xebb27f62, 0x90acfd81, + 0x0f767e1f, 0x6691f847, 0xf94b7bd9, 0x8255f93a, 0x1d8f7aa4, + 0x1a7ee766, 0x85a464f8, 0xfebae61b, 0x61606585, 0x0887e3dd, + 0x975d6043, 0xec43e2a0, 0x7399613e, 0x3f8cee10, 0xa0566d8e, + 0xdb48ef6d, 0x44926cf3, 0x2d75eaab, 0xb2af6935, 0xc9b1ebd6, + 0x566b6848}}; + +local const z_word_t FAR crc_braid_big_table[][256] = { + {0x00000000, 0x9e83da9f, 0x7d01c4e4, 0xe3821e7b, 0xbb04f912, + 0x2587238d, 0xc6053df6, 0x5886e769, 0x7609f225, 0xe88a28ba, + 0x0b0836c1, 0x958bec5e, 0xcd0d0b37, 0x538ed1a8, 0xb00ccfd3, + 0x2e8f154c, 0xec12e44b, 0x72913ed4, 0x911320af, 0x0f90fa30, + 0x57161d59, 0xc995c7c6, 0x2a17d9bd, 0xb4940322, 0x9a1b166e, + 0x0498ccf1, 0xe71ad28a, 0x79990815, 0x211fef7c, 0xbf9c35e3, + 0x5c1e2b98, 0xc29df107, 0xd825c897, 0x46a61208, 0xa5240c73, + 0x3ba7d6ec, 0x63213185, 0xfda2eb1a, 0x1e20f561, 0x80a32ffe, + 0xae2c3ab2, 0x30afe02d, 0xd32dfe56, 0x4dae24c9, 0x1528c3a0, + 0x8bab193f, 0x68290744, 0xf6aadddb, 0x34372cdc, 0xaab4f643, + 0x4936e838, 0xd7b532a7, 0x8f33d5ce, 0x11b00f51, 0xf232112a, + 0x6cb1cbb5, 0x423edef9, 0xdcbd0466, 0x3f3f1a1d, 0xa1bcc082, + 0xf93a27eb, 0x67b9fd74, 0x843be30f, 0x1ab83990, 0xf14de1f4, + 0x6fce3b6b, 0x8c4c2510, 0x12cfff8f, 0x4a4918e6, 0xd4cac279, + 0x3748dc02, 0xa9cb069d, 0x874413d1, 0x19c7c94e, 0xfa45d735, + 0x64c60daa, 0x3c40eac3, 0xa2c3305c, 0x41412e27, 0xdfc2f4b8, + 0x1d5f05bf, 0x83dcdf20, 0x605ec15b, 0xfedd1bc4, 0xa65bfcad, + 0x38d82632, 0xdb5a3849, 0x45d9e2d6, 0x6b56f79a, 0xf5d52d05, + 0x1657337e, 0x88d4e9e1, 0xd0520e88, 0x4ed1d417, 0xad53ca6c, + 0x33d010f3, 0x29682963, 0xb7ebf3fc, 0x5469ed87, 0xcaea3718, + 0x926cd071, 0x0cef0aee, 0xef6d1495, 0x71eece0a, 0x5f61db46, + 0xc1e201d9, 0x22601fa2, 0xbce3c53d, 0xe4652254, 0x7ae6f8cb, + 0x9964e6b0, 0x07e73c2f, 0xc57acd28, 0x5bf917b7, 0xb87b09cc, + 0x26f8d353, 0x7e7e343a, 0xe0fdeea5, 0x037ff0de, 0x9dfc2a41, + 0xb3733f0d, 0x2df0e592, 0xce72fbe9, 0x50f12176, 0x0877c61f, + 0x96f41c80, 0x757602fb, 0xebf5d864, 0xa39db332, 0x3d1e69ad, + 0xde9c77d6, 0x401fad49, 0x18994a20, 0x861a90bf, 0x65988ec4, + 0xfb1b545b, 0xd5944117, 0x4b179b88, 0xa89585f3, 0x36165f6c, + 0x6e90b805, 0xf013629a, 0x13917ce1, 0x8d12a67e, 0x4f8f5779, + 0xd10c8de6, 0x328e939d, 0xac0d4902, 0xf48bae6b, 0x6a0874f4, + 0x898a6a8f, 0x1709b010, 0x3986a55c, 0xa7057fc3, 0x448761b8, + 0xda04bb27, 0x82825c4e, 0x1c0186d1, 0xff8398aa, 0x61004235, + 0x7bb87ba5, 0xe53ba13a, 0x06b9bf41, 0x983a65de, 0xc0bc82b7, + 0x5e3f5828, 0xbdbd4653, 0x233e9ccc, 0x0db18980, 0x9332531f, + 0x70b04d64, 0xee3397fb, 0xb6b57092, 0x2836aa0d, 0xcbb4b476, + 0x55376ee9, 0x97aa9fee, 0x09294571, 0xeaab5b0a, 0x74288195, + 0x2cae66fc, 0xb22dbc63, 0x51afa218, 0xcf2c7887, 0xe1a36dcb, + 0x7f20b754, 0x9ca2a92f, 0x022173b0, 0x5aa794d9, 0xc4244e46, + 0x27a6503d, 0xb9258aa2, 0x52d052c6, 0xcc538859, 0x2fd19622, + 0xb1524cbd, 0xe9d4abd4, 0x7757714b, 0x94d56f30, 0x0a56b5af, + 0x24d9a0e3, 0xba5a7a7c, 0x59d86407, 0xc75bbe98, 0x9fdd59f1, + 0x015e836e, 0xe2dc9d15, 0x7c5f478a, 0xbec2b68d, 0x20416c12, + 0xc3c37269, 0x5d40a8f6, 0x05c64f9f, 0x9b459500, 0x78c78b7b, + 0xe64451e4, 0xc8cb44a8, 0x56489e37, 0xb5ca804c, 0x2b495ad3, + 0x73cfbdba, 0xed4c6725, 0x0ece795e, 0x904da3c1, 0x8af59a51, + 0x147640ce, 0xf7f45eb5, 0x6977842a, 0x31f16343, 0xaf72b9dc, + 0x4cf0a7a7, 0xd2737d38, 0xfcfc6874, 0x627fb2eb, 0x81fdac90, + 0x1f7e760f, 0x47f89166, 0xd97b4bf9, 0x3af95582, 0xa47a8f1d, + 0x66e77e1a, 0xf864a485, 0x1be6bafe, 0x85656061, 0xdde38708, + 0x43605d97, 0xa0e243ec, 0x3e619973, 0x10ee8c3f, 0x8e6d56a0, + 0x6def48db, 0xf36c9244, 0xabea752d, 0x3569afb2, 0xd6ebb1c9, + 0x48686b56}, + {0x00000000, 0xc0642817, 0x80c9502e, 0x40ad7839, 0x0093a15c, + 0xc0f7894b, 0x805af172, 0x403ed965, 0x002643b9, 0xc0426bae, + 0x80ef1397, 0x408b3b80, 0x00b5e2e5, 0xc0d1caf2, 0x807cb2cb, + 0x40189adc, 0x414af7a9, 0x812edfbe, 0xc183a787, 0x01e78f90, + 0x41d956f5, 0x81bd7ee2, 0xc11006db, 0x01742ecc, 0x416cb410, + 0x81089c07, 0xc1a5e43e, 0x01c1cc29, 0x41ff154c, 0x819b3d5b, + 0xc1364562, 0x01526d75, 0xc3929f88, 0x03f6b79f, 0x435bcfa6, + 0x833fe7b1, 0xc3013ed4, 0x036516c3, 0x43c86efa, 0x83ac46ed, + 0xc3b4dc31, 0x03d0f426, 0x437d8c1f, 0x8319a408, 0xc3277d6d, + 0x0343557a, 0x43ee2d43, 0x838a0554, 0x82d86821, 0x42bc4036, + 0x0211380f, 0xc2751018, 0x824bc97d, 0x422fe16a, 0x02829953, + 0xc2e6b144, 0x82fe2b98, 0x429a038f, 0x02377bb6, 0xc25353a1, + 0x826d8ac4, 0x4209a2d3, 0x02a4daea, 0xc2c0f2fd, 0xc7234eca, + 0x074766dd, 0x47ea1ee4, 0x878e36f3, 0xc7b0ef96, 0x07d4c781, + 0x4779bfb8, 0x871d97af, 0xc7050d73, 0x07612564, 0x47cc5d5d, + 0x87a8754a, 0xc796ac2f, 0x07f28438, 0x475ffc01, 0x873bd416, + 0x8669b963, 0x460d9174, 0x06a0e94d, 0xc6c4c15a, 0x86fa183f, + 0x469e3028, 0x06334811, 0xc6576006, 0x864ffada, 0x462bd2cd, + 0x0686aaf4, 0xc6e282e3, 0x86dc5b86, 0x46b87391, 0x06150ba8, + 0xc67123bf, 0x04b1d142, 0xc4d5f955, 0x8478816c, 0x441ca97b, + 0x0422701e, 0xc4465809, 0x84eb2030, 0x448f0827, 0x049792fb, + 0xc4f3baec, 0x845ec2d5, 0x443aeac2, 0x040433a7, 0xc4601bb0, + 0x84cd6389, 0x44a94b9e, 0x45fb26eb, 0x859f0efc, 0xc53276c5, + 0x05565ed2, 0x456887b7, 0x850cafa0, 0xc5a1d799, 0x05c5ff8e, + 0x45dd6552, 0x85b94d45, 0xc514357c, 0x05701d6b, 0x454ec40e, + 0x852aec19, 0xc5879420, 0x05e3bc37, 0xcf41ed4f, 0x0f25c558, + 0x4f88bd61, 0x8fec9576, 0xcfd24c13, 0x0fb66404, 0x4f1b1c3d, + 0x8f7f342a, 0xcf67aef6, 0x0f0386e1, 0x4faefed8, 0x8fcad6cf, + 0xcff40faa, 0x0f9027bd, 0x4f3d5f84, 0x8f597793, 0x8e0b1ae6, + 0x4e6f32f1, 0x0ec24ac8, 0xcea662df, 0x8e98bbba, 0x4efc93ad, + 0x0e51eb94, 0xce35c383, 0x8e2d595f, 0x4e497148, 0x0ee40971, + 0xce802166, 0x8ebef803, 0x4edad014, 0x0e77a82d, 0xce13803a, + 0x0cd372c7, 0xccb75ad0, 0x8c1a22e9, 0x4c7e0afe, 0x0c40d39b, + 0xcc24fb8c, 0x8c8983b5, 0x4cedaba2, 0x0cf5317e, 0xcc911969, + 0x8c3c6150, 0x4c584947, 0x0c669022, 0xcc02b835, 0x8cafc00c, + 0x4ccbe81b, 0x4d99856e, 0x8dfdad79, 0xcd50d540, 0x0d34fd57, + 0x4d0a2432, 0x8d6e0c25, 0xcdc3741c, 0x0da75c0b, 0x4dbfc6d7, + 0x8ddbeec0, 0xcd7696f9, 0x0d12beee, 0x4d2c678b, 0x8d484f9c, + 0xcde537a5, 0x0d811fb2, 0x0862a385, 0xc8068b92, 0x88abf3ab, + 0x48cfdbbc, 0x08f102d9, 0xc8952ace, 0x883852f7, 0x485c7ae0, + 0x0844e03c, 0xc820c82b, 0x888db012, 0x48e99805, 0x08d74160, + 0xc8b36977, 0x881e114e, 0x487a3959, 0x4928542c, 0x894c7c3b, + 0xc9e10402, 0x09852c15, 0x49bbf570, 0x89dfdd67, 0xc972a55e, + 0x09168d49, 0x490e1795, 0x896a3f82, 0xc9c747bb, 0x09a36fac, + 0x499db6c9, 0x89f99ede, 0xc954e6e7, 0x0930cef0, 0xcbf03c0d, + 0x0b94141a, 0x4b396c23, 0x8b5d4434, 0xcb639d51, 0x0b07b546, + 0x4baacd7f, 0x8bcee568, 0xcbd67fb4, 0x0bb257a3, 0x4b1f2f9a, + 0x8b7b078d, 0xcb45dee8, 0x0b21f6ff, 0x4b8c8ec6, 0x8be8a6d1, + 0x8abacba4, 0x4adee3b3, 0x0a739b8a, 0xca17b39d, 0x8a296af8, + 0x4a4d42ef, 0x0ae03ad6, 0xca8412c1, 0x8a9c881d, 0x4af8a00a, + 0x0a55d833, 0xca31f024, 0x8a0f2941, 0x4a6b0156, 0x0ac6796f, + 0xcaa25178}, + {0x00000000, 0xd4ea739b, 0xe9d396ed, 0x3d39e576, 0x93a15c00, + 0x474b2f9b, 0x7a72caed, 0xae98b976, 0x2643b900, 0xf2a9ca9b, + 0xcf902fed, 0x1b7a5c76, 0xb5e2e500, 0x6108969b, 0x5c3173ed, + 0x88db0076, 0x4c867201, 0x986c019a, 0xa555e4ec, 0x71bf9777, + 0xdf272e01, 0x0bcd5d9a, 0x36f4b8ec, 0xe21ecb77, 0x6ac5cb01, + 0xbe2fb89a, 0x83165dec, 0x57fc2e77, 0xf9649701, 0x2d8ee49a, + 0x10b701ec, 0xc45d7277, 0x980ce502, 0x4ce69699, 0x71df73ef, + 0xa5350074, 0x0badb902, 0xdf47ca99, 0xe27e2fef, 0x36945c74, + 0xbe4f5c02, 0x6aa52f99, 0x579ccaef, 0x8376b974, 0x2dee0002, + 0xf9047399, 0xc43d96ef, 0x10d7e574, 0xd48a9703, 0x0060e498, + 0x3d5901ee, 0xe9b37275, 0x472bcb03, 0x93c1b898, 0xaef85dee, + 0x7a122e75, 0xf2c92e03, 0x26235d98, 0x1b1ab8ee, 0xcff0cb75, + 0x61687203, 0xb5820198, 0x88bbe4ee, 0x5c519775, 0x3019ca05, + 0xe4f3b99e, 0xd9ca5ce8, 0x0d202f73, 0xa3b89605, 0x7752e59e, + 0x4a6b00e8, 0x9e817373, 0x165a7305, 0xc2b0009e, 0xff89e5e8, + 0x2b639673, 0x85fb2f05, 0x51115c9e, 0x6c28b9e8, 0xb8c2ca73, + 0x7c9fb804, 0xa875cb9f, 0x954c2ee9, 0x41a65d72, 0xef3ee404, + 0x3bd4979f, 0x06ed72e9, 0xd2070172, 0x5adc0104, 0x8e36729f, + 0xb30f97e9, 0x67e5e472, 0xc97d5d04, 0x1d972e9f, 0x20aecbe9, + 0xf444b872, 0xa8152f07, 0x7cff5c9c, 0x41c6b9ea, 0x952cca71, + 0x3bb47307, 0xef5e009c, 0xd267e5ea, 0x068d9671, 0x8e569607, + 0x5abce59c, 0x678500ea, 0xb36f7371, 0x1df7ca07, 0xc91db99c, + 0xf4245cea, 0x20ce2f71, 0xe4935d06, 0x30792e9d, 0x0d40cbeb, + 0xd9aab870, 0x77320106, 0xa3d8729d, 0x9ee197eb, 0x4a0be470, + 0xc2d0e406, 0x163a979d, 0x2b0372eb, 0xffe90170, 0x5171b806, + 0x859bcb9d, 0xb8a22eeb, 0x6c485d70, 0x6032940b, 0xb4d8e790, + 0x89e102e6, 0x5d0b717d, 0xf393c80b, 0x2779bb90, 0x1a405ee6, + 0xceaa2d7d, 0x46712d0b, 0x929b5e90, 0xafa2bbe6, 0x7b48c87d, + 0xd5d0710b, 0x013a0290, 0x3c03e7e6, 0xe8e9947d, 0x2cb4e60a, + 0xf85e9591, 0xc56770e7, 0x118d037c, 0xbf15ba0a, 0x6bffc991, + 0x56c62ce7, 0x822c5f7c, 0x0af75f0a, 0xde1d2c91, 0xe324c9e7, + 0x37ceba7c, 0x9956030a, 0x4dbc7091, 0x708595e7, 0xa46fe67c, + 0xf83e7109, 0x2cd40292, 0x11ede7e4, 0xc507947f, 0x6b9f2d09, + 0xbf755e92, 0x824cbbe4, 0x56a6c87f, 0xde7dc809, 0x0a97bb92, + 0x37ae5ee4, 0xe3442d7f, 0x4ddc9409, 0x9936e792, 0xa40f02e4, + 0x70e5717f, 0xb4b80308, 0x60527093, 0x5d6b95e5, 0x8981e67e, + 0x27195f08, 0xf3f32c93, 0xcecac9e5, 0x1a20ba7e, 0x92fbba08, + 0x4611c993, 0x7b282ce5, 0xafc25f7e, 0x015ae608, 0xd5b09593, + 0xe88970e5, 0x3c63037e, 0x502b5e0e, 0x84c12d95, 0xb9f8c8e3, + 0x6d12bb78, 0xc38a020e, 0x17607195, 0x2a5994e3, 0xfeb3e778, + 0x7668e70e, 0xa2829495, 0x9fbb71e3, 0x4b510278, 0xe5c9bb0e, + 0x3123c895, 0x0c1a2de3, 0xd8f05e78, 0x1cad2c0f, 0xc8475f94, + 0xf57ebae2, 0x2194c979, 0x8f0c700f, 0x5be60394, 0x66dfe6e2, + 0xb2359579, 0x3aee950f, 0xee04e694, 0xd33d03e2, 0x07d77079, + 0xa94fc90f, 0x7da5ba94, 0x409c5fe2, 0x94762c79, 0xc827bb0c, + 0x1ccdc897, 0x21f42de1, 0xf51e5e7a, 0x5b86e70c, 0x8f6c9497, + 0xb25571e1, 0x66bf027a, 0xee64020c, 0x3a8e7197, 0x07b794e1, + 0xd35de77a, 0x7dc55e0c, 0xa92f2d97, 0x9416c8e1, 0x40fcbb7a, + 0x84a1c90d, 0x504bba96, 0x6d725fe0, 0xb9982c7b, 0x1700950d, + 0xc3eae696, 0xfed303e0, 0x2a39707b, 0xa2e2700d, 0x76080396, + 0x4b31e6e0, 0x9fdb957b, 0x31432c0d, 0xe5a95f96, 0xd890bae0, + 0x0c7ac97b}, + {0x00000000, 0x27652581, 0x0fcc3bd9, 0x28a91e58, 0x5f9e0669, + 0x78fb23e8, 0x50523db0, 0x77371831, 0xbe3c0dd2, 0x99592853, + 0xb1f0360b, 0x9695138a, 0xe1a20bbb, 0xc6c72e3a, 0xee6e3062, + 0xc90b15e3, 0x3d7f6b7f, 0x1a1a4efe, 0x32b350a6, 0x15d67527, + 0x62e16d16, 0x45844897, 0x6d2d56cf, 0x4a48734e, 0x834366ad, + 0xa426432c, 0x8c8f5d74, 0xabea78f5, 0xdcdd60c4, 0xfbb84545, + 0xd3115b1d, 0xf4747e9c, 0x7afed6fe, 0x5d9bf37f, 0x7532ed27, + 0x5257c8a6, 0x2560d097, 0x0205f516, 0x2aaceb4e, 0x0dc9cecf, + 0xc4c2db2c, 0xe3a7fead, 0xcb0ee0f5, 0xec6bc574, 0x9b5cdd45, + 0xbc39f8c4, 0x9490e69c, 0xb3f5c31d, 0x4781bd81, 0x60e49800, + 0x484d8658, 0x6f28a3d9, 0x181fbbe8, 0x3f7a9e69, 0x17d38031, + 0x30b6a5b0, 0xf9bdb053, 0xded895d2, 0xf6718b8a, 0xd114ae0b, + 0xa623b63a, 0x814693bb, 0xa9ef8de3, 0x8e8aa862, 0xb5fadc26, + 0x929ff9a7, 0xba36e7ff, 0x9d53c27e, 0xea64da4f, 0xcd01ffce, + 0xe5a8e196, 0xc2cdc417, 0x0bc6d1f4, 0x2ca3f475, 0x040aea2d, + 0x236fcfac, 0x5458d79d, 0x733df21c, 0x5b94ec44, 0x7cf1c9c5, + 0x8885b759, 0xafe092d8, 0x87498c80, 0xa02ca901, 0xd71bb130, + 0xf07e94b1, 0xd8d78ae9, 0xffb2af68, 0x36b9ba8b, 0x11dc9f0a, + 0x39758152, 0x1e10a4d3, 0x6927bce2, 0x4e429963, 0x66eb873b, + 0x418ea2ba, 0xcf040ad8, 0xe8612f59, 0xc0c83101, 0xe7ad1480, + 0x909a0cb1, 0xb7ff2930, 0x9f563768, 0xb83312e9, 0x7138070a, + 0x565d228b, 0x7ef43cd3, 0x59911952, 0x2ea60163, 0x09c324e2, + 0x216a3aba, 0x060f1f3b, 0xf27b61a7, 0xd51e4426, 0xfdb75a7e, + 0xdad27fff, 0xade567ce, 0x8a80424f, 0xa2295c17, 0x854c7996, + 0x4c476c75, 0x6b2249f4, 0x438b57ac, 0x64ee722d, 0x13d96a1c, + 0x34bc4f9d, 0x1c1551c5, 0x3b707444, 0x6af5b94d, 0x4d909ccc, + 0x65398294, 0x425ca715, 0x356bbf24, 0x120e9aa5, 0x3aa784fd, + 0x1dc2a17c, 0xd4c9b49f, 0xf3ac911e, 0xdb058f46, 0xfc60aac7, + 0x8b57b2f6, 0xac329777, 0x849b892f, 0xa3feacae, 0x578ad232, + 0x70eff7b3, 0x5846e9eb, 0x7f23cc6a, 0x0814d45b, 0x2f71f1da, + 0x07d8ef82, 0x20bdca03, 0xe9b6dfe0, 0xced3fa61, 0xe67ae439, + 0xc11fc1b8, 0xb628d989, 0x914dfc08, 0xb9e4e250, 0x9e81c7d1, + 0x100b6fb3, 0x376e4a32, 0x1fc7546a, 0x38a271eb, 0x4f9569da, + 0x68f04c5b, 0x40595203, 0x673c7782, 0xae376261, 0x895247e0, + 0xa1fb59b8, 0x869e7c39, 0xf1a96408, 0xd6cc4189, 0xfe655fd1, + 0xd9007a50, 0x2d7404cc, 0x0a11214d, 0x22b83f15, 0x05dd1a94, + 0x72ea02a5, 0x558f2724, 0x7d26397c, 0x5a431cfd, 0x9348091e, + 0xb42d2c9f, 0x9c8432c7, 0xbbe11746, 0xccd60f77, 0xebb32af6, + 0xc31a34ae, 0xe47f112f, 0xdf0f656b, 0xf86a40ea, 0xd0c35eb2, + 0xf7a67b33, 0x80916302, 0xa7f44683, 0x8f5d58db, 0xa8387d5a, + 0x613368b9, 0x46564d38, 0x6eff5360, 0x499a76e1, 0x3ead6ed0, + 0x19c84b51, 0x31615509, 0x16047088, 0xe2700e14, 0xc5152b95, + 0xedbc35cd, 0xcad9104c, 0xbdee087d, 0x9a8b2dfc, 0xb22233a4, + 0x95471625, 0x5c4c03c6, 0x7b292647, 0x5380381f, 0x74e51d9e, + 0x03d205af, 0x24b7202e, 0x0c1e3e76, 0x2b7b1bf7, 0xa5f1b395, + 0x82949614, 0xaa3d884c, 0x8d58adcd, 0xfa6fb5fc, 0xdd0a907d, + 0xf5a38e25, 0xd2c6aba4, 0x1bcdbe47, 0x3ca89bc6, 0x1401859e, + 0x3364a01f, 0x4453b82e, 0x63369daf, 0x4b9f83f7, 0x6cfaa676, + 0x988ed8ea, 0xbfebfd6b, 0x9742e333, 0xb027c6b2, 0xc710de83, + 0xe075fb02, 0xc8dce55a, 0xefb9c0db, 0x26b2d538, 0x01d7f0b9, + 0x297eeee1, 0x0e1bcb60, 0x792cd351, 0x5e49f6d0, 0x76e0e888, + 0x5185cd09}}; + +#endif + +#endif + +#endif + +local const z_crc_t FAR x2n_table[] = { + 0x40000000, 0x20000000, 0x08000000, 0x00800000, 0x00008000, + 0xedb88320, 0xb1e6b092, 0xa06a2517, 0xed627dae, 0x88d14467, + 0xd7bbfe6a, 0xec447f11, 0x8e7ea170, 0x6427800e, 0x4d47bae0, + 0x09fe548f, 0x83852d0f, 0x30362f1a, 0x7b5a9cc3, 0x31fec169, + 0x9fec022a, 0x6c8dedc4, 0x15d6874d, 0x5fde7a4e, 0xbad90e37, + 0x2e4e5eef, 0x4eaba214, 0xa8a472c0, 0x429a969e, 0x148d302a, + 0xc40ba6d0, 0xc4e22c3c}; diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/deflate.c mame-0.243+dfsg.1/3rdparty/zlib/deflate.c --- mame-0.242+dfsg.1/3rdparty/zlib/deflate.c 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/deflate.c 2022-04-29 05:37:26.000000000 +0000 @@ -1,5 +1,5 @@ /* deflate.c -- compress data using the deflation algorithm - * Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler + * Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -52,7 +52,7 @@ #include "deflate.h" const char deflate_copyright[] = - " deflate 1.2.11 Copyright 1995-2017 Jean-loup Gailly and Mark Adler "; + " deflate 1.2.12 Copyright 1995-2022 Jean-loup Gailly and Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot @@ -190,8 +190,11 @@ * prev[] will be initialized on the fly. */ #define CLEAR_HASH(s) \ - s->head[s->hash_size-1] = NIL; \ - zmemzero((Bytef *)s->head, (unsigned)(s->hash_size-1)*sizeof(*s->head)); + do { \ + s->head[s->hash_size-1] = NIL; \ + zmemzero((Bytef *)s->head, \ + (unsigned)(s->hash_size-1)*sizeof(*s->head)); \ + } while (0) /* =========================================================================== * Slide the hash table when sliding the window down (could be avoided with 32 @@ -252,11 +255,6 @@ int wrap = 1; static const char my_version[] = ZLIB_VERSION; - ushf *overlay; - /* We overlay pending_buf and d_buf+l_buf. This works since the average - * output size for (length,distance) codes is <= 24 bits. - */ - if (version == Z_NULL || version[0] != my_version[0] || stream_size != sizeof(z_stream)) { return Z_VERSION_ERROR; @@ -326,9 +324,47 @@ s->lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */ - overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2); - s->pending_buf = (uchf *) overlay; - s->pending_buf_size = (ulg)s->lit_bufsize * (sizeof(ush)+2L); + /* We overlay pending_buf and sym_buf. This works since the average size + * for length/distance pairs over any compressed block is assured to be 31 + * bits or less. + * + * Analysis: The longest fixed codes are a length code of 8 bits plus 5 + * extra bits, for lengths 131 to 257. The longest fixed distance codes are + * 5 bits plus 13 extra bits, for distances 16385 to 32768. The longest + * possible fixed-codes length/distance pair is then 31 bits total. + * + * sym_buf starts one-fourth of the way into pending_buf. So there are + * three bytes in sym_buf for every four bytes in pending_buf. Each symbol + * in sym_buf is three bytes -- two for the distance and one for the + * literal/length. As each symbol is consumed, the pointer to the next + * sym_buf value to read moves forward three bytes. From that symbol, up to + * 31 bits are written to pending_buf. The closest the written pending_buf + * bits gets to the next sym_buf symbol to read is just before the last + * code is written. At that time, 31*(n-2) bits have been written, just + * after 24*(n-2) bits have been consumed from sym_buf. sym_buf starts at + * 8*n bits into pending_buf. (Note that the symbol buffer fills when n-1 + * symbols are written.) The closest the writing gets to what is unread is + * then n+14 bits. Here n is lit_bufsize, which is 16384 by default, and + * can range from 128 to 32768. + * + * Therefore, at a minimum, there are 142 bits of space between what is + * written and what is read in the overlain buffers, so the symbols cannot + * be overwritten by the compressed data. That space is actually 139 bits, + * due to the three-bit fixed-code block header. + * + * That covers the case where either Z_FIXED is specified, forcing fixed + * codes, or when the use of fixed codes is chosen, because that choice + * results in a smaller compressed block than dynamic codes. That latter + * condition then assures that the above analysis also covers all dynamic + * blocks. A dynamic-code block will only be chosen to be emitted if it has + * fewer bits than a fixed-code block would for the same set of symbols. + * Therefore its average symbol length is assured to be less than 31. So + * the compressed data for a dynamic block also cannot overwrite the + * symbols from which it is being constructed. + */ + + s->pending_buf = (uchf *) ZALLOC(strm, s->lit_bufsize, 4); + s->pending_buf_size = (ulg)s->lit_bufsize * 4; if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL || s->pending_buf == Z_NULL) { @@ -337,8 +373,12 @@ deflateEnd (strm); return Z_MEM_ERROR; } - s->d_buf = overlay + s->lit_bufsize/sizeof(ush); - s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize; + s->sym_buf = s->pending_buf + s->lit_bufsize; + s->sym_end = (s->lit_bufsize - 1) * 3; + /* We avoid equality with lit_bufsize*3 because of wraparound at 64K + * on 16 bit machines and because stored blocks are restricted to + * 64K-1 bytes. + */ s->level = level; s->strategy = strategy; @@ -488,13 +528,13 @@ #ifdef GZIP s->wrap == 2 ? GZIP_STATE : #endif - s->wrap ? INIT_STATE : BUSY_STATE; + INIT_STATE; strm->adler = #ifdef GZIP s->wrap == 2 ? crc32(0L, Z_NULL, 0) : #endif adler32(0L, Z_NULL, 0); - s->last_flush = Z_NO_FLUSH; + s->last_flush = -2; _tr_init(s); @@ -549,7 +589,8 @@ if (deflateStateCheck(strm)) return Z_STREAM_ERROR; s = strm->state; - if ((Bytef *)(s->d_buf) < s->pending_out + ((Buf_size + 7) >> 3)) + if (bits < 0 || bits > 16 || + s->sym_buf < s->pending_out + ((Buf_size + 7) >> 3)) return Z_BUF_ERROR; do { put = Buf_size - s->bi_valid; @@ -587,12 +628,12 @@ func = configuration_table[s->level].func; if ((strategy != s->strategy || func != configuration_table[level].func) && - s->high_water) { + s->last_flush != -2) { /* Flush the last buffer: */ int err = deflate(strm, Z_BLOCK); if (err == Z_STREAM_ERROR) return err; - if (strm->avail_out == 0) + if (strm->avail_in || (s->strstart - s->block_start) + s->lookahead) return Z_BUF_ERROR; } if (s->level != level) { @@ -811,6 +852,8 @@ } /* Write the header */ + if (s->status == INIT_STATE && s->wrap == 0) + s->status = BUSY_STATE; if (s->status == INIT_STATE) { /* zlib header */ uInt header = (Z_DEFLATED + ((s->w_bits-8)<<4)) << 8; @@ -1108,7 +1151,6 @@ #else deflate_state *ds; deflate_state *ss; - ushf *overlay; if (deflateStateCheck(source) || dest == Z_NULL) { @@ -1128,8 +1170,7 @@ ds->window = (Bytef *) ZALLOC(dest, ds->w_size, 2*sizeof(Byte)); ds->prev = (Posf *) ZALLOC(dest, ds->w_size, sizeof(Pos)); ds->head = (Posf *) ZALLOC(dest, ds->hash_size, sizeof(Pos)); - overlay = (ushf *) ZALLOC(dest, ds->lit_bufsize, sizeof(ush)+2); - ds->pending_buf = (uchf *) overlay; + ds->pending_buf = (uchf *) ZALLOC(dest, ds->lit_bufsize, 4); if (ds->window == Z_NULL || ds->prev == Z_NULL || ds->head == Z_NULL || ds->pending_buf == Z_NULL) { @@ -1143,8 +1184,7 @@ zmemcpy(ds->pending_buf, ss->pending_buf, (uInt)ds->pending_buf_size); ds->pending_out = ds->pending_buf + (ss->pending_out - ss->pending_buf); - ds->d_buf = overlay + ds->lit_bufsize/sizeof(ush); - ds->l_buf = ds->pending_buf + (1+sizeof(ush))*ds->lit_bufsize; + ds->sym_buf = ds->pending_buf + ds->lit_bufsize; ds->l_desc.dyn_tree = ds->dyn_ltree; ds->d_desc.dyn_tree = ds->dyn_dtree; @@ -1513,6 +1553,8 @@ s->match_start -= wsize; s->strstart -= wsize; /* we now have strstart >= MAX_DIST */ s->block_start -= (long) wsize; + if (s->insert > s->strstart) + s->insert = s->strstart; slide_hash(s); more += wsize; } @@ -1742,6 +1784,7 @@ s->matches = 2; /* clear hash */ zmemcpy(s->window, s->strm->next_in - s->w_size, s->w_size); s->strstart = s->w_size; + s->insert = s->strstart; } else { if (s->window_size - s->strstart <= used) { @@ -1750,12 +1793,14 @@ zmemcpy(s->window, s->window + s->w_size, s->strstart); if (s->matches < 2) s->matches++; /* add a pending slide_hash() */ + if (s->insert > s->strstart) + s->insert = s->strstart; } zmemcpy(s->window + s->strstart, s->strm->next_in - used, used); s->strstart += used; + s->insert += MIN(used, s->w_size - s->insert); } s->block_start = s->strstart; - s->insert += MIN(used, s->w_size - s->insert); } if (s->high_water < s->strstart) s->high_water = s->strstart; @@ -1770,7 +1815,7 @@ return block_done; /* Fill the window with any remaining input. */ - have = s->window_size - s->strstart - 1; + have = s->window_size - s->strstart; if (s->strm->avail_in > have && s->block_start >= (long)s->w_size) { /* Slide the window down. */ s->block_start -= s->w_size; @@ -1779,12 +1824,15 @@ if (s->matches < 2) s->matches++; /* add a pending slide_hash() */ have += s->w_size; /* more space now */ + if (s->insert > s->strstart) + s->insert = s->strstart; } if (have > s->strm->avail_in) have = s->strm->avail_in; if (have) { read_buf(s->strm, s->window + s->strstart, have); s->strstart += have; + s->insert += MIN(have, s->w_size - s->insert); } if (s->high_water < s->strstart) s->high_water = s->strstart; @@ -1912,7 +1960,7 @@ FLUSH_BLOCK(s, 1); return finish_done; } - if (s->last_lit) + if (s->sym_next) FLUSH_BLOCK(s, 0); return block_done; } @@ -2043,7 +2091,7 @@ FLUSH_BLOCK(s, 1); return finish_done; } - if (s->last_lit) + if (s->sym_next) FLUSH_BLOCK(s, 0); return block_done; } @@ -2118,7 +2166,7 @@ FLUSH_BLOCK(s, 1); return finish_done; } - if (s->last_lit) + if (s->sym_next) FLUSH_BLOCK(s, 0); return block_done; } @@ -2157,7 +2205,7 @@ FLUSH_BLOCK(s, 1); return finish_done; } - if (s->last_lit) + if (s->sym_next) FLUSH_BLOCK(s, 0); return block_done; } diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/deflate.h mame-0.243+dfsg.1/3rdparty/zlib/deflate.h --- mame-0.242+dfsg.1/3rdparty/zlib/deflate.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/deflate.h 2022-04-29 05:37:26.000000000 +0000 @@ -1,5 +1,5 @@ /* deflate.h -- internal compression state - * Copyright (C) 1995-2016 Jean-loup Gailly + * Copyright (C) 1995-2018 Jean-loup Gailly * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -217,7 +217,7 @@ /* Depth of each subtree used as tie breaker for trees of equal frequency */ - uchf *l_buf; /* buffer for literals or lengths */ + uchf *sym_buf; /* buffer for distances and literals/lengths */ uInt lit_bufsize; /* Size of match buffer for literals/lengths. There are 4 reasons for @@ -239,13 +239,8 @@ * - I can't count above 4 */ - uInt last_lit; /* running index in l_buf */ - - ushf *d_buf; - /* Buffer for distances. To simplify the code, d_buf and l_buf have - * the same number of elements. To use different lengths, an extra flag - * array would be necessary. - */ + uInt sym_next; /* running index in sym_buf */ + uInt sym_end; /* symbol table full when sym_next reaches this */ ulg opt_len; /* bit length of current block with optimal trees */ ulg static_len; /* bit length of current block with static trees */ @@ -325,20 +320,22 @@ # define _tr_tally_lit(s, c, flush) \ { uch cc = (c); \ - s->d_buf[s->last_lit] = 0; \ - s->l_buf[s->last_lit++] = cc; \ + s->sym_buf[s->sym_next++] = 0; \ + s->sym_buf[s->sym_next++] = 0; \ + s->sym_buf[s->sym_next++] = cc; \ s->dyn_ltree[cc].Freq++; \ - flush = (s->last_lit == s->lit_bufsize-1); \ + flush = (s->sym_next == s->sym_end); \ } # define _tr_tally_dist(s, distance, length, flush) \ { uch len = (uch)(length); \ ush dist = (ush)(distance); \ - s->d_buf[s->last_lit] = dist; \ - s->l_buf[s->last_lit++] = len; \ + s->sym_buf[s->sym_next++] = dist; \ + s->sym_buf[s->sym_next++] = dist >> 8; \ + s->sym_buf[s->sym_next++] = len; \ dist--; \ s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \ s->dyn_dtree[d_code(dist)].Freq++; \ - flush = (s->last_lit == s->lit_bufsize-1); \ + flush = (s->sym_next == s->sym_end); \ } #else # define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c) Binary files /tmp/tmpaxne9i8m/fOJLViudrj/mame-0.242+dfsg.1/3rdparty/zlib/doc/crc-doc.1.0.pdf and /tmp/tmpaxne9i8m/sRTM7IrWu_/mame-0.243+dfsg.1/3rdparty/zlib/doc/crc-doc.1.0.pdf differ diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/doc/txtvsbin.txt mame-0.243+dfsg.1/3rdparty/zlib/doc/txtvsbin.txt --- mame-0.242+dfsg.1/3rdparty/zlib/doc/txtvsbin.txt 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/doc/txtvsbin.txt 2022-04-29 05:37:26.000000000 +0000 @@ -38,15 +38,15 @@ The algorithm works by dividing the set of bytecodes [0..255] into three categories: -- The white list of textual bytecodes: +- The allow list of textual bytecodes: 9 (TAB), 10 (LF), 13 (CR), 32 (SPACE) to 255. - The gray list of tolerated bytecodes: 7 (BEL), 8 (BS), 11 (VT), 12 (FF), 26 (SUB), 27 (ESC). -- The black list of undesired, non-textual bytecodes: +- The block list of undesired, non-textual bytecodes: 0 (NUL) to 6, 14 to 31. -If a file contains at least one byte that belongs to the white list and -no byte that belongs to the black list, then the file is categorized as +If a file contains at least one byte that belongs to the allow list and +no byte that belongs to the block list, then the file is categorized as plain text; otherwise, it is categorized as binary. (The boundary case, when the file is empty, automatically falls into the latter category.) @@ -84,9 +84,9 @@ results on a text encoded, say, using ISO-8859-16 versus UTF-8.) There is an extra category of plain text files that are "polluted" with -one or more black-listed codes, either by mistake or by peculiar design +one or more block-listed codes, either by mistake or by peculiar design considerations. In such cases, a scheme that tolerates a small fraction -of black-listed codes would provide an increased recall (i.e. more true +of block-listed codes would provide an increased recall (i.e. more true positives). This, however, incurs a reduced precision overall, since false positives are more likely to appear in binary files that contain large chunks of textual data. Furthermore, "polluted" plain text should diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/examples/enough.c mame-0.243+dfsg.1/3rdparty/zlib/examples/enough.c --- mame-0.242+dfsg.1/3rdparty/zlib/examples/enough.c 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/examples/enough.c 2022-04-29 05:37:26.000000000 +0000 @@ -1,7 +1,7 @@ /* enough.c -- determine the maximum size of inflate's Huffman code tables over - * all possible valid and complete Huffman codes, subject to a length limit. - * Copyright (C) 2007, 2008, 2012 Mark Adler - * Version 1.4 18 August 2012 Mark Adler + * all possible valid and complete prefix codes, subject to a length limit. + * Copyright (C) 2007, 2008, 2012, 2018 Mark Adler + * Version 1.5 5 August 2018 Mark Adler */ /* Version history: @@ -17,101 +17,107 @@ 1.4 18 Aug 2012 Avoid shifts more than bits in type (caused endless loop!) Clean up comparisons of different types Clean up code indentation + 1.5 5 Aug 2018 Clean up code style, formatting, and comments + Show all the codes for the maximum, and only the maximum */ /* - Examine all possible Huffman codes for a given number of symbols and a - maximum code length in bits to determine the maximum table size for zilb's - inflate. Only complete Huffman codes are counted. + Examine all possible prefix codes for a given number of symbols and a + maximum code length in bits to determine the maximum table size for zlib's + inflate. Only complete prefix codes are counted. Two codes are considered distinct if the vectors of the number of codes per - length are not identical. So permutations of the symbol assignments result + length are not identical. So permutations of the symbol assignments result in the same code for the counting, as do permutations of the assignments of the bit values to the codes (i.e. only canonical codes are counted). We build a code from shorter to longer lengths, determining how many symbols - are coded at each length. At each step, we have how many symbols remain to + are coded at each length. At each step, we have how many symbols remain to be coded, what the last code length used was, and how many bit patterns of that length remain unused. Then we add one to the code length and double the - number of unused patterns to graduate to the next code length. We then + number of unused patterns to graduate to the next code length. We then assign all portions of the remaining symbols to that code length that - preserve the properties of a correct and eventually complete code. Those + preserve the properties of a correct and eventually complete code. Those properties are: we cannot use more bit patterns than are available; and when - all the symbols are used, there are exactly zero possible bit patterns - remaining. + all the symbols are used, there are exactly zero possible bit patterns left + unused. The inflate Huffman decoding algorithm uses two-level lookup tables for - speed. There is a single first-level table to decode codes up to root bits - in length (root == 9 in the current inflate implementation). The table - has 1 << root entries and is indexed by the next root bits of input. Codes - shorter than root bits have replicated table entries, so that the correct - entry is pointed to regardless of the bits that follow the short code. If - the code is longer than root bits, then the table entry points to a second- - level table. The size of that table is determined by the longest code with - that root-bit prefix. If that longest code has length len, then the table - has size 1 << (len - root), to index the remaining bits in that set of - codes. Each subsequent root-bit prefix then has its own sub-table. The - total number of table entries required by the code is calculated - incrementally as the number of codes at each bit length is populated. When - all of the codes are shorter than root bits, then root is reduced to the - longest code length, resulting in a single, smaller, one-level table. + speed. There is a single first-level table to decode codes up to root bits + in length (root == 9 for literal/length codes and root == 6 for distance + codes, in the current inflate implementation). The base table has 1 << root + entries and is indexed by the next root bits of input. Codes shorter than + root bits have replicated table entries, so that the correct entry is + pointed to regardless of the bits that follow the short code. If the code is + longer than root bits, then the table entry points to a second-level table. + The size of that table is determined by the longest code with that root-bit + prefix. If that longest code has length len, then the table has size 1 << + (len - root), to index the remaining bits in that set of codes. Each + subsequent root-bit prefix then has its own sub-table. The total number of + table entries required by the code is calculated incrementally as the number + of codes at each bit length is populated. When all of the codes are shorter + than root bits, then root is reduced to the longest code length, resulting + in a single, smaller, one-level table. The inflate algorithm also provides for small values of root (relative to the log2 of the number of symbols), where the shortest code has more bits - than root. In that case, root is increased to the length of the shortest - code. This program, by design, does not handle that case, so it is verified - that the number of symbols is less than 2^(root + 1). + than root. In that case, root is increased to the length of the shortest + code. This program, by design, does not handle that case, so it is verified + that the number of symbols is less than 1 << (root + 1). In order to speed up the examination (by about ten orders of magnitude for the default arguments), the intermediate states in the build-up of a code - are remembered and previously visited branches are pruned. The memory + are remembered and previously visited branches are pruned. The memory required for this will increase rapidly with the total number of symbols and - the maximum code length in bits. However this is a very small price to pay + the maximum code length in bits. However this is a very small price to pay for the vast speedup. - First, all of the possible Huffman codes are counted, and reachable + First, all of the possible prefix codes are counted, and reachable intermediate states are noted by a non-zero count in a saved-results array. Second, the intermediate states that lead to (root + 1) bit or longer codes are used to look at all sub-codes from those junctures for their inflate - memory usage. (The amount of memory used is not affected by the number of + memory usage. (The amount of memory used is not affected by the number of codes of root bits or less in length.) Third, the visited states in the construction of those sub-codes and the associated calculation of the table size is recalled in order to avoid recalculating from the same juncture. Beginning the code examination at (root + 1) bit codes, which is enabled by identifying the reachable nodes, accounts for about six of the orders of - magnitude of improvement for the default arguments. About another four - orders of magnitude come from not revisiting previous states. Out of - approximately 2x10^16 possible Huffman codes, only about 2x10^6 sub-codes + magnitude of improvement for the default arguments. About another four + orders of magnitude come from not revisiting previous states. Out of + approximately 2x10^16 possible prefix codes, only about 2x10^6 sub-codes need to be examined to cover all of the possible table memory usage cases for the default arguments of 286 symbols limited to 15-bit codes. - Note that an unsigned long long type is used for counting. It is quite easy - to exceed the capacity of an eight-byte integer with a large number of - symbols and a large maximum code length, so multiple-precision arithmetic - would need to replace the unsigned long long arithmetic in that case. This - program will abort if an overflow occurs. The big_t type identifies where - the counting takes place. - - An unsigned long long type is also used for calculating the number of - possible codes remaining at the maximum length. This limits the maximum - code length to the number of bits in a long long minus the number of bits - needed to represent the symbols in a flat code. The code_t type identifies - where the bit pattern counting takes place. + Note that the uintmax_t type is used for counting. It is quite easy to + exceed the capacity of an eight-byte integer with a large number of symbols + and a large maximum code length, so multiple-precision arithmetic would need + to replace the integer arithmetic in that case. This program will abort if + an overflow occurs. The big_t type identifies where the counting takes + place. + + The uintmax_t type is also used for calculating the number of possible codes + remaining at the maximum length. This limits the maximum code length to the + number of bits in a long long minus the number of bits needed to represent + the symbols in a flat code. The code_t type identifies where the bit-pattern + counting takes place. */ #include #include #include +#include +#include #include #define local static -/* special data types */ -typedef unsigned long long big_t; /* type for code counting */ -typedef unsigned long long code_t; /* type for bit pattern counting */ -struct tab { /* type for been here check */ - size_t len; /* length of bit vector in char's */ - char *vec; /* allocated bit vector */ +// Special data types. +typedef uintmax_t big_t; // type for code counting +#define PRIbig "ju" // printf format for big_t +typedef uintmax_t code_t; // type for bit pattern counting +struct tab { // type for been-here check + size_t len; // allocated length of bit vector in octets + char *vec; // allocated bit vector }; /* The array for saving results, num[], is indexed with this triplet: @@ -126,447 +132,466 @@ left: 2..syms - 1, but only the evens (so syms == 8 -> 2, 4, 6) len: 1..max - 1 (max == maximum code length in bits) - syms == 2 is not saved since that immediately leads to a single code. left + syms == 2 is not saved since that immediately leads to a single code. left must be even, since it represents the number of available bit patterns at - the current length, which is double the number at the previous length. - left ends at syms-1 since left == syms immediately results in a single code. + the current length, which is double the number at the previous length. left + ends at syms-1 since left == syms immediately results in a single code. (left > sym is not allowed since that would result in an incomplete code.) len is less than max, since the code completes immediately when len == max. - The offset into the array is calculated for the three indices with the - first one (syms) being outermost, and the last one (len) being innermost. - We build the array with length max-1 lists for the len index, with syms-3 - of those for each symbol. There are totsym-2 of those, with each one - varying in length as a function of sym. See the calculation of index in - count() for the index, and the calculation of size in main() for the size - of the array. + The offset into the array is calculated for the three indices with the first + one (syms) being outermost, and the last one (len) being innermost. We build + the array with length max-1 lists for the len index, with syms-3 of those + for each symbol. There are totsym-2 of those, with each one varying in + length as a function of sym. See the calculation of index in map() for the + index, and the calculation of size in main() for the size of the array. For the deflate example of 286 symbols limited to 15-bit codes, the array - has 284,284 entries, taking up 2.17 MB for an 8-byte big_t. More than - half of the space allocated for saved results is actually used -- not all - possible triplets are reached in the generation of valid Huffman codes. + has 284,284 entries, taking up 2.17 MB for an 8-byte big_t. More than half + of the space allocated for saved results is actually used -- not all + possible triplets are reached in the generation of valid prefix codes. */ /* The array for tracking visited states, done[], is itself indexed identically to the num[] array as described above for the (syms, left, len) triplet. Each element in the array is further indexed by the (mem, rem) doublet, where mem is the amount of inflate table space used so far, and rem is the - remaining unused entries in the current inflate sub-table. Each indexed + remaining unused entries in the current inflate sub-table. Each indexed element is simply one bit indicating whether the state has been visited or - not. Since the ranges for mem and rem are not known a priori, each bit + not. Since the ranges for mem and rem are not known a priori, each bit vector is of a variable size, and grows as needed to accommodate the visited - states. mem and rem are used to calculate a single index in a triangular - array. Since the range of mem is expected in the default case to be about + states. mem and rem are used to calculate a single index in a triangular + array. Since the range of mem is expected in the default case to be about ten times larger than the range of rem, the array is skewed to reduce the - memory usage, with eight times the range for mem than for rem. See the - calculations for offset and bit in beenhere() for the details. + memory usage, with eight times the range for mem than for rem. See the + calculations for offset and bit in been_here() for the details. For the deflate example of 286 symbols limited to 15-bit codes, the bit - vectors grow to total approximately 21 MB, in addition to the 4.3 MB done[] - array itself. + vectors grow to total 5.5 MB, in addition to the 4.3 MB done array itself. */ -/* Globals to avoid propagating constants or constant pointers recursively */ -local int max; /* maximum allowed bit length for the codes */ -local int root; /* size of base code table in bits */ -local int large; /* largest code table so far */ -local size_t size; /* number of elements in num and done */ -local int *code; /* number of symbols assigned to each bit length */ -local big_t *num; /* saved results array for code counting */ -local struct tab *done; /* states already evaluated array */ - -/* Index function for num[] and done[] */ -#define INDEX(i,j,k) (((size_t)((i-1)>>1)*((i-2)>>1)+(j>>1)-1)*(max-1)+k-1) - -/* Free allocated space. Uses globals code, num, and done. */ -local void cleanup(void) -{ - size_t n; - - if (done != NULL) { - for (n = 0; n < size; n++) - if (done[n].len) - free(done[n].vec); - free(done); - } - if (num != NULL) - free(num); - if (code != NULL) - free(code); -} - -/* Return the number of possible Huffman codes using bit patterns of lengths - len through max inclusive, coding syms symbols, with left bit patterns of - length len unused -- return -1 if there is an overflow in the counting. - Keep a record of previous results in num to prevent repeating the same - calculation. Uses the globals max and num. */ -local big_t count(int syms, int len, int left) -{ - big_t sum; /* number of possible codes from this juncture */ - big_t got; /* value returned from count() */ - int least; /* least number of syms to use at this juncture */ - int most; /* most number of syms to use at this juncture */ - int use; /* number of bit patterns to use in next call */ - size_t index; /* index of this case in *num */ +// Type for a variable-length, allocated string. +typedef struct { + char *str; // pointer to allocated string + size_t size; // size of allocation + size_t len; // length of string, not including terminating zero +} string_t; + +// Clear a string_t. +local void string_clear(string_t *s) { + s->str[0] = 0; + s->len = 0; +} + +// Initialize a string_t. +local void string_init(string_t *s) { + s->size = 16; + s->str = malloc(s->size); + assert(s->str != NULL && "out of memory"); + string_clear(s); +} + +// Release the allocation of a string_t. +local void string_free(string_t *s) { + free(s->str); + s->str = NULL; + s->size = 0; + s->len = 0; +} + +// Save the results of printf with fmt and the subsequent argument list to s. +// Each call appends to s. The allocated space for s is increased as needed. +local void string_printf(string_t *s, char *fmt, ...) { + va_list ap; + va_start(ap, fmt); + size_t len = s->len; + int ret = vsnprintf(s->str + len, s->size - len, fmt, ap); + assert(ret >= 0 && "out of memory"); + s->len += ret; + if (s->size < s->len + 1) { + do { + s->size <<= 1; + assert(s->size != 0 && "overflow"); + } while (s->size < s->len + 1); + s->str = realloc(s->str, s->size); + assert(s->str != NULL && "out of memory"); + vsnprintf(s->str + len, s->size - len, fmt, ap); + } + va_end(ap); +} - /* see if only one possible code */ +// Globals to avoid propagating constants or constant pointers recursively. +struct { + int max; // maximum allowed bit length for the codes + int root; // size of base code table in bits + int large; // largest code table so far + size_t size; // number of elements in num and done + big_t tot; // total number of codes with maximum tables size + string_t out; // display of subcodes for maximum tables size + int *code; // number of symbols assigned to each bit length + big_t *num; // saved results array for code counting + struct tab *done; // states already evaluated array +} g; + +// Index function for num[] and done[]. +local inline size_t map(int syms, int left, int len) { + return ((size_t)((syms - 1) >> 1) * ((syms - 2) >> 1) + + (left >> 1) - 1) * (g.max - 1) + + len - 1; +} + +// Free allocated space in globals. +local void cleanup(void) { + if (g.done != NULL) { + for (size_t n = 0; n < g.size; n++) + if (g.done[n].len) + free(g.done[n].vec); + g.size = 0; + free(g.done); g.done = NULL; + } + free(g.num); g.num = NULL; + free(g.code); g.code = NULL; + string_free(&g.out); +} + +// Return the number of possible prefix codes using bit patterns of lengths len +// through max inclusive, coding syms symbols, with left bit patterns of length +// len unused -- return -1 if there is an overflow in the counting. Keep a +// record of previous results in num to prevent repeating the same calculation. +local big_t count(int syms, int left, int len) { + // see if only one possible code if (syms == left) return 1; - /* note and verify the expected state */ - assert(syms > left && left > 0 && len < max); + // note and verify the expected state + assert(syms > left && left > 0 && len < g.max); - /* see if we've done this one already */ - index = INDEX(syms, left, len); - got = num[index]; + // see if we've done this one already + size_t index = map(syms, left, len); + big_t got = g.num[index]; if (got) - return got; /* we have -- return the saved result */ + return got; // we have -- return the saved result - /* we need to use at least this many bit patterns so that the code won't be - incomplete at the next length (more bit patterns than symbols) */ - least = (left << 1) - syms; + // we need to use at least this many bit patterns so that the code won't be + // incomplete at the next length (more bit patterns than symbols) + int least = (left << 1) - syms; if (least < 0) least = 0; - /* we can use at most this many bit patterns, lest there not be enough - available for the remaining symbols at the maximum length (if there were - no limit to the code length, this would become: most = left - 1) */ - most = (((code_t)left << (max - len)) - syms) / - (((code_t)1 << (max - len)) - 1); - - /* count all possible codes from this juncture and add them up */ - sum = 0; - for (use = least; use <= most; use++) { - got = count(syms - use, len + 1, (left - use) << 1); + // we can use at most this many bit patterns, lest there not be enough + // available for the remaining symbols at the maximum length (if there were + // no limit to the code length, this would become: most = left - 1) + int most = (((code_t)left << (g.max - len)) - syms) / + (((code_t)1 << (g.max - len)) - 1); + + // count all possible codes from this juncture and add them up + big_t sum = 0; + for (int use = least; use <= most; use++) { + got = count(syms - use, (left - use) << 1, len + 1); sum += got; - if (got == (big_t)0 - 1 || sum < got) /* overflow */ - return (big_t)0 - 1; + if (got == (big_t)-1 || sum < got) // overflow + return (big_t)-1; } - /* verify that all recursive calls are productive */ + // verify that all recursive calls are productive assert(sum != 0); - /* save the result and return it */ - num[index] = sum; + // save the result and return it + g.num[index] = sum; return sum; } -/* Return true if we've been here before, set to true if not. Set a bit in a - bit vector to indicate visiting this state. Each (syms,len,left) state - has a variable size bit vector indexed by (mem,rem). The bit vector is - lengthened if needed to allow setting the (mem,rem) bit. */ -local int beenhere(int syms, int len, int left, int mem, int rem) -{ - size_t index; /* index for this state's bit vector */ - size_t offset; /* offset in this state's bit vector */ - int bit; /* mask for this state's bit */ - size_t length; /* length of the bit vector in bytes */ - char *vector; /* new or enlarged bit vector */ - - /* point to vector for (syms,left,len), bit in vector for (mem,rem) */ - index = INDEX(syms, left, len); - mem -= 1 << root; - offset = (mem >> 3) + rem; +// Return true if we've been here before, set to true if not. Set a bit in a +// bit vector to indicate visiting this state. Each (syms,len,left) state has a +// variable size bit vector indexed by (mem,rem). The bit vector is lengthened +// as needed to allow setting the (mem,rem) bit. +local int been_here(int syms, int left, int len, int mem, int rem) { + // point to vector for (syms,left,len), bit in vector for (mem,rem) + size_t index = map(syms, left, len); + mem -= 1 << g.root; // mem always includes the root table + mem >>= 1; // mem and rem are always even + rem >>= 1; + size_t offset = (mem >> 3) + rem; offset = ((offset * (offset + 1)) >> 1) + rem; - bit = 1 << (mem & 7); + int bit = 1 << (mem & 7); - /* see if we've been here */ - length = done[index].len; - if (offset < length && (done[index].vec[offset] & bit) != 0) - return 1; /* done this! */ + // see if we've been here + size_t length = g.done[index].len; + if (offset < length && (g.done[index].vec[offset] & bit) != 0) + return 1; // done this! - /* we haven't been here before -- set the bit to show we have now */ + // we haven't been here before -- set the bit to show we have now - /* see if we need to lengthen the vector in order to set the bit */ + // see if we need to lengthen the vector in order to set the bit if (length <= offset) { - /* if we have one already, enlarge it, zero out the appended space */ + // if we have one already, enlarge it, zero out the appended space + char *vector; if (length) { do { length <<= 1; } while (length <= offset); - vector = realloc(done[index].vec, length); - if (vector != NULL) - memset(vector + done[index].len, 0, length - done[index].len); + vector = realloc(g.done[index].vec, length); + assert(vector != NULL && "out of memory"); + memset(vector + g.done[index].len, 0, length - g.done[index].len); } - /* otherwise we need to make a new vector and zero it out */ + // otherwise we need to make a new vector and zero it out else { - length = 1 << (len - root); + length = 16; while (length <= offset) length <<= 1; - vector = calloc(length, sizeof(char)); - } - - /* in either case, bail if we can't get the memory */ - if (vector == NULL) { - fputs("abort: unable to allocate enough memory\n", stderr); - cleanup(); - exit(1); + vector = calloc(length, 1); + assert(vector != NULL && "out of memory"); } - /* install the new vector */ - done[index].len = length; - done[index].vec = vector; + // install the new vector + g.done[index].len = length; + g.done[index].vec = vector; } - /* set the bit */ - done[index].vec[offset] |= bit; + // set the bit + g.done[index].vec[offset] |= bit; return 0; } -/* Examine all possible codes from the given node (syms, len, left). Compute - the amount of memory required to build inflate's decoding tables, where the - number of code structures used so far is mem, and the number remaining in - the current sub-table is rem. Uses the globals max, code, root, large, and - done. */ -local void examine(int syms, int len, int left, int mem, int rem) -{ - int least; /* least number of syms to use at this juncture */ - int most; /* most number of syms to use at this juncture */ - int use; /* number of bit patterns to use in next call */ - - /* see if we have a complete code */ +// Examine all possible codes from the given node (syms, len, left). Compute +// the amount of memory required to build inflate's decoding tables, where the +// number of code structures used so far is mem, and the number remaining in +// the current sub-table is rem. +local void examine(int syms, int left, int len, int mem, int rem) { + // see if we have a complete code if (syms == left) { - /* set the last code entry */ - code[len] = left; + // set the last code entry + g.code[len] = left; - /* complete computation of memory used by this code */ + // complete computation of memory used by this code while (rem < left) { left -= rem; - rem = 1 << (len - root); + rem = 1 << (len - g.root); mem += rem; } assert(rem == left); - /* if this is a new maximum, show the entries used and the sub-code */ - if (mem > large) { - large = mem; - printf("max %d: ", mem); - for (use = root + 1; use <= max; use++) - if (code[use]) - printf("%d[%d] ", code[use], use); - putchar('\n'); - fflush(stdout); + // if this is at the maximum, show the sub-code + if (mem >= g.large) { + // if this is a new maximum, update the maximum and clear out the + // printed sub-codes from the previous maximum + if (mem > g.large) { + g.large = mem; + string_clear(&g.out); + } + + // compute the starting state for this sub-code + syms = 0; + left = 1 << g.max; + for (int bits = g.max; bits > g.root; bits--) { + syms += g.code[bits]; + left -= g.code[bits]; + assert((left & 1) == 0); + left >>= 1; + } + + // print the starting state and the resulting sub-code to g.out + string_printf(&g.out, "<%u, %u, %u>:", + syms, g.root + 1, ((1 << g.root) - left) << 1); + for (int bits = g.root + 1; bits <= g.max; bits++) + if (g.code[bits]) + string_printf(&g.out, " %d[%d]", g.code[bits], bits); + string_printf(&g.out, "\n"); } - /* remove entries as we drop back down in the recursion */ - code[len] = 0; + // remove entries as we drop back down in the recursion + g.code[len] = 0; return; } - /* prune the tree if we can */ - if (beenhere(syms, len, left, mem, rem)) + // prune the tree if we can + if (been_here(syms, left, len, mem, rem)) return; - /* we need to use at least this many bit patterns so that the code won't be - incomplete at the next length (more bit patterns than symbols) */ - least = (left << 1) - syms; + // we need to use at least this many bit patterns so that the code won't be + // incomplete at the next length (more bit patterns than symbols) + int least = (left << 1) - syms; if (least < 0) least = 0; - /* we can use at most this many bit patterns, lest there not be enough - available for the remaining symbols at the maximum length (if there were - no limit to the code length, this would become: most = left - 1) */ - most = (((code_t)left << (max - len)) - syms) / - (((code_t)1 << (max - len)) - 1); + // we can use at most this many bit patterns, lest there not be enough + // available for the remaining symbols at the maximum length (if there were + // no limit to the code length, this would become: most = left - 1) + int most = (((code_t)left << (g.max - len)) - syms) / + (((code_t)1 << (g.max - len)) - 1); - /* occupy least table spaces, creating new sub-tables as needed */ - use = least; + // occupy least table spaces, creating new sub-tables as needed + int use = least; while (rem < use) { use -= rem; - rem = 1 << (len - root); + rem = 1 << (len - g.root); mem += rem; } rem -= use; - /* examine codes from here, updating table space as we go */ + // examine codes from here, updating table space as we go for (use = least; use <= most; use++) { - code[len] = use; - examine(syms - use, len + 1, (left - use) << 1, - mem + (rem ? 1 << (len - root) : 0), rem << 1); + g.code[len] = use; + examine(syms - use, (left - use) << 1, len + 1, + mem + (rem ? 1 << (len - g.root) : 0), rem << 1); if (rem == 0) { - rem = 1 << (len - root); + rem = 1 << (len - g.root); mem += rem; } rem--; } - /* remove entries as we drop back down in the recursion */ - code[len] = 0; + // remove entries as we drop back down in the recursion + g.code[len] = 0; } -/* Look at all sub-codes starting with root + 1 bits. Look at only the valid - intermediate code states (syms, left, len). For each completed code, - calculate the amount of memory required by inflate to build the decoding - tables. Find the maximum amount of memory required and show the code that - requires that maximum. Uses the globals max, root, and num. */ -local void enough(int syms) -{ - int n; /* number of remaing symbols for this node */ - int left; /* number of unused bit patterns at this length */ - size_t index; /* index of this case in *num */ - - /* clear code */ - for (n = 0; n <= max; n++) - code[n] = 0; - - /* look at all (root + 1) bit and longer codes */ - large = 1 << root; /* base table */ - if (root < max) /* otherwise, there's only a base table */ - for (n = 3; n <= syms; n++) - for (left = 2; left < n; left += 2) - { - /* look at all reachable (root + 1) bit nodes, and the - resulting codes (complete at root + 2 or more) */ - index = INDEX(n, left, root + 1); - if (root + 1 < max && num[index]) /* reachable node */ - examine(n, root + 1, left, 1 << root, 0); - - /* also look at root bit codes with completions at root + 1 - bits (not saved in num, since complete), just in case */ - if (num[index - 1] && n <= left << 1) - examine((n - left) << 1, root + 1, (n - left) << 1, - 1 << root, 0); +// Look at all sub-codes starting with root + 1 bits. Look at only the valid +// intermediate code states (syms, left, len). For each completed code, +// calculate the amount of memory required by inflate to build the decoding +// tables. Find the maximum amount of memory required and show the codes that +// require that maximum. +local void enough(int syms) { + // clear code + for (int n = 0; n <= g.max; n++) + g.code[n] = 0; + + // look at all (root + 1) bit and longer codes + string_clear(&g.out); // empty saved results + g.large = 1 << g.root; // base table + if (g.root < g.max) // otherwise, there's only a base table + for (int n = 3; n <= syms; n++) + for (int left = 2; left < n; left += 2) { + // look at all reachable (root + 1) bit nodes, and the + // resulting codes (complete at root + 2 or more) + size_t index = map(n, left, g.root + 1); + if (g.root + 1 < g.max && g.num[index]) // reachable node + examine(n, left, g.root + 1, 1 << g.root, 0); + + // also look at root bit codes with completions at root + 1 + // bits (not saved in num, since complete), just in case + if (g.num[index - 1] && n <= left << 1) + examine((n - left) << 1, (n - left) << 1, g.root + 1, + 1 << g.root, 0); } - /* done */ - printf("done: maximum of %d table entries\n", large); + // done + printf("maximum of %d table entries for root = %d\n", g.large, g.root); + fputs(g.out.str, stdout); } -/* - Examine and show the total number of possible Huffman codes for a given - maximum number of symbols, initial root table size, and maximum code length - in bits -- those are the command arguments in that order. The default - values are 286, 9, and 15 respectively, for the deflate literal/length code. - The possible codes are counted for each number of coded symbols from two to - the maximum. The counts for each of those and the total number of codes are - shown. The maximum number of inflate table entires is then calculated - across all possible codes. Each new maximum number of table entries and the - associated sub-code (starting at root + 1 == 10 bits) is shown. - - To count and examine Huffman codes that are not length-limited, provide a - maximum length equal to the number of symbols minus one. - - For the deflate literal/length code, use "enough". For the deflate distance - code, use "enough 30 6". - - This uses the %llu printf format to print big_t numbers, which assumes that - big_t is an unsigned long long. If the big_t type is changed (for example - to a multiple precision type), the method of printing will also need to be - updated. - */ -int main(int argc, char **argv) -{ - int syms; /* total number of symbols to code */ - int n; /* number of symbols to code for this run */ - big_t got; /* return value of count() */ - big_t sum; /* accumulated number of codes over n */ - code_t word; /* for counting bits in code_t */ - - /* set up globals for cleanup() */ - code = NULL; - num = NULL; - done = NULL; - - /* get arguments -- default to the deflate literal/length code */ - syms = 286; - root = 9; - max = 15; +// Examine and show the total number of possible prefix codes for a given +// maximum number of symbols, initial root table size, and maximum code length +// in bits -- those are the command arguments in that order. The default values +// are 286, 9, and 15 respectively, for the deflate literal/length code. The +// possible codes are counted for each number of coded symbols from two to the +// maximum. The counts for each of those and the total number of codes are +// shown. The maximum number of inflate table entires is then calculated across +// all possible codes. Each new maximum number of table entries and the +// associated sub-code (starting at root + 1 == 10 bits) is shown. +// +// To count and examine prefix codes that are not length-limited, provide a +// maximum length equal to the number of symbols minus one. +// +// For the deflate literal/length code, use "enough". For the deflate distance +// code, use "enough 30 6". +int main(int argc, char **argv) { + // set up globals for cleanup() + g.code = NULL; + g.num = NULL; + g.done = NULL; + string_init(&g.out); + + // get arguments -- default to the deflate literal/length code + int syms = 286; + g.root = 9; + g.max = 15; if (argc > 1) { syms = atoi(argv[1]); if (argc > 2) { - root = atoi(argv[2]); + g.root = atoi(argv[2]); if (argc > 3) - max = atoi(argv[3]); + g.max = atoi(argv[3]); } } - if (argc > 4 || syms < 2 || root < 1 || max < 1) { + if (argc > 4 || syms < 2 || g.root < 1 || g.max < 1) { fputs("invalid arguments, need: [sym >= 2 [root >= 1 [max >= 1]]]\n", stderr); return 1; } - /* if not restricting the code length, the longest is syms - 1 */ - if (max > syms - 1) - max = syms - 1; - - /* determine the number of bits in a code_t */ - for (n = 0, word = 1; word; n++, word <<= 1) - ; + // if not restricting the code length, the longest is syms - 1 + if (g.max > syms - 1) + g.max = syms - 1; + + // determine the number of bits in a code_t + int bits = 0; + for (code_t word = 1; word; word <<= 1) + bits++; - /* make sure that the calculation of most will not overflow */ - if (max > n || (code_t)(syms - 2) >= (((code_t)0 - 1) >> (max - 1))) { + // make sure that the calculation of most will not overflow + if (g.max > bits || (code_t)(syms - 2) >= ((code_t)-1 >> (g.max - 1))) { fputs("abort: code length too long for internal types\n", stderr); return 1; } - /* reject impossible code requests */ - if ((code_t)(syms - 1) > ((code_t)1 << max) - 1) { + // reject impossible code requests + if ((code_t)(syms - 1) > ((code_t)1 << g.max) - 1) { fprintf(stderr, "%d symbols cannot be coded in %d bits\n", - syms, max); + syms, g.max); return 1; } - /* allocate code vector */ - code = calloc(max + 1, sizeof(int)); - if (code == NULL) { - fputs("abort: unable to allocate enough memory\n", stderr); - return 1; - } - - /* determine size of saved results array, checking for overflows, - allocate and clear the array (set all to zero with calloc()) */ - if (syms == 2) /* iff max == 1 */ - num = NULL; /* won't be saving any results */ + // allocate code vector + g.code = calloc(g.max + 1, sizeof(int)); + assert(g.code != NULL && "out of memory"); + + // determine size of saved results array, checking for overflows, + // allocate and clear the array (set all to zero with calloc()) + if (syms == 2) // iff max == 1 + g.num = NULL; // won't be saving any results else { - size = syms >> 1; - if (size > ((size_t)0 - 1) / (n = (syms - 1) >> 1) || - (size *= n, size > ((size_t)0 - 1) / (n = max - 1)) || - (size *= n, size > ((size_t)0 - 1) / sizeof(big_t)) || - (num = calloc(size, sizeof(big_t))) == NULL) { - fputs("abort: unable to allocate enough memory\n", stderr); - cleanup(); - return 1; - } + g.size = syms >> 1; + int n = (syms - 1) >> 1; + assert(g.size <= (size_t)-1 / n && "overflow"); + g.size *= n; + n = g.max - 1; + assert(g.size <= (size_t)-1 / n && "overflow"); + g.size *= n; + g.num = calloc(g.size, sizeof(big_t)); + assert(g.num != NULL && "out of memory"); } - /* count possible codes for all numbers of symbols, add up counts */ - sum = 0; - for (n = 2; n <= syms; n++) { - got = count(n, 1, 2); + // count possible codes for all numbers of symbols, add up counts + big_t sum = 0; + for (int n = 2; n <= syms; n++) { + big_t got = count(n, 2, 1); sum += got; - if (got == (big_t)0 - 1 || sum < got) { /* overflow */ - fputs("abort: can't count that high!\n", stderr); - cleanup(); - return 1; - } - printf("%llu %d-codes\n", got, n); + assert(got != (big_t)-1 && sum >= got && "overflow"); } - printf("%llu total codes for 2 to %d symbols", sum, syms); - if (max < syms - 1) - printf(" (%d-bit length limit)\n", max); + printf("%"PRIbig" total codes for 2 to %d symbols", sum, syms); + if (g.max < syms - 1) + printf(" (%d-bit length limit)\n", g.max); else puts(" (no length limit)"); - /* allocate and clear done array for beenhere() */ + // allocate and clear done array for been_here() if (syms == 2) - done = NULL; - else if (size > ((size_t)0 - 1) / sizeof(struct tab) || - (done = calloc(size, sizeof(struct tab))) == NULL) { - fputs("abort: unable to allocate enough memory\n", stderr); - cleanup(); - return 1; + g.done = NULL; + else { + g.done = calloc(g.size, sizeof(struct tab)); + assert(g.done != NULL && "out of memory"); } - /* find and show maximum inflate table usage */ - if (root > max) /* reduce root to max length */ - root = max; - if ((code_t)syms < ((code_t)1 << (root + 1))) + // find and show maximum inflate table usage + if (g.root > g.max) // reduce root to max length + g.root = g.max; + if ((code_t)syms < ((code_t)1 << (g.root + 1))) enough(syms); else - puts("cannot handle minimum code lengths > root"); + fputs("cannot handle minimum code lengths > root", stderr); - /* done */ + // done cleanup(); return 0; } diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/examples/gzappend.c mame-0.243+dfsg.1/3rdparty/zlib/examples/gzappend.c --- mame-0.242+dfsg.1/3rdparty/zlib/examples/gzappend.c 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/examples/gzappend.c 2022-04-29 05:37:26.000000000 +0000 @@ -137,7 +137,7 @@ /* do simple left shift by one */ if (rot == 1) { tmp = *list; - memcpy(list, list + 1, len - 1); + memmove(list, list + 1, len - 1); *last = tmp; return; } diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/examples/gzlog.c mame-0.243+dfsg.1/3rdparty/zlib/examples/gzlog.c --- mame-0.242+dfsg.1/3rdparty/zlib/examples/gzlog.c 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/examples/gzlog.c 2022-04-29 05:37:26.000000000 +0000 @@ -1,8 +1,8 @@ /* * gzlog.c - * Copyright (C) 2004, 2008, 2012, 2016 Mark Adler, all rights reserved + * Copyright (C) 2004, 2008, 2012, 2016, 2019 Mark Adler, all rights reserved * For conditions of distribution and use, see copyright notice in gzlog.h - * version 2.2, 14 Aug 2012 + * version 2.3, 25 May 2019 */ /* @@ -756,12 +756,14 @@ return -2; } if ((fd = open(log->path, O_RDONLY, 0)) < 0) { + free(data); log_log(log, op, ".add file read failure"); return -1; } ret = (size_t)read(fd, data, len) != len; close(fd); if (ret) { + free(data); log_log(log, op, ".add file read failure"); return -1; } diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/examples/gznorm.c mame-0.243+dfsg.1/3rdparty/zlib/examples/gznorm.c --- mame-0.242+dfsg.1/3rdparty/zlib/examples/gznorm.c 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/examples/gznorm.c 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,470 @@ +/* gznorm.c -- normalize a gzip stream + * Copyright (C) 2018 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + * Version 1.0 7 Oct 2018 Mark Adler */ + +// gznorm takes a gzip stream, potentially containing multiple members, and +// converts it to a gzip stream with a single member. In addition the gzip +// header is normalized, removing the file name and time stamp, and setting the +// other header contents (XFL, OS) to fixed values. gznorm does not recompress +// the data, so it is fast, but no advantage is gained from the history that +// could be available across member boundaries. + +#include // fread, fwrite, putc, fflush, ferror, fprintf, + // vsnprintf, stdout, stderr, NULL, FILE +#include // malloc, free +#include // strerror +#include // errno +#include // va_list, va_start, va_end +#include "zlib.h" // inflateInit2, inflate, inflateReset, inflateEnd, + // z_stream, z_off_t, crc32_combine, Z_NULL, Z_BLOCK, + // Z_OK, Z_STREAM_END, Z_BUF_ERROR, Z_DATA_ERROR, + // Z_MEM_ERROR + +#if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(__CYGWIN__) +# include +# include +# define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY) +#else +# define SET_BINARY_MODE(file) +#endif + +#define local static + +// printf to an allocated string. Return the string, or NULL if the printf or +// allocation fails. +local char *aprintf(char *fmt, ...) { + // Get the length of the result of the printf. + va_list args; + va_start(args, fmt); + int len = vsnprintf(NULL, 0, fmt, args); + va_end(args); + if (len < 0) + return NULL; + + // Allocate the required space and printf to it. + char *str = malloc(len + 1); + if (str == NULL) + return NULL; + va_start(args, fmt); + vsnprintf(str, len + 1, fmt, args); + va_end(args); + return str; +} + +// Return with an error, putting an allocated error message in *err. Doing an +// inflateEnd() on an already ended state, or one with state set to Z_NULL, is +// permitted. +#define BYE(...) \ + do { \ + inflateEnd(&strm); \ + *err = aprintf(__VA_ARGS__); \ + return 1; \ + } while (0) + +// Chunk size for buffered reads and for decompression. Twice this many bytes +// will be allocated on the stack by gzip_normalize(). Must fit in an unsigned. +#define CHUNK 16384 + +// Read a gzip stream from in and write an equivalent normalized gzip stream to +// out. If given no input, an empty gzip stream will be written. If successful, +// 0 is returned, and *err is set to NULL. On error, 1 is returned, where the +// details of the error are returned in *err, a pointer to an allocated string. +// +// The input may be a stream with multiple gzip members, which is converted to +// a single gzip member on the output. Each gzip member is decompressed at the +// level of deflate blocks. This enables clearing the last-block bit, shifting +// the compressed data to concatenate to the previous member's compressed data, +// which can end at an arbitrary bit boundary, and identifying stored blocks in +// order to resynchronize those to byte boundaries. The deflate compressed data +// is terminated with a 10-bit empty fixed block. If any members on the input +// end with a 10-bit empty fixed block, then that block is excised from the +// stream. This avoids appending empty fixed blocks for every normalization, +// and assures that gzip_normalize applied a second time will not change the +// input. The pad bits after stored block headers and after the final deflate +// block are all forced to zeros. +local int gzip_normalize(FILE *in, FILE *out, char **err) { + // initialize the inflate engine to process a gzip member + z_stream strm; + strm.zalloc = Z_NULL; + strm.zfree = Z_NULL; + strm.opaque = Z_NULL; + strm.avail_in = 0; + strm.next_in = Z_NULL; + if (inflateInit2(&strm, 15 + 16) != Z_OK) + BYE("out of memory"); + + // State while processing the input gzip stream. + enum { // BETWEEN -> HEAD -> BLOCK -> TAIL -> BETWEEN -> ... + BETWEEN, // between gzip members (must end in this state) + HEAD, // reading a gzip header + BLOCK, // reading deflate blocks + TAIL // reading a gzip trailer + } state = BETWEEN; // current component being processed + unsigned long crc = 0; // accumulated CRC of uncompressed data + unsigned long len = 0; // accumulated length of uncompressed data + unsigned long buf = 0; // deflate stream bit buffer of num bits + int num = 0; // number of bits in buf (at bottom) + + // Write a canonical gzip header (no mod time, file name, comment, extra + // block, or extra flags, and OS is marked as unknown). + fwrite("\x1f\x8b\x08\0\0\0\0\0\0\xff", 1, 10, out); + + // Process the gzip stream from in until reaching the end of the input, + // encountering invalid input, or experiencing an i/o error. + int more; // true if not at the end of the input + do { + // State inside this loop. + unsigned char *put; // next input buffer location to process + int prev; // number of bits from previous block in + // the bit buffer, or -1 if not at the + // start of a block + unsigned long long memb; // uncompressed length of member + size_t tail; // number of trailer bytes read (0..8) + unsigned long part; // accumulated trailer component + + // Get the next chunk of input from in. + unsigned char dat[CHUNK]; + strm.avail_in = fread(dat, 1, CHUNK, in); + if (strm.avail_in == 0) + break; + more = strm.avail_in == CHUNK; + strm.next_in = put = dat; + + // Run that chunk of input through the inflate engine to exhaustion. + do { + // At this point it is assured that strm.avail_in > 0. + + // Inflate until the end of a gzip component (header, deflate + // block, trailer) is reached, or until all of the chunk is + // consumed. The resulting decompressed data is discarded, though + // the total size of the decompressed data in each member is + // tracked, for the calculation of the total CRC. + do { + // inflate and handle any errors + unsigned char scrap[CHUNK]; + strm.avail_out = CHUNK; + strm.next_out = scrap; + int ret = inflate(&strm, Z_BLOCK); + if (ret == Z_MEM_ERROR) + BYE("out of memory"); + if (ret == Z_DATA_ERROR) + BYE("input invalid: %s", strm.msg); + if (ret != Z_OK && ret != Z_BUF_ERROR && ret != Z_STREAM_END) + BYE("internal error"); + + // Update the number of uncompressed bytes generated in this + // member. The actual count (not modulo 2^32) is required to + // correctly compute the total CRC. + unsigned got = CHUNK - strm.avail_out; + memb += got; + if (memb < got) + BYE("overflow error"); + + // Continue to process this chunk until it is consumed, or + // until the end of a component (header, deflate block, or + // trailer) is reached. + } while (strm.avail_out == 0 && (strm.data_type & 0x80) == 0); + + // Since strm.avail_in was > 0 for the inflate call, some input was + // just consumed. It is therefore assured that put < strm.next_in. + + // Disposition the consumed component or part of a component. + switch (state) { + case BETWEEN: + state = HEAD; + // Fall through to HEAD when some or all of the header is + // processed. + + case HEAD: + // Discard the header. + if (strm.data_type & 0x80) { + // End of header reached -- deflate blocks follow. + put = strm.next_in; + prev = num; + memb = 0; + state = BLOCK; + } + break; + + case BLOCK: + // Copy the deflate stream to the output, but with the + // last-block-bit cleared. Re-synchronize stored block + // headers to the output byte boundaries. The bytes at + // put..strm.next_in-1 is the compressed data that has been + // processed and is ready to be copied to the output. + + // At this point, it is assured that new compressed data is + // available, i.e., put < strm.next_in. If prev is -1, then + // that compressed data starts in the middle of a deflate + // block. If prev is not -1, then the bits in the bit + // buffer, possibly combined with the bits in *put, contain + // the three-bit header of the new deflate block. In that + // case, prev is the number of bits from the previous block + // that remain in the bit buffer. Since num is the number + // of bits in the bit buffer, we have that num - prev is + // the number of bits from the new block currently in the + // bit buffer. + + // If strm.data_type & 0xc0 is 0x80, then the last byte of + // the available compressed data includes the last bits of + // the end of a deflate block. In that case, that last byte + // also has strm.data_type & 0x1f bits of the next deflate + // block, in the range 0..7. If strm.data_type & 0xc0 is + // 0xc0, then the last byte of the compressed data is the + // end of the deflate stream, followed by strm.data_type & + // 0x1f pad bits, also in the range 0..7. + + // Set bits to the number of bits not yet consumed from the + // last byte. If we are at the end of the block, bits is + // either the number of bits in the last byte belonging to + // the next block, or the number of pad bits after the + // final block. In either of those cases, bits is in the + // range 0..7. + ; // (required due to C syntax oddity) + int bits = strm.data_type & 0x1f; + + if (prev != -1) { + // We are at the start of a new block. Clear the last + // block bit, and check for special cases. If it is a + // stored block, then emit the header and pad to the + // next byte boundary. If it is a final, empty fixed + // block, then excise it. + + // Some or all of the three header bits for this block + // may already be in the bit buffer. Load any remaining + // header bits into the bit buffer. + if (num - prev < 3) { + buf += (unsigned long)*put++ << num; + num += 8; + } + + // Set last to have a 1 in the position of the last + // block bit in the bit buffer. + unsigned long last = (unsigned long)1 << prev; + + if (((buf >> prev) & 7) == 3) { + // This is a final fixed block. Load at least ten + // bits from this block, including the header, into + // the bit buffer. We already have at least three, + // so at most one more byte needs to be loaded. + if (num - prev < 10) { + if (put == strm.next_in) + // Need to go get and process more input. + // We'll end up back here to finish this. + break; + buf += (unsigned long)*put++ << num; + num += 8; + } + if (((buf >> prev) & 0x3ff) == 3) { + // That final fixed block is empty. Delete it + // to avoid adding an empty block every time a + // gzip stream is normalized. + num = prev; + buf &= last - 1; // zero the pad bits + } + } + else if (((buf >> prev) & 6) == 0) { + // This is a stored block. Flush to the next + // byte boundary after the three-bit header. + num = (prev + 10) & ~7; + buf &= last - 1; // zero the pad bits + } + + // Clear the last block bit. + buf &= ~last; + + // Write out complete bytes in the bit buffer. + while (num >= 8) { + putc(buf, out); + buf >>= 8; + num -= 8; + } + + // If no more bytes left to process, then we have + // consumed the byte that had bits from the next block. + if (put == strm.next_in) + bits = 0; + } + + // We are done handling the deflate block header. Now copy + // all or almost all of the remaining compressed data that + // has been processed so far. Don't copy one byte at the + // end if it contains bits from the next deflate block or + // pad bits at the end of a deflate block. + + // mix is 1 if we are at the end of a deflate block, and if + // some of the bits in the last byte follow this block. mix + // is 0 if we are in the middle of a deflate block, if the + // deflate block ended on a byte boundary, or if all of the + // compressed data processed so far has been consumed. + int mix = (strm.data_type & 0x80) && bits; + + // Copy all of the processed compressed data to the output, + // except for the last byte if it contains bits from the + // next deflate block or pad bits at the end of the deflate + // stream. Copy the data after shifting in num bits from + // buf in front of it, leaving num bits from the end of the + // compressed data in buf when done. + unsigned char *end = strm.next_in - mix; + if (put < end) { + if (num) + // Insert num bits from buf before the data being + // copied. + do { + buf += (unsigned)(*put++) << num; + putc(buf, out); + buf >>= 8; + } while (put < end); + else { + // No shifting needed -- write directly. + fwrite(put, 1, end - put, out); + put = end; + } + } + + // Process the last processed byte if it wasn't written. + if (mix) { + // Load the last byte into the bit buffer. + buf += (unsigned)(*put++) << num; + num += 8; + + if (strm.data_type & 0x40) { + // We are at the end of the deflate stream and + // there are bits pad bits. Discard the pad bits + // and write a byte to the output, if available. + // Leave the num bits left over in buf to prepend + // to the next deflate stream. + num -= bits; + if (num >= 8) { + putc(buf, out); + num -= 8; + buf >>= 8; + } + + // Force the pad bits in the bit buffer to zeros. + buf &= ((unsigned long)1 << num) - 1; + + // Don't need to set prev here since going to TAIL. + } + else + // At the end of an internal deflate block. Leave + // the last byte in the bit buffer to examine on + // the next entry to BLOCK, when more bits from the + // next block will be available. + prev = num - bits; // number of bits in buffer + // from current block + } + + // Don't have a byte left over, so we are in the middle of + // a deflate block, or the deflate block ended on a byte + // boundary. Set prev appropriately for the next entry into + // BLOCK. + else if (strm.data_type & 0x80) + // The block ended on a byte boundary, so no header + // bits are in the bit buffer. + prev = num; + else + // In the middle of a deflate block, so no header here. + prev = -1; + + // Check for the end of the deflate stream. + if ((strm.data_type & 0xc0) == 0xc0) { + // That ends the deflate stream on the input side, the + // pad bits were discarded, and any remaining bits from + // the last block in the stream are saved in the bit + // buffer to prepend to the next stream. Process the + // gzip trailer next. + tail = 0; + part = 0; + state = TAIL; + } + break; + + case TAIL: + // Accumulate available trailer bytes to update the total + // CRC and the total uncompressed length. + do { + part = (part >> 8) + ((unsigned long)(*put++) << 24); + tail++; + if (tail == 4) { + // Update the total CRC. + z_off_t len2 = memb; + if (len2 < 0 || (unsigned long long)len2 != memb) + BYE("overflow error"); + crc = crc ? crc32_combine(crc, part, len2) : part; + part = 0; + } + else if (tail == 8) { + // Update the total uncompressed length. (It's ok + // if this sum is done modulo 2^32.) + len += part; + + // At the end of a member. Set up to inflate an + // immediately following gzip member. (If we made + // it this far, then the trailer was valid.) + if (inflateReset(&strm) != Z_OK) + BYE("internal error"); + state = BETWEEN; + break; + } + } while (put < strm.next_in); + break; + } + + // Process the input buffer until completely consumed. + } while (strm.avail_in > 0); + + // Process input until end of file, invalid input, or i/o error. + } while (more); + + // Done with the inflate engine. + inflateEnd(&strm); + + // Verify the validity of the input. + if (state != BETWEEN) + BYE("input invalid: incomplete gzip stream"); + + // Write the remaining deflate stream bits, followed by a terminating + // deflate fixed block. + buf += (unsigned long)3 << num; + putc(buf, out); + putc(buf >> 8, out); + if (num > 6) + putc(0, out); + + // Write the gzip trailer, which is the CRC and the uncompressed length + // modulo 2^32, both in little-endian order. + putc(crc, out); + putc(crc >> 8, out); + putc(crc >> 16, out); + putc(crc >> 24, out); + putc(len, out); + putc(len >> 8, out); + putc(len >> 16, out); + putc(len >> 24, out); + fflush(out); + + // Check for any i/o errors. + if (ferror(in) || ferror(out)) + BYE("i/o error: %s", strerror(errno)); + + // All good! + *err = NULL; + return 0; +} + +// Normalize the gzip stream on stdin, writing the result to stdout. +int main(void) { + // Avoid end-of-line conversions on evil operating systems. + SET_BINARY_MODE(stdin); + SET_BINARY_MODE(stdout); + + // Normalize from stdin to stdout, returning 1 on error, 0 if ok. + char *err; + int ret = gzip_normalize(stdin, stdout, &err); + if (ret) + fprintf(stderr, "gznorm error: %s\n", err); + free(err); + return ret; +} diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/examples/README.examples mame-0.243+dfsg.1/3rdparty/zlib/examples/README.examples --- mame-0.242+dfsg.1/3rdparty/zlib/examples/README.examples 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/examples/README.examples 2022-04-29 05:37:26.000000000 +0000 @@ -34,6 +34,10 @@ and deflateSetDictionary() - illustrates use of a gzip header extra field +gznorm.c + normalize a gzip file by combining members into a single member + - demonstrates how to concatenate deflate streams using Z_BLOCK + zlib_how.html painfully comprehensive description of zpipe.c (see below) - describes in excruciating detail the use of deflate() and inflate() @@ -44,6 +48,7 @@ - deeply commented in zlib_how.html (see above) zran.c +zran.h index a zlib or gzip stream and randomly access it - illustrates the use of Z_BLOCK, inflatePrime(), and inflateSetDictionary() to provide random access diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/examples/zran.c mame-0.243+dfsg.1/3rdparty/zlib/examples/zran.c --- mame-0.242+dfsg.1/3rdparty/zlib/examples/zran.c 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/examples/zran.c 2022-04-29 05:37:26.000000000 +0000 @@ -1,11 +1,13 @@ /* zran.c -- example of zlib/gzip stream indexing and random access - * Copyright (C) 2005, 2012 Mark Adler + * Copyright (C) 2005, 2012, 2018 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h - Version 1.1 29 Sep 2012 Mark Adler */ + * Version 1.2 14 Oct 2018 Mark Adler */ /* Version History: 1.0 29 May 2005 First version 1.1 29 Sep 2012 Fix memory reallocation error + 1.2 14 Oct 2018 Handle gzip streams with multiple members + Add a header file to facilitate usage in applications */ /* Illustrate the use of Z_BLOCK, inflatePrime(), and inflateSetDictionary() @@ -20,11 +22,11 @@ the starting file offset and bit of that block, and the 32K bytes of uncompressed data that precede that block. Also the uncompressed offset of that block is saved to provide a referece for locating a desired starting - point in the uncompressed stream. build_index() works by decompressing the - input zlib or gzip stream a block at a time, and at the end of each block - deciding if enough uncompressed data has gone by to justify the creation of - a new access point. If so, that point is saved in a data structure that - grows as needed to accommodate the points. + point in the uncompressed stream. deflate_index_build() works by + decompressing the input zlib or gzip stream a block at a time, and at the + end of each block deciding if enough uncompressed data has gone by to + justify the creation of a new access point. If so, that point is saved in a + data structure that grows as needed to accommodate the points. To use the index, an offset in the uncompressed data is provided, for which the latest access point at or preceding that offset is located in the index. @@ -43,7 +45,8 @@ There is some fair bit of overhead to starting inflation for the random access, mainly copying the 32K byte dictionary. So if small pieces of the file are being accessed, it would make sense to implement a cache to hold - some lookahead and avoid many calls to extract() for small lengths. + some lookahead and avoid many calls to deflate_index_extract() for small + lengths. Another way to build an index would be to use inflateCopy(). That would not be constrained to have access points at block boundaries, but requires @@ -56,30 +59,21 @@ #include #include #include "zlib.h" +#include "zran.h" -#define local static - -#define SPAN 1048576L /* desired distance between access points */ #define WINSIZE 32768U /* sliding window size */ #define CHUNK 16384 /* file input buffer size */ -/* access point entry */ +/* Access point entry. */ struct point { off_t out; /* corresponding offset in uncompressed data */ off_t in; /* offset in input file of first full byte */ - int bits; /* number of bits (1-7) from byte at in - 1, or 0 */ + int bits; /* number of bits (1-7) from byte at in-1, or 0 */ unsigned char window[WINSIZE]; /* preceding 32K of uncompressed data */ }; -/* access point list */ -struct access { - int have; /* number of list entries filled in */ - int size; /* number of list entries allocated */ - struct point *list; /* allocated list */ -}; - -/* Deallocate an index built by build_index() */ -local void free_index(struct access *index) +/* See comments in zran.h. */ +void deflate_index_free(struct deflate_index *index) { if (index != NULL) { free(index->list); @@ -87,39 +81,43 @@ } } -/* Add an entry to the access point list. If out of memory, deallocate the - existing list and return NULL. */ -local struct access *addpoint(struct access *index, int bits, - off_t in, off_t out, unsigned left, unsigned char *window) +/* Add an entry to the access point list. If out of memory, deallocate the + existing list and return NULL. index->gzip is the allocated size of the + index in point entries, until it is time for deflate_index_build() to + return, at which point gzip is set to indicate a gzip file or not. + */ +static struct deflate_index *addpoint(struct deflate_index *index, int bits, + off_t in, off_t out, unsigned left, + unsigned char *window) { struct point *next; /* if list is empty, create it (start with eight points) */ if (index == NULL) { - index = malloc(sizeof(struct access)); + index = malloc(sizeof(struct deflate_index)); if (index == NULL) return NULL; index->list = malloc(sizeof(struct point) << 3); if (index->list == NULL) { free(index); return NULL; } - index->size = 8; + index->gzip = 8; index->have = 0; } /* if list is full, make it bigger */ - else if (index->have == index->size) { - index->size <<= 1; - next = realloc(index->list, sizeof(struct point) * index->size); + else if (index->have == index->gzip) { + index->gzip <<= 1; + next = realloc(index->list, sizeof(struct point) * index->gzip); if (next == NULL) { - free_index(index); + deflate_index_free(index); return NULL; } index->list = next; } /* fill in entry and increment how many we have */ - next = index->list + index->have; + next = (struct point *)(index->list) + index->have; next->bits = bits; next->in = in; next->out = out; @@ -133,20 +131,14 @@ return index; } -/* Make one entire pass through the compressed stream and build an index, with - access points about every span bytes of uncompressed output -- span is - chosen to balance the speed of random access against the memory requirements - of the list, about 32K bytes per access point. Note that data after the end - of the first zlib or gzip stream in the file is ignored. build_index() - returns the number of access points on success (>= 1), Z_MEM_ERROR for out - of memory, Z_DATA_ERROR for an error in the input file, or Z_ERRNO for a - file read error. On success, *built points to the resulting index. */ -local int build_index(FILE *in, off_t span, struct access **built) +/* See comments in zran.h. */ +int deflate_index_build(FILE *in, off_t span, struct deflate_index **built) { int ret; + int gzip = 0; /* true if reading a gzip file */ off_t totin, totout; /* our own total counters to avoid 4GB limit */ off_t last; /* totout value of last access point */ - struct access *index; /* access points being generated */ + struct deflate_index *index; /* access points being generated */ z_stream strm; unsigned char input[CHUNK]; unsigned char window[WINSIZE]; @@ -163,7 +155,7 @@ /* inflate the input, maintain a sliding window, and build an index -- this also validates the integrity of the compressed data using the check - information at the end of the gzip or zlib stream */ + information in the gzip or zlib stream */ totin = totout = last = 0; index = NULL; /* will be allocated by first addpoint() */ strm.avail_out = 0; @@ -172,14 +164,19 @@ strm.avail_in = fread(input, 1, CHUNK, in); if (ferror(in)) { ret = Z_ERRNO; - goto build_index_error; + goto deflate_index_build_error; } if (strm.avail_in == 0) { ret = Z_DATA_ERROR; - goto build_index_error; + goto deflate_index_build_error; } strm.next_in = input; + /* check for a gzip stream */ + if (totin == 0 && strm.avail_in >= 3 && + input[0] == 31 && input[1] == 139 && input[2] == 8) + gzip = 1; + /* process all of that, or until end of stream */ do { /* reset sliding window if necessary */ @@ -198,9 +195,17 @@ if (ret == Z_NEED_DICT) ret = Z_DATA_ERROR; if (ret == Z_MEM_ERROR || ret == Z_DATA_ERROR) - goto build_index_error; - if (ret == Z_STREAM_END) + goto deflate_index_build_error; + if (ret == Z_STREAM_END) { + if (gzip && + (strm.avail_in || ungetc(getc(in), in) != EOF)) { + ret = inflateReset(&strm); + if (ret != Z_OK) + goto deflate_index_build_error; + continue; + } break; + } /* if at end of block, consider adding an index entry (note that if data_type indicates an end-of-block, then all of the @@ -217,7 +222,7 @@ totout, strm.avail_out, window); if (index == NULL) { ret = Z_MEM_ERROR; - goto build_index_error; + goto deflate_index_build_error; } last = totout; } @@ -227,27 +232,21 @@ /* clean up and return index (release unused entries in list) */ (void)inflateEnd(&strm); index->list = realloc(index->list, sizeof(struct point) * index->have); - index->size = index->have; + index->gzip = gzip; + index->length = totout; *built = index; - return index->size; + return index->have; /* return error */ - build_index_error: + deflate_index_build_error: (void)inflateEnd(&strm); - if (index != NULL) - free_index(index); + deflate_index_free(index); return ret; } -/* Use the index to read len bytes from offset into buf, return bytes read or - negative for error (Z_DATA_ERROR or Z_MEM_ERROR). If data is requested past - the end of the uncompressed data, then extract() will return a value less - than len, indicating how much as actually read into buf. This function - should not return a data error unless the file was modified since the index - was generated. extract() may also return Z_ERRNO if there is an error on - reading or seeking the input file. */ -local int extract(FILE *in, struct access *index, off_t offset, - unsigned char *buf, int len) +/* See comments in zran.h. */ +int deflate_index_extract(FILE *in, struct deflate_index *index, off_t offset, + unsigned char *buf, int len) { int ret, skip; z_stream strm; @@ -276,12 +275,12 @@ return ret; ret = fseeko(in, here->in - (here->bits ? 1 : 0), SEEK_SET); if (ret == -1) - goto extract_ret; + goto deflate_index_extract_ret; if (here->bits) { ret = getc(in); if (ret == -1) { ret = ferror(in) ? Z_ERRNO : Z_DATA_ERROR; - goto extract_ret; + goto deflate_index_extract_ret; } (void)inflatePrime(&strm, here->bits, ret >> (8 - here->bits)); } @@ -293,21 +292,21 @@ skip = 1; /* while skipping to offset */ do { /* define where to put uncompressed data, and how much */ - if (offset == 0 && skip) { /* at offset now */ - strm.avail_out = len; - strm.next_out = buf; - skip = 0; /* only do this once */ - } if (offset > WINSIZE) { /* skip WINSIZE bytes */ strm.avail_out = WINSIZE; strm.next_out = discard; offset -= WINSIZE; } - else if (offset != 0) { /* last skip */ + else if (offset > 0) { /* last skip */ strm.avail_out = (unsigned)offset; strm.next_out = discard; offset = 0; } + else if (skip) { /* at offset now */ + strm.avail_out = len; + strm.next_out = buf; + skip = 0; /* only do this once */ + } /* uncompress until avail_out filled, or end of stream */ do { @@ -315,11 +314,11 @@ strm.avail_in = fread(input, 1, CHUNK, in); if (ferror(in)) { ret = Z_ERRNO; - goto extract_ret; + goto deflate_index_extract_ret; } if (strm.avail_in == 0) { ret = Z_DATA_ERROR; - goto extract_ret; + goto deflate_index_extract_ret; } strm.next_in = input; } @@ -327,41 +326,99 @@ if (ret == Z_NEED_DICT) ret = Z_DATA_ERROR; if (ret == Z_MEM_ERROR || ret == Z_DATA_ERROR) - goto extract_ret; - if (ret == Z_STREAM_END) - break; + goto deflate_index_extract_ret; + if (ret == Z_STREAM_END) { + /* the raw deflate stream has ended */ + if (index->gzip == 0) + /* this is a zlib stream that has ended -- done */ + break; + + /* near the end of a gzip member, which might be followed by + another gzip member -- skip the gzip trailer and see if + there is more input after it */ + if (strm.avail_in < 8) { + fseeko(in, 8 - strm.avail_in, SEEK_CUR); + strm.avail_in = 0; + } + else { + strm.avail_in -= 8; + strm.next_in += 8; + } + if (strm.avail_in == 0 && ungetc(getc(in), in) == EOF) + /* the input ended after the gzip trailer -- done */ + break; + + /* there is more input, so another gzip member should follow -- + validate and skip the gzip header */ + ret = inflateReset2(&strm, 31); + if (ret != Z_OK) + goto deflate_index_extract_ret; + do { + if (strm.avail_in == 0) { + strm.avail_in = fread(input, 1, CHUNK, in); + if (ferror(in)) { + ret = Z_ERRNO; + goto deflate_index_extract_ret; + } + if (strm.avail_in == 0) { + ret = Z_DATA_ERROR; + goto deflate_index_extract_ret; + } + strm.next_in = input; + } + ret = inflate(&strm, Z_BLOCK); + if (ret == Z_MEM_ERROR || ret == Z_DATA_ERROR) + goto deflate_index_extract_ret; + } while ((strm.data_type & 128) == 0); + + /* set up to continue decompression of the raw deflate stream + that follows the gzip header */ + ret = inflateReset2(&strm, -15); + if (ret != Z_OK) + goto deflate_index_extract_ret; + } + + /* continue to process the available input before reading more */ } while (strm.avail_out != 0); - /* if reach end of stream, then don't keep trying to get more */ if (ret == Z_STREAM_END) + /* reached the end of the compressed data -- return the data that + was available, possibly less than requested */ break; - /* do until offset reached and requested data read, or stream ends */ + /* do until offset reached and requested data read */ } while (skip); - /* compute number of uncompressed bytes read after offset */ + /* compute the number of uncompressed bytes read after the offset */ ret = skip ? 0 : len - strm.avail_out; - /* clean up and return bytes read or error */ - extract_ret: + /* clean up and return the bytes read, or the negative error */ + deflate_index_extract_ret: (void)inflateEnd(&strm); return ret; } -/* Demonstrate the use of build_index() and extract() by processing the file - provided on the command line, and the extracting 16K from about 2/3rds of - the way through the uncompressed output, and writing that to stdout. */ +#ifdef TEST + +#define SPAN 1048576L /* desired distance between access points */ +#define LEN 16384 /* number of bytes to extract */ + +/* Demonstrate the use of deflate_index_build() and deflate_index_extract() by + processing the file provided on the command line, and extracting LEN bytes + from 2/3rds of the way through the uncompressed output, writing that to + stdout. An offset can be provided as the second argument, in which case the + data is extracted from there instead. */ int main(int argc, char **argv) { int len; - off_t offset; + off_t offset = -1; FILE *in; - struct access *index = NULL; - unsigned char buf[CHUNK]; + struct deflate_index *index = NULL; + unsigned char buf[LEN]; /* open input file */ - if (argc != 2) { - fprintf(stderr, "usage: zran file.gz\n"); + if (argc < 2 || argc > 3) { + fprintf(stderr, "usage: zran file.gz [offset]\n"); return 1; } in = fopen(argv[1], "rb"); @@ -370,8 +427,18 @@ return 1; } + /* get optional offset */ + if (argc == 3) { + char *end; + offset = strtoll(argv[2], &end, 10); + if (*end || offset < 0) { + fprintf(stderr, "zran: %s is not a valid offset\n", argv[2]); + return 1; + } + } + /* build index */ - len = build_index(in, SPAN, &index); + len = deflate_index_build(in, SPAN, &index); if (len < 0) { fclose(in); switch (len) { @@ -392,8 +459,9 @@ fprintf(stderr, "zran: built index with %d access points\n", len); /* use index by reading some bytes from an arbitrary offset */ - offset = (index->list[index->have - 1].out << 1) / 3; - len = extract(in, index, offset, buf, CHUNK); + if (offset == -1) + offset = (index->length << 1) / 3; + len = deflate_index_extract(in, index, offset, buf, LEN); if (len < 0) fprintf(stderr, "zran: extraction failed: %s error\n", len == Z_MEM_ERROR ? "out of memory" : "input corrupted"); @@ -403,7 +471,9 @@ } /* clean up and exit */ - free_index(index); + deflate_index_free(index); fclose(in); return 0; } + +#endif diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/examples/zran.h mame-0.243+dfsg.1/3rdparty/zlib/examples/zran.h --- mame-0.242+dfsg.1/3rdparty/zlib/examples/zran.h 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/examples/zran.h 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,40 @@ +/* zran.h -- example of zlib/gzip stream indexing and random access + * Copyright (C) 2005, 2012, 2018 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + * Version 1.2 14 Oct 2018 Mark Adler */ + +#include +#include "zlib.h" + +/* Access point list. */ +struct deflate_index { + int have; /* number of list entries */ + int gzip; /* 1 if the index is of a gzip file, 0 if it is of a + zlib stream */ + off_t length; /* total length of uncompressed data */ + void *list; /* allocated list of entries */ +}; + +/* Make one entire pass through a zlib or gzip compressed stream and build an + index, with access points about every span bytes of uncompressed output. + gzip files with multiple members are indexed in their entirety. span should + be chosen to balance the speed of random access against the memory + requirements of the list, about 32K bytes per access point. The return value + is the number of access points on success (>= 1), Z_MEM_ERROR for out of + memory, Z_DATA_ERROR for an error in the input file, or Z_ERRNO for a file + read error. On success, *built points to the resulting index. */ +int deflate_index_build(FILE *in, off_t span, struct deflate_index **built); + +/* Deallocate an index built by deflate_index_build() */ +void deflate_index_free(struct deflate_index *index); + +/* Use the index to read len bytes from offset into buf. Return bytes read or + negative for error (Z_DATA_ERROR or Z_MEM_ERROR). If data is requested past + the end of the uncompressed data, then deflate_index_extract() will return a + value less than len, indicating how much was actually read into buf. This + function should not return a data error unless the file was modified since + the index was generated, since deflate_index_build() validated all of the + input. deflate_index_extract() will return Z_ERRNO if there is an error on + reading or seeking the input file. */ +int deflate_index_extract(FILE *in, struct deflate_index *index, off_t offset, + unsigned char *buf, int len); diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/gzguts.h mame-0.243+dfsg.1/3rdparty/zlib/gzguts.h --- mame-0.242+dfsg.1/3rdparty/zlib/gzguts.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/gzguts.h 2022-04-29 05:37:26.000000000 +0000 @@ -1,5 +1,5 @@ /* gzguts.h -- zlib internal header definitions for gz* operations - * Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013, 2016 Mark Adler + * Copyright (C) 2004-2019 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -39,7 +39,7 @@ # include #endif -#if defined(_WIN32) || defined(__CYGWIN__) +#if defined(_WIN32) # define WIDECHAR #endif @@ -190,6 +190,7 @@ /* just for writing */ int level; /* compression level */ int strategy; /* compression strategy */ + int reset; /* true if a reset is pending after a Z_FINISH */ /* seek request */ z_off64_t skip; /* amount to skip (already rewound if backwards) */ int seek; /* true if seek request pending */ diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/gzlib.c mame-0.243+dfsg.1/3rdparty/zlib/gzlib.c --- mame-0.242+dfsg.1/3rdparty/zlib/gzlib.c 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/gzlib.c 2022-04-29 05:37:26.000000000 +0000 @@ -1,11 +1,11 @@ /* gzlib.c -- zlib functions common to reading and writing gzip files - * Copyright (C) 2004-2017 Mark Adler + * Copyright (C) 2004-2019 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ #include "gzguts.h" -#if defined(_WIN32) && !defined(__BORLANDC__) && !defined(__MINGW32__) +#if defined(_WIN32) && !defined(__BORLANDC__) # define LSEEK _lseeki64 #else #if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0 @@ -81,6 +81,8 @@ state->past = 0; /* have not read past end yet */ state->how = LOOK; /* look for gzip header */ } + else /* for writing ... */ + state->reset = 0; /* no deflateReset pending */ state->seek = 0; /* no seek request pending */ gz_error(state, Z_OK, NULL); /* clear error */ state->x.pos = 0; /* no uncompressed data yet */ @@ -397,7 +399,7 @@ /* if within raw area while reading, just go there */ if (state->mode == GZ_READ && state->how == COPY && state->x.pos + offset >= 0) { - ret = LSEEK(state->fd, offset - state->x.have, SEEK_CUR); + ret = LSEEK(state->fd, offset - (z_off64_t)state->x.have, SEEK_CUR); if (ret == -1) return -1; state->x.have = 0; diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/gzread.c mame-0.243+dfsg.1/3rdparty/zlib/gzread.c --- mame-0.242+dfsg.1/3rdparty/zlib/gzread.c 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/gzread.c 2022-04-29 05:37:26.000000000 +0000 @@ -1,5 +1,5 @@ /* gzread.c -- zlib functions for reading gzip files - * Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013, 2016 Mark Adler + * Copyright (C) 2004-2017 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -314,9 +314,9 @@ got = 0; do { /* set n to the maximum amount of len that fits in an unsigned int */ - n = -1; + n = (unsigned)-1; if (n > len) - n = len; + n = (unsigned)len; /* first just try copying data from the output buffer */ if (state->x.have) { @@ -397,7 +397,7 @@ } /* read len or fewer bytes to buf */ - len = gz_read(state, buf, len); + len = (unsigned)gz_read(state, buf, len); /* check for an error */ if (len == 0 && state->err != Z_OK && state->err != Z_BUF_ERROR) @@ -447,7 +447,6 @@ int ZEXPORT gzgetc(file) gzFile file; { - int ret; unsigned char buf[1]; gz_statep state; @@ -469,8 +468,7 @@ } /* nothing there -- try gz_read() */ - ret = gz_read(state, buf, 1); - return ret < 1 ? -1 : buf[0]; + return gz_read(state, buf, 1) < 1 ? -1 : buf[0]; } int ZEXPORT gzgetc_(file) diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/gzwrite.c mame-0.243+dfsg.1/3rdparty/zlib/gzwrite.c --- mame-0.242+dfsg.1/3rdparty/zlib/gzwrite.c 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/gzwrite.c 2022-04-29 05:37:26.000000000 +0000 @@ -1,5 +1,5 @@ /* gzwrite.c -- zlib functions for writing gzip files - * Copyright (C) 2004-2017 Mark Adler + * Copyright (C) 2004-2019 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -97,6 +97,15 @@ return 0; } + /* check for a pending reset */ + if (state->reset) { + /* don't start a new gzip member unless there is data to write */ + if (strm->avail_in == 0) + return 0; + deflateReset(strm); + state->reset = 0; + } + /* run deflate() on provided input until it produces no more output */ ret = Z_OK; do { @@ -134,7 +143,7 @@ /* if that completed a deflate stream, allow another to start */ if (flush == Z_FINISH) - deflateReset(strm); + state->reset = 1; /* all done, no errors */ return 0; @@ -209,7 +218,7 @@ state->in); copy = state->size - have; if (copy > len) - copy = len; + copy = (unsigned)len; memcpy(state->in + have, buf, copy); state->strm.avail_in += copy; state->x.pos += copy; @@ -229,7 +238,7 @@ do { unsigned n = (unsigned)-1; if (n > len) - n = len; + n = (unsigned)len; state->strm.avail_in = n; state->x.pos += n; if (gz_comp(state, Z_NO_FLUSH) == -1) @@ -349,12 +358,11 @@ } /* -- see zlib.h -- */ -int ZEXPORT gzputs(file, str) +int ZEXPORT gzputs(file, s) gzFile file; - const char *str; + const char *s; { - int ret; - z_size_t len; + z_size_t len, put; gz_statep state; /* get internal structure */ @@ -367,9 +375,13 @@ return -1; /* write string */ - len = strlen(str); - ret = gz_write(state, str, len); - return ret == 0 && len != 0 ? -1 : ret; + len = strlen(s); + if ((int)len < 0 || (unsigned)len != len) { + gz_error(state, Z_STREAM_ERROR, "string length does not fit in int"); + return -1; + } + put = gz_write(state, s, len); + return put < len ? -1 : (int)len; } #if defined(STDC) || defined(Z_HAVE_STDARG_H) @@ -441,7 +453,7 @@ strm->avail_in = state->size; if (gz_comp(state, Z_NO_FLUSH) == -1) return state->err; - memcpy(state->in, state->in + state->size, left); + memmove(state->in, state->in + state->size, left); strm->next_in = state->in; strm->avail_in = left; } @@ -540,7 +552,7 @@ strm->avail_in = state->size; if (gz_comp(state, Z_NO_FLUSH) == -1) return state->err; - memcpy(state->in, state->in + state->size, left); + memmove(state->in, state->in + state->size, left); strm->next_in = state->in; strm->avail_in = left; } diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/infback.c mame-0.243+dfsg.1/3rdparty/zlib/infback.c --- mame-0.242+dfsg.1/3rdparty/zlib/infback.c 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/infback.c 2022-04-29 05:37:26.000000000 +0000 @@ -1,5 +1,5 @@ /* infback.c -- inflate using a call-back interface - * Copyright (C) 1995-2016 Mark Adler + * Copyright (C) 1995-2022 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -477,6 +477,7 @@ } Tracev((stderr, "inflate: codes ok\n")); state->mode = LEN; + /* fallthrough */ case LEN: /* use inflate_fast() if we have enough input and output */ diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/inffast.c mame-0.243+dfsg.1/3rdparty/zlib/inffast.c --- mame-0.242+dfsg.1/3rdparty/zlib/inffast.c 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/inffast.c 2022-04-29 05:37:26.000000000 +0000 @@ -70,7 +70,7 @@ code const FAR *dcode; /* local strm->distcode */ unsigned lmask; /* mask for first level of length codes */ unsigned dmask; /* mask for first level of distance codes */ - code here; /* retrieved table entry */ + code const *here; /* retrieved table entry */ unsigned op; /* code bits, operation, extra bits, or */ /* window position, window bytes to copy */ unsigned len; /* match length, unused bytes */ @@ -107,20 +107,20 @@ hold += (unsigned long)(*in++) << bits; bits += 8; } - here = lcode[hold & lmask]; + here = lcode + (hold & lmask); dolen: - op = (unsigned)(here.bits); + op = (unsigned)(here->bits); hold >>= op; bits -= op; - op = (unsigned)(here.op); + op = (unsigned)(here->op); if (op == 0) { /* literal */ - Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ? + Tracevv((stderr, here->val >= 0x20 && here->val < 0x7f ? "inflate: literal '%c'\n" : - "inflate: literal 0x%02x\n", here.val)); - *out++ = (unsigned char)(here.val); + "inflate: literal 0x%02x\n", here->val)); + *out++ = (unsigned char)(here->val); } else if (op & 16) { /* length base */ - len = (unsigned)(here.val); + len = (unsigned)(here->val); op &= 15; /* number of extra bits */ if (op) { if (bits < op) { @@ -138,14 +138,14 @@ hold += (unsigned long)(*in++) << bits; bits += 8; } - here = dcode[hold & dmask]; + here = dcode + (hold & dmask); dodist: - op = (unsigned)(here.bits); + op = (unsigned)(here->bits); hold >>= op; bits -= op; - op = (unsigned)(here.op); + op = (unsigned)(here->op); if (op & 16) { /* distance base */ - dist = (unsigned)(here.val); + dist = (unsigned)(here->val); op &= 15; /* number of extra bits */ if (bits < op) { hold += (unsigned long)(*in++) << bits; @@ -264,7 +264,7 @@ } } else if ((op & 64) == 0) { /* 2nd level distance code */ - here = dcode[here.val + (hold & ((1U << op) - 1))]; + here = dcode + here->val + (hold & ((1U << op) - 1)); goto dodist; } else { @@ -274,7 +274,7 @@ } } else if ((op & 64) == 0) { /* 2nd level length code */ - here = lcode[here.val + (hold & ((1U << op) - 1))]; + here = lcode + here->val + (hold & ((1U << op) - 1)); goto dolen; } else if (op & 32) { /* end-of-block */ diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/inflate.c mame-0.243+dfsg.1/3rdparty/zlib/inflate.c --- mame-0.242+dfsg.1/3rdparty/zlib/inflate.c 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/inflate.c 2022-04-29 05:37:26.000000000 +0000 @@ -1,5 +1,5 @@ /* inflate.c -- zlib decompression - * Copyright (C) 1995-2016 Mark Adler + * Copyright (C) 1995-2022 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -130,6 +130,7 @@ state->mode = HEAD; state->last = 0; state->havedict = 0; + state->flags = -1; state->dmax = 32768U; state->head = Z_NULL; state->hold = 0; @@ -447,10 +448,10 @@ /* check function to use adler32() for zlib or crc32() for gzip */ #ifdef GUNZIP -# define UPDATE(check, buf, len) \ +# define UPDATE_CHECK(check, buf, len) \ (state->flags ? crc32(check, buf, len) : adler32(check, buf, len)) #else -# define UPDATE(check, buf, len) adler32(check, buf, len) +# define UPDATE_CHECK(check, buf, len) adler32(check, buf, len) #endif /* check macros for header crc */ @@ -670,7 +671,6 @@ state->mode = FLAGS; break; } - state->flags = 0; /* expect zlib header */ if (state->head != Z_NULL) state->head->done = -1; if (!(state->wrap & 1) || /* check if zlib header allowed */ @@ -697,6 +697,7 @@ break; } state->dmax = 1U << len; + state->flags = 0; /* indicate zlib header */ Tracev((stderr, "inflate: zlib header ok\n")); strm->adler = state->check = adler32(0L, Z_NULL, 0); state->mode = hold & 0x200 ? DICTID : TYPE; @@ -722,6 +723,7 @@ CRC2(state->check, hold); INITBITS(); state->mode = TIME; + /* fallthrough */ case TIME: NEEDBITS(32); if (state->head != Z_NULL) @@ -730,6 +732,7 @@ CRC4(state->check, hold); INITBITS(); state->mode = OS; + /* fallthrough */ case OS: NEEDBITS(16); if (state->head != Z_NULL) { @@ -740,6 +743,7 @@ CRC2(state->check, hold); INITBITS(); state->mode = EXLEN; + /* fallthrough */ case EXLEN: if (state->flags & 0x0400) { NEEDBITS(16); @@ -753,6 +757,7 @@ else if (state->head != Z_NULL) state->head->extra = Z_NULL; state->mode = EXTRA; + /* fallthrough */ case EXTRA: if (state->flags & 0x0400) { copy = state->length; @@ -775,6 +780,7 @@ } state->length = 0; state->mode = NAME; + /* fallthrough */ case NAME: if (state->flags & 0x0800) { if (have == 0) goto inf_leave; @@ -796,6 +802,7 @@ state->head->name = Z_NULL; state->length = 0; state->mode = COMMENT; + /* fallthrough */ case COMMENT: if (state->flags & 0x1000) { if (have == 0) goto inf_leave; @@ -816,6 +823,7 @@ else if (state->head != Z_NULL) state->head->comment = Z_NULL; state->mode = HCRC; + /* fallthrough */ case HCRC: if (state->flags & 0x0200) { NEEDBITS(16); @@ -839,6 +847,7 @@ strm->adler = state->check = ZSWAP32(hold); INITBITS(); state->mode = DICT; + /* fallthrough */ case DICT: if (state->havedict == 0) { RESTORE(); @@ -846,8 +855,10 @@ } strm->adler = state->check = adler32(0L, Z_NULL, 0); state->mode = TYPE; + /* fallthrough */ case TYPE: if (flush == Z_BLOCK || flush == Z_TREES) goto inf_leave; + /* fallthrough */ case TYPEDO: if (state->last) { BYTEBITS(); @@ -898,8 +909,10 @@ INITBITS(); state->mode = COPY_; if (flush == Z_TREES) goto inf_leave; + /* fallthrough */ case COPY_: state->mode = COPY; + /* fallthrough */ case COPY: copy = state->length; if (copy) { @@ -935,6 +948,7 @@ Tracev((stderr, "inflate: table sizes ok\n")); state->have = 0; state->mode = LENLENS; + /* fallthrough */ case LENLENS: while (state->have < state->ncode) { NEEDBITS(3); @@ -956,6 +970,7 @@ Tracev((stderr, "inflate: code lengths ok\n")); state->have = 0; state->mode = CODELENS; + /* fallthrough */ case CODELENS: while (state->have < state->nlen + state->ndist) { for (;;) { @@ -1039,8 +1054,10 @@ Tracev((stderr, "inflate: codes ok\n")); state->mode = LEN_; if (flush == Z_TREES) goto inf_leave; + /* fallthrough */ case LEN_: state->mode = LEN; + /* fallthrough */ case LEN: if (have >= 6 && left >= 258) { RESTORE(); @@ -1090,6 +1107,7 @@ } state->extra = (unsigned)(here.op) & 15; state->mode = LENEXT; + /* fallthrough */ case LENEXT: if (state->extra) { NEEDBITS(state->extra); @@ -1100,6 +1118,7 @@ Tracevv((stderr, "inflate: length %u\n", state->length)); state->was = state->length; state->mode = DIST; + /* fallthrough */ case DIST: for (;;) { here = state->distcode[BITS(state->distbits)]; @@ -1127,6 +1146,7 @@ state->offset = (unsigned)here.val; state->extra = (unsigned)(here.op) & 15; state->mode = DISTEXT; + /* fallthrough */ case DISTEXT: if (state->extra) { NEEDBITS(state->extra); @@ -1143,6 +1163,7 @@ #endif Tracevv((stderr, "inflate: distance %u\n", state->offset)); state->mode = MATCH; + /* fallthrough */ case MATCH: if (left == 0) goto inf_leave; copy = out - left; @@ -1202,7 +1223,7 @@ state->total += out; if ((state->wrap & 4) && out) strm->adler = state->check = - UPDATE(state->check, put - out, out); + UPDATE_CHECK(state->check, put - out, out); out = left; if ((state->wrap & 4) && ( #ifdef GUNZIP @@ -1218,10 +1239,11 @@ } #ifdef GUNZIP state->mode = LENGTH; + /* fallthrough */ case LENGTH: if (state->wrap && state->flags) { NEEDBITS(32); - if (hold != (state->total & 0xffffffffUL)) { + if ((state->wrap & 4) && hold != (state->total & 0xffffffff)) { strm->msg = (char *)"incorrect length check"; state->mode = BAD; break; @@ -1231,6 +1253,7 @@ } #endif state->mode = DONE; + /* fallthrough */ case DONE: ret = Z_STREAM_END; goto inf_leave; @@ -1240,6 +1263,7 @@ case MEM: return Z_MEM_ERROR; case SYNC: + /* fallthrough */ default: return Z_STREAM_ERROR; } @@ -1265,7 +1289,7 @@ state->total += out; if ((state->wrap & 4) && out) strm->adler = state->check = - UPDATE(state->check, strm->next_out - out, out); + UPDATE_CHECK(state->check, strm->next_out - out, out); strm->data_type = (int)state->bits + (state->last ? 64 : 0) + (state->mode == TYPE ? 128 : 0) + (state->mode == LEN_ || state->mode == COPY_ ? 256 : 0); @@ -1401,6 +1425,7 @@ z_streamp strm; { unsigned len; /* number of bytes to look at or looked at */ + int flags; /* temporary to save header status */ unsigned long in, out; /* temporary to save total_in and total_out */ unsigned char buf[4]; /* to restore bit buffer to byte string */ struct inflate_state FAR *state; @@ -1433,9 +1458,15 @@ /* return no joy or set up to restart inflate() on a new block */ if (state->have != 4) return Z_DATA_ERROR; + if (state->flags == -1) + state->wrap = 0; /* if no header yet, treat as raw */ + else + state->wrap &= ~4; /* no point in computing a check value now */ + flags = state->flags; in = strm->total_in; out = strm->total_out; inflateReset(strm); strm->total_in = in; strm->total_out = out; + state->flags = flags; state->mode = TYPE; return Z_OK; } @@ -1531,7 +1562,7 @@ if (inflateStateCheck(strm)) return Z_STREAM_ERROR; state = (struct inflate_state FAR *)strm->state; - if (check) + if (check && state->wrap) state->wrap |= 4; else state->wrap &= ~4; diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/inflate.h mame-0.243+dfsg.1/3rdparty/zlib/inflate.h --- mame-0.242+dfsg.1/3rdparty/zlib/inflate.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/inflate.h 2022-04-29 05:37:26.000000000 +0000 @@ -1,5 +1,5 @@ /* inflate.h -- internal inflate state definition - * Copyright (C) 1995-2016 Mark Adler + * Copyright (C) 1995-2019 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -86,7 +86,8 @@ int wrap; /* bit 0 true for zlib, bit 1 true for gzip, bit 2 true to validate check value */ int havedict; /* true if dictionary provided */ - int flags; /* gzip header method and flags (0 if zlib) */ + int flags; /* gzip header method and flags, 0 if zlib, or + -1 if raw or no header yet */ unsigned dmax; /* zlib header max distance (INFLATE_STRICT) */ unsigned long check; /* protected copy of check value */ unsigned long total; /* protected copy of output count */ diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/inftrees.c mame-0.243+dfsg.1/3rdparty/zlib/inftrees.c --- mame-0.242+dfsg.1/3rdparty/zlib/inftrees.c 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/inftrees.c 2022-04-29 05:37:26.000000000 +0000 @@ -1,5 +1,5 @@ /* inftrees.c -- generate Huffman trees for efficient decoding - * Copyright (C) 1995-2017 Mark Adler + * Copyright (C) 1995-2022 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -9,7 +9,7 @@ #define MAXBITS 15 const char inflate_copyright[] = - " inflate 1.2.11 Copyright 1995-2017 Mark Adler "; + " inflate 1.2.12 Copyright 1995-2022 Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot @@ -62,7 +62,7 @@ 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; static const unsigned short lext[31] = { /* Length codes 257..285 extra */ 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, - 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 77, 202}; + 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 199, 202}; static const unsigned short dbase[32] = { /* Distance codes 0..29 base */ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/Makefile.in mame-0.243+dfsg.1/3rdparty/zlib/Makefile.in --- mame-0.242+dfsg.1/3rdparty/zlib/Makefile.in 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/Makefile.in 2022-04-29 05:37:26.000000000 +0000 @@ -32,7 +32,7 @@ STATICLIB=libz.a SHAREDLIB=libz.so -SHAREDLIBV=libz.so.1.2.11 +SHAREDLIBV=libz.so.1.2.12 SHAREDLIBM=libz.so.1 LIBS=$(STATICLIB) $(SHAREDLIBV) @@ -91,8 +91,8 @@ echo ' *** zlib test OK ***'; \ else \ echo ' *** zlib test FAILED ***'; false; \ - fi; \ - rm -f $$TMPST + fi + @rm -f tmpst_$$ testshared: shared @LD_LIBRARY_PATH=`pwd`:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \ @@ -104,8 +104,8 @@ echo ' *** zlib shared test OK ***'; \ else \ echo ' *** zlib shared test FAILED ***'; false; \ - fi; \ - rm -f $$TMPSH + fi + @rm -f tmpsh_$$ test64: all64 @TMP64=tmp64_$$; \ @@ -113,8 +113,8 @@ echo ' *** zlib 64-bit test OK ***'; \ else \ echo ' *** zlib 64-bit test FAILED ***'; false; \ - fi; \ - rm -f $$TMP64 + fi + @rm -f tmp64_$$ infcover.o: $(SRCDIR)test/infcover.c $(SRCDIR)zlib.h zconf.h $(CC) $(CFLAGS) $(ZINCOUT) -c -o $@ $(SRCDIR)test/infcover.c @@ -376,15 +376,13 @@ rm -f contrib/infback9/*.gcda contrib/infback9/*.gcno contrib/infback9/*.gcov maintainer-clean: distclean -distclean: clean zconf zconf.h.cmakein docs +distclean: clean zconf zconf.h.cmakein rm -f Makefile zlib.pc configure.log -@rm -f .DS_Store @if [ -f Makefile.in ]; then \ printf 'all:\n\t-@echo "Please use ./configure first. Thank you."\n' > Makefile ; \ printf '\ndistclean:\n\tmake -f Makefile.in distclean\n' >> Makefile ; \ touch -r $(SRCDIR)Makefile.in Makefile ; fi - @if [ ! -f zconf.h.in ]; then rm -f zconf.h zconf.h.cmakein ; fi - @if [ ! -f zlib.3 ]; then rm -f zlib.3.pdf ; fi tags: etags $(SRCDIR)*.[ch] diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/os400/README400 mame-0.243+dfsg.1/3rdparty/zlib/os400/README400 --- mame-0.242+dfsg.1/3rdparty/zlib/os400/README400 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/os400/README400 2022-04-29 05:37:26.000000000 +0000 @@ -1,4 +1,4 @@ - ZLIB version 1.2.11 for OS/400 installation instructions + ZLIB version 1.2.12 for OS/400 installation instructions 1) Download and unpack the zlib tarball to some IFS directory. (i.e.: /path/to/the/zlib/ifs/source/directory) diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/os400/zlib.inc mame-0.243+dfsg.1/3rdparty/zlib/os400/zlib.inc --- mame-0.242+dfsg.1/3rdparty/zlib/os400/zlib.inc 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/os400/zlib.inc 2022-04-29 05:37:26.000000000 +0000 @@ -1,7 +1,7 @@ * ZLIB.INC - Interface to the general purpose compression library * * ILE RPG400 version by Patrick Monnerat, DATASPHERE. - * Version 1.2.11 + * Version 1.2.12 * * * WARNING: @@ -22,12 +22,12 @@ * * Versioning information. * - D ZLIB_VERSION C '1.2.11' + D ZLIB_VERSION C '1.2.12' D ZLIB_VERNUM C X'12a0' D ZLIB_VER_MAJOR C 1 D ZLIB_VER_MINOR C 2 D ZLIB_VER_REVISION... - D C 11 + D C 12 D ZLIB_VER_SUBREVISION... D C 0 * diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/qnx/package.qpg mame-0.243+dfsg.1/3rdparty/zlib/qnx/package.qpg --- mame-0.242+dfsg.1/3rdparty/zlib/qnx/package.qpg 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/qnx/package.qpg 2022-04-29 05:37:26.000000000 +0000 @@ -25,10 +25,10 @@ - - - - + + + + @@ -63,7 +63,7 @@ - 1.2.11 + 1.2.12 Medium Stable diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/README mame-0.243+dfsg.1/3rdparty/zlib/README --- mame-0.242+dfsg.1/3rdparty/zlib/README 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/README 2022-04-29 05:37:26.000000000 +0000 @@ -1,6 +1,6 @@ ZLIB DATA COMPRESSION LIBRARY -zlib 1.2.11 is a general purpose data compression library. All the code is +zlib 1.2.12 is a general purpose data compression library. All the code is thread safe. The data format used by the zlib library is described by RFCs (Request for Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950 (zlib format), rfc1951 (deflate format) and @@ -31,7 +31,7 @@ issue of Dr. Dobb's Journal; a copy of the article is available at http://marknelson.us/1997/01/01/zlib-engine/ . -The changes made in version 1.2.11 are documented in the file ChangeLog. +The changes made in version 1.2.12 are documented in the file ChangeLog. Unsupported third party contributions are provided in directory contrib/ . @@ -84,7 +84,7 @@ Copyright notice: - (C) 1995-2017 Jean-loup Gailly and Mark Adler + (C) 1995-2022 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -108,7 +108,10 @@ If you use the zlib library in a product, we would appreciate *not* receiving lengthy legal documents to sign. The sources are provided for free but without warranty of any kind. The library has been entirely written by Jean-loup -Gailly and Mark Adler; it does not include third-party code. +Gailly and Mark Adler; it does not include third-party code. We make all +contributions to and distributions of this project solely in our personal +capacity, and are not conveying any rights to any intellectual property of +any third parties. If you redistribute modified sources, we would appreciate that you include in the file ChangeLog history information documenting your changes. Please read diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/test/example.c mame-0.243+dfsg.1/3rdparty/zlib/test/example.c --- mame-0.242+dfsg.1/3rdparty/zlib/test/example.c 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/test/example.c 2022-04-29 05:37:26.000000000 +0000 @@ -440,9 +440,8 @@ CHECK_ERR(err, "inflateSync"); err = inflate(&d_stream, Z_FINISH); - if (err != Z_DATA_ERROR) { - fprintf(stderr, "inflate should report DATA_ERROR\n"); - /* Because of incorrect adler32 */ + if (err != Z_STREAM_END) { + fprintf(stderr, "inflate should report Z_STREAM_END\n"); exit(1); } err = inflateEnd(&d_stream); diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/treebuild.xml mame-0.243+dfsg.1/3rdparty/zlib/treebuild.xml --- mame-0.242+dfsg.1/3rdparty/zlib/treebuild.xml 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/treebuild.xml 2022-04-29 05:37:26.000000000 +0000 @@ -1,6 +1,6 @@ - - + + zip compression library diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/trees.c mame-0.243+dfsg.1/3rdparty/zlib/trees.c --- mame-0.242+dfsg.1/3rdparty/zlib/trees.c 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/trees.c 2022-04-29 05:37:26.000000000 +0000 @@ -1,5 +1,5 @@ /* trees.c -- output deflated data using Huffman coding - * Copyright (C) 1995-2017 Jean-loup Gailly + * Copyright (C) 1995-2021 Jean-loup Gailly * detect_data_type() function provided freely by Cosmin Truta, 2006 * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -149,7 +149,7 @@ local void compress_block OF((deflate_state *s, const ct_data *ltree, const ct_data *dtree)); local int detect_data_type OF((deflate_state *s)); -local unsigned bi_reverse OF((unsigned value, int length)); +local unsigned bi_reverse OF((unsigned code, int len)); local void bi_windup OF((deflate_state *s)); local void bi_flush OF((deflate_state *s)); @@ -416,7 +416,7 @@ s->dyn_ltree[END_BLOCK].Freq = 1; s->opt_len = s->static_len = 0L; - s->last_lit = s->matches = 0; + s->sym_next = s->matches = 0; } #define SMALLEST 1 @@ -870,7 +870,8 @@ bi_windup(s); /* align on byte boundary */ put_short(s, (ush)stored_len); put_short(s, (ush)~stored_len); - zmemcpy(s->pending_buf + s->pending, (Bytef *)buf, stored_len); + if (stored_len) + zmemcpy(s->pending_buf + s->pending, (Bytef *)buf, stored_len); s->pending += stored_len; #ifdef ZLIB_DEBUG s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L; @@ -947,7 +948,7 @@ Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ", opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len, - s->last_lit)); + s->sym_next / 3)); if (static_lenb <= opt_lenb) opt_lenb = static_lenb; @@ -1016,8 +1017,9 @@ unsigned dist; /* distance of matched string */ unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */ { - s->d_buf[s->last_lit] = (ush)dist; - s->l_buf[s->last_lit++] = (uch)lc; + s->sym_buf[s->sym_next++] = dist; + s->sym_buf[s->sym_next++] = dist >> 8; + s->sym_buf[s->sym_next++] = lc; if (dist == 0) { /* lc is the unmatched char */ s->dyn_ltree[lc].Freq++; @@ -1032,30 +1034,7 @@ s->dyn_ltree[_length_code[lc]+LITERALS+1].Freq++; s->dyn_dtree[d_code(dist)].Freq++; } - -#ifdef TRUNCATE_BLOCK - /* Try to guess if it is profitable to stop the current block here */ - if ((s->last_lit & 0x1fff) == 0 && s->level > 2) { - /* Compute an upper bound for the compressed length */ - ulg out_length = (ulg)s->last_lit*8L; - ulg in_length = (ulg)((long)s->strstart - s->block_start); - int dcode; - for (dcode = 0; dcode < D_CODES; dcode++) { - out_length += (ulg)s->dyn_dtree[dcode].Freq * - (5L+extra_dbits[dcode]); - } - out_length >>= 3; - Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ", - s->last_lit, in_length, out_length, - 100L - out_length*100L/in_length)); - if (s->matches < s->last_lit/2 && out_length < in_length/2) return 1; - } -#endif - return (s->last_lit == s->lit_bufsize-1); - /* We avoid equality with lit_bufsize because of wraparound at 64K - * on 16 bit machines and because stored blocks are restricted to - * 64K-1 bytes. - */ + return (s->sym_next == s->sym_end); } /* =========================================================================== @@ -1068,13 +1047,14 @@ { unsigned dist; /* distance of matched string */ int lc; /* match length or unmatched char (if dist == 0) */ - unsigned lx = 0; /* running index in l_buf */ + unsigned sx = 0; /* running index in sym_buf */ unsigned code; /* the code to send */ int extra; /* number of extra bits to send */ - if (s->last_lit != 0) do { - dist = s->d_buf[lx]; - lc = s->l_buf[lx++]; + if (s->sym_next != 0) do { + dist = s->sym_buf[sx++] & 0xff; + dist += (unsigned)(s->sym_buf[sx++] & 0xff) << 8; + lc = s->sym_buf[sx++]; if (dist == 0) { send_code(s, lc, ltree); /* send a literal byte */ Tracecv(isgraph(lc), (stderr," '%c' ", lc)); @@ -1099,11 +1079,10 @@ } } /* literal or match pair ? */ - /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */ - Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx, - "pendingBuf overflow"); + /* Check that the overlay between pending_buf and sym_buf is ok: */ + Assert(s->pending < s->lit_bufsize + sx, "pendingBuf overflow"); - } while (lx < s->last_lit); + } while (sx < s->sym_next); send_code(s, END_BLOCK, ltree); } @@ -1112,9 +1091,9 @@ * Check if the data type is TEXT or BINARY, using the following algorithm: * - TEXT if the two conditions below are satisfied: * a) There are no non-portable control characters belonging to the - * "black list" (0..6, 14..25, 28..31). + * "block list" (0..6, 14..25, 28..31). * b) There is at least one printable character belonging to the - * "white list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255). + * "allow list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255). * - BINARY otherwise. * - The following partially-portable control characters form a * "gray list" that is ignored in this detection algorithm: @@ -1124,19 +1103,19 @@ local int detect_data_type(s) deflate_state *s; { - /* black_mask is the bit mask of black-listed bytes + /* block_mask is the bit mask of block-listed bytes * set bits 0..6, 14..25, and 28..31 * 0xf3ffc07f = binary 11110011111111111100000001111111 */ - unsigned long black_mask = 0xf3ffc07fUL; + unsigned long block_mask = 0xf3ffc07fUL; int n; - /* Check for non-textual ("black-listed") bytes. */ - for (n = 0; n <= 31; n++, black_mask >>= 1) - if ((black_mask & 1) && (s->dyn_ltree[n].Freq != 0)) + /* Check for non-textual ("block-listed") bytes. */ + for (n = 0; n <= 31; n++, block_mask >>= 1) + if ((block_mask & 1) && (s->dyn_ltree[n].Freq != 0)) return Z_BINARY; - /* Check for textual ("white-listed") bytes. */ + /* Check for textual ("allow-listed") bytes. */ if (s->dyn_ltree[9].Freq != 0 || s->dyn_ltree[10].Freq != 0 || s->dyn_ltree[13].Freq != 0) return Z_TEXT; @@ -1144,7 +1123,7 @@ if (s->dyn_ltree[n].Freq != 0) return Z_TEXT; - /* There are no "black-listed" or "white-listed" bytes: + /* There are no "block-listed" or "allow-listed" bytes: * this stream either is empty or has tolerated ("gray-listed") bytes only. */ return Z_BINARY; diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/win32/Makefile.bor mame-0.243+dfsg.1/3rdparty/zlib/win32/Makefile.bor --- mame-0.242+dfsg.1/3rdparty/zlib/win32/Makefile.bor 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/win32/Makefile.bor 2022-04-29 05:37:26.000000000 +0000 @@ -3,7 +3,6 @@ # # Usage: # make -f win32/Makefile.bor -# make -f win32/Makefile.bor LOCAL_ZLIB=-DASMV OBJA=match.obj OBJPA=+match.obj # ------------ Borland C++ ------------ diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/win32/Makefile.gcc mame-0.243+dfsg.1/3rdparty/zlib/win32/Makefile.gcc --- mame-0.242+dfsg.1/3rdparty/zlib/win32/Makefile.gcc 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/win32/Makefile.gcc 2022-04-29 05:37:26.000000000 +0000 @@ -11,10 +11,6 @@ # # make -fwin32/Makefile.gcc; make test testdll -fwin32/Makefile.gcc # -# To use the asm code, type: -# cp contrib/asm?86/match.S ./match.S -# make LOC=-DASMV OBJA=match.o -fwin32/Makefile.gcc -# # To install libz.a, zconf.h and zlib.h in the system directories, type: # # make install -fwin32/Makefile.gcc @@ -38,7 +34,6 @@ # SHARED_MODE=0 -#LOC = -DASMV #LOC = -DZLIB_DEBUG -g PREFIX = diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/win32/Makefile.msc mame-0.243+dfsg.1/3rdparty/zlib/win32/Makefile.msc --- mame-0.242+dfsg.1/3rdparty/zlib/win32/Makefile.msc 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/win32/Makefile.msc 2022-04-29 05:37:26.000000000 +0000 @@ -4,10 +4,6 @@ # Usage: # nmake -f win32/Makefile.msc (standard build) # nmake -f win32/Makefile.msc LOC=-DFOO (nonstandard build) -# nmake -f win32/Makefile.msc LOC="-DASMV -DASMINF" \ -# OBJA="inffas32.obj match686.obj" (use ASM code, x86) -# nmake -f win32/Makefile.msc AS=ml64 LOC="-DASMV -DASMINF -I." \ -# OBJA="inffasx64.obj gvmat64.obj inffas8664.obj" (use ASM code, x64) # The toplevel directory of the source tree. # diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/win32/README-WIN32.txt mame-0.243+dfsg.1/3rdparty/zlib/win32/README-WIN32.txt --- mame-0.242+dfsg.1/3rdparty/zlib/win32/README-WIN32.txt 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/win32/README-WIN32.txt 2022-04-29 05:37:26.000000000 +0000 @@ -1,6 +1,6 @@ ZLIB DATA COMPRESSION LIBRARY -zlib 1.2.11 is a general purpose data compression library. All the code is +zlib 1.2.12 is a general purpose data compression library. All the code is thread safe. The data format used by the zlib library is described by RFCs (Request for Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format) @@ -22,7 +22,7 @@ Manifest: -The package zlib-1.2.11-win32-x86.zip will contain the following files: +The package zlib-1.2.12-win32-x86.zip will contain the following files: README-WIN32.txt This document ChangeLog Changes since previous zlib packages diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/win32/zlib.def mame-0.243+dfsg.1/3rdparty/zlib/win32/zlib.def --- mame-0.242+dfsg.1/3rdparty/zlib/win32/zlib.def 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/win32/zlib.def 2022-04-29 05:37:26.000000000 +0000 @@ -69,6 +69,7 @@ gzoffset64 adler32_combine64 crc32_combine64 + crc32_combine_gen64 ; checksum functions adler32 adler32_z @@ -76,6 +77,8 @@ crc32_z adler32_combine crc32_combine + crc32_combine_gen + crc32_combine_op ; various hacks, don't look :) deflateInit_ deflateInit2_ diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/zlib.3 mame-0.243+dfsg.1/3rdparty/zlib/zlib.3 --- mame-0.242+dfsg.1/3rdparty/zlib/zlib.3 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/zlib.3 2022-04-29 05:37:26.000000000 +0000 @@ -1,4 +1,4 @@ -.TH ZLIB 3 "15 Jan 2017" +.TH ZLIB 3 "27 Mar 2022" .SH NAME zlib \- compression/decompression library .SH SYNOPSIS @@ -105,9 +105,9 @@ Send questions and/or comments to zlib@gzip.org, or (for the Windows DLL version) to Gilles Vollant (info@winimage.com). .SH AUTHORS AND LICENSE -Version 1.2.11 +Version 1.2.12 .LP -Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler +Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler .LP This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages Binary files /tmp/tmpaxne9i8m/fOJLViudrj/mame-0.242+dfsg.1/3rdparty/zlib/zlib.3.pdf and /tmp/tmpaxne9i8m/sRTM7IrWu_/mame-0.243+dfsg.1/3rdparty/zlib/zlib.3.pdf differ diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/zlib.h mame-0.243+dfsg.1/3rdparty/zlib/zlib.h --- mame-0.242+dfsg.1/3rdparty/zlib/zlib.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/zlib.h 2022-04-29 05:37:26.000000000 +0000 @@ -1,7 +1,7 @@ /* zlib.h -- interface of the 'zlib' general purpose compression library - version 1.2.11, January 15th, 2017 + version 1.2.12, March 11th, 2022 - Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler + Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -37,11 +37,11 @@ extern "C" { #endif -#define ZLIB_VERSION "1.2.11" -#define ZLIB_VERNUM 0x12b0 +#define ZLIB_VERSION "1.2.12" +#define ZLIB_VERNUM 0x12c0 #define ZLIB_VER_MAJOR 1 #define ZLIB_VER_MINOR 2 -#define ZLIB_VER_REVISION 11 +#define ZLIB_VER_REVISION 12 #define ZLIB_VER_SUBREVISION 0 /* @@ -543,8 +543,7 @@ int strategy)); This is another version of deflateInit with more compression options. The - fields next_in, zalloc, zfree and opaque must be initialized before by the - caller. + fields zalloc, zfree and opaque must be initialized before by the caller. The method parameter is the compression method. It must be Z_DEFLATED in this version of the library. @@ -712,11 +711,12 @@ used to switch between compression and straight copy of the input data, or to switch to a different kind of input data requiring a different strategy. If the compression approach (which is a function of the level) or the - strategy is changed, and if any input has been consumed in a previous - deflate() call, then the input available so far is compressed with the old - level and strategy using deflate(strm, Z_BLOCK). There are three approaches - for the compression levels 0, 1..3, and 4..9 respectively. The new level - and strategy will take effect at the next call of deflate(). + strategy is changed, and if there have been any deflate() calls since the + state was initialized or reset, then the input available so far is + compressed with the old level and strategy using deflate(strm, Z_BLOCK). + There are three approaches for the compression levels 0, 1..3, and 4..9 + respectively. The new level and strategy will take effect at the next call + of deflate(). If a deflate(strm, Z_BLOCK) is performed by deflateParams(), and it does not have enough output space to complete, then the parameter change will not @@ -865,9 +865,11 @@ detection, or add 16 to decode only the gzip format (the zlib format will return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a CRC-32 instead of an Adler-32. Unlike the gunzip utility and gzread() (see - below), inflate() will not automatically decode concatenated gzip streams. - inflate() will return Z_STREAM_END at the end of the gzip stream. The state - would need to be reset to continue decoding a subsequent gzip stream. + below), inflate() will *not* automatically decode concatenated gzip members. + inflate() will return Z_STREAM_END at the end of the gzip member. The state + would need to be reset to continue decoding a subsequent gzip member. This + *must* be done if there is more data after a gzip member, in order for the + decompression to be compliant with the gzip standard (RFC 1952). inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_VERSION_ERROR if the zlib library version is incompatible with the @@ -1302,14 +1304,14 @@ /* ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); - Opens a gzip (.gz) file for reading or writing. The mode parameter is as - in fopen ("rb" or "wb") but can also include a compression level ("wb9") or - a strategy: 'f' for filtered data as in "wb6f", 'h' for Huffman-only - compression as in "wb1h", 'R' for run-length encoding as in "wb1R", or 'F' - for fixed code compression as in "wb9F". (See the description of - deflateInit2 for more information about the strategy parameter.) 'T' will - request transparent writing or appending with no compression and not using - the gzip format. + Open the gzip (.gz) file at path for reading and decompressing, or + compressing and writing. The mode parameter is as in fopen ("rb" or "wb") + but can also include a compression level ("wb9") or a strategy: 'f' for + filtered data as in "wb6f", 'h' for Huffman-only compression as in "wb1h", + 'R' for run-length encoding as in "wb1R", or 'F' for fixed code compression + as in "wb9F". (See the description of deflateInit2 for more information + about the strategy parameter.) 'T' will request transparent writing or + appending with no compression and not using the gzip format. "a" can be used instead of "w" to request that the gzip stream that will be written be appended to the file. "+" will result in an error, since @@ -1339,9 +1341,9 @@ ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode)); /* - gzdopen associates a gzFile with the file descriptor fd. File descriptors - are obtained from calls like open, dup, creat, pipe or fileno (if the file - has been previously opened with fopen). The mode parameter is as in gzopen. + Associate a gzFile with the file descriptor fd. File descriptors are + obtained from calls like open, dup, creat, pipe or fileno (if the file has + been previously opened with fopen). The mode parameter is as in gzopen. The next call of gzclose on the returned gzFile will also close the file descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor @@ -1362,13 +1364,13 @@ ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size)); /* - Set the internal buffer size used by this library's functions. The - default buffer size is 8192 bytes. This function must be called after - gzopen() or gzdopen(), and before any other calls that read or write the - file. The buffer memory allocation is always deferred to the first read or - write. Three times that size in buffer space is allocated. A larger buffer - size of, for example, 64K or 128K bytes will noticeably increase the speed - of decompression (reading). + Set the internal buffer size used by this library's functions for file to + size. The default buffer size is 8192 bytes. This function must be called + after gzopen() or gzdopen(), and before any other calls that read or write + the file. The buffer memory allocation is always deferred to the first read + or write. Three times that size in buffer space is allocated. A larger + buffer size of, for example, 64K or 128K bytes will noticeably increase the + speed of decompression (reading). The new buffer size also affects the maximum length for gzprintf(). @@ -1378,9 +1380,9 @@ ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)); /* - Dynamically update the compression level or strategy. See the description - of deflateInit2 for the meaning of these parameters. Previously provided - data is flushed before the parameter change. + Dynamically update the compression level and strategy for file. See the + description of deflateInit2 for the meaning of these parameters. Previously + provided data is flushed before applying the parameter changes. gzsetparams returns Z_OK if success, Z_STREAM_ERROR if the file was not opened for writing, Z_ERRNO if there is an error writing the flushed data, @@ -1389,7 +1391,7 @@ ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); /* - Reads the given number of uncompressed bytes from the compressed file. If + Read and decompress up to len uncompressed bytes from file into buf. If the input file is not in gzip format, gzread copies the given number of bytes into the buffer directly from the file. @@ -1420,11 +1422,11 @@ ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems, gzFile file)); /* - Read up to nitems items of size size from file to buf, otherwise operating - as gzread() does. This duplicates the interface of stdio's fread(), with - size_t request and return types. If the library defines size_t, then - z_size_t is identical to size_t. If not, then z_size_t is an unsigned - integer type that can contain a pointer. + Read and decompress up to nitems items of size size from file into buf, + otherwise operating as gzread() does. This duplicates the interface of + stdio's fread(), with size_t request and return types. If the library + defines size_t, then z_size_t is identical to size_t. If not, then z_size_t + is an unsigned integer type that can contain a pointer. gzfread() returns the number of full items read of size size, or zero if the end of the file was reached and a full item could not be read, or if @@ -1443,18 +1445,16 @@ file, reseting and retrying on end-of-file, when size is not 1. */ -ZEXTERN int ZEXPORT gzwrite OF((gzFile file, - voidpc buf, unsigned len)); +ZEXTERN int ZEXPORT gzwrite OF((gzFile file, voidpc buf, unsigned len)); /* - Writes the given number of uncompressed bytes into the compressed file. - gzwrite returns the number of uncompressed bytes written or 0 in case of - error. + Compress and write the len uncompressed bytes at buf to file. gzwrite + returns the number of uncompressed bytes written or 0 in case of error. */ ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size, z_size_t nitems, gzFile file)); /* - gzfwrite() writes nitems items of size size from buf to file, duplicating + Compress and write nitems items of size size from buf to file, duplicating the interface of stdio's fwrite(), with size_t request and return types. If the library defines size_t, then z_size_t is identical to size_t. If not, then z_size_t is an unsigned integer type that can contain a pointer. @@ -1467,22 +1467,22 @@ ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...)); /* - Converts, formats, and writes the arguments to the compressed file under - control of the format string, as in fprintf. gzprintf returns the number of + Convert, format, compress, and write the arguments (...) to file under + control of the string format, as in fprintf. gzprintf returns the number of uncompressed bytes actually written, or a negative zlib error code in case of error. The number of uncompressed bytes written is limited to 8191, or one less than the buffer size given to gzbuffer(). The caller should assure that this limit is not exceeded. If it is exceeded, then gzprintf() will return an error (0) with nothing written. In this case, there may also be a buffer overflow with unpredictable consequences, which is possible only if - zlib was compiled with the insecure functions sprintf() or vsprintf() + zlib was compiled with the insecure functions sprintf() or vsprintf(), because the secure snprintf() or vsnprintf() functions were not available. This can be determined using zlibCompileFlags(). */ ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s)); /* - Writes the given null-terminated string to the compressed file, excluding + Compress and write the given null-terminated string s to file, excluding the terminating null character. gzputs returns the number of characters written, or -1 in case of error. @@ -1490,11 +1490,12 @@ ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len)); /* - Reads bytes from the compressed file until len-1 characters are read, or a - newline character is read and transferred to buf, or an end-of-file - condition is encountered. If any characters are read or if len == 1, the - string is terminated with a null character. If no characters are read due - to an end-of-file or len < 1, then the buffer is left untouched. + Read and decompress bytes from file into buf, until len-1 characters are + read, or until a newline character is read and transferred to buf, or an + end-of-file condition is encountered. If any characters are read or if len + is one, the string is terminated with a null character. If no characters + are read due to an end-of-file or len is less than one, then the buffer is + left untouched. gzgets returns buf which is a null-terminated string, or it returns NULL for end-of-file or in case of error. If there was an error, the contents at @@ -1503,13 +1504,13 @@ ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); /* - Writes c, converted to an unsigned char, into the compressed file. gzputc + Compress and write c, converted to an unsigned char, into file. gzputc returns the value that was written, or -1 in case of error. */ ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); /* - Reads one byte from the compressed file. gzgetc returns this byte or -1 + Read and decompress one byte from file. gzgetc returns this byte or -1 in case of end of file or error. This is implemented as a macro for speed. As such, it does not do all of the checking the other functions do. I.e. it does not check to see if file is NULL, nor whether the structure file @@ -1518,8 +1519,8 @@ ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file)); /* - Push one character back onto the stream to be read as the first character - on the next read. At least one character of push-back is allowed. + Push c back onto the stream for file to be read as the first character on + the next read. At least one character of push-back is always allowed. gzungetc() returns the character pushed, or -1 on failure. gzungetc() will fail if c is -1, and may fail if a character has been pushed but not read yet. If gzungetc is used immediately after gzopen or gzdopen, at least the @@ -1530,9 +1531,9 @@ ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); /* - Flushes all pending output into the compressed file. The parameter flush - is as in the deflate() function. The return value is the zlib error number - (see function gzerror below). gzflush is only permitted when writing. + Flush all pending output to file. The parameter flush is as in the + deflate() function. The return value is the zlib error number (see function + gzerror below). gzflush is only permitted when writing. If the flush parameter is Z_FINISH, the remaining data is written and the gzip stream is completed in the output. If gzwrite() is called again, a new @@ -1547,8 +1548,8 @@ ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file, z_off_t offset, int whence)); - Sets the starting position for the next gzread or gzwrite on the given - compressed file. The offset represents a number of bytes in the + Set the starting position to offset relative to whence for the next gzread + or gzwrite on file. The offset represents a number of bytes in the uncompressed data stream. The whence parameter is defined as in lseek(2); the value SEEK_END is not supported. @@ -1565,18 +1566,18 @@ ZEXTERN int ZEXPORT gzrewind OF((gzFile file)); /* - Rewinds the given file. This function is supported only for reading. + Rewind file. This function is supported only for reading. - gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET) + gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET). */ /* ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file)); - Returns the starting position for the next gzread or gzwrite on the given - compressed file. This position represents a number of bytes in the - uncompressed data stream, and is zero when starting, even if appending or - reading a gzip stream from the middle of a file using gzdopen(). + Return the starting position for the next gzread or gzwrite on file. + This position represents a number of bytes in the uncompressed data stream, + and is zero when starting, even if appending or reading a gzip stream from + the middle of a file using gzdopen(). gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR) */ @@ -1584,22 +1585,22 @@ /* ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file)); - Returns the current offset in the file being read or written. This offset - includes the count of bytes that precede the gzip stream, for example when - appending or when using gzdopen() for reading. When reading, the offset - does not include as yet unused buffered input. This information can be used - for a progress indicator. On error, gzoffset() returns -1. + Return the current compressed (actual) read or write offset of file. This + offset includes the count of bytes that precede the gzip stream, for example + when appending or when using gzdopen() for reading. When reading, the + offset does not include as yet unused buffered input. This information can + be used for a progress indicator. On error, gzoffset() returns -1. */ ZEXTERN int ZEXPORT gzeof OF((gzFile file)); /* - Returns true (1) if the end-of-file indicator has been set while reading, - false (0) otherwise. Note that the end-of-file indicator is set only if the - read tried to go past the end of the input, but came up short. Therefore, - just like feof(), gzeof() may return false even if there is no more data to - read, in the event that the last read request was for the exact number of - bytes remaining in the input file. This will happen if the input file size - is an exact multiple of the buffer size. + Return true (1) if the end-of-file indicator for file has been set while + reading, false (0) otherwise. Note that the end-of-file indicator is set + only if the read tried to go past the end of the input, but came up short. + Therefore, just like feof(), gzeof() may return false even if there is no + more data to read, in the event that the last read request was for the exact + number of bytes remaining in the input file. This will happen if the input + file size is an exact multiple of the buffer size. If gzeof() returns true, then the read functions will return no more data, unless the end-of-file indicator is reset by gzclearerr() and the input file @@ -1608,7 +1609,7 @@ ZEXTERN int ZEXPORT gzdirect OF((gzFile file)); /* - Returns true (1) if file is being copied directly while reading, or false + Return true (1) if file is being copied directly while reading, or false (0) if file is a gzip stream being decompressed. If the input file is empty, gzdirect() will return true, since the input @@ -1629,8 +1630,8 @@ ZEXTERN int ZEXPORT gzclose OF((gzFile file)); /* - Flushes all pending output if necessary, closes the compressed file and - deallocates the (de)compression state. Note that once file is closed, you + Flush all pending output for file, if necessary, close file and + deallocate the (de)compression state. Note that once file is closed, you cannot call gzerror with file, since its structures have been deallocated. gzclose must not be called more than once on the same file, just as free must not be called more than once on the same allocation. @@ -1654,10 +1655,10 @@ ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum)); /* - Returns the error message for the last error which occurred on the given - compressed file. errnum is set to zlib error number. If an error occurred - in the file system and not in the compression library, errnum is set to - Z_ERRNO and the application may consult errno to get the exact error code. + Return the error message for the last error which occurred on file. + errnum is set to zlib error number. If an error occurred in the file system + and not in the compression library, errnum is set to Z_ERRNO and the + application may consult errno to get the exact error code. The application must not modify the returned string. Future calls to this function may invalidate the previously returned string. If file is @@ -1670,7 +1671,7 @@ ZEXTERN void ZEXPORT gzclearerr OF((gzFile file)); /* - Clears the error and end-of-file flags for file. This is analogous to the + Clear the error and end-of-file flags for file. This is analogous to the clearerr() function in stdio. This is useful for continuing to read a gzip file that is being written concurrently. */ @@ -1688,8 +1689,9 @@ ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); /* Update a running Adler-32 checksum with the bytes buf[0..len-1] and - return the updated checksum. If buf is Z_NULL, this function returns the - required initial value for the checksum. + return the updated checksum. An Adler-32 value is in the range of a 32-bit + unsigned integer. If buf is Z_NULL, this function returns the required + initial value for the checksum. An Adler-32 checksum is almost as reliable as a CRC-32 but can be computed much faster. @@ -1722,12 +1724,13 @@ negative, the result has no meaning or utility. */ -ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); +ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); /* Update a running CRC-32 with the bytes buf[0..len-1] and return the - updated CRC-32. If buf is Z_NULL, this function returns the required - initial value for the crc. Pre- and post-conditioning (one's complement) is - performed within this function so it shouldn't be done by the application. + updated CRC-32. A CRC-32 value is in the range of a 32-bit unsigned integer. + If buf is Z_NULL, this function returns the required initial value for the + crc. Pre- and post-conditioning (one's complement) is performed within this + function so it shouldn't be done by the application. Usage example: @@ -1739,7 +1742,7 @@ if (crc != original_crc) error(); */ -ZEXTERN uLong ZEXPORT crc32_z OF((uLong adler, const Bytef *buf, +ZEXTERN uLong ZEXPORT crc32_z OF((uLong crc, const Bytef *buf, z_size_t len)); /* Same as crc32(), but with a size_t length. @@ -1755,6 +1758,20 @@ len2. */ +/* +ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t len2)); + + Return the operator corresponding to length len2, to be used with + crc32_combine_op(). +*/ + +ZEXTERN uLong ZEXPORT crc32_combine_op OF((uLong crc1, uLong crc2, uLong op)); +/* + Give the same result as crc32_combine(), using op in place of len2. op is + is generated from len2 by crc32_combine_gen(). This will be faster than + crc32_combine() if the generated op is used more than once. +*/ + /* various hacks, don't look :) */ @@ -1842,6 +1859,7 @@ ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile)); ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t)); ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t)); + ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF((z_off64_t)); #endif #if !defined(ZLIB_INTERNAL) && defined(Z_WANT64) @@ -1852,6 +1870,7 @@ # define z_gzoffset z_gzoffset64 # define z_adler32_combine z_adler32_combine64 # define z_crc32_combine z_crc32_combine64 +# define z_crc32_combine_gen z_crc32_combine_gen64 # else # define gzopen gzopen64 # define gzseek gzseek64 @@ -1859,6 +1878,7 @@ # define gzoffset gzoffset64 # define adler32_combine adler32_combine64 # define crc32_combine crc32_combine64 +# define crc32_combine_gen crc32_combine_gen64 # endif # ifndef Z_LARGE64 ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); @@ -1867,6 +1887,7 @@ ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile)); ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t)); ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t)); + ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF((z_off_t)); # endif #else ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *)); @@ -1875,12 +1896,14 @@ ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile)); ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t)); ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t)); + ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t)); #endif #else /* Z_SOLO */ ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t)); ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t)); + ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t)); #endif /* !Z_SOLO */ @@ -1893,7 +1916,7 @@ ZEXTERN unsigned long ZEXPORT inflateCodesUsed OF ((z_streamp)); ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp)); ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp)); -#if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(Z_SOLO) +#if defined(_WIN32) && !defined(Z_SOLO) ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t *path, const char *mode)); #endif diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/zlib.map mame-0.243+dfsg.1/3rdparty/zlib/zlib.map --- mame-0.242+dfsg.1/3rdparty/zlib/zlib.map 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/zlib.map 2022-04-29 05:37:26.000000000 +0000 @@ -92,3 +92,9 @@ adler32_z; crc32_z; } ZLIB_1.2.7.1; + +ZLIB_1.2.12 { + crc32_combine_gen; + crc32_combine_gen64; + crc32_combine_op; +} ZLIB_1.2.9; diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/zutil.c mame-0.243+dfsg.1/3rdparty/zlib/zutil.c --- mame-0.242+dfsg.1/3rdparty/zlib/zutil.c 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/zutil.c 2022-04-29 05:37:26.000000000 +0000 @@ -136,8 +136,8 @@ return ERR_MSG(err); } -#if defined(_WIN32_WCE) - /* The Microsoft C Run-Time Library for Windows CE doesn't have +#if defined(_WIN32_WCE) && _WIN32_WCE < 0x800 + /* The older Microsoft C Run-Time Library for Windows CE doesn't have * errno. We define it as a global variable to simplify porting. * Its value is always 0 and should not be used. */ diff -Nru mame-0.242+dfsg.1/3rdparty/zlib/zutil.h mame-0.243+dfsg.1/3rdparty/zlib/zutil.h --- mame-0.242+dfsg.1/3rdparty/zlib/zutil.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/3rdparty/zlib/zutil.h 2022-04-29 05:37:26.000000000 +0000 @@ -1,5 +1,5 @@ /* zutil.h -- internal interface and configuration of the compression library - * Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler + * Copyright (C) 1995-2022 Jean-loup Gailly, Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -29,10 +29,6 @@ # include #endif -#ifdef Z_SOLO - typedef long ptrdiff_t; /* guess -- will be caught if guess is wrong */ -#endif - #ifndef local # define local static #endif @@ -46,6 +42,17 @@ typedef ush FAR ushf; typedef unsigned long ulg; +#if !defined(Z_U8) && !defined(Z_SOLO) && defined(STDC) +# include +# if (ULONG_MAX == 0xffffffffffffffff) +# define Z_U8 unsigned long +# elif (ULLONG_MAX == 0xffffffffffffffff) +# define Z_U8 unsigned long long +# elif (UINT_MAX == 0xffffffffffffffff) +# define Z_U8 unsigned +# endif +#endif + extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ /* (size given to avoid silly warnings with Visual C++) */ @@ -170,10 +177,6 @@ #if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX # if defined(_WIN32_WCE) # define fdopen(fd,mode) NULL /* No fdopen() */ -# ifndef _PTRDIFF_T_DEFINED - typedef int ptrdiff_t; -# define _PTRDIFF_T_DEFINED -# endif # else # define fdopen(fd,type) _fdopen(fd,type) # endif diff -Nru mame-0.242+dfsg.1/android-project/app/src/main/AndroidManifest.xml mame-0.243+dfsg.1/android-project/app/src/main/AndroidManifest.xml --- mame-0.242+dfsg.1/android-project/app/src/main/AndroidManifest.xml 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/android-project/app/src/main/AndroidManifest.xml 2022-04-29 05:37:26.000000000 +0000 @@ -4,8 +4,8 @@ --> diff -Nru mame-0.242+dfsg.1/COPYING mame-0.243+dfsg.1/COPYING --- mame-0.242+dfsg.1/COPYING 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/COPYING 2022-04-29 05:37:26.000000000 +0000 @@ -251,7 +251,7 @@ Copyright (c) 1999 D. J. Bernstein zlib data compression library -Copyright (c) 1995-2017 Jean-loup Gailly and Mark Adler +Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff -Nru mame-0.242+dfsg.1/debian/changelog mame-0.243+dfsg.1/debian/changelog --- mame-0.242+dfsg.1/debian/changelog 2022-04-01 17:40:36.000000000 +0000 +++ mame-0.243+dfsg.1/debian/changelog 2022-04-29 13:10:37.000000000 +0000 @@ -1,9 +1,19 @@ -mame (0.242+dfsg.1-0ubuntu1~ppa1~impish1) impish; urgency=medium +mame (0.243+dfsg.1-0ubuntu1~ppa1~impish1) impish; urgency=medium * New upstream release. - * Updated patches. + * Refresh patches. - -- Cesare Falco Fri, 01 Apr 2022 19:40:36 +0200 + -- Cesare Falco Fri, 29 Apr 2022 15:10:37 +0200 + +mame (0.242+dfsg.1-1) unstable; urgency=medium + + [ Cesare Falco ] + * New upstream release. + + [ Jordi Mallach ] + * Add debian/gbp.conf with our current gbp defaults. + + -- Jordi Mallach Sat, 09 Apr 2022 00:01:51 +0200 mame (0.241+dfsg.1-1) unstable; urgency=medium diff -Nru mame-0.242+dfsg.1/debian/gbp.conf mame-0.243+dfsg.1/debian/gbp.conf --- mame-0.242+dfsg.1/debian/gbp.conf 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/debian/gbp.conf 2022-04-29 13:10:37.000000000 +0000 @@ -0,0 +1,4 @@ +[DEFAULT] +pristine-tar = true +debian-branch = master +upstream-branch = upstream diff -Nru mame-0.242+dfsg.1/debian/patches/hurd.patch mame-0.243+dfsg.1/debian/patches/hurd.patch --- mame-0.242+dfsg.1/debian/patches/hurd.patch 2022-04-01 17:40:36.000000000 +0000 +++ mame-0.243+dfsg.1/debian/patches/hurd.patch 2022-04-29 13:10:37.000000000 +0000 @@ -107,7 +107,7 @@ =================================================================== --- mame.orig/scripts/genie.lua +++ mame/scripts/genie.lua -@@ -142,6 +142,7 @@ newoption { +@@ -141,6 +141,7 @@ newoption { { "netbsd", "NetBSD" }, { "openbsd", "OpenBSD" }, { "linux", "Linux" }, diff -Nru mame-0.242+dfsg.1/docs/source/conf.py mame-0.243+dfsg.1/docs/source/conf.py --- mame-0.242+dfsg.1/docs/source/conf.py 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/docs/source/conf.py 2022-04-29 05:37:26.000000000 +0000 @@ -63,9 +63,9 @@ # built documents. # # The short X.Y version. -version = '0.242' +version = '0.243' # The full version, including alpha/beta/rc tags. -release = '0.242' +release = '0.243' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff -Nru mame-0.242+dfsg.1/hash/a800_flop.xml mame-0.243+dfsg.1/hash/a800_flop.xml --- mame-0.242+dfsg.1/hash/a800_flop.xml 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/hash/a800_flop.xml 2022-04-29 05:37:26.000000000 +0000 @@ -654,6 +654,23 @@ + + Pondering About Max's + 1989 + Change in Heat + + + + + + + + + + + + + Saracen 1987 diff -Nru mame-0.242+dfsg.1/hash/a800.xml mame-0.243+dfsg.1/hash/a800.xml --- mame-0.242+dfsg.1/hash/a800.xml 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/hash/a800.xml 2022-04-29 05:37:26.000000000 +0000 @@ -4318,6 +4318,30 @@ + + Popeye (prototype, 19830829) + 1983 + Parker Brothers + + + + + + + + + + Popeye (prototype, WIP8) + 1983 + Parker Brothers + + + + + + + + Porky's 1983 diff -Nru mame-0.242+dfsg.1/hash/apple2_flop_clcracked.xml mame-0.243+dfsg.1/hash/apple2_flop_clcracked.xml --- mame-0.242+dfsg.1/hash/apple2_flop_clcracked.xml 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/hash/apple2_flop_clcracked.xml 2022-04-29 05:37:26.000000000 +0000 @@ -47603,4 +47603,403 @@ + + Descending/Ascending Intervals (cleanly cracked) + 1986 + Electronic Courseware + + + + + + + + + + + + Functional Harmony: Secondary Dominants (cleanly cracked) + 1988 + Electronic Courseware + + + + + + + + + + + + Keyboard Note Drill (cleanly cracked) + 1985 + Electronic Courseware + + + + + + + + + + + + Melodic Dictation: Beginning Level (cleanly cracked) + 1988 + Electronic Courseware + + + + + + + + + + + + Melodic Dictation: Intermediate Level (cleanly cracked) + 1988 + Electronic Courseware + + + + + + + + + + + + Music Composer Quiz (cleanly cracked) + 1985 + Electronic Courseware + + + + + + + + + + + + Music Terminology (cleanly cracked) + 1984 + Electronic Courseware + + + + + + + + + + + + Tap-It (cleanly cracked) + 1987 + Electronic Courseware + + + + + + + + + + + + Zoo Puppet Theater (cleanly cracked) + 1989 + Electronic Courseware + + + + + + + + + + + + Volcanoes (cleanly cracked) + 1981 + Earthware Computer Services + + + + + + + + + + + + + + + + + + + Measuring Economic Activity (cleanly cracked) + 1985 + Focus Media + + + + + + + + + + + + Media Magic: The Melody Studio (cleanly cracked) + 1990 + Pelican Software + + + + + + + + + + + + + + + + + + + Time Explorers (cleanly cracked) + 1991 + Gamco Industries + + + + + + + + + + + + + + + + + + + On Target: 3000 Words of German (cleanly cracked) + 1984 + Langenscheidt Languageware + + + + + + + + + + + + Keyboard Fingerings (cleanly cracked) + 1985 + Electronic Courseware Systems + + + + + + + + + + + + Keyboard Intervals (cleanly cracked) + 1985 + Electronic Courseware Systems + + + + + + + + + + + + Keyboard Jazz Harmonies (cleanly cracked) + 1985 + Electronic Courseware Systems + + + + + + + + + + + + Keyboard Extended Jazz Harmonies (cleanly cracked) + 1987 + Electronic Courseware Systems + + + + + + + + + + + + Keyboard Speed Reading (cleanly cracked) + 1985 + Electronic Courseware Systems + + + + + + + + + + + + Musical Stairs (cleanly cracked) + 1985 + Electronic Courseware Systems + + + + + + + + + + + + Note Detective II: Intermediate Level (cleanly cracked) + 1989 + Electronic Courseware Systems + + + + + + + + + + + + Geography Search (cleanly cracked) + 1982 + McGraw-Hill + + + + + + + + + + + + Cubes, Prisms, and Cylinders (cleanly cracked) + 1988 + Educational Activities + + + + + + + + + + + + Early Music Skills (cleanly cracked) + 1985 + Electronic Courseware Systems + + + + + + + + + + + + Keyboard Arpeggios (cleanly cracked) + 1985 + Electronic Courseware Systems + + + + + + + + + + + + Keyboard Blues (cleanly cracked) + 1985 + Electronic Courseware Systems + + + + + + + + + + + + Keyboard Chords (cleanly cracked) + 1985 + Electronic Courseware Systems + + + + + + + + + + diff -Nru mame-0.242+dfsg.1/hash/apple2_flop_orig.xml mame-0.243+dfsg.1/hash/apple2_flop_orig.xml --- mame-0.242+dfsg.1/hash/apple2_flop_orig.xml 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/hash/apple2_flop_orig.xml 2022-04-29 05:37:26.000000000 +0000 @@ -3628,10 +3628,13 @@ + - - + + @@ -21619,5 +21622,932 @@ + + + Copy II Plus (Version 9.0) + 1989 + Central Point Software + + + + + + + + + + + + + + + + + + + + + Copy II Plus (Version 8.4) + 1989 + Central Point Software + + + + + + + + + + + + + + Copy II Plus (Version 9.1) + 1990 + Central Point Software + + + + + + + + + + + + + + + + + + + + + Copy II Plus (Version 8.1) (800K 3.5") + 1987 + Central Point Software + + + + + + + + + + + + + + Copy II Plus (Version 8.2) (800K 3.5") + 1988 + Central Point Software + + + + + + + + + + + + + + Copy II Plus (Version 8.3) (800K 3.5") + 1988 + Central Point Software + + + + + + + + + + + + + + Locksmith (Version 5.0 Revision C) + 1983 + Omega Microware + + + + + + + + + + + + + + Locksmith (Version 5.0 Revision F) + 1983 + Omega Microware + + + + + + + + + + + + + + Locksmith (Version 5.0 Revision G) + 1983 + Omega Microware + + + + + + + + + + + + + + Locksmith (Version 6.0 Revision A) + 1986 + Alpha Logic Business Systems + + + + + + + + + + + + + + + + + + + + Copy II Plus (Version 8.4) (800K 3.5") + 1989 + Central Point Software + + + + + + + + + + + + + + Locksmith (Version 6.0 Revision B) + 1986 + Alpha Logic Business Systems + + + + + + + + + + + + + + + + + + + + + + Essential Data Duplicator (Version 3.0-1984-02-06) + 1984 + Utilico Microware + + + + + + + + + + + + + + Essential Data Duplicator (Version 3.0-1984-05-25) + 1984 + Utilico Microware + + + + + + + + + + + + + + Back It Up (Version 3.6) + 1983 + Sensible Software + + + + + + + + + + + + + + Super Disk Copy (Version 3.6) + 1981 + Sensible Software + + + + + + + + + + + + + + Copy II Plus (Version 3.1) + 1981 + Central Point Software + + + + + + + + + + + + + + Copy II Plus (Version 4.1) + 1982 + Central Point Software + + + + + + + + + + + + + + Copy II Plus (Version 4.3) + 1982 + Central Point Software + + + + + + + + + + + + + + Copy II Plus (Version 4.4B) + 1982 + Central Point Software + + + + + + + + + + + + + + Copy II Plus (Version 4.4C) + 1982 + Central Point Software + + + + + + + + + + + + + + Copy II Plus (Version 9.0) (800K 3.5") + 1989 + Central Point Software + + + + + + + + + + + + + + Copy II Plus (Version 4.4D) + 1982 + Central Point Software + + + + + + + + + + + + + + Copy II Plus (Version 5.0) + 1985 + Central Point Software + + + + + + + + + + + + + + Copy II Plus (Version 5.1) + 1985 + Central Point Software + + + + + + + + + + + + + + Copy II Plus (Version 5.2) + 1985 + Central Point Software + + + + + + + + + + + + + + Copy II Plus (Version 5.4) + 1985 + Central Point Software + + + + + + + + + + + + + + Copy II Plus (Version 6.0) + 1985 + Central Point Software + + + + + + + + + + + + + + Copy II Plus (Version 5.5) + 1985 + Central Point Software + + + + + + + + + + + + + + Copy II Plus (Version 6.1) + 1986 + Central Point Software + + + + + + + + + + + + + + Copy II Plus (Version 6.2) + 1986 + Central Point Software + + + + + + + + + + + + + + Copy II Plus (Version 6.3) + 1986 + Central Point Software + + + + + + + + + + + + + + Copy II Plus (Version 9.1) (800K 3.5") + 1990 + Central Point Software + + + + + + + + + + + + + + Copy II Plus (Version 6.4) + 1986 + Central Point Software + + + + + + + + + + + + + + Copy II Plus (Version 6.5) + 1986 + Central Point Software + + + + + + + + + + + + + + Copy II Plus (Version 6.6) + 1986 + Central Point Software + + + + + + + + + + + + + + Copy II Plus (Version 7.1) + 1986 + Central Point Software + + + + + + + + + + + + + + Copy II Plus (Version 7.2) + 1986 + Central Point Software + + + + + + + + + + + + + + Copy II Plus (Version 7.3) + 1987 + Central Point Software + + + + + + + + + + + + + + Copy II Plus (Version 7.4) + 1987 + Central Point Software + + + + + + + + + + + + + + Copy II Plus (Version 8.1) + 1987 + Central Point Software + + + + + + + + + + + + + + Copy II Plus (Version 8.2) + 1988 + Central Point Software + + + + + + + + + + + + + + Copy II Plus (Version 8.3) + 1988 + Central Point Software + + + + + + + + + + + + + + Kraking by The Disk Jockey + 1984 + Pirate's Harbor + + + + + + + + + + + + + + + + + + + + + Hands-On Math! Volume I (800K 3.5") + 1988 + Ventura Educational Systems + + + + + + + + + + + + + + Science Corner: Planet Earth (800K 3.5") + 1989 + Society for Visual Education + + + + + + + + + + + + + + Bouncing Kamungas! + 1983 + Penguin Software + + + + + + + + + + + + + + Pig Pen + 1982 + Datamost + + + + + + + + + + + + + + Ricochet + 1982 + Automated Simulations + + + + + + + + + + + + + + Grey Seas, Grey Skies + 1983 + Simulations Canada + + + + + + + + + + + + + + World Class Leader Board + 1987 + Access Software + + + + + + + + + + + + + + + + + + + + + Columns //e (Version 2.01) + 1991 + Creative Computing Services + + + + + + + + + + + + + + + + + + + + + Wizardry: Proving Grounds of the Mad Overload (Version 05-SEP-81) + 1981 + Sir-Tech + + + + + + + + + + + + + + + + + + + + + Wizardry: Proving Grounds of the Mad Overload (Version 01-DEC-81) + 1981 + Sir-Tech + + + + + + + + + + + + + + + + + + diff -Nru mame-0.242+dfsg.1/hash/apple2gs_flop_orig.xml mame-0.243+dfsg.1/hash/apple2gs_flop_orig.xml --- mame-0.242+dfsg.1/hash/apple2gs_flop_orig.xml 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/hash/apple2gs_flop_orig.xml 2022-04-29 05:37:26.000000000 +0000 @@ -3492,11 +3492,13 @@ + + diff -Nru mame-0.242+dfsg.1/hash/famicom_flop.xml mame-0.243+dfsg.1/hash/famicom_flop.xml --- mame-0.242+dfsg.1/hash/famicom_flop.xml 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/hash/famicom_flop.xml 2022-04-29 05:37:26.000000000 +0000 @@ -115,7 +115,7 @@ - Aliens - Alien 2 (Prototype) + Aliens - Alien 2 (prototype) 1987 Square @@ -126,7 +126,7 @@ - All Night Nippon Super Mario Brothers (Promotion Card) + All Night Nippon Super Mario Brothers (promotion card) 1986 Nintendo @@ -776,7 +776,7 @@ - Family Computer Golf Special Course (Prize Card) + Family Computer Golf Special Course (prize card) 19?? Nintendo @@ -801,7 +801,7 @@ - Family Computer Golf Tournament - Japan Course (Prize Card) + Family Computer Golf Tournament - Japan Course (prize card) 19?? Nintendo @@ -1218,7 +1218,7 @@ - Koneko Monogatari - The Adventures of Chatran (Sample) + Koneko Monogatari - The Adventures of Chatran (sample) 1986 Pony Canyon @@ -1410,7 +1410,7 @@ - Michael English Daibouken (Sample) + Michael English Daibouken (sample) 1987 Scorpion Soft @@ -1508,7 +1508,7 @@ - Nazoraa Land Dai 2 Gou (Nazo Magazine Disk) + Nazoraa Land Dai 2 Gou (Nazo magazine disk) 1987 Sunsoft @@ -1522,7 +1522,7 @@ - Nazoraa Land Dai 3 Gou (Nazo Magazine Disk) + Nazoraa Land Dai 3 Gou (Nazo magazine disk) 1988 Sunsoft @@ -1536,7 +1536,7 @@ - Nazoraa Land Soukan Gou (Nazo Magazine Disk) + Nazoraa Land Soukan Gou (Nazo magazine disk) 1987 Sunsoft @@ -1550,7 +1550,7 @@ - Nazoraa Land Special!! - Quiz Ou wo Sagase! (Nazo Magazine Disk) + Nazoraa Land Special!! - Quiz Ou wo Sagase! (Nazo magazine disk) 1987 Sunsoft @@ -2156,7 +2156,7 @@ - Zelda no Densetsu - The Hyrule Fantasy (Prototype) + Zelda no Densetsu - The Hyrule Fantasy (prototype) 1986 Nintendo @@ -2255,7 +2255,7 @@ - FMC Disk Card Checker Ver 1.3 (v1.2) (Developer Card) + FMC Disk Card Checker Ver 1.3 (v1.2) (developer card) 19?? <unknown> @@ -2292,7 +2292,7 @@ - Adian no Tsue (Prototype) + Adian no Tsue (prototype) 1986 Sunsoft @@ -2326,7 +2326,7 @@ - Shanghai (Prototype) + Shanghai (prototype) 19?? Sunsoft @@ -2337,7 +2337,7 @@ - Shanghai 2 (Prototype, Dragon Layout) + Shanghai 2 (prototype, Dragon Layout) 19?? Sunsoft @@ -2348,7 +2348,7 @@ - Shanghai 2 (Prototype, Scorpion Layout) + Shanghai 2 (prototype, Scorpion Layout) 19?? Sunsoft @@ -2359,7 +2359,7 @@ - Sunsoft Tile Editor (Newer) + Sunsoft Tile Editor (newer) 19?? Sunsoft @@ -2370,7 +2370,7 @@ - Sunsoft Tile Editor (Older) + Sunsoft Tile Editor (older) 19?? Sunsoft @@ -2509,7 +2509,7 @@ - Bubble Bobble (Alt) + Bubble Bobble (alt) 1987 Taito @@ -2537,7 +2537,7 @@ - Burger Time (Alt) + Burger Time (alt) 1988 Data East @@ -2693,7 +2693,7 @@ - Famicom Grand Prix - F1 Race (Alt) + Famicom Grand Prix - F1 Race (alt) 1987 Nintendo @@ -2723,7 +2723,7 @@ - Famicom Mukashi Banashi - Shin Onigashima (Alt) + Famicom Mukashi Banashi - Shin Onigashima (alt) 1987 Nintendo @@ -2739,7 +2739,7 @@ - Famicom Mukashi Banashi - Shin Onigashima (Alt 2) + Famicom Mukashi Banashi - Shin Onigashima (alt 2) 1987 Nintendo @@ -2784,7 +2784,7 @@ - Famicom Tantei Club - Kieta Koukeisha (Alt) + Famicom Tantei Club - Kieta Koukeisha (alt) 1988 Nintendo @@ -2814,7 +2814,7 @@ - Famicom Tantei Club Part II - Ushiro ni Tatsu Shoujo (Alt) + Famicom Tantei Club Part II - Ushiro ni Tatsu Shoujo (alt) 1989 Nintendo @@ -2884,7 +2884,7 @@ - Famimaga Disk Vol. 3 - All 1 (Alt) + Famimaga Disk Vol. 3 - All 1 (alt) 1991 Tokuma Shoten @@ -3053,7 +3053,7 @@ - The Goonies (Alt) + The Goonies (alt) 1988 Konami @@ -3095,7 +3095,7 @@ - Gun.Smoke (Alt) + Gun.Smoke (alt) 1988 Capcom @@ -3151,7 +3151,7 @@ - Hikari Shinwa - Palthena no Kagami (v1.1, Alt?) + Hikari Shinwa - Palthena no Kagami (v1.1, alt?) 1986 Nintendo @@ -3223,7 +3223,7 @@ - Ice Climber (Alt) + Ice Climber (alt) 1988 Nintendo @@ -3295,7 +3295,7 @@ - Jikai Shounen Metto Mag (Alt) + Jikai Shounen Metto Mag (alt) 1987 Square @@ -3323,7 +3323,7 @@ - Kaettekita Mario Bros. (Alt) + Kaettekita Mario Bros. (alt) 1988 Nintendo @@ -3337,7 +3337,7 @@ - Kaettekita Mario Bros. (Alt 2) + Kaettekita Mario Bros. (alt 2) 1988 Nintendo @@ -3351,7 +3351,7 @@ - Kaettekita Mario Bros. (Alt 3) + Kaettekita Mario Bros. (alt 3) 1988 Nintendo @@ -3365,7 +3365,7 @@ - Kaettekita Mario Bros. (Alt 4) + Kaettekita Mario Bros. (alt 4) 1988 Nintendo @@ -3534,7 +3534,7 @@ - Matou no Houkai - The Hero of Babel (Alt) + Matou no Houkai - The Hero of Babel (alt) 1988 Pony Canyon @@ -3787,7 +3787,7 @@ - SD Gundam World - Gachapon Senshi - Scramble Wars (Alt) + SD Gundam World - Gachapon Senshi - Scramble Wars (alt) 1988 Bandai @@ -3801,7 +3801,7 @@ - SD Gundam World - Gachapon Senshi - Scramble Wars (Alt 2) + SD Gundam World - Gachapon Senshi - Scramble Wars (alt 2) 1988 Bandai @@ -3829,7 +3829,7 @@ - SD Gundam World - Gachapon Senshi - Scramble Wars - Map Collection (Alt) + SD Gundam World - Gachapon Senshi - Scramble Wars - Map Collection (alt) 1989 Bandai @@ -3899,7 +3899,7 @@ - Tama & Friends - 3 Choume Dai Bouken (Alt) + Tama & Friends - 3 Choume Dai Bouken (alt) 1989 Bandai @@ -3984,7 +3984,7 @@ - Tobidase Daisakusen (Alt) + Tobidase Daisakusen (alt) 1987 Square @@ -3999,7 +3999,7 @@ - Tobidase Daisakusen (Hacked?) + Tobidase Daisakusen (hacked?) 1987 Square @@ -4056,7 +4056,7 @@ - Ultraman - Kaijuu Teikoku no Gyakushuu (Alt) + Ultraman - Kaijuu Teikoku no Gyakushuu (alt) 1987 Bandai diff -Nru mame-0.242+dfsg.1/hash/fm7_cass.xml mame-0.243+dfsg.1/hash/fm7_cass.xml --- mame-0.242+dfsg.1/hash/fm7_cass.xml 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/hash/fm7_cass.xml 2022-04-29 05:37:26.000000000 +0000 @@ -34,19 +34,6 @@ - - Aldebaran - 1981 - ハドソン (Hudson Soft) - - - - - - - - - The Alien 1983 @@ -295,32 +282,6 @@ - - Happy Bushman - 1983 - ポニカ (PonyCa) - - - - - - - - - - - - Minami no Shima no Capricorn - 1983 - 九十九電機 (Tsukumo Denki) - - - - - - - - The Castle 1985 @@ -438,20 +399,6 @@ - - Delphis - 1984 - コムパック (Compaq) - - - - - - - - - - Dezeni Land 1983 @@ -605,18 +552,6 @@ - - Elevator Game - 19?? - スターパック (Star Pack) - - - - - - - - Enterprise 1983 @@ -915,20 +850,6 @@ - - Haunted House - 1983 - コムパック (Compaq) - - - - - - - - - - Hisha 1985 @@ -1078,20 +999,6 @@ - - Ohi! Kaguya Hime - Kinuginu no Wakare - 1983 - ポニカ (PonyCa) - - - - - - - - - - Karei Naru Kaitou 1983 @@ -1167,19 +1074,6 @@ - - Mari-chan Kiki Ippatsu - 1983 - エニックス (Enix) - - - - - - - - - Killer Station 1983 @@ -1384,20 +1278,6 @@ - - Midway - 1983 - 電波新聞社 (Dempa Shinbunsha) - - - - - - - - - - Mole Mole 1985 @@ -1426,19 +1306,6 @@ - - Mu Tairiku no Nazo - 1983 - マジカルズゥ (MagicalZoo) - - - - - - - - - Mystery House 1983 @@ -1594,20 +1461,6 @@ - - Joshi Ryou Panic - 1983 - エニックス (Enix) - - - - - - - - - - Penguin-kun 1983 @@ -1641,12 +1494,14 @@ - + + Portopia Renzoku Satsujin Jiken 1983 エニックス (Enix) + @@ -1821,19 +1676,6 @@ - - Renju - 1981 - 九十九電機 (Tsukumo Denki) - - - - - - - - - Riglas 1986 @@ -1891,32 +1733,6 @@ - - I wa Sanjutsu Nari - 1982 - ハドソン (Hudson Soft) - - - - - - - - - - - I wa Sanjutsu Nari (alt) - 1982 - ハドソン (Hudson Soft) - - - - - - - - - Super Baseball 1983 @@ -1942,19 +1758,6 @@ - - Shinjuwan Kougeki - 1983 - ポニカ (Pony Canyon) - - - - - - - - - Sokoban 1982 @@ -1983,25 +1786,6 @@ - - Sokoban 2 - 1984 - シンキングラビット (Thinking Rabbit) - - - - - - - - - - - - - - - Sonic Boom 1985 @@ -2182,18 +1966,6 @@ - - Star Trek - 1981 - 九十九電機 (Tsukumo Denki) - - - - - - - - The Stars 1983 @@ -2224,19 +1996,6 @@ - - Tank Game - 1983? - 九十九電機 (Tsukumo Denki) - - - - - - - - - Touch Down 1985 @@ -2311,18 +2070,6 @@ - - Ultra Yonin Mahjong - 1983 - 九十九電機 (Tsukumo Denki) - - - - - - - - Uootoy 1984 @@ -2443,31 +2190,6 @@ - - Yakyuuken - 1982 - 九十九電機 (Tsukumo Denki) - - - - - - - - - - Yamanotesen Adventure - 1983 - 光栄 (Koei) - - - - - - - - - Yume no Pro Yakyuu 1983 @@ -2481,19 +2203,6 @@ - - Zaiko Kanri - 1981 - Kinki Computer Service - - - - - - - - - Zerosen 1984 @@ -2518,130 +2227,6 @@ - - - - - - FM8 Demonstration - 19?? - <unknown> - - - - - - - - - - - Graph - 19?? - <unknown> - - - - - - - - - - Summer Winter - 1981? - アスキー (ASCII) - - - - - - - - - - Word Processor - 19?? - <unknown> - - - - - - - - - - Lunar Lander - 1981? - アスキー (ASCII) - - - - - - - - - - Black Jack & Bonus - 1981? - アスキー (ASCII) - - - - - - - - - - Sort Kenkyuu - 19?? - <unknown> - - - - - - - - - - Meibo - 19?? - <unknown> - - - - - - - - - - FM-8 Program Library No. 3 - 19?? - <unknown> - - - - - - - - - - FM-8 Program Library No. 4 - 19?? - <unknown> - - - - - - - diff -Nru mame-0.242+dfsg.1/hash/fm8_cass.xml mame-0.243+dfsg.1/hash/fm8_cass.xml --- mame-0.242+dfsg.1/hash/fm8_cass.xml 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/hash/fm8_cass.xml 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,377 @@ + + + + + + + + Aldebaran + 1981 + ハドソン (Hudson Soft) + + + + + + + + + + + Happy Bushman + 1983 + ポニカ (PonyCa) + + + + + + + + + + + + Minami no Shima no Capricorn + 1983 + 九十九電機 (Tsukumo Denki) + + + + + + + + + + Delphis + 1984 + コムパック (Compaq) + + + + + + + + + + + + Elevator Game + 19?? + スターパック (Star Pack) + + + + + + + + + + + FM-8 Program Library No. 2 + 19?? + アスキー (ASCII) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + FM-8 Program Library No. 3 + 19?? + アスキー (ASCII) + + + + + + + + + + FM-8 Program Library No. 4 + 19?? + アスキー (ASCII) + + + + + + + + + + Haunted House + 1983 + コムパック (Compaq) + + + + + + + + + + + + Ooi! Kaguya Hime - Kinuginu no Wakare + 1983 + ポニカ (PonyCa) + + + + + + + + + + + + Mari-chan Kiki Ippatsu + 1983 + エニックス (Enix) + + + + + + + + + + + Midway + 1983 + 電波新聞社 (Dempa Shinbunsha) + + + + + + + + + + + + Mu Tairiku no Nazo + 1983 + マジカルズゥ (MagicalZoo) + + + + + + + + + + + Joshi Ryou Panic + 1983 + エニックス (Enix) + + + + + + + + + + + + Renju + 1981 + 九十九電機 (Tsukumo Denki) + + + + + + + + + + + I wa Sanjutsu Nari + 1982 + ハドソン (Hudson Soft) + + + + + + + + + + + I wa Sanjutsu Nari (alt) + 1982 + ハドソン (Hudson Soft) + + + + + + + + + + + Shinjuwan Kougeki + 1983 + ポニカ (Pony Canyon) + + + + + + + + + + + Sokoban 2 + 1984 + シンキングラビット (Thinking Rabbit) + + + + + + + + + + + + + + + + + Star Trek + 1981 + 九十九電機 (Tsukumo Denki) + + + + + + + + + + Tank Game + 1983? + 九十九電機 (Tsukumo Denki) + + + + + + + + + + + Ultra Yonin Mahjong + 1983 + 九十九電機 (Tsukumo Denki) + + + + + + + + + + Yakyuuken + 1982 + 九十九電機 (Tsukumo Denki) + + + + + + + + + + Yamatesen Adventure + 1983 + 光栄 (Koei) + + + + + + + + + + + Zaiko Kanri + 1981 + Kinki Computer Service + + + + + + + + + + + diff -Nru mame-0.242+dfsg.1/hash/fmtowns_cd.xml mame-0.243+dfsg.1/hash/fmtowns_cd.xml --- mame-0.242+dfsg.1/hash/fmtowns_cd.xml 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/hash/fmtowns_cd.xml 2022-04-29 05:37:26.000000000 +0000 @@ -5600,7 +5600,7 @@ --> - De-Ja II + De·Ja II 1992 エルフ (Elf) diff -Nru mame-0.242+dfsg.1/hash/fmtowns_flop_cracked.xml mame-0.243+dfsg.1/hash/fmtowns_flop_cracked.xml --- mame-0.242+dfsg.1/hash/fmtowns_flop_cracked.xml 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/hash/fmtowns_flop_cracked.xml 2022-04-29 05:37:26.000000000 +0000 @@ -62,33 +62,6 @@ - - Dinosaur (cracked) - 1991 - 日本ファルコム (Nihon Falcom) - - - - - - - - - - - - - - - - - - - - - - - Super Daisenryaku (cracked?) diff -Nru mame-0.242+dfsg.1/hash/fmtowns_flop_orig.xml mame-0.243+dfsg.1/hash/fmtowns_flop_orig.xml --- mame-0.242+dfsg.1/hash/fmtowns_flop_orig.xml 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/hash/fmtowns_flop_orig.xml 2022-04-29 05:37:26.000000000 +0000 @@ -601,7 +601,7 @@ - + @@ -1398,7 +1398,7 @@ - + @@ -1431,7 +1431,7 @@ - + @@ -2210,7 +2210,7 @@ - + diff -Nru mame-0.242+dfsg.1/hash/gamegear.xml mame-0.243+dfsg.1/hash/gamegear.xml --- mame-0.242+dfsg.1/hash/gamegear.xml 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/hash/gamegear.xml 2022-04-29 05:37:26.000000000 +0000 @@ -6453,6 +6453,18 @@ + + + Poker Face Paul's Cribbage (prototype) + 1994 + Spidersoft + + + + + + + Poker Faced Paul's Gin (USA) diff -Nru mame-0.242+dfsg.1/hash/ibm5150.xml mame-0.243+dfsg.1/hash/ibm5150.xml --- mame-0.242+dfsg.1/hash/ibm5150.xml 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/hash/ibm5150.xml 2022-04-29 05:37:26.000000000 +0000 @@ -10288,192 +10288,6 @@ - - Dragon's Lair (5.25") - 1990 - Merit Software - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Dragon's Lair (5.25", older) - 1989 - Merit Software - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Dragon's Lair (3.5") - 1990 - Merit Software - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Drakkhen (EGA, CGA, VGA) 1990 diff -Nru mame-0.242+dfsg.1/hash/ibm5170.xml mame-0.243+dfsg.1/hash/ibm5170.xml --- mame-0.242+dfsg.1/hash/ibm5170.xml 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/hash/ibm5170.xml 2022-04-29 05:37:26.000000000 +0000 @@ -11950,7 +11950,7 @@ - Dragon's Lair + Dragon's Lair (3.5" HD, re-release) 1993 Merit Software @@ -11971,6 +11971,192 @@ + + Dragon's Lair (5.25" DD) + 1990 + Merit Software + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Dragon's Lair (5.25" DD, older) + 1989 + Merit Software + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Dragon's Lair (3.5" DD) + 1990 + Merit Software + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DragonSphere 1994 @@ -17135,6 +17321,39 @@ + + Pyrotechnica + 1995 + Psygnosis + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Quarantine 1994 @@ -17421,6 +17640,93 @@ + + Red Baron (VGA 256 colors version) + 1991 + Sierra On-Line + + + + + + + + + + + + + + + + Red Baron (EGA 16 colors version) + 1991 + Sierra On-Line + + + + + + + + + + + + + + + + + + + + + Red Baron: Mission Builder + 1991 + Sierra On-Line + + + + + + + + + + + Return of the Phantom + 1993 + MicroProse + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Rex Nebular and the Cosmic Gender-Bender 1992 @@ -18117,6 +18423,35 @@ + + SimCity Classic (Windows 3.x release) (3.5") + 1993 + Maxis + + + + + + + + + + + + + + + SimCity Classic (Windows 3.x release) (5.25") + 1993 + Maxis + + + + + + + + SimCity 2000 (Ver 1.00) 1994 @@ -18266,12 +18601,34 @@ - + - + + + + + + + SimLife (Windows 3.x release) + 1993 + Maxis + + + + + + + + + + + + + + diff -Nru mame-0.242+dfsg.1/hash/lk3000.xml mame-0.243+dfsg.1/hash/lk3000.xml --- mame-0.242+dfsg.1/hash/lk3000.xml 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/hash/lk3000.xml 2022-04-29 05:37:26.000000000 +0000 @@ -15,6 +15,7 @@ LK-0280: Winter Olympics LK-0680: Summer Olympics +LK-1001: Filing System LK-3050: English-Spanish LK-3060: English-French LK-3070: English-Italian @@ -45,13 +46,13 @@ Lexicon - + - + English-German 1979 Lexicon @@ -72,7 +73,7 @@ - + diff -Nru mame-0.242+dfsg.1/hash/msx2_flop.xml mame-0.243+dfsg.1/hash/msx2_flop.xml --- mame-0.242+dfsg.1/hash/msx2_flop.xml 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/hash/msx2_flop.xml 2022-04-29 05:37:26.000000000 +0000 @@ -2287,7 +2287,7 @@ - De Ja (Jpn) + De·Ja (Jpn) 1990 Elf diff -Nru mame-0.242+dfsg.1/hash/neogeo.xml mame-0.243+dfsg.1/hash/neogeo.xml --- mame-0.242+dfsg.1/hash/neogeo.xml 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/hash/neogeo.xml 2022-04-29 05:37:26.000000000 +0000 @@ -5502,7 +5502,7 @@ Shougi no Tatsujin - Master of Shougi - 1990 + 1995 ADK / SNK @@ -6624,7 +6624,7 @@ 1997 SNK - + @@ -6661,7 +6661,7 @@ 1997 SNK - + @@ -7670,7 +7670,7 @@ Battle Flip Shot - 1999 + 1998 Visco @@ -9182,9 +9182,9 @@ Matrimelee / Shin Gouketsuji Ichizoku Toukon (NGM-2660 ~ NGH-2660) - 2002 + 2003 Noise Factory / Atlus - + @@ -10811,7 +10811,7 @@ Matrimelee / Shin Gouketsuji Ichizoku Toukon (bootleg) - 2002 + 2003 bootleg diff -Nru mame-0.242+dfsg.1/hash/nes.xml mame-0.243+dfsg.1/hash/nes.xml --- mame-0.242+dfsg.1/hash/nes.xml 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/hash/nes.xml 2022-04-29 05:37:26.000000000 +0000 @@ -2411,7 +2411,7 @@ - + Back to the Future II & III (USA) 1990 LJN @@ -2734,7 +2734,7 @@ - + @@ -9792,7 +9792,7 @@ - + @@ -16496,7 +16496,7 @@ - + High Speed (USA) 1991 Tradewest @@ -16518,7 +16518,7 @@ - + High Speed (Euro) 1994 Tradewest @@ -19229,7 +19229,7 @@ - + Jordan vs. Bird - One on One (USA) 1989 Milton Bradley @@ -21301,7 +21301,7 @@ - Kyuukyoku Harikiri Koushien (Jpn) + Kyuukyoku Harikiri Koushien (Japan) 1992 Taito @@ -21312,7 +21312,7 @@ - + @@ -21353,7 +21353,7 @@ 1988 Taito - + @@ -21374,7 +21374,7 @@ - Kyuukyoku Harikiri Stadium III (Jpn) + Kyuukyoku Harikiri Stadium III (Japan) 1991 Taito @@ -21385,7 +21385,7 @@ - + @@ -21397,7 +21397,7 @@ - Kyuukyoku Harikiri Stadium - Heisei Gannen Ban (Jpn) + Kyuukyoku Harikiri Stadium - Heisei Gannen Ban (Japan) 1989 Taito @@ -21408,7 +21408,7 @@ - + @@ -22689,7 +22689,8 @@ - + + Mach Rider (Euro) 1987 Nintendo @@ -26216,8 +26217,9 @@ - - My Life My Love - Boku no Yume - Watashi no Negai (Jpn) + + + My Life My Love - Boku no Yume - Watashi no Negai (Japan) 1991 Banpresto @@ -27048,8 +27050,9 @@ - - Ninja Jajamaru - Ginga Daisakusen (Jpn) + + + Ninja Jajamaru - Ginga Daisakusen (Japan) 1991 Jaleco @@ -28848,7 +28851,7 @@ - + Pin-Bot (USA) 1990 Nintendo @@ -28871,7 +28874,7 @@ - + Pin-Bot (Euro) 1990 Nintendo @@ -29990,7 +29993,7 @@ - + @@ -30020,7 +30023,7 @@ - + Qix (USA) 1991 Taito @@ -32254,8 +32257,9 @@ - - SD Battle Oozumou - Heisei Hero Basho (Jpn) + + + SD Battle Oozumou - Heisei Hero Basho (Japan) 1990 Banpresto @@ -32467,7 +32471,7 @@ - SD Keiji - Blader (Jpn) + SD Keiji - Blader (Japan) 1991 Taito @@ -32478,7 +32482,7 @@ - + @@ -35682,8 +35686,9 @@ - - Squashed (USA, Prototype) + + + Squashed (USA, prototype) 1991 Jaleco @@ -39242,7 +39247,7 @@ Tengen - + @@ -44224,11 +44229,7 @@ - - - - - + @@ -44571,7 +44572,7 @@ - + @@ -44586,6 +44587,7 @@ + @@ -44606,10 +44608,10 @@ - + - + @@ -44626,10 +44628,10 @@ - + - + @@ -44652,10 +44654,10 @@ - + - + @@ -44671,10 +44673,10 @@ - + - + @@ -44690,10 +44692,10 @@ - + - + @@ -44794,10 +44796,10 @@ - + - + @@ -44848,7 +44850,7 @@ - + @@ -44867,10 +44869,10 @@ - + - + @@ -44885,8 +44887,9 @@ + - + @@ -44922,10 +44925,10 @@ - + - + @@ -44937,6 +44940,7 @@ + @@ -45021,7 +45025,7 @@ - + @@ -45042,10 +45046,10 @@ - + - + @@ -45121,10 +45125,10 @@ - + - + @@ -45176,7 +45180,7 @@ - + @@ -45197,10 +45201,10 @@ - + - + @@ -45217,7 +45221,7 @@ - + @@ -45241,7 +45245,7 @@ - + @@ -45334,7 +45338,7 @@ - + @@ -45372,10 +45376,10 @@ - + - + @@ -45438,6 +45442,7 @@ + @@ -45458,7 +45463,7 @@ - + @@ -45605,10 +45610,10 @@ - + - + @@ -45644,10 +45649,10 @@ - + - + @@ -45663,10 +45668,10 @@ - + - + @@ -45719,10 +45724,10 @@ - + - + @@ -45738,10 +45743,10 @@ - + - + @@ -45776,10 +45781,10 @@ - + - + @@ -45815,10 +45820,10 @@ - + - + @@ -45853,7 +45858,7 @@ - + @@ -45893,10 +45898,10 @@ - + - + @@ -45962,10 +45967,10 @@ - + - + @@ -46005,10 +46010,10 @@ - + - + @@ -46079,7 +46084,7 @@ - + @@ -46098,10 +46103,10 @@ - + - + @@ -46122,10 +46127,10 @@ - + - + @@ -46138,7 +46143,7 @@ - + @@ -46173,10 +46178,10 @@ - + - + @@ -46209,7 +46214,7 @@ - + @@ -46261,7 +46266,7 @@ - + @@ -46402,7 +46407,7 @@ - + @@ -46445,10 +46450,10 @@ - + - + @@ -46488,10 +46493,10 @@ - + - + @@ -46506,7 +46511,7 @@ - + @@ -46558,12 +46563,12 @@ - + - + - + @@ -46598,6 +46603,7 @@ + @@ -46672,10 +46678,10 @@ - + - + @@ -46710,10 +46716,10 @@ - + - + @@ -46732,10 +46738,10 @@ - + - + @@ -46751,10 +46757,10 @@ - + - + @@ -46794,10 +46800,10 @@ - + - + @@ -46841,7 +46847,7 @@ - + @@ -46962,7 +46968,7 @@ - + @@ -47017,10 +47023,10 @@ - + - + @@ -47036,10 +47042,10 @@ - + - + @@ -47115,10 +47121,10 @@ - + - + @@ -47166,10 +47172,10 @@ - + - + @@ -47261,7 +47267,6 @@ - @@ -47282,10 +47287,10 @@ - + - + @@ -47323,7 +47328,7 @@ - + @@ -47359,10 +47364,10 @@ - + - + @@ -47378,7 +47383,7 @@ - + @@ -47429,10 +47434,10 @@ - + - + @@ -47556,6 +47561,7 @@ + @@ -47593,10 +47599,10 @@ - + - + @@ -47629,10 +47635,10 @@ - + - + @@ -47664,10 +47670,10 @@ - + - + @@ -47683,10 +47689,10 @@ - + - + @@ -47701,11 +47707,12 @@ + - + - + @@ -47721,10 +47728,10 @@ - + - + @@ -47740,10 +47747,10 @@ - + - + @@ -47759,10 +47766,10 @@ - + - + @@ -47777,11 +47784,12 @@ + - + - + @@ -47797,7 +47805,7 @@ - + @@ -47816,10 +47824,10 @@ - + - + @@ -47852,10 +47860,10 @@ - + - + @@ -47897,7 +47905,7 @@ - + @@ -47956,11 +47964,12 @@ + - + - + @@ -47977,10 +47986,10 @@ - + - + @@ -48022,7 +48031,7 @@ - + @@ -48045,10 +48054,10 @@ - + - + @@ -48063,7 +48072,6 @@ - @@ -48080,6 +48088,7 @@ + @@ -48121,10 +48130,10 @@ - + - + @@ -48140,10 +48149,10 @@ - + - + @@ -48228,7 +48237,7 @@ - + @@ -48275,10 +48284,10 @@ - + - + @@ -48299,7 +48308,7 @@ - + @@ -48318,10 +48327,10 @@ - + - + @@ -48346,6 +48355,22 @@ + + Little Lancelot (USA) + 2019 + Piko Interactive + + + + + + + + + + + + Little Mermaid - Ningyo Hime (Jpn, Prototype) 1991 @@ -48420,10 +48445,10 @@ - + - + @@ -48443,10 +48468,10 @@ - + - + @@ -48500,7 +48525,7 @@ - + @@ -48520,11 +48545,11 @@ - + - + @@ -48540,10 +48565,10 @@ - + - + @@ -48633,10 +48658,10 @@ - + - + @@ -48652,7 +48677,7 @@ - + @@ -48671,10 +48696,10 @@ - + - + @@ -48688,10 +48713,10 @@ - + - + @@ -48699,6 +48724,7 @@ + Mega Man 2 - 30th Anniversary Classic Cartridge 2018 @@ -48754,7 +48780,7 @@ - + @@ -48777,7 +48803,7 @@ - + @@ -48796,10 +48822,10 @@ - + - + @@ -48826,6 +48852,27 @@ + + Metal Max (Japan, prototype) + 1991 + Data East + + + + + + + + + + + + + + + + + Metal Storm Collector's Edition 2019 @@ -48907,12 +48954,13 @@ Namcot + - + - + @@ -48927,11 +48975,12 @@ + - + - + @@ -49006,10 +49055,10 @@ - + - + @@ -49103,10 +49152,10 @@ - + - + @@ -49122,7 +49171,7 @@ - + @@ -49178,10 +49227,10 @@ - + - + @@ -49198,7 +49247,7 @@ - + @@ -49237,10 +49286,10 @@ - + - + @@ -49280,10 +49329,10 @@ - + - + @@ -49369,7 +49418,7 @@ - + @@ -49392,7 +49441,7 @@ - + @@ -49459,16 +49508,17 @@ - + - + - - Ninja Jajamaru - Ginga Daisakusen (Jpn, Prototype) + + + Ninja Jajamaru - Ginga Daisakusen (Japan, prototype) 1991 Jaleco @@ -49495,7 +49545,7 @@ - + @@ -49553,10 +49603,10 @@ - + - + @@ -49582,7 +49632,7 @@ - + @@ -49608,7 +49658,7 @@ - + @@ -49653,7 +49703,7 @@ - + @@ -49673,7 +49723,7 @@ - + @@ -49692,10 +49742,10 @@ - + - + @@ -49710,11 +49760,12 @@ + - + - + @@ -49732,10 +49783,10 @@ - + - + @@ -49755,10 +49806,10 @@ - + - + @@ -49772,10 +49823,10 @@ - + - + @@ -49808,10 +49859,10 @@ - + - + @@ -49829,10 +49880,10 @@ - + - + @@ -49849,7 +49900,7 @@ - + @@ -49885,7 +49936,7 @@ - + @@ -49925,7 +49976,7 @@ - + @@ -49940,6 +49991,7 @@ + @@ -49961,10 +50013,29 @@ - + - + + + + + + + Pyramids of Ra (USA) + 2019 + Piko Interactive + + + + + + + + + + + @@ -49978,10 +50049,10 @@ - + - + @@ -50011,10 +50082,10 @@ - + - + @@ -50027,7 +50098,7 @@ - + @@ -50096,10 +50167,10 @@ - + - + @@ -50166,10 +50237,10 @@ - + - + @@ -50237,7 +50308,7 @@ - + @@ -50276,10 +50347,10 @@ - + - + @@ -50382,14 +50453,14 @@ - + - + - + @@ -50440,17 +50511,17 @@ - + - + - - Scarabeus (USA, Prototype) - 19?? + + Scarabeus (USA, prototype) + 1991 <unknown> @@ -50494,10 +50565,10 @@ - + - + @@ -50513,10 +50584,10 @@ - + - + @@ -50569,7 +50640,7 @@ - + @@ -50591,7 +50662,7 @@ - + @@ -50659,7 +50730,7 @@ - + @@ -50678,10 +50749,10 @@ - + - + @@ -50713,10 +50784,10 @@ - + - + @@ -50804,7 +50875,7 @@ - + @@ -50825,6 +50896,7 @@ + @@ -50894,10 +50966,10 @@ - + - + @@ -50929,10 +51001,10 @@ - + - + @@ -50951,10 +51023,10 @@ - + - + @@ -51026,10 +51098,10 @@ - + - + @@ -51062,10 +51134,10 @@ - + - + @@ -51082,10 +51154,10 @@ - + - + @@ -51136,7 +51208,7 @@ - + @@ -51226,10 +51298,10 @@ - + - + @@ -51241,6 +51313,7 @@ + @@ -51261,10 +51334,10 @@ - + - + @@ -51295,7 +51368,7 @@ - + @@ -51314,10 +51387,10 @@ - + - + @@ -51333,10 +51406,10 @@ - + - + @@ -51345,14 +51418,15 @@ Tatakai no Banka (Jpn) 1986 Capcom - + + - + @@ -51388,10 +51462,10 @@ - + - + @@ -51444,7 +51518,7 @@ - + @@ -51467,7 +51541,7 @@ - + @@ -51490,10 +51564,10 @@ - + - + @@ -51525,10 +51599,10 @@ - + - + @@ -51543,11 +51617,12 @@ + - + - + @@ -51630,7 +51705,7 @@ - + @@ -51678,9 +51753,9 @@ - Time Diver Eon Man (USA, Prototype) - 19?? - <unknown> + Time Diver Eon Man (USA, prototype) + 1993 + Taito @@ -51705,10 +51780,10 @@ - + - + @@ -51724,10 +51799,10 @@ - + - + @@ -51761,7 +51836,7 @@ - + @@ -51797,10 +51872,10 @@ - + - + @@ -51815,9 +51890,9 @@ - + - + @@ -51960,10 +52035,10 @@ - + - + @@ -51983,10 +52058,10 @@ - + - + @@ -52085,10 +52160,10 @@ - + - + @@ -52137,10 +52212,10 @@ - + - + @@ -52157,7 +52232,7 @@ - + @@ -52165,10 +52240,10 @@ - - Xybots (USA, Prototype) - 19?? - <unknown> + + Xybots (USA, prototype) + 1990 + Tengen @@ -53571,8 +53646,8 @@ 19?? HES - - + + @@ -54258,7 +54333,7 @@ - + @@ -54347,23 +54422,26 @@ - - Chuugoku Taitei (Tw) - 19?? + + Zhōngguó Dàhēng (Taiwan) + 199? Sachen - - + - - + + + + + + @@ -54514,11 +54592,11 @@ - Taiwan Mahjong - Tai Wan Ma Que 16 (Tw) + Taiwan Mahjong - Tai Wan Ma Que 16 (Taiwan) 1989 Sachen - + @@ -54533,9 +54611,10 @@ - Taiwan Mahjong - Tai Wan Ma Que 16 (Tw, Alt) + Taiwan Mahjong - Tai Wan Ma Que 16 (Taiwan, alt) 1989 Sachen + @@ -54550,9 +54629,10 @@ - Taiwan Mahjong - Tai Wan Ma Que 16 (Tw, Pirate?) + Taiwan Mahjong - Tai Wan Ma Que 16 (Asia, pirate?) 1989 <pirate> + @@ -54847,7 +54927,7 @@ - + @@ -55111,8 +55191,9 @@ - - Huge Insect (Tw) + + + Huge Insect (Taiwan) 1993 Sachen @@ -55722,6 +55803,7 @@ + Master Shooter (Asia) 1993 @@ -55828,14 +55910,15 @@ - - Qi Wang - Chinese Chess (Tw) - 199? + + Qíwáng - Chinese Chess (Taiwan) + 1991 Micro Genius - - + + + @@ -55973,7 +56056,7 @@ - + Strike Wolf (Tw) 19?? TXC Corp @@ -56045,6 +56128,77 @@ + + + + Black Dragon (Korea) + 1991 + Haitai + + + + + + + + + + + + + + + + Nar-ara Superboy (Korea) + 1991? + Haitai + + + + + + + + + + + + + + + + Skull & Crossbones (Korea) + 1991 + Haitai + + + + + + + + + + + + + + Toobin' (Korea) + 1991? + Haitai + + + + + + + + + + + + + @@ -56076,12 +56230,12 @@ - - Chao Ji Da Fu Weng - Super Rich (Chi) - 199? + + Chāojí Dà Fùwēng - Super Rich (China) + 1997 Waixing - + @@ -56091,11 +56245,15 @@ + + + + - Chao Ji Da Fu Weng - Super Rich (Chi, Decrypted WXN) + Chāojí Dà Fùwēng - Super Rich (China, decrypted WXN) 199? Waixing @@ -56269,12 +56427,12 @@ - - Sheng Huo Hui Zhang - Suo Fei Ya De Fu Su (Chi) - 199? + + Shènghuǒ Huīzhāng - Suǒfēiyà Fùsū (China, alt) + 1997 Waixing - + @@ -56284,15 +56442,19 @@ - - + + + + + + - - Sheng Huo Hui Zhang - Suo Fei Ya De Fu Su (Chi, Alt) - 199? + + Shènghuǒ Huīzhāng Wàizhuàn (China) + 1997 CoolBoy @@ -56304,18 +56466,23 @@ - - + + + + + + - - Lin Ze Xu Jin Yan (Chi) - 19?? + + + Lín Zéxú Jìnyān (China) + 1996 Waixing - + @@ -56325,6 +56492,10 @@ + + + + @@ -56435,12 +56606,13 @@ - - Duo Bao Xiao Ying Hao - Guang Ming Yu An Hei Chuan Shuo (Chi, Decrypted SmyNES) - 19?? + + + Duó Bǎo Xiǎo Yīngháo - Guāngmíng Yǔ Hēi'àn Chuánshuō (China, decrypted SmyNES) + 1996 Waixing - + @@ -56457,11 +56629,13 @@ - - Duo Bao Xiao Ying Hao - Guang Ming Yu An Hei Chuan Shuo (Chi) - 19?? + + + Duó Bǎo Xiǎo Yīngháo - Guāngmíng Yǔ Hēi'àn Chuánshuō (China) + 1996 Waixing + @@ -56496,12 +56670,13 @@ + - Zheng Jiu Shi Ji (Chi) - 199? + Zhěngjiù Shìjì (China) + 1996 Waixing - + @@ -56514,12 +56689,13 @@ + - Zheng Jiu Shi Ji (Chi, Decrypted WXN) - 199? + Zhěngjiù Shìjì (China, decrypted WXN) + 1996 Waixing - + @@ -56532,9 +56708,10 @@ + - Guang Ming Zhi Shen (Chi) - 199? + Guāngmíng Zhī Shén (China) + 1996 CoolBoy @@ -56635,9 +56812,10 @@ + - Xi Tian Qu Jing II (Chi) + Xītiān Qǔjīng II (China) 19?? Waixing @@ -57033,12 +57211,13 @@ + - Zhen Jia Hou Wang (Chi) - 199? + Zhēn Jiǎ Hóu Wáng (China) + 1996 Waixing - + @@ -57188,14 +57367,14 @@ - - - + + + - + San Xia Wu Yi (Chi, Decrypted WXN) 19?? Waixing @@ -57210,14 +57389,14 @@ - - - + + + - + San Xia Wu Yi (Chi, Alt?) 19?? Waixing @@ -57225,13 +57404,17 @@ - + + + + + @@ -57291,9 +57474,10 @@ - - Dragon Quest VIII (Chi) - 19?? + + + Dragon Quest VIII (China) + 1999 Waixing @@ -57313,6 +57497,7 @@ + Grandia (China) 1998 @@ -57334,6 +57519,7 @@ + Grandia (China, alt) 1998 @@ -57656,12 +57842,13 @@ + - Ling Jie Hu Fa - Shock (Chi) - 19?? + Língjiè Hùfǎ - Shock (China) + 2001 Waixing - + @@ -57696,9 +57883,9 @@ - - Zhen Tian Shi Yongshi (Chi) - 19?? + + Zhēntián Shí Yǒngshì (China) + 2005 Waixing @@ -57711,8 +57898,12 @@ - - + + + + + + @@ -57848,21 +58039,24 @@ - - Cheng Ji Si Han (Chi) - 19?? + + Chéngjísīhán (China) + 2005 Waixing - - + + + + + @@ -57870,21 +58064,24 @@ - - Tang Mu Li Xian Ji (Chi) - 19?? + + Tāngmǔ Lìxiǎn Jì (China) + 2005 Waixing - + - - + + + + + @@ -58046,21 +58243,28 @@ - - Feng Se Huan Xiang (Chi) - 19?? + + Fēngsè Huànxiǎng (China) + 2005 Waixing - - + + + + + + + + + @@ -58346,15 +58550,16 @@ - + + Zhànshén Shìjiè (China) - 19?? + 20?? Shenzhen Jncota - - + + @@ -58368,15 +58573,15 @@ - + Jiànxiá Qíngyuán (China) - 19?? + 20?? Shenzhen Jncota - - + + @@ -58390,15 +58595,60 @@ - + + Tiějiǎ Tújí (China) + 20?? + Shenzhen Jncota + + + + + + + + + + + + + + + + + + + + Xīnghé Zhànduì (China) + 20?? + Shenzhen Jncota + + + + + + + + + + + + + + + + + + + + Shénmó Dàlù (China) - 19?? + 20?? Shenzhen Jncota - - + + @@ -58412,19 +58662,19 @@ - + Kǒudài Guàishòu - Fěicuì Bǎn (China) - 19?? + 20?? Shenzhen Jncota - - + + - - + + @@ -58433,15 +58683,16 @@ - + + Yǒngzhě Hēi'àn Shìjiè - Hùndùn De Shìjiè (China) - 19?? + 20?? Shenzhen Jncota - - + + @@ -58455,63 +58706,63 @@ - + Kǒudài Guàishòu - Zuànshí Bǎn (KT-008 PCB) - 19?? + 20?? Shenzhen Jncota - - + + - + - + - + Kǒudài Guàishòu - Zhēnzhū Bǎn (KT-008 PCB, alt) - 19?? + 20?? Shenzhen Jncota - - + + - + - + - + Kǒudài Guàishòu - Báijīn Bǎn (KT-008 PCB, alt 2) 19?? Shenzhen Jncota - - + + - + - + @@ -59480,7 +59731,28 @@ - + + Chǒngwù Bǎobǎo (China) + 20?? + Nanjing + + + + + + + + + + + + + + + + + + Gardman (Chi) @@ -59972,7 +60244,27 @@ - + + Qítiān Dàshèng (China) + 2008 + Nanjing + + + + + + + + + + + + + + + + + San Guo Zhi - Liu Bei Zhuan (Chi) @@ -60484,6 +60776,29 @@ + + + + Jiànxiá Qíngyuán (China, Final Fantasy pirate) + 20?? + Nantong + + + + + + + + + + + + + + + + + @@ -60505,8 +60820,9 @@ - - Titanic 1912 (Asia, Hacked) + + + Titanic 1912 (Asia, hacked) 19?? Union Bond @@ -60527,6 +60843,7 @@ + Final Fantasy V (Asia) 19?? @@ -60592,12 +60909,13 @@ + - Yuefei Chuan (Asia, Hacked) + Yuèfēi Chuán (Asia, hacked) 19?? Union Bond - + @@ -60686,8 +61004,9 @@ - - + + + @@ -60780,8 +61099,9 @@ 19?? Hacker International - - + + + @@ -60818,14 +61138,14 @@ - - + + - - + + - + @@ -60973,8 +61293,8 @@ - - + + @@ -61004,6 +61324,23 @@ + + Miss Peach World 1 - Super L.A. Cop (Japan) + 1991 + Hacker International + + + + + + + + + + + + + @@ -61012,8 +61349,8 @@ Hacker International - - + + @@ -61102,36 +61439,16 @@ - - + - Soap Panic (Jpn, Bad CHR?) + Soap Panic (Japan, fixed CHR?) 1991 Hacker International - - - - - - - - - - - - - - Soap Panic (Jpn, Fixed CHR?) - 1991 - Hacker International - - - - - + + @@ -61168,8 +61485,8 @@ - Columbus Chuan (Chi) - 19?? + Columbus Chuán (China) + 2005 Waixing @@ -61192,15 +61509,15 @@ - - Columbus Chuan (Chi, Alt?) - 19?? + + Columbus Chuán (China, alt) + 2005 Waixing - - + + @@ -61500,6 +61817,28 @@ + + Wúmíng Chuánshuō (China) + 20?? + Waixing? + + + + + + + + + + + + + + + + + + Mo Dao Shi Yin Mou (Chi, Alt) 19?? @@ -61673,9 +62012,9 @@ - - Sheng Huo Hui Zhang II Dai (Chi) - 19?? + + Shènghuǒ Huīzhāng II Dài (China) + 1998 Waixing @@ -61688,16 +62027,20 @@ - - + + + + + + - - Sheng Huo Hui Zhang II Dai (Chi, Alt?) - 19?? + + Shènghuǒ Huīzhāng II Dài (China, alt) + 1998 Waixing @@ -61710,8 +62053,8 @@ - - + + @@ -61721,12 +62064,12 @@ - - Sheng Huo Hui Zhang - Suo Fei Ya Fusou (Chi, Fixed?) - 19?? + + Shènghuǒ Huīzhāng - Suǒfēiyà Fùsū (China, fixed?) + 1997 Waixing - + @@ -61736,18 +62079,22 @@ - - + + + + + + - - Sheng Huo Hui Zhang - Suo Fei Ya Fusou (Chi) - 19?? + + Shènghuǒ Huīzhāng - Suǒfēiyà Fùsū (China) + 1997 Waixing - + @@ -61757,8 +62104,12 @@ - - + + + + + + @@ -62263,9 +62614,9 @@ - - Tenchi wo Kurau II - Shokatsu Koumei Den (Chi, Simplified) - 19?? + + Tenchi wo Kurau II - Shokatsu Koumei Den (China) + 1994 Waixing? @@ -62276,6 +62627,9 @@ + + + @@ -62283,9 +62637,9 @@ - - Tenchi wo Kurau II - Shokatsu Koumei Den (Chi, Traditional) - 19?? + + Tenchi wo Kurau II - Shokatsu Koumei Den (China, alt) + 1994 Waixing? @@ -62296,6 +62650,9 @@ + + + @@ -62303,9 +62660,9 @@ - - Tun Shi Tian Di II (Chi, Alt 2) - 19?? + + Tūnshí Tiāndì II (China, alt 2) + 1994 XianFeng Katong @@ -62316,6 +62673,9 @@ + + + @@ -62323,9 +62683,9 @@ - - Tun Shi Tian Di II (Chi) - 19?? + + Tūnshí Tiāndì II (China) + 1994 XianFeng Katong @@ -62337,6 +62697,9 @@ + + + @@ -62344,9 +62707,9 @@ - - Tun Shi Tian Di II (Chi, Alt) - 19?? + + Tūnshí Tiāndì II (China, alt) + 1994 XianFeng Katong @@ -62358,6 +62721,9 @@ + + + @@ -62365,11 +62731,11 @@ - - Tun Shi Tian Di III (Chi) - 19?? + + Tūnshí Tiāndì III (China) + 1994 Waixing? - + @@ -62379,6 +62745,9 @@ + + + @@ -62485,7 +62854,7 @@ - Du Shen (Chi) + Dǔ Shén (China) 19?? XianFeng Katong @@ -62509,14 +62878,14 @@ - Du Shen (Chi, Fixed?) + Dǔ Shén (China, fixed?) 19?? Waixing - - + + @@ -62534,13 +62903,14 @@ - Luo Ke Ren X (Chi) - 19?? + Luòkèrén X (China) + 2005 Waixing + - - + + @@ -63358,6 +63728,27 @@ + + 1995 New Series Super 2 in 1 (Asia) + 1995 + <pirate> + + + + + + + + + + + + + + + + + 2 in 1 - Sonic 5 + Earthworm Jim 3 (Asia) 19?? @@ -63480,7 +63871,6 @@ - @@ -63639,7 +64029,8 @@ - + + Aladdin 2 (Asia) 19?? <unknown> @@ -63905,24 +64296,6 @@ - - Black Dragon (Korea) - 19?? - Haitai - - - - - - - - - - - - - - Block Force (Asia, Ripped from Tetris Family 9 in 1?) 19?? @@ -64156,20 +64529,23 @@ - - Da Tang Feng Yun VI Dai (Chi) + + Dàtáng Fēngyún VI Dài (China) 19?? HengGedianzi - + - - + + + + + @@ -64543,14 +64919,15 @@ + - Fan Kong Jing Ying (Chi) + Fǎnkǒng Jīngyīng (China) 19?? HengGedianzi - - + + @@ -64719,24 +65096,6 @@ - - Nar-ara Superboy (Korea) - 199? - Haitai - - - - - - - - - - - - - - Fudou Myouou Den (pirate) 19?? @@ -64849,7 +65208,7 @@ - + @@ -65077,6 +65436,7 @@ + Xītiān Qǔjīng - Journey To The West (Asia) 19?? @@ -65095,6 +65455,7 @@ + Xītiān Qǔjīng - Journey To The West (Asia, alt) 19?? @@ -65395,11 +65756,12 @@ - - Meng Huan - Xiang Shuai Chuan Qi Zhi Xue Hai (Chi) + + + Mènghuàn - Xiāng Shuài Chuánqí Zhī Xuè Hǎi Piāolíng (China) 19?? HengGedianzi - + @@ -65450,23 +65812,6 @@ - - Miss Peach World 1 - Super L.A. Cop (Japan) - 1991 - Hacker International - - - - - - - - - - - - - Mo Li Zhan Shi (Chi) 19?? @@ -65742,7 +66087,7 @@ - + Queen Bee V (Asia) 1994 Nitra @@ -66532,8 +66877,9 @@ + - Wu Ji Mo Jie (Chi) + Wújí Mójiè (China) 19?? HengGedianzi @@ -66778,8 +67124,9 @@ + - Zhuo Yue Zhi Jian (Chi) + Zhuóyuè Zhī Jiàn (China) 19?? HengGedianzi @@ -66867,10 +67214,11 @@ - - Bai Wan Fu Weng (Chi) + + Bǎi Wàn Fùwēng (China) 199? <unknown> + @@ -66990,10 +67338,12 @@ - - Chu Liu Xiang (Chi) - 19?? - <unknown> + + + Chǔ Liúxiāng (China) + 1998 + Waixing + @@ -67059,8 +67409,8 @@ - Mo Shen Fa Shi (Chi) - 19?? + Móshén Fǎshī (China) + 1998 Waixing @@ -67072,6 +67422,32 @@ + + + + + + + + + Dì Shìtiān (China) + 19?? + Waixing? + + + + + + + + + + + + + + + @@ -67330,8 +67706,9 @@ + - Golden Axe (Chi, Decrypted WXN) + Golden Axe (China, decrypted WXN) 19?? Waixing @@ -67615,31 +67992,14 @@ - - Lin Ze Xu Jin Yan (Chi, Pal) - 19?? - Waixing - - - - - - - - - - - - - - - - Lin Ze Xu Jin Yan (Chi, NTSC fix) - 19?? + + + Lín Zéxú Jìnyān (China, NTSC fix) + 1996 Waixing - + @@ -67808,25 +68168,9 @@ + - Missile Tank (Chi) - 1994 - Y.S - - - - - - - - - - - - - - - Missile Tank (Chi, Alt with 6 enemies) + Missile Tank (China, alt with 6 enemies) 1994 Y.S @@ -68069,6 +68413,7 @@ + @@ -68080,15 +68425,15 @@ - - Qi Wang - Chinese Chess (Chi, Alt) - 19?? + + Qíwáng - Chinese Chess (China, bootleg?) + 199? TXC Corp. - - - + + + @@ -68172,9 +68517,10 @@ + - Da Fu Weng 2 - Shanghai Da Heng (Chi) - 19?? + Dà Fùwēng 2 - Shànghǎi Dàhēng (China) + 1996 Waixing @@ -68264,8 +68610,9 @@ + - Si Lu Chuan Qi (Chi) + Sī Lù Chuánqí (China) 19?? HengGedianzi @@ -68462,6 +68809,7 @@ + Super Donkey Kong - Xiang Jiao Chuan (Chi) 19?? @@ -68827,19 +69175,20 @@ + - + - + Almana no Kiseki (Asia, FDS conversion) - 19?? - <unknown> + 1987 + Kaiser @@ -68876,7 +69225,7 @@ Almana no Kiseki (Asia, FDS conversion, Alt 2) - 19?? + 1989 Whirlwind Manu @@ -68912,7 +69261,7 @@ Bubble Bobble (Asia, FDS conversion) - 19?? + 1987 Kaiser @@ -68992,8 +69341,9 @@ + - + @@ -69006,14 +69356,14 @@ Dracula II - Noroi no Fuuin (Asia, FDS conversion) - 19?? - <pirate> + 1988 + Kaiser - + @@ -69028,6 +69378,7 @@ + @@ -69199,8 +69550,9 @@ + - + @@ -75666,17 +76018,17 @@ - Mike Tyson's Punch-Out!! (Pirate) + Mike Tyson's Punch-Out!! (pirate) 19?? J. Y. Company - + - + @@ -76002,10 +76354,10 @@ - + - + @@ -77659,7 +78011,7 @@ - + @@ -79977,6 +80329,22 @@ + + L'Abbaye des Morts + 2021 + Broken Studio + + + + + + + + + + + + Airball (RetroZone) @@ -79995,6 +80363,41 @@ + + AO + 2016 + Second Dimension + + + + + + + + + + + + + + + + Assimilate + 2012 + Nessylum Games + + + + + + + + + + + + + Battle Kid - Fortress of Peril (v1.100) 2010 @@ -80067,6 +80470,23 @@ + + Beat'Em & Eat'Em + 2014 + retroUSB + + + + + + + + + + + + + Candelabra - Estoscerro 2020 @@ -80083,6 +80503,22 @@ + + Dúshlán + 2016 + Mega Cat Studios + + + + + + + + + + + + E.T. @@ -80137,6 +80573,21 @@ + + King Gizzard & the Lizard Wizard - Polygondwanaland - 2nd Edition + 2019 + 5Seven Records + + + + + + + + + + + Kira Kira Star Night DX 2016 @@ -80244,6 +80695,22 @@ + + NES Virus Cleaner + 2016 + Second Dimension + + + + + + + + + + + + Nomolos - Storming the Catsle 2014 @@ -80297,6 +80764,22 @@ + + Solaris + 2016 + retroUSB + + + + + + + + + + + + Star Versus 2015 @@ -80332,6 +80815,23 @@ + + Tic-Tac XO + 2008 + RetroZone + + + + + + + + + + + + + Ultimate Frogger Championship @@ -80675,6 +81175,23 @@ + + Chāozhí Gāo K Jīnkǎ 110 in 1 + 1992 + <pirate> + + + + + + + + + + + + + 115 in 1 19?? @@ -80956,22 +81473,6 @@ - - 150 in 1 (Alt Games) - 19?? - <pirate> - - - - - - - - - - - - 150 in 1 (Alt Games 2) 19?? @@ -81187,6 +81688,42 @@ + + Gàishì 190 in 1 + 1992 + <pirate> + + + + + + + + + + + + + + + + + + 1500 in 1 + 199? + <pirate> + + + + + + + + + + + + 1994 Super HIK 14 in 1 (G-136) 19?? @@ -81625,22 +82162,6 @@ - - 260 in 1 - 19?? - <pirate> - - - - - - - - - - - - 295 in 1 19?? @@ -82213,6 +82734,22 @@ + + 1993 Super HiK 4 in 1 (F-034) + 1993 + <pirate> + + + + + + + + + + + + Super 4-in-1 Fantasy Gun @@ -83753,7 +84290,7 @@ - + 7 in 1 19?? <unknown> @@ -83935,6 +84472,21 @@ + + 76 in 1 Y2K + 19?? + <pirate> + + + + + + + + + + + 77 in 1 (NT141) 19?? @@ -83974,6 +84526,23 @@ + + + 8 in 1 (0801) + 1994 + Subor + + + + + + + + + + + + 8 in 1 (A-020) 19?? @@ -84196,6 +84765,25 @@ + + 1993 New 860 in 1 Over-Valued Golden Version Games + 1993 + <pirate> + + + + + + + + + + + + + + + 9 in 1 (Journey to the West) @@ -84661,6 +85249,22 @@ + + Golden 8 in 1 + 19?? + <pirate> + + + + + + + + + + + + Golden Card 6 in 1 19?? @@ -84676,6 +85280,60 @@ + + Golden Game: 150 in 1 + 199? + RCM Group + + + + + + + + + + + + + + + + Golden Game: 210 in 1 + 199? + RCM Group + + + + + + + + + + + + + + + + Golden Game: 260 in 1 + 199? + RCM Group + + + + + + + + + + + + + + King Series Super 4 in 1 (K4M03) @@ -85425,23 +86083,6 @@ - - - Super 8 in 1 99 King Fighter (Bad CHR?) - 19?? - <pirate> - - - - - - - - - - - - Super 8 in 1 19?? @@ -85461,22 +86102,6 @@ - - Super 8 in 1 Super Mario Kart Rider - 19?? - <pirate> - - - - - - - - - - - - Super 8 in 1 (Including Rockin' Kats) 199? @@ -85605,6 +86230,21 @@ + + Super HiK 42 in 1 (K-42001) + 1998 + <pirate> + + + + + + + + + + + 1994 Super HIK 6 in 1 (EK-601) 19?? @@ -85989,10 +86629,28 @@ + + Mike Tyson's Intergalactic Power Punch (USA, prototype) + 1991 + Nintendo + + + + + + + + + + + + + + - Mike Tyson's Intergalactic Power Punch (USA, Prototype, Hacked) - 1992 + Mike Tyson's Intergalactic Power Punch (USA, prototype, hacked) + 2009? Nintendo @@ -86046,7 +86704,6 @@ - @@ -86377,20 +87034,22 @@ - + + Pokemon HeartGold (KT-008 PCB) - 19?? + 20?? Shenzhen Jncota + - - + + - + - + diff -Nru mame-0.242+dfsg.1/hash/pc8001_flop.xml mame-0.243+dfsg.1/hash/pc8001_flop.xml --- mame-0.242+dfsg.1/hash/pc8001_flop.xml 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/hash/pc8001_flop.xml 2022-04-29 05:37:26.000000000 +0000 @@ -1543,9 +1543,10 @@ - Normandy Joriku Sakusen + Normandy Jouriku Sakusen 19?? 光栄 (Koei) + @@ -1557,6 +1558,7 @@ Normandy Jouriku Sakusen (alt) 19?? 光栄 (Koei) + @@ -1568,6 +1570,7 @@ Normandy Jouriku Sakusen (alt 2) 19?? 光栄 (Koei) + diff -Nru mame-0.242+dfsg.1/hash/pc8801_cdrom.xml mame-0.243+dfsg.1/hash/pc8801_cdrom.xml --- mame-0.242+dfsg.1/hash/pc8801_cdrom.xml 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/hash/pc8801_cdrom.xml 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,31 @@ + + + + + + + + + CD Takarabako + 1989 + NEC + + + + + + + + + diff -Nru mame-0.242+dfsg.1/hash/pc8801_flop.xml mame-0.243+dfsg.1/hash/pc8801_flop.xml --- mame-0.242+dfsg.1/hash/pc8801_flop.xml 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/hash/pc8801_flop.xml 2022-04-29 05:37:26.000000000 +0000 @@ -8,7 +8,7 @@ - + @@ -2320,12 +2320,12 @@ - + Alpha (Demo) 1986 スクウェア (Square) - + @@ -2550,7 +2550,7 @@ - + American Truck MKII Ban 1989 @@ -2565,7 +2565,7 @@ - + American Truck MKII Ban (alt) 1989 @@ -3945,7 +3945,8 @@ - + + Ayumi 1990 @@ -4124,8 +4125,8 @@ - - + + Balance of Power 1989 @@ -4465,7 +4466,8 @@ - + + Belloncho Series 1 - Belloncho Shintai Kensa 1990 ハード (Hard) @@ -4526,7 +4528,8 @@ - + + Bishoujo Baseball Gakuen 1989 パソケット (Pasoket) @@ -4742,8 +4745,9 @@ - - + + + The Black Onyx 1984 B·P·S (Bullet-Proof Software) @@ -4853,6 +4857,7 @@ + Blue Moon Story 1989 @@ -4899,7 +4904,9 @@ - + + + Cruise Chaser - Blassty 1986 スクウェア (Square) @@ -4990,6 +4997,7 @@ + @@ -5623,7 +5631,9 @@ - + + + Can Can Bunny 1989 カクテルソフト (Cocktail Soft) @@ -5647,7 +5657,9 @@ - + + + Can Can Bunny (alt?) 1989 カクテルソフト (Cocktail Soft) @@ -5672,13 +5684,16 @@ - + + + Can Can Bunny Superior 1990 フェアリーテール (Fairytale) + @@ -5711,13 +5726,16 @@ - + + + Can Can Bunny Superior (alt?) 1990 フェアリーテール (Fairytale) + @@ -5750,7 +5768,9 @@ - + + + Can Can Bunny Superior (alt 2) 1990 フェアリーテール (Fairytale) @@ -6083,7 +6103,8 @@ - + + Championship Lode Runner 1985 システムソフト (System Soft) @@ -6216,8 +6237,11 @@ - + + + Chikyu Boeigun + 1986 アートディンク (Artdink) @@ -6467,7 +6491,7 @@ - + Columns 1992 @@ -6792,7 +6816,8 @@ - + + Cranston Manor 1983 スタークラフト (Starcraft) @@ -6849,7 +6874,8 @@ ExtractDisk [01]"Disk 1 " -> "cranston_manor_v80_01.d88" ExtractDisk [02]"Disk 2 " -> "cranston_manor_v80_02.d88" --> - + + Cranston Manor (alt 2) 1983 スタークラフト (Starcraft) @@ -6872,7 +6898,9 @@ - + + + Craze 1988 ハート電子 (Heart Denshi) @@ -7113,7 +7141,9 @@ - + + + Crimson 3 1990 クリスタルソフト (Xtal Soft) @@ -7254,7 +7284,9 @@ - + + + Chou Bishoujo Densetsu Croquis 1990 ピンキー (Pinky) @@ -7496,7 +7528,8 @@ - + + Cuby Panic 1985 ゲームアーツ (Game Arts) @@ -7771,7 +7804,7 @@ - + Dai Dassou 1985 キャリーラボ (Carry Lab) @@ -7799,7 +7832,7 @@ - + Daikoukai Jidai 1990 @@ -8129,7 +8162,8 @@ - + + Datenshi Kyouko - Part I 1988 システムハウスオウ (System House Oh!) @@ -8170,7 +8204,9 @@ - + + + Day Dream 1986 クロスメディアソフト (Cross Media Soft) @@ -8269,7 +8305,7 @@ - Degan no Maseki + Digan no Maseki 1988 アーテック (Artec) @@ -8319,7 +8355,7 @@ - De・Ja + De·Ja 1990 エルフ (Elf) @@ -8393,7 +8429,7 @@ - De・Ja (alt Disk 1) + De·Ja (alt Disk 1) 1990 エルフ (Elf) @@ -8481,6 +8517,7 @@ + Demon's Ring 1984 @@ -8507,6 +8544,7 @@ + Demon's Ring (alt) 1984 @@ -8574,6 +8612,7 @@ + @@ -8613,6 +8652,7 @@ + @@ -8652,6 +8692,7 @@ + @@ -8691,6 +8732,7 @@ + @@ -9877,6 +9919,7 @@ + Door Door mkII 1985 @@ -9992,9 +10035,9 @@ - - - + + + Dragon 1989 ログ (Log) @@ -11153,6 +11196,7 @@ + @@ -11171,7 +11215,7 @@ - + Elevator Action 1986 @@ -11200,13 +11244,14 @@ - + Emerald Densetsu 1990 システムハウスオウ (System House Oh!) + @@ -11397,6 +11442,7 @@ + Emmy 1984 @@ -11411,6 +11457,7 @@ + Emmy (alt) 1984 @@ -11700,7 +11747,7 @@ - + F-15 Strike Eagle 1988 システムソフト (System Soft) @@ -11726,7 +11773,9 @@ - + + + F2 Grand Prix 1985 @@ -11743,7 +11792,7 @@ - + F2 Grand Prix(SR PSG ver) 1985 @@ -11943,7 +11992,8 @@ - + + Fangs 1991 エニックス (Enix) @@ -12003,6 +12053,7 @@ + @@ -12140,6 +12191,7 @@ + Final Crisis 1991 @@ -12172,6 +12224,7 @@ + Final Crisis (alt) 1991 @@ -13329,8 +13382,8 @@ - - + + @@ -13360,8 +13413,7 @@ - - + Gambler Jikochuushinha Mahjong Puzzle Collection 1989 ゲームアーツ (Game Arts) @@ -13375,7 +13427,8 @@ - + + Gambler Jikochuushinha Mahjong Puzzle Collection Demo 1989 ゲームアーツ (Game Arts) @@ -13442,7 +13495,9 @@ - + + + Gaudi - Barcelona no Kaze 1989 ウルフチーム (WolfTeam) @@ -13577,6 +13632,7 @@ + GeGeGe no Kitarou 1985 @@ -14347,8 +14403,10 @@ - - Grodba + + + + Grobda 1986 電波新聞社 (Dempa Shinbunsha) @@ -14360,7 +14418,9 @@ - + + + Grobda (alt) 1986 電波新聞社 (Dempa Shinbunsha) @@ -14592,13 +14652,16 @@ - + + + Gunship 1990 マイクロプローズ (Microprose) + @@ -15721,6 +15784,8 @@ + + Holland Tsuma wa Denki Unagi no Yume wo Miruka? 1984 光栄 (Koei) @@ -17125,8 +17190,8 @@ - - + + Jesus 1987 エニックス (Enix) @@ -17158,8 +17223,8 @@ - - + + Jesus (alt) 1987 エニックス (Enix) @@ -19612,13 +19677,14 @@ - + Lamia 1999 1987 ハドソン (Hudson Soft) + @@ -20993,6 +21059,7 @@ + @@ -21007,6 +21074,8 @@ + + @@ -21236,6 +21305,7 @@ + Mahjong Clinic Zoukan-gou 1991 @@ -21884,7 +21954,9 @@ - + + + Makaimura 1987 アスキー (ASCII) @@ -22574,10 +22646,11 @@ - - Metal Orange + + + Cyber Block Metal Orange 1990 - Custom + Cybertech Custom @@ -22613,10 +22686,11 @@ - - Metal Orange (alt) + + + Cyber Block Metal Orange (alt) 1990 - Custom + Cybertech Custom @@ -23893,6 +23967,7 @@ + Mugen Senshi Valis 1986 @@ -23919,7 +23994,6 @@ - Mugen Senshi Valis II @@ -23930,6 +24004,7 @@ + @@ -24360,7 +24435,7 @@ - + Ninja-kun - Majou no Bouken 1986 @@ -25527,7 +25602,8 @@ - + + The Paladin 1985 @@ -28136,30 +28212,32 @@ - + Riglas 1986 ランダムハウス (Random House) + - + - + Riglas (alt) 1986 ランダムハウス (Random House) + - + @@ -28961,7 +29039,7 @@ - + Sammy Lightfoot 1985 @@ -28969,6 +29047,7 @@ + @@ -32442,8 +32521,7 @@ ExtractDisk [01]"B DISK " -> "sorcerian music library_01.d88" ExtractDisk [02]"A DISK " -> "sorcerian music library_02.d88" --> - - + Sorcerian Music Library 1987? 日本ファルコム (Nihon Falcom)? @@ -32493,8 +32571,7 @@ - - + Space Harrier 1987 電波新聞社 (Dempa Shinbunsha) @@ -32520,8 +32597,7 @@ - - + Space Harrier (alt?) 1987 電波新聞社 (Dempa Shinbunsha) @@ -32662,7 +32738,9 @@ - + + + Star Cruiser 1988 アルシスソフト (Arsys Soft) @@ -32695,12 +32773,17 @@ + Star Ship Rendezvous 1988 スキャップトラスト (Scap Trust) + + + + @@ -33014,9 +33097,8 @@ - - - + + Sugoroku Yakyuu-dou 1989 日本クリエイト (Nihon Create) / タケル (Takeru) @@ -34924,7 +35006,8 @@ - + + Tobira wo Hirakete 1987 @@ -35421,7 +35504,7 @@ - + The Tower of Dragon 1988 @@ -35429,6 +35512,7 @@ + @@ -38566,11 +38650,12 @@ - Xak + Xak: The Art of Visual Stage 1989 マイクロキャビン (Micro Cabin) + @@ -38610,13 +38695,15 @@ - + + - Xak 2 + Xak II: Rising of the Redmoon 1990 マイクロキャビン (Micro Cabin) + @@ -38677,13 +38764,14 @@ - + - Xak II (alt) + Xak II: Rising of the Redmoon (alt) 1990 マイクロキャビン (Micro Cabin) + @@ -38737,14 +38825,16 @@ - + - Xak - Gazel no Tou + + + Xak Precious Package: The Tower of Gazzel 1991 マイクロキャビン (Micro Cabin) - + @@ -39221,7 +39311,8 @@ - + + XZR II - Kanketsu-hen 1988 @@ -39261,7 +39352,8 @@ - + + XZR II - Kanketsu-hen (alt) 1988 @@ -39614,8 +39706,7 @@ - - + Yakyuu-dou 1988 @@ -39626,6 +39717,7 @@ + @@ -39655,8 +39747,7 @@ - - + Yakyuu-dou (alt) 1988 @@ -39961,13 +40052,14 @@ - - Yoju Kikohei - Wer Dragon + + + Yoju Kikohei - WerDragon 1989 アルシスソフト (Arsys Soft) - + @@ -40369,10 +40461,12 @@ + + - + @@ -40877,7 +40971,7 @@ - + 100-yen Music Disk Vol.1 @@ -41021,8 +41115,9 @@ - - + + + Angels - Celica Crisis 19?? <doujin> @@ -41078,7 +41173,9 @@ - + + + Attacker 1990 @@ -41255,8 +41352,7 @@ - - + Blue Blood Music Disk Vol. 7 - Gradius Special 19?? <doujin> @@ -41319,7 +41415,8 @@ - + + Brunette 19?? <doujin> @@ -41331,7 +41428,8 @@ - + + Brunette (alt) 19?? <doujin> @@ -41735,7 +41833,7 @@ Chou Senshi Hoehoe 3 - 19?? + 199? <doujin> @@ -41804,8 +41902,7 @@ - - + Cone Paper Vibration Data Shuu Dai-1-kan 1991 <doujin> @@ -41819,8 +41916,7 @@ - - + Cone Paper Vibration Data Shuu Dai-2-kan 1992 <doujin> @@ -41834,8 +41930,7 @@ - - + Cone Paper Vibration Data Shuu Dai-3-kan 1993 <doujin> @@ -41939,11 +42034,14 @@ - + + + Denno Tsushin Vol. 1 1990 電脳科学研究所 (Denno Kagaku Kenkujo) + @@ -42023,7 +42121,8 @@ - + + Tiny Troubadour - Dark Shine 19?? <doujin> @@ -42149,12 +42248,14 @@ - + + Dragon Knights ~Spirit 3~ 1992 <doujin> + @@ -42215,7 +42316,8 @@ - + + Dragon Knights ~Spirit 3~ (alt) 1992 <doujin> @@ -42294,7 +42396,8 @@ - + + Duet 1990? <doujin> @@ -42366,7 +42469,8 @@ - + + Escape Princess 19?? <doujin> @@ -42643,7 +42747,7 @@ - + Ferill 1989 @@ -42656,7 +42760,7 @@ - + Ferill (alt) 1989 @@ -42669,7 +42773,7 @@ - + Ferill Data Shu Vol.1 19?? @@ -43232,7 +43336,8 @@ - + + FSD Sample Ongaku-shuu vol. 1 1992 <doujin> @@ -43245,7 +43350,8 @@ - + + FSD Sample Ongaku-shuu vol. 2 1992 <doujin> @@ -43274,7 +43380,8 @@ - + + FSD Sample Ongaku-shuu vol. 4 1992 <doujin> @@ -43288,7 +43395,8 @@ - + + FSD Sample Ongaku-shuu vol. 5 1993 <doujin> @@ -43302,6 +43410,7 @@ + FSD Sample Ongaku-shuu vol. 6 1993 @@ -43316,7 +43425,8 @@ - + + FSD Sample Ongaku-shuu vol. 7 1994 <doujin> @@ -43357,7 +43467,8 @@ - + + GC-Clusterz Music Disk vol. 1+ 1991 <doujin> @@ -43370,7 +43481,8 @@ - + + GC-Clusterz Music Disk vol. 2 1991 <doujin> @@ -43383,7 +43495,8 @@ - + + GC-Clusterz Music Disk vol. 3 1991 <doujin> @@ -43395,7 +43508,8 @@ - + + GC-Clusterz Music Disk vol. 4 1991 <doujin> @@ -43415,7 +43529,8 @@ - + + GC-Clusterz Music Disk vol. 5 1991 <doujin> @@ -43436,7 +43551,8 @@ - + + GC-Clusterz Music Disk vol. 5 (alt) 1991 <doujin> @@ -43457,7 +43573,8 @@ - + + GC-Clusterz Music Disk vol. 6 1991 <doujin> @@ -43478,7 +43595,8 @@ - + + GC-Clusterz Music Disk vol. 6 (alt) 1991 <doujin> @@ -43499,7 +43617,8 @@ - + + GC-Clusterz Music Disk vol. 7 1991 <doujin> @@ -43602,7 +43721,8 @@ - + + Hoehoe Team 199x Music Disk Vol. 1 - Explosion 1992? <doujin> @@ -43626,7 +43746,8 @@ - + + Holiness Story 1992 @@ -46384,7 +46505,7 @@ Sweet Girl 19?? <doujin> - + @@ -46396,7 +46517,7 @@ Sweet Girl 2 ~Body Game~ 1990? <doujin> - + @@ -47244,187 +47365,192 @@ - - - - - - + Lode Runner with Level Disks 19?? システムソフト (System Soft) + + + + + + + + + + + + + + + + + + + + + + + + + Jam Disk Magazine Vol.1 19?? @@ -47487,6 +47613,17 @@ + Jam Disk Magazine Vol.1 (alt) 19?? @@ -47896,7 +48033,7 @@ - + Ao no Sekizou - The Blue Statue 19?? <unknown> @@ -47926,10 +48063,13 @@ + Ashura no To - 19?? + 1990 + <unknown> + @@ -47973,12 +48113,15 @@ - + + Autumn Park 19?? <unknown> + + @@ -48050,10 +48193,13 @@ - - Card Game Vol.1 - 19?? - <unknown> + + + Card Game Change Vol.1 + 1991 + <doujin> + + @@ -48072,47 +48218,49 @@ - - Celia - 19?? - <unknown> + + + Card Game Change Vol.1 (alt) + 1990 + <doujin> + + - + - - - + + + - - - + + + - - Change Vol.1 + + Celia 19?? <unknown> - - + - - - + + + - - - + + + @@ -48139,7 +48287,7 @@ - + Chili Tomato 19?? @@ -48279,7 +48427,8 @@ - + + Double Face 1987 DTB Software @@ -48378,7 +48527,7 @@ - + Fantastic Eaters 19?? @@ -48390,7 +48539,7 @@ - + Fantastic Eaters (alt) 19?? @@ -48402,7 +48551,7 @@ - + Final Funtasy 19?? @@ -48924,7 +49073,8 @@ - + + Lascivious Oranges 19?? @@ -49221,7 +49371,7 @@ - + Midnight Chase 2 19?? @@ -50992,7 +51142,7 @@ - + Arthemis 2 19?? @@ -51073,8 +51223,8 @@ - - + + Battle Bunnygirl 1990 @@ -51798,6 +51948,7 @@ Gaia no Kiba 19?? <unknown> + @@ -52086,6 +52237,8 @@ Jark 19?? <unknown> + + @@ -52637,8 +52790,8 @@ - - + + Nazo Demo 3 19?? <unknown> @@ -52912,7 +53065,8 @@ - + + Play6 Limited Version 1999 @@ -53508,9 +53662,9 @@ - + Super Jack 88 (SB2 version) 19?? @@ -53944,19 +54098,14 @@ - - - + - + + Game Music Library 19?? <unknown> @@ -53976,6 +54125,54 @@ + + FC-Software Sound Board 1 Ongaku Disk + 19?? + <unknown> + + + + + + + + + Music Gallery 2 + 19?? + <unknown> + + + + + + + + + Game Music Collection Vol. 1 - Sega & Draque ][ + 19?? + <unknown> + + + + + + + + + + + Game Music Collection Vol. 2 - Final Fantasy Original Music + Alpha + 19?? + <unknown> + + + + + + + + + Game Pack 13 19?? @@ -54408,7 +54605,7 @@ 09:ドンキーゴリラ 10:Golf 1 11:Golf 2 12:SUPER BASEBALL 13:ガンバレ モモコ - --> +--> Oldmix2 19?? @@ -54589,15 +54786,15 @@ - + 88Gamez1 19?? @@ -54611,14 +54808,14 @@ - + 88Gamez2 19?? @@ -55042,76 +55239,6 @@ - - FC-Software Sound Board 1 Ongaku Disk - 19?? - <unknown> - - - - - - - - - Music Gallery 2 - 19?? - <unknown> - - - - - - - - - - - Music Art 88 (v2.0) - 1987? - NCS - - - - - - - - - - - - - - - - - - - Game Music Collection Vol. 1 - Sega & Draque ][ - 19?? - <unknown> - - - - - - - - - Game Music Collection Vol. 2 - Final Fantasy Original Music + Alpha - 19?? - <unknown> - - - - - - - MMK No.14 19?? @@ -55145,6 +55272,8 @@ + + P1 col 19?? @@ -55427,9 +55556,9 @@ - P1 Demo 2 + P1 Auto Demo part 2 19?? - <unknown> + デービーソフト (dB-Soft) @@ -55491,6 +55620,7 @@ + 100-yen Soft #8 Revival Special 19?? @@ -55573,9 +55703,6 @@ - - - Dig Dug / Xevious / Nintendo no Golf / Nuts & Milk 19?? @@ -56045,13 +56172,13 @@ - + + DataBox 19?? <unknown> - + - @@ -56104,7 +56231,7 @@ - + Expert88 Filer 860727 19?? @@ -56286,8 +56413,11 @@ - - + + + + + JET-Terminal v1.0 1986 キャリーラボ (Carry Lab) @@ -56302,10 +56432,16 @@ ExtractDisk [01]"システム " -> "kaseijin_01.d88" ExtractDisk [02]"データ " -> "kaseijin_02.d88" --> - - Kaseijin - 19?? - <unknown> + + + + + + Kasei-Jin + 1988 + パックインビデオ (Pack-in Video) + + @@ -56432,6 +56568,32 @@ + + + Music Art 88 (v2.0) + 1987? + NCS + + + + + + + + + + + + + + + + + + @@ -56883,7 +57045,9 @@ - + + + Super Editor 19?? <unknown> @@ -56899,8 +57063,10 @@ ExtractDisk [02]"システムディスク " -> "super shunbo ii_02.d88" ExtractDisk [03]"文章ディスク " -> "super shunbo ii_03.d88" --> - - Super Shunbo II + + + + Super Shunbo II (v1.00) 1986 デービーソフト (dB-Soft) @@ -56918,9 +57084,11 @@ + + - + @@ -58039,4 +58207,3 @@ - diff -Nru mame-0.242+dfsg.1/hash/pc98_cd.xml mame-0.243+dfsg.1/hash/pc98_cd.xml --- mame-0.242+dfsg.1/hash/pc98_cd.xml 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/hash/pc98_cd.xml 2022-04-29 05:37:26.000000000 +0000 @@ -1103,8 +1103,8 @@ - - + + - + Brandish Renewal 1995 @@ -8530,7 +8529,7 @@ - + @@ -13768,7 +13767,7 @@ - De・Ja + De·Ja 1990 エルフ (Elf) @@ -57823,7 +57822,7 @@ - De・Ja 2 + De·Ja 2 1992 エルフ (Elf) diff -Nru mame-0.242+dfsg.1/hash/pcecd.xml mame-0.243+dfsg.1/hash/pcecd.xml --- mame-0.242+dfsg.1/hash/pcecd.xml 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/hash/pcecd.xml 2022-04-29 05:37:26.000000000 +0000 @@ -31,6 +31,10 @@ various PC software and/or emulators handle them? There are multiple second audio offset issues with several games in MESS/MAME which could be related. + TODO: + - Fix sharedfeat for Arcade Card (ACD) games, once that we split implementation from scdsys; + - What [Imperfect] means in some sets? Is it an alias for baddump? + --> @@ -179,7 +183,7 @@ - Angels II - Holy Night [Prototype][Backup] (SCD)(Jpn) + Angels II - Holy Night [prototype][backup] (SCD)(Jpn) 19?? NEC @@ -359,7 +363,7 @@ - + @@ -558,15 +562,15 @@ - - Bunilla Syndrome Mahjong (CD, SCD)(Jpn) + + Mahjong Vanilla Syndrome (CD, SCD)(Jpn) 1991 Nichibutsu - + - + @@ -974,7 +978,7 @@ - De-Ja (SCD)(Jpn) + De·Ja (SCD)(Jpn) 1996 NEC Interchannel @@ -1617,7 +1621,7 @@ - + @@ -1870,7 +1874,7 @@ - + @@ -1886,7 +1890,7 @@ - + @@ -1902,7 +1906,7 @@ - + @@ -1966,7 +1970,7 @@ - + @@ -3054,7 +3058,7 @@ - + @@ -3086,7 +3090,7 @@ - + @@ -3099,7 +3103,7 @@ 1994 NEC Home Electronics - + @@ -3115,7 +3119,7 @@ - + @@ -3236,7 +3240,7 @@ - Mahou no Shoujo Silky Lip [Ver 3.1 Prototype][Backup] (SCD)(Jpn) + Mahou no Shoujo Silky Lip [ver 3.1 prototype][backup] (SCD)(Jpn) 19?? Nihon Telenet @@ -3250,7 +3254,7 @@ - Mahou no Shoujo Silky Lip [Ver 5.0 Prototype][Backup][alt] (SCD)(Jpn) + Mahou no Shoujo Silky Lip [ver 5.0 prototype][backup][alt] (SCD)(Jpn) 19?? Nihon Telenet @@ -4457,7 +4461,7 @@ - + @@ -4777,7 +4781,7 @@ - + @@ -4790,7 +4794,7 @@ 1994 Hudson - + @@ -4910,7 +4914,7 @@ - Seiya Monogatari - Anearth Fantasy Stories [Debug Version Prototype] (SCD)(Jpn) + Seiya Monogatari - Anearth Fantasy Stories [debug version prototype] (SCD)(Jpn) 19?? NEC @@ -5411,13 +5415,13 @@ - Space Fantasy Zone [Prototype][Backup] (CD, SCD)(Jpn) + Space Fantasy Zone [prototype][backup] (CD, SCD)(Jpn) 1991? NEC Avenue - + @@ -5577,7 +5581,7 @@ - + @@ -5817,7 +5821,7 @@ - + @@ -6022,7 +6026,7 @@ - + @@ -6118,7 +6122,7 @@ - + @@ -6723,7 +6727,7 @@ - + @@ -6737,7 +6741,7 @@ Hudson - + @@ -6762,7 +6766,8 @@ - Xak I II (SCD)(Jpn) + + Xak I & II (SCD)(Jpn) 1992 Nihon Telenet @@ -7185,7 +7190,7 @@ - Fantasy Star Soldier [Prototype] (SCD)(USA) + Fantasy Star Soldier [prototype] (SCD)(USA) 199? Inter State @@ -7269,16 +7274,16 @@ - Implode (SCD)(USA)[bad toc] - + Implode (SCD)(USA) 2002 MindRec + - + @@ -7373,7 +7378,7 @@ Hudson Soft / Red - + @@ -7499,7 +7504,7 @@ Sleuth Publications - + @@ -7555,7 +7560,7 @@ Syd Mead - + @@ -7652,16 +7657,16 @@ - Meteor Blaster DX (SCD)(USA)[bad toc] - + Meteor Blaster DX (SCD)(USA) 2004 MindRec + - + @@ -7755,7 +7760,7 @@ - CD Bishoujo Pachinko Kyuuma Yon Shimai (GECD)(Jpn) [Imperfect] + CD Bishoujo Pachinko Kyuuma Yon Shimai [Imperfect] (GECD)(Jpn) 1995 Game Express diff -Nru mame-0.242+dfsg.1/hash/roland_tnsc1.xml mame-0.243+dfsg.1/hash/roland_tnsc1.xml --- mame-0.242+dfsg.1/hash/roland_tnsc1.xml 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/hash/roland_tnsc1.xml 2022-04-29 05:37:26.000000000 +0000 @@ -8,12 +8,12 @@ Known cards: Dumped Serial Type Name Contents No TN-SC1-01 Music Style Card Country Bluegrass, Tex / Mex, Country Waltz, Country Rock - No TN-SC1-02 Music Style Card 50's and 60's M'Town, Rock 'n' Roll 2, Mexican Rock, Slow Soul + Yes TN-SC1-02 Music Style Card 50's and 60's M'Town, Rock 'n' Roll 2, Mexican Rock, Slow Soul Yes TN-SC1-03 Music Style Card 70's and 80's Euro Pop, Rap, Funk 3, Big Rock No TN-SC1-04 Music Style Card Around the World March 2, Waltz 2, Polka 2, Foxtrot - No TN-SC1-05 Music Style Card Around the World 2 Calypso, Reggae 2, Ska, Caribbean - No TN-SC1-06 Music Style Card Piano Bar Slow Waltz, Ballad 2, Ballad 3 - No TN-SC1-07 Music Style Card Latin Samba 2, Mambo, Beguine, Paso Doble + Yes TN-SC1-05 Music Style Card Around the World 2 Calypso, Reggae 2, Ska, Caribbean + Yes TN-SC1-06 Music Style Card Piano Bar Slow Waltz, Standard, Ballad 2, Ballad 3 + Yes TN-SC1-07 Music Style Card Latin Samba 2, Mambo, Beguine, Paso Doble No TN-SC1-08 Music Style Card Enka Enka 1, Enka 2, Enka 3, Enka 4 No TN-SC1-09 Music Style Card Japanese Pops Japanese Pop 1, Japaneses Pop 2, Japanese Pop 3, Japanese Pop 4 No TN-SC1-10 Music Style Card Easy Eight Swing 2, 8 Beat 3, 16 Beat 3, Disco 3, Waltz 4, 2 Beat, Latin Beat, Slow Rock 2 @@ -23,6 +23,23 @@ No TN-SC1-14 Music Style Card Dance 4 16 Beat 4, Blues, Slow Swing, Slow Soul 2 --> + + + 50's and 60's (TN-SC1-02) + 19?? + Roland + + + + + + + + Around the World 2 (TN-SC1-05) + 19?? + Roland + + + + + + + + + + Piano Bar (TN-SC1-06) + 19?? + Roland + + + + + + + + + + Latin (TN-SC1-07) + 19?? + Roland + + + + + + diff -Nru mame-0.242+dfsg.1/hash/sms.xml mame-0.243+dfsg.1/hash/sms.xml --- mame-0.242+dfsg.1/hash/sms.xml 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/hash/sms.xml 2022-04-29 05:37:26.000000000 +0000 @@ -944,6 +944,20 @@ + + Basket Ball Nightmare (early prototype) + 1989 + Sega + + + + + + + + + + Batman Returns (Euro, Bra) 1993 @@ -2980,6 +2994,20 @@ + + + Golden Axe CES Demo + 198? + Sega + + + + + + + + + Golden Axe Warrior (Euro, USA, Bra) 1990 @@ -2999,6 +3027,20 @@ + + Game Mo-eumjip 188 Hap (Korea) + 19?? + <unknown> + + + + + + + + + + Geraldinho (Bra) @@ -5340,6 +5382,20 @@ + + Psycho Fox (prototype) + 1989 + Aimo + + + + + + + + + + Putt & Putter (Euro, Bra) 1992 @@ -6925,6 +6981,17 @@ + + Super Futebol II (Brazil) + 1990 + Sega + + + + + + + Super Kick Off (Euro, Bra) 1991 @@ -7719,6 +7786,17 @@ + + + Wimbledon (Brazil) + 1992 + Sega + + + + + + Winter Olympics - Lillehammer '94 (Euro) diff -Nru mame-0.242+dfsg.1/hash/spectrum_cass.xml mame-0.243+dfsg.1/hash/spectrum_cass.xml --- mame-0.242+dfsg.1/hash/spectrum_cass.xml 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/hash/spectrum_cass.xml 2022-04-29 05:37:26.000000000 +0000 @@ -6143,13 +6143,46 @@ - + Cobra (bugfix) 1986 hack - - + + + + + + + + Cobra (Erbe, medium case) + 1986 + Erbe + + + + + + + + + Cobra (Erbe, small case) + 1986 + Erbe + + + + + + + + + Cobra (IBSA) + 1986 + IBSA + + + @@ -6219,7 +6252,7 @@ - Capitan Trueno (set 1) + El Capitan Trueno (set 1) 1990 Dinamic Software @@ -6234,8 +6267,8 @@ - - Capitan Trueno (set 2) + + El Capitan Trueno (set 2) 19?? <unknown> @@ -6250,8 +6283,24 @@ - - Capitan Trueno (set 2) (Part 1 only) + + El Capitan Trueno (Serie Leyenda) + 1990 + IBSA + + + + + + + + + + + + + + Capitan Trueno (set 3) (part 1 only) 1990 Dinamic Software @@ -13036,7 +13085,7 @@ International Karate (set 1) 1985 - System 3 Software Ltd + System 3 Software @@ -13052,7 +13101,7 @@ International Karate (set 2, Endurance Games) 1985 - System 3 Software Ltd + System 3 Software @@ -13100,7 +13149,7 @@ IK+ 1987 - System 3 Software Ltd + System 3 Software @@ -15405,7 +15454,7 @@ Luna Atac 1986 - Atlantis Software Ltd + Atlantis Software @@ -18324,38 +18373,6 @@ - - Ninja Warriors - 1989 - Virgin Games - - - - - - - - - - - - - - Ninja Warriors (Tronix) - 1989 - Tronix - - - - - - - - - - - - The Never Ending Story (128k release) @@ -20079,7 +20096,7 @@ Power Drift (set 3, The Hit Squad) 1989 - Activision + The Hit Squad @@ -21467,7 +21484,7 @@ Rally Simulator 1989 - Zeppelin Games Ltd + Zeppelin Games @@ -22576,7 +22593,7 @@ - Revolution (set 4, bugfix) + Revolution (set 3, bugfix) 1986 hack @@ -22599,8 +22616,8 @@ Raid Over Moscow (set 2, Americana) - 19?? - <unknown> + 1985 + Americana Software @@ -22609,7 +22626,7 @@ - Raid Over Moscow (set 3) + Raid Over Moscow (set 3, alt) 19?? <unknown> @@ -22620,7 +22637,7 @@ - Raid Over Moscow (set 4, Dro Soft) + Raid Over Moscow (set 4, Dro Soft, alt) 19?? <unknown> @@ -22631,7 +22648,7 @@ - Raid Over Moscow (set 5, Americana) + Raid Over Moscow (set 5, Americana, alt) 19?? <unknown> @@ -22641,6 +22658,17 @@ + + Raid Over Moscow (set 6, Dro Soft) + 1988 + Dro Soft + + + + + + + Red Heat 1989 @@ -22659,11 +22687,11 @@ Red Heat (Erbe) - 19?? - <unknown> + 1989 + Erbe - - + + @@ -22680,7 +22708,7 @@ - Red Heat (set 4) + Red Heat (alt) 19?? <unknown> @@ -23908,7 +23936,7 @@ The Survivors 1986 - Atlantis Software Ltd + Atlantis Software @@ -25874,9 +25902,9 @@ - Sabotage (Zeppelin Games) + Sabotage 1988 - Zeppelin Games Ltd + Zeppelin Games @@ -25885,9 +25913,9 @@ - Sabotage (Zeppelin Games, Mastering Tape) - 19?? - <unknown> + Sabotage (master tape) + 1991 + Zeppelin Games @@ -37174,6 +37202,17 @@ + + 3D Dracman + 1984 + <unknown> + + + + + + + 3D Game Maker 1987 @@ -37675,6 +37714,22 @@ + + 4 Logiciels pour ZX Spectrum + 1987 + Loriciels + + + + + + + + + + + + 4 Minute Warning 1984 @@ -37971,8 +38026,8 @@ The 11th Hour (set 2) - 19?? - <unknown> + 1986 + Venturesoft @@ -37982,11 +38037,22 @@ The 11th Hour - 19?? - <unknown> + 1986 + Venturesoft - + + + + + + + The 11th Hour (The Guild) + 19?? + The Guild + + + @@ -38121,10 +38187,26 @@ + + A Harvesting Moon (two sides) + 1985 + 8th Day + + + + + + + + + + + + - A Harvesting Moon (GI Games) - 19?? - <unknown> + A Harvesting Moon (G.I. Games) + 1991 + G.I. Games @@ -45191,7 +45273,7 @@ Battle on Hoth 19?? - <unknown> + Empire Software @@ -45199,6 +45281,17 @@ + + Battle on Hoth (alt) + 1983 + Empire Software + + + + + + + Battle Tank Simulator 1984 @@ -45758,6 +45851,17 @@ + + Bell Ropes + 1985 + John S. Patullo + + + + + + + Bemutato es Oktato 19?? @@ -50224,20 +50328,25 @@ - Captain Blood (EDOS) - 19?? - <unknown> - - - + Captain Blood + 1988 + Exxos + + + + + + + + Captain Blood (Players) - 19?? - <unknown> + 1990 + Players Software @@ -50246,17 +50355,12 @@ - Captain Blood + Captain Blood (EDOS) 19?? <unknown> - - - - - - - - + + + @@ -60096,8 +60200,8 @@ Defenders of the Earth (Hi-Tec) - 19?? - <unknown> + 1990 + Hi-Tec Software @@ -62099,7 +62203,7 @@ Dominator (set 1) 1989 - System 3 Software Ltd + System 3 Software @@ -62110,7 +62214,7 @@ Dominator (set 2, MCM) 1989 - System 3 Software Ltd / MCM + System 3 Software / MCM @@ -62121,7 +62225,7 @@ Dominator (set 3, Portuguese cover) 1989 - System 3 Software Ltd + System 3 Software @@ -62137,7 +62241,7 @@ Dominator (set 4) 1989 - System 3 Software Ltd + System 3 Software @@ -62951,8 +63055,8 @@ Dragon's Lair (Encore) - 19?? - <unknown> + 1990 + Encore @@ -62976,11 +63080,8 @@ - - - - Dragon's Lair 2 + Dragon's Lair II: Escape from Singe's Castle 1987 Software Projects @@ -62996,9 +63097,9 @@ - Dragon's Lair 2 (Encore) - 19?? - <unknown> + Dragon's Lair II: Escape from Singe's Castle (Encore) + 1990 + Encore @@ -63006,8 +63107,21 @@ - - + + Dragon's Lair II: Escape from Singe's Castle (Erbe) + 1987 + Erbe Software + + + + + + + + + + + Dragon World @@ -63054,23 +63168,23 @@ - Dragons of Flame (Kixx) + Dragons of Flame 1990 - Kixx + U.S. Gold - - + + - Dragons of Flame - 19?? - <unknown> + Dragons of Flame (Kixx) + 1990 + Kixx - - + + @@ -65096,22 +65210,6 @@ - - El Capitan Trueno (Serie Leyenda) - 1990 - IBSA - - - - - - - - - - - - El Cid (Mastertronic) 1987 @@ -70951,7 +71049,7 @@ - Freddy Hardest En Manhattan Sur + Freddy Hardest en Manhattan Sur 1989 Dinamic Software @@ -71093,7 +71191,7 @@ - French Is Fun + French is Fun 1983 CDS Microsystems @@ -71626,7 +71724,7 @@ Full Throttle 2 1990 - Zeppelin Games Ltd + Zeppelin Games @@ -77371,7 +77469,6 @@ - Halma 2005 2005 @@ -77384,23 +77481,23 @@ - Hammerfist (MCM) + Hammerfist 1990 - MCM Software + Activision - - + + - Hammerfist - 19?? - <unknown> + Hammerfist (MCM) + 1990 + MCM Software - - + + @@ -82053,23 +82150,23 @@ - Intensity (MCM) + Intensity 1988 - MCM Software + Firebird Software - - + + - Intensity - 19?? - <unknown> + Intensity (MCM) + 1988 + MCM Software - - + + @@ -82111,23 +82208,23 @@ - Interalia (EDOS) - 19?? - <unknown> + Interalia + 1990 + Atlantis Software - - + + - Interalia + Interalia (EDOS) 19?? - <unknown> + EDOS - - + + @@ -82365,7 +82462,7 @@ International 5-A-Side 1992 - Zeppelin Games Ltd + Zeppelin Games @@ -82593,7 +82690,7 @@ International Tennis 1992 - Zeppelin Games Ltd + Zeppelin Games @@ -88031,7 +88128,7 @@ - The Knights Quest + The Knight's Quest 1983 Phipps Associates @@ -88041,6 +88138,28 @@ + + Brave Knight + 1984 + Visiogame + + + + + + + + + La Quête du Chevalier + 1984 + <unknown> + + + + + + + The Krazy Kartoonist Kaper (Zenobi) 1991 @@ -92745,7 +92864,7 @@ - Mad In Cascais + Mad'in Ca$hcais 1986 Cascaismicro @@ -95710,9 +95829,9 @@ - Meganova The Weapon (Alternative) - 19?? - <unknown> + Meganova - The Weapon (Alternative) + 1988 + Alternative Software @@ -100436,7 +100555,7 @@ The Mafia Contract (set 1) 1984 - Atlantis Software Ltd + Atlantis Software @@ -100447,7 +100566,7 @@ The Mafia Contract (set 2) 1984 - Atlantis Software Ltd + Atlantis Software @@ -100458,7 +100577,7 @@ The Mafia Contract (set 3) 1984 - Atlantis Software Ltd + Atlantis Software @@ -100469,7 +100588,7 @@ The Mafia Contract II 1986 - Atlantis Software Ltd + Atlantis Software @@ -100480,7 +100599,7 @@ The Mafia Contract II (set 2) 1986 - Atlantis Software Ltd + Atlantis Software @@ -102931,9 +103050,22 @@ + The Ninja Master + 1986 + Firebird Software + + + + + + + + + The Ninja Master (MCM) 1988 MCM Software + @@ -102941,21 +103073,37 @@ - - The Ninja Master - 19?? - <unknown> + + The Ninja Warriors + 1989 + Virgin Games + + + + + + + + + + + + + + The Ninja Warriors (alt) + 1989 + Virgin Games - - + + - + The Ninja Warriors (Dro Soft) - 19?? - <unknown> + 1989 + Dro Soft @@ -102968,13 +103116,18 @@ - - The Ninja Warriors - 19?? - <unknown> - - - + + Ninja Warriors (Tronix) + 1989 + Tronix + + + + + + + + @@ -104787,7 +104940,7 @@ Overkill 1988 - Atlantis Software Ltd + Atlantis Software @@ -107477,7 +107630,7 @@ Pioneer 1984 - Atlantis Software Ltd + Atlantis Software @@ -108574,40 +108727,40 @@ - - Popeye (Alternative) - 1987 - Alternative Software + + Popeye (DK'Tronics) + 1985 + DK'Tronics - - + + - - Popeye (Dk'Tronics) - 1985 - DK'Tronics + + Popeye (Alternative) + 1987 + Alternative Software - - + + - + Popeye (Macmillan) - 19?? - <unknown> + 1985 + Macmillan Software - - + + - + Popeye (System 4) 1988 System 4 @@ -108618,7 +108771,18 @@ - + + Popeye (Zafi Chip) + 1986 + Zafi Chip + + + + + + + + Popeye (Zafiro) 1987 Z Cobra @@ -109041,7 +109205,7 @@ - Premier II - Release 1 + Premier II (release 1) 1986 E&J @@ -109052,7 +109216,7 @@ - Premier II - Release 2 + Premier II (release 2) 19?? <unknown> @@ -114727,7 +114891,7 @@ Robin of Sherlock (CRL) 1986 - CRL Group + Silversoft - CRL Group @@ -114741,9 +114905,9 @@ - Robin of Sherlock (GI Games) - 19?? - <unknown> + Robin of Sherlock (G.I. Games) + 1991 + G.I. Games @@ -114758,24 +114922,24 @@ Robin of Sherlock (Zenobi) - 19?? - <unknown> + 1992 + Zenobi Software - - + + - - + + Robin of Sherlock (set 2) - 19?? - <unknown> + 1985 + Silversoft @@ -114790,8 +114954,8 @@ Robin of Sherlock - 19?? - <unknown> + 1985 + Silversoft @@ -115529,23 +115693,23 @@ - Rollaround (Dro Soft) + Rollaround 1988 - Dro Soft + Mastertronic - + - Rollaround - 19?? - <unknown> + Rollaround (Dro Soft) + 1988 + Dro Soft - + @@ -116095,7 +116259,7 @@ - Run Baby Run - Release 1 + Run Baby Run (release 1) 19?? <unknown> @@ -116106,7 +116270,7 @@ - Run Baby Run - Release 2 + Run Baby Run (release 2) 19?? <unknown> @@ -116329,8 +116493,19 @@ - - Rygar (Erbe) (alternate) + + Rygar + 1987 + U.S. Gold + + + + + + + + + Rygar (Erbe, alt) 1987 Erbe Software @@ -116340,24 +116515,24 @@ - - Rygar (Kixx) + + Rygar (Erbe, promotional) 1987 - Kixx + Erbe Software - - + + - - Rygar + + Rygar (Kixx) 1987 - U.S. Gold + Kixx - - + + @@ -117393,24 +117568,24 @@ - + Satan 1989 - System 4 + Dinamic Software - - + + - - + + - - Satan - Small Case + + Satan (small case) 1989 System 4 @@ -117453,9 +117628,9 @@ - Savage Island Part 1 (set 3) - 19?? - <unknown> + Savage Island - Part 1 (set 3) + 1987 + Adventure International @@ -117464,9 +117639,9 @@ - Savage Island Part 1 (set 2) - 19?? - <unknown> + Savage Island - Part 1 (set 2) + 1987 + Adventure International @@ -117475,9 +117650,9 @@ - Savage Island Part 1 - 19?? - <unknown> + Savage Island - Part 1 (Tynesoft) + 1987 + Tynesoft @@ -117486,20 +117661,20 @@ - Savage Island Part 2 (set 3) - 19?? - <unknown> + Savage Island - Part 1 (set 1) + 1987 + Adventure International - - + + - - Savage Island Part 2 (set 2) - 19?? - <unknown> + + Savage Island - Part 2 (set 2) + 1987 + Adventure International @@ -117507,24 +117682,24 @@ - - Savage Island Part 2 - 19?? - <unknown> + + Savage Island - Part 2 (set 1) + 1987 + Adventure International - - + + - - Savage Island - 19?? - <unknown> + + Savage Island - Part 2 (Tynesoft) + 1987 + Tynesoft - - + + @@ -117585,7 +117760,7 @@ - Scapeghost - 128k + Scapeghost (128K) 1989 Level 9 Computing @@ -117606,9 +117781,9 @@ - Scapeghost - 48k - 19?? - <unknown> + Scapeghost (48K) + 1989 + Level 9 Computing @@ -117777,21 +117952,21 @@ - - Scoop (set 3) + + Scoop 1985 - Sentient + Sentient Software - - + + - + Scoop (set 2) - 19?? - <unknown> + 1985 + Sentient Software @@ -117799,13 +117974,13 @@ - - Scoop + + Scoop (set 3) 1985 - Sentient + Sentient Software - - + + @@ -118014,7 +118189,7 @@ - Scramble - Release 1 + Scramble (release 1) 19?? <unknown> @@ -118025,7 +118200,7 @@ - Scramble - Release 2 + Scramble (release 2) 19?? <unknown> @@ -128305,20 +128480,20 @@ - Super Cycle (Erbe) + Super Cycle 1987 - Erbe Software + U.S. Gold - - + + Super Cycle (Kixx) - 19?? - <unknown> + 1987 + Kixx @@ -128327,12 +128502,23 @@ - Super Cycle - 19?? - <unknown> + Super Cycle (Erbe) + 1987 + Erbe Software + + + + + + + + + Super Cycle (Compulogical) + 1987 + Compulogical - + @@ -129176,7 +129362,7 @@ Superkid 1989 - Atlantis Software Ltd + Atlantis Software @@ -129187,7 +129373,7 @@ Superkid In Space 1990 - Atlantis Software Ltd + Atlantis Software @@ -131964,7 +132150,7 @@ Temple Terror 1985 - Atlantis Software Ltd + Atlantis Software @@ -133531,7 +133717,7 @@ Thinker (1984, Atlantis) 1984 - Atlantis Software Ltd + Atlantis Software @@ -134641,7 +134827,7 @@ Titanic Blinky (set 1) 1991 - Zeppelin Games Ltd + Zeppelin Games @@ -137057,7 +137243,18 @@ - + + Tusker + 1989 + System 3 Software + + + + + + + + Tusker (Kixx) 1989 Kixx @@ -137068,7 +137265,7 @@ - + Tusker (MCM) 1989 MCM Software @@ -137079,17 +137276,6 @@ - - Tusker - 1989 - System 3 Software - - - - - - - Tutankhamun 1983 @@ -144023,24 +144209,24 @@ - - Yeti (Alternative) + + Yeti 1988 - Alternative Software + Destiny - - + + - - Yeti + + Yeti (Alternative) 1988 - Destiny + Alternative Software - - + + diff -Nru mame-0.242+dfsg.1/hash/vboy.xml mame-0.243+dfsg.1/hash/vboy.xml --- mame-0.242+dfsg.1/hash/vboy.xml 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/hash/vboy.xml 2022-04-29 05:37:26.000000000 +0000 @@ -36,7 +36,7 @@ - Bound High! (Jpn, USA, Prototype) + Bound High! (Jpn, USA, prototype) 1996 Nintendo @@ -167,7 +167,7 @@ - Niko-chan Battle (Jpn, Prototype) + Niko-chan Battle (Jpn, prototype) 1996 Bullet-Proof Software @@ -251,7 +251,7 @@ - Space Pinball (Jpn, Prototype) + Space Pinball (Jpn, prototype) 1995 Nintendo diff -Nru mame-0.242+dfsg.1/hash/x68k_flop.xml mame-0.243+dfsg.1/hash/x68k_flop.xml --- mame-0.242+dfsg.1/hash/x68k_flop.xml 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/hash/x68k_flop.xml 2022-04-29 05:37:26.000000000 +0000 @@ -3496,7 +3496,7 @@ - De・Ja + De·Ja 1990 エルフ (Elf) diff -Nru mame-0.242+dfsg.1/language/Chinese_Simplified/strings.po mame-0.243+dfsg.1/language/Chinese_Simplified/strings.po --- mame-0.242+dfsg.1/language/Chinese_Simplified/strings.po 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/language/Chinese_Simplified/strings.po 2022-04-29 05:37:26.000000000 +0000 @@ -5609,7 +5609,7 @@ #, lua-format msgctxt "plugin-autofire" msgid "%s [%g Hz]" -msgstr "%s [%d Hz]" +msgstr "%s [%g Hz]" #: plugins/autofire/autofire_menu.lua:95 #, lua-format diff -Nru mame-0.242+dfsg.1/language/Greek/strings.po mame-0.243+dfsg.1/language/Greek/strings.po --- mame-0.242+dfsg.1/language/Greek/strings.po 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/language/Greek/strings.po 2022-04-29 05:37:26.000000000 +0000 @@ -5638,7 +5638,7 @@ #, lua-format msgctxt "plugin-autofire" msgid "%s [%g Hz]" -msgstr "%s [%d Hz]" +msgstr "%s [%g Hz]" #: plugins/autofire/autofire_menu.lua:95 #, lua-format diff -Nru mame-0.242+dfsg.1/language/Ukrainian/strings.po mame-0.243+dfsg.1/language/Ukrainian/strings.po --- mame-0.242+dfsg.1/language/Ukrainian/strings.po 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/language/Ukrainian/strings.po 2022-04-29 05:37:26.000000000 +0000 @@ -1,15 +1,16 @@ -# Ukrainian translations for PACKAGE package. -# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# Automatically generated, 2016. +# Ukrainian translations for MAME package. +# Український переклад MAME-пакета +# Copyright (C) 1997-2022 MAMEdev and contributors +# This file is distributed under the same license as the MAME package. +# Automatically generated, 2021. # msgid "" msgstr "" "Project-Id-Version: MAME\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-12-09 04:44+1100\n" -"PO-Revision-Date: 2016-02-20 18:03+0100\n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2022-01-05 19:14+0200\n" +"Last-Translator: Stanley Kid \n" "Language-Team: MAME Language Team\n" "Language: uk\n" "MIME-Version: 1.0\n" @@ -24,10 +25,13 @@ "\n" "Press any key to continue" msgstr "" +"\n" +"\n" +"Натисни для продовження." #: src/frontend/mame/ui/ui.cpp:554 msgid "This driver requires images to be loaded in the following device(s): " -msgstr "" +msgstr "Драйверу необхідне завантаження образів на пристрої: " #: src/frontend/mame/ui/ui.cpp:1248 #, c-format @@ -35,6 +39,8 @@ "UI controls enabled\n" "Use %1$s to toggle" msgstr "" +"UI-керування увімкнено.\n" +"Використовуй %1$s для перемикання." #: src/frontend/mame/ui/ui.cpp:1250 #, c-format @@ -42,110 +48,112 @@ "UI controls disabled\n" "Use %1$s to toggle" msgstr "" +"UI-керування вимкнено.\n" +"Використовуй %1$s для перемикання." #: src/frontend/mame/ui/ui.cpp:1459 msgid "Master Volume" -msgstr "" +msgstr "Загальна гучність" #: src/frontend/mame/ui/ui.cpp:1468 #, c-format msgid "%1$s Volume" -msgstr "" +msgstr "%1$s гучність" #: src/frontend/mame/ui/ui.cpp:1490 #, c-format msgid "Overclock CPU %1$s" -msgstr "" +msgstr "CPU-розгін %1$s" #: src/frontend/mame/ui/ui.cpp:1498 #, c-format msgid "Overclock %1$s sound" -msgstr "" +msgstr "Розгін %1$s звуку" #: src/frontend/mame/ui/ui.cpp:1517 #, c-format msgid "%1$s Refresh Rate" -msgstr "" +msgstr "Частота оновлення %1$s" #: src/frontend/mame/ui/ui.cpp:1522 #, c-format msgid "%1$s Brightness" -msgstr "" +msgstr "Яскравість %1$s" #: src/frontend/mame/ui/ui.cpp:1524 #, c-format msgid "%1$s Contrast" -msgstr "" +msgstr "Контраст %1$s" #: src/frontend/mame/ui/ui.cpp:1526 #, c-format msgid "%1$s Gamma" -msgstr "" +msgstr "Гама %1$s" #: src/frontend/mame/ui/ui.cpp:1530 #, c-format msgid "%1$s Horiz Stretch" -msgstr "" +msgstr "Горизонтальне розтягування %1$s" #: src/frontend/mame/ui/ui.cpp:1532 #, c-format msgid "%1$s Horiz Position" -msgstr "" +msgstr "Горизонтальне положення %1$s" #: src/frontend/mame/ui/ui.cpp:1534 #, c-format msgid "%1$s Vert Stretch" -msgstr "" +msgstr "Вертикальне розтягування %1$s" #: src/frontend/mame/ui/ui.cpp:1536 #, c-format msgid "%1$s Vert Position" -msgstr "" +msgstr "Вертикальне положення %1$s" #: src/frontend/mame/ui/ui.cpp:1552 #, c-format msgid "Laserdisc '%1$s' Horiz Stretch" -msgstr "" +msgstr "Горизонтальне розтягування %1$s Laserdisc" #: src/frontend/mame/ui/ui.cpp:1555 #, c-format msgid "Laserdisc '%1$s' Horiz Position" -msgstr "" +msgstr "Горизонтальне положення %1$s Laserdisc" #: src/frontend/mame/ui/ui.cpp:1557 #, c-format msgid "Laserdisc '%1$s' Vert Stretch" -msgstr "" +msgstr "Вертикальне розтягування %1$s Laserdisc" #: src/frontend/mame/ui/ui.cpp:1560 #, c-format msgid "Laserdisc '%1$s' Vert Position" -msgstr "" +msgstr "Вертикальне положення %1$s Laserdisc" #: src/frontend/mame/ui/ui.cpp:1570 msgid "Vector Flicker" -msgstr "" +msgstr "Векторне мерехтіння" #: src/frontend/mame/ui/ui.cpp:1571 msgid "Beam Width Minimum" -msgstr "" +msgstr "Мінімальна ширина променя" #: src/frontend/mame/ui/ui.cpp:1572 msgid "Beam Width Maximum" -msgstr "" +msgstr "Максимальна ширина променя" #: src/frontend/mame/ui/ui.cpp:1573 msgid "Beam Dot Size" -msgstr "" +msgstr "Розмір точки променя" #: src/frontend/mame/ui/ui.cpp:1574 msgid "Beam Intensity Weight" -msgstr "" +msgstr "Інтенсивність променя" #: src/frontend/mame/ui/ui.cpp:1587 #, c-format msgid "Crosshair Scale %1$s" -msgstr "" +msgstr "Масштаб прицілу %1$s" #: src/frontend/mame/ui/ui.cpp:1587 src/frontend/mame/ui/ui.cpp:1589 msgid "X" @@ -158,22 +166,22 @@ #: src/frontend/mame/ui/ui.cpp:1589 #, c-format msgid "Crosshair Offset %1$s" -msgstr "" +msgstr "Зміщення прицілу %1$s" #: src/frontend/mame/ui/ui.cpp:1617 #, c-format msgid "%1$3ddB" -msgstr "" +msgstr "%1$3d дБ" #: src/frontend/mame/ui/ui.cpp:1660 #, c-format msgid "%1$d%%" -msgstr "" +msgstr "%1$d %%" #: src/frontend/mame/ui/ui.cpp:1675 #, c-format msgid "%1$3.0f%%" -msgstr "" +msgstr "%1$3.0f %%" #: src/frontend/mame/ui/ui.cpp:1698 src/frontend/mame/ui/ui.cpp:1718 #: src/frontend/mame/ui/ui.cpp:1737 src/frontend/mame/ui/ui.cpp:1755 @@ -195,31 +203,31 @@ #: src/frontend/mame/ui/ui.cpp:2006 #, c-format msgid "Crosshair Scale X %1$1.3f" -msgstr "" +msgstr "Масштаб прицілу X %1$1.3f" #: src/frontend/mame/ui/ui.cpp:2006 #, c-format msgid "Crosshair Scale Y %1$1.3f" -msgstr "" +msgstr "Масштаб прицілу Y %1$1.3f" #: src/frontend/mame/ui/ui.cpp:2023 #, c-format msgid "Crosshair Offset X %1$1.3f" -msgstr "" +msgstr "Зміщення прицілу X %1$1.3f" #: src/frontend/mame/ui/ui.cpp:2023 #, c-format msgid "Crosshair Offset Y %1$1.3f" -msgstr "" +msgstr "Зміщення прицілу Y %1$1.3f" #: src/frontend/mame/ui/ui.cpp:2110 msgid "**Error saving ui.ini**" -msgstr "" +msgstr "**Помилка збереження ui.ini**" #: src/frontend/mame/ui/ui.cpp:2169 #, c-format msgid "**Error saving %s.ini**" -msgstr "" +msgstr "**Помилка збереження %s.ini**" #: src/frontend/mame/ui/ui.cpp:2173 src/frontend/mame/ui/miscmenu.cpp:748 msgid "" @@ -227,6 +235,9 @@ " Configuration saved \n" "\n" msgstr "" +"\n" +" Конфігурацію збережено. \n" +"\n" #: src/frontend/mame/ui/selsoft.cpp:484 src/frontend/mame/ui/selgame.cpp:300 #, c-format @@ -234,6 +245,8 @@ "%s\n" " added to favorites list." msgstr "" +"%s\n" +" додано до переліку вподобань." #: src/frontend/mame/ui/selsoft.cpp:489 src/frontend/mame/ui/selgame.cpp:305 #: src/frontend/mame/ui/selgame.cpp:311 @@ -242,397 +255,399 @@ "%s\n" " removed from favorites list." msgstr "" +"%s\n" +" вилучено з переліку вподобань." #: src/frontend/mame/ui/selsoft.cpp:522 msgid "[Start empty]" -msgstr "" +msgstr "[Розпочати порожнім]" #: src/frontend/mame/ui/selsoft.cpp:522 msgid "[Use file manager]" -msgstr "" +msgstr "(Використовувати менеджер файлів)" #: src/frontend/mame/ui/selsoft.cpp:705 #, c-format msgid "%1$s %2$s ( %3$d / %4$d software packages )" -msgstr "" +msgstr "%1$s %2$s (%3$d / %4$d програмні пакети)" #: src/frontend/mame/ui/selsoft.cpp:706 #, c-format msgid "Driver: \"%1$s\" software list " -msgstr "" +msgstr "Драйвер: \"%1$s\" переліків програм " #: src/frontend/mame/ui/selsoft.cpp:711 src/frontend/mame/ui/selgame.cpp:1076 #, c-format msgid "%1$s: %2$s - Search: %3$s_" -msgstr "" +msgstr "%1$s: %2$s - Шукати: %3$s_" #: src/frontend/mame/ui/selsoft.cpp:713 src/frontend/mame/ui/selgame.cpp:1078 #, c-format msgid "Search: %1$s_" -msgstr "" +msgstr "Шукати: %1$s_" #: src/frontend/mame/ui/selsoft.cpp:720 #, c-format msgid "Software list/item: %1$s:%2$s" -msgstr "" +msgstr "Перелік програм / пунктів: %1$s:%2$s" #: src/frontend/mame/ui/optsmenu.cpp:73 src/frontend/mame/ui/sndmenu.cpp:161 msgid "Sound Options" -msgstr "" +msgstr "Опції аудіо" #: src/frontend/mame/ui/optsmenu.cpp:76 msgid "General Inputs" -msgstr "" +msgstr "Загальне керування" #: src/frontend/mame/ui/optsmenu.cpp:79 src/frontend/mame/ui/miscmenu.cpp:945 msgid "Plugins" -msgstr "" +msgstr "Плаґіни" #: src/frontend/mame/ui/optsmenu.cpp:81 msgid "Save Configuration" -msgstr "" +msgstr "Зберегти конфігурацію" #: src/frontend/mame/ui/optsmenu.cpp:148 msgid "Settings" -msgstr "" +msgstr "Налаштування" #: src/frontend/mame/ui/optsmenu.cpp:205 msgid "Filter" -msgstr "" +msgstr "Фільтр" #: src/frontend/mame/ui/optsmenu.cpp:217 msgid "Customize UI" -msgstr "" +msgstr "Змінити UI" #: src/frontend/mame/ui/optsmenu.cpp:218 msgid "Configure Directories" -msgstr "" +msgstr "Налаштувати каталоги" #: src/frontend/mame/ui/filesel.cpp:260 src/frontend/mame/ui/swlist.cpp:89 #: src/frontend/mame/ui/slotopt.cpp:220 msgid "[empty slot]" -msgstr "" +msgstr "[порожній слот]" #: src/frontend/mame/ui/filesel.cpp:264 msgid "[create]" -msgstr "" +msgstr "[створити]" #: src/frontend/mame/ui/filesel.cpp:268 src/frontend/mame/ui/swlist.cpp:100 msgid "[software list]" -msgstr "" +msgstr "[перелік програм]" #: src/frontend/mame/ui/filesel.cpp:324 #, c-format msgid "Error accessing %s" -msgstr "" +msgstr "Помилка доступу до %s." #: src/frontend/mame/ui/filesel.cpp:546 msgid "Select access mode" -msgstr "" +msgstr "Вибери режим доступу." #: src/frontend/mame/ui/filesel.cpp:547 msgid "Read-only" -msgstr "" +msgstr "Лише читання" #: src/frontend/mame/ui/filesel.cpp:549 msgid "Read-write" -msgstr "" +msgstr "Читання-запис" #: src/frontend/mame/ui/filesel.cpp:550 msgid "Read this image, write to another image" -msgstr "" +msgstr "Читання образу, запис до іншого" #: src/frontend/mame/ui/filesel.cpp:551 msgid "Read this image, write to diff" -msgstr "" +msgstr "Читання образу, запис до diff" #: src/frontend/mame/ui/submenu.cpp:33 msgid "Miscellaneous Options" -msgstr "" +msgstr "Різні опції" #: src/frontend/mame/ui/submenu.cpp:34 msgid "Skip imperfect emulation warnings" -msgstr "" +msgstr "Пропускати попередження недосконалої емуляції" #: src/frontend/mame/ui/submenu.cpp:35 msgid "Re-select last machine launched" -msgstr "" +msgstr "Вибрати останню запущену машину знову" #: src/frontend/mame/ui/submenu.cpp:36 msgid "Enlarge images in the right panel" -msgstr "" +msgstr "Збільшувати зображення на правій панелі" #: src/frontend/mame/ui/submenu.cpp:37 msgid "Cheats" -msgstr "" +msgstr "Чіти" #: src/frontend/mame/ui/submenu.cpp:38 msgid "Show mouse pointer" -msgstr "" +msgstr "Показувати курсор миші" #: src/frontend/mame/ui/submenu.cpp:39 msgid "Confirm quit from emulation" -msgstr "" +msgstr "Підтверджувати вихід із емуляції" #: src/frontend/mame/ui/submenu.cpp:40 msgid "Skip system information screen" -msgstr "" +msgstr "Пропускати екран відомостей системи" #: src/frontend/mame/ui/submenu.cpp:41 msgid "Force 4:3 aspect for snapshot display" -msgstr "" +msgstr "Примусове співвідношення 4:3 для відображення кадрів" #: src/frontend/mame/ui/submenu.cpp:42 msgid "Use image as background" -msgstr "" +msgstr "Використовувати зображення як тло" #: src/frontend/mame/ui/submenu.cpp:43 msgid "Skip BIOS selection menu" -msgstr "" +msgstr "Пропускати меню вибору BIOS" #: src/frontend/mame/ui/submenu.cpp:44 msgid "Skip software part selection menu" -msgstr "" +msgstr "Пропускати меню вибору програмної частини" #: src/frontend/mame/ui/submenu.cpp:45 msgid "Info auto audit" -msgstr "" +msgstr "Відомості автоперевірки" #: src/frontend/mame/ui/submenu.cpp:46 msgid "Hide romless machine from available list" -msgstr "" +msgstr "Приховати машину без ROM із переліку доступних" #: src/frontend/mame/ui/submenu.cpp:52 msgid "Advanced Options" -msgstr "" +msgstr "Розширені опції" #: src/frontend/mame/ui/submenu.cpp:53 msgid "Performance Options" -msgstr "" +msgstr "Опції продуктивності" #: src/frontend/mame/ui/submenu.cpp:54 msgid "Auto frame skip" -msgstr "" +msgstr "Автопропуск кадрів" #: src/frontend/mame/ui/submenu.cpp:55 msgid "Frame skip" -msgstr "" +msgstr "Пропуск кадрів" #: src/frontend/mame/ui/submenu.cpp:56 msgid "Throttle" -msgstr "" +msgstr "Прискорити" #: src/frontend/mame/ui/submenu.cpp:57 msgid "Mute when unthrottled" -msgstr "" +msgstr "Притлумити звук без прискорення" #: src/frontend/mame/ui/submenu.cpp:58 msgid "Sleep" -msgstr "" +msgstr "Сон" #: src/frontend/mame/ui/submenu.cpp:59 msgid "Speed" -msgstr "" +msgstr "Швидкість" #: src/frontend/mame/ui/submenu.cpp:60 msgid "Adjust speed to match refresh rate" -msgstr "" +msgstr "Регулювати швидкість за частотою оновлення" #: src/frontend/mame/ui/submenu.cpp:61 msgid "Low latency" -msgstr "" +msgstr "Низька затримка" #: src/frontend/mame/ui/submenu.cpp:63 msgid "Rotation Options" -msgstr "" +msgstr "Опції повороту" #: src/frontend/mame/ui/submenu.cpp:64 src/frontend/mame/ui/videoopt.cpp:179 msgid "Rotate" -msgstr "" +msgstr "Повернути" #: src/frontend/mame/ui/submenu.cpp:65 msgid "Rotate right" -msgstr "" +msgstr "Повернути праворуч" #: src/frontend/mame/ui/submenu.cpp:66 msgid "Rotate left" -msgstr "" +msgstr "Повернути ліворуч" #: src/frontend/mame/ui/submenu.cpp:67 msgid "Auto rotate right" -msgstr "" +msgstr "Автоповорот праворуч" #: src/frontend/mame/ui/submenu.cpp:68 msgid "Auto rotate left" -msgstr "" +msgstr "Автоповорот ліворуч" #: src/frontend/mame/ui/submenu.cpp:69 msgid "Flip X" -msgstr "" +msgstr "Перевернути X" #: src/frontend/mame/ui/submenu.cpp:70 msgid "Flip Y" -msgstr "" +msgstr "Перевернути Y" #: src/frontend/mame/ui/submenu.cpp:72 msgid "Artwork Options" -msgstr "" +msgstr "Опції оформлення" #: src/frontend/mame/ui/submenu.cpp:73 msgid "Zoom to screen area" -msgstr "" +msgstr "Масштабувати до області екрана" #: src/frontend/mame/ui/submenu.cpp:75 msgid "State/Playback Options" -msgstr "" +msgstr "Опції збереження / відтворення" #: src/frontend/mame/ui/submenu.cpp:76 msgid "Automatic save/restore" -msgstr "" +msgstr "Автоматичне збереження / відновлення" #: src/frontend/mame/ui/submenu.cpp:77 msgid "Allow rewind" -msgstr "" +msgstr "Дозволити перемотування назад" #: src/frontend/mame/ui/submenu.cpp:78 msgid "Rewind capacity" -msgstr "" +msgstr "Швидкість перемотування назад" #: src/frontend/mame/ui/submenu.cpp:79 msgid "Bilinear filtering for snapshots" -msgstr "" +msgstr "Білінійна фільтрація для кадрів" #: src/frontend/mame/ui/submenu.cpp:80 msgid "Burn-in" -msgstr "" +msgstr "Вигорання" #: src/frontend/mame/ui/submenu.cpp:82 msgid "Input Options" -msgstr "" +msgstr "Опції керування" #: src/frontend/mame/ui/submenu.cpp:83 msgid "Coin lockout" -msgstr "" +msgstr "Блокування монет" #: src/frontend/mame/ui/submenu.cpp:84 msgid "Mouse" -msgstr "" +msgstr "Миша" #: src/frontend/mame/ui/submenu.cpp:85 msgid "Joystick" -msgstr "" +msgstr "Джойстик" #: src/frontend/mame/ui/submenu.cpp:86 msgid "Lightgun" -msgstr "" +msgstr "Світловий пістолет" #: src/frontend/mame/ui/submenu.cpp:87 msgid "Multi-keyboard" -msgstr "" +msgstr "Мультиклавіатура" #: src/frontend/mame/ui/submenu.cpp:88 msgid "Multi-mouse" -msgstr "" +msgstr "Мультимиша" #: src/frontend/mame/ui/submenu.cpp:89 msgid "Steadykey" -msgstr "" +msgstr "Постійна кнопка" #: src/frontend/mame/ui/submenu.cpp:90 msgid "UI active" -msgstr "" +msgstr "Активний UI" #: src/frontend/mame/ui/submenu.cpp:91 msgid "Off-screen reload" -msgstr "" +msgstr "Закадрове перезавантаження" #: src/frontend/mame/ui/submenu.cpp:92 msgid "Joystick deadzone" -msgstr "" +msgstr "Мертва зона джойстика" #: src/frontend/mame/ui/submenu.cpp:93 msgid "Joystick saturation" -msgstr "" +msgstr "Насиченість джойстика" #: src/frontend/mame/ui/submenu.cpp:94 msgid "Natural keyboard" -msgstr "" +msgstr "Звичайна клавіатура" #: src/frontend/mame/ui/submenu.cpp:95 msgid "Allow contradictory joystick inputs" -msgstr "" +msgstr "Дозволити протилежні керування джойстика" #: src/frontend/mame/ui/submenu.cpp:96 msgid "Coin impulse" -msgstr "" +msgstr "Імпульс монети" #: src/frontend/mame/ui/submenu.cpp:102 msgid "Input Device Options" -msgstr "" +msgstr "Опції пристрою керування" #: src/frontend/mame/ui/submenu.cpp:103 msgid "Lightgun Device Assignment" -msgstr "" +msgstr "Призначення пристрою світлового пістолета" #: src/frontend/mame/ui/submenu.cpp:104 msgid "Trackball Device Assignment" -msgstr "" +msgstr "Призначення пристрою трекболу" #: src/frontend/mame/ui/submenu.cpp:105 msgid "Pedal Device Assignment" -msgstr "" +msgstr "Призначення пристрою педалі" #: src/frontend/mame/ui/submenu.cpp:106 msgid "AD Stick Device Assignment" -msgstr "" +msgstr "Призначення пристрою аналогового джойстика" #: src/frontend/mame/ui/submenu.cpp:107 msgid "Paddle Device Assignment" -msgstr "" +msgstr "Призначення пристрою весла" #: src/frontend/mame/ui/submenu.cpp:108 msgid "Dial Device Assignment" -msgstr "" +msgstr "Призначення поворотного пристрою" #: src/frontend/mame/ui/submenu.cpp:109 msgid "Positional Device Assignment" -msgstr "" +msgstr "Призначення позиційного пристрою" #: src/frontend/mame/ui/submenu.cpp:110 msgid "Mouse Device Assignment" -msgstr "" +msgstr "Призначення пристрою миші" #: src/frontend/mame/ui/submenu.cpp:112 msgid "Keyboard Input Provider" -msgstr "" +msgstr "Постачальник керування клавіатури" #: src/frontend/mame/ui/submenu.cpp:113 msgid "Mouse Input Provider" -msgstr "" +msgstr "Постачальник керування миші" #: src/frontend/mame/ui/submenu.cpp:114 msgid "Lightgun Input Provider" -msgstr "" +msgstr "Постачальник керування світлового пістолета" #: src/frontend/mame/ui/submenu.cpp:115 msgid "Joystick Input Provider" -msgstr "" +msgstr "Постачальник керування джойстика" #: src/frontend/mame/ui/submenu.cpp:121 src/frontend/mame/ui/mainmenu.cpp:174 msgid "Video Options" -msgstr "" +msgstr "Опції відео" #: src/frontend/mame/ui/submenu.cpp:122 msgid "Video Mode" -msgstr "" +msgstr "Відеорежим" #: src/frontend/mame/ui/submenu.cpp:123 msgid "Number Of Screens" -msgstr "" +msgstr "Кількість екранів" #: src/frontend/mame/ui/submenu.cpp:125 msgid "Triple Buffering" -msgstr "" +msgstr "Потрійна буферизація" #: src/frontend/mame/ui/submenu.cpp:126 msgid "HLSL" @@ -644,38 +659,38 @@ #: src/frontend/mame/ui/submenu.cpp:129 msgid "Bilinear Filtering" -msgstr "" +msgstr "Білінійна фільтрація" #: src/frontend/mame/ui/submenu.cpp:130 msgid "Bitmap Prescaling" -msgstr "" +msgstr "Попереднє масштабування растрового зображення" #: src/frontend/mame/ui/submenu.cpp:131 msgid "Window Mode" -msgstr "" +msgstr "Режим вікна" #: src/frontend/mame/ui/submenu.cpp:132 msgid "Enforce Aspect Ratio" -msgstr "" +msgstr "Примусове співвідношення сторін" #: src/frontend/mame/ui/submenu.cpp:133 msgid "Start Out Maximized" -msgstr "" +msgstr "Розпочинати розгорнутим" #: src/frontend/mame/ui/submenu.cpp:134 msgid "Synchronized Refresh" -msgstr "" +msgstr "Синхронізоване оновлення" #: src/frontend/mame/ui/submenu.cpp:135 msgid "Wait Vertical Sync" -msgstr "" +msgstr "Дочекатися вертикальної синхронізації" #: src/frontend/mame/ui/menu.cpp:360 src/frontend/mame/ui/menu.cpp:689 #: src/frontend/mame/ui/videoopt.cpp:191 src/frontend/mame/ui/custui.cpp:490 #: src/frontend/mame/ui/analogipt.cpp:471 plugins/cheatfind/init.lua:766 #: plugins/cheatfind/init.lua:777 plugins/cheat/init.lua:668 msgid "On" -msgstr "" +msgstr "Увімкнути" #: src/frontend/mame/ui/menu.cpp:360 src/frontend/mame/ui/menu.cpp:692 #: src/frontend/mame/ui/videoopt.cpp:207 src/frontend/mame/ui/custui.cpp:490 @@ -683,192 +698,193 @@ #: plugins/cheatfind/init.lua:774 plugins/cheat/init.lua:671 #: plugins/cheat/init.lua:680 msgid "Off" -msgstr "" +msgstr "Вимкнути" #: src/frontend/mame/ui/menu.cpp:695 msgid "Auto" -msgstr "" +msgstr "Автоматично" -#: src/frontend/mame/ui/menu.cpp:1197 -#: src/frontend/mame/ui/simpleselgame.cpp:278 +#: src/frontend/mame/ui/menu.cpp:1197 src/frontend/mame/ui/simpleselgame.cpp:278 #: src/frontend/mame/ui/selmenu.cpp:1280 msgid "Return to Previous Menu" -msgstr "" +msgstr "Повернутися до попереднього меню" -#: src/frontend/mame/ui/filemngr.cpp:139 -#: src/frontend/mame/ui/confswitch.cpp:119 +#: src/frontend/mame/ui/filemngr.cpp:139 src/frontend/mame/ui/confswitch.cpp:119 #: src/frontend/mame/ui/inputmap.cpp:563 src/frontend/mame/ui/analogipt.cpp:360 #, c-format msgid "[root%1$s]" msgstr "" -#: src/frontend/mame/ui/filemngr.cpp:153 -#: src/frontend/mame/ui/confswitch.cpp:170 src/frontend/mame/ui/slotopt.cpp:203 +#: src/frontend/mame/ui/filemngr.cpp:153 src/frontend/mame/ui/confswitch.cpp:170 +#: src/frontend/mame/ui/slotopt.cpp:203 msgid "Reset Machine" -msgstr "" +msgstr "Перезавантажити машину" #: src/frontend/mame/ui/filemngr.cpp:153 src/frontend/mame/ui/mainmenu.cpp:208 msgid "Start Machine" -msgstr "" +msgstr "Запустити машину" #: src/frontend/mame/ui/videoopt.cpp:57 #, c-format msgid "Screen #%d" -msgstr "" +msgstr "Екран #%d" #: src/frontend/mame/ui/videoopt.cpp:183 msgid "Zoom to Screen Area" -msgstr "" +msgstr "Масштабувати до області екрана" #: src/frontend/mame/ui/videoopt.cpp:195 msgid "X Only" -msgstr "" +msgstr "Лише X" #: src/frontend/mame/ui/videoopt.cpp:199 msgid "Y Only" -msgstr "" +msgstr "Лише Y" #: src/frontend/mame/ui/videoopt.cpp:203 msgid "X or Y (Auto)" -msgstr "" +msgstr "X / Y (автоматично)" #: src/frontend/mame/ui/videoopt.cpp:210 msgid "Non-Integer Scaling" -msgstr "" +msgstr "Неціле масштабування" #: src/frontend/mame/ui/videoopt.cpp:213 msgid "Maintain Aspect Ratio" -msgstr "" +msgstr "Зберігати співвідношення сторін" #: src/frontend/mame/ui/videoopt.cpp:227 msgid "Cannot change options while recording!" -msgstr "" +msgstr "Неможливо змінити опції при записі!" #: src/frontend/mame/ui/info.cpp:37 msgctxt "emulation-feature" msgid "protection" -msgstr "" +msgstr "захист" #: src/frontend/mame/ui/info.cpp:38 msgctxt "emulation-feature" msgid "timing" -msgstr "" +msgstr "швидкість" #: src/frontend/mame/ui/info.cpp:39 msgctxt "emulation-feature" msgid "graphics" -msgstr "" +msgstr "графіка" #: src/frontend/mame/ui/info.cpp:40 msgctxt "emulation-feature" msgid "color palette" -msgstr "" +msgstr "колірна палітра" #: src/frontend/mame/ui/info.cpp:41 msgctxt "emulation-feature" msgid "sound" -msgstr "" +msgstr "звук" #: src/frontend/mame/ui/info.cpp:42 msgctxt "emulation-feature" msgid "capture hardware" -msgstr "" +msgstr "обладнання захоплення" #: src/frontend/mame/ui/info.cpp:43 msgctxt "emulation-feature" msgid "camera" -msgstr "" +msgstr "камера" #: src/frontend/mame/ui/info.cpp:44 msgctxt "emulation-feature" msgid "microphone" -msgstr "" +msgstr "мікрофон" #: src/frontend/mame/ui/info.cpp:45 msgctxt "emulation-feature" msgid "controls" -msgstr "" +msgstr "керування" #: src/frontend/mame/ui/info.cpp:46 msgctxt "emulation-feature" msgid "keyboard" -msgstr "" +msgstr "клавіатура" #: src/frontend/mame/ui/info.cpp:47 msgctxt "emulation-feature" msgid "mouse" -msgstr "" +msgstr "миша" #: src/frontend/mame/ui/info.cpp:48 msgctxt "emulation-feature" msgid "media" -msgstr "" +msgstr "медіа" #: src/frontend/mame/ui/info.cpp:49 msgctxt "emulation-feature" msgid "disk" -msgstr "" +msgstr "диск" #: src/frontend/mame/ui/info.cpp:50 msgctxt "emulation-feature" msgid "printer" -msgstr "" +msgstr "принтер" #: src/frontend/mame/ui/info.cpp:51 msgctxt "emulation-feature" msgid "magnetic tape" -msgstr "" +msgstr "магнітострічка" #: src/frontend/mame/ui/info.cpp:52 msgctxt "emulation-feature" msgid "punch tape" -msgstr "" +msgstr "перфострічка" #: src/frontend/mame/ui/info.cpp:53 msgctxt "emulation-feature" msgid "magnetic drum" -msgstr "" +msgstr "магнітний барабан" #: src/frontend/mame/ui/info.cpp:54 msgctxt "emulation-feature" msgid "solid state storage" -msgstr "" +msgstr "твердотіле сховище" #: src/frontend/mame/ui/info.cpp:55 msgctxt "emulation-feature" msgid "communications" -msgstr "" +msgstr "комунікації" #: src/frontend/mame/ui/info.cpp:56 msgctxt "emulation-feature" msgid "LAN" -msgstr "" +msgstr "локальна мережа" #: src/frontend/mame/ui/info.cpp:57 msgctxt "emulation-feature" msgid "WAN" -msgstr "" +msgstr "глобальна мережа" #: src/frontend/mame/ui/info.cpp:66 msgid "" -"One or more ROMs/CHDs for this machine are incorrect. The machine may not " -"run correctly.\n" +"One or more ROMs/CHDs for this machine are incorrect. The machine may not run " +"correctly.\n" msgstr "" +"Один або декілька ROM'ів / CHD'ів машини неправильні. Машина може неналежно " +"працювати.\n" #: src/frontend/mame/ui/info.cpp:79 msgid "" "There are known problems with this machine\n" "\n" msgstr "" +"Відомі проблеми машини\n" +"\n" #: src/frontend/mame/ui/info.cpp:84 -msgid "" -"One or more ROMs/CHDs for this machine have not been correctly dumped.\n" -msgstr "" +msgid "One or more ROMs/CHDs for this machine have not been correctly dumped.\n" +msgstr "Один або декілька ROM'ів / CHD'ів машини неналежно задамплено.\n" #: src/frontend/mame/ui/info.cpp:92 msgid "Completely unemulated features: " -msgstr "" +msgstr "Повністю неемульовані особливості: " #: src/frontend/mame/ui/info.cpp:98 src/frontend/mame/ui/info.cpp:114 #, c-format @@ -883,35 +899,42 @@ #: src/frontend/mame/ui/info.cpp:108 msgid "Imperfectly emulated features: " -msgstr "" +msgstr "Недосконало емульовані особливості: " #: src/frontend/mame/ui/info.cpp:129 msgid "Screen flipping in cocktail mode is not supported.\n" -msgstr "" +msgstr "Переворот екрана в коктейль-режим непідтримуваний.\n" #: src/frontend/mame/ui/info.cpp:131 msgid "This machine requires external artwork files.\n" -msgstr "" +msgstr "Машині необхідні зовнішні файли оформлення.\n" #: src/frontend/mame/ui/info.cpp:133 msgid "" "This machine was never completed. It may exhibit strange behavior or missing " "elements that are not bugs in the emulation.\n" msgstr "" +"Машину не завершено. Її поведінка дивна чи відсутні елементи, які не є " +"помилками емуляції.\n" #: src/frontend/mame/ui/info.cpp:135 msgid "" "This machine has no sound hardware, MAME will produce no sounds, this is " "expected behaviour.\n" msgstr "" +"Відсутнє звукове обладнання машини, MAME не видає звуків, очікувана " +"поведінка.\n" #: src/frontend/mame/ui/info.cpp:139 msgid "" "\n" "THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet " -"complete. There is nothing you can do to fix this problem except wait for " -"the developers to improve the emulation.\n" +"complete. There is nothing you can do to fix this problem except wait for the " +"developers to improve the emulation.\n" msgstr "" +"\n" +"Машина не працює, її емуляцію не завершено. Дочекайся виправлення проблеми " +"виробниками покращенням емуляції.\n" #: src/frontend/mame/ui/info.cpp:141 msgid "" @@ -920,6 +943,9 @@ "interaction or consist of mechanical devices. It is not possible to fully " "experience this machine.\n" msgstr "" +"\n" +"Елементи машини неможливо емулювати, необхідна фізична взаємодія чи вони " +"складаються з механічних пристроїв. Повністю випробувати машину неможливо.\n" #: src/frontend/mame/ui/info.cpp:163 #, c-format @@ -928,6 +954,9 @@ "\n" "There are working clones of this machine: %s" msgstr "" +"\n" +"\n" +"Робочі клони машини: %s" #: src/frontend/mame/ui/info.cpp:364 #, c-format @@ -938,46 +967,55 @@ "\n" "CPU:\n" msgstr "" +"%1$s\n" +"%2$s %3$s\n" +"Драйвер: %4$s\n" +"\n" +"CPU:\n" #: src/frontend/mame/ui/info.cpp:406 src/frontend/mame/ui/info.cpp:449 #: src/frontend/mame/ui/devopt.cpp:105 src/frontend/mame/ui/devopt.cpp:184 msgid "GHz" -msgstr "" +msgstr "ГГц" #: src/frontend/mame/ui/info.cpp:406 src/frontend/mame/ui/info.cpp:449 #: src/frontend/mame/ui/devopt.cpp:105 src/frontend/mame/ui/devopt.cpp:184 msgid "MHz" -msgstr "" +msgstr "МГц" #: src/frontend/mame/ui/info.cpp:406 src/frontend/mame/ui/info.cpp:449 #: src/frontend/mame/ui/devopt.cpp:105 src/frontend/mame/ui/devopt.cpp:184 msgid "kHz" -msgstr "" +msgstr "кГц" #: src/frontend/mame/ui/info.cpp:406 src/frontend/mame/ui/info.cpp:449 #: src/frontend/mame/ui/devopt.cpp:105 src/frontend/mame/ui/devopt.cpp:184 msgid "Hz" -msgstr "" +msgstr "Гц" #: src/frontend/mame/ui/info.cpp:420 msgid "" "\n" "Sound:\n" msgstr "" +"\n" +"Аудіо:\n" #: src/frontend/mame/ui/info.cpp:453 msgid "" "\n" "Video:\n" msgstr "" +"\n" +"Відео:\n" #: src/frontend/mame/ui/info.cpp:457 msgid "None\n" -msgstr "" +msgstr "Не вказано\n" #: src/frontend/mame/ui/info.cpp:464 msgid "Vector" -msgstr "" +msgstr "Вектор" #: src/frontend/mame/ui/info.cpp:483 #, c-format @@ -991,11 +1029,11 @@ #: src/frontend/mame/ui/info.cpp:500 #, c-format msgid "Screen '%1$s'" -msgstr "" +msgstr "Екран '%1$s'" #: src/frontend/mame/ui/info.cpp:502 msgid "Screen" -msgstr "" +msgstr "екрана" #: src/frontend/mame/ui/info.cpp:573 src/frontend/mame/ui/info.cpp:584 #, c-format @@ -1004,83 +1042,83 @@ #: src/frontend/mame/ui/info.cpp:665 msgid "Not supported" -msgstr "" +msgstr "Без підтримки" #: src/frontend/mame/ui/info.cpp:668 msgid "Partially supported" -msgstr "" +msgstr "Часткова підтримка" #: src/frontend/mame/ui/info.cpp:677 msgid "[empty]" -msgstr "" +msgstr "[порожньо]" #: src/frontend/mame/ui/swlist.cpp:94 msgid "[file manager]" -msgstr "" +msgstr "[менеджер файлів]" #: src/frontend/mame/ui/swlist.cpp:227 msgid "Switch Item Ordering" -msgstr "" +msgstr "Перемкнути порядок пунктів" #: src/frontend/mame/ui/swlist.cpp:259 msgid "Switched Order: entries now ordered by shortname" -msgstr "" +msgstr "Перемкнений порядок: записи впорядковано за коротким іменем." #: src/frontend/mame/ui/swlist.cpp:260 msgid "Switched Order: entries now ordered by description" -msgstr "" +msgstr "Перемкнений порядок: записи впорядковано за описом." #: src/frontend/mame/ui/swlist.cpp:396 msgid "[compatible lists]" -msgstr "" +msgstr "[сумісні переліки]" #: src/frontend/mame/ui/filecreate.cpp:78 msgid "File Already Exists - Override?" -msgstr "" +msgstr "Замінити файл?" #: src/frontend/mame/ui/filecreate.cpp:80 src/frontend/mame/ui/utils.cpp:1090 msgid "No" -msgstr "" +msgstr "Ні" #: src/frontend/mame/ui/filecreate.cpp:81 src/frontend/mame/ui/utils.cpp:1090 msgid "Yes" -msgstr "" +msgstr "Так" #: src/frontend/mame/ui/filecreate.cpp:167 msgid "New Image Name:" -msgstr "" +msgstr "Ім'я нового образу:" #: src/frontend/mame/ui/filecreate.cpp:173 msgid "Image Format:" -msgstr "" +msgstr "Формат образу:" #: src/frontend/mame/ui/filecreate.cpp:179 msgid "Create" -msgstr "" +msgstr "Створити" #: src/frontend/mame/ui/filecreate.cpp:207 msgid "Please enter a file extension too" -msgstr "" +msgstr "Укажи формат файлу." #: src/frontend/mame/ui/filecreate.cpp:258 msgid "Select image format" -msgstr "" +msgstr "Вибери формат образу." #: src/frontend/mame/ui/filecreate.cpp:317 msgid "Select initial contents" -msgstr "" +msgstr "Вибери початковий уміст." #: src/frontend/mame/ui/keyboard.cpp:45 src/frontend/mame/ui/mainmenu.cpp:170 msgid "Keyboard Mode" -msgstr "" +msgstr "Режим клавіатури" #: src/frontend/mame/ui/keyboard.cpp:46 src/frontend/mame/ui/keyboard.cpp:91 msgid "Natural" -msgstr "" +msgstr "Звичайна" #: src/frontend/mame/ui/keyboard.cpp:46 src/frontend/mame/ui/keyboard.cpp:91 msgid "Emulated" -msgstr "" +msgstr "Емульована" #: src/frontend/mame/ui/keyboard.cpp:59 src/frontend/mame/ui/confswitch.cpp:117 #: src/frontend/mame/ui/inputmap.cpp:561 src/frontend/mame/ui/analogipt.cpp:358 @@ -1094,41 +1132,41 @@ #: src/frontend/mame/ui/keyboard.cpp:62 src/frontend/mame/ui/keyboard.cpp:109 msgid "Enabled" -msgstr "" +msgstr "Увімкнено" #: src/frontend/mame/ui/keyboard.cpp:62 src/frontend/mame/ui/keyboard.cpp:109 msgid "Disabled" -msgstr "" +msgstr "Вимкнено" #: src/frontend/mame/ui/utils.cpp:63 msgctxt "swlist-info" msgid "Alternate Title" -msgstr "" +msgstr "Альтернативна назва" #: src/frontend/mame/ui/utils.cpp:64 msgctxt "swlist-info" msgid "Author" -msgstr "" +msgstr "Автор" #: src/frontend/mame/ui/utils.cpp:65 msgctxt "swlist-info" msgid "Barcode Number" -msgstr "" +msgstr "Номер штрих-коду" #: src/frontend/mame/ui/utils.cpp:66 msgctxt "swlist-info" msgid "Developer" -msgstr "" +msgstr "Виробник" #: src/frontend/mame/ui/utils.cpp:67 msgctxt "swlist-info" msgid "Distributor" -msgstr "" +msgstr "Розповсюдник" #: src/frontend/mame/ui/utils.cpp:68 msgctxt "swlist-info" msgid "Installation Instructions" -msgstr "" +msgstr "Посібник встановлення" #: src/frontend/mame/ui/utils.cpp:69 msgctxt "swlist-info" @@ -1143,87 +1181,87 @@ #: src/frontend/mame/ui/utils.cpp:71 msgctxt "swlist-info" msgid "Original Publisher" -msgstr "" +msgstr "Початковий видавець" #: src/frontend/mame/ui/utils.cpp:72 msgctxt "swlist-info" msgid "Part Number" -msgstr "" +msgstr "№ частини" #: src/frontend/mame/ui/utils.cpp:73 msgctxt "swlist-info" msgid "PCB" -msgstr "" +msgstr "Друкована плата" #: src/frontend/mame/ui/utils.cpp:74 msgctxt "swlist-info" msgid "Programmer" -msgstr "" +msgstr "Програміст" #: src/frontend/mame/ui/utils.cpp:75 msgctxt "swlist-info" msgid "Release Date" -msgstr "" +msgstr "Дата випуску" #: src/frontend/mame/ui/utils.cpp:76 msgctxt "swlist-info" msgid "Serial Number" -msgstr "" +msgstr "Серійний №" #: src/frontend/mame/ui/utils.cpp:77 msgctxt "swlist-info" msgid "Usage Instructions" -msgstr "" +msgstr "Посібник використання" #: src/frontend/mame/ui/utils.cpp:78 msgctxt "swlist-info" msgid "Version" -msgstr "" +msgstr "Версія" #: src/frontend/mame/ui/utils.cpp:84 msgctxt "machine-filter" msgid "Unfiltered" -msgstr "" +msgstr "Без фільтра" #: src/frontend/mame/ui/utils.cpp:85 msgctxt "machine-filter" msgid "Available" -msgstr "" +msgstr "Доступні" #: src/frontend/mame/ui/utils.cpp:86 msgctxt "machine-filter" msgid "Unavailable" -msgstr "" +msgstr "Недоступні" #: src/frontend/mame/ui/utils.cpp:87 msgctxt "machine-filter" msgid "Working" -msgstr "" +msgstr "Робочі" #: src/frontend/mame/ui/utils.cpp:88 msgctxt "machine-filter" msgid "Not Working" -msgstr "" +msgstr "Неробочі" #: src/frontend/mame/ui/utils.cpp:89 msgctxt "machine-filter" msgid "Mechanical" -msgstr "" +msgstr "Механічні" #: src/frontend/mame/ui/utils.cpp:90 msgctxt "machine-filter" msgid "Not Mechanical" -msgstr "" +msgstr "Немеханічні" #: src/frontend/mame/ui/utils.cpp:91 msgctxt "machine-filter" msgid "Category" -msgstr "" +msgstr "Категорії" #: src/frontend/mame/ui/utils.cpp:92 msgctxt "machine-filter" msgid "Favorites" -msgstr "" +msgstr "Уподобання" #: src/frontend/mame/ui/utils.cpp:93 msgctxt "machine-filter" @@ -1233,7 +1271,7 @@ #: src/frontend/mame/ui/utils.cpp:94 msgctxt "machine-filter" msgid "Not BIOS" -msgstr "" +msgstr "Не BIOS" #: src/frontend/mame/ui/utils.cpp:95 msgctxt "machine-filter" @@ -1243,72 +1281,72 @@ #: src/frontend/mame/ui/utils.cpp:96 msgctxt "machine-filter" msgid "Clones" -msgstr "" +msgstr "Клони" #: src/frontend/mame/ui/utils.cpp:97 msgctxt "machine-filter" msgid "Manufacturer" -msgstr "" +msgstr "Виробник" #: src/frontend/mame/ui/utils.cpp:98 msgctxt "machine-filter" msgid "Year" -msgstr "" +msgstr "Рік" #: src/frontend/mame/ui/utils.cpp:99 msgctxt "machine-filter" msgid "Save Supported" -msgstr "" +msgstr "Підтримка збережень" #: src/frontend/mame/ui/utils.cpp:100 msgctxt "machine-filter" msgid "Save Unsupported" -msgstr "" +msgstr "Без підтримки збережень" #: src/frontend/mame/ui/utils.cpp:101 msgctxt "machine-filter" msgid "CHD Required" -msgstr "" +msgstr "CHD" #: src/frontend/mame/ui/utils.cpp:102 msgctxt "machine-filter" msgid "No CHD Required" -msgstr "" +msgstr "Без CHD" #: src/frontend/mame/ui/utils.cpp:103 msgctxt "machine-filter" msgid "Vertical Screen" -msgstr "" +msgstr "Вертикальний екран" #: src/frontend/mame/ui/utils.cpp:104 msgctxt "machine-filter" msgid "Horizontal Screen" -msgstr "" +msgstr "Горизонтальний екран" #: src/frontend/mame/ui/utils.cpp:105 msgctxt "machine-filter" msgid "Custom Filter" -msgstr "" +msgstr "Указаний фільтр" #: src/frontend/mame/ui/utils.cpp:109 msgctxt "software-filter" msgid "Unfiltered" -msgstr "" +msgstr "Без фільтра" #: src/frontend/mame/ui/utils.cpp:110 msgctxt "software-filter" msgid "Available" -msgstr "" +msgstr "Доступні" #: src/frontend/mame/ui/utils.cpp:111 msgctxt "software-filter" msgid "Unavailable" -msgstr "" +msgstr "Недоступні" #: src/frontend/mame/ui/utils.cpp:112 msgctxt "software-filter" msgid "Favorites" -msgstr "" +msgstr "Уподобання" #: src/frontend/mame/ui/utils.cpp:113 msgctxt "software-filter" @@ -1318,143 +1356,143 @@ #: src/frontend/mame/ui/utils.cpp:114 msgctxt "software-filter" msgid "Clones" -msgstr "" +msgstr "Клони" #: src/frontend/mame/ui/utils.cpp:115 msgctxt "software-filter" msgid "Year" -msgstr "" +msgstr "Рік" #: src/frontend/mame/ui/utils.cpp:116 msgctxt "software-filter" msgid "Publisher" -msgstr "" +msgstr "Видавець" #: src/frontend/mame/ui/utils.cpp:117 msgctxt "software-filter" msgid "Developer" -msgstr "" +msgstr "Виробник" #: src/frontend/mame/ui/utils.cpp:118 msgctxt "software-filter" msgid "Distributor" -msgstr "" +msgstr "Розповсюдник" #: src/frontend/mame/ui/utils.cpp:119 msgctxt "software-filter" msgid "Author" -msgstr "" +msgstr "Автор" #: src/frontend/mame/ui/utils.cpp:120 msgctxt "software-filter" msgid "Programmer" -msgstr "" +msgstr "Програміст" #: src/frontend/mame/ui/utils.cpp:121 msgctxt "software-filter" msgid "Supported" -msgstr "" +msgstr "Підтримка" #: src/frontend/mame/ui/utils.cpp:122 msgctxt "software-filter" msgid "Partially Supported" -msgstr "" +msgstr "Часткова підтримка" #: src/frontend/mame/ui/utils.cpp:123 msgctxt "software-filter" msgid "Unsupported" -msgstr "" +msgstr "Без підтримки" #: src/frontend/mame/ui/utils.cpp:124 msgctxt "software-filter" msgid "Release Region" -msgstr "" +msgstr "Регіон випуску" #: src/frontend/mame/ui/utils.cpp:125 msgctxt "software-filter" msgid "Device Type" -msgstr "" +msgstr "Тип пристрою" #: src/frontend/mame/ui/utils.cpp:126 msgctxt "software-filter" msgid "Software List" -msgstr "" +msgstr "Перелік програм" #: src/frontend/mame/ui/utils.cpp:127 msgctxt "software-filter" msgid "Custom Filter" -msgstr "" +msgstr "Указаний фільтр" #: src/frontend/mame/ui/utils.cpp:291 msgid "" -msgstr "" +msgstr "<встановити фільтри>" #: src/frontend/mame/ui/utils.cpp:396 msgid "Select custom filters:" -msgstr "" +msgstr "Вибери вказані фільтри:" #: src/frontend/mame/ui/utils.cpp:547 #, c-format msgid "Filter %1$u" -msgstr "" +msgstr "Фільтр %1$u" #: src/frontend/mame/ui/utils.cpp:561 msgid "Remove last filter" -msgstr "" +msgstr "Вилучити останній фільтр" #: src/frontend/mame/ui/utils.cpp:563 msgid "Add filter" -msgstr "" +msgstr "Додати фільтр" #: src/frontend/mame/ui/utils.cpp:1002 msgid "Select category:" -msgstr "" +msgstr "Вибери категорію:" #: src/frontend/mame/ui/utils.cpp:1033 msgid "[no category INI files]" -msgstr "" +msgstr "[INI без категорій]" #: src/frontend/mame/ui/utils.cpp:1041 msgid "[no groups in INI file]" -msgstr "" +msgstr "[INI без груп]" #: src/frontend/mame/ui/utils.cpp:1075 msgid "No category INI files found" -msgstr "" +msgstr "Не знайдено INI-файлів категорій." #: src/frontend/mame/ui/utils.cpp:1080 msgid "File" -msgstr "" +msgstr "Файл" #: src/frontend/mame/ui/utils.cpp:1084 msgid "No groups found in category file" -msgstr "" +msgstr "Не знайдено групи в файлі категорій." #: src/frontend/mame/ui/utils.cpp:1089 msgid "Group" -msgstr "" +msgstr "Група" #: src/frontend/mame/ui/utils.cpp:1090 msgid "Include clones" -msgstr "" +msgstr "З урахуванням клонів" #: src/frontend/mame/ui/utils.cpp:2048 src/frontend/mame/ui/inifile.cpp:272 msgctxt "swlist-info" msgid "Software list/item" -msgstr "" +msgstr "Перелік програм / пунктів" #: src/frontend/mame/ui/datmenu.cpp:88 src/frontend/mame/ui/selmenu.cpp:2707 msgid "Software List Info" -msgstr "" +msgstr "Відомості переліку програм" #: src/frontend/mame/ui/datmenu.cpp:316 #, c-format msgid "Revision: %1$s" -msgstr "" +msgstr "Ревізія: %1$s" #: src/frontend/mame/ui/miscmenu.cpp:78 msgid "Reset" -msgstr "" +msgstr "Перезавантажити" #: src/frontend/mame/ui/miscmenu.cpp:234 #, c-format @@ -1462,6 +1500,8 @@ "Uptime: %1$d:%2$02d:%3$02d\n" "\n" msgstr "" +"Час роботи: %1$d:%2$02d:%3$02d\n" +"\n" #: src/frontend/mame/ui/miscmenu.cpp:236 #, c-format @@ -1469,6 +1509,8 @@ "Uptime: %1$d:%2$02d\n" "\n" msgstr "" +"Час роботи: %1$d:%2$02d\n" +"\n" #: src/frontend/mame/ui/miscmenu.cpp:241 #, c-format @@ -1476,59 +1518,61 @@ "Tickets dispensed: %1$d\n" "\n" msgstr "" +"Видано квитків: %1$d\n" +"\n" #: src/frontend/mame/ui/miscmenu.cpp:254 msgid "Coin %1$c: NA%3$s\n" -msgstr "" +msgstr "Монета %1$c: НД%3$s\n" #: src/frontend/mame/ui/miscmenu.cpp:254 #, c-format msgid "Coin %1$c: %2$d%3$s\n" -msgstr "" +msgstr "Монета %1$c: %2$d%3$s\n" #: src/frontend/mame/ui/miscmenu.cpp:257 msgid " (locked)" -msgstr "" +msgstr " (заблоковано)" #: src/frontend/mame/ui/miscmenu.cpp:474 #, c-format msgid "P%d Visibility" -msgstr "" +msgstr "Видимість P%d" #: src/frontend/mame/ui/miscmenu.cpp:528 #, c-format msgid "P%d Crosshair" -msgstr "" +msgstr "Приціл P%d" #: src/frontend/mame/ui/miscmenu.cpp:545 msgid "Visible Delay" -msgstr "" +msgstr "Видима затримка" #: src/frontend/mame/ui/miscmenu.cpp:629 #, c-format msgid "%s.xml saved in UI settings folder." -msgstr "" +msgstr "%s.xml збережено до теки налаштувань UI." #: src/frontend/mame/ui/miscmenu.cpp:655 msgid "Name: Description:\n" -msgstr "" +msgstr "Ім'я: Опис:\n" #: src/frontend/mame/ui/miscmenu.cpp:666 #, c-format msgid "%s.txt saved in UI settings folder." -msgstr "" +msgstr "%s.txt збережено до теки налаштувань UI." #: src/frontend/mame/ui/miscmenu.cpp:683 msgid "Export list in XML format (like -listxml)" -msgstr "" +msgstr "Експортувати перелік до XML (-listxml)" #: src/frontend/mame/ui/miscmenu.cpp:684 msgid "Export list in XML format (like -listxml, but exclude devices)" -msgstr "" +msgstr "Експортувати перелік до XML (-listxml із вилученням пристроїв)" #: src/frontend/mame/ui/miscmenu.cpp:685 msgid "Export list in TXT format (like -listfull)" -msgstr "" +msgstr "Експортувати перелік до TXT (-listfull)" #: src/frontend/mame/ui/miscmenu.cpp:792 msgid "BIOS" @@ -1536,35 +1580,35 @@ #: src/frontend/mame/ui/miscmenu.cpp:796 msgid "Driver" -msgstr "" +msgstr "Драйвер" #: src/frontend/mame/ui/miscmenu.cpp:799 msgid "This machine has no BIOS." -msgstr "" +msgstr "Відсутній BIOS машини." #: src/frontend/mame/ui/miscmenu.cpp:808 src/frontend/mame/ui/mainmenu.cpp:194 msgid "Add To Favorites" -msgstr "" +msgstr "Додати до вподобань" #: src/frontend/mame/ui/miscmenu.cpp:810 src/frontend/mame/ui/mainmenu.cpp:196 msgid "Remove From Favorites" -msgstr "" +msgstr "Вилучити з уподобань" #: src/frontend/mame/ui/miscmenu.cpp:813 msgid "Save Machine Configuration" -msgstr "" +msgstr "Зберегти конфігурацію машини" #: src/frontend/mame/ui/miscmenu.cpp:824 msgid "Configure Machine:" -msgstr "" +msgstr "Налаштувати машину:" #: src/frontend/mame/ui/miscmenu.cpp:858 src/frontend/mame/ui/selmenu.cpp:2647 msgid " (default)" -msgstr "" +msgstr " (типово)" #: src/frontend/mame/ui/miscmenu.cpp:934 msgid "No plugins found" -msgstr "" +msgstr "Не знайдено плаґінів." #: src/frontend/mame/ui/quitmenu.cpp:37 #, c-format @@ -1574,22 +1618,26 @@ "Press %1$s to quit\n" "Press %2$s to return to emulation" msgstr "" +"Вийти?\n" +"\n" +"%1$s - вихід.\n" +"%2$s - повернення до емуляції." #: src/frontend/mame/ui/info_pty.cpp:30 msgid "Pseudo terminals" -msgstr "" +msgstr "Псевдотермінали" #: src/frontend/mame/ui/info_pty.cpp:39 msgid "[failed]" -msgstr "" +msgstr "[не виконано]" #: src/frontend/mame/ui/state.cpp:217 msgid "[no saved states found]" -msgstr "" +msgstr "[не знайдено збережених станів]" #: src/frontend/mame/ui/state.cpp:222 plugins/cheatfind/init.lua:492 msgid "Cancel" -msgstr "" +msgstr "Скасувати" #: src/frontend/mame/ui/state.cpp:261 #, c-format @@ -1598,150 +1646,156 @@ "Press %2$s to delete\n" "Press %3$s to cancel" msgstr "" +"Видалити збережені дані %1$s?\n" +"%2$s - видалення.\n" +"%3$s - скасування." #: src/frontend/mame/ui/state.cpp:374 #, c-format msgid "Error removing saved state file %1$s" -msgstr "" +msgstr "Помилка вилучення збереженого стану %1$s." #: src/frontend/mame/ui/state.cpp:426 #, c-format msgid "Press %1$s to delete" -msgstr "" +msgstr "Натисни %1$s для видалення." #: src/frontend/mame/ui/state.cpp:499 msgid "Load State" -msgstr "" +msgstr "Завантажити стан" #: src/frontend/mame/ui/state.cpp:499 msgid "Select state to load" -msgstr "" +msgstr "Вибери стан для завантаження." #: src/frontend/mame/ui/state.cpp:523 msgid "Save State" -msgstr "" +msgstr "Зберегти стан" #: src/frontend/mame/ui/state.cpp:523 msgid "Press a key or joystick button, or select state to overwrite" -msgstr "" +msgstr "Натисни кнопку клавіатури / джойстика чи вибери стан для перезапису." #: src/frontend/mame/ui/slotopt.cpp:192 #, c-format msgid "%s [internal]" -msgstr "" +msgstr "%s [внутрішній]" #: src/frontend/mame/ui/inputmap.cpp:38 msgid "User Interface" -msgstr "" +msgstr "Інтерфейс користувача" #: src/frontend/mame/ui/inputmap.cpp:41 #, c-format msgid "Player %1$d Controls" -msgstr "" +msgstr "Керування гравця %1$d" #: src/frontend/mame/ui/inputmap.cpp:44 msgid "Other Controls" -msgstr "" +msgstr "Інше керування" #: src/frontend/mame/ui/inputmap.cpp:231 msgid "This machine has no configurable inputs." -msgstr "" +msgstr "Відсутні налаштовувані керування машини." #: src/frontend/mame/ui/inputmap.cpp:331 msgid "Pressed" -msgstr "" +msgstr "Натиснено" #: src/frontend/mame/ui/inputmap.cpp:401 msgid "Invalid sequence entered" -msgstr "" +msgstr "Указано недійсну послідовність." #: src/frontend/mame/ui/inputmap.cpp:546 #, c-format msgctxt "input-name" msgid "%1$s Analog" -msgstr "" +msgstr "%1$s Аналог" #: src/frontend/mame/ui/inputmap.cpp:547 #, c-format msgctxt "input-name" msgid "%1$s Analog Inc" -msgstr "" +msgstr "%1$s Аналог +" #: src/frontend/mame/ui/inputmap.cpp:548 #, c-format msgctxt "input-name" msgid "%1$s Analog Dec" -msgstr "" +msgstr "%1$s Аналог -" #: src/frontend/mame/ui/inputmap.cpp:590 #, c-format msgid "Press %1$s to set\n" -msgstr "" +msgstr "Натисни %1$s для встановлення.\n" #: src/frontend/mame/ui/inputmap.cpp:591 #, c-format msgid "Press %1$s to append\n" -msgstr "" +msgstr "Натисни %1$s для додання.\n" #: src/frontend/mame/ui/inputmap.cpp:592 #, c-format msgid "Press %1$s to clear\n" -msgstr "" +msgstr "Натисни %1$s для очищення.\n" #: src/frontend/mame/ui/inputmap.cpp:593 #, c-format msgid "Press %1$s to restore default\n" -msgstr "" +msgstr "Натисни %1$s для типового відновлення.\n" #: src/frontend/mame/ui/tapectrl.cpp:86 msgid "stopped" -msgstr "" +msgstr "зупинено" #: src/frontend/mame/ui/tapectrl.cpp:88 msgid "playing" -msgstr "" +msgstr "відтворення" #: src/frontend/mame/ui/tapectrl.cpp:88 msgid "(playing)" -msgstr "" +msgstr "(відтворення)" #: src/frontend/mame/ui/tapectrl.cpp:89 msgid "recording" -msgstr "" +msgstr "запис" #: src/frontend/mame/ui/tapectrl.cpp:89 msgid "(recording)" -msgstr "" +msgstr "(запис)" #: src/frontend/mame/ui/tapectrl.cpp:96 msgid "Pause/Stop" -msgstr "" +msgstr "Призупинити / Зупинити" #: src/frontend/mame/ui/tapectrl.cpp:99 msgid "Play" -msgstr "" +msgstr "Відтворити" #: src/frontend/mame/ui/tapectrl.cpp:102 msgid "Record" -msgstr "" +msgstr "Записати" #: src/frontend/mame/ui/tapectrl.cpp:105 msgid "Rewind" -msgstr "" +msgstr "Перемотати назад" #: src/frontend/mame/ui/tapectrl.cpp:108 msgid "Fast Forward" -msgstr "" +msgstr "Перемотати вперед" #: src/frontend/mame/ui/imgcntrl.cpp:132 msgid "Cannot save over directory" -msgstr "" +msgstr "Неможливо зберегти над каталогом." #: src/frontend/mame/ui/imgcntrl.cpp:165 msgid "" "The software selected is missing one or more required ROM or CHD images.\n" "Please acquire the correct files or select a different one." msgstr "" +"У вибраній програмі відсутній один або декілька необхідних ROM / CHD-" +"образів.\n" +"Знайди правильні файли чи вибери інший." #: src/frontend/mame/ui/simpleselgame.cpp:146 msgid "" @@ -1750,16 +1804,20 @@ "\n" "Press any key to continue." msgstr "" +"У вибраній грі відсутній один або декілька необхідних ROM / CHD-образів. " +"Вибери іншу гру.\n" +"\n" +"Натисни для продовження." #: src/frontend/mame/ui/simpleselgame.cpp:273 #: src/frontend/mame/ui/selgame.cpp:443 msgid "Configure Options" -msgstr "" +msgstr "Налаштувати опції" #: src/frontend/mame/ui/simpleselgame.cpp:274 #: src/frontend/mame/ui/selmenu.cpp:1280 msgid "Exit" -msgstr "" +msgstr "Вихід" #: src/frontend/mame/ui/simpleselgame.cpp:299 #, c-format @@ -1769,15 +1827,19 @@ "If this is your first time using %2$s, please see the config.txt file in the " "docs directory for information on configuring %2$s." msgstr "" +"Не знайдено машин. Перевір указаний у %1$s.ini шлях ROM'ів.\n" +"\n" +"При першому використанні %2$s переглянь config.txt у каталозі документів для " +"отримання відомостей налаштування %2$s." #: src/frontend/mame/ui/simpleselgame.cpp:315 #, c-format msgid "Type name or select: %1$s_" -msgstr "" +msgstr "Укажи ім'я чи вибери: %1$s_." #: src/frontend/mame/ui/simpleselgame.cpp:317 msgid "Type name or select: (random)" -msgstr "" +msgstr "Укажи ім'я чи вибери: (випадково)." #: src/frontend/mame/ui/simpleselgame.cpp:331 #, c-format @@ -1792,57 +1854,57 @@ #: src/frontend/mame/ui/simpleselgame.cpp:337 #, c-format msgid "Driver: %1$s" -msgstr "" +msgstr "Драйвер: %1$s" #: src/frontend/mame/ui/simpleselgame.cpp:353 #: src/frontend/mame/ui/selmenu.cpp:723 msgid "Overall: NOT WORKING" -msgstr "" +msgstr "Загалом: Неробоче" #: src/frontend/mame/ui/simpleselgame.cpp:355 #: src/frontend/mame/ui/selmenu.cpp:725 msgid "Overall: Unemulated Protection" -msgstr "" +msgstr "Загалом: Неемульований захист" #: src/frontend/mame/ui/simpleselgame.cpp:357 #: src/frontend/mame/ui/selmenu.cpp:727 msgid "Overall: Working" -msgstr "" +msgstr "Загалом: Робоче" #: src/frontend/mame/ui/simpleselgame.cpp:361 #: src/frontend/mame/ui/selmenu.cpp:731 msgid "Graphics: Unimplemented, " -msgstr "" +msgstr "Графіка: Не реалізовано, " #: src/frontend/mame/ui/simpleselgame.cpp:363 #: src/frontend/mame/ui/selmenu.cpp:733 msgid "Graphics: Imperfect, " -msgstr "" +msgstr "Графіка: Недосконало, " #: src/frontend/mame/ui/simpleselgame.cpp:365 #: src/frontend/mame/ui/selmenu.cpp:735 msgid "Graphics: OK, " -msgstr "" +msgstr "Графіка: OK, " #: src/frontend/mame/ui/simpleselgame.cpp:368 #: src/frontend/mame/ui/selmenu.cpp:738 msgid "Sound: None" -msgstr "" +msgstr "Аудіо: Не вказано" #: src/frontend/mame/ui/simpleselgame.cpp:370 #: src/frontend/mame/ui/selmenu.cpp:740 msgid "Sound: Unimplemented" -msgstr "" +msgstr "Аудіо: Не реалізовано" #: src/frontend/mame/ui/simpleselgame.cpp:372 #: src/frontend/mame/ui/selmenu.cpp:742 msgid "Sound: Imperfect" -msgstr "" +msgstr "Аудіо: Недосконало" #: src/frontend/mame/ui/simpleselgame.cpp:374 #: src/frontend/mame/ui/selmenu.cpp:744 msgid "Sound: OK" -msgstr "" +msgstr "Аудіо: OK" #: src/frontend/mame/ui/cheatopt.cpp:82 plugins/cheat/init.lua:751 #, c-format, lua-format @@ -1850,263 +1912,265 @@ "Cheat Comment:\n" "%s" msgstr "" +"Коментар чіту:\n" +"%s" #: src/frontend/mame/ui/cheatopt.cpp:95 msgid "All cheats reloaded" -msgstr "" +msgstr "Усі чіти перезавантажено." #: src/frontend/mame/ui/cheatopt.cpp:136 plugins/cheat/init.lua:698 msgid "Reset All" -msgstr "" +msgstr "Відновити всі" #: src/frontend/mame/ui/cheatopt.cpp:139 plugins/cheat/init.lua:699 msgid "Reload All" -msgstr "" +msgstr "Перезавантажити всі" #: src/frontend/mame/ui/dirmenu.cpp:38 msgctxt "path-option" msgid "ROMs" -msgstr "" +msgstr "ROM'и" #: src/frontend/mame/ui/dirmenu.cpp:39 msgctxt "path-option" msgid "Software Media" -msgstr "" +msgstr "Програмний носій" #: src/frontend/mame/ui/dirmenu.cpp:40 msgctxt "path-option" msgid "Sound Samples" -msgstr "" +msgstr "Звукові зразки" #: src/frontend/mame/ui/dirmenu.cpp:41 msgctxt "path-option" msgid "Artwork" -msgstr "" +msgstr "Оформлення" #: src/frontend/mame/ui/dirmenu.cpp:42 msgctxt "path-option" msgid "Crosshairs" -msgstr "" +msgstr "Приціли" #: src/frontend/mame/ui/dirmenu.cpp:43 msgctxt "path-option" msgid "Cheat Files" -msgstr "" +msgstr "Чіти" #: src/frontend/mame/ui/dirmenu.cpp:44 msgctxt "path-option" msgid "Plugins" -msgstr "" +msgstr "Плаґіни" #: src/frontend/mame/ui/dirmenu.cpp:45 msgctxt "path-option" msgid "UI Translations" -msgstr "" +msgstr "UI-переклади" #: src/frontend/mame/ui/dirmenu.cpp:46 msgctxt "path-option" msgid "INIs" -msgstr "" +msgstr "INI" #: src/frontend/mame/ui/dirmenu.cpp:47 msgctxt "path-option" msgid "UI Settings" -msgstr "" +msgstr "UI-налаштування" #: src/frontend/mame/ui/dirmenu.cpp:48 msgctxt "path-option" msgid "Plugin Data" -msgstr "" +msgstr "Дані плаґінів" #: src/frontend/mame/ui/dirmenu.cpp:49 msgctxt "path-option" msgid "DATs" -msgstr "" +msgstr "DAT" #: src/frontend/mame/ui/dirmenu.cpp:50 msgctxt "path-option" msgid "Category INIs" -msgstr "" +msgstr "INI категорій" #: src/frontend/mame/ui/dirmenu.cpp:51 msgctxt "path-option" msgid "Snapshots" -msgstr "" +msgstr "Кадри" #: src/frontend/mame/ui/dirmenu.cpp:52 msgctxt "path-option" msgid "Icons" -msgstr "" +msgstr "Піктограми" #: src/frontend/mame/ui/dirmenu.cpp:53 msgctxt "path-option" msgid "Control Panels" -msgstr "" +msgstr "Панелі керування" #: src/frontend/mame/ui/dirmenu.cpp:54 msgctxt "path-option" msgid "Cabinets" -msgstr "" +msgstr "Кабінети" #: src/frontend/mame/ui/dirmenu.cpp:55 msgctxt "path-option" msgid "Marquees" -msgstr "" +msgstr "Рухомі рядки" #: src/frontend/mame/ui/dirmenu.cpp:56 msgctxt "path-option" msgid "PCBs" -msgstr "" +msgstr "Друковані плати" #: src/frontend/mame/ui/dirmenu.cpp:57 msgctxt "path-option" msgid "Flyers" -msgstr "" +msgstr "Буклети" #: src/frontend/mame/ui/dirmenu.cpp:58 msgctxt "path-option" msgid "Title Screens" -msgstr "" +msgstr "Екрани назв" #: src/frontend/mame/ui/dirmenu.cpp:59 msgctxt "path-option" msgid "Game Endings" -msgstr "" +msgstr "Завершення ігор" #: src/frontend/mame/ui/dirmenu.cpp:60 msgctxt "path-option" msgid "Bosses" -msgstr "" +msgstr "Боси" #: src/frontend/mame/ui/dirmenu.cpp:61 msgctxt "path-option" msgid "Artwork Previews" -msgstr "" +msgstr "Попередні перегляди оформлень" #: src/frontend/mame/ui/dirmenu.cpp:62 msgctxt "path-option" msgid "Select" -msgstr "" +msgstr "Вибрати" #: src/frontend/mame/ui/dirmenu.cpp:63 msgctxt "path-option" msgid "Game Over Screens" -msgstr "" +msgstr "Екрани завершенння гри" #: src/frontend/mame/ui/dirmenu.cpp:64 msgctxt "path-option" msgid "HowTo" -msgstr "" +msgstr "Посібник" #: src/frontend/mame/ui/dirmenu.cpp:65 msgctxt "path-option" msgid "Logos" -msgstr "" +msgstr "Логотипи" #: src/frontend/mame/ui/dirmenu.cpp:66 msgctxt "path-option" msgid "Scores" -msgstr "" +msgstr "Рекорди" #: src/frontend/mame/ui/dirmenu.cpp:67 msgctxt "path-option" msgid "Versus" -msgstr "" +msgstr "Проти" #: src/frontend/mame/ui/dirmenu.cpp:68 msgctxt "path-option" msgid "Covers" -msgstr "" +msgstr "Обкладинки" #: src/frontend/mame/ui/dirmenu.cpp:119 msgid "Folders Setup" -msgstr "" +msgstr "Налаштування тек" #: src/frontend/mame/ui/dirmenu.cpp:169 #, c-format msgid "Current %1$s Folders" -msgstr "" +msgstr "Поточні теки %1$s" #: src/frontend/mame/ui/dirmenu.cpp:181 msgid "Change Folder" -msgstr "" +msgstr "Змінити теку" #: src/frontend/mame/ui/dirmenu.cpp:181 msgid "Add Folder" -msgstr "" +msgstr "Додати теку" #: src/frontend/mame/ui/dirmenu.cpp:184 msgid "Remove Folder" -msgstr "" +msgstr "Вилучити теку" #: src/frontend/mame/ui/dirmenu.cpp:417 #, c-format msgid "Change %1$s Folder - Search: %2$s_" -msgstr "" +msgstr "Змінити %1$s теку - Шукати: %2$s_" #: src/frontend/mame/ui/dirmenu.cpp:417 #, c-format msgid "Add %1$s Folder - Search: %2$s_" -msgstr "" +msgstr "Додати %1$s теку - Шукати: %2$s_" #: src/frontend/mame/ui/dirmenu.cpp:428 msgid "Press TAB to set" -msgstr "" +msgstr "Натисни Tab для встановлення." #: src/frontend/mame/ui/dirmenu.cpp:511 #, c-format msgid "Remove %1$s Folder" -msgstr "" +msgstr "Вилучити %1$s теку" #: src/frontend/mame/ui/viewgfx.cpp:436 msgid " COLORS" -msgstr "" +msgstr " Кольори" #: src/frontend/mame/ui/viewgfx.cpp:436 msgid " PENS" -msgstr "" +msgstr " Пера" #: src/frontend/mame/ui/viewgfx.cpp:1224 src/frontend/mame/ui/viewgfx.cpp:1255 #, c-format -msgid "Zoom = 1/%1$d" -msgstr "" +msgid "Zoom = 1 / %1$d" +msgstr "Масштаб = 1 / %1$d" #: src/frontend/mame/ui/viewgfx.cpp:1224 src/frontend/mame/ui/viewgfx.cpp:1255 #, c-format msgid "Zoom = %1$d" -msgstr "" +msgstr "Масштаб = %1$d" #: src/frontend/mame/ui/viewgfx.cpp:1262 msgid "Expand to fit" -msgstr "" +msgstr "Розгорнути до розміру" #: src/frontend/mame/ui/selgame.cpp:444 msgid "Configure Machine" -msgstr "" +msgstr "Налаштувати машину" #: src/frontend/mame/ui/selgame.cpp:1060 #, c-format msgid "%1$s %2$s ( %3$d / %4$d machines (%5$d BIOS) )" -msgstr "" +msgstr "%1$s %2$s (%3$d / %4$d машин; %5$d BIOS)" #: src/frontend/mame/ui/selgame.cpp:1088 #, c-format msgid "System: %1$-.100s" -msgstr "" +msgstr "Система: %1$-.100s" #: src/frontend/mame/ui/selector.cpp:116 msgid "Selection List - Search: " -msgstr "" +msgstr "Перелік вибору - Шукати: " #: src/frontend/mame/ui/selector.cpp:124 #, c-format msgid "Double-click or press %1$s to select" -msgstr "" +msgstr "Натисни двічі ЛКМ чи %1$s для вибору." #: src/frontend/mame/ui/auditmenu.cpp:60 #, c-format msgid "Results will be saved to %1$s" -msgstr "" +msgstr "Результати буде збережено до %1$s." #: src/frontend/mame/ui/auditmenu.cpp:98 #, c-format @@ -2114,6 +2178,8 @@ "Auditing media for machine %2$u of %3$u...\n" "%1$s" msgstr "" +"Перевірка медіа для машини %2$u / %3$u...\n" +"%1$s" #: src/frontend/mame/ui/auditmenu.cpp:116 #, c-format @@ -2123,307 +2189,311 @@ "Press %1$s to cancel\n" "Press %2$s to continue" msgstr "" +"Скасувати перевірку?\n" +"\n" +"%1$s - скасування.\n" +"%2$s - продовження." #: src/frontend/mame/ui/auditmenu.cpp:136 #, c-format msgid "Audit media for %1$u machines marked unavailable" -msgstr "" +msgstr "Перевірити медіа для %1$u машин позначених недоступними" #: src/frontend/mame/ui/auditmenu.cpp:137 #, c-format msgid "Audit media for all %1$u machines" -msgstr "" +msgstr "Перевірити медіа для всіх %1$u машин" #: src/frontend/mame/ui/auditmenu.cpp:154 #, c-format msgid "Press %1$s to cancel\n" -msgstr "" +msgstr "Натисни %1$s для скасування.\n" #: src/frontend/mame/ui/custui.cpp:52 msgid "Show All" -msgstr "" +msgstr "Показати все" #: src/frontend/mame/ui/custui.cpp:53 msgid "Hide Filters" -msgstr "" +msgstr "Приховати фільтри" #: src/frontend/mame/ui/custui.cpp:54 msgid "Hide Info/Image" -msgstr "" +msgstr "Приховати відомості / зображення" #: src/frontend/mame/ui/custui.cpp:55 msgid "Hide Both" -msgstr "" +msgstr "Приховати обидва" #: src/frontend/mame/ui/custui.cpp:210 msgid "Fonts" -msgstr "" +msgstr "Шрифти" #: src/frontend/mame/ui/custui.cpp:211 msgid "Colors" -msgstr "" +msgstr "Кольори" #: src/frontend/mame/ui/custui.cpp:214 msgid "Language" -msgstr "" +msgstr "Мова" #: src/frontend/mame/ui/custui.cpp:217 msgid "System Names" -msgstr "" +msgstr "Системні імена" #: src/frontend/mame/ui/custui.cpp:220 msgid "Show side panels" -msgstr "" +msgstr "Приховати бокові панелі" #: src/frontend/mame/ui/custui.cpp:232 msgid "UI Customization Settings" -msgstr "" +msgstr "Зміна UI-налаштувань" #: src/frontend/mame/ui/custui.cpp:246 src/frontend/mame/ui/custui.cpp:290 msgid "[built-in]" -msgstr "" +msgstr "[вбудовано]" #: src/frontend/mame/ui/custui.cpp:374 msgid "default" -msgstr "" +msgstr "типово" #: src/frontend/mame/ui/custui.cpp:509 msgid "UI Font" -msgstr "" +msgstr "UI-шрифт" #: src/frontend/mame/ui/custui.cpp:514 msgid "Bold" -msgstr "" +msgstr "Жирний" #: src/frontend/mame/ui/custui.cpp:515 msgid "Italic" -msgstr "" +msgstr "Курсив" #: src/frontend/mame/ui/custui.cpp:520 msgid "Lines" -msgstr "" +msgstr "Лінії" #: src/frontend/mame/ui/custui.cpp:525 msgid "Infos text size" -msgstr "" +msgstr "Розмір тексту відомостей" #: src/frontend/mame/ui/custui.cpp:539 msgid "UI Fonts Settings" -msgstr "" +msgstr "Налаштування UI-шрифту" #: src/frontend/mame/ui/custui.cpp:548 msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit." -msgstr "" +msgstr "Зразок тексту - Сама біль - любов, головний замовник." #: src/frontend/mame/ui/custui.cpp:625 msgctxt "color-option" msgid "Normal text" -msgstr "" +msgstr "Звичайний текст" #: src/frontend/mame/ui/custui.cpp:626 msgctxt "color-option" msgid "Selected color" -msgstr "" +msgstr "Вибраний колір" #: src/frontend/mame/ui/custui.cpp:627 msgctxt "color-option" msgid "Normal text background" -msgstr "" +msgstr "Звичайний текст тла" #: src/frontend/mame/ui/custui.cpp:628 msgctxt "color-option" msgid "Selected background color" -msgstr "" +msgstr "Вибраний колір тла" #: src/frontend/mame/ui/custui.cpp:629 msgctxt "color-option" msgid "Subitem color" -msgstr "" +msgstr "Колір підпункту" #: src/frontend/mame/ui/custui.cpp:630 msgctxt "color-option" msgid "Clone" -msgstr "" +msgstr "Клон" #: src/frontend/mame/ui/custui.cpp:631 msgctxt "color-option" msgid "Border" -msgstr "" +msgstr "Межа" #: src/frontend/mame/ui/custui.cpp:632 msgctxt "color-option" msgid "Background" -msgstr "" +msgstr "Тло" #: src/frontend/mame/ui/custui.cpp:633 msgctxt "color-option" msgid "DIP switch" -msgstr "" +msgstr "DIP-перемикач" #: src/frontend/mame/ui/custui.cpp:634 msgctxt "color-option" msgid "Unavailable color" -msgstr "" +msgstr "Недоступний колір" #: src/frontend/mame/ui/custui.cpp:635 msgctxt "color-option" msgid "Slider color" -msgstr "" +msgstr "Колір слайдера" #: src/frontend/mame/ui/custui.cpp:636 msgctxt "color-option" msgid "Graphics viewer background" -msgstr "" +msgstr "Тло переглядача графіки" #: src/frontend/mame/ui/custui.cpp:637 msgctxt "color-option" msgid "Mouse over color" -msgstr "" +msgstr "Колір під мишею" #: src/frontend/mame/ui/custui.cpp:638 msgctxt "color-option" msgid "Mouse over background color" -msgstr "" +msgstr "Колір тла під мишею" #: src/frontend/mame/ui/custui.cpp:639 msgctxt "color-option" msgid "Mouse down color" -msgstr "" +msgstr "Колір натисненої миші" #: src/frontend/mame/ui/custui.cpp:640 msgctxt "color-option" msgid "Mouse down background color" -msgstr "" +msgstr "Колір тла натисненої миші" #: src/frontend/mame/ui/custui.cpp:644 msgid "Restore default colors" -msgstr "" +msgstr "Відновити типові кольори" #: src/frontend/mame/ui/custui.cpp:656 msgid "UI Color Settings" -msgstr "" +msgstr "Налаштування UI-кольорів" #: src/frontend/mame/ui/custui.cpp:665 #, c-format msgid "Double-click or press %1$s to change color" -msgstr "" +msgstr "Натисни двічі ЛКМ чи %1$s для зміни кольору." #: src/frontend/mame/ui/custui.cpp:673 msgid "Menu Preview" -msgstr "" +msgstr "Попередній перегляд меню" #: src/frontend/mame/ui/custui.cpp:687 msgctxt "color-sample" msgid "Normal" -msgstr "" +msgstr "Звичайний" #: src/frontend/mame/ui/custui.cpp:688 msgctxt "color-sample" msgid "Subitem" -msgstr "" +msgstr "Підпункт" #: src/frontend/mame/ui/custui.cpp:689 msgctxt "color-sample" msgid "Selected" -msgstr "" +msgstr "Вибраний" #: src/frontend/mame/ui/custui.cpp:690 msgctxt "color-sample" msgid "Mouse Over" -msgstr "" +msgstr "Під мишею" #: src/frontend/mame/ui/custui.cpp:691 msgctxt "color-sample" msgid "Clone" -msgstr "" +msgstr "Клон" #: src/frontend/mame/ui/custui.cpp:906 msgid "ARGB Settings" -msgstr "" +msgstr "ARGB-налаштування" #: src/frontend/mame/ui/custui.cpp:911 src/frontend/mame/ui/custui.cpp:914 msgctxt "color-channel" msgid "Alpha" -msgstr "" +msgstr "Альфа" #: src/frontend/mame/ui/custui.cpp:919 src/frontend/mame/ui/custui.cpp:922 msgctxt "color-channel" msgid "Red" -msgstr "" +msgstr "Червоний" #: src/frontend/mame/ui/custui.cpp:927 src/frontend/mame/ui/custui.cpp:930 msgctxt "color-channel" msgid "Green" -msgstr "" +msgstr "Зелений" #: src/frontend/mame/ui/custui.cpp:935 src/frontend/mame/ui/custui.cpp:938 msgctxt "color-channel" msgid "Blue" -msgstr "" +msgstr "Синій" #: src/frontend/mame/ui/custui.cpp:941 msgid "Choose from palette" -msgstr "" +msgstr "Вибери з палітри." #: src/frontend/mame/ui/custui.cpp:988 msgid "Color preview:" -msgstr "" +msgstr "Попередній перегляд кольору:" #: src/frontend/mame/ui/custui.cpp:1085 msgctxt "color-preset" msgid "White" -msgstr "" +msgstr "Білий" #: src/frontend/mame/ui/custui.cpp:1086 msgctxt "color-preset" msgid "Silver" -msgstr "" +msgstr "Срібний" #: src/frontend/mame/ui/custui.cpp:1087 msgctxt "color-preset" msgid "Gray" -msgstr "" +msgstr "Сірий" #: src/frontend/mame/ui/custui.cpp:1088 msgctxt "color-preset" msgid "Black" -msgstr "" +msgstr "Чорний" #: src/frontend/mame/ui/custui.cpp:1089 msgctxt "color-preset" msgid "Red" -msgstr "" +msgstr "Червоний" #: src/frontend/mame/ui/custui.cpp:1090 msgctxt "color-preset" msgid "Orange" -msgstr "" +msgstr "Помаранчевий" #: src/frontend/mame/ui/custui.cpp:1091 msgctxt "color-preset" msgid "Yellow" -msgstr "" +msgstr "Жовтий" #: src/frontend/mame/ui/custui.cpp:1092 msgctxt "color-preset" msgid "Green" -msgstr "" +msgstr "Зелений" #: src/frontend/mame/ui/custui.cpp:1093 msgctxt "color-preset" msgid "Blue" -msgstr "" +msgstr "Синій" #: src/frontend/mame/ui/custui.cpp:1094 msgctxt "color-preset" msgid "Violet" -msgstr "" +msgstr "Фіолетовий" #: src/frontend/mame/ui/about.cpp:42 #, c-format msgctxt "about-header" msgid "%1$s %2$s (%3$s%4$sP%5$s, debug)" -msgstr "" +msgstr "%1$s %2$s (%3$s%4$sP%5$s, відлагодження)" #: src/frontend/mame/ui/about.cpp:44 #, c-format @@ -2435,250 +2505,250 @@ #, c-format msgctxt "about-header" msgid "Revision: %1$s" -msgstr "" +msgstr "Огляд: %1$s" #: src/frontend/mame/ui/analogipt.cpp:91 #, c-format msgid "Press %s to show menu" -msgstr "" +msgstr "Натисни %s для показу меню" #: src/frontend/mame/ui/analogipt.cpp:369 #, c-format msgid "%1$s Increment/Decrement Speed" -msgstr "" +msgstr "%1$s збільшення / зменшення швидкості" #: src/frontend/mame/ui/analogipt.cpp:374 #, c-format msgid "%1$s Auto-centering Speed" -msgstr "" +msgstr "%1$s автоцентрування швидкості" #: src/frontend/mame/ui/analogipt.cpp:379 #, c-format msgid "%1$s Reverse" -msgstr "" +msgstr "%1$s зворот" #: src/frontend/mame/ui/analogipt.cpp:384 #, c-format msgid "%1$s Sensitivity" -msgstr "" +msgstr "%1$s чутливість" #: src/frontend/mame/ui/barcode.cpp:77 msgid "New Barcode:" -msgstr "" +msgstr "Новий штрих-код:" #: src/frontend/mame/ui/barcode.cpp:80 msgid "Enter Code" -msgstr "" +msgstr "Укажи код." #: src/frontend/mame/ui/barcode.cpp:116 msgid "Barcode length invalid!" -msgstr "" +msgstr "Недійсна довжина штрих-коду!" #: src/frontend/mame/ui/mainmenu.cpp:121 msgid "Input (general)" -msgstr "" +msgstr "Керування (загальне)" #: src/frontend/mame/ui/mainmenu.cpp:123 msgid "Input (this machine)" -msgstr "" +msgstr "Керування (машина)" #: src/frontend/mame/ui/mainmenu.cpp:126 msgid "Analog Controls" -msgstr "" +msgstr "Аналогове керування" #: src/frontend/mame/ui/mainmenu.cpp:128 msgid "DIP Switches" -msgstr "" +msgstr "DIP-перемикачі" #: src/frontend/mame/ui/mainmenu.cpp:130 msgid "Machine Configuration" -msgstr "" +msgstr "Конфігурація машини" #: src/frontend/mame/ui/mainmenu.cpp:132 msgid "Bookkeeping Info" -msgstr "" +msgstr "Облік відомостей" #: src/frontend/mame/ui/mainmenu.cpp:134 msgid "Machine Information" -msgstr "" +msgstr "Відомості машини" #: src/frontend/mame/ui/mainmenu.cpp:137 msgid "Warning Information" -msgstr "" +msgstr "Відомості попередження" #: src/frontend/mame/ui/mainmenu.cpp:143 msgid "Image Information" -msgstr "" +msgstr "Відомості образу" #: src/frontend/mame/ui/mainmenu.cpp:145 msgid "File Manager" -msgstr "" +msgstr "Менеджер файлів" #: src/frontend/mame/ui/mainmenu.cpp:152 msgid "Tape Control" -msgstr "" +msgstr "Керування стрічкою" #: src/frontend/mame/ui/mainmenu.cpp:155 msgid "Pseudo Terminals" -msgstr "" +msgstr "Псевдотермінали" #: src/frontend/mame/ui/mainmenu.cpp:158 msgid "BIOS Selection" -msgstr "" +msgstr "Вибір BIOS" #: src/frontend/mame/ui/mainmenu.cpp:161 msgid "Slot Devices" -msgstr "" +msgstr "Слот-пристрої" #: src/frontend/mame/ui/mainmenu.cpp:164 msgid "Barcode Reader" -msgstr "" +msgstr "Читач штрих-кодів" #: src/frontend/mame/ui/mainmenu.cpp:167 msgid "Network Devices" -msgstr "" +msgstr "Мережеві пристрої" #: src/frontend/mame/ui/mainmenu.cpp:172 msgid "Slider Controls" -msgstr "" +msgstr "Керування слайдерами" #: src/frontend/mame/ui/mainmenu.cpp:177 msgid "Crosshair Options" -msgstr "" +msgstr "Опції прицілу" #: src/frontend/mame/ui/mainmenu.cpp:180 plugins/cheat/init.lua:799 msgid "Cheat" -msgstr "" +msgstr "Чіти" #: src/frontend/mame/ui/mainmenu.cpp:185 msgid "Plugin Options" -msgstr "" +msgstr "Опції плаґінів" #: src/frontend/mame/ui/mainmenu.cpp:188 msgid "External DAT View" -msgstr "" +msgstr "Зовнішній перегляд DAT" #: src/frontend/mame/ui/mainmenu.cpp:200 #, c-format msgid "About %1$s" -msgstr "" +msgstr "Про %1$s" #: src/frontend/mame/ui/mainmenu.cpp:212 msgid "Select New Machine" -msgstr "" +msgstr "Вибрати нову машину" #: src/frontend/mame/ui/mainmenu.cpp:213 msgid "Return to Machine" -msgstr "" +msgstr "Повернутися до машини" #: src/frontend/mame/ui/selmenu.cpp:76 msgctxt "selmenu-artwork" msgid "Snapshots" -msgstr "" +msgstr "Кадри" #: src/frontend/mame/ui/selmenu.cpp:77 msgctxt "selmenu-artwork" msgid "Cabinet" -msgstr "" +msgstr "Кабінет" #: src/frontend/mame/ui/selmenu.cpp:78 msgctxt "selmenu-artwork" msgid "Control Panel" -msgstr "" +msgstr "Панель керування" #: src/frontend/mame/ui/selmenu.cpp:79 msgctxt "selmenu-artwork" msgid "PCB" -msgstr "" +msgstr "Друкована плата" #: src/frontend/mame/ui/selmenu.cpp:80 msgctxt "selmenu-artwork" msgid "Flyer" -msgstr "" +msgstr "Буклет" #: src/frontend/mame/ui/selmenu.cpp:81 msgctxt "selmenu-artwork" msgid "Title Screen" -msgstr "" +msgstr "Екран назви" #: src/frontend/mame/ui/selmenu.cpp:82 msgctxt "selmenu-artwork" msgid "Ending" -msgstr "" +msgstr "Завершення" #: src/frontend/mame/ui/selmenu.cpp:83 msgctxt "selmenu-artwork" msgid "Artwork Preview" -msgstr "" +msgstr "Попередній перегляд оформлення" #: src/frontend/mame/ui/selmenu.cpp:84 msgctxt "selmenu-artwork" msgid "Bosses" -msgstr "" +msgstr "Боси" #: src/frontend/mame/ui/selmenu.cpp:85 msgctxt "selmenu-artwork" msgid "Logo" -msgstr "" +msgstr "Логотип" #: src/frontend/mame/ui/selmenu.cpp:86 msgctxt "selmenu-artwork" msgid "Versus" -msgstr "" +msgstr "Проти" #: src/frontend/mame/ui/selmenu.cpp:87 msgctxt "selmenu-artwork" msgid "Game Over" -msgstr "" +msgstr "Завершення гри" #: src/frontend/mame/ui/selmenu.cpp:88 msgctxt "selmenu-artwork" msgid "HowTo" -msgstr "" +msgstr "Посібник" #: src/frontend/mame/ui/selmenu.cpp:89 msgctxt "selmenu-artwork" msgid "Scores" -msgstr "" +msgstr "Рекорди" #: src/frontend/mame/ui/selmenu.cpp:90 msgctxt "selmenu-artwork" msgid "Select" -msgstr "" +msgstr "Вибрати" #: src/frontend/mame/ui/selmenu.cpp:91 msgctxt "selmenu-artwork" msgid "Marquee" -msgstr "" +msgstr "Рухомий рядок" #: src/frontend/mame/ui/selmenu.cpp:92 msgctxt "selmenu-artwork" msgid "Covers" -msgstr "" +msgstr "Обкладинки" #: src/frontend/mame/ui/selmenu.cpp:96 msgid "Add or remove favorite" -msgstr "" +msgstr "Додати чи вилучити з уподобань" #: src/frontend/mame/ui/selmenu.cpp:97 msgid "Export displayed list to file" -msgstr "" +msgstr "Експортувати відображений перелік до файлу" #: src/frontend/mame/ui/selmenu.cpp:98 msgid "Audit media" -msgstr "" +msgstr "Перевірити медіа" #: src/frontend/mame/ui/selmenu.cpp:99 msgid "Show DATs view" -msgstr "" +msgstr "Показати перегляд DAT" #: src/frontend/mame/ui/selmenu.cpp:319 msgid "Software part selection:" -msgstr "" +msgstr "Вибір програмної частини:" #: src/frontend/mame/ui/selmenu.cpp:424 msgid "BIOS selection:" -msgstr "" +msgstr "Вибір BIOS:" #: src/frontend/mame/ui/selmenu.cpp:677 src/frontend/mame/ui/selmenu.cpp:708 #, c-format @@ -2688,7 +2758,7 @@ #: src/frontend/mame/ui/selmenu.cpp:681 #, c-format msgid "Software is clone of: %1$s" -msgstr "" +msgstr "Програма - клон: %1$s" #: src/frontend/mame/ui/selmenu.cpp:683 msgid "Software is parent" @@ -2696,15 +2766,15 @@ #: src/frontend/mame/ui/selmenu.cpp:688 msgid "Supported: No" -msgstr "" +msgstr "Без підтримки" #: src/frontend/mame/ui/selmenu.cpp:693 msgid "Supported: Partial" -msgstr "" +msgstr "Часткова підтримка" #: src/frontend/mame/ui/selmenu.cpp:698 msgid "Supported: Yes" -msgstr "" +msgstr "Підтримка" #: src/frontend/mame/ui/selmenu.cpp:714 msgid "Driver is parent" @@ -2713,7 +2783,7 @@ #: src/frontend/mame/ui/selmenu.cpp:716 src/frontend/mame/ui/selmenu.cpp:718 #, c-format msgid "Driver is clone of: %1$s" -msgstr "" +msgstr "Драйвер - клон: %1$s" #: src/frontend/mame/ui/selmenu.cpp:754 #, c-format @@ -2722,11 +2792,11 @@ #: src/frontend/mame/ui/selmenu.cpp:2244 msgid "Images" -msgstr "" +msgstr "Зображення" #: src/frontend/mame/ui/selmenu.cpp:2245 msgid "Infos" -msgstr "" +msgstr "Відомості" #: src/frontend/mame/ui/selmenu.cpp:2560 msgid "" @@ -2734,6 +2804,9 @@ "Please acquire the correct files or select a different system.\n" "\n" msgstr "" +"Необхідні образи ROM'у / диска для вибраної системи відсутні чи неправильні. " +"Знайди правильні файли чи вибери іншу систему.\n" +"\n" #: src/frontend/mame/ui/selmenu.cpp:2576 msgid "" @@ -2741,18 +2814,21 @@ "Please acquire the correct files or select a different software item.\n" "\n" msgstr "" +"Необхідні образи ROM'у / диска для вибраної програми відсутні чи неправильні. " +"Знайди правильні файли чи вибери іншу програму.\n" +"\n" #: src/frontend/mame/ui/selmenu.cpp:2592 msgid "incorrect checksum" -msgstr "" +msgstr "неправильна контрольна сума" #: src/frontend/mame/ui/selmenu.cpp:2595 msgid "incorrect length" -msgstr "" +msgstr "неправильна довжина" #: src/frontend/mame/ui/selmenu.cpp:2598 msgid "not found" -msgstr "" +msgstr "не знайдено" #: src/frontend/mame/ui/selmenu.cpp:2609 #, c-format @@ -2766,31 +2842,31 @@ #: src/frontend/mame/ui/selmenu.cpp:2615 msgid "Press any key to continue." -msgstr "" +msgstr "Натисни для продовження." #: src/frontend/mame/ui/selmenu.cpp:2744 msgid "General Info" -msgstr "" +msgstr "Загальні відомості" #: src/frontend/mame/ui/selmenu.cpp:2896 #, c-format msgid "Romset\t%1$s\n" -msgstr "" +msgstr "ROM-набір\t%1$s\n" #: src/frontend/mame/ui/selmenu.cpp:2897 #, c-format msgid "Year\t%1$s\n" -msgstr "" +msgstr "Рік\t%1$s\n" #: src/frontend/mame/ui/selmenu.cpp:2898 #, c-format msgid "Manufacturer\t%1$s\n" -msgstr "" +msgstr "Виробник\t%1$s\n" #: src/frontend/mame/ui/selmenu.cpp:2905 #, c-format msgid "Driver is Clone of\t%1$s\n" -msgstr "" +msgstr "Драйвер - клон\t%1$s\n" #: src/frontend/mame/ui/selmenu.cpp:2910 msgid "Driver is Parent\t\n" @@ -2798,297 +2874,299 @@ #: src/frontend/mame/ui/selmenu.cpp:2914 msgid "Analog Controls\tYes\n" -msgstr "" +msgstr "Аналогове керування\tТак\n" #: src/frontend/mame/ui/selmenu.cpp:2916 msgid "Keyboard Inputs\tYes\n" -msgstr "" +msgstr "Клавіатурне керування\tТак\n" #: src/frontend/mame/ui/selmenu.cpp:2919 msgid "Overall\tNOT WORKING\n" -msgstr "" +msgstr "Загалом\tНеробоче\n" #: src/frontend/mame/ui/selmenu.cpp:2921 msgid "Overall\tUnemulated Protection\n" -msgstr "" +msgstr "Загалом\tНеемульований захист\n" #: src/frontend/mame/ui/selmenu.cpp:2923 msgid "Overall\tWorking\n" -msgstr "" +msgstr "Загалом\tРобоче\n" #: src/frontend/mame/ui/selmenu.cpp:2926 msgid "Graphics\tUnimplemented\n" -msgstr "" +msgstr "Графіка\tНе реалізовано\n" #: src/frontend/mame/ui/selmenu.cpp:2928 msgid "Graphics\tWrong Colors\n" -msgstr "" +msgstr "Графіка\tНеправильні кольори\n" #: src/frontend/mame/ui/selmenu.cpp:2930 msgid "Graphics\tImperfect Colors\n" -msgstr "" +msgstr "Графіка\tНедосконалі кольори\n" #: src/frontend/mame/ui/selmenu.cpp:2932 msgid "Graphics\tImperfect\n" -msgstr "" +msgstr "Графіка\tНедосконало\n" #: src/frontend/mame/ui/selmenu.cpp:2934 msgid "Graphics\tOK\n" -msgstr "" +msgstr "Графіка\tOK\n" #: src/frontend/mame/ui/selmenu.cpp:2937 msgid "Sound\tNone\n" -msgstr "" +msgstr "Аудіо\tНе вказано\n" #: src/frontend/mame/ui/selmenu.cpp:2939 msgid "Sound\tUnimplemented\n" -msgstr "" +msgstr "Аудіо\tНе реалізовано\n" #: src/frontend/mame/ui/selmenu.cpp:2941 msgid "Sound\tImperfect\n" -msgstr "" +msgstr "Аудіо\tНедосконало\n" #: src/frontend/mame/ui/selmenu.cpp:2943 msgid "Sound\tOK\n" -msgstr "" +msgstr "Аудіо\tOK\n" #: src/frontend/mame/ui/selmenu.cpp:2946 msgid "Capture\tUnimplemented\n" -msgstr "" +msgstr "Захоплення\tНе реалізовано\n" #: src/frontend/mame/ui/selmenu.cpp:2948 msgid "Capture\tImperfect\n" -msgstr "" +msgstr "Захоплення\tНедосконало\n" #: src/frontend/mame/ui/selmenu.cpp:2951 msgid "Camera\tUnimplemented\n" -msgstr "" +msgstr "Камера\tНе реалізовано\n" #: src/frontend/mame/ui/selmenu.cpp:2953 msgid "Camera\tImperfect\n" -msgstr "" +msgstr "Камера\tНедосконало\n" #: src/frontend/mame/ui/selmenu.cpp:2956 msgid "Microphone\tUnimplemented\n" -msgstr "" +msgstr "Мікрофон\tНе реалізовано\n" #: src/frontend/mame/ui/selmenu.cpp:2958 msgid "Microphone\tImperfect\n" -msgstr "" +msgstr "Мікрофон\tНедосконало\n" #: src/frontend/mame/ui/selmenu.cpp:2961 msgid "Controls\tUnimplemented\n" -msgstr "" +msgstr "Керування\tНе реалізовано\n" #: src/frontend/mame/ui/selmenu.cpp:2963 msgid "Controls\tImperfect\n" -msgstr "" +msgstr "Керування\tНедосконало\n" #: src/frontend/mame/ui/selmenu.cpp:2966 msgid "Keyboard\tUnimplemented\n" -msgstr "" +msgstr "Клавіатура\tНе реалізовано\n" #: src/frontend/mame/ui/selmenu.cpp:2968 msgid "Keyboard\tImperfect\n" -msgstr "" +msgstr "Клавіатура\tНедосконало\n" #: src/frontend/mame/ui/selmenu.cpp:2971 msgid "Mouse\tUnimplemented\n" -msgstr "" +msgstr "Миша\tНе реалізовано\n" #: src/frontend/mame/ui/selmenu.cpp:2973 msgid "Mouse\tImperfect\n" -msgstr "" +msgstr "Миша\tНедосконало\n" #: src/frontend/mame/ui/selmenu.cpp:2976 msgid "Media\tUnimplemented\n" -msgstr "" +msgstr "Медіа\tНе реалізовано\n" #: src/frontend/mame/ui/selmenu.cpp:2978 msgid "Media\tImperfect\n" -msgstr "" +msgstr "Медіа\tНедосконало\n" #: src/frontend/mame/ui/selmenu.cpp:2981 msgid "Disk\tUnimplemented\n" -msgstr "" +msgstr "Диск\tНе реалізовано\n" #: src/frontend/mame/ui/selmenu.cpp:2983 msgid "Disk\tImperfect\n" -msgstr "" +msgstr "Диск\tНедосконало\n" #: src/frontend/mame/ui/selmenu.cpp:2986 msgid "Printer\tUnimplemented\n" -msgstr "" +msgstr "Принтер\tНе реалізовано\n" #: src/frontend/mame/ui/selmenu.cpp:2988 msgid "Printer\tImperfect\n" -msgstr "" +msgstr "Принтер\tНедосконало\n" #: src/frontend/mame/ui/selmenu.cpp:2991 msgid "Mag. Tape\tUnimplemented\n" -msgstr "" +msgstr "Магнітострічка\tНе реалізовано\n" #: src/frontend/mame/ui/selmenu.cpp:2993 msgid "Mag. Tape\tImperfect\n" -msgstr "" +msgstr "Магнітострічка\tНедосконало\n" #: src/frontend/mame/ui/selmenu.cpp:2996 msgid "Punch Tape\tUnimplemented\n" -msgstr "" +msgstr "Перфострічка\tНе реалізовано\n" #: src/frontend/mame/ui/selmenu.cpp:2998 msgid "Punch Tape\tImperfect\n" -msgstr "" +msgstr "Перфострічка\tНедосконало\n" #: src/frontend/mame/ui/selmenu.cpp:3001 msgid "Mag. Drum\tUnimplemented\n" -msgstr "" +msgstr "Магнітний барабан\tНе реалізовано\n" #: src/frontend/mame/ui/selmenu.cpp:3003 msgid "Mag. Drum\tImperfect\n" -msgstr "" +msgstr "Магнітний барабан\tНедосконало\n" #: src/frontend/mame/ui/selmenu.cpp:3006 msgid "(EP)ROM\tUnimplemented\n" -msgstr "" +msgstr "(EP)ROM\tНе реалізовано\n" #: src/frontend/mame/ui/selmenu.cpp:3008 msgid "(EP)ROM\tImperfect\n" -msgstr "" +msgstr "(EP)ROM\tНедосконало\n" #: src/frontend/mame/ui/selmenu.cpp:3011 msgid "Communications\tUnimplemented\n" -msgstr "" +msgstr "Комунікації\tНе реалізовано\n" #: src/frontend/mame/ui/selmenu.cpp:3013 msgid "Communications\tImperfect\n" -msgstr "" +msgstr "Комунікації\tНедосконало\n" #: src/frontend/mame/ui/selmenu.cpp:3016 msgid "LAN\tUnimplemented\n" -msgstr "" +msgstr "Локальна мережа\tНе реалізовано\n" #: src/frontend/mame/ui/selmenu.cpp:3018 msgid "LAN\tImperfect\n" -msgstr "" +msgstr "Локальна мережа\tНедосконало\n" #: src/frontend/mame/ui/selmenu.cpp:3021 msgid "WAN\tUnimplemented\n" -msgstr "" +msgstr "Глобальна мережа\tНе реалізовано\n" #: src/frontend/mame/ui/selmenu.cpp:3023 msgid "WAN\tImperfect\n" -msgstr "" +msgstr "Глобальна мережа\tНедосконало\n" #: src/frontend/mame/ui/selmenu.cpp:3026 msgid "Timing\tUnimplemented\n" -msgstr "" +msgstr "Швидкість\tНе реалізовано\n" #: src/frontend/mame/ui/selmenu.cpp:3028 msgid "Timing\tImperfect\n" -msgstr "" +msgstr "Швидкість\tНедосконало\n" #: src/frontend/mame/ui/selmenu.cpp:3030 msgid "Mechanical Machine\tYes\n" -msgstr "" +msgstr "Механічна машина\tТак\n" #: src/frontend/mame/ui/selmenu.cpp:3030 msgid "Mechanical Machine\tNo\n" -msgstr "" +msgstr "Механічна машина\tНі\n" #: src/frontend/mame/ui/selmenu.cpp:3031 msgid "Requires Artwork\tYes\n" -msgstr "" +msgstr "Оформлення\tТак\n" #: src/frontend/mame/ui/selmenu.cpp:3031 msgid "Requires Artwork\tNo\n" -msgstr "" +msgstr "Оформлення\tНі\n" #: src/frontend/mame/ui/selmenu.cpp:3032 msgid "Requires Clickable Artwork\tYes\n" -msgstr "" +msgstr "Інтерактивне оформлення\tТак\n" #: src/frontend/mame/ui/selmenu.cpp:3032 msgid "Requires Clickable Artwork\tNo\n" -msgstr "" +msgstr "Інтерактивне оформлення\tНі\n" #: src/frontend/mame/ui/selmenu.cpp:3034 msgid "Support Cocktail\tNo\n" -msgstr "" +msgstr "Підтримка коктейль-режиму\tНі\n" #: src/frontend/mame/ui/selmenu.cpp:3035 msgid "Driver is BIOS\tYes\n" -msgstr "" +msgstr "Драйвер - BIOS\tТак\n" #: src/frontend/mame/ui/selmenu.cpp:3035 msgid "Driver is BIOS\tNo\n" -msgstr "" +msgstr "Драйвер - BIOS\tНі\n" #: src/frontend/mame/ui/selmenu.cpp:3036 msgid "Support Save\tYes\n" -msgstr "" +msgstr "Підтримка збережень\tТак\n" #: src/frontend/mame/ui/selmenu.cpp:3036 msgid "Support Save\tNo\n" -msgstr "" +msgstr "Підтримка збережень\tНі\n" #: src/frontend/mame/ui/selmenu.cpp:3037 msgid "Screen Orientation\tVertical\n" -msgstr "" +msgstr "Орієнтація екрана\tВертикальна\n" #: src/frontend/mame/ui/selmenu.cpp:3037 msgid "Screen Orientation\tHorizontal\n" -msgstr "" +msgstr "Орієнтація екрана\tГоризонтальна\n" #: src/frontend/mame/ui/selmenu.cpp:3047 msgid "Requires CHD\tYes\n" -msgstr "" +msgstr "CHD\tТак\n" #: src/frontend/mame/ui/selmenu.cpp:3047 msgid "Requires CHD\tNo\n" -msgstr "" +msgstr "CHD\tНі\n" #: src/frontend/mame/ui/selmenu.cpp:3060 msgid "Media Audit Result\tOK\n" -msgstr "" +msgstr "Результат перевірки медіа\tOK\n" #: src/frontend/mame/ui/selmenu.cpp:3062 msgid "Media Audit Result\tBAD\n" -msgstr "" +msgstr "Результат перевірки медіа\tПошкоджено\n" #: src/frontend/mame/ui/selmenu.cpp:3065 msgid "Samples Audit Result\tNone Needed\n" -msgstr "" +msgstr "Результат перевірки зразків\tБез необхідності\n" #: src/frontend/mame/ui/selmenu.cpp:3067 msgid "Samples Audit Result\tOK\n" -msgstr "" +msgstr "Результат перевірки зразків\tOK\n" #: src/frontend/mame/ui/selmenu.cpp:3069 msgid "Samples Audit Result\tBAD\n" -msgstr "" +msgstr "Результат перевірки зразків\tПошкоджено\n" #: src/frontend/mame/ui/selmenu.cpp:3073 msgid "" "Media Audit\tDisabled\n" "Samples Audit\tDisabled\n" msgstr "" +"Перевірка медіа\tВимкнено\n" +"Перевірка зразків\tВимкнено\n" #: src/frontend/mame/ui/sndmenu.cpp:146 msgid "Sound" -msgstr "" +msgstr "Аудіо" #: src/frontend/mame/ui/sndmenu.cpp:147 msgid "Compressor" -msgstr "" +msgstr "Компресор" #: src/frontend/mame/ui/sndmenu.cpp:148 msgid "Sample Rate" -msgstr "" +msgstr "Частота дискретизації" #: src/frontend/mame/ui/sndmenu.cpp:149 msgid "Use External Samples" -msgstr "" +msgstr "Використовувати зовнішні зразки" #: src/frontend/mame/ui/devopt.cpp:58 #, c-format @@ -3100,6 +3178,12 @@ "\n" "The selected option enables the following items:\n" msgstr "" +"(Опцію змонтовано в запущеній системі)\n" +"\n" +"Опція: %1$s\n" +"Пристрій: %2$s\n" +"\n" +"Вибрана опція увімкне наведені пункти:\n" #: src/frontend/mame/ui/devopt.cpp:59 #, c-format @@ -3111,6 +3195,12 @@ "\n" "If you select this option, the following items will be enabled:\n" msgstr "" +"(Опцію не змонтовано в запущеній системі)\n" +"\n" +"Опція: %1$s\n" +"Пристрій: %2$s\n" +"\n" +"При виборі опції буде увімкнено наведені пункти:\n" #: src/frontend/mame/ui/devopt.cpp:68 msgid "* CPU:\n" @@ -3118,26 +3208,26 @@ #: src/frontend/mame/ui/devopt.cpp:114 msgid "* Video:\n" -msgstr "" +msgstr "* Відео:\n" #: src/frontend/mame/ui/devopt.cpp:119 #, c-format msgid " Screen '%1$s': Vector\n" -msgstr "" +msgstr " Екран '%1$s': Вектор\n" #: src/frontend/mame/ui/devopt.cpp:135 #, c-format -msgid " Screen '%1$s': %2$d × %3$d (V) %4$s Hz\n" -msgstr "" +msgid " Screen '%1$s': %2$d × %3$d (V) %4$s Hz\n" +msgstr " Екран '%1$s': %2$d * %3$d (В) %4$s Гц\n" #: src/frontend/mame/ui/devopt.cpp:136 #, c-format -msgid " Screen '%1$s': %2$d × %3$d (H) %4$s Hz\n" -msgstr "" +msgid " Screen '%1$s': %2$d × %3$d (H) %4$s Hz\n" +msgstr " Екран '%1$s': %2$d * %3$d (Г) %4$s Гц\n" #: src/frontend/mame/ui/devopt.cpp:150 msgid "* Sound:\n" -msgstr "" +msgstr "* Аудіо:\n" #: src/frontend/mame/ui/devopt.cpp:214 #, c-format @@ -3145,12 +3235,14 @@ "* BIOS settings:\n" " %1$d options [default: %2$s]\n" msgstr "" +"* BIOS-налаштування:\n" +" %1$d опцій (типово: %2$s)\n" #: src/frontend/mame/ui/devopt.cpp:258 src/frontend/mame/ui/devopt.cpp:274 #: src/frontend/mame/ui/devopt.cpp:335 #, c-format msgid " %1$s [default: %2$s]\n" -msgstr "" +msgstr " %1$s (типово: %2$s)\n" #: src/frontend/mame/ui/devopt.cpp:263 src/frontend/mame/ui/devopt.cpp:279 #, c-format @@ -3159,133 +3251,133 @@ #: src/frontend/mame/ui/devopt.cpp:285 msgid "* DIP switch settings:\n" -msgstr "" +msgstr "* Налаштування DIP-перемикача:\n" #: src/frontend/mame/ui/devopt.cpp:290 msgid "* Configuration settings:\n" -msgstr "" +msgstr "* Налаштування конфігурації:\n" #: src/frontend/mame/ui/devopt.cpp:294 msgid "* Input device(s):\n" -msgstr "" +msgstr "* Пристрої керування:\n" #: src/frontend/mame/ui/devopt.cpp:296 #, c-format msgid " User inputs [%1$d inputs]\n" -msgstr "" +msgstr " Користувацьке керування (%1$d даних)\n" #: src/frontend/mame/ui/devopt.cpp:298 #, c-format msgid " Mahjong inputs [%1$d inputs]\n" -msgstr "" +msgstr " Маджонг-керування (%1$d даних)\n" #: src/frontend/mame/ui/devopt.cpp:300 #, c-format msgid " Hanafuda inputs [%1$d inputs]\n" -msgstr "" +msgstr " Ханафуда-керування (%1$d даних)\n" #: src/frontend/mame/ui/devopt.cpp:302 #, c-format msgid " Gambling inputs [%1$d inputs]\n" -msgstr "" +msgstr " Азартні керування (%1$d даних)\n" #: src/frontend/mame/ui/devopt.cpp:304 #, c-format msgid " Analog inputs [%1$d inputs]\n" -msgstr "" +msgstr " Аналогові керування (%1$d даних)\n" #: src/frontend/mame/ui/devopt.cpp:306 #, c-format msgid " Adjuster inputs [%1$d inputs]\n" -msgstr "" +msgstr " Регулювальні керування (%1$d даних)\n" #: src/frontend/mame/ui/devopt.cpp:308 #, c-format msgid " Keypad inputs [%1$d inputs]\n" -msgstr "" +msgstr " Міні-клавіатурні керування (%1$d даних)\n" #: src/frontend/mame/ui/devopt.cpp:310 #, c-format msgid " Keyboard inputs [%1$d inputs]\n" -msgstr "" +msgstr " Клавіатурні керування (%1$d даних)\n" #: src/frontend/mame/ui/devopt.cpp:315 msgid "* Media Options:\n" -msgstr "" +msgstr "* Опції медіа:\n" #: src/frontend/mame/ui/devopt.cpp:320 #, c-format msgid " %1$s [tag: %2$s]\n" -msgstr "" +msgstr " %1$s [теґ: %2$s]\n" #: src/frontend/mame/ui/devopt.cpp:330 msgid "* Slot Options:\n" -msgstr "" +msgstr "* Слот-опції:\n" #: src/frontend/mame/ui/devopt.cpp:344 msgid "[None]\n" -msgstr "" +msgstr "[Не вказано]\n" #: src/emu/render.cpp:1796 #, c-format msgctxt "view-name" msgid "Screen %1$u Standard (%2$u:%3$u)" -msgstr "" +msgstr "Екран %1$u Типовий (%2$u:%3$u)" #: src/emu/render.cpp:1822 #, c-format msgctxt "view-name" msgid "Screen %1$u Pixel Aspect (%2$u:%3$u)" -msgstr "" +msgstr "Екран %1$u Піксельне співвідношення (%2$u:%3$u)" #: src/emu/render.cpp:1844 src/emu/render.cpp:1979 msgctxt "view-name" msgid "Cocktail" -msgstr "" +msgstr "Коктейль" #: src/emu/render.cpp:1964 msgctxt "view-name" msgid "Left-to-Right" -msgstr "" +msgstr "Зліва направо" #: src/emu/render.cpp:1965 msgctxt "view-name" msgid "Left-to-Right (Gapless)" -msgstr "" +msgstr "Зліва направо (неперервно)" #: src/emu/render.cpp:1966 msgctxt "view-name" msgid "Top-to-Bottom" -msgstr "" +msgstr "Згори донизу" #: src/emu/render.cpp:1967 msgctxt "view-name" msgid "Top-to-Bottom (Gapless)" -msgstr "" +msgstr "Згори донизу (неперервно)" #: src/emu/render.cpp:2018 #, c-format msgctxt "view-name" msgid "%1$u×%2$u Left-to-Right, Top-to-Bottom" -msgstr "" +msgstr "%1$u * %2$u Зліва направо, Згори донизу" #: src/emu/render.cpp:2027 #, c-format msgctxt "view-name" msgid "%1$u×%2$u Left-to-Right, Top-to-Bottom (Gapless)" -msgstr "" +msgstr "%1$u * %2$u Зліва направо, Згори донизу (неперервно)" #: src/emu/render.cpp:2036 #, c-format msgctxt "view-name" msgid "%1$u×%2$u Top-to-Bottom, Left-to-Right" -msgstr "" +msgstr "%1$u * %2$u Згори донизу, Зліва направо" #: src/emu/render.cpp:2045 #, c-format msgctxt "view-name" msgid "%1$u×%2$u Top-to-Bottom, Left-to-Right (Gapless)" -msgstr "" +msgstr "%1$u * %2$u Згори донизу, Зліва направо (неперервно)" #: src/emu/ioport.cpp:332 #, c-format @@ -3305,7 +3397,7 @@ #, c-format msgctxt "input-name" msgid "%p Up" -msgstr "" +msgstr "%p ↑" #: src/emu/inpttype.ipp:23 src/emu/inpttype.ipp:141 src/emu/inpttype.ipp:222 #: src/emu/inpttype.ipp:256 src/emu/inpttype.ipp:290 src/emu/inpttype.ipp:324 @@ -3314,7 +3406,7 @@ #, c-format msgctxt "input-name" msgid "%p Down" -msgstr "" +msgstr "%p ↓" #: src/emu/inpttype.ipp:24 src/emu/inpttype.ipp:142 src/emu/inpttype.ipp:223 #: src/emu/inpttype.ipp:257 src/emu/inpttype.ipp:291 src/emu/inpttype.ipp:325 @@ -3323,7 +3415,7 @@ #, c-format msgctxt "input-name" msgid "%p Left" -msgstr "" +msgstr "%p ←" #: src/emu/inpttype.ipp:25 src/emu/inpttype.ipp:143 src/emu/inpttype.ipp:224 #: src/emu/inpttype.ipp:258 src/emu/inpttype.ipp:292 src/emu/inpttype.ipp:326 @@ -3332,7 +3424,7 @@ #, c-format msgctxt "input-name" msgid "%p Right" -msgstr "" +msgstr "%p →" #: src/emu/inpttype.ipp:26 src/emu/inpttype.ipp:144 src/emu/inpttype.ipp:225 #: src/emu/inpttype.ipp:259 src/emu/inpttype.ipp:293 src/emu/inpttype.ipp:327 @@ -3341,7 +3433,7 @@ #, c-format msgctxt "input-name" msgid "%p Right Stick/Up" -msgstr "" +msgstr "%p Правий важіль ↑" #: src/emu/inpttype.ipp:27 src/emu/inpttype.ipp:145 src/emu/inpttype.ipp:226 #: src/emu/inpttype.ipp:260 src/emu/inpttype.ipp:294 src/emu/inpttype.ipp:328 @@ -3350,7 +3442,7 @@ #, c-format msgctxt "input-name" msgid "%p Right Stick/Down" -msgstr "" +msgstr "%p Правий важіль ↓" #: src/emu/inpttype.ipp:28 src/emu/inpttype.ipp:146 src/emu/inpttype.ipp:227 #: src/emu/inpttype.ipp:261 src/emu/inpttype.ipp:295 src/emu/inpttype.ipp:329 @@ -3359,7 +3451,7 @@ #, c-format msgctxt "input-name" msgid "%p Right Stick/Left" -msgstr "" +msgstr "%p Правий важіль ←" #: src/emu/inpttype.ipp:29 src/emu/inpttype.ipp:147 src/emu/inpttype.ipp:228 #: src/emu/inpttype.ipp:262 src/emu/inpttype.ipp:296 src/emu/inpttype.ipp:330 @@ -3368,7 +3460,7 @@ #, c-format msgctxt "input-name" msgid "%p Right Stick/Right" -msgstr "" +msgstr "%p Правий важіль →" #: src/emu/inpttype.ipp:30 src/emu/inpttype.ipp:148 src/emu/inpttype.ipp:229 #: src/emu/inpttype.ipp:263 src/emu/inpttype.ipp:297 src/emu/inpttype.ipp:331 @@ -3377,7 +3469,7 @@ #, c-format msgctxt "input-name" msgid "%p Left Stick/Up" -msgstr "" +msgstr "%p Лівий важіль ↑" #: src/emu/inpttype.ipp:31 src/emu/inpttype.ipp:149 src/emu/inpttype.ipp:230 #: src/emu/inpttype.ipp:264 src/emu/inpttype.ipp:298 src/emu/inpttype.ipp:332 @@ -3386,7 +3478,7 @@ #, c-format msgctxt "input-name" msgid "%p Left Stick/Down" -msgstr "" +msgstr "%p Лівий важіль ↓" #: src/emu/inpttype.ipp:32 src/emu/inpttype.ipp:150 src/emu/inpttype.ipp:231 #: src/emu/inpttype.ipp:265 src/emu/inpttype.ipp:299 src/emu/inpttype.ipp:333 @@ -3395,7 +3487,7 @@ #, c-format msgctxt "input-name" msgid "%p Left Stick/Left" -msgstr "" +msgstr "%p Лівий важіль ←" #: src/emu/inpttype.ipp:33 src/emu/inpttype.ipp:151 src/emu/inpttype.ipp:232 #: src/emu/inpttype.ipp:266 src/emu/inpttype.ipp:300 src/emu/inpttype.ipp:334 @@ -3404,7 +3496,7 @@ #, c-format msgctxt "input-name" msgid "%p Left Stick/Right" -msgstr "" +msgstr "%p Лівий важіль →" #: src/emu/inpttype.ipp:34 src/emu/inpttype.ipp:152 src/emu/inpttype.ipp:233 #: src/emu/inpttype.ipp:267 src/emu/inpttype.ipp:301 src/emu/inpttype.ipp:335 @@ -3413,7 +3505,7 @@ #, c-format msgctxt "input-name" msgid "%p Button 1" -msgstr "" +msgstr "%p Кнопка 1" #: src/emu/inpttype.ipp:35 src/emu/inpttype.ipp:153 src/emu/inpttype.ipp:234 #: src/emu/inpttype.ipp:268 src/emu/inpttype.ipp:302 src/emu/inpttype.ipp:336 @@ -3422,7 +3514,7 @@ #, c-format msgctxt "input-name" msgid "%p Button 2" -msgstr "" +msgstr "%p Кнопка 2" #: src/emu/inpttype.ipp:36 src/emu/inpttype.ipp:154 src/emu/inpttype.ipp:235 #: src/emu/inpttype.ipp:269 src/emu/inpttype.ipp:303 src/emu/inpttype.ipp:337 @@ -3431,7 +3523,7 @@ #, c-format msgctxt "input-name" msgid "%p Button 3" -msgstr "" +msgstr "%p Кнопка 3" #: src/emu/inpttype.ipp:37 src/emu/inpttype.ipp:155 src/emu/inpttype.ipp:236 #: src/emu/inpttype.ipp:270 src/emu/inpttype.ipp:304 src/emu/inpttype.ipp:338 @@ -3440,7 +3532,7 @@ #, c-format msgctxt "input-name" msgid "%p Button 4" -msgstr "" +msgstr "%p Кнопка 4" #: src/emu/inpttype.ipp:38 src/emu/inpttype.ipp:156 src/emu/inpttype.ipp:237 #: src/emu/inpttype.ipp:271 src/emu/inpttype.ipp:305 src/emu/inpttype.ipp:339 @@ -3449,7 +3541,7 @@ #, c-format msgctxt "input-name" msgid "%p Button 5" -msgstr "" +msgstr "%p Кнопка 5" #: src/emu/inpttype.ipp:39 src/emu/inpttype.ipp:157 src/emu/inpttype.ipp:238 #: src/emu/inpttype.ipp:272 src/emu/inpttype.ipp:306 src/emu/inpttype.ipp:340 @@ -3458,7 +3550,7 @@ #, c-format msgctxt "input-name" msgid "%p Button 6" -msgstr "" +msgstr "%p Кнопка 6" #: src/emu/inpttype.ipp:40 src/emu/inpttype.ipp:158 src/emu/inpttype.ipp:239 #: src/emu/inpttype.ipp:273 src/emu/inpttype.ipp:307 src/emu/inpttype.ipp:341 @@ -3467,7 +3559,7 @@ #, c-format msgctxt "input-name" msgid "%p Button 7" -msgstr "" +msgstr "%p Кнопка 7" #: src/emu/inpttype.ipp:41 src/emu/inpttype.ipp:159 src/emu/inpttype.ipp:240 #: src/emu/inpttype.ipp:274 src/emu/inpttype.ipp:308 src/emu/inpttype.ipp:342 @@ -3476,7 +3568,7 @@ #, c-format msgctxt "input-name" msgid "%p Button 8" -msgstr "" +msgstr "%p Кнопка 8" #: src/emu/inpttype.ipp:42 src/emu/inpttype.ipp:160 src/emu/inpttype.ipp:241 #: src/emu/inpttype.ipp:275 src/emu/inpttype.ipp:309 src/emu/inpttype.ipp:343 @@ -3485,7 +3577,7 @@ #, c-format msgctxt "input-name" msgid "%p Button 9" -msgstr "" +msgstr "%p Кнопка 9" #: src/emu/inpttype.ipp:43 src/emu/inpttype.ipp:161 src/emu/inpttype.ipp:242 #: src/emu/inpttype.ipp:276 src/emu/inpttype.ipp:310 src/emu/inpttype.ipp:344 @@ -3494,7 +3586,7 @@ #, c-format msgctxt "input-name" msgid "%p Button 10" -msgstr "" +msgstr "%p Кнопка 10" #: src/emu/inpttype.ipp:44 src/emu/inpttype.ipp:162 src/emu/inpttype.ipp:243 #: src/emu/inpttype.ipp:277 src/emu/inpttype.ipp:311 src/emu/inpttype.ipp:345 @@ -3503,7 +3595,7 @@ #, c-format msgctxt "input-name" msgid "%p Button 11" -msgstr "" +msgstr "%p Кнопка 11" #: src/emu/inpttype.ipp:45 src/emu/inpttype.ipp:163 src/emu/inpttype.ipp:244 #: src/emu/inpttype.ipp:278 src/emu/inpttype.ipp:312 src/emu/inpttype.ipp:346 @@ -3512,7 +3604,7 @@ #, c-format msgctxt "input-name" msgid "%p Button 12" -msgstr "" +msgstr "%p Кнопка 12" #: src/emu/inpttype.ipp:46 src/emu/inpttype.ipp:164 src/emu/inpttype.ipp:245 #: src/emu/inpttype.ipp:279 src/emu/inpttype.ipp:313 src/emu/inpttype.ipp:347 @@ -3521,7 +3613,7 @@ #, c-format msgctxt "input-name" msgid "%p Button 13" -msgstr "" +msgstr "%p Кнопка 13" #: src/emu/inpttype.ipp:47 src/emu/inpttype.ipp:165 src/emu/inpttype.ipp:246 #: src/emu/inpttype.ipp:280 src/emu/inpttype.ipp:314 src/emu/inpttype.ipp:348 @@ -3530,7 +3622,7 @@ #, c-format msgctxt "input-name" msgid "%p Button 14" -msgstr "" +msgstr "%p Кнопка 14" #: src/emu/inpttype.ipp:48 src/emu/inpttype.ipp:166 src/emu/inpttype.ipp:247 #: src/emu/inpttype.ipp:281 src/emu/inpttype.ipp:315 src/emu/inpttype.ipp:349 @@ -3539,7 +3631,7 @@ #, c-format msgctxt "input-name" msgid "%p Button 15" -msgstr "" +msgstr "%p Кнопка 15" #: src/emu/inpttype.ipp:49 src/emu/inpttype.ipp:167 src/emu/inpttype.ipp:248 #: src/emu/inpttype.ipp:282 src/emu/inpttype.ipp:316 src/emu/inpttype.ipp:350 @@ -3548,7 +3640,7 @@ #, c-format msgctxt "input-name" msgid "%p Button 16" -msgstr "" +msgstr "%p Кнопка 16" #: src/emu/inpttype.ipp:50 src/emu/inpttype.ipp:168 src/emu/inpttype.ipp:249 #: src/emu/inpttype.ipp:283 src/emu/inpttype.ipp:317 src/emu/inpttype.ipp:351 @@ -3572,540 +3664,540 @@ #, c-format msgctxt "input-name" msgid "%p Mahjong A" -msgstr "" +msgstr "%p Маджонг A" #: src/emu/inpttype.ipp:57 src/emu/inpttype.ipp:175 #, c-format msgctxt "input-name" msgid "%p Mahjong B" -msgstr "" +msgstr "%p Маджонг B" #: src/emu/inpttype.ipp:58 src/emu/inpttype.ipp:176 #, c-format msgctxt "input-name" msgid "%p Mahjong C" -msgstr "" +msgstr "%p Маджонг C" #: src/emu/inpttype.ipp:59 src/emu/inpttype.ipp:177 #, c-format msgctxt "input-name" msgid "%p Mahjong D" -msgstr "" +msgstr "%p Маджонг D" #: src/emu/inpttype.ipp:60 src/emu/inpttype.ipp:178 #, c-format msgctxt "input-name" msgid "%p Mahjong E" -msgstr "" +msgstr "%p Маджонг E" #: src/emu/inpttype.ipp:61 src/emu/inpttype.ipp:179 #, c-format msgctxt "input-name" msgid "%p Mahjong F" -msgstr "" +msgstr "%p Маджонг F" #: src/emu/inpttype.ipp:62 src/emu/inpttype.ipp:180 #, c-format msgctxt "input-name" msgid "%p Mahjong G" -msgstr "" +msgstr "%p Маджонг G" #: src/emu/inpttype.ipp:63 src/emu/inpttype.ipp:181 #, c-format msgctxt "input-name" msgid "%p Mahjong H" -msgstr "" +msgstr "%p Маджонг H" #: src/emu/inpttype.ipp:64 src/emu/inpttype.ipp:182 #, c-format msgctxt "input-name" msgid "%p Mahjong I" -msgstr "" +msgstr "%p Маджонг I" #: src/emu/inpttype.ipp:65 src/emu/inpttype.ipp:183 #, c-format msgctxt "input-name" msgid "%p Mahjong J" -msgstr "" +msgstr "%p Маджонг J" #: src/emu/inpttype.ipp:66 src/emu/inpttype.ipp:184 #, c-format msgctxt "input-name" msgid "%p Mahjong K" -msgstr "" +msgstr "%p Маджонг K" #: src/emu/inpttype.ipp:67 src/emu/inpttype.ipp:185 #, c-format msgctxt "input-name" msgid "%p Mahjong L" -msgstr "" +msgstr "%p Маджонг L" #: src/emu/inpttype.ipp:68 src/emu/inpttype.ipp:186 #, c-format msgctxt "input-name" msgid "%p Mahjong M" -msgstr "" +msgstr "%p Маджонг M" #: src/emu/inpttype.ipp:69 src/emu/inpttype.ipp:187 #, c-format msgctxt "input-name" msgid "%p Mahjong N" -msgstr "" +msgstr "%p Маджонг N" #: src/emu/inpttype.ipp:70 src/emu/inpttype.ipp:188 #, c-format msgctxt "input-name" msgid "%p Mahjong O" -msgstr "" +msgstr "%p Маджонг O" #: src/emu/inpttype.ipp:71 src/emu/inpttype.ipp:189 #, c-format msgctxt "input-name" msgid "%p Mahjong P" -msgstr "" +msgstr "%p Маджонг P" #: src/emu/inpttype.ipp:72 src/emu/inpttype.ipp:190 #, c-format msgctxt "input-name" msgid "%p Mahjong Q" -msgstr "" +msgstr "%p Маджонг Q" #: src/emu/inpttype.ipp:73 src/emu/inpttype.ipp:191 #, c-format msgctxt "input-name" msgid "%p Mahjong Kan" -msgstr "" +msgstr "%p Маджонг Кан" #: src/emu/inpttype.ipp:74 src/emu/inpttype.ipp:192 #, c-format msgctxt "input-name" msgid "%p Mahjong Pon" -msgstr "" +msgstr "%p Маджонг Пон" #: src/emu/inpttype.ipp:75 src/emu/inpttype.ipp:193 #, c-format msgctxt "input-name" msgid "%p Mahjong Chi" -msgstr "" +msgstr "%p Маджонг Чі" #: src/emu/inpttype.ipp:76 src/emu/inpttype.ipp:194 #, c-format msgctxt "input-name" msgid "%p Mahjong Reach" -msgstr "" +msgstr "%p Маджонг Річ" #: src/emu/inpttype.ipp:77 src/emu/inpttype.ipp:195 #, c-format msgctxt "input-name" msgid "%p Mahjong Ron" -msgstr "" +msgstr "%p Маджонг Рон" #: src/emu/inpttype.ipp:78 src/emu/inpttype.ipp:200 #, c-format msgctxt "input-name" msgid "%p Mahjong Flip Flop" -msgstr "" +msgstr "%p Маджонг Фліп-флоп" #: src/emu/inpttype.ipp:79 src/emu/inpttype.ipp:196 #, c-format msgctxt "input-name" msgid "%p Mahjong Bet" -msgstr "" +msgstr "%p Маджонг Ставка" #: src/emu/inpttype.ipp:80 src/emu/inpttype.ipp:198 #, c-format msgctxt "input-name" msgid "%p Mahjong Take Score" -msgstr "" +msgstr "%p Маджонг Отримання пунктів" #: src/emu/inpttype.ipp:81 src/emu/inpttype.ipp:199 #, c-format msgctxt "input-name" msgid "%p Mahjong Double Up" -msgstr "" +msgstr "%p Маджонг Подвоєння" #: src/emu/inpttype.ipp:82 src/emu/inpttype.ipp:201 #, c-format msgctxt "input-name" msgid "%p Mahjong Big" -msgstr "" +msgstr "%p Маджонг Великий" #: src/emu/inpttype.ipp:83 src/emu/inpttype.ipp:202 #, c-format msgctxt "input-name" msgid "%p Mahjong Small" -msgstr "" +msgstr "%p Маджонг Малий" #: src/emu/inpttype.ipp:84 src/emu/inpttype.ipp:197 #, c-format msgctxt "input-name" msgid "%p Mahjong Last Chance" -msgstr "" +msgstr "%p Маджонг Останній шанс" #: src/emu/inpttype.ipp:89 src/emu/inpttype.ipp:207 #, c-format msgctxt "input-name" msgid "%p Hanafuda A/1" -msgstr "" +msgstr "%p Ханафуда A / 1" #: src/emu/inpttype.ipp:90 src/emu/inpttype.ipp:208 #, c-format msgctxt "input-name" msgid "%p Hanafuda B/2" -msgstr "" +msgstr "%p Ханафуда B / 2" #: src/emu/inpttype.ipp:91 src/emu/inpttype.ipp:209 #, c-format msgctxt "input-name" msgid "%p Hanafuda C/3" -msgstr "" +msgstr "%p Ханафуда C / 3" #: src/emu/inpttype.ipp:92 src/emu/inpttype.ipp:210 #, c-format msgctxt "input-name" msgid "%p Hanafuda D/4" -msgstr "" +msgstr "%p Ханафуда D / 4" #: src/emu/inpttype.ipp:93 src/emu/inpttype.ipp:211 #, c-format msgctxt "input-name" msgid "%p Hanafuda E/5" -msgstr "" +msgstr "%p Ханафуда E / 5" #: src/emu/inpttype.ipp:94 src/emu/inpttype.ipp:212 #, c-format msgctxt "input-name" msgid "%p Hanafuda F/6" -msgstr "" +msgstr "%p Ханафуда F / 6" #: src/emu/inpttype.ipp:95 src/emu/inpttype.ipp:213 #, c-format msgctxt "input-name" msgid "%p Hanafuda G/7" -msgstr "" +msgstr "%p Ханафуда G / 7" #: src/emu/inpttype.ipp:96 src/emu/inpttype.ipp:214 #, c-format msgctxt "input-name" msgid "%p Hanafuda H/8" -msgstr "" +msgstr "%p Ханафуда H / 8" #: src/emu/inpttype.ipp:97 src/emu/inpttype.ipp:215 #, c-format msgctxt "input-name" msgid "%p Hanafuda Yes" -msgstr "" +msgstr "%p Ханафуда Так" #: src/emu/inpttype.ipp:98 src/emu/inpttype.ipp:216 #, c-format msgctxt "input-name" msgid "%p Hanafuda No" -msgstr "" +msgstr "%p Ханафуда Ні" #: src/emu/inpttype.ipp:103 msgctxt "input-name" msgid "Key In" -msgstr "" +msgstr "Вставити ключ" #: src/emu/inpttype.ipp:104 msgctxt "input-name" msgid "Key Out" -msgstr "" +msgstr "Вилучити ключ" #: src/emu/inpttype.ipp:105 src/emu/inpttype.ipp:540 msgctxt "input-name" msgid "Service" -msgstr "" +msgstr "Обслуговування" #: src/emu/inpttype.ipp:106 msgctxt "input-name" msgid "Book-Keeping" -msgstr "" +msgstr "Облік" #: src/emu/inpttype.ipp:107 msgctxt "input-name" msgid "Door" -msgstr "" +msgstr "Двері" #: src/emu/inpttype.ipp:108 msgctxt "input-name" msgid "Payout" -msgstr "" +msgstr "Оплата" #: src/emu/inpttype.ipp:109 msgctxt "input-name" msgid "Bet" -msgstr "" +msgstr "Ставка" #: src/emu/inpttype.ipp:110 msgctxt "input-name" msgid "Deal" -msgstr "" +msgstr "Згода" #: src/emu/inpttype.ipp:111 msgctxt "input-name" msgid "Stand" -msgstr "" +msgstr "Зупинка" #: src/emu/inpttype.ipp:112 msgctxt "input-name" msgid "Take Score" -msgstr "" +msgstr "Отримання пунктів" #: src/emu/inpttype.ipp:113 msgctxt "input-name" msgid "Double Up" -msgstr "" +msgstr "Подвоєння" #: src/emu/inpttype.ipp:114 msgctxt "input-name" msgid "Half Gamble" -msgstr "" +msgstr "Напівазарт" #: src/emu/inpttype.ipp:115 msgctxt "input-name" msgid "High" -msgstr "" +msgstr "Великий" #: src/emu/inpttype.ipp:116 msgctxt "input-name" msgid "Low" -msgstr "" +msgstr "Малий" #: src/emu/inpttype.ipp:121 msgctxt "input-name" msgid "Hold 1" -msgstr "" +msgstr "Затримка 1" #: src/emu/inpttype.ipp:122 msgctxt "input-name" msgid "Hold 2" -msgstr "" +msgstr "Затримка 2" #: src/emu/inpttype.ipp:123 msgctxt "input-name" msgid "Hold 3" -msgstr "" +msgstr "Затримка 3" #: src/emu/inpttype.ipp:124 msgctxt "input-name" msgid "Hold 4" -msgstr "" +msgstr "Затримка 4" #: src/emu/inpttype.ipp:125 msgctxt "input-name" msgid "Hold 5" -msgstr "" +msgstr "Затримка 5" #: src/emu/inpttype.ipp:126 msgctxt "input-name" msgid "Cancel" -msgstr "" +msgstr "Скасувати" #: src/emu/inpttype.ipp:131 msgctxt "input-name" msgid "Stop Reel 1" -msgstr "" +msgstr "Зупинка барабана 1" #: src/emu/inpttype.ipp:132 msgctxt "input-name" msgid "Stop Reel 2" -msgstr "" +msgstr "Зупинка барабана 2" #: src/emu/inpttype.ipp:133 msgctxt "input-name" msgid "Stop Reel 3" -msgstr "" +msgstr "Зупинка барабана 3" #: src/emu/inpttype.ipp:134 msgctxt "input-name" msgid "Stop Reel 4" -msgstr "" +msgstr "Зупинка барабана 4" #: src/emu/inpttype.ipp:135 msgctxt "input-name" msgid "Stop All Reels" -msgstr "" +msgstr "Зупинка всіх барабанів" #: src/emu/inpttype.ipp:493 msgctxt "input-name" msgid "1 Player Start" -msgstr "" +msgstr "Розпочати 1 гравцем" #: src/emu/inpttype.ipp:494 msgctxt "input-name" msgid "2 Players Start" -msgstr "" +msgstr "Розпочати 2 гравцями" #: src/emu/inpttype.ipp:495 msgctxt "input-name" msgid "3 Players Start" -msgstr "" +msgstr "Розпочати 3 гравцями" #: src/emu/inpttype.ipp:496 msgctxt "input-name" msgid "4 Players Start" -msgstr "" +msgstr "Розпочати 4 гравцями" #: src/emu/inpttype.ipp:497 msgctxt "input-name" msgid "5 Players Start" -msgstr "" +msgstr "Розпочати 5 гравцями" #: src/emu/inpttype.ipp:498 msgctxt "input-name" msgid "6 Players Start" -msgstr "" +msgstr "Розпочати 6 гравцями" #: src/emu/inpttype.ipp:499 msgctxt "input-name" msgid "7 Players Start" -msgstr "" +msgstr "Розпочати 7 гравцями" #: src/emu/inpttype.ipp:500 msgctxt "input-name" msgid "8 Players Start" -msgstr "" +msgstr "Розпочати 8 гравцями" #: src/emu/inpttype.ipp:505 msgctxt "input-name" msgid "Coin 1" -msgstr "" +msgstr "Монета 1" #: src/emu/inpttype.ipp:506 msgctxt "input-name" msgid "Coin 2" -msgstr "" +msgstr "Монета 2" #: src/emu/inpttype.ipp:507 msgctxt "input-name" msgid "Coin 3" -msgstr "" +msgstr "Монета 3" #: src/emu/inpttype.ipp:508 msgctxt "input-name" msgid "Coin 4" -msgstr "" +msgstr "Монета 4" #: src/emu/inpttype.ipp:509 msgctxt "input-name" msgid "Coin 5" -msgstr "" +msgstr "Монета 5" #: src/emu/inpttype.ipp:510 msgctxt "input-name" msgid "Coin 6" -msgstr "" +msgstr "Монета 6" #: src/emu/inpttype.ipp:511 msgctxt "input-name" msgid "Coin 7" -msgstr "" +msgstr "Монета 7" #: src/emu/inpttype.ipp:512 msgctxt "input-name" msgid "Coin 8" -msgstr "" +msgstr "Монета 8" #: src/emu/inpttype.ipp:513 msgctxt "input-name" msgid "Coin 9" -msgstr "" +msgstr "Монета 9" #: src/emu/inpttype.ipp:514 msgctxt "input-name" msgid "Coin 10" -msgstr "" +msgstr "Монета 10" #: src/emu/inpttype.ipp:515 msgctxt "input-name" msgid "Coin 11" -msgstr "" +msgstr "Монета 11" #: src/emu/inpttype.ipp:516 msgctxt "input-name" msgid "Coin 12" -msgstr "" +msgstr "Монета 12" #: src/emu/inpttype.ipp:517 msgctxt "input-name" msgid "Bill 1" -msgstr "" +msgstr "Банкнота 1" #: src/emu/inpttype.ipp:522 msgctxt "input-name" msgid "Service 1" -msgstr "" +msgstr "Служба 1" #: src/emu/inpttype.ipp:523 msgctxt "input-name" msgid "Service 2" -msgstr "" +msgstr "Служба 2" #: src/emu/inpttype.ipp:524 msgctxt "input-name" msgid "Service 3" -msgstr "" +msgstr "Служба 3" #: src/emu/inpttype.ipp:525 msgctxt "input-name" msgid "Service 4" -msgstr "" +msgstr "Служба 4" #: src/emu/inpttype.ipp:530 msgctxt "input-name" msgid "Tilt 1" -msgstr "" +msgstr "Нахил 1" #: src/emu/inpttype.ipp:531 msgctxt "input-name" msgid "Tilt 2" -msgstr "" +msgstr "Нахил 2" #: src/emu/inpttype.ipp:532 msgctxt "input-name" msgid "Tilt 3" -msgstr "" +msgstr "Нахил 3" #: src/emu/inpttype.ipp:533 msgctxt "input-name" msgid "Tilt 4" -msgstr "" +msgstr "Нахил 4" #: src/emu/inpttype.ipp:538 msgctxt "input-name" msgid "Power On" -msgstr "" +msgstr "Увімкнути живлення" #: src/emu/inpttype.ipp:539 msgctxt "input-name" msgid "Power Off" -msgstr "" +msgstr "Вимкнути живлення" #: src/emu/inpttype.ipp:541 msgctxt "input-name" msgid "Tilt" -msgstr "" +msgstr "Нахил" #: src/emu/inpttype.ipp:542 msgctxt "input-name" msgid "Door Interlock" -msgstr "" +msgstr "Блокування дверей" #: src/emu/inpttype.ipp:543 msgctxt "input-name" msgid "Memory Reset" -msgstr "" +msgstr "Перезавантаження пам'яті" #: src/emu/inpttype.ipp:544 msgctxt "input-name" msgid "Volume Down" -msgstr "" +msgstr "Зменшити гучність" #: src/emu/inpttype.ipp:545 msgctxt "input-name" msgid "Volume Up" -msgstr "" +msgstr "Збільшити гучність" #: src/emu/inpttype.ipp:550 src/emu/inpttype.ipp:551 src/emu/inpttype.ipp:552 #: src/emu/inpttype.ipp:553 src/emu/inpttype.ipp:554 src/emu/inpttype.ipp:555 @@ -4114,7 +4206,7 @@ #, c-format msgctxt "input-name" msgid "%p Pedal 1" -msgstr "" +msgstr "%p Педаль 1" #: src/emu/inpttype.ipp:564 src/emu/inpttype.ipp:565 src/emu/inpttype.ipp:566 #: src/emu/inpttype.ipp:567 src/emu/inpttype.ipp:568 src/emu/inpttype.ipp:569 @@ -4123,7 +4215,7 @@ #, c-format msgctxt "input-name" msgid "%p Pedal 2" -msgstr "" +msgstr "%p Педаль 2" #: src/emu/inpttype.ipp:578 src/emu/inpttype.ipp:579 src/emu/inpttype.ipp:580 #: src/emu/inpttype.ipp:581 src/emu/inpttype.ipp:582 src/emu/inpttype.ipp:583 @@ -4132,1171 +4224,1173 @@ #, c-format msgctxt "input-name" msgid "%p Pedal 3" -msgstr "" +msgstr "%p Педаль 3" #: src/emu/inpttype.ipp:592 msgctxt "input-name" msgid "Paddle" -msgstr "" +msgstr "Весло 1" #: src/emu/inpttype.ipp:593 msgctxt "input-name" msgid "Paddle 2" -msgstr "" +msgstr "Весло 2" #: src/emu/inpttype.ipp:594 msgctxt "input-name" msgid "Paddle 3" -msgstr "" +msgstr "Весло 3" #: src/emu/inpttype.ipp:595 msgctxt "input-name" msgid "Paddle 4" -msgstr "" +msgstr "Весло 4" #: src/emu/inpttype.ipp:596 msgctxt "input-name" msgid "Paddle 5" -msgstr "" +msgstr "Весло 5" #: src/emu/inpttype.ipp:597 msgctxt "input-name" msgid "Paddle 6" -msgstr "" +msgstr "Весло 6" #: src/emu/inpttype.ipp:598 msgctxt "input-name" msgid "Paddle 7" -msgstr "" +msgstr "Весло 7" #: src/emu/inpttype.ipp:599 msgctxt "input-name" msgid "Paddle 8" -msgstr "" +msgstr "Весло 8" #: src/emu/inpttype.ipp:600 msgctxt "input-name" msgid "Paddle 9" -msgstr "" +msgstr "Весло 9" #: src/emu/inpttype.ipp:601 msgctxt "input-name" msgid "Paddle 10" -msgstr "" +msgstr "Весло 10" #: src/emu/inpttype.ipp:606 msgctxt "input-name" msgid "Paddle V" -msgstr "" +msgstr "Весло вертикально 1" #: src/emu/inpttype.ipp:607 msgctxt "input-name" msgid "Paddle V 2" -msgstr "" +msgstr "Весло вертикально 2" #: src/emu/inpttype.ipp:608 msgctxt "input-name" msgid "Paddle V 3" -msgstr "" +msgstr "Весло вертикально 3" #: src/emu/inpttype.ipp:609 msgctxt "input-name" msgid "Paddle V 4" -msgstr "" +msgstr "Весло вертикально 4" #: src/emu/inpttype.ipp:610 msgctxt "input-name" msgid "Paddle V 5" -msgstr "" +msgstr "Весло вертикально 5" #: src/emu/inpttype.ipp:611 msgctxt "input-name" msgid "Paddle V 6" -msgstr "" +msgstr "Весло вертикально 6" #: src/emu/inpttype.ipp:612 msgctxt "input-name" msgid "Paddle V 7" -msgstr "" +msgstr "Весло вертикально 7" #: src/emu/inpttype.ipp:613 msgctxt "input-name" msgid "Paddle V 8" -msgstr "" +msgstr "Весло вертикально 8" #: src/emu/inpttype.ipp:614 msgctxt "input-name" msgid "Paddle V 9" -msgstr "" +msgstr "Весло вертикально 9" #: src/emu/inpttype.ipp:615 msgctxt "input-name" msgid "Paddle V 10" -msgstr "" +msgstr "Весло вертикально 10" #: src/emu/inpttype.ipp:620 msgctxt "input-name" msgid "Positional" -msgstr "" +msgstr "Позиційний 1" #: src/emu/inpttype.ipp:621 msgctxt "input-name" msgid "Positional 2" -msgstr "" +msgstr "Позиційний 2" #: src/emu/inpttype.ipp:622 msgctxt "input-name" msgid "Positional 3" -msgstr "" +msgstr "Позиційний 3" #: src/emu/inpttype.ipp:623 msgctxt "input-name" msgid "Positional 4" -msgstr "" +msgstr "Позиційний 4" #: src/emu/inpttype.ipp:624 msgctxt "input-name" msgid "Positional 5" -msgstr "" +msgstr "Позиційний 5" #: src/emu/inpttype.ipp:625 msgctxt "input-name" msgid "Positional 6" -msgstr "" +msgstr "Позиційний 6" #: src/emu/inpttype.ipp:626 msgctxt "input-name" msgid "Positional 7" -msgstr "" +msgstr "Позиційний 7" #: src/emu/inpttype.ipp:627 msgctxt "input-name" msgid "Positional 8" -msgstr "" +msgstr "Позиційний 8" #: src/emu/inpttype.ipp:628 msgctxt "input-name" msgid "Positional 9" -msgstr "" +msgstr "Позиційний 9" #: src/emu/inpttype.ipp:629 msgctxt "input-name" msgid "Positional 10" -msgstr "" +msgstr "Позиційний 10" #: src/emu/inpttype.ipp:634 msgctxt "input-name" msgid "Positional V" -msgstr "" +msgstr "Позиційний вертикально 1" #: src/emu/inpttype.ipp:635 msgctxt "input-name" msgid "Positional V 2" -msgstr "" +msgstr "Позиційний вертикально 2" #: src/emu/inpttype.ipp:636 msgctxt "input-name" msgid "Positional V 3" -msgstr "" +msgstr "Позиційний вертикально 3" #: src/emu/inpttype.ipp:637 msgctxt "input-name" msgid "Positional V 4" -msgstr "" +msgstr "Позиційний вертикально 4" #: src/emu/inpttype.ipp:638 msgctxt "input-name" msgid "Positional V 5" -msgstr "" +msgstr "Позиційний вертикально 5" #: src/emu/inpttype.ipp:639 msgctxt "input-name" msgid "Positional V 6" -msgstr "" +msgstr "Позиційний вертикально 6" #: src/emu/inpttype.ipp:640 msgctxt "input-name" msgid "Positional V 7" -msgstr "" +msgstr "Позиційний вертикально 7" #: src/emu/inpttype.ipp:641 msgctxt "input-name" msgid "Positional V 8" -msgstr "" +msgstr "Позиційний вертикально 8" #: src/emu/inpttype.ipp:642 msgctxt "input-name" msgid "Positional V 9" -msgstr "" +msgstr "Позиційний вертикально 9" #: src/emu/inpttype.ipp:643 msgctxt "input-name" msgid "Positional V 10" -msgstr "" +msgstr "Позиційний вертикально 10" #: src/emu/inpttype.ipp:648 msgctxt "input-name" msgid "Dial" -msgstr "" +msgstr "Поворот 1" #: src/emu/inpttype.ipp:649 msgctxt "input-name" msgid "Dial 2" -msgstr "" +msgstr "Поворот 2" #: src/emu/inpttype.ipp:650 msgctxt "input-name" msgid "Dial 3" -msgstr "" +msgstr "Поворот 3" #: src/emu/inpttype.ipp:651 msgctxt "input-name" msgid "Dial 4" -msgstr "" +msgstr "Поворот 4" #: src/emu/inpttype.ipp:652 msgctxt "input-name" msgid "Dial 5" -msgstr "" +msgstr "Поворот 5" #: src/emu/inpttype.ipp:653 msgctxt "input-name" msgid "Dial 6" -msgstr "" +msgstr "Поворот 6" #: src/emu/inpttype.ipp:654 msgctxt "input-name" msgid "Dial 7" -msgstr "" +msgstr "Поворот 7" #: src/emu/inpttype.ipp:655 msgctxt "input-name" msgid "Dial 8" -msgstr "" +msgstr "Поворот 8" #: src/emu/inpttype.ipp:656 msgctxt "input-name" msgid "Dial 9" -msgstr "" +msgstr "Поворот 9" #: src/emu/inpttype.ipp:657 msgctxt "input-name" msgid "Dial 10" -msgstr "" +msgstr "Поворот 10" #: src/emu/inpttype.ipp:662 msgctxt "input-name" msgid "Dial V" -msgstr "" +msgstr "Поворот вертикально 1" #: src/emu/inpttype.ipp:663 msgctxt "input-name" msgid "Dial V 2" -msgstr "" +msgstr "Поворот вертикально 2" #: src/emu/inpttype.ipp:664 msgctxt "input-name" msgid "Dial V 3" -msgstr "" +msgstr "Поворот вертикально 3" #: src/emu/inpttype.ipp:665 msgctxt "input-name" msgid "Dial V 4" -msgstr "" +msgstr "Поворот вертикально 4" #: src/emu/inpttype.ipp:666 msgctxt "input-name" msgid "Dial V 5" -msgstr "" +msgstr "Поворот вертикально 5" #: src/emu/inpttype.ipp:667 msgctxt "input-name" msgid "Dial V 6" -msgstr "" +msgstr "Поворот вертикально 6" #: src/emu/inpttype.ipp:668 msgctxt "input-name" msgid "Dial V 7" -msgstr "" +msgstr "Поворот вертикально 7" #: src/emu/inpttype.ipp:669 msgctxt "input-name" msgid "Dial V 8" -msgstr "" +msgstr "Поворот вертикально 8" #: src/emu/inpttype.ipp:670 msgctxt "input-name" msgid "Dial V 9" -msgstr "" +msgstr "Поворот вертикально 9" #: src/emu/inpttype.ipp:671 msgctxt "input-name" msgid "Dial V 10" -msgstr "" +msgstr "Поворот вертикально 10" #: src/emu/inpttype.ipp:676 msgctxt "input-name" msgid "Track X" -msgstr "" +msgstr "Трекбол X 1" #: src/emu/inpttype.ipp:677 msgctxt "input-name" msgid "Track X 2" -msgstr "" +msgstr "Трекбол X 2" #: src/emu/inpttype.ipp:678 msgctxt "input-name" msgid "Track X 3" -msgstr "" +msgstr "Трекбол X 3" #: src/emu/inpttype.ipp:679 msgctxt "input-name" msgid "Track X 4" -msgstr "" +msgstr "Трекбол X 4" #: src/emu/inpttype.ipp:680 msgctxt "input-name" msgid "Track X 5" -msgstr "" +msgstr "Трекбол X 5" #: src/emu/inpttype.ipp:681 msgctxt "input-name" msgid "Track X 6" -msgstr "" +msgstr "Трекбол X 6" #: src/emu/inpttype.ipp:682 msgctxt "input-name" msgid "Track X 7" -msgstr "" +msgstr "Трекбол X 7" #: src/emu/inpttype.ipp:683 msgctxt "input-name" msgid "Track X 8" -msgstr "" +msgstr "Трекбол X 8" #: src/emu/inpttype.ipp:684 msgctxt "input-name" msgid "Track X 9" -msgstr "" +msgstr "Трекбол X 9" #: src/emu/inpttype.ipp:685 msgctxt "input-name" msgid "Track X 10" -msgstr "" +msgstr "Трекбол X 10" #: src/emu/inpttype.ipp:690 msgctxt "input-name" msgid "Track Y" -msgstr "" +msgstr "Трекбол Y 1" #: src/emu/inpttype.ipp:691 msgctxt "input-name" msgid "Track Y 2" -msgstr "" +msgstr "Трекбол Y 2" #: src/emu/inpttype.ipp:692 msgctxt "input-name" msgid "Track Y 3" -msgstr "" +msgstr "Трекбол Y 3" #: src/emu/inpttype.ipp:693 msgctxt "input-name" msgid "Track Y 4" -msgstr "" +msgstr "Трекбол Y 4" #: src/emu/inpttype.ipp:694 msgctxt "input-name" msgid "Track Y 5" -msgstr "" +msgstr "Трекбол Y 5" #: src/emu/inpttype.ipp:695 msgctxt "input-name" msgid "Track Y 6" -msgstr "" +msgstr "Трекбол Y 6" #: src/emu/inpttype.ipp:696 msgctxt "input-name" msgid "Track Y 7" -msgstr "" +msgstr "Трекбол Y 7" #: src/emu/inpttype.ipp:697 msgctxt "input-name" msgid "Track Y 8" -msgstr "" +msgstr "Трекбол Y 8" #: src/emu/inpttype.ipp:698 msgctxt "input-name" msgid "Track Y 9" -msgstr "" +msgstr "Трекбол Y 9" #: src/emu/inpttype.ipp:699 msgctxt "input-name" msgid "Track Y 10" -msgstr "" +msgstr "Трекбол Y 10" #: src/emu/inpttype.ipp:704 msgctxt "input-name" msgid "AD Stick X" -msgstr "" +msgstr "Аналоговий джойстик X 1" #: src/emu/inpttype.ipp:705 msgctxt "input-name" msgid "AD Stick X 2" -msgstr "" +msgstr "Аналоговий джойстик X 2" #: src/emu/inpttype.ipp:706 msgctxt "input-name" msgid "AD Stick X 3" -msgstr "" +msgstr "Аналоговий джойстик X 3" #: src/emu/inpttype.ipp:707 msgctxt "input-name" msgid "AD Stick X 4" -msgstr "" +msgstr "Аналоговий джойстик X 4" #: src/emu/inpttype.ipp:708 msgctxt "input-name" msgid "AD Stick X 5" -msgstr "" +msgstr "Аналоговий джойстик X 5" #: src/emu/inpttype.ipp:709 msgctxt "input-name" msgid "AD Stick X 6" -msgstr "" +msgstr "Аналоговий джойстик X 6" #: src/emu/inpttype.ipp:710 msgctxt "input-name" msgid "AD Stick X 7" -msgstr "" +msgstr "Аналоговий джойстик X 7" #: src/emu/inpttype.ipp:711 msgctxt "input-name" msgid "AD Stick X 8" -msgstr "" +msgstr "Аналоговий джойстик X 8" #: src/emu/inpttype.ipp:712 msgctxt "input-name" msgid "AD Stick X 9" -msgstr "" +msgstr "Аналоговий джойстик X 9" #: src/emu/inpttype.ipp:713 msgctxt "input-name" msgid "AD Stick X 10" -msgstr "" +msgstr "Аналоговий джойстик X 10" #: src/emu/inpttype.ipp:718 msgctxt "input-name" msgid "AD Stick Y" -msgstr "" +msgstr "Аналоговий джойстик Y 1" #: src/emu/inpttype.ipp:719 msgctxt "input-name" msgid "AD Stick Y 2" -msgstr "" +msgstr "Аналоговий джойстик Y 2" #: src/emu/inpttype.ipp:720 msgctxt "input-name" msgid "AD Stick Y 3" -msgstr "" +msgstr "Аналоговий джойстик Y 3" #: src/emu/inpttype.ipp:721 msgctxt "input-name" msgid "AD Stick Y 4" -msgstr "" +msgstr "Аналоговий джойстик Y 4" #: src/emu/inpttype.ipp:722 msgctxt "input-name" msgid "AD Stick Y 5" -msgstr "" +msgstr "Аналоговий джойстик Y 5" #: src/emu/inpttype.ipp:723 msgctxt "input-name" msgid "AD Stick Y 6" -msgstr "" +msgstr "Аналоговий джойстик Y 6" #: src/emu/inpttype.ipp:724 msgctxt "input-name" msgid "AD Stick Y 7" -msgstr "" +msgstr "Аналоговий джойстик Y 7" #: src/emu/inpttype.ipp:725 msgctxt "input-name" msgid "AD Stick Y 8" -msgstr "" +msgstr "Аналоговий джойстик Y 8" #: src/emu/inpttype.ipp:726 msgctxt "input-name" msgid "AD Stick Y 9" -msgstr "" +msgstr "Аналоговий джойстик Y 9" #: src/emu/inpttype.ipp:727 msgctxt "input-name" msgid "AD Stick Y 10" -msgstr "" +msgstr "Аналоговий джойстик Y 10" #: src/emu/inpttype.ipp:732 msgctxt "input-name" msgid "AD Stick Z" -msgstr "" +msgstr "Аналоговий джойстик Z 1" #: src/emu/inpttype.ipp:733 msgctxt "input-name" msgid "AD Stick Z 2" -msgstr "" +msgstr "Аналоговий джойстик Z 2" #: src/emu/inpttype.ipp:734 msgctxt "input-name" msgid "AD Stick Z 3" -msgstr "" +msgstr "Аналоговий джойстик Z 3" #: src/emu/inpttype.ipp:735 msgctxt "input-name" msgid "AD Stick Z 4" -msgstr "" +msgstr "Аналоговий джойстик Z 4" #: src/emu/inpttype.ipp:736 msgctxt "input-name" msgid "AD Stick Z 5" -msgstr "" +msgstr "Аналоговий джойстик Z 5" #: src/emu/inpttype.ipp:737 msgctxt "input-name" msgid "AD Stick Z 6" -msgstr "" +msgstr "Аналоговий джойстик Z 6" #: src/emu/inpttype.ipp:738 msgctxt "input-name" msgid "AD Stick Z 7" -msgstr "" +msgstr "Аналоговий джойстик Z 7" #: src/emu/inpttype.ipp:739 msgctxt "input-name" msgid "AD Stick Z 8" -msgstr "" +msgstr "Аналоговий джойстик Z 8" #: src/emu/inpttype.ipp:740 msgctxt "input-name" msgid "AD Stick Z 9" -msgstr "" +msgstr "Аналоговий джойстик Z 9" #: src/emu/inpttype.ipp:741 msgctxt "input-name" msgid "AD Stick Z 10" -msgstr "" +msgstr "Аналоговий джойстик Z 10" #: src/emu/inpttype.ipp:746 msgctxt "input-name" msgid "Lightgun X" -msgstr "" +msgstr "Світловий пістолет X 1" #: src/emu/inpttype.ipp:747 msgctxt "input-name" msgid "Lightgun X 2" -msgstr "" +msgstr "Світловий пістолет X 2" #: src/emu/inpttype.ipp:748 msgctxt "input-name" msgid "Lightgun X 3" -msgstr "" +msgstr "Світловий пістолет X 3" #: src/emu/inpttype.ipp:749 msgctxt "input-name" msgid "Lightgun X 4" -msgstr "" +msgstr "Світловий пістолет X 4" #: src/emu/inpttype.ipp:750 msgctxt "input-name" msgid "Lightgun X 5" -msgstr "" +msgstr "Світловий пістолет X 5" #: src/emu/inpttype.ipp:751 msgctxt "input-name" msgid "Lightgun X 6" -msgstr "" +msgstr "Світловий пістолет X 6" #: src/emu/inpttype.ipp:752 msgctxt "input-name" msgid "Lightgun X 7" -msgstr "" +msgstr "Світловий пістолет X 7" #: src/emu/inpttype.ipp:753 msgctxt "input-name" msgid "Lightgun X 8" -msgstr "" +msgstr "Світловий пістолет X 8" #: src/emu/inpttype.ipp:754 msgctxt "input-name" msgid "Lightgun X 9" -msgstr "" +msgstr "Світловий пістолет X 9" #: src/emu/inpttype.ipp:755 msgctxt "input-name" msgid "Lightgun X 10" -msgstr "" +msgstr "Світловий пістолет X 10" #: src/emu/inpttype.ipp:760 msgctxt "input-name" msgid "Lightgun Y" -msgstr "" +msgstr "Світловий пістолет Y 1" #: src/emu/inpttype.ipp:761 msgctxt "input-name" msgid "Lightgun Y 2" -msgstr "" +msgstr "Світловий пістолет Y 2" #: src/emu/inpttype.ipp:762 msgctxt "input-name" msgid "Lightgun Y 3" -msgstr "" +msgstr "Світловий пістолет Y 3" #: src/emu/inpttype.ipp:763 msgctxt "input-name" msgid "Lightgun Y 4" -msgstr "" +msgstr "Світловий пістолет Y 4" #: src/emu/inpttype.ipp:764 msgctxt "input-name" msgid "Lightgun Y 5" -msgstr "" +msgstr "Світловий пістолет Y 5" #: src/emu/inpttype.ipp:765 msgctxt "input-name" msgid "Lightgun Y 6" -msgstr "" +msgstr "Світловий пістолет Y 6" #: src/emu/inpttype.ipp:766 msgctxt "input-name" msgid "Lightgun Y 7" -msgstr "" +msgstr "Світловий пістолет Y 7" #: src/emu/inpttype.ipp:767 msgctxt "input-name" msgid "Lightgun Y 8" -msgstr "" +msgstr "Світловий пістолет Y 8" #: src/emu/inpttype.ipp:768 msgctxt "input-name" msgid "Lightgun Y 9" -msgstr "" +msgstr "Світловий пістолет Y 9" #: src/emu/inpttype.ipp:769 msgctxt "input-name" msgid "Lightgun Y 10" -msgstr "" +msgstr "Світловий пістолет Y 10" #: src/emu/inpttype.ipp:774 msgctxt "input-name" msgid "Mouse X" -msgstr "" +msgstr "Миша X 1" #: src/emu/inpttype.ipp:775 msgctxt "input-name" msgid "Mouse X 2" -msgstr "" +msgstr "Миша X 2" #: src/emu/inpttype.ipp:776 msgctxt "input-name" msgid "Mouse X 3" -msgstr "" +msgstr "Миша X 3" #: src/emu/inpttype.ipp:777 msgctxt "input-name" msgid "Mouse X 4" -msgstr "" +msgstr "Миша X 4" #: src/emu/inpttype.ipp:778 msgctxt "input-name" msgid "Mouse X 5" -msgstr "" +msgstr "Миша X 5" #: src/emu/inpttype.ipp:779 msgctxt "input-name" msgid "Mouse X 6" -msgstr "" +msgstr "Миша X 6" #: src/emu/inpttype.ipp:780 msgctxt "input-name" msgid "Mouse X 7" -msgstr "" +msgstr "Миша X 7" #: src/emu/inpttype.ipp:781 msgctxt "input-name" msgid "Mouse X 8" -msgstr "" +msgstr "Миша X 8" #: src/emu/inpttype.ipp:782 msgctxt "input-name" msgid "Mouse X 9" -msgstr "" +msgstr "Миша X 9" #: src/emu/inpttype.ipp:783 msgctxt "input-name" msgid "Mouse X 10" -msgstr "" +msgstr "Миша X 10" #: src/emu/inpttype.ipp:788 msgctxt "input-name" msgid "Mouse Y" -msgstr "" +msgstr "Миша Y 1" #: src/emu/inpttype.ipp:789 msgctxt "input-name" msgid "Mouse Y 2" -msgstr "" +msgstr "Миша Y 2" #: src/emu/inpttype.ipp:790 msgctxt "input-name" msgid "Mouse Y 3" -msgstr "" +msgstr "Миша Y 3" #: src/emu/inpttype.ipp:791 msgctxt "input-name" msgid "Mouse Y 4" -msgstr "" +msgstr "Миша Y 4" #: src/emu/inpttype.ipp:792 msgctxt "input-name" msgid "Mouse Y 5" -msgstr "" +msgstr "Миша Y 5" #: src/emu/inpttype.ipp:793 msgctxt "input-name" msgid "Mouse Y 6" -msgstr "" +msgstr "Миша Y 6" #: src/emu/inpttype.ipp:794 msgctxt "input-name" msgid "Mouse Y 7" -msgstr "" +msgstr "Миша Y 7" #: src/emu/inpttype.ipp:795 msgctxt "input-name" msgid "Mouse Y 8" -msgstr "" +msgstr "Миша Y 8" #: src/emu/inpttype.ipp:796 msgctxt "input-name" msgid "Mouse Y 9" -msgstr "" +msgstr "Миша Y 9" #: src/emu/inpttype.ipp:797 msgctxt "input-name" msgid "Mouse Y 10" -msgstr "" +msgstr "Миша Y 10" #: src/emu/inpttype.ipp:802 msgctxt "input-name" msgid "Keypad" -msgstr "" +msgstr "Міні-клавіатура" #: src/emu/inpttype.ipp:803 msgctxt "input-name" msgid "Keyboard" -msgstr "" +msgstr "Клавіатура" #: src/emu/inpttype.ipp:808 msgctxt "input-name" msgid "On Screen Display" -msgstr "" +msgstr "Відображати на екрані" #: src/emu/inpttype.ipp:809 msgctxt "input-name" msgid "Break in Debugger" -msgstr "" +msgstr "Зупинка налагоджувача" #: src/emu/inpttype.ipp:810 msgctxt "input-name" msgid "Config Menu" -msgstr "" +msgstr "Меню конфігурації" #: src/emu/inpttype.ipp:811 msgctxt "input-name" msgid "Pause" -msgstr "" +msgstr "Призупинити" #: src/emu/inpttype.ipp:812 msgctxt "input-name" msgid "Pause - Single Step" -msgstr "" +msgstr "Призупинити - одиничний крок" #: src/emu/inpttype.ipp:813 msgctxt "input-name" msgid "Rewind - Single Step" -msgstr "" +msgstr "Перемотати назад - одиничний крок" #: src/emu/inpttype.ipp:814 msgctxt "input-name" msgid "Reset Machine" -msgstr "" +msgstr "Перезавантажити машину" #: src/emu/inpttype.ipp:815 msgctxt "input-name" msgid "Soft Reset" -msgstr "" +msgstr "Програмне перезавантаження" #: src/emu/inpttype.ipp:816 msgctxt "input-name" msgid "Show Decoded Graphics" -msgstr "" +msgstr "Показати декодовану графіку" #: src/emu/inpttype.ipp:817 msgctxt "input-name" msgid "Frameskip Dec" -msgstr "" +msgstr "Зменшити пропуск кадрів" #: src/emu/inpttype.ipp:818 msgctxt "input-name" msgid "Frameskip Inc" -msgstr "" +msgstr "Збільшити пропуск кадрів" #: src/emu/inpttype.ipp:819 msgctxt "input-name" msgid "Throttle" -msgstr "" +msgstr "Прискорити" #: src/emu/inpttype.ipp:820 msgctxt "input-name" msgid "Fast Forward" -msgstr "" +msgstr "Перемотати вперед" #: src/emu/inpttype.ipp:821 msgctxt "input-name" msgid "Show FPS" -msgstr "" +msgstr "Показати FPS" #: src/emu/inpttype.ipp:822 msgctxt "input-name" msgid "Save Snapshot" -msgstr "" +msgstr "Зберегти кадр" #: src/emu/inpttype.ipp:823 msgctxt "input-name" msgid "Record MNG" -msgstr "" +msgstr "Записати MNG" #: src/emu/inpttype.ipp:824 msgctxt "input-name" msgid "Record AVI" -msgstr "" +msgstr "Записати AVI" #: src/emu/inpttype.ipp:825 msgctxt "input-name" msgid "Toggle Cheat" -msgstr "" +msgstr "Перемкнути чіти" #: src/emu/inpttype.ipp:826 msgctxt "input-name" msgid "UI Up" -msgstr "" +msgstr "UI ↑" #: src/emu/inpttype.ipp:827 msgctxt "input-name" msgid "UI Down" -msgstr "" +msgstr "UI ↓" #: src/emu/inpttype.ipp:828 msgctxt "input-name" msgid "UI Left" -msgstr "" +msgstr "UI ←" #: src/emu/inpttype.ipp:829 msgctxt "input-name" msgid "UI Right" -msgstr "" +msgstr "UI →" #: src/emu/inpttype.ipp:830 msgctxt "input-name" msgid "UI Home" -msgstr "" +msgstr "UI Початок" #: src/emu/inpttype.ipp:831 msgctxt "input-name" msgid "UI End" -msgstr "" +msgstr "UI Кінець" #: src/emu/inpttype.ipp:832 msgctxt "input-name" msgid "UI Page Up" -msgstr "" +msgstr "UI Сторінка вгору" #: src/emu/inpttype.ipp:833 msgctxt "input-name" msgid "UI Page Down" -msgstr "" +msgstr "UI Сторінка вниз" #: src/emu/inpttype.ipp:834 msgctxt "input-name" msgid "UI Focus Next" -msgstr "" +msgstr "UI Перейти до наступного" #: src/emu/inpttype.ipp:835 msgctxt "input-name" msgid "UI Focus Previous" -msgstr "" +msgstr "UI Перейти до попереднього" #: src/emu/inpttype.ipp:836 msgctxt "input-name" msgid "UI Select" -msgstr "" +msgstr "UI Вибрати" #: src/emu/inpttype.ipp:837 msgctxt "input-name" msgid "UI Cancel" -msgstr "" +msgstr "UI Скасувати" #: src/emu/inpttype.ipp:838 msgctxt "input-name" msgid "UI Display Comment" -msgstr "" +msgstr "UI Відобразити коментар" #: src/emu/inpttype.ipp:839 msgctxt "input-name" msgid "UI Clear" -msgstr "" +msgstr "UI Очистити" #: src/emu/inpttype.ipp:840 msgctxt "input-name" msgid "UI Zoom In" -msgstr "" +msgstr "UI Збільшити масштаб" #: src/emu/inpttype.ipp:841 msgctxt "input-name" msgid "UI Zoom Out" -msgstr "" +msgstr "UI Зменшити масштаб" #: src/emu/inpttype.ipp:842 msgctxt "input-name" msgid "UI Default Zoom" -msgstr "" +msgstr "UI Типовий масштаб" #: src/emu/inpttype.ipp:843 msgctxt "input-name" msgid "UI Previous Group" -msgstr "" +msgstr "UI Попередня група" #: src/emu/inpttype.ipp:844 msgctxt "input-name" msgid "UI Next Group" -msgstr "" +msgstr "UI Наступна група" #: src/emu/inpttype.ipp:845 msgctxt "input-name" msgid "UI Rotate" -msgstr "" +msgstr "UI Повернути" #: src/emu/inpttype.ipp:846 msgctxt "input-name" msgid "Show Profiler" -msgstr "" +msgstr "Показати профайлер" #: src/emu/inpttype.ipp:847 msgctxt "input-name" msgid "UI Toggle" -msgstr "" +msgstr "UI Перемкнути" #: src/emu/inpttype.ipp:848 msgctxt "input-name" msgid "UI Release Pointer" -msgstr "" +msgstr "UI Встановити вказівник" #: src/emu/inpttype.ipp:849 msgctxt "input-name" msgid "UI Paste Text" -msgstr "" +msgstr "UI Вставити текст" #: src/emu/inpttype.ipp:850 msgctxt "input-name" msgid "Save State" -msgstr "" +msgstr "Зберегти стан" #: src/emu/inpttype.ipp:851 msgctxt "input-name" msgid "Load State" -msgstr "" +msgstr "Завантажити стан" #: src/emu/inpttype.ipp:852 msgctxt "input-name" msgid "UI (First) Tape Start" -msgstr "" +msgstr "UI (Початково) Відтворення стрічки" #: src/emu/inpttype.ipp:853 msgctxt "input-name" msgid "UI (First) Tape Stop" -msgstr "" +msgstr "UI (Початково) Зупинка стрічки" #: src/emu/inpttype.ipp:854 msgctxt "input-name" msgid "UI External DAT View" -msgstr "" +msgstr "UI Переглянути зовнішній DAT" #: src/emu/inpttype.ipp:855 msgctxt "input-name" msgid "UI Add/Remove favorite" -msgstr "" +msgstr "UI Додати / вилучити з уподобань" #: src/emu/inpttype.ipp:856 msgctxt "input-name" msgid "UI Export List" -msgstr "" +msgstr "UI Експортувати перелік" #: src/emu/inpttype.ipp:857 msgctxt "input-name" msgid "UI Audit Media" -msgstr "" +msgstr "UI Перевірити медіа" #: src/osd/modules/input/input_windows.cpp:111 #: src/osd/modules/input/input_sdlcommon.cpp:175 msgctxt "input-name" msgid "Toggle Fullscreen" -msgstr "" +msgstr "Перемкнути повний екран" #: src/osd/modules/input/input_windows.cpp:117 msgctxt "input-name" msgid "Take Rendered Snapshot" -msgstr "" +msgstr "Узяти опрацьований кадр" #: src/osd/modules/input/input_windows.cpp:128 #: src/osd/modules/input/input_sdlcommon.cpp:223 msgctxt "input-name" msgid "Record Rendered Video" -msgstr "" +msgstr "Записати опрацьоване відео" #: src/osd/modules/input/input_windows.cpp:144 msgctxt "input-name" msgid "Toggle Post-Processing" -msgstr "" +msgstr "Перемкнути постопрацювання" #: src/osd/modules/input/input_sdlcommon.cpp:201 msgctxt "input-name" msgid "Toggle Filter" -msgstr "" +msgstr "Перемкнути фільтр" #: src/osd/modules/input/input_sdlcommon.cpp:207 msgctxt "input-name" msgid "Decrease Prescaling" -msgstr "" +msgstr "Зменшити попереднє масштабування" #: src/osd/modules/input/input_sdlcommon.cpp:217 msgctxt "input-name" msgid "Increase Prescaling" -msgstr "" +msgstr "Збільшити попереднє масштабування" #: plugins/hiscore/init.lua:85 msgctxt "plugin-hiscore" msgid "When updated" -msgstr "" +msgstr "При оновленні" #: plugins/hiscore/init.lua:85 msgctxt "plugin-hiscore" msgid "On exit" -msgstr "" +msgstr "При виході" #: plugins/hiscore/init.lua:86 msgctxt "plugin-hiscore" msgid "Hiscore Support Options" -msgstr "" +msgstr "Опції підтримки рекордів" #: plugins/hiscore/init.lua:88 msgctxt "plugin-hiscore" msgid "Save scores" -msgstr "" +msgstr "Зберегти рекорди" #: plugins/hiscore/init.lua:372 msgctxt "plugin-hiscore" msgid "Hiscore Support" -msgstr "" +msgstr "Підтримка рекордів" #: plugins/cheatfind/init.lua:387 msgid "Other: " -msgstr "" +msgstr "Інше: " #: plugins/cheatfind/init.lua:388 msgid "Save Cheat" -msgstr "" +msgstr "Зберегти чіт" #: plugins/cheatfind/init.lua:391 msgid "Default" -msgstr "" +msgstr "Типово" #: plugins/cheatfind/init.lua:391 msgid "Custom" -msgstr "" +msgstr "Указаний" #: plugins/cheatfind/init.lua:392 msgid "Cheat Name" -msgstr "" +msgstr "Ім'я чіту" #: plugins/cheatfind/init.lua:398 plugins/cheatfind/init.lua:977 #, lua-format msgid "Default name is %s" -msgstr "" +msgstr "Типове ім'я: %s." #: plugins/cheatfind/init.lua:406 msgid "Player" -msgstr "" +msgstr "Гравець" #: plugins/cheatfind/init.lua:411 msgid "Type" -msgstr "" +msgstr "Тип" #: plugins/cheatfind/init.lua:411 msgid "(empty)" -msgstr "" +msgstr "(порожньо)" #: plugins/cheatfind/init.lua:427 msgid "You can enter any type name" -msgstr "" +msgstr "Можна вказати будь-який тип імені." #: plugins/cheatfind/init.lua:436 msgid "Save" -msgstr "" +msgstr "Зберегти" #: plugins/cheatfind/init.lua:444 msgid "Type name is empty" -msgstr "" +msgstr "Порожній тип імені." #: plugins/cheatfind/init.lua:468 #, lua-format msgid "Cheat written to %s and added to cheat.simple" -msgstr "" +msgstr "Чіт записано до %s та додано до cheat.simple." #: plugins/cheatfind/init.lua:478 msgid "Cheat added to cheat.simple" -msgstr "" +msgstr "Чіт додано до cheat.simple." #: plugins/cheatfind/init.lua:483 msgid "" "Unable to write file\n" "Ensure that cheatpath folder exists" msgstr "" +"Неможливо записати файл.\n" +"Переконайсь у наявності теки cheatpath." #: plugins/cheatfind/init.lua:497 msgid "CPU or RAM" -msgstr "" +msgstr "CPU чи RAM" #: plugins/cheatfind/init.lua:501 msgid "Changes to this only take effect when \"Start new search\" is selected" -msgstr "" +msgstr "Зміни відбудуться лише при виборі \"Почати новий пошук\"." #: plugins/cheatfind/init.lua:511 msgid "Automatic" -msgstr "" +msgstr "Автоматично" #: plugins/cheatfind/init.lua:511 msgid "Manual" -msgstr "" +msgstr "Власноруч" #: plugins/cheatfind/init.lua:512 msgid "Pause Mode" -msgstr "" +msgstr "Режим призупинення" #: plugins/cheatfind/init.lua:519 msgid "Manually toggle pause when needed" -msgstr "" +msgstr "За необхідності власноруч перемикай призупинення." #: plugins/cheatfind/init.lua:522 msgid "Automatically toggle pause with on-screen menus" -msgstr "" +msgstr "Автоматично перемикати призупинення екранними меню" #: plugins/cheatfind/init.lua:543 msgid "All slots cleared and current state saved to Slot 1" @@ -5304,7 +5398,7 @@ #: plugins/cheatfind/init.lua:555 msgid "Start new search" -msgstr "" +msgstr "Розпочати новий пошук" #: plugins/cheatfind/init.lua:566 #, lua-format @@ -5319,7 +5413,7 @@ #: plugins/cheatfind/init.lua:614 #, lua-format msgid "%d total matches found" -msgstr "" +msgstr "Загалом знайдено %d збігів." #: plugins/cheatfind/init.lua:623 #, lua-format @@ -5348,59 +5442,59 @@ #: plugins/cheatfind/init.lua:678 msgid "Left less than right" -msgstr "" +msgstr "Ліворуч менше, ніж праворуч" #: plugins/cheatfind/init.lua:680 msgid "Left greater than right" -msgstr "" +msgstr "Ліворуч більше, ніж праворуч" #: plugins/cheatfind/init.lua:682 msgid "Left equal to right" -msgstr "" +msgstr "Ліворуч рівне праворуч" #: plugins/cheatfind/init.lua:684 msgid "Left not equal to right" -msgstr "" +msgstr "Ліворуч не рівне праворуч" #: plugins/cheatfind/init.lua:686 msgid "Left equal to right with bitmask" -msgstr "" +msgstr "Ліворуч рівне праворуч за бітмаскою" #: plugins/cheatfind/init.lua:688 msgid "Left not equal to right with bitmask" -msgstr "" +msgstr "Ліворуч не рівне праворуч за бітмаскою" #: plugins/cheatfind/init.lua:690 msgid "Left less than value" -msgstr "" +msgstr "Ліворуч менше, ніж значення" #: plugins/cheatfind/init.lua:692 msgid "Left greater than value" -msgstr "" +msgstr "Ліворуч більше, ніж значення" #: plugins/cheatfind/init.lua:694 msgid "Left equal to value" -msgstr "" +msgstr "Ліворуч рівне значенню" #: plugins/cheatfind/init.lua:696 msgid "Left not equal to value" -msgstr "" +msgstr "Ліворуч не рівне значенню" #: plugins/cheatfind/init.lua:718 msgid "Value" -msgstr "" +msgstr "Значення" #: plugins/cheatfind/init.lua:720 msgid "Difference" -msgstr "" +msgstr "Різниця" #: plugins/cheatfind/init.lua:725 msgid "Any" -msgstr "" +msgstr "Будь-який" #: plugins/cheatfind/init.lua:731 msgid "Data Format" -msgstr "" +msgstr "Формат даних" #: plugins/cheatfind/init.lua:737 msgid "Slot 1 Value" @@ -5412,12 +5506,12 @@ #: plugins/cheatfind/init.lua:740 msgid "Test/Write Poke Value" -msgstr "" +msgstr "Тестувати / Записати отримане значення" #: plugins/cheatfind/init.lua:747 msgid "" -"Use this if you want to poke the Slot 1 value (eg. You started with " -"something but lost it)" +"Use this if you want to poke the Slot 1 value (eg. You started with something " +"but lost it)" msgstr "" #: plugins/cheatfind/init.lua:749 @@ -5429,226 +5523,224 @@ #: plugins/cheatfind/init.lua:751 #, lua-format msgid "Use this if you want to poke %s" -msgstr "" +msgstr "Використовуй для отримання %s." #: plugins/cheatfind/init.lua:774 msgid "Aligned only" -msgstr "" +msgstr "Лише вирівняні" #: plugins/cheatfind/init.lua:791 msgid "Undo last search -- #" -msgstr "" +msgstr "Скасувати останній пошук -- #" #: plugins/cheatfind/init.lua:795 msgid "Match block" -msgstr "" +msgstr "Збіжний блок" #: plugins/cheatfind/init.lua:798 msgid "All" -msgstr "" +msgstr "Усі" #: plugins/cheatfind/init.lua:907 #, lua-format msgid "Test Cheat %08X_%02X" -msgstr "" +msgstr "Тестувати чіт %08X_%02X" #: plugins/cheatfind/init.lua:947 msgid "Cheat engine not available" -msgstr "" +msgstr "Чіт-рушій недоступний." #: plugins/cheatfind/init.lua:1003 msgid "Test" -msgstr "" +msgstr "Тестувати" #: plugins/cheatfind/init.lua:1003 msgid "Write" -msgstr "" +msgstr "Записати" #: plugins/cheatfind/init.lua:1003 msgid "Watch" -msgstr "" +msgstr "Переглянути" #: plugins/cheatfind/init.lua:1020 msgid "Page" -msgstr "" +msgstr "Сторінка" #: plugins/cheatfind/init.lua:1039 msgid "Clear Watches" -msgstr "" +msgstr "Очистити перегляд" #: plugins/cheatfind/init.lua:1054 msgid "Cheat Finder" -msgstr "" +msgstr "Шукач чітів" #: plugins/portname/init.lua:103 msgid "Save input names to file" -msgstr "" +msgstr "Зберегти імена керувань до файлу" #: plugins/portname/init.lua:134 plugins/portname/init.lua:139 #: plugins/portname/init.lua:155 msgid "Failed to save input name file" -msgstr "" +msgstr "Не вдалося зберегти імена керувань." #: plugins/portname/init.lua:167 #, lua-format msgid "Input port name file saved to %s" -msgstr "" +msgstr "Імена портів керування збережено до %s." #: plugins/portname/init.lua:172 msgid "Input ports" -msgstr "" +msgstr "Порти керування" #: plugins/autofire/init.lua:94 msgctxt "plugin-autofire" msgid "Failed to load autofire menu" -msgstr "" +msgstr "Не вдалося завантажити меню турборежиму." #: plugins/autofire/init.lua:101 msgctxt "plugin-autofire" msgid "Autofire" -msgstr "" +msgstr "Турборежим" #: plugins/autofire/autofire_menu.lua:74 msgctxt "plugin-autofire" msgid "Autofire buttons" -msgstr "" +msgstr "Турбокнопки" #: plugins/autofire/autofire_menu.lua:75 #, lua-format msgctxt "plugin-autofire" msgid "Press %s to delete" -msgstr "" +msgstr "Натисни %s для видалення." #: plugins/autofire/autofire_menu.lua:93 #, lua-format msgctxt "plugin-autofire" msgid "%s [%g Hz]" -msgstr "" +msgstr "%s [%g Гц]" #: plugins/autofire/autofire_menu.lua:95 #, lua-format msgctxt "plugin-autofire" msgid "n/a [%g Hz]" -msgstr "" +msgstr "Не доступно [%g Гц]" #: plugins/autofire/autofire_menu.lua:103 msgctxt "plugin-autofire" msgid "[no autofire buttons]" -msgstr "" +msgstr "[відсутні турбокнопки]" -#: plugins/autofire/autofire_menu.lua:109 -#: plugins/autofire/autofire_menu.lua:263 +#: plugins/autofire/autofire_menu.lua:109 plugins/autofire/autofire_menu.lua:263 msgctxt "plugin-autofire" msgid "Add autofire button" -msgstr "" +msgstr "Додати турбокнопку" #: plugins/autofire/autofire_menu.lua:150 msgctxt "plugin-autofire" msgid "n/a" -msgstr "" +msgstr "Не доступно" -#: plugins/autofire/autofire_menu.lua:152 -#: plugins/autofire/autofire_menu.lua:154 +#: plugins/autofire/autofire_menu.lua:152 plugins/autofire/autofire_menu.lua:154 msgctxt "plugin-autofire" msgid "[not set]" -msgstr "" +msgstr "[не встановлено]" #: plugins/autofire/autofire_menu.lua:155 msgctxt "plugin-autofire" msgid "Input" -msgstr "" +msgstr "Керування" #: plugins/autofire/autofire_menu.lua:159 msgctxt "plugin-autofire" msgid "Hotkey" -msgstr "" +msgstr "Гаряча кнопка" #: plugins/autofire/autofire_menu.lua:160 msgctxt "plugin-autofire" msgid "On frames" -msgstr "" +msgstr "Кадри увімкнення" #: plugins/autofire/autofire_menu.lua:161 msgctxt "plugin-autofire" msgid "Off frames" -msgstr "" +msgstr "Кадри вимкнення" #: plugins/autofire/autofire_menu.lua:200 msgctxt "plugin-autofire" msgid "Number of frames button will be pressed" -msgstr "" +msgstr "Кількість кадрів для натисненої кнопки" #: plugins/autofire/autofire_menu.lua:213 msgctxt "plugin-autofire" msgid "Number of frames button will be released" -msgstr "" +msgstr "Кількість кадрів для натисненої кнопки" #: plugins/autofire/autofire_menu.lua:230 msgctxt "plugin-autofire" msgid "Edit autofire button" -msgstr "" +msgstr "Редагувати турбокнопку" #: plugins/autofire/autofire_menu.lua:238 msgctxt "plugin-autofire" msgid "Done" -msgstr "" +msgstr "Виконано" #: plugins/autofire/autofire_menu.lua:272 msgctxt "plugin-autofire" msgid "Create" -msgstr "" +msgstr "Створити" #: plugins/autofire/autofire_menu.lua:274 msgctxt "plugin-autofire" msgid "Cancel" -msgstr "" +msgstr "Скасувати" #: plugins/autofire/autofire_menu.lua:325 msgctxt "plugin-autofire" msgid "Select an input for autofire" -msgstr "" +msgstr "Вибери керування для турборежиму." #: plugins/timecode/init.lua:155 #, lua-format msgctxt "plugin-timecode" msgid "TIMECODE: Intro started at %s" -msgstr "" +msgstr "TIMECODE: Вступ розпочато на %s." #: plugins/timecode/init.lua:160 #, lua-format msgctxt "plugin-timecode" msgid "TIMECODE: Intro duration %s" -msgstr "" +msgstr "TIMECODE: Тривалість вступу %s." #: plugins/timecode/init.lua:165 #, lua-format msgctxt "plugin-timecode" msgid "TIMECODE: Gameplay started at %s" -msgstr "" +msgstr "TIMECODE: Ігровий процес розпочато на %s." #: plugins/timecode/init.lua:170 #, lua-format msgctxt "plugin-timecode" msgid "TIMECODE: Gameplay duration %s" -msgstr "" +msgstr "TIMECODE: Тривалість ігрового процесу %s." #: plugins/timecode/init.lua:176 #, lua-format msgctxt "plugin-timecode" msgid "TIMECODE: Extra %d started at %s" -msgstr "" +msgstr "TIMECODE: Додаток %d розпочато на %s." #: plugins/timecode/init.lua:182 #, lua-format msgctxt "plugin-timecode" msgid "TIMECODE: Extra %d duration %s" -msgstr "" +msgstr "TIMECODE: Тривалість додатку %d %s." #: plugins/timecode/init.lua:207 #, lua-format msgctxt "plugin-timecode" msgid " %s%s%02d:%02d [paused] " -msgstr "" +msgstr " %s%s%02d:%02d [призупинено] " #: plugins/timecode/init.lua:207 #, lua-format @@ -5660,189 +5752,189 @@ #, lua-format msgctxt "plugin-timecode" msgid "TOTAL %02d:%02d " -msgstr "" +msgstr "Загалом %02d:%02d " #: plugins/timecode/init.lua:323 plugins/timecode/init.lua:345 msgctxt "plugin-timecode" msgid "Timecode Recorder" -msgstr "" +msgstr "Записувач часових кодів" #: plugins/timecode/init.lua:326 msgctxt "plugin-timecode" msgid "Assume 60 Hz" -msgstr "" +msgstr "Припустимо 60 Гц" #: plugins/timecode/init.lua:326 msgctxt "plugins-timecode" msgid "Count emulated frames" -msgstr "" +msgstr "Кількість емульованих кадрів" #: plugins/timecode/init.lua:327 msgctxt "plugin-timecode" msgid "Frame numbers" -msgstr "" +msgstr "Числа кадрів" #: plugins/timecode/init.lua:330 msgctxt "plugin-timecode" msgid "Hotkey" -msgstr "" +msgstr "Гаряча кнопка" #: plugins/inputmacro/init.lua:135 plugins/inputmacro/inputmacro_menu.lua:560 msgctxt "plugin-inputmacro" msgid "Input Macros" -msgstr "" +msgstr "Макрос керування" #: plugins/inputmacro/inputmacro_menu.lua:31 msgctxt "plugin-inputmacro" msgid "New macro" -msgstr "" +msgstr "Новий макрос" #: plugins/inputmacro/inputmacro_menu.lua:35 #, lua-format msgctxt "plugin-inputmacro" msgid "New macro %d" -msgstr "" +msgstr "Новий макрос %d" #: plugins/inputmacro/inputmacro_menu.lua:84 msgctxt "plugin-inputmacro" msgid "Set Input" -msgstr "" +msgstr "Встановити керування" #: plugins/inputmacro/inputmacro_menu.lua:350 msgctxt "plugin-inputmacro" msgid "Name" -msgstr "" +msgstr "Ім'я" #: plugins/inputmacro/inputmacro_menu.lua:358 #: plugins/inputmacro/inputmacro_menu.lua:400 msgctxt "plugin-inputmacro" msgid "[not set]" -msgstr "" +msgstr "[не встановлено]" #: plugins/inputmacro/inputmacro_menu.lua:359 msgctxt "plugin-inputmacro" msgid "Activation sequence" -msgstr "" +msgstr "Послідовність активації" #: plugins/inputmacro/inputmacro_menu.lua:362 msgctxt "plugin-inputmacro" msgid "Stop immediately" -msgstr "" +msgstr "Зупинити негайно" #: plugins/inputmacro/inputmacro_menu.lua:362 msgctxt "plugin-inputmacro" msgid "Complete macro" -msgstr "" +msgstr "Завершити макрос" #: plugins/inputmacro/inputmacro_menu.lua:363 msgctxt "plugin-inputmacro" msgid "On release" -msgstr "" +msgstr "При випуску" #: plugins/inputmacro/inputmacro_menu.lua:369 msgctxt "plugin-inputmacro" msgid "Release" -msgstr "" +msgstr "Випуск" #: plugins/inputmacro/inputmacro_menu.lua:372 #, lua-format msgctxt "plugin-inputmacro" msgid "Loop to step %d" -msgstr "" +msgstr "Повторити до кроку %d" #: plugins/inputmacro/inputmacro_menu.lua:377 #, lua-format msgctxt "plugin-inputmacro" msgid "Prolong step %d" -msgstr "" +msgstr "Повторити лише крок %d" #: plugins/inputmacro/inputmacro_menu.lua:379 msgctxt "plugin-inputmacro" msgid "When held" -msgstr "" +msgstr "При проведенні" #: plugins/inputmacro/inputmacro_menu.lua:383 #, lua-format msgctxt "plugin-inputmacro" msgid "Step %d" -msgstr "" +msgstr "Крок %d" #: plugins/inputmacro/inputmacro_menu.lua:384 msgctxt "plugin-inputmacro" msgid "Delay (frames)" -msgstr "" +msgstr "Затримка (кадрів)" #: plugins/inputmacro/inputmacro_menu.lua:390 msgctxt "plugin-inputmacro" msgid "Duration (frames)" -msgstr "" +msgstr "Тривалість (кадрів)" #: plugins/inputmacro/inputmacro_menu.lua:398 msgctxt "plugin-inputmacro" msgid "n/a" -msgstr "" +msgstr "не доступно" #: plugins/inputmacro/inputmacro_menu.lua:402 #, lua-format msgctxt "plugin-inputmacro" msgid "Input %d" -msgstr "" +msgstr "Керування %d" #: plugins/inputmacro/inputmacro_menu.lua:407 msgctxt "plugin-inputmacro" msgid "Add input" -msgstr "" +msgstr "Додати керування" #: plugins/inputmacro/inputmacro_menu.lua:412 msgctxt "plugin-inputmacro" msgid "Delete step" -msgstr "" +msgstr "Видалити крок" #: plugins/inputmacro/inputmacro_menu.lua:428 msgctxt "plugin-inputmacro" msgid "Add step at position" -msgstr "" +msgstr "Додати крок на позицію" #: plugins/inputmacro/inputmacro_menu.lua:474 msgctxt "plugin-inputmacro" msgid "Add Input Macro" -msgstr "" +msgstr "Додати макрос керування" #: plugins/inputmacro/inputmacro_menu.lua:481 msgctxt "plugin-inputmacro" msgid "Create" -msgstr "" +msgstr "Створити" #: plugins/inputmacro/inputmacro_menu.lua:483 msgctxt "plugin-inputmacro" msgid "Cancel" -msgstr "" +msgstr "Скасувати" #: plugins/inputmacro/inputmacro_menu.lua:499 msgctxt "plugin-inputmacro" msgid "Edit Input Macro" -msgstr "" +msgstr "Редагувати макрос керування" #: plugins/inputmacro/inputmacro_menu.lua:505 msgctxt "plugin-inputmacro" msgid "Done" -msgstr "" +msgstr "Виконано" #: plugins/inputmacro/inputmacro_menu.lua:561 #, lua-format msgctxt "plugin-inputmacro" msgid "Press %s to delete" -msgstr "" +msgstr "Натисни %s для видалення" #: plugins/inputmacro/inputmacro_menu.lua:573 msgctxt "plugin-inputmacro" msgid "[no macros]" -msgstr "" +msgstr "(без макросів)" #: plugins/inputmacro/inputmacro_menu.lua:578 msgctxt "plugin-inputmacro" msgid "Add macro" -msgstr "" +msgstr "Додати макрос" #: plugins/timer/init.lua:27 #, lua-format @@ -5853,122 +5945,122 @@ #: plugins/timer/init.lua:32 msgctxt "plugin-timer" msgid "Wall clock" -msgstr "" +msgstr "Системний час" #: plugins/timer/init.lua:32 msgctxt "plugin-timer" msgid "Emulated time" -msgstr "" +msgstr "Емульований час" #: plugins/timer/init.lua:37 msgctxt "plugin-timer" msgid "Reference" -msgstr "" +msgstr "Посилання" #: plugins/timer/init.lua:39 msgctxt "plugin-timer" msgid "Current time" -msgstr "" +msgstr "Поточний час" #: plugins/timer/init.lua:40 msgctxt "plugin-timer" msgid "Total time" -msgstr "" +msgstr "Загальний час" #: plugins/timer/init.lua:41 msgctxt "plugin-timer" msgid "Play Count" -msgstr "" +msgstr "Кількість ігор" #: plugins/timer/init.lua:73 msgctxt "plugin-timer" msgid "Timer" -msgstr "" +msgstr "Таймер" #: plugins/cheat/init.lua:611 msgid "Select cheat to set hotkey" -msgstr "" +msgstr "Вибери чіт для встановлення гарячої кнопки." #: plugins/cheat/init.lua:612 #, lua-format msgid "Press %s to clear hotkey" -msgstr "" +msgstr "Натисни %s для очищення гарячої кнопки." #: plugins/cheat/init.lua:640 msgid "None" -msgstr "" +msgstr "Не вказано" #: plugins/cheat/init.lua:646 msgid "Done" -msgstr "" +msgstr "Виконано" #: plugins/cheat/init.lua:664 plugins/cheat/init.lua:678 msgid "Set" -msgstr "" +msgstr "Встановити" #: plugins/cheat/init.lua:697 msgid "Set hotkeys" -msgstr "" +msgstr "Встановити гарячі кнопки" #: plugins/cheat/init.lua:785 #, lua-format msgid "Activated: %s = %s" -msgstr "" +msgstr "Активовано: %s = %s." #: plugins/cheat/init.lua:787 plugins/cheat/init.lua:845 #, lua-format msgid "Activated: %s" -msgstr "" +msgstr "Активовано: %s." #: plugins/cheat/init.lua:849 #, lua-format msgid "Enabled: %s" -msgstr "" +msgstr "Увімкнено: %s." #: plugins/cheat/init.lua:854 #, lua-format msgid "Disabled: %s" -msgstr "" +msgstr "Вимкнено: %s." #: plugins/cheat/init.lua:913 #, lua-format msgid "%s added" -msgstr "" +msgstr "%s додано." #: plugins/data/data_command.lua:22 msgctxt "plugin-data" msgid "Command" -msgstr "" +msgstr "Команда" #: plugins/data/data_story.lua:22 msgctxt "plugin-data" msgid "Mamescore" -msgstr "" +msgstr "MAME-пункти" #: plugins/data/data_sysinfo.lua:15 msgctxt "plugin-data" msgid "Sysinfo" -msgstr "" +msgstr "Системні відомості" #: plugins/data/data_hiscore.lua:1220 plugins/data/data_hiscore.lua:1268 msgctxt "plugin-data" msgid "High Scores" -msgstr "" +msgstr "Рекорди" #: plugins/data/data_marp.lua:136 msgctxt "plugin-data" msgid "MARPScore" -msgstr "" +msgstr "MARP-пункти" #: plugins/data/data_gameinit.lua:16 msgctxt "plugin-data" msgid "Gameinit" -msgstr "" +msgstr "Початок гри" #: plugins/data/data_history.lua:172 msgctxt "plugin-data" msgid "History" -msgstr "" +msgstr "Історія" #: plugins/data/data_messinfo.lua:19 plugins/data/data_mameinfo.lua:18 msgctxt "plugin-data" @@ -5978,16 +6070,20 @@ "--- DRIVER INFO ---\n" "Driver: " msgstr "" +"\n" +"\n" +"--- Відомості драйвера ---\n" +"Драйвер: " #: plugins/data/data_messinfo.lua:21 msgctxt "plugin-data" msgid "MESSinfo" -msgstr "" +msgstr "MESS-відомості" #: plugins/data/data_mameinfo.lua:20 msgctxt "plugin-data" msgid "MAMEinfo" -msgstr "" +msgstr "MAME-відомості" #: plugins/commonui/init.lua:93 #, lua-format @@ -6004,12 +6100,12 @@ #: plugins/commonui/init.lua:101 msgctxt "plugin-commonui" msgid "Cancel" -msgstr "" +msgstr "Скасувати" #: plugins/commonui/init.lua:197 msgctxt "plugin-commonui" msgid "Invalid sequence entered" -msgstr "" +msgstr "Указано недійсну послідовність." #: plugins/commonui/init.lua:203 #, lua-format @@ -6018,3 +6114,5 @@ "Enter sequence or press %s to cancel\n" "%s" msgstr "" +"Укажи послідовність або натисни %s для скасування.\n" +"%s" diff -Nru mame-0.242+dfsg.1/makefile mame-0.243+dfsg.1/makefile --- mame-0.242+dfsg.1/makefile 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/makefile 2022-04-29 05:37:26.000000000 +0000 @@ -1546,7 +1546,7 @@ ifeq (posix,$(SHELLTYPE)) $(GENDIR)/version.cpp: makefile $(GENDIR)/git_desc | $(GEN_FOLDERS) - @echo '#define BARE_BUILD_VERSION "0.242"' > $@ + @echo '#define BARE_BUILD_VERSION "0.243"' > $@ @echo '#define BARE_VCS_REVISION "$(NEW_GIT_VERSION)"' >> $@ @echo 'extern const char bare_build_version[];' >> $@ @echo 'extern const char bare_vcs_revision[];' >> $@ @@ -1556,7 +1556,7 @@ @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.242" > $@ + @echo #define BARE_BUILD_VERSION "0.243" > $@ @echo #define BARE_VCS_REVISION "$(NEW_GIT_VERSION)" >> $@ @echo extern const char bare_build_version[]; >> $@ @echo extern const char bare_vcs_revision[]; >> $@ diff -Nru mame-0.242+dfsg.1/scripts/genie.lua mame-0.243+dfsg.1/scripts/genie.lua --- mame-0.242+dfsg.1/scripts/genie.lua 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/scripts/genie.lua 2022-04-29 05:37:26.000000000 +0000 @@ -92,7 +92,6 @@ if _OPTIONS["gcc"]~=nil and string.find(_OPTIONS["gcc"], "gcc") then buildoptions_cpp { "-Wsuggest-override", - "-flifetime-dse=1", } end end @@ -1032,7 +1031,7 @@ local version = str_to_version(_OPTIONS["gcc_version"]) if string.find(_OPTIONS["gcc"], "clang") or string.find(_OPTIONS["gcc"], "asmjs") or string.find(_OPTIONS["gcc"], "android") then - if (version < 60000) then + if version < 60000 then print("Clang version 6.0 or later needed") os.exit(-1) end @@ -1061,23 +1060,28 @@ } end else - if (version < 70000) then + if version < 70000 then print("GCC version 7.0 or later needed") os.exit(-1) end + buildoptions_cpp { + "-Wimplicit-fallthrough", + } + buildoptions_objcpp { + "-Wimplicit-fallthrough", + } + buildoptions { + "-Wno-unused-result", -- needed for fgets,fread on linux + -- array bounds checking seems to be buggy in 4.8.1 (try it on video/stvvdp1.c and video/model1.c without -Wno-array-bounds) + "-Wno-array-bounds", + "-Wno-error=attributes", -- GCC fails to recognize some uses of [[maybe_unused]] + } + if version < 100000 then buildoptions_cpp { - "-Wimplicit-fallthrough", + "-flifetime-dse=1", -- GCC 9 takes issue with Sol's get >() otherwise } - buildoptions_objcpp { - "-Wimplicit-fallthrough", - } - buildoptions { - "-Wno-unused-result", -- needed for fgets,fread on linux - -- array bounds checking seems to be buggy in 4.8.1 (try it on video/stvvdp1.c and video/model1.c without -Wno-array-bounds) - "-Wno-array-bounds", - "-Wno-error=attributes", -- GCC fails to recognize some uses of [[maybe_unused]] - } - if (version >= 80000) then + end + if version >= 80000 then buildoptions { "-Wno-stringop-truncation", -- ImGui again "-Wno-stringop-overflow", -- formats/victor9k_dsk.cpp bugs the compiler @@ -1086,7 +1090,7 @@ "-Wno-class-memaccess", -- many instances in ImGui and BGFX } end - if (version >= 110000) then + if version >= 110000 then buildoptions { "-Wno-nonnull", -- luaengine.cpp lambdas do not need "this" captured but GCC 11.1 erroneously insists "-Wno-stringop-overread", -- machine/bbc.cpp in GCC 11.1 @@ -1218,7 +1222,7 @@ "-Wno-asm-operand-widths", } -configuration { "linux-*"} +configuration { "linux-*" } links { "dl", "rt", diff -Nru mame-0.242+dfsg.1/scripts/src/bus.lua mame-0.243+dfsg.1/scripts/src/bus.lua --- mame-0.242+dfsg.1/scripts/src/bus.lua 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/scripts/src/bus.lua 2022-04-29 05:37:26.000000000 +0000 @@ -2406,6 +2406,8 @@ MAME_DIR .. "src/devices/bus/vme/vme_fcscsi.h", MAME_DIR .. "src/devices/bus/vme/vme_hcpu30.cpp", MAME_DIR .. "src/devices/bus/vme/vme_hcpu30.h", + MAME_DIR .. "src/devices/bus/vme/vme_smvme2000.cpp", + MAME_DIR .. "src/devices/bus/vme/vme_smvme2000.h", } end @@ -4667,6 +4669,8 @@ MAME_DIR .. "src/devices/bus/multibus/multibus.h", MAME_DIR .. "src/devices/bus/multibus/isbc202.cpp", MAME_DIR .. "src/devices/bus/multibus/isbc202.h", + MAME_DIR .. "src/devices/bus/multibus/isbc8024.cpp", + MAME_DIR .. "src/devices/bus/multibus/isbc8024.h", MAME_DIR .. "src/devices/bus/multibus/cpuap.cpp", MAME_DIR .. "src/devices/bus/multibus/cpuap.h", MAME_DIR .. "src/devices/bus/multibus/serad.cpp", @@ -4809,3 +4813,23 @@ MAME_DIR .. "src/devices/bus/pce_ctrl/multitap.h", } end + +--------------------------------------------------- +-- +--@src/devices/bus/pc8801/pc8801_31.h,BUSES["PC8801"] = true +--------------------------------------------------- + +if (BUSES["PC8801"]~=null) then + files { + MAME_DIR .. "src/devices/bus/pc8801/pc8801_23.cpp", + MAME_DIR .. "src/devices/bus/pc8801/pc8801_23.h", + MAME_DIR .. "src/devices/bus/pc8801/pc8801_31.cpp", + MAME_DIR .. "src/devices/bus/pc8801/pc8801_31.h", + MAME_DIR .. "src/devices/bus/pc8801/pc8801_exp.cpp", + MAME_DIR .. "src/devices/bus/pc8801/pc8801_exp.h", + MAME_DIR .. "src/devices/bus/pc8801/pcg8100.cpp", + MAME_DIR .. "src/devices/bus/pc8801/pcg8100.h", + MAME_DIR .. "src/devices/bus/pc8801/jmbx1.cpp", + MAME_DIR .. "src/devices/bus/pc8801/jmbx1.h", + } +end diff -Nru mame-0.242+dfsg.1/scripts/src/cpu.lua mame-0.243+dfsg.1/scripts/src/cpu.lua --- mame-0.242+dfsg.1/scripts/src/cpu.lua 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/scripts/src/cpu.lua 2022-04-29 05:37:26.000000000 +0000 @@ -2853,29 +2853,41 @@ end -------------------------------------------------- --- Rockwell B5000 family ---@src/devices/cpu/b5000/b5000.h,CPUS["B5000"] = true ---@src/devices/cpu/b5000/b6000.h,CPUS["B5000"] = true ---@src/devices/cpu/b5000/b6100.h,CPUS["B5000"] = true +-- Rockwell A/B5000 family +--@src/devices/cpu/rw5000/a5000.h,CPUS["RW5000"] = true +--@src/devices/cpu/rw5000/a5500.h,CPUS["RW5000"] = true +--@src/devices/cpu/rw5000/a5900.h,CPUS["RW5000"] = true +--@src/devices/cpu/rw5000/b5000.h,CPUS["RW5000"] = true +--@src/devices/cpu/rw5000/b5500.h,CPUS["RW5000"] = true +--@src/devices/cpu/rw5000/b6000.h,CPUS["RW5000"] = true +--@src/devices/cpu/rw5000/b6100.h,CPUS["RW5000"] = true -------------------------------------------------- -if CPUS["B5000"] then +if CPUS["RW5000"] then files { - MAME_DIR .. "src/devices/cpu/b5000/b5000base.cpp", - MAME_DIR .. "src/devices/cpu/b5000/b5000base.h", - MAME_DIR .. "src/devices/cpu/b5000/b5000.cpp", - MAME_DIR .. "src/devices/cpu/b5000/b5000.h", - MAME_DIR .. "src/devices/cpu/b5000/b5000op.cpp", - MAME_DIR .. "src/devices/cpu/b5000/b6000.cpp", - MAME_DIR .. "src/devices/cpu/b5000/b6000.h", - MAME_DIR .. "src/devices/cpu/b5000/b6100.cpp", - MAME_DIR .. "src/devices/cpu/b5000/b6100.h", + MAME_DIR .. "src/devices/cpu/rw5000/rw5000base.cpp", + MAME_DIR .. "src/devices/cpu/rw5000/rw5000base.h", + MAME_DIR .. "src/devices/cpu/rw5000/b5000.cpp", + MAME_DIR .. "src/devices/cpu/rw5000/b5000.h", + MAME_DIR .. "src/devices/cpu/rw5000/b5000op.cpp", + MAME_DIR .. "src/devices/cpu/rw5000/b5500.cpp", + MAME_DIR .. "src/devices/cpu/rw5000/b5500.h", + MAME_DIR .. "src/devices/cpu/rw5000/b6000.cpp", + MAME_DIR .. "src/devices/cpu/rw5000/b6000.h", + MAME_DIR .. "src/devices/cpu/rw5000/b6100.cpp", + MAME_DIR .. "src/devices/cpu/rw5000/b6100.h", + MAME_DIR .. "src/devices/cpu/rw5000/a5000.cpp", + MAME_DIR .. "src/devices/cpu/rw5000/a5000.h", + MAME_DIR .. "src/devices/cpu/rw5000/a5500.cpp", + MAME_DIR .. "src/devices/cpu/rw5000/a5500.h", + MAME_DIR .. "src/devices/cpu/rw5000/a5900.cpp", + MAME_DIR .. "src/devices/cpu/rw5000/a5900.h", } end -if opt_tool(CPUS, "B5000") then - table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/b5000/b5000d.cpp") - table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/b5000/b5000d.h") +if opt_tool(CPUS, "RW5000") then + table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/rw5000/rw5000d.cpp") + table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/rw5000/rw5000d.h") end -------------------------------------------------- diff -Nru mame-0.242+dfsg.1/scripts/src/lib.lua mame-0.243+dfsg.1/scripts/src/lib.lua --- mame-0.242+dfsg.1/scripts/src/lib.lua 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/scripts/src/lib.lua 2022-04-29 05:37:26.000000000 +0000 @@ -45,8 +45,6 @@ MAME_DIR .. "src/lib/util/cdrom.h", MAME_DIR .. "src/lib/util/chd.cpp", MAME_DIR .. "src/lib/util/chd.h", - MAME_DIR .. "src/lib/util/chdcd.cpp", - MAME_DIR .. "src/lib/util/chdcd.h", MAME_DIR .. "src/lib/util/chdcodec.cpp", MAME_DIR .. "src/lib/util/chdcodec.h", MAME_DIR .. "src/lib/util/client_http.hpp", diff -Nru mame-0.242+dfsg.1/scripts/target/mame/arcade.lua mame-0.243+dfsg.1/scripts/target/mame/arcade.lua --- mame-0.242+dfsg.1/scripts/target/mame/arcade.lua 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/scripts/target/mame/arcade.lua 2022-04-29 05:37:26.000000000 +0000 @@ -120,7 +120,7 @@ CPUS["HCD62121"] = true CPUS["PPS4"] = true --CPUS["PPS41"] = true ---CPUS["B5000"] = true +--CPUS["RW5000"] = true CPUS["UPD7725"] = true CPUS["HD61700"] = true CPUS["LC8670"] = true @@ -1187,6 +1187,7 @@ MAME_DIR .. "src/mame/includes/badlands.h", MAME_DIR .. "src/mame/machine/badlands.cpp", MAME_DIR .. "src/mame/video/badlands.cpp", + MAME_DIR .. "src/mame/drivers/badlands_ms.cpp", MAME_DIR .. "src/mame/drivers/badlandsbl.cpp", MAME_DIR .. "src/mame/drivers/bartop52.cpp", MAME_DIR .. "src/mame/drivers/batman.cpp", @@ -1531,8 +1532,6 @@ MAME_DIR .. "src/mame/drivers/blktiger.cpp", MAME_DIR .. "src/mame/drivers/blktiger_ms.cpp", MAME_DIR .. "src/mame/drivers/cbasebal.cpp", - MAME_DIR .. "src/mame/includes/cbasebal.h", - MAME_DIR .. "src/mame/video/cbasebal.cpp", MAME_DIR .. "src/mame/drivers/commando.cpp", MAME_DIR .. "src/mame/includes/commando.h", MAME_DIR .. "src/mame/video/commando.cpp", @@ -1556,8 +1555,6 @@ MAME_DIR .. "src/mame/drivers/fcrash.cpp", MAME_DIR .. "src/mame/includes/fcrash.h", MAME_DIR .. "src/mame/drivers/gng.cpp", - MAME_DIR .. "src/mame/includes/gng.h", - MAME_DIR .. "src/mame/video/gng.cpp", MAME_DIR .. "src/mame/drivers/gunsmoke.cpp", MAME_DIR .. "src/mame/includes/gunsmoke.h", MAME_DIR .. "src/mame/video/gunsmoke.cpp", @@ -1788,8 +1785,6 @@ MAME_DIR .. "src/mame/video/metlclsh.cpp", MAME_DIR .. "src/mame/drivers/mirage.cpp", MAME_DIR .. "src/mame/drivers/pcktgal.cpp", - MAME_DIR .. "src/mame/includes/pcktgal.h", - MAME_DIR .. "src/mame/video/pcktgal.cpp", MAME_DIR .. "src/mame/drivers/pktgaldx.cpp", MAME_DIR .. "src/mame/includes/pktgaldx.h", MAME_DIR .. "src/mame/video/pktgaldx.cpp", @@ -2113,13 +2108,14 @@ files { MAME_DIR .. "src/mame/drivers/calchase.cpp", MAME_DIR .. "src/mame/drivers/fruitpc.cpp", + MAME_DIR .. "src/mame/drivers/igspc.cpp", MAME_DIR .. "src/mame/drivers/pangofun.cpp", + MAME_DIR .. "src/mame/drivers/paokaipc.cpp", MAME_DIR .. "src/mame/drivers/pcat_dyn.cpp", MAME_DIR .. "src/mame/drivers/pcat_nit.cpp", MAME_DIR .. "src/mame/drivers/pcxt.cpp", MAME_DIR .. "src/mame/drivers/quakeat.cpp", MAME_DIR .. "src/mame/drivers/queen.cpp", - MAME_DIR .. "src/mame/drivers/igspc.cpp", } createMAMEProjects(_target, _subtarget, "igs") @@ -2234,8 +2230,6 @@ MAME_DIR .. "src/mame/audio/redalert.h", MAME_DIR .. "src/mame/video/redalert.cpp", MAME_DIR .. "src/mame/drivers/shisen.cpp", - MAME_DIR .. "src/mame/includes/shisen.h", - MAME_DIR .. "src/mame/video/shisen.cpp", MAME_DIR .. "src/mame/drivers/travrusa.cpp", MAME_DIR .. "src/mame/includes/travrusa.h", MAME_DIR .. "src/mame/video/travrusa.cpp", @@ -2360,8 +2354,6 @@ MAME_DIR .. "src/mame/drivers/galpanic.cpp", MAME_DIR .. "src/mame/drivers/galpanic_ms.cpp", MAME_DIR .. "src/mame/includes/galpnipt.h", - MAME_DIR .. "src/mame/includes/galpanic.h", - MAME_DIR .. "src/mame/video/galpanic.cpp", MAME_DIR .. "src/mame/drivers/galpani2.cpp", MAME_DIR .. "src/mame/includes/galpani2.h", MAME_DIR .. "src/mame/video/galpani2.cpp", @@ -2406,9 +2398,6 @@ MAME_DIR .. "src/mame/includes/88games.h", MAME_DIR .. "src/mame/video/88games.cpp", MAME_DIR .. "src/mame/drivers/ajax.cpp", - MAME_DIR .. "src/mame/includes/ajax.h", - MAME_DIR .. "src/mame/machine/ajax.cpp", - MAME_DIR .. "src/mame/video/ajax.cpp", MAME_DIR .. "src/mame/drivers/aliens.cpp", MAME_DIR .. "src/mame/includes/aliens.h", MAME_DIR .. "src/mame/video/aliens.cpp", @@ -2426,8 +2415,6 @@ MAME_DIR .. "src/mame/video/bladestl.cpp", MAME_DIR .. "src/mame/drivers/blockhl.cpp", MAME_DIR .. "src/mame/drivers/bottom9.cpp", - MAME_DIR .. "src/mame/includes/bottom9.h", - MAME_DIR .. "src/mame/video/bottom9.cpp", MAME_DIR .. "src/mame/drivers/chqflag.cpp", MAME_DIR .. "src/mame/includes/chqflag.h", MAME_DIR .. "src/mame/video/chqflag.cpp", @@ -2439,8 +2426,6 @@ MAME_DIR .. "src/mame/includes/combatsc.h", MAME_DIR .. "src/mame/video/combatsc.cpp", MAME_DIR .. "src/mame/drivers/contra.cpp", - MAME_DIR .. "src/mame/includes/contra.h", - MAME_DIR .. "src/mame/video/contra.cpp", MAME_DIR .. "src/mame/drivers/crimfght.cpp", MAME_DIR .. "src/mame/includes/crimfght.h", MAME_DIR .. "src/mame/video/crimfght.cpp", @@ -2482,11 +2467,7 @@ MAME_DIR .. "src/mame/includes/gyruss.h", MAME_DIR .. "src/mame/video/gyruss.cpp", MAME_DIR .. "src/mame/drivers/hcastle.cpp", - MAME_DIR .. "src/mame/includes/hcastle.h", - MAME_DIR .. "src/mame/video/hcastle.cpp", MAME_DIR .. "src/mame/drivers/hexion.cpp", - MAME_DIR .. "src/mame/includes/hexion.h", - MAME_DIR .. "src/mame/video/hexion.cpp", MAME_DIR .. "src/mame/drivers/hornet.cpp", MAME_DIR .. "src/mame/machine/konppc.cpp", MAME_DIR .. "src/mame/machine/konppc.h", @@ -2550,8 +2531,6 @@ MAME_DIR .. "src/mame/machine/zs01.cpp", MAME_DIR .. "src/mame/machine/zs01.h", MAME_DIR .. "src/mame/drivers/labyrunr.cpp", - MAME_DIR .. "src/mame/includes/labyrunr.h", - MAME_DIR .. "src/mame/video/labyrunr.cpp", MAME_DIR .. "src/mame/drivers/lethal.cpp", MAME_DIR .. "src/mame/includes/lethal.h", MAME_DIR .. "src/mame/video/lethal.cpp", @@ -2579,8 +2558,6 @@ MAME_DIR .. "src/mame/includes/pandoras.h", MAME_DIR .. "src/mame/video/pandoras.cpp", MAME_DIR .. "src/mame/drivers/parodius.cpp", - MAME_DIR .. "src/mame/includes/parodius.h", - MAME_DIR .. "src/mame/video/parodius.cpp", MAME_DIR .. "src/mame/drivers/pingpong.cpp", MAME_DIR .. "src/mame/includes/pingpong.h", MAME_DIR .. "src/mame/video/pingpong.cpp", @@ -2629,8 +2606,6 @@ MAME_DIR .. "src/mame/includes/spy.h", MAME_DIR .. "src/mame/video/spy.cpp", MAME_DIR .. "src/mame/drivers/surpratk.cpp", - MAME_DIR .. "src/mame/includes/surpratk.h", - MAME_DIR .. "src/mame/video/surpratk.cpp", MAME_DIR .. "src/mame/drivers/tasman.cpp", MAME_DIR .. "src/mame/drivers/tgtpanic.cpp", MAME_DIR .. "src/mame/drivers/thunderx.cpp", @@ -2666,8 +2641,6 @@ MAME_DIR .. "src/mame/includes/ultraman.h", MAME_DIR .. "src/mame/video/ultraman.cpp", MAME_DIR .. "src/mame/drivers/vendetta.cpp", - MAME_DIR .. "src/mame/includes/vendetta.h", - MAME_DIR .. "src/mame/video/vendetta.cpp", MAME_DIR .. "src/mame/drivers/viper.cpp", MAME_DIR .. "src/mame/drivers/wecleman.cpp", MAME_DIR .. "src/mame/includes/wecleman.h", @@ -3026,8 +2999,6 @@ MAME_DIR .. "src/mame/drivers/rbowlorama.cpp", MAME_DIR .. "src/mame/drivers/shootaway2.cpp", MAME_DIR .. "src/mame/drivers/skykid.cpp", - MAME_DIR .. "src/mame/includes/skykid.h", - MAME_DIR .. "src/mame/video/skykid.cpp", MAME_DIR .. "src/mame/drivers/sweetland.cpp", MAME_DIR .. "src/mame/audio/nl_tankbatt.h", MAME_DIR .. "src/mame/audio/nl_tankbatt.cpp", @@ -3087,11 +3058,7 @@ createMAMEProjects(_target, _subtarget, "nasco") files { MAME_DIR .. "src/mame/drivers/crgolf.cpp", - MAME_DIR .. "src/mame/includes/crgolf.h", - MAME_DIR .. "src/mame/video/crgolf.cpp", MAME_DIR .. "src/mame/drivers/himesiki.cpp", - MAME_DIR .. "src/mame/includes/himesiki.h", - MAME_DIR .. "src/mame/video/himesiki.cpp", MAME_DIR .. "src/mame/drivers/suprgolf.cpp", } @@ -3452,8 +3419,6 @@ createMAMEProjects(_target, _subtarget, "sega") files { MAME_DIR .. "src/mame/drivers/angelkds.cpp", - MAME_DIR .. "src/mame/includes/angelkds.h", - MAME_DIR .. "src/mame/video/angelkds.cpp", MAME_DIR .. "src/mame/drivers/bingoc.cpp", MAME_DIR .. "src/mame/drivers/blockade.cpp", MAME_DIR .. "src/mame/drivers/calorie.cpp", @@ -3745,8 +3710,6 @@ MAME_DIR .. "src/mame/video/dynduke.cpp", MAME_DIR .. "src/mame/drivers/feversoc.cpp", MAME_DIR .. "src/mame/drivers/goal92.cpp", - MAME_DIR .. "src/mame/includes/goal92.h", - MAME_DIR .. "src/mame/video/goal92.cpp", MAME_DIR .. "src/mame/drivers/goodejan.cpp", MAME_DIR .. "src/mame/drivers/kncljoe.cpp", MAME_DIR .. "src/mame/includes/kncljoe.h", @@ -3965,8 +3928,6 @@ MAME_DIR .. "src/mame/includes/ikki.h", MAME_DIR .. "src/mame/video/ikki.cpp", MAME_DIR .. "src/mame/drivers/kangaroo.cpp", - MAME_DIR .. "src/mame/includes/kangaroo.h", - MAME_DIR .. "src/mame/video/kangaroo.cpp", MAME_DIR .. "src/mame/drivers/markham.cpp", MAME_DIR .. "src/mame/includes/markham.h", MAME_DIR .. "src/mame/video/markham.cpp", @@ -4006,12 +3967,10 @@ MAME_DIR .. "src/mame/machine/bublbobl.cpp", MAME_DIR .. "src/mame/video/bublbobl.cpp", MAME_DIR .. "src/mame/drivers/buggychl.cpp", - MAME_DIR .. "src/mame/includes/buggychl.h", MAME_DIR .. "src/mame/machine/taito68705interface.cpp", MAME_DIR .. "src/mame/machine/taito68705interface.h", MAME_DIR .. "src/mame/machine/taitosjsec.cpp", MAME_DIR .. "src/mame/machine/taitosjsec.h", - MAME_DIR .. "src/mame/video/buggychl.cpp", MAME_DIR .. "src/mame/drivers/capr1.cpp", MAME_DIR .. "src/mame/drivers/caprcyc.cpp", MAME_DIR .. "src/mame/drivers/cchance.cpp", @@ -4033,8 +3992,6 @@ MAME_DIR .. "src/mame/video/darius.cpp", MAME_DIR .. "src/mame/drivers/dinoking.cpp", MAME_DIR .. "src/mame/drivers/exzisus.cpp", - MAME_DIR .. "src/mame/includes/exzisus.h", - MAME_DIR .. "src/mame/video/exzisus.cpp", MAME_DIR .. "src/mame/drivers/fgoal.cpp", MAME_DIR .. "src/mame/includes/fgoal.h", MAME_DIR .. "src/mame/video/fgoal.cpp", @@ -4068,8 +4025,6 @@ MAME_DIR .. "src/mame/drivers/invqix.cpp", MAME_DIR .. "src/mame/drivers/jollyjgr.cpp", MAME_DIR .. "src/mame/drivers/ksayakyu.cpp", - MAME_DIR .. "src/mame/includes/ksayakyu.h", - MAME_DIR .. "src/mame/video/ksayakyu.cpp", MAME_DIR .. "src/mame/drivers/lgp.cpp", MAME_DIR .. "src/mame/drivers/lkage.cpp", MAME_DIR .. "src/mame/includes/lkage.h", @@ -4315,8 +4270,6 @@ MAME_DIR .. "src/mame/includes/shadfrce.h", MAME_DIR .. "src/mame/video/shadfrce.cpp", MAME_DIR .. "src/mame/drivers/spdodgeb.cpp", - MAME_DIR .. "src/mame/includes/spdodgeb.h", - MAME_DIR .. "src/mame/video/spdodgeb.cpp", MAME_DIR .. "src/mame/drivers/ssozumo.cpp", MAME_DIR .. "src/mame/includes/ssozumo.h", MAME_DIR .. "src/mame/video/ssozumo.cpp", @@ -4363,8 +4316,6 @@ MAME_DIR .. "src/mame/includes/spbactn.h", MAME_DIR .. "src/mame/video/spbactn.cpp", MAME_DIR .. "src/mame/drivers/tbowl.cpp", - MAME_DIR .. "src/mame/includes/tbowl.h", - MAME_DIR .. "src/mame/video/tbowl.cpp", MAME_DIR .. "src/mame/drivers/tecmo.cpp", MAME_DIR .. "src/mame/includes/tecmo.h", MAME_DIR .. "src/mame/video/tecmo.cpp", @@ -4409,6 +4360,7 @@ MAME_DIR .. "src/mame/includes/slapfght.h", MAME_DIR .. "src/mame/machine/slapfght.cpp", MAME_DIR .. "src/mame/video/slapfght.cpp", + MAME_DIR .. "src/mame/drivers/slapfght_ms.cpp", MAME_DIR .. "src/mame/drivers/snowbros.cpp", MAME_DIR .. "src/mame/includes/snowbros.h", MAME_DIR .. "src/mame/video/snowbros.cpp", @@ -4688,7 +4640,6 @@ MAME_DIR .. "src/mame/drivers/s6.cpp", MAME_DIR .. "src/mame/drivers/s7.cpp", MAME_DIR .. "src/mame/drivers/s8.cpp", - MAME_DIR .. "src/mame/drivers/s8a.cpp", MAME_DIR .. "src/mame/drivers/s9.cpp", MAME_DIR .. "src/mame/drivers/sam.cpp", MAME_DIR .. "src/mame/drivers/sleic.cpp", @@ -4877,8 +4828,6 @@ MAME_DIR .. "src/mame/drivers/efdt.cpp", MAME_DIR .. "src/mame/drivers/electra.cpp", MAME_DIR .. "src/mame/drivers/epos.cpp", - MAME_DIR .. "src/mame/includes/epos.h", - MAME_DIR .. "src/mame/video/epos.cpp", MAME_DIR .. "src/mame/drivers/esd16.cpp", MAME_DIR .. "src/mame/includes/esd16.h", MAME_DIR .. "src/mame/video/esd16.cpp", @@ -4967,6 +4916,7 @@ MAME_DIR .. "src/mame/drivers/laserbas.cpp", MAME_DIR .. "src/mame/drivers/laz_aftrshok.cpp", MAME_DIR .. "src/mame/drivers/laz_ribrac.cpp", + MAME_DIR .. "src/mame/drivers/lependu.cpp", MAME_DIR .. "src/mame/drivers/lethalj.cpp", MAME_DIR .. "src/mame/includes/lethalj.h", MAME_DIR .. "src/mame/video/lethalj.cpp", @@ -5099,6 +5049,7 @@ MAME_DIR .. "src/mame/drivers/special_gambl.cpp", MAME_DIR .. "src/mame/audio/special.cpp", MAME_DIR .. "src/mame/audio/special.h", + MAME_DIR .. "src/mame/drivers/spdamjes.cpp", MAME_DIR .. "src/mame/drivers/spool99.cpp", MAME_DIR .. "src/mame/drivers/sprcros2.cpp", MAME_DIR .. "src/mame/drivers/ssingles.cpp", diff -Nru mame-0.242+dfsg.1/scripts/target/mame/mess.lua mame-0.243+dfsg.1/scripts/target/mame/mess.lua --- mame-0.242+dfsg.1/scripts/target/mame/mess.lua 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/scripts/target/mame/mess.lua 2022-04-29 05:37:26.000000000 +0000 @@ -123,7 +123,7 @@ CPUS["HCD62121"] = true CPUS["PPS4"] = true CPUS["PPS41"] = true -CPUS["B5000"] = true +CPUS["RW5000"] = true CPUS["UPD7725"] = true CPUS["HD61700"] = true CPUS["LC8670"] = true @@ -961,6 +961,7 @@ BUSES["QBUS"] = true BUSES["QL"] = true BUSES["RS232"] = true +BUSES["PC8801"] = true BUSES["RTPC_KBD"] = true BUSES["S100"] = true BUSES["SAITEK_OSA"] = true @@ -2252,7 +2253,6 @@ MAME_DIR .. "src/mame/drivers/ac1.cpp", MAME_DIR .. "src/mame/drivers/bcs3.cpp", MAME_DIR .. "src/mame/drivers/c80.cpp", - MAME_DIR .. "src/mame/includes/c80.h", MAME_DIR .. "src/mame/drivers/huebler.cpp", MAME_DIR .. "src/mame/includes/huebler.h", MAME_DIR .. "src/mame/drivers/jtc.cpp", @@ -2410,9 +2410,6 @@ createMESSProjects(_target, _subtarget, "entex") files { MAME_DIR .. "src/mame/drivers/advision.cpp", - MAME_DIR .. "src/mame/includes/advision.h", - MAME_DIR .. "src/mame/machine/advision.cpp", - MAME_DIR .. "src/mame/video/advision.cpp", MAME_DIR .. "src/mame/drivers/sag.cpp", } @@ -2771,6 +2768,7 @@ MAME_DIR .. "src/mame/drivers/ipc.cpp", MAME_DIR .. "src/mame/drivers/ipds.cpp", MAME_DIR .. "src/mame/drivers/isbc.cpp", + MAME_DIR .. "src/mame/drivers/isbc660.cpp", MAME_DIR .. "src/mame/drivers/isbc8010.cpp", MAME_DIR .. "src/mame/drivers/isbc8030.cpp", MAME_DIR .. "src/mame/machine/imm6_76.cpp", @@ -3590,8 +3588,8 @@ MAME_DIR .. "src/mame/includes/aim65.h", MAME_DIR .. "src/mame/machine/aim65.cpp", MAME_DIR .. "src/mame/drivers/aim65_40.cpp", - MAME_DIR .. "src/mame/drivers/hh_b5000.cpp", MAME_DIR .. "src/mame/drivers/hh_pps41.cpp", + MAME_DIR .. "src/mame/drivers/hh_rw5000.cpp", } createMESSProjects(_target, _subtarget, "rtpc") @@ -4712,6 +4710,7 @@ MAME_DIR .. "src/mame/drivers/mstation.cpp", MAME_DIR .. "src/mame/drivers/mt735.cpp", MAME_DIR .. "src/mame/drivers/mtd1256.cpp", + MAME_DIR .. "src/mame/drivers/mw4pole.cpp", MAME_DIR .. "src/mame/drivers/mx2178.cpp", MAME_DIR .. "src/mame/drivers/mycom.cpp", MAME_DIR .. "src/mame/drivers/myvision.cpp", diff -Nru mame-0.242+dfsg.1/src/devices/bus/a2bus/a2diskiing.cpp mame-0.243+dfsg.1/src/devices/bus/a2bus/a2diskiing.cpp --- mame-0.242+dfsg.1/src/devices/bus/a2bus/a2diskiing.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/a2bus/a2diskiing.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -50,7 +50,8 @@ void diskiing_device::floppy_formats(format_registration &fr) { - fr.add(FLOPPY_A216S_FORMAT); + fr.add(FLOPPY_A216S_DOS_FORMAT); + fr.add(FLOPPY_A216S_PRODOS_FORMAT); fr.add(FLOPPY_RWTS18_FORMAT); fr.add(FLOPPY_EDD_FORMAT); fr.add(FLOPPY_WOZ_FORMAT); diff -Nru mame-0.242+dfsg.1/src/devices/bus/adamnet/fdc.cpp mame-0.243+dfsg.1/src/devices/bus/adamnet/fdc.cpp --- mame-0.242+dfsg.1/src/devices/bus/adamnet/fdc.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/adamnet/fdc.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -97,7 +97,7 @@ //------------------------------------------------- -// floppy_format_type floppy_formats +// floppy_formats //------------------------------------------------- void adam_fdc_device::floppy_formats(format_registration &fr) diff -Nru mame-0.242+dfsg.1/src/devices/bus/ata/idehd.cpp mame-0.243+dfsg.1/src/devices/bus/ata/idehd.cpp --- mame-0.242+dfsg.1/src/devices/bus/ata/idehd.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/ata/idehd.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -821,28 +821,28 @@ void ide_hdd_device::device_reset() { - m_handle = m_image->get_chd_file(); m_disk = m_image->get_hard_disk_file(); if (m_disk != nullptr && !m_can_identify_device) { - const hard_disk_info *hdinfo = hard_disk_get_info(m_disk); - if (hdinfo->sectorbytes == IDE_DISK_SECTOR_SIZE) + const auto &hdinfo = m_disk->get_info(); + if (hdinfo.sectorbytes == IDE_DISK_SECTOR_SIZE) { - m_num_cylinders = hdinfo->cylinders; - m_num_sectors = hdinfo->sectors; - m_num_heads = hdinfo->heads; + m_num_cylinders = hdinfo.cylinders; + m_num_sectors = hdinfo.sectors; + m_num_heads = hdinfo.heads; if (PRINTF_IDE_COMMANDS) osd_printf_debug("CHS: %u %u %u\n", m_num_cylinders, m_num_heads, m_num_sectors); osd_printf_debug("CHS: %u %u %u\n", m_num_cylinders, m_num_heads, m_num_sectors); } // build the features page - uint32_t metalength; - if (m_handle && !m_handle->read_metadata(HARD_DISK_IDENT_METADATA_TAG, 0, &m_buffer[0], 512, metalength)) + std::vector ident; + m_disk->get_inquiry_data(ident); + if (ident.size() == 512) { for( int w = 0; w < 256; w++ ) { - m_identify_buffer[w] = (m_buffer[(w * 2) + 1] << 8) | m_buffer[w * 2]; + m_identify_buffer[w] = (ident[(w * 2) + 1] << 8) | ident[w * 2]; } } else diff -Nru mame-0.242+dfsg.1/src/devices/bus/ata/idehd.h mame-0.243+dfsg.1/src/devices/bus/ata/idehd.h --- mame-0.242+dfsg.1/src/devices/bus/ata/idehd.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/ata/idehd.h 2022-04-29 05:37:26.000000000 +0000 @@ -102,11 +102,10 @@ // optional information overrides virtual void device_add_mconfig(machine_config &config) override; - virtual int read_sector(uint32_t lba, void *buffer) override { return !m_disk ? 0 : hard_disk_read(m_disk, lba, buffer); } - virtual int write_sector(uint32_t lba, const void *buffer) override { return !m_disk ? 0 : hard_disk_write(m_disk, lba, buffer); } + virtual int read_sector(uint32_t lba, void *buffer) override { return !m_disk ? 0 : m_disk->read(lba, buffer); } + virtual int write_sector(uint32_t lba, const void *buffer) override { return !m_disk ? 0 : m_disk->write(lba, buffer); } virtual uint8_t calculate_status() override; - chd_file *m_handle; hard_disk_file *m_disk; enum diff -Nru mame-0.242+dfsg.1/src/devices/bus/isa/hdc.cpp mame-0.243+dfsg.1/src/devices/bus/isa/hdc.cpp --- mame-0.242+dfsg.1/src/devices/bus/isa/hdc.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/isa/hdc.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -279,17 +279,15 @@ int xt_hdc_device::get_lbasector() { - hard_disk_info *info; - hard_disk_file *file; int lbasector; - file = pc_hdc_file(drv); - info = hard_disk_get_info(file); + hard_disk_file *file = pc_hdc_file(drv); + const auto &info = file->get_info(); lbasector = cylinder[drv]; - lbasector *= info->heads; + lbasector *= info.heads; lbasector += head[drv]; - lbasector *= info->sectors; + lbasector *= info.sectors; lbasector += sector[drv]; return lbasector; } @@ -307,17 +305,15 @@ int xt_hdc_device::dack_r() { uint8_t result; - hard_disk_info *info; - hard_disk_file *file; - file = pc_hdc_file(drv); + hard_disk_file *file = pc_hdc_file(drv); if (!file) return 0; - info = hard_disk_get_info(file); + const auto &info = file->get_info(); if (hdcdma_read == 0) { - hard_disk_read(file, get_lbasector(), hdcdma_data); + file->read(get_lbasector(), hdcdma_data); hdcdma_read = 512; hdcdma_size -= 512; hdcdma_src = hdcdma_data; @@ -329,10 +325,10 @@ if( --hdcdma_read == 0 ) { /* end of cylinder ? */ - if (sector[drv] >= info->sectors) + if (sector[drv] >= info.sectors) { sector[drv] = 0; - if (++head[drv] >= info->heads) /* beyond heads? */ + if (++head[drv] >= info.heads) /* beyond heads? */ { head[drv] = 0; /* reset head */ cylinder[drv]++; /* next cylinder */ @@ -379,27 +375,24 @@ void xt_hdc_device::dack_w(int data) { - hard_disk_info *info; - hard_disk_file *file; - - file = pc_hdc_file(drv); + hard_disk_file *file = pc_hdc_file(drv); if (!file) return; - info = hard_disk_get_info(file); + const auto &info = file->get_info(); *(hdcdma_dst++) = data; if( --hdcdma_write == 0 ) { - hard_disk_write(file, get_lbasector(), hdcdma_data); + file->write(get_lbasector(), hdcdma_data); hdcdma_write = 512; hdcdma_size -= 512; /* end of cylinder ? */ - if( ++sector[drv] >= info->sectors ) + if( ++sector[drv] >= info.sectors ) { sector[drv] = 0; - if (++head[drv] >= info->heads) /* beyond heads? */ + if (++head[drv] >= info.heads) /* beyond heads? */ { head[drv] = 0; /* reset head */ cylinder[drv]++; /* next cylinder */ diff -Nru mame-0.242+dfsg.1/src/devices/bus/isa/mcd.cpp mame-0.243+dfsg.1/src/devices/bus/isa/mcd.cpp --- mame-0.242+dfsg.1/src/devices/bus/isa/mcd.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/isa/mcd.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -78,10 +78,10 @@ bool mcd_isa_device::read_sector(bool first) { - uint32_t lba = msf_to_lba(m_readmsf); + uint32_t lba = cdrom_file::msf_to_lba(m_readmsf); if(m_drvmode == DRV_MODE_CDDA) { - if(cdrom_get_track_type(m_cdrom_handle, cdrom_get_track(m_cdrom_handle, lba)) == CD_TRACK_AUDIO) + if(m_cdrom_handle->get_track_type(m_cdrom_handle->get_track(lba)) == cdrom_file::CD_TRACK_AUDIO) { m_cdda->stop_audio(); m_cdda->set_cdrom(m_cdrom_handle); @@ -100,14 +100,14 @@ return false; } m_cdda->stop_audio(); - cdrom_read_data(m_cdrom_handle, lba - 150, m_buf, m_mode & 0x40 ? CD_TRACK_MODE1_RAW : CD_TRACK_MODE1); + m_cdrom_handle->read_data(lba - 150, m_buf, m_mode & 0x40 ? cdrom_file::CD_TRACK_MODE1_RAW : cdrom_file::CD_TRACK_MODE1); if(m_mode & 0x40) { //correct the header m_buf[12] = dec_2_bcd((m_readmsf >> 16) & 0xff); m_buf[13] = dec_2_bcd((m_readmsf >> 8) & 0xff); } - m_readmsf = lba_to_msf_alt(lba + 1); + m_readmsf = cdrom_file::lba_to_msf_alt(lba + 1); m_buf_count = m_dmalen + 1; m_buf_idx = 0; m_data = true; @@ -272,9 +272,9 @@ case CMD_GET_INFO: if(m_cdrom_handle) { - uint32_t first = lba_to_msf(150), last = lba_to_msf(cdrom_get_track_start(m_cdrom_handle, 0xaa)); + uint32_t first = cdrom_file::lba_to_msf(150), last = cdrom_file::lba_to_msf(m_cdrom_handle->get_track_start(0xaa)); m_cmdbuf[1] = 1; - m_cmdbuf[2] = dec_2_bcd(cdrom_get_last_track(m_cdrom_handle)); + m_cmdbuf[2] = dec_2_bcd(m_cdrom_handle->get_last_track()); m_cmdbuf[3] = (last >> 16) & 0xff; m_cmdbuf[4] = (last >> 8) & 0xff; m_cmdbuf[5] = last & 0xff; @@ -294,11 +294,11 @@ case CMD_GET_Q: if(m_cdrom_handle) { - int tracks = cdrom_get_last_track(m_cdrom_handle); - uint32_t start = cdrom_get_track_start(m_cdrom_handle, m_curtoctrk); - uint32_t len = lba_to_msf(cdrom_get_track_start(m_cdrom_handle, m_curtoctrk < (tracks - 1) ? m_curtoctrk + 1 : 0xaa) - start); - start = lba_to_msf(start); - m_cmdbuf[1] = (cdrom_get_adr_control(m_cdrom_handle, m_curtoctrk) << 4) & 0xf0; + int tracks = m_cdrom_handle->get_last_track(); + uint32_t start = m_cdrom_handle->get_track_start(m_curtoctrk); + uint32_t len = cdrom_file::lba_to_msf(m_cdrom_handle->get_track_start(m_curtoctrk < (tracks - 1) ? m_curtoctrk + 1 : 0xaa) - start); + start = cdrom_file::lba_to_msf(start); + m_cmdbuf[1] = (m_cdrom_handle->get_adr_control(m_curtoctrk) << 4) & 0xf0; m_cmdbuf[2] = 0; // track num except when reading toc m_cmdbuf[3] = dec_2_bcd(m_curtoctrk + 1); // index m_cmdbuf[4] = (len >> 16) & 0xff; diff -Nru mame-0.242+dfsg.1/src/devices/bus/isbx/compis_fdc.cpp mame-0.243+dfsg.1/src/devices/bus/isbx/compis_fdc.cpp --- mame-0.242+dfsg.1/src/devices/bus/isbx/compis_fdc.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/isbx/compis_fdc.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -26,7 +26,7 @@ //------------------------------------------------- -// floppy_format_type floppy_formats +// floppy_formats //------------------------------------------------- WRITE_LINE_MEMBER( compis_fdc_device::fdc_irq ) diff -Nru mame-0.242+dfsg.1/src/devices/bus/lpci/i82371ab.cpp mame-0.243+dfsg.1/src/devices/bus/lpci/i82371ab.cpp --- mame-0.242+dfsg.1/src/devices/bus/lpci/i82371ab.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/lpci/i82371ab.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -19,6 +19,20 @@ #include "emu.h" #include "i82371ab.h" +#define LOG_ISA (1U << 1) +#define LOG_IDE (1U << 2) +#define LOG_USB (1U << 3) +#define LOG_ACPI (1U << 4) + +#define VERBOSE (LOG_GENERAL | LOG_ISA | LOG_IDE | LOG_USB | LOG_ACPI) +//#define LOG_OUTPUT_FUNC osd_printf_info +#include "logmacro.h" + +#define LOGISA(...) LOGMASKED(LOG_ISA, __VA_ARGS__) +#define LOGIDE(...) LOGMASKED(LOG_IDE, __VA_ARGS__) +#define LOGUSB(...) LOGMASKED(LOG_USB, __VA_ARGS__) +#define LOGACPI(...) LOGMASKED(LOG_ACPI, __VA_ARGS__) + DEFINE_DEVICE_TYPE(I82371AB, i82371ab_device, "i82371ab", "Intel 82371AB") @@ -28,6 +42,8 @@ { } + + uint32_t i82371ab_device::pci_isa_r(device_t *busdevice, int offset, uint32_t mem_mask) { uint32_t result = m_regs[0][offset] | @@ -35,7 +51,7 @@ m_regs[0][offset+2] << 16| m_regs[0][offset+3] << 24; - logerror("i82371ab_pci_isa_r, offset = %02x, mem_mask = %08x\n", offset, mem_mask); + LOGISA("ISA read: [%02x] -> %08x & %08x\n", offset, result, mem_mask); return result; } @@ -46,7 +62,7 @@ int i; COMBINE_DATA(&cdata); - logerror("i82371ab_pci_isa_w, offset = %02x, data = %08x, mem_mask = %08x\n", offset, data, mem_mask); + LOGISA("ISA write: [%02x] <- %08x & %08x\n", offset, data, mem_mask); for(i = 0; i < 4; i++, offset++, cdata >>= 8) { @@ -74,7 +90,7 @@ m_regs[1][offset+2] << 16| m_regs[1][offset+3] << 24; - logerror("i82371ab_pci_ide_r, offset = %02x, mem_mask = %08x\n", offset, mem_mask); + LOGIDE("IDE read: [%02x] -> %08x & %08x\n", offset, result, mem_mask); return result; } @@ -85,7 +101,7 @@ int i; COMBINE_DATA(&cdata); - logerror("i82371ab_pci_isa_w, offset = %02x, data = %08x, mem_mask = %08x\n", offset, data, mem_mask); + LOGIDE("IDE write: [%02x] <- %08x & %08x\n", offset, data, mem_mask); for(i = 0; i < 4; i++, offset++, cdata >>= 8) { @@ -113,7 +129,7 @@ m_regs[2][offset+2] << 16| m_regs[2][offset+3] << 24; - logerror("i82371ab_pci_usb_r, offset = %02x, mem_mask = %08x\n", offset, mem_mask); + LOGUSB("USB read: [%02x] -> %08x & %08x\n", offset, result, mem_mask); return result; } @@ -124,7 +140,7 @@ int i; COMBINE_DATA(&cdata); - logerror("i82371ab_pci_isa_w, offset = %02x, data = %08x, mem_mask = %08x\n", offset, data, mem_mask); + LOGUSB("USB write: [%02x] <- %08x & %08x\n", offset, data, mem_mask); for(i = 0; i < 4; i++, offset++, cdata >>= 8) { @@ -152,7 +168,7 @@ m_regs[3][offset+2] << 16| m_regs[3][offset+3] << 24; - logerror("i82371ab_pci_acpi_r, offset = %02x, mem_mask = %08x\n", offset, mem_mask); + LOGACPI("ACPI read: [%02x] -> %08x & %08x\n", offset, result, mem_mask); return result; } @@ -163,7 +179,7 @@ int i; COMBINE_DATA(&cdata); - logerror("i82371ab_pci_isa_w, offset = %02x, data = %08x, mem_mask = %08x\n", offset, data, mem_mask); + LOGACPI("ACPI write: [%02x] <- %08x & %08x\n", offset, data, mem_mask); for(i = 0; i < 4; i++, offset++, cdata >>= 8) { @@ -194,7 +210,7 @@ case 3: return pci_acpi_r(pcibus, offset, mem_mask); } - logerror("i82371ab_pci_read: read from undefined function %d\n", function); + LOG("read from undefined function %d\n", function); return 0; } diff -Nru mame-0.242+dfsg.1/src/devices/bus/multibus/isbc8024.cpp mame-0.243+dfsg.1/src/devices/bus/multibus/isbc8024.cpp --- mame-0.242+dfsg.1/src/devices/bus/multibus/isbc8024.cpp 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/multibus/isbc8024.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,156 @@ +// license:BSD-3-Clause +// copyright-holders:Patrick Mackinlay + +/* + * Intel iSBC 80/24 Single Board Computer + * + * Sources: + * - http://www.bitsavers.org/pdf/intel/iSBC/148437-001_iSBC_80_24A_Hardware_Reference_Manual_Nov85.pdf + * + * TODO: + * - configurable eprom quantity/size + * - configurable irq, clock and I/O + * - reverse engineer unknown firmware + * - led output + */ + +#include "emu.h" +#include "isbc8024.h" + +#define VERBOSE 0 +#include "logmacro.h" + +DEFINE_DEVICE_TYPE(ISBC8024, isbc8024_device, "isbc8024", "Intel iSBC 80/24 Single Board Computer") + +isbc8024_device::isbc8024_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) + : device_t(mconfig, ISBC8024, tag, owner, clock) + , device_multibus_interface(mconfig, *this) + , m_cpu(*this, "cpu") + , m_pit(*this, "pit") + , m_pci(*this, "pci") + , m_ppi(*this, "ppi%u", 0U) + , m_pic(*this, "pic") + , m_j3(*this, "j3") + , m_conf(*this, "CONF") + , m_installed(false) +{ +} + +ROM_START(isbc8024) + ROM_REGION(0x1000, "eprom", 0) + ROM_SYSTEM_BIOS(0, "unknown", "unknown") + ROMX_LOAD("unknown.u50", 0x000, 0x800, CRC(28b18721) SHA1(37526ed0a4f1e910fc0a8f6af0708c77a7358f69), ROM_BIOS(0)) + ROMX_LOAD("unknown.u51", 0x800, 0x800, CRC(9e49f6ad) SHA1(565ab4740d3151eb4d8ef9ff3e02570cf7804be1), ROM_BIOS(0)) +ROM_END + +static INPUT_PORTS_START(isbc8024) + PORT_START("CONF") + PORT_CONFNAME(0x0003, 0x0003, "Size") + PORT_CONFSETTING( 0x0000, "None") + PORT_CONFSETTING( 0x0001, "2048") + PORT_CONFSETTING( 0x0002, "4096") + PORT_CONFSETTING( 0x0003, "8192") + + PORT_CONFNAME(0xf000, 0xf000, "End") + PORT_CONFSETTING( 0x3000, "3FFF") + PORT_CONFSETTING( 0x7000, "7FFF") + PORT_CONFSETTING( 0xb000, "BFFF") + PORT_CONFSETTING( 0xf000, "FFFF") +INPUT_PORTS_END + +const tiny_rom_entry *isbc8024_device::device_rom_region() const +{ + return ROM_NAME(isbc8024); +} + +ioport_constructor isbc8024_device::device_input_ports() const +{ + return INPUT_PORTS_NAME(isbc8024); +} + +void isbc8024_device::device_start() +{ +} + +void isbc8024_device::device_reset() +{ + if (!m_installed) + { + ioport_value const conf = m_conf->read(); + if (conf & 3) + { + size_t const ram_size = 1024 << (conf & 3); + offs_t ram_end = (conf & 0xf000) | 0x0fff; + + std::unique_ptr const ram = std::make_unique(ram_size); + m_cpu->space(AS_PROGRAM).install_ram(ram_end - ram_size + 1, ram_end, ram.get()); + } + + // TODO: what's exposed to the Multibus? + m_bus->int_callback<2>().set(m_pic, FUNC(pic8259_device::ir1_w)); + + m_installed = true; + } +} + +void isbc8024_device::device_add_mconfig(machine_config &config) +{ + I8085A(config, m_cpu, 19'354'000 / 2); + m_cpu->set_addrmap(AS_PROGRAM, &isbc8024_device::cpu_mem_map); + m_cpu->set_addrmap(AS_IO, &isbc8024_device::cpu_pio_map); + + PIT8254(config, m_pit); + m_pit->set_clk<0>(19'354'000 / 18); + m_pit->set_clk<1>(19'354'000 / 18); + m_pit->set_clk<2>(19'354'000 / 18); + m_pit->out_handler<0>().set(m_pic, FUNC(pic8259_device::ir2_w)); + //m_pit->out_handler<1>().set(m_pic, FUNC(pic8259_device::ir?)); + m_pit->out_handler<2>().append(m_pci, FUNC(i8251_device::write_rxc)); + m_pit->out_handler<2>().append(m_pci, FUNC(i8251_device::write_txc)); + + I8251(config, m_pci, 0); + + I8255(config, m_ppi[0], 0); // j1 + I8255(config, m_ppi[1], 0); // j2 + + PIC8259(config, m_pic); + m_pic->out_int_callback().set_inputline(m_cpu, I8085_INTR_LINE); + + RS232_PORT(config, m_j3, default_rs232_devices, nullptr); + + m_pci->txd_handler().set(m_j3, FUNC(rs232_port_device::write_txd)); + m_pci->dtr_handler().set(m_j3, FUNC(rs232_port_device::write_dtr)); + m_pci->rts_handler().set(m_j3, FUNC(rs232_port_device::write_rts)); + m_j3->rxd_handler().set(m_pci, FUNC(i8251_device::write_rxd)); + m_j3->dsr_handler().set(m_pci, FUNC(i8251_device::write_dsr)); + m_j3->cts_handler().set(m_pci, FUNC(i8251_device::write_cts)); +} + +void isbc8024_device::cpu_mem_map(address_map &map) +{ + // default off-board mem access to multibus + map(0x0000, 0xffff).rw(FUNC(isbc8024_device::bus_mem_r), FUNC(isbc8024_device::bus_mem_w)); + + // TODO: variable number and size of EPROMs + map(0x0000, 0x0fff).rom().region("eprom", 0); +} + +void isbc8024_device::cpu_pio_map(address_map &map) +{ + // default off-board pio access to multibus + map(0x00, 0xff).rw(FUNC(isbc8024_device::bus_pio_r), FUNC(isbc8024_device::bus_pio_w)); + + map(0xd4, 0xd4).noprw(); // TODO: power fail + //map(0xd5, 0xd5); // system bus override + map(0xd6, 0xd6).lw8([this](u8 data) { popmessage("LED"); }, "led_w"); // led diagnostic indicator + map(0xd7, 0xd7).noprw(); // reserved + map(0xd8, 0xd9).rw(m_pic, FUNC(pic8259_device::read), FUNC(pic8259_device::write)).mirror(0x02); + map(0xdc, 0xdf).rw(m_pit, FUNC(pit8254_device::read), FUNC(pit8254_device::write)); + map(0xe4, 0xe7).rw(m_ppi[0], FUNC(i8255_device::read), FUNC(i8255_device::write)); + map(0xe8, 0xeb).rw(m_ppi[1], FUNC(i8255_device::read), FUNC(i8255_device::write)); + map(0xec, 0xed).rw(m_pci, FUNC(i8251_device::read), FUNC(i8251_device::write)).mirror(0x02); + //map(0xc0, 0xc7); // mutimodule 1 mcs0/ j5 + //map(0xc8, 0xcf); // mutimodule 1 mcs1/ j5 + //map(0xf0, 0xf7); // mutimodule 2 mcs0/ j6 + //map(0xf8, 0xff); // mutimodule 2 mcs1/ j6 +} diff -Nru mame-0.242+dfsg.1/src/devices/bus/multibus/isbc8024.h mame-0.243+dfsg.1/src/devices/bus/multibus/isbc8024.h --- mame-0.242+dfsg.1/src/devices/bus/multibus/isbc8024.h 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/multibus/isbc8024.h 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,57 @@ +// license:BSD-3-Clause +// copyright-holders:Patrick Mackinlay + +#ifndef MAME_BUS_MULTIBUS_ISBC8024_H +#define MAME_BUS_MULTIBUS_ISBC8024_H + +#pragma once + +#include "multibus.h" + +#include "cpu/i8085/i8085.h" +#include "machine/pit8253.h" +#include "machine/i8251.h" +#include "machine/i8255.h" +#include "machine/pic8259.h" + +#include "bus/rs232/rs232.h" + +class isbc8024_device + : public device_t + , public device_multibus_interface +{ +public: + isbc8024_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock); + +protected: + // device_t overrides + virtual const tiny_rom_entry *device_rom_region() const override; + virtual void device_add_mconfig(machine_config &config) override; + virtual ioport_constructor device_input_ports() const override; + virtual void device_start() override; + virtual void device_reset() override; + +private: + void cpu_mem_map(address_map &map); + void cpu_pio_map(address_map &map); + + void bus_mem_w(offs_t offset, u8 data) { m_bus->space(AS_PROGRAM).write_byte(offset, data); } + u8 bus_mem_r(offs_t offset) { return m_bus->space(AS_PROGRAM).read_byte(offset); } + void bus_pio_w(offs_t offset, u8 data) { m_bus->space(AS_IO).write_byte(offset, data); } + u8 bus_pio_r(offs_t offset) { return m_bus->space(AS_IO).read_byte(offset); } + + required_device m_cpu; + required_device m_pit; + required_device m_pci; + required_device_array m_ppi; + required_device m_pic; + required_device m_j3; + + required_ioport m_conf; + + bool m_installed; +}; + +DECLARE_DEVICE_TYPE(ISBC8024, isbc8024_device) + +#endif // MAME_BUS_MULTIBUS_ISBC8024_H diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/act53.cpp mame-0.243+dfsg.1/src/devices/bus/nes/act53.cpp --- mame-0.242+dfsg.1/src/devices/bus/nes/act53.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/act53.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -112,7 +112,7 @@ void nes_action53_device::update_prg() { u16 prg_lo, prg_hi; - u8 size = (m_reg[2] & 0x30) >> 4; // Game size + u8 size = BIT(m_reg[2], 4, 2); // Game size u16 mask = ~0 << (size + 1); // Bits to be taken from PRG regs u8 b32k = !BIT(m_reg[2], 3); // 32K mode bit u16 outer = m_reg[3] << 1; // Outer PRG reg bits diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/aladdin.cpp mame-0.243+dfsg.1/src/devices/bus/nes/aladdin.cpp --- mame-0.242+dfsg.1/src/devices/bus/nes/aladdin.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/aladdin.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -245,7 +245,7 @@ // m_hibank = 3rd page inside the block if (offset < 0x4000) { - m_bank_base = ((data >> 3) & 3) << 2; + m_bank_base = (data & 0x18) >> 1; m_lobank = m_bank_base | (m_lobank & 3); m_hibank = m_bank_base | 3; } diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/ave.cpp mame-0.243+dfsg.1/src/devices/bus/nes/ave.cpp --- mame-0.242+dfsg.1/src/devices/bus/nes/ave.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/ave.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -56,30 +56,6 @@ -void nes_nina001_device::device_start() -{ - common_start(); -} - -void nes_nina001_device::pcb_reset() -{ - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - prg32(0); - chr8(0, m_chr_source); -} - -void nes_nina006_device::device_start() -{ - common_start(); -} - -void nes_nina006_device::pcb_reset() -{ - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - prg32(0); - chr8(0, m_chr_source); -} - void nes_maxi15_device::device_start() { common_start(); @@ -154,7 +130,8 @@ { LOG_MMC(("nina-006 write_l, offset: %04x, data: %02x\n", offset, data)); - if (!(offset & 0x0100)) + offset += 0x100; + if (BIT(offset, 8)) // $41xx, $43xx, ... $5fxx { prg32(data >> 3); chr8(data & 7, CHRROM); diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/ave.h mame-0.243+dfsg.1/src/devices/bus/nes/ave.h --- mame-0.242+dfsg.1/src/devices/bus/nes/ave.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/ave.h 2022-04-29 05:37:26.000000000 +0000 @@ -17,12 +17,6 @@ nes_nina001_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void write_m(offs_t offset, uint8_t data) override; - - virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; @@ -35,12 +29,6 @@ nes_nina006_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void write_l(offs_t offset, uint8_t data) override; - - virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/bandai.cpp mame-0.243+dfsg.1/src/devices/bus/nes/bandai.cpp --- mame-0.242+dfsg.1/src/devices/bus/nes/bandai.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/bandai.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -207,32 +207,28 @@ void nes_oekakids_device::nt_w(offs_t offset, uint8_t data) { - int page = ((offset & 0xc00) >> 10); - #if 0 if (!(offset & 0x1000) && (offset & 0x3ff) < 0x3c0) { - m_latch = (offset & 0x300) >> 8; + m_latch = BIT(offset, 8, 2); chr4_0(m_reg | m_latch, CHRRAM); } #endif - m_nt_access[page][offset & 0x3ff] = data; + device_nes_cart_interface::nt_w(offset, data); } uint8_t nes_oekakids_device::nt_r(offs_t offset) { - int page = ((offset & 0xc00) >> 10); - #if 0 if (!(offset & 0x1000) && (offset & 0x3ff) < 0x3c0) { - m_latch = (offset & 0x300) >> 8; + m_latch = BIT(offset, 8, 2); chr4_0(m_reg | m_latch, CHRRAM); } #endif - return m_nt_access[page][offset & 0x3ff]; + return device_nes_cart_interface::nt_r(offset); } void nes_oekakids_device::update_chr() @@ -247,7 +243,7 @@ #if 0 if ((offset & 0x3000) == 0x2000) { - m_latch = (offset & 0x300) >> 8; + m_latch = BIT(offset, 8, 2); update_chr(); } #endif diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/bandai.h mame-0.243+dfsg.1/src/devices/bus/nes/bandai.h --- mame-0.242+dfsg.1/src/devices/bus/nes/bandai.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/bandai.h 2022-04-29 05:37:26.000000000 +0000 @@ -74,7 +74,6 @@ // construction/destruction nes_lz93d50_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // device-level overrides virtual void write_h(offs_t offset, uint8_t data) override { fcg_write(offset, data); } protected: diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/benshieng.cpp mame-0.243+dfsg.1/src/devices/bus/nes/benshieng.cpp --- mame-0.242+dfsg.1/src/devices/bus/nes/benshieng.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/benshieng.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -31,9 +31,8 @@ DEFINE_DEVICE_TYPE(NES_BENSHIENG, nes_benshieng_device, "nes_benshieng", "NES Cart Benshieng PCB") -nes_benshieng_device::nes_benshieng_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : nes_nrom_device(mconfig, NES_BENSHIENG, tag, owner, clock) - , m_dipsetting(0) +nes_benshieng_device::nes_benshieng_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : nes_nrom_device(mconfig, NES_BENSHIENG, tag, owner, clock), m_dipsetting(0) { } @@ -44,20 +43,17 @@ { common_start(); save_item(NAME(m_dipsetting)); - save_item(NAME(m_mmc_prg_bank)); - save_item(NAME(m_mmc_vrom_bank)); } void nes_benshieng_device::pcb_reset() { - m_dipsetting = 0; + for (int i = 0; i < 4; i++) + { + prg8_x(i, 0x0f); + chr2_x(2 * i, 0x00, CHRROM); + } - m_mmc_prg_bank[0] = 0xff; - m_mmc_prg_bank[1] = 0xff; - m_mmc_prg_bank[2] = 0xff; - m_mmc_prg_bank[3] = 0xff; - memset(m_mmc_vrom_bank, 0, sizeof(m_mmc_vrom_bank)); - update_banks(); + m_dipsetting = 0; } @@ -72,35 +68,27 @@ Games: a few 4 in 1 multicarts - -------------------------------------------------*/ + NES 2.0: mapper 286 -void nes_benshieng_device::update_banks() -{ - prg8_89(m_mmc_prg_bank[0]); - prg8_ab(m_mmc_prg_bank[1]); - prg8_cd(m_mmc_prg_bank[2]); - prg8_ef(m_mmc_prg_bank[3]); - chr2_0(m_mmc_vrom_bank[0], CHRROM); - chr2_2(m_mmc_vrom_bank[1], CHRROM); - chr2_4(m_mmc_vrom_bank[2], CHRROM); - chr2_6(m_mmc_vrom_bank[3], CHRROM); -} + -------------------------------------------------*/ -void nes_benshieng_device::write_h(offs_t offset, uint8_t data) +void nes_benshieng_device::write_h(offs_t offset, u8 data) { - uint8_t helper = (offset & 0xc00) >> 10; LOG_MMC(("benshieng write_h, offset: %04x, data: %02x\n", offset, data)); // m_mmc_dipsetting = ioport("CARTDIPS")->read(); + u8 bank = BIT(offset, 10, 2); + switch (offset & 0x7000) { case 0x0000: - m_mmc_vrom_bank[helper] = offset & 0x1f; + case 0x1000: + chr2_x(2 * bank, offset & 0x1f, CHRROM); break; case 0x2000: - if (BIT(offset, m_dipsetting + 4)) // mmc_dipsetting is always zero atm, given we have no way to add cart-based DIPs - m_mmc_prg_bank[helper] = offset & 0x0f; + case 0x3000: + if (BIT(offset, m_dipsetting + 4)) // m_dipsetting is always zero atm, given we have no way to add cart-based DIPs + prg8_x(bank, offset & 0x0f); break; } - update_banks(); } diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/benshieng.h mame-0.243+dfsg.1/src/devices/bus/nes/benshieng.h --- mame-0.242+dfsg.1/src/devices/bus/nes/benshieng.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/benshieng.h 2022-04-29 05:37:26.000000000 +0000 @@ -14,9 +14,9 @@ { public: // construction/destruction - nes_benshieng_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_benshieng_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - virtual void write_h(offs_t offset, uint8_t data) override; + virtual void write_h(offs_t offset, u8 data) override; virtual void pcb_reset() override; @@ -25,10 +25,7 @@ virtual void device_start() override; private: - void update_banks(); - uint8_t m_dipsetting; - uint8_t m_mmc_prg_bank[4]; - uint8_t m_mmc_vrom_bank[4]; + u8 m_dipsetting; }; diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/bootleg.cpp mame-0.243+dfsg.1/src/devices/bus/nes/bootleg.cpp --- mame-0.242+dfsg.1/src/devices/bus/nes/bootleg.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/bootleg.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -24,7 +24,6 @@ #include "bootleg.h" #include "video/ppu2c0x.h" // this has to be included so that IRQ functions can access ppu2c0x_device::BOTTOM_VISIBLE_SCANLINE -#include "screen.h" #ifdef NES_PCB_DEBUG @@ -659,22 +658,6 @@ m_latch = 0xff; } -void nes_mmalee_device::device_start() -{ - common_start(); -} - -void nes_mmalee_device::pcb_reset() -{ - chr8(0, CHRROM); - prg32(0); -} - -void nes_rt01_device::device_start() -{ - common_start(); -} - void nes_rt01_device::pcb_reset() { chr2_0(0, CHRROM); @@ -1019,7 +1002,7 @@ case 0x5002: case 0x6000: case 0x6002: - bank = ((offset & 0x7000) - 0x3000) / 0x0800 + ((offset & 0x0002) >> 1); + bank = 2 * (BIT(offset, 12, 3) - 3) + BIT(offset, 1); chr1_x(bank, data, CHRROM); break; case 0x7000: diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/bootleg.h mame-0.243+dfsg.1/src/devices/bus/nes/bootleg.h --- mame-0.242+dfsg.1/src/devices/bus/nes/bootleg.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/bootleg.h 2022-04-29 05:37:26.000000000 +0000 @@ -400,6 +400,7 @@ { public: virtual u8 read_m(offs_t offset) override; + virtual void pcb_reset() override; protected: @@ -654,12 +655,6 @@ virtual uint8_t read_m(offs_t offset) override; virtual void write_m(offs_t offset, uint8_t data) override; - - virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; @@ -674,10 +669,6 @@ virtual uint8_t read_h(offs_t offset) override; virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/camerica.cpp mame-0.243+dfsg.1/src/devices/bus/nes/camerica.cpp --- mame-0.242+dfsg.1/src/devices/bus/nes/camerica.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/camerica.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -64,11 +64,6 @@ -void nes_bf9093_device::device_start() -{ - common_start(); -} - void nes_bf9093_device::pcb_reset() { m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/camerica.h mame-0.243+dfsg.1/src/devices/bus/nes/camerica.h --- mame-0.242+dfsg.1/src/devices/bus/nes/camerica.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/camerica.h 2022-04-29 05:37:26.000000000 +0000 @@ -19,10 +19,6 @@ virtual void write_h(offs_t offset, uint8_t data) override; virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/cne.cpp mame-0.243+dfsg.1/src/devices/bus/nes/cne.cpp --- mame-0.242+dfsg.1/src/devices/bus/nes/cne.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/cne.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -54,23 +54,6 @@ -void nes_cne_decathl_device::device_start() -{ - common_start(); -} - -void nes_cne_decathl_device::pcb_reset() -{ - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - prg32(0); - chr8(0, m_chr_source); -} - -void nes_cne_fsb_device::device_start() -{ - common_start(); -} - void nes_cne_fsb_device::pcb_reset() { m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; @@ -78,18 +61,6 @@ chr8(0, m_chr_source); } -void nes_cne_shlz_device::device_start() -{ - common_start(); -} - -void nes_cne_shlz_device::pcb_reset() -{ - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - prg32(0); - chr8(0, m_chr_source); -} - diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/cne.h mame-0.243+dfsg.1/src/devices/bus/nes/cne.h --- mame-0.242+dfsg.1/src/devices/bus/nes/cne.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/cne.h 2022-04-29 05:37:26.000000000 +0000 @@ -17,12 +17,6 @@ nes_cne_decathl_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void write_h(offs_t offset, uint8_t data) override; - - virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; @@ -38,10 +32,6 @@ virtual void write_m(offs_t offset, uint8_t data) override; virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; @@ -54,12 +44,6 @@ nes_cne_shlz_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void write_l(offs_t offset, uint8_t data) override; - - virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/discrete.cpp mame-0.243+dfsg.1/src/devices/bus/nes/discrete.cpp --- mame-0.242+dfsg.1/src/devices/bus/nes/discrete.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/discrete.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -61,11 +61,6 @@ -void nes_74x161x161x32_device::device_start() -{ - common_start(); -} - void nes_74x161x161x32_device::pcb_reset() { m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; @@ -74,11 +69,6 @@ chr8(0, m_chr_source); } -void nes_74x139x74_device::device_start() -{ - common_start(); -} - void nes_74x139x74_device::pcb_reset() { m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; @@ -87,30 +77,6 @@ chr8(0, m_chr_source); } -void nes_74x377_device::device_start() -{ - common_start(); -} - -void nes_74x377_device::pcb_reset() -{ - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - prg32(0); - chr8(0, m_chr_source); -} - -void nes_74x161x138_device::device_start() -{ - common_start(); -} - -void nes_74x161x138_device::pcb_reset() -{ - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - prg32(0); - chr8(0, m_chr_source); -} - diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/discrete.h mame-0.243+dfsg.1/src/devices/bus/nes/discrete.h --- mame-0.242+dfsg.1/src/devices/bus/nes/discrete.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/discrete.h 2022-04-29 05:37:26.000000000 +0000 @@ -19,10 +19,6 @@ virtual void write_h(offs_t offset, uint8_t data) override; virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; @@ -37,10 +33,6 @@ virtual void write_m(offs_t offset, uint8_t data) override; virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; @@ -53,12 +45,6 @@ nes_74x377_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void write_h(offs_t offset, uint8_t data) override; - - virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; @@ -71,12 +57,6 @@ nes_74x161x138_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void write_m(offs_t offset, uint8_t data) override; - - virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/disksys.cpp mame-0.243+dfsg.1/src/devices/bus/nes/disksys.cpp --- mame-0.242+dfsg.1/src/devices/bus/nes/disksys.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/disksys.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -461,7 +461,6 @@ // if there is an header, skip it image.fseek(header, SEEK_SET); image.fread(m_fds_data.get(), 65500 * m_fds_sides); - return; } void nes_disksys_device::unload_disk(device_image_interface &image) diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/event.cpp mame-0.243+dfsg.1/src/devices/bus/nes/event.cpp --- mame-0.242+dfsg.1/src/devices/bus/nes/event.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/event.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -250,12 +250,12 @@ m_prgram[offset % m_prgram.size()] = data; } -void nes_event2_device::set_chr(u8 chr, int chr_base, int chr_mask) +void nes_event2_device::chr_cb(int start, int bank, int source) { if (m_tqrom_mode) - nes_tqrom_device::set_chr(chr, chr_base, chr_mask); + nes_tqrom_device::chr_cb(start, bank, source); else - nes_txrom_device::set_chr(chr, chr_base, chr_mask); + nes_txrom_device::chr_cb(start, bank, source); } diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/event.h mame-0.243+dfsg.1/src/devices/bus/nes/event.h --- mame-0.242+dfsg.1/src/devices/bus/nes/event.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/event.h 2022-04-29 05:37:26.000000000 +0000 @@ -51,6 +51,7 @@ virtual void write_l(offs_t offset, u8 data) override; virtual u8 read_m(offs_t offset) override; virtual void write_m(offs_t offset, u8 data) override; + virtual void chr_cb(int start, int bank, int source) override; virtual void pcb_reset() override; @@ -60,8 +61,6 @@ virtual void device_timer(emu_timer &timer, device_timer_id id, int param) override; virtual ioport_constructor device_input_ports() const override; - virtual void set_chr(u8 chr, int chr_base, int chr_mask) override; - required_ioport m_dsw; bool m_tqrom_mode; diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/ggenie.cpp mame-0.243+dfsg.1/src/devices/bus/nes/ggenie.cpp --- mame-0.242+dfsg.1/src/devices/bus/nes/ggenie.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/ggenie.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -10,6 +10,8 @@ * Galoob Game Genie, passthrough hacking cart + TODO: emulate bugs/quirks/bus conflicts. See NesDev wiki. + ***********************************************************************************************************/ @@ -33,10 +35,10 @@ DEFINE_DEVICE_TYPE(NES_GGENIE, nes_ggenie_device, "nes_ggenie", "NES Cart Game Genie PCB") -nes_ggenie_device::nes_ggenie_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +nes_ggenie_device::nes_ggenie_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_nrom_device(mconfig, NES_GGENIE, tag, owner, clock) , m_ggslot(*this, "gg_slot") - , m_gg_bypass(0) + , m_gg_bypass(false) { } @@ -45,26 +47,35 @@ { common_start(); save_item(NAME(m_gg_bypass)); + save_item(NAME(m_gg_addr)); + save_item(NAME(m_gg_repl)); + save_item(NAME(m_gg_comp)); + save_item(NAME(m_gg_enable)); + save_item(NAME(m_gg_is_comp)); } -void nes_ggenie_device::pcb_start(running_machine &machine, uint8_t *ciram_ptr, bool cart_mounted) +void nes_ggenie_device::pcb_start(running_machine &machine, u8 *ciram_ptr, bool cart_mounted) { device_nes_cart_interface::pcb_start(machine, ciram_ptr, cart_mounted); - if (m_ggslot->m_cart) - m_ggslot->pcb_start(m_ciram); -} + m_ggslot->pcb_start(m_ciram); -void nes_ggenie_device::pcb_reset() -{ - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; prg32(0); - chr8(0, m_chr_source); + m_gg_bypass = false; - set_nt_mirroring(PPU_MIRROR_LOW); - m_gg_bypass = 0; + for (int i = 0; i < 3; i++) + { + m_gg_addr[i] = 0; + m_gg_repl[i] = 0; + m_gg_comp[i] = 0; + m_gg_enable[i] = false; + m_gg_is_comp[i] = false; + } +} - if (m_ggslot->m_cart) - m_ggslot->m_cart->pcb_reset(); +void nes_ggenie_device::pcb_reset() +{ + // Game Genie does NOT reset to its interface once in game mode + m_ggslot->pcb_reset(); } @@ -80,177 +91,154 @@ -------------------------------------------------*/ -void nes_ggenie_device::write_h(offs_t offset, uint8_t data) +void nes_ggenie_device::write_h(offs_t offset, u8 data) { -// LOG_MMC(("axrom write_h, offset: %04x, data: %02x\n", offset, data)); - if (!m_gg_bypass) +// LOG_MMC(("ggenie write_h, offset: %04x, data: %02x\n", offset, data)); + + if (m_gg_bypass) { - // From blargg: Codes are written to $8001-800C, starting at $800C and going down to $8001. - // Next, two values are written to $8000. The first specify the kind of codes which have - // been inserted, the second write to $8000 is always zero (all 8 bits). - // This probably disables the boot ROM (the code is executing from RAM at this point). - // Once done, the code jumps to ($FFFC) to begin the game. - // All 12 bytes from $8001-800C are written regardless of how many codes are inserted. - // The value written to $8000 is the only clue as to what codes are actually valid and which - // ones have compare values. - if (offset) - { - int code; - offset -= 1; - code = (offset & 0xc) >> 2; - if (code == 3) - return; // how did we end up here? the GG is not expected to write to $800d-800f! + m_ggslot->write_h(offset, data); + return; + } - switch (offset & 3) - { - case 0: - m_gg_addr[code] |= (data & 0x7f) << 8; - break; - case 1: - m_gg_addr[code] = data; - break; - case 2: - m_gg_comp[code] = data; - break; - case 3: - m_gg_repl[code] = data; - break; - } - return; - } + // From blargg: Codes are written to $8001-800C, starting at $800C and going down to $8001. + // Next, two values are written to $8000. The first specify the kind of codes which have + // been inserted, and disables the boot ROM. The second write to $8000 is always 0x00, and + // goes to the slave cart for unknown reasons. + // Once done, the code jumps to ($FFFC) to begin the game. + // All 12 bytes from $8001-800C are written regardless of how many codes are inserted. + // The value written to $8000 is the only clue as to what codes are actually valid and which + // ones have compare values. + if (offset) + { + offset -= 1; + int code = BIT(offset, 2, 2); + if (code == 3) + return; // how did we end up here? the GG is not expected to write to $800d-800f! - if (offset == 0 && data == 0) + switch (offset & 3) { - m_gg_bypass = 1; - reset_cpu(); + case 0: + m_gg_addr[code] |= (data & 0x7f) << 8; + break; + case 1: + m_gg_addr[code] = data; + break; + case 2: + m_gg_comp[code] = data; + break; + case 3: + m_gg_repl[code] = data; + break; } - else + } + else // 0x8000 + { + m_gg_bypass = BIT(data, 0); + for (int i = 0; i < 3; i++) { - // bit 0 is always set (GG enable?) - m_gg_is_comp[0] = BIT(data, 1); - m_gg_is_comp[1] = BIT(data, 2); - m_gg_is_comp[2] = BIT(data, 3); - m_gg_disable[0] = BIT(data, 4); - m_gg_disable[1] = BIT(data, 5); - m_gg_disable[2] = BIT(data, 6); - // bit 7 is always clear - logerror("Game Genie Summary:\n"); - for (int i = 0; i < 3; i++) - { - logerror("Code %d: %s\n", i, m_gg_disable[i] ? "No" : "Yes"); - if (!m_gg_disable[i]) - { - logerror("\tAddr: 0x%X\n", m_gg_addr[i]); - logerror("\tValue: 0x%X\n", m_gg_repl[i]); - if (m_gg_is_comp[i]) - logerror("\t if equals: 0x%X\n", m_gg_comp[i]); + m_gg_is_comp[i] = BIT(data, i + 1); + m_gg_enable[i] = !BIT(data, i + 4); + } + // bit 7 is unused and always zero - } + logerror("Game Genie Summary:\n"); + for (int i = 0; i < 3; i++) + { + logerror("Code %d: %s\n", i, m_gg_enable[i] ? "Yes" : "No"); + if (m_gg_enable[i]) + { + logerror("\tAddr: 0x%X\n", m_gg_addr[i]); + logerror("\tValue: 0x%X\n", m_gg_repl[i]); + if (m_gg_is_comp[i]) + logerror("\t if equals: 0x%X\n", m_gg_comp[i]); } } } - else - m_ggslot->write_h(offset, data); } -void nes_ggenie_device::write_m(offs_t offset, uint8_t data) +void nes_ggenie_device::write_m(offs_t offset, u8 data) { - if (m_gg_bypass && m_ggslot) + if (m_gg_bypass) m_ggslot->write_m(offset, data); } -void nes_ggenie_device::write_l(offs_t offset, uint8_t data) +void nes_ggenie_device::write_l(offs_t offset, u8 data) { - if (m_gg_bypass && m_ggslot) + if (m_gg_bypass) m_ggslot->write_l(offset, data); } -uint8_t nes_ggenie_device::read_h(offs_t offset) +u8 nes_ggenie_device::read_h(offs_t offset) { if (m_gg_bypass && m_ggslot->m_cart) { - uint8_t rom_value = m_ggslot->m_cart->hi_access_rom(offset); + u8 rom_value = m_ggslot->m_cart->hi_access_rom(offset); // check if GG code has to act on this address for (int i = 0; i < 3; i++) { - if (!m_gg_disable[i] && offset == m_gg_addr[i]) + if (m_gg_enable[i] && offset == m_gg_addr[i]) { - if (!m_gg_is_comp[i] || (m_gg_is_comp[i] && m_gg_comp[i] == rom_value)) + if (!m_gg_is_comp[i] || m_gg_comp[i] == rom_value) return m_gg_repl[i]; } } - return rom_value; + return rom_value; } - return hi_access_rom(offset); + return m_prg[offset & 0xfff]; // ROM is only 4K } -uint8_t nes_ggenie_device::read_m(offs_t offset) +u8 nes_ggenie_device::read_m(offs_t offset) { - if (m_gg_bypass && m_ggslot->m_cart) - return m_ggslot->m_cart->read_m(offset); + if (m_gg_bypass) + return m_ggslot->read_m(offset); return 0xff; } -uint8_t nes_ggenie_device::read_l(offs_t offset) +u8 nes_ggenie_device::read_l(offs_t offset) { - if (m_gg_bypass && m_ggslot->m_cart) - return m_ggslot->m_cart->read_l(offset); + if (m_gg_bypass) + return m_ggslot->read_l(offset); return 0xff; } -void nes_ggenie_device::chr_w(offs_t offset, uint8_t data) +void nes_ggenie_device::chr_w(offs_t offset, u8 data) { - int bank = offset >> 10; - if (m_gg_bypass && m_ggslot->m_cart) - { m_ggslot->m_cart->chr_w(offset, data); - return; - } - - if (m_chr_src[bank] == CHRRAM) - m_chr_access[bank][offset & 0x3ff] = data; } -uint8_t nes_ggenie_device::chr_r(offs_t offset) +u8 nes_ggenie_device::chr_r(offs_t offset) { - int bank = offset >> 10; - if (m_gg_bypass && m_ggslot->m_cart) - return m_ggslot->m_cart->chr_r(offset); - - return m_chr_access[bank][offset & 0x3ff]; + return m_ggslot->m_cart->chr_r(offset); + else + { + // there is no on-board CHRROM, 1 of 4 values are generated based on PPU A2, A4, A5, A6, A7, resulting in 16 tiles + static constexpr u8 chr_lut[4] = { 0x00, 0xf0, 0x0f, 0xff }; + return chr_lut[BIT(offset, BIT(offset, 2) ? 4 : 6, 2)]; + } } -void nes_ggenie_device::nt_w(offs_t offset, uint8_t data) +void nes_ggenie_device::nt_w(offs_t offset, u8 data) { - int page = ((offset & 0xc00) >> 10); - if (m_gg_bypass && m_ggslot->m_cart) - { m_ggslot->m_cart->nt_w(offset, data); - return; - } - - if (!m_nt_writable[page]) - return; - - m_nt_access[page][offset & 0x3ff] = data; + else + device_nes_cart_interface::nt_w(offset, data); } -uint8_t nes_ggenie_device::nt_r(offs_t offset) +u8 nes_ggenie_device::nt_r(offs_t offset) { - int page = ((offset & 0xc00) >> 10); - if (m_gg_bypass && m_ggslot->m_cart) return m_ggslot->m_cart->nt_r(offset); - - return m_nt_access[page][offset & 0x3ff]; + else + return device_nes_cart_interface::nt_r(offset); } diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/ggenie.h mame-0.243+dfsg.1/src/devices/bus/nes/ggenie.h --- mame-0.242+dfsg.1/src/devices/bus/nes/ggenie.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/ggenie.h 2022-04-29 05:37:26.000000000 +0000 @@ -14,26 +14,26 @@ { public: // construction/destruction - nes_ggenie_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_ggenie_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - virtual uint8_t read_l(offs_t offset) override; - virtual uint8_t read_m(offs_t offset) override; - virtual uint8_t read_h(offs_t offset) override; - virtual void write_l(offs_t offset, uint8_t data) override; - virtual void write_m(offs_t offset, uint8_t data) override; - virtual void write_h(offs_t offset, uint8_t data) override; - - virtual uint8_t chr_r(offs_t offset) override; - virtual void chr_w(offs_t offset, uint8_t data) override; - virtual uint8_t nt_r(offs_t offset) override; - virtual void nt_w(offs_t offset, uint8_t data) override; + virtual u8 read_l(offs_t offset) override; + virtual u8 read_m(offs_t offset) override; + virtual u8 read_h(offs_t offset) override; + virtual void write_l(offs_t offset, u8 data) override; + virtual void write_m(offs_t offset, u8 data) override; + virtual void write_h(offs_t offset, u8 data) override; + + virtual u8 chr_r(offs_t offset) override; + virtual void chr_w(offs_t offset, u8 data) override; + virtual u8 nt_r(offs_t offset) override; + virtual void nt_w(offs_t offset, u8 data) override; void hblank_irq(int scanline, int vblank, int blanked) override { if (m_gg_bypass && m_ggslot->m_cart) m_ggslot->m_cart->hblank_irq(scanline, vblank, blanked); } void scanline_irq(int scanline, int vblank, int blanked) override { if (m_gg_bypass && m_ggslot->m_cart) m_ggslot->m_cart->scanline_irq(scanline, vblank, blanked); } void ppu_latch(offs_t offset) override { if (m_gg_bypass && m_ggslot->m_cart) m_ggslot->m_cart->ppu_latch(offset); } virtual void pcb_reset() override; - virtual void pcb_start(running_machine &machine, uint8_t *ciram_ptr, bool cart_mounted) override; + virtual void pcb_start(running_machine &machine, u8 *ciram_ptr, bool cart_mounted) override; protected: // device-level overrides @@ -42,16 +42,16 @@ virtual void device_add_mconfig(machine_config &config) override; private: - // emulate the Game Genie! + // passthrough cart slot required_device m_ggslot; - int m_gg_bypass; + bool m_gg_bypass; // GG codes - uint16_t m_gg_addr[3]; - uint8_t m_gg_repl[3]; - uint8_t m_gg_comp[3]; - int m_gg_disable[3]; - int m_gg_is_comp[3]; + u16 m_gg_addr[3]; + u8 m_gg_repl[3]; + u8 m_gg_comp[3]; + bool m_gg_enable[3]; + bool m_gg_is_comp[3]; }; diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/henggedianzi.cpp mame-0.243+dfsg.1/src/devices/bus/nes/henggedianzi.cpp --- mame-0.242+dfsg.1/src/devices/bus/nes/henggedianzi.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/henggedianzi.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -52,34 +52,6 @@ -void nes_hengg_srich_device::device_start() -{ - common_start(); -} - -void nes_hengg_srich_device::pcb_reset() -{ - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - prg32(0); - chr8(0, m_chr_source); -} - -void nes_hengg_xhzs_device::device_start() -{ - common_start(); -} - -void nes_hengg_xhzs_device::pcb_reset() -{ - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - prg32(0); - chr8(0, m_chr_source); -} - - - - - /*------------------------------------------------- mapper specific handlers -------------------------------------------------*/ diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/henggedianzi.h mame-0.243+dfsg.1/src/devices/bus/nes/henggedianzi.h --- mame-0.242+dfsg.1/src/devices/bus/nes/henggedianzi.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/henggedianzi.h 2022-04-29 05:37:26.000000000 +0000 @@ -17,12 +17,6 @@ nes_hengg_srich_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void write_h(offs_t offset, uint8_t data) override; - - virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; @@ -36,12 +30,6 @@ virtual void write_l(offs_t offset, uint8_t data) override; virtual void write_h(offs_t offset, uint8_t data) override; - - virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/hes.cpp mame-0.243+dfsg.1/src/devices/bus/nes/hes.cpp --- mame-0.242+dfsg.1/src/devices/bus/nes/hes.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/hes.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -33,26 +33,12 @@ DEFINE_DEVICE_TYPE(NES_HES, nes_hes_device, "nes_hes", "NES Cart HES PCB") -nes_hes_device::nes_hes_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +nes_hes_device::nes_hes_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_nrom_device(mconfig, NES_HES, tag, owner, clock) { } -void nes_hes_device::device_start() -{ - common_start(); -} - -void nes_hes_device::pcb_reset() -{ - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - prg32(0); - chr8(0, m_chr_source); -} - - - /*------------------------------------------------- mapper specific handlers -------------------------------------------------*/ @@ -69,19 +55,19 @@ iNES: mapper 113 - In MESS: Supported. + In MAME: Supported. -------------------------------------------------*/ -void nes_hes_device::write_l(offs_t offset, uint8_t data) +void nes_hes_device::write_l(offs_t offset, u8 data) { LOG_MMC(("hes write_l, offset: %04x, data: %02x\n", offset, data)); - if (!(offset & 0x100)) + offset += 0x100; + if (BIT(offset, 8)) // $41xx, $43xx, ... $5fxx { - prg32((data & 0x38) >> 3); - chr8((data & 0x07) | ((data & 0x40) >> 3), CHRROM); - if (m_pcb_ctrl_mirror) - set_nt_mirroring(BIT(data, 7) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ); + prg32(BIT(data, 3, 3)); + chr8(bitswap<4>(data, 6, 2, 1, 0), CHRROM); + set_nt_mirroring(BIT(data, 7) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ); } } diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/hes.h mame-0.243+dfsg.1/src/devices/bus/nes/hes.h --- mame-0.242+dfsg.1/src/devices/bus/nes/hes.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/hes.h 2022-04-29 05:37:26.000000000 +0000 @@ -14,15 +14,9 @@ { public: // construction/destruction - nes_hes_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_hes_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - virtual void write_l(offs_t offset, uint8_t data) override; - - virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; + virtual void write_l(offs_t offset, u8 data) override; }; diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/irem.cpp mame-0.243+dfsg.1/src/devices/bus/nes/irem.cpp --- mame-0.242+dfsg.1/src/devices/bus/nes/irem.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/irem.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -40,38 +40,38 @@ DEFINE_DEVICE_TYPE(NES_H3001, nes_h3001_device, "ns_h3001", "NES Cart Irem H-3001 PCB") -nes_lrog017_device::nes_lrog017_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +nes_lrog017_device::nes_lrog017_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_nrom_device(mconfig, NES_LROG017, tag, owner, clock) { } -nes_holydivr_device::nes_holydivr_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +nes_holydivr_device::nes_holydivr_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_nrom_device(mconfig, NES_HOLYDIVR, tag, owner, clock) { } -nes_tam_s1_device::nes_tam_s1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +nes_tam_s1_device::nes_tam_s1_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_nrom_device(mconfig, NES_TAM_S1, tag, owner, clock) { } -nes_g101_device::nes_g101_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : nes_nrom_device(mconfig, NES_G101, tag, owner, clock), m_latch(0) +nes_g101_device::nes_g101_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u8 prg_mask) + : nes_nrom_device(mconfig, type, tag, owner, clock), m_latch(0), m_reg(0), m_prg_mask(prg_mask) { } -nes_h3001_device::nes_h3001_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : nes_nrom_device(mconfig, NES_H3001, tag, owner, clock), m_irq_count(0), m_irq_count_latch(0), m_irq_enable(0), irq_timer(nullptr) +nes_g101_device::nes_g101_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : nes_g101_device(mconfig, NES_G101, tag, owner, clock, 0x1f) { } +nes_h3001_device::nes_h3001_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : nes_g101_device(mconfig, NES_H3001, tag, owner, clock, 0x3f), m_irq_count(0), m_irq_count_latch(0), m_irq_enable(0), irq_timer(nullptr) +{ +} -void nes_lrog017_device::device_start() -{ - common_start(); -} void nes_lrog017_device::pcb_reset() { @@ -82,51 +82,39 @@ chr2_6(2, CHRRAM); } -void nes_holydivr_device::device_start() -{ - common_start(); -} - void nes_holydivr_device::pcb_reset() { - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; prg16_89ab(0); prg16_cdef(m_prg_chunks - 1); chr8(0, m_chr_source); } -void nes_tam_s1_device::device_start() -{ - common_start(); -} - void nes_tam_s1_device::pcb_reset() { - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; prg16_89ab(m_prg_chunks - 1); prg16_cdef(0); - chr8(0, m_chr_source); } void nes_g101_device::device_start() { common_start(); save_item(NAME(m_latch)); + save_item(NAME(m_reg)); } void nes_g101_device::pcb_reset() { - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; prg16_89ab(0); prg16_cdef(m_prg_chunks - 1); chr8(0, m_chr_source); m_latch = 0; + m_reg = 0; } void nes_h3001_device::device_start() { - common_start(); + nes_g101_device::device_start(); irq_timer = timer_alloc(TIMER_IRQ); irq_timer->adjust(attotime::zero, 0, clocks_to_attotime(1)); @@ -137,11 +125,7 @@ void nes_h3001_device::pcb_reset() { - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - prg16_89ab(0); - prg16_cdef(m_prg_chunks - 1); - chr8(0, m_chr_source); - + nes_g101_device::pcb_reset(); m_irq_enable = 0; m_irq_count = 0; m_irq_count_latch = 0; @@ -166,7 +150,7 @@ -------------------------------------------------*/ -void nes_lrog017_device::write_h(offs_t offset, uint8_t data) +void nes_lrog017_device::write_h(offs_t offset, u8 data) { LOG_MMC(("lrog017 write_h, offset: %04x, data: %02x\n", offset, data)); @@ -185,7 +169,7 @@ -------------------------------------------------*/ -void nes_holydivr_device::write_h(offs_t offset, uint8_t data) +void nes_holydivr_device::write_h(offs_t offset, u8 data) { LOG_MMC(("holy diver write_h, offset: %04x, data: %02x\n", offset, data)); @@ -205,19 +189,16 @@ iNES: mapper 97 - In MESS: Supported. + In MAME: Supported. -------------------------------------------------*/ -void nes_tam_s1_device::write_h(offs_t offset, uint8_t data) +void nes_tam_s1_device::write_h(offs_t offset, u8 data) { LOG_MMC(("tam s1 write_h, offset: %04x, data: %02x\n", offset, data)); if (offset < 0x4000) { - // this pcb is subject to bus conflict - data = account_bus_conflict(offset, data); - set_nt_mirroring(BIT(data, 7) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ); prg16_cdef(data); } @@ -227,40 +208,41 @@ Irem G-101 board emulation - Major League uses hardwired mirroring + Major League has hardwired mirroring and PRG mode latch iNES: mapper 32 -------------------------------------------------*/ -void nes_g101_device::write_h(offs_t offset, uint8_t data) +void nes_g101_device::set_prg() +{ + prg8_x(0 ^ m_latch, m_reg); + prg8_x(2 ^ m_latch, m_prg_mask - 1); +} + +void nes_g101_device::write_h(offs_t offset, u8 data) { LOG_MMC(("g101 write_h, offset: %04x, data: %02x\n", offset, data)); switch (offset & 0x7000) { case 0x0000: - if (m_latch) - { - prg8_89(0xfe); - prg8_cd(data & 0x1f); - } - else - { - prg8_89(data & 0x1f); - prg8_cd(0xfe); - } + m_reg = data & m_prg_mask; + set_prg(); break; case 0x1000: - m_latch = BIT(data, 1); if (m_pcb_ctrl_mirror) + { + m_latch = data & 0x02; + set_prg(); set_nt_mirroring(BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); + } break; case 0x2000: - prg8_ab(data & 0x1f); + prg8_ab(data & m_prg_mask); break; case 0x3000: - chr1_x(offset & 0x07, data & 0x7f, CHRROM); + chr1_x(offset & 0x07, data, CHRROM); break; } } @@ -274,11 +256,10 @@ iNES: mapper 65 - In MESS: Supported. + In MAME: Supported. -------------------------------------------------*/ - void nes_h3001_device::device_timer(emu_timer &timer, device_timer_id id, int param) { if (id == TIMER_IRQ) @@ -287,7 +268,7 @@ { // 16bit counter, IRQ fired when the counter reaches 0 // after firing, the counter is *not* reloaded and does not wrap - if (m_irq_count > 0) + if (m_irq_count) m_irq_count--; if (!m_irq_count) @@ -299,52 +280,39 @@ } } -void nes_h3001_device::write_h(offs_t offset, uint8_t data) +void nes_h3001_device::write_h(offs_t offset, u8 data) { LOG_MMC(("h3001 write_h, offset %04x, data: %02x\n", offset, data)); - switch (offset & 0x7fff) + switch (offset & 0x7007) { - case 0x0000: - prg8_89(data); + default: + nes_g101_device::write_h(offset, data); + break; + case 0x1000: + m_latch = (data & 0x80) >> 6; + set_prg(); break; - case 0x1001: - set_nt_mirroring(BIT(data, 7) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); + set_nt_mirroring(BIT(data, 6) ? PPU_MIRROR_LOW : (BIT(data, 7) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT)); + break; + case 0x1002: break; - case 0x1003: m_irq_enable = data & 0x80; set_irq_line(CLEAR_LINE); break; - case 0x1004: m_irq_count = m_irq_count_latch; set_irq_line(CLEAR_LINE); break; - case 0x1005: m_irq_count_latch = (m_irq_count_latch & 0x00ff) | (data << 8); break; - case 0x1006: m_irq_count_latch = (m_irq_count_latch & 0xff00) | data; break; - - case 0x2000: - prg8_ab(data); - break; - - case 0x3000: case 0x3001: case 0x3002: case 0x3003: - case 0x3004: case 0x3005: case 0x3006: case 0x3007: - chr1_x(offset & 0x07, data, CHRROM); - break; - - case 0x4000: - prg8_cd(data); - break; - - default: + case 0x1007: break; } } diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/irem.h mame-0.243+dfsg.1/src/devices/bus/nes/irem.h --- mame-0.242+dfsg.1/src/devices/bus/nes/irem.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/irem.h 2022-04-29 05:37:26.000000000 +0000 @@ -14,15 +14,11 @@ { public: // construction/destruction - nes_lrog017_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_lrog017_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - virtual void write_h(offs_t offset, uint8_t data) override; + virtual void write_h(offs_t offset, u8 data) override; virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; @@ -32,15 +28,11 @@ { public: // construction/destruction - nes_holydivr_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_holydivr_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - virtual void write_h(offs_t offset, uint8_t data) override; + virtual void write_h(offs_t offset, u8 data) override; virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; @@ -50,15 +42,11 @@ { public: // construction/destruction - nes_tam_s1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_tam_s1_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - virtual void write_h(offs_t offset, uint8_t data) override; + virtual void write_h(offs_t offset, u8 data) override; virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; @@ -68,29 +56,36 @@ { public: // construction/destruction - nes_g101_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_g101_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - virtual void write_h(offs_t offset, uint8_t data) override; + virtual void write_h(offs_t offset, u8 data) override; virtual void pcb_reset() override; protected: + // construction/destruction + nes_g101_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u8 prg_mask); + // device-level overrides virtual void device_start() override; - uint8_t m_latch; + void set_prg(); + u8 m_latch; + +private: + u8 m_reg, m_prg_mask; }; // ======================> nes_h3001_device -class nes_h3001_device : public nes_nrom_device +class nes_h3001_device : public nes_g101_device { public: // construction/destruction - nes_h3001_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_h3001_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - virtual void write_h(offs_t offset, uint8_t data) override; + virtual void write_h(offs_t offset, u8 data) override; virtual void pcb_reset() override; @@ -99,13 +94,15 @@ virtual void device_start() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param) override; - uint16_t m_irq_count, m_irq_count_latch; - int m_irq_enable; +private: + u16 m_irq_count, m_irq_count_latch; + u8 m_irq_enable; - static const device_timer_id TIMER_IRQ = 0; + static constexpr device_timer_id TIMER_IRQ = 0; emu_timer *irq_timer; }; + // device type definition DECLARE_DEVICE_TYPE(NES_LROG017, nes_lrog017_device) DECLARE_DEVICE_TYPE(NES_HOLYDIVR, nes_holydivr_device) diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/jaleco.cpp mame-0.243+dfsg.1/src/devices/bus/nes/jaleco.cpp --- mame-0.242+dfsg.1/src/devices/bus/nes/jaleco.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/jaleco.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -21,7 +21,6 @@ #include "emu.h" #include "jaleco.h" -#include "sound/samples.h" #include "speaker.h" @@ -141,35 +140,6 @@ -void nes_jf11_device::device_start() -{ - common_start(); -} - -void nes_jf11_device::pcb_reset() -{ - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - prg32(0); - chr8(0, m_chr_source); -} - -void nes_jf13_device::device_start() -{ - common_start(); -} - -void nes_jf13_device::pcb_reset() -{ - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - prg32(0); - chr8(0, m_chr_source); -} - -void nes_jf16_device::device_start() -{ - common_start(); -} - void nes_jf16_device::pcb_reset() { m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; @@ -193,18 +163,6 @@ m_latch = 0; } -void nes_jf19_device::device_start() -{ - common_start(); -} - -void nes_jf19_device::pcb_reset() -{ - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - prg32(0); - chr8(0, m_chr_source); -} - void nes_ss88006_device::device_start() { common_start(); @@ -513,9 +471,9 @@ case 0x3000: case 0x3001: case 0x3002: case 0x3003: case 0x4000: case 0x4001: case 0x4002: case 0x4003: case 0x5000: case 0x5001: case 0x5002: case 0x5003: - bank = ((offset & 0x7000) - 0x2000) / 0x0800 + ((offset & 0x0002) >> 1); + bank = 2 * (BIT(offset, 12, 3) - 2) + BIT(offset, 1); if (offset & 0x0001) - m_mmc_vrom_bank[bank] = (m_mmc_vrom_bank[bank] & 0x0f) | ((data & 0x0f)<< 4); + m_mmc_vrom_bank[bank] = (m_mmc_vrom_bank[bank] & 0x0f) | ((data & 0x0f) << 4); else m_mmc_vrom_bank[bank] = (m_mmc_vrom_bank[bank] & 0xf0) | (data & 0x0f); @@ -575,7 +533,7 @@ { // printf("sample write: data: %02x\n", data); if ((m_latch & 2) && !(data & 2)) - dev.start((data >> 2) & 0x1f, (data >> 2) & 0x1f); + dev.start(BIT(data, 2, 5), BIT(data, 2, 5)); } m_latch = data; break; diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/jaleco.h mame-0.243+dfsg.1/src/devices/bus/nes/jaleco.h --- mame-0.242+dfsg.1/src/devices/bus/nes/jaleco.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/jaleco.h 2022-04-29 05:37:26.000000000 +0000 @@ -18,12 +18,6 @@ nes_jf11_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void write_m(offs_t offset, uint8_t data) override; - - virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; @@ -37,12 +31,8 @@ virtual void write_m(offs_t offset, uint8_t data) override; - virtual void pcb_reset() override; - protected: // device-level overrides - virtual void device_start() override; - virtual void device_add_mconfig(machine_config &config) override; private: @@ -61,10 +51,6 @@ virtual void write_h(offs_t offset, uint8_t data) override; virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; @@ -118,13 +104,8 @@ virtual void write_h(offs_t offset, uint8_t data) override; - virtual void pcb_reset() override; - protected: nes_jf19_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; }; diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/kaiser.cpp mame-0.243+dfsg.1/src/devices/bus/nes/kaiser.cpp --- mame-0.242+dfsg.1/src/devices/bus/nes/kaiser.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/kaiser.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -68,12 +68,12 @@ { } -nes_ks7058_device::nes_ks7058_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +nes_ks7058_device::nes_ks7058_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_nrom_device(mconfig, NES_KS7058, tag, owner, clock) { } -nes_ks7022_device::nes_ks7022_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +nes_ks7022_device::nes_ks7022_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_nrom_device(mconfig, NES_KS7022, tag, owner, clock), m_latch(0) { } @@ -108,7 +108,7 @@ { } -nes_ks7017_device::nes_ks7017_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +nes_ks7017_device::nes_ks7017_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_nrom_device(mconfig, NES_KS7017, tag, owner, clock), m_latch(0), m_irq_count(0), m_irq_status(0), m_irq_enable(0), irq_timer(nullptr) { } @@ -123,12 +123,12 @@ { } -nes_ks7012_device::nes_ks7012_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +nes_ks7012_device::nes_ks7012_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_nrom_device(mconfig, NES_KS7012, tag, owner, clock) { } -nes_ks7013b_device::nes_ks7013b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +nes_ks7013b_device::nes_ks7013b_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_nrom_device(mconfig, NES_KS7013B, tag, owner, clock) { } @@ -138,13 +138,13 @@ { } -nes_ks7031_device::nes_ks7031_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +nes_ks7031_device::nes_ks7031_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_nrom_device(mconfig, NES_KS7031, tag, owner, clock) { } -nes_ks7037_device::nes_ks7037_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : nes_nrom_device(mconfig, NES_KS7037, tag, owner, clock) +nes_ks7037_device::nes_ks7037_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : nes_nrom_device(mconfig, NES_KS7037, tag, owner, clock), m_reg(0) { } @@ -170,18 +170,6 @@ m_latch = (m_latch + 1) & 0x03; } -void nes_ks7058_device::device_start() -{ - common_start(); -} - -void nes_ks7058_device::pcb_reset() -{ - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - prg32(0); - chr8(0, m_chr_source); -} - void nes_ks7022_device::device_start() { common_start(); @@ -190,7 +178,6 @@ void nes_ks7022_device::pcb_reset() { - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; prg16_89ab(0); prg16_cdef(m_prg_chunks - 1); chr8(0, m_chr_source); @@ -213,16 +200,15 @@ void nes_ks7032_device::pcb_reset() { - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - chr8(0, m_chr_source); - m_latch = 0; m_irq_enable = 0; m_irq_count = 0; m_irq_count_latch = 0; std::fill(std::begin(m_reg), std::end(m_reg), 0x00); + prg_update(); prg8_ef((m_prg_chunks << 1) - 1); + chr8(0, m_chr_source); } void nes_ks7016_device::device_start() @@ -237,8 +223,6 @@ prg8_ab(0x0d ^ m_a15_flip); prg8_cd(0x0e ^ m_a15_flip); prg8_ef(0x0f ^ m_a15_flip); - chr8(0, CHRRAM); - set_nt_mirroring(PPU_MIRROR_VERT); m_latch = 0; } @@ -257,10 +241,8 @@ void nes_ks7017_device::pcb_reset() { - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; prg16_89ab(0); prg16_cdef(2); - chr8(0, m_chr_source); m_latch = 0; m_irq_enable = 0; @@ -268,11 +250,6 @@ m_irq_status = 0; } -void nes_ks7021a_device::device_start() -{ - common_start(); -} - void nes_ks7021a_device::pcb_reset() { prg16_89ab(0); @@ -291,34 +268,19 @@ prg16_89ab(0x05); // all upper banks are fixed prg16_cdef(0x03); chr8(0, CHRROM); - set_nt_mirroring(PPU_MIRROR_VERT); m_latch = 0; } -void nes_ks7012_device::device_start() -{ - common_start(); -} - void nes_ks7012_device::pcb_reset() { - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - prg32(0xff); - chr8(0, m_chr_source); -} - -void nes_ks7013b_device::device_start() -{ - common_start(); + prg32((m_prg_chunks >> 1) - 1); } void nes_ks7013b_device::pcb_reset() { - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; prg16_89ab(0); prg16_cdef(m_prg_chunks - 1); - chr8(0, m_chr_source); } void nes_ks7030_device::device_start() @@ -330,8 +292,6 @@ void nes_ks7030_device::pcb_reset() { prg32((m_prg_chunks >> 1) - 1); // not really used... - chr8(0, CHRRAM); - set_nt_mirroring(PPU_MIRROR_VERT); m_reg[0] = m_reg[1] = 0; } @@ -345,18 +305,13 @@ void nes_ks7031_device::pcb_reset() { prg32(0); // not really used... - chr8(0, CHRRAM); - m_reg[0] = 0; - m_reg[1] = 0; - m_reg[2] = 0; - m_reg[3] = 0; + std::fill(std::begin(m_reg), std::end(m_reg), 0x00); } void nes_ks7037_device::device_start() { common_start(); - save_item(NAME(m_latch)); save_item(NAME(m_reg)); } @@ -366,10 +321,8 @@ prg8_ab(0x0e); prg8_cd(0); prg8_ef(0x0f); - chr8(0, CHRRAM); - std::fill(std::begin(m_reg), std::end(m_reg), 0x00); - m_latch = 0; + m_reg = 0; } void nes_ks7057_device::device_start() @@ -382,7 +335,6 @@ { prg8_ab(0x0d); prg16_cdef(0x07); - chr8(0, CHRRAM); std::fill(std::begin(m_reg), std::end(m_reg), 0x00); } @@ -424,7 +376,7 @@ -------------------------------------------------*/ -void nes_ks7058_device::write_h(offs_t offset, uint8_t data) +void nes_ks7058_device::write_h(offs_t offset, u8 data) { LOG_MMC(("ks7058 write_h, offset: %04x, data: %02x\n", offset, data)); @@ -451,18 +403,17 @@ -------------------------------------------------*/ -void nes_ks7022_device::write_h(offs_t offset, uint8_t data) +void nes_ks7022_device::write_h(offs_t offset, u8 data) { LOG_MMC(("ks7022 write_h, offset: %04x, data: %02x\n", offset, data)); if (offset == 0) set_nt_mirroring(BIT(data, 2) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); - - if (offset == 0x2000) + else if (offset == 0x2000) m_latch = data & 0x0f; } -uint8_t nes_ks7022_device::read_h(offs_t offset) +u8 nes_ks7022_device::read_h(offs_t offset) { LOG_MMC(("ks7022 read_h, offset: %04x\n", offset)); @@ -676,7 +627,7 @@ } } -void nes_ks7017_device::write_l(offs_t offset, uint8_t data) +void nes_ks7017_device::write_l(offs_t offset, u8 data) { LOG_MMC(("ks7017 write_l, offset: %04x, data: %02x\n", offset, data)); @@ -692,30 +643,32 @@ } } -void nes_ks7017_device::write_ex(offs_t offset, uint8_t data) +void nes_ks7017_device::write_ex(offs_t offset, u8 data) { LOG_MMC(("ks7017 write_ex, offset: %04x, data: %02x\n", offset, data)); - offset += 0x20; - - if (offset == 0x0020) // 0x4020 - m_irq_count = (m_irq_count & 0xff00) | data; - if (offset == 0x0021) // 0x4021 + offset += 0x4020; + switch (offset) { - m_irq_count = (m_irq_count & 0x00ff) | (data << 8); - m_irq_enable = 1; + case 0x4020: + m_irq_count = (m_irq_count & 0xff00) | data; + break; + case 0x4021: + m_irq_count = (m_irq_count & 0x00ff) | (data << 8); + m_irq_enable = 1; + break; + case 0x4025: + set_nt_mirroring(BIT(data, 3) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); + break; } - - if (offset == 0x0025) // 0x4025 - set_nt_mirroring(BIT(data, 3) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); } -uint8_t nes_ks7017_device::read_ex(offs_t offset) +u8 nes_ks7017_device::read_ex(offs_t offset) { LOG_MMC(("ks7017 read_ex, offset: %04x\n", offset)); - offset += 0x20; - if (offset == 0x0030) // 0x4030 + offset += 0x4020; + if (offset == 0x4030) { int temp = m_irq_status; m_irq_status &= ~0x01; @@ -808,7 +761,7 @@ -------------------------------------------------*/ -void nes_ks7012_device::write_h(offs_t offset, uint8_t data) +void nes_ks7012_device::write_h(offs_t offset, u8 data) { LOG_MMC(("ks7012 write_h, offset: %04x, data: %02x\n", offset, data)); @@ -830,13 +783,13 @@ -------------------------------------------------*/ -void nes_ks7013b_device::write_m(offs_t offset, uint8_t data) +void nes_ks7013b_device::write_m(offs_t offset, u8 data) { LOG_MMC(("ks7013b write_l, offset: %04x, data: %02x\n", offset, data)); prg16_89ab(data); } -void nes_ks7013b_device::write_h(offs_t offset, uint8_t data) +void nes_ks7013b_device::write_h(offs_t offset, u8 data) { LOG_MMC(("ks7013b write_h, offset: %04x, data: %02x\n", offset, data)); set_nt_mirroring((data & 1) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); @@ -932,20 +885,20 @@ -------------------------------------------------*/ -uint8_t nes_ks7031_device::read_m(offs_t offset) +u8 nes_ks7031_device::read_m(offs_t offset) { // LOG_MMC(("ks7031 read_m, offset: %04x\n", offset)); return m_prg[(m_reg[BIT(offset, 11, 2)] * 0x0800) + (offset & 0x7ff)]; } -uint8_t nes_ks7031_device::read_h(offs_t offset) +u8 nes_ks7031_device::read_h(offs_t offset) { // here the first 32K are accessed, but in 16x2K blocks loaded in reverse order - int accessed_2k = BIT(offset, 11, 4); - return m_prg[((0x0f - accessed_2k) * 0x0800) + (offset & 0x7ff)]; + int accessed_2k = BIT(~offset, 11, 4); + return m_prg[accessed_2k * 0x0800 + (offset & 0x7ff)]; } -void nes_ks7031_device::write_h(offs_t offset, uint8_t data) +void nes_ks7031_device::write_h(offs_t offset, u8 data) { LOG_MMC(("ks7031 write_h, offset: %04x, data: %02x\n", offset, data)); m_reg[BIT(offset, 11, 2)] = data & 0x3f; @@ -968,17 +921,7 @@ -------------------------------------------------*/ -void nes_ks7037_device::update_prg() -{ - prg8_89(m_reg[6]); - prg8_cd(m_reg[7]); - set_nt_page(0, CIRAM, m_reg[2] & 1, 1); - set_nt_page(2, CIRAM, m_reg[3] & 1, 1); - set_nt_page(1, CIRAM, m_reg[4] & 1, 1); - set_nt_page(3, CIRAM, m_reg[5] & 1, 1); -} - -uint8_t nes_ks7037_device::read_m(offs_t offset) +u8 nes_ks7037_device::read_m(offs_t offset) { // LOG_MMC(("ks7037 read_m, offset: %04x\n", offset)); if (offset < 0x1000) @@ -987,14 +930,14 @@ return m_prg[0x0f * 0x1000 + (offset & 0x0fff)]; // 4k PRG bank 15 is fixed } -void nes_ks7037_device::write_m(offs_t offset, uint8_t data) +void nes_ks7037_device::write_m(offs_t offset, u8 data) { LOG_MMC(("ks7037 write_m, offset: %04x, data: %02x\n", offset, data)); if (offset < 0x1000) m_prgram[offset] = data; } -uint8_t nes_ks7037_device::read_h(offs_t offset) +u8 nes_ks7037_device::read_h(offs_t offset) { // LOG_MMC(("ks7037 read_h, offset: %04x\n", offset)); @@ -1004,24 +947,24 @@ return hi_access_rom(offset); } -void nes_ks7037_device::write_h(offs_t offset, uint8_t data) +void nes_ks7037_device::write_h(offs_t offset, u8 data) { LOG_MMC(("ks7037 write_h, offset: %04x, data: %02x\n", offset, data)); - if (offset >= 0x3000 && offset < 0x4000) - m_prgram[0x1000 + (offset & 0x0fff)] = data; - else + switch (offset & 0x7000) { - switch (offset & 0x6001) - { - case 0x0000: - m_latch = data & 7; - break; - case 0x0001: - m_reg[m_latch] = data; - update_prg(); - break; - } + case 0x0000: + case 0x1000: + if (!(offset & 1)) + m_reg = data & 7; + else if (m_reg >= 6) + prg8_x((m_reg & 1) << 1, data); + else if (m_reg >= 2) + set_nt_page(bitswap<2>(m_reg, 0, 2), CIRAM, data & 1, 1); + break; + case 0x3000: + m_prgram[0x1000 + (offset & 0x0fff)] = data; + break; } } diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/kaiser.h mame-0.243+dfsg.1/src/devices/bus/nes/kaiser.h --- mame-0.242+dfsg.1/src/devices/bus/nes/kaiser.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/kaiser.h 2022-04-29 05:37:26.000000000 +0000 @@ -33,15 +33,9 @@ { public: // construction/destruction - nes_ks7058_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_ks7058_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - virtual void write_h(offs_t offset, uint8_t data) override; - - virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; + virtual void write_h(offs_t offset, u8 data) override; }; @@ -51,10 +45,10 @@ { public: // construction/destruction - nes_ks7022_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_ks7022_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - virtual uint8_t read_h(offs_t offset) override; - virtual void write_h(offs_t offset, uint8_t data) override; + virtual u8 read_h(offs_t offset) override; + virtual void write_h(offs_t offset, u8 data) override; virtual void pcb_reset() override; @@ -63,7 +57,7 @@ virtual void device_start() override; private: - uint8_t m_latch; + u8 m_latch; }; @@ -95,7 +89,7 @@ u8 m_latch; u16 m_irq_count, m_irq_count_latch; - int m_irq_enable; + u8 m_irq_enable; static const device_timer_id TIMER_IRQ = 0; emu_timer *irq_timer; @@ -157,11 +151,11 @@ { public: // construction/destruction - nes_ks7017_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_ks7017_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - virtual uint8_t read_ex(offs_t offset) override; - virtual void write_ex(offs_t offset, uint8_t data) override; - virtual void write_l(offs_t offset, uint8_t data) override; + virtual u8 read_ex(offs_t offset) override; + virtual void write_ex(offs_t offset, u8 data) override; + virtual void write_l(offs_t offset, u8 data) override; virtual void pcb_reset() override; @@ -171,11 +165,11 @@ virtual void device_timer(emu_timer &timer, device_timer_id id, int param) override; private: - uint8_t m_latch; + u8 m_latch; - uint16_t m_irq_count; - uint8_t m_irq_status; - int m_irq_enable; + u16 m_irq_count; + u8 m_irq_status; + u8 m_irq_enable; static const device_timer_id TIMER_IRQ = 0; emu_timer *irq_timer; @@ -193,10 +187,6 @@ virtual void write_h(offs_t offset, u8 data) override; virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; @@ -228,15 +218,11 @@ { public: // construction/destruction - nes_ks7012_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_ks7012_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - virtual void write_h(offs_t offset, uint8_t data) override; + virtual void write_h(offs_t offset, u8 data) override; virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; @@ -246,16 +232,12 @@ { public: // construction/destruction - nes_ks7013b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_ks7013b_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - virtual void write_m(offs_t offset, uint8_t data) override; - virtual void write_h(offs_t offset, uint8_t data) override; + virtual void write_m(offs_t offset, u8 data) override; + virtual void write_h(offs_t offset, u8 data) override; virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; @@ -289,11 +271,11 @@ { public: // construction/destruction - nes_ks7031_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_ks7031_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - virtual uint8_t read_m(offs_t offset) override; - virtual uint8_t read_h(offs_t offset) override; - virtual void write_h(offs_t offset, uint8_t data) override; + virtual u8 read_m(offs_t offset) override; + virtual u8 read_h(offs_t offset) override; + virtual void write_h(offs_t offset, u8 data) override; virtual void pcb_reset() override; @@ -302,7 +284,7 @@ virtual void device_start() override; private: - uint8_t m_reg[4]; + u8 m_reg[4]; }; @@ -312,12 +294,12 @@ { public: // construction/destruction - nes_ks7037_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_ks7037_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - virtual uint8_t read_m(offs_t offset) override; - virtual uint8_t read_h(offs_t offset) override; - virtual void write_m(offs_t offset, uint8_t data) override; - virtual void write_h(offs_t offset, uint8_t data) override; + virtual u8 read_m(offs_t offset) override; + virtual u8 read_h(offs_t offset) override; + virtual void write_m(offs_t offset, u8 data) override; + virtual void write_h(offs_t offset, u8 data) override; virtual void pcb_reset() override; @@ -326,9 +308,7 @@ virtual void device_start() override; private: - void update_prg(); - uint8_t m_latch; - uint8_t m_reg[8]; + u8 m_reg; }; diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/konami.cpp mame-0.243+dfsg.1/src/devices/bus/nes/konami.cpp --- mame-0.242+dfsg.1/src/devices/bus/nes/konami.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/konami.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -168,9 +168,6 @@ void nes_konami_vrc4_device::pcb_reset() { - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - chr8(0, m_chr_source); - m_irq_mode = 0; m_irq_prescale = 0; m_irq_enable = 0; @@ -183,7 +180,10 @@ m_mmc_prg_bank[0] = 0; m_mmc_prg_bank[1] = 0; set_prg(); - std::fill(std::begin(m_mmc_vrom_bank), std::end(m_mmc_vrom_bank), 0x00); + + for (int i = 0; i < 8; i++) + m_mmc_vrom_bank[i] = i; + set_chr(); } void nes_konami_vrc7_device::pcb_reset() @@ -454,6 +454,12 @@ prg8_x(3, prg_base | prg_mask); } +void nes_konami_vrc4_device::set_chr(int chr_base, int chr_mask) +{ + for (int i = 0; i < 8; i++) + chr1_x(i, chr_base | (m_mmc_vrom_bank[i] & chr_mask), m_chr_source); +} + u8 nes_konami_vrc4_device::read_m(offs_t offset) { LOG_MMC(("VRC-4 read_m, offset: %04x\n", offset)); @@ -504,7 +510,7 @@ int shift = BIT(addr_lines, 0) * 4; int mask = shift ? 0x1f0 : 0x0f; m_mmc_vrom_bank[bank] = (m_mmc_vrom_bank[bank] & ~mask) | ((data << shift) & mask); - chr1_x(bank, m_mmc_vrom_bank[bank], m_chr_source); + set_chr(); break; } case 0x7000: diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/konami.h mame-0.243+dfsg.1/src/devices/bus/nes/konami.h --- mame-0.242+dfsg.1/src/devices/bus/nes/konami.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/konami.h 2022-04-29 05:37:26.000000000 +0000 @@ -109,7 +109,10 @@ void set_mirror(u8 data); void set_prg(int prg_base, int prg_mask); + void set_chr(int chr_base, int chr_mask); virtual void set_prg() { set_prg(0x00, 0x1f); } + virtual void set_chr() { set_chr(0x00, 0x1ff); } + u16 m_mmc_vrom_bank[8]; u8 m_mmc_prg_bank[2]; u8 m_prg_flip; diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/legacy.cpp mame-0.243+dfsg.1/src/devices/bus/nes/legacy.cpp --- mame-0.242+dfsg.1/src/devices/bus/nes/legacy.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/legacy.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -59,19 +59,6 @@ -void nes_ffe3_device::device_start() -{ - common_start(); -} - -void nes_ffe3_device::pcb_reset() -{ - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - prg32(0); - chr8(0, m_chr_source); -} - - void nes_ffe4_device::device_start() { common_start(); diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/legacy.h mame-0.243+dfsg.1/src/devices/bus/nes/legacy.h --- mame-0.242+dfsg.1/src/devices/bus/nes/legacy.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/legacy.h 2022-04-29 05:37:26.000000000 +0000 @@ -17,12 +17,6 @@ nes_ffe3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void write_h(offs_t offset, uint8_t data) override; - - virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; @@ -70,7 +64,6 @@ // construction/destruction nes_ffe8_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // device-level overrides virtual void write_l(offs_t offset, uint8_t data) override; virtual void write_h(offs_t offset, uint8_t data) override {} diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/mmc2.h mame-0.243+dfsg.1/src/devices/bus/nes/mmc2.h --- mame-0.242+dfsg.1/src/devices/bus/nes/mmc2.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/mmc2.h 2022-04-29 05:37:26.000000000 +0000 @@ -41,7 +41,6 @@ // construction/destruction nes_fxrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // device-level overrides virtual void write_h(offs_t offset, uint8_t data) override; virtual void pcb_reset() override; diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/mmc3_clones.cpp mame-0.243+dfsg.1/src/devices/bus/nes/mmc3_clones.cpp --- mame-0.242+dfsg.1/src/devices/bus/nes/mmc3_clones.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/mmc3_clones.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -52,6 +52,7 @@ DEFINE_DEVICE_TYPE(NES_GOUDER, nes_gouder_device, "nes_gouder", "NES Cart Gouder PCB") DEFINE_DEVICE_TYPE(NES_SA9602B, nes_sa9602b_device, "nes_sa9602b", "NES Cart SA-9602B PCB") DEFINE_DEVICE_TYPE(NES_SACHEN_SHERO, nes_sachen_shero_device, "nes_shero", "NES Cart Street Hero PCB") +DEFINE_DEVICE_TYPE(NES_SACHEN_ZGDH, nes_sachen_zgdh_device, "nes_zgdh", "NES Cart Zhongguo Daheng PCB") DEFINE_DEVICE_TYPE(NES_A9746, nes_a9746_device, "nes_bmc_a9746", "NES Cart A-9746 PCB") DEFINE_DEVICE_TYPE(NES_A88S1, nes_a88s1_device, "nes_a88s1", "NES Cart BMC A88S-1 PCB") @@ -157,7 +158,7 @@ // LIVE DEVICE //************************************************************************** -nes_nitra_device::nes_nitra_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +nes_nitra_device::nes_nitra_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_txrom_device(mconfig, NES_NITRA, tag, owner, clock) { } @@ -167,17 +168,17 @@ { } -nes_fs6_device::nes_fs6_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +nes_fs6_device::nes_fs6_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_txrom_device(mconfig, NES_FS6, tag, owner, clock) { } -nes_sbros11_device::nes_sbros11_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +nes_sbros11_device::nes_sbros11_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_txrom_device(mconfig, NES_SBROS11, tag, owner, clock) { } -nes_malisb_device::nes_malisb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +nes_malisb_device::nes_malisb_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_txrom_device(mconfig, NES_MALISB, tag, owner, clock) { } @@ -294,6 +295,11 @@ { } +nes_sachen_zgdh_device::nes_sachen_zgdh_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : nes_txrom_device(mconfig, NES_SACHEN_ZGDH, tag, owner, clock), m_reg(0) +{ +} + nes_a9746_device::nes_a9746_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_txrom_device(mconfig, NES_A9746, tag, owner, clock) { @@ -689,6 +695,20 @@ mmc3_common_initialize(0xff, 0xff, 0); } +void nes_sachen_zgdh_device::device_start() +{ + mmc3_start(); + save_item(NAME(m_reg)); +} + +void nes_sachen_zgdh_device::pcb_reset() +{ + assert(m_vram.size() >= 0x2000); + + m_reg = 0; + mmc3_common_initialize(0x1f, 0x7f, 0); +} + void nes_a9746_device::device_start() { mmc3_start(); @@ -909,8 +929,6 @@ void nes_bmc_f600_device::pcb_reset() { - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - m_reg = 0; mmc3_common_initialize(0x1f, 0x7f, 0); } @@ -1021,8 +1039,6 @@ void nes_bmc_810305c_device::pcb_reset() { - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - m_outer = 0; mmc3_common_initialize(0x1f, 0x7f, 0); } @@ -1112,10 +1128,10 @@ Bootleg Board by Nitra - Games: Time Diver Avenger + Games: Queen Bee, Time Diver Avenger - This acts basically like a MMC3 with different use of write - address. + MMC3 clone with A10 tied to what is normally A0 and + data instead coming from the lower address lines. iNES: mapper 250 @@ -1218,6 +1234,8 @@ This is very similar to mapper 196, but with additional data bit swap. + NES 2.0: mapper 325 + In MAME: Supported. -------------------------------------------------*/ @@ -1238,10 +1256,8 @@ { LOG_MMC(("malisb write_h, offset: %04x, data: %02x\n", offset, data)); - if (offset > 0x4000) - txrom_write((offset & 0xfffe) | BIT(offset, 2) | BIT(offset, 3), data); - else - txrom_write((offset & 0xfffe) | BIT(offset, 3), data); + offset = (offset & 0x6000) | BIT(offset, 3) | (BIT(offset, 14) & BIT(offset, 2)); + txrom_write(offset, data); } /*------------------------------------------------- @@ -1786,10 +1802,9 @@ prg32((data >> 4) | data); } -// writes to 0x8000-0xffff are like MMC3 but no PRG bankswitch (beacuse it is handled by low writes) +// writes to 0x8000-0xffff are like MMC3 but no PRG bankswitch (because it is handled by low writes) void nes_txc_tw_device::prg_cb(int start, int bank) { - return; } /*------------------------------------------------- @@ -2014,10 +2029,9 @@ return get_open_bus(); } -// writes to 0x8000-0xffff are like MMC3 but no PRG bankswitch (beacuse it is handled by low writes) +// writes to 0x8000-0xffff are like MMC3 but no PRG bankswitch (because it is handled by low writes) void nes_gouder_device::prg_cb(int start, int bank) { - return; } @@ -2118,6 +2132,61 @@ /*------------------------------------------------- + SACHEN-ZGDH + + Sachen board used for Zhongguo Daheng + + NES 2.0: mapper 512 + + In MAME: Supported. + + -------------------------------------------------*/ + +u8 nes_sachen_zgdh_device::nt_r(offs_t offset) +{ + if (m_reg == 1) + return m_vram[0x1000 + (offset & 0x0fff)]; + else + return device_nes_cart_interface::nt_r(offset); +} + +void nes_sachen_zgdh_device::nt_w(offs_t offset, u8 data) +{ + if (m_reg == 1) + m_vram[0x1000 + (offset & 0x0fff)] = data; + else + device_nes_cart_interface::nt_w(offset, data); +} + +void nes_sachen_zgdh_device::set_chr(u8 chr, int chr_base, int chr_mask) +{ + if (m_reg <= 1) + { + chr = CHRROM; + m_chr_mask = 0x7f; + } + else + { + chr = CHRRAM; + m_chr_mask = 0x03; + } + nes_txrom_device::set_chr(chr, chr_base, m_chr_mask); +} + +void nes_sachen_zgdh_device::write_l(offs_t offset, u8 data) +{ + LOG_MMC(("zgdh write_l, offset: %04x, data: %02x\n", offset, data)); + + offset += 0x100; + if ((offset & 0x1100) == 0x0100) + { + m_reg = data & 0x03; + set_chr(m_chr_source, m_chr_base, m_chr_mask); + } +} + +/*------------------------------------------------- + UNL-A9746 Games: Toy Story, Super 1997 4 in 1 (NT-8029) @@ -2253,7 +2322,7 @@ void nes_fk23c_device::fk23c_set_prg() { if ((m_reg[0] & 0x07) == 4) - prg32((m_reg[1] & 0x7f) >> 1); + prg32(BIT(m_reg[1], 1, 6)); else if ((m_reg[0] & 0x07) == 3) { prg16_89ab(m_reg[1] & 0x7f); @@ -3010,12 +3079,12 @@ nes_txrom_device::write_h(offset, data); } -void nes_bmc_f600_device::chr_cb(int start, int bank, int source) +void nes_bmc_f600_device::set_chr(u8 chr, int chr_base, int chr_mask) { if ((m_reg & 0x07) == 1) - nes_txsrom_device::chr_cb(start, bank, source); + nes_txsrom_device::set_chr(chr, chr_base, chr_mask); else - nes_txrom_device::chr_cb(start, bank, source); + nes_txrom_device::set_chr(chr, chr_base, chr_mask); } /*------------------------------------------------- @@ -3328,7 +3397,7 @@ { m_reg = offset; if (BIT(m_reg, 3)) - prg32((m_reg & 0x07) << 2 | (m_reg & 0x30) >> 4); + prg32(bitswap<5>(m_reg, 2, 1, 0, 5, 4)); else { m_prg_base = (m_reg & 0x07) << 4; @@ -3377,16 +3446,10 @@ { if (m_outer == 2 && BIT(m_mmc_vrom_bank[0], 7)) chr8(0, CHRRAM); - else + else if (m_outer) nes_txrom_device::set_chr(chr, chr_base, chr_mask); -} - -void nes_bmc_810305c_device::chr_cb(int start, int bank, int source) -{ - if (m_outer) - nes_txrom_device::chr_cb(start, bank, source); else - nes_txsrom_device::chr_cb(start, bank, source); + nes_txsrom_device::set_chr(chr, chr_base, chr_mask); } void nes_bmc_810305c_device::write_h(offs_t offset, u8 data) diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/mmc3_clones.h mame-0.243+dfsg.1/src/devices/bus/nes/mmc3_clones.h --- mame-0.242+dfsg.1/src/devices/bus/nes/mmc3_clones.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/mmc3_clones.h 2022-04-29 05:37:26.000000000 +0000 @@ -14,10 +14,9 @@ { public: // construction/destruction - nes_nitra_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_nitra_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - // device-level overrides - virtual void write_h(offs_t offset, uint8_t data) override; + virtual void write_h(offs_t offset, u8 data) override; }; @@ -51,10 +50,9 @@ { public: // construction/destruction - nes_fs6_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_fs6_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - // device-level overrides - virtual void write_h(offs_t offset, uint8_t data) override; + virtual void write_h(offs_t offset, u8 data) override; }; @@ -64,10 +62,9 @@ { public: // construction/destruction - nes_sbros11_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_sbros11_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - // device-level overrides - virtual void write_h(offs_t offset, uint8_t data) override; + virtual void write_h(offs_t offset, u8 data) override; }; @@ -77,10 +74,9 @@ { public: // construction/destruction - nes_malisb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_malisb_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - // device-level overrides - virtual void write_h(offs_t offset, uint8_t data) override; + virtual void write_h(offs_t offset, u8 data) override; virtual void prg_cb(int start, int bank) override; virtual void chr_cb(int start, int bank, int source) override; }; @@ -332,7 +328,6 @@ // construction/destruction nes_txc_tw_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // device-level overrides virtual void write_l(offs_t offset, uint8_t data) override; virtual void write_m(offs_t offset, uint8_t data) override { write_l(offset & 0xff, data); } // offset does not really count for this mapper } virtual void prg_cb(int start, int bank) override; @@ -347,7 +342,6 @@ // construction/destruction nes_kof97_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // device-level overrides virtual void write_h(offs_t offset, uint8_t data) override; }; @@ -384,7 +378,6 @@ // construction/destruction nes_sf3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // device-level overrides virtual void write_h(offs_t offset, uint8_t data) override; protected: @@ -476,6 +469,30 @@ u8 m_reg; }; +// ======================> nes_sachen_zgdh_device + +class nes_sachen_zgdh_device : public nes_txrom_device +{ +public: + // construction/destruction + nes_sachen_zgdh_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + + virtual void write_l(offs_t offset, u8 data) override; + virtual u8 nt_r(offs_t offset) override; + virtual void nt_w(offs_t offset, u8 data) override; + + virtual void pcb_reset() override; + +protected: + // device-level overrides + virtual void device_start() override; + + virtual void set_chr(u8 chr, int chr_base, int chr_mask) override; + +private: + u8 m_reg; +}; + // ======================> nes_a9746_device class nes_a9746_device : public nes_txrom_device @@ -667,6 +684,7 @@ virtual void pcb_reset() override; protected: + // device-level overrides virtual ioport_constructor device_input_ports() const override; private: @@ -696,7 +714,6 @@ // construction/destruction nes_bmc_15in1_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - // device-level overrides virtual void write_m(offs_t offset, u8 data) override; virtual void pcb_reset() override; @@ -714,7 +731,6 @@ // construction/destruction nes_bmc_sbig7_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // device-level overrides virtual void write_h(offs_t offset, uint8_t data) override; virtual void pcb_reset() override; @@ -877,7 +893,6 @@ virtual u8 read_l(offs_t offset) override; virtual void write_l(offs_t offset, u8 data) override; virtual void write_h(offs_t offset, u8 data) override; - virtual void chr_cb(int start, int bank, int source) override; virtual void pcb_reset() override; @@ -886,6 +901,8 @@ virtual ioport_constructor device_input_ports() const override; virtual void device_start() override; + virtual void set_chr(u8 chr, int chr_base, int chr_mask) override; + private: required_ioport m_jumper; u8 m_reg; @@ -1050,7 +1067,6 @@ nes_bmc_810305c_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); virtual void write_h(offs_t offset, u8 data) override; - virtual void chr_cb(int start, int bank, int source) override; virtual void pcb_reset() override; @@ -1229,6 +1245,7 @@ DECLARE_DEVICE_TYPE(NES_GOUDER, nes_gouder_device) DECLARE_DEVICE_TYPE(NES_SA9602B, nes_sa9602b_device) DECLARE_DEVICE_TYPE(NES_SACHEN_SHERO, nes_sachen_shero_device) +DECLARE_DEVICE_TYPE(NES_SACHEN_ZGDH, nes_sachen_zgdh_device) DECLARE_DEVICE_TYPE(NES_A9746, nes_a9746_device) DECLARE_DEVICE_TYPE(NES_A88S1, nes_a88s1_device) diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/mmc3.cpp mame-0.243+dfsg.1/src/devices/bus/nes/mmc3.cpp --- mame-0.242+dfsg.1/src/devices/bus/nes/mmc3.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/mmc3.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -20,7 +20,6 @@ * 004 Mendel Palace has never worked properly * 004 Ninja Gaiden 2 has flashing bg graphics in the second level - * 119 Pin Bot has glitches when the ball is in the upper half of the screen ***********************************************************************************************************/ @@ -29,7 +28,6 @@ #include "mmc3.h" #include "video/ppu2c0x.h" // this has to be included so that IRQ functions can access ppu2c0x_device::BOTTOM_VISIBLE_SCANLINE -#include "screen.h" #ifdef NES_PCB_DEBUG @@ -89,12 +87,12 @@ { } -nes_qj_device::nes_qj_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +nes_qj_device::nes_qj_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_txrom_device(mconfig, NES_QJ_PCB, tag, owner, clock) { } -nes_zz_device::nes_zz_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +nes_zz_device::nes_zz_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_txrom_device(mconfig, NES_ZZ_PCB, tag, owner, clock) { } @@ -185,14 +183,12 @@ void nes_qj_device::pcb_reset() { - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; mmc3_common_initialize(0x0f, 0x7f, 0); } void nes_zz_device::pcb_reset() { - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; mmc3_common_initialize(0x07, 0x7f, 0); } @@ -345,7 +341,7 @@ { if (!m_battery.empty()) m_battery[offset & (m_battery.size() - 1)] = data; - if (!m_prgram.empty()) + else if (!m_prgram.empty()) m_prgram[offset & (m_prgram.size() - 1)] = data; } } @@ -461,35 +457,23 @@ iNES: mapper 118 - In MESS: Supported. It also uses mmc3_irq. + In MAME: Supported. It also uses mmc3_irq. -------------------------------------------------*/ -void nes_txsrom_device::set_mirror() +void nes_txsrom_device::set_chr(u8 chr, int chr_base, int chr_mask) { - if (m_latch & 0x80) - { - set_nt_page(0, CIRAM, BIT(m_mmc_vrom_bank[2],7), 1); - set_nt_page(1, CIRAM, BIT(m_mmc_vrom_bank[3],7), 1); - set_nt_page(2, CIRAM, BIT(m_mmc_vrom_bank[4],7), 1); - set_nt_page(3, CIRAM, BIT(m_mmc_vrom_bank[5],7), 1); - } - else - { - set_nt_page(0, CIRAM, BIT(m_mmc_vrom_bank[0],7), 1); - set_nt_page(1, CIRAM, BIT(m_mmc_vrom_bank[0],7), 1); - set_nt_page(2, CIRAM, BIT(m_mmc_vrom_bank[1],7), 1); - set_nt_page(3, CIRAM, BIT(m_mmc_vrom_bank[1],7), 1); - } -} + nes_txrom_device::set_chr(chr, chr_base, chr_mask); -void nes_txsrom_device::chr_cb( int start, int bank, int source ) -{ - set_mirror(); // we could probably update only for one (e.g. the first) call, to slightly optimize the code - chr1_x(start, bank, source); + // do nametables + static constexpr u8 bank[8] = { 0, 0, 1, 1, 2, 3, 4, 5 }; + int start = (m_latch & 0x80) >> 5; + + for (int i = 0; i < 4; i++) + set_nt_page(i, CIRAM, BIT(m_mmc_vrom_bank[bank[start + i]], 7), 1); } -void nes_txsrom_device::write_h(offs_t offset, uint8_t data) +void nes_txsrom_device::write_h(offs_t offset, u8 data) { LOG_MMC(("txsrom write_h, offset: %04x, data: %02x\n", offset, data)); @@ -497,7 +481,6 @@ { case 0x2000: break; - default: txrom_write(offset, data); break; @@ -512,33 +495,18 @@ iNES: mapper 119 - In MESS: Supported. It also uses mmc3_irq. + In MAME: Supported. It also uses mmc3_irq. -------------------------------------------------*/ -void nes_tqrom_device::set_chr( uint8_t chr, int chr_base, int chr_mask ) +void nes_tqrom_device::chr_cb(int start, int bank, int source) { - uint8_t chr_page = (m_latch & 0x80) >> 5; - uint8_t src[6], mask[6]; - - // TQROM ignores the source, base and mask set by the MMC3 and determines them based on vrom bank bits - for (int i = 0; i < 6; i++) - { - src[i] = (m_mmc_vrom_bank[i] & 0x40) ? CHRRAM : CHRROM; - mask[i] = (m_mmc_vrom_bank[i] & 0x40) ? 0x07 : 0x3f; - } - - chr1_x(chr_page ^ 0, ((m_mmc_vrom_bank[0] & ~0x01) & mask[0]), src[0]); - chr1_x(chr_page ^ 1, ((m_mmc_vrom_bank[0] | 0x01) & mask[0]), src[0]); - chr1_x(chr_page ^ 2, ((m_mmc_vrom_bank[1] & ~0x01) & mask[1]), src[1]); - chr1_x(chr_page ^ 3, ((m_mmc_vrom_bank[1] | 0x01) & mask[1]), src[1]); - chr1_x(chr_page ^ 4, (m_mmc_vrom_bank[2] & mask[2]), src[2]); - chr1_x(chr_page ^ 5, (m_mmc_vrom_bank[3] & mask[3]), src[3]); - chr1_x(chr_page ^ 6, (m_mmc_vrom_bank[4] & mask[4]), src[4]); - chr1_x(chr_page ^ 7, (m_mmc_vrom_bank[5] & mask[5]), src[5]); + if (BIT(bank, 6)) + chr1_x(start, bank & 0x07, CHRRAM); + else + chr1_x(start, bank & 0x3f, CHRROM); } - /*------------------------------------------------- NES-QJ board (MMC3 variant for US 2-in-1 Nintendo cart @@ -548,19 +516,19 @@ -------------------------------------------------*/ -void nes_qj_device::write_m(offs_t offset, uint8_t data) +void nes_qj_device::write_m(offs_t offset, u8 data) { LOG_MMC(("qj write_m, offset: %04x, data: %02x\n", offset, data)); - m_prg_base = BIT(data, 0) << 4; - m_prg_mask = 0x0f; - m_chr_base = BIT(data, 0) << 7; - m_chr_mask = 0x7f; - set_prg(m_prg_base, m_prg_mask); - set_chr(m_chr_source, m_chr_base, m_chr_mask); + if (BIT(m_wram_protect, 7) && !BIT(m_wram_protect, 6)) + { + m_prg_base = BIT(data, 0) << 4; + m_chr_base = BIT(data, 0) << 7; + set_prg(m_prg_base, m_prg_mask); + set_chr(m_chr_source, m_chr_base, m_chr_mask); + } } - /*------------------------------------------------- PAL-ZZ board (MMC3 variant for European 3-in-1 Nintendo cart @@ -568,17 +536,22 @@ iNES: mapper 37 + TODO: this board apparently only resets to the menu + screen on systems with a CIC (the outer PRG lines + are somehow tied to the CIC's reset line). + -------------------------------------------------*/ -void nes_zz_device::write_m(offs_t offset, uint8_t data) +void nes_zz_device::write_m(offs_t offset, u8 data) { - uint8_t mmc_helper = data & 0x07; LOG_MMC(("zz write_m, offset: %04x, data: %02x\n", offset, data)); - m_prg_base = (BIT(mmc_helper, 2) << 4) | (((mmc_helper & 0x03) == 0x03) ? 0x08 : 0); - m_prg_mask = (mmc_helper << 1) | 0x07; - m_chr_base = BIT(mmc_helper, 2) << 7; - m_chr_mask = 0x7f; - set_prg(m_prg_base, m_prg_mask); - set_chr(m_chr_source, m_chr_base, m_chr_mask); + if (BIT(m_wram_protect, 7) && !BIT(m_wram_protect, 6)) + { + m_prg_base = ((data & 0x04) | (data & (data << 1) & 0x02)) << 2; + m_prg_mask = (m_prg_mask == 0x10) ? 0x0f : 0x07; + m_chr_base = BIT(data, 2) << 7; + set_prg(m_prg_base, m_prg_mask); + set_chr(m_chr_source, m_chr_base, m_chr_mask); + } } diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/mmc3.h mame-0.243+dfsg.1/src/devices/bus/nes/mmc3.h --- mame-0.242+dfsg.1/src/devices/bus/nes/mmc3.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/mmc3.h 2022-04-29 05:37:26.000000000 +0000 @@ -90,13 +90,12 @@ nes_txsrom_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); virtual void write_h(offs_t offset, u8 data) override; - virtual void chr_cb(int start, int bank, int source) override; protected: // construction/destruction nes_txsrom_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); - void set_mirror(); + virtual void set_chr(u8 chr, int chr_base, int chr_mask) override; }; @@ -108,11 +107,11 @@ // construction/destruction nes_tqrom_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + virtual void chr_cb(int start, int bank, int source) override; + protected: // construction/destruction nes_tqrom_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); - - virtual void set_chr(u8 chr, int chr_base, int chr_mask) override; }; @@ -122,9 +121,10 @@ { public: // construction/destruction - nes_qj_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_qj_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + + virtual void write_m(offs_t offset, u8 data) override; - virtual void write_m(offs_t offset, uint8_t data) override; virtual void pcb_reset() override; }; @@ -135,9 +135,10 @@ { public: // construction/destruction - nes_zz_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_zz_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + + virtual void write_m(offs_t offset, u8 data) override; - virtual void write_m(offs_t offset, uint8_t data) override; virtual void pcb_reset() override; }; diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/multigame.cpp mame-0.243+dfsg.1/src/devices/bus/nes/multigame.cpp --- mame-0.242+dfsg.1/src/devices/bus/nes/multigame.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/multigame.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -8,9 +8,9 @@ Here we emulate several PCBs used in multigame pirate carts (not MMC-3 based) - TODO: Investigate further Gunsmoke on mc_8et40 and mc_2gn91. Both exhibit the - same bug where enemies/barrels don't appear until they are halfway down the - screen. They are both almost the same minor hack of the US release. + TODO: Investigate further Gunsmoke on mc_8et40, mc_2gn91, mc_8x801. All have + the same bug where enemies/barrels don't appear until they are halfway down + the screeen. They all seem to be a minor hack of the US release. ***********************************************************************************************************/ @@ -56,6 +56,7 @@ DEFINE_DEVICE_TYPE(NES_NTD03, nes_ntd03_device, "nes_ntd03", "NES Cart NTD-03 PCB") DEFINE_DEVICE_TYPE(NES_BMC_CTC09, nes_bmc_ctc09_device, "nes_bmc_ctc09", "NES Cart BMC CTC-09 PCB") DEFINE_DEVICE_TYPE(NES_BMC_CTC12IN1, nes_bmc_ctc12in1_device, "nes_bmc_ctc12in1", "NES Cart BMC CTC-12IN1 PCB") +DEFINE_DEVICE_TYPE(NES_BMC_DS927, nes_bmc_ds927_device, "nes_bmc_ds927", "NES Cart BMC DS-9-27 PCB") DEFINE_DEVICE_TYPE(NES_BMC_FAM250, nes_bmc_fam250_device, "nes_bmc_fam250", "NES Cart BMC FAM250 PCB") DEFINE_DEVICE_TYPE(NES_BMC_GKA, nes_bmc_gka_device, "nes_bmc_gka", "NES Cart BMC GK-A PCB") DEFINE_DEVICE_TYPE(NES_BMC_GKB, nes_bmc_gkb_device, "nes_bmc_gkb", "NES Cart BMC GK-B PCB") @@ -65,8 +66,11 @@ DEFINE_DEVICE_TYPE(NES_BMC_K1029, nes_bmc_k1029_device, "nes_bmc_k1029", "NES Cart BMC K-1029 PCB") DEFINE_DEVICE_TYPE(NES_BMC_K3036, nes_bmc_k3036_device, "nes_bmc_k3036", "NES Cart BMC K-3036 PCB") DEFINE_DEVICE_TYPE(NES_BMC_K3046, nes_bmc_k3046_device, "nes_bmc_k3046", "NES Cart BMC K-3046 PCB") +DEFINE_DEVICE_TYPE(NES_BMC_K3071, nes_bmc_k3071_device, "nes_bmc_k3071", "NES Cart BMC K-3071 PCB") +DEFINE_DEVICE_TYPE(NES_BMC_S009, nes_bmc_s009_device, "nes_bmc_s009", "NES Cart BMC S-009 PCB") DEFINE_DEVICE_TYPE(NES_BMC_SA005A, nes_bmc_sa005a_device, "nes_bmc_sa005a", "NES Cart BMC SA005-A PCB") DEFINE_DEVICE_TYPE(NES_BMC_TF2740, nes_bmc_tf2740_device, "nes_bmc_tf2740", "NES Cart BMC TF2740 PCB") +DEFINE_DEVICE_TYPE(NES_BMC_TH2348, nes_bmc_th2348_device, "nes_bmc_th2348", "NES Cart BMC TH2348 PCB") DEFINE_DEVICE_TYPE(NES_BMC_TJ03, nes_bmc_tj03_device, "nes_bmc_tj03", "NES Cart BMC TJ-03 PCB") DEFINE_DEVICE_TYPE(NES_BMC_WS, nes_bmc_ws_device, "nes_bmc_ws", "NES Cart BMC WS PCB") DEFINE_DEVICE_TYPE(NES_BMC_11160, nes_bmc_11160_device, "nes_bmc_1160", "NES Cart BMC-1160 PCB") @@ -94,8 +98,7 @@ DEFINE_DEVICE_TYPE(NES_BMC_500IN1, nes_bmc_500in1_device, "nes_bmc_500in1", "NES Cart BMC 500 in 1 PCB") DEFINE_DEVICE_TYPE(NES_BMC_800IN1, nes_bmc_800in1_device, "nes_bmc_800in1", "NES Cart BMC 800 in 1 PCB") DEFINE_DEVICE_TYPE(NES_BMC_1200IN1, nes_bmc_1200in1_device, "nes_bmc_1200in1", "NES Cart BMC 1200 in 1 PCB") -DEFINE_DEVICE_TYPE(NES_BMC_GOLD150, nes_bmc_gold150_device, "nes_bmc_gold150", "NES Cart BMC Golden 150 in 1 PCB") -DEFINE_DEVICE_TYPE(NES_BMC_GOLD260, nes_bmc_gold260_device, "nes_bmc_gold260", "NES Cart BMC Golden 260 in 1 PCB") +DEFINE_DEVICE_TYPE(NES_BMC_GOLD260, nes_bmc_gold260_device, "nes_bmc_gold260", "NES Cart BMC Golden Game X in 1 PCB") DEFINE_DEVICE_TYPE(NES_BMC_TH22913, nes_bmc_th22913_device, "nes_bmc_th22913", "NES Cart BMC TH2291-3 PCB") DEFINE_DEVICE_TYPE(NES_BMC_82AB, nes_bmc_82ab_device, "nes_bmc_82ab", "NES Cart BMC 82AB PCB") DEFINE_DEVICE_TYPE(NES_BMC_4IN1RESET, nes_bmc_4in1reset_device, "nes_bmc_4in1reset", "NES Cart BMC 4 in 1 (Reset Based) PCB") @@ -127,7 +130,7 @@ // LIVE DEVICE //************************************************************************** -nes_action52_device::nes_action52_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +nes_action52_device::nes_action52_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_nrom_device(mconfig, NES_ACTION52, tag, owner, clock) { } @@ -227,7 +230,7 @@ { } -nes_ntd03_device::nes_ntd03_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +nes_ntd03_device::nes_ntd03_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_nrom_device(mconfig, NES_NTD03, tag, owner, clock) { } @@ -237,6 +240,11 @@ { } +nes_bmc_ds927_device::nes_bmc_ds927_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : nes_nrom_device(mconfig, NES_BMC_DS927, tag, owner, clock), m_latch(0), m_mode(0) +{ +} + nes_bmc_gka_device::nes_bmc_gka_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_nrom_device(mconfig, NES_BMC_GKA, tag, owner, clock) { @@ -272,6 +280,16 @@ { } +nes_bmc_k3071_device::nes_bmc_k3071_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : nes_nrom_device(mconfig, NES_BMC_K3071, tag, owner, clock) +{ +} + +nes_bmc_s009_device::nes_bmc_s009_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : nes_nrom_device(mconfig, NES_BMC_S009, tag, owner, clock), m_reg(0) +{ +} + nes_bmc_sa005a_device::nes_bmc_sa005a_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_nrom_device(mconfig, NES_BMC_SA005A, tag, owner, clock) { @@ -282,6 +300,11 @@ { } +nes_bmc_th2348_device::nes_bmc_th2348_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : nes_nrom_device(mconfig, NES_BMC_TH2348, tag, owner, clock), m_latch(0) +{ +} + nes_bmc_tj03_device::nes_bmc_tj03_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_nrom_device(mconfig, NES_BMC_TJ03, tag, owner, clock) { @@ -334,8 +357,8 @@ { } -nes_bmc_64y2k_device::nes_bmc_64y2k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : nes_nrom_device(mconfig, NES_BMC_64Y2K, tag, owner, clock) +nes_bmc_64y2k_device::nes_bmc_64y2k_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : nes_nrom_device(mconfig, NES_BMC_64Y2K, tag, owner, clock), m_reg_mask(0) { } @@ -344,7 +367,7 @@ { } -nes_bmc_12in1_device::nes_bmc_12in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +nes_bmc_12in1_device::nes_bmc_12in1_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_nrom_device(mconfig, NES_BMC_12IN1, tag, owner, clock) { } @@ -419,12 +442,7 @@ { } -nes_bmc_gold150_device::nes_bmc_gold150_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : nes_nrom_device(mconfig, NES_BMC_GOLD150, tag, owner, clock), m_latch(0) -{ -} - -nes_bmc_gold260_device::nes_bmc_gold260_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +nes_bmc_gold260_device::nes_bmc_gold260_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_nrom_device(mconfig, NES_BMC_GOLD260, tag, owner, clock) { } @@ -517,18 +535,6 @@ -void nes_action52_device::device_start() -{ - common_start(); -} - -void nes_action52_device::pcb_reset() -{ - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - prg32(0); - chr8(0, m_chr_source); -} - void nes_caltron6in1_device::device_start() { common_start(); @@ -621,11 +627,6 @@ chr8(0, CHRRAM); } -void nes_a65as_device::device_start() -{ - common_start(); -} - void nes_a65as_device::pcb_reset() { m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; @@ -650,18 +651,6 @@ m_latch = 0; } -void nes_studyngame_device::device_start() -{ - common_start(); -} - -void nes_studyngame_device::pcb_reset() -{ - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - prg32(0); - chr8(0, m_chr_source); -} - void nes_sgun20in1_device::pcb_reset() { prg16_89ab(0); @@ -770,24 +759,30 @@ m_latch = 0; } -void nes_ntd03_device::device_start() +void nes_bmc_ctc09_device::pcb_reset() { - common_start(); +// nes_slot's pcb_start sets us up in the main menu. Soft reset is empty so +// that games reset to their own title screens. This seems to be this cart's +// intended behavior as trying to reset to the menu here crashes (due to RAM +// contents?). Soft reset can similarly crash the main menu (BTANB?). } -void nes_ntd03_device::pcb_reset() +void nes_bmc_ds927_device::device_start() { - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - prg32(0); - chr8(0, m_chr_source); + common_start(); + save_item(NAME(m_latch)); + save_item(NAME(m_mode)); } -void nes_bmc_ctc09_device::pcb_reset() +void nes_bmc_ds927_device::pcb_reset() { -// nes_slot's pcb_start sets us up in the main menu. Soft reset is empty so -// that games reset to their own title screens. This seems to be this cart's -// intended behavior as trying to reset to the menu here crashes (due to RAM -// contents?). Soft reset can similarly crash the main menu (BTANB?). + assert(m_prgram.size() >= 0x2000); + + prg16_89ab(0); + prg16_cdef(0); + + m_latch = 0; + m_mode = 0; } void nes_bmc_gka_device::device_start() @@ -834,6 +829,28 @@ chr8(0, CHRRAM); } +void nes_bmc_k3071_device::pcb_reset() +{ + prg16_89ab(0); + prg16_cdef(0); + chr8(0, CHRROM); +} + +void nes_bmc_s009_device::device_start() +{ + common_start(); + save_item(NAME(m_reg)); +} + +void nes_bmc_s009_device::pcb_reset() +{ + prg16_89ab(0); + prg16_cdef(7); + chr8(0, CHRRAM); + + m_reg = 0; +} + void nes_bmc_sa005a_device::pcb_reset() { prg16_89ab(0); @@ -857,6 +874,21 @@ m_reg[0] = m_reg[1] = m_reg[2] = 0; } +void nes_bmc_th2348_device::device_start() +{ + common_start(); + save_item(NAME(m_latch)); +} + +void nes_bmc_th2348_device::pcb_reset() +{ + prg16_89ab(0); + prg16_cdef(7); + chr8(0, CHRRAM); + + m_latch = 0; +} + void nes_bmc_ws_device::device_start() { common_start(); @@ -954,14 +986,11 @@ void nes_bmc_64y2k_device::pcb_reset() { - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - chr8(0, m_chr_source); - + m_reg_mask = m_chr_source == CHRROM ? 0x03 : 0x01; m_reg[0] = 0x80; m_reg[1] = 0x43; m_reg[2] = m_reg[3] = 0; - set_prg(); - set_nt_mirroring(PPU_MIRROR_VERT); + update_banks(); } void nes_bmc_420y2k_device::device_start() @@ -989,20 +1018,10 @@ void nes_bmc_12in1_device::pcb_reset() { - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - prg32(0); - chr8(0, m_chr_source); - m_reg[0] = 0; - m_reg[1] = 0; - m_reg[2] = 0; + std::fill(std::begin(m_reg), std::end(m_reg), 0x00); update_banks(); } -void nes_bmc_35in1_device::device_start() -{ - common_start(); -} - void nes_bmc_35in1_device::pcb_reset() { m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; @@ -1011,11 +1030,6 @@ chr8(0, m_chr_source); } -void nes_bmc_36in1_device::device_start() -{ - common_start(); -} - void nes_bmc_36in1_device::pcb_reset() { m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; @@ -1024,11 +1038,6 @@ chr8(0, m_chr_source); } -void nes_bmc_64in1_device::device_start() -{ - common_start(); -} - void nes_bmc_64in1_device::pcb_reset() { m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; @@ -1094,33 +1103,6 @@ m_vram_protect = 0; } -void nes_bmc_gold150_device::device_start() -{ - common_start(); - save_item(NAME(m_latch)); -} - -void nes_bmc_gold150_device::pcb_reset() -{ - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - prg32(0); - chr8(0, m_chr_source); - - m_latch = 0; -} - -void nes_bmc_gold260_device::device_start() -{ - common_start(); -} - -void nes_bmc_gold260_device::pcb_reset() -{ - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - prg32(0); - chr8(0, m_chr_source); -} - // This PCB is fully emulated here :) void nes_bmc_4in1reset_device::device_start() { @@ -1246,24 +1228,17 @@ -------------------------------------------------*/ -void nes_action52_device::write_h(offs_t offset, uint8_t data) +void nes_action52_device::write_h(offs_t offset, u8 data) { - uint8_t pmode = offset & 0x20; - int pbank = (offset & 0x1fc0) >> 6; - int cbank = (data & 0x03) | ((offset & 0x0f) << 2); LOG_MMC(("ae_act52_w, offset: %04x, data: %02x\n", offset, data)); - set_nt_mirroring(BIT(offset, 13) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); - - chr8(cbank, CHRROM); + u8 bank = BIT(offset, 6, 7); + u8 mode = !BIT(offset, 5); + prg16_89ab(bank & ~mode); + prg16_cdef(bank | mode); - if (pmode) - { - prg16_89ab(pbank); - prg16_cdef(pbank); - } - else - prg32(pbank >> 1); + chr8((data & 0x03) | (offset & 0x0f) << 2, CHRROM); + set_nt_mirroring(BIT(offset, 13) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); } /*------------------------------------------------- @@ -1376,8 +1351,8 @@ // this pcb is subject to bus conflict data = account_bus_conflict(offset, data); - m_prg = (m_prg & ~0x01) | (data & 0x01); - m_chr = (m_chr & ~0x07) | ((data & 0x70) >> 4); + m_prg = (m_prg & ~0x01) | BIT(data, 0); + m_chr = (m_chr & ~0x07) | BIT(data, 4, 3); prg32(m_prg); chr8(m_chr, CHRROM); } @@ -1545,7 +1520,7 @@ set_nt_mirroring(BIT(m_latch, 1) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); } - u8 bank = (m_latch & 0x300) >> 3 | (m_latch & 0x60) >> 2 | (data & 0x07); // NesDev shows the high bit here, but is it correct? So far no cart is large enough to use this. + u8 bank = bitswap<4>(m_latch, 9, 8, 6, 5) << 3 | (data & 0x07); // NesDev shows the high bit here, but is it correct? So far no cart is large enough to use this. u8 mode = BIT(m_latch, 0); if (BIT(m_latch, 7)) // NROM mode { @@ -1602,7 +1577,7 @@ { case 0x0000: case 0x7000: - offset = (offset >> 2) & (m_prg_mask >> 1); + offset >>= 2; prg16_89ab(offset); prg16_cdef(offset); chr8(offset, CHRROM); @@ -1636,7 +1611,7 @@ { m_latch = offset >> 8; - u8 bank = (offset >> 4) & 0x07; + u8 bank = BIT(offset, 4, 3); u8 mode = !BIT(offset, 7); prg16_89ab(bank & ~mode); prg16_cdef(bank | mode); @@ -1820,7 +1795,7 @@ { LOG_MMC(("bmc_970630c write_h, offset: %04x, data: %02x\n", offset, data)); - u8 bank = (offset >> 2) & 0x1f; + u8 bank = BIT(offset, 2, 5); if (BIT(offset, 9)) // NROM mode { u8 mode = !BIT(offset, 0); @@ -1859,23 +1834,17 @@ -------------------------------------------------*/ -void nes_ntd03_device::write_h(offs_t offset, uint8_t data) +void nes_ntd03_device::write_h(offs_t offset, u8 data) { - uint8_t pbank = (offset >> 10) & 0x1e; - uint8_t cbank = ((offset & 0x300) >> 5) | (offset & 0x07); LOG_MMC(("ntd03 write_h, offset: %04x, data: %02x\n", offset, data)); - if (BIT(offset, 7)) - { - prg16_89ab(pbank | BIT(offset, 6)); - prg16_cdef(pbank | BIT(offset, 6)); - } - else - prg32(pbank >> 1); + u8 bank = bitswap<5>(offset, 14, 13, 12, 11, 6); + u8 mode = !BIT(offset, 7); + prg16_89ab(bank & ~mode); + prg16_cdef(bank | mode); + chr8(bitswap<5>(offset, 9, 8, 2, 1, 0), CHRROM); set_nt_mirroring(BIT(offset, 10) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); - - chr8(cbank, CHRROM); } /*------------------------------------------------- @@ -1912,6 +1881,73 @@ /*------------------------------------------------- + Board DS-9-27 + + Games: 190 in 1 + + Bizarro board of mostly simple games that has + 8K of WRAM that is mappable, with mirroring in + NROM128 mode, to anywhere in upper memory. + + NES 2.0: mapper 452 + + In MAME: Supported. + + -------------------------------------------------*/ + +u8 nes_bmc_ds927_device::read_h(offs_t offset) +{ +// LOG_MMC(("bmc_ds927 read_h, offset: %04x\n", offset)); + + int bits = m_mode == 1 ? 1 : 2; + + if (BIT(offset, 13, bits) == BIT(m_latch, 4, bits)) + return m_prgram[offset & 0x1fff]; + + return hi_access_rom(offset); +} + +void nes_bmc_ds927_device::write_h(offs_t offset, u8 data) +{ + LOG_MMC(("bmc_ds927 write_h, offset: %04x, data: %02x\n", offset, data)); + + if (offset < 0x6000) + { + m_latch = data; + m_mode = bitswap<2>(data, 3, 1); + + int bank = BIT(offset, 1, 7); + + switch (m_mode) + { + case 0: + prg16_89ab(bank >> 1); + prg16_cdef(0); + break; + case 1: + for (int i = 0; i < 4; i++) + prg8_x(i, bank); + break; + case 2: + case 3: + prg8_89(bank); + prg8_ab(bank | 1); + prg8_cd(bank | 2); + prg8_ef(bank | 3 | (data & 0x04)); + break; + } + } + + set_nt_mirroring(BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); + + int bits = m_mode == 1 ? 1 : 2; + + if (BIT(offset, 13, bits) == BIT(m_latch, 4, bits)) + m_prgram[offset & 0x1fff] = data; +} + +/*------------------------------------------------- + Board BMC-GKA Unknown Bootleg Multigame Board @@ -1973,7 +2009,7 @@ prg16_89ab(bank & ~mode); prg16_cdef(bank | mode); - chr8((offset >> 3) & 0x07, CHRROM); + chr8(BIT(offset, 3, 3), CHRROM); set_nt_mirroring(BIT(offset, 7) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); } @@ -1996,7 +2032,7 @@ { LOG_MMC(("bmc_gkcxin1 write_h, offset: %04x, data: %02x\n", offset, data)); - prg32((offset >> 3) & 0x03); + prg32(BIT(offset, 3, 2)); chr8(offset & 0x07, CHRROM); } @@ -2116,6 +2152,64 @@ /*------------------------------------------------- + BMC-K-3071 + + Games: 110 in 1 + + NES 2.0: mapper 438 + + In MAME: Supported. + + -------------------------------------------------*/ + +void nes_bmc_k3071_device::write_h(offs_t offset, u8 data) +{ + LOG_MMC(("bmc_k3071 write_h, offset: %04x, data: %02x\n", offset, data)); + + u8 bank = BIT(offset, 1, 5); + u8 mode = BIT(offset, 0); + prg16_89ab(bank & ~mode); + prg16_cdef(bank | mode); + + chr8(BIT(data, 1, 5), CHRROM); + set_nt_mirroring(BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); +} + +/*------------------------------------------------- + + BMC-S-009 + + Games: 8 in 1 + + NES 2.0: mapper 434 + + In MAME: Supported. + + -------------------------------------------------*/ + +void nes_bmc_s009_device::write_m(offs_t offset, u8 data) +{ + LOG_MMC(("bmc_s009 write_m, offset: %04x, data: %02x\n", offset, data)); + + m_reg = (data & 0x07) << 3; + prg16_89ab(m_reg); + prg16_cdef(m_reg | 0x07); + + set_nt_mirroring(BIT(data, 5) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ); +} + +void nes_bmc_s009_device::write_h(offs_t offset, u8 data) +{ + LOG_MMC(("bmc_s009 write_h, offset: %04x, data: %02x\n", offset, data)); + + // this pcb is subject to bus conflict + data = account_bus_conflict(offset, data); + + prg16_89ab(m_reg | (data & 0x07)); +} + +/*------------------------------------------------- + BMC-SA005-A Games: 16 in 1 @@ -2192,6 +2286,43 @@ /*------------------------------------------------- + BMC-TH2348 + + Games: Golden 8 in 1 + + NES 2.0: mapper 437 + + In MAME: Supported. + + -------------------------------------------------*/ + +void nes_bmc_th2348_device::write_l(offs_t offset, u8 data) +{ + LOG_MMC(("bmc_th2348 write_l, offset: %04x, data: %02x\n", offset, data)); + + offset += 0x100; + if (offset >= 0x1000) + { + m_latch = (offset & 0x07) << 3; + prg16_89ab(m_latch); + prg16_cdef(m_latch | 0x07); + + set_nt_mirroring(BIT(offset, 3) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); + } +} + +void nes_bmc_th2348_device::write_h(offs_t offset, u8 data) +{ + LOG_MMC(("bmc_th2348 write_h, offset: %04x, data: %02x\n", offset, data)); + + // this pcb is subject to bus conflict + data = account_bus_conflict(offset, data); + + prg16_89ab(m_latch | (data & 0x07)); +} + +/*------------------------------------------------- + BMC-TJ-03 Games: 4 in 1 @@ -2217,14 +2348,13 @@ Games: Super 40-in-1 - In MESS: Partially Supported (some games, like Galaxian, have + In MAME: Partially Supported (some games, like Galaxian, have issues) -------------------------------------------------*/ void nes_bmc_ws_device::write_m(offs_t offset, uint8_t data) { - uint8_t mmc_helper; LOG_MMC(("bmc_ws write_m, offset: %04x, data: %02x\n", offset, data)); if (offset < 0x1000) @@ -2236,9 +2366,9 @@ { m_latch = data & 0x20; set_nt_mirroring(BIT(data, 4) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); - mmc_helper = (~data & 0x08) >> 3; - prg16_89ab(data & ~mmc_helper); - prg16_cdef(data | mmc_helper); + u8 mode = !BIT(data, 3); + prg16_89ab(data & ~mode); + prg16_cdef(data | mode); } break; case 1: @@ -2265,8 +2395,8 @@ { LOG_MMC(("bmc_11160 write_h, offset: %04x, data: %02x\n", offset, data)); - prg32((data & 0x30) >> 4); - chr8(((data & 0x30) >> 2) | (data & 0x03), CHRROM); + prg32(BIT(data, 4, 2)); + chr8(bitswap<4>(data, 5, 4, 1, 0), CHRROM); set_nt_mirroring(BIT(data, 7) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ); } @@ -2320,7 +2450,8 @@ u8 mode = BIT(offset, 7); prg16_89ab(bank & ~mode); prg16_cdef(bank | mode); - chr8((offset >> 1) & 0x07, CHRROM); + + chr8(BIT(offset, 1, 3), CHRROM); set_nt_mirroring(BIT(offset, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); } @@ -2422,7 +2553,7 @@ { LOG_MMC(("bmc_s700 write_h, offset: %04x, data: %02x\n", offset, data)); - u8 bank = (offset & 0x40) | ((offset >> 8) & 0x3f); + u8 bank = (offset & 0x40) | BIT(offset, 8, 6); u8 mode = !BIT(offset, 5); prg16_89ab(bank & ~mode); prg16_cdef(bank | mode); @@ -2518,54 +2649,45 @@ Games: 64-in-1 Y2K - In MESS: Supported + NES 2.0: mapper 314 + + In MAME: Supported. -------------------------------------------------*/ -void nes_bmc_64y2k_device::set_prg() +void nes_bmc_64y2k_device::update_banks() { - uint8_t helper1 = (m_reg[1] & 0x1f); - uint8_t helper2 = (helper1 << 1) | ((m_reg[1] & 0x40) >> 6); - - if (m_reg[0] & 0x80) + if (BIT(m_reg[0] & m_reg[1], 7)) + prg32(m_reg[1]); + else { - if (m_reg[1] & 0x80) - prg32(helper1); - else - { - prg16_89ab(helper2); - prg16_cdef(helper2); - } + u8 bank = m_reg[1] << 1 | BIT(m_reg[1], 6); + prg16_89ab(bank); + prg16_cdef(bank | (BIT(m_reg[0], 7) ? 0 : 7)); } - else - prg16_cdef(helper2); + + chr8(BIT(m_reg[0], 1, 2) | (m_reg[2] << 2), m_chr_source); + set_nt_mirroring(BIT(m_reg[0], 5) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); } -void nes_bmc_64y2k_device::write_l(offs_t offset, uint8_t data) +void nes_bmc_64y2k_device::write_l(offs_t offset, u8 data) { - LOG_MMC(("bmc64y2k write_l, offset: %04x, data: %02x\n", offset, data)); - offset += 0x100; + LOG_MMC(("bmc_64y2k write_l, offset: %04x, data: %02x\n", offset, data)); - switch (offset) + offset += 0x100; + if (offset >= 0x1000) { - case 0x1000: - case 0x1001: - case 0x1002: - case 0x1003: - m_reg[offset & 0x03] = data; - set_prg(); - chr8(((m_reg[0] >> 1) & 0x03) | (m_reg[2] << 2), CHRROM); - break; + m_reg[offset & m_reg_mask] = data; + update_banks(); } - if (offset == 0x1000) /* write to reg[0] also sets mirroring */ - set_nt_mirroring(BIT(data, 5) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); } -void nes_bmc_64y2k_device::write_h(offs_t offset, uint8_t data) +void nes_bmc_64y2k_device::write_h(offs_t offset, u8 data) { - LOG_MMC(("bmc64y2k write_h, offset: %04x, data: %02x\n", offset, data)); + LOG_MMC(("bmc_64y2k write_h, offset: %04x, data: %02x\n", offset, data)); - m_reg[3] = data; // reg[3] is currently unused?!? + if (!BIT(m_reg[0], 7)) + prg16_89ab(((m_reg[1] << 1) & ~0x07) | (data & 0x07)); } /*------------------------------------------------- @@ -2615,42 +2737,37 @@ BMC-12IN1 Unknown Bootleg Multigame Board - Games: + Games: 7 in 1 - iNES: + NES 2.0: mapper 331 - In MESS: Supported. + In MAME: Supported. + + TODO: Supposedly PRG banks change depending on what + CHR page the PPU is rendering from. This is not + emulated but the cart still works since both inner + PRG registers are always set to the same value. -------------------------------------------------*/ void nes_bmc_12in1_device::update_banks() { - int bank = (m_reg[2] & 3) << 3; - - chr4_0((m_reg[0] >> 3) | (bank << 2), m_chr_source); - chr4_4((m_reg[1] >> 3) | (bank << 2), m_chr_source); + u8 outer = (m_reg[3] & 0x03) << 3; + u8 mode = BIT(m_reg[3], 3) ? 0x01 : 0x07; // NROM256 or UNROM-like mode + prg16_89ab(outer | (m_reg[1] & 0x07)); + prg16_cdef(outer | (m_reg[2] & 0x07) | mode); - if (m_reg[2] & 8) - prg32(((m_reg[0] & 7) >> 1) | bank); - else - { - prg16_89ab((m_reg[0] & 7) | bank); - prg16_cdef(7 | bank); - } + chr4_0(outer | (m_reg[1] >> 3), m_chr_source); + chr4_4(outer | (m_reg[2] >> 3), m_chr_source); - set_nt_mirroring(BIT(m_reg[2], 2) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); + set_nt_mirroring(BIT(m_reg[3], 2) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); } -void nes_bmc_12in1_device::write_h(offs_t offset, uint8_t data) +void nes_bmc_12in1_device::write_h(offs_t offset, u8 data) { LOG_MMC(("bmc_12in1 write_h, offset: %04x, data: %02x\n", offset, data)); - switch (offset & 0x6000) - { - case 0x2000: m_reg[0] = data; break; - case 0x4000: m_reg[1] = data; break; - case 0x6000: m_reg[2] = data; break; - } + m_reg[BIT(offset, 13, 2)] = data; update_banks(); } @@ -2736,16 +2853,17 @@ iNES: mapper 203 - In MESS: Supported. + In MAME: Supported. -------------------------------------------------*/ -void nes_bmc_35in1_device::write_h(offs_t offset, uint8_t data) +void nes_bmc_35in1_device::write_h(offs_t offset, u8 data) { LOG_MMC(("bmc_35in1 write_h, offset: %04x, data: %02x\n", offset, data)); - prg16_89ab((data >> 2) & 0x03); - prg16_cdef((data >> 2) & 0x03); + u8 bank = BIT(data, 2, 2); + prg16_89ab(bank); + prg16_cdef(bank); chr8(data & 0x03, CHRROM); } @@ -2917,7 +3035,7 @@ LOG_MMC(("bmc_72in1 write_h, offset: %04x, data: %02x\n", offset, data)); u8 high = (offset >> 8) & 0x40; - u8 bank = high | ((offset >> 6) & 0x3f); + u8 bank = high | BIT(offset, 6, 6); u8 mode = !BIT(offset, 12); prg16_89ab(bank & ~mode); prg16_cdef(bank | mode); @@ -2977,7 +3095,7 @@ { LOG_MMC(("bmc_150in1 write_h, offset: %04x, data: %02x\n", offset, data)); - u8 bank = (offset >> 1) & 0x07; + u8 bank = BIT(offset, 1, 3); u8 mode = (bank & 0x06) == 0x06; prg16_89ab(bank & ~mode); prg16_cdef(bank | mode); @@ -3002,7 +3120,7 @@ void nes_bmc_500in1_device::write_h(offs_t offset, u8 data) { LOG_MMC(("bmc500in1 write_h, offset: %04x, data: %02x\n", offset, data)); - prg32((offset >> 2) & 0x07); + prg32(BIT(offset, 2, 3)); chr8(offset & 0x07, CHRROM); } @@ -3060,88 +3178,32 @@ set_nt_mirroring(BIT(offset, 1) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); } - /*------------------------------------------------- BMC-GOLDEN260IN1 Unknown Bootleg Multigame Board - Games: - - iNES: mapper 235 - - In MESS: Preliminary Supported. - - -------------------------------------------------*/ - -void nes_bmc_gold260_device::write_h(offs_t offset, uint8_t data) -{ - int bank = (offset & 0x1f) | ((offset & 0x0300) >> 3); - LOG_MMC(("bmc_gold260 write_h, offset: %04x, data: %02x\n", offset, data)); - - if (offset & 0x400) - set_nt_mirroring(PPU_MIRROR_LOW); - else - set_nt_mirroring(BIT(offset, 13) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); - - if (offset & 0x800) - { - bank = (bank << 1) | BIT(offset, 12); - prg16_89ab(bank); - prg16_cdef(bank); - } - else - prg32(bank); -} - - -/*------------------------------------------------- - - BMC-GOLDEN150IN1 - - Unknown Bootleg Multigame Board - Games: + Games: Golden Game 150 in 1, Golden Game 210 in 1, + Golden Game 260 in 1, 1500 in 1 iNES: mapper 235 - Same as the above + open bus in 0x8000-0xffff when - enabled + In MAME: Supported. - In MESS: Preliminary Supported. + TODO: Return open bus when ROM sockets are empty? -------------------------------------------------*/ - -void nes_bmc_gold150_device::write_h(offs_t offset, uint8_t data) +void nes_bmc_gold260_device::write_h(offs_t offset, u8 data) { - int bank = (offset & 0x1f) | ((offset & 0x0200) >> 4); - LOG_MMC(("bmc_gold150 write_h, offset: %04x, data: %02x\n", offset, data)); - - m_latch = (offset & 0x0100); - - if (offset & 0x400) - set_nt_mirroring(PPU_MIRROR_LOW); - else - set_nt_mirroring(BIT(offset, 13) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); - - if (offset & 0x800) - { - bank = (bank << 1) | BIT(offset, 12); - prg16_89ab(bank); - prg16_cdef(bank); - } - else - prg32(bank); -} + LOG_MMC(("bmc_gold260 write_h, offset: %04x, data: %02x\n", offset, data)); -uint8_t nes_bmc_gold150_device::read_h(offs_t offset) -{ - LOG_MMC(("bmc_gold150 read_h, offset: %04x\n", offset)); + u8 bank = bitswap<8>(offset, 9, 8, 4, 3, 2, 1, 0, 12); + u8 mode = !BIT(offset, 11); + prg16_89ab(bank & ~mode); + prg16_cdef(bank | mode); - if (m_latch) - return get_open_bus(); - else - return hi_access_rom(offset); + set_nt_mirroring(BIT(offset, 10) ? PPU_MIRROR_LOW : BIT(offset, 13) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); } /*------------------------------------------------- @@ -3216,7 +3278,7 @@ LOG_MMC(("bmc_lc160 write_h, offset: %04x, data: %02x\n", offset, data)); if (offset >= 0x4000) { - u8 bank = (offset >> 2) & 0x3f; + u8 bank = BIT(offset, 2, 6); u8 mode = !BIT(offset, 1); prg16_89ab(bank & ~mode); prg16_cdef(bank | mode); @@ -3339,7 +3401,7 @@ LOG_MMC(("bmc_891227 write_h, offset: %04x, data: %02x\n", offset, data)); if (offset < 0x4000) - data = (data & 0x80) >> 2 | (data & 0x60) << 1 | (data & 0x1f); + data = bitswap<8>(data, 6, 5, 7, 4, 3, 2, 1, 0); nes_bmc_ctc12in1_device::write_h(offset, data); @@ -3468,7 +3530,7 @@ m_latch[BIT(offset, 14)] = offset; - u8 bank = (m_latch[0] & 0x200) >> 3 | (m_latch[0] & 0xe0) >> 2 | (m_latch[1] & 0x07); + u8 bank = bitswap<4>(m_latch[0], 9, 7, 6, 5) << 3 | (m_latch[1] & 0x07); u8 mode = BIT(m_latch[0], 1); if (mode && BIT(m_latch[0], 8)) // UNROM mode { diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/multigame.h mame-0.243+dfsg.1/src/devices/bus/nes/multigame.h --- mame-0.242+dfsg.1/src/devices/bus/nes/multigame.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/multigame.h 2022-04-29 05:37:26.000000000 +0000 @@ -14,15 +14,9 @@ { public: // construction/destruction - nes_action52_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_action52_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - virtual void write_h(offs_t offset, uint8_t data) override; - - virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; + virtual void write_h(offs_t offset, u8 data) override; }; @@ -169,10 +163,6 @@ virtual void write_h(offs_t offset, uint8_t data) override; virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; @@ -206,12 +196,6 @@ nes_studyngame_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void write_h(offs_t offset, uint8_t data) override; - - virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; @@ -393,15 +377,9 @@ { public: // construction/destruction - nes_ntd03_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - - virtual void write_h(offs_t offset, uint8_t data) override; - - virtual void pcb_reset() override; + nes_ntd03_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); -protected: - // device-level overrides - virtual void device_start() override; + virtual void write_h(offs_t offset, u8 data) override; }; @@ -419,6 +397,28 @@ }; +// ======================> nes_bmc_ds927_device + +class nes_bmc_ds927_device : public nes_nrom_device +{ +public: + // construction/destruction + nes_bmc_ds927_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + + virtual u8 read_h(offs_t offset) override; + virtual void write_h(offs_t offset, u8 data) override; + + virtual void pcb_reset() override; + +protected: + // device-level overrides + virtual void device_start() override; + +private: + u8 m_latch, m_mode; +}; + + // ======================> nes_bmc_gka_device class nes_bmc_gka_device : public nes_nrom_device @@ -527,6 +527,42 @@ }; +// ======================> nes_bmc_k3071_device + +class nes_bmc_k3071_device : public nes_nrom_device +{ +public: + // construction/destruction + nes_bmc_k3071_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + + virtual void write_h(offs_t offset, u8 data) override; + + virtual void pcb_reset() override; +}; + + +// ======================> nes_bmc_s009_device + +class nes_bmc_s009_device : public nes_nrom_device +{ +public: + // construction/destruction + nes_bmc_s009_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + + virtual void write_m(offs_t offset, u8 data) override; + virtual void write_h(offs_t offset, u8 data) override; + + virtual void pcb_reset() override; + +protected: + // device-level overrides + virtual void device_start() override; + +private: + u8 m_reg = 0; +}; + + // ======================> nes_bmc_sa005a_device class nes_bmc_sa005a_device : public nes_nrom_device @@ -566,6 +602,28 @@ }; +// ======================> nes_bmc_th2348_device + +class nes_bmc_th2348_device : public nes_nrom_device +{ +public: + // construction/destruction + nes_bmc_th2348_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + + virtual void write_l(offs_t offset, u8 data) override; + virtual void write_h(offs_t offset, u8 data) override; + + virtual void pcb_reset() override; + +protected: + // device-level overrides + virtual void device_start() override; + +private: + u8 m_latch = 0; +}; + + // ======================> nes_bmc_tj03_device class nes_bmc_tj03_device : public nes_nrom_device @@ -740,10 +798,10 @@ { public: // construction/destruction - nes_bmc_64y2k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_bmc_64y2k_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - virtual void write_l(offs_t offset, uint8_t data) override; - virtual void write_h(offs_t offset, uint8_t data) override; + virtual void write_l(offs_t offset, u8 data) override; + virtual void write_h(offs_t offset, u8 data) override; virtual void pcb_reset() override; @@ -752,8 +810,9 @@ virtual void device_start() override; private: - void set_prg(); - uint8_t m_reg[4]; + void update_banks(); + u8 m_reg[4]; + u8 m_reg_mask; }; @@ -785,9 +844,9 @@ { public: // construction/destruction - nes_bmc_12in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_bmc_12in1_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - virtual void write_h(offs_t offset, uint8_t data) override; + virtual void write_h(offs_t offset, u8 data) override; virtual void pcb_reset() override; @@ -797,7 +856,7 @@ private: void update_banks(); - uint8_t m_reg[3]; + u8 m_reg[4]; }; @@ -848,10 +907,6 @@ virtual void write_h(offs_t offset, uint8_t data) override; virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; @@ -866,10 +921,6 @@ virtual void write_h(offs_t offset, uint8_t data) override; virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; @@ -884,10 +935,6 @@ virtual void write_h(offs_t offset, uint8_t data) override; virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; @@ -1026,43 +1073,15 @@ }; -// ======================> nes_bmc_gold150_device - -class nes_bmc_gold150_device : public nes_nrom_device -{ -public: - // construction/destruction - nes_bmc_gold150_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - - virtual uint8_t read_h(offs_t offset) override; - virtual void write_h(offs_t offset, uint8_t data) override; - - virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; - -private: - uint8_t m_latch; -}; - - // ======================> nes_bmc_gold260_device class nes_bmc_gold260_device : public nes_nrom_device { public: // construction/destruction - nes_bmc_gold260_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_bmc_gold260_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - virtual void write_h(offs_t offset, uint8_t data) override; - - virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; + virtual void write_h(offs_t offset, u8 data) override; }; @@ -1326,6 +1345,7 @@ DECLARE_DEVICE_TYPE(NES_NTD03, nes_ntd03_device) DECLARE_DEVICE_TYPE(NES_BMC_CTC09, nes_bmc_ctc09_device) DECLARE_DEVICE_TYPE(NES_BMC_CTC12IN1, nes_bmc_ctc12in1_device) +DECLARE_DEVICE_TYPE(NES_BMC_DS927, nes_bmc_ds927_device) DECLARE_DEVICE_TYPE(NES_BMC_FAM250, nes_bmc_fam250_device) DECLARE_DEVICE_TYPE(NES_BMC_GKA, nes_bmc_gka_device) DECLARE_DEVICE_TYPE(NES_BMC_GKB, nes_bmc_gkb_device) @@ -1335,8 +1355,11 @@ DECLARE_DEVICE_TYPE(NES_BMC_K1029, nes_bmc_k1029_device) DECLARE_DEVICE_TYPE(NES_BMC_K3036, nes_bmc_k3036_device) DECLARE_DEVICE_TYPE(NES_BMC_K3046, nes_bmc_k3046_device) +DECLARE_DEVICE_TYPE(NES_BMC_K3071, nes_bmc_k3071_device) +DECLARE_DEVICE_TYPE(NES_BMC_S009, nes_bmc_s009_device) DECLARE_DEVICE_TYPE(NES_BMC_SA005A, nes_bmc_sa005a_device) DECLARE_DEVICE_TYPE(NES_BMC_TF2740, nes_bmc_tf2740_device) +DECLARE_DEVICE_TYPE(NES_BMC_TH2348, nes_bmc_th2348_device) DECLARE_DEVICE_TYPE(NES_BMC_TJ03, nes_bmc_tj03_device) DECLARE_DEVICE_TYPE(NES_BMC_WS, nes_bmc_ws_device) DECLARE_DEVICE_TYPE(NES_BMC_11160, nes_bmc_11160_device) @@ -1364,7 +1387,6 @@ DECLARE_DEVICE_TYPE(NES_BMC_500IN1, nes_bmc_500in1_device) DECLARE_DEVICE_TYPE(NES_BMC_800IN1, nes_bmc_800in1_device) DECLARE_DEVICE_TYPE(NES_BMC_1200IN1, nes_bmc_1200in1_device) -DECLARE_DEVICE_TYPE(NES_BMC_GOLD150, nes_bmc_gold150_device) DECLARE_DEVICE_TYPE(NES_BMC_GOLD260, nes_bmc_gold260_device) DECLARE_DEVICE_TYPE(NES_BMC_4IN1RESET, nes_bmc_4in1reset_device) DECLARE_DEVICE_TYPE(NES_BMC_42IN1RESET, nes_bmc_42in1reset_device) diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/namcot.cpp mame-0.243+dfsg.1/src/devices/bus/nes/namcot.cpp --- mame-0.242+dfsg.1/src/devices/bus/nes/namcot.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/namcot.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -466,7 +466,7 @@ case 0x1000: case 0x1800: case 0x2000: case 0x2800: case 0x3000: case 0x3800: - chr1_x(offset / 0x800, data, CHRROM); + chr1_x(offset >> 11, data, CHRROM); break; case 0x4000: // no cart found with wram, so it is not clear if this could work as in Namcot-175... @@ -611,7 +611,7 @@ void nes_namcot163_device::write_m(offs_t offset, uint8_t data) { // the pcb can separately protect each 2KB chunk of the external wram from writes - int bank = (offset & 0x1800) >> 11; + int bank = BIT(offset, 11, 2); if (!m_battery.empty() && !BIT(m_wram_protect, bank)) m_battery[offset & (m_battery.size() - 1)] = data; } diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/nes_carts.cpp mame-0.243+dfsg.1/src/devices/bus/nes/nes_carts.cpp --- mame-0.242+dfsg.1/src/devices/bus/nes/nes_carts.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/nes_carts.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -221,7 +221,6 @@ device.option_add_internal("s74x374a", NES_SACHEN_74X374_ALT); // FIXME: Made up boards some different handling device.option_add_internal("tcu01", NES_SACHEN_TCU01); device.option_add_internal("tcu02", NES_SACHEN_TCU02); - device.option_add_internal("tengen_800008", NES_TENGEN_800008); // FIXME: Is this the same as CNROM? device.option_add_internal("tengen_800032", NES_TENGEN_800032); device.option_add_internal("tengen_800037", NES_TENGEN_800037); device.option_add_internal("txc_22110", NES_TXC_22110); @@ -237,12 +236,12 @@ device.option_add_internal("waixing_d", NES_WAIXING_D); device.option_add_internal("waixing_e", NES_WAIXING_E); device.option_add_internal("waixing_f", NES_WAIXING_F); + device.option_add_internal("waixing_f1", NES_WAIXING_F1); device.option_add_internal("waixing_g", NES_WAIXING_G); device.option_add_internal("waixing_h", NES_WAIXING_H); device.option_add_internal("waixing_h1", NES_WAIXING_H1); // FIXME: Made up boards the different WRAM protect banks (see Shen Mi Jin San Jiao) device.option_add_internal("waixing_i", NES_WAIXING_I); device.option_add_internal("waixing_j", NES_WAIXING_J); - device.option_add_internal("waixing_sgz", NES_WAIXING_SGZ); device.option_add_internal("waixing_sgzlz", NES_WAIXING_SGZLZ); device.option_add_internal("waixing_sec", NES_WAIXING_SEC); device.option_add_internal("waixing_ffv", NES_WAIXING_FFV); @@ -256,7 +255,6 @@ device.option_add_internal("yoko", NES_YOKO); device.option_add_internal("hengg_srich", NES_HENGG_SRICH); device.option_add_internal("hengg_xhzs", NES_HENGG_XHZS); - device.option_add_internal("hengg_shjy3", NES_HENGG_SHJY3); // mapper 253 device.option_add_internal("hes", NES_HES); device.option_add_internal("ks106c", NES_KS106C); // mapper 352 device.option_add_internal("ks202", NES_KS202); // mapper 56 @@ -293,18 +291,12 @@ device.option_add_internal("cc21", NES_CC21); device.option_add_internal("xiaozy", NES_XIAOZY); device.option_add_internal("edu2k", NES_EDU2K); - device.option_add_internal("t230", NES_T230); device.option_add_internal("jy830623c", NES_JY830623C); device.option_add_internal("unl_43272", NES_43272); // used in Gaau Hok Gwong Cheung - device.option_add_internal("tf1201", NES_TF1201); - device.option_add_internal("th21311", NES_TH21311); - device.option_add_internal("unl_cfight", NES_CITYFIGHT); // used by City Fighter IV device.option_add_internal("ninjaryu", NES_NINJARYU); // used by Ninja Ryukenden Chinese device.option_add_internal("unl_eh8813a", NES_EH8813A); // used by Dr. Mario II device.option_add_internal("zemina", NES_ZEMINA); // mapper 190 - Magic Kid GooGoo // misc bootleg boards - device.option_add_internal("ax40g", NES_AX40G); - device.option_add_internal("ax5705", NES_AX5705); device.option_add_internal("sc127", NES_SC127); device.option_add_internal("mariobaby", NES_MARIOBABY); device.option_add_internal("asnicol", NES_ASN); @@ -316,8 +308,6 @@ device.option_add_internal("smb2jb", NES_SMB2JB); device.option_add_internal("yung08", NES_YUNG08); device.option_add_internal("btl_0353", NES_0353); // used by Lucky (Roger) Rabbit FDS conversion - device.option_add_internal("btl_2yudb", NES_2YUDB); - device.option_add_internal("btl_900218", NES_900218); device.option_add_internal("09034a", NES_09034A); device.option_add_internal("l001", NES_L001); device.option_add_internal("batmanfs", NES_BATMANFS); @@ -336,7 +326,6 @@ device.option_add_internal("unl_lh51", NES_LH51); // used in Ai Senshi Nicol alt FDS conversion device.option_add_internal("unl_lh53", NES_LH53); // used in Nazo no Murasamejou (FDS Conversion) device.option_add_internal("unl_ac08", NES_AC08); // used by Green Beret FDS conversion - device.option_add_internal("sgpipe", NES_SHUIGUAN); // mapper 183 device.option_add_internal("rt01", NES_RT01); // misc MMC3 clone boards device.option_add_internal("dbz5", NES_REX_DBZ5); @@ -364,8 +353,24 @@ device.option_add_internal("sfight3", NES_SF3); device.option_add_internal("gouder", NES_GOUDER); device.option_add_internal("sa9602b", NES_SA9602B); - device.option_add_internal("unl_shero", NES_SACHEN_SHERO); + device.option_add_internal("sachen_shero", NES_SACHEN_SHERO); + device.option_add_internal("sachen_zgdh", NES_SACHEN_ZGDH); device.option_add_internal("a9746", NES_A9746); // mapper 219 +// misc VRC clone boards + device.option_add_internal("btl_2yudb", NES_2YUDB); + device.option_add_internal("btl_900218", NES_900218); + device.option_add_internal("ax40g", NES_AX40G); + device.option_add_internal("ax5705", NES_AX5705); + device.option_add_internal("bmc_830506c", NES_BMC_830506C); + device.option_add_internal("bmc_831128c", NES_BMC_831128C); + device.option_add_internal("bmc_kl06", NES_BMC_KL06); + device.option_add_internal("unl_cfight", NES_CITYFIGHT); // used by City Fighter IV + device.option_add_internal("hengg_shjy3", NES_HENGG_SHJY3); // mapper 253 + device.option_add_internal("sgpipe", NES_SHUIGUAN); // mapper 183 + device.option_add_internal("t230", NES_T230); + device.option_add_internal("tf1201", NES_TF1201); + device.option_add_internal("th21311", NES_TH21311); + device.option_add_internal("waixing_sgz", NES_WAIXING_SGZ); // misc multigame cart boards device.option_add_internal("benshieng", NES_BENSHIENG); device.option_add_internal("action52", NES_ACTION52); @@ -386,7 +391,6 @@ device.option_add_internal("bmc_810544c", NES_BMC_810544C); device.option_add_internal("bmc_82ab", NES_BMC_82AB); device.option_add_internal("bmc_830425c", NES_BMC_830425C); - device.option_add_internal("bmc_830506c", NES_BMC_830506C); device.option_add_internal("bmc_830928c", NES_BMC_830928C); device.option_add_internal("bmc_850437c", NES_BMC_850437C); device.option_add_internal("bmc_891227", NES_BMC_891227); @@ -398,6 +402,7 @@ device.option_add_internal("ntd03", NES_NTD03); device.option_add_internal("bmc_ctc09", NES_BMC_CTC09); device.option_add_internal("bmc_ctc12in1", NES_BMC_CTC12IN1); + device.option_add_internal("bmc_ds927", NES_BMC_DS927); device.option_add_internal("bmc_fam250", NES_BMC_FAM250); device.option_add_internal("bmc_gka", NES_BMC_GKA); device.option_add_internal("bmc_gkb", NES_BMC_GKB); @@ -409,8 +414,11 @@ device.option_add_internal("bmc_k3033", NES_BMC_K3033); device.option_add_internal("bmc_k3036", NES_BMC_K3036); device.option_add_internal("bmc_k3046", NES_BMC_K3046); + device.option_add_internal("bmc_k3071", NES_BMC_K3071); + device.option_add_internal("bmc_s009", NES_BMC_S009); device.option_add_internal("bmc_sa005a", NES_BMC_SA005A); device.option_add_internal("bmc_tf2740", NES_BMC_TF2740); + device.option_add_internal("bmc_th2348", NES_BMC_TH2348); device.option_add_internal("bmc_tj03", NES_BMC_TJ03); device.option_add_internal("bmc_ws", NES_BMC_WS); device.option_add_internal("bmc_g146", NES_BMC_G146); @@ -438,8 +446,7 @@ device.option_add_internal("bmc_500in1", NES_BMC_500IN1); device.option_add_internal("bmc_800in1", NES_BMC_800IN1); // mapper 236 device.option_add_internal("bmc_1200in1", NES_BMC_1200IN1); - device.option_add_internal("bmc_gold150", NES_BMC_GOLD150); // mapper 235 with 2M PRG - device.option_add_internal("bmc_gold260", NES_BMC_GOLD260); // mapper 235 with 4M PRG + device.option_add_internal("bmc_gold260", NES_BMC_GOLD260); // mapper 235 device.option_add_internal("bmc_th22913", NES_BMC_TH22913); // mapper 63 device.option_add_internal("bmc_reset4", NES_BMC_4IN1RESET); // mapper 60 with 64k prg and 32k chr device.option_add_internal("bmc_reset42", NES_BMC_42IN1RESET); // mapper 233 @@ -497,7 +504,6 @@ device.option_add_internal("onebus", NES_NROM); // UNSUPPORTED device.option_add_internal("pec586", NES_NROM); // UNSUPPORTED // are there dumps of games with these boards? - device.option_add_internal("bmc_hik_kof", NES_NROM); // mapper 251 - UNSUPPORTED device.option_add_internal("bmc_13in1jy110", NES_NROM); // [mentioned in FCEUMM source - we need more info] - UNSUPPORTED device.option_add_internal("bmc_gk_192", NES_NROM); // [mentioned in FCEUMM source - we need more info] - UNSUPPORTED device.option_add_internal("konami_qtai", NES_NROM); // [mentioned in FCEUMM source - we need more info] - UNSUPPORTED diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/nes_ines.hxx mame-0.243+dfsg.1/src/devices/bus/nes/nes_ines.hxx --- mame-0.242+dfsg.1/src/devices/bus/nes/nes_ines.hxx 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/nes_ines.hxx 2022-04-29 05:37:26.000000000 +0000 @@ -114,7 +114,7 @@ { 79, AVE_NINA06 }, { 80, TAITO_X1_005 }, { 81, NTDEC_N715021 }, // 81 Super Gun - { 82, TAITO_X1_017 }, + // 82 Taito X1-017 mapper for old mis-ordered PRG dumps { 83, CONY_BOARD }, // 84 Pasofami hacked images? { 85, KONAMI_VRC7 }, @@ -232,7 +232,7 @@ { 196, BTL_SBROS11 }, { 197, UNL_SF3 }, { 198, WAIXING_TYPE_F }, - { 199, WAIXING_TYPE_G }, + { 199, WAIXING_TYPE_F1 }, { 200, BMC_36IN1 }, { 201, BMC_21IN1 }, { 202, BMC_150IN1 }, @@ -268,7 +268,7 @@ { 232, CAMERICA_BF9096 }, { 233, BMC_42IN1RESET }, { 234, AVE_MAXI15 }, - { 235, BMC_GOLD150 }, // 235 Golden Game x-in-1 - Unsupported + { 235, BMC_GOLD260 }, // 235 Golden Game x-in-1 games { 236, BMC_70IN1 }, { 237, BMC_TELETUBBIES }, { 238, UNL_603_5052 }, @@ -464,17 +464,33 @@ // 426 PnP // 427 PnP { 428, BMC_TF2740 }, - // 429 Unused - // 430 Unused + // 429 Milowork FCFC1 flash cartridge + // 430 MMC3-based 831031C/T-308 multicart { 431, BMC_GN91B }, // 432 Realtec 8090 { 433, BMC_NC20MB }, - // 434 S-009 - // 435...442 Unused + { 434, BMC_S009 }, + // 435 F-1002 multicart + // 436 VT02 PnP + { 437, BMC_TH2348 }, + { 438, BMC_K3071 }, + // 439 YS2309 multicart + // 440 Dongda Sonic REC-9388 educational computer + // 441 841026C and 850335C multicarts + // 442 "Golden Key" educational computer // 443 NC3000M multicart // 444 NC7000M multicart - // 445...511 Unused - // 512 probably the correct MMC3 clone for chuugokt in nes.xml + // 445 DG574B MMC3-compatible multicart + // 446 Mindkids SMD172B_FPGA board + { 447, BMC_KL06 }, + // 448 VRC4-based 830768C multicart + // 449 Super Games King multicart + // 450 VRC2-based YY841157C multicart + // 451 homebrew Haratyler HP/MP + { 452, BMC_DS927 }, + // 453 Realtec 8042 + // 454...511 Unused + { 512, SACHEN_ZGDH }, { 513, SACHEN_SA9602B }, // 514 seems to be for skaraok, currently set to UNKNOWN in nes.xml // 515 Korean Family Noraebang karaoke cart with expansion cart, mic, and YM2413! @@ -490,7 +506,7 @@ { 525, KAISER_KS7021A }, // GetsuFumaDen pirate (and maybe a Contra?) // 526 sangochu clone not yet in nes.xml? { 527, UNL_AX40G }, // Fudou Myouou Den pirate - // 528 1995 New Series Super 2-in-1 multicart not in nes.xml + { 528, BMC_831128C }, // 1995 New Series Super 2-in-1 { 529, UNL_T230 }, // Datach Dragon Ball Z IV bootleg { 530, UNL_AX5705 }, // Super Mario Bros Pocker Mali // 531 Used by Asder PC-95 Famicom clone built into a keyboard @@ -513,7 +529,7 @@ { 549, KAISER_KS7016B }, // Meikyuu Jiin Dababa alt FDS conversion { 550, BMC_JY820845C }, { 551, JNCOTA_KT1001 }, - // 552 TAITO_X1_017, this is a correction of mapper 82. We should drop 82 and only support the accurate dumps of 552? + { 552, TAITO_X1_017 }, { 553, SACHEN_3013 }, // Dong Dong Nao 1 { 554, KAISER_KS7010 }, // Akumajo Dracula FDS conversion { 555, STD_EVENT2 }, diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/nes_pcb.hxx mame-0.243+dfsg.1/src/devices/bus/nes/nes_pcb.hxx --- mame-0.242+dfsg.1/src/devices/bus/nes/nes_pcb.hxx 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/nes_pcb.hxx 2022-04-29 05:37:26.000000000 +0000 @@ -129,7 +129,6 @@ { "tcu01", SACHEN_TCU01 }, { "tcu02", SACHEN_TCU02 }, { "sa9602b", SACHEN_SA9602B }, - { "tengen_800008", TENGEN_800008 }, /* FIXME: Is this the same as mapper 3? */ { "tengen_800032", TENGEN_800032 }, { "tengen_800037", TENGEN_800037 }, { "txc_22110", TXC_22110 }, @@ -145,12 +144,12 @@ { "waixing_d", WAIXING_TYPE_D }, { "waixing_e", WAIXING_TYPE_E }, { "waixing_f", WAIXING_TYPE_F }, + { "waixing_f1", WAIXING_TYPE_F1 }, { "waixing_g", WAIXING_TYPE_G }, { "waixing_h", WAIXING_TYPE_H }, { "waixing_h1", WAIXING_TYPE_H1 }, { "waixing_i", WAIXING_TYPE_I }, { "waixing_j", WAIXING_TYPE_J }, - { "waixing_sgz", WAIXING_SGZ }, { "waixing_sgzlz", WAIXING_SGZLZ }, { "waixing_sec", WAIXING_SECURITY }, { "waixing_ffv", WAIXING_FFV }, @@ -164,7 +163,6 @@ { "yoko", YOKO_BOARD }, { "hengg_srich", HENGG_SRICH }, { "hengg_xhzs", HENGG_XHZS }, - { "hengg_shjy3", HENGG_SHJY3 }, // mapper 253 { "hes", HES_BOARD }, { "ks106c", KAISER_KS106C }, // mapper 352 { "ks202", KAISER_KS202 }, // mapper 56 @@ -201,12 +199,24 @@ { "cc21", UNL_CC21 }, { "xiaozy", UNL_XIAOZY }, { "edu2k", UNL_EDU2K }, - { "t230", UNL_T230 }, { "jy830623c", UNL_JY830623C }, { "zemina", ZEMINA_BOARD }, - // misc bootleg boards + // misc VRC clone boards + { "btl_2yudb", BTL_2YUDB }, + { "btl_900218", BTL_900218 }, // pirate The Lord of King { "ax40g", UNL_AX40G }, { "ax5705", UNL_AX5705 }, + { "bmc_830506c", BMC_830506C }, + { "bmc_831128c", BMC_831128C }, + { "bmc_kl06", BMC_KL06 }, + { "unl_cfight", UNL_CITYFIGHT }, + { "hengg_shjy3", HENGG_SHJY3 }, // mapper 253 + { "sgpipe", BTL_SHUIGUAN }, + { "t230", UNL_T230 }, + { "tf1201", UNL_TF1201 }, + { "th21311", UNL_TH21311 }, + { "waixing_sgz", WAIXING_SGZ }, + // misc bootleg boards { "sc127", UNL_SC127 }, { "mariobaby", BTL_MARIOBABY }, { "asnicol", BTL_AISENSHINICOL }, @@ -218,8 +228,6 @@ { "smb2jb", BTL_SMB2JB }, { "yung08", BTL_YUNG08 }, { "btl_0353", BTL_0353 }, - { "btl_2yudb", BTL_2YUDB }, - { "btl_900218", BTL_900218 }, // pirate The Lord of King { "09034a", BTL_09034A }, { "l001", BTL_L001 }, { "batmanfs", BTL_BATMANFS }, @@ -266,7 +274,6 @@ { "bmc_810544c", BMC_810544C }, { "bmc_82ab", BMC_82AB }, { "bmc_830425c", BMC_830425C }, - { "bmc_830506c", BMC_830506C }, { "bmc_830928c", BMC_830928C }, { "bmc_850437c", BMC_850437C }, { "bmc_891227", BMC_891227 }, @@ -278,6 +285,7 @@ { "ntd03", BMC_NTD_03 }, { "bmc_ctc09", BMC_CTC09 }, { "bmc_ctc12in1", BMC_CTC_12IN1 }, + { "bmc_ds927", BMC_DS927 }, { "bmc_fam250", BMC_FAM250 }, { "bmc_gka", BMC_GKA }, { "bmc_gkb", BMC_GKB }, @@ -289,8 +297,11 @@ { "bmc_k3033", BMC_K3033 }, { "bmc_k3036", BMC_K3036 }, { "bmc_k3046", BMC_K3046 }, + { "bmc_k3071", BMC_K3071 }, + { "bmc_s009", BMC_S009 }, { "bmc_sa005a", BMC_SA005A }, { "bmc_tf2740", BMC_TF2740 }, + { "bmc_th2348", BMC_TH2348 }, { "bmc_tj03", BMC_TJ03 }, { "bmc_ws", BMC_WS }, { "bmc_hik300", BMC_SUPERHIK_300IN1 }, @@ -353,7 +364,6 @@ { "bmc_yy841101c", BMC_YY841101C }, { "bmc_yy841155c", BMC_YY841155C }, { "pjoy84", BMC_PJOY84 }, - { "bmc_gold150", BMC_GOLD150 }, { "bmc_gold260", BMC_GOLD260 }, { "bmc_th22913", BMC_TH22913 }, { "bmc_reset4", BMC_4IN1RESET }, @@ -366,7 +376,8 @@ { "jyc_c", JYCOMPANY_C }, { "tek90", JYCOMPANY_A }, { "sa9602b", SACHEN_SA9602B }, - { "unl_shero", SACHEN_SHERO }, + { "sachen_shero", SACHEN_SHERO }, + { "sachen_zgdh", SACHEN_ZGDH }, { "a9746", UNL_A9746 }, { "mmalee2", UNL_MMALEE }, { "unl_2708", UNL_2708 }, @@ -382,12 +393,8 @@ { "unl_lh53", UNL_LH53 }, { "unl_ac08", UNL_AC08 }, { "unl_malisb", UNL_MALISB }, - { "sgpipe", BTL_SHUIGUAN }, { "rt01", UNL_RT01 }, // Russian Test Cart { "unl_43272", UNL_43272 }, - { "tf1201", UNL_TF1201 }, - { "th21311", UNL_TH21311 }, - { "unl_cfight", UNL_CITYFIGHT }, { "ninjaryu", UNL_NINJARYU }, { "unl_eh8813a", UNL_EH8813A }, // Dr. Mario II { "nocash_nochr", NOCASH_NOCHR }, @@ -405,7 +412,6 @@ { "ffe4", FFE4_BOARD }, { "ffe8", FFE8_BOARD }, { "unl_dance", UNSUPPORTED_BOARD }, - { "bmc_hik_kof", UNSUPPORTED_BOARD }, { "onebus", UNSUPPORTED_BOARD }, { "pec586", UNSUPPORTED_BOARD }, { "test", TEST_BOARD }, diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/nes_slot.cpp mame-0.243+dfsg.1/src/devices/bus/nes/nes_slot.cpp --- mame-0.242+dfsg.1/src/devices/bus/nes/nes_slot.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/nes_slot.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -478,12 +478,6 @@ m_maincpu->set_input_line(m6502_device::IRQ_LINE, state); } -void device_nes_cart_interface::reset_cpu() -{ - // another hack - m_maincpu->set_pc(0xfffc); -} - //------------------------------------------------- // Other helpers //------------------------------------------------- @@ -535,10 +529,8 @@ { int page = BIT(offset, 10, 2); - if (!m_nt_writable[page]) - return; - - m_nt_access[page][offset & 0x3ff] = data; + if (m_nt_writable[page]) + m_nt_access[page][offset & 0x3ff] = data; } uint8_t device_nes_cart_interface::nt_r(offs_t offset) diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/nes_slot.h mame-0.243+dfsg.1/src/devices/bus/nes/nes_slot.h --- mame-0.242+dfsg.1/src/devices/bus/nes/nes_slot.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/nes_slot.h 2022-04-29 05:37:26.000000000 +0000 @@ -72,7 +72,7 @@ SACHEN_SA009, SACHEN_SA0036, SACHEN_SA0037, SACHEN_SA72007, SACHEN_SA72008, SACHEN_SA9602B, SACHEN_TCA01, SACHEN_TCU01, SACHEN_TCU02, SACHEN_3013, SACHEN_3014, - SACHEN_74LS374, SACHEN_74LS374_ALT, SACHEN_SHERO, + SACHEN_74LS374, SACHEN_74LS374_ALT, SACHEN_SHERO, SACHEN_ZGDH, // Sunsoft SUNSOFT_1, SUNSOFT_2, SUNSOFT_3, SUNSOFT_4, SUNSOFT_DCS, SUNSOFT_5, SUNSOFT_FME7, @@ -80,13 +80,13 @@ TAITO_TC0190FMC, TAITO_TC0190FMCP, TAITO_X1_005, TAITO_X1_017, // Tengen - TENGEN_800008, TENGEN_800032, TENGEN_800037, + TENGEN_800032, TENGEN_800037, // TXC TXC_22110, TXC_22211, TXC_COMMANDOS, TXC_DUMARACING, TXC_MJBLOCK, TXC_STRIKEW, TXC_TW, // Multigame Carts BMC_64IN1NR, BMC_190IN1, BMC_A65AS, BMC_A88S1, BMC_F15, BMC_F600, BMC_L6IN1, - BMC_GN45, BMC_HIK8IN1, BMC_SFC12, BMC_JY208, BMC_JY302, BMC_KC885, + BMC_GN45, BMC_HIK8IN1, BMC_SFC12, BMC_JY208, BMC_JY302, BMC_KC885, BMC_KL06, BMC_S24IN1SC03, BMC_T262, BMC_TELETUBBIES, BMC_WS, BMC_SUPERBIG_7IN1, BMC_SUPERHIK_4IN1, BMC_BALLGAMES_11IN1, BMC_MARIOPARTY_7IN1, BMC_GOLD_7IN1, BMC_SUPER_700IN1, BMC_FAMILY_4646, @@ -95,19 +95,19 @@ BMC_72IN1, BMC_SUPER_42IN1, BMC_76IN1, BMC_31IN1, BMC_22GAMES, BMC_20IN1, BMC_5IN1_1993, BMC_70IN1, BMC_500IN1, BMC_800IN1, BMC_1200IN1, - BMC_GKA, BMC_GKB, BMC_GKCXIN1, BMC_GN91B, + BMC_DS927, BMC_GKA, BMC_GKB, BMC_GKCXIN1, BMC_GN91B, BMC_GOLD260, BMC_HP898F, BMC_VT5201, BMC_BENSHIENG, BMC_CTC09, BMC_CTC_12IN1, BMC_60311C, BMC_80013B, BMC_810544C, BMC_82AB, BMC_830425C, BMC_830506C, BMC_830928C, BMC_850437C, BMC_891227, BMC_970630C, BMC_N32_4IN1, BMC_NC20MB, BMC_NT639, BMC_NTD_03, BMC_SRPG_5IN1, BMC_EL860947C, BMC_EL861121C, BMC_FAM250, BMC_FK23C, BMC_FK23CA, - BMC_JY012005, BMC_JY820845C, BMC_PJOY84, BMC_TH22913, BMC_11160, BMC_G146, + BMC_JY012005, BMC_JY820845C, BMC_PJOY84, + BMC_S009, BMC_TH22913, BMC_TH2348, BMC_11160, BMC_G146, BMC_2751, BMC_8157, BMC_00202650, BMC_411120C, BMC_810305C, BMC_820720C, BMC_830118C, - BMC_830832C, BMC_YY841101C, BMC_YY841155C, - BMC_GOLD150, BMC_GOLD260, + BMC_830832C, BMC_831128C, BMC_YY841101C, BMC_YY841155C, BMC_12IN1, BMC_4IN1RESET, BMC_42IN1RESET, BMC_LITTLECOM160, - BMC_K1029, BMC_K3006, BMC_K3033, BMC_K3036, BMC_K3046, BMC_SA005A, + BMC_K1029, BMC_K3006, BMC_K3033, BMC_K3036, BMC_K3046, BMC_K3071, BMC_SA005A, BMC_TF2740, BMC_TJ03, BMC_RESETSXROM, BMC_RESETTXROM, BMC_TECHLINE9IN1, // Unlicensed UNL_8237, UNL_8237A, UNL_CC21, UNL_AX40G, UNL_AX5705, UNL_KN42, @@ -139,7 +139,7 @@ CNE_DECATHLON, CNE_FSB, CNE_SHLZ, COCOMA_BOARD, CONY_BOARD, CONY1K_BOARD, SMD133_BOARD, YOKO_BOARD, RCM_GS2015, RCM_GS2004, RCM_GS2013, RCM_TF9IN1, RCM_3DBLOCK, WAIXING_TYPE_A, WAIXING_TYPE_A1, WAIXING_TYPE_B, WAIXING_TYPE_C, WAIXING_TYPE_D, - WAIXING_TYPE_E, WAIXING_TYPE_F, WAIXING_TYPE_G, WAIXING_TYPE_H, WAIXING_TYPE_H1, + WAIXING_TYPE_E, WAIXING_TYPE_F, WAIXING_TYPE_F1, WAIXING_TYPE_G, WAIXING_TYPE_H, WAIXING_TYPE_H1, WAIXING_TYPE_I, WAIXING_TYPE_J, WAIXING_FS304, WAIXING_SGZLZ, WAIXING_SGZ, WAIXING_WXZS, WAIXING_SECURITY, WAIXING_SH2, WAIXING_DQ8, WAIXING_FFV, WAIXING_WXZS2, SUPERGAME_LIONKING, SUPERGAME_BOOGERMAN, @@ -266,7 +266,6 @@ device_nes_cart_interface(const machine_config &mconfig, device_t &device); DECLARE_WRITE_LINE_MEMBER(set_irq_line); - void reset_cpu(); // internal state uint8_t *m_prg; diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/nxrom.cpp mame-0.243+dfsg.1/src/devices/bus/nes/nxrom.cpp --- mame-0.242+dfsg.1/src/devices/bus/nes/nxrom.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/nxrom.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -30,8 +30,6 @@ #include "emu.h" #include "nxrom.h" -#include "sound/samples.h" - #ifdef NES_PCB_DEBUG #define VERBOSE 1 #else @@ -154,11 +152,6 @@ chr8(0, m_chr_source); } -void nes_axrom_device::device_start() -{ - common_start(); -} - void nes_axrom_device::pcb_reset() { m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; @@ -168,18 +161,6 @@ set_nt_mirroring(PPU_MIRROR_LOW); } -void nes_bxrom_device::device_start() -{ - common_start(); -} - -void nes_bxrom_device::pcb_reset() -{ - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - prg32(0); - chr8(0, m_chr_source); -} - void nes_cnrom_device::device_start() { common_start(); @@ -195,11 +176,6 @@ m_chr_open_bus = 0; } -void nes_cprom_device::device_start() -{ - common_start(); -} - void nes_cprom_device::pcb_reset() { m_chr_source = CHRRAM; @@ -208,23 +184,6 @@ chr4_4(0, m_chr_source); } -void nes_gxrom_device::device_start() -{ - common_start(); -} - -void nes_gxrom_device::pcb_reset() -{ - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - prg32(0); - chr8(0, m_chr_source); -} - -void nes_uxrom_device::device_start() -{ - common_start(); -} - void nes_uxrom_device::pcb_reset() { m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; @@ -233,29 +192,25 @@ chr8(0, m_chr_source); } -void nes_uxrom_cc_device::device_start() -{ - common_start(); -} - -void nes_uxrom_cc_device::pcb_reset() +void nes_un1rom_device::pcb_reset() { m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - prg32(0); + prg16_89ab(0); + prg16_cdef(m_prg_chunks - 1); chr8(0, m_chr_source); } -void nes_un1rom_device::device_start() +void nes_nochr_device::pcb_reset() { - common_start(); -} + prg32(0); -void nes_un1rom_device::pcb_reset() -{ - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - prg16_89ab(0); - prg16_cdef(m_prg_chunks - 1); - chr8(0, m_chr_source); + switch (m_mirroring) + { + case PPU_MIRROR_VERT: m_ciram_a10 = 10; break; + case PPU_MIRROR_HORZ: m_ciram_a10 = 11; break; + case PPU_MIRROR_LOW: m_ciram_a10 = 12; break; + case PPU_MIRROR_HIGH: m_ciram_a10 = 13; break; + } } @@ -544,33 +499,39 @@ NoCash NOCHR board emulation - This is an homebrew PCB design on a single chip - (+possibly CIC) which uses the NTRAM as CHRRAM! + This is a homebrew PCB design on a single chip + (+optional CIC) which uses the NTRAM as CHRRAM! + One of PPU A10-A13 is tied directly to CIRAM A10, + meaning the 16K PPU address space (save for the + palette RAM at 0x3f00-0x3fff) appears as the first + 1K page of CIRAM 1, 2, 4, or 8 times followed by + the second 1K page of CIRAM 1, 2, 4, or 8 times, + and then mirrored as many times as necessary. iNES: mapper 218 - In MESS: Supported. + In MAME: Supported. -------------------------------------------------*/ -void nes_nochr_device::chr_w(offs_t offset, uint8_t data) +void nes_nochr_device::chr_w(offs_t offset, u8 data) { - int mirr = get_mirroring(); - if (mirr == PPU_MIRROR_HIGH) - m_ciram[(offset & 0x3ff) + 0x000] = data; - else if (mirr == PPU_MIRROR_LOW) - m_ciram[(offset & 0x3ff) + 0x400] = data; - else - m_ciram[offset & 0x7ff] = data; // not sure here, since there is no software to test... + offset = (offset & 0x3ff) | BIT(offset, m_ciram_a10) << 10; + m_ciram[offset] = data; } -uint8_t nes_nochr_device::chr_r(offs_t offset) +u8 nes_nochr_device::chr_r(offs_t offset) { - int mirr = get_mirroring(); - if (mirr == PPU_MIRROR_HIGH) - return m_ciram[(offset & 0x3ff) + 0x000]; - else if (mirr == PPU_MIRROR_LOW) - return m_ciram[(offset & 0x3ff) + 0x400]; - else - return m_ciram[offset & 0x7ff]; // not sure here, since there is no software to test... + offset = (offset & 0x3ff) | BIT(offset, m_ciram_a10) << 10; + return m_ciram[offset]; +} + +void nes_nochr_device::nt_w(offs_t offset, u8 data) +{ + chr_w(offset + 0x2000, data); +} + +u8 nes_nochr_device::nt_r(offs_t offset) +{ + return chr_r(offset + 0x2000); } diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/nxrom.h mame-0.243+dfsg.1/src/devices/bus/nes/nxrom.h --- mame-0.242+dfsg.1/src/devices/bus/nes/nxrom.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/nxrom.h 2022-04-29 05:37:26.000000000 +0000 @@ -6,7 +6,6 @@ #pragma once #include "nes_slot.h" -#include "sound/samples.h" // ======================> nes_nrom_device @@ -65,10 +64,6 @@ virtual void write_h(offs_t offset, uint8_t data) override; virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; @@ -81,12 +76,6 @@ nes_bxrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void write_h(offs_t offset, uint8_t data) override; - - virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; @@ -125,10 +114,6 @@ virtual void write_h(offs_t offset, uint8_t data) override; virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; @@ -141,12 +126,6 @@ nes_gxrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void write_h(offs_t offset, uint8_t data) override; - - virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; @@ -161,10 +140,6 @@ virtual void write_h(offs_t offset, uint8_t data) override; virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; @@ -177,12 +152,6 @@ nes_uxrom_cc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void write_h(offs_t offset, uint8_t data) override; - - virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; @@ -197,10 +166,6 @@ virtual void write_h(offs_t offset, uint8_t data) override; virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; @@ -210,13 +175,18 @@ { public: // construction/destruction - nes_nochr_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_nochr_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - // device-level overrides - virtual uint8_t chr_r(offs_t offset) override; - virtual void chr_w(offs_t offset, uint8_t data) override; -}; + virtual u8 chr_r(offs_t offset) override; + virtual void chr_w(offs_t offset, u8 data) override; + virtual u8 nt_r(offs_t offset) override; + virtual void nt_w(offs_t offset, u8 data) override; + + virtual void pcb_reset() override; +private: + u8 m_ciram_a10; +}; // device type definition diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/pirate.cpp mame-0.243+dfsg.1/src/devices/bus/nes/pirate.cpp --- mame-0.242+dfsg.1/src/devices/bus/nes/pirate.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/pirate.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -18,7 +18,6 @@ #include "pirate.h" #include "video/ppu2c0x.h" // this has to be included so that IRQ functions can access ppu2c0x_device::BOTTOM_VISIBLE_SCANLINE -#include "screen.h" #ifdef NES_PCB_DEBUG @@ -111,23 +110,6 @@ -void nes_agci_device::device_start() -{ - common_start(); -} - -void nes_agci_device::pcb_reset() -{ - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - prg32(0); - chr8(0, m_chr_source); -} - -void nes_dreamtech_device::device_start() -{ - common_start(); -} - void nes_dreamtech_device::pcb_reset() { m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; @@ -190,11 +172,6 @@ memset(m_reg, 0, sizeof(m_reg)); } -void nes_xiaozy_device::device_start() -{ - common_start(); -} - void nes_xiaozy_device::pcb_reset() { m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; @@ -680,7 +657,7 @@ LOG_MMC(("unl_43272 write_h, offset: %04x, data: %02x\n", offset, data)); if ((m_latch & 0x81) == 0x81) - prg32((m_latch & 0x38) >> 3); + prg32(BIT(m_latch, 3, 3)); m_latch = offset & 0xffff; } @@ -778,7 +755,7 @@ offset += 0x6000; if (offset == 0x7001 || offset == 0x7777) - return m_latch | ((offset >> 8) & 0x7f); + return m_latch | (BIT(offset, 8, 7)); return get_open_bus(); } diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/pirate.h mame-0.243+dfsg.1/src/devices/bus/nes/pirate.h --- mame-0.242+dfsg.1/src/devices/bus/nes/pirate.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/pirate.h 2022-04-29 05:37:26.000000000 +0000 @@ -17,12 +17,6 @@ nes_agci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void write_h(offs_t offset, uint8_t data) override; - - virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; @@ -37,10 +31,6 @@ virtual void write_l(offs_t offset, uint8_t data) override; virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; @@ -148,10 +138,6 @@ virtual void write_l(offs_t offset, uint8_t data) override; virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/pt554.h mame-0.243+dfsg.1/src/devices/bus/nes/pt554.h --- mame-0.242+dfsg.1/src/devices/bus/nes/pt554.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/pt554.h 2022-04-29 05:37:26.000000000 +0000 @@ -6,6 +6,7 @@ #pragma once #include "nxrom.h" +#include "sound/samples.h" // ======================> nes_bandai_pt554_device diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/rcm.cpp mame-0.243+dfsg.1/src/devices/bus/nes/rcm.cpp --- mame-0.242+dfsg.1/src/devices/bus/nes/rcm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/rcm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -75,32 +75,6 @@ -void nes_gs2015_device::device_start() -{ - common_start(); -} - -void nes_gs2015_device::pcb_reset() -{ - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - prg32(0); - chr8(0, m_chr_source); -} - -void nes_3dblock_device::device_start() -{ - common_start(); -} - -void nes_3dblock_device::pcb_reset() -{ - prg32(0); - chr8(0, CHRRAM); -} - - - - /*------------------------------------------------- mapper specific handlers -------------------------------------------------*/ diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/rcm.h mame-0.243+dfsg.1/src/devices/bus/nes/rcm.h --- mame-0.242+dfsg.1/src/devices/bus/nes/rcm.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/rcm.h 2022-04-29 05:37:26.000000000 +0000 @@ -19,12 +19,6 @@ virtual uint8_t read_l(offs_t offset) override { return read_m(offset); } virtual uint8_t read_m(offs_t offset) override; virtual void write_h(offs_t offset, uint8_t data) override; - - virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; @@ -77,12 +71,6 @@ public: // construction/destruction nes_3dblock_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - - virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/sachen.cpp mame-0.243+dfsg.1/src/devices/bus/nes/sachen.cpp --- mame-0.242+dfsg.1/src/devices/bus/nes/sachen.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/sachen.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -9,8 +9,8 @@ Here we emulate the following PCBs * Sachen SA-009 [mapper 160] - * Sachen SA-0036 [mapper 148] - * Sachen SA-0037 [mapper 149] + * Sachen SA-0036 [mapper 149] + * Sachen SA-0037 [mapper 148] * Sachen SA-72007 [mapper 145] * Sachen SA-72008 [mapper 133] * Sachen TCA-01 [mapper 143] @@ -69,7 +69,7 @@ { } -nes_sachen_sa0036_device::nes_sachen_sa0036_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +nes_sachen_sa0036_device::nes_sachen_sa0036_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_nrom_device(mconfig, NES_SACHEN_SA0036, tag, owner, clock) { } @@ -157,71 +157,6 @@ -void nes_sachen_sa009_device::device_start() -{ - common_start(); -} - -void nes_sachen_sa009_device::pcb_reset() -{ - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - prg32(0); - chr8(0, m_chr_source); -} - -void nes_sachen_sa0036_device::device_start() -{ - common_start(); -} - -void nes_sachen_sa0036_device::pcb_reset() -{ - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - prg32(0); - chr8(0, m_chr_source); -} - -void nes_sachen_sa0037_device::device_start() -{ - common_start(); -} - -void nes_sachen_sa0037_device::pcb_reset() -{ - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - prg32(0); - chr8(0, m_chr_source); -} - -void nes_sachen_sa72007_device::device_start() -{ - common_start(); -} - -void nes_sachen_sa72007_device::pcb_reset() -{ - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - prg32(0); - chr8(0, m_chr_source); -} - -void nes_sachen_sa72008_device::device_start() -{ - common_start(); -} - -void nes_sachen_sa72008_device::pcb_reset() -{ - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - prg32(0); - chr8(0, m_chr_source); -} - -void nes_sachen_tca01_device::device_start() -{ - common_start(); -} - void nes_sachen_tca01_device::pcb_reset() { m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; @@ -230,18 +165,6 @@ chr8(0, m_chr_source); } -void nes_sachen_tcu01_device::device_start() -{ - common_start(); -} - -void nes_sachen_tcu01_device::pcb_reset() -{ - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - prg32(0); - chr8(0, m_chr_source); -} - void nes_sachen_tcu02_device::device_start() { common_start(); @@ -351,30 +274,34 @@ iNES: mapper 149 - In MESS: Supported. + In MAME: Supported. -------------------------------------------------*/ -void nes_sachen_sa0036_device::write_h(offs_t offset, uint8_t data) +void nes_sachen_sa0036_device::write_h(offs_t offset, u8 data) { LOG_MMC(("sa0036 write_h, offset: %04x, data: %02x\n", offset, data)); + // this pcb is subject to bus conflict + data = account_bus_conflict(offset, data); + chr8(data >> 7, CHRROM); } /*------------------------------------------------- Sachen SA0037 bootleg boards + Tengen 800008 board - Games: Mahjong World, Shisen Mahjong + Games: Mahjong World, Shisen Mahjong, Tengen Tetris iNES: mapper 148 - In MESS: Supported. + In MAME: Supported. -------------------------------------------------*/ -void nes_sachen_sa0037_device::write_h(offs_t offset, uint8_t data) +void nes_sachen_sa0037_device::write_h(offs_t offset, u8 data) { LOG_MMC(("sa0037 write_h, offset: %04x, data: %02x\n", offset, data)); @@ -628,7 +555,7 @@ chr8(m_mmc_vrom_bank, CHRROM); break; case 0x07: - set_mirror((data >> 1) & 0x03); + set_mirror(BIT(data, 1, 2)); break; default: break; diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/sachen.h mame-0.243+dfsg.1/src/devices/bus/nes/sachen.h --- mame-0.242+dfsg.1/src/devices/bus/nes/sachen.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/sachen.h 2022-04-29 05:37:26.000000000 +0000 @@ -17,12 +17,6 @@ nes_sachen_sa009_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void write_l(offs_t offset, uint8_t data) override; - - virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; @@ -32,15 +26,9 @@ { public: // construction/destruction - nes_sachen_sa0036_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_sachen_sa0036_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - virtual void write_h(offs_t offset, uint8_t data) override; - - virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; + virtual void write_h(offs_t offset, u8 data) override; }; @@ -50,15 +38,9 @@ { public: // construction/destruction - nes_sachen_sa0037_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - - virtual void write_h(offs_t offset, uint8_t data) override; + nes_sachen_sa0037_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; + virtual void write_h(offs_t offset, u8 data) override; }; @@ -71,12 +53,6 @@ nes_sachen_sa72007_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void write_l(offs_t offset, uint8_t data) override; - - virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; @@ -89,12 +65,6 @@ nes_sachen_sa72008_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void write_l(offs_t offset, uint8_t data) override; - - virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; @@ -109,10 +79,6 @@ virtual uint8_t read_l(offs_t offset) override; virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; @@ -127,12 +93,6 @@ virtual void write_l(offs_t offset, uint8_t data) override; virtual void write_m(offs_t offset, uint8_t data) override { write_l((offset + 0x100) & 0xfff, data); } virtual void write_h(offs_t offset, uint8_t data) override { write_l((offset + 0x100) & 0xfff, data); } - - virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; @@ -224,7 +184,6 @@ // construction/destruction nes_sachen_74x374_alt_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // device-level overrides virtual uint8_t read_l(offs_t offset) override { return 0xff; } // no read_l here virtual void write_l(offs_t offset, uint8_t data) override; }; diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/subor.cpp mame-0.243+dfsg.1/src/devices/bus/nes/subor.cpp --- mame-0.242+dfsg.1/src/devices/bus/nes/subor.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/subor.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -185,12 +185,10 @@ uint8_t nes_subor2_device::nt_r(offs_t offset) { - int page = ((offset & 0xc00) >> 10); + // Nametable reads report the current page; this seems to work without issues + m_page = BIT(offset, 10, 2); - /* Nametable reads report the current page; this seems to work without issues */ - m_page = page; - - return m_nt_access[page][offset & 0x3ff]; + return device_nes_cart_interface::nt_r(offset); } /*------------------------------------------------- @@ -254,7 +252,7 @@ uint8_t subor_helper1, subor_helper2; LOG_MMC("subor0 write_h, offset: %04x, data: %02x\n", offset, data); - m_reg[(offset >> 13) & 0x03] = data; + m_reg[BIT(offset, 13, 2)] = data; subor_helper1 = ((m_reg[0] ^ m_reg[1]) << 1) & 0x20; subor_helper2 = ((m_reg[2] ^ m_reg[3]) << 0) & 0x1f; @@ -284,7 +282,7 @@ uint8_t subor_helper1, subor_helper2; LOG_MMC("subor1 write_h, offset: %04x, data: %02x\n", offset, data); - m_reg[(offset >> 13) & 0x03] = data; + m_reg[BIT(offset, 13, 2)] = data; subor_helper1 = ((m_reg[0] ^ m_reg[1]) << 1) & 0x20; subor_helper2 = ((m_reg[2] ^ m_reg[3]) << 0) & 0x1f; diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/sunsoft.cpp mame-0.243+dfsg.1/src/devices/bus/nes/sunsoft.cpp --- mame-0.242+dfsg.1/src/devices/bus/nes/sunsoft.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/sunsoft.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -64,12 +64,12 @@ { } -nes_sunsoft_4_device::nes_sunsoft_4_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) - : nes_nrom_device(mconfig, type, tag, owner, clock), m_reg(0), m_latch1(0), m_latch2(0), m_wram_enable(0) +nes_sunsoft_4_device::nes_sunsoft_4_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) + : nes_nrom_device(mconfig, type, tag, owner, clock), m_wram_enable(0) { } -nes_sunsoft_4_device::nes_sunsoft_4_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +nes_sunsoft_4_device::nes_sunsoft_4_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_sunsoft_4_device(mconfig, NES_SUNSOFT_4, tag, owner, clock) { } @@ -91,11 +91,6 @@ } -void nes_sunsoft_1_device::device_start() -{ - common_start(); -} - void nes_sunsoft_1_device::pcb_reset() { m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; @@ -104,11 +99,6 @@ chr8(0, m_chr_source); } -void nes_sunsoft_2_device::device_start() -{ - common_start(); -} - void nes_sunsoft_2_device::pcb_reset() { m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; @@ -145,8 +135,6 @@ void nes_sunsoft_4_device::device_start() { common_start(); - save_item(NAME(m_latch1)); - save_item(NAME(m_latch2)); save_item(NAME(m_reg)); save_item(NAME(m_wram_enable)); } @@ -158,9 +146,7 @@ prg16_cdef(m_prg_chunks - 1); chr8(0, m_chr_source); - m_reg = 0; - m_latch1 = 0; - m_latch2 = 0; + m_reg[0] = m_reg[1] = m_reg[2] = 0; m_wram_enable = 0; } @@ -324,107 +310,69 @@ -------------------------------------------------*/ -void nes_sunsoft_4_device::sun4_mirror( int mirror, int mirr0, int mirr1 ) +void nes_sunsoft_4_device::sun4_mirror() { - switch (mirror) + static constexpr u8 ciram_lut[4] = { - case 0x00: - set_nt_mirroring(PPU_MIRROR_VERT); - break; - case 0x01: - set_nt_mirroring(PPU_MIRROR_HORZ); - break; - case 0x02: - set_nt_mirroring(PPU_MIRROR_LOW); - break; - case 0x03: - set_nt_mirroring(PPU_MIRROR_HIGH); - break; - case 0x10: - set_nt_page(0, VROM, mirr0 | 0x80, 0); - set_nt_page(1, VROM, mirr1 | 0x80, 0); - set_nt_page(2, VROM, mirr0 | 0x80, 0); - set_nt_page(3, VROM, mirr1 | 0x80, 0); - break; - case 0x11: - set_nt_page(0, VROM, mirr0 | 0x80, 0); - set_nt_page(1, VROM, mirr0 | 0x80, 0); - set_nt_page(2, VROM, mirr1 | 0x80, 0); - set_nt_page(3, VROM, mirr1 | 0x80, 0); - break; - case 0x12: - set_nt_page(0, VROM, mirr0 | 0x80, 0); - set_nt_page(1, VROM, mirr0 | 0x80, 0); - set_nt_page(2, VROM, mirr0 | 0x80, 0); - set_nt_page(3, VROM, mirr0 | 0x80, 0); - break; - case 0x13: - set_nt_page(0, VROM, mirr1 | 0x80, 0); - set_nt_page(1, VROM, mirr1 | 0x80, 0); - set_nt_page(2, VROM, mirr1 | 0x80, 0); - set_nt_page(3, VROM, mirr1 | 0x80, 0); - break; - } + PPU_MIRROR_VERT, PPU_MIRROR_HORZ, PPU_MIRROR_LOW, PPU_MIRROR_HIGH + }; + + static constexpr u8 vrom_lut[4][4] = + { + { 0, 1, 0, 1 }, // vert + { 0, 0, 1, 1 }, // horz + { 0, 0, 0, 0 }, // low + { 1, 1, 1, 1 } // high + }; + + int mirr = m_reg[2] & 0x03; + + if (BIT(m_reg[2], 4)) + for (int i = 0; i < 4; i++) + set_nt_page(i, VROM, m_reg[vrom_lut[mirr][i]], 0); + else + set_nt_mirroring(ciram_lut[mirr]); } -void nes_sunsoft_4_device::sun4_write(offs_t offset, uint8_t data) +void nes_sunsoft_4_device::sun4_write(offs_t offset, u8 data) { LOG_MMC(("Sunsoft 4 write_h, offset %04x, data: %02x\n", offset, data)); switch (offset & 0x7000) { case 0x0000: - chr2_0(data, CHRROM); - break; case 0x1000: - chr2_2(data, CHRROM); - break; case 0x2000: - chr2_4(data, CHRROM); - break; case 0x3000: - chr2_6(data, CHRROM); + chr2_x((offset >> 11) & 0x06, data, CHRROM); break; case 0x4000: - m_latch1 = data & 0x7f; - sun4_mirror(m_reg, m_latch1, m_latch2); - break; case 0x5000: - m_latch2 = data & 0x7f; - sun4_mirror(m_reg, m_latch1, m_latch2); - break; case 0x6000: - m_reg = data & 0x13; - sun4_mirror(m_reg, m_latch1, m_latch2); + m_reg[(offset >> 12) - 4] = data | 0x80; + sun4_mirror(); break; case 0x7000: prg16_89ab(data & 0x0f); m_wram_enable = BIT(data, 4); break; - default: - LOG_MMC(("Sunsoft 4 write_h uncaught write, offset: %04x, data: %02x\n", offset, data)); - break; } } -void nes_sunsoft_4_device::write_m(offs_t offset, uint8_t data) +void nes_sunsoft_4_device::write_m(offs_t offset, u8 data) { LOG_MMC(("Sunsoft 4 write_m, offset: %04x, data: %02x\n", offset, data)); - if (!m_battery.empty() && m_wram_enable) - m_battery[offset & (m_battery.size() - 1)] = data; - if (!m_prgram.empty() && m_wram_enable) - m_prgram[offset & (m_prgram.size() - 1)] = data; + if (m_wram_enable) + device_nes_cart_interface::write_m(offset, data); } -uint8_t nes_sunsoft_4_device::read_m(offs_t offset) +u8 nes_sunsoft_4_device::read_m(offs_t offset) { LOG_MMC(("Sunsoft 4 read_m, offset: %04x\n", offset)); - if (!m_battery.empty() && m_wram_enable) - return m_battery[offset & (m_battery.size() - 1)]; - if (!m_prgram.empty() && m_wram_enable) - return m_prgram[offset & (m_prgram.size() - 1)]; + if (m_wram_enable) + return device_nes_cart_interface::read_m(offset); return get_open_bus(); } diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/sunsoft_dcs.cpp mame-0.243+dfsg.1/src/devices/bus/nes/sunsoft_dcs.cpp --- mame-0.242+dfsg.1/src/devices/bus/nes/sunsoft_dcs.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/sunsoft_dcs.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -166,30 +166,19 @@ void nes_sunsoft_dcs_device::device_start() { - common_start(); + nes_sunsoft_4_device::device_start(); + ntb_enable_timer = timer_alloc(TIMER_PROTECT); ntb_enable_timer->reset(); timer_freq = clocks_to_attotime(107520); - save_item(NAME(m_latch1)); - save_item(NAME(m_latch2)); - save_item(NAME(m_reg)); - save_item(NAME(m_wram_enable)); save_item(NAME(m_exrom_enable)); save_item(NAME(m_timer_on)); } void nes_sunsoft_dcs_device::pcb_reset() { - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - prg16_89ab(0); - prg16_cdef(m_prg_chunks - 1); - chr8(0, m_chr_source); - - m_reg = 0; - m_latch1 = 0; - m_latch2 = 0; - m_wram_enable = 0; + nes_sunsoft_4_device::pcb_reset(); m_exrom_enable = 0; m_timer_on = 0; } diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/sunsoft.h mame-0.243+dfsg.1/src/devices/bus/nes/sunsoft.h --- mame-0.242+dfsg.1/src/devices/bus/nes/sunsoft.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/sunsoft.h 2022-04-29 05:37:26.000000000 +0000 @@ -20,10 +20,6 @@ virtual void write_m(offs_t offset, uint8_t data) override; virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; @@ -38,10 +34,6 @@ virtual void write_h(offs_t offset, uint8_t data) override; virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; @@ -77,24 +69,27 @@ { public: // construction/destruction - nes_sunsoft_4_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_sunsoft_4_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - virtual uint8_t read_m(offs_t offset) override; - virtual void write_m(offs_t offset, uint8_t data) override; - void sun4_write(offs_t offset, uint8_t data); - virtual void write_h(offs_t offset, uint8_t data) override { sun4_write(offset, data); } + virtual u8 read_m(offs_t offset) override; + virtual void write_m(offs_t offset, u8 data) override; + void sun4_write(offs_t offset, u8 data); + virtual void write_h(offs_t offset, u8 data) override { sun4_write(offset, data); } virtual void pcb_reset() override; protected: - nes_sunsoft_4_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + nes_sunsoft_4_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); // device-level overrides virtual void device_start() override; - void sun4_mirror(int mirror, int mirr0, int mirr1); + u8 m_wram_enable; + +private: + void sun4_mirror(); - int m_reg, m_latch1, m_latch2, m_wram_enable; + u8 m_reg[3]; }; diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/taito.cpp mame-0.243+dfsg.1/src/devices/bus/nes/taito.cpp --- mame-0.242+dfsg.1/src/devices/bus/nes/taito.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/taito.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -46,41 +46,35 @@ DEFINE_DEVICE_TYPE(NES_X1_017, nes_x1_017_device, "nes_x1_017", "NES Cart Taito X1-017 PCB") -nes_tc0190fmc_device::nes_tc0190fmc_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) +nes_tc0190fmc_device::nes_tc0190fmc_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) : nes_nrom_device(mconfig, type, tag, owner, clock) { } -nes_tc0190fmc_device::nes_tc0190fmc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +nes_tc0190fmc_device::nes_tc0190fmc_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_tc0190fmc_device(mconfig, NES_TC0190FMC, tag, owner, clock) { } -nes_tc0190fmc_pal16r4_device::nes_tc0190fmc_pal16r4_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +nes_tc0190fmc_pal16r4_device::nes_tc0190fmc_pal16r4_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_tc0190fmc_device(mconfig, NES_TC0190FMC_PAL16R4, tag, owner, clock), m_irq_count(0), m_irq_count_latch(0), m_irq_enable(0) { } -nes_x1_005_device::nes_x1_005_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +nes_x1_005_device::nes_x1_005_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_nrom_device(mconfig, NES_X1_005, tag, owner, clock), m_latch(0) { } -nes_x1_017_device::nes_x1_017_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : nes_nrom_device(mconfig, NES_X1_017, tag, owner, clock), m_latch(0) +nes_x1_017_device::nes_x1_017_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : nes_nrom_device(mconfig, NES_X1_017, tag, owner, clock), m_latch(0), m_irq_count(0), m_irq_count_latch(0), m_irq_enable(0), irq_timer(nullptr) { } -void nes_tc0190fmc_device::device_start() -{ - common_start(); -} - void nes_tc0190fmc_device::pcb_reset() { - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; prg16_89ab(0); prg16_cdef(m_prg_chunks - 1); chr8(0, m_chr_source); @@ -88,7 +82,7 @@ void nes_tc0190fmc_pal16r4_device::device_start() { - common_start(); + nes_tc0190fmc_device::device_start(); save_item(NAME(m_irq_enable)); save_item(NAME(m_irq_count)); save_item(NAME(m_irq_count_latch)); @@ -96,10 +90,7 @@ void nes_tc0190fmc_pal16r4_device::pcb_reset() { - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - prg16_89ab(0); - prg16_cdef(m_prg_chunks - 1); - chr8(0, m_chr_source); + nes_tc0190fmc_device::pcb_reset(); m_irq_enable = 0; m_irq_count = 0; @@ -119,7 +110,6 @@ void nes_x1_005_device::pcb_reset() { - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; prg16_89ab(0); prg16_cdef(m_prg_chunks - 1); chr8(0, m_chr_source); @@ -130,6 +120,13 @@ void nes_x1_017_device::device_start() { common_start(); + irq_timer = timer_alloc(TIMER_IRQ); + irq_timer->adjust(attotime::zero, 0, clocks_to_attotime(1)); + + save_item(NAME(m_irq_enable)); + save_item(NAME(m_irq_count)); + save_item(NAME(m_irq_count_latch)); + save_item(NAME(m_latch)); save_item(NAME(m_reg)); save_item(NAME(m_mmc_vrom_bank)); @@ -142,14 +139,17 @@ void nes_x1_017_device::pcb_reset() { - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; prg16_89ab(0); prg16_cdef(m_prg_chunks - 1); chr8(0, m_chr_source); + m_irq_enable = 0; + m_irq_count = 0; + m_irq_count_latch = 0; + m_latch = 0; - memset(m_reg, 0, sizeof(m_reg)); - memset(m_mmc_vrom_bank, 0, sizeof(m_mmc_vrom_bank)); + m_reg[0] = m_reg[1] = m_reg[2] = 0; + std::fill(std::begin(m_mmc_vrom_bank), std::end(m_mmc_vrom_bank), 0x00); } @@ -168,15 +168,15 @@ iNES: mapper 33 - In MESS: Supported. + In MAME: Supported. -------------------------------------------------*/ -void nes_tc0190fmc_device::tc0190fmc_write(offs_t offset, uint8_t data) +void nes_tc0190fmc_device::write_h(offs_t offset, u8 data) { - LOG_MMC(("tc0190fmc_write, offset: %04x, data: %02x\n", offset, data)); + LOG_MMC(("tc0190fmc write_h, offset: %04x, data: %02x\n", offset, data)); - switch (offset & 0x7003) + switch (offset & 0x6003) { case 0x0000: set_nt_mirroring(BIT(data, 6) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); @@ -186,22 +186,14 @@ prg8_ab(data); break; case 0x0002: - chr2_0(data, CHRROM); - break; case 0x0003: - chr2_2(data, CHRROM); + chr2_x((offset & 1) << 1, data, CHRROM); break; case 0x2000: - chr1_4(data, CHRROM); - break; case 0x2001: - chr1_5(data, CHRROM); - break; case 0x2002: - chr1_6(data, CHRROM); - break; case 0x2003: - chr1_7(data, CHRROM); + chr1_x((offset & 0x03) | 4, data, CHRROM); break; } } @@ -221,30 +213,30 @@ iNES: mapper 48 - In MESS: Supported. + In MAME: Supported. -------------------------------------------------*/ -void nes_tc0190fmc_pal16r4_device::hblank_irq( int scanline, int vblank, int blanked ) +void nes_tc0190fmc_pal16r4_device::hblank_irq(int scanline, int vblank, int blanked) { if (scanline < ppu2c0x_device::BOTTOM_VISIBLE_SCANLINE) { - int prior_count = m_irq_count; - if (m_irq_count == 0) - m_irq_count = m_irq_count_latch; - else + if (m_irq_count) + { m_irq_count--; - - if (m_irq_enable && !blanked && (m_irq_count == 0) && prior_count) - set_irq_line(ASSERT_LINE); + if (m_irq_enable && !blanked && !m_irq_count) + set_irq_line(ASSERT_LINE); + } + else + m_irq_count = m_irq_count_latch; } } -void nes_tc0190fmc_pal16r4_device::write_h(offs_t offset, uint8_t data) +void nes_tc0190fmc_pal16r4_device::write_h(offs_t offset, u8 data) { LOG_MMC(("tc0190fmc pal16r4 write_h, offset: %04x, data: %02x\n", offset, data)); - switch (offset & 0x7003) + switch (offset & 0x6003) { case 0x0000: prg8_89(data); @@ -256,10 +248,10 @@ case 0x2001: case 0x2002: case 0x2003: - tc0190fmc_write(offset, data); + nes_tc0190fmc_device::write_h(offset, data); break; case 0x4000: - m_irq_count_latch = (0x100 - data) & 0xff; + m_irq_count_latch = ~data; break; case 0x4001: m_irq_count = m_irq_count_latch; @@ -284,78 +276,62 @@ Actually, Fudou Myouou Den uses a variant of the board with CIRAM, making necessary two distinct mappers & pcb_id. - Also, we miss to emulate the security check at 0x7ef8 / 0x7ef9 - and the 0x80 ram! - iNES: mappers 80 & 207 -------------------------------------------------*/ -void nes_x1_005_device::write_m(offs_t offset, uint8_t data) +void nes_x1_005_device::write_m(offs_t offset, u8 data) { LOG_MMC(("x1_005 write_m, offset: %04x, data: %02x\n", offset, data)); - switch (offset) + if ((offset & 0x1f70) == 0x1e70) // A7 is not connected { - case 0x1ef0: - chr2_0(BIT(data, 1, 6), CHRROM); - if (m_x1_005_alt_mirroring) - { - set_nt_page(0, CIRAM, BIT(data, 7), 1); - set_nt_page(1, CIRAM, BIT(data, 7), 1); - } - break; - case 0x1ef1: - chr2_2(BIT(data, 1, 6), CHRROM); - if (m_x1_005_alt_mirroring) - { - set_nt_page(2, CIRAM, BIT(data, 7), 1); - set_nt_page(3, CIRAM, BIT(data, 7), 1); - } - break; - case 0x1ef2: - chr1_4(data, CHRROM); - break; - case 0x1ef3: - chr1_5(data, CHRROM); - break; - case 0x1ef4: - chr1_6(data, CHRROM); - break; - case 0x1ef5: - chr1_7(data, CHRROM); - break; - case 0x1ef6: - case 0x1ef7: - if (!m_x1_005_alt_mirroring) - set_nt_mirroring(BIT(data, 0) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ); - break; - case 0x1ef8: - case 0x1ef9: - m_latch = data; - break; - case 0x1efa: - case 0x1efb: - prg8_89(data); - break; - case 0x1efc: - case 0x1efd: - prg8_ab(data); - break; - case 0x1efe: - case 0x1eff: - prg8_cd(data); - break; - default: - logerror("mapper80_m_w uncaught addr: %04x, value: %02x\n", offset + 0x6000, data); - break; - } + u8 reg = offset & 0x0f; - if (offset >= 0x1f00 && m_latch == 0xa3) + switch (reg) + { + case 0x0: + case 0x1: + reg <<= 1; + chr2_x(reg, BIT(data, 1, 6), CHRROM); + if (m_x1_005_alt_mirroring) + { + set_nt_page(reg + 0, CIRAM, BIT(data, 7), 1); + set_nt_page(reg + 1, CIRAM, BIT(data, 7), 1); + } + break; + case 0x2: + case 0x3: + case 0x4: + case 0x5: + chr1_x(reg + 2, data, CHRROM); + break; + case 0x6: + case 0x7: + if (!m_x1_005_alt_mirroring) + set_nt_mirroring(BIT(data, 0) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ); + break; + case 0x8: + case 0x9: + m_latch = data; + break; + case 0xa: + case 0xb: + case 0xc: + case 0xd: + case 0xe: + case 0xf: + prg8_x((reg - 0x0a) >> 1, data); + break; + } + } + else if (offset >= 0x1f00 && m_latch == 0xa3) m_x1_005_ram[offset & 0x7f] = data; + else + logerror("Taito X1-005 uncaught addr: %04x, value: %02x\n", offset + 0x6000, data); } -uint8_t nes_x1_005_device::read_m(offs_t offset) +u8 nes_x1_005_device::read_m(offs_t offset) { LOG_MMC(("x1_005 read_m, offset: %04x\n", offset)); @@ -369,37 +345,42 @@ Taito X1-017 board emulation - We miss to emulate the security check at 0x6000-0x73ff - and the ram! - Games: Kyuukyoku Harikiri Koushien, Kyuukyoku Harikiri - Stadium, SD Keiji - Blader + Stadium 3, Kyuukyoku Harikiri - Heisei Gannenban, + SD Keiji - Blader - iNES: mapper 82 + NES 2.0: mapper 552 (old mapper 82 are mis-ordered bad dumps) - In MESS: Supported. + In MAME: Supported. + + TODO: KH Koushien seems to be working except it needs to + be reset once with a new NVRAM file. KH Heisei won't + load "Single Game" menu option but other game modes work. -------------------------------------------------*/ -void nes_x1_017_device::set_chr() +void nes_x1_017_device::device_timer(emu_timer &timer, device_timer_id id, int param) { - if (m_latch) - { - chr2_4(m_mmc_vrom_bank[0] >> 1, CHRROM); - chr2_6(m_mmc_vrom_bank[1] >> 1, CHRROM); - } - else + if (id == TIMER_IRQ) { - chr2_0(m_mmc_vrom_bank[0] >> 1, CHRROM); - chr2_2(m_mmc_vrom_bank[1] >> 1, CHRROM); + if ((m_irq_enable & 0x05) == 1 && m_irq_count) // counting enabled? + m_irq_count--; + if (!m_irq_count && BIT(m_irq_enable, 1)) + set_irq_line(ASSERT_LINE); } +} + +void nes_x1_017_device::set_chr() +{ + chr2_x(0 ^ m_latch, m_mmc_vrom_bank[0] >> 1, CHRROM); + chr2_x(2 ^ m_latch, m_mmc_vrom_bank[1] >> 1, CHRROM); chr1_x(4 ^ m_latch, m_mmc_vrom_bank[2], CHRROM); chr1_x(5 ^ m_latch, m_mmc_vrom_bank[3], CHRROM); chr1_x(6 ^ m_latch, m_mmc_vrom_bank[4], CHRROM); chr1_x(7 ^ m_latch, m_mmc_vrom_bank[5], CHRROM); } -void nes_x1_017_device::write_m(offs_t offset, uint8_t data) +void nes_x1_017_device::write_m(offs_t offset, u8 data) { LOG_MMC(("x1017 write_m, offset: %04x, data: %02x\n", offset, data)); @@ -411,19 +392,13 @@ case 0x1ef3: case 0x1ef4: case 0x1ef5: - if (m_mmc_vrom_bank[offset & 0x07] != data) - { - m_mmc_vrom_bank[offset & 0x07] = data; - set_chr(); - } + m_mmc_vrom_bank[offset & 0x07] = data; + set_chr(); break; case 0x1ef6: set_nt_mirroring(BIT(data, 0) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ); - if (m_latch != ((data & 0x02) << 1)) - { - m_latch = ((data & 0x02) << 1); - set_chr(); - } + m_latch = (data & 0x02) << 1; + set_chr(); break; case 0x1ef7: case 0x1ef8: @@ -431,39 +406,54 @@ m_reg[(offset & 0x0f) - 7] = data; break; case 0x1efa: - prg8_89(data >> 2); - break; case 0x1efb: - prg8_ab(data >> 2); - break; case 0x1efc: - prg8_cd(data >> 2); + prg8_x((offset & 0x0f) - 0x0a, bitswap<6>(data, 0, 1, 2, 3, 4, 5)); + break; + case 0x1efd: + m_irq_count_latch = data; + break; + case 0x1efe: + m_irq_enable = data; + if (!BIT(m_irq_enable, 0)) + m_irq_count = m_irq_count_latch ? (m_irq_count_latch + 2) * 16 : 17; + if (!BIT(m_irq_enable, 1)) + set_irq_line(CLEAR_LINE); break; - default: - logerror("x1017_m_w uncaught write, addr: %04x, value: %02x\n", offset + 0x6000, data); + case 0x1eff: + set_irq_line(CLEAR_LINE); + m_irq_count = m_irq_count_latch ? (m_irq_count_latch + 1) * 16 : 1; break; } // 2+2+1 KB of Internal RAM can be independently enabled/disabled! - if (offset < 0x0800 && m_reg[0] == 0xca) - m_x1_017_ram[0x0000 + (offset & 0x7ff)] = data; - if (offset < 0x1000 && m_reg[1] == 0x69) - m_x1_017_ram[0x0800 + (offset & 0x7ff)] = data; - if (offset < 0x1400 && m_reg[2] == 0x84) - m_x1_017_ram[0x1000 + (offset & 0x3ff)] = data; + if ((offset < 0x0800 && m_reg[0] == 0xca) || + (offset < 0x1000 && m_reg[1] == 0x69) || + (offset < 0x1400 && m_reg[2] == 0x84)) + { + m_x1_017_ram[offset] = data; + + // 1st byte in each 1K page latches most recent read/write from that page + m_x1_017_ram[offset & 0x1c00] = data; + } } -uint8_t nes_x1_017_device::read_m(offs_t offset) +u8 nes_x1_017_device::read_m(offs_t offset) { LOG_MMC(("x1017 read_m, offset: %04x\n", offset)); // 2+2+1 KB of Internal RAM can be independently enabled/disabled! - if (offset < 0x0800 && m_reg[0] == 0xca) - return m_x1_017_ram[0x0000 + (offset & 0x7ff)]; - if (offset < 0x1000 && m_reg[1] == 0x69) - return m_x1_017_ram[0x0800 + (offset & 0x7ff)]; - if (offset < 0x1400 && m_reg[2] == 0x84) - return m_x1_017_ram[0x1000 + (offset & 0x3ff)]; + if ((offset < 0x0800 && m_reg[0] == 0xca) || + (offset < 0x1000 && m_reg[1] == 0x69) || + (offset < 0x1400 && m_reg[2] == 0x84)) + { + u8 ret = m_x1_017_ram[offset]; - return get_open_bus(); + // 1st byte in each 1K page latches most recent read/write from that page + m_x1_017_ram[offset & 0x1c00] = ret; + + return ret; + } + + return 0; // no open bus behavior due to pull-down resistors } diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/taito.h mame-0.243+dfsg.1/src/devices/bus/nes/taito.h --- mame-0.242+dfsg.1/src/devices/bus/nes/taito.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/taito.h 2022-04-29 05:37:26.000000000 +0000 @@ -14,18 +14,14 @@ { public: // construction/destruction - nes_tc0190fmc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_tc0190fmc_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - void tc0190fmc_write(offs_t offset, uint8_t data); - virtual void write_h(offs_t offset, uint8_t data) override { tc0190fmc_write(offset, data); } + virtual void write_h(offs_t offset, u8 data) override; virtual void pcb_reset() override; protected: - nes_tc0190fmc_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; + nes_tc0190fmc_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); }; @@ -35,9 +31,9 @@ { public: // construction/destruction - nes_tc0190fmc_pal16r4_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_tc0190fmc_pal16r4_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - virtual void write_h(offs_t offset, uint8_t data) override; + virtual void write_h(offs_t offset, u8 data) override; virtual void hblank_irq(int scanline, int vblank, int blanked) override; virtual void pcb_reset() override; @@ -47,8 +43,8 @@ virtual void device_start() override; private: - uint16_t m_irq_count, m_irq_count_latch; - int m_irq_enable; + u8 m_irq_count, m_irq_count_latch; + u8 m_irq_enable; }; @@ -58,10 +54,10 @@ { public: // construction/destruction - nes_x1_005_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_x1_005_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - virtual uint8_t read_m(offs_t offset) override; - virtual void write_m(offs_t offset, uint8_t data) override; + virtual u8 read_m(offs_t offset) override; + virtual void write_m(offs_t offset, u8 data) override; virtual void pcb_reset() override; @@ -70,9 +66,9 @@ virtual void device_start() override; private: - uint8_t m_latch; + u8 m_latch; // Taito X1-005 chip contains 80 bytes of internal ram, possibly battery backed up - uint8_t m_x1_005_ram[0x80]; + u8 m_x1_005_ram[0x80]; }; @@ -82,24 +78,34 @@ { public: // construction/destruction - nes_x1_017_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_x1_017_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - virtual uint8_t read_m(offs_t offset) override; - virtual void write_m(offs_t offset, uint8_t data) override; + virtual u8 read_ex(offs_t offset) override { return 0; } // no open bus + virtual u8 read_l(offs_t offset) override { return 0; } // no open bus + virtual u8 read_m(offs_t offset) override; + virtual void write_m(offs_t offset, u8 data) override; virtual void pcb_reset() override; protected: // device-level overrides virtual void device_start() override; + virtual void device_timer(emu_timer &timer, device_timer_id id, int param) override; private: void set_chr(); - uint8_t m_latch; - uint8_t m_reg[3]; //mapper ram protect - uint8_t m_mmc_vrom_bank[6]; + u8 m_latch; + u8 m_reg[3]; // mapper ram enable + u8 m_mmc_vrom_bank[6]; // Taito X1-017 chip contains 5K of internal ram, battery backed up - uint8_t m_x1_017_ram[0x1400]; + u8 m_x1_017_ram[0x1400]; + + u16 m_irq_count; + u8 m_irq_count_latch; + u8 m_irq_enable; + + static constexpr device_timer_id TIMER_IRQ = 0; + emu_timer *irq_timer; }; @@ -109,5 +115,4 @@ DECLARE_DEVICE_TYPE(NES_X1_005, nes_x1_005_device) DECLARE_DEVICE_TYPE(NES_X1_017, nes_x1_017_device) - #endif // MAME_BUS_NES_TAITO_H diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/tengen.cpp mame-0.243+dfsg.1/src/devices/bus/nes/tengen.cpp --- mame-0.242+dfsg.1/src/devices/bus/nes/tengen.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/tengen.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -8,12 +8,10 @@ Here we emulate the following PCBs - * Tengen 800008 * Tengen 800032 [mapper 64] * Tengen 800037 [mapper 158] - TODO: - - emulated the IRQ delay in 800032 (possibly reason of Skull & Crossbones not working?) + Note, Tetris' Tengen 800008 [mapper 148] is implemented in sachen.cpp. ***********************************************************************************************************/ @@ -37,27 +35,21 @@ // constructor //------------------------------------------------- -DEFINE_DEVICE_TYPE(NES_TENGEN_800008, nes_tengen008_device, "nes_tengen008", "NES Cart Tengen 800008 PCB") DEFINE_DEVICE_TYPE(NES_TENGEN_800032, nes_tengen032_device, "nes_tengen032", "NES Cart Tengen 800032 PCB") DEFINE_DEVICE_TYPE(NES_TENGEN_800037, nes_tengen037_device, "nes_tengen037", "NES Cart Tengen 800037 PCB") -nes_tengen008_device::nes_tengen008_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : nes_nrom_device(mconfig, NES_TENGEN_800008, tag, owner, clock) +nes_tengen032_device::nes_tengen032_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) + : nes_nrom_device(mconfig, type, tag, owner, clock), m_latch(0), m_irq_count(0), m_irq_count_latch(0), m_irq_mode(0), m_irq_reset(0), m_irq_enable(0), m_irq_pending(0), irq_timer(nullptr) { } -nes_tengen032_device::nes_tengen032_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) - : nes_nrom_device(mconfig, type, tag, owner, clock), m_irq_count(0), m_irq_count_latch(0), m_irq_mode(0), m_irq_reset(0), m_irq_enable(0), m_latch(0), irq_timer(nullptr) -{ -} - -nes_tengen032_device::nes_tengen032_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +nes_tengen032_device::nes_tengen032_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_tengen032_device(mconfig, NES_TENGEN_800032, tag, owner, clock) { } -nes_tengen037_device::nes_tengen037_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +nes_tengen037_device::nes_tengen037_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_tengen032_device(mconfig, NES_TENGEN_800037, tag, owner, clock) { } @@ -65,24 +57,12 @@ -void nes_tengen008_device::device_start() -{ - common_start(); -} - -void nes_tengen008_device::pcb_reset() -{ - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - prg32(0); - chr8(0, m_chr_source); -} - void nes_tengen032_device::device_start() { common_start(); irq_timer = timer_alloc(TIMER_IRQ); - irq_timer->reset(); timer_freq = clocks_to_attotime(4); + irq_timer->adjust(attotime::zero, 0, timer_freq); save_item(NAME(m_mmc_prg_bank)); save_item(NAME(m_mmc_vrom_bank)); @@ -91,24 +71,27 @@ save_item(NAME(m_irq_mode)); save_item(NAME(m_irq_reset)); save_item(NAME(m_irq_enable)); + save_item(NAME(m_irq_pending)); save_item(NAME(m_irq_count)); save_item(NAME(m_irq_count_latch)); } void nes_tengen032_device::pcb_reset() { - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - prg16_89ab(m_prg_chunks - 1); + prg16_89ab(0); prg16_cdef(m_prg_chunks - 1); chr8(0, m_chr_source); - memset(m_mmc_prg_bank, 0, sizeof(m_mmc_prg_bank)); - memset(m_mmc_vrom_bank, 0, sizeof(m_mmc_vrom_bank)); + + std::fill(std::begin(m_mmc_prg_bank), std::end(m_mmc_prg_bank), 0x00); + std::fill(std::begin(m_mmc_vrom_bank), std::end(m_mmc_vrom_bank), 0x00); m_latch = 0; m_irq_mode = 0; m_irq_reset = 0; m_irq_enable = 0; - m_irq_count = m_irq_count_latch = 0; + m_irq_pending = 0; + m_irq_count = 0; + m_irq_count_latch = 0xff; } @@ -118,27 +101,6 @@ /*------------------------------------------------- - Tengen 800008 Board - - iNES: mapper 3? - - In MESS: Supported. - - -------------------------------------------------*/ - -void nes_tengen008_device::write_h(offs_t offset, uint8_t data) -{ - LOG_MMC(("tengen008 write_h, offset: %04x, data: %02x\n", offset, data)); - - // this pcb is subject to bus conflict - data = account_bus_conflict(offset, data); - - prg32(data >> 3); - chr8(data, CHRROM); -} - -/*------------------------------------------------- - Tengen 800032 Board Games: Klax, Road Runner, Rolling Thunder, Shinobi, Skulls @@ -150,10 +112,12 @@ iNES: mapper 64 - In MESS: Partially Supported (there should be a small - delay between the IRQ and its execution, but that is not - emulated yet: this is possibly the problem with Skulls - & Crossbones) + In MAME: Partially supported. + + TODO: There are issues with IRQ. Skull & Crossbones + probably doesn't work because of this? It alone uses + the cycle-based IRQ (and it constantly switches + between IRQ modes). -------------------------------------------------*/ @@ -168,14 +132,15 @@ if (m_irq_reset) { m_irq_reset = 0; - m_irq_count = m_irq_count_latch + 1; + m_irq_count = m_irq_count_latch | (m_irq_count_latch ? 1 : 0); } else if (!m_irq_count) m_irq_count = m_irq_count_latch; + else + m_irq_count--; - m_irq_count--; if (m_irq_enable && !blanked && !m_irq_count) - set_irq_line(ASSERT_LINE); + m_irq_pending = 1; } // we use the HBLANK IRQ latch from PPU for the scanline based IRQ mode @@ -185,7 +150,14 @@ { if (id == TIMER_IRQ) { - irq_clock(0); + if (m_irq_pending) + { + set_irq_line(ASSERT_LINE); + m_irq_pending = 0; + } + + if (m_irq_mode) + irq_clock(0); } } @@ -194,7 +166,7 @@ { if (!m_irq_mode) // we are in scanline mode! { - if (scanline < ppu2c0x_device::BOTTOM_VISIBLE_SCANLINE) + if (scanline <= ppu2c0x_device::BOTTOM_VISIBLE_SCANLINE) { irq_clock(blanked); } @@ -203,47 +175,40 @@ void nes_tengen032_device::set_prg() { - uint8_t prg_mode = m_latch & 0x40; + u8 prg_flip = (m_latch & 0x40) >> 5; - prg8_89(m_mmc_prg_bank[prg_mode ? 2: 0]); - prg8_ab(m_mmc_prg_bank[prg_mode ? 0: 1]); - prg8_cd(m_mmc_prg_bank[prg_mode ? 1: 2]); -} - -void nes_tengen032_device::chr_cb(int start, int bank, int source) -{ - chr1_x(start, bank, source); + prg8_89(m_mmc_prg_bank[0 ^ prg_flip]); + prg8_ab(m_mmc_prg_bank[1]); + prg8_cd(m_mmc_prg_bank[2 ^ prg_flip]); } void nes_tengen032_device::set_chr() { - uint8_t chr_page = (m_latch & 0x80) >> 5; + u8 chr_flip = (m_latch & 0x80) >> 5; if (m_latch & 0x20) { - chr_cb(0 ^ chr_page, m_mmc_vrom_bank[0], CHRROM); - chr_cb(1 ^ chr_page, m_mmc_vrom_bank[6], CHRROM); - chr_cb(2 ^ chr_page, m_mmc_vrom_bank[1], CHRROM); - chr_cb(3 ^ chr_page, m_mmc_vrom_bank[7], CHRROM); + chr1_x(0 ^ chr_flip, m_mmc_vrom_bank[0], CHRROM); + chr1_x(1 ^ chr_flip, m_mmc_vrom_bank[6], CHRROM); + chr1_x(2 ^ chr_flip, m_mmc_vrom_bank[1], CHRROM); + chr1_x(3 ^ chr_flip, m_mmc_vrom_bank[7], CHRROM); } else { - chr_cb(0 ^ chr_page, m_mmc_vrom_bank[0] & ~0x01, CHRROM); - chr_cb(1 ^ chr_page, m_mmc_vrom_bank[0] | 0x01, CHRROM); - chr_cb(2 ^ chr_page, m_mmc_vrom_bank[1] & ~0x01, CHRROM); - chr_cb(3 ^ chr_page, m_mmc_vrom_bank[1] | 0x01, CHRROM); + chr2_x(0 ^ chr_flip, m_mmc_vrom_bank[0] >> 1, CHRROM); + chr2_x(2 ^ chr_flip, m_mmc_vrom_bank[1] >> 1, CHRROM); } - chr_cb(4 ^ chr_page, m_mmc_vrom_bank[2], CHRROM); - chr_cb(5 ^ chr_page, m_mmc_vrom_bank[3], CHRROM); - chr_cb(6 ^ chr_page, m_mmc_vrom_bank[4], CHRROM); - chr_cb(7 ^ chr_page, m_mmc_vrom_bank[5], CHRROM); + chr1_x(4 ^ chr_flip, m_mmc_vrom_bank[2], CHRROM); + chr1_x(5 ^ chr_flip, m_mmc_vrom_bank[3], CHRROM); + chr1_x(6 ^ chr_flip, m_mmc_vrom_bank[4], CHRROM); + chr1_x(7 ^ chr_flip, m_mmc_vrom_bank[5], CHRROM); } -void nes_tengen032_device::tengen032_write(offs_t offset, uint8_t data) +void nes_tengen032_device::write_h(offs_t offset, u8 data) { - uint8_t helper, cmd; - LOG_MMC(("tengen032_write, offset: %04x, data: %02x\n", offset, data)); + u8 helper, cmd; + LOG_MMC(("tengen032 write_h, offset: %04x, data: %02x\n", offset, data)); switch (offset & 0x6001) { @@ -293,17 +258,16 @@ m_irq_count_latch = data; break; - case 0x4001: /* $c001 - IRQ scanline latch */ + case 0x4001: // $c001 - IRQ scanline latch m_irq_mode = data & 0x01; if (m_irq_mode) irq_timer->adjust(attotime::zero, 0, timer_freq); - else - irq_timer->adjust(attotime::never); m_irq_reset = 1; break; case 0x6000: m_irq_enable = 0; + m_irq_pending = 0; set_irq_line(CLEAR_LINE); break; @@ -330,36 +294,23 @@ iNES: mapper 158 - In MESS: Supported. + In MAME: Supported. -------------------------------------------------*/ -void nes_tengen037_device::set_mirror() +void nes_tengen037_device::set_chr() { - if (m_latch & 0x80) - { - set_nt_page(0, CIRAM, BIT(m_mmc_vrom_bank[2],7), 1); - set_nt_page(1, CIRAM, BIT(m_mmc_vrom_bank[3],7), 1); - set_nt_page(2, CIRAM, BIT(m_mmc_vrom_bank[4],7), 1); - set_nt_page(3, CIRAM, BIT(m_mmc_vrom_bank[5],7), 1); - } - else - { - set_nt_page(0, CIRAM, BIT(m_mmc_vrom_bank[0],7), 1); - set_nt_page(1, CIRAM, BIT(m_mmc_vrom_bank[0],7), 1); - set_nt_page(2, CIRAM, BIT(m_mmc_vrom_bank[1],7), 1); - set_nt_page(3, CIRAM, BIT(m_mmc_vrom_bank[1],7), 1); - } -} + nes_tengen032_device::set_chr(); -void nes_tengen037_device::chr_cb( int start, int bank, int source ) -{ - set_mirror(); // we could probably update only for one (e.g. the first) call, to slightly optimize the code - chr1_x(start, bank, source); -} + // do nametables + static constexpr u8 bank[8] = { 0, 0, 1, 1, 2, 3, 4, 5 }; + int start = (m_latch & 0x80) >> 5; + for (int i = 0; i < 4; i++) + set_nt_page(i, CIRAM, BIT(m_mmc_vrom_bank[bank[start + i]], 7), 1); +} -void nes_tengen037_device::write_h(offs_t offset, uint8_t data) +void nes_tengen037_device::write_h(offs_t offset, u8 data) { LOG_MMC(("tengen037 write_h, offset: %04x, data: %02x\n", offset, data)); @@ -367,9 +318,8 @@ { case 0x2000: break; - default: - tengen032_write(offset, data); + nes_tengen032_device::write_h(offset, data); break; } } diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/tengen.h mame-0.243+dfsg.1/src/devices/bus/nes/tengen.h --- mame-0.242+dfsg.1/src/devices/bus/nes/tengen.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/tengen.h 2022-04-29 05:37:26.000000000 +0000 @@ -6,60 +6,42 @@ #include "nxrom.h" -// ======================> nes_tengen008_device - -class nes_tengen008_device : public nes_nrom_device -{ -public: - // construction/destruction - nes_tengen008_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - - virtual void write_h(offs_t offset, uint8_t data) override; - - virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; -}; - - // ======================> nes_tengen032_device class nes_tengen032_device : public nes_nrom_device { public: // construction/destruction - nes_tengen032_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_tengen032_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - void tengen032_write(offs_t offset, uint8_t data); - virtual void write_h(offs_t offset, uint8_t data) override { tengen032_write(offset, data); } + virtual void write_h(offs_t offset, u8 data) override; virtual void hblank_irq(int scanline, int vblank, int blanked) override; virtual void pcb_reset() override; protected: - nes_tengen032_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + nes_tengen032_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); // device-level overrides virtual void device_start() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param) override; - virtual void chr_cb(int start, int bank, int source); + virtual void set_chr(); + u8 m_latch; + u8 m_mmc_vrom_bank[8]; + +private: void set_prg(); - void set_chr(); void irq_clock(int blanked); - uint16_t m_irq_count, m_irq_count_latch; - uint8_t m_irq_mode, m_irq_reset; - int m_irq_enable; - - uint8_t m_latch; - uint8_t m_mmc_prg_bank[3]; - uint8_t m_mmc_vrom_bank[8]; + u16 m_irq_count, m_irq_count_latch; + u8 m_irq_mode, m_irq_reset; + u8 m_irq_enable, m_irq_pending; + + u8 m_mmc_prg_bank[3]; - static const device_timer_id TIMER_IRQ = 0; + static constexpr device_timer_id TIMER_IRQ = 0; emu_timer *irq_timer; attotime timer_freq; }; @@ -71,19 +53,17 @@ { public: // construction/destruction - nes_tengen037_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_tengen037_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); // device-level overrides - virtual void write_h(offs_t offset, uint8_t data) override; - virtual void chr_cb(int start, int bank, int source) override; + virtual void write_h(offs_t offset, u8 data) override; protected: - void set_mirror(); + virtual void set_chr() override; }; // device type definition -DECLARE_DEVICE_TYPE(NES_TENGEN_800008, nes_tengen008_device) DECLARE_DEVICE_TYPE(NES_TENGEN_800032, nes_tengen032_device) DECLARE_DEVICE_TYPE(NES_TENGEN_800037, nes_tengen037_device) diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/txc.cpp mame-0.243+dfsg.1/src/devices/bus/nes/txc.cpp --- mame-0.242+dfsg.1/src/devices/bus/nes/txc.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/txc.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -91,31 +91,6 @@ m_reg[0] = m_reg[1] = m_reg[2] = m_reg[3] = 0; } -void nes_txc_strikew_device::device_start() -{ - common_start(); -} - -void nes_txc_strikew_device::pcb_reset() -{ - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - prg32(0); - chr8(0, m_chr_source); -} - -void nes_txc_commandos_device::device_start() -{ - common_start(); -} - -void nes_txc_commandos_device::pcb_reset() -{ - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - prg32(0); - chr8(0, m_chr_source); -} - - diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/txc.h mame-0.243+dfsg.1/src/devices/bus/nes/txc.h --- mame-0.242+dfsg.1/src/devices/bus/nes/txc.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/txc.h 2022-04-29 05:37:26.000000000 +0000 @@ -40,7 +40,6 @@ // construction/destruction nes_txc_dumarc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // device-level overrides virtual void write_h(offs_t offset, uint8_t data) override; }; @@ -53,7 +52,6 @@ // construction/destruction nes_txc_mjblock_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // device-level overrides virtual uint8_t read_l(offs_t offset) override; }; @@ -67,12 +65,6 @@ nes_txc_strikew_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void write_h(offs_t offset, uint8_t data) override; - - virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; @@ -86,12 +78,6 @@ virtual uint8_t read_l(offs_t offset) override; virtual void write_h(offs_t offset, uint8_t data) override; - - virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/vrc_clones.cpp mame-0.243+dfsg.1/src/devices/bus/nes/vrc_clones.cpp --- mame-0.242+dfsg.1/src/devices/bus/nes/vrc_clones.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/vrc_clones.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -33,6 +33,8 @@ DEFINE_DEVICE_TYPE(NES_AX40G, nes_ax40g_device, "nes_ax40g", "NES Cart UNL-AX-40G PCB") DEFINE_DEVICE_TYPE(NES_AX5705, nes_ax5705_device, "nes_ax5705", "NES Cart AX5705 PCB") DEFINE_DEVICE_TYPE(NES_BMC_830506C, nes_bmc_830506c_device, "nes_bmc_830506c", "NES Cart BMC 830506C PCB") +DEFINE_DEVICE_TYPE(NES_BMC_831128C, nes_bmc_831128c_device, "nes_bmc_831128c", "NES Cart BMC 831128C PCB") +DEFINE_DEVICE_TYPE(NES_BMC_KL06, nes_bmc_kl06_device, "nes_bmc_kl06", "NES Cart BMC KL-06 PCB") DEFINE_DEVICE_TYPE(NES_CITYFIGHT, nes_cityfight_device, "nes_cityfight", "NES Cart City Fighter PCB") DEFINE_DEVICE_TYPE(NES_SHUIGUAN, nes_shuiguan_device, "nes_shuiguan", "NES Cart Shui Guan Pipe Pirate PCB") DEFINE_DEVICE_TYPE(NES_T230, nes_t230_device, "nes_t230", "NES Cart T-230 PCB") @@ -67,6 +69,16 @@ { } +nes_bmc_831128c_device::nes_bmc_831128c_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : nes_konami_vrc4_device(mconfig, NES_BMC_831128C, tag, owner, clock), m_reg(0) +{ +} + +nes_bmc_kl06_device::nes_bmc_kl06_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : nes_konami_vrc4_device(mconfig, NES_BMC_KL06, tag, owner, clock), m_reg(0) +{ +} + nes_cityfight_device::nes_cityfight_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_konami_vrc4_device(mconfig, NES_CITYFIGHT, tag, owner, clock) { @@ -180,6 +192,36 @@ nes_konami_vrc4_device::pcb_reset(); } +void nes_bmc_831128c_device::device_start() +{ + nes_konami_vrc4_device::device_start(); + save_item(NAME(m_reg)); +} + +void nes_bmc_831128c_device::pcb_reset() +{ + nes_konami_vrc4_device::pcb_reset(); + + m_reg = 0; + prg32((m_prg_chunks >> 1) - 1); +} + +void nes_bmc_kl06_device::device_start() +{ + nes_konami_vrc4_device::device_start(); + save_item(NAME(m_reg)); + + // VRC4 pins 3 and 4 + m_vrc_ls_prg_a = 3; // A1 + m_vrc_ls_prg_b = 2; // A0 +} + +void nes_bmc_kl06_device::pcb_reset() +{ + m_reg = 0; + nes_konami_vrc4_device::pcb_reset(); +} + void nes_cityfight_device::device_start() { nes_konami_vrc4_device::device_start(); @@ -697,3 +739,128 @@ set_prg(); } } + +/*------------------------------------------------- + + Board BMC-831128C + + Games: 1995 New Series Super 2 in 1 + + Weird clone that seems to be part Konami VRC4 (IRQ), + and part Sunsoft FME-7 (banking/mirroring). + + NES 2.0: mapper 528 + + In MAME: Supported. + + -------------------------------------------------*/ + + +u8 nes_bmc_831128c_device::read_m(offs_t offset) +{ +// LOG_MMC(("bmc_831128c read_m, offset: %04x, data: %02x\n", offset, data)); + + if (m_reg == 1) + return device_nes_cart_interface::read_m(offset); + else + return m_prg[(m_reg * 0x2000 + offset) & (m_prg_size - 1)]; +} + +void nes_bmc_831128c_device::write_m(offs_t offset, u8 data) +{ +// LOG_MMC(("bmc_831128c write_m, offset: %04x, data: %02x\n", offset, data)); + + if (m_reg == 1) + device_nes_cart_interface::write_m(offset, data); +} + +void nes_bmc_831128c_device::write_h(offs_t offset, u8 data) +{ + LOG_MMC(("bmc_831128c write_h, offset: %04x, data: %02x\n", offset, data)); + + u8 page = offset >> 12; + if (page != 2 && page != 4) // ignore writes except $Axxx and $Cxxx + return; + + int outer = BIT(offset, 14) << 4; + prg16_cdef(outer ? m_prg_chunks - 1 : 7); + + u8 reg = offset & 0x0f; + switch (reg) + { + case 0x0: case 0x1: case 0x2: case 0x3: + case 0x4: case 0x5: case 0x6: case 0x7: + chr1_x(reg, (outer << 4) | data, m_chr_source); + break; + case 0x8: + m_reg = data; + break; + case 0x9: + case 0xa: + prg8_x(reg - 9, outer + (data & (outer | 0x0f))); + break; + // case 0xb: do nothing + case 0xc: + set_mirror(data); + break; + case 0xd: + irq_ctrl_w(data); + break; + case 0xe: + irq_ack_w(); + break; + case 0xf: + m_irq_count_latch = data; + break; + } +} + +/*------------------------------------------------- + + Board BMC-KL-06 + + Games: 1993 New 860 in 1 Over-Valued Golden Version Games + + VRC4 clone with banking for multicart menu. + + NES 2.0: mapper 447 + + In MAME: Supported. + + TODO: There must be jumper settings since this is + showing up as a 1650 in 1. + + -------------------------------------------------*/ + +void nes_bmc_kl06_device::set_prg() +{ + u8 outer = (m_reg & 0x03) << 4; + + if (BIT(m_reg, 2)) + { + u8 bank_lo = outer | m_mmc_prg_bank[0]; + u8 bank_hi = outer | m_mmc_prg_bank[1]; + u8 mode = ~m_reg & 0x02; + prg8_89(bank_lo & ~mode); + prg8_ab(bank_hi & ~mode); + prg8_cd(bank_lo | mode); + prg8_ef(bank_hi | mode); + } + else + nes_konami_vrc4_device::set_prg(outer, 0x0f); +} + +void nes_bmc_kl06_device::write_m(offs_t offset, u8 data) +{ + LOG_MMC(("bmc_kl06 write_m, offset: %04x, data: %02x\n", offset, data)); + + // 2K RAM for Crisis Force overlays control register + nes_konami_vrc4_device::write_m(offset, data); + + if (!(m_reg & 1)) // lock bit + { + m_reg = offset; + set_prg(); + set_chr(); + } +} diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/vrc_clones.h mame-0.243+dfsg.1/src/devices/bus/nes/vrc_clones.h --- mame-0.242+dfsg.1/src/devices/bus/nes/vrc_clones.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/vrc_clones.h 2022-04-29 05:37:26.000000000 +0000 @@ -113,6 +113,53 @@ }; +// ======================> nes_bmc_831128c_device + +class nes_bmc_831128c_device : public nes_konami_vrc4_device +{ +public: + // construction/destruction + nes_bmc_831128c_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + + virtual u8 read_m(offs_t offset) override; + virtual void write_m(offs_t offset, u8 data) override; + virtual void write_h(offs_t offset, u8 data) override; + + virtual void pcb_reset() override; + +protected: + // device-level overrides + virtual void device_start() override; + +private: + u8 m_reg; +}; + + +// ======================> nes_bmc_kl06_device + +class nes_bmc_kl06_device : public nes_konami_vrc4_device +{ +public: + // construction/destruction + nes_bmc_kl06_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + + virtual void write_m(offs_t offset, u8 data) override; + + virtual void pcb_reset() override; + +protected: + // device-level overrides + virtual void device_start() override; + + virtual void set_prg() override; + virtual void set_chr() override { nes_konami_vrc4_device::set_chr((m_reg & 0x03) << 7, 0x7f); } + +private: + u8 m_reg; +}; + + // ======================> nes_cityfight_device class nes_cityfight_device : public nes_konami_vrc4_device @@ -121,7 +168,7 @@ // construction/destruction nes_cityfight_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - virtual void write_h(offs_t offset, uint8_t data) override; + virtual void write_h(offs_t offset, u8 data) override; protected: // device-level overrides @@ -249,6 +296,8 @@ DECLARE_DEVICE_TYPE(NES_AX40G, nes_ax40g_device) DECLARE_DEVICE_TYPE(NES_AX5705, nes_ax5705_device) DECLARE_DEVICE_TYPE(NES_BMC_830506C, nes_bmc_830506c_device) +DECLARE_DEVICE_TYPE(NES_BMC_831128C, nes_bmc_831128c_device) +DECLARE_DEVICE_TYPE(NES_BMC_KL06, nes_bmc_kl06_device) DECLARE_DEVICE_TYPE(NES_CITYFIGHT, nes_cityfight_device) DECLARE_DEVICE_TYPE(NES_HENGG_SHJY3, nes_hengg_shjy3_device) DECLARE_DEVICE_TYPE(NES_SHUIGUAN, nes_shuiguan_device) diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/waixing.cpp mame-0.243+dfsg.1/src/devices/bus/nes/waixing.cpp --- mame-0.242+dfsg.1/src/devices/bus/nes/waixing.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/waixing.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -38,6 +38,7 @@ DEFINE_DEVICE_TYPE(NES_WAIXING_D, nes_waixing_d_device, "nes_waixing_d", "NES Cart Waixing Type D PCB") DEFINE_DEVICE_TYPE(NES_WAIXING_E, nes_waixing_e_device, "nes_waixing_e", "NES Cart Waixing Type E PCB") DEFINE_DEVICE_TYPE(NES_WAIXING_F, nes_waixing_f_device, "nes_waixing_f", "NES Cart Waixing Type F PCB") +DEFINE_DEVICE_TYPE(NES_WAIXING_F1, nes_waixing_f1_device, "nes_waixing_f1", "NES Cart Waixing Type F1 PCB") DEFINE_DEVICE_TYPE(NES_WAIXING_G, nes_waixing_g_device, "nes_waixing_g", "NES Cart Waixing Type G PCB") DEFINE_DEVICE_TYPE(NES_WAIXING_H, nes_waixing_h_device, "nes_waixing_h", "NES Cart Waixing Type H PCB") DEFINE_DEVICE_TYPE(NES_WAIXING_H1, nes_waixing_h1_device, "nes_waixing_h1", "NES Cart Waixing Type H (Alt) PCB") @@ -88,8 +89,18 @@ { } -nes_waixing_f_device::nes_waixing_f_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : nes_waixing_a_device(mconfig, NES_WAIXING_F, tag, owner, clock) +nes_waixing_f_device::nes_waixing_f_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) + : nes_txrom_device(mconfig, type, tag, owner, clock) +{ +} + +nes_waixing_f_device::nes_waixing_f_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : nes_waixing_f_device(mconfig, NES_WAIXING_F, tag, owner, clock) +{ +} + +nes_waixing_f1_device::nes_waixing_f1_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : nes_waixing_f_device(mconfig, NES_WAIXING_F1, tag, owner, clock) { } @@ -123,7 +134,7 @@ { } -nes_waixing_sh2_device::nes_waixing_sh2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +nes_waixing_sh2_device::nes_waixing_sh2_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_txrom_device(mconfig, NES_WAIXING_SH2, tag, owner, clock) { } @@ -178,19 +189,6 @@ std::fill(std::begin(mapper_ram), std::end(mapper_ram), 0x00); } -void nes_waixing_f_device::pcb_reset() -{ - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - mmc3_common_initialize(0xff, 0xff, 0); - - std::fill(std::begin(mapper_ram), std::end(mapper_ram), 0x00); - m_mmc_prg_bank[0] = 0x00; - m_mmc_prg_bank[1] = 0x01; - m_mmc_prg_bank[2] = 0x4e; - m_mmc_prg_bank[3] = 0x4f; - set_prg(m_prg_base, m_prg_mask); -} - void nes_waixing_g_device::pcb_reset() { m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; @@ -239,10 +237,9 @@ void nes_waixing_sh2_device::pcb_reset() { - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - m_reg[0] = m_reg[1] = 0; mmc3_common_initialize(0xff, 0xff, 0); + set_nt_mirroring(PPU_MIRROR_VERT); // first Fire Emblem doesn't properly set mirroring like the other games do } void nes_waixing_sec_device::device_start() @@ -290,35 +287,6 @@ m_reg[0] = m_reg[1] = 0; } -void nes_waixing_wxzs_device::device_start() -{ - common_start(); -} - -void nes_waixing_wxzs_device::pcb_reset() -{ - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - prg32(0); - chr8(0, m_chr_source); -} - -void nes_waixing_dq8_device::device_start() -{ - common_start(); -} - -void nes_waixing_dq8_device::pcb_reset() -{ - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - prg32(0); - chr8(0, m_chr_source); -} - -void nes_waixing_wxzs2_device::device_start() -{ - common_start(); -} - void nes_waixing_wxzs2_device::pcb_reset() { m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; @@ -529,77 +497,49 @@ chr1_x(start, bank, chr_src); } - /*------------------------------------------------- - Waixing Board Type F + Waixing Board Type F, F1 - Games: Tenchi wo Kurau II (C) + Games: Tenchi wo Kurau II translations (mapper 198), + and (mapper 199) Chengjisihan, Tangmu Lixian Ji, + Fengse Huanxiang, Datang Fengyun VI Dai - MMC3 clone. + MMC3 clone with an extra 4K WRAM at 0x5000-0x5fff. + Mapper 198 banks its 8K CHR RAM and 199 does not. - iNES: mapper 198 + iNES: mappers 198, 199 - In MESS: Preliminary support. + In MAME: Supported. + + TODO: Sort out G board games which were assigned + to mapper 199 previously. -------------------------------------------------*/ -void nes_waixing_f_device::chr_cb(int start, int bank, int source) +u8 nes_waixing_f_device::read_l(offs_t offset) { - chr1_x(start, bank, CHRRAM); -} +// LOG_MMC(("waixing_f read_l, offset: %04x\n", offset)); -void nes_waixing_f_device::prg_cb(int start, int bank) -{ -// if (bank > 0x3f) -// bank = 0x40 | (bank & 0xf); - prg8_x(start, bank); + offset += 0x100; + if (!m_prgram.empty() && offset >= 0x1000) + return m_prgram[offset & 0x0fff & (m_prgram.size() - 1)]; + + return get_open_bus(); } -void nes_waixing_f_device::set_prg( int prg_base, int prg_mask ) +void nes_waixing_f_device::write_l(offs_t offset, u8 data) { - uint8_t prg_flip = (m_latch & 0x40) ? 2 : 0; +// LOG_MMC(("waixing_f write_l, offset: %04x, data: %02x\n", offset, data)); - prg_cb(0, m_mmc_prg_bank[0 ^ prg_flip]); - prg_cb(1, m_mmc_prg_bank[1]); - prg_cb(2, m_mmc_prg_bank[2 ^ prg_flip]); - prg_cb(3, m_mmc_prg_bank[3]); + offset += 0x100; + if (!m_prgram.empty() && offset >= 0x1000) + m_prgram[offset & 0x0fff & (m_prgram.size() - 1)] = data; } -void nes_waixing_f_device::write_h(offs_t offset, uint8_t data) +void nes_waixing_f1_device::set_chr(u8 chr, int chr_base, int chr_mask) { - uint8_t cmd; - LOG_MMC(("waixing_f write_h, offset: %04x, data: %02x\n", offset, data)); - - switch (offset & 0x6001) - { - case 0x0001: - cmd = m_latch & 0x07; - switch (cmd) - { - case 0: case 1: // these do not need to be separated: we take care of them in set_chr! - case 2: case 3: case 4: case 5: - m_mmc_vrom_bank[cmd] = data; - set_chr(m_chr_source, m_chr_base, m_chr_mask); - break; - case 6: - case 7: - case 8: - case 9: - m_mmc_prg_bank[cmd - 6] = data; - //printf("prg bank %d value %x\n", cmd - 6, data); - set_prg(m_prg_base, m_prg_mask); - break; - } - break; - - case 0x2001: - break; - - default: - waixing_write(offset, data); - break; - } +// ignore CHR banking as all F1 games use 8K unbanked CHR RAM } /*------------------------------------------------- @@ -842,41 +782,39 @@ Waixing SH2 Board - Games: Fire Emblem (C) and Fire Emblem Gaiden (C) + Games: Fire Emblem (C), Fire Emblem Gaiden (C), + Zhentian Shi Yongshi - MMC3 clone with different access to CHR + MMC3 clone with MMC2-like CHR banking. iNES: mapper 165 - In MESS: Partially Supported. + In MAME: Supported. -------------------------------------------------*/ -void nes_waixing_sh2_device::chr_cb(int start, int bank, int source) +void nes_waixing_sh2_device::set_chr(u8 chr, int chr_base, int chr_mask) { - chr4_0(m_reg[0], m_reg[0] ? CHRRAM : CHRROM); - chr4_4(m_reg[1], m_reg[1] ? CHRRAM : CHRROM); + int bank1 = m_mmc_vrom_bank[m_reg[0] ? 1 : 0] >> 2; + int bank2 = m_mmc_vrom_bank[m_reg[1] ? 4 : 2] >> 2; + + chr4_0(bank1, bank1 ? CHRROM : CHRRAM); + chr4_4(bank2, bank2 ? CHRROM : CHRRAM); } -uint8_t nes_waixing_sh2_device::chr_r(offs_t offset) +u8 nes_waixing_sh2_device::chr_r(offs_t offset) { - int bank = offset >> 10; - uint8_t val = m_chr_access[bank][offset & 0x3ff]; // this would be usual return value - int chr_helper; + int val = device_nes_cart_interface::chr_r(offset); switch (offset & 0xff8) { - case 0xfd0: chr_helper = (bank & 0x4) | 0x0; break; - case 0xfe8: chr_helper = (bank & 0x4) | 0x2; break; - default: return val; + case 0xfd0: + case 0xfe8: + m_reg[BIT(offset, 12)] = BIT(offset, 3); + set_chr(m_chr_source, m_chr_base, m_chr_mask); + break; } - m_reg[offset >> 12] = chr_helper; - if (offset & 0x1000) - chr4_4(m_reg[1], m_reg[1] ? CHRRAM : CHRROM); - else - chr4_0(m_reg[0], m_reg[0] ? CHRRAM : CHRROM); - return val; } @@ -1113,8 +1051,8 @@ void nes_waixing_wxzs2_device::write_h(offs_t offset, uint8_t data) { - uint8_t flip = (data & 0x80) >> 7; - uint8_t helper = (data & 0x7f) << 1; + uint8_t flip = BIT(data, 7); + uint8_t helper = data << 1; LOG_MMC(("waixing_wxzs2 write_h, offset: %04x, data: %02x\n", offset, data)); @@ -1167,13 +1105,12 @@ void nes_waixing_fs304_device::write_l(offs_t offset, uint8_t data) { LOG_MMC(("fs304 write_l, offset: %04x, data: %02x\n", offset, data)); - int bank; - offset += 0x100; + offset += 0x100; if (offset >= 0x1000) { - m_reg[(offset >> 8) & 3] = data; - bank = ((m_reg[2] & 0x0f) << 4) | BIT(m_reg[1], 1) | (m_reg[0] & 0x0e); + m_reg[BIT(offset, 8, 2)] = data; + int bank = ((m_reg[2] & 0x0f) << 4) | BIT(m_reg[1], 1) | (m_reg[0] & 0x0e); prg32(bank); chr8(0, CHRRAM); } diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes/waixing.h mame-0.243+dfsg.1/src/devices/bus/nes/waixing.h --- mame-0.242+dfsg.1/src/devices/bus/nes/waixing.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes/waixing.h 2022-04-29 05:37:26.000000000 +0000 @@ -56,7 +56,6 @@ // construction/destruction nes_waixing_b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // device-level overrides virtual void chr_cb(int start, int bank, int source) override; }; @@ -69,7 +68,6 @@ // construction/destruction nes_waixing_c_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // device-level overrides virtual void chr_cb(int start, int bank, int source) override; }; @@ -82,7 +80,6 @@ // construction/destruction nes_waixing_d_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // device-level overrides virtual void chr_cb(int start, int bank, int source) override; }; @@ -95,28 +92,37 @@ // construction/destruction nes_waixing_e_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // device-level overrides virtual void chr_cb(int start, int bank, int source) override; }; // ======================> nes_waixing_f_device -class nes_waixing_f_device : public nes_waixing_a_device +class nes_waixing_f_device : public nes_txrom_device { public: // construction/destruction - nes_waixing_f_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_waixing_f_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - // device-level overrides - virtual void write_h(offs_t offset, uint8_t data) override; - virtual void prg_cb(int start, int bank) override; - virtual void chr_cb(int start, int bank, int source) override; + virtual u8 read_l(offs_t offset) override; + virtual void write_l(offs_t offset, u8 data) override; - virtual void pcb_reset() override; +protected: + // construction/destruction + nes_waixing_f_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); +}; -private: - virtual void set_prg(int prg_base, int prg_mask) override; + +// ======================> nes_waixing_f1_device + +class nes_waixing_f1_device : public nes_waixing_f_device +{ +public: + // construction/destruction + nes_waixing_f1_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + +protected: + virtual void set_chr(uint8_t chr, int chr_base, int chr_mask) override; }; @@ -128,7 +134,6 @@ // construction/destruction nes_waixing_g_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // device-level overrides virtual void write_h(offs_t offset, uint8_t data) override; virtual void chr_cb(int start, int bank, int source) override; @@ -147,15 +152,13 @@ // construction/destruction nes_waixing_h_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + virtual void write_h(offs_t offset, uint8_t data) override; virtual void chr_cb(int start, int bank, int source) override; // This PCB does not have 1K of internal RAM, so it's not derived from nes_waixing_a_device!! protected: nes_waixing_h_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); - - // device-level overrides - virtual void write_h(offs_t offset, uint8_t data) override; }; @@ -167,7 +170,6 @@ // construction/destruction nes_waixing_h1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // device-level overrides virtual void write_h(offs_t offset, uint8_t data) override; // This variant does not ignore the wram protect! @@ -213,17 +215,20 @@ { public: // construction/destruction - nes_waixing_sh2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_waixing_sh2_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - // device-level overrides - virtual void device_start() override; - virtual uint8_t chr_r(offs_t offset) override; - virtual void chr_cb(int start, int bank, int source) override; + virtual u8 chr_r(offs_t offset) override; virtual void pcb_reset() override; protected: - uint8_t m_reg[2]; + // device-level overrides + virtual void device_start() override; + + virtual void set_chr(u8 chr, int chr_base, int chr_mask) override; + +private: + u8 m_reg[2]; }; @@ -298,12 +303,6 @@ nes_waixing_wxzs_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void write_h(offs_t offset, uint8_t data) override; - - virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; @@ -316,12 +315,6 @@ nes_waixing_dq8_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void write_h(offs_t offset, uint8_t data) override; - - virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; @@ -336,10 +329,6 @@ virtual void write_h(offs_t offset, uint8_t data) override; virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; }; @@ -371,6 +360,7 @@ DECLARE_DEVICE_TYPE(NES_WAIXING_D, nes_waixing_d_device) DECLARE_DEVICE_TYPE(NES_WAIXING_E, nes_waixing_e_device) DECLARE_DEVICE_TYPE(NES_WAIXING_F, nes_waixing_f_device) +DECLARE_DEVICE_TYPE(NES_WAIXING_F1, nes_waixing_f1_device) DECLARE_DEVICE_TYPE(NES_WAIXING_G, nes_waixing_g_device) DECLARE_DEVICE_TYPE(NES_WAIXING_H, nes_waixing_h_device) DECLARE_DEVICE_TYPE(NES_WAIXING_H1, nes_waixing_h1_device) diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes_ctrl/4score.h mame-0.243+dfsg.1/src/devices/bus/nes_ctrl/4score.h --- mame-0.242+dfsg.1/src/devices/bus/nes_ctrl/4score.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes_ctrl/4score.h 2022-04-29 05:37:26.000000000 +0000 @@ -23,6 +23,9 @@ class nes_4score_device : public device_t, public device_nes_control_port_interface { +public: + virtual uint8_t read_bit0() override; + protected: // construction/destruction nes_4score_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); @@ -31,8 +34,6 @@ virtual void device_start() override; virtual void device_reset() override; - virtual uint8_t read_bit0() override; - uint32_t m_latch; }; @@ -44,10 +45,11 @@ // construction/destruction nes_4score_p1p3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual ioport_constructor device_input_ports() const override; + virtual void write(uint8_t data) override; protected: - virtual void write(uint8_t data) override; + // device-level overrides + virtual ioport_constructor device_input_ports() const override; private: required_ioport m_joypad1; @@ -62,10 +64,11 @@ // construction/destruction nes_4score_p2p4_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual ioport_constructor device_input_ports() const override; + virtual void write(uint8_t data) override; protected: - virtual void write(uint8_t data) override; + // device-level overrides + virtual ioport_constructor device_input_ports() const override; private: required_ioport m_joypad2; @@ -77,5 +80,4 @@ DECLARE_DEVICE_TYPE(NES_4SCORE_P1P3, nes_4score_p1p3_device) DECLARE_DEVICE_TYPE(NES_4SCORE_P2P4, nes_4score_p2p4_device) - #endif // MAME_BUS_NES_CTRL_4SCORE_H diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes_ctrl/arkpaddle.cpp mame-0.243+dfsg.1/src/devices/bus/nes_ctrl/arkpaddle.cpp --- mame-0.242+dfsg.1/src/devices/bus/nes_ctrl/arkpaddle.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes_ctrl/arkpaddle.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -6,17 +6,15 @@ Arkanoid Paddle input device TODO: Investigate the differences between the 3 paddles released with - Arkanoid (US), Arkanoid (JP), Arkanoid II (JP). It's not clear if and - how they differ and so for the moment we only emulate the NES and - daisy-chainable Famicom paddles. + Arkanoid (US), Arkanoid (JP), Arkanoid II (JP). At the moment we only + emulate the US and daisy-chainable Famicom (Ark2) paddles. Known differences: NES and Ark2 paddles have screws to adjust range of returned values, Ark2 paddle has an extra expansion port. - Claimed differences: NES and Ark1 paddles have 9-bit latch (and don't - return the MSB) while Ark2 has an 8-bit latch, Ark2 paddle ADC responds - to writes to $4016.b1 not b0 (the post-Ark2 paddle games, Arkanoid 2 - and Chase HQ, both dutifully strobe both bits one at a time). + All paddles return the ones' complement of a 9-bit value from their + potentiometers, MSB first. The three commercial releases, Arkanoids + and Chase HQ, only read 8-bits, ignoring the LSB. **********************************************************************/ @@ -33,7 +31,10 @@ static INPUT_PORTS_START( arkanoid_paddle ) PORT_START("PADDLE") - PORT_BIT( 0xff, 0x7f, IPT_PADDLE ) PORT_SENSITIVITY(25) PORT_KEYDELTA(25) PORT_CENTERDELTA(0) PORT_MINMAX(0x4e, 0xf2) // this minmax is from what Arkanoid 2 clamps values to, so an actual paddle's range may be greater + // MINMAX range large enough to encompass what Taito games expect, Ark1 will glitch if MIN is too low + // This may be too wide compared with real paddles, even accounting for those with adjustment screws + PORT_BIT( 0x1ff, 0x130, IPT_PADDLE ) PORT_SENSITIVITY(50) PORT_KEYDELTA(35) PORT_CENTERDELTA(0) PORT_MINMAX(0x78, 0x1f8) + PORT_START("BUTTON") PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Paddle button") INPUT_PORTS_END @@ -80,7 +81,6 @@ , device_nes_control_port_interface(mconfig, *this) , m_paddle(*this, "PADDLE") , m_button(*this, "BUTTON") - , m_start_conv(0) , m_latch(0) { } @@ -104,7 +104,7 @@ void nes_vaus_device::device_start() { save_item(NAME(m_latch)); - save_item(NAME(m_start_conv)); + save_item(NAME(m_strobe)); } @@ -115,7 +115,7 @@ u8 nes_vaus_device::read_bit34() { u8 ret = m_button->read() << 3; - ret |= (m_latch & 0x80) >> 3; + ret |= (m_latch & 0x100) >> 4; m_latch <<= 1; return ret; } @@ -127,7 +127,7 @@ ret = m_button->read() << 1; else //$4017 { - ret = (m_latch & 0x80) >> 6; + ret = (m_latch & 0x100) >> 7; m_latch <<= 1; ret |= m_daisychain->read_exp(0) << 2; ret |= m_daisychain->read_exp(1) << 3; @@ -141,10 +141,8 @@ void nes_vaus_device::write(u8 data) { - if (data == 0 && m_start_conv == 1) + if (write_strobe(data)) m_latch = ~m_paddle->read(); - - m_start_conv = data; } void nes_vausfc_device::write(u8 data) diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes_ctrl/arkpaddle.h mame-0.243+dfsg.1/src/devices/bus/nes_ctrl/arkpaddle.h --- mame-0.242+dfsg.1/src/devices/bus/nes_ctrl/arkpaddle.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes_ctrl/arkpaddle.h 2022-04-29 05:37:26.000000000 +0000 @@ -27,22 +27,19 @@ // construction/destruction nes_vaus_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - // optional information overrides - virtual ioport_constructor device_input_ports() const override; + virtual u8 read_bit34() override; + virtual void write(u8 data) override; protected: nes_vaus_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); // device-level overrides virtual void device_start() override; - - virtual u8 read_bit34() override; - virtual void write(u8 data) override; + virtual ioport_constructor device_input_ports() const override; required_ioport m_paddle; required_ioport m_button; - u8 m_start_conv; - u8 m_latch; + u16 m_latch; }; @@ -54,14 +51,14 @@ // construction/destruction nes_vausfc_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); -protected: - // device-level overrides - virtual void device_add_mconfig(machine_config &config) override; - virtual u8 read_bit34() override { return 0; } virtual u8 read_exp(offs_t offset) override; virtual void write(u8 data) override; +protected: + // device-level overrides + virtual void device_add_mconfig(machine_config &config) override; + private: required_device m_daisychain; }; diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes_ctrl/bcbattle.h mame-0.243+dfsg.1/src/devices/bus/nes_ctrl/bcbattle.h --- mame-0.242+dfsg.1/src/devices/bus/nes_ctrl/bcbattle.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes_ctrl/bcbattle.h 2022-04-29 05:37:26.000000000 +0000 @@ -28,6 +28,8 @@ // construction/destruction nes_bcbattle_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + virtual uint8_t read_exp(offs_t offset) override; + protected: static constexpr device_timer_id TIMER_BATTLER = 1; @@ -38,7 +40,6 @@ virtual void device_add_mconfig(machine_config &config) override; - virtual uint8_t read_exp(offs_t offset) override; int read_current_bit(); required_device m_reader; diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes_ctrl/ctrl.h mame-0.243+dfsg.1/src/devices/bus/nes_ctrl/ctrl.h --- mame-0.242+dfsg.1/src/devices/bus/nes_ctrl/ctrl.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes_ctrl/ctrl.h 2022-04-29 05:37:26.000000000 +0000 @@ -101,5 +101,4 @@ void famibox_control_port12_devices(device_slot_interface &device); void famibox_control_port3_devices(device_slot_interface &device); - #endif // MAME_BUS_NES_CTRL_CTRL_H diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes_ctrl/dorepiano.h mame-0.243+dfsg.1/src/devices/bus/nes_ctrl/dorepiano.h --- mame-0.242+dfsg.1/src/devices/bus/nes_ctrl/dorepiano.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes_ctrl/dorepiano.h 2022-04-29 05:37:26.000000000 +0000 @@ -28,14 +28,13 @@ // construction/destruction nes_dorepiano_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - virtual ioport_constructor device_input_ports() const override; + virtual u8 read_exp(offs_t offset) override; + virtual void write(u8 data) override; protected: // device-level overrides virtual void device_start() override; - - virtual u8 read_exp(offs_t offset) override; - virtual void write(u8 data) override; + virtual ioport_constructor device_input_ports() const override; private: required_ioport_array<8> m_port; @@ -48,5 +47,4 @@ // device type definition DECLARE_DEVICE_TYPE(NES_DOREPIANO, nes_dorepiano_device) - #endif // MAME_BUS_NES_CTRL_DOREPIANO_H diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes_ctrl/fckeybrd.h mame-0.243+dfsg.1/src/devices/bus/nes_ctrl/fckeybrd.h --- mame-0.242+dfsg.1/src/devices/bus/nes_ctrl/fckeybrd.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes_ctrl/fckeybrd.h 2022-04-29 05:37:26.000000000 +0000 @@ -28,6 +28,9 @@ // construction/destruction nes_fckeybrd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + virtual uint8_t read_exp(offs_t offset) override; + virtual void write(uint8_t data) override; + protected: // device-level overrides virtual void device_start() override; @@ -36,9 +39,6 @@ virtual ioport_constructor device_input_ports() const override; virtual void device_add_mconfig(machine_config &config) override; - virtual uint8_t read_exp(offs_t offset) override; - virtual void write(uint8_t data) override; - private: required_device m_cassette; required_ioport_array<9> m_kbd; @@ -49,5 +49,4 @@ // device type definition DECLARE_DEVICE_TYPE(NES_FCKEYBOARD, nes_fckeybrd_device) - #endif // MAME_BUS_NES_CTRL_FCKEYBOARD_H diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes_ctrl/fcmat.h mame-0.243+dfsg.1/src/devices/bus/nes_ctrl/fcmat.h --- mame-0.242+dfsg.1/src/devices/bus/nes_ctrl/fcmat.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes_ctrl/fcmat.h 2022-04-29 05:37:26.000000000 +0000 @@ -25,6 +25,10 @@ public device_t, public device_nes_control_port_interface { +public: + virtual u8 read_exp(offs_t offset) override; + virtual void write(u8 data) override; + protected: // construction/destruction nes_fcmat_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); @@ -32,9 +36,6 @@ // device-level overrides virtual void device_start() override; - virtual u8 read_exp(offs_t offset) override; - virtual void write(u8 data) override; - private: required_ioport_array<4> m_mat; u8 m_row_scan; @@ -50,6 +51,7 @@ nes_ftrainer_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); protected: + // device-level overrides virtual ioport_constructor device_input_ports() const override; }; @@ -63,6 +65,7 @@ nes_taptapmat_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); protected: + // device-level overrides virtual ioport_constructor device_input_ports() const override; }; @@ -71,5 +74,4 @@ DECLARE_DEVICE_TYPE(NES_FTRAINER, nes_ftrainer_device) DECLARE_DEVICE_TYPE(NES_TAPTAPMAT, nes_taptapmat_device) - #endif // MAME_BUS_NES_CTRL_FCMAT_H diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes_ctrl/hori.cpp mame-0.243+dfsg.1/src/devices/bus/nes_ctrl/hori.cpp --- mame-0.242+dfsg.1/src/devices/bus/nes_ctrl/hori.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes_ctrl/hori.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -5,9 +5,9 @@ Nintendo Family Computer Hori Twin and 4 Players adapters In general these adapters work by reading pin 13 (the Famicom sees - this in memory location $4016, bit 1) of their subports. It is not - clear if other lines are pass-thru. For the moment we only emulate - joypads connected to these ports, which only use pin 13 when read. + this in memory location $4016, bit 1) of their subports. Other + input pins are not connected so various specialty controllers are + incompatible with these adapters. The Hori Twin passes subport 1's input directly through to $4016 bit 1. It reroutes subport 2's to $4017 bit 1. Incidentally, HAL @@ -137,6 +137,9 @@ u8 ret = 0; int mode4p = m_cfg->read(); + if (m_strobe) + reset_regs(); + if (m_count[offset] < 16 || !mode4p) // read from P1/P2 for first byte, P3/P4 for second byte if in 4P mode { int port = 2 * (BIT(m_count[offset], 3) & mode4p) + offset; @@ -146,6 +149,7 @@ { ret = (m_sig[offset] & 1) << 1; m_sig[offset] >>= 1; + m_sig[offset] |= 0x80; // reads beyond signature are always 1 } m_count[offset]++; diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes_ctrl/hori.h mame-0.243+dfsg.1/src/devices/bus/nes_ctrl/hori.h --- mame-0.242+dfsg.1/src/devices/bus/nes_ctrl/hori.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes_ctrl/hori.h 2022-04-29 05:37:26.000000000 +0000 @@ -27,14 +27,14 @@ // construction/destruction nes_horitwin_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + virtual u8 read_exp(offs_t offset) override; + virtual void write(u8 data) override; + protected: // device-level overrides virtual void device_start() override { } virtual void device_add_mconfig(machine_config &config) override; - virtual u8 read_exp(offs_t offset) override; - virtual void write(u8 data) override; - private: required_device_array m_subexp; }; @@ -49,15 +49,15 @@ // construction/destruction nes_hori4p_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + virtual u8 read_exp(offs_t offset) override; + virtual void write(u8 data) override; + protected: // device-level overrides virtual void device_start() override; virtual void device_add_mconfig(machine_config &config) override; virtual ioport_constructor device_input_ports() const override; - virtual u8 read_exp(offs_t offset) override; - virtual void write(u8 data) override; - private: void reset_regs(); diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes_ctrl/joypad.h mame-0.243+dfsg.1/src/devices/bus/nes_ctrl/joypad.h --- mame-0.242+dfsg.1/src/devices/bus/nes_ctrl/joypad.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes_ctrl/joypad.h 2022-04-29 05:37:26.000000000 +0000 @@ -28,16 +28,16 @@ // construction/destruction nes_joypad_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - virtual ioport_constructor device_input_ports() const override; + virtual u8 read_bit0() override; + virtual void write(u8 data) override; protected: nes_joypad_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u32 latch_fill = 0x80); // device-level overrides virtual void device_start() override; + virtual ioport_constructor device_input_ports() const override; - virtual u8 read_bit0() override; - virtual void write(u8 data) override; virtual void set_latch() { m_latch = m_joypad->read(); } required_ioport m_joypad; @@ -54,11 +54,11 @@ // construction/destruction nes_fcpadexp_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); -protected: - nes_fcpadexp_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u32 latch_fill = 0x80); - virtual u8 read_bit0() override { return 0; } virtual u8 read_exp(offs_t offset) override; + +protected: + nes_fcpadexp_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u32 latch_fill = 0x80); }; @@ -70,10 +70,11 @@ // construction/destruction nes_fcpad2_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - virtual ioport_constructor device_input_ports() const override; + virtual u8 read_bit2() override; protected: - virtual u8 read_bit2() override; + // device-level overrides + virtual ioport_constructor device_input_ports() const override; private: required_ioport m_mic; @@ -88,6 +89,8 @@ // construction/destruction nes_ccpadl_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +protected: + // device-level overrides virtual ioport_constructor device_input_ports() const override; }; @@ -100,6 +103,8 @@ // construction/destruction nes_ccpadr_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +protected: + // device-level overrides virtual ioport_constructor device_input_ports() const override; }; @@ -112,13 +117,15 @@ // construction/destruction nes_arcstick_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + virtual u8 read_exp(offs_t offset) override; + virtual void write(u8 data) override; + protected: + // device-level overrides virtual ioport_constructor device_input_ports() const override; virtual void device_add_mconfig(machine_config &config) override; - virtual u8 read_exp(offs_t offset) override; - virtual void write(u8 data) override; - +private: required_device m_daisychain; required_ioport m_cfg; }; @@ -133,6 +140,7 @@ nes_vboyctrl_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); protected: + // device-level overrides virtual ioport_constructor device_input_ports() const override; }; diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes_ctrl/konamibag.h mame-0.243+dfsg.1/src/devices/bus/nes_ctrl/konamibag.h --- mame-0.242+dfsg.1/src/devices/bus/nes_ctrl/konamibag.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes_ctrl/konamibag.h 2022-04-29 05:37:26.000000000 +0000 @@ -30,14 +30,13 @@ // construction/destruction nes_konamibag_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - virtual ioport_constructor device_input_ports() const override; + virtual u8 read_exp(offs_t offset) override; + virtual void write(u8 data) override; protected: // device-level overrides virtual void device_start() override; - - virtual u8 read_exp(offs_t offset) override; - virtual void write(u8 data) override; + virtual ioport_constructor device_input_ports() const override; private: required_ioport_array<2> m_sensor; @@ -48,5 +47,4 @@ // device type definition DECLARE_DEVICE_TYPE(NES_KONAMIBAG, nes_konamibag_device) - #endif // MAME_BUS_NES_CTRL_KONAMIBAG_H diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes_ctrl/konamihs.h mame-0.243+dfsg.1/src/devices/bus/nes_ctrl/konamihs.h --- mame-0.242+dfsg.1/src/devices/bus/nes_ctrl/konamihs.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes_ctrl/konamihs.h 2022-04-29 05:37:26.000000000 +0000 @@ -27,15 +27,15 @@ // construction/destruction nes_konamihs_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - virtual ioport_constructor device_input_ports() const override; + virtual u8 read_exp(offs_t offset) override; + virtual void write(u8 data) override; protected: // device-level overrides virtual void device_start() override; + virtual ioport_constructor device_input_ports() const override; - virtual u8 read_exp(offs_t offset) override; - virtual void write(u8 data) override; - +private: required_ioport_array<2> m_ipt; u8 m_latch; }; diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes_ctrl/miracle.h mame-0.243+dfsg.1/src/devices/bus/nes_ctrl/miracle.h --- mame-0.242+dfsg.1/src/devices/bus/nes_ctrl/miracle.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes_ctrl/miracle.h 2022-04-29 05:37:26.000000000 +0000 @@ -30,6 +30,9 @@ // construction/destruction nes_miracle_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + virtual uint8_t read_bit0() override; + virtual void write(uint8_t data) override; + required_device m_midiin, m_midiout; protected: @@ -52,9 +55,6 @@ void xmit_char(uint8_t data); - virtual uint8_t read_bit0() override; - virtual void write(uint8_t data) override; - emu_timer *strobe_timer; int m_strobe_on, m_midi_mode, m_sent_bits; diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes_ctrl/mjpanel.h mame-0.243+dfsg.1/src/devices/bus/nes_ctrl/mjpanel.h --- mame-0.242+dfsg.1/src/devices/bus/nes_ctrl/mjpanel.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes_ctrl/mjpanel.h 2022-04-29 05:37:26.000000000 +0000 @@ -27,14 +27,13 @@ // construction/destruction nes_mjpanel_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - virtual ioport_constructor device_input_ports() const override; + virtual u8 read_exp(offs_t offset) override; + virtual void write(u8 data) override; protected: // device-level overrides virtual void device_start() override; - - virtual u8 read_exp(offs_t offset) override; - virtual void write(u8 data) override; + virtual ioport_constructor device_input_ports() const override; private: void set_latch(); diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes_ctrl/pachinko.h mame-0.243+dfsg.1/src/devices/bus/nes_ctrl/pachinko.h --- mame-0.242+dfsg.1/src/devices/bus/nes_ctrl/pachinko.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes_ctrl/pachinko.h 2022-04-29 05:37:26.000000000 +0000 @@ -26,9 +26,10 @@ // construction/destruction nes_pachinko_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +protected: + // device-level overrides virtual ioport_constructor device_input_ports() const override; -protected: virtual void set_latch() override; private: diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes_ctrl/partytap.h mame-0.243+dfsg.1/src/devices/bus/nes_ctrl/partytap.h --- mame-0.242+dfsg.1/src/devices/bus/nes_ctrl/partytap.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes_ctrl/partytap.h 2022-04-29 05:37:26.000000000 +0000 @@ -27,15 +27,15 @@ // construction/destruction nes_partytap_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - virtual ioport_constructor device_input_ports() const override; + virtual u8 read_exp(offs_t offset) override; + virtual void write(u8 data) override; protected: // device-level overrides virtual void device_start() override; + virtual ioport_constructor device_input_ports() const override; - virtual u8 read_exp(offs_t offset) override; - virtual void write(u8 data) override; - +private: required_ioport m_inputs; u8 m_latch; }; diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes_ctrl/powerpad.h mame-0.243+dfsg.1/src/devices/bus/nes_ctrl/powerpad.h --- mame-0.242+dfsg.1/src/devices/bus/nes_ctrl/powerpad.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes_ctrl/powerpad.h 2022-04-29 05:37:26.000000000 +0000 @@ -27,14 +27,13 @@ // construction/destruction nes_powerpad_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - virtual ioport_constructor device_input_ports() const override; + virtual u8 read_bit34() override; + virtual void write(u8 data) override; protected: // device-level overrides virtual void device_start() override; - - virtual u8 read_bit34() override; - virtual void write(u8 data) override; + virtual ioport_constructor device_input_ports() const override; private: required_ioport_array<2> m_ipt; diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes_ctrl/rob.h mame-0.243+dfsg.1/src/devices/bus/nes_ctrl/rob.h --- mame-0.242+dfsg.1/src/devices/bus/nes_ctrl/rob.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes_ctrl/rob.h 2022-04-29 05:37:26.000000000 +0000 @@ -29,13 +29,12 @@ // construction/destruction nes_rob_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - virtual ioport_constructor device_input_ports() const override; - protected: // device-level overrides virtual void device_start() override; virtual void device_add_mconfig(machine_config &config) override; virtual const tiny_rom_entry *device_rom_region() const override; + virtual ioport_constructor device_input_ports() const override; private: required_device m_maincpu; diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes_ctrl/snesadapter.h mame-0.243+dfsg.1/src/devices/bus/nes_ctrl/snesadapter.h --- mame-0.242+dfsg.1/src/devices/bus/nes_ctrl/snesadapter.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes_ctrl/snesadapter.h 2022-04-29 05:37:26.000000000 +0000 @@ -27,14 +27,14 @@ // construction/destruction nes_snesadapter_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + virtual u8 read_bit0() override; + virtual void write(u8 data) override; + protected: // device-level overrides virtual void device_start() override { } virtual void device_add_mconfig(machine_config &config) override; - virtual u8 read_bit0() override; - virtual void write(u8 data) override; - private: required_device m_snesctrl; }; diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes_ctrl/suborkey.h mame-0.243+dfsg.1/src/devices/bus/nes_ctrl/suborkey.h --- mame-0.242+dfsg.1/src/devices/bus/nes_ctrl/suborkey.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes_ctrl/suborkey.h 2022-04-29 05:37:26.000000000 +0000 @@ -27,15 +27,14 @@ // construction/destruction nes_suborkey_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual ioport_constructor device_input_ports() const override; + virtual uint8_t read_exp(offs_t offset) override; + virtual void write(uint8_t data) override; protected: // device-level overrides virtual void device_start() override; virtual void device_reset() override; - - virtual uint8_t read_exp(offs_t offset) override; - virtual void write(uint8_t data) override; + virtual ioport_constructor device_input_ports() const override; private: required_ioport_array<13> m_kbd; diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes_ctrl/turbofile.h mame-0.243+dfsg.1/src/devices/bus/nes_ctrl/turbofile.h --- mame-0.242+dfsg.1/src/devices/bus/nes_ctrl/turbofile.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes_ctrl/turbofile.h 2022-04-29 05:37:26.000000000 +0000 @@ -28,6 +28,9 @@ // construction/destruction nes_turbofile_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + virtual u8 read_exp(offs_t offset) override; + virtual void write(u8 data) override; + DECLARE_INPUT_CHANGED_MEMBER(lock_changed); protected: @@ -38,9 +41,6 @@ virtual ioport_constructor device_input_ports() const override; virtual void device_add_mconfig(machine_config &config) override; - virtual u8 read_exp(offs_t offset) override; - virtual void write(u8 data) override; - private: required_device m_nvram; required_ioport m_lock; diff -Nru mame-0.242+dfsg.1/src/devices/bus/nes_ctrl/zapper.h mame-0.243+dfsg.1/src/devices/bus/nes_ctrl/zapper.h --- mame-0.242+dfsg.1/src/devices/bus/nes_ctrl/zapper.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nes_ctrl/zapper.h 2022-04-29 05:37:26.000000000 +0000 @@ -29,7 +29,8 @@ // construction/destruction nes_zapper_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - virtual ioport_constructor device_input_ports() const override; + virtual u8 read_bit34() override; + virtual u8 read_exp(offs_t offset) override; protected: // construction/destruction @@ -38,9 +39,7 @@ // device-level overrides virtual void device_start() override; virtual void device_add_mconfig(machine_config &config) override; - - virtual u8 read_bit34() override; - virtual u8 read_exp(offs_t offset) override; + virtual ioport_constructor device_input_ports() const override; private: required_device m_sensor; @@ -58,14 +57,13 @@ // construction/destruction nes_bandaihs_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - virtual ioport_constructor device_input_ports() const override; + virtual u8 read_exp(offs_t offset) override; + virtual void write(u8 data) override; protected: // device-level overrides virtual void device_start() override; - - virtual u8 read_exp(offs_t offset) override; - virtual void write(u8 data) override; + virtual ioport_constructor device_input_ports() const override; private: required_ioport m_joypad; diff -Nru mame-0.242+dfsg.1/src/devices/bus/nscsi/cd.cpp mame-0.243+dfsg.1/src/devices/bus/nscsi/cd.cpp --- mame-0.242+dfsg.1/src/devices/bus/nscsi/cd.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nscsi/cd.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -123,7 +123,7 @@ const int extra_pos = (lba * bytes_per_block) % bytes_per_sector; if(sector != cur_sector) { cur_sector = sector; - if(!cdrom_read_data(cdrom, sector, sector_buffer, CD_TRACK_MODE1)) { + if(!cdrom->read_data(sector, sector_buffer, cdrom_file::CD_TRACK_MODE1)) { LOG("CD READ ERROR sector %d!\n", sector); std::fill_n(sector_buffer, sizeof(sector_buffer), 0); } @@ -311,15 +311,15 @@ } case SC_READ_CAPACITY: { + LOG("command READ CAPACITY\n"); + if(!cdrom) { return_no_cd(); break; } - LOG("command READ CAPACITY\n"); - // get the last used block on the disc - const u32 temp = cdrom_get_track_start(cdrom, 0xaa) * (bytes_per_sector / bytes_per_block) - 1; + const u32 temp = cdrom->get_track_start(0xaa) * (bytes_per_sector / bytes_per_block) - 1; scsi_cmdbuf[0] = (temp>>24) & 0xff; scsi_cmdbuf[1] = (temp>>16) & 0xff; @@ -365,7 +365,7 @@ scsi_cmdbuf[pos++] = 0x80; // WP, cache // get the last used block on the disc - const u32 temp = cdrom_get_track_start(cdrom, 0xaa) * (bytes_per_sector / bytes_per_block) - 1; + const u32 temp = cdrom ? cdrom->get_track_start(0xaa) * (bytes_per_sector / bytes_per_block) - 1 : 0; scsi_cmdbuf[pos++] = 0x08; // Block descriptor length scsi_cmdbuf[pos++] = 0x00; // density code @@ -463,18 +463,23 @@ case SC_READ_DISC_INFORMATION: LOG("command READ DISC INFORMATION\n"); + if(!cdrom) { + return_no_cd(); + break; + } + std::fill_n(scsi_cmdbuf, 34, 0); scsi_cmdbuf[1] = 32; scsi_cmdbuf[2] = 2; // disc is complete scsi_cmdbuf[3] = 1; // first track scsi_cmdbuf[4] = 1; // number of sessions (TODO: session support for CHDv6) scsi_cmdbuf[5] = 1; // first track in last session - scsi_cmdbuf[6] = cdrom_get_last_track(cdrom); // last track in last session + scsi_cmdbuf[6] = cdrom->get_last_track(); // last track in last session scsi_cmdbuf[8] = 0; // CD-ROM, not XA // lead in start time in MSF { - u32 tstart = cdrom_get_track_start(cdrom, 0); + u32 tstart = cdrom->get_track_start(0); tstart = to_msf(tstart + 150); scsi_cmdbuf[16] = (tstart >> 24) & 0xff; @@ -483,7 +488,7 @@ scsi_cmdbuf[19] = (tstart & 0xff); // lead-out start time in MSF - tstart = cdrom_get_track_start(cdrom, 0xaa); + tstart = cdrom->get_track_start(0xaa); tstart = to_msf(tstart + 150); scsi_cmdbuf[20] = (tstart >> 24) & 0xff; @@ -538,11 +543,16 @@ LOG("command READ TOC PMA ATIP, format %s msf=%d size=%d\n", format_names[format], msf, size); + if(!cdrom) { + return_no_cd(); + break; + } + int pos = 0; switch (format) { case 0: { int start_track = scsi_cmdbuf[6]; - int end_track = cdrom_get_last_track(cdrom); + int end_track = cdrom->get_last_track(); int tracks; if(start_track == 0) @@ -561,7 +571,7 @@ scsi_cmdbuf[pos++] = (len>>8) & 0xff; scsi_cmdbuf[pos++] = (len & 0xff); scsi_cmdbuf[pos++] = 1; - scsi_cmdbuf[pos++] = cdrom_get_last_track(cdrom); + scsi_cmdbuf[pos++] = cdrom->get_last_track(); if (start_track == 0) start_track = 1; @@ -575,11 +585,11 @@ } scsi_cmdbuf[pos++] = 0; - scsi_cmdbuf[pos++] = cdrom_get_adr_control(cdrom, cdrom_track); + scsi_cmdbuf[pos++] = cdrom->get_adr_control(cdrom_track); scsi_cmdbuf[pos++] = track; scsi_cmdbuf[pos++] = 0; - u32 tstart = cdrom_get_track_start(cdrom, cdrom_track); + u32 tstart = cdrom->get_track_start(cdrom_track); if(msf) tstart = to_msf(tstart+150); @@ -601,11 +611,11 @@ scsi_cmdbuf[pos++] = 1; scsi_cmdbuf[pos++] = 0; - scsi_cmdbuf[pos++] = cdrom_get_adr_control(cdrom, 0); + scsi_cmdbuf[pos++] = cdrom->get_adr_control(0); scsi_cmdbuf[pos++] = 1; scsi_cmdbuf[pos++] = 0; - u32 tstart = cdrom_get_track_start(cdrom, 0); + u32 tstart = cdrom->get_track_start(0); if (msf) tstart = to_msf(tstart+150); diff -Nru mame-0.242+dfsg.1/src/devices/bus/nscsi/hd.cpp mame-0.243+dfsg.1/src/devices/bus/nscsi/hd.cpp --- mame-0.242+dfsg.1/src/devices/bus/nscsi/hd.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nscsi/hd.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -43,12 +43,9 @@ scsi_id = -1; bytes_per_sector = 0; } else { - const hard_disk_info *hdinfo = hard_disk_get_info(harddisk); - bytes_per_sector = hdinfo->sectorbytes; - - chd_file *chd = image->get_chd_file(); - if(chd != nullptr) - chd->read_metadata(HARD_DISK_IDENT_METADATA_TAG, 0, m_inquiry_data); + const auto &hdinfo = harddisk->get_info(); + bytes_per_sector = hdinfo.sectorbytes; + harddisk->get_inquiry_data(m_inquiry_data); } cur_lba = -1; } @@ -70,7 +67,7 @@ int clba = lba + pos / bytes_per_sector; if(clba != cur_lba) { cur_lba = clba; - if(!hard_disk_read(harddisk, cur_lba, block)) { + if(!harddisk->read(cur_lba, block)) { LOG("HD READ ERROR !\n"); memset(block, 0, sizeof(block)); } @@ -93,7 +90,7 @@ block[offset] = data; cur_lba = lba + pos / bytes_per_sector; if(offset == bytes_per_sector-1) { - if(!hard_disk_write(harddisk, cur_lba, block)) + if(!harddisk->write(cur_lba, block)) LOG("HD WRITE ERROR !\n"); } } @@ -120,7 +117,7 @@ LOG("command READ start=%08x blocks=%04x\n", lba, blocks); - if(hard_disk_read(harddisk, lba, block)) { + if(harddisk->read(lba, block)) { scsi_data_in(2, blocks*bytes_per_sector); scsi_status_complete(SS_GOOD); } @@ -222,17 +219,17 @@ scsi_cmdbuf[pos++] = 0x00; // medium type scsi_cmdbuf[pos++] = 0x00; // WP, cache - hard_disk_info *info = hard_disk_get_info(harddisk); - uint32_t dsize = info->cylinders * info->heads * info->sectors - 1; + const auto &info = harddisk->get_info(); + uint32_t dsize = info.cylinders * info.heads * info.sectors - 1; scsi_cmdbuf[pos++] = 0x08; // Block descriptor length scsi_cmdbuf[pos++] = 0x00; scsi_cmdbuf[pos++] = (dsize>>16) & 0xff; scsi_cmdbuf[pos++] = (dsize>>8) & 0xff; scsi_cmdbuf[pos++] = (dsize & 0xff); scsi_cmdbuf[pos++] = 0x00; - scsi_cmdbuf[pos++] = (info->sectorbytes>>16)&0xff; - scsi_cmdbuf[pos++] = (info->sectorbytes>>8)&0xff; - scsi_cmdbuf[pos++] = (info->sectorbytes & 0xff); + scsi_cmdbuf[pos++] = (info.sectorbytes>>16)&0xff; + scsi_cmdbuf[pos++] = (info.sectorbytes>>8)&0xff; + scsi_cmdbuf[pos++] = (info.sectorbytes & 0xff); int pmax = page == 0x3f ? 0x3e : page; int pmin = page == 0x3f ? 0x00 : page; @@ -284,18 +281,18 @@ case 0x03: { // Format parameters page scsi_cmdbuf[pos++] = 0x83; // PS, page id scsi_cmdbuf[pos++] = 0x16; // Page length - scsi_cmdbuf[pos++] = (info->cylinders * info->heads) >> 8; // Track/zone - scsi_cmdbuf[pos++] = info->cylinders * info->heads; // Track/zone + scsi_cmdbuf[pos++] = (info.cylinders * info.heads) >> 8; // Track/zone + scsi_cmdbuf[pos++] = info.cylinders * info.heads; // Track/zone scsi_cmdbuf[pos++] = 0x00; // Alt sect/zone scsi_cmdbuf[pos++] = 0x00; // Alt sect/zone scsi_cmdbuf[pos++] = 0x00; // Alt track/zone scsi_cmdbuf[pos++] = 0x00; // Alt track/zone scsi_cmdbuf[pos++] = 0x00; // Alt track/volume scsi_cmdbuf[pos++] = 0x00; // Alt track/volume - scsi_cmdbuf[pos++] = info->sectors >> 8; // Sectors/track - scsi_cmdbuf[pos++] = info->sectors; // Sectors/track - scsi_cmdbuf[pos++] = info->sectorbytes >> 8; // Bytes/sector - scsi_cmdbuf[pos++] = info->sectorbytes; // Bytes/sector + scsi_cmdbuf[pos++] = info.sectors >> 8; // Sectors/track + scsi_cmdbuf[pos++] = info.sectors; // Sectors/track + scsi_cmdbuf[pos++] = info.sectorbytes >> 8; // Bytes/sector + scsi_cmdbuf[pos++] = info.sectorbytes; // Bytes/sector scsi_cmdbuf[pos++] = 0x00; // Interleave scsi_cmdbuf[pos++] = 0x00; // Interleave scsi_cmdbuf[pos++] = 0x00; // Track skew @@ -312,10 +309,10 @@ case 0x04: { // Rigid drive geometry page scsi_cmdbuf[pos++] = 0x84; // PS, page id scsi_cmdbuf[pos++] = 0x16; // Page length - scsi_cmdbuf[pos++] = info->cylinders >> 16; // Cylinders - scsi_cmdbuf[pos++] = info->cylinders >> 8; // Cylinders - scsi_cmdbuf[pos++] = info->cylinders; // Cylinders - scsi_cmdbuf[pos++] = info->heads; // Heads + scsi_cmdbuf[pos++] = info.cylinders >> 16; // Cylinders + scsi_cmdbuf[pos++] = info.cylinders >> 8; // Cylinders + scsi_cmdbuf[pos++] = info.cylinders; // Cylinders + scsi_cmdbuf[pos++] = info.heads; // Heads scsi_cmdbuf[pos++] = 0x00; // Starting cylinder - write precomp scsi_cmdbuf[pos++] = 0x00; // Starting cylinder - write precomp scsi_cmdbuf[pos++] = 0x00; // Starting cylinder - write precomp @@ -453,17 +450,17 @@ case SC_READ_CAPACITY: { LOG("command READ CAPACITY\n"); - hard_disk_info *info = hard_disk_get_info(harddisk); - uint32_t size = info->cylinders * info->heads * info->sectors - 1; + const auto &info = harddisk->get_info(); + uint32_t size = info.cylinders * info.heads * info.sectors - 1; scsi_cmdbuf[0] = (size>>24) & 0xff; scsi_cmdbuf[1] = (size>>16) & 0xff; scsi_cmdbuf[2] = (size>>8) & 0xff; scsi_cmdbuf[3] = (size & 0xff); - scsi_cmdbuf[4] = (info->sectorbytes>>24)&0xff; - scsi_cmdbuf[5] = (info->sectorbytes>>16)&0xff; - scsi_cmdbuf[6] = (info->sectorbytes>>8)&0xff; - scsi_cmdbuf[7] = (info->sectorbytes & 0xff); + scsi_cmdbuf[4] = (info.sectorbytes>>24)&0xff; + scsi_cmdbuf[5] = (info.sectorbytes>>16)&0xff; + scsi_cmdbuf[6] = (info.sectorbytes>>8)&0xff; + scsi_cmdbuf[7] = (info.sectorbytes & 0xff); scsi_data_in(0, 8); scsi_status_complete(SS_GOOD); @@ -476,7 +473,7 @@ LOG("command READ EXTENDED start=%08x blocks=%04x\n",lba, blocks); - if(hard_disk_read(harddisk, lba, block)) { + if(harddisk->read(lba, block)) { scsi_data_in(2, blocks*bytes_per_sector); scsi_status_complete(SS_GOOD); } @@ -505,12 +502,12 @@ (scsi_cmdbuf[1] & 0x10) ? " FMTDATA" : "", (scsi_cmdbuf[1] & 0x08) ? " CMPLIST" : ""); { - hard_disk_info *info = hard_disk_get_info(harddisk); - auto block = std::make_unique(info->sectorbytes); - for(int cyl = 0; cyl < info->cylinders; cyl++) { - for(int head = 0; head < info->heads; head++) { - for(int sector = 0; sector < info->sectors; sector++) { - hard_disk_write(harddisk, cyl * head * sector, block.get()); + const auto &info = harddisk->get_info(); + auto block = std::make_unique(info.sectorbytes); + for(int cyl = 0; cyl < info.cylinders; cyl++) { + for(int head = 0; head < info.heads; head++) { + for(int sector = 0; sector < info.sectors; sector++) { + harddisk->write(cyl * head * sector, block.get()); } } } diff -Nru mame-0.242+dfsg.1/src/devices/bus/nscsi/s1410.cpp mame-0.243+dfsg.1/src/devices/bus/nscsi/s1410.cpp --- mame-0.242+dfsg.1/src/devices/bus/nscsi/s1410.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/nscsi/s1410.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -57,12 +57,12 @@ case SC_FORMAT_UNIT: LOG("command FORMAT UNIT\n"); { - hard_disk_info *info = hard_disk_get_info(harddisk); - auto block = std::make_unique(info->sectorbytes); - memset(&block[0], 0x6c, info->sectorbytes); + const auto &info = harddisk->get_info(); + auto block = std::make_unique(info.sectorbytes); + memset(&block[0], 0x6c, info.sectorbytes); lba = ((scsi_cmdbuf[1] & 0x1f)<<16) | (scsi_cmdbuf[2]<<8) | scsi_cmdbuf[3]; - for(; lba < (info->cylinders * info->heads * info->sectors); lba++) { - hard_disk_write(harddisk, lba, block.get()); + for(; lba < (info.cylinders * info.heads * info.sectors); lba++) { + harddisk->write(lba, block.get()); } } scsi_status_complete(SS_GOOD); @@ -81,7 +81,7 @@ auto block = std::make_unique(track_length); memset(&block[0], 0x6c, track_length); - if(!hard_disk_write(harddisk, lba, &block[0])) { + if(!harddisk->write(lba, &block[0])) { logerror("%s: HD WRITE ERROR !\n", tag()); scsi_status_complete(SS_FORMAT_ERROR); } else { diff -Nru mame-0.242+dfsg.1/src/devices/bus/pc8801/jmbx1.cpp mame-0.243+dfsg.1/src/devices/bus/pc8801/jmbx1.cpp --- mame-0.242+dfsg.1/src/devices/bus/pc8801/jmbx1.cpp 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/pc8801/jmbx1.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,58 @@ +// license:BSD-3-Clause +// copyright-holders:Angelo Salese +/************************************************************************************************** + + JMB-X1 sound card + + Used for PC-8001mkII/PC-8801 NRTDRV sound program + http://upd780c1.g1.xrea.com/pc-8001/j80-25.html + + TODO: + - Source claims it runs on INT3, but the vector that uses NRTDRV is clearly INT4. + Is it configurable? + +**************************************************************************************************/ + +#include "emu.h" +#include "jmbx1.h" + + +DEFINE_DEVICE_TYPE(JMBX1, jmbx1_device, "jmbx1", "JMB-X1 \"Sound Board X\"") + +jmbx1_device::jmbx1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : pc8801_exp_device(mconfig, JMBX1, tag, owner, clock) + , m_opm1(*this, "opm1") + , m_opm2(*this, "opm2") + , m_ssg(*this, "ssg") +{ +} + +void jmbx1_device::io_map(address_map &map) +{ + map(0xc8, 0xc9).rw(m_opm1, FUNC(ym2151_device::read), FUNC(ym2151_device::write)); + map(0xca, 0xcb).rw(m_opm2, FUNC(ym2151_device::read), FUNC(ym2151_device::write)); + map(0xcc, 0xcd).w(m_ssg, FUNC(ym2149_device::address_data_w)); + map(0xcd, 0xcd).r(m_ssg, FUNC(ym2149_device::data_r)); +} + +void jmbx1_device::device_add_mconfig(machine_config &config) +{ + constexpr XTAL jmb_x1_clock = XTAL(8'000'000); + + // TODO: OPM mixing + // (SSG is mono) + // doesn't seem to have irq mask + YM2151(config, m_opm1, jmb_x1_clock / 2); + m_opm1->irq_handler().set(FUNC(jmbx1_device::int4_w)); + m_opm1->add_route(ALL_OUTPUTS, "^^lspeaker", 0.25); + m_opm1->add_route(ALL_OUTPUTS, "^^rspeaker", 0.25); + + YM2151(config, m_opm2, jmb_x1_clock / 2); + m_opm2->add_route(ALL_OUTPUTS, "^^lspeaker", 0.25); + m_opm2->add_route(ALL_OUTPUTS, "^^rspeaker", 0.25); + + YM2149(config, m_ssg, jmb_x1_clock / 4); + // TODO: adds a non-negligible DC offset, likely needs high pass filter + m_ssg->add_route(ALL_OUTPUTS, "^^lspeaker", 0.20); + m_ssg->add_route(ALL_OUTPUTS, "^^rspeaker", 0.20); +} diff -Nru mame-0.242+dfsg.1/src/devices/bus/pc8801/jmbx1.h mame-0.243+dfsg.1/src/devices/bus/pc8801/jmbx1.h --- mame-0.242+dfsg.1/src/devices/bus/pc8801/jmbx1.h 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/pc8801/jmbx1.h 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,31 @@ +// license:BSD-3-Clause +// copyright-holders:Angelo Salese + +#ifndef MAME_BUS_PC8801_JMBX1_H +#define MAME_BUS_PC8801_JMBX1_H + +#pragma once + +#include "pc8801_exp.h" +#include "sound/ay8910.h" +#include "sound/ymopm.h" + +class jmbx1_device : public pc8801_exp_device +{ +public: + jmbx1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + + virtual void io_map(address_map &map) override; + +private: + virtual void device_add_mconfig(machine_config &config) override; + + required_device m_opm1; + required_device m_opm2; + required_device m_ssg; +}; + +DECLARE_DEVICE_TYPE(JMBX1, jmbx1_device) + + +#endif // MAME_BUS_PC8801_JMBX1_H diff -Nru mame-0.242+dfsg.1/src/devices/bus/pc8801/pc8801_23.cpp mame-0.243+dfsg.1/src/devices/bus/pc8801/pc8801_23.cpp --- mame-0.242+dfsg.1/src/devices/bus/pc8801/pc8801_23.cpp 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/pc8801/pc8801_23.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,89 @@ +// license:BSD-3-Clause +// copyright-holders:Angelo Salese +/************************************************************************************************** + + NEC PC-8801-23 / -24 / -25 "Sound Board II" + + TODO: + - Irq hangs if there's a PC-8801 OPN/OPNA declared in driver. + Master OPNA keeps sending acks in the correlated INT4 handler that hampers irq + signals from here; + - Confirm there's no DB9 joyport on any variants of this; + +**************************************************************************************************/ + +#include "emu.h" +#include "pc8801_23.h" + +DEFINE_DEVICE_TYPE(PC8801_23, pc8801_23_device, "pc8801_23", "NEC PC-8801-23 \"Sound Board II\"") + +pc8801_23_device::pc8801_23_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : pc8801_exp_device(mconfig, PC8801_23, tag, owner, clock) + , m_opna(*this, "opna") +{ +} + +void pc8801_23_device::io_map(address_map &map) +{ + map(0xa8, 0xa9).rw(m_opna, FUNC(ym2608_device::read), FUNC(ym2608_device::write)); + map(0xaa, 0xaa).rw(FUNC(pc8801_23_device::irq_status_r), FUNC(pc8801_23_device::irq_mask_w)); + map(0xac, 0xad).lrw8( + NAME([this] (offs_t offset) { return m_opna->read(offset | 2); }), + NAME([this] (offs_t offset, u8 data) { m_opna->write(offset | 2, data); }) + ); +} + +void pc8801_23_device::opna_map(address_map &map) +{ + // TODO: confirm it really is ROMless + // TODO: confirm size + map(0x000000, 0x1fffff).ram(); +} + +void pc8801_23_device::device_add_mconfig(machine_config &config) +{ + constexpr XTAL sound_clock = XTAL(31'948'800) / 4; + + YM2608(config, m_opna, sound_clock); + m_opna->set_addrmap(0, &pc8801_23_device::opna_map); + m_opna->irq_handler().set(FUNC(pc8801_23_device::int4_w)); +// m_opna->port_a_read_callback().set(FUNC(pc8801_23_device::opn_porta_r)); +// m_opna->port_b_read_callback().set_ioport("OPN_PB"); + // TODO: per-channel mixing is unconfirmed + m_opna->add_route(0, "^^lspeaker", 0.25); + m_opna->add_route(0, "^^rspeaker", 0.25); + m_opna->add_route(1, "^^lspeaker", 0.75); + m_opna->add_route(2, "^^rspeaker", 0.75); +} + +void pc8801_23_device::device_start() +{ + save_item(NAME(m_irq_mask)); + save_item(NAME(m_irq_pending)); +} + +void pc8801_23_device::device_reset() +{ + m_irq_mask = true; + m_irq_pending = false; +} + +u8 pc8801_23_device::irq_status_r() +{ + return 0x7f | (m_irq_mask << 7); +} + +void pc8801_23_device::irq_mask_w(u8 data) +{ + m_irq_mask = bool(BIT(data, 7)); + + if (!m_irq_mask && m_irq_pending) + int4_w(m_irq_pending); +} + +WRITE_LINE_MEMBER( pc8801_23_device::int4_w ) +{ + bool irq_state = (!m_irq_mask) & state; + pc8801_exp_device::int4_w(irq_state); + m_irq_pending = state; +} diff -Nru mame-0.242+dfsg.1/src/devices/bus/pc8801/pc8801_23.h mame-0.243+dfsg.1/src/devices/bus/pc8801/pc8801_23.h --- mame-0.242+dfsg.1/src/devices/bus/pc8801/pc8801_23.h 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/pc8801/pc8801_23.h 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,43 @@ +// license:BSD-3-Clause +// copyright-holders:Angelo Salese + +#ifndef MAME_BUS_PC8801_23_H +#define MAME_BUS_PC8801_23_H + +#pragma once + +#include "pc8801_exp.h" +#include "sound/ymopn.h" + +class pc8801_23_device : public pc8801_exp_device +{ +public: + pc8801_23_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + + static constexpr feature_type unemulated_features() { return feature::SOUND; } + + virtual void io_map(address_map &map) override; + +protected: + virtual void device_start() override; + virtual void device_reset() override; + virtual DECLARE_WRITE_LINE_MEMBER( int4_w ) override; + +private: + virtual void device_add_mconfig(machine_config &config) override; + + required_device m_opna; + + u8 irq_status_r(); + void irq_mask_w(u8 data); + + bool m_irq_mask = false; + bool m_irq_pending = false; + + void opna_map(address_map &map); +}; + +DECLARE_DEVICE_TYPE(PC8801_23, pc8801_23_device) + + +#endif // MAME_BUS_PC8801_23_H diff -Nru mame-0.242+dfsg.1/src/devices/bus/pc8801/pc8801_31.cpp mame-0.243+dfsg.1/src/devices/bus/pc8801/pc8801_31.cpp --- mame-0.242+dfsg.1/src/devices/bus/pc8801/pc8801_31.cpp 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/pc8801/pc8801_31.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,262 @@ +// license:BSD-3-Clause +// copyright-holders:Angelo Salese +/************************************************************************************************** + + NEC PC8801-31 CD-ROM I/F + + TODO: + - Interface with PC8801-30 (the actual CD drive); + - Make it a slot option for PC-8801MA (does it have same ROM as the internal MC version?) + +**************************************************************************************************/ + +#include "emu.h" +#include "pc8801_31.h" + + +//************************************************************************** +// GLOBAL VARIABLES +//************************************************************************** + + +// device type definition +DEFINE_DEVICE_TYPE(PC8801_31, pc8801_31_device, "pc8801_31", "NEC PC8801-31 CD-ROM I/F") + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + + +//------------------------------------------------- +// pc8801_31_device - constructor +//------------------------------------------------- + + +pc8801_31_device::pc8801_31_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, PC8801_31, tag, owner, clock) + , m_scsibus(*this, "scsi") + , m_rom_bank_cb(*this) + , m_sel_off_timer(nullptr) +{ +} + + +//------------------------------------------------- +// device_add_mconfig - device-specific machine +// configuration addiitons +//------------------------------------------------- + +static void pc8801_scsi_devices(device_slot_interface &device) +{ + // TODO: PC8801-30 + device.option_add("cdrom", NSCSI_CDROM); + // TODO: at very least HxC Floppy emulator option +} + +void pc8801_31_device::device_add_mconfig(machine_config &config) +{ + NSCSI_BUS(config, m_scsibus); + NSCSI_CONNECTOR(config, "scsi:0", pc8801_scsi_devices, "cdrom"); + NSCSI_CONNECTOR(config, "scsi:1", pc8801_scsi_devices, nullptr); + NSCSI_CONNECTOR(config, "scsi:2", pc8801_scsi_devices, nullptr); + NSCSI_CONNECTOR(config, "scsi:3", pc8801_scsi_devices, nullptr); + NSCSI_CONNECTOR(config, "scsi:4", pc8801_scsi_devices, nullptr); + NSCSI_CONNECTOR(config, "scsi:5", pc8801_scsi_devices, nullptr); + NSCSI_CONNECTOR(config, "scsi:6", pc8801_scsi_devices, nullptr); + NSCSI_CONNECTOR(config, "scsi:7", pc8801_scsi_devices, nullptr); + + SOFTWARE_LIST(config, "cd_list").set_original("pc8801_cdrom"); +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void pc8801_31_device::device_resolve_objects() +{ + m_rom_bank_cb.resolve(); +} + + +void pc8801_31_device::device_start() +{ + m_sel_off_timer = timer_alloc(0); + + save_item(NAME(m_clock_hb)); + save_item(NAME(m_cddrive_enable)); +} + + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + + +void pc8801_31_device::device_reset() +{ + m_clock_hb = false; + m_cddrive_enable = false; + + m_sel_off_timer->adjust(attotime::never); +} + +void pc8801_31_device::device_timer(emu_timer &timer, device_timer_id id, int param) +{ + switch(id) + { + case 0: + m_scsibus->ctrl_w(0, 0, nscsi_device::S_SEL); + break; + } +} + + + +//************************************************************************** +// READ/WRITE HANDLERS +//************************************************************************** + + +void pc8801_31_device::amap(address_map &map) +{ + map(0x00, 0x00).rw(FUNC(pc8801_31_device::scsi_status_r), FUNC(pc8801_31_device::scsi_sel_w)); + map(0x01, 0x01).lrw8( + NAME([this]() { return m_scsibus->data_r(); }), + NAME([this](u8 data) { m_scsibus->data_w(0, data); }) + ); + map(0x04, 0x04).w(FUNC(pc8801_31_device::scsi_reset_w)); + map(0x08, 0x08).rw(FUNC(pc8801_31_device::clock_r), FUNC(pc8801_31_device::volume_control_w)); + map(0x09, 0x09).rw(FUNC(pc8801_31_device::id_r), FUNC(pc8801_31_device::rom_bank_w)); + map(0x0b, 0x0b).r(FUNC(pc8801_31_device::volume_meter_r)); + map(0x0d, 0x0d).r(FUNC(pc8801_31_device::volume_meter_r)); + map(0x0f, 0x0f).lw8( + NAME([this](u8 data) { m_cddrive_enable = bool(BIT(data, 0)); }) + ); +} + +/* + * I/O Port $90 + * + * x--- ---- BSY + * -x-- ---- REQ + * --x- ---- MSG + * ---x ---- CD + * ---- x--- IO + * ---- ---x CD-ROM drive status (from $9f) + * + * BIOS expects a bit 6 to go high then checks if (MSG | CD | IO) == CD. + * It eventually moves on floppy/BASIC fallback if this check fails. + * + */ +u8 pc8801_31_device::scsi_status_r() +{ + u32 ctrl = m_scsibus->ctrl_r(); + return ( + (ctrl & nscsi_device::S_BSY ? 0x80 : 0x00) | + (ctrl & nscsi_device::S_REQ ? 0x40 : 0x00) | + (ctrl & nscsi_device::S_MSG ? 0x20 : 0x00) | + (ctrl & nscsi_device::S_CTL ? 0x10 : 0x00) | + (ctrl & nscsi_device::S_INP ? 0x08 : 0x00) | + m_cddrive_enable + ); +} + +void pc8801_31_device::scsi_sel_w(u8 data) +{ + bool sel_on = bool(BIT(data, 0)); + m_scsibus->ctrl_w( + 0, + sel_on ? nscsi_device::S_SEL : 0, + nscsi_device::S_SEL + ); + + // TODO: timing + if (sel_on) + m_sel_off_timer->adjust(attotime::from_usec(10)); +} + +/* + * I/O Port $98 + * + * x--- ---- (r/o?) device clock heartbeat? + * ---- -xxx (w/o?) CD-DA volume control (not unlike PCE) + * ---- -00x enable + * ---- -01x disable + * ---- -100 fade-in short (100 msec) + * ---- -101 fade-in long (1500 msec) + * ---- -110 fade-out short (100 msec) + * ---- -111 fade-out long (1500 msec) + * + */ +u8 pc8801_31_device::clock_r() +{ + // Checked 11 times on POST before giving up, definitely some kind of timing-based CD-ROM or board identification. + // If check passes the BIOS goes on with the "CD-System initialize\n[Space]->CD player" screen. + // A similar PCE pattern is mapped as "CDDA data select". + // There's no way to load floppies with this always on unless STOP key is held on boot (which doesn't look convenient). + // TODO: identify source and verify how much fast this really is. + m_clock_hb ^= 1; + return m_clock_hb << 7; +} + +void pc8801_31_device::volume_control_w(u8 data) +{ + logerror("%s: volume_w %02x\n", machine().describe_context(), data); +} + +/* + * I/O Port $94 + * + * x--- ---- to SCSI RST + * + */ +void pc8801_31_device::scsi_reset_w(u8 data) +{ + m_scsibus->ctrl_w( + 0, + BIT(data, 7) ? nscsi_device::S_RST : 0, + nscsi_device::S_RST + ); +} + +u8 pc8801_31_device::id_r() +{ + // PC=A9AA CD-Player checks this against 0xcd, branches with $71 bit 0 set (N88 extended ROM bank) + // Identifier for a 8801MC? + logerror("%s: id_r\n", machine().describe_context()); + return 0xcd; +} + +/* + * I/O Port $99 + * + * ---x ---- CD-ROM BIOS bank + * ---- ---x CD-ROM E-ROM bank (?) + * + */ +void pc8801_31_device::rom_bank_w(u8 data) +{ + m_rom_bank_cb(bool(BIT(data, 4))); + + if (data & 0xef) + logerror("%s: rom_bank_w %02x\n", machine().describe_context(), data); +} + +/* + * I/O Port $9b / $9d CDDA Left/Right output meter + * + * ?xxx xx-- L/R metering + * + * M88 hardwires this as 0x3c, CD player shows arbitrary clamp with + * timed flicker on ticks depending on the value read. + * i.e. a value of 0x70 will make the uppermost tick to flicker more than 0x74, + * while 0x7c won't flicker at all + * + */ +// TODO: templatìze, measure via real HW tests +u8 pc8801_31_device::volume_meter_r() +{ + return 0; +} diff -Nru mame-0.242+dfsg.1/src/devices/bus/pc8801/pc8801_31.h mame-0.243+dfsg.1/src/devices/bus/pc8801/pc8801_31.h --- mame-0.242+dfsg.1/src/devices/bus/pc8801/pc8801_31.h 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/pc8801/pc8801_31.h 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,66 @@ +// license:BSD-3-Clause +// copyright-holders:Angelo Salese +/************************************************************************************************** + + NEC PC8801-31 CD-ROM I/F + +**************************************************************************************************/ + +#ifndef MAME_BUS_PC8801_31_H +#define MAME_BUS_PC8801_31_H + +#pragma once + +#include "machine/nscsi_bus.h" +#include "bus/nscsi/cd.h" + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +class pc8801_31_device : public device_t +{ +public: + // construction/destruction + pc8801_31_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + + static constexpr feature_type unemulated_features() { return feature::DISK; } + + auto rom_bank_cb() { return m_rom_bank_cb.bind(); } + + // I/O operations + void amap(address_map &map); + +protected: + // device-level overrides + virtual void device_resolve_objects() override; + virtual void device_add_mconfig(machine_config &config) override; + virtual void device_start() override; + virtual void device_reset() override; + virtual void device_timer(emu_timer &timer, device_timer_id id, int param) override; + +private: + required_device m_scsibus; + + devcb_write_line m_rom_bank_cb; + + emu_timer *m_sel_off_timer; + + u8 scsi_status_r(); + void scsi_sel_w(u8 data); + void scsi_reset_w(u8 data); + u8 clock_r(); + void volume_control_w(u8 data); + u8 id_r(); + void rom_bank_w(u8 data); + u8 volume_meter_r(); + + bool m_clock_hb; + bool m_cddrive_enable; +}; + + +// device type definition +DECLARE_DEVICE_TYPE(PC8801_31, pc8801_31_device) + +#endif // MAME_BUS_PC8801_31_H diff -Nru mame-0.242+dfsg.1/src/devices/bus/pc8801/pc8801_exp.cpp mame-0.243+dfsg.1/src/devices/bus/pc8801/pc8801_exp.cpp --- mame-0.242+dfsg.1/src/devices/bus/pc8801/pc8801_exp.cpp 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/pc8801/pc8801_exp.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,126 @@ +// license:BSD-3-Clause +// copyright-holders:Angelo Salese +/************************************************************************************************** + + PC-8801 EXPansion bus + + List of known cards: + \- NEC PC-8801-10 + (MIDI interface); + \- NEC PC-8801-11 + ("Sound Board", single YM2203C OPN, single joy port, mono out); + \- NEC PC-8801-12 + (Modem board, full duplex 300bps); + \- NEC PC-8801-13 + (Parallel I/F board); + \- NEC PC-8801-17 / -18 + (VTR capture card "Video art board" / "Video digitizing unit", 16-bit color); + \- NEC PC-8801-21 + (CMT i/f board); + \- NEC PC-8801-22 + ("Multi board B", upgrades a FH to MH and FA to MA (?)); + \- NEC PC-8801-23 & -24 & -25 + ("Sound Board 2", single YM2608 OPNA, single joy port, stereo out. + -24 is the internal FH / MH version, -25 is the internal FE / FE2 with YM2608B. + Standard and on main board instead for FA / MA and onward); + \- NEC PC-8801-30 & -31 + (-31 is CD-ROM SCSI i/f, -30 is virtually same to PC Engine CD-ROM² drive) + \- NEC PC-8864 + (Network board mapping at $a0-$a3) + \- HAL PCG-8100 + (PCG and 3x DAC_1BIT at I/O $01, $02. PIT at $0c-$0f) + \- HAL GSX-8800 + (2x PSG at I/O $a0-$a3, mono out. Has goofy extra connector on top and a couple jumpers, + guess it may cascade with another board for 2x extra PSGs at $a4-$a7); + \- HIBIKI-8800 + (YM2151 OPM + YM3802-X MIDI controller, stereo out, has own internal XTAL @ 4MHz. + Has an undumped PAL/PROM labeled "HAL-881"); + \- HAL HMB-20 + (same as HIBIKI-8800 board?) + \- JMB-X1 + ("Sound Board X", 2x OPM + 1x SSG. Used by NRTDRV, more info at GH #8709); + +**************************************************************************************************/ + +#include "emu.h" +#include "pc8801_exp.h" + +DEFINE_DEVICE_TYPE(PC8801_EXP_SLOT, pc8801_exp_slot_device, "pc8801_exp_slot", "PC-8801 Expansion Slot") + +pc8801_exp_slot_device::pc8801_exp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, PC8801_EXP_SLOT, tag, owner, clock) + , device_single_card_slot_interface(mconfig, *this) + , m_iospace(*this, finder_base::DUMMY_TAG, -1) + , m_int3_cb(*this) + , m_int4_cb(*this) + , m_int5_cb(*this) +{ +} + +pc8801_exp_slot_device::~pc8801_exp_slot_device() +{ +} + +void pc8801_exp_slot_device::device_start() +{ +} + +void pc8801_exp_slot_device::device_resolve_objects() +{ + m_int3_cb.resolve_safe(); + m_int4_cb.resolve_safe(); + m_int5_cb.resolve_safe(); +} + +device_pc8801_exp_interface::device_pc8801_exp_interface(const machine_config &mconfig, device_t &device) + : device_interface(device, "pc8801exp") +{ + m_slot = dynamic_cast(device.owner()); +} + +device_pc8801_exp_interface::~device_pc8801_exp_interface() +{ +} + +void device_pc8801_exp_interface::interface_pre_start() +{ + if (!m_slot->started()) + throw device_missing_dependencies(); +} + +void device_pc8801_exp_interface::interface_post_start() +{ + m_slot->install_io_device(*this, &device_pc8801_exp_interface::io_map); +} + +// generic passthroughs to INT* lines +// NB: clients are responsible to handle irq masking just like base HW if available +WRITE_LINE_MEMBER( device_pc8801_exp_interface::int3_w ) { m_slot->m_int3_cb(state); } +WRITE_LINE_MEMBER( device_pc8801_exp_interface::int4_w ) { m_slot->m_int4_cb(state); } +WRITE_LINE_MEMBER( device_pc8801_exp_interface::int5_w ) { m_slot->m_int5_cb(state); } + +pc8801_exp_device::pc8801_exp_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_pc8801_exp_interface(mconfig, *this) +{ +} + +void pc8801_exp_device::device_start() +{ + +} + + + +// slot devices +#include "pcg8100.h" +#include "pc8801_23.h" +#include "jmbx1.h" + +void pc8801_exp_devices(device_slot_interface &device) +{ + device.option_add("sbii", PC8801_23); + + device.option_add("pcg8100", PCG8100); + device.option_add("jmbx1", JMBX1); +} diff -Nru mame-0.242+dfsg.1/src/devices/bus/pc8801/pc8801_exp.h mame-0.243+dfsg.1/src/devices/bus/pc8801/pc8801_exp.h --- mame-0.242+dfsg.1/src/devices/bus/pc8801/pc8801_exp.h 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/pc8801/pc8801_exp.h 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,95 @@ +// license:BSD-3-Clause +// copyright-holders:Angelo Salese + +#ifndef MAME_BUS_PC8801_EXP_H +#define MAME_BUS_PC8801_EXP_H + +#pragma once + +class device_pc8801_exp_interface; +class pc8801_exp_device; + +class pc8801_exp_slot_device : public device_t, public device_single_card_slot_interface +{ + friend class device_pc8801_exp_interface; +public: + // construction/destruction + template + pc8801_exp_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&opts, char const *dflt) + : pc8801_exp_slot_device(mconfig, tag, owner, (uint32_t)0) + { + option_reset(); + opts(*this); + set_default_option(dflt); + set_fixed(false); + } + pc8801_exp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + virtual ~pc8801_exp_slot_device(); + + template void set_iospace(T &&tag, int spacenum) { m_iospace.set_tag(std::forward(tag), spacenum); } + + template void install_io_device(T &device, void (T::*map)(class address_map &map)) + { + m_iospace->install_device(0x00, 0xff, device, map); + } + + auto int3_callback() { return m_int3_cb.bind(); } + auto int4_callback() { return m_int4_cb.bind(); } + auto int5_callback() { return m_int5_cb.bind(); } + +protected: + // device-level overrides + virtual void device_start() override; + virtual void device_resolve_objects() override; + +private: + required_address_space m_iospace; + +// device_pc8801_exp_interface *m_exp; + + devcb_write_line m_int3_cb; + devcb_write_line m_int4_cb; + devcb_write_line m_int5_cb; +}; + +class device_pc8801_exp_interface : public device_interface +{ +public: + // construction/destruction + virtual ~device_pc8801_exp_interface(); + + virtual void io_map(address_map &map) { } + +protected: + device_pc8801_exp_interface(const machine_config &mconfig, device_t &device); + + virtual void interface_pre_start() override; + virtual void interface_post_start() override; + + pc8801_exp_slot_device *m_slot; + + DECLARE_WRITE_LINE_MEMBER( int3_w ); + virtual DECLARE_WRITE_LINE_MEMBER( int4_w ); + DECLARE_WRITE_LINE_MEMBER( int5_w ); +}; + +class pc8801_exp_device : public device_t, public device_pc8801_exp_interface +{ +public: + // construction/destruction + pc8801_exp_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + + +protected: +// virtual void device_add_mconfig(machine_config &config) override; + virtual void device_start() override; + + +}; + +// device type definition +DECLARE_DEVICE_TYPE(PC8801_EXP_SLOT, pc8801_exp_slot_device) + +void pc8801_exp_devices(device_slot_interface &device); + +#endif // MAME_MACHINE_PC8801_EXP_H diff -Nru mame-0.242+dfsg.1/src/devices/bus/pc8801/pcg8100.cpp mame-0.243+dfsg.1/src/devices/bus/pc8801/pcg8100.cpp --- mame-0.242+dfsg.1/src/devices/bus/pc8801/pcg8100.cpp 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/pc8801/pcg8100.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,109 @@ +// license:BSD-3-Clause +// copyright-holders:Angelo Salese +/************************************************************************************************** + + HAL PCG-8100 + + Used on a bunch of PC-8001 games, adds a Programmable Character Generator overlay, + a write-only 8253 with channels tied to three DAC1BIT + +**************************************************************************************************/ + +#include "emu.h" +#include "pcg8100.h" + + +DEFINE_DEVICE_TYPE(PCG8100, pcg8100_device, "pcg8100", "HAL Laboratory PCG-8100") + +pcg8100_device::pcg8100_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : pc8801_exp_device(mconfig, PCG8100, tag, owner, clock) + , m_pit(*this, "pit") + , m_dac1bit(*this, "dac1bit%u", 0L) + , m_cg_rom(*this, "^^cgrom") +{ +} + +void pcg8100_device::io_map(address_map &map) +{ + map(0x00, 0x00).lw8(NAME([this] (u8 data) { m_pcg_data = data; })); + map(0x01, 0x01).lw8(NAME([this] (u8 data) { m_pcg_address = (m_pcg_address & 0x300) | data; })); + map(0x02, 0x02).w(FUNC(pcg8100_device::pcg_latch_w)); + map(0x0c, 0x0f).w(m_pit, FUNC(pit8253_device::write)); +} + +void pcg8100_device::device_add_mconfig(machine_config &config) +{ + constexpr XTAL pcg_clock = XTAL(31'948'800) / 8; + + PIT8253(config, m_pit, 0); + m_pit->set_clk<0>(pcg_clock); + m_pit->out_handler<0>().set(m_dac1bit[0], FUNC(speaker_sound_device::level_w)); + m_pit->set_clk<1>(pcg_clock); + m_pit->out_handler<1>().set(m_dac1bit[1], FUNC(speaker_sound_device::level_w)); + m_pit->set_clk<2>(pcg_clock); + m_pit->out_handler<2>().set(m_dac1bit[2], FUNC(speaker_sound_device::level_w)); + + for (auto &dac1bit : m_dac1bit) + { + SPEAKER_SOUND(config, dac1bit); + dac1bit->add_route(ALL_OUTPUTS, "^^lspeaker", 0.25); + dac1bit->add_route(ALL_OUTPUTS, "^^rspeaker", 0.25); + } +} + +void pcg8100_device::device_start() +{ + save_item(NAME(m_pcg_data)); + save_item(NAME(m_pcg_address)); + + // PCG overlays directly to the internal PC-8001 3301 CG ROM base. + // Save a local copy of the original data here, card can eventually restore data at later time. + for (int i = 0x000; i < 0x400; i++) + m_original_rom[i] = m_cg_rom[i | 0x400]; + + save_item(NAME(m_original_rom)); +} + +void pcg8100_device::device_reset() +{ + int i; + m_pcg_data = 0; + m_pcg_address = 0; + m_pcg_latch = 0; + + for (i = 0x000; i < 0x400; i++) + m_cg_rom[i | 0x400] = m_original_rom[i]; + + for (i = 0; i < 3; i++) + audio_channel(i, false); +} + +void pcg8100_device::audio_channel(u8 ch, bool keyon) +{ + m_dac1bit[ch]->set_output_gain(0, keyon ? 1.0 : 0.0); +} + +/* + * x--- ---- DAC1BIT #2 + * -x-- ---- DAC1BIT #1 + * --x- ---- (0) select overlay on latch (1) select PC-8001/PC-8801 original CG ROM + * ---x ---- latch data into current PCG address RAM + * ---- x--- DAC1BIT #0 + * ---- --xx upper PCG address + */ +void pcg8100_device::pcg_latch_w(u8 data) +{ + if (BIT(m_pcg_latch, 4) && !(BIT(data, 4))) + { + if (BIT(m_pcg_latch, 5)) + m_cg_rom[0x400 | m_pcg_address] = m_original_rom[m_pcg_address]; + else + m_cg_rom[0x400 | m_pcg_address] = m_pcg_data; + } + m_pcg_address = (m_pcg_address & 0xff) | ((data & 0x3) << 8); + m_pcg_latch = data; + + audio_channel(0, bool(BIT(data, 3))); + audio_channel(1, bool(BIT(data, 6))); + audio_channel(2, bool(BIT(data, 7))); +} diff -Nru mame-0.242+dfsg.1/src/devices/bus/pc8801/pcg8100.h mame-0.243+dfsg.1/src/devices/bus/pc8801/pcg8100.h --- mame-0.242+dfsg.1/src/devices/bus/pc8801/pcg8100.h 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/pc8801/pcg8100.h 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,44 @@ +// license:BSD-3-Clause +// copyright-holders:Angelo Salese + +#ifndef MAME_BUS_PC8801_PCG8100_H +#define MAME_BUS_PC8801_PCG8100_H + +#pragma once + +#include "pc8801_exp.h" +#include "machine/pit8253.h" +#include "sound/spkrdev.h" + +class pcg8100_device : public pc8801_exp_device +{ +public: + pcg8100_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + + virtual void io_map(address_map &map) override; + +protected: + virtual void device_start() override; + virtual void device_reset() override; + +private: + virtual void device_add_mconfig(machine_config &config) override; + + u8 m_pcg_data = 0; + u16 m_pcg_address = 0; + u8 m_pcg_latch = 0; + + void pcg_latch_w(u8 data); + + required_device m_pit; + required_device_array m_dac1bit; + + required_region_ptr m_cg_rom; + std::array m_original_rom; + void audio_channel(u8 ch, bool keyon); +}; + +DECLARE_DEVICE_TYPE(PCG8100, pcg8100_device) + + +#endif // MAME_BUS_PC8801_JMBX1_H diff -Nru mame-0.242+dfsg.1/src/devices/bus/rs232/xvd701.cpp mame-0.243+dfsg.1/src/devices/bus/rs232/xvd701.cpp --- mame-0.242+dfsg.1/src/devices/bus/rs232/xvd701.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/rs232/xvd701.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1,12 +1,23 @@ // license:BSD-3-Clause -// copyright-holders:smf +// copyright-holders:smf, DragonMinded, windyfairy + #include "emu.h" #include "xvd701.h" +#define LOG_COMMAND (1 << 1) +// #define VERBOSE (LOG_COMMAND) +// #define LOG_OUTPUT_STREAM std::cout + +#include "logmacro.h" + +#define LOGCMD(...) LOGMASKED(LOG_COMMAND, __VA_ARGS__) + + jvc_xvd701_device::jvc_xvd701_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, JVC_XVD701, tag, owner, clock), device_serial_interface(mconfig, *this), device_rs232_port_interface(mconfig, *this), + m_media_type(JVC_MEDIA_VCD), // TODO: This should be changed based on the type of disc inserted or else seeking won't work properly m_response_index(0), m_timer_response(nullptr) { @@ -55,6 +66,11 @@ memset(m_command, 0, sizeof(m_command)); m_response_index = sizeof(m_response); + + m_jlip_id = 33; // Twinkle default + m_is_powered = false; + m_chapter = 0; + m_playback_status = STATUS_STOP; } void jvc_xvd701_device::device_timer(emu_timer &timer, device_timer_id id, int param) @@ -82,14 +98,27 @@ unsigned char jvc_xvd701_device::sum(unsigned char *buffer, int length) { - int sum = 0; + int sum = 0x80; for (int i = 0; i < length; i++) - sum += buffer[i]; + sum -= buffer[i] & 0x7f; return sum & 0x7f; } +void jvc_xvd701_device::create_packet(unsigned char status, const unsigned char response[6]) +{ + m_response[0] = 0xfc; + m_response[1] = 0xff; + m_response[2] = m_jlip_id; + m_response[3] = status; + memcpy(&m_response[4], response, 6); + m_response[10] = sum(m_response, sizeof(m_response) - 1); + + m_response_index = 0; + m_timer_response->adjust(attotime::from_msec(100)); +} + void jvc_xvd701_device::send_response() { if (m_response_index < sizeof(m_response) && is_transmit_register_empty()) @@ -99,6 +128,22 @@ } } +bool jvc_xvd701_device::seek_chapter(int chapter) +{ + if (chapter <= 0) + { + // Chapters are from 1 and up + return false; + } + + m_chapter = chapter; + + if (m_playback_status != STATUS_PAUSE) + m_playback_status = STATUS_PLAYING; + + return true; +} + void jvc_xvd701_device::rcv_complete() { receive_register_extract(); @@ -110,39 +155,162 @@ if (m_command[0] == 0xff && m_command[1] == 0xff && - m_command[2] == 0x21 && - sum(m_command, sizeof(m_command)) == 0) + m_command[10] == sum(m_command, sizeof(m_command) - 1)) { - // printf("xvd701"); - - //for (int i = 0; i < sizeof(m_command); i++) - // printf(" %02x", m_command[i]); - - //printf("\n"); - - // FF FF 21 3E 40 70 00 00 00 00 73 DEVICE ON - // FF FF 21 3E 40 60 00 00 00 00 03 DEVICE OFF - // FF FF 21 0C 44 60 00 00 00 00 31 STOP - // FF FF 21 0C 43 75 00 00 00 00 1D PLAY - // FF FF 21 0C 43 6D 00 00 00 00 25 PAUSE - // FF FF 21 0C 50 20 00 00 00 00 63 SEEK TO SPECIFIC CHAPTER - // FF FF 21 0C 50 73 00 00 00 00 12 FF (SEEK TO NEXT CHAPTER) - // FF FF 21 0C 50 61 00 00 00 00 24 PREV (SEEK TO PREVIOUS CHAPTER) - - m_response[0] = 0xff; - m_response[1] = 0xfe; - m_response[2] = 0x7f; - m_response[3] = 0x7e; - m_response[4] = 0x7d; - m_response[5] = 0x7c; - m_response[6] = 0x7b; - m_response[7] = 0x7a; - m_response[8] = 0x79; - m_response[9] = 0x78; - m_response[10] = 0x77; - m_response_index = 0; - - m_timer_response->adjust(attotime::from_msec(100)); + if (m_command[3] == 0x0c && m_command[4] == 0x43 && m_command[5] == 0x6d) + { + // FF FF 21 0C 43 6D 00 00 00 00 25 PAUSE + LOGCMD("xvd701: Playback PAUSE\n"); + m_playback_status = STATUS_PAUSE; + create_packet(STATUS_OK, NO_RESPONSE); + } + else if (m_command[3] == 0x0c && m_command[4] == 0x43 && m_command[5] == 0x75) + { + // FF FF 21 0C 43 75 00 00 00 00 1D PLAY + LOGCMD("xvd701: Playback PLAY\n"); + + auto status = STATUS_OK; + if (m_playback_status == STATUS_STOP) + { + // Force video to load again if the video was stopped then started again + if (!seek_chapter(m_chapter)) + status = STATUS_ERROR; + } + + if (status == STATUS_OK) + m_playback_status = STATUS_PLAYING; + + create_packet(status, NO_RESPONSE); + } + else if (m_command[3] == 0x0c && m_command[4] == 0x44 && m_command[5] == 0x60) + { + // FF FF 21 0C 44 60 00 00 00 00 31 STOP + LOGCMD("xvd701: Playback STOP\n"); + + m_playback_status = STATUS_STOP; + create_packet(STATUS_OK, NO_RESPONSE); + } + else if (m_command[3] == 0x0c && m_command[4] == 0x50 && m_command[5] == 0x20) + { + // FF FF 21 0C 50 20 00 00 00 00 63 SEEK TO SPECIFIC CHAPTER + auto chapter = ((m_command[6] % 10) * 100) + ((m_command[7] % 10) * 10) + (m_command[8] % 10); + + if (m_media_type == JVC_MEDIA_VCD) + { + // VCD can only go to 99, so it sticks the data in the first two spots + chapter /= 10; + } + + auto status = seek_chapter(chapter); + LOGCMD("xvd701: Seek chapter %d -> %d\n", chapter, status); + create_packet(status ? STATUS_OK : STATUS_ERROR, NO_RESPONSE); + } + else if (m_command[3] == 0x0c && m_command[4] == 0x50 && m_command[5] == 0x61) + { + // FF FF 21 0C 50 61 00 00 00 00 24 PREV (SEEK TO PREVIOUS CHAPTER) + auto chapter = m_chapter - 1; + if (m_playback_status != STATUS_PLAYING && chapter == 0) + chapter = 1; + + auto status = seek_chapter(chapter); + LOGCMD("xvd701: Seek prev -> %d\n", status); + create_packet(status ? STATUS_OK : STATUS_ERROR, NO_RESPONSE); + } + else if (m_command[3] == 0x0c && m_command[4] == 0x50 && m_command[5] == 0x73) + { + // FF FF 21 0C 50 73 00 00 00 00 12 FF (SEEK TO NEXT CHAPTER) + auto status = seek_chapter(m_chapter + 1); + LOGCMD("xvd701: Seek FF -> %d\n", status); + create_packet(status ? STATUS_OK : STATUS_ERROR, NO_RESPONSE); + } + + else if (m_command[3] == 0x3e && m_command[4] == 0x40 && m_command[5] == 0x60) + { + // FF FF 21 3E 40 60 00 00 00 00 03 DEVICE OFF + LOGCMD("xvd701: Device OFF\n"); + + auto status = m_is_powered ? STATUS_OK : STATUS_ERROR; + if (m_is_powered) + m_is_powered = false; + + create_packet(status, NO_RESPONSE); + + } + else if (m_command[3] == 0x3e && m_command[4] == 0x40 && m_command[5] == 0x70) + { + // FF FF 21 3E 40 70 00 00 00 00 73 DEVICE ON + LOGCMD("xvd701: Device ON\n"); + + auto status = !m_is_powered ? STATUS_OK : STATUS_ERROR; + if (!m_is_powered) + m_is_powered = true; + + create_packet(status, NO_RESPONSE); + } + else if (m_command[3] == 0x3e && m_command[4] == 0x4e && m_command[5] == 0x20) + { + LOGCMD("xvd701: Device power status request\n"); + const unsigned char response[6] = { m_is_powered, 0x20, 0, 0, 0, 0 }; + create_packet(STATUS_OK, response); + } + else if (m_command[3] == 0x7c && m_command[4] == 0x41) + { + auto new_id = m_command[5]; + LOGCMD("xvd701: Change JLIP ID to %02x\n", new_id); + + if (new_id > 0 && new_id < 64) + { + m_jlip_id = new_id; + create_packet(STATUS_OK, NO_RESPONSE); + } + else + { + create_packet(STATUS_ERROR, NO_RESPONSE); + } + } + else if (m_command[3] == 0x7c && m_command[4] == 0x45 && m_command[5] == 0x00) + { + LOGCMD("xvd701: Machine code request\n"); + + const unsigned char response[6] = { 0x00, 0x01, 0x03, 0x00, 0x03, 0x01 }; + create_packet(STATUS_OK, response); + } + else if (m_command[3] == 0x7c && m_command[4] == 0x48 && m_command[5] == 0x20) + { + LOGCMD("xvd701: Baud rate request\n"); + + // Hardcoded to 9600 baud + const unsigned char response[6] = { 0x20, 0x00, 0x00, 0x00, 0x00, 0x00 }; + create_packet(STATUS_OK, response); + } + else if (m_command[3] == 0x7c && m_command[4] == 0x49 && m_command[5] == 0x00) + { + LOGCMD("xvd701: Device code request\n"); + + const unsigned char response[6] = { 0x03, 0x0C, 0x7F, 0x7F, 0x7F, 0x7F }; + create_packet(STATUS_OK, response); + } + else if (m_command[3] == 0x7c && m_command[4] == 0x4c && m_command[5] == 0x00) + { + LOGCMD("xvd701: Device name first half request\n"); + + const unsigned char response[6] = { 'D', 'V', 'D', ' ', 'P', 'L' }; + create_packet(STATUS_OK, response); + } + else if (m_command[3] == 0x7c && m_command[4] == 0x4d && m_command[5] == 0x00) + { + LOGCMD("xvd701: Device name last half request\n"); + + const unsigned char response[6] = { 'A', 'Y', 'E', 'R', 0x7F, 0x7F }; + create_packet(STATUS_OK, response); + } + else if (m_command[3] == 0x7c && m_command[4] == 0x4e && m_command[5] == 0x20) + { + LOGCMD("xvd701: NOP request\n"); + + const unsigned char response[6] = { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 }; + create_packet(STATUS_OK, response); + } } } diff -Nru mame-0.242+dfsg.1/src/devices/bus/rs232/xvd701.h mame-0.243+dfsg.1/src/devices/bus/rs232/xvd701.h --- mame-0.242+dfsg.1/src/devices/bus/rs232/xvd701.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/rs232/xvd701.h 2022-04-29 05:37:26.000000000 +0000 @@ -28,13 +28,45 @@ private: static constexpr int TIMER_RESPONSE = 1; + enum jvc_xvd701_media_type : uint32_t + { + JVC_MEDIA_VCD = 0, + JVC_MEDIA_DVD = 1, + }; + + enum jvc_xvd701_playback_status : uint32_t + { + STATUS_STOP = 0, + STATUS_PLAYING = 1, + STATUS_PAUSE = 2, + }; + void send_response(); unsigned char sum(unsigned char *buffer, int length); + void create_packet(unsigned char status, const unsigned char response[6]); + + bool seek_chapter(int chapter); + + jvc_xvd701_media_type m_media_type; unsigned char m_command[11]; unsigned char m_response[11]; int m_response_index; emu_timer *m_timer_response; + + jvc_xvd701_playback_status m_playback_status; + + unsigned char m_jlip_id; + bool m_is_powered; + + int m_chapter; + + enum : unsigned char { + STATUS_UNKNOWN_COMMAND = 1, + STATUS_OK = 3, + STATUS_ERROR = 5, + }; + const unsigned char NO_RESPONSE[6] = { 0 }; }; DECLARE_DEVICE_TYPE(JVC_XVD701, jvc_xvd701_device) diff -Nru mame-0.242+dfsg.1/src/devices/bus/scsi/omti5100.cpp mame-0.243+dfsg.1/src/devices/bus/scsi/omti5100.cpp --- mame-0.242+dfsg.1/src/devices/bus/scsi/omti5100.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/scsi/omti5100.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -54,7 +54,7 @@ m_transfer_length = 0; return; } - hard_disk_info *info = hard_disk_get_info(image); + const auto &info = image->get_info(); switch(command[0]) { case OMTI_READ_DATA_BUFFER: @@ -77,7 +77,7 @@ { int track = ((command[1]&0x1f)<<16 | command[2]<<8 | command[3]) / (m_param[drive].sectors ? m_param[drive].sectors : 1); int heads = m_param[drive].heads ? m_param[drive].heads : 1; - if(((track % heads) > info->heads) || (track >= (info->cylinders * heads))) + if(((track % heads) > info.heads) || (track >= (info.cylinders * heads))) { m_phase = SCSI_PHASE_STATUS; m_status_code = SCSI_STATUS_CODE_CHECK_CONDITION; @@ -94,15 +94,15 @@ case OMTI_FORMAT_TRACK: { int track = ((command[1]&0x1f)<<16 | command[2]<<8 | command[3]) / m_param[drive].sectors; - if(((track % m_param[drive].heads) <= info->heads) && (track < (info->cylinders * m_param[drive].heads))) + if(((track % m_param[drive].heads) <= info.heads) && (track < (info.cylinders * m_param[drive].heads))) { - std::vector sector(info->sectorbytes); - memset(§or[0], 0xe5, info->sectorbytes); + std::vector sector(info.sectorbytes); + memset(§or[0], 0xe5, info.sectorbytes); m_phase = SCSI_PHASE_STATUS; m_status_code = SCSI_STATUS_CODE_GOOD; m_transfer_length = 0; - for(int i = 0; i < info->sectors; i++) - hard_disk_write(image, track * info->sectors + i, §or[0]); + for(int i = 0; i < info.sectors; i++) + image->write(track * info.sectors + i, §or[0]); } else { @@ -149,7 +149,7 @@ m_param[drive].cylinders = ((data[4] << 8) | data[5]) + 1; if(!data[8] && image) { - switch(hard_disk_get_info(image)->sectorbytes) + switch(image->get_info().sectorbytes) { case 128: m_param[drive].sectors = 53; diff -Nru mame-0.242+dfsg.1/src/devices/bus/scsi/omti5100.h mame-0.243+dfsg.1/src/devices/bus/scsi/omti5100.h --- mame-0.242+dfsg.1/src/devices/bus/scsi/omti5100.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/scsi/omti5100.h 2022-04-29 05:37:26.000000000 +0000 @@ -24,7 +24,7 @@ private: required_device m_image0; required_device m_image1; - hard_disk_info m_param[2]; + hard_disk_file::info m_param[2]; }; DECLARE_DEVICE_TYPE(OMTI5100, omti5100_device) diff -Nru mame-0.242+dfsg.1/src/devices/bus/scsi/s1410.cpp mame-0.243+dfsg.1/src/devices/bus/scsi/s1410.cpp --- mame-0.242+dfsg.1/src/devices/bus/scsi/s1410.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/scsi/s1410.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -255,7 +255,7 @@ while (m_blocks > 0) { - if (!hard_disk_write(m_disk, m_lba, &data[0])) + if (!m_disk->write(m_lba, &data[0])) { logerror("S1410: HD write error!\n"); } diff -Nru mame-0.242+dfsg.1/src/devices/bus/sega8/rom.cpp mame-0.243+dfsg.1/src/devices/bus/sega8/rom.cpp --- mame-0.242+dfsg.1/src/devices/bus/sega8/rom.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/sega8/rom.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -40,6 +40,7 @@ DEFINE_DEVICE_TYPE(SEGA8_ROM_JANGGUN, sega8_janggun_device, "sega8_janggun", "SMS Janggun Cart") DEFINE_DEVICE_TYPE(SEGA8_ROM_HICOM, sega8_hicom_device, "sega8_hicom", "SMS Hi-Com Carts") DEFINE_DEVICE_TYPE(SEGA8_ROM_KOREAN, sega8_korean_device, "sega8_korean", "SMS Korean Carts") +DEFINE_DEVICE_TYPE(SEGA8_ROM_KOREAN_188, sega8_korean_188_device, "sega8_korean_188", "SMS Korean 188 in 1 Multicart") DEFINE_DEVICE_TYPE(SEGA8_ROM_KOREAN_NB, sega8_korean_nb_device, "sega8_korean_nb", "SMS Korean No-Bank Mapper Carts") DEFINE_DEVICE_TYPE(SEGA8_ROM_SEOJIN, sega8_seojin_device, "sega8_seojin", "SMS Seo Jin Multi-cart") DEFINE_DEVICE_TYPE(SEGA8_ROM_X_TERMINATOR, sega8_x_terminator_device, "sega8_x_terminator", "GG X-Terminator") @@ -178,6 +179,13 @@ } +sega8_korean_188_device::sega8_korean_188_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : sega8_rom_device(mconfig, SEGA8_ROM_KOREAN_188, tag, owner, clock) + , m_rom_bank_base(0) +{ +} + + sega8_korean_nb_device::sega8_korean_nb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sega8_rom_device(mconfig, SEGA8_ROM_KOREAN_NB, tag, owner, clock) { @@ -258,6 +266,7 @@ m_ram_enabled = 0; } + void sega8_4pak_device::device_start() { save_item(NAME(m_rom_bank_base)); @@ -285,6 +294,17 @@ } +void sega8_korean_188_device::device_start() +{ + save_item(NAME(m_rom_bank_base)); +} + +void sega8_korean_188_device::device_reset() +{ + m_rom_bank_base = 0; +} + + void sega8_multicart_device::device_start() { save_item(NAME(m_block)); @@ -990,6 +1010,36 @@ m_rom_bank_base[2] = data % m_rom_page_count; } + +/*------------------------------------------------- + + Korean Game 188 multicart, + writes to 0x2000 switch 8K banks at 0x4000-0xbfff + + TODO: figure out why menu #s 6, 13, etc don't load. + Add dumps of other compatible multicarts. + + -------------------------------------------------*/ + +u8 sega8_korean_188_device::read_cart(offs_t offset) +{ + if (offset < 0x4000) + return m_rom[offset]; + else + { + int bank = m_rom_bank_base ^ 0x1f; + bank %= m_rom_page_count * 2; + return m_rom[bank * 0x2000 + offset - 0x4000]; + } +} + +void sega8_korean_188_device::write_cart(offs_t offset, u8 data) +{ + if ((offset & 0x6000) == 0x2000) + m_rom_bank_base = data; +} + + /*------------------------------------------------- Seo Jin Multi-Carts diff -Nru mame-0.242+dfsg.1/src/devices/bus/sega8/rom.h mame-0.243+dfsg.1/src/devices/bus/sega8/rom.h --- mame-0.242+dfsg.1/src/devices/bus/sega8/rom.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/sega8/rom.h 2022-04-29 05:37:26.000000000 +0000 @@ -359,6 +359,28 @@ }; +// ======================> sega8_korean_188_device + +class sega8_korean_188_device : public sega8_rom_device +{ +public: + // construction/destruction + sega8_korean_188_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + + // reading and writing + virtual u8 read_cart(offs_t offset) override; + virtual void write_cart(offs_t offset, u8 data) override; + +protected: + // device-level overrides + virtual void device_start() override; + virtual void device_reset() override; + +private: + u8 m_rom_bank_base; +}; + + // ======================> sega8_korean_nb_device class sega8_korean_nb_device : public sega8_rom_device @@ -495,6 +517,7 @@ DECLARE_DEVICE_TYPE(SEGA8_ROM_JANGGUN, sega8_janggun_device) DECLARE_DEVICE_TYPE(SEGA8_ROM_HICOM, sega8_hicom_device) DECLARE_DEVICE_TYPE(SEGA8_ROM_KOREAN, sega8_korean_device) +DECLARE_DEVICE_TYPE(SEGA8_ROM_KOREAN_188, sega8_korean_188_device) DECLARE_DEVICE_TYPE(SEGA8_ROM_KOREAN_NB, sega8_korean_nb_device) DECLARE_DEVICE_TYPE(SEGA8_ROM_SEOJIN, sega8_seojin_device) DECLARE_DEVICE_TYPE(SEGA8_ROM_MULTICART, sega8_multicart_device) diff -Nru mame-0.242+dfsg.1/src/devices/bus/sega8/sega8_slot.cpp mame-0.243+dfsg.1/src/devices/bus/sega8/sega8_slot.cpp --- mame-0.242+dfsg.1/src/devices/bus/sega8/sega8_slot.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/sega8/sega8_slot.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -223,6 +223,7 @@ { SEGA8_NEMESIS, "nemesis" }, { SEGA8_JANGGUN, "janggun" }, { SEGA8_KOREAN, "korean" }, + { SEGA8_KOREAN_188IN1, "korean_188in1" }, { SEGA8_KOREAN_NOBANK, "korean_nb" }, { SEGA8_OTHELLO, "othello" }, { SEGA8_CASTLE, "castle" }, @@ -916,6 +917,7 @@ device.option_add_internal("janggun", SEGA8_ROM_JANGGUN); device.option_add_internal("hicom", SEGA8_ROM_HICOM); device.option_add_internal("korean", SEGA8_ROM_KOREAN); + device.option_add_internal("korean_188in1", SEGA8_ROM_KOREAN_188); device.option_add_internal("korean_nb", SEGA8_ROM_KOREAN_NB); device.option_add_internal("seojin", SEGA8_ROM_SEOJIN); device.option_add_internal("othello", SEGA8_ROM_OTHELLO); @@ -937,6 +939,7 @@ device.option_add_internal("janggun", SEGA8_ROM_JANGGUN); device.option_add_internal("hicom", SEGA8_ROM_HICOM); device.option_add_internal("korean", SEGA8_ROM_KOREAN); + device.option_add_internal("korean_188in1", SEGA8_ROM_KOREAN_188); device.option_add_internal("korean_nb", SEGA8_ROM_KOREAN_NB); } diff -Nru mame-0.242+dfsg.1/src/devices/bus/sega8/sega8_slot.h mame-0.243+dfsg.1/src/devices/bus/sega8/sega8_slot.h --- mame-0.242+dfsg.1/src/devices/bus/sega8/sega8_slot.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/sega8/sega8_slot.h 2022-04-29 05:37:26.000000000 +0000 @@ -25,6 +25,7 @@ SEGA8_NEMESIS, SEGA8_JANGGUN, SEGA8_KOREAN, + SEGA8_KOREAN_188IN1, SEGA8_KOREAN_NOBANK, SEGA8_OTHELLO, SEGA8_CASTLE, diff -Nru mame-0.242+dfsg.1/src/devices/bus/spectrum/beta128.cpp mame-0.243+dfsg.1/src/devices/bus/spectrum/beta128.cpp --- mame-0.242+dfsg.1/src/devices/bus/spectrum/beta128.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/spectrum/beta128.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -63,7 +63,7 @@ } //------------------------------------------------- -// floppy_format_type floppy_formats +// floppy_formats //------------------------------------------------- void spectrum_beta128_device::floppy_formats(format_registration &fr) diff -Nru mame-0.242+dfsg.1/src/devices/bus/spectrum/beta.cpp mame-0.243+dfsg.1/src/devices/bus/spectrum/beta.cpp --- mame-0.242+dfsg.1/src/devices/bus/spectrum/beta.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/spectrum/beta.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -121,7 +121,7 @@ } //------------------------------------------------- -// floppy_format_type floppy_formats +// floppy_formats //------------------------------------------------- void spectrum_betav2_device::floppy_formats(format_registration &fr) diff -Nru mame-0.242+dfsg.1/src/devices/bus/spectrum/floppyone.cpp mame-0.243+dfsg.1/src/devices/bus/spectrum/floppyone.cpp --- mame-0.242+dfsg.1/src/devices/bus/spectrum/floppyone.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/spectrum/floppyone.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -83,7 +83,7 @@ } //------------------------------------------------- -// floppy_format_type floppy_formats +// floppy_formats //------------------------------------------------- void spectrum_flpone_device::floppy_formats(format_registration &fr) diff -Nru mame-0.242+dfsg.1/src/devices/bus/spectrum/mgt.cpp mame-0.243+dfsg.1/src/devices/bus/spectrum/mgt.cpp --- mame-0.242+dfsg.1/src/devices/bus/spectrum/mgt.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/spectrum/mgt.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -227,7 +227,7 @@ } //------------------------------------------------- -// floppy_format_type floppy_formats +// floppy_formats //------------------------------------------------- void spectrum_plusd_device::floppy_formats(format_registration &fr) diff -Nru mame-0.242+dfsg.1/src/devices/bus/spectrum/sixword.cpp mame-0.243+dfsg.1/src/devices/bus/spectrum/sixword.cpp --- mame-0.242+dfsg.1/src/devices/bus/spectrum/sixword.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/spectrum/sixword.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -105,7 +105,7 @@ } //------------------------------------------------- -// floppy_format_type floppy_formats +// floppy_formats //------------------------------------------------- void spectrum_swiftdisc_device::floppy_formats(format_registration &fr) diff -Nru mame-0.242+dfsg.1/src/devices/bus/spectrum/speccydos.cpp mame-0.243+dfsg.1/src/devices/bus/spectrum/speccydos.cpp --- mame-0.242+dfsg.1/src/devices/bus/spectrum/speccydos.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/spectrum/speccydos.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -72,7 +72,7 @@ } //------------------------------------------------- -// floppy_format_type floppy_formats +// floppy_formats //------------------------------------------------- void spectrum_speccydos_device::floppy_formats(format_registration &fr) diff -Nru mame-0.242+dfsg.1/src/devices/bus/ti99/internal/998board.cpp mame-0.243+dfsg.1/src/devices/bus/ti99/internal/998board.cpp --- mame-0.242+dfsg.1/src/devices/bus/ti99/internal/998board.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/ti99/internal/998board.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -189,6 +189,7 @@ m_p3grom0(*owner, TI998_GLIB30_TAG), m_p3grom1(*owner, TI998_GLIB31_TAG), m_p3grom2(*owner, TI998_GLIB32_TAG), + m_tms9901(*owner, TI998_TMS9901_TAG), m_sgrom_idle(true), m_tsgrom_idle(true), m_p8grom_idle(true), @@ -383,6 +384,10 @@ m_logical_address = offset; m_physical_address = 0; + // Trigger the 9901's clock if S0=1 + if ((offset & 0x0020) != 0) + m_tms9901->update_clock(); + // In TI's bit order, A14 is the second line from the right side (2^1) m_A14_set = ((m_logical_address & 2)!=0); // Needed for clock_in diff -Nru mame-0.242+dfsg.1/src/devices/bus/ti99/internal/998board.h mame-0.243+dfsg.1/src/devices/bus/ti99/internal/998board.h --- mame-0.242+dfsg.1/src/devices/bus/ti99/internal/998board.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/ti99/internal/998board.h 2022-04-29 05:37:26.000000000 +0000 @@ -24,6 +24,7 @@ #include "bus/ti99/internal/ioport.h" #include "machine/ram.h" #include "machine/tmc0430.h" +#include "machine/tms9901.h" #include "sound/sn76496.h" #include "sound/tms5220.h" #include "video/tms9928a.h" @@ -685,6 +686,9 @@ required_device m_p3grom1; required_device m_p3grom2; + // Link to the 9901 + required_device m_tms9901; + // Idle flags for GROMs bool m_sgrom_idle = true; bool m_tsgrom_idle = true; diff -Nru mame-0.242+dfsg.1/src/devices/bus/ti99/internal/datamux.cpp mame-0.243+dfsg.1/src/devices/bus/ti99/internal/datamux.cpp --- mame-0.242+dfsg.1/src/devices/bus/ti99/internal/datamux.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/ti99/internal/datamux.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -101,6 +101,7 @@ m_grom0(*owner, TI99_GROM0_TAG), m_grom1(*owner, TI99_GROM1_TAG), m_grom2(*owner, TI99_GROM2_TAG), + m_tms9901(*owner, TI99_TMS9901_TAG), m_ready(*this), m_addr_buf(0), m_dbin(CLEAR_LINE), @@ -436,6 +437,10 @@ LOGMASKED(LOG_ADDRESS, "Set address %04x\n", m_addr_buf); + // Trigger the TMS9901 clock when A10 is 1 + if ((m_addr_buf & 0x0020) != 0) + m_tms9901->update_clock(); + if ((m_addr_buf & 0xe000) == 0x0000) { return; // console ROM diff -Nru mame-0.242+dfsg.1/src/devices/bus/ti99/internal/datamux.h mame-0.243+dfsg.1/src/devices/bus/ti99/internal/datamux.h --- mame-0.242+dfsg.1/src/devices/bus/ti99/internal/datamux.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/ti99/internal/datamux.h 2022-04-29 05:37:26.000000000 +0000 @@ -22,6 +22,7 @@ #include "sound/sn76496.h" #include "video/tms9928a.h" #include "machine/ram.h" +#include "machine/tms9901.h" #define TI99_DATAMUX_TAG "datamux_16_8" #define TI99_GROM0_TAG "console_grom_0" @@ -32,6 +33,7 @@ #define TI99_CONSOLEROM "console_rom" #define TI99_SOUNDCHIP_TAG "soundchip" #define TI99_VDP_TAG "vdp" +#define TI99_TMS9901_TAG "tms9901" namespace bus::ti99::internal { @@ -91,6 +93,9 @@ required_device m_grom1; required_device m_grom2; + // Link to 9901 + required_device m_tms9901; + // Common read routine void read_all(uint16_t addr, uint8_t *target); diff -Nru mame-0.242+dfsg.1/src/devices/bus/ti99/peb/tipi.cpp mame-0.243+dfsg.1/src/devices/bus/ti99/peb/tipi.cpp --- mame-0.242+dfsg.1/src/devices/bus/ti99/peb/tipi.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/ti99/peb/tipi.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -58,6 +58,12 @@ the mouse operations can be polled from the Raspberry in the intended way. + Logging + ------- + Since we use a background thread for the websocket client, and logging + is not thread-safe, log output may look broken at some times. + + Michael Zapf March 20222 @@ -65,8 +71,6 @@ [1] TIPI description on Github: https://github.com/jedimatt42/tipi - TODO: Add ASYNC mode - *****************************************************************************/ #include "emu.h" @@ -78,6 +82,8 @@ #define LOG_PORTS (1U<<4) #define LOG_CONFIG (1U<<5) #define LOG_RPI (1U<<6) +#define LOG_QUEUE (1U<<7) +#define LOG_PROT (1U<<8) #define VERBOSE ( LOG_GENERAL | LOG_WARN | LOG_CONFIG ) #define RASPI "rpi" @@ -95,7 +101,11 @@ m_rpi(*this, RASPI), m_address(0), m_dsr(false), - m_portaccess(false) + m_portaccess(false), + m_waitinit(false), + m_rpiconn(false), + m_tc(0), + m_lasttc(0) { } @@ -124,7 +134,7 @@ if (m_dsr) { // Lines A0-A12 directly connected to the EPROM (chip pin order) - // Lines A13-A15 connected to PLD + // Lines A13-A15 connected to PLD (currently not used) int base = 0; uint8_t* rom = &m_eprom[base | (m_address & 0x1fff)]; *value = *rom; @@ -145,7 +155,8 @@ int val = 0; if (m_address & 2) { - val = m_rd; + val = m_indqueue.front(); + m_indqueue.pop(); LOGMASKED(LOG_PORTS, "RDIN -> %02x\n", val); } else @@ -199,6 +210,7 @@ if (m_tc != data) { m_tc = data; + m_lasttc = 0; process_message(); } } @@ -208,6 +220,15 @@ */ void tipi_card_device::debug_read(offs_t offset, uint8_t* value) { + int base = 0; + if (in_dsr_space(offset, true) && m_selected) + { + if ((offset & 0x1ff8)!=0x1ff8) // not in mapping area + { + uint8_t* rom = &m_eprom[base | (offset & 0x1fff)]; + *value = *rom; + } + } } /* @@ -215,6 +236,7 @@ */ void tipi_card_device::debug_write(offs_t offset, uint8_t data) { + // No write allowed } /* @@ -222,6 +244,7 @@ */ void tipi_card_device::crureadz(offs_t offset, uint8_t *value) { + // No CRU read } /* @@ -251,18 +274,24 @@ void tipi_card_device::send(const char* message) { - *m_send_stream << message; - m_wsclient->send(m_send_stream); + if (m_rpiconn) + { + *m_send_stream << message; + m_wsclient->send(m_send_stream); + } } void tipi_card_device::send(u8* message, int len) { - for (int i=0; i < len; i++) + if (m_rpiconn) { - LOGMASKED(LOG_RPI, "Sending byte %02x\n", message[i]); - *m_send_stream << message[i]; + for (int i=0; i < len; i++) + { + LOGMASKED(LOG_RPI, "Sending byte %02x\n", message[i]); + *m_send_stream << message[i]; + } + m_wsclient->send(m_send_stream, nullptr, 130); // binary (10000010) } - m_wsclient->send(m_send_stream, nullptr, 130); // binary (10000010) } enum @@ -310,60 +339,61 @@ { if (m_tc == TSRSET) // Reset command { + LOGMASKED(LOG_PROT, "Reset\n"); m_rpimessage = nullptr; m_msgindex = -2; m_rc = m_tc; - send("SYNC"); + m_lasttc = 0; + + if (m_syncmode) + { + LOGMASKED(LOG_PROT, "Sending SYNC\n"); + send("SYNC"); // only for SYNC mode + } } else { - if ((m_tc & 0xfe) == TSWB) // 02 and 03: write byte (LSB as strobe) + if (m_lasttc != m_tc) { - if (m_msgindex == -2) - m_msglength = m_td << 8; - else + if ((m_tc & 0xfe) == TSWB) // 02 and 03: write byte (LSB as strobe) { - if (m_msgindex == -1) + switch (m_msgindex) { + case -2: + m_msglength = m_td << 8; + break; + case -1: m_msglength |= m_td; m_rpimessage = std::make_unique(m_msglength); - } - else - { + break; + default: if (m_rpimessage != nullptr) m_rpimessage[m_msgindex] = m_td; } - } - m_msgindex++; - if (m_msgindex == m_msglength) - { - // Message is complete - transmit it - LOGMASKED(LOG_RPI, "Sending message, length %d\n", m_msglength); - send(m_rpimessage.get(), m_msglength); - m_rpimessage = nullptr; + m_msgindex++; + + if (m_msgindex == m_msglength) + { + // Message is complete - transmit it + LOGMASKED(LOG_RPI, "Sending message, length %d\n", m_msglength); + send(m_rpimessage.get(), m_msglength); + m_rpimessage = nullptr; + } + else + m_lasttc = m_tc; + + m_rc = m_tc; // Auto-acknowledge } - m_rc = m_tc; // Auto-acknowledge - } - else - { - if ((m_tc & 0xfe) == TSRB) // 06 and 07: read byte (LSB as strobe) + else { - if (m_rpimessage != nullptr) + if ((m_tc & 0xfe) == TSRB) // 06 and 07: read byte (LSB as strobe) { - if (m_msgindex == -2) - m_rd = (m_msglength >> 8)& 0xff; - else + if (!m_indqueue.empty()) { - if (m_msgindex == -1) - m_rd = m_msglength & 0xff; - else - { - m_rd = m_rpimessage[m_msgindex]; - } + m_rc = m_tc; // Auto-acknowledge + m_lasttc = m_tc; } - m_msgindex++; - m_rc = m_tc; // Auto-acknowledge } } } @@ -378,7 +408,7 @@ */ void tipi_card_device::open_websocket() { - if (m_rpi->exists()) + if (m_rpiconn) { // We are just interested in the file name // Cannot call it "socket.xxx" because this will make sdlsocket open @@ -394,7 +424,7 @@ shost += "/tipi"; - LOGMASKED(LOG_CONFIG, "Connection to Raspberry Pi at %s\n", shost.c_str()); + LOG("Trying to connect to Raspberry Pi at %s\n", shost.c_str()); m_wsclient = std::make_unique(shost); webpp::ws_client* wsc = m_wsclient.get(); @@ -422,14 +452,15 @@ else fatalerror("Invalid TIPI connection address. Syntax: -conn rpi.[:]\n"); } - else - LOGMASKED(LOG_CONFIG, "No Raspberry Pi connected\n"); } void tipi_card_device::websocket_opened() { - LOGMASKED(LOG_RPI, "Opening connection\n"); + LOG("Connection established\n"); m_connected = true; + m_rc = 0; + + if (m_waitinit) m_slot->set_ready(ASSERT_LINE); } void tipi_card_device::websocket_incoming(std::shared_ptr message) @@ -441,7 +472,7 @@ LOGMASKED(LOG_RPI, "Got text message: %s\n", message->string()); if (message->string().find("RD=")==0) { - m_rd = std::stoi(message->string().substr(3)); + m_indqueue.push(std::stoi(message->string().substr(3))); } if (message->string().find("RC=")==0) { @@ -451,12 +482,25 @@ case 2: LOGMASKED(LOG_RPI, "Got binary message, length %d\n", message->size()); - m_rpimessage = std::make_unique(message->size()); + // Enqueue the incoming message + // as n1 n2 msg, where n1 and n2 are the length of the message, + // and msg is the byte sequence of the message. + { + u8 len1 = (message->size()>>8) & 0xff; + u8 len2 = message->size() & 0xff; + m_indqueue.push(len1); + LOGMASKED(LOG_QUEUE, "<- %02x (len1) [%d]\n", len1, m_indqueue.size()); + m_indqueue.push(len2); + LOGMASKED(LOG_QUEUE, "<- %02x (len2) [%d]\n", len2, m_indqueue.size()); + } + for (int i=0; i < message->size(); i++) - m_rpimessage[i] = (u8)message->get(); + { + u8 msgbyte = (u8)message->get(); + m_indqueue.push(msgbyte); + LOGMASKED(LOG_QUEUE, "<- %02x [%d]\n", msgbyte, m_indqueue.size()); + } - m_msglength = message->size(); - m_msgindex = -2; process_message(); break; @@ -474,18 +518,24 @@ if (m_attempts > 0) { m_attempts--; - LOGMASKED(LOG_CONFIG, "Error, connection reset. Retrying.\n"); - m_restart_timer->adjust(attotime::from_msec(1000)); + LOGMASKED(LOG_WARN, "Error, connection reset. Retrying.\n"); + m_restart_timer->adjust(attotime::from_msec(2500)); } else { - LOGMASKED(LOG_CONFIG, "Connection is reset on setup several times; giving up\n"); + LOGMASKED(LOG_WARN, "Connection has been reset several times; giving up\n"); m_connected = false; } } else { - LOGMASKED(LOG_RPI, "Got error: %s (%d)\n", code.message().c_str(), code.value()); + // End-of-file (2) occurs when the Pi is rebooted + LOGMASKED(LOG_WARN, "Got error: %s (%d)\n", code.message().c_str(), code.value()); + // Reconnection is not implemented on the Pi side for emulations, + // so this may cause the config program to wait forever + // Needs to be documented + m_restart_timer->adjust(attotime::from_msec(20000)); + m_attempts = 20; } } @@ -500,10 +550,12 @@ void tipi_card_device::websocket_closed(int i, const std::string& msg) { - LOGMASKED(LOG_RPI, "Closing connection\n"); - // Open it again after 2 secs + LOG("Closing connection\n"); + if (m_waitinit) m_slot->set_ready(CLEAR_LINE); + // Open it again after 3 secs m_wsclient->stop(); m_restart_timer->adjust(attotime::from_msec(3000)); + m_attempts = 5; } void tipi_card_device::device_start() @@ -519,20 +571,33 @@ save_item(NAME(m_tc)); save_item(NAME(m_td)); save_item(NAME(m_rc)); - save_item(NAME(m_rd)); + save_item(NAME(m_lasttc)); m_restart_timer = timer_alloc(0); - m_attempts = 5; + m_rpiconn = (m_rpi->exists()); } void tipi_card_device::device_reset() { m_cru_base = (ioport("SW1")->read()) << 8; + m_waitinit = (ioport("WAIT")->read()!=0); + m_syncmode = (ioport("MODE")->read()!=0); m_address = 0; m_dsr = false; m_portaccess = false; + if (!m_rpiconn) LOGMASKED(LOG_CONFIG, "No Raspberry Pi connected\n"); open_websocket(); m_connected = false; + m_lasttc = 0; + m_attempts = 5; +} + +void tipi_card_device::device_stop() +{ + // MZ: Without this I'm getting segfaults/list corruption + // when leaving the emulation + m_wsclient = NULL; + LOG("Stopping TIPI\n"); } /* @@ -540,7 +605,7 @@ */ INPUT_PORTS_START( tipi ) PORT_START("SW1") - PORT_DIPNAME(0x1f, 0x10, "TIPI card CRU base") + PORT_DIPNAME(0x1f, 0x10, "CRU base") PORT_DIPSETTING(0x10, "1000") // Default setting PORT_DIPSETTING(0x11, "1100") PORT_DIPSETTING(0x12, "1200") @@ -557,6 +622,15 @@ PORT_DIPSETTING(0x1d, "1d00") PORT_DIPSETTING(0x1e, "1e00") PORT_DIPSETTING(0x1f, "1f00") + PORT_START("WAIT") + PORT_CONFNAME(0x01, 0x00, "Wait for initialization") + PORT_CONFSETTING( 0x00, DEF_STR( Off ) ) + PORT_CONFSETTING( 0x01, DEF_STR( On ) ) + PORT_START("MODE") + PORT_CONFNAME(0x01, 0x00, "Transfer mode") + PORT_CONFSETTING( 0x00, "async" ) + PORT_CONFSETTING( 0x01, "sync" ) + INPUT_PORTS_END void tipi_card_device::device_add_mconfig(machine_config &config) diff -Nru mame-0.242+dfsg.1/src/devices/bus/ti99/peb/tipi.h mame-0.243+dfsg.1/src/devices/bus/ti99/peb/tipi.h --- mame-0.242+dfsg.1/src/devices/bus/ti99/peb/tipi.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/ti99/peb/tipi.h 2022-04-29 05:37:26.000000000 +0000 @@ -18,6 +18,8 @@ #include "peribox.h" #include "client_ws.hpp" +#include + namespace bus::ti99::peb { class tipi_attached_device; @@ -37,6 +39,7 @@ private: void device_start() override; void device_reset() override; + void device_stop() override; ioport_constructor device_input_ports() const override; const tiny_rom_entry *device_rom_region() const override; void device_add_mconfig(machine_config &config) override; @@ -62,6 +65,8 @@ int m_address; bool m_dsr; bool m_portaccess; + bool m_waitinit; + bool m_syncmode; // DSR ROM uint8_t* m_eprom; @@ -75,12 +80,17 @@ emu_timer* m_restart_timer; int m_attempts; bool m_connected; + bool m_rpiconn; + + // Incoming queue + std::queue m_indqueue; // Computer interface u8 m_tc; u8 m_td; u8 m_rc; - u8 m_rd; + + u8 m_lasttc; }; /* diff -Nru mame-0.242+dfsg.1/src/devices/bus/ti99x/990_hd.cpp mame-0.243+dfsg.1/src/devices/bus/ti99x/990_hd.cpp --- mame-0.242+dfsg.1/src/devices/bus/ti99x/990_hd.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/ti99x/990_hd.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -175,18 +175,16 @@ if ( hd_file ) { - const hard_disk_info *standard_header; - d->format = format_mame; d->hd_handle = hd_file; /* use standard hard disk image header. */ - standard_header = hard_disk_get_info(d->hd_handle); + const auto &standard_header = d->hd_handle->get_info(); - d->cylinders = standard_header->cylinders; - d->heads = standard_header->heads; - d->sectors_per_track = standard_header->sectors; - d->bytes_per_sector = standard_header->sectorbytes; + d->cylinders = standard_header.cylinders; + d->heads = standard_header.heads; + d->sectors_per_track = standard_header.sectors; + d->bytes_per_sector = standard_header.sectorbytes; } else { @@ -365,7 +363,7 @@ switch (m_d[unit].format) { case format_mame: - bytes_read = m_d[unit].bytes_per_sector * hard_disk_read(m_d[unit].hd_handle, lba, buffer); + bytes_read = m_d[unit].bytes_per_sector * m_d[unit].hd_handle->read(lba, buffer); if (bytes_read > bytes_to_read) bytes_read = bytes_to_read; break; @@ -395,7 +393,7 @@ switch (m_d[unit].format) { case format_mame: - bytes_written = m_d[unit].bytes_per_sector * hard_disk_write(m_d[unit].hd_handle, lba, buffer); + bytes_written = m_d[unit].bytes_per_sector * m_d[unit].hd_handle->write(lba, buffer); if (bytes_written > bytes_to_write) bytes_written = bytes_to_write; break; diff -Nru mame-0.242+dfsg.1/src/devices/bus/vme/vme_fccpu20.cpp mame-0.243+dfsg.1/src/devices/bus/vme/vme_fccpu20.cpp --- mame-0.242+dfsg.1/src/devices/bus/vme/vme_fccpu20.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/vme/vme_fccpu20.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -438,6 +438,11 @@ LOG("%s %s\n", tag, FUNCNAME); } +enum +{ + TIMER_ID_BUS_GRANT +}; + /* Start it up */ void vme_fccpu20_device::device_start() { @@ -460,19 +465,14 @@ m_vme->install_device(base + 2, base + 3, // Channel B - Control read8_delegate(*subdevice("pit"), FUNC(z80sio_device::cb_r)), write8_delegate(*subdevice("pit"), FUNC(z80sio_device::cb_w)), 0x00ff); #endif + m_arbiter_start = timer_alloc(TIMER_ID_BUS_GRANT); } -enum -{ - TIMER_ID_BUS_GRANT -}; - void vme_fccpu20_device::device_reset() { LOG("%s\n", FUNCNAME); /* We need to delay the static bus grant signal until we have it from the VME interface or MAME supports bus arbitration */ - m_arbiter_start = timer_alloc(TIMER_ID_BUS_GRANT); m_arbiter_start->adjust(attotime::from_msec(10), TIMER_ID_BUS_GRANT, attotime::never); } diff -Nru mame-0.242+dfsg.1/src/devices/bus/vme/vme_smvme2000.cpp mame-0.243+dfsg.1/src/devices/bus/vme/vme_smvme2000.cpp --- mame-0.242+dfsg.1/src/devices/bus/vme/vme_smvme2000.cpp 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/vme/vme_smvme2000.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,138 @@ +// license:BSD-3-Clause +// copyright-holders:Patrick Mackinlay + +/* + * Signetics SMVME2000 VMEbus CPU Module + * + * Probably also sold as the Motorola MVME115M with different firmware, 68010 and MMU. + * + * Sources: + * - http://bitsavers.org/components/signetics/_dataBooks/1986_Signetics_Microprocessor.pdf + * + * TODO: + * - interrupts and configuration + * - VME interface + * - MMU + */ + +#include "emu.h" +#include "vme_smvme2000.h" + +#define VERBOSE 0 +#include "logmacro.h" + +DEFINE_DEVICE_TYPE(VME_SMVME2000, vme_smvme2000_device, "smvme2000", "Signetics SMVME2000") + +vme_smvme2000_device::vme_smvme2000_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) + : device_t(mconfig, VME_SMVME2000, tag, owner, clock) + , device_vme_card_interface(mconfig, *this) + , m_cpu(*this, "cpu") + //, m_mmu(*this, "mmu") + , m_duart(*this, "duart") + , m_pit(*this, "pit") + , m_serial(*this, "serial%u", 0U) + , m_fail(*this, "fail") + , m_eprom(*this, "eprom") + , m_ram(*this, "ram") +{ +} + +ROM_START(smvme2000) + ROM_REGION16_BE(0x10000, "eprom", 0) + ROM_SYSTEM_BIOS(0, "v11", "SIGbug Version 1.1 Copyright 1983 Signetics") + ROMX_LOAD("sigbug__1.bin", 0x0000, 0x4000, CRC(ae23c2c3) SHA1(da422ca03ac77d9aed2067f1099ec0fb96939fc8), ROM_SKIP(1) | ROM_BIOS(0)) + ROMX_LOAD("sigbug__2.bin", 0x0001, 0x4000, CRC(e39bd1db) SHA1(2f610170f118c74477f4586e19aee0fc63803e17), ROM_SKIP(1) | ROM_BIOS(0)) + ROMX_LOAD("sigbug__3.bin", 0x8000, 0x4000, CRC(182998ef) SHA1(ecf980b7dd8bd0286f002b31cd726798f84a2267), ROM_SKIP(1) | ROM_BIOS(0)) + ROMX_LOAD("sigbug__4.bin", 0x8001, 0x4000, CRC(f0e25380) SHA1(78427f7b9a6f676945c2cdb90632a16a619c83f9), ROM_SKIP(1) | ROM_BIOS(0)) +ROM_END + +static INPUT_PORTS_START(smvme2000) +INPUT_PORTS_END + +const tiny_rom_entry *vme_smvme2000_device::device_rom_region() const +{ + return ROM_NAME(smvme2000); +} + +ioport_constructor vme_smvme2000_device::device_input_ports() const +{ + return INPUT_PORTS_NAME(smvme2000); +} + +void vme_smvme2000_device::device_start() +{ + m_fail.resolve(); +} + +void vme_smvme2000_device::device_reset() +{ + /* + * FIXME: EPROM is mapped at the start of memory during reset to allow the + * CPU to fetch the stack pointer and initial PC. The exact mechanism used + * is unknown; current emulation unmaps the EPROM and maps RAM when the last + * two bytes of the reset vector are fetched. + */ + m_cpu->space(AS_PROGRAM).install_rom(0, m_eprom.bytes() - 1, m_eprom.target()); + + m_boot = m_cpu->space(AS_PROGRAM).install_read_tap(0x000006, 0x000007, "boot", + [this](offs_t offset, u16 &data, u16 mem_mask) + { + if (!machine().side_effects_disabled()) + { + m_cpu->space(AS_PROGRAM).unmap_readwrite(0, m_eprom.bytes() - 1); + m_cpu->space(AS_PROGRAM).install_ram(0, m_ram.bytes() - 1, m_ram.target()); + + m_boot.remove(); + } + }); +} + +void vme_smvme2000_device::device_add_mconfig(machine_config &config) +{ + M68000(config, m_cpu, 16_MHz_XTAL / 2); + m_cpu->set_addrmap(AS_PROGRAM, &vme_smvme2000_device::cpu_mem); + m_cpu->set_addrmap(m68000_base_device::AS_CPU_SPACE, &vme_smvme2000_device::cpu_int); + + SCN2681(config, m_duart, 3.6864_MHz_XTAL); + m_duart->irq_cb().set(m_pit, FUNC(pit68230_device::h3_w)); // TODO: verify destination + + PIT68230(config, m_pit, 0); + m_pit->pc_out_callback().set( + [this](u8 data) + { + m_fail = BIT(data, 4); + }); + m_pit->port_irq_callback().set_inputline(m_cpu, M68K_IRQ_5); // TODO: verify destination + + RS232_PORT(config, m_serial[0], default_rs232_devices, nullptr); + RS232_PORT(config, m_serial[1], default_rs232_devices, nullptr); + + // TODO: dsr, dtr + m_duart->a_tx_cb().set(m_serial[0], FUNC(rs232_port_device::write_txd)); + m_duart->b_tx_cb().set(m_serial[1], FUNC(rs232_port_device::write_txd)); + m_serial[0]->rxd_handler().set(m_duart, FUNC(scn2681_device::rx_a_w)); + m_serial[1]->rxd_handler().set(m_duart, FUNC(scn2681_device::rx_b_w)); +} + +void vme_smvme2000_device::cpu_mem(address_map &map) +{ + map(0x000000, 0x000fff).ram().share("ram"); + + //map(0x010000, 0xf6ffff); // VMEbus memory address space + map(0xf70000, 0xf7ffff).rom().region("eprom", 0); + //map(0xf80000, 0xf8003f); // MMU + map(0xf81000, 0xf8103f).rw(m_pit, FUNC(pit68230_device::read), FUNC(pit68230_device::write)).umask16(0x00ff); + map(0xf82000, 0xf8201f).rw(m_duart, FUNC(scn2681_device::read), FUNC(scn2681_device::write)).umask16(0x00ff); + //map(0xf90000, 0xf9ffff).mirror(0x060000); // VMEbus short I/O space +} + +void vme_smvme2000_device::cpu_int(address_map &map) +{ + map(0xfffff3, 0xfffff3).lr8(NAME([]() { return m68000_base_device::autovector(1); })); + map(0xfffff5, 0xfffff5).lr8(NAME([]() { return m68000_base_device::autovector(2); })); + map(0xfffff7, 0xfffff7).lr8(NAME([]() { return m68000_base_device::autovector(3); })); + map(0xfffff9, 0xfffff9).lr8(NAME([]() { return m68000_base_device::autovector(4); })); + map(0xfffffb, 0xfffffb).lr8(NAME([]() { return m68000_base_device::autovector(5); })); // TODO: m_pit->irq_piack()? + map(0xfffffd, 0xfffffd).lr8(NAME([]() { return m68000_base_device::autovector(6); })); + map(0xffffff, 0xffffff).lr8(NAME([]() { return m68000_base_device::autovector(7); })); +} diff -Nru mame-0.242+dfsg.1/src/devices/bus/vme/vme_smvme2000.h mame-0.243+dfsg.1/src/devices/bus/vme/vme_smvme2000.h --- mame-0.242+dfsg.1/src/devices/bus/vme/vme_smvme2000.h 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/bus/vme/vme_smvme2000.h 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,54 @@ +// license:BSD-3-Clause +// copyright-holders:Patrick Mackinlay + +#ifndef MAME_BUS_VME_SMVME2000_H +#define MAME_BUS_VME_SMVME2000_H + +#pragma once + +#include "bus/vme/vme.h" + +#include "cpu/m68000/m68000.h" +//#include "machine/m68451.h" +#include "machine/mc68681.h" +#include "machine/68230pit.h" + +#include "bus/rs232/rs232.h" + +class vme_smvme2000_device + : public device_t + , public device_vme_card_interface +{ +public: + vme_smvme2000_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock); + +protected: + // device_t overrides + virtual const tiny_rom_entry *device_rom_region() const override; + virtual void device_add_mconfig(machine_config &config) override; + virtual ioport_constructor device_input_ports() const override; + virtual void device_start() override; + virtual void device_reset() override; + +private: + void cpu_mem(address_map &map); + void cpu_int(address_map &map); + + required_device m_cpu; + //optional_device m_mmu; + required_device m_duart; + required_device m_pit; + + required_device_array m_serial; + + output_finder<> m_fail; + + required_region_ptr m_eprom; + required_shared_ptr m_ram; + + memory_passthrough_handler m_boot; +}; + +DECLARE_DEVICE_TYPE(VME_SMVME2000, vme_smvme2000_device) + +#endif // MAME_BUS_VME_SMVME2000_H diff -Nru mame-0.242+dfsg.1/src/devices/cpu/8x300/8x300.cpp mame-0.243+dfsg.1/src/devices/cpu/8x300/8x300.cpp --- mame-0.242+dfsg.1/src/devices/cpu/8x300/8x300.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/8x300/8x300.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -12,7 +12,6 @@ #include "emu.h" #include "8x300.h" #include "8x300dasm.h" -#include "debugger.h" #define FETCHOP(a) (m_cache.read_word(a)) #define CYCLES(x) do { m_icount -= (x); } while (0) @@ -47,6 +46,11 @@ , m_program_config("program", ENDIANNESS_BIG, 16, 13, -1) , m_io_config("io", ENDIANNESS_BIG, 8, 9, 0) , m_sc_callback(*this) + , m_wc_callback(*this) + , m_lb_callback(*this) + , m_rb_callback(*this) + , m_mclk_callback(*this) + , m_iv_callback(*this) { } @@ -68,15 +72,49 @@ }; } -void n8x300_cpu_device::xmit_lb(uint8_t dst, uint8_t mask) +void n8x300_cpu_device::xmit_lb(uint8_t dst, uint8_t mask, bool with_sc, bool with_wc) { m_IV_latch = (m_IV_latch & ~mask) | (dst & mask); + + if(with_sc) + { + m_sc_callback(1); + m_wc_callback(0); + m_lb_callback(1); + m_iv_callback(m_IVL); + } + + if(with_wc) + { + m_sc_callback(0); + m_wc_callback(1); + m_lb_callback(1); + m_iv_callback(m_IV_latch); + } + WRITEPORT(m_IVL, m_IV_latch); } -void n8x300_cpu_device::xmit_rb(uint8_t dst, uint8_t mask) +void n8x300_cpu_device::xmit_rb(uint8_t dst, uint8_t mask, bool with_sc, bool with_wc) { m_IV_latch = (m_IV_latch & ~mask) | (dst & mask); + + if(with_sc) + { + m_sc_callback(1); + m_wc_callback(0); + m_rb_callback(1); + m_iv_callback(m_IVL); + } + + if(with_wc) + { + m_sc_callback(0); + m_wc_callback(1); + m_rb_callback(1); + m_iv_callback(m_IV_latch); + } + WRITEPORT(m_IVR + 0x100, m_IV_latch); } @@ -91,11 +129,11 @@ case 0x04: m_R4 = val; break; case 0x05: m_R5 = val; break; case 0x06: m_R6 = val; break; - case 0x07: m_IVL = val; m_sc_callback(0, val); break; + case 0x07: m_IVL = val; xmit_lb(val, 0xFF, true, false); break; // OVF is read-only case 0x09: m_R11 = val; break; - case 0x0f: m_IVR = val; m_sc_callback(1, val); break; - default: logerror("8X300: Invalid register %02x written to.\n",reg); break; + case 0x0f: m_IVR = val; xmit_rb(val, 0xFF, true, false); break; + default: logerror("8X300: Tried to write to invalid register %02x.\n",reg); break; } } @@ -103,8 +141,8 @@ { switch (reg) { - case 0x0a: if (xmit) xmit_lb(val, 0xff); else m_R12 = val; break; - case 0x0b: if (xmit) xmit_rb(val, 0xff); else m_R13 = val; break; + case 0x0a: if (xmit) xmit_lb(val, 0xff, true, true); else m_R12 = val; break; + case 0x0b: if (xmit) xmit_rb(val, 0xff, true, true); else m_R13 = val; break; case 0x0c: m_R14 = val; break; case 0x0d: m_R15 = val; break; case 0x0e: m_R16 = val; break; @@ -149,6 +187,11 @@ void n8x300_cpu_device::device_resolve_objects() { m_sc_callback.resolve_safe(); + m_wc_callback.resolve_safe(); + m_lb_callback.resolve_safe(); + m_rb_callback.resolve_safe(); + m_mclk_callback.resolve_safe(); + m_iv_callback.resolve_safe(); } void n8x300_cpu_device::device_start() @@ -271,6 +314,10 @@ m_AR = 0; m_genPC = 0; m_increment_pc = true; + + m_lb_callback(0); + m_rb_callback(0); + m_mclk_callback(0); } void n8x300_cpu_device::execute_run() @@ -282,12 +329,21 @@ uint8_t dst; uint8_t rotlen; // rotate amount or I/O field length uint8_t mask; + bool with_sc; + bool with_wc; /* fetch the opcode */ m_genPC = m_AR; debugger_instruction_hook(m_genPC); opcode = FETCHOP(m_genPC); + /* reset I/O lines for this instruction */ + m_lb_callback(0); + m_rb_callback(0); + m_sc_callback(0); + m_wc_callback(0); + m_mclk_callback(0); + if (m_increment_pc) { m_PC++; @@ -322,9 +378,9 @@ src = (get_reg(SRC)) << (7-DST_LSB); mask <<= (7-DST_LSB); if(DST_IS_RIGHT_BANK) - xmit_rb(src, mask); + xmit_rb(src, mask, false, true); else - xmit_lb(src, mask); + xmit_lb(src, mask, false, true); } else if(!(is_src_reg(opcode)) && is_dst_reg(opcode)) { // MOVE IV,reg @@ -343,9 +399,9 @@ dst <<= (7-DST_LSB); mask <<= (7-DST_LSB); if(DST_IS_RIGHT_BANK) // untouched source IV bits are preserved and sent to destination IV - xmit_rb(dst, mask); + xmit_rb(dst, mask, false, true); else - xmit_lb(dst, mask); + xmit_lb(dst, mask, false, true); } } break; @@ -373,9 +429,9 @@ mask <<= DST_LSB; SET_OVF; if(DST_IS_RIGHT_BANK) - xmit_rb(dst, mask); + xmit_rb(dst, mask, false, true); else - xmit_lb(dst, mask); + xmit_lb(dst, mask, false, true); } else if(!(is_src_reg(opcode)) && is_dst_reg(opcode)) { // ADD IV,reg @@ -396,9 +452,9 @@ dst = (result << (7-DST_LSB)) & 0xff; mask <<= (7-DST_LSB); if(DST_IS_RIGHT_BANK) // unused destination IV data is not preserved, is merged with input IV data - xmit_rb(dst, mask); + xmit_rb(dst, mask, false, true); else - xmit_lb(dst, mask); + xmit_lb(dst, mask, false, true); } } break; @@ -424,9 +480,9 @@ dst <<= (7-DST_LSB); mask <<= (7-DST_LSB); if(DST_IS_RIGHT_BANK) - xmit_rb(dst, mask); + xmit_rb(dst, mask, false, true); else - xmit_lb(dst, mask); + xmit_lb(dst, mask, false, true); } else if(!(is_src_reg(opcode)) && is_dst_reg(opcode)) { // AND IV,reg @@ -445,9 +501,9 @@ dst <<= (7-DST_LSB); mask <<= (7-DST_LSB); if(DST_IS_RIGHT_BANK) - xmit_rb(dst, mask); + xmit_rb(dst, mask, false, true); else - xmit_lb(dst, mask); + xmit_lb(dst, mask, false, true); } } break; @@ -472,9 +528,9 @@ dst <<= (7-DST_LSB); mask <<= (7-DST_LSB); if(DST_IS_RIGHT_BANK) - xmit_rb(dst, mask); + xmit_rb(dst, mask, false, true); else - xmit_lb(dst, mask); + xmit_lb(dst, mask, false, true); } else if(!(is_src_reg(opcode)) && is_dst_reg(opcode)) { // XOR IV,reg @@ -493,9 +549,9 @@ dst <<= (7-DST_LSB); mask <<= (7-DST_LSB); if(DST_IS_RIGHT_BANK) - xmit_rb(dst, mask); + xmit_rb(dst, mask, false, true); else - xmit_lb(dst, mask); + xmit_lb(dst, mask, false, true); } } break; @@ -553,16 +609,36 @@ dst = IMM5; mask <<= (7-SRC_LSB); dst <<= (7-SRC_LSB); + + if(opcode & 0xA00 || opcode & 0xB00) + { + // Imm -> IV Data + with_sc = false; + with_wc = true; + } + else + { + // Imm -> IV Address + with_sc = false; + with_wc = true; + } + if(SRC_IS_RIGHT_BANK) - xmit_rb(dst, mask); + { + xmit_rb(dst, mask, with_sc, with_wc); + } else - xmit_lb(dst, mask); + { + xmit_lb(dst, mask, with_sc, with_wc); + } + } break; case 0x07: // JMP SET_PC(ADDR); break; } + m_mclk_callback(1); CYCLES(1); // all instructions take 1 cycle (250ns) } while (m_icount > 0); } diff -Nru mame-0.242+dfsg.1/src/devices/cpu/8x300/8x300dasm.cpp mame-0.243+dfsg.1/src/devices/cpu/8x300/8x300dasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/8x300/8x300dasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/8x300/8x300dasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -49,6 +49,7 @@ offs_t n8x300_disassembler::disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) { unsigned startpc = pc; + offs_t flags = 0; uint16_t opcode = opcodes.r16(pc); uint8_t inst = opcode >> 13; pc+=1; @@ -111,6 +112,7 @@ util::stream_format(stream, ",%i", ROTLEN); util::stream_format(stream, ",%02XH", IMM5); } + flags = STEP_COND; break; case 0x06: stream << "XMIT "; @@ -132,5 +134,5 @@ } - return (pc - startpc); + return (pc - startpc) | flags | SUPPORTED; } diff -Nru mame-0.242+dfsg.1/src/devices/cpu/8x300/8x300.h mame-0.243+dfsg.1/src/devices/cpu/8x300/8x300.h --- mame-0.242+dfsg.1/src/devices/cpu/8x300/8x300.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/8x300/8x300.h 2022-04-29 05:37:26.000000000 +0000 @@ -46,7 +46,11 @@ n8x300_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); auto sc_callback() { return m_sc_callback.bind(); } - + auto wc_callback() { return m_wc_callback.bind(); } + auto mclk_callback() { return m_mclk_callback.bind(); } + auto lb_callback() { return m_lb_callback.bind(); } + auto rb_callback() { return m_rb_callback.bind(); } + auto iv_callback() { return m_iv_callback.bind(); } protected: n8x300_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); @@ -73,8 +77,8 @@ virtual void set_reg(uint8_t reg, uint8_t val, bool xmit); virtual uint8_t get_reg(uint8_t reg); - void xmit_lb(uint8_t dst, uint8_t mask); - void xmit_rb(uint8_t dst, uint8_t mask); + void xmit_lb(uint8_t dst, uint8_t mask, bool with_sc, bool with_wc); + void xmit_rb(uint8_t dst, uint8_t mask, bool with_sc, bool with_wc); address_space_config m_program_config; address_space_config m_io_config; @@ -86,7 +90,12 @@ memory_access<13, 1, -1, ENDIANNESS_BIG>::specific m_program; memory_access< 9, 0, 0, ENDIANNESS_BIG>::specific m_io; - devcb_write8 m_sc_callback; // Select Command (address latch) + devcb_write_line m_sc_callback; // address latch + devcb_write_line m_wc_callback; // data latch + devcb_write_line m_lb_callback; + devcb_write_line m_rb_callback; + devcb_write_line m_mclk_callback; + devcb_write8 m_iv_callback; uint16_t m_PC; // Program Counter uint16_t m_AR; // Address Register diff -Nru mame-0.242+dfsg.1/src/devices/cpu/adsp2100/2100dasm.cpp mame-0.243+dfsg.1/src/devices/cpu/adsp2100/2100dasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/adsp2100/2100dasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/adsp2100/2100dasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -278,10 +278,13 @@ if (op & 1) { util::stream_format(stream, "%s", "CALL "); - dasmflags = STEP_OVER; + dasmflags = STEP_OVER | STEP_COND; } else + { util::stream_format(stream, "%s", "JUMP "); + dasmflags = STEP_COND; + } temp = ((op >> 4) & 0x0fff) | ((op << 10) & 0x3000); util::stream_format(stream, "$%04X", temp); break; @@ -347,6 +350,8 @@ else util::stream_format(stream, "%s", "RTS"); dasmflags = STEP_OUT; + if ((op & 15) != 15) + dasmflags |= STEP_COND; } else util::stream_format(stream, "??? (%06X)", op); @@ -363,6 +368,8 @@ } else util::stream_format(stream, "JUMP (I%d)", 4 + ((op >> 6) & 3)); + if ((op & 15) != 15) + dasmflags |= STEP_COND; } else util::stream_format(stream, "??? (%06X)", op); @@ -441,6 +448,8 @@ } else util::stream_format(stream, "%sJUMP $%04X", condition[op & 15], (op >> 4) & 0x3fff); + if ((op & 15) != 15) + dasmflags |= STEP_COND; break; case 0x20: case 0x21: case 0x22: case 0x23: case 0x24: case 0x25: case 0x26: case 0x27: /* 00100xxx xxxxxxxx xxxxxxxx conditional ALU/MAC */ diff -Nru mame-0.242+dfsg.1/src/devices/cpu/adsp2100/adsp2100.cpp mame-0.243+dfsg.1/src/devices/cpu/adsp2100/adsp2100.cpp --- mame-0.242+dfsg.1/src/devices/cpu/adsp2100/adsp2100.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/adsp2100/adsp2100.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -106,7 +106,6 @@ ***************************************************************************/ #include "emu.h" -#include "debugger.h" #include "adsp2100.h" #include "2100dasm.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/alpha/alpha.cpp mame-0.243+dfsg.1/src/devices/cpu/alpha/alpha.cpp --- mame-0.242+dfsg.1/src/devices/cpu/alpha/alpha.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/alpha/alpha.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -26,8 +26,6 @@ #include "alpha.h" #include "common.h" -#include "debugger.h" - #include "softfloat3/source/include/softfloat.h" #define LOG_GENERAL (1U << 0) diff -Nru mame-0.242+dfsg.1/src/devices/cpu/alpha/alphad.cpp mame-0.243+dfsg.1/src/devices/cpu/alpha/alphad.cpp --- mame-0.242+dfsg.1/src/devices/cpu/alpha/alphad.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/alpha/alphad.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1225,21 +1225,21 @@ else BRANCH_R("br", Ra(instruction), Disp_B(instruction)); // BR break; - case 0x31: BRANCH_F("fbeq", Ra(instruction), Disp_B(instruction)); break; // FBEQ - case 0x32: BRANCH_F("fblt", Ra(instruction), Disp_B(instruction)); break; // FBLT - case 0x33: BRANCH_F("fble", Ra(instruction), Disp_B(instruction)); break; // FBLE - case 0x34: BRANCH_R("bsr", Ra(instruction), Disp_B(instruction)); break; // BSR - case 0x35: BRANCH_F("fbne", Ra(instruction), Disp_B(instruction)); break; // FBNE - case 0x36: BRANCH_F("fbge", Ra(instruction), Disp_B(instruction)); break; // FBGE - case 0x37: BRANCH_F("fbgt", Ra(instruction), Disp_B(instruction)); break; // FBGT - case 0x38: BRANCH_R("blbc", Ra(instruction), Disp_B(instruction)); break; // BLBC - case 0x39: BRANCH_R("beq", Ra(instruction), Disp_B(instruction)); break; // BEQ - case 0x3a: BRANCH_R("blt", Ra(instruction), Disp_B(instruction)); break; // BLT - case 0x3b: BRANCH_R("ble", Ra(instruction), Disp_B(instruction)); break; // BLE - case 0x3c: BRANCH_R("blbs", Ra(instruction), Disp_B(instruction)); break; // BLBS - case 0x3d: BRANCH_R("bne", Ra(instruction), Disp_B(instruction)); break; // BNE - case 0x3e: BRANCH_R("bge", Ra(instruction), Disp_B(instruction)); break; // BGE - case 0x3f: BRANCH_R("bgt", Ra(instruction), Disp_B(instruction)); break; // BGT + case 0x31: BRANCH_F("fbeq", Ra(instruction), Disp_B(instruction)); flags |= STEP_COND; break; // FBEQ + case 0x32: BRANCH_F("fblt", Ra(instruction), Disp_B(instruction)); flags |= STEP_COND; break; // FBLT + case 0x33: BRANCH_F("fble", Ra(instruction), Disp_B(instruction)); flags |= STEP_COND; break; // FBLE + case 0x34: BRANCH_R("bsr", Ra(instruction), Disp_B(instruction)); flags |= STEP_OVER; break; // BSR + case 0x35: BRANCH_F("fbne", Ra(instruction), Disp_B(instruction)); flags |= STEP_COND; break; // FBNE + case 0x36: BRANCH_F("fbge", Ra(instruction), Disp_B(instruction)); flags |= STEP_COND; break; // FBGE + case 0x37: BRANCH_F("fbgt", Ra(instruction), Disp_B(instruction)); flags |= STEP_COND; break; // FBGT + case 0x38: BRANCH_R("blbc", Ra(instruction), Disp_B(instruction)); flags |= STEP_COND; break; // BLBC + case 0x39: BRANCH_R("beq", Ra(instruction), Disp_B(instruction)); flags |= STEP_COND; break; // BEQ + case 0x3a: BRANCH_R("blt", Ra(instruction), Disp_B(instruction)); flags |= STEP_COND; break; // BLT + case 0x3b: BRANCH_R("ble", Ra(instruction), Disp_B(instruction)); flags |= STEP_COND; break; // BLE + case 0x3c: BRANCH_R("blbs", Ra(instruction), Disp_B(instruction)); flags |= STEP_COND; break; // BLBS + case 0x3d: BRANCH_R("bne", Ra(instruction), Disp_B(instruction)); flags |= STEP_COND; break; // BNE + case 0x3e: BRANCH_R("bge", Ra(instruction), Disp_B(instruction)); flags |= STEP_COND; break; // BGE + case 0x3f: BRANCH_R("bgt", Ra(instruction), Disp_B(instruction)); flags |= STEP_COND; break; // BGT } return bytes | flags; diff -Nru mame-0.242+dfsg.1/src/devices/cpu/alto2/alto2cpu.h mame-0.243+dfsg.1/src/devices/cpu/alto2/alto2cpu.h --- mame-0.242+dfsg.1/src/devices/cpu/alto2/alto2cpu.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/alto2/alto2cpu.h 2022-04-29 05:37:26.000000000 +0000 @@ -12,8 +12,6 @@ #include "machine/diablo_hd.h" -#include "debugger.h" - #define ALTO2_TAG "alto2" /** diff -Nru mame-0.242+dfsg.1/src/devices/cpu/am29000/am29000.cpp mame-0.243+dfsg.1/src/devices/cpu/am29000/am29000.cpp --- mame-0.242+dfsg.1/src/devices/cpu/am29000/am29000.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/am29000/am29000.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -15,7 +15,6 @@ ***************************************************************************/ #include "emu.h" -#include "debugger.h" #include "am29000.h" #include "am29dasm.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/am29000/am29dasm.cpp mame-0.243+dfsg.1/src/devices/cpu/am29000/am29dasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/am29000/am29dasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/am29000/am29dasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -212,17 +212,17 @@ case 0x9f: util::stream_format(stream, "inv"); break; case 0xa0: util::stream_format(stream, "jmp $%04x", pc + OP_SJMP); break; case 0xa1: util::stream_format(stream, "jmp $%04x", OP_IJMP); break; - case 0xa4: case 0xa5: util::stream_format(stream, "jmpf %s", TYPE_4); break; - case 0xa8: case 0xa9: util::stream_format(stream, "call %s", TYPE_4); break; - case 0xac: case 0xad: util::stream_format(stream, "jmpt %s", TYPE_4); break; - case 0xb4: case 0xb5: util::stream_format(stream, "jmpfdec %s", TYPE_4); break; + case 0xa4: case 0xa5: util::stream_format(stream, "jmpf %s", TYPE_4); flags = STEP_COND | step_over_extra(1); break; + case 0xa8: case 0xa9: util::stream_format(stream, "call %s", TYPE_4); flags = STEP_OVER | step_over_extra(1); break; + case 0xac: case 0xad: util::stream_format(stream, "jmpt %s", TYPE_4); flags = STEP_COND | step_over_extra(1); break; + case 0xb4: case 0xb5: util::stream_format(stream, "jmpfdec %s", TYPE_4); flags = STEP_COND | step_over_extra(1); break; case 0xb6: util::stream_format(stream, "mftlb r%d, r%d", OP_RC, OP_RA); break; case 0xbe: util::stream_format(stream, "mttlb r%d, r%d", OP_RA, OP_RB); break; case 0xc0: util::stream_format(stream, "jmpi r%d", OP_RB); break; - case 0xc4: util::stream_format(stream, "jmpfi r%d, r%d", OP_RA, OP_RB); break; + case 0xc4: util::stream_format(stream, "jmpfi r%d, r%d", OP_RA, OP_RB); flags = STEP_COND | step_over_extra(1); break; case 0xc6: util::stream_format(stream, "mfsr r%d, %s", OP_RC, get_spr(OP_SA)); break; - case 0xc8: util::stream_format(stream, "calli r%d, r%d", OP_RA, OP_RB); break; - case 0xcc: util::stream_format(stream, "jmpti r%d, r%d", OP_RA, OP_RB); break; + case 0xc8: util::stream_format(stream, "calli r%d, r%d", OP_RA, OP_RB); flags = STEP_OVER | step_over_extra(1); break; + case 0xcc: util::stream_format(stream, "jmpti r%d, r%d", OP_RA, OP_RB); flags = STEP_COND | step_over_extra(1); break; case 0xce: util::stream_format(stream, "mtsr %s, r%d", get_spr(OP_SA), OP_RB); break; case 0xd7: util::stream_format(stream, "emulate %s", TYPE_5); break; case 0xde: util::stream_format(stream, "multm %s", TYPE_2); break; diff -Nru mame-0.242+dfsg.1/src/devices/cpu/amis2000/amis2000.cpp mame-0.243+dfsg.1/src/devices/cpu/amis2000/amis2000.cpp --- mame-0.242+dfsg.1/src/devices/cpu/amis2000/amis2000.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/amis2000/amis2000.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -20,7 +20,6 @@ #include "emu.h" #include "amis2000.h" #include "amis2000d.h" -#include "debugger.h" // S2000 is the most basic one, 64 nibbles internal RAM and 1KB internal ROM diff -Nru mame-0.242+dfsg.1/src/devices/cpu/amis2000/amis2000d.cpp mame-0.243+dfsg.1/src/devices/cpu/amis2000/amis2000d.cpp --- mame-0.242+dfsg.1/src/devices/cpu/amis2000/amis2000d.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/amis2000/amis2000d.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -33,9 +33,9 @@ const u32 amis2000_disassembler::s_flags[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, STEP_COND, STEP_COND, 0, 0, + 0, STEP_COND, STEP_COND, 0, 0, 0, 0, 0, 0, 0, 0, 0, + STEP_COND, STEP_COND, STEP_COND, STEP_COND, STEP_COND, STEP_COND, STEP_COND, STEP_COND, STEP_COND, 0, 0, STEP_OVER, STEP_OUT, STEP_OUT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; diff -Nru mame-0.242+dfsg.1/src/devices/cpu/apexc/apexc.cpp mame-0.243+dfsg.1/src/devices/cpu/apexc/apexc.cpp --- mame-0.242+dfsg.1/src/devices/cpu/apexc/apexc.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/apexc/apexc.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -328,7 +328,6 @@ #include "emu.h" #include "apexc.h" #include "apexcdsm.h" -#include "debugger.h" DEFINE_DEVICE_TYPE(APEXC, apexc_cpu_device, "apexc_cpu", "APE(X)C") diff -Nru mame-0.242+dfsg.1/src/devices/cpu/arc/arc.cpp mame-0.243+dfsg.1/src/devices/cpu/arc/arc.cpp --- mame-0.242+dfsg.1/src/devices/cpu/arc/arc.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/arc/arc.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -10,7 +10,6 @@ \*********************************/ #include "emu.h" -#include "debugger.h" #include "arc.h" #include "arcdasm.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/arcompact/arcompact.cpp mame-0.243+dfsg.1/src/devices/cpu/arcompact/arcompact.cpp --- mame-0.242+dfsg.1/src/devices/cpu/arcompact/arcompact.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/arcompact/arcompact.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -19,7 +19,6 @@ \*********************************/ #include "emu.h" -#include "debugger.h" #include "arcompact.h" #include "arcompactdasm.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/arcompact/arcompact_execute.cpp mame-0.243+dfsg.1/src/devices/cpu/arcompact/arcompact_execute.cpp --- mame-0.242+dfsg.1/src/devices/cpu/arcompact/arcompact_execute.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/arcompact/arcompact_execute.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -2,7 +2,6 @@ // copyright-holders:David Haywood #include "emu.h" -#include "debugger.h" #include "arcompact.h" #include "arcompactdasm.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/arm/arm.cpp mame-0.243+dfsg.1/src/devices/cpu/arm/arm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/arm/arm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/arm/arm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -18,7 +18,6 @@ #include "emu.h" #include "arm.h" -#include "debugger.h" #include "armdasm.h" #define ARM_DEBUG_CORE 0 diff -Nru mame-0.242+dfsg.1/src/devices/cpu/arm/armdasm.cpp mame-0.243+dfsg.1/src/devices/cpu/arm/armdasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/arm/armdasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/arm/armdasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -226,8 +226,13 @@ break; case 0x0d: /* look for mov pc,lr */ - if (((opcode >> 12) & 0x0f) == 15 && ((opcode >> 0) & 0x0f) == 14 && (opcode & 0x02000000) == 0) - dasmflags = STEP_OUT; + if (((opcode >> 12) & 0x0f) == 15) + { + if (((opcode >> 0) & 0x0f) == 14 && (opcode & 0x02000000) == 0) + dasmflags = STEP_OUT; + if (opcode < 0xe0000000) + dasmflags |= STEP_COND; + } [[fallthrough]]; case 0x0f: WriteDataProcessingOperand(stream, opcode, true, false, pc); @@ -337,7 +342,11 @@ util::stream_format( stream, "%c%c", ( opcode&0x00800000 ) ? 'I' : 'D', ( opcode&0x01000000 ) ? 'B' : 'A'); if( opcode & 0x00008000 ) + { dasmflags = STEP_OUT; + if (opcode < 0xe0000000) + dasmflags |= STEP_COND; + } } else { @@ -397,6 +406,8 @@ { stream << "B"; } + if (opcode < 0xe0000000) + dasmflags |= STEP_COND; stream << pConditionCode; @@ -446,6 +457,8 @@ WritePadding(stream, start_position); util::stream_format( stream, "&%X", opcode&0x00ffffff ); dasmflags = STEP_OVER; + if (opcode < 0xe0000000) + dasmflags |= STEP_COND; } else { diff -Nru mame-0.242+dfsg.1/src/devices/cpu/arm7/arm7dasm.cpp mame-0.243+dfsg.1/src/devices/cpu/arm7/arm7dasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/arm7/arm7dasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/arm7/arm7dasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -226,6 +226,8 @@ /* BLX(2) */ stream << "BLX"; dasmflags = STEP_OVER; + if (opcode < 0xe0000000) + dasmflags |= STEP_COND; WritePadding(stream, start_position); util::stream_format( stream, "R%d",(opcode&0xf)); } @@ -237,6 +239,8 @@ util::stream_format( stream, "R%d",(opcode&0xf)); if ((opcode & 0x0f) == 14) dasmflags = STEP_OUT; + if (opcode < 0xe0000000) + dasmflags |= STEP_COND; } else if ((opcode & 0x0ff000f0) == 0x01600010) // CLZ - v5 { @@ -290,11 +294,11 @@ /* half word data transfer */ if (((opcode & 0x60) == 0x40) && !(opcode & 0x100000)) // bit 20 = 0, bits 5&6 = 10 is ARMv5TE LDRD { - util::stream_format(stream, "LDRD%s", pConditionCode); + stream << "LDRD"; } else if (((opcode & 0x60) == 0x60) && !(opcode & 0x100000)) // bit 20 = 0, bits 5&6 = 11 is ARMv5TE STRD { - util::stream_format(stream, "STRD%s", pConditionCode); + stream << "STRD"; } else { @@ -309,9 +313,8 @@ util::stream_format(stream, "S%c", (opcode & 0x20) ? 'H' : 'B'); //Bit 5 = 1 for Half Word, 0 for Byte else stream << 'H'; - - stream << pConditionCode; } + stream << pConditionCode; WritePadding(stream, start_position); @@ -529,8 +532,13 @@ switch (op) { case 0x02: // check for SUBS PC, LR, #imm - if (((opcode >> 12) & 0x0f) == 15 && ((opcode >> 0) & 0x0f) == 14 && (opcode & 0x02100000) == 0x02100000) - dasmflags = STEP_OUT; + if (((opcode >> 12) & 0x0f) == 15) + { + if (((opcode >> 0) & 0x0f) == 14 && (opcode & 0x02100000) == 0x02100000) + dasmflags = STEP_OUT; + if (opcode < 0xe0000000) + dasmflags |= STEP_COND; + } [[fallthrough]]; case 0x04: if (is_adr) @@ -576,8 +584,13 @@ break; } /* look for mov pc,lr */ - if (((opcode >> 12) & 0x0f) == 15 && ((opcode >> 0) & 0x0f) == 14 && (opcode & 0x02000000) == 0) - dasmflags = STEP_OUT; + if (((opcode >> 12) & 0x0f) == 15) + { + if (((opcode >> 0) & 0x0f) == 14 && (opcode & 0x02000000) == 0) + dasmflags = STEP_OUT; + if (opcode < 0xe0000000) + dasmflags |= STEP_COND; + } [[fallthrough]]; case 0x0f: WriteDataProcessingOperand(stream, opcode, true, false); @@ -707,6 +720,8 @@ util::stream_format(stream, "R%d-", last); stream << "R15"; dasmflags = STEP_OUT; + if (opcode < 0xe0000000) + dasmflags |= STEP_COND; } } @@ -732,6 +747,8 @@ } stream << pConditionCode; + if (opcode < 0xe0000000) + dasmflags |= STEP_COND; WritePadding(stream, start_position); @@ -767,6 +784,8 @@ WritePadding(stream, start_position); util::stream_format( stream, "0x%X", opcode&0x00ffffff ); dasmflags = STEP_OVER; + if (opcode < 0xe0000000) + dasmflags |= STEP_COND; } else { @@ -1330,6 +1349,7 @@ util::stream_format( stream, "B%s", pConditionCodeTable[( opcode & THUMB_COND_TYPE ) >> THUMB_COND_TYPE_SHIFT]); WritePadding(stream, start_position); util::stream_format( stream, "0x%08X", pc + 4 + (offs << 1)); + dasmflags = STEP_COND; break; } break; diff -Nru mame-0.242+dfsg.1/src/devices/cpu/asap/asap.cpp mame-0.243+dfsg.1/src/devices/cpu/asap/asap.cpp --- mame-0.242+dfsg.1/src/devices/cpu/asap/asap.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/asap/asap.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -14,7 +14,6 @@ #include "emu.h" #include "asap.h" #include "asapdasm.h" -#include "debugger.h" //************************************************************************** @@ -615,7 +614,7 @@ { m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); - fetch_instruction(); + fetch_instruction_debug(); m_pc = m_nextpc; m_nextpc = ~0; @@ -630,7 +629,7 @@ { m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); - fetch_instruction(); + fetch_instruction_debug(); m_pc = m_nextpc; m_nextpc = ~0; @@ -645,7 +644,7 @@ { m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); - fetch_instruction(); + fetch_instruction_debug(); m_pc = m_nextpc; m_nextpc = ~0; @@ -660,7 +659,7 @@ { m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); - fetch_instruction(); + fetch_instruction_debug(); m_pc = m_nextpc; m_nextpc = ~0; @@ -675,7 +674,7 @@ { m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); - fetch_instruction(); + fetch_instruction_debug(); m_pc = m_nextpc; m_nextpc = ~0; @@ -690,7 +689,7 @@ { m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); - fetch_instruction(); + fetch_instruction_debug(); m_pc = m_nextpc; m_nextpc = ~0; @@ -705,7 +704,7 @@ { m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); - fetch_instruction(); + fetch_instruction_debug(); m_pc = m_nextpc; m_nextpc = ~0; @@ -720,7 +719,7 @@ { m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); - fetch_instruction(); + fetch_instruction_debug(); m_pc = m_nextpc; m_nextpc = ~0; @@ -735,7 +734,7 @@ { m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); - fetch_instruction(); + fetch_instruction_debug(); m_pc = m_nextpc; m_nextpc = ~0; @@ -750,7 +749,7 @@ { m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); - fetch_instruction(); + fetch_instruction_debug(); m_pc = m_nextpc; m_nextpc = ~0; @@ -765,7 +764,7 @@ { m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); - fetch_instruction(); + fetch_instruction_debug(); m_pc = m_nextpc; m_nextpc = ~0; @@ -780,7 +779,7 @@ { m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); - fetch_instruction(); + fetch_instruction_debug(); m_pc = m_nextpc; m_nextpc = ~0; @@ -795,7 +794,7 @@ { m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); - fetch_instruction(); + fetch_instruction_debug(); m_pc = m_nextpc; m_nextpc = ~0; @@ -810,7 +809,7 @@ { m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); - fetch_instruction(); + fetch_instruction_debug(); m_pc = m_nextpc; m_nextpc = ~0; @@ -825,7 +824,7 @@ { m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); - fetch_instruction(); + fetch_instruction_debug(); m_pc = m_nextpc; m_nextpc = ~0; @@ -840,7 +839,7 @@ { m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); - fetch_instruction(); + fetch_instruction_debug(); m_pc = m_nextpc; m_nextpc = ~0; @@ -856,7 +855,7 @@ DSTVAL = m_pc + 4; m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); - fetch_instruction(); + fetch_instruction_debug(); m_pc = m_nextpc; m_nextpc = ~0; @@ -868,7 +867,7 @@ { m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); - fetch_instruction(); + fetch_instruction_debug(); m_pc = m_nextpc; m_nextpc = ~0; @@ -1603,7 +1602,7 @@ DSTVAL = m_pc + 4; m_nextpc = SRC1VAL + (SRC2VAL << 2); - fetch_instruction(); + fetch_instruction_debug(); m_pc = m_nextpc; m_nextpc = ~0; @@ -1615,7 +1614,7 @@ { m_nextpc = SRC1VAL + (SRC2VAL << 2); - fetch_instruction(); + fetch_instruction_debug(); m_pc = m_nextpc; m_nextpc = ~0; @@ -1629,7 +1628,7 @@ m_nextpc = SRC1VAL + (SRC2VAL << 2); m_iflag = m_pflag; - fetch_instruction(); + fetch_instruction_debug(); m_pc = m_nextpc; m_nextpc = ~0; @@ -1643,7 +1642,7 @@ m_nextpc = SRC1VAL + (SRC2VAL << 2); m_iflag = m_pflag; - fetch_instruction(); + fetch_instruction_debug(); m_pc = m_nextpc; m_nextpc = ~0; diff -Nru mame-0.242+dfsg.1/src/devices/cpu/asap/asapdasm.cpp mame-0.243+dfsg.1/src/devices/cpu/asap/asapdasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/asap/asapdasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/asap/asapdasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -57,7 +57,7 @@ switch (opcode) { case 0x00: util::stream_format(stream, "trap $00"); flags = STEP_OVER; break; - case 0x01: util::stream_format(stream, "b%s $%08x", condition[rdst & 15], pc + ((int32_t)(op << 10) >> 8)); break; + case 0x01: util::stream_format(stream, "b%s $%08x", condition[rdst & 15], pc + ((int32_t)(op << 10) >> 8)); flags = STEP_COND | step_over_extra(1); break; case 0x02: if ((op & 0x003fffff) == 3) { uint32_t nextop = opcodes.r32(pc+4); @@ -132,7 +132,7 @@ else if (rsrc2_iszero) { if (rsrc1 == 28) - flags = STEP_OUT; + flags = STEP_OUT | step_over_extra(1); util::stream_format(stream, "jmp%s %s", setcond[cond], reg[rsrc1]); } else diff -Nru mame-0.242+dfsg.1/src/devices/cpu/avr8/avr8.cpp mame-0.243+dfsg.1/src/devices/cpu/avr8/avr8.cpp --- mame-0.242+dfsg.1/src/devices/cpu/avr8/avr8.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/avr8/avr8.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -60,7 +60,6 @@ #include "emu.h" #include "avr8.h" #include "avr8dasm.h" -#include "debugger.h" #define LOG_UNKNOWN (1 << 1) #define LOG_BOOT (1 << 2) diff -Nru mame-0.242+dfsg.1/src/devices/cpu/avr8/avr8dasm.cpp mame-0.243+dfsg.1/src/devices/cpu/avr8/avr8dasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/avr8/avr8dasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/avr8/avr8dasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -161,6 +161,7 @@ { case 0x0000: util::stream_format(stream, "CPSE R%d, R%d", RD5(op), RR5(op)); + flags = STEP_COND; break; case 0x0400: util::stream_format(stream, "CP R%d, R%d", RD5(op), RR5(op)); @@ -541,12 +542,14 @@ break; case 0x0900: util::stream_format(stream, "SBIC %s, %s", register_names[ACONST5(op)], register_bit_names[ACONST5(op)][RR3(op)]); + flags = STEP_COND; break; case 0x0a00: util::stream_format(stream, "SBI %s, %s", register_names[ACONST5(op)], register_bit_names[ACONST5(op)][RR3(op)]); break; case 0x0b00: util::stream_format(stream, "SBIS %s, %s", register_names[ACONST5(op)], register_bit_names[ACONST5(op)][RR3(op)]); + flags = STEP_COND; break; case 0x0c00: case 0x0d00: @@ -603,6 +606,7 @@ util::stream_format(stream, "BRIE %08x", (((op & 0x0200) ? (KCONST7(op) | 0xff80) : KCONST7(op)) << 1)); break; } + flags = STEP_COND; break; case 0x0400: switch(op & 0x0007) @@ -632,6 +636,7 @@ util::stream_format(stream, "BRID %08x", (((op & 0x0200) ? (KCONST7(op) | 0xff80) : KCONST7(op)) << 1)); break; } + flags = STEP_COND; break; case 0x0800: if(op & 0x0200) @@ -644,6 +649,7 @@ util::stream_format(stream, "SBRS R%d, %d", RD5(op), RR3(op)); else util::stream_format(stream, "SBRC R%d, %d", RD5(op), RR3(op)); + flags = STEP_COND; break; } break; diff -Nru mame-0.242+dfsg.1/src/devices/cpu/b5000/b5000base.cpp mame-0.243+dfsg.1/src/devices/cpu/b5000/b5000base.cpp --- mame-0.242+dfsg.1/src/devices/cpu/b5000/b5000base.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/b5000/b5000base.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,222 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:hap -/* - - Rockwell B5000 family MCU cores - -This MCU series sits between A4000 and the more publicly available PPS4/1. -Known part numbers: A/B5000, A5300, A/B5500, A/B5900, B6000, B6100. -The latter two were manufactured for Mattel, with small modifications -useful for making handheld games. In fact, the programmer of the first -Mattel handheld games was a circuit designer at Rockwell. - -The main difference between Axxxx and Bxxxx is that B runs on low power, -there's also a small change with the way they output LEDs. - -A5300 might not be in this series, the page size is 0x3f instead of 0x40. -A4000 is similar, but too many differences to emulate in this device, probably. - -*/ - -#include "emu.h" -#include "b5000base.h" - -#include "debugger.h" - - -b5000_base_device::b5000_base_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data) : - cpu_device(mconfig, type, tag, owner, clock), - m_program_config("program", ENDIANNESS_LITTLE, 8, prgwidth, 0, program), - m_data_config("data", ENDIANNESS_LITTLE, 8, datawidth, 0, data), - m_prgwidth(prgwidth), - m_datawidth(datawidth), - m_read_kb(*this), - m_read_din(*this), - m_write_str(*this), - m_write_seg(*this), - m_write_spk(*this) -{ } - - -//------------------------------------------------- -// device_start - device-specific startup -//------------------------------------------------- - -void b5000_base_device::device_start() -{ - m_program = &space(AS_PROGRAM); - m_data = &space(AS_DATA); - m_prgmask = (1 << m_prgwidth) - 1; - m_datamask = (1 << m_datawidth) - 1; - - // resolve callbacks - m_read_kb.resolve_safe(0); - m_read_din.resolve_safe(0); - m_write_str.resolve_safe(); - m_write_seg.resolve_safe(); - m_write_spk.resolve_safe(); - - // zerofill - m_pc = 0; - m_prev_pc = 0; - m_s = 0; - m_op = 0; - m_prev_op = 0; - - m_a = 0; - m_bl = 0; - m_bu = 0; - m_prev_bl = 0; - m_prev_bu = 0; - m_bl_delay = false; - m_bu_delay = false; - m_ram_addr = 0; - m_c = 0; - m_prev_c = 0; - m_prev2_c = 0; - m_sr = false; - m_skip = false; - m_seg = 0; - m_suppress0 = false; - - m_atbz_step = 0; - m_tra_step = 0; - m_ret_step = 0; - - // register for savestates - save_item(NAME(m_pc)); - save_item(NAME(m_prev_pc)); - save_item(NAME(m_s)); - save_item(NAME(m_op)); - save_item(NAME(m_prev_op)); - - save_item(NAME(m_a)); - save_item(NAME(m_bl)); - save_item(NAME(m_bu)); - save_item(NAME(m_prev_bl)); - save_item(NAME(m_prev_bu)); - save_item(NAME(m_bl_delay)); - save_item(NAME(m_bu_delay)); - save_item(NAME(m_ram_addr)); - save_item(NAME(m_c)); - save_item(NAME(m_prev_c)); - save_item(NAME(m_prev2_c)); - save_item(NAME(m_sr)); - save_item(NAME(m_skip)); - save_item(NAME(m_seg)); - save_item(NAME(m_suppress0)); - - save_item(NAME(m_atbz_step)); - save_item(NAME(m_tra_step)); - save_item(NAME(m_ret_step)); - - // register state for debugger - state_add(STATE_GENPC, "GENPC", m_pc).formatstr("%03X").noshow(); - state_add(STATE_GENPCBASE, "CURPC", m_prev_pc).formatstr("%03X").noshow(); - - m_state_count = 0; - state_add(++m_state_count, "PC", m_pc).formatstr("%03X"); // 1 - state_add(++m_state_count, "S", m_s).formatstr("%03X"); // 2 - state_add(++m_state_count, "A", m_a).formatstr("%01X"); // 3 - state_add(++m_state_count, "C", m_c).formatstr("%01X"); // 4 - state_add(++m_state_count, "B", m_ram_addr).formatstr("%02X"); // 5 - state_add(++m_state_count, "BU", m_bu).formatstr("%01X").noshow(); // 6 - state_add(++m_state_count, "BL", m_bl).formatstr("%01X").noshow(); // 7 - - set_icountptr(m_icount); -} - -device_memory_interface::space_config_vector b5000_base_device::memory_space_config() const -{ - return space_config_vector { - std::make_pair(AS_PROGRAM, &m_program_config), - std::make_pair(AS_DATA, &m_data_config) - }; -} - - -//------------------------------------------------- -// device_reset - device-specific reset -//------------------------------------------------- - -void b5000_base_device::device_reset() -{ - reset_pc(); - m_prev_pc = m_pc; - m_s = m_pc; - m_op = 0; - m_prev_op = 0; - - m_bl_delay = false; - m_bu_delay = false; - m_sr = false; - m_skip = false; - - m_atbz_step = 0; - m_tra_step = 0; - m_ret_step = 0; -} - - -//------------------------------------------------- -// execute -//------------------------------------------------- - -void b5000_base_device::increment_pc() -{ - // low part is LFSR - int feed = ((m_pc & 0x3e) == 0) ? 1 : 0; - feed ^= (m_pc >> 1 ^ m_pc) & 1; - m_pc = (m_pc & ~0x3f) | (m_pc >> 1 & 0x1f) | (feed << 5); -} - -void b5000_base_device::execute_run() -{ - while (m_icount > 0) - { - // remember previous state - m_prev_op = m_op; - m_prev_pc = m_pc; - - m_prev_bl = m_bl; - m_prev_bu = m_bu; - m_prev2_c = m_prev_c; - m_prev_c = m_c; - - // fetch next opcode - m_op = m_program->read_byte(m_pc); - bool skip = m_skip && op_canskip(m_op); - m_skip = false; - - if (!skip) - debugger_instruction_hook(m_pc); - increment_pc(); - m_icount--; - - // handle opcode if it's not skipped - if (skip) - m_op = 0; // fake nop - else - execute_one(); - - // some opcodes have multiple steps and will run in parallel with next ones, - // eg. it may fetch in order A,B and parts executed in order B,A - if (m_atbz_step) op_atbz(); - if (m_tra_step) op_tra(); - if (m_ret_step) op_ret(); - - // some opcodes delay RAM address adjustment for 1 cycle - m_ram_addr = (m_bu << 4 & 0x30) | (m_bl & 0xf); - - if (m_bl_delay) - { - m_ram_addr = (m_ram_addr & ~0xf) | (m_prev_bl & 0xf); - m_bl_delay = false; - } - if (m_bu_delay) - { - m_ram_addr = (m_ram_addr & 0xf) | (m_prev_bu << 4 & 0x30); - m_bu_delay = false; - } - } -} diff -Nru mame-0.242+dfsg.1/src/devices/cpu/b5000/b5000base.h mame-0.243+dfsg.1/src/devices/cpu/b5000/b5000base.h --- mame-0.242+dfsg.1/src/devices/cpu/b5000/b5000base.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/b5000/b5000base.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,114 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:hap -/* - - Rockwell B5000 family MCU cores - - Don't include this file, include the specific device header instead, - for example b5000.h - -*/ - -#ifndef MAME_CPU_B5000_B5000BASE_H -#define MAME_CPU_B5000_B5000BASE_H - -#pragma once - - -class b5000_base_device : public cpu_device -{ -public: - // configuration helpers - // I/O ports: - - // 4-bit KB inputs - auto read_kb() { return m_read_kb.bind(); } - - // 1-4 DIN inputs - auto read_din() { return m_read_din.bind(); } - - // 9(possibly more) strobe outputs - auto write_str() { return m_write_str.bind(); } - - // 7/8/10 segment outputs - auto write_seg() { return m_write_seg.bind(); } - - // speaker output line (aka SEG0) - auto write_spk() { return m_write_spk.bind(); } - -protected: - // construction/destruction - b5000_base_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data); - - // device-level overrides - virtual void device_start() override; - virtual void device_reset() override; - - // device_execute_interface overrides - virtual u64 execute_clocks_to_cycles(u64 clocks) const noexcept override { return (clocks + 4 - 1) / 4; } // 4-phase clock - virtual u64 execute_cycles_to_clocks(u64 cycles) const noexcept override { return (cycles * 4); } - virtual u32 execute_min_cycles() const noexcept override { return 1; } - virtual u32 execute_max_cycles() const noexcept override { return 1; } - virtual void execute_run() override; - virtual void execute_one() = 0; - - // device_memory_interface overrides - virtual space_config_vector memory_space_config() const override; - - address_space_config m_program_config; - address_space_config m_data_config; - address_space *m_program; - address_space *m_data; - - int m_icount; - int m_state_count; - - int m_prgwidth; // ROM/RAM address size - int m_datawidth; // " - u16 m_prgmask; // " - u16 m_datamask; // " - - void increment_pc(); - virtual bool op_canskip(u8 op) = 0; - virtual void reset_pc() = 0; - - u16 m_pc; - u16 m_prev_pc; - u16 m_s; - u8 m_op; - u8 m_prev_op; - - u8 m_a; - u8 m_bl; - u8 m_bu; - u8 m_prev_bl; - u8 m_prev_bu; - bool m_bl_delay; - bool m_bu_delay; - u8 m_ram_addr; - u8 m_c; - u8 m_prev_c; - u8 m_prev2_c; - bool m_sr; - bool m_skip; - u16 m_seg; - bool m_suppress0; - - u8 m_atbz_step; - u8 m_tra_step; - u8 m_ret_step; - - virtual void op_atbz() { ; } - virtual void op_tra() { ; } - virtual void op_ret() { ; } - - // i/o handlers - devcb_read8 m_read_kb; - devcb_read8 m_read_din; - devcb_write16 m_write_str; - devcb_write16 m_write_seg; - devcb_write_line m_write_spk; -}; - - -#endif // MAME_CPU_B5000_B5000BASE_H diff -Nru mame-0.242+dfsg.1/src/devices/cpu/b5000/b5000.cpp mame-0.243+dfsg.1/src/devices/cpu/b5000/b5000.cpp --- mame-0.242+dfsg.1/src/devices/cpu/b5000/b5000.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/b5000/b5000.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,159 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:hap -/* - - Rockwell B5000 MCU - -TODO: -- is unmapped ram mirrored? (that goes for subdevices too) -- fill unknown data in segment decoder, it's not on a neat PLA -- is ATB an unskippable opcode? nothing relies on it - -*/ - -#include "emu.h" -#include "b5000.h" - -#include "b5000d.h" - - -DEFINE_DEVICE_TYPE(B5000, b5000_cpu_device, "b5000", "Rockwell B5000") - - -// constructor -b5000_cpu_device::b5000_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data) : - b5000_base_device(mconfig, type, tag, owner, clock, prgwidth, program, datawidth, data) -{ } - -b5000_cpu_device::b5000_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : - b5000_cpu_device(mconfig, B5000, tag, owner, clock, 9, address_map_constructor(FUNC(b5000_cpu_device::program_448x8), this), 6, address_map_constructor(FUNC(b5000_cpu_device::data_45x4), this)) -{ } - - -// internal memory maps -void b5000_cpu_device::program_448x8(address_map &map) -{ - map(0x000, 0x0bf).rom(); - map(0x100, 0x1ff).rom(); -} - -void b5000_cpu_device::data_45x4(address_map &map) -{ - map(0x00, 0x0b).ram(); - map(0x10, 0x1a).ram(); - map(0x20, 0x2a).ram(); - map(0x30, 0x3a).ram(); -} - - -// disasm -std::unique_ptr b5000_cpu_device::create_disassembler() -{ - return std::make_unique(); -} - - -// digit segment decoder -u16 b5000_cpu_device::decode_digit(u8 data) -{ - static u8 lut_segs[0x10] = - { - // 0-9 ok (6 and 9 have tails) - 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, - - // ?, ?, newline?, -, ?, ? - 0, 0, 0x80, 0x40, 0, 0 - }; - - u16 seg = lut_segs[data & 0xf] << 1 | BIT(data, 4); - - // zero suppression logic is done in hardware - if (seg & 0x100) - m_suppress0 = true; - else if (data > 0) - m_suppress0 = false; - - return m_suppress0 ? 0 : (seg & 0xff); -} - - -//------------------------------------------------- -// execute -//------------------------------------------------- - -void b5000_cpu_device::execute_one() -{ - switch (m_op & 0xf0) - { - case 0x40: op_lax(); break; - case 0x60: - if (m_op != 0x6f) - op_adx(); - else - op_read(); - break; - - case 0x80: case 0x90: case 0xa0: case 0xb0: - case 0xc0: case 0xd0: case 0xe0: case 0xf0: - m_tra_step = 1; break; - - default: - switch (m_op & 0xfc) - { - case 0x04: op_tdin(); break; - case 0x08: op_tm(); break; - case 0x10: op_sm(); break; - case 0x14: op_rsm(); break; - case 0x18: m_ret_step = 1; break; - - case 0x20: op_lb(7); break; - case 0x24: op_lb(10); break; - case 0x28: op_lb(9); break; - case 0x2c: op_lb(8); break; - case 0x3c: op_lb(0); break; - - case 0x30: case 0x34: op_tl(); break; - - case 0x50: op_lda(); break; - case 0x54: op_excp(); break; - case 0x58: op_exc0(); break; - case 0x5c: op_excm(); break; - case 0x70: op_add(); break; - case 0x78: op_comp(); break; - case 0x7c: op_tam(); break; - - default: - switch (m_op) - { - case 0x00: op_nop(); break; - case 0x01: op_tc(); break; - case 0x02: op_tkb(); break; - case 0x03: op_tkbs(); break; - case 0x39: op_rsc(); break; - case 0x3b: op_sc(); break; - case 0x74: op_kseg(); break; - case 0x77: m_atbz_step = 1; break; // ATB - - default: op_illegal(); break; - } - break; // 0xff - - } - break; // 0xfc - } -} - -bool b5000_cpu_device::op_is_tl(u8 op) -{ - return ((op & 0xf8) == 0x30); -} - -bool b5000_cpu_device::op_is_lb(u8 op) -{ - return ((op & 0xf0) == 0x20) || ((op & 0xfc) == 0x3c); -} - -bool b5000_cpu_device::op_is_atb(u8 op) -{ - return (op == 0x77); -} diff -Nru mame-0.242+dfsg.1/src/devices/cpu/b5000/b5000d.cpp mame-0.243+dfsg.1/src/devices/cpu/b5000/b5000d.cpp --- mame-0.242+dfsg.1/src/devices/cpu/b5000/b5000d.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/b5000/b5000d.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,198 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:hap -/* - - Rockwell B5000 family MCU disassembler - -*/ - -#include "emu.h" -#include "b5000d.h" - -// constructor - -b5000_common_disassembler::b5000_common_disassembler() -{ - // init lfsr pc lut - for (u32 i = 0, pc = 0; i < 0x40; i++) - { - m_l2r[i] = pc; - m_r2l[pc] = i; - pc = increment_pc(pc); - } -} - -offs_t b5000_common_disassembler::increment_pc(offs_t pc) -{ - int feed = ((pc & 0x3e) == 0) ? 1 : 0; - feed ^= (pc >> 1 ^ pc) & 1; - return (pc & ~0x3f) | (pc >> 1 & 0x1f) | (feed << 5); -} - - -// common lookup tables - -const char *const b5000_common_disassembler::s_name[] = -{ - "?", - "NOP", "RSC", "SC", "TC", "TAM", - "LAX", "ADX", "COMP", "ATB", "ATBZ", - "LDA", "EXC", "EXC", "EXC", "ADD", - "LB", "LB", "LB", "LB", "LB", "LB", - "RSM", "SM", "TM", - "TL", "TRA", "TRA", "RET", - "TKB", "TKBS", "TDIN", "READ", "KSEG", "MTD" -}; - -// number of bits per opcode parameter -// note: d4 means bitmask param, d5 means inverted -const u8 b5000_common_disassembler::s_bits[] = -{ - 0, - 0, 0, 0, 0, 0, - 0x24, 0x24, 0, 0, 0, - 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, - 0x12, 0x12, 0x12, - 4, 6, 6, 0, - 0, 0, 2, 0, 0, 0 -}; - -const u32 b5000_common_disassembler::s_flags[] = -{ - 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, - 0, STEP_OVER, 0, STEP_OUT, - 0, 0, 0, 0, 0, 0 -}; - - -// common disasm - -offs_t b5000_common_disassembler::common_disasm(const u8 *lut_opmap, std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) -{ - // get raw opcode - u8 op = opcodes.r8(pc); - u8 instr = lut_opmap[op]; - - // get parameter - u8 bits = s_bits[instr]; - u8 mask = (1 << (bits & 0xf)) - 1; - u8 param = (bits & 0x20) ? (~op & mask) : (op & mask); - if (bits & 0x10) - param = 1 << param; - - // TDIN 0 is 4 - if (instr == em_TDIN && param == 0) - param = 4; - - // disassemble it - util::stream_format(stream, "%-6s", s_name[instr]); - - if (bits > 0) - { - // exceptions for opcodes with 2 params - if (instr >= em_EXC0 && instr <= em_EXCM) - { - switch (instr) - { - case em_EXC0: util::stream_format(stream, "%d,0", param); break; - case em_EXCP: util::stream_format(stream, "%d,+1", param); break; - case em_EXCM: util::stream_format(stream, "%d,-1", param); break; - default: break; - } - } - else if (instr == em_ADD) - { - switch (param ^ 2) - { - case 1: stream << "S"; break; // 0,1 - case 2: stream << "C"; break; // 1,0 - case 3: stream << "C,S"; break; // 1,1 - default: break; - } - } - else if (instr >= em_LB0 && instr <= em_LB11) - { - int param2 = (instr == em_LB0) ? 0 : (6 + instr - em_LB0); - util::stream_format(stream, "%d,%d", param, param2); - } - else if (instr == em_TRA0 || instr == em_TRA1) - { - int param2 = (instr == em_TRA1) ? 1 : 0; - util::stream_format(stream, "%d,$%02X", param2, param); - } - else - util::stream_format(stream, "%d", param); - } - - return 1 | s_flags[instr] | SUPPORTED; -} - - -// B5000/B6000 disasm (for A5xxx, the only difference is ATBZ = MTD) - -const u8 b5000_disassembler::b5000_opmap[0x100] = -{ -/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ - em_NOP, em_TC, em_TKB, em_TKBS, em_TDIN, em_TDIN, em_TDIN, em_TDIN, em_TM, em_TM, em_TM, em_TM, 0, 0, 0, 0, // 0 - em_SM, em_SM, em_SM, em_SM, em_RSM, em_RSM, em_RSM, em_RSM, em_RET, em_RET, em_RET, em_RET, 0, 0, 0, 0, // 1 - em_LB7, em_LB7, em_LB7, em_LB7, em_LB10, em_LB10, em_LB10, em_LB10, em_LB9, em_LB9, em_LB9, em_LB9, em_LB8, em_LB8, em_LB8, em_LB8, // 2 - em_TL, em_TL, em_TL, em_TL, em_TL, em_TL, em_TL, em_TL, 0, em_RSC, 0, em_SC, em_LB0, em_LB0, em_LB0, em_LB0, // 3 - - em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, // 4 - em_LDA, em_LDA, em_LDA, em_LDA, em_EXCP, em_EXCP, em_EXCP, em_EXCP, em_EXC0, em_EXC0, em_EXC0, em_EXC0, em_EXCM, em_EXCM, em_EXCM, em_EXCM, // 5 - em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_READ, // 6 - em_ADD, em_ADD, em_ADD, em_ADD, em_KSEG, 0, em_ATBZ, em_ATB, em_COMP, em_COMP, em_COMP, em_COMP, em_TAM, em_TAM, em_TAM, em_TAM, // 7 - - em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, // 8 - em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, // 9 - em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, // A - em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, // B - - em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, // C - em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, // D - em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, // E - em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, // F -}; - -offs_t b5000_disassembler::disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) -{ - return common_disasm(b5000_opmap, stream, pc, opcodes, params); -} - - -// B5500/B6100 disasm (for A5xxx, the only difference is ATBZ = MTD) - -const u8 b5500_disassembler::b5500_opmap[0x100] = -{ -/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ - em_NOP, em_TC, em_TKB, em_TKBS, em_TDIN, em_TDIN, em_TDIN, em_TDIN, em_TM, em_TM, em_TM, em_TM, em_SC, em_RSC, 0, 0, // 0 - em_SM, em_SM, em_SM, em_SM, em_RSM, em_RSM, em_RSM, em_RSM, em_RET, em_RET, em_RET, em_RET, em_LB11, em_LB11, em_LB11, em_LB11, // 1 - em_LB7, em_LB7, em_LB7, em_LB7, em_LB10, em_LB10, em_LB10, em_LB10, em_LB9, em_LB9, em_LB9, em_LB9, em_LB8, em_LB8, em_LB8, em_LB8, // 2 - em_TL, em_TL, em_TL, em_TL, em_TL, em_TL, em_TL, em_TL, em_TL, em_TL, em_TL, em_TL, em_LB0, em_LB0, em_LB0, em_LB0, // 3 - - em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, // 4 - em_LDA, em_LDA, em_LDA, em_LDA, em_EXCP, em_EXCP, em_EXCP, em_EXCP, em_EXC0, em_EXC0, em_EXC0, em_EXC0, em_EXCM, em_EXCM, em_EXCM, em_EXCM, // 5 - em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_READ, // 6 - em_ADD, em_ADD, em_ADD, em_ADD, em_KSEG, 0, em_ATBZ, em_ATB, em_COMP, em_COMP, em_COMP, em_COMP, em_TAM, em_TAM, em_TAM, em_TAM, // 7 - - em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, // 8 - em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, // 9 - em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, // A - em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, // B - - em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, // C - em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, // D - em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, // E - em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, // F -}; - -offs_t b5500_disassembler::disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) -{ - return common_disasm(b5500_opmap, stream, pc, opcodes, params); -} diff -Nru mame-0.242+dfsg.1/src/devices/cpu/b5000/b5000d.h mame-0.243+dfsg.1/src/devices/cpu/b5000/b5000d.h --- mame-0.242+dfsg.1/src/devices/cpu/b5000/b5000d.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/b5000/b5000d.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,78 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:hap -/* - - Rockwell B5000 family MCU disassembler - -*/ - -#ifndef MAME_CPU_B5000_B5000D_H -#define MAME_CPU_B5000_B5000D_H - -#pragma once - - -class b5000_common_disassembler : public util::disasm_interface -{ -public: - b5000_common_disassembler(); - virtual ~b5000_common_disassembler() = default; - - 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 6; } - virtual offs_t pc_linear_to_real(offs_t pc) const override { return (pc & ~0x3f) | m_l2r[pc & 0x3f]; } - virtual offs_t pc_real_to_linear(offs_t pc) const override { return (pc & ~0x3f) | m_r2l[pc & 0x3f]; } - -protected: - // opcode mnemonics - enum e_mnemonics - { - em_ILL, - em_NOP, em_RSC, em_SC, em_TC, em_TAM, - em_LAX, em_ADX, em_COMP, em_ATB, em_ATBZ, - em_LDA, em_EXC0, em_EXCP, em_EXCM, em_ADD, - em_LB0, em_LB7, em_LB8, em_LB9, em_LB10, em_LB11, - em_RSM, em_SM, em_TM, - em_TL, em_TRA0, em_TRA1, em_RET, - em_TKB, em_TKBS, em_TDIN, em_READ, em_KSEG, em_MTD - }; - - static const char *const s_name[]; - static const u8 s_bits[]; - static const u32 s_flags[]; - - u8 m_l2r[0x40]; - u8 m_r2l[0x40]; - - offs_t increment_pc(offs_t pc); - offs_t common_disasm(const u8 *lut_opmap, std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms); -}; - -class b5000_disassembler : public b5000_common_disassembler -{ -public: - b5000_disassembler() = default; - virtual ~b5000_disassembler() = default; - - virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) override; - -private: - static const u8 b5000_opmap[0x100]; - -}; - -class b5500_disassembler : public b5000_common_disassembler -{ -public: - b5500_disassembler() = default; - virtual ~b5500_disassembler() = default; - - virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) override; - -private: - static const u8 b5500_opmap[0x100]; - -}; - -#endif // MAME_CPU_B5000_B5000D_H diff -Nru mame-0.242+dfsg.1/src/devices/cpu/b5000/b5000.h mame-0.243+dfsg.1/src/devices/cpu/b5000/b5000.h --- mame-0.242+dfsg.1/src/devices/cpu/b5000/b5000.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/b5000/b5000.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,113 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:hap -/* - - Rockwell B5000 MCU - -*/ - -#ifndef MAME_CPU_B5000_B5000_H -#define MAME_CPU_B5000_B5000_H - -#pragma once - -#include "b5000base.h" - -// pinout reference (preliminary) - -/* - _____ _____ - VSS 1 |* \_/ | 42 NC - CLK? 2 | | 41 NC - VC? 3 | | 40 NC - NC 4 | | 39 VDD - NC 5 | | 38 STR8 - NC 6 | | 37 STR7 - NC 7 | | 36 STR6 - NC 8 | | 35 STR5 - NC 9 | | 34 STR4 - NC 10 | B5000 | 33 STR3 - KB3 11 | | 32 STR2 - DIN1? 12 | | 31 STR1 - KB1 13 | | 30 STR0 - KB2 14 | | 29 SEG7 - KB4 15 | | 28 SEG6 - NC 16 | | 27 SEG5 - NC 17 | | 26 SEG4 - NC 18 | | 25 SEG3 - NC 19 | | 24 SEG2 - NC 20 | _ | 23 SEG1 - NC 21 |_____/ \_____| 22 SEG0 - -*/ - -class b5000_cpu_device : public b5000_base_device -{ -public: - b5000_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - -protected: - b5000_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data); - - // device_disasm_interface overrides - virtual std::unique_ptr create_disassembler() override; - - // device_execute_interface overrides - virtual void execute_one() override; - - virtual bool op_canskip(u8 op) override { return !op_is_tl(op); } - virtual bool op_is_tl(u8 op); - virtual bool op_is_lb(u8 op); - virtual bool op_is_atb(u8 op); - virtual void reset_pc() override { set_pc(7, 0); } - virtual u8 sr_page() { return 0; } - virtual u16 decode_digit(u8 data); - - void program_448x8(address_map &map); - void data_45x4(address_map &map); - - // opcode helpers - u8 ram_r(); - void ram_w(u8 data); - void set_pc(u8 pu, u8 pl); - void set_bu(u8 bu); - void seg_w(u16 seg); - void op_illegal(); - - // opcode handlers - virtual void op_tl(); - virtual void op_tra() override; - virtual void op_ret() override; - virtual void op_nop(); - - virtual void op_lb(u8 bl); - virtual void op_atb(); - virtual void op_lda(); - virtual void op_exc0(); - virtual void op_excp(); - virtual void op_excm(); - virtual void op_sm(); - virtual void op_rsm(); - virtual void op_tm(); - virtual void op_tam(); - - virtual void op_lax(); - virtual void op_comp(); - virtual void op_adx(); - virtual void op_add(); - virtual void op_sc(); - virtual void op_rsc(); - virtual void op_tc(); - - virtual void op_kseg(); - virtual void op_atbz() override; - virtual void op_tkb(); - virtual void op_tkbs(); - virtual void op_read(); - virtual void op_tdin(); -}; - - -DECLARE_DEVICE_TYPE(B5000, b5000_cpu_device) - -#endif // MAME_CPU_B5000_B5000_H diff -Nru mame-0.242+dfsg.1/src/devices/cpu/b5000/b5000op.cpp mame-0.243+dfsg.1/src/devices/cpu/b5000/b5000op.cpp --- mame-0.242+dfsg.1/src/devices/cpu/b5000/b5000op.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/b5000/b5000op.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,331 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:hap - -// B5000 common opcode handlers - -#include "emu.h" -#include "b5000.h" - - -// internal helpers - -u8 b5000_cpu_device::ram_r() -{ - return m_data->read_byte(m_ram_addr) & 0xf; -} - -void b5000_cpu_device::ram_w(u8 data) -{ - m_data->write_byte(m_ram_addr, data & 0xf); -} - -void b5000_cpu_device::set_pc(u8 pu, u8 pl) -{ - m_pc = ((pu << 6) | (pl & 0x3f)) & m_prgmask; -} - -void b5000_cpu_device::set_bu(u8 bu) -{ - m_bu = bu & 3; - - // changing to or from 0 delays RAM address modification - if (bool(m_bu) != bool(m_prev_bu)) - m_bu_delay = true; -} - -void b5000_cpu_device::seg_w(u16 seg) -{ - m_write_seg(m_seg = seg); -} - -void b5000_cpu_device::op_illegal() -{ - logerror("unknown opcode $%02X at $%03X\n", m_op, m_prev_pc); -} - - -// opcodes - -// ROM addressing instructions - -void b5000_cpu_device::op_tl() -{ - // TL z: set Pu to z - set_pc(m_op & 0xf, m_pc); - - // S is actually only 6-bit - m_s = (m_pc & ~0x3f) | (m_s & 0x3f); -} - -void b5000_cpu_device::op_tra() -{ - assert(m_tra_step > 0); - - // TRA 0/1,x: call/jump to x (multi step) - switch (m_tra_step) - { - // step 1: skip next opcode - // TL is unskippable, that's how it does long jumps - case 1: - m_skip = true; - break; - - // step 2: handle the call/jump - case 2: - if (!m_sr && ~m_prev_op & 0x40) - { - // call: push P to save register - m_sr = true; - m_s = (m_s & ~0x3f) | (m_prev_pc & 0x3f); - } - if (m_sr) - { - // SR set: set Pu to subroutine page - set_pc(sr_page() ^ BIT(m_prev_op, 6), m_pc); - } - - // set Pl to x - set_pc(m_pc >> 6, m_prev_op); - m_tra_step = 0; - return; - - default: - break; - } - m_tra_step++; -} - -void b5000_cpu_device::op_ret() -{ - assert(m_ret_step > 0); - - // RET: return from subroutine (multi step) - switch (m_ret_step) - { - // step 1: skip next opcode - // a TL after RET will return to the page specified by TL - case 1: - m_skip = true; - break; - - // step 2: handle the ret - case 2: - m_pc = m_s; - m_sr = false; - m_ret_step = 0; - return; - - default: - break; - } - m_ret_step++; -} - -void b5000_cpu_device::op_nop() -{ - // NOP: no operation -} - - -// RAM addressing instructions - -void b5000_cpu_device::op_lb(u8 bl) -{ - // LB x,y: load B from x,y (successive LB/ATB are ignored) - if (!op_is_lb(m_prev_op) && !op_is_atb(m_prev_op)) - { - m_bl = bl; - set_bu(m_op & 3); - } -} - -void b5000_cpu_device::op_atb() -{ - // ATB: load Bl from A (successive LB/ATB are ignored) - if (!op_is_lb(m_prev_op) && !op_is_atb(m_prev_op)) - { - m_bl = m_a; - m_bl_delay = true; - } -} - -void b5000_cpu_device::op_lda() -{ - // LDA x: load A from RAM, XOR Bu with x - m_a = ram_r(); - set_bu(m_op ^ m_bu); -} - -void b5000_cpu_device::op_exc0() -{ - // EXC x,0: exchange A with RAM, XOR Bu with x - u8 a = m_a; - m_a = ram_r(); - ram_w(a); - set_bu(m_op ^ m_bu); -} - -void b5000_cpu_device::op_excp() -{ - // EXC x,+1: EXC x,0 + increment Bl and skip on 3-bit overflow - op_exc0(); - m_bl = (m_bl + 1) & 0xf; - m_skip = (m_bl & 7) == 0; - m_bl_delay = true; -} - -void b5000_cpu_device::op_excm() -{ - // EXC x,-1: EXC x,0 + decrement Bl and skip on overflow - op_exc0(); - m_bl = (m_bl - 1) & 0xf; - m_skip = (m_bl == 0xf); - m_bl_delay = true; -} - -void b5000_cpu_device::op_sm() -{ - // SM x: set bit x in RAM - ram_w(ram_r() | (1 << (m_op & 3))); -} - -void b5000_cpu_device::op_rsm() -{ - // RSM x: reset bit x in RAM - ram_w(ram_r() & ~(1 << (m_op & 3))); -} - -void b5000_cpu_device::op_tm() -{ - // TM x: skip next if bit x in RAM is clear - m_skip = !BIT(ram_r(), m_op & 3); -} - -void b5000_cpu_device::op_tam() -{ - // TAM: skip next if A equals RAM - m_skip = (m_a == ram_r()); -} - - -// arithmetic instructions - -void b5000_cpu_device::op_lax() -{ - // LAX x: load A from x - m_a = ~m_op & 0xf; -} - -void b5000_cpu_device::op_comp() -{ - // COMP: complement A - m_a ^= 0xf; -} - -void b5000_cpu_device::op_adx() -{ - // ADX x: add x to A, skip on no overflow - m_a += ~m_op & 0xf; - m_skip = !BIT(m_a, 4); - m_a &= 0xf; -} - -void b5000_cpu_device::op_add() -{ - // ADD (C),(S): add RAM to A (optional carry/skip) - m_a += ram_r(); - if (~m_op & 2) - { - m_a += m_c; - m_c = BIT(m_a, 4); - } - if (m_op & 1) - m_skip = !BIT(m_a, 4); - m_a &= 0xf; -} - -void b5000_cpu_device::op_sc() -{ - // SC: set carry - m_c = 1; -} - -void b5000_cpu_device::op_rsc() -{ - // RSC: reset carry - m_c = 0; -} - -void b5000_cpu_device::op_tc() -{ - // TC: skip next on carry - m_skip = bool(m_c); -} - - -// I/O instructions - -void b5000_cpu_device::op_kseg() -{ - // KSEG: reset segment outputs - seg_w(0); -} - -void b5000_cpu_device::op_atbz() -{ - assert(m_atbz_step > 0); - - // ATBZ (aka ATB on B5xxx): ATB + load strobe (multi step) - switch (m_atbz_step) - { - // step 1: ATB + KSEG - case 1: - op_atb(); - op_kseg(); - break; - - // step 3: disable strobe - case 3: - m_write_str(0); - break; - - // step 4: load strobe from Bl - case 4: - m_write_str(1 << (m_ram_addr & 0xf)); - m_atbz_step = 0; - return; - - default: - break; - } - m_atbz_step++; -} - -void b5000_cpu_device::op_tkb() -{ - // TKB: skip next if any KB is high - m_skip = (m_read_kb() & 0xf) != 0; -} - -void b5000_cpu_device::op_tkbs() -{ - // TKBS: TKB + load segments - op_tkb(); - - // note: SEG0(DP) from C flag is delayed 2 cycles - seg_w(m_seg | decode_digit(m_prev2_c << 4 | ram_r())); -} - -void b5000_cpu_device::op_read() -{ - // READ: add _KB to A, skip next on no overflow - m_a += (~m_read_kb() & 0xf); - m_skip = !BIT(m_a, 4); - m_a &= 0xf; -} - -void b5000_cpu_device::op_tdin() -{ - // TDIN x: skip next if DIN x is high - m_skip = bool(BIT(m_read_din(), (m_op - 1) & 3)); -} diff -Nru mame-0.242+dfsg.1/src/devices/cpu/b5000/b6000.cpp mame-0.243+dfsg.1/src/devices/cpu/b5000/b6000.cpp --- mame-0.242+dfsg.1/src/devices/cpu/b5000/b6000.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/b5000/b6000.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,107 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:hap -/* - - Rockwell B6000 MCU (based on B5900) - -MCU designed for Mattel's electronic games, I/O is a bit more versatile, -and a speaker output was added. It was succeeded by B6100 with a larger ROM. - -TODO: -- any other changed opcodes? -- confirm digit segment decoder (10, 11, 15 are unused by the games) - -*/ - -#include "emu.h" -#include "b6000.h" - - -DEFINE_DEVICE_TYPE(B6000, b6000_cpu_device, "b6000", "Rockwell B6000") - - -// constructor -b6000_cpu_device::b6000_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data) : - b5000_cpu_device(mconfig, type, tag, owner, clock, prgwidth, program, datawidth, data) -{ } - -b6000_cpu_device::b6000_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : - b6000_cpu_device(mconfig, B6000, tag, owner, clock, 9, address_map_constructor(FUNC(b6000_cpu_device::program_512x8), this), 6, address_map_constructor(FUNC(b6000_cpu_device::data_45x4), this)) -{ } - - -// internal memory maps -void b6000_cpu_device::program_512x8(address_map &map) -{ - map(0x000, 0x1ff).rom(); -} - - -// initialize -void b6000_cpu_device::device_reset() -{ - b5000_cpu_device::device_reset(); - - // clear all registers - m_bl = 0; - m_bu = 0; - m_ram_addr = 0; - m_a = 0; - m_c = 0; - - // clear outputs - seg_w(0); - m_write_str(0); - m_write_spk(0); -} - - -// digit segment decoder -u16 b6000_cpu_device::decode_digit(u8 data) -{ - static u8 lut_segs[0x10] = - { - // 0-9 same as B5000 - 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, - - // ?, ?, none, F, G, ? - 0, 0, 0x00, 0x20, 0x40, 0 - }; - return lut_segs[data & 0xf]; -} - - -//------------------------------------------------- -// execute -//------------------------------------------------- - -void b6000_cpu_device::execute_one() -{ - switch (m_op) - { - case 0x76: op_atbz(); break; - case 0x77: op_atb(); break; - - // rest is same as B5000 - default: b5000_cpu_device::execute_one(); break; - } -} - - -//------------------------------------------------- -// changed opcodes (no need for separate file) -//------------------------------------------------- - -void b6000_cpu_device::op_tkbs() -{ - // TKBS: load segments and speaker (no TKB step) - seg_w(m_seg | decode_digit(ram_r())); - m_write_spk(m_c); -} - -void b6000_cpu_device::op_atbz() -{ - // ATBZ: KSEG + load strobe (no ATB step) - op_kseg(); - m_write_str(1 << m_a); -} diff -Nru mame-0.242+dfsg.1/src/devices/cpu/b5000/b6000.h mame-0.243+dfsg.1/src/devices/cpu/b5000/b6000.h --- mame-0.242+dfsg.1/src/devices/cpu/b5000/b6000.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/b5000/b6000.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,68 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:hap -/* - - Rockwell B6000 MCU - -*/ - -#ifndef MAME_CPU_B5000_B6000_H -#define MAME_CPU_B5000_B6000_H - -#pragma once - -#include "b5000.h" - -// pinout reference (preliminary) - -/* - _____ _____ - SEG0 1 |* \_/ | 42 SEG0P - SEG1 2 | | 41 NC - GRD 3 | | 40 NC - SEG2 4 | | 39 KB1 - SEG3 5 | | 38 KB4 - SEG4 6 | | 37 KB2 - SEG5 7 | | 36 DIN1 - SEG6 8 | | 35 ? - SEG7 9 | | 34 KB3 - STR0 10 | B6000 | 33 NC - STR1 11 | | 32 NC - STR2 12 | | 31 NC - STR3 13 | | 30 NC - STR4 14 | | 29 NC - STR5 15 | | 28 NC - STR6 16 | | 27 NC - STR7 17 | | 26 ? - STR8 18 | | 25 ? - VDD 19 | | 24 VC? - VSS 20 | _ | 23 CLK - NC 21 |_____/ \_____| 22 NC - -*/ - -class b6000_cpu_device : public b5000_cpu_device -{ -public: - b6000_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - -protected: - b6000_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data); - - // device-level overrides - virtual void device_reset() override; - - virtual void execute_one() override; - virtual u16 decode_digit(u8 data) override; - - void program_512x8(address_map &map); - - // opcode handlers - virtual void op_tkbs() override; - virtual void op_atbz() override; -}; - - -DECLARE_DEVICE_TYPE(B6000, b6000_cpu_device) - -#endif // MAME_CPU_B5000_B6000_H diff -Nru mame-0.242+dfsg.1/src/devices/cpu/b5000/b6100.cpp mame-0.243+dfsg.1/src/devices/cpu/b5000/b6100.cpp --- mame-0.242+dfsg.1/src/devices/cpu/b5000/b6100.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/b5000/b6100.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,159 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:hap -/* - - Rockwell B6100 MCU (based on B5500+B6000) - -*/ - -#include "emu.h" -#include "b6100.h" - -#include "b5000d.h" - - -DEFINE_DEVICE_TYPE(B6100, b6100_cpu_device, "b6100", "Rockwell B6100") - - -// constructor -b6100_cpu_device::b6100_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data) : - b6000_cpu_device(mconfig, type, tag, owner, clock, prgwidth, program, datawidth, data) -{ } - -b6100_cpu_device::b6100_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : - b6100_cpu_device(mconfig, B6100, tag, owner, clock, 10, address_map_constructor(FUNC(b6100_cpu_device::program_896x8), this), 6, address_map_constructor(FUNC(b6100_cpu_device::data_48x4), this)) -{ } - - -// internal memory maps -void b6100_cpu_device::program_896x8(address_map &map) -{ - map(0x000, 0x2ff).rom(); - map(0x380, 0x3ff).rom(); -} - -void b6100_cpu_device::data_48x4(address_map &map) -{ - map(0x00, 0x0b).ram(); - map(0x10, 0x1b).ram(); - map(0x20, 0x2b).ram(); - map(0x30, 0x3b).ram(); -} - - -// disasm -std::unique_ptr b6100_cpu_device::create_disassembler() -{ - return std::make_unique(); -} - - -// digit segment decoder -u16 b6100_cpu_device::decode_digit(u8 data) -{ - static u16 lut_segs[0x10] = - { - // 0-9 same as B6000 - 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, - - // EFG, BCG, none, SEG8, SEG9, SEG10 - 0x70, 0x46, 0x00, 0x80, 0x100, 0x200 - }; - return lut_segs[data & 0xf]; -} - - -//------------------------------------------------- -// execute -//------------------------------------------------- - -void b6100_cpu_device::execute_one() -{ - switch (m_op & 0xf0) - { - case 0x40: op_lax(); break; - case 0x60: - if (m_op != 0x6f) - op_adx(); - else - op_read(); - break; - - case 0x80: case 0x90: case 0xa0: case 0xb0: - case 0xc0: case 0xd0: case 0xe0: case 0xf0: - m_tra_step = 1; break; - - default: - switch (m_op & 0xfc) - { - case 0x04: op_tdin(); break; - case 0x08: op_tm(); break; - case 0x10: op_sm(); break; - case 0x14: op_rsm(); break; - case 0x18: m_ret_step = 1; break; - - case 0x1c: op_lb(11); break; - case 0x20: op_lb(7); break; - case 0x24: op_lb(10); break; - case 0x28: op_lb(9); break; - case 0x2c: op_lb(8); break; - case 0x3c: op_lb(0); break; - - case 0x30: case 0x34: case 0x38: op_tl(); break; - - case 0x50: op_lda(); break; - case 0x54: op_excp(); break; - case 0x58: op_exc0(); break; - case 0x5c: op_excm(); break; - case 0x70: op_add(); break; - case 0x78: op_comp(); break; - case 0x7c: op_tam(); break; - - default: - switch (m_op) - { - case 0x00: op_nop(); break; - case 0x01: op_tc(); break; - case 0x02: op_tkb(); break; - case 0x03: op_tkbs(); break; - case 0x0c: op_sc(); break; - case 0x0d: op_rsc(); break; - case 0x74: op_kseg(); break; - case 0x76: op_atbz(); break; - case 0x77: op_atb(); break; - - default: op_illegal(); break; - } - break; // 0xff - - } - break; // 0xfc - } - - // instead of with TKBS, carry flag directly outputs to SPK - if (m_c != m_prev_c) - m_write_spk(m_c); -} - -bool b6100_cpu_device::op_is_tl(u8 op) -{ - return ((op & 0xf8) == 0x30) || ((op & 0xfc) == 0x38); -} - -bool b6100_cpu_device::op_is_lb(u8 op) -{ - return ((op & 0xfc) == 0x1c) || ((op & 0xf0) == 0x20) || ((op & 0xfc) == 0x3c); -} - - -//------------------------------------------------- -// changed opcodes (no need for separate file) -//------------------------------------------------- - -void b6100_cpu_device::op_read() -{ - // READ: add KB to A, skip next on no overflow - m_a += (m_read_kb() & 0xf); - m_skip = !BIT(m_a, 4); - m_a &= 0xf; -} diff -Nru mame-0.242+dfsg.1/src/devices/cpu/b5000/b6100.h mame-0.243+dfsg.1/src/devices/cpu/b5000/b6100.h --- mame-0.242+dfsg.1/src/devices/cpu/b5000/b6100.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/b5000/b6100.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,74 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:hap -/* - - Rockwell B6100 MCU - -*/ - -#ifndef MAME_CPU_B5000_B6100_H -#define MAME_CPU_B5000_B6100_H - -#pragma once - -#include "b6000.h" - -// pinout reference - -/* - _____ _____ - NC 1 |* \_/ | 42 NC - NC 2 | | 41 NC - VSS 3 | | 40 VDD - NC 4 | | 39 STR8 - C12P 5 | | 38 STR7 - NC 6 | | 37 STR6 - NC 7 | | 36 STR5 - NC 8 | | 35 STR4 - VC 9 | | 34 STR3 - DIN4 10 | B6100 | 33 STR2 - DIN2 11 | | 32 STR1 - DIN3 12 | | 31 STR0 - DIN1 13 | | 30 SEG9 - PO 14 | | 29 SEG8 - KB1 15 | | 28 SEG10 - KB2 16 | | 27 SEG1 - KB3 17 | | 26 SEG4 - KB4 18 | | 25 SEG5 - SPKOP 19 | | 24 SEG7 - SPKO 20 | _ | 23 SEG6 - SEG2 21 |_____/ \_____| 22 SEG3 - -*/ - -class b6100_cpu_device : public b6000_cpu_device -{ -public: - b6100_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - -protected: - b6100_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data); - - // device_disasm_interface overrides - virtual std::unique_ptr create_disassembler() override; - - // device_execute_interface overrides - virtual void execute_one() override; - - virtual bool op_is_tl(u8 op) override; - virtual bool op_is_lb(u8 op) override; - virtual void reset_pc() override { set_pc(0, 0); } - virtual u8 sr_page() override { return 15; } - virtual u16 decode_digit(u8 data) override; - - void program_896x8(address_map &map); - void data_48x4(address_map &map); - - // opcode handlers - virtual void op_read() override; -}; - - -DECLARE_DEVICE_TYPE(B6100, b6100_cpu_device) - -#endif // MAME_CPU_B5000_B6100_H diff -Nru mame-0.242+dfsg.1/src/devices/cpu/bcp/bcpdasm.cpp mame-0.243+dfsg.1/src/devices/cpu/bcp/bcpdasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/bcp/bcpdasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/bcp/bcpdasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -7,15 +7,8 @@ ***************************************************************************/ #include "emu.h" -#include "util/disasmintf.h" #include "bcpdasm.h" -#include "util/strformat.h" - -using osd::u32; -using util::BIT; -using offs_t = u32; - //************************************************************************** // BCP DISASSEMBLER @@ -230,12 +223,13 @@ { // 8C00-8DFF, 0000-FFFF: LJMP Rs,p,s,nn (2 + 2 T-states) util::stream_format(stream, "%-8s", "ljmp"); + words |= STEP_COND; } else { // 8E00-8FFF, 0000-FFFF: LCALL Rs,p,s,nn (2 + 2 T-states) util::stream_format(stream, "%-8s", "lcall"); - words |= STEP_OVER; + words |= STEP_OVER | STEP_COND; } format_register(stream, inst & 0x001f); util::stream_format(stream, ",%d,%d,", (inst & 0x00e0) >> 5, BIT(inst, 8)); @@ -304,7 +298,10 @@ // AF00-A7FF: RETF f,s{,{g}{,rf}} (2 or 3 T-states) // AF80-AFF0: RET {g{,rf}} (2 T-states) if (!BIT(inst, 7)) + { util::stream_format(stream, (inst & 0x0070) == 0 ? "r%s" : "r%-7s", cc_to_string(inst & 0x0007, BIT(inst, 3))); + words |= STEP_COND; + } else util::stream_format(stream, (inst & 0x0070) == 0 ? "%s" : "%-8s", "ret"); @@ -455,6 +452,7 @@ // D000-DFFF: JMP f,s,n (2 or 3 T-states) util::stream_format(stream, "j%-7s", cc_to_string((inst & 0x0700) >> 8, BIT(inst, 11))); format_address(stream, pc + 1 + s8(inst & 0x00ff)); + words |= STEP_COND; break; case 0xe000: case 0xf000: diff -Nru mame-0.242+dfsg.1/src/devices/cpu/capricorn/capricorn.cpp mame-0.243+dfsg.1/src/devices/cpu/capricorn/capricorn.cpp --- mame-0.242+dfsg.1/src/devices/cpu/capricorn/capricorn.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/capricorn/capricorn.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -8,7 +8,6 @@ #include "emu.h" #include "capricorn.h" #include "capricorn_dasm.h" -#include "debugger.h" // Register indexes // GP registers are named "R" & the octal representation of the index (00-77) diff -Nru mame-0.242+dfsg.1/src/devices/cpu/capricorn/capricorn_dasm.cpp mame-0.243+dfsg.1/src/devices/cpu/capricorn/capricorn_dasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/capricorn/capricorn_dasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/capricorn/capricorn_dasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -154,21 +154,21 @@ { 0xfc, 0xe8, "PO" , true , 'I' , &capricorn_disassembler::param_dr_id_ar, 0 }, { 0xfc, 0xec, "PU" , true , 'I' , &capricorn_disassembler::param_dr_id_ar, 0 }, { 0xff, 0xf0, "JMP" , false, '\0', &capricorn_disassembler::param_jmp_off, 0 }, - { 0xff, 0xf1, "JNO" , false, '\0', &capricorn_disassembler::param_jmp_off, 0 }, - { 0xff, 0xf2, "JOD" , false, '\0', &capricorn_disassembler::param_jmp_off, 0 }, - { 0xff, 0xf3, "JEV" , false, '\0', &capricorn_disassembler::param_jmp_off, 0 }, - { 0xff, 0xf4, "JNG" , false, '\0', &capricorn_disassembler::param_jmp_off, 0 }, - { 0xff, 0xf5, "JPS" , false, '\0', &capricorn_disassembler::param_jmp_off, 0 }, - { 0xff, 0xf6, "JNZ" , false, '\0', &capricorn_disassembler::param_jmp_off, 0 }, - { 0xff, 0xf7, "JZR" , false, '\0', &capricorn_disassembler::param_jmp_off, 0 }, - { 0xff, 0xf8, "JEN" , false, '\0', &capricorn_disassembler::param_jmp_off, 0 }, - { 0xff, 0xf9, "JEZ" , false, '\0', &capricorn_disassembler::param_jmp_off, 0 }, - { 0xff, 0xfa, "JNC" , false, '\0', &capricorn_disassembler::param_jmp_off, 0 }, - { 0xff, 0xfb, "JCY" , false, '\0', &capricorn_disassembler::param_jmp_off, 0 }, - { 0xff, 0xfc, "JLZ" , false, '\0', &capricorn_disassembler::param_jmp_off, 0 }, - { 0xff, 0xfd, "JLN" , false, '\0', &capricorn_disassembler::param_jmp_off, 0 }, - { 0xff, 0xfe, "JRZ" , false, '\0', &capricorn_disassembler::param_jmp_off, 0 }, - { 0xff, 0xff, "JRN" , false, '\0', &capricorn_disassembler::param_jmp_off, 0 }, + { 0xff, 0xf1, "JNO" , false, '\0', &capricorn_disassembler::param_jmp_off, STEP_COND }, + { 0xff, 0xf2, "JOD" , false, '\0', &capricorn_disassembler::param_jmp_off, STEP_COND }, + { 0xff, 0xf3, "JEV" , false, '\0', &capricorn_disassembler::param_jmp_off, STEP_COND }, + { 0xff, 0xf4, "JNG" , false, '\0', &capricorn_disassembler::param_jmp_off, STEP_COND }, + { 0xff, 0xf5, "JPS" , false, '\0', &capricorn_disassembler::param_jmp_off, STEP_COND }, + { 0xff, 0xf6, "JNZ" , false, '\0', &capricorn_disassembler::param_jmp_off, STEP_COND }, + { 0xff, 0xf7, "JZR" , false, '\0', &capricorn_disassembler::param_jmp_off, STEP_COND }, + { 0xff, 0xf8, "JEN" , false, '\0', &capricorn_disassembler::param_jmp_off, STEP_COND }, + { 0xff, 0xf9, "JEZ" , false, '\0', &capricorn_disassembler::param_jmp_off, STEP_COND }, + { 0xff, 0xfa, "JNC" , false, '\0', &capricorn_disassembler::param_jmp_off, STEP_COND }, + { 0xff, 0xfb, "JCY" , false, '\0', &capricorn_disassembler::param_jmp_off, STEP_COND }, + { 0xff, 0xfc, "JLZ" , false, '\0', &capricorn_disassembler::param_jmp_off, STEP_COND }, + { 0xff, 0xfd, "JLN" , false, '\0', &capricorn_disassembler::param_jmp_off, STEP_COND }, + { 0xff, 0xfe, "JRZ" , false, '\0', &capricorn_disassembler::param_jmp_off, STEP_COND }, + { 0xff, 0xff, "JRN" , false, '\0', &capricorn_disassembler::param_jmp_off, STEP_COND }, // *** END *** {0, 0, nullptr, false, 0, nullptr, 0 } }; diff -Nru mame-0.242+dfsg.1/src/devices/cpu/ccpu/ccpu.cpp mame-0.243+dfsg.1/src/devices/cpu/ccpu/ccpu.cpp --- mame-0.242+dfsg.1/src/devices/cpu/ccpu/ccpu.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/ccpu/ccpu.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -13,7 +13,6 @@ #include "emu.h" #include "ccpu.h" #include "ccpudasm.h" -#include "debugger.h" DEFINE_DEVICE_TYPE(CCPU, ccpu_cpu_device, "ccpu", "Cinematronics CPU") diff -Nru mame-0.242+dfsg.1/src/devices/cpu/ccpu/ccpudasm.cpp mame-0.243+dfsg.1/src/devices/cpu/ccpu/ccpudasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/ccpu/ccpudasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/ccpu/ccpudasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -23,6 +23,7 @@ unsigned startpc = pc; uint8_t opcode = opcodes.r8(pc++); uint8_t tempval; + offs_t flags = 0; switch (opcode) { @@ -85,31 +86,37 @@ /* JMIB/JEHB */ case 0x51: util::stream_format(stream, "JMIB/JEHB"); + flags = STEP_COND; break; /* JVNB */ case 0x52: util::stream_format(stream, "JVNB"); + flags = STEP_COND; break; /* JLTB */ case 0x53: util::stream_format(stream, "JLTB"); + flags = STEP_COND; break; /* JEQB */ case 0x54: util::stream_format(stream, "JEQB"); + flags = STEP_COND; break; /* JCZB */ case 0x55: util::stream_format(stream, "JCZB"); + flags = STEP_COND; break; /* JOSB */ case 0x56: util::stream_format(stream, "JOSB"); + flags = STEP_COND; break; /* SSA */ @@ -125,31 +132,37 @@ /* JMI/JEH */ case 0x59: util::stream_format(stream, "JMI/JEH"); + flags = STEP_COND; break; /* JVN */ case 0x5a: util::stream_format(stream, "JVN"); + flags = STEP_COND; break; /* JLT */ case 0x5b: util::stream_format(stream, "JLT"); + flags = STEP_COND; break; /* JEQ */ case 0x5c: util::stream_format(stream, "JEQ"); + flags = STEP_COND; break; /* JCZ */ case 0x5d: util::stream_format(stream, "JCZ"); + flags = STEP_COND; break; /* JOS */ case 0x5e: util::stream_format(stream, "JOS"); + flags = STEP_COND; break; /* NOP */ @@ -330,5 +343,5 @@ break; } - return (pc - startpc) | SUPPORTED; + return (pc - startpc) | flags | SUPPORTED; } diff -Nru mame-0.242+dfsg.1/src/devices/cpu/clipper/clipper.cpp mame-0.243+dfsg.1/src/devices/cpu/clipper/clipper.cpp --- mame-0.242+dfsg.1/src/devices/cpu/clipper/clipper.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/clipper/clipper.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -14,7 +14,6 @@ */ #include "emu.h" -#include "debugger.h" #include "clipper.h" #include "clipperd.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/clipper/clipperd.cpp mame-0.243+dfsg.1/src/devices/cpu/clipper/clipperd.cpp --- mame-0.242+dfsg.1/src/devices/cpu/clipper/clipperd.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/clipper/clipperd.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -150,22 +150,22 @@ case 0x46: util::stream_format(stream, "loadd2 (r%d),f%d", R1, R2); bytes = 2; break; case 0x47: util::stream_format(stream, "loadd2 %s,f%d", address(pc, opcodes), ADDR_R2); bytes = 2 + ADDR_SIZE; break; #endif - case 0x48: util::stream_format(stream, "b%-4s (r%d)", cc[R2], R1); bytes = 2; break; - case 0x49: util::stream_format(stream, "b%-4s %s", cc[ADDR_R2], address(pc, opcodes)); bytes = 2 + ADDR_SIZE; break; + case 0x48: util::stream_format(stream, "b%-4s (r%d)", cc[R2], R1); bytes = 2; if (R2 != 0) flags |= STEP_COND; break; + case 0x49: util::stream_format(stream, "b%-4s %s", cc[ADDR_R2], address(pc, opcodes)); bytes = 2 + ADDR_SIZE; if (ADDR_R2 != 0) flags |= STEP_COND; break; #if C400_INSTRUCTIONS // delayed branches - case 0x4a: util::stream_format(stream, "cdb r%d,(r%d)", R2, R1); bytes = 2; break; - case 0x4b: util::stream_format(stream, "cdb r%d,%s", ADDR_R2, address(pc, opcodes)); bytes = 2 + ADDR_SIZE; break; - case 0x4c: util::stream_format(stream, "cdbeq r%d,(r%d)", R2, R1); bytes = 2; break; - case 0x4d: util::stream_format(stream, "cdbeq r%d,%s", ADDR_R2, address(pc, opcodes)); bytes = 2 + ADDR_SIZE; break; - case 0x4e: util::stream_format(stream, "cdbne r%d,(r%d)", R2, R1); bytes = 2; break; - case 0x4f: util::stream_format(stream, "cdbne r%d,%s", ADDR_R2, address(pc, opcodes)); bytes = 2 + ADDR_SIZE; break; - case 0x50: util::stream_format(stream, "db%-4s (r%d)", cc[R2], R1); bytes = 2; break; - case 0x51: util::stream_format(stream, "db%-4s %s", cc[ADDR_R2], address(pc, opcodes)); bytes = 2 + ADDR_SIZE; break; + case 0x4a: util::stream_format(stream, "cdb r%d,(r%d)", R2, R1); bytes = 2; flags |= STEP_COND | step_over_extra(2); break; + case 0x4b: util::stream_format(stream, "cdb r%d,%s", ADDR_R2, address(pc, opcodes)); bytes = 2 + ADDR_SIZE; flags |= STEP_COND | step_over_extra(2); break; + case 0x4c: util::stream_format(stream, "cdbeq r%d,(r%d)", R2, R1); bytes = 2; flags |= STEP_COND | step_over_extra(2); break; + case 0x4d: util::stream_format(stream, "cdbeq r%d,%s", ADDR_R2, address(pc, opcodes)); bytes = 2 + ADDR_SIZE; flags |= STEP_COND | step_over_extra(2); break; + case 0x4e: util::stream_format(stream, "cdbne r%d,(r%d)", R2, R1); bytes = 2; flags |= STEP_COND | step_over_extra(2); break; + case 0x4f: util::stream_format(stream, "cdbne r%d,%s", ADDR_R2, address(pc, opcodes)); bytes = 2 + ADDR_SIZE; flags |= STEP_COND | step_over_extra(2); break; + case 0x50: util::stream_format(stream, "db%-4s (r%d)", cc[R2], R1); bytes = 2; if (R2 != 0) flags |= STEP_COND | step_over_extra(2); break; + case 0x51: util::stream_format(stream, "db%-4s %s", cc[ADDR_R2], address(pc, opcodes)); bytes = 2 + ADDR_SIZE; if (ADDR_R2 != 0) flags |= STEP_COND | step_over_extra(2); break; #else // these instructions are in the C300 documentation, but appear to be replaced in the C400 - case 0x4c: util::stream_format(stream, "bf%s (r%d)", R2 == 0 ? "any" : "bad", R1); bytes = 2; break; - case 0x4d: util::stream_format(stream, "bf%s %s", ADDR_R2 == 0 ? "any" : "bad", address(pc, opcodes)); bytes = 2 + ADDR_SIZE; break; + case 0x4c: util::stream_format(stream, "bf%s (r%d)", R2 == 0 ? "any" : "bad", R1); bytes = 2; flags |= STEP_COND; break; + case 0x4d: util::stream_format(stream, "bf%s %s", ADDR_R2 == 0 ? "any" : "bad", address(pc, opcodes)); bytes = 2 + ADDR_SIZE; flags |= STEP_COND; break; #endif case 0x60: util::stream_format(stream, "loadw (r%d),r%d", R1, R2); bytes = 2; break; diff -Nru mame-0.242+dfsg.1/src/devices/cpu/cop400/cop400.cpp mame-0.243+dfsg.1/src/devices/cpu/cop400/cop400.cpp --- mame-0.242+dfsg.1/src/devices/cpu/cop400/cop400.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/cop400/cop400.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -57,7 +57,6 @@ */ #include "emu.h" -#include "debugger.h" #include "cop400.h" #include "cop410ds.h" #include "cop420ds.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/cop400/cop410ds.cpp mame-0.243+dfsg.1/src/devices/cpu/cop400/cop410ds.cpp --- mame-0.242+dfsg.1/src/devices/cpu/cop400/cop410ds.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/cop400/cop410ds.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -67,6 +67,7 @@ else if (opcode >= 0x51 && opcode <= 0x5F) { util::stream_format(stream, "AISC %u", opcode & 0xF); + flags = STEP_COND; } else if (opcode >= 0x60 && opcode <= 0x61) { @@ -95,6 +96,7 @@ case 1: util::stream_format(stream, "SKMBZ 0"); + flags = STEP_COND; break; case 2: @@ -103,10 +105,12 @@ case 3: util::stream_format(stream, "SKMBZ 2"); + flags = STEP_COND; break; case 4: util::stream_format(stream, "XIS 0"); + flags = STEP_COND; break; case 5: @@ -119,18 +123,22 @@ case 7: util::stream_format(stream, "XDS 0"); + flags = STEP_COND; break; case 0x11: util::stream_format(stream, "SKMBZ 1"); + flags = STEP_COND; break; case 0x13: util::stream_format(stream, "SKMBZ 3"); + flags = STEP_COND; break; case 0x14: util::stream_format(stream, "XIS 1"); + flags = STEP_COND; break; case 0x15: @@ -143,14 +151,17 @@ case 0x17: util::stream_format(stream, "XDS 1"); + flags = STEP_COND; break; case 0x20: util::stream_format(stream, "SKC"); + flags = STEP_COND; break; case 0x21: util::stream_format(stream, "SKE"); + flags = STEP_COND; break; case 0x22: @@ -173,6 +184,7 @@ case 0x24: util::stream_format(stream, "XIS 2"); + flags = STEP_COND; break; case 0x25: @@ -185,10 +197,12 @@ case 0x27: util::stream_format(stream, "XDS 2"); + flags = STEP_COND; break; case 0x30: util::stream_format(stream, "ASC"); + flags = STEP_COND; break; case 0x31: @@ -212,22 +226,27 @@ { case 0x01: util::stream_format(stream, "SKGBZ 0"); + flags = STEP_COND; break; case 0x03: util::stream_format(stream, "SKGBZ 2"); + flags = STEP_COND; break; case 0x11: util::stream_format(stream, "SKGBZ 1"); + flags = STEP_COND; break; case 0x13: util::stream_format(stream, "SKGBZ 3"); + flags = STEP_COND; break; case 0x21: util::stream_format(stream, "SKGZ"); + flags = STEP_COND; break; case 0x2A: @@ -264,6 +283,7 @@ case 0x34: util::stream_format(stream, "XIS 3"); + flags = STEP_COND; break; case 0x35: @@ -276,6 +296,7 @@ case 0x37: util::stream_format(stream, "XDS 3"); + flags = STEP_COND; break; case 0x40: diff -Nru mame-0.242+dfsg.1/src/devices/cpu/cop400/cop420ds.cpp mame-0.243+dfsg.1/src/devices/cpu/cop400/cop420ds.cpp --- mame-0.242+dfsg.1/src/devices/cpu/cop400/cop420ds.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/cop400/cop420ds.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -67,6 +67,7 @@ else if (opcode >= 0x51 && opcode <= 0x5F) { util::stream_format(stream, "AISC %u", opcode & 0xF); + flags = STEP_COND; } else if (opcode >= 0x60 && opcode <= 0x63) { @@ -95,6 +96,7 @@ case 1: util::stream_format(stream, "SKMBZ 0"); + flags = STEP_COND; break; case 2: @@ -103,10 +105,12 @@ case 3: util::stream_format(stream, "SKMBZ 2"); + flags = STEP_COND; break; case 4: util::stream_format(stream, "XIS 0"); + flags = STEP_COND; break; case 5: @@ -119,14 +123,17 @@ case 7: util::stream_format(stream, "XDS 0"); + flags = STEP_COND; break; case 0x10: util::stream_format(stream, "CASC"); + flags = STEP_COND; break; case 0x11: util::stream_format(stream, "SKMBZ 1"); + flags = STEP_COND; break; case 0x12: @@ -135,10 +142,12 @@ case 0x13: util::stream_format(stream, "SKMBZ 3"); + flags = STEP_COND; break; case 0x14: util::stream_format(stream, "XIS 1"); + flags = STEP_COND; break; case 0x15: @@ -151,14 +160,17 @@ case 0x17: util::stream_format(stream, "XDS 1"); + flags = STEP_COND; break; case 0x20: util::stream_format(stream, "SKC"); + flags = STEP_COND; break; case 0x21: util::stream_format(stream, "SKE"); + flags = STEP_COND; break; case 0x22: @@ -186,6 +198,7 @@ case 0x24: util::stream_format(stream, "XIS 2"); + flags = STEP_COND; break; case 0x25: @@ -198,10 +211,12 @@ case 0x27: util::stream_format(stream, "XDS 2"); + flags = STEP_COND; break; case 0x30: util::stream_format(stream, "ASC"); + flags = STEP_COND; break; case 0x31: @@ -245,22 +260,27 @@ { case 0x01: util::stream_format(stream, "SKGBZ 0"); + flags = STEP_COND; break; case 0x03: util::stream_format(stream, "SKGBZ 2"); + flags = STEP_COND; break; case 0x11: util::stream_format(stream, "SKGBZ 1"); + flags = STEP_COND; break; case 0x13: util::stream_format(stream, "SKGBZ 3"); + flags = STEP_COND; break; case 0x21: util::stream_format(stream, "SKGZ"); + flags = STEP_COND; break; case 0x28: @@ -304,6 +324,7 @@ case 0x34: util::stream_format(stream, "XIS 3"); + flags = STEP_COND; break; case 0x35: @@ -316,6 +337,7 @@ case 0x37: util::stream_format(stream, "XDS 3"); + flags = STEP_COND; break; case 0x40: @@ -324,6 +346,7 @@ case 0x41: util::stream_format(stream, "SKT"); + flags = STEP_COND; break; case 0x42: diff -Nru mame-0.242+dfsg.1/src/devices/cpu/cop400/cop424ds.cpp mame-0.243+dfsg.1/src/devices/cpu/cop400/cop424ds.cpp --- mame-0.242+dfsg.1/src/devices/cpu/cop400/cop424ds.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/cop400/cop424ds.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -67,6 +67,7 @@ else if (opcode >= 0x51 && opcode <= 0x5F) { util::stream_format(stream, "AISC %u", opcode & 0xF); + flags = STEP_COND; } else if (opcode >= 0x60 && opcode <= 0x67) { @@ -95,6 +96,7 @@ case 1: util::stream_format(stream, "SKMBZ 0"); + flags = STEP_COND; break; case 2: @@ -103,10 +105,12 @@ case 3: util::stream_format(stream, "SKMBZ 2"); + flags = STEP_COND; break; case 4: util::stream_format(stream, "XIS 0"); + flags = STEP_COND; break; case 5: @@ -119,14 +123,17 @@ case 7: util::stream_format(stream, "XDS 0"); + flags = STEP_COND; break; case 0x10: util::stream_format(stream, "CASC"); + flags = STEP_COND; break; case 0x11: util::stream_format(stream, "SKMBZ 1"); + flags = STEP_COND; break; case 0x12: @@ -135,10 +142,12 @@ case 0x13: util::stream_format(stream, "SKMBZ 3"); + flags = STEP_COND; break; case 0x14: util::stream_format(stream, "XIS 1"); + flags = STEP_COND; break; case 0x15: @@ -151,14 +160,17 @@ case 0x17: util::stream_format(stream, "XDS 1"); + flags = STEP_COND; break; case 0x20: util::stream_format(stream, "SKC"); + flags = STEP_COND; break; case 0x21: util::stream_format(stream, "SKE"); + flags = STEP_COND; break; case 0x22: @@ -182,6 +194,7 @@ case 0x24: util::stream_format(stream, "XIS 2"); + flags = STEP_COND; break; case 0x25: @@ -194,10 +207,12 @@ case 0x27: util::stream_format(stream, "XDS 2"); + flags = STEP_COND; break; case 0x30: util::stream_format(stream, "ASC"); + flags = STEP_COND; break; case 0x31: @@ -229,22 +244,27 @@ { case 0x01: util::stream_format(stream, "SKGBZ 0"); + flags = STEP_COND; break; case 0x03: util::stream_format(stream, "SKGBZ 2"); + flags = STEP_COND; break; case 0x11: util::stream_format(stream, "SKGBZ 1"); + flags = STEP_COND; break; case 0x13: util::stream_format(stream, "SKGBZ 3"); + flags = STEP_COND; break; case 0x21: util::stream_format(stream, "SKGZ"); + flags = STEP_COND; break; case 0x28: @@ -305,6 +325,7 @@ case 0x34: util::stream_format(stream, "XIS 3"); + flags = STEP_COND; break; case 0x35: @@ -317,6 +338,7 @@ case 0x37: util::stream_format(stream, "XDS 3"); + flags = STEP_COND; break; case 0x40: @@ -325,6 +347,7 @@ case 0x41: util::stream_format(stream, "SKT"); + flags = STEP_COND; break; case 0x42: diff -Nru mame-0.242+dfsg.1/src/devices/cpu/cop400/cop444ds.cpp mame-0.243+dfsg.1/src/devices/cpu/cop400/cop444ds.cpp --- mame-0.242+dfsg.1/src/devices/cpu/cop400/cop444ds.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/cop400/cop444ds.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -67,6 +67,7 @@ else if (opcode >= 0x51 && opcode <= 0x5F) { util::stream_format(stream, "AISC %u", opcode & 0xF); + flags = STEP_COND; } else if (opcode >= 0x60 && opcode <= 0x67) { @@ -95,6 +96,7 @@ case 1: util::stream_format(stream, "SKMBZ 0"); + flags = STEP_COND; break; case 2: @@ -103,10 +105,12 @@ case 3: util::stream_format(stream, "SKMBZ 2"); + flags = STEP_COND; break; case 4: util::stream_format(stream, "XIS 0"); + flags = STEP_COND; break; case 5: @@ -119,14 +123,17 @@ case 7: util::stream_format(stream, "XDS 0"); + flags = STEP_COND; break; case 0x10: util::stream_format(stream, "CASC"); + flags = STEP_COND; break; case 0x11: util::stream_format(stream, "SKMBZ 1"); + flags = STEP_COND; break; case 0x12: @@ -135,10 +142,12 @@ case 0x13: util::stream_format(stream, "SKMBZ 3"); + flags = STEP_COND; break; case 0x14: util::stream_format(stream, "XIS 1"); + flags = STEP_COND; break; case 0x15: @@ -151,14 +160,17 @@ case 0x17: util::stream_format(stream, "XDS 1"); + flags = STEP_COND; break; case 0x20: util::stream_format(stream, "SKC"); + flags = STEP_COND; break; case 0x21: util::stream_format(stream, "SKE"); + flags = STEP_COND; break; case 0x22: @@ -182,6 +194,7 @@ case 0x24: util::stream_format(stream, "XIS 2"); + flags = STEP_COND; break; case 0x25: @@ -194,10 +207,12 @@ case 0x27: util::stream_format(stream, "XDS 2"); + flags = STEP_COND; break; case 0x30: util::stream_format(stream, "ASC"); + flags = STEP_COND; break; case 0x31: @@ -229,22 +244,27 @@ { case 0x01: util::stream_format(stream, "SKGBZ 0"); + flags = STEP_COND; break; case 0x03: util::stream_format(stream, "SKGBZ 2"); + flags = STEP_COND; break; case 0x11: util::stream_format(stream, "SKGBZ 1"); + flags = STEP_COND; break; case 0x13: util::stream_format(stream, "SKGBZ 3"); + flags = STEP_COND; break; case 0x21: util::stream_format(stream, "SKGZ"); + flags = STEP_COND; break; case 0x28: @@ -288,6 +308,7 @@ case 0x34: util::stream_format(stream, "XIS 3"); + flags = STEP_COND; break; case 0x35: @@ -300,6 +321,7 @@ case 0x37: util::stream_format(stream, "XDS 3"); + flags = STEP_COND; break; case 0x40: @@ -308,6 +330,7 @@ case 0x41: util::stream_format(stream, "SKT"); + flags = STEP_COND; break; case 0x42: diff -Nru mame-0.242+dfsg.1/src/devices/cpu/cops1/cops1base.cpp mame-0.243+dfsg.1/src/devices/cpu/cops1/cops1base.cpp --- mame-0.242+dfsg.1/src/devices/cpu/cops1/cops1base.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/cops1/cops1base.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -33,8 +33,6 @@ #include "emu.h" #include "cops1base.h" -#include "debugger.h" - cops1_base_device::cops1_base_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data) : cpu_device(mconfig, type, tag, owner, clock), diff -Nru mame-0.242+dfsg.1/src/devices/cpu/cops1/cops1d.cpp mame-0.243+dfsg.1/src/devices/cpu/cops1/cops1d.cpp --- mame-0.242+dfsg.1/src/devices/cpu/cops1/cops1d.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/cops1/cops1d.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -60,11 +60,11 @@ const u32 cops1_common_disassembler::s_flags[] = { 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, + 0, STEP_COND, STEP_COND, 0, 0, STEP_COND, 0, STEP_COND, 0, 0, STEP_COND, + STEP_COND, STEP_COND, STEP_COND, STEP_COND, 0, 0, 0, 0, 0, 0, 0, STEP_OVER, STEP_OUT, STEP_OUT, 0, STEP_OVER, 0, - 0, 0, 0, 0, 0, + 0, STEP_COND, STEP_COND, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; diff -Nru mame-0.242+dfsg.1/src/devices/cpu/cosmac/cosdasm.cpp mame-0.243+dfsg.1/src/devices/cpu/cosmac/cosdasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/cosmac/cosdasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/cosmac/cosdasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -150,19 +150,19 @@ case 0x28: case 0x29: case 0x2a: case 0x2b: case 0x2c: case 0x2d: case 0x2e: case 0x2f: CDP1801_OPCODE("DEC R%d", implied(opcode)); break; case 0x30: CDP1801_OPCODE("BR %04X", short_branch(base_pc, pc, params)); break; - case 0x32: CDP1801_OPCODE("BZ %04X", short_branch(base_pc, pc, params)); break; - case 0x33: CDP1801_OPCODE("BDF %04X", short_branch(base_pc, pc, params)); break; - case 0x34: CDP1801_OPCODE("B1 %04X", short_branch(base_pc, pc, params)); break; - case 0x35: CDP1801_OPCODE("B2 %04X", short_branch(base_pc, pc, params)); break; - case 0x36: CDP1801_OPCODE("B3 %04X", short_branch(base_pc, pc, params)); break; - case 0x37: CDP1801_OPCODE("B4 %04X", short_branch(base_pc, pc, params)); break; + case 0x32: CDP1801_OPCODE("BZ %04X", short_branch(base_pc, pc, params)); flags = STEP_COND; break; + case 0x33: CDP1801_OPCODE("BDF %04X", short_branch(base_pc, pc, params)); flags = STEP_COND; break; + case 0x34: CDP1801_OPCODE("B1 %04X", short_branch(base_pc, pc, params)); flags = STEP_COND; break; + case 0x35: CDP1801_OPCODE("B2 %04X", short_branch(base_pc, pc, params)); flags = STEP_COND; break; + case 0x36: CDP1801_OPCODE("B3 %04X", short_branch(base_pc, pc, params)); flags = STEP_COND; break; + case 0x37: CDP1801_OPCODE("B4 %04X", short_branch(base_pc, pc, params)); flags = STEP_COND; break; case 0x38: CDP1801_OPCODE("SKP %04X", short_skip(pc)); break; - case 0x3a: CDP1801_OPCODE("BNZ %04X", short_branch(base_pc, pc, params)); break; - case 0x3b: CDP1801_OPCODE("BNF %04X", short_branch(base_pc, pc, params)); break; - case 0x3c: CDP1801_OPCODE("BN1 %04X", short_branch(base_pc, pc, params)); break; - case 0x3d: CDP1801_OPCODE("BN2 %04X", short_branch(base_pc, pc, params)); break; - case 0x3e: CDP1801_OPCODE("BN3 %04X", short_branch(base_pc, pc, params)); break; - case 0x3f: CDP1801_OPCODE("BN4 %04X", short_branch(base_pc, pc, params)); break; + case 0x3a: CDP1801_OPCODE("BNZ %04X", short_branch(base_pc, pc, params)); flags = STEP_COND; break; + case 0x3b: CDP1801_OPCODE("BNF %04X", short_branch(base_pc, pc, params)); flags = STEP_COND; break; + case 0x3c: CDP1801_OPCODE("BN1 %04X", short_branch(base_pc, pc, params)); flags = STEP_COND; break; + case 0x3d: CDP1801_OPCODE("BN2 %04X", short_branch(base_pc, pc, params)); flags = STEP_COND; break; + case 0x3e: CDP1801_OPCODE("BN3 %04X", short_branch(base_pc, pc, params)); flags = STEP_COND; break; + case 0x3f: CDP1801_OPCODE("BN4 %04X", short_branch(base_pc, pc, params)); flags = STEP_COND; break; case 0x40: case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: case 0x48: case 0x49: case 0x4a: case 0x4b: case 0x4c: case 0x4d: case 0x4e: case 0x4f: CDP1801_OPCODE("LDA R%d", implied(opcode)); break; @@ -213,8 +213,8 @@ case 0xfd: CDP1801_OPCODE("SDI #%02X", immediate(pc, params)); break; case 0xff: CDP1801_OPCODE("SMI #%02X", immediate(pc, params)); break; // CDP1802 - case 0x31: CDP1802_OPCODE("BQ %04X", short_branch(base_pc, pc, params)); break; - case 0x39: CDP1802_OPCODE("BNQ %04X", short_branch(base_pc, pc, params)); break; + case 0x31: CDP1802_OPCODE("BQ %04X", short_branch(base_pc, pc, params)); flags = STEP_COND; break; + case 0x39: CDP1802_OPCODE("BNQ %04X", short_branch(base_pc, pc, params)); flags = STEP_COND; break; case 0x60: util::stream_format(stream, m_variant < TYPE_1802 ? "OUT 0" : "IRX"); if (m_config && m_config->get_p() == m_config->get_x()) @@ -235,21 +235,21 @@ case 0x7e: CDP1802_OPCODE("SHLC"); break; case 0x7f: CDP1802_OPCODE("SMBI #%02X", immediate(pc, params)); break; case 0xc0: CDP1802_OPCODE("LBR %04X", long_branch(pc, params)); break; - case 0xc1: CDP1802_OPCODE("LBQ %04X", long_branch(pc, params)); break; - case 0xc2: CDP1802_OPCODE("LBZ %04X", long_branch(pc, params)); break; - case 0xc3: CDP1802_OPCODE("LBDF %04X", long_branch(pc, params)); break; + case 0xc1: CDP1802_OPCODE("LBQ %04X", long_branch(pc, params)); flags = STEP_COND; break; + case 0xc2: CDP1802_OPCODE("LBZ %04X", long_branch(pc, params)); flags = STEP_COND; break; + case 0xc3: CDP1802_OPCODE("LBDF %04X", long_branch(pc, params)); flags = STEP_COND; break; case 0xc4: CDP1802_OPCODE("NOP"); break; - case 0xc5: CDP1802_OPCODE("LSNQ %04X", long_skip(pc)); break; - case 0xc6: CDP1802_OPCODE("LSNZ %04X", long_skip(pc)); break; - case 0xc7: CDP1802_OPCODE("LSNF %04X", long_skip(pc)); break; + case 0xc5: CDP1802_OPCODE("LSNQ %04X", long_skip(pc)); flags = STEP_COND; break; + case 0xc6: CDP1802_OPCODE("LSNZ %04X", long_skip(pc)); flags = STEP_COND; break; + case 0xc7: CDP1802_OPCODE("LSNF %04X", long_skip(pc)); flags = STEP_COND; break; case 0xc8: CDP1802_OPCODE("LSKP %04X", long_skip(pc)); break; - case 0xc9: CDP1802_OPCODE("LBNQ %04X", long_skip(pc)); break; - case 0xca: CDP1802_OPCODE("LBNZ %04X", long_skip(pc)); break; - case 0xcb: CDP1802_OPCODE("LBNF %04X", long_skip(pc)); break; - case 0xcc: CDP1802_OPCODE("LSIE %04X", long_skip(pc)); break; - case 0xcd: CDP1802_OPCODE("LSQ %04X", long_skip(pc)); break; - case 0xce: CDP1802_OPCODE("LSZ %04X", long_skip(pc)); break; - case 0xcf: CDP1802_OPCODE("LSDF %04X", long_skip(pc)); break; + case 0xc9: CDP1802_OPCODE("LBNQ %04X", long_skip(pc)); flags = STEP_COND; break; + case 0xca: CDP1802_OPCODE("LBNZ %04X", long_skip(pc)); flags = STEP_COND; break; + case 0xcb: CDP1802_OPCODE("LBNF %04X", long_skip(pc)); flags = STEP_COND; break; + case 0xcc: CDP1802_OPCODE("LSIE %04X", long_skip(pc)); flags = STEP_COND; break; + case 0xcd: CDP1802_OPCODE("LSQ %04X", long_skip(pc)); flags = STEP_COND; break; + case 0xce: CDP1802_OPCODE("LSZ %04X", long_skip(pc)); flags = STEP_COND; break; + case 0xcf: CDP1802_OPCODE("LSDF %04X", long_skip(pc)); flags = STEP_COND; break; case 0xfe: CDP1802_OPCODE("SHL"); break; // default: CDP1801_OPCODE("illegal"); break; diff -Nru mame-0.242+dfsg.1/src/devices/cpu/cosmac/cosmac.cpp mame-0.243+dfsg.1/src/devices/cpu/cosmac/cosmac.cpp --- mame-0.242+dfsg.1/src/devices/cpu/cosmac/cosmac.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/cosmac/cosmac.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -16,7 +16,6 @@ **********************************************************************/ #include "emu.h" -#include "debugger.h" #include "cosmac.h" // permit our enums to be saved diff -Nru mame-0.242+dfsg.1/src/devices/cpu/cp1610/1610dasm.cpp mame-0.243+dfsg.1/src/devices/cpu/cp1610/1610dasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/cp1610/1610dasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/cp1610/1610dasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -778,36 +778,43 @@ size += 1; ea = oprom16[1]; util::stream_format(stream, "BC %04X",pc+2+ea); + flags = STEP_COND; break; case 0x202: /* 1 000 000 010 */ size += 1; ea = oprom16[1]; util::stream_format(stream, "BOV %04X",pc+2+ea); + flags = STEP_COND; break; case 0x203: /* 1 000 000 011 */ size += 1; ea = oprom16[1]; util::stream_format(stream, "BPL %04X",pc+2+ea); + flags = STEP_COND; break; case 0x204: /* 1 000 000 100 */ size += 1; ea = oprom16[1]; util::stream_format(stream, "BZE %04X",pc+2+ea); + flags = STEP_COND; break; case 0x205: /* 1 000 000 101 */ size += 1; ea = oprom16[1]; util::stream_format(stream, "BLT %04X",pc+2+ea); + flags = STEP_COND; break; case 0x206: /* 1 000 000 110 */ size += 1; ea = oprom16[1]; util::stream_format(stream, "BLE %04X",pc+2+ea); + flags = STEP_COND; break; case 0x207: /* 1 000 000 111 */ size += 1; ea = oprom16[1]; util::stream_format(stream, "BUSC %04X",pc+2+ea); + flags = STEP_COND; break; case 0x208: /* 1 000 001 000 */ size += 1; @@ -818,36 +825,43 @@ size += 1; ea = oprom16[1]; util::stream_format(stream, "BNC %04X",pc+2+ea); + flags = STEP_COND; break; case 0x20a: /* 1 000 001 010 */ size += 1; ea = oprom16[1]; util::stream_format(stream, "BNOV %04X",pc+2+ea); + flags = STEP_COND; break; case 0x20b: /* 1 000 001 011 */ size += 1; ea = oprom16[1]; util::stream_format(stream, "BMI %04X",pc+2+ea); + flags = STEP_COND; break; case 0x20c: /* 1 000 001 100 */ size += 1; ea = oprom16[1]; util::stream_format(stream, "BNZE %04X",pc+2+ea); + flags = STEP_COND; break; case 0x20d: /* 1 000 001 101 */ size += 1; ea = oprom16[1]; util::stream_format(stream, "BGE %04X",pc+2+ea); + flags = STEP_COND; break; case 0x20e: /* 1 000 001 110 */ size += 1; ea = oprom16[1]; util::stream_format(stream, "BGT %04X",pc+2+ea); + flags = STEP_COND; break; case 0x20f: /* 1 000 001 111 */ size += 1; ea = oprom16[1]; util::stream_format(stream, "BESC %04X",pc+2+ea); + flags = STEP_COND; break; case 0x210: /* 1 000 010 000 */ case 0x211: /* 1 000 010 001 */ @@ -868,6 +882,7 @@ size += 1; ea = oprom16[1]; util::stream_format(stream, "BEXT %04X,%01X",pc+2+ea,op&0x0f); + flags = STEP_COND; break; case 0x220: /* 1 000 100 000 */ size += 1; @@ -878,36 +893,43 @@ size += 1; ea = oprom16[1]; util::stream_format(stream, "BC %04X",pc+1-ea); + flags = STEP_COND; break; case 0x222: /* 1 000 100 010 */ size += 1; ea = oprom16[1]; util::stream_format(stream, "BOV %04X",pc+1-ea); + flags = STEP_COND; break; case 0x223: /* 1 000 100 011 */ size += 1; ea = oprom16[1]; util::stream_format(stream, "BPL %04X",pc+1-ea); + flags = STEP_COND; break; case 0x224: /* 1 000 100 100 */ size += 1; ea = oprom16[1]; util::stream_format(stream, "BZE %04X",pc+1-ea); + flags = STEP_COND; break; case 0x225: /* 1 000 100 101 */ size += 1; ea = oprom16[1]; util::stream_format(stream, "BLT %04X",pc+1-ea); + flags = STEP_COND; break; case 0x226: /* 1 000 100 110 */ size += 1; ea = oprom16[1]; util::stream_format(stream, "BLE %04X",pc+1-ea); + flags = STEP_COND; break; case 0x227: /* 1 000 100 111 */ size += 1; ea = oprom16[1]; util::stream_format(stream, "BUSC %04X",pc+1-ea); + flags = STEP_COND; break; case 0x228: /* 1 000 101 000 */ size += 1; @@ -918,36 +940,43 @@ size += 1; ea = oprom16[1]; util::stream_format(stream, "BNC %04X",pc+1-ea); + flags = STEP_COND; break; case 0x22a: /* 1 000 101 010 */ size += 1; ea = oprom16[1]; util::stream_format(stream, "BNOV %04X",pc+1-ea); + flags = STEP_COND; break; case 0x22b: /* 1 000 101 011 */ size += 1; ea = oprom16[1]; util::stream_format(stream, "BMI %04X",pc+1-ea); + flags = STEP_COND; break; case 0x22c: /* 1 000 101 100 */ size += 1; ea = oprom16[1]; util::stream_format(stream, "BNZE %04X",pc+1-ea); + flags = STEP_COND; break; case 0x22d: /* 1 000 101 101 */ size += 1; ea = oprom16[1]; util::stream_format(stream, "BGE %04X",pc+1-ea); + flags = STEP_COND; break; case 0x22e: /* 1 000 101 110 */ size += 1; ea = oprom16[1]; util::stream_format(stream, "BGT %04X",pc+1-ea); + flags = STEP_COND; break; case 0x22f: /* 1 000 101 111 */ size += 1; ea = oprom16[1]; util::stream_format(stream, "BESC %04X",pc+1-ea); + flags = STEP_COND; break; case 0x230: /* 1 000 110 000 */ case 0x231: /* 1 000 110 001 */ @@ -968,6 +997,7 @@ size += 1; ea = oprom16[1]; util::stream_format(stream, "BEXT %04X,%01X",pc+1-ea,op&0x0f); + flags = STEP_COND; break; case 0x240: /* 1 001 000 000 */ case 0x241: /* 1 001 000 001 */ diff -Nru mame-0.242+dfsg.1/src/devices/cpu/cp1610/cp1610.cpp mame-0.243+dfsg.1/src/devices/cpu/cp1610/cp1610.cpp --- mame-0.242+dfsg.1/src/devices/cpu/cp1610/cp1610.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/cp1610/cp1610.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -15,7 +15,6 @@ #include "emu.h" #include "cp1610.h" -#include "debugger.h" #include "1610dasm.h" DEFINE_DEVICE_TYPE(CP1610, cp1610_cpu_device, "cp1610", "GI CP1610") diff -Nru mame-0.242+dfsg.1/src/devices/cpu/cr16b/cr16bdasm.cpp mame-0.243+dfsg.1/src/devices/cpu/cr16b/cr16bdasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/cr16b/cr16bdasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/cr16b/cr16bdasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -564,11 +564,17 @@ if ((opcode & 0x000e) == 0x000e && (opcode & 0x01e0) != 0x01e0) { if ((opcode & 0x01e0) == 0x01c0) + { stream << "br "; + format_pc_disp17(stream, pc, u32(opcode & 0x0010) << 12 | opcodes.r16(pc + 2)); + return 4 | SUPPORTED; + } else + { util::stream_format(stream, "b%s ", s_cc[(opcode & 0x01e0) >> 5]); - format_pc_disp17(stream, pc, u32(opcode & 0x0010) << 12 | opcodes.r16(pc + 2)); - return 4 | SUPPORTED; + format_pc_disp17(stream, pc, u32(opcode & 0x0010) << 12 | opcodes.r16(pc + 2)); + return 4 | STEP_COND | SUPPORTED; + } } else { @@ -579,15 +585,18 @@ case 0x1401: case 0x3401: // Compare and branch group if (m_arch == cr16_arch::CR16A) + { stream << "res"; + return 2 | SUPPORTED; + } else { util::stream_format(stream, "b%s%c%c ", BIT(opcode, 7) ? "ne" : "eq", BIT(opcode, 6) ? '1' : '0', BIT(opcode, 13) ? 'w' : 'b'); format_reg(stream, (opcode & 0x0120) >> 5); stream << ", "; format_pc_disp5(stream, pc, opcode & 0x001e); + return 2 | STEP_COND | SUPPORTED; } - return 2 | SUPPORTED; case 0x1600: // Jump and link to large address @@ -610,7 +619,7 @@ else util::stream_format(stream, "j%s ", s_cc[(opcode & 0x01e0) >> 5]); format_rpair(stream, (opcode & 0x001e) >> 1); - return 2 | (opcode == 0x17db ? STEP_OUT : 0) | SUPPORTED; + return 2 | ((opcode & 0x001e) == 0x001a ? STEP_OUT : 0) | ((opcode & 0x01e0) != 0x01c0 ? STEP_COND : 0) | SUPPORTED; } else { @@ -728,14 +737,23 @@ if ((opcode & 0x01e0) != 0x01e0) { if ((opcode & 0x01e0) == 0x01c0) + { stream << "br "; + format_pc_disp9(stream, pc, (opcode & 0x1e00) >> 4 | (opcode & 0x001e)); + return 2 | SUPPORTED; + } else + { util::stream_format(stream, "b%s ", s_cc[(opcode & 0x01e0) >> 5]); - format_pc_disp9(stream, pc, (opcode & 0x1e00) >> 4 | (opcode & 0x001e)); + format_pc_disp9(stream, pc, (opcode & 0x1e00) >> 4 | (opcode & 0x001e)); + return 2 | STEP_COND | SUPPORTED; + } } else + { stream << "res"; - return 2 | SUPPORTED; + return 2 | SUPPORTED; + } case 0x4001: case 0x6001: util::stream_format(stream, "add%c ", BIT(opcode, 13) ? 'w' : 'b'); @@ -808,7 +826,7 @@ else util::stream_format(stream, "j%s ", s_cc[(opcode & 0x01e0) >> 5]); format_reg(stream, (opcode & 0x001e) >> 1); - return 2 | (opcode == 0x55dd ? STEP_OUT : 0) | SUPPORTED; + return 2 | ((opcode & 0x001e) == 0x001c ? STEP_OUT : 0) | ((opcode & 0x01e0) != 0x01c0 ? STEP_COND : 0) | SUPPORTED; } else { @@ -941,11 +959,17 @@ if ((opcode & 0x01e0) != 0x01e0 && m_arch != cr16_arch::CR16A) { if ((opcode & 0x01e0) == 0x01c0) + { stream << "br "; + format_pc_disp21(stream, pc, u32(opcode & 0x000e) << 16 | u32(opcode & 0x0010) << 12 | opcodes.r16(pc + 2)); + return 4 | SUPPORTED; + } else + { util::stream_format(stream, "b%s ", s_cc[(opcode & 0x01e0) >> 5]); - format_pc_disp21(stream, pc, u32(opcode & 0x000e) << 16 | u32(opcode & 0x0010) << 12 | opcodes.r16(pc + 2)); - return 4 | SUPPORTED; + format_pc_disp21(stream, pc, u32(opcode & 0x000e) << 16 | u32(opcode & 0x0010) << 12 | opcodes.r16(pc + 2)); + return 4 | STEP_COND | SUPPORTED; + } } else { diff -Nru mame-0.242+dfsg.1/src/devices/cpu/cr16c/cr16cdasm.cpp mame-0.243+dfsg.1/src/devices/cpu/cr16c/cr16cdasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/cr16c/cr16cdasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/cr16c/cr16cdasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -413,12 +413,21 @@ stream << "bal "; format_rpair(stream, (op2 & 0x00f0) >> 4); stream << ", "; + format_pc_disp24(stream, pc, u32(op2 & 0x000f) << 20 | u32(op2 & 0x0f00) << 8 | op3); + return 6 | STEP_OVER | SUPPORTED; } else if ((op2 & 0x00e0) == 0x00e0) + { stream << "br "; + format_pc_disp24(stream, pc, u32(op2 & 0x000f) << 20 | u32(op2 & 0x0f00) << 8 | op3); + return 6 | SUPPORTED; + } else + { util::stream_format(stream, "b%s ", s_cc[(opcode & 0x00f0) >> 4]); - format_pc_disp24(stream, pc, u32(op2 & 0x000f) << 20 | u32(op2 & 0x0f00) << 8 | op3); + format_pc_disp24(stream, pc, u32(op2 & 0x000f) << 20 | u32(op2 & 0x0f00) << 8 | op3); + return 6 | STEP_COND | SUPPORTED; + } } else stream << "res/nop"; @@ -829,7 +838,7 @@ else util::stream_format(stream, "j%s ", s_cc[(opcode & 0x00f0) >> 4]); format_rpair(stream, opcode & 0x000f); - return 2 | ((opcode & 0x00ef) == 0x00ee ? STEP_OUT : 0) | SUPPORTED; + return 2 | ((opcode & 0x000f) == 0x000e ? STEP_OUT : 0) | ((opcode & 0x00e0) != 0x00e0 ? STEP_COND : 0) | SUPPORTED; case 0x0b: stream << "mulsb "; @@ -844,7 +853,7 @@ format_reg(stream, opcode & 0x000f); stream << ", "; format_pc_disp4(stream, pc, (opcode & 0x00f0) >> 4); - return 2 | SUPPORTED; + return 2 | STEP_COND | SUPPORTED; case 0x10: case 0x11: case 0x12: case 0x13: case 0x14: case 0x15: case 0x16: case 0x17: @@ -858,12 +867,12 @@ if ((opcode & 0x0f0f) == 0x0800) { format_pc_disp16(stream, pc, opcodes.r16(pc + 2)); - return 4 | SUPPORTED; + return 4 | ((opcode & 0x00e0) != 0x00e0 ? STEP_COND : 0) | SUPPORTED; } else { format_pc_disp8(stream, pc, (opcode & 0x0f00) >> 4 | (opcode & 0x000f)); - return 2 | SUPPORTED; + return 2 | ((opcode & 0x00e0) != 0x00e0 ? STEP_COND : 0) | SUPPORTED; } case 0x20: case 0x21: case 0x22: case 0x23: diff -Nru mame-0.242+dfsg.1/src/devices/cpu/cubeqcpu/cubeqcpu.cpp mame-0.243+dfsg.1/src/devices/cpu/cubeqcpu/cubeqcpu.cpp --- mame-0.242+dfsg.1/src/devices/cpu/cubeqcpu/cubeqcpu.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/cubeqcpu/cubeqcpu.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -14,7 +14,6 @@ ***************************************************************************/ #include "emu.h" -#include "debugger.h" #include "cubeqcpu.h" #include "cubedasm.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/diablo/diablo1300.cpp mame-0.243+dfsg.1/src/devices/cpu/diablo/diablo1300.cpp --- mame-0.242+dfsg.1/src/devices/cpu/diablo/diablo1300.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/diablo/diablo1300.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -7,7 +7,6 @@ */ #include "emu.h" -#include "debugger.h" #include "diablo1300.h" #include "diablo1300dasm.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/diablo/diablo1300dasm.cpp mame-0.243+dfsg.1/src/devices/cpu/diablo/diablo1300dasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/diablo/diablo1300dasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/diablo/diablo1300dasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -17,6 +17,7 @@ offs_t diablo1300_disassembler::disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) { uint16_t op = opcodes.r16(pc); + uint32_t flags = 0; switch (op & 0x0007) { @@ -27,6 +28,7 @@ break; case 1: // JNC Addr util::stream_format(stream, "JNC %03X", ((op & 0xff00) >> 8) + ((op & 0x0008) ? 0x100 : 0)); + flags = STEP_COND; break; case 2: // RST #Dport util::stream_format(stream, "RST dv%d", (op & 0x0700) >> 8); @@ -78,5 +80,5 @@ break; } - return 1 | SUPPORTED; + return 1 | flags | SUPPORTED; } diff -Nru mame-0.242+dfsg.1/src/devices/cpu/drcbec.cpp mame-0.243+dfsg.1/src/devices/cpu/drcbec.cpp --- mame-0.242+dfsg.1/src/devices/cpu/drcbec.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/drcbec.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -9,7 +9,7 @@ ***************************************************************************/ #include "emu.h" -#include "debugger.h" +#include "debug/debugcpu.h" #include "drcbec.h" #include diff -Nru mame-0.242+dfsg.1/src/devices/cpu/drcbex64.cpp mame-0.243+dfsg.1/src/devices/cpu/drcbex64.cpp --- mame-0.242+dfsg.1/src/devices/cpu/drcbex64.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/drcbex64.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -169,7 +169,7 @@ #include "emu.h" #include "drcbex64.h" -#include "debugger.h" +#include "debug/debugcpu.h" #include "emuopts.h" #include @@ -2642,8 +2642,6 @@ be_parameter srcp(*this, inst.param(0), PTYPE_MRI); be_parameter bitp(*this, inst.param(1), PTYPE_MRI); - Gp const src = Gp::fromTypeAndId((inst.size() == 4) ? RegType::kX86_Gpd : RegType::kX86_Gpq, srcp.ireg()); - // degenerate case: source is immediate if (srcp.is_immediate() && bitp.is_immediate()) { @@ -2660,18 +2658,19 @@ a.and_(ecx, inst.size() * 8 - 1); } - if (bitp.is_immediate()) + if (srcp.is_memory()) { - if (srcp.is_memory()) + if (bitp.is_immediate()) a.bt(MABS(srcp.memory(), inst.size()), bitp.immediate()); // bt [srcp],bitp - else if (srcp.is_int_register()) - a.bt(src, bitp.immediate()); // bt srcp,bitp + else + a.bt(MABS(srcp.memory(), inst.size()), ecx); // bt [srcp],ecx } - else + else if (srcp.is_int_register()) { - if (srcp.is_memory()) - a.bt(MABS(srcp.memory(), inst.size()), ecx); // bt [srcp],ecx - else if (srcp.is_int_register()) + Gp const src = Gp::fromTypeAndId((inst.size() == 4) ? RegType::kX86_Gpd : RegType::kX86_Gpq, srcp.ireg()); + if (bitp.is_immediate()) + a.bt(src, bitp.immediate()); // bt srcp,bitp + else a.bt(src, ecx); // bt srcp,ecx } } diff -Nru mame-0.242+dfsg.1/src/devices/cpu/drcbex86.cpp mame-0.243+dfsg.1/src/devices/cpu/drcbex86.cpp --- mame-0.242+dfsg.1/src/devices/cpu/drcbex86.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/drcbex86.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -85,7 +85,7 @@ #include "emu.h" #include "drcbex86.h" -#include "debugger.h" +#include "debug/debugcpu.h" #include "emuopts.h" #include "drcuml.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/drcfe.h mame-0.243+dfsg.1/src/devices/cpu/drcfe.h --- mame-0.242+dfsg.1/src/devices/cpu/drcfe.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/drcfe.h 2022-04-29 05:37:26.000000000 +0000 @@ -133,6 +133,8 @@ // describe a block opcode_desc const *describe_code(offs_t startpc); + // get last opcode of block + opcode_desc const *get_last() { return m_desc_live_list.last(); } protected: // required overrides diff -Nru mame-0.242+dfsg.1/src/devices/cpu/dsp16/dsp16.cpp mame-0.243+dfsg.1/src/devices/cpu/dsp16/dsp16.cpp --- mame-0.242+dfsg.1/src/devices/cpu/dsp16/dsp16.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/dsp16/dsp16.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -80,8 +80,6 @@ #include "dsp16core.ipp" #include "dsp16rc.h" -#include "debugger.h" - #include #include diff -Nru mame-0.242+dfsg.1/src/devices/cpu/dsp16/dsp16dis.cpp mame-0.243+dfsg.1/src/devices/cpu/dsp16/dsp16dis.cpp --- mame-0.242+dfsg.1/src/devices/cpu/dsp16/dsp16dis.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/dsp16/dsp16dis.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -92,6 +92,8 @@ util::stream_format( stream, "if %1$s%2$s%3$s%4$s", con.text, controlled.nop ? "" : " ", controlled.text, comment); + if (!controlled.nop) + flags |= STEP_COND; } break; diff -Nru mame-0.242+dfsg.1/src/devices/cpu/dsp32/dsp32.cpp mame-0.243+dfsg.1/src/devices/cpu/dsp32/dsp32.cpp --- mame-0.242+dfsg.1/src/devices/cpu/dsp32/dsp32.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/dsp32/dsp32.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -31,7 +31,6 @@ #include "emu.h" #include "dsp32.h" #include "dsp32dis.h" -#include "debugger.h" //************************************************************************** diff -Nru mame-0.242+dfsg.1/src/devices/cpu/dsp32/dsp32dis.cpp mame-0.243+dfsg.1/src/devices/cpu/dsp32/dsp32dis.cpp --- mame-0.242+dfsg.1/src/devices/cpu/dsp32/dsp32dis.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/dsp32/dsp32dis.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -354,6 +354,8 @@ flags = STEP_OUT; util::stream_format(stream, "if (%s) goto %s", condtable[C], rH); } + if (C > 1) + flags |= STEP_COND; } break; } diff -Nru mame-0.242+dfsg.1/src/devices/cpu/dsp56000/dsp56000.cpp mame-0.243+dfsg.1/src/devices/cpu/dsp56000/dsp56000.cpp --- mame-0.242+dfsg.1/src/devices/cpu/dsp56000/dsp56000.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/dsp56000/dsp56000.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -12,7 +12,6 @@ */ #include "emu.h" -#include "debugger.h" #include "dsp56000.h" #include "dsp56000d.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/dsp56000/dsp56000d.cpp mame-0.243+dfsg.1/src/devices/cpu/dsp56000/dsp56000d.cpp --- mame-0.242+dfsg.1/src/devices/cpu/dsp56000/dsp56000d.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/dsp56000/dsp56000d.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -369,9 +369,9 @@ switch (op & 0x010020U) { case 0x000000U: util::stream_format(stream, "jmp %s", ea(MMMRRR, ew)); break; - case 0x000020U: util::stream_format(stream, "j%s %s", CCCC[op & 15], ea(MMMRRR, ew)); break; - case 0x010000U: util::stream_format(stream, "jsr %s", ea(MMMRRR, ew)); break; - case 0x010020U: util::stream_format(stream, "js%s %s", CCCC[op & 15], ea(MMMRRR, ew)); break; + case 0x000020U: util::stream_format(stream, "j%s %s", CCCC[op & 15], ea(MMMRRR, ew)); flags |= STEP_COND; break; + case 0x010000U: util::stream_format(stream, "jsr %s", ea(MMMRRR, ew)); flags |= STEP_OVER; break; + case 0x010020U: util::stream_format(stream, "js%s %s", CCCC[op & 15], ea(MMMRRR, ew)); flags |= STEP_OVER | STEP_COND; break; } // consume absolute @@ -385,12 +385,12 @@ switch (op & 0x010060U) { - case 0x000000U: util::stream_format(stream, "jclr #%d,%s,$%x", op & 31, reg(dddddd), u16(ew)); words++; break; - case 0x000020U: util::stream_format(stream, "jset #%d,%s,$%x", op & 31, reg(dddddd), u16(ew)); words++; break; + case 0x000000U: util::stream_format(stream, "jclr #%d,%s,$%x", op & 31, reg(dddddd), u16(ew)); words++; flags |= STEP_COND; break; + case 0x000020U: util::stream_format(stream, "jset #%d,%s,$%x", op & 31, reg(dddddd), u16(ew)); words++; flags |= STEP_COND; break; case 0x000040U: util::stream_format(stream, "bclr #%d,%s", op & 31, reg(dddddd)); break; case 0x000060U: util::stream_format(stream, "bset #%d,%s", op & 31, reg(dddddd)); break; - case 0x010000U: util::stream_format(stream, "jsclr #%d,%s,$%x", op & 31, reg(dddddd), u16(ew)); words++; break; - case 0x010020U: util::stream_format(stream, "jsset #%d,%s,$%x", op & 31, reg(dddddd), u16(ew)); words++; break; + case 0x010000U: util::stream_format(stream, "jsclr #%d,%s,$%x", op & 31, reg(dddddd), u16(ew)); words++; flags |= STEP_OVER | STEP_COND; break; + case 0x010020U: util::stream_format(stream, "jsset #%d,%s,$%x", op & 31, reg(dddddd), u16(ew)); words++; flags |= STEP_OVER | STEP_COND; break; case 0x010040U: util::stream_format(stream, "bchg #%d,%s", op & 31, reg(dddddd)); break; case 0x010060U: util::stream_format(stream, "btst #%d,%s", op & 31, reg(dddddd)); break; } @@ -405,12 +405,12 @@ { case 0x000000U: util::stream_format(stream, "bclr #%d", op & 31); break; case 0x000020U: util::stream_format(stream, "bset #%d", op & 31); break; - case 0x000080U: util::stream_format(stream, "jclr #%d", op & 31); break; - case 0x0000a0U: util::stream_format(stream, "jset #%d", op & 31); break; + case 0x000080U: util::stream_format(stream, "jclr #%d", op & 31); flags |= STEP_COND; break; + case 0x0000a0U: util::stream_format(stream, "jset #%d", op & 31); flags |= STEP_COND; break; case 0x010000U: util::stream_format(stream, "bchg #%d", op & 31); break; case 0x010020U: util::stream_format(stream, "btst #%d", op & 31); break; - case 0x010080U: util::stream_format(stream, "jsclr #%d", op & 31); break; - case 0x0100a0U: util::stream_format(stream, "jsset #%d", op & 31); break; + case 0x010080U: util::stream_format(stream, "jsclr #%d", op & 31); flags |= STEP_OVER | STEP_COND; break; + case 0x0100a0U: util::stream_format(stream, "jsset #%d", op & 31); flags |= STEP_OVER | STEP_COND; break; } // second operand (address) @@ -432,9 +432,9 @@ } break; case 0xc: util::stream_format(stream, "jmp <$%x", op & 0xfff); break; - case 0xd: util::stream_format(stream, "jsr <$%x", op & 0xfff); break; - case 0xe: util::stream_format(stream, "j%s <$%x", CCCC[(op >> 12) & 15], op & 0xfff); break; - case 0xf: util::stream_format(stream, "js%s <$%x", CCCC[(op >> 12) & 15], op & 0xfff); break; + case 0xd: util::stream_format(stream, "jsr <$%x", op & 0xfff); flags |= STEP_OVER; break; + case 0xe: util::stream_format(stream, "j%s <$%x", CCCC[(op >> 12) & 15], op & 0xfff); flags |= STEP_COND; break; + case 0xf: util::stream_format(stream, "js%s <$%x", CCCC[(op >> 12) & 15], op & 0xfff); flags |= STEP_OVER | STEP_COND; break; } } else diff -Nru mame-0.242+dfsg.1/src/devices/cpu/dsp56156/dsp56156.cpp mame-0.243+dfsg.1/src/devices/cpu/dsp56156/dsp56156.cpp --- mame-0.242+dfsg.1/src/devices/cpu/dsp56156/dsp56156.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/dsp56156/dsp56156.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -37,7 +37,7 @@ #include "opcode.h" -#include "debugger.h" +#include "debug/debugcpu.h" #include "dsp56def.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/dspp/dspp.cpp mame-0.243+dfsg.1/src/devices/cpu/dspp/dspp.cpp --- mame-0.242+dfsg.1/src/devices/cpu/dspp/dspp.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/dspp/dspp.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -14,8 +14,6 @@ #include "dsppfe.h" #include "dsppdasm.h" -#include "debugger.h" - //************************************************************************** // CONSTANTS diff -Nru mame-0.242+dfsg.1/src/devices/cpu/dspp/dsppdrc.cpp mame-0.243+dfsg.1/src/devices/cpu/dspp/dsppdrc.cpp --- mame-0.242+dfsg.1/src/devices/cpu/dspp/dsppdrc.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/dspp/dsppdrc.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -8,7 +8,6 @@ ******************************************************************************/ #include "emu.h" -#include "debugger.h" #include "dspp.h" #include "dsppfe.h" #include "cpu/drcfe.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/e0c6200/e0c6200.cpp mame-0.243+dfsg.1/src/devices/cpu/e0c6200/e0c6200.cpp --- mame-0.242+dfsg.1/src/devices/cpu/e0c6200/e0c6200.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/e0c6200/e0c6200.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -21,7 +21,6 @@ #include "emu.h" #include "e0c6200.h" #include "e0c6200d.h" -#include "debugger.h" // construction/destruction diff -Nru mame-0.242+dfsg.1/src/devices/cpu/e0c6200/e0c6200d.cpp mame-0.243+dfsg.1/src/devices/cpu/e0c6200/e0c6200d.cpp --- mame-0.242+dfsg.1/src/devices/cpu/e0c6200/e0c6200d.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/e0c6200/e0c6200d.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -21,7 +21,7 @@ const u32 e0c6200_disassembler::em_flags[] = { - 0, STEP_OUT, STEP_OVER, STEP_OVER, + STEP_COND, STEP_OUT, STEP_OVER, STEP_OVER, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -656,7 +656,6 @@ } // 0xf00 (big switch) - // fetch mnemonic util::stream_format(stream, "%-6s", em_name[m]); @@ -670,7 +669,7 @@ } } - return 1 | em_flags[m] | SUPPORTED; + return 1 | ((op & 0xf00) == 0 ? 0 : em_flags[m]) | SUPPORTED; } u32 e0c6200_disassembler::opcode_alignment() const diff -Nru mame-0.242+dfsg.1/src/devices/cpu/e132xs/32xsdasm.cpp mame-0.243+dfsg.1/src/devices/cpu/e132xs/32xsdasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/e132xs/32xsdasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/e132xs/32xsdasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1751,7 +1751,7 @@ int32_t rel = PCrel_format(op, pc, opcodes) + 2; util::stream_format(stream, "DBV $%x", rel); - flags = STEP_OVER | step_over_extra(1); + flags = STEP_COND | step_over_extra(1); break; } @@ -1762,7 +1762,7 @@ int32_t rel = PCrel_format(op, pc, opcodes) + 2; util::stream_format(stream, "DBNV $%x", rel); - flags = STEP_OVER | step_over_extra(1); + flags = STEP_COND | step_over_extra(1); break; } @@ -1773,7 +1773,7 @@ int32_t rel = PCrel_format(op, pc, opcodes) + 2; util::stream_format(stream, "DBE $%x", rel); - flags = STEP_OVER | step_over_extra(1); + flags = STEP_COND | step_over_extra(1); break; } @@ -1784,7 +1784,7 @@ int32_t rel = PCrel_format(op, pc, opcodes) + 2; util::stream_format(stream, "DBNE $%x", rel); - flags = STEP_OVER | step_over_extra(1); + flags = STEP_COND | step_over_extra(1); break; } @@ -1795,7 +1795,7 @@ int32_t rel = PCrel_format(op, pc, opcodes) + 2; util::stream_format(stream, "DBC $%x", rel); - flags = STEP_OVER | step_over_extra(1); + flags = STEP_COND | step_over_extra(1); break; } @@ -1806,7 +1806,7 @@ int32_t rel = PCrel_format(op, pc, opcodes) + 2; util::stream_format(stream, "DBNC $%x", rel); - flags = STEP_OVER | step_over_extra(1); + flags = STEP_COND | step_over_extra(1); break; } @@ -1817,7 +1817,7 @@ int32_t rel = PCrel_format(op, pc, opcodes) + 2; util::stream_format(stream, "DBSE $%x", rel); - flags = STEP_OVER | step_over_extra(1); + flags = STEP_COND | step_over_extra(1); break; } @@ -1828,7 +1828,7 @@ int32_t rel = PCrel_format(op, pc, opcodes) + 2; util::stream_format(stream, "DBHT $%x", rel); - flags = STEP_OVER | step_over_extra(1); + flags = STEP_COND | step_over_extra(1); break; } @@ -1839,7 +1839,7 @@ int32_t rel = PCrel_format(op, pc, opcodes) + 2; util::stream_format(stream, "DBN $%x", rel); - flags = STEP_OVER | step_over_extra(1); + flags = STEP_COND | step_over_extra(1); break; } @@ -1850,7 +1850,7 @@ int32_t rel = PCrel_format(op, pc, opcodes) + 2; util::stream_format(stream, "DBNN $%x", rel); - flags = STEP_OVER | step_over_extra(1); + flags = STEP_COND | step_over_extra(1); break; } @@ -1861,7 +1861,7 @@ int32_t rel = PCrel_format(op, pc, opcodes) + 2; util::stream_format(stream, "DBLE $%x", rel); - flags = STEP_OVER | step_over_extra(1); + flags = STEP_COND | step_over_extra(1); break; } @@ -1872,7 +1872,7 @@ int32_t rel = PCrel_format(op, pc, opcodes) + 2; util::stream_format(stream, "DBGT $%x", rel); - flags = STEP_OVER | step_over_extra(1); + flags = STEP_COND | step_over_extra(1); break; } @@ -1883,7 +1883,7 @@ int32_t rel = PCrel_format(op, pc, opcodes) + 2; util::stream_format(stream, "DBR $%x", rel); - flags = STEP_OVER | step_over_extra(1); + flags = STEP_COND | step_over_extra(1); break; } @@ -1923,6 +1923,7 @@ int32_t rel = PCrel_format(op, pc, opcodes) + 2; util::stream_format(stream, "BV $%x", rel); + flags = STEP_COND; break; } @@ -1933,6 +1934,7 @@ int32_t rel = PCrel_format(op, pc, opcodes) + 2; util::stream_format(stream, "BNV $%x", rel); + flags = STEP_COND; break; } @@ -1943,6 +1945,7 @@ int32_t rel = PCrel_format(op, pc, opcodes) + 2; util::stream_format(stream, "BE $%x", rel); + flags = STEP_COND; break; } @@ -1953,6 +1956,7 @@ int32_t rel = PCrel_format(op, pc, opcodes) + 2; util::stream_format(stream, "BNE $%x", rel); + flags = STEP_COND; break; } @@ -1963,6 +1967,7 @@ int32_t rel = PCrel_format(op, pc, opcodes) + 2; util::stream_format(stream, "BC $%x", rel); + flags = STEP_COND; break; } @@ -1973,6 +1978,7 @@ int32_t rel = PCrel_format(op, pc, opcodes) + 2; util::stream_format(stream, "BNC $%x", rel); + flags = STEP_COND; break; } @@ -1983,6 +1989,7 @@ int32_t rel = PCrel_format(op, pc, opcodes) + 2; util::stream_format(stream, "BSE $%x", rel); + flags = STEP_COND; break; } @@ -1993,6 +2000,7 @@ int32_t rel = PCrel_format(op, pc, opcodes) + 2; util::stream_format(stream, "BHT $%x", rel); + flags = STEP_COND; break; } @@ -2003,6 +2011,7 @@ int32_t rel = PCrel_format(op, pc, opcodes) + 2; util::stream_format(stream, "BN $%x", rel); + flags = STEP_COND; break; } @@ -2013,6 +2022,7 @@ int32_t rel = PCrel_format(op, pc, opcodes) + 2; util::stream_format(stream, "BNN $%x", rel); + flags = STEP_COND; break; } @@ -2023,6 +2033,7 @@ int32_t rel = PCrel_format(op, pc, opcodes) + 2; util::stream_format(stream, "BLE $%x", rel); + flags = STEP_COND; break; } @@ -2033,6 +2044,7 @@ int32_t rel = PCrel_format(op, pc, opcodes) + 2; util::stream_format(stream, "BGT $%x", rel); + flags = STEP_COND; break; } @@ -2057,67 +2069,67 @@ { case TRAPLE: util::stream_format(stream, "TRAPLE %d", trapno); - flags = STEP_OVER; + flags = STEP_OVER | STEP_COND; break; case TRAPGT: util::stream_format(stream, "TRAPGT %d", trapno); - flags = STEP_OVER; + flags = STEP_OVER | STEP_COND; break; case TRAPLT: util::stream_format(stream, "TRAPLT %d", trapno); - flags = STEP_OVER; + flags = STEP_OVER | STEP_COND; break; case TRAPGE: util::stream_format(stream, "TRAPGE %d", trapno); - flags = STEP_OVER; + flags = STEP_OVER | STEP_COND; break; case TRAPSE: util::stream_format(stream, "TRAPSE %d", trapno); - flags = STEP_OVER; + flags = STEP_OVER | STEP_COND; break; case TRAPHT: util::stream_format(stream, "TRAPHT %d", trapno); - flags = STEP_OVER; + flags = STEP_OVER | STEP_COND; break; case TRAPST: util::stream_format(stream, "TRAPST %d", trapno); - flags = STEP_OVER; + flags = STEP_OVER | STEP_COND; break; case TRAPHE: util::stream_format(stream, "TRAPHE %d", trapno); - flags = STEP_OVER; + flags = STEP_OVER | STEP_COND; break; case TRAPE: util::stream_format(stream, "TRAPE %d", trapno); - flags = STEP_OVER; + flags = STEP_OVER | STEP_COND; break; case TRAPNE: util::stream_format(stream, "TRAPNE %d", trapno); - flags = STEP_OVER; + flags = STEP_OVER | STEP_COND; break; case TRAPV: util::stream_format(stream, "TRAPV %d", trapno); - flags = STEP_OVER; + flags = STEP_OVER | STEP_COND; break; diff -Nru mame-0.242+dfsg.1/src/devices/cpu/e132xs/e132xs.cpp mame-0.243+dfsg.1/src/devices/cpu/e132xs/e132xs.cpp --- mame-0.242+dfsg.1/src/devices/cpu/e132xs/e132xs.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/e132xs/e132xs.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -146,8 +146,6 @@ #include "e132xs.h" #include "e132xsfe.h" -#include "debugger.h" - #include "32xsdefs.h" //#define VERBOSE 1 diff -Nru mame-0.242+dfsg.1/src/devices/cpu/es5510/es5510.cpp mame-0.243+dfsg.1/src/devices/cpu/es5510/es5510.cpp --- mame-0.242+dfsg.1/src/devices/cpu/es5510/es5510.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/es5510/es5510.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -17,7 +17,6 @@ #include "es5510d.h" #include "cpu/m68000/m68000.h" -#include "debugger.h" #include "corestr.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/esrip/esrip.cpp mame-0.243+dfsg.1/src/devices/cpu/esrip/esrip.cpp --- mame-0.242+dfsg.1/src/devices/cpu/esrip/esrip.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/esrip/esrip.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -13,7 +13,6 @@ #include "esrip.h" #include "esripdsm.h" -#include "debugger.h" #include "screen.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/f2mc16/f2mc16d.cpp mame-0.243+dfsg.1/src/devices/cpu/f2mc16/f2mc16d.cpp --- mame-0.242+dfsg.1/src/devices/cpu/f2mc16/f2mc16d.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/f2mc16/f2mc16d.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -349,7 +349,7 @@ { stream << ", "; format_rel(stream, pc + bytes + 1, opcodes.r8(pc + bytes)); - ++bytes; + return (bytes + 1) | STEP_COND | SUPPORTED; } else if ((op2 & 0xe0) == 0x20) stream << ", A"; @@ -710,8 +710,7 @@ format_imm8(stream, opcodes.r8(pc + bytes)); stream << ", "; format_rel(stream, pc + bytes + 2, opcodes.r8(pc + bytes + 1)); - bytes += 2; - break; + return (bytes + 2) | STEP_COND | SUPPORTED; case 0x01: util::stream_format(stream, "%-8s@", "JMPP"); @@ -881,8 +880,7 @@ bytes += dasm_ea8(stream, pc + bytes, op2, segm, opcodes); stream << ", "; format_rel(stream, pc + bytes + 1, opcodes.r8(pc + bytes)); - ++bytes; - break; + return (bytes + 1) | STEP_COND | SUPPORTED; case 0x05: util::stream_format(stream, "%-8s", "ADD"); @@ -969,8 +967,7 @@ bytes += dasm_ea16(stream, pc + bytes, op2, segm, opcodes); stream << ", "; format_rel(stream, pc + bytes + 1, opcodes.r8(pc + bytes)); - ++bytes; - break; + return (bytes + 1) | STEP_COND | SUPPORTED; case 0x07: util::stream_format(stream, "%-8s", "ADDW"); @@ -1061,7 +1058,7 @@ { util::stream_format(stream, "%-8s", s_bcc_ops[op & 0x0f]); format_rel(stream, pc + bytes + 1, opcodes.r8(pc + bytes)); - ++bytes; + return (bytes + 1) | STEP_COND | SUPPORTED; } else if (op >= 0xe0) { @@ -1278,8 +1275,7 @@ format_imm8(stream, opcodes.r8(pc + bytes++)); stream << ", "; format_rel(stream, pc + bytes + 1, opcodes.r8(pc + bytes)); - ++bytes; - break; + return (bytes + 1) | STEP_COND | SUPPORTED; case 0x2b: case 0x3b: util::stream_format(stream, "%-8sA", "CMPW"); diff -Nru mame-0.242+dfsg.1/src/devices/cpu/f8/f8.cpp mame-0.243+dfsg.1/src/devices/cpu/f8/f8.cpp --- mame-0.242+dfsg.1/src/devices/cpu/f8/f8.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/f8/f8.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -46,7 +46,6 @@ #include "emu.h" #include "f8.h" #include "f8dasm.h" -#include "debugger.h" /* status flags */ diff -Nru mame-0.242+dfsg.1/src/devices/cpu/f8/f8dasm.cpp mame-0.243+dfsg.1/src/devices/cpu/f8/f8dasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/f8/f8dasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/f8/f8dasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -277,14 +277,17 @@ case 0x81: /* 1000 0001 */ case 0x85: /* 1000 0101 */ util::stream_format(stream, "BP H'%04X'", base_pc + (int8_t)opcodes.r8(pc++) + 1); + flags |= STEP_COND; break; case 0x82: /* 1000 0010 */ util::stream_format(stream, "BC H'%04X'", base_pc + (int8_t)opcodes.r8(pc++) + 1); + flags |= STEP_COND; break; case 0x84: /* 1000 0100 */ util::stream_format(stream, "BZ H'%04X'", base_pc + (int8_t)opcodes.r8(pc++) + 1); + flags |= STEP_COND; break; case 0x80: /* 1000 0000 */ @@ -292,6 +295,7 @@ case 0x86: /* 1000 0110 */ case 0x87: /* 1000 0111 */ util::stream_format(stream, "BT H'%02X',H'%04X'", op & 0x07, base_pc + (int8_t)opcodes.r8(pc++) + 1); + flags |= STEP_COND; break; case 0x88: /* 1000 1000 */ @@ -324,6 +328,7 @@ case 0x8f: /* 1000 1111 */ util::stream_format(stream, "BR7 H'%04X'", base_pc + (int8_t)opcodes.r8(pc++) + 1); + flags |= STEP_COND; break; case 0x90: /* 1001 0000 */ @@ -333,18 +338,22 @@ case 0x91: /* 1001 0001 */ case 0x95: /* 1001 0101 */ util::stream_format(stream, "BM H'%04X'", base_pc + (int8_t)opcodes.r8(pc++) + 1); + flags |= STEP_COND; break; case 0x92: /* 1001 0010 */ util::stream_format(stream, "BNC H'%04X'", base_pc + (int8_t)opcodes.r8(pc++) + 1); + flags |= STEP_COND; break; case 0x94: /* 1001 0100 */ util::stream_format(stream, "BNZ H'%04X'", base_pc + (int8_t)opcodes.r8(pc++) + 1); + flags |= STEP_COND; break; case 0x98: /* 1001 1000 */ util::stream_format(stream, "BNO H'%04X'", base_pc + (int8_t)opcodes.r8(pc++) + 1); + flags |= STEP_COND; break; case 0x93: /* 1001 0011 */ @@ -358,6 +367,7 @@ case 0x9e: /* 1001 1110 */ case 0x9f: /* 1001 1111 */ util::stream_format(stream, "BF H'%02X',H'%04X'", op & 0x0f, base_pc + (int8_t)opcodes.r8(pc++) + 1); + flags |= STEP_COND; break; case 0xa0: /* 1010 0000 */ diff -Nru mame-0.242+dfsg.1/src/devices/cpu/fr/frdasm.cpp mame-0.243+dfsg.1/src/devices/cpu/fr/frdasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/fr/frdasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/fr/frdasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -882,46 +882,46 @@ return dasm_branch(stream, pc, "BNO", (opcode & 0x00ff) << 1); case 0xe2: - return dasm_branch(stream, pc, "BEQ", (opcode & 0x00ff) << 1); + return dasm_branch(stream, pc, "BEQ", (opcode & 0x00ff) << 1) | STEP_COND; case 0xe3: - return dasm_branch(stream, pc, "BNE", (opcode & 0x00ff) << 1); + return dasm_branch(stream, pc, "BNE", (opcode & 0x00ff) << 1) | STEP_COND; case 0xe4: - return dasm_branch(stream, pc, "BC", (opcode & 0x00ff) << 1); + return dasm_branch(stream, pc, "BC", (opcode & 0x00ff) << 1) | STEP_COND; case 0xe5: - return dasm_branch(stream, pc, "BNC", (opcode & 0x00ff) << 1); + return dasm_branch(stream, pc, "BNC", (opcode & 0x00ff) << 1) | STEP_COND; case 0xe6: - return dasm_branch(stream, pc, "BN", (opcode & 0x00ff) << 1); + return dasm_branch(stream, pc, "BN", (opcode & 0x00ff) << 1) | STEP_COND; case 0xe7: - return dasm_branch(stream, pc, "BP", (opcode & 0x00ff) << 1); + return dasm_branch(stream, pc, "BP", (opcode & 0x00ff) << 1) | STEP_COND; case 0xe8: - return dasm_branch(stream, pc, "BV", (opcode & 0x00ff) << 1); + return dasm_branch(stream, pc, "BV", (opcode & 0x00ff) << 1) | STEP_COND; case 0xe9: - return dasm_branch(stream, pc, "BNV", (opcode & 0x00ff) << 1); + return dasm_branch(stream, pc, "BNV", (opcode & 0x00ff) << 1) | STEP_COND; case 0xea: - return dasm_branch(stream, pc, "BLT", (opcode & 0x00ff) << 1); + return dasm_branch(stream, pc, "BLT", (opcode & 0x00ff) << 1) | STEP_COND; case 0xeb: - return dasm_branch(stream, pc, "BGE", (opcode & 0x00ff) << 1); + return dasm_branch(stream, pc, "BGE", (opcode & 0x00ff) << 1) | STEP_COND; case 0xec: - return dasm_branch(stream, pc, "BLE", (opcode & 0x00ff) << 1); + return dasm_branch(stream, pc, "BLE", (opcode & 0x00ff) << 1) | STEP_COND; case 0xed: - return dasm_branch(stream, pc, "BGT", (opcode & 0x00ff) << 1); + return dasm_branch(stream, pc, "BGT", (opcode & 0x00ff) << 1) | STEP_COND; case 0xee: - return dasm_branch(stream, pc, "BLS", (opcode & 0x00ff) << 1); + return dasm_branch(stream, pc, "BLS", (opcode & 0x00ff) << 1) | STEP_COND; case 0xef: - return dasm_branch(stream, pc, "BHI", (opcode & 0x00ff) << 1); + return dasm_branch(stream, pc, "BHI", (opcode & 0x00ff) << 1) | STEP_COND; case 0xf0: return dasm_branch(stream, pc, "BRA:D", (opcode & 0x00ff) << 1); @@ -930,46 +930,46 @@ return dasm_branch(stream, pc, "BNO:D", (opcode & 0x00ff) << 1); case 0xf2: - return dasm_branch(stream, pc, "BEQ:D", (opcode & 0x00ff) << 1); + return dasm_branch(stream, pc, "BEQ:D", (opcode & 0x00ff) << 1) | STEP_COND | step_over_extra(1); case 0xf3: - return dasm_branch(stream, pc, "BNE:D", (opcode & 0x00ff) << 1); + return dasm_branch(stream, pc, "BNE:D", (opcode & 0x00ff) << 1) | STEP_COND | step_over_extra(1); case 0xf4: - return dasm_branch(stream, pc, "BC:D", (opcode & 0x00ff) << 1); + return dasm_branch(stream, pc, "BC:D", (opcode & 0x00ff) << 1) | STEP_COND | step_over_extra(1); case 0xf5: - return dasm_branch(stream, pc, "BNC:D", (opcode & 0x00ff) << 1); + return dasm_branch(stream, pc, "BNC:D", (opcode & 0x00ff) << 1) | STEP_COND | step_over_extra(1); case 0xf6: - return dasm_branch(stream, pc, "BN:D", (opcode & 0x00ff) << 1); + return dasm_branch(stream, pc, "BN:D", (opcode & 0x00ff) << 1) | STEP_COND | step_over_extra(1); case 0xf7: - return dasm_branch(stream, pc, "BP:D", (opcode & 0x00ff) << 1); + return dasm_branch(stream, pc, "BP:D", (opcode & 0x00ff) << 1) | STEP_COND | step_over_extra(1); case 0xf8: - return dasm_branch(stream, pc, "BV:D", (opcode & 0x00ff) << 1); + return dasm_branch(stream, pc, "BV:D", (opcode & 0x00ff) << 1) | STEP_COND | step_over_extra(1); case 0xf9: - return dasm_branch(stream, pc, "BNV:D", (opcode & 0x00ff) << 1); + return dasm_branch(stream, pc, "BNV:D", (opcode & 0x00ff) << 1) | STEP_COND | step_over_extra(1); case 0xfa: - return dasm_branch(stream, pc, "BLT:D", (opcode & 0x00ff) << 1); + return dasm_branch(stream, pc, "BLT:D", (opcode & 0x00ff) << 1) | STEP_COND | step_over_extra(1); case 0xfb: - return dasm_branch(stream, pc, "BGE:D", (opcode & 0x00ff) << 1); + return dasm_branch(stream, pc, "BGE:D", (opcode & 0x00ff) << 1) | STEP_COND | step_over_extra(1); case 0xfc: - return dasm_branch(stream, pc, "BLE:D", (opcode & 0x00ff) << 1); + return dasm_branch(stream, pc, "BLE:D", (opcode & 0x00ff) << 1) | STEP_COND | step_over_extra(1); case 0xfd: - return dasm_branch(stream, pc, "BGT:D", (opcode & 0x00ff) << 1); + return dasm_branch(stream, pc, "BGT:D", (opcode & 0x00ff) << 1) | STEP_COND | step_over_extra(1); case 0xfe: - return dasm_branch(stream, pc, "BLS:D", (opcode & 0x00ff) << 1); + return dasm_branch(stream, pc, "BLS:D", (opcode & 0x00ff) << 1) | STEP_COND | step_over_extra(1); case 0xff: - return dasm_branch(stream, pc, "BHI:D", (opcode & 0x00ff) << 1); + return dasm_branch(stream, pc, "BHI:D", (opcode & 0x00ff) << 1) | STEP_COND | step_over_extra(1); default: return dasm_invalid(stream, opcode); diff -Nru mame-0.242+dfsg.1/src/devices/cpu/g65816/g65816.cpp mame-0.243+dfsg.1/src/devices/cpu/g65816/g65816.cpp --- mame-0.242+dfsg.1/src/devices/cpu/g65816/g65816.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/g65816/g65816.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -684,13 +684,13 @@ unsigned g65816_device::EA_DY() {return MAKE_UINT_16(REGISTER_D + g65816i_read_8_immediate(EA_IMM8()) + REGISTER_Y);} unsigned g65816_device::EA_AX() {unsigned tmp = EA_A(); if((tmp^(tmp+REGISTER_X))&0xff00) CLK(1); return tmp + REGISTER_X;} unsigned g65816_device::EA_ALX() {return EA_AL() + REGISTER_X;} -unsigned g65816_device::EA_AY() {unsigned tmp = EA_A(); if((tmp^(tmp+REGISTER_X))&0xff00) CLK(1); return tmp + REGISTER_Y;} +unsigned g65816_device::EA_AY() {unsigned tmp = EA_A(); if((tmp^(tmp+REGISTER_Y))&0xff00) CLK(1); return tmp + REGISTER_Y;} unsigned g65816_device::EA_DI() {return REGISTER_DB | g65816i_read_16_direct(EA_D());} unsigned g65816_device::EA_DLI() {return g65816i_read_24_direct(EA_D());} unsigned g65816_device::EA_AI() {return g65816i_read_16_normal(g65816i_read_16_immediate(EA_IMM16()));} unsigned g65816_device::EA_ALI() {return g65816i_read_24_normal(EA_A());} unsigned g65816_device::EA_DXI() {return REGISTER_DB | g65816i_read_16_direct(EA_DX());} -unsigned g65816_device::EA_DIY() {unsigned tmp = REGISTER_DB | g65816i_read_16_direct(EA_D()); if((tmp^(tmp+REGISTER_X))&0xff00) CLK(1); return tmp + REGISTER_Y;} +unsigned g65816_device::EA_DIY() {unsigned tmp = REGISTER_DB | g65816i_read_16_direct(EA_D()); if((tmp^(tmp+REGISTER_Y))&0xff00) CLK(1); return tmp + REGISTER_Y;} unsigned g65816_device::EA_DLIY() {return g65816i_read_24_direct(EA_D()) + REGISTER_Y;} unsigned g65816_device::EA_AXI() {return g65816i_read_16_normal(MAKE_UINT_16(g65816i_read_16_immediate(EA_IMM16()) + REGISTER_X));} unsigned g65816_device::EA_S() {return MAKE_UINT_16(REGISTER_S + g65816i_read_8_immediate(EA_IMM8()));} diff -Nru mame-0.242+dfsg.1/src/devices/cpu/g65816/g65816ds.cpp mame-0.243+dfsg.1/src/devices/cpu/g65816/g65816ds.cpp --- mame-0.242+dfsg.1/src/devices/cpu/g65816/g65816ds.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/g65816/g65816ds.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -64,6 +64,11 @@ } } +bool g65816_disassembler::opcode_struct::is_cond() const +{ + return ea == RELB && m_name != op::BRA; +} + g65816_disassembler::opcode_struct::opcode_struct(op n, u8 f, u8 e) : m_name(n), flag(f), ea(e) { } @@ -183,6 +188,8 @@ dasm_flags = STEP_OVER; else if (opcode->is_return()) dasm_flags = STEP_OUT; + else if (opcode->is_cond()) + dasm_flags = STEP_COND; else dasm_flags = 0; diff -Nru mame-0.242+dfsg.1/src/devices/cpu/g65816/g65816ds.h mame-0.243+dfsg.1/src/devices/cpu/g65816/g65816ds.h --- mame-0.242+dfsg.1/src/devices/cpu/g65816/g65816ds.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/g65816/g65816ds.h 2022-04-29 05:37:26.000000000 +0000 @@ -76,6 +76,7 @@ const char *name() const; bool is_call() const; bool is_return() const; + bool is_cond() const; }; static const char *const s_opnames[]; diff -Nru mame-0.242+dfsg.1/src/devices/cpu/g65816/g65816o0.cpp mame-0.243+dfsg.1/src/devices/cpu/g65816/g65816o0.cpp --- mame-0.242+dfsg.1/src/devices/cpu/g65816/g65816o0.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/g65816/g65816o0.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1,7 +1,6 @@ // license:BSD-3-Clause // copyright-holders:Karl Stenerud #include "emu.h" -#include "debugger.h" #include "g65816.h" #include "g65816cm.h" #define EXECUTION_MODE EXECUTION_MODE_M0X0 diff -Nru mame-0.242+dfsg.1/src/devices/cpu/g65816/g65816o1.cpp mame-0.243+dfsg.1/src/devices/cpu/g65816/g65816o1.cpp --- mame-0.242+dfsg.1/src/devices/cpu/g65816/g65816o1.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/g65816/g65816o1.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1,7 +1,6 @@ // license:BSD-3-Clause // copyright-holders:Karl Stenerud #include "emu.h" -#include "debugger.h" #include "g65816.h" #include "g65816cm.h" #define EXECUTION_MODE EXECUTION_MODE_M0X1 diff -Nru mame-0.242+dfsg.1/src/devices/cpu/g65816/g65816o2.cpp mame-0.243+dfsg.1/src/devices/cpu/g65816/g65816o2.cpp --- mame-0.242+dfsg.1/src/devices/cpu/g65816/g65816o2.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/g65816/g65816o2.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1,7 +1,6 @@ // license:BSD-3-Clause // copyright-holders:Karl Stenerud #include "emu.h" -#include "debugger.h" #include "g65816.h" #include "g65816cm.h" #define EXECUTION_MODE EXECUTION_MODE_M1X0 diff -Nru mame-0.242+dfsg.1/src/devices/cpu/g65816/g65816o3.cpp mame-0.243+dfsg.1/src/devices/cpu/g65816/g65816o3.cpp --- mame-0.242+dfsg.1/src/devices/cpu/g65816/g65816o3.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/g65816/g65816o3.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1,7 +1,6 @@ // license:BSD-3-Clause // copyright-holders:Karl Stenerud #include "emu.h" -#include "debugger.h" #include "g65816.h" #include "g65816cm.h" #define EXECUTION_MODE EXECUTION_MODE_M1X1 diff -Nru mame-0.242+dfsg.1/src/devices/cpu/g65816/g65816o4.cpp mame-0.243+dfsg.1/src/devices/cpu/g65816/g65816o4.cpp --- mame-0.242+dfsg.1/src/devices/cpu/g65816/g65816o4.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/g65816/g65816o4.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1,7 +1,6 @@ // license:BSD-3-Clause // copyright-holders:Karl Stenerud #include "emu.h" -#include "debugger.h" #include "g65816.h" #include "g65816cm.h" #define EXECUTION_MODE EXECUTION_MODE_E diff -Nru mame-0.242+dfsg.1/src/devices/cpu/g65816/g65816op.h mame-0.243+dfsg.1/src/devices/cpu/g65816/g65816op.h --- mame-0.242+dfsg.1/src/devices/cpu/g65816/g65816op.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/g65816/g65816op.h 2022-04-29 05:37:26.000000000 +0000 @@ -596,7 +596,7 @@ /* Unusual behavior: stacks PC-1 */ #undef OP_JSR #define OP_JSR(MODE) \ - CLK(CLK_OP + CLK_W16 + CLK_##MODE); \ + CLK(6); \ DST = EA_##MODE(); \ g65816i_push_16(REGISTER_PC-1); \ g65816i_jump_16(DST) @@ -605,7 +605,7 @@ /* Unusual behavior: stacks PC-1 */ #undef OP_JSRAXI #define OP_JSRAXI() \ - CLK(CLK_OP + CLK_W16 + CLK_AXI); \ + CLK(8); \ DST = read_16_AXI(REGISTER_PB | (MAKE_UINT_16(OPER_16_IMM() + REGISTER_X))); \ g65816i_push_16(REGISTER_PC-1); \ g65816i_jump_16(DST) diff -Nru mame-0.242+dfsg.1/src/devices/cpu/gigatron/gigatrondasm.cpp mame-0.243+dfsg.1/src/devices/cpu/gigatron/gigatrondasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/gigatron/gigatrondasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/gigatron/gigatrondasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -51,6 +51,8 @@ util::stream_format(stream, "%-5s", s_jumps[(inst & 0x1c00) >> 10]); if ((inst & 0x1c00) == 0) stream << "y,"; + else if (inst < 0xfc00) + flags = STEP_COND | step_over_extra(1); switch (inst & 0x0300) { @@ -73,8 +75,6 @@ stream << "in"; break; } - - flags = STEP_OVER | step_over_extra(1); } else if ((inst & 0xf300) == 0x0200) stream << "nop"; diff -Nru mame-0.242+dfsg.1/src/devices/cpu/h16/h16dasm.cpp mame-0.243+dfsg.1/src/devices/cpu/h16/h16dasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/h16/h16dasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/h16/h16dasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -832,9 +832,14 @@ break; case 0xa4: case 0xa5: case 0xa6: - util::stream_format(stream, "%-9s", string_format("B%s.%c", s_conditions[opcodes.r8(pc++) & 0x0f], "BWL"[op & 0x03])); + { + u8 xb = opcodes.r8(pc++); + util::stream_format(stream, "%-9s", string_format("B%s.%c", s_conditions[xb & 0x0f], "BWL"[op & 0x03])); dasm_branch_disp(stream, pc, opcodes, op & 0x03); + if ((xb & 0x0e) != 0) + flags |= STEP_COND; break; + } case 0xa8: case 0xa9: case 0xaa: util::stream_format(stream, "%-9s", string_format("BSR.%c", "BWL"[op & 0x03])); @@ -865,6 +870,7 @@ format_register(stream, 0, xb >> 4); stream << ", "; dasm_branch_disp(stream, pc, opcodes, op & 0x03); + flags |= STEP_COND; break; } @@ -995,9 +1001,14 @@ break; case 0xf3: - util::stream_format(stream, "TRAP/%s", s_conditions[opcodes.r8(pc++) & 0x0f]); + { + u8 xb = opcodes.r8(pc++); + util::stream_format(stream, "TRAP/%s", s_conditions[xb & 0x0f]); flags |= STEP_OVER; + if ((xb & 0x0e) != 0) + flags |= STEP_COND; break; + } case 0xf4: stream << "RTR"; diff -Nru mame-0.242+dfsg.1/src/devices/cpu/h6280/6280dasm.cpp mame-0.243+dfsg.1/src/devices/cpu/h6280/6280dasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/h6280/6280dasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/h6280/6280dasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -120,6 +120,8 @@ case _rel: util::stream_format(stream, "%-5s$%04X", token[opc], (PC + 1 + (signed char)params.r8(PC)) & 0xffff); PC+=1; + if (opc != _bra && opc != _bsr) + flags = STEP_COND; break; case _imm: util::stream_format(stream, "%-5s#$%02X", token[opc], params.r8(PC)); diff -Nru mame-0.242+dfsg.1/src/devices/cpu/h6280/h6280.cpp mame-0.243+dfsg.1/src/devices/cpu/h6280/h6280.cpp --- mame-0.242+dfsg.1/src/devices/cpu/h6280/h6280.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/h6280/h6280.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -113,7 +113,6 @@ #include "emu.h" #include "h6280.h" #include "6280dasm.h" -#include "debugger.h" /* 6280 flags */ enum diff -Nru mame-0.242+dfsg.1/src/devices/cpu/h8/h8.cpp mame-0.243+dfsg.1/src/devices/cpu/h8/h8.cpp --- mame-0.242+dfsg.1/src/devices/cpu/h8/h8.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/h8/h8.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -10,7 +10,6 @@ ***************************************************************************/ #include "emu.h" -#include "debugger.h" #include "h8.h" #include "h8_dma.h" #include "h8_dtc.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/h8/h8make.py mame-0.243+dfsg.1/src/devices/cpu/h8/h8make.py --- mame-0.242+dfsg.1/src/devices/cpu/h8/h8make.py 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/h8/h8make.py 2022-04-29 05:37:26.000000000 +0000 @@ -201,6 +201,8 @@ flags = "%d | STEP_OVER" % size elif self.name == "rts" or self.name == "rte": flags = "%d | STEP_OUT" % size + elif self.am1 == "rel8" and self.name != "bt" and self.name != "bf": + flags = "%d | STEP_COND" % size else: flags = "%d" % size diff -Nru mame-0.242+dfsg.1/src/devices/cpu/h8500/h8500dasm.cpp mame-0.243+dfsg.1/src/devices/cpu/h8500/h8500dasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/h8500/h8500dasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/h8500/h8500dasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -404,7 +404,7 @@ format_reg(stream, op & 0x07, true); stream << ","; format_bdisp(stream, s16(s8(opcodes.r8(pc + 2))), pc + 3); - return 3 | SUPPORTED; + return 3 | STEP_COND | SUPPORTED; } else if (ea == 0x11 && (op & 0xf7) == 0x14 && m_expanded) { @@ -503,7 +503,7 @@ format_bdisp(stream, s16(opcodes.r16(pc + 1)), pc + 3); else format_bdisp(stream, s16(s8(opcodes.r8(pc + 1))), pc + 2); - return (BIT(op, 4) ? 3 : 2) | SUPPORTED; + return (BIT(op, 4) ? 3 : 2) | ((op & 0x0e) != 0 ? STEP_COND : 0) | SUPPORTED; } else switch (op) { diff -Nru mame-0.242+dfsg.1/src/devices/cpu/hcd62121/hcd62121.cpp mame-0.243+dfsg.1/src/devices/cpu/hcd62121/hcd62121.cpp --- mame-0.242+dfsg.1/src/devices/cpu/hcd62121/hcd62121.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/hcd62121/hcd62121.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -23,8 +23,6 @@ #include "hcd62121.h" #include "hcd62121d.h" -#include "debugger.h" - enum { diff -Nru mame-0.242+dfsg.1/src/devices/cpu/hd61700/hd61700.cpp mame-0.243+dfsg.1/src/devices/cpu/hd61700/hd61700.cpp --- mame-0.242+dfsg.1/src/devices/cpu/hd61700/hd61700.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/hd61700/hd61700.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -26,8 +26,6 @@ #include "hd61700.h" #include "hd61700d.h" -#include "debugger.h" - // internal ROM #define INT_ROM 0x0c00 diff -Nru mame-0.242+dfsg.1/src/devices/cpu/hd61700/hd61700d.cpp mame-0.243+dfsg.1/src/devices/cpu/hd61700/hd61700d.cpp --- mame-0.242+dfsg.1/src/devices/cpu/hd61700/hd61700d.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/hd61700/hd61700d.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -166,7 +166,7 @@ { "rtn", OP_JX_COND, OP_NULL, 0 }, { "rtn", OP_JX_COND, OP_NULL, 0 }, { "rtn", OP_JX_COND, OP_NULL, 0 }, { "rtn", OP_JX_COND, OP_NULL, 0 }, { "rtn", OP_JX_COND, OP_NULL, 0 }, { "rtn", OP_NULL, OP_NULL, 0 }, - { "nop", OP_JX_COND, OP_NULL, 0 }, { "clt", OP_NULL, OP_NULL, 0 }, + { "nop", OP_NULL, OP_NULL, 0 }, { "clt", OP_NULL, OP_NULL, 0 }, { "fst", OP_NULL, OP_NULL, 0 }, { "slw", OP_NULL, OP_NULL, 0 }, { "can", OP_NULL, OP_NULL, 0 }, { "rtni", OP_NULL, OP_NULL, 0 }, { "off", OP_NULL, OP_NULL, 0 }, { "trp", OP_NULL, OP_NULL, 0 }, @@ -340,18 +340,17 @@ switch (op) { case 0x30: case 0x31: case 0x32: case 0x33: //jp - case 0x34: case 0x35: case 0x36: case 0x37: //jp + case 0x34: case 0x35: case 0x36: //jp + case 0xb0: case 0xb1: case 0xb2: case 0xb3: //jr + case 0xb4: case 0xb5: case 0xb6: //jr + return STEP_COND; case 0x70: case 0x71: case 0x72: case 0x73: //cal case 0x74: case 0x75: case 0x76: case 0x77: //cal - case 0xb0: case 0xb1: case 0xb2: case 0xb3: //jr - case 0xb4: case 0xb5: case 0xb6: case 0xb7: //jr - case 0xde: //jp - case 0xdf: //jp - return STEP_OVER; + return STEP_OVER | (op < 0x77 ? STEP_COND : 0); case 0xf0: case 0xf1: case 0xf2: case 0xf3: //rtn case 0xf4: case 0xf5: case 0xf6: case 0xf7: //rtn case 0xfd: //rtni - return STEP_OUT; + return STEP_OUT | (op < 0xf7 ? STEP_COND : 0); } return 0; diff -Nru mame-0.242+dfsg.1/src/devices/cpu/hmcs40/hmcs40.cpp mame-0.243+dfsg.1/src/devices/cpu/hmcs40/hmcs40.cpp --- mame-0.242+dfsg.1/src/devices/cpu/hmcs40/hmcs40.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/hmcs40/hmcs40.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -20,7 +20,6 @@ #include "emu.h" #include "hmcs40.h" -#include "debugger.h" #include "hmcs40d.h" #define IS_PMOS 0 diff -Nru mame-0.242+dfsg.1/src/devices/cpu/hmcs40/hmcs40d.cpp mame-0.243+dfsg.1/src/devices/cpu/hmcs40/hmcs40d.cpp --- mame-0.242+dfsg.1/src/devices/cpu/hmcs40/hmcs40d.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/hmcs40/hmcs40d.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -81,7 +81,7 @@ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, STEP_OVER, 0, 0, STEP_OUT, + STEP_COND, STEP_OVER | STEP_COND, 0, 0, STEP_OUT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, STEP_OUT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 diff -Nru mame-0.242+dfsg.1/src/devices/cpu/hpc/hpcdasm.cpp mame-0.243+dfsg.1/src/devices/cpu/hpc/hpcdasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/hpc/hpcdasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/hpc/hpcdasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -462,10 +462,12 @@ case 0x06: stream << "ifnc"; + bytes |= STEP_COND; break; case 0x07: stream << "ifc"; + bytes |= STEP_COND; break; case 0x08: case 0x09: case 0x0a: case 0x0b: @@ -476,6 +478,7 @@ case 0x10: case 0x11: case 0x12: case 0x13: case 0x14: case 0x15: case 0x16: case 0x17: disassemble_bit_op(stream, "ifbit", opcode & 0x07, reg, src, indir, idx); + bytes |= STEP_COND; break; case 0x18: case 0x19: case 0x1a: case 0x1b: @@ -515,6 +518,7 @@ case 0x3a: disassemble_op(stream, "ifbit", reg, src, imm, indir, idx, false); + bytes |= STEP_COND; break; case 0x3b: @@ -589,7 +593,7 @@ case 0x8a: case 0xaa: disassemble_unary_op(stream, "decsz", reg, src, indir, idx, BIT(opcode, 5)); - bytes |= STEP_OVER | (1 << OVERINSTSHIFT); + bytes |= STEP_COND; break; case 0x8b: @@ -643,10 +647,12 @@ case 0x9c: case 0xbc: case 0xdc: case 0xfc: disassemble_op(stream, "ifeq", reg, src, imm, indir, idx, BIT(opcode, 5)); + bytes |= STEP_COND; break; case 0x9d: case 0xbd: case 0xdd: case 0xfd: disassemble_op(stream, "ifgt", reg, src, imm, indir, idx, BIT(opcode, 5)); + bytes |= STEP_COND; break; case 0x9e: case 0xbe: case 0xde: case 0xfe: @@ -691,7 +697,7 @@ util::stream_format(stream, "%-8sA,[B%c].%c", "lds", BIT(opcode, 1) ? '-' : '+', BIT(opcode, 5) ? 'w' : 'b'); - bytes |= STEP_OVER | (1 << OVERINSTSHIFT); + bytes |= STEP_COND; break; case 0xd0: case 0xd2: @@ -706,7 +712,7 @@ util::stream_format(stream, "%-8sA,[B%c].%c", "xs", BIT(opcode, 1) ? '-' : '+', BIT(opcode, 5) ? 'w' : 'b'); - bytes |= STEP_OVER | (1 << OVERINSTSHIFT); + bytes |= STEP_COND; break; case 0xd1: case 0xd3: diff -Nru mame-0.242+dfsg.1/src/devices/cpu/hphybrid/hphybrid.cpp mame-0.243+dfsg.1/src/devices/cpu/hphybrid/hphybrid.cpp --- mame-0.242+dfsg.1/src/devices/cpu/hphybrid/hphybrid.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/hphybrid/hphybrid.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -34,7 +34,6 @@ #include "emu.h" #include "hphybrid.h" #include "hphybrid_dasm.h" -#include "debugger.h" #include "hphybrid_defs.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/hphybrid/hphybrid_dasm.cpp mame-0.243+dfsg.1/src/devices/cpu/hphybrid/hphybrid_dasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/hphybrid/hphybrid_dasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/hphybrid/hphybrid_dasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -286,47 +286,47 @@ {0xffff , 0x0000 , "NOP" , &hp_hybrid_disassembler::param_none , 0 }, {0x7800 , 0x0000 , "LDA" , &hp_hybrid_disassembler::param_loc , 0 }, {0x7800 , 0x0800 , "LDB" , &hp_hybrid_disassembler::param_loc , 0 }, - {0x7800 , 0x1000 , "CPA" , &hp_hybrid_disassembler::param_loc , 0 }, - {0x7800 , 0x1800 , "CPB" , &hp_hybrid_disassembler::param_loc , 0 }, + {0x7800 , 0x1000 , "CPA" , &hp_hybrid_disassembler::param_loc , STEP_COND }, + {0x7800 , 0x1800 , "CPB" , &hp_hybrid_disassembler::param_loc , STEP_COND }, {0x7800 , 0x2000 , "ADA" , &hp_hybrid_disassembler::param_loc , 0 }, {0x7800 , 0x2800 , "ADB" , &hp_hybrid_disassembler::param_loc , 0 }, {0x7800 , 0x3000 , "STA" , &hp_hybrid_disassembler::param_loc , 0 }, {0x7800 , 0x3800 , "STB" , &hp_hybrid_disassembler::param_loc , 0 }, {0x7800 , 0x4000 , "JSM" , &hp_hybrid_disassembler::param_loc , STEP_OVER }, - {0x7800 , 0x4800 , "ISZ" , &hp_hybrid_disassembler::param_loc , 0 }, + {0x7800 , 0x4800 , "ISZ" , &hp_hybrid_disassembler::param_loc , STEP_COND }, {0x7800 , 0x5000 , "AND" , &hp_hybrid_disassembler::param_loc , 0 }, - {0x7800 , 0x5800 , "DSZ" , &hp_hybrid_disassembler::param_loc , 0 }, + {0x7800 , 0x5800 , "DSZ" , &hp_hybrid_disassembler::param_loc , STEP_COND }, {0x7800 , 0x6000 , "IOR" , &hp_hybrid_disassembler::param_loc , 0 }, {0x7800 , 0x6800 , "JMP" , &hp_hybrid_disassembler::param_loc , 0 }, {0x7fe0 , 0x7000 , "EXE" , &hp_hybrid_disassembler::param_addr32 , 0 }, - {0xffc0 , 0x7400 , "RZA" , &hp_hybrid_disassembler::param_skip , 0 }, - {0xffc0 , 0x7C00 , "RZB" , &hp_hybrid_disassembler::param_skip , 0 }, - {0xffc0 , 0x7440 , "RIA" , &hp_hybrid_disassembler::param_skip , 0 }, - {0xffc0 , 0x7C40 , "RIB" , &hp_hybrid_disassembler::param_skip , 0 }, - {0xffc0 , 0x74c0 , "SDS" , &hp_hybrid_disassembler::param_skip , 0 }, - {0xffc0 , 0x7500 , "SZA" , &hp_hybrid_disassembler::param_skip , 0 }, - {0xffc0 , 0x7D00 , "SZB" , &hp_hybrid_disassembler::param_skip , 0 }, - {0xffc0 , 0x7540 , "SIA" , &hp_hybrid_disassembler::param_skip , 0 }, - {0xffc0 , 0x7D40 , "SIB" , &hp_hybrid_disassembler::param_skip , 0 }, - {0xffc0 , 0x7480 , "SFS" , &hp_hybrid_disassembler::param_skip , 0 }, - {0xffc0 , 0x7580 , "SFC" , &hp_hybrid_disassembler::param_skip , 0 }, - {0xffc0 , 0x75c0 , "SDC" , &hp_hybrid_disassembler::param_skip , 0 }, - {0xffc0 , 0x7c80 , "SSS" , &hp_hybrid_disassembler::param_skip , 0 }, - {0xffc0 , 0x7d80 , "SSC" , &hp_hybrid_disassembler::param_skip , 0 }, - {0xffc0 , 0x7cc0 , "SHS" , &hp_hybrid_disassembler::param_skip , 0 }, - {0xffc0 , 0x7dc0 , "SHC" , &hp_hybrid_disassembler::param_skip , 0 }, - {0xff00 , 0x7600 , "SLA" , &hp_hybrid_disassembler::param_skip_sc , 0 }, - {0xff00 , 0x7e00 , "SLB" , &hp_hybrid_disassembler::param_skip_sc , 0 }, - {0xff00 , 0x7700 , "RLA" , &hp_hybrid_disassembler::param_skip_sc , 0 }, - {0xff00 , 0x7f00 , "RLB" , &hp_hybrid_disassembler::param_skip_sc , 0 }, - {0xff00 , 0xf400 , "SAP" , &hp_hybrid_disassembler::param_skip_sc , 0 }, - {0xff00 , 0xfc00 , "SBP" , &hp_hybrid_disassembler::param_skip_sc , 0 }, - {0xff00 , 0xf500 , "SAM" , &hp_hybrid_disassembler::param_skip_sc , 0 }, - {0xff00 , 0xfd00 , "SBM" , &hp_hybrid_disassembler::param_skip_sc , 0 }, - {0xff00 , 0xf600 , "SOC" , &hp_hybrid_disassembler::param_skip_sc , 0 }, - {0xff00 , 0xf700 , "SOS" , &hp_hybrid_disassembler::param_skip_sc , 0 }, - {0xff00 , 0xfe00 , "SEC" , &hp_hybrid_disassembler::param_skip_sc , 0 }, - {0xff00 , 0xff00 , "SES" , &hp_hybrid_disassembler::param_skip_sc , 0 }, + {0xffc0 , 0x7400 , "RZA" , &hp_hybrid_disassembler::param_skip , STEP_COND }, + {0xffc0 , 0x7C00 , "RZB" , &hp_hybrid_disassembler::param_skip , STEP_COND }, + {0xffc0 , 0x7440 , "RIA" , &hp_hybrid_disassembler::param_skip , STEP_COND }, + {0xffc0 , 0x7C40 , "RIB" , &hp_hybrid_disassembler::param_skip , STEP_COND }, + {0xffc0 , 0x74c0 , "SDS" , &hp_hybrid_disassembler::param_skip , STEP_COND }, + {0xffc0 , 0x7500 , "SZA" , &hp_hybrid_disassembler::param_skip , STEP_COND }, + {0xffc0 , 0x7D00 , "SZB" , &hp_hybrid_disassembler::param_skip , STEP_COND }, + {0xffc0 , 0x7540 , "SIA" , &hp_hybrid_disassembler::param_skip , STEP_COND }, + {0xffc0 , 0x7D40 , "SIB" , &hp_hybrid_disassembler::param_skip , STEP_COND }, + {0xffc0 , 0x7480 , "SFS" , &hp_hybrid_disassembler::param_skip , STEP_COND }, + {0xffc0 , 0x7580 , "SFC" , &hp_hybrid_disassembler::param_skip , STEP_COND }, + {0xffc0 , 0x75c0 , "SDC" , &hp_hybrid_disassembler::param_skip , STEP_COND }, + {0xffc0 , 0x7c80 , "SSS" , &hp_hybrid_disassembler::param_skip , STEP_COND }, + {0xffc0 , 0x7d80 , "SSC" , &hp_hybrid_disassembler::param_skip , STEP_COND }, + {0xffc0 , 0x7cc0 , "SHS" , &hp_hybrid_disassembler::param_skip , STEP_COND }, + {0xffc0 , 0x7dc0 , "SHC" , &hp_hybrid_disassembler::param_skip , STEP_COND }, + {0xff00 , 0x7600 , "SLA" , &hp_hybrid_disassembler::param_skip_sc , STEP_COND }, + {0xff00 , 0x7e00 , "SLB" , &hp_hybrid_disassembler::param_skip_sc , STEP_COND }, + {0xff00 , 0x7700 , "RLA" , &hp_hybrid_disassembler::param_skip_sc , STEP_COND }, + {0xff00 , 0x7f00 , "RLB" , &hp_hybrid_disassembler::param_skip_sc , STEP_COND }, + {0xff00 , 0xf400 , "SAP" , &hp_hybrid_disassembler::param_skip_sc , STEP_COND }, + {0xff00 , 0xfc00 , "SBP" , &hp_hybrid_disassembler::param_skip_sc , STEP_COND }, + {0xff00 , 0xf500 , "SAM" , &hp_hybrid_disassembler::param_skip_sc , STEP_COND }, + {0xff00 , 0xfd00 , "SBM" , &hp_hybrid_disassembler::param_skip_sc , STEP_COND }, + {0xff00 , 0xf600 , "SOC" , &hp_hybrid_disassembler::param_skip_sc , STEP_COND }, + {0xff00 , 0xf700 , "SOS" , &hp_hybrid_disassembler::param_skip_sc , STEP_COND }, + {0xff00 , 0xfe00 , "SEC" , &hp_hybrid_disassembler::param_skip_sc , STEP_COND }, + {0xff00 , 0xff00 , "SES" , &hp_hybrid_disassembler::param_skip_sc , STEP_COND }, {0xffff , 0xf020 , "TCA" , &hp_hybrid_disassembler::param_none , 0 }, {0xffff , 0xf820 , "TCB" , &hp_hybrid_disassembler::param_none , 0 }, {0xffff , 0xf060 , "CMA" , &hp_hybrid_disassembler::param_none , 0 }, diff -Nru mame-0.242+dfsg.1/src/devices/cpu/i386/cpuidmsrs.hxx mame-0.243+dfsg.1/src/devices/cpu/i386/cpuidmsrs.hxx --- mame-0.242+dfsg.1/src/devices/cpu/i386/cpuidmsrs.hxx 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/i386/cpuidmsrs.hxx 2022-04-29 05:37:26.000000000 +0000 @@ -36,7 +36,7 @@ if (!(offset & ~0xf)) // 2-f are test registers { valid_msr = true; - logerror("RDMSR: Reading test MSR %x", offset); + logerror("RDMSR: Reading test MSR %x\n", offset); return 0; } logerror("RDMSR: invalid P5 MSR read %08x at %08x\n", offset, m_pc - 2); @@ -84,7 +84,7 @@ if (!(offset & ~0xf)) // 2-f are test registers { valid_msr = true; - logerror("WRMSR: Writing test MSR %x", offset); + logerror("WRMSR: Writing test MSR %x\n", offset); break; } logerror("WRMSR: invalid MSR write %08x (%08x%08x) at %08x\n", offset, (uint32_t)(data >> 32), (uint32_t)data, m_pc - 2); diff -Nru mame-0.242+dfsg.1/src/devices/cpu/i386/i386.cpp mame-0.243+dfsg.1/src/devices/cpu/i386/i386.cpp --- mame-0.242+dfsg.1/src/devices/cpu/i386/i386.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/i386/i386.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -25,7 +25,6 @@ #include "cycles.h" #include "i386ops.h" -#include "debugger.h" #include "debug/debugcpu.h" #include "debug/express.h" @@ -2445,6 +2444,7 @@ m_opcode_bytes_length = 0; memset(m_opcode_addrs, 0, sizeof(m_opcode_addrs)); m_opcode_addrs_index = 0; + m_dri_changed_active = false; } void i386_device::device_reset() diff -Nru mame-0.242+dfsg.1/src/devices/cpu/i386/i386dasm.cpp mame-0.243+dfsg.1/src/devices/cpu/i386/i386dasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/i386/i386dasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/i386/i386dasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -131,22 +131,22 @@ {"outsb", 0, PARAM_PREIMP, 0, 0 }, {"outsw\0outsd\0outsd",VAR_NAME, PARAM_PREIMP, 0, 0 }, // 0x70 - {"jo", 0, PARAM_REL8, 0, 0 }, - {"jno", 0, PARAM_REL8, 0, 0 }, - {"jb", 0, PARAM_REL8, 0, 0 }, - {"jae", 0, PARAM_REL8, 0, 0 }, - {"je", 0, PARAM_REL8, 0, 0 }, - {"jne", 0, PARAM_REL8, 0, 0 }, - {"jbe", 0, PARAM_REL8, 0, 0 }, - {"ja", 0, PARAM_REL8, 0, 0 }, - {"js", 0, PARAM_REL8, 0, 0 }, - {"jns", 0, PARAM_REL8, 0, 0 }, - {"jp", 0, PARAM_REL8, 0, 0 }, - {"jnp", 0, PARAM_REL8, 0, 0 }, - {"jl", 0, PARAM_REL8, 0, 0 }, - {"jge", 0, PARAM_REL8, 0, 0 }, - {"jle", 0, PARAM_REL8, 0, 0 }, - {"jg", 0, PARAM_REL8, 0, 0 }, + {"jo", 0, PARAM_REL8, 0, 0, STEP_COND}, + {"jno", 0, PARAM_REL8, 0, 0, STEP_COND}, + {"jb", 0, PARAM_REL8, 0, 0, STEP_COND}, + {"jae", 0, PARAM_REL8, 0, 0, STEP_COND}, + {"je", 0, PARAM_REL8, 0, 0, STEP_COND}, + {"jne", 0, PARAM_REL8, 0, 0, STEP_COND}, + {"jbe", 0, PARAM_REL8, 0, 0, STEP_COND}, + {"ja", 0, PARAM_REL8, 0, 0, STEP_COND}, + {"js", 0, PARAM_REL8, 0, 0, STEP_COND}, + {"jns", 0, PARAM_REL8, 0, 0, STEP_COND}, + {"jp", 0, PARAM_REL8, 0, 0, STEP_COND}, + {"jnp", 0, PARAM_REL8, 0, 0, STEP_COND}, + {"jl", 0, PARAM_REL8, 0, 0, STEP_COND}, + {"jge", 0, PARAM_REL8, 0, 0, STEP_COND}, + {"jle", 0, PARAM_REL8, 0, 0, STEP_COND}, + {"jg", 0, PARAM_REL8, 0, 0, STEP_COND}, // 0x80 {"group80", GROUP, 0, 0, 0 }, {"group81", GROUP, 0, 0, 0 }, @@ -230,7 +230,7 @@ {"retf", 0, 0, 0, 0, STEP_OUT}, {"int 3", 0, 0, 0, 0, STEP_OVER}, {"int", 0, PARAM_UI8, 0, 0, STEP_OVER}, - {"into", 0, 0, 0, 0 }, + {"into", 0, 0, 0, 0, STEP_OVER | STEP_COND}, {"iret", 0, 0, 0, 0, STEP_OUT}, // 0xd0 {"groupD0", GROUP, 0, 0, 0 }, @@ -250,10 +250,10 @@ {"escape", FPU, 0, 0, 0 }, {"escape", FPU, 0, 0, 0 }, // 0xe0 - {"loopne", 0, PARAM_REL8, 0, 0, STEP_OVER}, - {"loopz", 0, PARAM_REL8, 0, 0, STEP_OVER}, - {"loop", 0, PARAM_REL8, 0, 0, STEP_OVER}, - {"jcxz\0jecxz\0jrcxz",VAR_NAME, PARAM_REL8, 0, 0 }, + {"loopne", 0, PARAM_REL8, 0, 0, STEP_COND}, + {"loopz", 0, PARAM_REL8, 0, 0, STEP_COND}, + {"loop", 0, PARAM_REL8, 0, 0, STEP_COND}, + {"jcxz\0jecxz\0jrcxz",VAR_NAME, PARAM_REL8, 0, 0, STEP_COND}, {"in", 0, PARAM_AL, PARAM_UI8, 0 }, {"in", 0, PARAM_EAX, PARAM_UI8, 0 }, {"out", 0, PARAM_UI8, PARAM_AL, 0 }, diff -Nru mame-0.242+dfsg.1/src/devices/cpu/i386/i386.h mame-0.243+dfsg.1/src/devices/cpu/i386/i386.h --- mame-0.242+dfsg.1/src/devices/cpu/i386/i386.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/i386/i386.h 2022-04-29 05:37:26.000000000 +0000 @@ -276,6 +276,7 @@ memory_passthrough_handler m_dr_breakpoints[4]; util::notifier_subscription m_notifier; + bool m_dri_changed_active; //386 Debug Register change handlers. inline void dri_changed(); diff -Nru mame-0.242+dfsg.1/src/devices/cpu/i386/i386ops.hxx mame-0.243+dfsg.1/src/devices/cpu/i386/i386ops.hxx --- mame-0.242+dfsg.1/src/devices/cpu/i386/i386ops.hxx 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/i386/i386ops.hxx 2022-04-29 05:37:26.000000000 +0000 @@ -736,9 +736,10 @@ case 6: CYCLES(CYCLES_MOV_DR6_7_REG); m_dr[dr] = LOAD_RM32(modrm); break; case 7: { - dr7_changed(m_dr[7], rm32); - CYCLES(CYCLES_MOV_DR6_7_REG); + uint32_t old_dr7 = m_dr[7]; m_dr[dr] = rm32; + dr7_changed(old_dr7, m_dr[7]); + CYCLES(CYCLES_MOV_DR6_7_REG); break; } default: diff -Nru mame-0.242+dfsg.1/src/devices/cpu/i386/i386segs.hxx mame-0.243+dfsg.1/src/devices/cpu/i386/i386segs.hxx --- mame-0.242+dfsg.1/src/devices/cpu/i386/i386segs.hxx 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/i386/i386segs.hxx 2022-04-29 05:37:26.000000000 +0000 @@ -2479,7 +2479,11 @@ inline void i386_device::dri_changed() { int dr; - if(!(m_dr[7] & 0xff)) return; + + if(m_dri_changed_active) + return; + m_dri_changed_active = true; + for(dr = 0; dr < 4; dr++) { m_dr_breakpoints[dr].remove(); @@ -2490,48 +2494,65 @@ int breakpoint_length = (m_dr[7] >> ((dr << 2) + 16 + 2)) & 3; uint32_t phys_addr = m_dr[dr]; uint32_t error; - phys_addr = translate_address(m_CPL, TRANSLATE_READ, &phys_addr, &error); - phys_addr &= ~3; // According to CUP386, data breakpoints are only reliable on dword-aligned addresses, so align this to a dword. - uint32_t true_mask = 0; - switch(breakpoint_length) - { - case 0: true_mask = 0xff; break; - case 1: true_mask = 0xffff; break; - // Case 2 is invalid on a real 386. - case 3: true_mask = 0xffffffff; break; - } - if(true_mask == 0) - { - logerror("i386: Unknown breakpoint length value\n"); - } - else if(breakpoint_type == 1) m_dr_breakpoints[dr] = m_program->install_write_tap(phys_addr, phys_addr + 3, "i386_debug_write_breakpoint", - [&, dr, true_mask](offs_t offset, u32& data, u32 mem_mask) + if(translate_address(m_CPL, TRANSLATE_READ, &phys_addr, &error)) { - if(true_mask & mem_mask) + phys_addr &= ~3; // According to CUP386, data breakpoints are only reliable on dword-aligned addresses, so align this to a dword. + uint32_t true_mask = 0; + switch(breakpoint_length) { - m_dr[6] |= 1 << dr; - i386_trap(1,0,0); + case 0: true_mask = 0xff; break; + case 1: true_mask = 0xffff; break; + // Case 2 is invalid on a real 386. + case 3: true_mask = 0xffffffff; break; } - }, &m_dr_breakpoints[dr]); - else if(breakpoint_type == 3) m_dr_breakpoints[dr] = m_program->install_readwrite_tap(phys_addr, phys_addr + 3, "i386_debug_readwrite_breakpoint", - [this, dr, true_mask](offs_t offset, u32& data, u32 mem_mask) - { - if(true_mask & mem_mask) + if(true_mask == 0) { - m_dr[6] |= 1 << dr; - i386_trap(1,0,0); + logerror("i386: Unknown breakpoint length value\n"); } - }, - [this, dr, true_mask](offs_t offset, u32& data, u32 mem_mask) - { - if(true_mask & mem_mask) + else if(breakpoint_type == 1) { - m_dr[6] |= 1 << dr; - i386_trap(1,0,0); + m_dr_breakpoints[dr] = m_program->install_write_tap( + phys_addr, + phys_addr + 3, + "i386_debug_write_breakpoint", + [this, dr, true_mask](offs_t offset, u32& data, u32 mem_mask) + { + if(true_mask & mem_mask) + { + m_dr[6] |= 1 << dr; + i386_trap(1,1,0); + } + }, + &m_dr_breakpoints[dr]); } - }, &m_dr_breakpoints[dr]); + else if(breakpoint_type == 3) + { + m_dr_breakpoints[dr] = m_program->install_readwrite_tap( + phys_addr, + phys_addr + 3, + "i386_debug_readwrite_breakpoint", + [this, dr, true_mask](offs_t offset, u32& data, u32 mem_mask) + { + if(true_mask & mem_mask) + { + m_dr[6] |= 1 << dr; + i386_trap(1,1,0); + } + }, + [this, dr, true_mask](offs_t offset, u32& data, u32 mem_mask) + { + if(true_mask & mem_mask) + { + m_dr[6] |= 1 << dr; + i386_trap(1,1,0); + } + }, + &m_dr_breakpoints[dr]); + } + } } } + m_dri_changed_active = false; } inline void i386_device::dr7_changed(uint32_t old_val, uint32_t new_val) diff -Nru mame-0.242+dfsg.1/src/devices/cpu/i8008/8008dasm.cpp mame-0.243+dfsg.1/src/devices/cpu/i8008/8008dasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/i8008/8008dasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/i8008/8008dasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -65,7 +65,7 @@ } } break; - case 3 : util::stream_format(stream, "r%c%c",(BIT(op,5) ? 't' : 'f'),flag_names[(op>>3)&3]); break; + case 3 : util::stream_format(stream, "r%c%c",(BIT(op,5) ? 't' : 'f'),flag_names[(op>>3)&3]); flags = STEP_OUT | STEP_COND; break; case 4 : { switch((op >> 3) & 7) { case 0 : util::stream_format(stream, "adi %02x",params.r8(pc)); pc++; break; @@ -81,15 +81,15 @@ break; case 5 : util::stream_format(stream, "rst %02x",(op>>3) & 7); break; case 6 : util::stream_format(stream, "l%ci %02x",reg[(op >> 3) & 7],params.r8(pc)); pc++; break; - case 7 : util::stream_format(stream, "ret"); break; + case 7 : util::stream_format(stream, "ret"); flags = STEP_OUT; break; } break; case 0x01: // starting with 01 switch(op & 7) { - case 0 : util::stream_format(stream, "j%c%c %02x%02x",(BIT(op,5)? 't' : 'f'),flag_names[(op>>3)&3], params.r8(pc+1) & 0x3f,params.r8(pc)); pc+=2; break; - case 2 : util::stream_format(stream, "c%c%c %02x%02x",(BIT(op,5)? 't' : 'f'),flag_names[(op>>3)&3], params.r8(pc+1) & 0x3f,params.r8(pc)); pc+=2; break; + case 0 : util::stream_format(stream, "j%c%c %02x%02x",(BIT(op,5)? 't' : 'f'),flag_names[(op>>3)&3], params.r8(pc+1) & 0x3f,params.r8(pc)); pc+=2; flags = STEP_COND; break; + case 2 : util::stream_format(stream, "c%c%c %02x%02x",(BIT(op,5)? 't' : 'f'),flag_names[(op>>3)&3], params.r8(pc+1) & 0x3f,params.r8(pc)); pc+=2; flags = STEP_OVER | STEP_COND; break; case 4 : util::stream_format(stream, "jmp %02x%02x",params.r8(pc+1) & 0x3f,params.r8(pc)); pc+=2; break; - case 6 : util::stream_format(stream, "cal %02x%02x",params.r8(pc+1) & 0x3f,params.r8(pc)); pc+=2; break; + case 6 : util::stream_format(stream, "cal %02x%02x",params.r8(pc+1) & 0x3f,params.r8(pc)); pc+=2; flags = STEP_OVER; break; case 1 : case 3 : case 5 : diff -Nru mame-0.242+dfsg.1/src/devices/cpu/i8008/i8008.cpp mame-0.243+dfsg.1/src/devices/cpu/i8008/i8008.cpp --- mame-0.242+dfsg.1/src/devices/cpu/i8008/i8008.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/i8008/i8008.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -10,7 +10,6 @@ #include "emu.h" #include "i8008.h" #include "8008dasm.h" -#include "debugger.h" //************************************************************************** // MACROS diff -Nru mame-0.242+dfsg.1/src/devices/cpu/i8085/8085dasm.cpp mame-0.243+dfsg.1/src/devices/cpu/i8085/8085dasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/i8085/8085dasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/i8085/8085dasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -216,68 +216,68 @@ case 0xbd: util::stream_format(stream, "cmp l"); break; case 0xbe: util::stream_format(stream, "cmp m"); break; case 0xbf: util::stream_format(stream, "cmp a"); break; - case 0xc0: util::stream_format(stream, "rnz"); flags = STEP_OUT; break; + case 0xc0: util::stream_format(stream, "rnz"); flags = STEP_OUT | STEP_COND; break; case 0xc1: util::stream_format(stream, "pop b"); break; - case 0xc2: util::stream_format(stream, "jnz $%04x", params.r16(pc)); pc+=2; break; + case 0xc2: util::stream_format(stream, "jnz $%04x", params.r16(pc)); pc+=2; flags = STEP_COND; break; case 0xc3: util::stream_format(stream, "jmp $%04x", params.r16(pc)); pc+=2; break; - case 0xc4: util::stream_format(stream, "cnz $%04x", params.r16(pc)); pc+=2; flags = STEP_OVER; break; + case 0xc4: util::stream_format(stream, "cnz $%04x", params.r16(pc)); pc+=2; flags = STEP_OVER | STEP_COND; break; case 0xc5: util::stream_format(stream, "push b"); break; case 0xc6: util::stream_format(stream, "adi $%02x", params.r8(pc)); pc++; break; case 0xc7: util::stream_format(stream, "rst 0"); flags = STEP_OVER; break; - case 0xc8: util::stream_format(stream, "rz"); flags = STEP_OUT; break; + case 0xc8: util::stream_format(stream, "rz"); flags = STEP_OUT | STEP_COND; break; case 0xc9: util::stream_format(stream, "ret"); flags = STEP_OUT; break; - case 0xca: util::stream_format(stream, "jz $%04x", params.r16(pc)); pc+=2; break; - case 0xcb: util::stream_format(stream, "rstv 8 (*)"); flags = STEP_OVER; break; - case 0xcc: util::stream_format(stream, "cz $%04x", params.r16(pc)); pc+=2; flags = STEP_OVER; break; + case 0xca: util::stream_format(stream, "jz $%04x", params.r16(pc)); pc+=2; flags = STEP_COND; break; + case 0xcb: util::stream_format(stream, "rstv 8 (*)"); flags = STEP_OVER | STEP_COND; break; + case 0xcc: util::stream_format(stream, "cz $%04x", params.r16(pc)); pc+=2; flags = STEP_OVER | STEP_COND; break; case 0xcd: util::stream_format(stream, "call $%04x", params.r16(pc)); pc+=2; flags = STEP_OVER; break; case 0xce: util::stream_format(stream, "aci $%02x", params.r8(pc)); pc++; break; case 0xcf: util::stream_format(stream, "rst 1"); flags = STEP_OVER; break; - case 0xd0: util::stream_format(stream, "rnc"); flags = STEP_OUT; break; + case 0xd0: util::stream_format(stream, "rnc"); flags = STEP_OUT | STEP_COND; break; case 0xd1: util::stream_format(stream, "pop d"); break; - case 0xd2: util::stream_format(stream, "jnc $%04x", params.r16(pc)); pc+=2; break; + case 0xd2: util::stream_format(stream, "jnc $%04x", params.r16(pc)); pc+=2; flags = STEP_COND; break; case 0xd3: util::stream_format(stream, "out $%02x", params.r8(pc)); pc++; break; - case 0xd4: util::stream_format(stream, "cnc $%04x", params.r16(pc)); pc+=2; flags = STEP_OVER; break; + case 0xd4: util::stream_format(stream, "cnc $%04x", params.r16(pc)); pc+=2; flags = STEP_OVER | STEP_COND; break; case 0xd5: util::stream_format(stream, "push d"); break; case 0xd6: util::stream_format(stream, "sui $%02x", params.r8(pc)); pc++; break; case 0xd7: util::stream_format(stream, "rst 2"); flags = STEP_OVER; break; - case 0xd8: util::stream_format(stream, "rc"); flags = STEP_OUT; break; + case 0xd8: util::stream_format(stream, "rc"); flags = STEP_OUT | STEP_COND; break; case 0xd9: util::stream_format(stream, "shlx d (*)"); break; - case 0xda: util::stream_format(stream, "jc $%04x", params.r16(pc)); pc+=2; break; + case 0xda: util::stream_format(stream, "jc $%04x", params.r16(pc)); pc+=2; flags = STEP_COND; break; case 0xdb: util::stream_format(stream, "in $%02x", params.r8(pc)); pc++; break; - case 0xdc: util::stream_format(stream, "cc $%04x", params.r16(pc)); pc+=2; flags = STEP_OVER; break; - case 0xdd: util::stream_format(stream, "jnx $%04x (*)", params.r16(pc)); pc+=2; break; + case 0xdc: util::stream_format(stream, "cc $%04x", params.r16(pc)); pc+=2; flags = STEP_OVER | STEP_COND; break; + case 0xdd: util::stream_format(stream, "jnx $%04x (*)", params.r16(pc)); pc+=2; flags = STEP_COND; break; case 0xde: util::stream_format(stream, "sbi $%02x", params.r8(pc)); pc++; break; case 0xdf: util::stream_format(stream, "rst 3"); flags = STEP_OVER; break; - case 0xe0: util::stream_format(stream, "rpo"); flags = STEP_OUT; break; + case 0xe0: util::stream_format(stream, "rpo"); flags = STEP_OUT | STEP_COND; break; case 0xe1: util::stream_format(stream, "pop h"); break; - case 0xe2: util::stream_format(stream, "jpo $%04x", params.r16(pc)); pc+=2; break; + case 0xe2: util::stream_format(stream, "jpo $%04x", params.r16(pc)); pc+=2; flags = STEP_COND; break; case 0xe3: util::stream_format(stream, "xthl"); break; - case 0xe4: util::stream_format(stream, "cpo $%04x", params.r16(pc)); pc+=2; flags = STEP_OVER; break; + case 0xe4: util::stream_format(stream, "cpo $%04x", params.r16(pc)); pc+=2; flags = STEP_OVER | STEP_COND; break; case 0xe5: util::stream_format(stream, "push h"); break; case 0xe6: util::stream_format(stream, "ani $%02x", params.r8(pc)); pc++; break; case 0xe7: util::stream_format(stream, "rst 4"); flags = STEP_OVER; break; - case 0xe8: util::stream_format(stream, "rpe"); flags = STEP_OUT; break; + case 0xe8: util::stream_format(stream, "rpe"); flags = STEP_OUT | STEP_COND; break; case 0xe9: util::stream_format(stream, "pchl"); break; - case 0xea: util::stream_format(stream, "jpe $%04x", params.r16(pc)); pc+=2; break; + case 0xea: util::stream_format(stream, "jpe $%04x", params.r16(pc)); pc+=2; flags = STEP_COND; break; case 0xeb: util::stream_format(stream, "xchg"); break; - case 0xec: util::stream_format(stream, "cpe $%04x", params.r16(pc)); pc+=2; flags = STEP_OVER; break; + case 0xec: util::stream_format(stream, "cpe $%04x", params.r16(pc)); pc+=2; flags = STEP_OVER | STEP_COND; break; case 0xed: util::stream_format(stream, "lhlx d (*)"); break; case 0xee: util::stream_format(stream, "xri $%02x", params.r8(pc)); pc++; break; case 0xef: util::stream_format(stream, "rst 5"); flags = STEP_OVER; break; - case 0xf0: util::stream_format(stream, "rp"); flags = STEP_OUT; break; + case 0xf0: util::stream_format(stream, "rp"); flags = STEP_OUT | STEP_COND; break; case 0xf1: util::stream_format(stream, "pop psw"); break; - case 0xf2: util::stream_format(stream, "jp $%04x", params.r16(pc)); pc+=2; break; + case 0xf2: util::stream_format(stream, "jp $%04x", params.r16(pc)); pc+=2; flags = STEP_COND; break; case 0xf3: util::stream_format(stream, "di"); break; - case 0xf4: util::stream_format(stream, "cp $%04x", params.r16(pc)); pc+=2; break; + case 0xf4: util::stream_format(stream, "cp $%04x", params.r16(pc)); pc+=2; flags = STEP_OVER | STEP_COND; break; case 0xf5: util::stream_format(stream, "push psw"); break; case 0xf6: util::stream_format(stream, "ori $%02x", params.r8(pc)); pc++; break; case 0xf7: util::stream_format(stream, "rst 6"); flags = STEP_OVER; break; - case 0xf8: util::stream_format(stream, "rm"); flags = STEP_OUT; break; + case 0xf8: util::stream_format(stream, "rm"); flags = STEP_OUT | STEP_COND; break; case 0xf9: util::stream_format(stream, "sphl"); break; - case 0xfa: util::stream_format(stream, "jm $%04x", params.r16(pc)); pc+=2; break; + case 0xfa: util::stream_format(stream, "jm $%04x", params.r16(pc)); pc+=2; flags = STEP_COND; break; case 0xfb: util::stream_format(stream, "ei"); break; - case 0xfc: util::stream_format(stream, "cm $%04x", params.r16(pc)); pc+=2; flags = STEP_OVER; break; - case 0xfd: util::stream_format(stream, "jx $%04x (*)", params.r16(pc)); pc+=2; break; + case 0xfc: util::stream_format(stream, "cm $%04x", params.r16(pc)); pc+=2; flags = STEP_OVER | STEP_COND; break; + case 0xfd: util::stream_format(stream, "jx $%04x (*)", params.r16(pc)); pc+=2; flags = STEP_COND; break; case 0xfe: util::stream_format(stream, "cpi $%02x", params.r8(pc)); pc++; break; case 0xff: util::stream_format(stream, "rst 7"); flags = STEP_OVER; break; } diff -Nru mame-0.242+dfsg.1/src/devices/cpu/i8085/i8085.cpp mame-0.243+dfsg.1/src/devices/cpu/i8085/i8085.cpp --- mame-0.242+dfsg.1/src/devices/cpu/i8085/i8085.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/i8085/i8085.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -107,7 +107,6 @@ *****************************************************************************/ #include "emu.h" -#include "debugger.h" #include "i8085.h" #include "8085dasm.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/i8089/i8089_channel.cpp mame-0.243+dfsg.1/src/devices/cpu/i8089/i8089_channel.cpp --- mame-0.242+dfsg.1/src/devices/cpu/i8089/i8089_channel.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/i8089/i8089_channel.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -13,8 +13,6 @@ #include "i8089.h" -#include "debugger.h" - //************************************************************************** // MACROS/CONSTANTS diff -Nru mame-0.242+dfsg.1/src/devices/cpu/i8089/i8089_dasm.cpp mame-0.243+dfsg.1/src/devices/cpu/i8089/i8089_dasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/i8089/i8089_dasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/i8089/i8089_dasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -302,8 +302,8 @@ case 0x0c: return inst_ri("movbi", "movi"); case 0x0e: return inst_r("inc"); case 0x0f: return inst_r("dec"); - case 0x10: return inst_jr("jnz", "ljnz"); - case 0x11: return inst_jr("jz", "ljz"); + case 0x10: m_flags |= STEP_COND; return inst_jr("jnz", "ljnz"); + case 0x11: m_flags |= STEP_COND; return inst_jr("jz", "ljz"); case 0x12: if (m_mm == 0 && m_w == 0 && m_aa == 0 && m_wb == 0 && m_brp == 1) @@ -368,10 +368,10 @@ case 0x29: return inst_rm("orb", "or"); case 0x2a: return inst_rm("andb", "and"); case 0x2b: return inst_rm("notb", "not"); - case 0x2c: return inst_jm("jmce", "ljmce"); - case 0x2d: return inst_jm("jmcne", "ljmcne"); - case 0x2e: return inst_jmb("jnbt", "ljnbt"); - case 0x2f: return inst_jmb("jbt", "ljbt"); + case 0x2c: m_flags |= STEP_COND; return inst_jm("jmce", "ljmce"); + case 0x2d: m_flags |= STEP_COND; return inst_jm("jmcne", "ljmcne"); + case 0x2e: m_flags |= STEP_COND; return inst_jmb("jnbt", "ljnbt"); + case 0x2f: m_flags |= STEP_COND; return inst_jmb("jbt", "ljbt"); case 0x30: return inst_mi("addbi", "addi"); case 0x31: return inst_mi("orbi", "ori"); case 0x32: return inst_mi("andbi", "andi"); @@ -380,8 +380,8 @@ case 0x35: return inst_mr("orb", "or"); case 0x36: return inst_mr("andb", "and"); case 0x37: return inst_mr("notb", "not"); - case 0x38: return inst_j16("jnzb", "jnz", "ljnzb", "ljnz"); - case 0x39: return inst_j16("jzb", "jz", "ljzb", "ljz"); + case 0x38: m_flags |= STEP_COND; return inst_j16("jnzb", "jnz", "ljnzb", "ljnz"); + case 0x39: m_flags |= STEP_COND; return inst_j16("jzb", "jz", "ljzb", "ljz"); case 0x3a: return inst_m("incb", "inc"); case 0x3b: return inst_m("decb", "dec"); case 0x3d: return inst_b("setb"); diff -Nru mame-0.242+dfsg.1/src/devices/cpu/i86/i186.cpp mame-0.243+dfsg.1/src/devices/cpu/i86/i186.cpp --- mame-0.242+dfsg.1/src/devices/cpu/i86/i186.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/i86/i186.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -9,7 +9,6 @@ #include "emu.h" #include "i186.h" -#include "debugger.h" #include "i86inline.h" #define LOG_PORTS 0 diff -Nru mame-0.242+dfsg.1/src/devices/cpu/i86/i286.cpp mame-0.243+dfsg.1/src/devices/cpu/i86/i286.cpp --- mame-0.242+dfsg.1/src/devices/cpu/i86/i286.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/i86/i286.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -2,7 +2,6 @@ // copyright-holders:Carl #include "emu.h" #include "i286.h" -#include "debugger.h" #include "i86inline.h" /* diff -Nru mame-0.242+dfsg.1/src/devices/cpu/i86/i86.cpp mame-0.243+dfsg.1/src/devices/cpu/i86/i86.cpp --- mame-0.242+dfsg.1/src/devices/cpu/i86/i86.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/i86/i86.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -13,7 +13,6 @@ #include "emu.h" #include "i86.h" -#include "debugger.h" #include "i86inline.h" #include "cpu/i386/i386dasm.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/i860/i860.cpp mame-0.243+dfsg.1/src/devices/cpu/i860/i860.cpp --- mame-0.242+dfsg.1/src/devices/cpu/i860/i860.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/i860/i860.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -16,7 +16,6 @@ */ #include "emu.h" -#include "debugger.h" #include "i860.h" #include "i860dis.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/i960/i960.cpp mame-0.243+dfsg.1/src/devices/cpu/i960/i960.cpp --- mame-0.242+dfsg.1/src/devices/cpu/i960/i960.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/i960/i960.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -3,7 +3,6 @@ #include "emu.h" #include "i960.h" #include "i960dis.h" -#include "debugger.h" #ifdef _MSC_VER /* logb prototype is different for MS Visual C */ diff -Nru mame-0.242+dfsg.1/src/devices/cpu/i960/i960dis.cpp mame-0.243+dfsg.1/src/devices/cpu/i960/i960dis.cpp --- mame-0.242+dfsg.1/src/devices/cpu/i960/i960dis.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/i960/i960dis.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -537,6 +537,8 @@ disflags = STEP_OVER; else if (op == 0x0a) disflags = STEP_OUT; + else if ((op & 0xd8) == 0x10 || (op > 0x38 && op < 0x3f)) + disflags = STEP_COND; switch(mnemonic[op].type) { diff -Nru mame-0.242+dfsg.1/src/devices/cpu/ie15/ie15.cpp mame-0.243+dfsg.1/src/devices/cpu/ie15/ie15.cpp --- mame-0.242+dfsg.1/src/devices/cpu/ie15/ie15.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/ie15/ie15.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -4,8 +4,6 @@ #include "ie15.h" #include "ie15dasm.h" -#include "debugger.h" - //************************************************************************** // MACROS diff -Nru mame-0.242+dfsg.1/src/devices/cpu/jaguar/jaguar.cpp mame-0.243+dfsg.1/src/devices/cpu/jaguar/jaguar.cpp --- mame-0.242+dfsg.1/src/devices/cpu/jaguar/jaguar.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/jaguar/jaguar.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -17,7 +17,6 @@ ***************************************************************************/ #include "emu.h" -#include "debugger.h" #include "jaguar.h" #include "jagdasm.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/ks0164/ks0164.cpp mame-0.243+dfsg.1/src/devices/cpu/ks0164/ks0164.cpp --- mame-0.242+dfsg.1/src/devices/cpu/ks0164/ks0164.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/ks0164/ks0164.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -6,7 +6,6 @@ #include "emu.h" #include "ks0164.h" #include "ks0164d.h" -#include "debugger.h" DEFINE_DEVICE_TYPE(KS0164CPU, ks0164_cpu_device, "ks0164cpu", "Samsung KS0164 audio processor") diff -Nru mame-0.242+dfsg.1/src/devices/cpu/ks0164/ks0164d.cpp mame-0.243+dfsg.1/src/devices/cpu/ks0164/ks0164d.cpp --- mame-0.242+dfsg.1/src/devices/cpu/ks0164/ks0164d.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/ks0164/ks0164d.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -32,21 +32,21 @@ #define P std::ostream &stream, u32 opcode, const data_buffer &opcodes, u32 pc const ks0164_disassembler::instruction ks0164_disassembler::instructions[] { - { 0x0000, 0xfc00, [](P) -> u32 { util::stream_format(stream, "bne %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2; } }, - { 0x0400, 0xfc00, [](P) -> u32 { util::stream_format(stream, "beq %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2; } }, - { 0x0800, 0xfc00, [](P) -> u32 { util::stream_format(stream, "bgeu %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2; } }, - { 0x0c00, 0xfc00, [](P) -> u32 { util::stream_format(stream, "bltu %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2; } }, - { 0x1000, 0xfc00, [](P) -> u32 { util::stream_format(stream, "bpl %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2; } }, - { 0x1400, 0xfc00, [](P) -> u32 { util::stream_format(stream, "bmi %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2; } }, - { 0x1800, 0xfc00, [](P) -> u32 { util::stream_format(stream, "bvc %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2; } }, - { 0x1c00, 0xfc00, [](P) -> u32 { util::stream_format(stream, "bvs %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2; } }, - { 0x2000, 0xfc00, [](P) -> u32 { util::stream_format(stream, "bnv %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2; } }, - { 0x2400, 0xfc00, [](P) -> u32 { util::stream_format(stream, "bgtu %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2; } }, - { 0x2800, 0xfc00, [](P) -> u32 { util::stream_format(stream, "bleu %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2; } }, - { 0x2c00, 0xfc00, [](P) -> u32 { util::stream_format(stream, "bgts %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2; } }, - { 0x3000, 0xfc00, [](P) -> u32 { util::stream_format(stream, "bles %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2; } }, - { 0x3400, 0xfc00, [](P) -> u32 { util::stream_format(stream, "bges %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2; } }, - { 0x3800, 0xfc00, [](P) -> u32 { util::stream_format(stream, "blts %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2; } }, + { 0x0000, 0xfc00, [](P) -> u32 { util::stream_format(stream, "bne %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2 | STEP_COND; } }, + { 0x0400, 0xfc00, [](P) -> u32 { util::stream_format(stream, "beq %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2 | STEP_COND; } }, + { 0x0800, 0xfc00, [](P) -> u32 { util::stream_format(stream, "bgeu %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2 | STEP_COND; } }, + { 0x0c00, 0xfc00, [](P) -> u32 { util::stream_format(stream, "bltu %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2 | STEP_COND; } }, + { 0x1000, 0xfc00, [](P) -> u32 { util::stream_format(stream, "bpl %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2 | STEP_COND; } }, + { 0x1400, 0xfc00, [](P) -> u32 { util::stream_format(stream, "bmi %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2 | STEP_COND; } }, + { 0x1800, 0xfc00, [](P) -> u32 { util::stream_format(stream, "bvc %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2 | STEP_COND; } }, + { 0x1c00, 0xfc00, [](P) -> u32 { util::stream_format(stream, "bvs %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2 | STEP_COND; } }, + { 0x2000, 0xfc00, [](P) -> u32 { util::stream_format(stream, "bnv %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2 | STEP_COND; } }, + { 0x2400, 0xfc00, [](P) -> u32 { util::stream_format(stream, "bgtu %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2 | STEP_COND; } }, + { 0x2800, 0xfc00, [](P) -> u32 { util::stream_format(stream, "bleu %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2 | STEP_COND; } }, + { 0x2c00, 0xfc00, [](P) -> u32 { util::stream_format(stream, "bgts %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2 | STEP_COND; } }, + { 0x3000, 0xfc00, [](P) -> u32 { util::stream_format(stream, "bles %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2 | STEP_COND; } }, + { 0x3400, 0xfc00, [](P) -> u32 { util::stream_format(stream, "bges %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2 | STEP_COND; } }, + { 0x3800, 0xfc00, [](P) -> u32 { util::stream_format(stream, "blts %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2 | STEP_COND; } }, { 0x3c00, 0xfc00, [](P) -> u32 { util::stream_format(stream, "bra %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2; } }, { 0x4000, 0xf800, [](P) -> u32 { util::stream_format(stream, "%s += %s", regs[(opcode >> 8) & 7], imm8(opcode)); return 2; } }, @@ -215,8 +215,8 @@ { 0xe007, 0xf88f, [](P) -> u32 { util::stream_format(stream, "(%s%s).b = %s", regs[(opcode >> 8) & 7], off16(opcodes.r16(pc+2)), regs[(opcode >> 4) & 7]); return 4; } }, { 0xe00f, 0xf88f, [](P) -> u32 { util::stream_format(stream, "(%s%s).w = %s", regs[(opcode >> 8) & 7], off16(opcodes.r16(pc+2)), regs[(opcode >> 4) & 7]); return 4; } }, - { 0xf004, 0xf8ff, [](P) -> u32 { util::stream_format(stream, "dbra %s, %04x", regs[(opcode >> 8) & 7], opcodes.r16(pc+2)); return 4; } }, - { 0xf00d, 0xf8ff, [](P) -> u32 { util::stream_format(stream, "cmpbeq %s, %04x, %04x", regs[(opcode >> 8) & 7], opcodes.r16(pc+2), opcodes.r16(pc+4)); return 6; } }, + { 0xf004, 0xf8ff, [](P) -> u32 { util::stream_format(stream, "dbra %s, %04x", regs[(opcode >> 8) & 7], opcodes.r16(pc+2)); return 4 | STEP_COND; } }, + { 0xf00d, 0xf8ff, [](P) -> u32 { util::stream_format(stream, "cmpbeq %s, %04x, %04x", regs[(opcode >> 8) & 7], opcodes.r16(pc+2), opcodes.r16(pc+4)); return 6 | STEP_COND; } }, { 0x0000, 0x0000, [](P) -> u32 { util::stream_format(stream, "?%04x", opcode); return 2; } }, diff -Nru mame-0.242+dfsg.1/src/devices/cpu/lc58/lc58d.cpp mame-0.243+dfsg.1/src/devices/cpu/lc58/lc58d.cpp --- mame-0.242+dfsg.1/src/devices/cpu/lc58/lc58d.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/lc58/lc58d.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -125,14 +125,14 @@ { 0x3000, 0xf000, [](P) -> u32 { util::stream_format(stream, "wrp %02x, %02x", (opcode >> 7) & 0x1f, opcode & 0x7f); return 1; } }, { 0xc000, 0xf800, [](P) -> u32 { util::stream_format(stream, "jmp %03x", opcode & 0x7ff); return 1; } }, - { 0x8000, 0xf800, [](P) -> u32 { util::stream_format(stream, "bab0 %03x", opcode & 0x7ff); return 1; } }, - { 0x8800, 0xf800, [](P) -> u32 { util::stream_format(stream, "bab1 %03x", opcode & 0x7ff); return 1; } }, - { 0x9000, 0xf800, [](P) -> u32 { util::stream_format(stream, "bab2 %03x", opcode & 0x7ff); return 1; } }, - { 0x9800, 0xf800, [](P) -> u32 { util::stream_format(stream, "bab3 %03x", opcode & 0x7ff); return 1; } }, - { 0xa000, 0xf800, [](P) -> u32 { util::stream_format(stream, "banz %03x", opcode & 0x7ff); return 1; } }, - { 0xb000, 0xf800, [](P) -> u32 { util::stream_format(stream, "baz %03x", opcode & 0x7ff); return 1; } }, - { 0xa800, 0xf800, [](P) -> u32 { util::stream_format(stream, "bcnh %03x", opcode & 0x7ff); return 1; } }, - { 0xb800, 0xf800, [](P) -> u32 { util::stream_format(stream, "bch %03x", opcode & 0x7ff); return 1; } }, + { 0x8000, 0xf800, [](P) -> u32 { util::stream_format(stream, "bab0 %03x", opcode & 0x7ff); return 1 | STEP_COND; } }, + { 0x8800, 0xf800, [](P) -> u32 { util::stream_format(stream, "bab1 %03x", opcode & 0x7ff); return 1 | STEP_COND; } }, + { 0x9000, 0xf800, [](P) -> u32 { util::stream_format(stream, "bab2 %03x", opcode & 0x7ff); return 1 | STEP_COND; } }, + { 0x9800, 0xf800, [](P) -> u32 { util::stream_format(stream, "bab3 %03x", opcode & 0x7ff); return 1 | STEP_COND; } }, + { 0xa000, 0xf800, [](P) -> u32 { util::stream_format(stream, "banz %03x", opcode & 0x7ff); return 1 | STEP_COND; } }, + { 0xb000, 0xf800, [](P) -> u32 { util::stream_format(stream, "baz %03x", opcode & 0x7ff); return 1 | STEP_COND; } }, + { 0xa800, 0xf800, [](P) -> u32 { util::stream_format(stream, "bcnh %03x", opcode & 0x7ff); return 1 | STEP_COND; } }, + { 0xb800, 0xf800, [](P) -> u32 { util::stream_format(stream, "bch %03x", opcode & 0x7ff); return 1 | STEP_COND; } }, { 0xc800, 0xf800, [](P) -> u32 { util::stream_format(stream, "call %03x", opcode & 0x7ff); return 1 | STEP_OVER; } }, { 0xd000, 0xffff, [](P) -> u32 { util::stream_format(stream, "rts"); return 1 | STEP_OUT; } }, diff -Nru mame-0.242+dfsg.1/src/devices/cpu/lc8670/lc8670.cpp mame-0.243+dfsg.1/src/devices/cpu/lc8670/lc8670.cpp --- mame-0.242+dfsg.1/src/devices/cpu/lc8670/lc8670.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/lc8670/lc8670.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -16,7 +16,6 @@ ******************************************************************************/ #include "emu.h" -#include "debugger.h" #include "lc8670.h" #include "lc8670dsm.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/lh5801/lh5801.cpp mame-0.243+dfsg.1/src/devices/cpu/lh5801/lh5801.cpp --- mame-0.242+dfsg.1/src/devices/cpu/lh5801/lh5801.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/lh5801/lh5801.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -18,8 +18,6 @@ #include "lh5801.h" #include "5801dasm.h" -#include "debugger.h" - #define VERBOSE 0 #include "logmacro.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/lr35902/lr35902.cpp mame-0.243+dfsg.1/src/devices/cpu/lr35902/lr35902.cpp --- mame-0.242+dfsg.1/src/devices/cpu/lr35902/lr35902.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/lr35902/lr35902.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -42,7 +42,6 @@ #include "emu.h" #include "lr35902.h" #include "lr35902d.h" -#include "debugger.h" /* Flag bit definitions */ enum lr35902_flag diff -Nru mame-0.242+dfsg.1/src/devices/cpu/lr35902/lr35902d.cpp mame-0.243+dfsg.1/src/devices/cpu/lr35902/lr35902d.cpp --- mame-0.242+dfsg.1/src/devices/cpu/lr35902/lr35902d.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/lr35902/lr35902d.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -22,13 +22,13 @@ }; const uint32_t lr35902_disassembler::s_flags[] = { - 0 ,0 ,0 ,0 ,STEP_OVER,0 ,0 , - 0 ,0 ,0 ,0 ,0 ,0 ,STEP_OVER, - 0 ,0 ,0 ,0 ,0 ,0 ,0 , - 0 ,0 ,0 ,STEP_OUT ,STEP_OUT ,0 ,0 , - 0 ,0 ,0 ,0 ,0 ,0 ,STEP_OVER, - 0 ,0 ,0 ,0 ,0 ,0 ,0 , - STEP_OVER,0 ,0 ,0 + 0 ,0 ,0 ,0 ,STEP_OVER,0 ,0 , + 0 ,0 ,0 ,0 ,0 ,0 ,STEP_OVER, + 0 ,0 ,STEP_COND,STEP_COND,0 ,0 ,0 , + 0 ,0 ,0 ,STEP_OUT ,STEP_OUT ,0 ,0 , + 0 ,0 ,0 ,0 ,0 ,0 ,STEP_OVER, + 0 ,0 ,0 ,0 ,0 ,0 ,0 , + STEP_OVER,0 ,0 ,0 }; const lr35902_disassembler::lr35902dasm lr35902_disassembler::mnemonic_cb[256] = { @@ -195,6 +195,7 @@ d = &mnemonic_main[op]; } + bool comma = false; if( d->arguments ) { util::stream_format(stream, "%-4s ", s_mnemonic[d->mnemonic]); src = d->arguments; @@ -245,6 +246,9 @@ pos += 2; util::stream_format(stream, "$%04X", ea); break; + case ',': + comma = true; + [[fallthrough]]; default: stream << *src; break; @@ -255,5 +259,9 @@ util::stream_format(stream, "%s", s_mnemonic[d->mnemonic]); } - return (pos - pc) | s_flags[d->mnemonic] | SUPPORTED; + uint32_t flags = s_flags[d->mnemonic]; + if (flags == STEP_COND && !comma) + flags = 0; + + return (pos - pc) | flags | SUPPORTED; } diff -Nru mame-0.242+dfsg.1/src/devices/cpu/m32c/m32cdasm.cpp mame-0.243+dfsg.1/src/devices/cpu/m32c/m32cdasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/m32c/m32cdasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/m32c/m32cdasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -856,7 +856,7 @@ stream << "und"; } -void m32c_disassembler::dasm_111x(std::ostream &stream, offs_t &pc, const m32c_disassembler::data_buffer &opcodes, u8 op1, bool indirect_dest) const +void m32c_disassembler::dasm_111x(std::ostream &stream, offs_t &pc, offs_t &flags, const m32c_disassembler::data_buffer &opcodes, u8 op1, bool indirect_dest) const { u8 op2 = opcodes.r8(pc++); if ((op2 & 0x30) == 0 || ((op2 & 0x30) == 0x20 && !BIT(op1, 4))) @@ -877,6 +877,7 @@ dasm_operand(stream, pc, opcodes, (op1 & 0x0e) << 1 | BIT(op2, 6, 2), op1 & 1, indirect_dest); stream << ", "; format_label(stream, pc + s8(opcodes.r8(pc))); + flags |= STEP_COND; ++pc; } else if ((op2 & 0x30) == 0x30 && BIT(op1, 4)) @@ -1050,6 +1051,7 @@ util::stream_format(stream, "%-11s", util::string_format("j%s", s_cnds[bitswap<4>(op1, 6, 5, 4, 0)])); format_label(stream, pc + s8(opcodes.r8(pc))); ++pc; + flags |= STEP_COND; break; case 0x8c: case 0x8d: @@ -1211,7 +1213,7 @@ case 0xe0: case 0xe1: case 0xe2: case 0xe3: case 0xe4: case 0xe5: case 0xe6: case 0xe7: case 0xe8: case 0xe9: case 0xf0: case 0xf1: case 0xf2: case 0xf3: case 0xf4: case 0xf5: case 0xf6: case 0xf7: case 0xf8: case 0xf9: - dasm_111x(stream, pc, opcodes, op1, indirect_dest); + dasm_111x(stream, pc, flags, opcodes, op1, indirect_dest); break; case 0xec: diff -Nru mame-0.242+dfsg.1/src/devices/cpu/m32c/m32cdasm.h mame-0.243+dfsg.1/src/devices/cpu/m32c/m32cdasm.h --- mame-0.242+dfsg.1/src/devices/cpu/m32c/m32cdasm.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/m32c/m32cdasm.h 2022-04-29 05:37:26.000000000 +0000 @@ -51,7 +51,7 @@ void dasm_00000001(std::ostream &stream, offs_t &pc, const data_buffer &opcodes, bool indirect_src, bool indirect_dest) const; void dasm_general(std::ostream &stream, offs_t &pc, offs_t &flags, const data_buffer &opcodes, u8 op1, bool indirect_src, bool indirect_dest) const; void dasm_1101(std::ostream &stream, offs_t &pc, const data_buffer &opcodes, u8 op1, bool indirect_src, bool indirect_dest) const; - void dasm_111x(std::ostream &stream, offs_t &pc, const data_buffer &opcodes, u8 op1, bool indirect_dest) const; + void dasm_111x(std::ostream &stream, offs_t &pc, offs_t &flags, const data_buffer &opcodes, u8 op1, bool indirect_dest) const; }; #endif // MAME_CPU_M32C_M32CDASM_H diff -Nru mame-0.242+dfsg.1/src/devices/cpu/m37710/m37710.cpp mame-0.243+dfsg.1/src/devices/cpu/m37710/m37710.cpp --- mame-0.242+dfsg.1/src/devices/cpu/m37710/m37710.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/m37710/m37710.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -63,7 +63,6 @@ #include "emu.h" #include "m37710.h" -#include "debugger.h" #include "m37710cm.h" #include "m37710il.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/m37710/m37710o0.cpp mame-0.243+dfsg.1/src/devices/cpu/m37710/m37710o0.cpp --- mame-0.242+dfsg.1/src/devices/cpu/m37710/m37710o0.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/m37710/m37710o0.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1,7 +1,6 @@ // license:BSD-3-Clause // copyright-holders:R. Belmont, Karl Stenerud, hap #include "emu.h" -#include "debugger.h" #include "m37710cm.h" #include "m37710il.h" #define EXECUTION_MODE EXECUTION_MODE_M0X0 diff -Nru mame-0.242+dfsg.1/src/devices/cpu/m37710/m37710o1.cpp mame-0.243+dfsg.1/src/devices/cpu/m37710/m37710o1.cpp --- mame-0.242+dfsg.1/src/devices/cpu/m37710/m37710o1.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/m37710/m37710o1.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1,7 +1,6 @@ // license:BSD-3-Clause // copyright-holders:R. Belmont, Karl Stenerud, hap #include "emu.h" -#include "debugger.h" #include "m37710cm.h" #include "m37710il.h" #define EXECUTION_MODE EXECUTION_MODE_M0X1 diff -Nru mame-0.242+dfsg.1/src/devices/cpu/m37710/m37710o2.cpp mame-0.243+dfsg.1/src/devices/cpu/m37710/m37710o2.cpp --- mame-0.242+dfsg.1/src/devices/cpu/m37710/m37710o2.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/m37710/m37710o2.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1,7 +1,6 @@ // license:BSD-3-Clause // copyright-holders:R. Belmont, Karl Stenerud, hap #include "emu.h" -#include "debugger.h" #include "m37710cm.h" #include "m37710il.h" #define EXECUTION_MODE EXECUTION_MODE_M1X0 diff -Nru mame-0.242+dfsg.1/src/devices/cpu/m37710/m37710o3.cpp mame-0.243+dfsg.1/src/devices/cpu/m37710/m37710o3.cpp --- mame-0.242+dfsg.1/src/devices/cpu/m37710/m37710o3.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/m37710/m37710o3.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1,7 +1,6 @@ // license:BSD-3-Clause // copyright-holders:R. Belmont, Karl Stenerud, hap #include "emu.h" -#include "debugger.h" #include "m37710cm.h" #include "m37710il.h" #define EXECUTION_MODE EXECUTION_MODE_M1X1 diff -Nru mame-0.242+dfsg.1/src/devices/cpu/m37710/m7700ds.cpp mame-0.243+dfsg.1/src/devices/cpu/m37710/m7700ds.cpp --- mame-0.242+dfsg.1/src/devices/cpu/m37710/m7700ds.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/m37710/m7700ds.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -354,6 +354,8 @@ flags = STEP_OVER; else if (opcode->is_return()) flags = STEP_OUT; + else if (opcode->is_bcond()) + flags = STEP_COND; stream << opcode->name(); diff -Nru mame-0.242+dfsg.1/src/devices/cpu/m37710/m7700ds.h mame-0.243+dfsg.1/src/devices/cpu/m37710/m7700ds.h --- mame-0.242+dfsg.1/src/devices/cpu/m37710/m7700ds.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/m37710/m7700ds.h 2022-04-29 05:37:26.000000000 +0000 @@ -73,6 +73,7 @@ public: bool is_call() const { return m_name == op::JSR; } bool is_return() const { return (m_name == op::RTS) || (m_name == op::RTI); } + bool is_bcond() const { return (ea == RELB && m_name != op::BRA) || (m_name == op::BBS) || (m_name == op::BBC); } const char *name() const { return s_opnames[unsigned(m_name)]; } static const m7700_opcode_struct &get(unsigned char ins) { return s_opcodes[ins]; } diff -Nru mame-0.242+dfsg.1/src/devices/cpu/m6502/m6502.cpp mame-0.243+dfsg.1/src/devices/cpu/m6502/m6502.cpp --- mame-0.242+dfsg.1/src/devices/cpu/m6502/m6502.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/m6502/m6502.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -9,7 +9,6 @@ ***************************************************************************/ #include "emu.h" -#include "debugger.h" #include "m6502.h" #include "m6502d.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/m6502/m6502make.py mame-0.243+dfsg.1/src/devices/cpu/m6502/m6502make.py --- mame-0.242+dfsg.1/src/devices/cpu/m6502/m6502make.py 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/m6502/m6502make.py 2022-04-29 05:37:26.000000000 +0000 @@ -233,6 +233,8 @@ extra = "STEP_OVER" elif opc in ["rts", "rti", "rtn", "retf", "tpi"]: extra = "STEP_OUT" + elif opc in ["bcc", "bcs", "beq", "bmi", "bne", "bpl", "bvc", "bvs", "bbr", "bbs", "bbc", "bar", "bas"]: + extra = "STEP_COND" emit(f, '\t{ "%s", DASM_%s, %s },' % (opc, mode, extra)) emit(f, DISASM_EPILOG % d) diff -Nru mame-0.242+dfsg.1/src/devices/cpu/m6800/6800dasm.cpp mame-0.243+dfsg.1/src/devices/cpu/m6800/6800dasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/m6800/6800dasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/m6800/6800dasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -165,6 +165,8 @@ flags = STEP_OVER; else if (opcode == rti || opcode == rts) flags = STEP_OUT; + else if (args == rel && opcode != bra && opcode != brn && opcode != bsr) + flags = STEP_COND; if ( invalid & invalid_mask ) /* invalid for this cpu type ? */ { diff -Nru mame-0.242+dfsg.1/src/devices/cpu/m6800/m6800.cpp mame-0.243+dfsg.1/src/devices/cpu/m6800/m6800.cpp --- mame-0.242+dfsg.1/src/devices/cpu/m6800/m6800.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/m6800/m6800.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -70,7 +70,6 @@ */ #include "emu.h" -#include "debugger.h" #include "m6800.h" #include "6800dasm.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/m68000/m68kcpu.cpp mame-0.243+dfsg.1/src/devices/cpu/m68000/m68kcpu.cpp --- mame-0.242+dfsg.1/src/devices/cpu/m68000/m68kcpu.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/m68000/m68kcpu.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -25,7 +25,6 @@ /* ======================================================================== */ #include "emu.h" -#include "debugger.h" #include "m68000.h" #include "m68kdasm.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/m68000/m68kdasm.cpp mame-0.243+dfsg.1/src/devices/cpu/m68000/m68kdasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/m68000/m68kdasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/m68000/m68kdasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -637,12 +637,14 @@ std::string m68k_disassembler::d68000_bcc_8() { u32 temp_pc = m_cpu_pc; + m_flags = STEP_COND; return util::string_format("b%-2s $%x", m_cc[(m_cpu_ir>>8)&0xf], temp_pc + make_int_8(m_cpu_ir)); } std::string m68k_disassembler::d68000_bcc_16() { u32 temp_pc = m_cpu_pc; + m_flags = STEP_COND; return util::string_format("b%-2s $%x", m_cc[(m_cpu_ir>>8)&0xf], temp_pc + make_int_16(read_imm_16())); } @@ -652,6 +654,7 @@ auto limit = limit_cpu_types(M68020_PLUS); if(limit.first) return limit.second; + m_flags = STEP_COND; return util::string_format("b%-2s $%x; (2+)", m_cc[(m_cpu_ir>>8)&0xf], temp_pc + read_imm_32()); } @@ -933,7 +936,7 @@ std::string m68k_disassembler::d68000_chk_16() { - m_flags = STEP_OVER; + m_flags = STEP_OVER | STEP_COND; return util::string_format("chk.w %s, D%d", get_ea_mode_str_16(m_cpu_ir), (m_cpu_ir>>9)&7); } @@ -942,7 +945,7 @@ auto limit = limit_cpu_types(M68020_PLUS); if(limit.first) return limit.second; - m_flags = STEP_OVER; + m_flags = STEP_OVER | STEP_COND; return util::string_format("chk.l %s, D%d; (2+)", get_ea_mode_str_32(m_cpu_ir), (m_cpu_ir>>9)&7); } @@ -1265,14 +1268,14 @@ std::string m68k_disassembler::d68000_dbra() { u32 temp_pc = m_cpu_pc; - m_flags = STEP_OVER; + m_flags = STEP_COND; return util::string_format("dbra D%d, $%x", m_cpu_ir & 7, temp_pc + make_int_16(read_imm_16())); } std::string m68k_disassembler::d68000_dbcc() { u32 temp_pc = m_cpu_pc; - m_flags = STEP_OVER; + m_flags = STEP_COND; return util::string_format("db%-2s D%d, $%x", m_cc[(m_cpu_ir>>8)&0xf], m_cpu_ir & 7, temp_pc + make_int_16(read_imm_16())); } @@ -2749,7 +2752,7 @@ auto limit = limit_cpu_types(M68020_PLUS); if(limit.first) return limit.second; - m_flags = STEP_OVER; + m_flags = STEP_OVER | STEP_COND; return util::string_format("trap%-2s; (2+)", m_cc[(m_cpu_ir>>8)&0xf]); } @@ -2758,7 +2761,7 @@ auto limit = limit_cpu_types(M68020_PLUS); if(limit.first) return limit.second; - m_flags = STEP_OVER; + m_flags = STEP_OVER | STEP_COND; return util::string_format("trap%-2s %s; (2+)", m_cc[(m_cpu_ir>>8)&0xf], get_imm_str_u16()); } @@ -2767,13 +2770,13 @@ auto limit = limit_cpu_types(M68020_PLUS); if(limit.first) return limit.second; - m_flags = STEP_OVER; + m_flags = STEP_OVER | STEP_COND; return util::string_format("trap%-2s %s; (2+)", m_cc[(m_cpu_ir>>8)&0xf], get_imm_str_u32()); } std::string m68k_disassembler::d68000_trapv() { - m_flags = STEP_OVER; + m_flags = STEP_OVER | STEP_COND; return util::string_format("trapv"); } diff -Nru mame-0.242+dfsg.1/src/devices/cpu/m6805/6805dasm.cpp mame-0.243+dfsg.1/src/devices/cpu/m6805/6805dasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/m6805/6805dasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/m6805/6805dasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -129,6 +129,24 @@ case op_names::rti: flags = STEP_OUT; break; + case op_names::brset: + case op_names::brclr: + case op_names::bhi: + case op_names::bls: + case op_names::bcc: + case op_names::bcs: + case op_names::bne: + case op_names::beq: + case op_names::bhcc: + case op_names::bhcs: + case op_names::bpl: + case op_names::bmi: + case op_names::bmc: + case op_names::bms: + case op_names::bil: + case op_names::bih: + flags = STEP_COND; + break; default: flags = 0; } diff -Nru mame-0.242+dfsg.1/src/devices/cpu/m6805/m6805.cpp mame-0.243+dfsg.1/src/devices/cpu/m6805/m6805.cpp --- mame-0.242+dfsg.1/src/devices/cpu/m6805/m6805.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/m6805/m6805.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -37,8 +37,6 @@ #include "m6805defs.h" #include "6805dasm.h" -#include "debugger.h" - #include #define OP(name) (&m6805_base_device::name) diff -Nru mame-0.242+dfsg.1/src/devices/cpu/m6809/6x09dasm.cpp mame-0.243+dfsg.1/src/devices/cpu/m6809/6x09dasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/m6809/6x09dasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/m6809/6x09dasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -323,20 +323,20 @@ { 0x20, 2, "BRA", REL, M6x09_GENERAL }, { 0x21, 2, "BRN", REL, M6x09_GENERAL }, - { 0x22, 2, "BHI", REL, M6x09_GENERAL }, - { 0x23, 2, "BLS", REL, M6x09_GENERAL }, - { 0x24, 2, "BCC", REL, M6x09_GENERAL }, - { 0x25, 2, "BCS", REL, M6x09_GENERAL }, - { 0x26, 2, "BNE", REL, M6x09_GENERAL }, - { 0x27, 2, "BEQ", REL, M6x09_GENERAL }, - { 0x28, 2, "BVC", REL, M6x09_GENERAL }, - { 0x29, 2, "BVS", REL, M6x09_GENERAL }, - { 0x2A, 2, "BPL", REL, M6x09_GENERAL }, - { 0x2B, 2, "BMI", REL, M6x09_GENERAL }, - { 0x2C, 2, "BGE", REL, M6x09_GENERAL }, - { 0x2D, 2, "BLT", REL, M6x09_GENERAL }, - { 0x2E, 2, "BGT", REL, M6x09_GENERAL }, - { 0x2F, 2, "BLE", REL, M6x09_GENERAL }, + { 0x22, 2, "BHI", REL, M6x09_GENERAL, STEP_COND }, + { 0x23, 2, "BLS", REL, M6x09_GENERAL, STEP_COND }, + { 0x24, 2, "BCC", REL, M6x09_GENERAL, STEP_COND }, + { 0x25, 2, "BCS", REL, M6x09_GENERAL, STEP_COND }, + { 0x26, 2, "BNE", REL, M6x09_GENERAL, STEP_COND }, + { 0x27, 2, "BEQ", REL, M6x09_GENERAL, STEP_COND }, + { 0x28, 2, "BVC", REL, M6x09_GENERAL, STEP_COND }, + { 0x29, 2, "BVS", REL, M6x09_GENERAL, STEP_COND }, + { 0x2A, 2, "BPL", REL, M6x09_GENERAL, STEP_COND }, + { 0x2B, 2, "BMI", REL, M6x09_GENERAL, STEP_COND }, + { 0x2C, 2, "BGE", REL, M6x09_GENERAL, STEP_COND }, + { 0x2D, 2, "BLT", REL, M6x09_GENERAL, STEP_COND }, + { 0x2E, 2, "BGT", REL, M6x09_GENERAL, STEP_COND }, + { 0x2F, 2, "BLE", REL, M6x09_GENERAL, STEP_COND }, { 0x30, 2, "LEAX", IND, M6x09_GENERAL }, { 0x31, 2, "LEAY", IND, M6x09_GENERAL }, @@ -1114,38 +1114,38 @@ { 0x5C, 2, "STS", IND, M6x09_GENERAL }, { 0x60, 2, "BRA", REL, M6x09_GENERAL }, - { 0x61, 2, "BHI", REL, M6x09_GENERAL }, - { 0x62, 2, "BCC", REL, M6x09_GENERAL }, - { 0x63, 2, "BNE", REL, M6x09_GENERAL }, - { 0x64, 2, "BVC", REL, M6x09_GENERAL }, - { 0x65, 2, "BPL", REL, M6x09_GENERAL }, - { 0x66, 2, "BGE", REL, M6x09_GENERAL }, - { 0x67, 2, "BGT", REL, M6x09_GENERAL }, + { 0x61, 2, "BHI", REL, M6x09_GENERAL, STEP_COND }, + { 0x62, 2, "BCC", REL, M6x09_GENERAL, STEP_COND }, + { 0x63, 2, "BNE", REL, M6x09_GENERAL, STEP_COND }, + { 0x64, 2, "BVC", REL, M6x09_GENERAL, STEP_COND }, + { 0x65, 2, "BPL", REL, M6x09_GENERAL, STEP_COND }, + { 0x66, 2, "BGE", REL, M6x09_GENERAL, STEP_COND }, + { 0x67, 2, "BGT", REL, M6x09_GENERAL, STEP_COND }, { 0x68, 3, "LBRA", LREL, M6x09_GENERAL }, - { 0x69, 3, "LBHI", LREL, M6x09_GENERAL }, - { 0x6A, 3, "LBCC", LREL, M6x09_GENERAL }, - { 0x6B, 3, "LBNE", LREL, M6x09_GENERAL }, - { 0x6C, 3, "LBVC", LREL, M6x09_GENERAL }, - { 0x6D, 3, "LBPL", LREL, M6x09_GENERAL }, - { 0x6E, 3, "LBGE", LREL, M6x09_GENERAL }, - { 0x6F, 3, "LBGT", LREL, M6x09_GENERAL }, + { 0x69, 3, "LBHI", LREL, M6x09_GENERAL, STEP_COND }, + { 0x6A, 3, "LBCC", LREL, M6x09_GENERAL, STEP_COND }, + { 0x6B, 3, "LBNE", LREL, M6x09_GENERAL, STEP_COND }, + { 0x6C, 3, "LBVC", LREL, M6x09_GENERAL, STEP_COND }, + { 0x6D, 3, "LBPL", LREL, M6x09_GENERAL, STEP_COND }, + { 0x6E, 3, "LBGE", LREL, M6x09_GENERAL, STEP_COND }, + { 0x6F, 3, "LBGT", LREL, M6x09_GENERAL, STEP_COND }, { 0x70, 2, "BRN", REL, M6x09_GENERAL }, - { 0x71, 2, "BLS", REL, M6x09_GENERAL }, - { 0x72, 2, "BCS", REL, M6x09_GENERAL }, - { 0x73, 2, "BEQ", REL, M6x09_GENERAL }, - { 0x74, 2, "BVS", REL, M6x09_GENERAL }, - { 0x75, 2, "BMI", REL, M6x09_GENERAL }, - { 0x76, 2, "BLT", REL, M6x09_GENERAL }, - { 0x77, 2, "BLE", REL, M6x09_GENERAL }, + { 0x71, 2, "BLS", REL, M6x09_GENERAL, STEP_COND }, + { 0x72, 2, "BCS", REL, M6x09_GENERAL, STEP_COND }, + { 0x73, 2, "BEQ", REL, M6x09_GENERAL, STEP_COND }, + { 0x74, 2, "BVS", REL, M6x09_GENERAL, STEP_COND }, + { 0x75, 2, "BMI", REL, M6x09_GENERAL, STEP_COND }, + { 0x76, 2, "BLT", REL, M6x09_GENERAL, STEP_COND }, + { 0x77, 2, "BLE", REL, M6x09_GENERAL, STEP_COND }, { 0x78, 3, "LBRN", LREL, M6x09_GENERAL }, - { 0x79, 3, "LBLS", LREL, M6x09_GENERAL }, - { 0x7A, 3, "LBCS", LREL, M6x09_GENERAL }, - { 0x7B, 3, "LBEQ", LREL, M6x09_GENERAL }, - { 0x7C, 3, "LBVS", LREL, M6x09_GENERAL }, - { 0x7D, 3, "LBMI", LREL, M6x09_GENERAL }, - { 0x7E, 3, "LBLT", LREL, M6x09_GENERAL }, - { 0x7F, 3, "LBLE", LREL, M6x09_GENERAL }, + { 0x79, 3, "LBLS", LREL, M6x09_GENERAL, STEP_COND }, + { 0x7A, 3, "LBCS", LREL, M6x09_GENERAL, STEP_COND }, + { 0x7B, 3, "LBEQ", LREL, M6x09_GENERAL, STEP_COND }, + { 0x7C, 3, "LBVS", LREL, M6x09_GENERAL, STEP_COND }, + { 0x7D, 3, "LBMI", LREL, M6x09_GENERAL, STEP_COND }, + { 0x7E, 3, "LBLT", LREL, M6x09_GENERAL, STEP_COND }, + { 0x7F, 3, "LBLE", LREL, M6x09_GENERAL, STEP_COND }, { 0x80, 1, "CLRA", INH, M6x09_GENERAL }, { 0x81, 1, "CLRB", INH, M6x09_GENERAL }, diff -Nru mame-0.242+dfsg.1/src/devices/cpu/m6809/hd6309.cpp mame-0.243+dfsg.1/src/devices/cpu/m6809/hd6309.cpp --- mame-0.242+dfsg.1/src/devices/cpu/m6809/hd6309.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/m6809/hd6309.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -115,7 +115,6 @@ *****************************************************************************/ #include "emu.h" -#include "debugger.h" #include "hd6309.h" #include "m6809inl.h" #include "6x09dasm.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/m6809/konami.cpp mame-0.243+dfsg.1/src/devices/cpu/m6809/konami.cpp --- mame-0.242+dfsg.1/src/devices/cpu/m6809/konami.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/m6809/konami.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -55,7 +55,6 @@ *****************************************************************************/ #include "emu.h" -#include "debugger.h" #include "konami.h" #include "m6809inl.h" #include "6x09dasm.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/m6809/m6809.cpp mame-0.243+dfsg.1/src/devices/cpu/m6809/m6809.cpp --- mame-0.242+dfsg.1/src/devices/cpu/m6809/m6809.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/m6809/m6809.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -104,7 +104,6 @@ *****************************************************************************/ #include "emu.h" -#include "debugger.h" #include "m6809.h" #include "m6809inl.h" #include "6x09dasm.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/m68hc16/cpu16dasm.cpp mame-0.243+dfsg.1/src/devices/cpu/m68hc16/cpu16dasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/m68hc16/cpu16dasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/m68hc16/cpu16dasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -38,8 +38,8 @@ { "", cpu16_disassembler::mode::UND, 0 }, { "bclr", cpu16_disassembler::mode::BIT, 0 }, { "bset", cpu16_disassembler::mode::BIT, 0 }, - { "brclr", cpu16_disassembler::mode::BIT, 0 }, - { "brset", cpu16_disassembler::mode::BIT, 0 }, + { "brclr", cpu16_disassembler::mode::BIT, STEP_COND }, + { "brset", cpu16_disassembler::mode::BIT, STEP_COND }, { "rol", cpu16_disassembler::mode::IND, 0 }, { "asr", cpu16_disassembler::mode::IND, 0 }, { "ror", cpu16_disassembler::mode::IND, 0 }, @@ -56,8 +56,8 @@ { "", cpu16_disassembler::mode::UND, 0 }, // actually prebyte for page 1 { "bclr", cpu16_disassembler::mode::BIT, 0 }, { "bset", cpu16_disassembler::mode::BIT, 0 }, - { "brclr", cpu16_disassembler::mode::BIT, 0 }, - { "brset", cpu16_disassembler::mode::BIT, 0 }, + { "brclr", cpu16_disassembler::mode::BIT, STEP_COND }, + { "brset", cpu16_disassembler::mode::BIT, STEP_COND }, { "rol", cpu16_disassembler::mode::IND, 0 }, { "asr", cpu16_disassembler::mode::IND, 0 }, { "ror", cpu16_disassembler::mode::IND, 0 }, @@ -74,8 +74,8 @@ { "", cpu16_disassembler::mode::UND, 0 }, // actually prebyte for page 2 { "bclr", cpu16_disassembler::mode::BIT, 0 }, { "bset", cpu16_disassembler::mode::BIT, 0 }, - { "brclr", cpu16_disassembler::mode::BIT, 0 }, - { "brset", cpu16_disassembler::mode::BIT, 0 }, + { "brclr", cpu16_disassembler::mode::BIT, STEP_COND }, + { "brset", cpu16_disassembler::mode::BIT, STEP_COND }, { "rol", cpu16_disassembler::mode::IND, 0 }, { "asr", cpu16_disassembler::mode::IND, 0 }, { "ror", cpu16_disassembler::mode::IND, 0 }, @@ -92,8 +92,8 @@ { "", cpu16_disassembler::mode::UND, 0 }, // actually prebyte for page 3 { "bclr", cpu16_disassembler::mode::BIT, 0 }, { "bset", cpu16_disassembler::mode::BIT, 0 }, - { "brclr", cpu16_disassembler::mode::BIT, 0 }, - { "brset", cpu16_disassembler::mode::BIT, 0 }, + { "brclr", cpu16_disassembler::mode::BIT, STEP_COND }, + { "brset", cpu16_disassembler::mode::BIT, STEP_COND }, { "aix", cpu16_disassembler::mode::IMMS, 0 }, { "aiy", cpu16_disassembler::mode::IMMS, 0 }, { "aiz", cpu16_disassembler::mode::IMMS, 0 }, @@ -183,7 +183,7 @@ { "cpd", cpu16_disassembler::mode::IND, 0 }, { "jsr", cpu16_disassembler::mode::IND20, STEP_OVER }, { "std", cpu16_disassembler::mode::IND, 0 }, - { "brset", cpu16_disassembler::mode::BIT, 0 }, + { "brset", cpu16_disassembler::mode::BIT, STEP_COND }, { "stx", cpu16_disassembler::mode::IND, 0 }, { "sty", cpu16_disassembler::mode::IND, 0 }, { "stz", cpu16_disassembler::mode::IND, 0 }, @@ -201,7 +201,7 @@ { "cpd", cpu16_disassembler::mode::IND, 0 }, { "jsr", cpu16_disassembler::mode::IND20, STEP_OVER }, { "std", cpu16_disassembler::mode::IND, 0 }, - { "brset", cpu16_disassembler::mode::BIT, 0 }, + { "brset", cpu16_disassembler::mode::BIT, STEP_COND }, { "stx", cpu16_disassembler::mode::IND, 0 }, { "sty", cpu16_disassembler::mode::IND, 0 }, { "stz", cpu16_disassembler::mode::IND, 0 }, @@ -219,7 +219,7 @@ { "cpd", cpu16_disassembler::mode::IND, 0 }, { "jsr", cpu16_disassembler::mode::IND20, STEP_OVER }, { "std", cpu16_disassembler::mode::IND, 0 }, - { "brset", cpu16_disassembler::mode::BIT, 0 }, + { "brset", cpu16_disassembler::mode::BIT, STEP_COND }, { "stx", cpu16_disassembler::mode::IND, 0 }, { "sty", cpu16_disassembler::mode::IND, 0 }, { "stz", cpu16_disassembler::mode::IND, 0 }, @@ -228,20 +228,20 @@ // BX { "bra", cpu16_disassembler::mode::REL, 0 }, { "brn", cpu16_disassembler::mode::REL, 0 }, - { "bhi", cpu16_disassembler::mode::REL, 0 }, - { "bls", cpu16_disassembler::mode::REL, 0 }, - { "bcc", cpu16_disassembler::mode::REL, 0 }, - { "bcs", cpu16_disassembler::mode::REL, 0 }, - { "bne", cpu16_disassembler::mode::REL, 0 }, - { "beq", cpu16_disassembler::mode::REL, 0 }, - { "bvc", cpu16_disassembler::mode::REL, 0 }, - { "bvs", cpu16_disassembler::mode::REL, 0 }, - { "bpl", cpu16_disassembler::mode::REL, 0 }, - { "bmi", cpu16_disassembler::mode::REL, 0 }, - { "bge", cpu16_disassembler::mode::REL, 0 }, - { "blt", cpu16_disassembler::mode::REL, 0 }, - { "bgt", cpu16_disassembler::mode::REL, 0 }, - { "ble", cpu16_disassembler::mode::REL, 0 }, + { "bhi", cpu16_disassembler::mode::REL, STEP_COND }, + { "bls", cpu16_disassembler::mode::REL, STEP_COND }, + { "bcc", cpu16_disassembler::mode::REL, STEP_COND }, + { "bcs", cpu16_disassembler::mode::REL, STEP_COND }, + { "bne", cpu16_disassembler::mode::REL, STEP_COND }, + { "beq", cpu16_disassembler::mode::REL, STEP_COND }, + { "bvc", cpu16_disassembler::mode::REL, STEP_COND }, + { "bvs", cpu16_disassembler::mode::REL, STEP_COND }, + { "bpl", cpu16_disassembler::mode::REL, STEP_COND }, + { "bmi", cpu16_disassembler::mode::REL, STEP_COND }, + { "bge", cpu16_disassembler::mode::REL, STEP_COND }, + { "blt", cpu16_disassembler::mode::REL, STEP_COND }, + { "bgt", cpu16_disassembler::mode::REL, STEP_COND }, + { "ble", cpu16_disassembler::mode::REL, STEP_COND }, // CX { "subb", cpu16_disassembler::mode::IND, 0 }, @@ -255,7 +255,7 @@ { "cmpb", cpu16_disassembler::mode::IND, 0 }, { "bitb", cpu16_disassembler::mode::IND, 0 }, { "stab", cpu16_disassembler::mode::IND, 0 }, - { "brclr", cpu16_disassembler::mode::BIT, 0 }, + { "brclr", cpu16_disassembler::mode::BIT, STEP_COND }, { "ldx", cpu16_disassembler::mode::IND, 0 }, { "ldy", cpu16_disassembler::mode::IND, 0 }, { "ldz", cpu16_disassembler::mode::IND, 0 }, @@ -273,7 +273,7 @@ { "cmpb", cpu16_disassembler::mode::IND, 0 }, { "bitb", cpu16_disassembler::mode::IND, 0 }, { "stab", cpu16_disassembler::mode::IND, 0 }, - { "brclr", cpu16_disassembler::mode::BIT, 0 }, + { "brclr", cpu16_disassembler::mode::BIT, STEP_COND }, { "ldx", cpu16_disassembler::mode::IND, 0 }, { "ldy", cpu16_disassembler::mode::IND, 0 }, { "ldz", cpu16_disassembler::mode::IND, 0 }, @@ -291,7 +291,7 @@ { "cmpb", cpu16_disassembler::mode::IND, 0 }, { "bitb", cpu16_disassembler::mode::IND, 0 }, { "stab", cpu16_disassembler::mode::IND, 0 }, - { "brclr", cpu16_disassembler::mode::BIT, 0 }, + { "brclr", cpu16_disassembler::mode::BIT, STEP_COND }, { "ldx", cpu16_disassembler::mode::IND, 0 }, { "ldy", cpu16_disassembler::mode::IND, 0 }, { "ldz", cpu16_disassembler::mode::IND, 0 }, diff -Nru mame-0.242+dfsg.1/src/devices/cpu/m88000/m88000.cpp mame-0.243+dfsg.1/src/devices/cpu/m88000/m88000.cpp --- mame-0.242+dfsg.1/src/devices/cpu/m88000/m88000.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/m88000/m88000.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -16,7 +16,7 @@ */ #include "emu.h" -#include "debugger.h" +#include "debug/debugcpu.h" #include "m88000.h" #include "m88000d.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/m88000/m88000d.cpp mame-0.243+dfsg.1/src/devices/cpu/m88000/m88000d.cpp --- mame-0.242+dfsg.1/src/devices/cpu/m88000/m88000d.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/m88000/m88000d.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1175,7 +1175,7 @@ util::stream_format(stream, ",r%d,$%08x", (inst & 0x001f0000) >> 16, pc + disp); // Set flags for optional delay slot - return 4 | SUPPORTED | (BIT(inst, 26) ? STEP_OVER | step_over_extra(1) : 0); + return 4 | SUPPORTED | STEP_COND | (BIT(inst, 26) ? step_over_extra(1) : 0); } offs_t m88000_disassembler::dasm_d26(std::ostream &stream, const char *mnemonic, u32 inst, offs_t pc) diff -Nru mame-0.242+dfsg.1/src/devices/cpu/mb86233/mb86233.cpp mame-0.243+dfsg.1/src/devices/cpu/mb86233/mb86233.cpp --- mame-0.242+dfsg.1/src/devices/cpu/mb86233/mb86233.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/mb86233/mb86233.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -2,7 +2,6 @@ // copyright-holders:Olivier Galibert #include "emu.h" -#include "debugger.h" #include "mb86233.h" #include "mb86233d.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/mb86233/mb86233d.cpp mame-0.243+dfsg.1/src/devices/cpu/mb86233/mb86233d.cpp --- mame-0.242+dfsg.1/src/devices/cpu/mb86233/mb86233d.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/mb86233/mb86233d.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -259,6 +259,7 @@ offs_t mb86233_disassembler::disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) { u32 opcode = opcodes.r32(pc); + offs_t flags = 0; switch((opcode >> 26) & 0x3f) { case 0x00: { // Dual move AB @@ -467,6 +468,8 @@ switch(subtype) { case 0: util::stream_format(stream, "brif %s #0x%x", condition(cond, invert), data); + if (cond != 0x16) + flags = STEP_COND; break; case 1: @@ -475,10 +478,13 @@ util::stream_format(stream, "%s", regs(opcode & 0x1f)); else util::stream_format(stream, "(%s)", memory(opcode & 0x1ff, false, false)); + if (cond != 0x16) + flags = STEP_COND; break; case 2: util::stream_format(stream, "bsif %s #0x%x", condition(cond, invert), data); + flags = STEP_OVER | (cond != 0x16 ? STEP_COND : 0); break; case 3: @@ -487,10 +493,12 @@ util::stream_format(stream, "%s", regs(opcode & 0x1f)); else util::stream_format(stream, "(%s)", memory(opcode & 0x1ff, false, false)); + flags = STEP_OVER | (cond != 0x16 ? STEP_COND : 0); break; case 5: util::stream_format(stream, "rtif %s", condition(cond, invert)); + flags = STEP_OUT | (cond != 0x16 ? STEP_COND : 0); break; case 6: @@ -499,6 +507,7 @@ case 7: util::stream_format(stream, "iret"); + flags = STEP_OUT; break; default: @@ -513,7 +522,7 @@ break; } - return 1 | SUPPORTED; + return 1 | flags | SUPPORTED; } u32 mb86233_disassembler::opcode_alignment() const diff -Nru mame-0.242+dfsg.1/src/devices/cpu/mb86235/mb86235.cpp mame-0.243+dfsg.1/src/devices/cpu/mb86235/mb86235.cpp --- mame-0.242+dfsg.1/src/devices/cpu/mb86235/mb86235.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/mb86235/mb86235.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -25,8 +25,6 @@ #include "mb86235fe.h" #include "mb86235d.h" -#include "debugger.h" - #define ENABLE_DRC 0 diff -Nru mame-0.242+dfsg.1/src/devices/cpu/mb86235/mb86235d.cpp mame-0.243+dfsg.1/src/devices/cpu/mb86235/mb86235d.cpp --- mame-0.242+dfsg.1/src/devices/cpu/mb86235/mb86235d.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/mb86235/mb86235d.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -219,7 +219,7 @@ } } -void mb86235_disassembler::dasm_control(std::ostream &stream, uint32_t pc, uint64_t opcode) +offs_t mb86235_disassembler::dasm_control(std::ostream &stream, uint32_t pc, uint64_t opcode) { int ef1 = (opcode >> 16) & 0x3f; int ef2 = opcode & 0xffff; @@ -228,6 +228,8 @@ int rel12 = (opcode & 0x800) ? (0xfffff000 | (opcode & 0xfff)) : (opcode & 0xfff); + offs_t flags = 0; + switch (cop) { case 0x00: stream << "NOP"; @@ -281,12 +283,15 @@ break; case 0x14: util::stream_format(stream, "DBBC AR%d:%d, %04X", (uint32_t)((opcode >> 13) & 7), (uint32_t)((opcode >> 16) & 0xf), pc + rel12); + flags = STEP_COND | step_over_extra(1); break; case 0x15: util::stream_format(stream, "DBBS AR%d:%d, %04X", (uint32_t)((opcode >> 13) & 7), (uint32_t)((opcode >> 16) & 0xf), pc + rel12); + flags = STEP_COND | step_over_extra(1); break; case 0x1b: stream << "DRET"; + flags = STEP_OUT | step_over_extra(1); break; case 0x10: // DBcc @@ -297,17 +302,32 @@ case 0x12: // DJMP { if (cop == 0x10) + { util::stream_format(stream, "%s ", db_mnemonic[ef1]); + flags = STEP_COND | step_over_extra(1); + } else if (cop == 0x11) + { util::stream_format(stream, "%s ", dbn_mnemonic[ef1]); + flags = STEP_COND | step_over_extra(1); + } else if (cop == 0x18) + { util::stream_format(stream, "%s ", dc_mnemonic[ef1]); + flags = STEP_OVER | STEP_COND | step_over_extra(1); + } else if (cop == 0x19) + { util::stream_format(stream, "%s ", dcn_mnemonic[ef1]); + flags = STEP_OVER | STEP_COND | step_over_extra(1); + } else if (cop == 0x12) stream << "DJMP "; else if (cop == 0x1a) + { stream << "DCALL "; + flags = STEP_OVER | step_over_extra(1); + } switch ((opcode >> 12) & 0xf) { @@ -332,6 +352,8 @@ break; } } + + return flags; } void mb86235_disassembler::dasm_double_xfer1(std::ostream &stream, uint64_t opcode) @@ -690,8 +712,7 @@ case 2: // ALU / MUL / control dasm_alu_mul(stream, opcode, true); stream << " : "; - dasm_control(stream, pc, opcode); - break; + return 1 | dasm_control(stream, pc, opcode) | SUPPORTED; case 4: // ALU or MUL / double transfer (type 2) dasm_alu_mul(stream, opcode, false); stream << " : "; @@ -705,8 +726,7 @@ case 6: // ALU or MUL / control dasm_alu_mul(stream, opcode, false); stream << " : "; - dasm_control(stream, pc, opcode); - break; + return 1 | dasm_control(stream, pc, opcode) | SUPPORTED; case 7: // transfer (type 3) dasm_xfer3(stream, opcode); break; diff -Nru mame-0.242+dfsg.1/src/devices/cpu/mb86235/mb86235d.h mame-0.243+dfsg.1/src/devices/cpu/mb86235/mb86235d.h --- mame-0.242+dfsg.1/src/devices/cpu/mb86235/mb86235d.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/mb86235/mb86235d.h 2022-04-29 05:37:26.000000000 +0000 @@ -29,7 +29,7 @@ void dasm_ea(std::ostream &stream, int md, int arx, int ary, int disp); void dasm_alu_mul(std::ostream &stream, uint64_t opcode, bool twoop); - void dasm_control(std::ostream &stream, uint32_t pc, uint64_t opcode); + offs_t dasm_control(std::ostream &stream, uint32_t pc, uint64_t opcode); void dasm_double_xfer1(std::ostream &stream, uint64_t opcode); void dasm_xfer1(std::ostream &stream, uint64_t opcode); void dasm_double_xfer2_field(std::ostream &stream, int sd, bool isbbus, uint32_t field); diff -Nru mame-0.242+dfsg.1/src/devices/cpu/mb86235/mb86235drc.cpp mame-0.243+dfsg.1/src/devices/cpu/mb86235/mb86235drc.cpp --- mame-0.242+dfsg.1/src/devices/cpu/mb86235/mb86235drc.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/mb86235/mb86235drc.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -13,7 +13,6 @@ #include "cpu/drcfe.h" #include "cpu/drcuml.h" #include "cpu/drcumlsh.h" -#include "debugger.h" #include "mb86235defs.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/mb86235/mb86235ops.cpp mame-0.243+dfsg.1/src/devices/cpu/mb86235/mb86235ops.cpp --- mame-0.242+dfsg.1/src/devices/cpu/mb86235/mb86235ops.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/mb86235/mb86235ops.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -10,7 +10,6 @@ #include "emu.h" #include "mb86235.h" -#include "debugger.h" /********************* * diff -Nru mame-0.242+dfsg.1/src/devices/cpu/mb88xx/mb88xx.cpp mame-0.243+dfsg.1/src/devices/cpu/mb88xx/mb88xx.cpp --- mame-0.242+dfsg.1/src/devices/cpu/mb88xx/mb88xx.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/mb88xx/mb88xx.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -18,7 +18,6 @@ #include "emu.h" #include "mb88xx.h" #include "mb88dasm.h" -#include "debugger.h" DEFINE_DEVICE_TYPE(MB88201, mb88201_cpu_device, "mb88201", "Fujitsu MB88201") diff -Nru mame-0.242+dfsg.1/src/devices/cpu/mc68hc11/hc11dasm.cpp mame-0.243+dfsg.1/src/devices/cpu/mc68hc11/hc11dasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/mc68hc11/hc11dasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/mc68hc11/hc11dasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1151,6 +1151,8 @@ flags = STEP_OVER; else if (!strcmp(op_table->mnemonic, "rts") || !strcmp(op_table->mnemonic, "rti")) flags = STEP_OUT; + else if ((opcode >= 0x22 && opcode < 0x30) || !strcmp(op_table->mnemonic, "brset") || !strcmp(op_table->mnemonic, "brclr")) + flags = STEP_COND; switch(op_table->address_mode) { diff -Nru mame-0.242+dfsg.1/src/devices/cpu/mc68hc11/mc68hc11.cpp mame-0.243+dfsg.1/src/devices/cpu/mc68hc11/mc68hc11.cpp --- mame-0.242+dfsg.1/src/devices/cpu/mc68hc11/mc68hc11.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/mc68hc11/mc68hc11.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -14,7 +14,6 @@ */ #include "emu.h" -#include "debugger.h" #include "mc68hc11.h" #include "hc11dasm.h" @@ -47,6 +46,7 @@ DEFINE_DEVICE_TYPE(MC68HC11A1, mc68hc11a1_device, "mc68hc11a1", "Motorola MC68HC11A1") DEFINE_DEVICE_TYPE(MC68HC11D0, mc68hc11d0_device, "mc68hc11d0", "Motorola MC68HC11D0") +DEFINE_DEVICE_TYPE(MC68HC11E1, mc68hc11e1_device, "mc68hc11e1", "Motorola MC68HC11E1") DEFINE_DEVICE_TYPE(MC68HC811E2, mc68hc811e2_device, "mc68hc811e2", "Motorola MC68HC811E2") DEFINE_DEVICE_TYPE(MC68HC11F1, mc68hc11f1_device, "mc68hc11f1", "Motorola MC68HC11F1") DEFINE_DEVICE_TYPE(MC68HC11K1, mc68hc11k1_device, "mc68hc11k1", "Motorola MC68HC11K1") @@ -107,6 +107,11 @@ { } +mc68hc11e1_device::mc68hc11e1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : mc68hc11_cpu_device(mconfig, MC68HC11E1, tag, owner, clock, 512, 64, 0, 512, 0x01, 0x0f, 0xfb) +{ +} + mc68hc811e2_device::mc68hc811e2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mc68hc11_cpu_device(mconfig, MC68HC811E2, tag, owner, clock, 256, 64, 0, 2048, 0x01, 0xf5, 0xfb) { @@ -511,6 +516,40 @@ block(base + 0x3f, base + 0x3f).rw(FUNC(mc68hc11d0_device::config_r), FUNC(mc68hc11d0_device::config_w)); // CONFIG } +void mc68hc11e1_device::mc68hc11_reg_map(memory_view::memory_view_entry &block, offs_t base) +{ + block(base + 0x00, base + 0x00).rw(FUNC(mc68hc11e1_device::port_r<0>), FUNC(mc68hc11e1_device::port_w<0>)); // PORTA + block(base + 0x02, base + 0x02).r(FUNC(mc68hc11e1_device::pioc_r)); // PIOC + block(base + 0x03, base + 0x03).rw(FUNC(mc68hc11e1_device::port_r<2>), FUNC(mc68hc11e1_device::port_w<2>)); // PORTC + block(base + 0x04, base + 0x04).rw(FUNC(mc68hc11e1_device::port_r<1>), FUNC(mc68hc11e1_device::port_w<1>)); // PORTB + block(base + 0x05, base + 0x05).nopw(); // PORTCL + block(base + 0x07, base + 0x07).rw(FUNC(mc68hc11e1_device::ddr_r<2>), FUNC(mc68hc11e1_device::ddr_w<2>)); // DDRC + block(base + 0x08, base + 0x08).rw(FUNC(mc68hc11e1_device::port_r<3>), FUNC(mc68hc11e1_device::port_w<3>)); // PORTD + block(base + 0x09, base + 0x09).rw(FUNC(mc68hc11e1_device::ddr_r<3>), FUNC(mc68hc11e1_device::ddr_w<3>)); // DDRD + block(base + 0x0a, base + 0x0a).r(FUNC(mc68hc11e1_device::port_r<4>)); // PORTE + block(base + 0x0e, base + 0x0f).rw(FUNC(mc68hc11e1_device::tcnt_r), FUNC(mc68hc11e1_device::tcnt_w)); // TCNT + block(base + 0x16, base + 0x1f).rw(FUNC(mc68hc11e1_device::toc_r), FUNC(mc68hc11e1_device::toc_w)); // TOC1-TOC4, TI4/O5 + block(base + 0x20, base + 0x20).rw(FUNC(mc68hc11e1_device::tctl1_r), FUNC(mc68hc11e1_device::tctl1_w)); // TCTL1 + block(base + 0x21, base + 0x21).rw(FUNC(mc68hc11e1_device::tctl2_r), FUNC(mc68hc11e1_device::tctl2_w)); // TCTL2 + block(base + 0x22, base + 0x22).rw(FUNC(mc68hc11e1_device::tmsk1_r), FUNC(mc68hc11e1_device::tmsk1_w)); // TMSK1 + block(base + 0x23, base + 0x23).rw(FUNC(mc68hc11e1_device::tflg1_r), FUNC(mc68hc11e1_device::tflg1_w)); // TFLG1 + block(base + 0x24, base + 0x24).rw(FUNC(mc68hc11e1_device::tmsk2_r), FUNC(mc68hc11e1_device::tmsk2_w)); // TMSK2 + block(base + 0x25, base + 0x25).rw(FUNC(mc68hc11e1_device::tflg2_r), FUNC(mc68hc11e1_device::tflg2_w)); // TFLG2 + block(base + 0x26, base + 0x26).rw(FUNC(mc68hc11e1_device::pactl_ddra_r), FUNC(mc68hc11e1_device::pactl_ddra_w)); // PACTL + block(base + 0x28, base + 0x28).r(FUNC(mc68hc11e1_device::spcr_r<0>)).nopw(); // SPCR + block(base + 0x29, base + 0x29).r(FUNC(mc68hc11e1_device::spsr_r<0>)).nopw(); // SPSR + block(base + 0x2a, base + 0x2a).rw(FUNC(mc68hc11e1_device::spdr_r<0>), FUNC(mc68hc11e1_device::spdr_w<0>)); // SPDR + block(base + 0x2c, base + 0x2c).r(FUNC(mc68hc11e1_device::sccr1_r)).nopw(); // SCCR1 + block(base + 0x2d, base + 0x2d).r(FUNC(mc68hc11e1_device::sccr2_r)).nopw(); // SCCR2 + block(base + 0x30, base + 0x30).rw(FUNC(mc68hc11e1_device::adctl_r), FUNC(mc68hc11e1_device::adctl_w)); // ADCTL + block(base + 0x31, base + 0x34).r(FUNC(mc68hc11e1_device::adr_r)); // ADR1-ADR4 + block(base + 0x39, base + 0x39).rw(FUNC(mc68hc11e1_device::option_r), FUNC(mc68hc11e1_device::option_w)); // OPTION + block(base + 0x3a, base + 0x3a).nopw(); // COPRST (watchdog) + block(base + 0x3b, base + 0x3b).nopw(); // PPROG (EEPROM programming) + block(base + 0x3d, base + 0x3d).rw(FUNC(mc68hc11e1_device::init_r), FUNC(mc68hc11e1_device::init_w)); // INIT + block(base + 0x3f, base + 0x3f).rw(FUNC(mc68hc11e1_device::config_r), FUNC(mc68hc11e1_device::config_w)); // CONFIG +} + void mc68hc811e2_device::mc68hc11_reg_map(memory_view::memory_view_entry &block, offs_t base) { block(base + 0x00, base + 0x00).rw(FUNC(mc68hc811e2_device::port_r<0>), FUNC(mc68hc811e2_device::port_w<0>)); // PORTA @@ -893,6 +932,16 @@ m_config = 0x00; } +void mc68hc11e1_device::device_reset() +{ + mc68hc11_cpu_device::device_reset(); + + m_port_data[0] &= 0x8f; + m_port_data[1] = 0x00; + ddr_w<0>(0x70); + ddr_w<1>(0xff); +} + void mc68hc811e2_device::device_reset() { mc68hc11_cpu_device::device_reset(); diff -Nru mame-0.242+dfsg.1/src/devices/cpu/mc68hc11/mc68hc11.h mame-0.243+dfsg.1/src/devices/cpu/mc68hc11/mc68hc11.h --- mame-0.242+dfsg.1/src/devices/cpu/mc68hc11/mc68hc11.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/mc68hc11/mc68hc11.h 2022-04-29 05:37:26.000000000 +0000 @@ -14,6 +14,7 @@ DECLARE_DEVICE_TYPE(MC68HC11A1, mc68hc11a1_device) DECLARE_DEVICE_TYPE(MC68HC11D0, mc68hc11d0_device) +DECLARE_DEVICE_TYPE(MC68HC11E1, mc68hc11e1_device) DECLARE_DEVICE_TYPE(MC68HC811E2, mc68hc811e2_device) DECLARE_DEVICE_TYPE(MC68HC11F1, mc68hc11f1_device) DECLARE_DEVICE_TYPE(MC68HC11K1, mc68hc11k1_device) @@ -573,6 +574,18 @@ uint8_t reg01_r(); }; +class mc68hc11e1_device : public mc68hc11_cpu_device +{ +public: + // construction/destruction + mc68hc11e1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + +protected: + virtual void device_reset() override; + + virtual void mc68hc11_reg_map(memory_view::memory_view_entry &block, offs_t base) override; +}; + class mc68hc811e2_device : public mc68hc11_cpu_device { public: diff -Nru mame-0.242+dfsg.1/src/devices/cpu/mcs40/mcs40.cpp mame-0.243+dfsg.1/src/devices/cpu/mcs40/mcs40.cpp --- mame-0.242+dfsg.1/src/devices/cpu/mcs40/mcs40.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/mcs40/mcs40.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -10,7 +10,6 @@ #include "emu.h" #include "mcs40.h" #include "mcs40dasm.h" -#include "debugger.h" /* diff -Nru mame-0.242+dfsg.1/src/devices/cpu/mcs40/mcs40dasm.cpp mame-0.243+dfsg.1/src/devices/cpu/mcs40/mcs40dasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/mcs40/mcs40dasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/mcs40/mcs40dasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -119,10 +119,12 @@ offs_t flags(0U); if (format::ILL != desc.m_format) { - if (0x50U == (opcode & 0xf0U)) // JMS + if (0x50 == (opcode & 0xf0)) // JMS flags = STEP_OVER; else if ((0xc0 == (opcode & 0xf0)) || (0x02 == opcode)) // BBL/BBS flags = STEP_OUT; + else if (0x10 == (opcode & 0xf0) || 0x70 == (opcode & 0xf0)) // JCN/ISZ + flags = STEP_COND; } return (npc - pc) | flags | SUPPORTED; diff -Nru mame-0.242+dfsg.1/src/devices/cpu/mcs48/mcs48.cpp mame-0.243+dfsg.1/src/devices/cpu/mcs48/mcs48.cpp --- mame-0.242+dfsg.1/src/devices/cpu/mcs48/mcs48.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/mcs48/mcs48.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -87,8 +87,6 @@ #include "mcs48.h" #include "mcs48dsm.h" -#include "debugger.h" - /*************************************************************************** CONSTANTS diff -Nru mame-0.242+dfsg.1/src/devices/cpu/mcs48/mcs48dsm.cpp mame-0.243+dfsg.1/src/devices/cpu/mcs48/mcs48dsm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/mcs48/mcs48dsm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/mcs48/mcs48dsm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -67,14 +67,17 @@ case 0x10: util::stream_format(stream, "inc @r0"); break; case 0x11: util::stream_format(stream, "inc @r1"); break; case 0x12: if (!m_i802x) + { util::stream_format(stream, "jb0 $%03X", ((pc + 1) & 0x700) | params.r8(cpc++)); + flags = STEP_COND; + } else util::stream_format(stream, "illegal"); break; case 0x13: util::stream_format(stream, "addc a,#$%02X", params.r8(cpc++)); break; case 0x14: util::stream_format(stream, "call $0%02X", params.r8(cpc++)); flags = STEP_OVER; break; case 0x15: util::stream_format(stream, "dis i"); break; - case 0x16: util::stream_format(stream, "jtf $%03X", ((pc + 1) & 0x700) | params.r8(cpc++)); break; + case 0x16: util::stream_format(stream, "jtf $%03X", ((pc + 1) & 0x700) | params.r8(cpc++)); flags = STEP_COND; break; case 0x17: util::stream_format(stream, "inc a"); break; case 0x18: util::stream_format(stream, "inc r0"); break; case 0x19: util::stream_format(stream, "inc r1"); break; @@ -94,7 +97,7 @@ case 0x23: util::stream_format(stream, "mov a,#$%02X", params.r8(cpc++)); break; case 0x24: util::stream_format(stream, "jmp $1%02X", params.r8(cpc++)); break; case 0x25: util::stream_format(stream, "en tcnti"); break; - case 0x26: util::stream_format(stream, "jnt0 $%03X", ((pc + 1) & 0x700) | params.r8(cpc++)); break; + case 0x26: util::stream_format(stream, "jnt0 $%03X", ((pc + 1) & 0x700) | params.r8(cpc++)); flags = STEP_COND; break; case 0x27: util::stream_format(stream, "clr a"); break; case 0x28: util::stream_format(stream, "xch a,r0"); break; case 0x29: util::stream_format(stream, "xch a,r1"); break; @@ -107,13 +110,16 @@ case 0x30: util::stream_format(stream, "xchd a,@r0"); break; case 0x31: util::stream_format(stream, "xchd a,@r1"); break; case 0x32: if (!m_i802x) + { util::stream_format(stream, "jb1 $%03X", ((pc + 1) & 0x700) | params.r8(cpc++)); + flags = STEP_COND; + } else util::stream_format(stream, "illegal"); break; case 0x34: util::stream_format(stream, "call $1%02X", params.r8(cpc++)); flags = STEP_OVER; break; case 0x35: util::stream_format(stream, "dis tcnti"); break; - case 0x36: util::stream_format(stream, "jt0 $%03X", ((pc + 1) & 0x700) | params.r8(cpc++)); break; + case 0x36: util::stream_format(stream, "jt0 $%03X", ((pc + 1) & 0x700) | params.r8(cpc++)); flags = STEP_COND; break; case 0x37: util::stream_format(stream, "cpl a"); break; case 0x39: util::stream_format(stream, "outl p1,a"); break; case 0x3a: util::stream_format(stream, "outl p2,a"); break; @@ -127,7 +133,7 @@ case 0x43: util::stream_format(stream, "orl a,#$%02X", params.r8(cpc++)); break; case 0x44: util::stream_format(stream, "jmp $2%02X", params.r8(cpc++)); break; case 0x45: util::stream_format(stream, "strt cnt"); break; - case 0x46: util::stream_format(stream, "jnt1 $%03X", ((pc + 1) & 0x700) | params.r8(cpc++)); break; + case 0x46: util::stream_format(stream, "jnt1 $%03X", ((pc + 1) & 0x700) | params.r8(cpc++)); flags = STEP_COND; break; case 0x47: util::stream_format(stream, "swap a"); break; case 0x48: util::stream_format(stream, "orl a,r0"); break; case 0x49: util::stream_format(stream, "orl a,r1"); break; @@ -140,14 +146,17 @@ case 0x50: util::stream_format(stream, "anl a,@r0"); break; case 0x51: util::stream_format(stream, "anl a,@r1"); break; case 0x52: if (!m_i802x) + { util::stream_format(stream, "jb2 $%03X", ((pc + 1) & 0x700) | params.r8(cpc++)); + flags = STEP_COND; + } else util::stream_format(stream, "illegal"); break; case 0x53: util::stream_format(stream, "anl a,#$%02X", params.r8(cpc++)); break; case 0x54: util::stream_format(stream, "call $2%02X", params.r8(cpc++)); flags = STEP_OVER; break; case 0x55: util::stream_format(stream, "strt t"); break; - case 0x56: util::stream_format(stream, "jt1 $%03X", ((pc + 1) & 0x700) | params.r8(cpc++)); break; + case 0x56: util::stream_format(stream, "jt1 $%03X", ((pc + 1) & 0x700) | params.r8(cpc++)); flags = STEP_COND; break; case 0x57: util::stream_format(stream, "da a"); break; case 0x58: util::stream_format(stream, "anl a,r0"); break; case 0x59: util::stream_format(stream, "anl a,r1"); break; @@ -174,7 +183,10 @@ case 0x70: util::stream_format(stream, "addc a,@r0"); break; case 0x71: util::stream_format(stream, "addc a,@r1"); break; case 0x72: if (!m_i802x) + { util::stream_format(stream, "jb3 $%03X", ((pc + 1) & 0x700) | params.r8(cpc++)); + flags = STEP_COND; + } else util::stream_format(stream, "illegal"); break; @@ -185,7 +197,10 @@ util::stream_format(stream, "illegal"); break; case 0x76: if (!m_i802x) + { util::stream_format(stream, "jf1 $%03X", ((pc + 1) & 0x700) | params.r8(cpc++)); + flags = STEP_COND; + } else util::stream_format(stream, "illegal"); break; @@ -219,10 +234,14 @@ break; case 0x86: if (m_i802x) util::stream_format(stream, "illegal"); - else if (!m_upi41) - util::stream_format(stream, "jni $%03X", ((pc + 1) & 0x700) | params.r8(cpc++)); else - util::stream_format(stream, "jobf $%03X", ((pc + 1) & 0x700) | params.r8(cpc++)); + { + if (!m_upi41) + util::stream_format(stream, "jni $%03X", ((pc + 1) & 0x700) | params.r8(cpc++)); + else + util::stream_format(stream, "jobf $%03X", ((pc + 1) & 0x700) | params.r8(cpc++)); + flags = STEP_COND; + } break; case 0x88: if (!m_upi41 && !m_i802x) util::stream_format(stream, "orl bus,#$%02X", params.r8(cpc++)); @@ -256,7 +275,10 @@ util::stream_format(stream, "illegal"); break; case 0x92: if (!m_i802x) + { util::stream_format(stream, "jb4 $%03X", ((pc + 1) & 0x700) | params.r8(cpc++)); + flags = STEP_COND; + } else util::stream_format(stream, "illegal"); break; @@ -272,7 +294,7 @@ else util::stream_format(stream, "sel an1"); break; - case 0x96: util::stream_format(stream, "jnz $%03X", ((pc + 1) & 0x700) | params.r8(cpc++)); break; + case 0x96: util::stream_format(stream, "jnz $%03X", ((pc + 1) & 0x700) | params.r8(cpc++)); flags = STEP_COND; break; case 0x97: util::stream_format(stream, "clr c"); break; case 0x98: if (!m_upi41 && !m_i802x) util::stream_format(stream, "anl bus,#$%02X", params.r8(cpc++)); @@ -314,7 +336,10 @@ case 0xb0: util::stream_format(stream, "mov @r0,#$%02X", params.r8(cpc++)); break; case 0xb1: util::stream_format(stream, "mov @r1,#$%02X", params.r8(cpc++)); break; case 0xb2: if (!m_i802x) + { util::stream_format(stream, "jb5 $%03X", ((pc + 1) & 0x700) | params.r8(cpc++)); + flags = STEP_COND; + } else util::stream_format(stream, "illegal"); break; @@ -326,7 +351,10 @@ util::stream_format(stream, "illegal"); break; case 0xb6: if (!m_i802x) + { util::stream_format(stream, "jf0 $%03X", ((pc + 1) & 0x700) | params.r8(cpc++)); + flags = STEP_COND; + } else util::stream_format(stream, "illegal"); break; @@ -344,7 +372,7 @@ else util::stream_format(stream, "illegal"); break; - case 0xc6: util::stream_format(stream, "jz $%03X", ((pc + 1) & 0x700) | params.r8(cpc++)); break; + case 0xc6: util::stream_format(stream, "jz $%03X", ((pc + 1) & 0x700) | params.r8(cpc++)); flags = STEP_COND; break; case 0xc7: if (!m_i802x) util::stream_format(stream, "mov a,psw"); else @@ -393,7 +421,10 @@ case 0xd0: util::stream_format(stream, "xrl a,@r0"); break; case 0xd1: util::stream_format(stream, "xrl a,@r1"); break; case 0xd2: if (!m_i802x) + { util::stream_format(stream, "jb6 $%03X", ((pc + 1) & 0x700) | params.r8(cpc++)); + flags = STEP_COND; + } else util::stream_format(stream, "illegal"); break; @@ -407,7 +438,10 @@ case 0xd6: if (!m_upi41) util::stream_format(stream, "illegal"); else + { util::stream_format(stream, "jnibf $%03X", ((pc + 1) & 0x700) | params.r8(cpc++)); + flags = STEP_COND; + } break; case 0xd7: if (!m_i802x) util::stream_format(stream, "mov psw,a"); @@ -435,7 +469,7 @@ else util::stream_format(stream, "en dma"); break; - case 0xe6: util::stream_format(stream, "jnc $%03X", ((pc + 1) & 0x700) | params.r8(cpc++)); break; + case 0xe6: util::stream_format(stream, "jnc $%03X", ((pc + 1) & 0x700) | params.r8(cpc++)); flags = STEP_COND; break; case 0xe7: util::stream_format(stream, "rl a"); break; case 0xe8: util::stream_format(stream, "djnz r0,$%03X", ((pc + 1) & 0x700) | params.r8(cpc++)); flags = STEP_OVER; break; case 0xe9: util::stream_format(stream, "djnz r1,$%03X", ((pc + 1) & 0x700) | params.r8(cpc++)); flags = STEP_OVER; break; @@ -448,7 +482,10 @@ case 0xf0: util::stream_format(stream, "mov a,@r0"); break; case 0xf1: util::stream_format(stream, "mov a,@r1"); break; case 0xf2: if (!m_i802x) + { util::stream_format(stream, "jb7 $%03X", ((pc + 1) & 0x700) | params.r8(cpc++)); + flags = STEP_COND; + } else util::stream_format(stream, "illegal"); break; @@ -460,7 +497,7 @@ else util::stream_format(stream, "en flags"); break; - case 0xf6: util::stream_format(stream, "jc $%03X", ((pc + 1) & 0x700) | params.r8(cpc++)); break; + case 0xf6: util::stream_format(stream, "jc $%03X", ((pc + 1) & 0x700) | params.r8(cpc++)); flags = STEP_COND; break; case 0xf7: util::stream_format(stream, "rlc a"); break; case 0xf8: util::stream_format(stream, "mov a,r0"); break; case 0xf9: util::stream_format(stream, "mov a,r1"); break; diff -Nru mame-0.242+dfsg.1/src/devices/cpu/mcs51/axc51-core.cpp mame-0.243+dfsg.1/src/devices/cpu/mcs51/axc51-core.cpp --- mame-0.242+dfsg.1/src/devices/cpu/mcs51/axc51-core.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/mcs51/axc51-core.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -22,7 +22,6 @@ *****************************************************************************/ #include "emu.h" -#include "debugger.h" #include "axc51-core.h" #include "axc51-core_dasm.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/mcs51/mcs51.cpp mame-0.243+dfsg.1/src/devices/cpu/mcs51/mcs51.cpp --- mame-0.242+dfsg.1/src/devices/cpu/mcs51/mcs51.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/mcs51/mcs51.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -134,8 +134,6 @@ #include "mcs51.h" #include "mcs51dasm.h" -#include "debugger.h" - #define VERBOSE 0 #define LOG(x) do { if (VERBOSE) logerror x; } while (0) diff -Nru mame-0.242+dfsg.1/src/devices/cpu/mcs51/mcs51dasm.cpp mame-0.243+dfsg.1/src/devices/cpu/mcs51/mcs51dasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/mcs51/mcs51dasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/mcs51/mcs51dasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -784,6 +784,7 @@ sym = get_bit_address(params.r8(PC++)); rel = params.r8(PC++); util::stream_format(stream, "jbc %s,$%04X", sym, PC + rel); + flags = STEP_COND; break; //ACALL code addr /* 1: aaa1 0001 */ @@ -846,6 +847,7 @@ sym = get_bit_address(params.r8(PC++)); rel = params.r8(PC++); util::stream_format(stream, "jb %s,$%04X", sym, (PC + rel)); + flags = STEP_COND; break; //RET @@ -894,6 +896,7 @@ sym = get_bit_address(params.r8(PC++)); rel = params.r8(PC++); util::stream_format(stream, "jnb %s,$%04X", sym, (PC + rel)); + flags = STEP_COND; break; //RETI @@ -940,6 +943,7 @@ case 0x40: /* 1: 0100 0000 */ rel = params.r8(PC++); util::stream_format(stream, "jc $%04X", PC + rel); + flags = STEP_COND; break; //ORL data addr, A @@ -988,6 +992,7 @@ case 0x50: /* 1: 0101 0000 */ rel = params.r8(PC++); util::stream_format(stream, "jnc $%04X", PC + rel); + flags = STEP_COND; break; //Unable to test @@ -1038,6 +1043,7 @@ case 0x60: /* 1: 0110 0000 */ rel = params.r8(PC++); util::stream_format(stream, "jz $%04X", PC + rel); + flags = STEP_COND; break; //Unable to test @@ -1087,6 +1093,7 @@ case 0x70: /* 1: 0111 0000 */ rel = params.r8(PC++); util::stream_format(stream, "jnz $%04X", PC + rel); + flags = STEP_COND; break; //Unable to test @@ -1302,6 +1309,7 @@ data = params.r8(PC++); rel = params.r8(PC++); util::stream_format(stream, "cjne a,#$%02X,$%04X", data, PC + rel); + flags = STEP_COND; break; //CJNE A, data addr, code addr @@ -1309,6 +1317,7 @@ sym = get_data_address(params.r8(PC++)); rel = params.r8(PC++); util::stream_format(stream, "cjne a,%s,$%04X", sym, PC + rel); + flags = STEP_COND; break; //Unable to test @@ -1318,6 +1327,7 @@ data = params.r8(PC++); rel = params.r8(PC++); util::stream_format(stream, "cjne @r%d,#$%02X,$%04X", op&1, data, PC + rel); + flags = STEP_COND; break; //CJNE R0 to R7, #data, code addr/* 1: 1011 1rrr */ @@ -1332,6 +1342,7 @@ data = params.r8(PC++); rel = params.r8(PC++); util::stream_format(stream, "cjne r%d,#$%02X,$%04X", op&7, data, PC + rel); + flags = STEP_COND; break; //PUSH data addr @@ -1408,7 +1419,7 @@ sym = get_data_address(params.r8(PC++)); rel = params.r8(PC++); util::stream_format(stream, "djnz %s,$%04X", sym, PC + rel); - flags = STEP_OVER; + flags = STEP_COND; break; //XCHD A, @R0/@R1 /* 1: 1101 011i */ @@ -1428,7 +1439,7 @@ case 0xdf: rel = params.r8(PC++); util::stream_format(stream, "djnz r%d,$%04X", op&7, (PC + rel)); - flags = STEP_OVER; + flags = STEP_COND; break; //MOVX A,@DPTR diff -Nru mame-0.242+dfsg.1/src/devices/cpu/mcs96/mcs96.cpp mame-0.243+dfsg.1/src/devices/cpu/mcs96/mcs96.cpp --- mame-0.242+dfsg.1/src/devices/cpu/mcs96/mcs96.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/mcs96/mcs96.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -9,7 +9,6 @@ ***************************************************************************/ #include "emu.h" -#include "debugger.h" #include "mcs96.h" mcs96_device::mcs96_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, int data_width, address_map_constructor regs_map) : diff -Nru mame-0.242+dfsg.1/src/devices/cpu/mcs96/mcs96make.py mame-0.243+dfsg.1/src/devices/cpu/mcs96/mcs96make.py --- mame-0.242+dfsg.1/src/devices/cpu/mcs96/mcs96make.py 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/mcs96/mcs96make.py 2022-04-29 05:37:26.000000000 +0000 @@ -129,6 +129,8 @@ flags = "STEP_OVER" elif opc.name == "rts": flags = "STEP_OUT" + elif opc.amode == "rel8" or opc.amode == "rrel8" or opc.amode == "brrel8" or opc.amode == "wrrel8": + flags = "STEP_COND" else: flags = "0" print("\t{ \"%s\", %s, DASM_%s, %s }," % (opc.name, alt, opc.amode, flags), file=f) diff -Nru mame-0.242+dfsg.1/src/devices/cpu/melps4/m58846.cpp mame-0.243+dfsg.1/src/devices/cpu/melps4/m58846.cpp --- mame-0.242+dfsg.1/src/devices/cpu/melps4/m58846.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/melps4/m58846.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -27,7 +27,7 @@ // device definitions -m58846_device::m58846_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +m58846_device::m58846_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : melps4_cpu_device(mconfig, M58846, tag, owner, clock, 11, address_map_constructor(FUNC(m58846_device::program_2kx9), this), 7, address_map_constructor(FUNC(m58846_device::data_128x4), this), 12 /* number of D pins */, 2 /* subroutine page */, 1 /* interrupt page */), m_timer(nullptr) { } @@ -93,7 +93,7 @@ reset_timer(); } -void m58846_device::write_v(uint8_t data) +void m58846_device::write_v(u8 data) { // d0: enable timer 1 irq // d1: enable timer 2 irq? (TODO) diff -Nru mame-0.242+dfsg.1/src/devices/cpu/melps4/m58846.h mame-0.243+dfsg.1/src/devices/cpu/melps4/m58846.h --- mame-0.242+dfsg.1/src/devices/cpu/melps4/m58846.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/melps4/m58846.h 2022-04-29 05:37:26.000000000 +0000 @@ -19,7 +19,7 @@ class m58846_device : public melps4_cpu_device { public: - m58846_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + m58846_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); protected: // device-level overrides @@ -31,7 +31,7 @@ // timers virtual void device_timer(emu_timer &timer, device_timer_id id, int param) override; - virtual void write_v(uint8_t data) override; + virtual void write_v(u8 data) override; void data_128x4(address_map &map); void program_2kx9(address_map &map); diff -Nru mame-0.242+dfsg.1/src/devices/cpu/melps4/melps4.cpp mame-0.243+dfsg.1/src/devices/cpu/melps4/melps4.cpp --- mame-0.242+dfsg.1/src/devices/cpu/melps4/melps4.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/melps4/melps4.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -40,10 +40,9 @@ #include "emu.h" #include "melps4.h" #include "melps4d.h" -#include "debugger.h" -melps4_cpu_device::melps4_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, int d_pins, uint8_t sm_page, uint8_t int_page) +melps4_cpu_device::melps4_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, int d_pins, u8 sm_page, u8 int_page) : cpu_device(mconfig, type, tag, owner, clock) , m_program_config("program", ENDIANNESS_LITTLE, 16, prgwidth, -1, program) , m_data_config("data", ENDIANNESS_LITTLE, 8, datawidth, 0, data) @@ -274,7 +273,7 @@ // i/o handling //------------------------------------------------- -uint8_t melps4_cpu_device::read_gen_port(int port) +u8 melps4_cpu_device::read_gen_port(int port) { // input generic port switch (port) @@ -291,7 +290,7 @@ return 0; } -void melps4_cpu_device::write_gen_port(int port, uint8_t data) +void melps4_cpu_device::write_gen_port(int port, u8 data) { // output generic port switch (port) @@ -320,7 +319,7 @@ { // read port D, return state of selected pin bit &= 0xf; - uint16_t d = (m_port_d | m_read_d(bit, 0xffff)) & m_d_mask; + u16 d = (m_port_d | m_read_d(bit, 0xffff)) & m_d_mask; return d >> bit & 1; } diff -Nru mame-0.242+dfsg.1/src/devices/cpu/melps4/melps4d.cpp mame-0.243+dfsg.1/src/devices/cpu/melps4/melps4d.cpp --- mame-0.242+dfsg.1/src/devices/cpu/melps4/melps4d.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/melps4/melps4d.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -28,7 +28,7 @@ }; // number of bits per opcode parameter -const uint8_t melps4_disassembler::em_bits[] = +const u8 melps4_disassembler::em_bits[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -43,18 +43,18 @@ 0, 0, 0, 0, 0 }; -const uint32_t melps4_disassembler::em_flags[] = +const u32 melps4_disassembler::em_flags[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, STEP_COND, STEP_COND, 0, 0, + 0, 0, STEP_COND, STEP_COND, + 0, 0, 0, STEP_COND, STEP_COND, 0, 0, STEP_COND, 0, 0, 0, + 0, 0, STEP_COND, STEP_COND, STEP_COND, + 0, 0, 0, 0, 0, 0, STEP_COND, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, STEP_COND, STEP_COND, 0, 0, 0, STEP_OVER, STEP_OUT, STEP_OUT, STEP_OUT, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, STEP_COND, 0, 0, 0, 0, 0, 0, 0, 0, STEP_COND, 0, 0, 0, 0, 0, 0, 0 }; @@ -62,7 +62,7 @@ // M58846 disasm -const uint8_t melps4_disassembler::m58846_opmap[0xc0] = +const u8 melps4_disassembler::m58846_opmap[0xc0] = { // 0 1 2 3 4 5 6 7 8 9 A B C D E F em_NOP, em_BA, em_INY, em_DEY, em_DI, em_EI, em_RU, em_SU, 0, em_TABE, em_AM, em_OSE, em_TYA, 0, 0, em_CMA, // 0x @@ -81,10 +81,10 @@ offs_t melps4_disassembler::disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) { - uint16_t op = opcodes.r16(pc) & 0x1ff; + u16 op = opcodes.r16(pc) & 0x1ff; // get opcode - uint8_t instr; + u8 instr; if (op >= 0x180) instr = em_B; else if (op >= 0x100) @@ -94,28 +94,33 @@ else instr = m58846_opmap[op]; + u32 flags = em_flags[instr]; util::stream_format(stream, "%-6s", em_name[instr]); // get immediate param - uint8_t bits = em_bits[instr]; + u8 bits = em_bits[instr]; // special case for LXY x,y if (instr == em_LXY) { - uint8_t x = op >> 4 & 3; - uint8_t y = op & 0xf; + u8 x = op >> 4 & 3; + u8 y = op & 0xf; util::stream_format(stream, "%d,%d", x, y); } else if (bits > 0) { - uint8_t param = op & ((1 << bits) - 1); + u8 param = op & ((1 << bits) - 1); + + if (instr == em_A && param == 6) + flags &= ~STEP_COND; + if (bits > 4) util::stream_format(stream, "$%02X", param); else util::stream_format(stream, "%d", param); } - return 1 | em_flags[instr] | SUPPORTED; + return 1 | flags | SUPPORTED; } u32 melps4_disassembler::opcode_alignment() const diff -Nru mame-0.242+dfsg.1/src/devices/cpu/melps4/melps4d.h mame-0.243+dfsg.1/src/devices/cpu/melps4/melps4d.h --- mame-0.242+dfsg.1/src/devices/cpu/melps4/melps4d.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/melps4/melps4d.h 2022-04-29 05:37:26.000000000 +0000 @@ -43,9 +43,9 @@ }; static const char *const em_name[]; - static const uint8_t em_bits[]; - static const uint32_t em_flags[]; - static const uint8_t m58846_opmap[0xc0]; + static const u8 em_bits[]; + static const u32 em_flags[]; + static const u8 m58846_opmap[0xc0]; }; #endif diff -Nru mame-0.242+dfsg.1/src/devices/cpu/melps4/melps4.h mame-0.243+dfsg.1/src/devices/cpu/melps4/melps4.h --- mame-0.242+dfsg.1/src/devices/cpu/melps4/melps4.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/melps4/melps4.h 2022-04-29 05:37:26.000000000 +0000 @@ -90,18 +90,18 @@ protected: // construction/destruction - melps4_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, int d_pins, uint8_t sm_page, uint8_t int_page); + melps4_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, int d_pins, u8 sm_page, u8 int_page); // device-level overrides virtual void device_start() override; virtual void device_reset() override; // device_execute_interface overrides - virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const noexcept override { return (clocks + 6 - 1) / 6; } // 6 t-states per machine cycle - virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const noexcept override { return (cycles * 6); } // " - virtual uint32_t execute_min_cycles() const noexcept override { return 1; } - virtual uint32_t execute_max_cycles() const noexcept override { return 1+1; } // max opcode cycles + interrupt duration - virtual uint32_t execute_input_lines() const noexcept override { return 3; } // up to 3 (some internal) + virtual u64 execute_clocks_to_cycles(u64 clocks) const noexcept override { return (clocks + 6 - 1) / 6; } // 6 t-states per machine cycle + virtual u64 execute_cycles_to_clocks(u64 cycles) const noexcept override { return (cycles * 6); } // " + virtual u32 execute_min_cycles() const noexcept override { return 1; } + virtual u32 execute_max_cycles() const noexcept override { return 1+1; } // max opcode cycles + interrupt duration + virtual u32 execute_input_lines() const noexcept override { return 3; } // up to 3 (some internal) virtual void execute_set_input(int line, int state) override; virtual void execute_run() override; virtual void execute_one(); @@ -130,32 +130,32 @@ int m_d_pins; // number of D port pins and bitmask: 11 on '40,'41,'42,'44, 8 on '43, 12 on '45,'46, 16 on '47 int m_d_mask; // " - uint8_t m_sm_page; // subroutine default page: 14 on '40 to '44, 2 on '45,'46, 0 on '47 - uint8_t m_int_page; // interrupt routine page: 12 on '40 to '44, 1 on '45,'46, 2 on '47 - uint8_t m_xami_mask; // mask option for XAMI opcode on '40,'41,'45 (0xf for others) - uint16_t m_sp_mask; // SP opcode location(middle 4 bits): 7 on '40 to '46, 3 on '47 - uint16_t m_ba_op; // BA opcode location: 1 on '40 to '46, N/A on '47 - uint8_t m_stack_levels; // 3 levels on MELPS 4, 12 levels on MELPS 41/42 + u8 m_sm_page; // subroutine default page: 14 on '40 to '44, 2 on '45,'46, 0 on '47 + u8 m_int_page; // interrupt routine page: 12 on '40 to '44, 1 on '45,'46, 2 on '47 + u8 m_xami_mask; // mask option for XAMI opcode on '40,'41,'45 (0xf for others) + u16 m_sp_mask; // SP opcode location(middle 4 bits): 7 on '40 to '46, 3 on '47 + u16 m_ba_op; // BA opcode location: 1 on '40 to '46, N/A on '47 + u8 m_stack_levels; // 3 levels on MELPS 4, 12 levels on MELPS 41/42 // internal state, misc regs - uint16_t m_pc; // program counter (11 or 10-bit) - uint16_t m_prev_pc; - uint16_t m_stack[12]; // callstack (SK0-SKx, same size as PC) - uint16_t m_op; - uint16_t m_prev_op; - uint8_t m_bitmask; // opcode bit argument - - uint16_t m_port_d; // last written port data - uint8_t m_port_s; // " - uint8_t m_port_f; // " - uint8_t m_port_t; // " + u16 m_pc; // program counter (11 or 10-bit) + u16 m_prev_pc; + u16 m_stack[12]; // callstack (SK0-SKx, same size as PC) + u16 m_op; + u16 m_prev_op; + u8 m_bitmask; // opcode bit argument + + u16 m_port_d; // last written port data + u8 m_port_s; // " + u8 m_port_f; // " + u8 m_port_t; // " bool m_sm, m_sms; // subroutine mode flag + irq stack bool m_ba_flag; // temp flag indicates BA opcode was executed - uint8_t m_sp_param; // temp register holding SP opcode parameter - uint8_t m_cps; // DP,CY or DP',CY' selected + u8 m_sp_param; // temp register holding SP opcode parameter + u8 m_cps; // DP,CY or DP',CY' selected bool m_skip; // skip next opcode - uint8_t m_inte; // interrupt enable flag + u8 m_inte; // interrupt enable flag int m_intp; // external interrupt polarity ('40 to '44) bool m_irqflag[3]; // irq flags: exf, 1f, 2f (external, timer 1, timer 2) int m_int_state; // INT pin state @@ -163,24 +163,24 @@ bool m_prohibit_irq; // interrupt is prohibited during certain opcodes bool m_possible_irq; // indicate that irq needs to be rechecked - uint8_t m_tmr_count[2]; // timer active count - uint8_t m_tmr_reload; // timer(2) auto reload + u8 m_tmr_count[2]; // timer active count + u8 m_tmr_reload; // timer(2) auto reload bool m_tmr_irq_enabled[2]; // work registers (unless specified, each is 4-bit) - uint8_t m_a; // accumulator - uint8_t m_b; // generic - uint8_t m_e; // 8-bit register, hold data for S output - uint8_t m_y, m_y2; // RAM index Y, Y' (Z.XX.YYYY is DP aka Data Pointer) - uint8_t m_x, m_x2; // RAM index X, X', 2-bit - uint8_t m_z, m_z2; // RAM index Z, Z', 1-bit, optional - uint8_t m_cy, m_cy2; // carry flag(s) - - uint8_t m_h; // A/D converter H or generic - uint8_t m_l; // A/D converter L or generic - uint8_t m_c; // A/D converter counter - uint8_t m_v; // timer control V - uint8_t m_w; // timer control W + u8 m_a; // accumulator + u8 m_b; // generic + u8 m_e; // 8-bit register, hold data for S output + u8 m_y, m_y2; // RAM index Y, Y' (Z.XX.YYYY is DP aka Data Pointer) + u8 m_x, m_x2; // RAM index X, X', 2-bit + u8 m_z, m_z2; // RAM index Z, Z', 1-bit, optional + u8 m_cy, m_cy2; // carry flag(s) + + u8 m_h; // A/D converter H or generic + u8 m_l; // A/D converter L or generic + u8 m_c; // A/D converter counter + u8 m_v; // timer control V + u8 m_w; // timer control W // i/o handlers devcb_read16 m_read_k; @@ -196,19 +196,19 @@ devcb_write_line m_write_t; virtual void write_t_in(int state) { m_t_in_state = state; } - virtual void write_v(uint8_t data) { m_v = data; } - virtual void write_w(uint8_t data) { m_w = data; } + virtual void write_v(u8 data) { m_v = data; } + virtual void write_w(u8 data) { m_w = data; } virtual void do_interrupt(int which); virtual void check_interrupt(); - uint8_t read_gen_port(int port); - void write_gen_port(int port, uint8_t data); + u8 read_gen_port(int port); + void write_gen_port(int port, u8 data); int read_d_pin(int bit); void write_d_pin(int bit, int state); // misc internal helpers - uint8_t ram_r(); - void ram_w(uint8_t data); + u8 ram_r(); + void ram_w(u8 data); void pop_pc(); void push_pc(); diff -Nru mame-0.242+dfsg.1/src/devices/cpu/melps4/melps4op.cpp mame-0.243+dfsg.1/src/devices/cpu/melps4/melps4op.cpp --- mame-0.242+dfsg.1/src/devices/cpu/melps4/melps4op.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/melps4/melps4op.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -9,15 +9,15 @@ // internal helpers -inline uint8_t melps4_cpu_device::ram_r() +inline u8 melps4_cpu_device::ram_r() { - uint8_t address = (m_z << 6 | m_x << 4 | m_y) & m_datamask; + u8 address = (m_z << 6 | m_x << 4 | m_y) & m_datamask; return m_data->read_byte(address) & 0xf; } -inline void melps4_cpu_device::ram_w(uint8_t data) +inline void melps4_cpu_device::ram_w(u8 data) { - uint8_t address = (m_z << 6 | m_x << 4 | m_y) & m_datamask; + u8 address = (m_z << 6 | m_x << 4 | m_y) & m_datamask; m_data->write_byte(address, data & 0xf); } @@ -135,7 +135,7 @@ m_cps = m_op & 1; // swap registers - uint8_t x, y, z, cy; + u8 x, y, z, cy; x = m_x; y = m_y; z = m_z; @@ -172,7 +172,7 @@ void melps4_cpu_device::op_xam() { // XAM j: exchange RAM with A, xor X with j - uint8_t a = m_a; + u8 a = m_a; m_a = ram_r(); ram_w(a); m_x ^= m_op & 3; @@ -228,7 +228,7 @@ void melps4_cpu_device::op_a() { // A n: add immediate to A, skip next on no carry (except when n=6) - uint8_t n = m_op & 0xf; + u8 n = m_op & 0xf; m_a += n; m_skip = !(m_a & 0x10 || n == 6); m_a &= 0xf; @@ -261,7 +261,7 @@ void melps4_cpu_device::op_rl() { // RL(undocumented): rotate A left through carry - uint8_t c = m_a >> 3 & 1; + u8 c = m_a >> 3 & 1; m_a = (m_a << 1 | m_cy) & 0xf; m_cy = c; } @@ -269,7 +269,7 @@ void melps4_cpu_device::op_rr() { // RR(undocumented): rotate A right through carry - uint8_t c = m_a & 1; + u8 c = m_a & 1; m_a = m_a >> 1 | m_cy << 3; m_cy = c; } @@ -334,7 +334,7 @@ void melps4_cpu_device::op_xal() { // XAL: exchange A with L - uint8_t a = m_a; + u8 a = m_a; m_a = m_l; m_l = a; } @@ -342,7 +342,7 @@ void melps4_cpu_device::op_xah() { // XAH: exchange A with H - uint8_t a = m_a; + u8 a = m_a; m_a = m_h; m_h = a; } @@ -363,7 +363,7 @@ void melps4_cpu_device::op_shl() { // SHL: set bit in L or H designated by C - uint8_t mask = 1 << (m_c & 3); + u8 mask = 1 << (m_c & 3); if (m_c & 4) m_h |= mask; else @@ -373,7 +373,7 @@ void melps4_cpu_device::op_rhl() { // RHL: reset bit in L or H designated by C - uint8_t mask = 1 << (m_c & 3); + u8 mask = 1 << (m_c & 3); if (m_c & 4) m_h &= ~mask; else @@ -499,7 +499,7 @@ // - short call: subroutine page // - short jump: current page, or sub. page + 1 when in sub. mode // - long jump/call(B/BM preceded by SP): temp SP register - uint8_t page = m_pc >> 7; + u8 page = m_pc >> 7; if ((m_prev_op & ~0xf) == m_sp_mask) { m_sm = false; diff -Nru mame-0.242+dfsg.1/src/devices/cpu/minx/minx.cpp mame-0.243+dfsg.1/src/devices/cpu/minx/minx.cpp --- mame-0.242+dfsg.1/src/devices/cpu/minx/minx.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/minx/minx.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -48,7 +48,6 @@ #include "emu.h" #include "minx.h" #include "minxd.h" -#include "debugger.h" #define FLAG_I 0x80 #define FLAG_D 0x40 diff -Nru mame-0.242+dfsg.1/src/devices/cpu/minx/minxd.cpp mame-0.243+dfsg.1/src/devices/cpu/minx/minxd.cpp --- mame-0.242+dfsg.1/src/devices/cpu/minx/minxd.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/minx/minxd.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -26,13 +26,13 @@ }; const uint32_t minx_disassembler::s_flags[] = { - 0, 0, 0, 0, 0, 0, STEP_OVER, STEP_OVER, STEP_OVER, STEP_OVER, STEP_OVER, - STEP_OVER, STEP_OVER, STEP_OVER, STEP_OVER, STEP_OVER, STEP_OVER, STEP_OVER, STEP_OVER, - STEP_OVER, STEP_OVER, STEP_OVER, STEP_OVER, STEP_OVER, STEP_OVER, STEP_OVER, STEP_OVER, + 0, 0, 0, 0, 0, 0, STEP_OVER, STEP_OVER | STEP_COND, STEP_OVER | STEP_COND, STEP_OVER | STEP_COND, STEP_OVER | STEP_COND, + STEP_OVER | STEP_COND, STEP_OVER | STEP_COND, STEP_OVER | STEP_COND, STEP_OVER | STEP_COND, STEP_OVER | STEP_COND, STEP_OVER | STEP_COND, STEP_OVER | STEP_COND, STEP_OVER | STEP_COND, + STEP_OVER | STEP_COND, STEP_OVER | STEP_COND, STEP_OVER | STEP_COND, STEP_OVER | STEP_COND, STEP_OVER | STEP_COND, STEP_OVER | STEP_COND, STEP_OVER | STEP_COND, STEP_OVER | STEP_COND, 0, 0, 0, 0, 0, STEP_OVER, 0, STEP_OVER, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, + STEP_COND, STEP_COND, STEP_COND, STEP_COND, STEP_COND, STEP_COND, STEP_COND, 0, + STEP_COND, STEP_COND, STEP_COND, STEP_COND, STEP_COND, STEP_COND, STEP_COND, STEP_COND, + STEP_COND, STEP_COND, STEP_COND, STEP_COND, STEP_COND, STEP_COND, STEP_COND, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, STEP_OUT, STEP_OUT, STEP_OUT, 0, 0, 0, 0, 0, 0, 0, 0, 0, diff -Nru mame-0.242+dfsg.1/src/devices/cpu/mips/mips1.cpp mame-0.243+dfsg.1/src/devices/cpu/mips/mips1.cpp --- mame-0.242+dfsg.1/src/devices/cpu/mips/mips1.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/mips/mips1.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -14,7 +14,6 @@ #include "emu.h" #include "mips1.h" #include "mips1dsm.h" -#include "debugger.h" #include "softfloat3/source/include/softfloat.h" #define LOG_GENERAL (1U << 0) diff -Nru mame-0.242+dfsg.1/src/devices/cpu/mips/mips1dsm.cpp mame-0.243+dfsg.1/src/devices/cpu/mips/mips1dsm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/mips/mips1dsm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/mips/mips1dsm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -105,8 +105,8 @@ case 0x08: /* BC */ switch (rt) { - case 0x00: util::stream_format(stream, "bc%df $%08x", cop, pc + 4 + ((int16_t)op << 2)); break; - case 0x01: util::stream_format(stream, "bc%dt $%08x", cop, pc + 4 + ((int16_t)op << 2)); break; + case 0x00: util::stream_format(stream, "bc%df $%08x", cop, pc + 4 + ((int16_t)op << 2)); flags = STEP_COND | step_over_extra(1); break; + case 0x01: util::stream_format(stream, "bc%dt $%08x", cop, pc + 4 + ((int16_t)op << 2)); flags = STEP_COND | step_over_extra(1); break; case 0x02: util::stream_format(stream, "bc%dfl [invalid]", cop); break; case 0x03: util::stream_format(stream, "bc%dtl [invalid]", cop); break; default: util::stream_format(stream, "dc.l $%08x [invalid]", op); break; @@ -176,10 +176,10 @@ case 0x08: /* BC */ switch (rt & 3) { - case 0x00: util::stream_format(stream, "bc1f $%08x,%d", pc + 4 + ((int16_t)op << 2), (op >> 18) & 7); break; - case 0x01: util::stream_format(stream, "bc1t $%08x,%d", pc + 4 + ((int16_t)op << 2), (op >> 18) & 7); break; - case 0x02: util::stream_format(stream, "bc1fl $%08x,%d", pc + 4 + ((int16_t)op << 2), (op >> 18) & 7); flags = STEP_OVER | step_over_extra(1); break; - case 0x03: util::stream_format(stream, "bc1tl $%08x,%d", pc + 4 + ((int16_t)op << 2), (op >> 18) & 7); flags = STEP_OVER | step_over_extra(1); break; + case 0x00: util::stream_format(stream, "bc1f $%08x,%d", pc + 4 + ((int16_t)op << 2), (op >> 18) & 7); flags = STEP_COND | step_over_extra(1); break; + case 0x01: util::stream_format(stream, "bc1t $%08x,%d", pc + 4 + ((int16_t)op << 2), (op >> 18) & 7); flags = STEP_COND | step_over_extra(1); break; + case 0x02: util::stream_format(stream, "bc1fl $%08x,%d", pc + 4 + ((int16_t)op << 2), (op >> 18) & 7); flags = STEP_COND | step_over_extra(1); break; + case 0x03: util::stream_format(stream, "bc1tl $%08x,%d", pc + 4 + ((int16_t)op << 2), (op >> 18) & 7); flags = STEP_COND | step_over_extra(1); break; } break; default: /* COP */ @@ -298,8 +298,8 @@ case 0x01: /* REGIMM */ switch ((op >> 16) & 31) { - case 0x00: util::stream_format(stream, "bltz %s,$%08x", reg[rs], pc + 4 + ((int16_t)op << 2)); break; - case 0x01: util::stream_format(stream, "bgez %s,$%08x", reg[rs], pc + 4 + ((int16_t)op << 2)); break; + case 0x00: util::stream_format(stream, "bltz %s,$%08x", reg[rs], pc + 4 + ((int16_t)op << 2)); if (rs != 0) flags = STEP_COND | step_over_extra(1); break; + case 0x01: util::stream_format(stream, "bgez %s,$%08x", reg[rs], pc + 4 + ((int16_t)op << 2)); if (rs != 0) flags = STEP_COND | step_over_extra(1); break; case 0x02: util::stream_format(stream, "bltzl [invalid]"); break; case 0x03: util::stream_format(stream, "bgezl [invalid]"); break; case 0x08: util::stream_format(stream, "tgei [invalid]"); break; @@ -308,8 +308,8 @@ case 0x0b: util::stream_format(stream, "tltiu [invalid]"); break; case 0x0c: util::stream_format(stream, "teqi [invalid]"); break; case 0x0e: util::stream_format(stream, "tnei [invalid]"); break; - case 0x10: util::stream_format(stream, "bltzal %s,$%08x", reg[rs], pc + 4 + ((int16_t)op << 2)); flags = STEP_OVER | step_over_extra(1); break; - case 0x11: util::stream_format(stream, "bgezal %s,$%08x", reg[rs], pc + 4 + ((int16_t)op << 2)); flags = STEP_OVER | step_over_extra(1); break; + case 0x10: util::stream_format(stream, "bltzal %s,$%08x", reg[rs], pc + 4 + ((int16_t)op << 2)); if (rs != 0) flags = STEP_OVER | STEP_COND | step_over_extra(1); break; + case 0x11: util::stream_format(stream, "bgezal %s,$%08x", reg[rs], pc + 4 + ((int16_t)op << 2)); flags = STEP_OVER | (rs != 0 ? STEP_COND : 0) | step_over_extra(1); break; case 0x12: util::stream_format(stream, "bltzall [invalid]"); break; case 0x13: util::stream_format(stream, "bgezall [invalid]"); break; default: util::stream_format(stream, "dc.l $%08x [invalid]", op); break; @@ -321,11 +321,14 @@ case 0x04: if (rs == 0 && rt == 0) util::stream_format(stream, "b $%08x", pc + 4 + ((int16_t)op << 2)); else + { util::stream_format(stream, "beq %s,%s,$%08x", reg[rs], reg[rt], pc + 4 + ((int16_t)op << 2)); + flags = STEP_COND | step_over_extra(1); + } break; - case 0x05: util::stream_format(stream, "bne %s,%s,$%08x", reg[rs], reg[rt], pc + 4 + ((int16_t)op << 2));break; - case 0x06: util::stream_format(stream, "blez %s,$%08x", reg[rs], pc + 4 + ((int16_t)op << 2)); break; - case 0x07: util::stream_format(stream, "bgtz %s,$%08x", reg[rs], pc + 4 + ((int16_t)op << 2)); break; + case 0x05: util::stream_format(stream, "bne %s,%s,$%08x", reg[rs], reg[rt], pc + 4 + ((int16_t)op << 2)); flags = STEP_COND | step_over_extra(1); break; + case 0x06: util::stream_format(stream, "blez %s,$%08x", reg[rs], pc + 4 + ((int16_t)op << 2)); flags = STEP_COND | step_over_extra(1); break; + case 0x07: util::stream_format(stream, "bgtz %s,$%08x", reg[rs], pc + 4 + ((int16_t)op << 2)); flags = STEP_COND | step_over_extra(1); break; case 0x08: util::stream_format(stream, "addi %s,%s,%s", reg[rt], reg[rs], signed_16bit(op)); break; case 0x09: util::stream_format(stream, "addiu %s,%s,%s", reg[rt], reg[rs], signed_16bit(op)); break; case 0x0a: util::stream_format(stream, "slti %s,%s,%s", reg[rt], reg[rs], signed_16bit(op)); break; diff -Nru mame-0.242+dfsg.1/src/devices/cpu/mips/mips3.cpp mame-0.243+dfsg.1/src/devices/cpu/mips/mips3.cpp --- mame-0.242+dfsg.1/src/devices/cpu/mips/mips3.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/mips/mips3.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -9,7 +9,6 @@ ***************************************************************************/ #include "emu.h" -#include "debugger.h" #include "mips3.h" #include "mips3com.h" #include "mips3dsm.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/mips/mips3drc.cpp mame-0.243+dfsg.1/src/devices/cpu/mips/mips3drc.cpp --- mame-0.242+dfsg.1/src/devices/cpu/mips/mips3drc.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/mips/mips3drc.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -24,7 +24,6 @@ ***************************************************************************/ #include "emu.h" -#include "debugger.h" #include "mips3com.h" #include "mips3fe.h" #include "mips3dsm.h" @@ -34,6 +33,11 @@ #include "cpu/drcumlsh.h" +/* Use with STRICT_VERIFY to print debug info to console for extra validation checks */ +/* Set to 1 to activate and use MIPS3DRC_STRICT_VERIFY in the drc options */ +#define DEBUG_STRICT_VERIFY 0 + + /*************************************************************************** MACROS ***************************************************************************/ @@ -157,6 +161,15 @@ } /*------------------------------------------------- + mips3drc_get_options - return current DRC options +-------------------------------------------------*/ + +uint32_t mips3_device::mips3drc_get_options() +{ + return m_drcoptions; +} + +/*------------------------------------------------- mips3drc_clears_fastram - clears fastram region starting at index select_start -------------------------------------------------*/ @@ -283,6 +296,7 @@ { compiler_state compiler = { 0 }; const opcode_desc *seqhead, *seqlast; + const opcode_desc *codelast; const opcode_desc *desclist; bool override = false; @@ -290,6 +304,8 @@ /* get a description of this sequence */ desclist = m_drcfe->describe_code(pc); + /* get last instruction of the code (potentially used in generate_checksum) */ + codelast = m_drcfe->get_last(); if (m_drcuml->logging() || m_drcuml->logging_native()) log_opcode_desc(desclist, 0); @@ -341,7 +357,7 @@ /* validate this code block if we're not pointing into ROM */ if (m_program->get_write_ptr(seqhead->physpc) != nullptr) - generate_checksum_block(block, compiler, seqhead, seqlast); + generate_checksum_block(block, compiler, seqhead, seqlast, codelast); /* label this instruction, if it may be jumped to locally */ if (seqhead->flags & OPFLAG_IS_BRANCH_TARGET) @@ -1098,7 +1114,7 @@ validate a sequence of opcodes -------------------------------------------------*/ -void mips3_device::generate_checksum_block(drcuml_block &block, compiler_state &compiler, const opcode_desc *seqhead, const opcode_desc *seqlast) +void mips3_device::generate_checksum_block(drcuml_block &block, compiler_state &compiler, const opcode_desc *seqhead, const opcode_desc *seqlast, const opcode_desc *codelast) { const opcode_desc *curdesc; if (m_drcuml->logging()) @@ -1147,35 +1163,130 @@ #else uint32_t sum = 0; const void *base = m_prptr(seqhead->physpc); - uint32_t low_bits = (seqhead->physpc & (m_data_bits == 64 ? 4 : 0)) ^ m_dword_xor; + const uint32_t data_bits_mask = (m_data_bits == 64 ? 4 : 0); + const uint32_t last_physpc = codelast->physpc; + uint32_t low_bits = (seqhead->physpc & data_bits_mask) ^ m_dword_xor; UML_LOAD(block, I0, base, low_bits, SIZE_DWORD, SCALE_x1); // load i0,base,0,dword sum += seqhead->opptr.l[0]; - for (curdesc = seqhead->next(); curdesc != seqlast->next(); curdesc = curdesc->next()) + if ((m_drcoptions & MIPS3DRC_EXTRA_INSTR_CHECK) && !(codelast->flags & OPFLAG_VIRTUAL_NOOP) && last_physpc != seqhead->physpc) { - if (!(curdesc->flags & OPFLAG_VIRTUAL_NOOP)) + base = m_prptr(last_physpc); + assert(base != nullptr); + low_bits = (last_physpc & data_bits_mask) ^ m_dword_xor; + UML_LOAD(block, I1, base, low_bits, SIZE_DWORD, SCALE_x1); // load i1,base,dword + UML_ADD(block, I0, I0, I1); // add i0,i0,i1 + sum += codelast->opptr.l[0]; + } + if (!(m_drcoptions & MIPS3DRC_EXTRA_INSTR_CHECK)) + { + for (curdesc = seqhead->next(); curdesc != seqlast->next(); curdesc = curdesc->next()) { - base = m_prptr(curdesc->physpc); - assert(base != nullptr); - uint32_t low_bits = (curdesc->physpc & (m_data_bits == 64 ? 4 : 0)) ^ m_dword_xor; - UML_LOAD(block, I1, base, low_bits, SIZE_DWORD, SCALE_x1); // load i1,base,dword - UML_ADD(block, I0, I0, I1); // add i0,i0,i1 - sum += curdesc->opptr.l[0]; - - if (curdesc->delay.first() != nullptr - && !(curdesc->delay.first()->flags & OPFLAG_VIRTUAL_NOOP) - && (curdesc == seqlast || (curdesc->next() != nullptr && curdesc->next()->physpc != curdesc->delay.first()->physpc))) + if (!(curdesc->flags & OPFLAG_VIRTUAL_NOOP)) { - base = m_prptr(curdesc->delay.first()->physpc); + base = m_prptr(curdesc->physpc); assert(base != nullptr); - uint32_t low_bits = (curdesc->delay.first()->physpc & (m_data_bits == 64 ? 4 : 0)) ^ m_dword_xor; - UML_LOAD(block, I1, base, low_bits, SIZE_DWORD, SCALE_x1); // load i1,base,dword - UML_ADD(block, I0, I0, I1); // add i0,i0,i1 - sum += curdesc->delay.first()->opptr.l[0]; + low_bits = (curdesc->physpc & data_bits_mask) ^ m_dword_xor; + UML_LOAD(block, I1, base, low_bits, SIZE_DWORD, SCALE_x1); // load i1,base,dword + UML_ADD(block, I0, I0, I1); // add i0,i0,i1 + sum += curdesc->opptr.l[0]; + + if (curdesc->delay.first() != nullptr + && !(curdesc->delay.first()->flags & OPFLAG_VIRTUAL_NOOP) + && (curdesc == seqlast || (curdesc->next() != nullptr && curdesc->next()->physpc != curdesc->delay.first()->physpc))) + { + base = m_prptr(curdesc->delay.first()->physpc); + assert(base != nullptr); + low_bits = (curdesc->delay.first()->physpc & data_bits_mask) ^ m_dword_xor; + UML_LOAD(block, I1, base, low_bits, SIZE_DWORD, SCALE_x1); // load i1,base,dword + UML_ADD(block, I0, I0, I1); // add i0,i0,i1 + sum += curdesc->delay.first()->opptr.l[0]; + } + } + } + } + else + { + for (curdesc = seqhead->next(); curdesc != seqlast->next(); curdesc = curdesc->next()) + { + if (!(curdesc->flags & OPFLAG_VIRTUAL_NOOP)) + { + // Skip the last if it was already included above + if (curdesc->physpc != last_physpc) + { + base = m_prptr(curdesc->physpc); + assert(base != nullptr); + low_bits = (curdesc->physpc & data_bits_mask) ^ m_dword_xor; + UML_LOAD(block, I1, base, low_bits, SIZE_DWORD, SCALE_x1); // load i1,base,dword + UML_ADD(block, I0, I0, I1); // add i0,i0,i1 + sum += curdesc->opptr.l[0]; + } + + if (curdesc->delay.first() != nullptr + && !(curdesc->delay.first()->flags & OPFLAG_VIRTUAL_NOOP) + && (curdesc == seqlast || (curdesc->next() != nullptr && curdesc->next()->physpc != curdesc->delay.first()->physpc))) + { + base = m_prptr(curdesc->delay.first()->physpc); + assert(base != nullptr); + low_bits = (curdesc->delay.first()->physpc & data_bits_mask) ^ m_dword_xor; + UML_LOAD(block, I1, base, low_bits, SIZE_DWORD, SCALE_x1); // load i1,base,dword + UML_ADD(block, I0, I0, I1); // add i0,i0,i1 + sum += curdesc->delay.first()->opptr.l[0]; + } } } } UML_CMP(block, I0, sum); // cmp i0,sum UML_EXHc(block, COND_NE, *m_nocode, epc(seqhead)); // exne nocode,seqhead->pc + if (DEBUG_STRICT_VERIFY) + { + // This code will do additional checks on the last instruction and last delay slot and indicate if the check failed + uml::code_label check_second = compiler.labelnum++; + uml::code_label check_failed = compiler.labelnum++; + uml::code_label check_passed = compiler.labelnum++; + // Check the last instruction + if (!(codelast->flags & OPFLAG_VIRTUAL_NOOP) && last_physpc != seqhead->physpc) + { + base = m_prptr(last_physpc); + assert(base != nullptr); + low_bits = (last_physpc & (m_data_bits == 64 ? 4 : 0)) ^ m_dword_xor; + UML_LOAD(block, I0, base, low_bits, SIZE_DWORD, SCALE_x1); // load i1,base,dword + sum = codelast->opptr.l[0]; + UML_CMP(block, I0, sum); // cmp i0,sum + UML_JMPc(block, COND_E, check_second); + static const char text[] = "Last instr validation fail seq: %08X end: %08x\n"; + UML_DMOV(block, mem(&m_core->format), (uintptr_t)text); // mov [format],text + UML_MOV(block, mem(&m_core->arg0), seqhead->pc); + UML_MOV(block, mem(&m_core->arg1), last_physpc); // mov [arg0],desc->pc + UML_CALLC(block, cfunc_printf_debug, this); // callc printf_debug + //UML_CALLC(block, cfunc_debug_break, this); + // Skip delay slot check + UML_JMP(block, check_failed); + // Check the last instruction delay slot + UML_LABEL(block, check_second); + if (codelast->delay.first() != nullptr && !(codelast->delay.first()->flags & OPFLAG_VIRTUAL_NOOP) + && last_physpc != seqhead->physpc) + { + base = m_prptr(codelast->delay.first()->physpc); + assert(base != nullptr); + low_bits = (codelast->delay.first()->physpc & (m_data_bits == 64 ? 4 : 0)) ^ m_dword_xor; + UML_LOAD(block, I0, base, low_bits, SIZE_DWORD, SCALE_x1); // load i1,base,dword + sum = codelast->delay.first()->opptr.l[0]; + UML_CMP(block, I0, sum); // cmp i0,sum + UML_JMPc(block, COND_E, check_passed); + static const char text[] = "Last delay slot validation fail seq: %08X end: %08x\n"; + UML_DMOV(block, mem(&m_core->format), (uintptr_t)text); // mov [format],text + UML_MOV(block, mem(&m_core->arg0), seqhead->pc); + UML_MOV(block, mem(&m_core->arg1), last_physpc); // mov [arg0],desc->pc + UML_CALLC(block, cfunc_printf_debug, this); // callc printf_debug + //UML_CALLC(block, cfunc_debug_break, this); + UML_JMP(block, check_failed); + } + } + UML_JMP(block, check_passed); + UML_LABEL(block, check_failed); + UML_EXH(block, *m_nocode, epc(seqhead)); // exne nocode,seqhead->pc + UML_LABEL(block, check_passed); + } #endif } } @@ -1188,22 +1299,19 @@ void mips3_device::generate_sequence_instruction(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc) { - offs_t expc; - int hotnum; - /* add an entry for the log */ if (m_drcuml->logging() && !(desc->flags & OPFLAG_VIRTUAL_NOOP)) log_add_disasm_comment(block, desc->pc, desc->opptr.l[0]); /* set the PC map variable */ - expc = (desc->flags & OPFLAG_IN_DELAY_SLOT) ? desc->pc - 3 : desc->pc; + offs_t expc = (desc->flags & OPFLAG_IN_DELAY_SLOT) ? desc->pc - 3 : desc->pc; UML_MAPVAR(block, MAPVAR_PC, expc); // mapvar PC,expc /* accumulate total cycles */ compiler.cycles += desc->cycles; /* is this a hotspot? */ - for (hotnum = 0; hotnum < MIPS3_MAX_HOTSPOTS; hotnum++) + for (int hotnum = 0; hotnum < MIPS3_MAX_HOTSPOTS; hotnum++) if (m_hotspot[hotnum].pc != 0 && desc->pc == m_hotspot[hotnum].pc && desc->opptr.l[0] == m_hotspot[hotnum].opcode) { compiler.cycles += m_hotspot[hotnum].cycles; @@ -1335,7 +1443,7 @@ if (desc->targetpc != BRANCH_TARGET_DYNAMIC) { generate_update_cycles(block, compiler_temp, desc->targetpc, true); // - if (!(m_drcoptions & MIPS3DRC_DISABLE_INTRABLOCK) && desc->flags & OPFLAG_INTRABLOCK_BRANCH) + if (!(m_drcoptions & MIPS3DRC_DISABLE_INTRABLOCK) && (desc->flags & OPFLAG_INTRABLOCK_BRANCH)) { UML_JMP(block, desc->targetpc | 0x80000000); // jmp desc->targetpc | 0x80000000 } diff -Nru mame-0.242+dfsg.1/src/devices/cpu/mips/mips3dsm.cpp mame-0.243+dfsg.1/src/devices/cpu/mips/mips3dsm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/mips/mips3dsm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/mips/mips3dsm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -147,8 +147,8 @@ case 0x08: /* BC */ switch (rt) { - case 0x00: util::stream_format(stream, "bc0f $%08x", pc + 4 + ((int16_t)op << 2)); break; - case 0x01: util::stream_format(stream, "bc0t $%08x", pc + 4 + ((int16_t)op << 2)); break; + case 0x00: util::stream_format(stream, "bc0f $%08x", pc + 4 + ((int16_t)op << 2)); flags = STEP_COND | step_over_extra(1); break; + case 0x01: util::stream_format(stream, "bc0t $%08x", pc + 4 + ((int16_t)op << 2)); flags = STEP_COND | step_over_extra(1); break; case 0x02: util::stream_format(stream, "bc0fl [invalid]"); break; case 0x03: util::stream_format(stream, "bc0tl [invalid]"); break; default: util::stream_format(stream, "dc.l $%08x [invalid]", op); break; @@ -218,10 +218,10 @@ case 0x08: /* BC */ switch (rt & 3) { - case 0x00: util::stream_format(stream, "bc1f $%08x,%d", pc + 4 + ((int16_t)op << 2), (op >> 18) & 7); break; - case 0x01: util::stream_format(stream, "bc1t $%08x,%d", pc + 4 + ((int16_t)op << 2), (op >> 18) & 7); break; - case 0x02: util::stream_format(stream, "bc1fl $%08x,%d", pc + 4 + ((int16_t)op << 2), (op >> 18) & 7); flags = STEP_OVER | step_over_extra(1); break; - case 0x03: util::stream_format(stream, "bc1tl $%08x,%d", pc + 4 + ((int16_t)op << 2), (op >> 18) & 7); flags = STEP_OVER | step_over_extra(1); break; + case 0x00: util::stream_format(stream, "bc1f $%08x,%d", pc + 4 + ((int16_t)op << 2), (op >> 18) & 7); flags = STEP_COND | step_over_extra(1); break; + case 0x01: util::stream_format(stream, "bc1t $%08x,%d", pc + 4 + ((int16_t)op << 2), (op >> 18) & 7); flags = STEP_COND | step_over_extra(1); break; + case 0x02: util::stream_format(stream, "bc1fl $%08x,%d", pc + 4 + ((int16_t)op << 2), (op >> 18) & 7); flags = STEP_COND | step_over_extra(1); break; + case 0x03: util::stream_format(stream, "bc1tl $%08x,%d", pc + 4 + ((int16_t)op << 2), (op >> 18) & 7); flags = STEP_COND | step_over_extra(1); break; } break; default: /* COP */ @@ -358,8 +358,8 @@ case 0x08: /* BC */ switch (rt) { - case 0x00: util::stream_format(stream, "bc2f $%08x", pc + 4 + ((int16_t)op << 2)); break; - case 0x01: util::stream_format(stream, "bc2t $%08x", pc + 4 + ((int16_t)op << 2)); break; + case 0x00: util::stream_format(stream, "bc2f $%08x", pc + 4 + ((int16_t)op << 2)); flags = STEP_COND | step_over_extra(1); break; + case 0x01: util::stream_format(stream, "bc2t $%08x", pc + 4 + ((int16_t)op << 2)); flags = STEP_COND | step_over_extra(1); break; case 0x02: util::stream_format(stream, "bc2fl [invalid]"); break; case 0x03: util::stream_format(stream, "bc2tl [invalid]"); break; default: util::stream_format(stream, "dc.l $%08x [invalid]", op); break; @@ -954,20 +954,20 @@ case 0x01: /* REGIMM */ switch ((op >> 16) & 31) { - case 0x00: util::stream_format(stream, "bltz %s,$%08x", reg[rs], pc + 4 + ((int16_t)op << 2)); break; - case 0x01: util::stream_format(stream, "bgez %s,$%08x", reg[rs], pc + 4 + ((int16_t)op << 2)); break; - case 0x02: util::stream_format(stream, "bltzl %s,$%08x", reg[rs], pc + 4 + ((int16_t)op << 2)); break; - case 0x03: util::stream_format(stream, "bgezl %s,$%08x", reg[rs], pc + 4 + ((int16_t)op << 2)); break; - case 0x08: util::stream_format(stream, "tgei %s,%s", reg[rs], signed_16bit(op)); flags = STEP_OVER; break; - case 0x09: util::stream_format(stream, "tgeiu %s,%s", reg[rs], signed_16bit(op)); flags = STEP_OVER; break; - case 0x0a: util::stream_format(stream, "tlti %s,%s", reg[rs], signed_16bit(op)); flags = STEP_OVER; break; - case 0x0b: util::stream_format(stream, "tltiu %s,%s", reg[rs], signed_16bit(op)); flags = STEP_OVER; break; - case 0x0c: util::stream_format(stream, "teqi %s,%s", reg[rs], signed_16bit(op)); flags = STEP_OVER; break; - case 0x0e: util::stream_format(stream, "tnei %s,%s", reg[rs], signed_16bit(op)); flags = STEP_OVER; break; - case 0x10: util::stream_format(stream, "bltzal %s,$%08x", reg[rs], pc + 4 + ((int16_t)op << 2)); flags = STEP_OVER | step_over_extra(1); break; - case 0x11: util::stream_format(stream, "bgezal %s,$%08x", reg[rs], pc + 4 + ((int16_t)op << 2)); flags = STEP_OVER | step_over_extra(1); break; - case 0x12: util::stream_format(stream, "bltzall %s,$%08x", reg[rs], pc + 4 + ((int16_t)op << 2)); flags = STEP_OVER | step_over_extra(1); break; - case 0x13: util::stream_format(stream, "bgezall %s,$%08x", reg[rs], pc + 4 + ((int16_t)op << 2)); flags = STEP_OVER | step_over_extra(1); break; + case 0x00: util::stream_format(stream, "bltz %s,$%08x", reg[rs], pc + 4 + ((int16_t)op << 2)); if (rs != 0) flags = STEP_COND | step_over_extra(1); break; + case 0x01: util::stream_format(stream, "bgez %s,$%08x", reg[rs], pc + 4 + ((int16_t)op << 2)); if (rs != 0) flags = STEP_COND | step_over_extra(1); break; + case 0x02: util::stream_format(stream, "bltzl %s,$%08x", reg[rs], pc + 4 + ((int16_t)op << 2)); if (rs != 0) flags = STEP_COND | step_over_extra(1); break; + case 0x03: util::stream_format(stream, "bgezl %s,$%08x", reg[rs], pc + 4 + ((int16_t)op << 2)); if (rs != 0) flags = STEP_COND | step_over_extra(1); break; + case 0x08: util::stream_format(stream, "tgei %s,%s", reg[rs], signed_16bit(op)); flags = STEP_OVER | STEP_COND; break; + case 0x09: util::stream_format(stream, "tgeiu %s,%s", reg[rs], signed_16bit(op)); flags = STEP_OVER | STEP_COND; break; + case 0x0a: util::stream_format(stream, "tlti %s,%s", reg[rs], signed_16bit(op)); flags = STEP_OVER | STEP_COND; break; + case 0x0b: util::stream_format(stream, "tltiu %s,%s", reg[rs], signed_16bit(op)); flags = STEP_OVER | STEP_COND; break; + case 0x0c: util::stream_format(stream, "teqi %s,%s", reg[rs], signed_16bit(op)); flags = STEP_OVER | STEP_COND; break; + case 0x0e: util::stream_format(stream, "tnei %s,%s", reg[rs], signed_16bit(op)); flags = STEP_OVER | STEP_COND; break; + case 0x10: util::stream_format(stream, "bltzal %s,$%08x", reg[rs], pc + 4 + ((int16_t)op << 2)); if (rs != 0) flags = STEP_OVER | STEP_COND | step_over_extra(1); break; + case 0x11: util::stream_format(stream, "bgezal %s,$%08x", reg[rs], pc + 4 + ((int16_t)op << 2)); flags = STEP_OVER | (rs != 0 ? STEP_COND : 0) | step_over_extra(1); break; + case 0x12: util::stream_format(stream, "bltzall %s,$%08x", reg[rs], pc + 4 + ((int16_t)op << 2)); if (rs != 0) flags = STEP_OVER | STEP_COND | step_over_extra(1); break; + case 0x13: util::stream_format(stream, "bgezall %s,$%08x", reg[rs], pc + 4 + ((int16_t)op << 2)); flags = STEP_OVER | (rs != 0 ? STEP_COND : 0) | step_over_extra(1); break; default: flags = dasm_extra_regimm(pc, op, stream); break; } break; diff -Nru mame-0.242+dfsg.1/src/devices/cpu/mips/mips3.h mame-0.243+dfsg.1/src/devices/cpu/mips/mips3.h --- mame-0.242+dfsg.1/src/devices/cpu/mips/mips3.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/mips/mips3.h 2022-04-29 05:37:26.000000000 +0000 @@ -309,6 +309,7 @@ void add_fastram(offs_t start, offs_t end, uint8_t readonly, void *base); void clear_fastram(uint32_t select_start); void mips3drc_set_options(uint32_t options); + uint32_t mips3drc_get_options(); void mips3drc_add_hotspot(offs_t pc, uint32_t opcode, uint32_t cycles); protected: @@ -623,7 +624,7 @@ void generate_update_mode(drcuml_block &block); void generate_update_cycles(drcuml_block &block, compiler_state &compiler, uml::parameter param, bool allow_exception); - void generate_checksum_block(drcuml_block &block, compiler_state &compiler, const opcode_desc *seqhead, const opcode_desc *seqlast); + void generate_checksum_block(drcuml_block &block, compiler_state &compiler, const opcode_desc *seqhead, const opcode_desc *seqlast, const opcode_desc *codelast); void generate_sequence_instruction(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc); void generate_delay_slot_and_branch(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc, uint8_t linkreg); @@ -969,7 +970,6 @@ COMPILER-SPECIFIC OPTIONS ***************************************************************************/ -/* fix me -- how do we make this work?? */ #define MIPS3DRC_STRICT_VERIFY 0x0001 /* verify all instructions */ #define MIPS3DRC_STRICT_COP0 0x0002 /* validate all COP0 instructions */ #define MIPS3DRC_STRICT_COP1 0x0004 /* validate all COP1 instructions */ @@ -977,9 +977,9 @@ #define MIPS3DRC_DISABLE_INTRABLOCK 0x0010 /* disable intrablock branching */ #define MIPS3DRC_CHECK_OVERFLOWS 0x0020 /* actually check overflows on add/sub instructions */ #define MIPS3DRC_ACCURATE_DIVZERO 0x0040 /* load correct values into HI/LO on integer divide-by-zero */ +#define MIPS3DRC_EXTRA_INSTR_CHECK 0x0080 /* adds the last instruction value to all validation entry locations, used with STRICT_VERIFY */ #define MIPS3DRC_COMPATIBLE_OPTIONS (MIPS3DRC_STRICT_VERIFY | MIPS3DRC_STRICT_COP1 | MIPS3DRC_STRICT_COP0 | MIPS3DRC_STRICT_COP2) #define MIPS3DRC_FASTEST_OPTIONS (0) - #endif // MAME_CPU_MIPS_MIPS3_H diff -Nru mame-0.242+dfsg.1/src/devices/cpu/mips/ps2vu.cpp mame-0.243+dfsg.1/src/devices/cpu/mips/ps2vu.cpp --- mame-0.242+dfsg.1/src/devices/cpu/mips/ps2vu.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/mips/ps2vu.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -14,7 +14,6 @@ #include "video/ps2gif.h" #include "vudasm.h" -#include "debugger.h" DEFINE_DEVICE_TYPE(SONYPS2_VU0, sonyvu0_device, "sonyvu0", "Sony PlayStation 2 VU0") DEFINE_DEVICE_TYPE(SONYPS2_VU1, sonyvu1_device, "sonyvu1", "Sony PlayStation 2 VU1") diff -Nru mame-0.242+dfsg.1/src/devices/cpu/mips/r4000.cpp mame-0.243+dfsg.1/src/devices/cpu/mips/r4000.cpp --- mame-0.242+dfsg.1/src/devices/cpu/mips/r4000.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/mips/r4000.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -27,7 +27,7 @@ */ #include "emu.h" -#include "debugger.h" +#include "debug/debugcpu.h" #include "r4000.h" #include "mips3dsm.h" #include "unicode.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/mk1/mk1dasm.cpp mame-0.243+dfsg.1/src/devices/cpu/mk1/mk1dasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/mk1/mk1dasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/mk1/mk1dasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -48,7 +48,7 @@ // Conditional skip const u8 disp = BIT(uop, 0, 4); util::stream_format(stream, "%s %d ; $%03x", s_skips[BIT(uop, 4, 2)], disp, (pc + 1 + disp) & 0xfff); - return 1 | SUPPORTED; + return 1 | STEP_COND | SUPPORTED; } else if (uop >= 0xb0) { diff -Nru mame-0.242+dfsg.1/src/devices/cpu/mn10200/mn10200.cpp mame-0.243+dfsg.1/src/devices/cpu/mn10200/mn10200.cpp --- mame-0.242+dfsg.1/src/devices/cpu/mn10200/mn10200.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/mn10200/mn10200.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -9,7 +9,6 @@ */ #include "emu.h" -#include "debugger.h" #include "mn10200.h" #include "mn102dis.h" @@ -226,6 +225,17 @@ save_item(NAME(m_port[i].dir), i); } + // registering reads the value, so clear it before + m_pc = 0; + m_mdr = 0; + m_nmicr = 0; + m_iagr = 0; + for (int i=0; i != 4; i++) + { + m_d[i] = 0; + m_a[i] = 0; + } + // register for debugger state_add( MN10200_PC, "PC", m_pc ).mask(0xffffff).formatstr("%06X"); state_add( MN10200_MDR, "MDR", m_mdr).formatstr("%04X"); diff -Nru mame-0.242+dfsg.1/src/devices/cpu/mn10200/mn102dis.cpp mame-0.243+dfsg.1/src/devices/cpu/mn10200/mn102dis.cpp --- mame-0.242+dfsg.1/src/devices/cpu/mn10200/mn102dis.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/mn10200/mn102dis.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -157,43 +157,43 @@ case 0xe0: util::stream_format(stream, "blt $%x", (pc+2+(s8)opcodes.r8(pc+1)) & 0xffffff); - return 2 | SUPPORTED; + return 2 | STEP_COND | SUPPORTED; case 0xe1: util::stream_format(stream, "bgt $%x", (pc+2+(s8)opcodes.r8(pc+1)) & 0xffffff); - return 2 | SUPPORTED; + return 2 | STEP_COND | SUPPORTED; case 0xe2: util::stream_format(stream, "bge $%x", (pc+2+(s8)opcodes.r8(pc+1)) & 0xffffff); - return 2 | SUPPORTED; + return 2 | STEP_COND | SUPPORTED; case 0xe3: util::stream_format(stream, "ble $%x", (pc+2+(s8)opcodes.r8(pc+1)) & 0xffffff); - return 2 | SUPPORTED; + return 2 | STEP_COND | SUPPORTED; case 0xe4: util::stream_format(stream, "bcs $%x", (pc+2+(s8)opcodes.r8(pc+1)) & 0xffffff); - return 2 | SUPPORTED; + return 2 | STEP_COND | SUPPORTED; case 0xe5: util::stream_format(stream, "bhi $%x", (pc+2+(s8)opcodes.r8(pc+1)) & 0xffffff); - return 2 | SUPPORTED; + return 2 | STEP_COND | SUPPORTED; case 0xe6: util::stream_format(stream, "bcc $%x", (pc+2+(s8)opcodes.r8(pc+1)) & 0xffffff); - return 2 | SUPPORTED; + return 2 | STEP_COND | SUPPORTED; case 0xe7: util::stream_format(stream, "bls $%x", (pc+2+(s8)opcodes.r8(pc+1)) & 0xffffff); - return 2 | SUPPORTED; + return 2 | STEP_COND | SUPPORTED; case 0xe8: util::stream_format(stream, "beq $%x", (pc+2+(s8)opcodes.r8(pc+1)) & 0xffffff); - return 2 | SUPPORTED; + return 2 | STEP_COND | SUPPORTED; case 0xe9: util::stream_format(stream, "bne $%x", (pc+2+(s8)opcodes.r8(pc+1)) & 0xffffff); - return 2 | SUPPORTED; + return 2 | STEP_COND | SUPPORTED; case 0xea: util::stream_format(stream, "bra $%x", (pc+2+(s8)opcodes.r8(pc+1)) & 0xffffff); @@ -442,12 +442,12 @@ case 0xc0: case 0xc1: case 0xc2: case 0xc3: case 0xc4: case 0xc5: case 0xc6: case 0xc7: util::stream_format(stream, "tbz ($%x) %d, $%x", r24(opcodes, pc+3), opcode & 7, (pc+7+(s8)opcodes.r8(pc+6)) & 0xffffff); - return 7 | SUPPORTED; + return 7 | STEP_COND | SUPPORTED; case 0xc8: case 0xc9: case 0xca: case 0xcb: case 0xcc: case 0xcd: case 0xce: case 0xcf: util::stream_format(stream, "tbnz ($%x) %d, $%x", r24(opcodes, pc+3), opcode & 7, (pc+7+(s8)opcodes.r8(pc+6)) & 0xffffff); - return 7 | SUPPORTED; + return 7 | STEP_COND | SUPPORTED; case 0xd0: case 0xd1: case 0xd2: case 0xd3: case 0xd4: case 0xd5: case 0xd6: case 0xd7: util::stream_format(stream, "bset ($%x) %d", r24(opcodes, pc+2), opcode & 7); @@ -469,7 +469,7 @@ case 0x88: case 0x89: case 0x8a: case 0x8b: case 0x8c: case 0x8d: case 0x8e: case 0x8f: util::stream_format(stream, "tbz (%s, a%d) %d, $%x", i8str(opcodes.r8(pc+3)), 2+((opcode>>3)&1), opcode & 7, (pc+5+(s8)opcodes.r8(pc+4)) & 0xffffff); - return 5 | SUPPORTED; + return 5 | STEP_COND | SUPPORTED; case 0x90: case 0x91: case 0x92: case 0x93: case 0x94: case 0x95: case 0x96: case 0x97: case 0x98: case 0x99: case 0x9a: case 0x9b: case 0x9c: case 0x9d: case 0x9e: case 0x9f: @@ -480,7 +480,7 @@ case 0xa8: case 0xa9: case 0xaa: case 0xab: case 0xac: case 0xad: case 0xae: case 0xaf: util::stream_format(stream, "tbnz (%s, a%d) %d, $%x", i8str(opcodes.r8(pc+3)), 2+((opcode>>3)&1), opcode & 7, (pc+5+(s8)opcodes.r8(pc+4)) & 0xffffff); - return 5 | SUPPORTED; + return 5 | STEP_COND | SUPPORTED; case 0xb0: case 0xb1: case 0xb2: case 0xb3: case 0xb4: case 0xb5: case 0xb6: case 0xb7: case 0xb8: case 0xb9: case 0xba: case 0xbb: case 0xbc: case 0xbd: case 0xbe: case 0xbf: @@ -723,7 +723,7 @@ case 0x88: case 0x89: case 0x8a: case 0x8b: case 0x8c: case 0x8d: case 0x8e: case 0x8f: util::stream_format(stream, "tbz (%s, a%d) %d, $%x", i8str(opcodes.r8(pc+2)), (opcode>>3)&1, opcode & 7, (pc+4+(s8)opcodes.r8(pc+3)) & 0xffffff); - return 4 | SUPPORTED; + return 4 | STEP_COND | SUPPORTED; case 0x90: case 0x91: case 0x92: case 0x93: case 0x94: case 0x95: case 0x96: case 0x97: case 0x98: case 0x99: case 0x9a: case 0x9b: case 0x9c: case 0x9d: case 0x9e: case 0x9f: @@ -734,7 +734,7 @@ case 0xa8: case 0xa9: case 0xaa: case 0xab: case 0xac: case 0xad: case 0xae: case 0xaf: util::stream_format(stream, "tbnz (%s, a%d) %d, $%x", i8str(opcodes.r8(pc+2)), (opcode>>3)&1, opcode & 7, (pc+4+(s8)opcodes.r8(pc+3)) & 0xffffff); - return 4 | SUPPORTED; + return 4 | STEP_COND | SUPPORTED; case 0xb0: case 0xb1: case 0xb2: case 0xb3: case 0xb4: case 0xb5: case 0xb6: case 0xb7: case 0xb8: case 0xb9: case 0xba: case 0xbb: case 0xbc: case 0xbd: case 0xbe: case 0xbf: @@ -744,12 +744,12 @@ case 0xc0: case 0xc1: case 0xc2: case 0xc3: case 0xc4: case 0xc5: case 0xc6: case 0xc7: util::stream_format(stream, "tbz ($%x) %d, $%x", opcodes.r16(pc+2), opcode & 7, (pc+5+(s8)opcodes.r8(pc+4)) & 0xffffff); - return 5 | SUPPORTED; + return 5 | STEP_COND | SUPPORTED; case 0xc8: case 0xc9: case 0xca: case 0xcb: case 0xcc: case 0xcd: case 0xce: case 0xcf: util::stream_format(stream, "tbnz ($%x) %d, $%x", opcodes.r16(pc+2), opcode & 7, (pc+5+(s8)opcodes.r8(pc+4)) & 0xffffff); - return 5 | SUPPORTED; + return 5 | STEP_COND | SUPPORTED; case 0xd0: case 0xd1: case 0xd2: case 0xd3: case 0xd4: case 0xd5: case 0xd6: case 0xd7: util::stream_format(stream, "bset ($%x) %d", opcodes.r16(pc+2), opcode & 7); @@ -761,59 +761,59 @@ case 0xe0: util::stream_format(stream, "bltx $%x", (pc+3+s8(opcodes.r8(pc+2))) & 0xffffff); - return 3 | SUPPORTED; + return 3 | STEP_COND | SUPPORTED; case 0xe1: util::stream_format(stream, "bgtx $%x", (pc+3+s8(opcodes.r8(pc+2))) & 0xffffff); - return 3 | SUPPORTED; + return 3 | STEP_COND | SUPPORTED; case 0xe2: util::stream_format(stream, "bgex $%x", (pc+3+s8(opcodes.r8(pc+2))) & 0xffffff); - return 3 | SUPPORTED; + return 3 | STEP_COND | SUPPORTED; case 0xe3: util::stream_format(stream, "blex $%x", (pc+3+s8(opcodes.r8(pc+2))) & 0xffffff); - return 3 | SUPPORTED; + return 3 | STEP_COND | SUPPORTED; case 0xe4: util::stream_format(stream, "bcsx $%x", (pc+3+s8(opcodes.r8(pc+2))) & 0xffffff); - return 3 | SUPPORTED; + return 3 | STEP_COND | SUPPORTED; case 0xe5: util::stream_format(stream, "bhix $%x", (pc+3+s8(opcodes.r8(pc+2))) & 0xffffff); - return 3 | SUPPORTED; + return 3 | STEP_COND | SUPPORTED; case 0xe6: util::stream_format(stream, "bccx $%x", (pc+3+s8(opcodes.r8(pc+2))) & 0xffffff); - return 3 | SUPPORTED; + return 3 | STEP_COND | SUPPORTED; case 0xe7: util::stream_format(stream, "blsx $%x", (pc+3+s8(opcodes.r8(pc+2))) & 0xffffff); - return 3 | SUPPORTED; + return 3 | STEP_COND | SUPPORTED; case 0xe8: util::stream_format(stream, "beqx $%x", (pc+3+s8(opcodes.r8(pc+2))) & 0xffffff); - return 3 | SUPPORTED; + return 3 | STEP_COND | SUPPORTED; case 0xe9: util::stream_format(stream, "bnex $%x", (pc+3+s8(opcodes.r8(pc+2))) & 0xffffff); - return 3 | SUPPORTED; + return 3 | STEP_COND | SUPPORTED; case 0xec: util::stream_format(stream, "bvcx $%x", (pc+3+s8(opcodes.r8(pc+2))) & 0xffffff); - return 3 | SUPPORTED; + return 3 | STEP_COND | SUPPORTED; case 0xed: util::stream_format(stream, "bvsx $%x", (pc+3+s8(opcodes.r8(pc+2))) & 0xffffff); - return 3 | SUPPORTED; + return 3 | STEP_COND | SUPPORTED; case 0xee: util::stream_format(stream, "bncx $%x", (pc+3+s8(opcodes.r8(pc+2))) & 0xffffff); - return 3 | SUPPORTED; + return 3 | STEP_COND | SUPPORTED; case 0xef: util::stream_format(stream, "bnsx $%x", (pc+3+s8(opcodes.r8(pc+2))) & 0xffffff); - return 3 | SUPPORTED; + return 3 | STEP_COND | SUPPORTED; case 0xf0: case 0xf1: case 0xf2: case 0xf3: case 0xf4: case 0xf5: case 0xf6: case 0xf7: { @@ -843,19 +843,19 @@ case 0xfc: util::stream_format(stream, "bvc $%x", (pc+3+s8(opcodes.r8(pc+2))) & 0xffffff); - return 3 | SUPPORTED; + return 3 | STEP_COND | SUPPORTED; case 0xfd: util::stream_format(stream, "bvs $%x", (pc+3+s8(opcodes.r8(pc+2))) & 0xffffff); - return 3 | SUPPORTED; + return 3 | STEP_COND | SUPPORTED; case 0xfe: util::stream_format(stream, "bnc $%x", (pc+3+s8(opcodes.r8(pc+2))) & 0xffffff); - return 3 | SUPPORTED; + return 3 | STEP_COND | SUPPORTED; case 0xff: util::stream_format(stream, "bns $%x", (pc+3+s8(opcodes.r8(pc+2))) & 0xffffff); - return 3 | SUPPORTED; + return 3 | STEP_COND | SUPPORTED; default: goto illegal2; diff -Nru mame-0.242+dfsg.1/src/devices/cpu/mn1880/mn1880d.cpp mame-0.243+dfsg.1/src/devices/cpu/mn1880/mn1880d.cpp --- mame-0.242+dfsg.1/src/devices/cpu/mn1880/mn1880d.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/mn1880/mn1880d.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -252,6 +252,7 @@ stream << ", "; format_rel(stream, pc + 1, opcodes.r8(pc)); ++pc; + flags |= STEP_COND; } } else if (opcode < 0x34) @@ -416,6 +417,8 @@ util::stream_format(stream, "%s, ", BIT(opcode, 1) ? "yp" : "xp"); format_rel(stream, pc + 1, opcodes.r8(pc)); ++pc; + if ((opcode & 0xf7) != 0x80) + flags |= STEP_COND; } } else if (opcode < 0xb0) @@ -439,6 +442,7 @@ stream << ", "; format_rel(stream, pc + 1, opcodes.r8(pc)); ++pc; + flags |= STEP_COND; } } else @@ -543,6 +547,7 @@ stream << ", "; format_rel(stream, pc + 1, opcodes.r8(pc)); ++pc; + flags |= STEP_COND; } else if ((opcode & 0xf7) == 0xf2) { diff -Nru mame-0.242+dfsg.1/src/devices/cpu/nanoprocessor/nanoprocessor.cpp mame-0.243+dfsg.1/src/devices/cpu/nanoprocessor/nanoprocessor.cpp --- mame-0.242+dfsg.1/src/devices/cpu/nanoprocessor/nanoprocessor.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/nanoprocessor/nanoprocessor.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -4,7 +4,6 @@ #include "emu.h" #include "nanoprocessor.h" #include "nanoprocessor_dasm.h" -#include "debugger.h" // Index of state variables enum { diff -Nru mame-0.242+dfsg.1/src/devices/cpu/nanoprocessor/nanoprocessor_dasm.cpp mame-0.243+dfsg.1/src/devices/cpu/nanoprocessor/nanoprocessor_dasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/nanoprocessor/nanoprocessor_dasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/nanoprocessor/nanoprocessor_dasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -57,23 +57,23 @@ {0xff, 0x05, "CMA", nullptr, 1}, {0xff, 0x06, "RSA", nullptr, 1}, {0xff, 0x07, "LSA", nullptr, 1}, - {0xff, 0x08, "SGT", nullptr, 1}, - {0xff, 0x09, "SLT", nullptr, 1}, - {0xff, 0x0a, "SEQ", nullptr, 1}, - {0xff, 0x0b, "SAZ", nullptr, 1}, - {0xff, 0x0c, "SLE", nullptr, 1}, - {0xff, 0x0d, "SGE", nullptr, 1}, - {0xff, 0x0e, "SNE", nullptr, 1}, - {0xff, 0x0f, "SAN", nullptr, 1}, - {0xf8, 0x10, "SBS", &hp_nanoprocessor_disassembler::param_bitno, 1}, - {0xff, 0x1f, "SES", nullptr, 1}, - {0xf8, 0x18, "SFS", &hp_nanoprocessor_disassembler::param_bitno, 1}, - {0xf8, 0x20, "SBN", &hp_nanoprocessor_disassembler::param_bitno, 1}, + {0xff, 0x08, "SGT", nullptr, 1 | STEP_COND}, + {0xff, 0x09, "SLT", nullptr, 1 | STEP_COND}, + {0xff, 0x0a, "SEQ", nullptr, 1 | STEP_COND}, + {0xff, 0x0b, "SAZ", nullptr, 1 | STEP_COND}, + {0xff, 0x0c, "SLE", nullptr, 1 | STEP_COND}, + {0xff, 0x0d, "SGE", nullptr, 1 | STEP_COND}, + {0xff, 0x0e, "SNE", nullptr, 1 | STEP_COND}, + {0xff, 0x0f, "SAN", nullptr, 1 | STEP_COND}, + {0xf8, 0x10, "SBS", &hp_nanoprocessor_disassembler::param_bitno, 1 | STEP_COND}, + {0xff, 0x1f, "SES", nullptr, 1 | STEP_COND}, + {0xf8, 0x18, "SFS", &hp_nanoprocessor_disassembler::param_bitno, 1 | STEP_COND}, + {0xf8, 0x20, "SBN", &hp_nanoprocessor_disassembler::param_bitno, 1 | STEP_COND}, {0xff, 0x2f, "ENI", nullptr, 1}, {0xf8, 0x28, "STC", &hp_nanoprocessor_disassembler::param_bitno, 1}, - {0xf8, 0x30, "SBZ", &hp_nanoprocessor_disassembler::param_bitno, 1}, - {0xff, 0x3f, "SEZ", nullptr, 1}, - {0xf8, 0x38, "SFZ", &hp_nanoprocessor_disassembler::param_bitno, 1}, + {0xf8, 0x30, "SBZ", &hp_nanoprocessor_disassembler::param_bitno, 1 | STEP_COND}, + {0xff, 0x3f, "SEZ", nullptr, 1 | STEP_COND}, + {0xf8, 0x38, "SFZ", &hp_nanoprocessor_disassembler::param_bitno, 1 | STEP_COND}, {0xf0, 0x40, "INA", &hp_nanoprocessor_disassembler::param_ds, 1}, {0xff, 0x5f, "NOP", nullptr, 1}, {0xf0, 0x50, "OTA", &hp_nanoprocessor_disassembler::param_ds, 1}, diff -Nru mame-0.242+dfsg.1/src/devices/cpu/nec/nec.cpp mame-0.243+dfsg.1/src/devices/cpu/nec/nec.cpp --- mame-0.242+dfsg.1/src/devices/cpu/nec/nec.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/nec/nec.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -108,8 +108,6 @@ #include "nec.h" #include "necdasm.h" -#include "debugger.h" - typedef uint8_t BOOLEAN; typedef uint8_t BYTE; typedef uint16_t WORD; diff -Nru mame-0.242+dfsg.1/src/devices/cpu/nec/necdasm.cpp mame-0.243+dfsg.1/src/devices/cpu/nec/necdasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/nec/necdasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/nec/necdasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -132,22 +132,22 @@ {"outmb", 0, 0, 0, 0 }, {"outmw", 0, 0, 0, 0 }, // 0x70 - {"bv", 0, PARAM_REL8, 0, 0 }, - {"bnv", 0, PARAM_REL8, 0, 0 }, - {"bc", 0, PARAM_REL8, 0, 0 }, - {"bnc", 0, PARAM_REL8, 0, 0 }, - {"be", 0, PARAM_REL8, 0, 0 }, - {"bne", 0, PARAM_REL8, 0, 0 }, - {"bnh", 0, PARAM_REL8, 0, 0 }, - {"bh", 0, PARAM_REL8, 0, 0 }, - {"bn", 0, PARAM_REL8, 0, 0 }, - {"bp", 0, PARAM_REL8, 0, 0 }, - {"bpe", 0, PARAM_REL8, 0, 0 }, - {"bpo", 0, PARAM_REL8, 0, 0 }, - {"blt", 0, PARAM_REL8, 0, 0 }, - {"bge", 0, PARAM_REL8, 0, 0 }, - {"ble", 0, PARAM_REL8, 0, 0 }, - {"bgt", 0, PARAM_REL8, 0, 0 }, + {"bv", 0, PARAM_REL8, 0, 0, STEP_COND}, + {"bnv", 0, PARAM_REL8, 0, 0, STEP_COND}, + {"bc", 0, PARAM_REL8, 0, 0, STEP_COND}, + {"bnc", 0, PARAM_REL8, 0, 0, STEP_COND}, + {"be", 0, PARAM_REL8, 0, 0, STEP_COND}, + {"bne", 0, PARAM_REL8, 0, 0, STEP_COND}, + {"bnh", 0, PARAM_REL8, 0, 0, STEP_COND}, + {"bh", 0, PARAM_REL8, 0, 0, STEP_COND}, + {"bn", 0, PARAM_REL8, 0, 0, STEP_COND}, + {"bp", 0, PARAM_REL8, 0, 0, STEP_COND}, + {"bpe", 0, PARAM_REL8, 0, 0, STEP_COND}, + {"bpo", 0, PARAM_REL8, 0, 0, STEP_COND}, + {"blt", 0, PARAM_REL8, 0, 0, STEP_COND}, + {"bge", 0, PARAM_REL8, 0, 0, STEP_COND}, + {"ble", 0, PARAM_REL8, 0, 0, STEP_COND}, + {"bgt", 0, PARAM_REL8, 0, 0, STEP_COND}, // 0x80 {"immb", GROUP, 0, 0, 0 }, {"immw", GROUP, 0, 0, 0 }, @@ -231,7 +231,7 @@ {"retf", 0, 0, 0, 0, STEP_OUT}, {"brk 3", 0, 0, 0, 0, STEP_OVER}, {"brk", 0, PARAM_UI8, 0, 0, STEP_OVER}, - {"brkv", 0, 0, 0, 0 }, + {"brkv", 0, 0, 0, 0, STEP_OVER | STEP_COND}, {"reti", 0, 0, 0, 0, STEP_OUT}, // 0xd0 {"shiftb", GROUP, 0, 0, 0 }, @@ -251,10 +251,10 @@ {"escape", FPU, 0, 0, 0 }, {"escape", FPU, 0, 0, 0 }, // 0xe0 - {"dbnzne", 0, PARAM_REL8, 0, 0, STEP_OVER}, - {"dbnze", 0, PARAM_REL8, 0, 0, STEP_OVER}, - {"dbnz", 0, PARAM_REL8, 0, 0, STEP_OVER}, - {"bcwz", 0, PARAM_REL8, 0, 0 }, + {"dbnzne", 0, PARAM_REL8, 0, 0, STEP_COND}, + {"dbnze", 0, PARAM_REL8, 0, 0, STEP_COND}, + {"dbnz", 0, PARAM_REL8, 0, 0, STEP_COND}, + {"bcwz", 0, PARAM_REL8, 0, 0, STEP_COND}, {"in", 0, PARAM_AL, PARAM_UI8, 0 }, {"in", 0, PARAM_AW, PARAM_UI8, 0 }, {"out", 0, PARAM_UI8, PARAM_AL, 0 }, @@ -454,7 +454,7 @@ {"???", 0, 0, 0, 0 }, {"???", 0, 0, 0, 0 }, {"???", 0, 0, 0, 0 }, - {"btclr", 0, PARAM_SFREG, PARAM_I3, PARAM_REL8 }, /* V25/V35 only */ + {"btclr", 0, PARAM_SFREG, PARAM_I3, PARAM_REL8, STEP_COND}, /* V25/V35 only */ {"???", 0, 0, 0, 0 }, {"stop", 0, 0, 0, 0 }, /* V25/V35 only */ {"???", 0, 0, 0, 0 }, @@ -1654,51 +1654,51 @@ case 0xbd: util::stream_format(stream, "cmp bl"); break; case 0xbe: util::stream_format(stream, "cmp m"); break; case 0xbf: util::stream_format(stream, "cmp al"); break; - case 0xc0: util::stream_format(stream, "rnz"); flags = STEP_OUT; break; + case 0xc0: util::stream_format(stream, "rnz"); flags = STEP_OUT | STEP_COND; break; case 0xc1: util::stream_format(stream, "pop cw"); break; - case 0xc2: util::stream_format(stream, "jnz $%04x", params.r16(pc)); pc+=2; break; + case 0xc2: util::stream_format(stream, "jnz $%04x", params.r16(pc)); pc+=2; flags = STEP_COND; break; case 0xc3: util::stream_format(stream, "jmp $%04x", params.r16(pc)); pc+=2; break; case 0xc4: util::stream_format(stream, "cnz $%04x", params.r16(pc)); pc+=2; flags = STEP_OVER; break; case 0xc5: util::stream_format(stream, "push cw"); break; case 0xc6: util::stream_format(stream, "adi $%02x", params.r8(pc)); pc++; break; case 0xc7: util::stream_format(stream, "rst 0"); flags = STEP_OVER; break; - case 0xc8: util::stream_format(stream, "rz"); flags = STEP_OUT; break; + case 0xc8: util::stream_format(stream, "rz"); flags = STEP_OUT | STEP_COND; break; case 0xc9: util::stream_format(stream, "ret"); flags = STEP_OUT; break; - case 0xca: util::stream_format(stream, "jz $%04x", params.r16(pc)); pc+=2; break; + case 0xca: util::stream_format(stream, "jz $%04x", params.r16(pc)); pc+=2; flags = STEP_COND; break; case 0xcb: util::stream_format(stream, "jmp $%04x", params.r16(pc)); pc+=2; break; case 0xcc: util::stream_format(stream, "cz $%04x", params.r16(pc)); pc+=2; flags = STEP_OVER; break; case 0xcd: util::stream_format(stream, "call $%04x", params.r16(pc)); pc+=2; flags = STEP_OVER; break; case 0xce: util::stream_format(stream, "aci $%02x", params.r8(pc)); pc++; break; case 0xcf: util::stream_format(stream, "rst 1"); flags = STEP_OVER; break; - case 0xd0: util::stream_format(stream, "rnc"); flags = STEP_OUT; break; + case 0xd0: util::stream_format(stream, "rnc"); flags = STEP_OUT | STEP_COND; break; case 0xd1: util::stream_format(stream, "pop dw"); break; - case 0xd2: util::stream_format(stream, "jnc $%04x", params.r16(pc)); pc+=2; break; + case 0xd2: util::stream_format(stream, "jnc $%04x", params.r16(pc)); pc+=2; flags = STEP_COND; break; case 0xd3: util::stream_format(stream, "out $%02x", params.r8(pc)); pc++; break; case 0xd4: util::stream_format(stream, "cnc $%04x", params.r16(pc)); pc+=2; flags = STEP_OVER; break; case 0xd5: util::stream_format(stream, "push dw"); break; case 0xd6: util::stream_format(stream, "sui $%02x", params.r8(pc)); pc++; break; case 0xd7: util::stream_format(stream, "rst 2"); flags = STEP_OVER; break; - case 0xd8: util::stream_format(stream, "rc"); flags = STEP_OUT; break; + case 0xd8: util::stream_format(stream, "rc"); flags = STEP_OUT | STEP_COND; break; case 0xd9: util::stream_format(stream, "shlx d (*)"); break; - case 0xda: util::stream_format(stream, "jc $%04x", params.r16(pc)); pc+=2; break; + case 0xda: util::stream_format(stream, "jc $%04x", params.r16(pc)); pc+=2; flags = STEP_COND; break; case 0xdb: util::stream_format(stream, "in $%02x", params.r8(pc)); pc++; break; case 0xdc: util::stream_format(stream, "cc $%04x", params.r16(pc)); pc+=2; flags = STEP_OVER; break; case 0xdd: util::stream_format(stream, "call $%04x", params.r16(pc)); pc+=2; flags = STEP_OVER; break; case 0xde: util::stream_format(stream, "sbi $%02x", params.r8(pc)); pc++; break; case 0xdf: util::stream_format(stream, "rst 3"); flags = STEP_OVER; break; - case 0xe0: util::stream_format(stream, "rpo"); flags = STEP_OUT; break; + case 0xe0: util::stream_format(stream, "rpo"); flags = STEP_OUT | STEP_COND; break; case 0xe1: util::stream_format(stream, "pop bw"); break; - case 0xe2: util::stream_format(stream, "jpo $%04x", params.r16(pc)); pc+=2; break; + case 0xe2: util::stream_format(stream, "jpo $%04x", params.r16(pc)); pc+=2; flags = STEP_COND; break; case 0xe3: util::stream_format(stream, "xthl"); break; - case 0xe4: util::stream_format(stream, "cpo $%04x", params.r16(pc)); pc+=2; flags = STEP_OVER; break; + case 0xe4: util::stream_format(stream, "cpo $%04x", params.r16(pc)); pc+=2; flags = STEP_OVER | STEP_COND; break; case 0xe5: util::stream_format(stream, "push bw"); break; case 0xe6: util::stream_format(stream, "ani $%02x", params.r8(pc)); pc++; break; case 0xe7: util::stream_format(stream, "rst 4"); flags = STEP_OVER; break; - case 0xe8: util::stream_format(stream, "rpe"); flags = STEP_OUT; break; + case 0xe8: util::stream_format(stream, "rpe"); flags = STEP_OUT | STEP_COND; break; case 0xe9: util::stream_format(stream, "pchl"); break; - case 0xea: util::stream_format(stream, "jpe $%04x", params.r16(pc)); pc+=2; break; + case 0xea: util::stream_format(stream, "jpe $%04x", params.r16(pc)); pc+=2; flags = STEP_COND; break; case 0xeb: util::stream_format(stream, "xchg"); break; - case 0xec: util::stream_format(stream, "cpe $%04x", params.r16(pc)); pc+=2; flags = STEP_OVER; break; + case 0xec: util::stream_format(stream, "cpe $%04x", params.r16(pc)); pc+=2; flags = STEP_OVER | STEP_COND; break; case 0xed: switch (params.r8(pc)) { @@ -1712,19 +1712,19 @@ break; case 0xee: util::stream_format(stream, "xri $%02x", params.r8(pc)); pc++; break; case 0xef: util::stream_format(stream, "rst 5"); flags = STEP_OVER; break; - case 0xf0: util::stream_format(stream, "rp"); flags = STEP_OUT; break; + case 0xf0: util::stream_format(stream, "rp"); flags = STEP_OUT | STEP_COND; break; case 0xf1: util::stream_format(stream, "pop psw"); break; - case 0xf2: util::stream_format(stream, "jp $%04x", params.r16(pc)); pc+=2; break; + case 0xf2: util::stream_format(stream, "jp $%04x", params.r16(pc)); pc+=2; flags = STEP_COND; break; case 0xf3: util::stream_format(stream, "di"); break; - case 0xf4: util::stream_format(stream, "cp $%04x", params.r16(pc)); pc+=2; break; + case 0xf4: util::stream_format(stream, "cp $%04x", params.r16(pc)); pc+=2; flags = STEP_OVER | STEP_COND; break; case 0xf5: util::stream_format(stream, "push psw"); break; case 0xf6: util::stream_format(stream, "ori $%02x", params.r8(pc)); pc++; break; case 0xf7: util::stream_format(stream, "rst 6"); flags = STEP_OVER; break; - case 0xf8: util::stream_format(stream, "rm"); flags = STEP_OUT; break; + case 0xf8: util::stream_format(stream, "rm"); flags = STEP_OUT | STEP_COND; break; case 0xf9: util::stream_format(stream, "sphl"); break; case 0xfa: util::stream_format(stream, "jm $%04x", params.r16(pc)); pc+=2; break; case 0xfb: util::stream_format(stream, "ei"); break; - case 0xfc: util::stream_format(stream, "cm $%04x", params.r16(pc)); pc+=2; flags = STEP_OVER; break; + case 0xfc: util::stream_format(stream, "cm $%04x", params.r16(pc)); pc+=2; flags = STEP_OVER | STEP_COND; break; case 0xfd: util::stream_format(stream, "call $%04x", params.r16(pc)); pc+=2; flags = STEP_OVER; break; case 0xfe: util::stream_format(stream, "cpi $%02x", params.r8(pc)); pc++; break; case 0xff: util::stream_format(stream, "rst 7"); flags = STEP_OVER; break; diff -Nru mame-0.242+dfsg.1/src/devices/cpu/nec/v25.cpp mame-0.243+dfsg.1/src/devices/cpu/nec/v25.cpp --- mame-0.242+dfsg.1/src/devices/cpu/nec/v25.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/nec/v25.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -38,8 +38,6 @@ #include "v25.h" #include "necdasm.h" -#include "debugger.h" - typedef uint8_t BOOLEAN; typedef uint8_t BYTE; typedef uint16_t WORD; diff -Nru mame-0.242+dfsg.1/src/devices/cpu/ns32000/ns32000.cpp mame-0.243+dfsg.1/src/devices/cpu/ns32000/ns32000.cpp --- mame-0.242+dfsg.1/src/devices/cpu/ns32000/ns32000.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/ns32000/ns32000.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -5,7 +5,7 @@ #include "ns32000.h" #include "ns32000dasm.h" -#include "debugger.h" +#include "debug/debugcpu.h" DEFINE_DEVICE_TYPE(NS32008, ns32008_device, "ns32008", "National Semiconductor NS32008") DEFINE_DEVICE_TYPE(NS32016, ns32016_device, "ns32016", "National Semiconductor NS32016") diff -Nru mame-0.242+dfsg.1/src/devices/cpu/ns32000/ns32000dasm.cpp mame-0.243+dfsg.1/src/devices/cpu/ns32000/ns32000dasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/ns32000/ns32000dasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/ns32000/ns32000dasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -207,6 +207,8 @@ { // format 0: cccc 1010 util::stream_format(stream, "B%-2s 0x%X", cond_code[BIT(opbyte, 4, 4)], pc + displacement(pc, opcodes, bytes)); + if (BIT(opbyte, 4, 4) < 0xe) + flags |= STEP_COND; } else if ((opbyte & 15) == 2) { @@ -258,7 +260,7 @@ case 1: util::stream_format(stream, "CMPQ%c %d, %s", size_char[size], s32(quick << 28) >> 28, mode[0].mode); break; case 2: util::stream_format(stream, "SPR%c %s, %s", size_char[size], procreg[quick], mode[0].mode); break; case 3: util::stream_format(stream, "S%s%c %s", cond_code[quick], size_char[size], mode[0].mode); break; - case 4: util::stream_format(stream, "ACB%c %d, %s, 0x%X", size_char[size], s32(quick << 28) >> 28, mode[0].mode, pc + displacement(pc, opcodes, bytes)); break; + case 4: util::stream_format(stream, "ACB%c %d, %s, 0x%X", size_char[size], s32(quick << 28) >> 28, mode[0].mode, pc + displacement(pc, opcodes, bytes)); flags |= STEP_COND; break; case 5: util::stream_format(stream, "MOVQ%c %d, %s", size_char[size], s32(quick << 28) >> 28, mode[0].mode); break; case 6: util::stream_format(stream, "LPR%c %s, %s", size_char[size], procreg[quick], mode[0].mode); break; case 7: diff -Nru mame-0.242+dfsg.1/src/devices/cpu/nuon/nuon.cpp mame-0.243+dfsg.1/src/devices/cpu/nuon/nuon.cpp --- mame-0.242+dfsg.1/src/devices/cpu/nuon/nuon.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/nuon/nuon.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -11,7 +11,6 @@ #include "emu.h" #include "nuon.h" #include "nuondasm.h" -#include "debugger.h" #define VERBOSE_LEVEL (0) diff -Nru mame-0.242+dfsg.1/src/devices/cpu/pace/pacedasm.cpp mame-0.243+dfsg.1/src/devices/cpu/pace/pacedasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/pace/pacedasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/pace/pacedasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -111,211 +111,211 @@ { case 0x0000: stream << "HALT"; - return 1; + return 1 | SUPPORTED; case 0x0400: util::stream_format(stream, "%-8sAC%d", "CFR", (inst & 0x0300) >> 8); - return 1; + return 1 | SUPPORTED; case 0x0800: util::stream_format(stream, "%-8sAC%d", "CRF", (inst & 0x0300) >> 8); - return 1; + return 1 | SUPPORTED; case 0x0c00: stream << "PUSHF"; - return 1; + return 1 | SUPPORTED; case 0x1000: stream << "PULLF"; - return 1; + return 1 | SUPPORTED; case 0x1400: util::stream_format(stream, "%-8s", "JSR"); format_ea(stream, pc, inst); - return 1 | STEP_OVER; + return 1 | STEP_OVER | SUPPORTED; case 0x1800: util::stream_format(stream, "%-8s", "JMP"); format_ea(stream, pc, inst); - return 1; + return 1 | SUPPORTED; case 0x1c00: util::stream_format(stream, "%-8sAC%d", "XCHRS", (inst & 0x0300) >> 8); - return 1; + return 1 | SUPPORTED; case 0x2000: util::stream_format(stream, "%-8sAC%d,%d,%d", "ROL", (inst & 0x0300) >> 8, (inst & 0x00fe) >> 1, inst & 0x0001); - return 1; + return 1 | SUPPORTED; case 0x2400: util::stream_format(stream, "%-8sAC%d,%d,%d", "ROR", (inst & 0x0300) >> 8, (inst & 0x00fe) >> 1, inst & 0x0001); - return 1; + return 1 | SUPPORTED; case 0x2800: util::stream_format(stream, "%-8sAC%d,%d,%d", "SHL", (inst & 0x0300) >> 8, (inst & 0x00fe) >> 1, inst & 0x0001); - return 1; + return 1 | SUPPORTED; case 0x2c00: util::stream_format(stream, "%-8sAC%d,%d,%d", "SHR", (inst & 0x0300) >> 8, (inst & 0x00fe) >> 1, inst & 0x0001); - return 1; + return 1 | SUPPORTED; case 0x3000: case 0x3400: case 0x3800: case 0x3c00: util::stream_format(stream, "%-8s%s", BIT(inst, 7) ? "SFLG" : "PFLG", s_flags[(inst & 0x0f00) >> 8]); - return 1; + return 1 | SUPPORTED; case 0x4000: case 0x4400: case 0x4800: case 0x4c00: util::stream_format(stream, "%-8s%s,", "BOC", s_cc[(inst & 0x0f00) >> 8]); format_addr(stream, pc + 1 + s8(inst & 0x00ff)); - return 1; + return 1 | STEP_COND | SUPPORTED; case 0x5000: util::stream_format(stream, "%-8sAC%d,", "LI", (inst & 0x0300) >> 8); format_disp(stream, inst & 0x00ff); - return 1; + return 1 | SUPPORTED; case 0x5400: util::stream_format(stream, "%-8sAC%d,AC%d", "RAND", (inst & 0x00c0) >> 6, (inst & 0x0300) >> 8); - return 1; + return 1 | SUPPORTED; case 0x5800: util::stream_format(stream, "%-8sAC%d,AC%d", "RXOR", (inst & 0x00c0) >> 6, (inst & 0x0300) >> 8); - return 1; + return 1 | SUPPORTED; case 0x5c00: if ((inst & 0x0300) >> 2 == (inst & 0x00c0)) stream << "NOP"; else util::stream_format(stream, "%-8sAC%d,AC%d", "RCPY", (inst & 0x00c0) >> 6, (inst & 0x0300) >> 8); - return 1; + return 1 | SUPPORTED; case 0x6000: util::stream_format(stream, "%-8sAC%d", "PUSH", (inst & 0x0300) >> 8); - return 1; + return 1 | SUPPORTED; case 0x6400: util::stream_format(stream, "%-8sAC%d", "PULL", (inst & 0x0300) >> 8); - return 1; + return 1 | SUPPORTED; case 0x6800: util::stream_format(stream, "%-8sAC%d,AC%d", "RADD", (inst & 0x00c0) >> 6, (inst & 0x0300) >> 8); - return 1; + return 1 | SUPPORTED; case 0x6c00: util::stream_format(stream, "%-8sAC%d,AC%d", "RXCH", (inst & 0x00c0) >> 6, (inst & 0x0300) >> 8); - return 1; + return 1 | SUPPORTED; case 0x7000: util::stream_format(stream, "%-8sAC%d,", "CAI", (inst & 0x0300) >> 8); format_disp(stream, inst & 0x00ff); - return 1; + return 1 | SUPPORTED; case 0x7400: util::stream_format(stream, "%-8sAC%d,AC%d", "RADC", (inst & 0x00c0) >> 6, (inst & 0x0300) >> 8); - return 1; + return 1 | SUPPORTED; case 0x7800: util::stream_format(stream, "%-8sAC%d,", "AISZ", (inst & 0x0300) >> 8); format_disp(stream, inst & 0x00ff); - return 1 | STEP_OVER; + return 1 | STEP_COND | SUPPORTED; case 0x7c00: util::stream_format(stream, "%-8s", "RTI"); format_disp(stream, inst & 0x00ff); - return 1 | STEP_OUT; + return 1 | STEP_OUT | SUPPORTED; case 0x8000: util::stream_format(stream, "%-8s", "RTS"); format_disp(stream, inst & 0x00ff); - return 1 | STEP_OUT; + return 1 | STEP_OUT | SUPPORTED; case 0x8800: util::stream_format(stream, "%-8sAC0,", "DECA"); format_ea(stream, pc, inst); - return 1; + return 1 | SUPPORTED; case 0x8c00: util::stream_format(stream, "%-8s", "ISZ"); format_ea(stream, pc, inst); - return 1 | STEP_OVER; + return 1 | STEP_COND | SUPPORTED; case 0x9000: util::stream_format(stream, "%-8sAC0,", "SUBB"); format_ea(stream, pc, inst); - return 1; + return 1 | SUPPORTED; case 0x9400: util::stream_format(stream, "%-8s@", "JSR"); format_ea(stream, pc, inst); - return 1 | STEP_OVER; + return 1 | STEP_OVER | SUPPORTED; case 0x9800: util::stream_format(stream, "%-8s@", "JMP"); format_ea(stream, pc, inst); - return 1; + return 1 | SUPPORTED; case 0x9c00: util::stream_format(stream, "%-8sAC0,", "SKG"); format_ea(stream, pc, inst); - return 1 | STEP_OVER; + return 1 | STEP_COND | SUPPORTED; case 0xa000: util::stream_format(stream, "%-8sAC0,@", "LD"); format_ea(stream, pc, inst); - return 1; + return 1 | SUPPORTED; case 0xa400: util::stream_format(stream, "%-8sAC0,", "OR"); format_ea(stream, pc, inst); - return 1; + return 1 | SUPPORTED; case 0xa800: util::stream_format(stream, "%-8sAC0,", "AND"); format_ea(stream, pc, inst); - return 1; + return 1 | SUPPORTED; case 0xac00: util::stream_format(stream, "%-8s", "DSZ"); format_ea(stream, pc, inst); - return 1 | STEP_OVER; + return 1 | STEP_COND | SUPPORTED; case 0xb000: util::stream_format(stream, "%-8sAC0,@", "ST"); format_ea(stream, pc, inst); - return 1; + return 1 | SUPPORTED; case 0xb800: util::stream_format(stream, "%-8sAC0,", "SKAZ"); format_ea(stream, pc, inst); - return 1 | STEP_OVER; + return 1 | STEP_COND | SUPPORTED; case 0xbc00: util::stream_format(stream, "%-8sAC0,", "LSEX"); format_ea(stream, pc, inst); - return 1; + return 1 | SUPPORTED; case 0xc000: case 0xc400: case 0xc800: case 0xcc00: util::stream_format(stream, "%-8sAC%d,", "LD", (inst & 0x0c00) >> 10); format_ea(stream, pc, inst); - return 1; + return 1 | SUPPORTED; case 0xd000: case 0xd400: case 0xd800: case 0xdc00: util::stream_format(stream, "%-8sAC%d,", "ST", (inst & 0x0c00) >> 10); format_ea(stream, pc, inst); - return 1; + return 1 | SUPPORTED; case 0xe000: case 0xe400: case 0xe800: case 0xec00: util::stream_format(stream, "%-8sAC%d,", "ADD", (inst & 0x0c00) >> 10); format_ea(stream, pc, inst); - return 1; + return 1 | SUPPORTED; case 0xf000: case 0xf400: case 0xf800: case 0xfc00: util::stream_format(stream, "%-8sAC%d,", "SKNE", (inst & 0x0c00) >> 10); format_ea(stream, pc, inst); - return 1 | STEP_OVER; + return 1 | STEP_COND | SUPPORTED; default: util::stream_format(stream, "%-8s", ".WORD"); format_addr(stream, inst); - return 1; + return 1 | SUPPORTED; } } diff -Nru mame-0.242+dfsg.1/src/devices/cpu/patinhofeio/patinho_feio.cpp mame-0.243+dfsg.1/src/devices/cpu/patinhofeio/patinho_feio.cpp --- mame-0.242+dfsg.1/src/devices/cpu/patinhofeio/patinho_feio.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/patinhofeio/patinho_feio.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -7,7 +7,6 @@ #include "emu.h" #include "patinhofeio_cpu.h" #include "patinho_feio_dasm.h" -#include "debugger.h" #include "includes/patinhofeio.h" // FIXME: this is a dependency from devices on MAME #define PC m_pc //The program counter is called "contador de instrucoes" (IC) in portuguese diff -Nru mame-0.242+dfsg.1/src/devices/cpu/pdp1/pdp1.cpp mame-0.243+dfsg.1/src/devices/cpu/pdp1/pdp1.cpp --- mame-0.242+dfsg.1/src/devices/cpu/pdp1/pdp1.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/pdp1/pdp1.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -340,7 +340,6 @@ #include "emu.h" -#include "debugger.h" #include "pdp1.h" #include "pdp1dasm.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/pdp8/pdp8.cpp mame-0.243+dfsg.1/src/devices/cpu/pdp8/pdp8.cpp --- mame-0.242+dfsg.1/src/devices/cpu/pdp8/pdp8.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/pdp8/pdp8.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -7,7 +7,6 @@ */ #include "emu.h" -#include "debugger.h" #include "pdp8.h" #include "pdp8dasm.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/pdp8/pdp8dasm.cpp mame-0.243+dfsg.1/src/devices/cpu/pdp8/pdp8dasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/pdp8/pdp8dasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/pdp8/pdp8dasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -140,7 +140,7 @@ { case 000: stream << "SKON"; // PDP-8/E and up - break; + return 1 | SUPPORTED | STEP_COND; case 001: stream << "ION"; @@ -152,7 +152,7 @@ case 003: stream << "SRQ"; // PDP-8/E and up - break; + return 1 | SUPPORTED | STEP_COND; case 004: stream << "GTF"; // PDP-8/E and up (used earlier by a PDP-5/Classic-8 ADC option) @@ -164,7 +164,7 @@ case 006: stream << "SGT"; // KE8-E - break; + return 1 | SUPPORTED | STEP_COND; case 007: stream << "CAF"; // PDP-8/E and up @@ -176,7 +176,7 @@ case 011: stream << "RSF"; // Paper tape reader - break; + return 1 | SUPPORTED | STEP_COND; case 012: case 016: stream << "RRB"; // Paper tape reader @@ -194,7 +194,7 @@ case 021: stream << "PSF"; // Paper tape punch - break; + return 1 | SUPPORTED | STEP_COND; case 022: stream << "PCF"; // Paper tape punch @@ -214,7 +214,7 @@ case 031: stream << "KSF"; // TTY/keyboard - break; + return 1 | SUPPORTED | STEP_COND; case 032: stream << "KCC"; // TTY/keyboard @@ -238,7 +238,7 @@ case 041: stream << "TSF"; // Teleprinter - break; + return 1 | SUPPORTED | STEP_COND; case 042: stream << "TCF"; // Teleprinter @@ -250,7 +250,7 @@ case 045: stream << "TSK"; // Teleprinter (KL8-E and up; SPI is a later name for this IOT) - break; + return 1 | SUPPORTED | STEP_COND; case 046: stream << "TLS"; // Teleprinter @@ -258,7 +258,7 @@ case 0102: stream << "SPL"; // Automatic restart - break; + return 1 | SUPPORTED | STEP_COND; case 0201: case 0202: case 0203: case 0211: case 0212: case 0213: @@ -297,7 +297,7 @@ case 0254: stream << "SINT"; // Time-sharing extension (LIF on some Intersil peripherals) - break; + return 1 | SUPPORTED | STEP_COND; case 0264: stream << "CUF"; // Time-sharing extension @@ -309,7 +309,7 @@ default: util::stream_format(stream, "IOT %03o", dev); - break; + return 1 | SUPPORTED | STEP_COND; // any IOT can theoretically cause a skip } return 1 | SUPPORTED; @@ -324,7 +324,10 @@ if (BIT(pc, 15)) stream << "PRS"; else + { stream << "SKON"; + return 1 | SUPPORTED | STEP_COND; + } break; case 001: @@ -339,7 +342,10 @@ if (BIT(pc, 15)) stream << "PGO"; else + { stream << "SRQ"; + return 1 | SUPPORTED | STEP_COND; + } break; case 004: @@ -355,7 +361,7 @@ case 006: stream << "SGT"; - break; + return 1 | SUPPORTED | STEP_COND; case 007: stream << "CAF"; @@ -432,7 +438,7 @@ default: util::stream_format(stream, "IOT %03o", dev); - break; + return 1 | SUPPORTED | STEP_COND; } return 1 | SUPPORTED; @@ -592,7 +598,7 @@ // Sequence 1b: SMA, SZA, SZL (skip if any condition holds) // Sequence 2: CLA // Sequence 3: OSR, HLT -void pdp8_disassembler::dasm_opr_group2(std::ostream &stream, u16 opr) +offs_t pdp8_disassembler::dasm_opr_group2(std::ostream &stream, u16 opr) { if ((opr & 0170) != 0) { @@ -643,6 +649,14 @@ if ((opr & 0170) == 0) stream << "!400"; } + + // HACK: HLT is a software trap on HD-6120 + if (m_has_r3l && BIT(opr, 1)) + return 1 | SUPPORTED | STEP_OVER; + else if ((opr & 0160) != 0) + return 1 | SUPPORTED | STEP_COND; + else + return 1 | SUPPORTED; } // Sequence 1: CLA @@ -777,7 +791,7 @@ if ((opr & 0320) != 0) stream << " "; stream << "DPSZ"; // KE8-E Mode B - break; + return 1 | SUPPORTED | STEP_COND; case 056: if ((opr & 0320) != 0) @@ -856,7 +870,7 @@ case 2: stream << "ISZ"; dasm_memory_reference(stream, inst, pc); - break; + return 1 | SUPPORTED | STEP_COND; case 3: stream << "DCA"; @@ -882,13 +896,7 @@ if (!BIT(inst, 8)) dasm_opr_group1(stream, inst & 0777); else if (!BIT(inst, 0)) - { - dasm_opr_group2(stream, inst & 0777); - - // HACK: HLT is a software trap on HD-6120 - if (m_has_r3l && BIT(inst, 1)) - return 1 | SUPPORTED | STEP_OVER; - } + return dasm_opr_group2(stream, inst & 0777); else return dasm_opr_group3(stream, inst & 0777, pc, opcodes); break; diff -Nru mame-0.242+dfsg.1/src/devices/cpu/pdp8/pdp8dasm.h mame-0.243+dfsg.1/src/devices/cpu/pdp8/pdp8dasm.h --- mame-0.242+dfsg.1/src/devices/cpu/pdp8/pdp8dasm.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/pdp8/pdp8dasm.h 2022-04-29 05:37:26.000000000 +0000 @@ -19,7 +19,7 @@ void dasm_memory_reference(std::ostream &stream, u16 inst, offs_t pc); virtual offs_t dasm_iot(std::ostream &stream, u16 dev, offs_t pc); void dasm_opr_group1(std::ostream &stream, u16 inst); - void dasm_opr_group2(std::ostream &stream, u16 inst); + offs_t dasm_opr_group2(std::ostream &stream, u16 inst); virtual offs_t dasm_opr_group3(std::ostream &stream, u16 inst, offs_t pc, const data_buffer &opcodes); private: diff -Nru mame-0.242+dfsg.1/src/devices/cpu/pic16/pic16d.cpp mame-0.243+dfsg.1/src/devices/cpu/pic16/pic16d.cpp --- mame-0.242+dfsg.1/src/devices/cpu/pic16/pic16d.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/pic16/pic16d.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -106,14 +106,14 @@ { 0x0e00, 0x3f00, [](P) -> u32 { util::stream_format(stream, "swapf %s, %c", d->freg(opcode), fw(opcode)); return 1; } }, { 0x0600, 0x3f00, [](P) -> u32 { util::stream_format(stream, "xorwf %s, %c", d->freg(opcode), fw(opcode)); return 1; } }, - { 0x0b00, 0x3f00, [](P) -> u32 { util::stream_format(stream, "decfsz %s, %c", d->freg(opcode), fw(opcode)); return 1; } }, - { 0x0f00, 0x3f00, [](P) -> u32 { util::stream_format(stream, "incfsz %s, %c", d->freg(opcode), fw(opcode)); return 1; } }, + { 0x0b00, 0x3f00, [](P) -> u32 { util::stream_format(stream, "decfsz %s, %c", d->freg(opcode), fw(opcode)); return 1 | STEP_COND; } }, + { 0x0f00, 0x3f00, [](P) -> u32 { util::stream_format(stream, "incfsz %s, %c", d->freg(opcode), fw(opcode)); return 1 | STEP_COND; } }, { 0x1000, 0x3c00, [](P) -> u32 { util::stream_format(stream, "bcf %d, %s", (opcode >> 7) & 7, d->freg(opcode)); return 1; } }, { 0x1400, 0x3c00, [](P) -> u32 { util::stream_format(stream, "bsf %d, %s", (opcode >> 7) & 7, d->freg(opcode)); return 1; } }, - { 0x1800, 0x3c00, [](P) -> u32 { util::stream_format(stream, "btfsc %d, %s", (opcode >> 7) & 7, d->freg(opcode)); return 1; } }, - { 0x1c00, 0x3c00, [](P) -> u32 { util::stream_format(stream, "btfss %d, %s", (opcode >> 7) & 7, d->freg(opcode)); return 1; } }, + { 0x1800, 0x3c00, [](P) -> u32 { util::stream_format(stream, "btfsc %d, %s", (opcode >> 7) & 7, d->freg(opcode)); return 1 | STEP_COND; } }, + { 0x1c00, 0x3c00, [](P) -> u32 { util::stream_format(stream, "btfss %d, %s", (opcode >> 7) & 7, d->freg(opcode)); return 1 | STEP_COND; } }, { 0x3e00, 0x3f00, [](P) -> u32 { util::stream_format(stream, "addlw %s", imm8(opcode)); return 1; } }, { 0x3900, 0x3f00, [](P) -> u32 { util::stream_format(stream, "andlw %s", imm8(opcode)); return 1; } }, diff -Nru mame-0.242+dfsg.1/src/devices/cpu/pic1670/pic1670d.cpp mame-0.243+dfsg.1/src/devices/cpu/pic1670/pic1670d.cpp --- mame-0.242+dfsg.1/src/devices/cpu/pic1670/pic1670d.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/pic1670/pic1670d.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -53,25 +53,25 @@ { 0x0400, 0x1f80, [](P) -> u32 { util::stream_format(stream, "adcwf %s, %c", d->freg(opcode), fw(opcode)); return 1; } }, { 0x0480, 0x1f80, [](P) -> u32 { util::stream_format(stream, "comf %s, %c", d->freg(opcode), fw(opcode)); return 1; } }, { 0x0500, 0x1f80, [](P) -> u32 { util::stream_format(stream, "incf %s, %c", d->freg(opcode), fw(opcode)); return 1; } }, - { 0x0580, 0x1f80, [](P) -> u32 { util::stream_format(stream, "decfsz %s, %c", d->freg(opcode), fw(opcode)); return 1; } }, + { 0x0580, 0x1f80, [](P) -> u32 { util::stream_format(stream, "decfsz %s, %c", d->freg(opcode), fw(opcode)); return 1 | STEP_COND; } }, { 0x0600, 0x1f80, [](P) -> u32 { util::stream_format(stream, "rlcf %s, %c", d->freg(opcode), fw(opcode)); return 1; } }, { 0x0680, 0x1f80, [](P) -> u32 { util::stream_format(stream, "rrcf %s, %c", d->freg(opcode), fw(opcode)); return 1; } }, { 0x0700, 0x1f80, [](P) -> u32 { util::stream_format(stream, "swapf %s, %c", d->freg(opcode), fw(opcode)); return 1; } }, - { 0x0780, 0x1f80, [](P) -> u32 { util::stream_format(stream, "incfsz %s, %c", d->freg(opcode), fw(opcode)); return 1; } }, + { 0x0780, 0x1f80, [](P) -> u32 { util::stream_format(stream, "incfsz %s, %c", d->freg(opcode), fw(opcode)); return 1 | STEP_COND; } }, { 0x1000, 0x1fc0, [](P) -> u32 { util::stream_format(stream, "movfw %s", d->freg(opcode) ); return 1; } }, { 0x1040, 0x1fc0, [](P) -> u32 { util::stream_format(stream, "clrf %s", d->freg(opcode) ); return 1; } }, { 0x1080, 0x1fc0, [](P) -> u32 { util::stream_format(stream, "rrncf %s", d->freg(opcode) ); return 1; } }, { 0x10c0, 0x1fc0, [](P) -> u32 { util::stream_format(stream, "rlncf %s", d->freg(opcode) ); return 1; } }, - { 0x1100, 0x1fc0, [](P) -> u32 { util::stream_format(stream, "cpfslt %s", d->freg(opcode) ); return 1; } }, - { 0x1140, 0x1fc0, [](P) -> u32 { util::stream_format(stream, "cpfseq %s", d->freg(opcode) ); return 1; } }, - { 0x1180, 0x1fc0, [](P) -> u32 { util::stream_format(stream, "cpfsgt %s", d->freg(opcode) ); return 1; } }, + { 0x1100, 0x1fc0, [](P) -> u32 { util::stream_format(stream, "cpfslt %s", d->freg(opcode) ); return 1 | STEP_COND; } }, + { 0x1140, 0x1fc0, [](P) -> u32 { util::stream_format(stream, "cpfseq %s", d->freg(opcode) ); return 1 | STEP_COND; } }, + { 0x1180, 0x1fc0, [](P) -> u32 { util::stream_format(stream, "cpfsgt %s", d->freg(opcode) ); return 1 | STEP_COND; } }, { 0x11c0, 0x1fc0, [](P) -> u32 { util::stream_format(stream, "testf %s", d->freg(opcode) ); return 1; } }, { 0x0800, 0x1e00, [](P) -> u32 { util::stream_format(stream, "bcf %d, %s", (opcode >> 6) & 7, d->freg(opcode)); return 1; } }, { 0x0a00, 0x1e00, [](P) -> u32 { util::stream_format(stream, "bsf %d, %s", (opcode >> 6) & 7, d->freg(opcode)); return 1; } }, - { 0x0c00, 0x1e00, [](P) -> u32 { util::stream_format(stream, "btfsc %d, %s", (opcode >> 6) & 7, d->freg(opcode)); return 1; } }, - { 0x0e00, 0x1e00, [](P) -> u32 { util::stream_format(stream, "btfss %d, %s", (opcode >> 6) & 7, d->freg(opcode)); return 1; } }, + { 0x0c00, 0x1e00, [](P) -> u32 { util::stream_format(stream, "btfsc %d, %s", (opcode >> 6) & 7, d->freg(opcode)); return 1 | STEP_COND; } }, + { 0x0e00, 0x1e00, [](P) -> u32 { util::stream_format(stream, "btfss %d, %s", (opcode >> 6) & 7, d->freg(opcode)); return 1 | STEP_COND; } }, { 0x0000, 0x1fc7, [](P) -> u32 { util::stream_format(stream, "nop" ); return 1; } }, { 0x0001, 0x1fc7, [](P) -> u32 { util::stream_format(stream, "halt" ); return 1; } }, diff -Nru mame-0.242+dfsg.1/src/devices/cpu/pic16c5x/16c5xdsm.cpp mame-0.243+dfsg.1/src/devices/cpu/pic16c5x/16c5xdsm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/pic16c5x/16c5xdsm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/pic16c5x/16c5xdsm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -190,6 +190,8 @@ flags = STEP_OVER; else if (!strncmp(cp, "ret", 3)) flags = STEP_OUT; + else if (!strncmp(cp, "btfs", 4) || !strncmp(cp + 2, "cfsz", 4)) + flags = STEP_COND; while (*cp) { diff -Nru mame-0.242+dfsg.1/src/devices/cpu/pic16c5x/pic16c5x.cpp mame-0.243+dfsg.1/src/devices/cpu/pic16c5x/pic16c5x.cpp --- mame-0.242+dfsg.1/src/devices/cpu/pic16c5x/pic16c5x.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/pic16c5x/pic16c5x.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -74,7 +74,6 @@ #include "emu.h" #include "pic16c5x.h" #include "16c5xdsm.h" -#include "debugger.h" DEFINE_DEVICE_TYPE(PIC16C54, pic16c54_device, "pic16c54", "Microchip PIC16C54") diff -Nru mame-0.242+dfsg.1/src/devices/cpu/pic16c62x/16c62xdsm.cpp mame-0.243+dfsg.1/src/devices/cpu/pic16c62x/16c62xdsm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/pic16c62x/16c62xdsm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/pic16c62x/16c62xdsm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -202,6 +202,8 @@ flags = STEP_OVER; else if (!strncmp(cp, "ret", 3)) flags = STEP_OUT; + else if (!strncmp(cp, "btfs", 4) || !strncmp(cp + 2, "cfsz", 4)) + flags = STEP_COND; while (*cp) { diff -Nru mame-0.242+dfsg.1/src/devices/cpu/pic16c62x/pic16c62x.cpp mame-0.243+dfsg.1/src/devices/cpu/pic16c62x/pic16c62x.cpp --- mame-0.242+dfsg.1/src/devices/cpu/pic16c62x/pic16c62x.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/pic16c62x/pic16c62x.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -55,7 +55,6 @@ #include "emu.h" #include "pic16c62x.h" #include "16c62xdsm.h" -#include "debugger.h" DEFINE_DEVICE_TYPE(PIC16C620, pic16c620_device, "pic16c620", "Microchip PIC16C620") diff -Nru mame-0.242+dfsg.1/src/devices/cpu/pic17/pic17d.cpp mame-0.243+dfsg.1/src/devices/cpu/pic17/pic17d.cpp --- mame-0.242+dfsg.1/src/devices/cpu/pic17/pic17d.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/pic17/pic17d.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -161,6 +161,8 @@ util::stream_format(stream, "%-8s", s_bit_ops[BIT(opcode, 11, 2)]); format_register(stream, opcode & 0x00ff); util::stream_format(stream, ",%d", BIT(opcode, 8, 3)); + if (BIT(opcode, 12)) + words |= STEP_COND; } else if (opcode >= 0x6000) { @@ -189,6 +191,7 @@ { util::stream_format(stream, "%-8s", s_cp_ops[BIT(opcode, 8, 2)]); format_register(stream, opcode & 0x00ff); + words |= STEP_COND; } else if (opcode < 0x3500) { @@ -205,6 +208,8 @@ format_register(stream, opcode & 0x00ff); if (opcode >= 0x0200) util::stream_format(stream, ",%c", BIT(opcode, 8) ? 'F' : 'W'); + if ((opcode & 0x3600) == 0x1600 || (opcode & 0x3c00) == 0x2400) + words |= STEP_COND; } else switch (opcode) { diff -Nru mame-0.242+dfsg.1/src/devices/cpu/powerpc/ppc_dasm.cpp mame-0.243+dfsg.1/src/devices/cpu/powerpc/ppc_dasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/powerpc/ppc_dasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/powerpc/ppc_dasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -860,6 +860,8 @@ oprs = util::string_format("0x%02X,%d,0x%08X", G_BO(op), G_BI(op), disp + ((op & M_AA) ? 0 : pc)); else // BI gives us the condition bit oprs = util::string_format("0x%02X,cr%d[%s],0x%08X", G_BO(op), G_BI(op) / 4, crbit[G_BI(op) & 3], disp + ((op & M_AA) ? 0 : pc)); + if ((G_BO(op) & 0x14) != 0x14) + flags |= STEP_COND; break; case F_BO_BI: @@ -867,6 +869,8 @@ oprs = util::string_format("0x%02X,%d", G_BO(op), G_BI(op)); else oprs = util::string_format("0x%02X,cr%d[%s]", G_BO(op), G_BI(op) / 4, crbit[G_BI(op) & 3]); + if ((G_BO(op) & 0x14) != 0x14) + flags |= STEP_COND; break; case F_CMP: diff -Nru mame-0.242+dfsg.1/src/devices/cpu/powerpc/ppcdrc.cpp mame-0.243+dfsg.1/src/devices/cpu/powerpc/ppcdrc.cpp --- mame-0.242+dfsg.1/src/devices/cpu/powerpc/ppcdrc.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/powerpc/ppcdrc.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -22,7 +22,6 @@ #include "cpu/drcfe.h" #include "cpu/drcuml.h" #include "cpu/drcumlsh.h" -#include "debugger.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/pps4/pps4.cpp mame-0.243+dfsg.1/src/devices/cpu/pps4/pps4.cpp --- mame-0.242+dfsg.1/src/devices/cpu/pps4/pps4.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/pps4/pps4.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -78,7 +78,6 @@ #include "emu.h" #include "pps4.h" #include "pps4dasm.h" -#include "debugger.h" #define VERBOSE 0 //!< set to 1 to log certain instruction conditions diff -Nru mame-0.242+dfsg.1/src/devices/cpu/pps4/pps4dasm.cpp mame-0.243+dfsg.1/src/devices/cpu/pps4/pps4dasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/pps4/pps4dasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/pps4/pps4dasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -66,7 +66,7 @@ "sag" /* special address generation */ }; -uint16_t const pps4_disassembler::table[] = { +uint32_t const pps4_disassembler::table[] = { /* 00 */ t_LBL | t_I8c, /* 01 */ t_TML | t_I4 | t_I8, /* 02 */ t_TML | t_I4 | t_I8, @@ -75,8 +75,8 @@ /* 05 */ t_RTN | t_OUT, /* 06 */ t_XS, /* 07 */ t_RTNSK | t_OUT, -/* 08 */ t_ADCSK, -/* 09 */ t_ADSK, +/* 08 */ t_ADCSK | t_COND, +/* 09 */ t_ADSK | t_COND, /* 0a */ t_ADC, /* 0b */ t_AD, /* 0c */ t_EOR, @@ -88,18 +88,18 @@ /* 11 */ t_LABL, /* 12 */ t_LAX, /* 13 */ t_SAG, -/* 14 */ t_SKF2, -/* 15 */ t_SKC, -/* 16 */ t_SKF1, -/* 17 */ t_INCB, +/* 14 */ t_SKF2 | t_COND, +/* 15 */ t_SKC | t_COND, +/* 16 */ t_SKF1 | t_COND, +/* 17 */ t_INCB | t_COND, /* 18 */ t_XBMX, /* 19 */ t_XABL, /* 1a */ t_XAX, /* 1b */ t_LXA, /* 1c */ t_IOL | t_I8, /* 1d */ t_DOA, -/* 1e */ t_SKZ, -/* 1f */ t_DECB, +/* 1e */ t_SKZ | t_COND, +/* 1f */ t_DECB | t_COND, /* 20 */ t_SC, /* 21 */ t_SF2, @@ -109,14 +109,14 @@ /* 25 */ t_RF2, /* 26 */ t_RF1, /* 27 */ t_DIA, -/* 28 */ t_EXD | t_I3c, -/* 29 */ t_EXD | t_I3c, -/* 2a */ t_EXD | t_I3c, -/* 2b */ t_EXD | t_I3c, -/* 2c */ t_EXD | t_I3c, -/* 2d */ t_EXD | t_I3c, -/* 2e */ t_EXD | t_I3c, -/* 2f */ t_EXD | t_I3c, +/* 28 */ t_EXD | t_I3c | t_COND, +/* 29 */ t_EXD | t_I3c | t_COND, +/* 2a */ t_EXD | t_I3c | t_COND, +/* 2b */ t_EXD | t_I3c | t_COND, +/* 2c */ t_EXD | t_I3c | t_COND, +/* 2d */ t_EXD | t_I3c | t_COND, +/* 2e */ t_EXD | t_I3c | t_COND, +/* 2f */ t_EXD | t_I3c | t_COND, /* 30 */ t_LD | t_I3c, /* 31 */ t_LD | t_I3c, @@ -135,22 +135,22 @@ /* 3e */ t_EX | t_I3c, /* 3f */ t_EX | t_I3c, -/* 40 */ t_SKBI | t_I4, -/* 41 */ t_SKBI | t_I4, -/* 42 */ t_SKBI | t_I4, -/* 43 */ t_SKBI | t_I4, -/* 44 */ t_SKBI | t_I4, -/* 45 */ t_SKBI | t_I4, -/* 46 */ t_SKBI | t_I4, -/* 47 */ t_SKBI | t_I4, -/* 48 */ t_SKBI | t_I4, -/* 49 */ t_SKBI | t_I4, -/* 4a */ t_SKBI | t_I4, -/* 4b */ t_SKBI | t_I4, -/* 4c */ t_SKBI | t_I4, -/* 4d */ t_SKBI | t_I4, -/* 4e */ t_SKBI | t_I4, -/* 4f */ t_SKBI | t_I4, +/* 40 */ t_SKBI | t_I4 | t_COND, +/* 41 */ t_SKBI | t_I4 | t_COND, +/* 42 */ t_SKBI | t_I4 | t_COND, +/* 43 */ t_SKBI | t_I4 | t_COND, +/* 44 */ t_SKBI | t_I4 | t_COND, +/* 45 */ t_SKBI | t_I4 | t_COND, +/* 46 */ t_SKBI | t_I4 | t_COND, +/* 47 */ t_SKBI | t_I4 | t_COND, +/* 48 */ t_SKBI | t_I4 | t_COND, +/* 49 */ t_SKBI | t_I4 | t_COND, +/* 4a */ t_SKBI | t_I4 | t_COND, +/* 4b */ t_SKBI | t_I4 | t_COND, +/* 4c */ t_SKBI | t_I4 | t_COND, +/* 4d */ t_SKBI | t_I4 | t_COND, +/* 4e */ t_SKBI | t_I4 | t_COND, +/* 4f */ t_SKBI | t_I4 | t_COND, /* 50 */ t_TL | t_I4 | t_I8 | t_OVER, /* 51 */ t_TL | t_I4 | t_I8 | t_OVER, @@ -169,21 +169,21 @@ /* 5e */ t_TL | t_I4 | t_I8 | t_OVER, /* 5f */ t_TL | t_I4 | t_I8 | t_OVER, -/* 60 */ t_ADI | t_I4c, -/* 61 */ t_ADI | t_I4c, -/* 62 */ t_ADI | t_I4c, -/* 63 */ t_ADI | t_I4c, -/* 64 */ t_ADI | t_I4c, +/* 60 */ t_ADI | t_I4c | t_COND, +/* 61 */ t_ADI | t_I4c | t_COND, +/* 62 */ t_ADI | t_I4c | t_COND, +/* 63 */ t_ADI | t_I4c | t_COND, +/* 64 */ t_ADI | t_I4c | t_COND, /* 65 */ t_DC, -/* 66 */ t_ADI | t_I4c, -/* 67 */ t_ADI | t_I4c, -/* 68 */ t_ADI | t_I4c, -/* 69 */ t_ADI | t_I4c, -/* 6a */ t_ADI | t_I4c, -/* 6b */ t_ADI | t_I4c, -/* 6c */ t_ADI | t_I4c, -/* 6d */ t_ADI | t_I4c, -/* 6e */ t_ADI | t_I4c, +/* 66 */ t_ADI | t_I4c | t_COND, +/* 67 */ t_ADI | t_I4c | t_COND, +/* 68 */ t_ADI | t_I4c | t_COND, +/* 69 */ t_ADI | t_I4c | t_COND, +/* 6a */ t_ADI | t_I4c | t_COND, +/* 6b */ t_ADI | t_I4c | t_COND, +/* 6c */ t_ADI | t_I4c | t_COND, +/* 6d */ t_ADI | t_I4c | t_COND, +/* 6e */ t_ADI | t_I4c | t_COND, /* 6f */ t_CYS, /* 70 */ t_LDI | t_I4c, diff -Nru mame-0.242+dfsg.1/src/devices/cpu/pps4/pps4dasm.h mame-0.243+dfsg.1/src/devices/cpu/pps4/pps4dasm.h --- mame-0.242+dfsg.1/src/devices/cpu/pps4/pps4dasm.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/pps4/pps4dasm.h 2022-04-29 05:37:26.000000000 +0000 @@ -26,7 +26,7 @@ virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) override; private: - typedef enum pps4_token_e { + typedef enum pps4_token_e : uint32_t { t_AD, t_ADC, t_ADSK, t_ADCSK, t_ADI, t_DC, t_AND, t_OR, t_EOR, t_COMP, t_SC, t_RC, t_SF1, t_RF1, t_SF2, @@ -48,11 +48,12 @@ t_I8 = 1 << 12, /* immediate 8 bit constant (I/O port number) */ t_I8c = 1 << 13, /* immediate 8 bit constant inverted */ t_OVER = 1 << 14, /* Debugger step over (CALL) */ - t_OUT = 1 << 15 /* Debugger step out (RETURN) */ + t_OUT = 1 << 15, /* Debugger step out (RETURN) */ + t_COND = 1 << 16 /* Debugger conditional branch */ } pps4_token_e; static char const *const token_str[t_COUNT]; - static uint16_t const table[]; + static uint32_t const table[]; }; diff -Nru mame-0.242+dfsg.1/src/devices/cpu/pps41/pps41base.cpp mame-0.243+dfsg.1/src/devices/cpu/pps41/pps41base.cpp --- mame-0.242+dfsg.1/src/devices/cpu/pps41/pps41base.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/pps41/pps41base.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -55,8 +55,6 @@ #include "emu.h" #include "pps41base.h" -#include "debugger.h" - pps41_base_device::pps41_base_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data) : cpu_device(mconfig, type, tag, owner, clock), diff -Nru mame-0.242+dfsg.1/src/devices/cpu/pps41/pps41d.cpp mame-0.243+dfsg.1/src/devices/cpu/pps41/pps41d.cpp --- mame-0.242+dfsg.1/src/devices/cpu/pps41/pps41d.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/pps41/pps41d.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -77,17 +77,17 @@ // MM76 0, 0, 0, 0, 0, - 0, 0, 0, + 0, 0, STEP_COND, 0, 0, - 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, STEP_COND, STEP_COND, + 0, 0, STEP_COND, STEP_COND, 0, 0, 0, STEP_COND, 0, STEP_COND, STEP_OUT, STEP_OUT, 0, 0, 0, STEP_OVER, STEP_OVER, 0, - 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + STEP_COND, STEP_COND, STEP_COND, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, STEP_COND, STEP_COND, STEP_COND, STEP_COND, 0, 0, // MM78 - 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, + STEP_COND, STEP_COND, 0, 0, 0, + STEP_COND, 0, 0, 0, 0, 0, 0, STEP_OVER }; diff -Nru mame-0.242+dfsg.1/src/devices/cpu/psx/psx.cpp mame-0.243+dfsg.1/src/devices/cpu/psx/psx.cpp --- mame-0.242+dfsg.1/src/devices/cpu/psx/psx.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/psx/psx.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -70,7 +70,6 @@ #include "mdec.h" #include "rcnt.h" #include "sound/spu.h" -#include "debugger.h" #include "psxdefs.h" @@ -1983,6 +1982,10 @@ state_add( PSXCPU_CP2CR30, "zsf4", m_gte.m_cp2cr[ 30 ].d ); state_add( PSXCPU_CP2CR31, "flag", m_gte.m_cp2cr[ 31 ].d ); + // initialize the registers once + for(int i=0; i != 32; i++) + m_r[i] = 0; + // set our instruction counter set_icountptr(m_icount); diff -Nru mame-0.242+dfsg.1/src/devices/cpu/psx/psxdasm.cpp mame-0.243+dfsg.1/src/devices/cpu/psx/psxdasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/psx/psxdasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/psx/psxdasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -303,11 +303,14 @@ if( INS_RT( op ) == RT_BLTZAL ) { util::stream_format( stream, "bltzal %s,$%08x", s_cpugenreg[ INS_RS( op ) ], relative_address( pc, op ) ); - flags = STEP_OVER | step_over_extra( 1 ); + if( INS_RS( op ) != 0 ) + flags = STEP_OVER | STEP_COND | step_over_extra( 1 ); } else { util::stream_format( stream, "bltz %s,$%08x", s_cpugenreg[ INS_RS( op ) ], relative_address( pc, op ) ); + if( INS_RS( op ) != 0 ) + flags = STEP_COND | step_over_extra( 1 ); } break; case RT_BGEZ: @@ -315,10 +318,14 @@ { util::stream_format( stream, "bgezal %s,$%08x", s_cpugenreg[ INS_RS( op ) ], relative_address( pc, op ) ); flags = STEP_OVER | step_over_extra( 1 ); + if( INS_RS( op ) != 0 ) + flags |= STEP_COND; } else { util::stream_format( stream, "bgez %s,$%08x", s_cpugenreg[ INS_RS( op ) ], relative_address( pc, op ) ); + if( INS_RS( op ) != 0 ) + flags = STEP_COND | step_over_extra( 1 ); } break; } @@ -332,15 +339,19 @@ break; case OP_BEQ: util::stream_format( stream, "beq %s,%s,$%08x", s_cpugenreg[ INS_RS( op ) ], s_cpugenreg[ INS_RT( op ) ], relative_address( pc, op ) ); + flags = STEP_COND | step_over_extra( 1 ); break; case OP_BNE: util::stream_format( stream, "bne %s,%s,$%08x", s_cpugenreg[ INS_RS( op ) ], s_cpugenreg[ INS_RT( op ) ], relative_address( pc, op ) ); + flags = STEP_COND | step_over_extra( 1 ); break; case OP_BLEZ: util::stream_format( stream, "blez %s,%s,$%08x", s_cpugenreg[ INS_RS( op ) ], s_cpugenreg[ INS_RT( op ) ], relative_address( pc, op ) ); + flags = STEP_COND | step_over_extra( 1 ); break; case OP_BGTZ: util::stream_format( stream, "bgtz %s,%s,$%08x", s_cpugenreg[ INS_RS( op ) ], s_cpugenreg[ INS_RT( op ) ], relative_address( pc, op ) ); + flags = STEP_COND | step_over_extra( 1 ); break; case OP_ADDI: util::stream_format( stream, "addi %s,%s,%s", s_cpugenreg[ INS_RT( op ) ], s_cpugenreg[ INS_RS( op ) ], make_signed_hex_str_16( INS_IMMEDIATE( op ) ) ); @@ -392,6 +403,7 @@ util::stream_format( stream, "bc0t $%08x", relative_address( pc, op ) ); break; } + flags = STEP_COND | step_over_extra( 1 ); break; default: switch( INS_CO( op ) ) @@ -449,6 +461,7 @@ util::stream_format( stream, "bc1t $%08x", relative_address( pc, op ) ); break; } + flags = STEP_COND | step_over_extra( 1 ); break; default: switch( INS_CO( op ) ) @@ -486,6 +499,7 @@ util::stream_format( stream, "bc2t $%08x", relative_address( pc, op ) ); break; } + flags = STEP_COND | step_over_extra( 1 ); break; default: switch( INS_CO( op ) ) @@ -596,6 +610,7 @@ util::stream_format( stream, "bc3t $%08x", relative_address( pc, op ) ); break; } + flags = STEP_COND | step_over_extra( 1 ); break; default: switch( INS_CO( op ) ) diff -Nru mame-0.242+dfsg.1/src/devices/cpu/rii/riidasm.cpp mame-0.243+dfsg.1/src/devices/cpu/rii/riidasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/rii/riidasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/rii/riidasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -412,7 +412,7 @@ format_immediate(stream, opcode & 0x00ff); stream << ","; format_address(stream, (pc & 0x30000) | opcodes.r16(pc + 1)); - words = 2; + words = 2 | STEP_COND; break; case 0x4800: @@ -420,7 +420,7 @@ format_immediate(stream, opcode & 0x00ff); stream << ","; format_address(stream, (pc & 0x30000) | opcodes.r16(pc + 1)); - words = 2; + words = 2 | STEP_COND; break; case 0x4900: @@ -428,7 +428,7 @@ format_immediate(stream, opcode & 0x00ff); stream << ","; format_address(stream, (pc & 0x30000) | opcodes.r16(pc + 1)); - words = 2; + words = 2 | STEP_COND; break; case 0x4a00: @@ -466,7 +466,7 @@ format_register(stream, opcode & 0x00ff); stream << ","; format_address(stream, (pc & 0x30000) | opcodes.r16(pc + 1)); - words = 2; + words = 2 | STEP_COND; break; case 0x5100: @@ -474,7 +474,7 @@ format_register(stream, opcode & 0x00ff); stream << ","; format_address(stream, (pc & 0x30000) | opcodes.r16(pc + 1)); - words = 2; + words = 2 | STEP_COND; break; case 0x5200: @@ -482,7 +482,7 @@ format_register(stream, opcode & 0x00ff); stream << ","; format_address(stream, (pc & 0x30000) | opcodes.r16(pc + 1)); - words = 2; + words = 2 | STEP_COND; break; case 0x5300: @@ -490,7 +490,7 @@ format_register(stream, opcode & 0x00ff); stream << ","; format_address(stream, (pc & 0x30000) | opcodes.r16(pc + 1)); - words = 2; + words = 2 | STEP_COND; break; case 0x5500: @@ -498,7 +498,7 @@ format_register(stream, opcode & 0x00ff); stream << ","; format_address(stream, (pc & 0x30000) | opcodes.r16(pc + 1)); - words = 2; + words = 2 | STEP_COND; break; case 0x5600: @@ -506,7 +506,7 @@ format_register(stream, opcode & 0x00ff); stream << ","; format_address(stream, (pc & 0x30000) | opcodes.r16(pc + 1)); - words = 2; + words = 2 | STEP_COND; break; case 0x5700: @@ -514,7 +514,7 @@ format_register(stream, opcode & 0x00ff); stream << ","; format_address(stream, (pc & 0x30000) | opcodes.r16(pc + 1)); - words = 2; + words = 2 | STEP_COND; break; case 0x5800: case 0x5900: case 0x5a00: case 0x5b00: @@ -523,7 +523,7 @@ format_register(stream, opcode & 0x00ff); util::stream_format(stream, ",%d,", (opcode & 0x0700) >> 8); format_address(stream, (pc & 0x30000) | opcodes.r16(pc + 1)); - words = 2; + words = 2 | STEP_COND; break; case 0x6000: case 0x6100: case 0x6200: case 0x6300: @@ -532,7 +532,7 @@ format_register(stream, opcode & 0x00ff); util::stream_format(stream, ",%d,", (opcode & 0x0700) >> 8); format_address(stream, (pc & 0x30000) | opcodes.r16(pc + 1)); - words = 2; + words = 2 | STEP_COND; break; case 0x6800: case 0x6900: case 0x6a00: case 0x6b00: diff -Nru mame-0.242+dfsg.1/src/devices/cpu/romp/romp.cpp mame-0.243+dfsg.1/src/devices/cpu/romp/romp.cpp --- mame-0.242+dfsg.1/src/devices/cpu/romp/romp.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/romp/romp.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -17,7 +17,6 @@ #include "emu.h" #include "romp.h" #include "rompdasm.h" -#include "debugger.h" #define LOG_GENERAL (1U << 0) #define LOG_INTERRUPT (1U << 1) diff -Nru mame-0.242+dfsg.1/src/devices/cpu/romp/rompdasm.cpp mame-0.243+dfsg.1/src/devices/cpu/romp/rompdasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/romp/rompdasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/romp/rompdasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -43,7 +43,11 @@ switch (op >> 12) { // JI format - case 0x0: util::stream_format(stream, "j%-4s 0x%x", cc[(op >> 8) & 15], pc + (s32(s8(op)) << 1)); break; // jump on [not] condition bit + case 0x0: // jump on [not] condition bit + util::stream_format(stream, "j%-4s 0x%x", cc[(op >> 8) & 15], pc + (s32(s8(op)) << 1)); + if (((op >> 8) & 7) != 0) + flags = STEP_COND; + break; // DS format case 0x1: util::stream_format(stream, "stcs %s,%s", gpr[R2], R3_0((op >> 8) & 15, R3)); break; // store character short @@ -74,8 +78,16 @@ case 0x8b: util::stream_format(stream, "balax 0x%x", b & 0x00fffffeU); flags |= STEP_OVER | step_over_extra(1); break; // branch and link absolute with execute case 0x8c: util::stream_format(stream, "bali %s,0x%x", gpr[R2], pc + (s32(b << 12) >> 11)); flags |= STEP_OVER; break; // branch and link immediate case 0x8d: util::stream_format(stream, "balix %s,0x%x", gpr[R2], pc + (s32(b << 12) >> 11)); flags |= STEP_OVER | step_over_extra(1); break; // branch and link immediate with execute - case 0x8e: util::stream_format(stream, "b%-4s 0x%x", cc[N], pc + (s32(b << 12) >> 11)); break; // branch on condition bit immediate - case 0x8f: util::stream_format(stream, "b%-4s 0x%x", util::string_format("%sx", cc[N]), pc + (s32(b << 12) >> 11)); break; // branch on condition bit immediate with execute + case 0x8e: // branch on condition bit immediate + util::stream_format(stream, "b%-4s 0x%x", cc[N], pc + (s32(b << 12) >> 11)); + if (N != 8) + flags |= STEP_COND; + break; + case 0x8f: // branch on condition bit immediate with execute + util::stream_format(stream, "b%-4s 0x%x", util::string_format("%sx", cc[N]), pc + (s32(b << 12) >> 11)); + if (N != 8) + flags |= STEP_COND | step_over_extra(1); + break; } } break; @@ -101,7 +113,11 @@ case 0xc9: util::stream_format(stream, "lm %s,%s", gpr[R2], R3_0(s16(i), R3)); break; // load multiple case 0xca: util::stream_format(stream, "lha %s,%s", gpr[R2], R3_0(s16(i), R3)); break; // load half algebraic case 0xcb: util::stream_format(stream, "ior %s,%s", gpr[R2], R3_0(s16(i), R3)); break; // input/output read - case 0xcc: util::stream_format(stream, "t%-4s %s,0x%x", tc[R2 & 7], gpr[R3], s16(i)); break; // trap on condition immediate + case 0xcc: // trap on condition immediate + util::stream_format(stream, "t%-4s %s,0x%x", tc[R2 & 7], gpr[R3], s16(i)); + if ((R2 & 7) != 0) + flags |= STEP_OVER | STEP_COND; + break; case 0xcd: util::stream_format(stream, "l %s,%s", gpr[R2], R3_0(s16(i), R3)); break; // load case 0xce: util::stream_format(stream, "lc %s,%s", gpr[R2], R3_0(s16(i), R3)); break; // load character case 0xcf: util::stream_format(stream, "tsh %s,%s", gpr[R2], R3_0(s16(i), R3)); break; // test and set half @@ -190,14 +206,38 @@ case 0xe5: util::stream_format(stream, "n %s,%s", gpr[R2], gpr[R3]); break; // and case 0xe6: util::stream_format(stream, "m %s,%s", gpr[R2], gpr[R3]); break; // multiply step case 0xe7: util::stream_format(stream, "x %s,%s", gpr[R2], gpr[R3]); break; // exclusive or - case 0xe8: util::stream_format(stream, "b%-5s %s", util::string_format("%sr", cc[N - 8]), gpr[R3]); break; // branch on not condition bit - case 0xe9: util::stream_format(stream, "b%-5s %s", util::string_format("%srx", cc[N - 8]), gpr[R3]); break; // branch on not condition bit with execute + case 0xe8: // branch on not condition bit + util::stream_format(stream, "b%-5s %s", util::string_format("%sr", cc[N - 8]), gpr[R3]); + if (N != 8) + flags |= STEP_COND; + if (R3 == 15) + flags |= STEP_OUT; + break; + case 0xe9: // branch on not condition bit with execute + util::stream_format(stream, "b%-5s %s", util::string_format("%srx", cc[N - 8]), gpr[R3]); + if (N != 8) + flags |= STEP_COND | step_over_extra(1); + if (R3 == 15) + flags |= STEP_OUT | step_over_extra(1); + break; // ea case 0xeb: util::stream_format(stream, "lhs %s,0(%s)", gpr[R2], gpr[R3]); break; // load half short case 0xec: util::stream_format(stream, "balr %s,%s", gpr[R2], gpr[R3]); flags |= STEP_OVER; break; // branch and link case 0xed: util::stream_format(stream, "balrx %s,%s", gpr[R2], gpr[R3]); flags |= STEP_OVER | step_over_extra(1); break; // branch and link with execute - case 0xee: util::stream_format(stream, "b%-5s %s", util::string_format("%sr", cc[N]), gpr[R3]); break; // branch on condition bit - case 0xef: util::stream_format(stream, "b%-5s %s", util::string_format("%srx", cc[N]), gpr[R3]); break; // branch on condition bit with execute + case 0xee: // branch on condition bit + util::stream_format(stream, "b%-5s %s", util::string_format("%sr", cc[N]), gpr[R3]); break; + if (N != 8) + flags |= STEP_COND; + if (R3 == 15) + flags |= STEP_OUT; + break; + case 0xef: // branch on condition bit with execute + util::stream_format(stream, "b%-5s %s", util::string_format("%srx", cc[N]), gpr[R3]); + if (N != 8) + flags |= STEP_COND | step_over_extra(1); + if (R3 == 15) + flags |= STEP_OUT | step_over_extra(1); + break; case 0xf0: util::stream_format(stream, "wait"); break; // wait case 0xf1: util::stream_format(stream, "ae %s,%s", gpr[R2], gpr[R3]); break; // add extended diff -Nru mame-0.242+dfsg.1/src/devices/cpu/rsp/rsp.cpp mame-0.243+dfsg.1/src/devices/cpu/rsp/rsp.cpp --- mame-0.242+dfsg.1/src/devices/cpu/rsp/rsp.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/rsp/rsp.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -9,8 +9,6 @@ #include "emu.h" #include "rsp.h" -#include "debugger.h" - #include "rspdefs.h" #include "rspdiv.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/rsp/rsp_dasm.cpp mame-0.243+dfsg.1/src/devices/cpu/rsp/rsp_dasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/rsp/rsp_dasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/rsp/rsp_dasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -268,7 +268,7 @@ case 0x04: util::stream_format(stream, "sllv %s, %s, %s", reg[rd], reg[rt], reg[rs]); break; case 0x06: util::stream_format(stream, "srlv %s, %s, %s", reg[rd], reg[rt], reg[rs]); break; case 0x07: util::stream_format(stream, "srav %s, %s, %s", reg[rd], reg[rt], reg[rs]); break; - case 0x08: util::stream_format(stream, "jr %s", reg[rs]); if (rs == 31) flags = STEP_OUT; break; + case 0x08: util::stream_format(stream, "jr %s", reg[rs]); if (rs == 31) flags = STEP_OUT | step_over_extra(1); break; case 0x09: { if (rd == 31) @@ -303,10 +303,10 @@ { switch ((op >> 16) & 0x1f) { - case 0x00: util::stream_format(stream, "bltz %s, $%08X", reg[rs], pc + 4 + ((int16_t)op << 2)); break; - case 0x01: util::stream_format(stream, "bgez %s, $%08X", reg[rs], pc + 4 + ((int16_t)op << 2)); break; - case 0x10: util::stream_format(stream, "bltzal %s, $%08X", reg[rs], pc + 4 + ((int16_t)op << 2)); break; - case 0x11: util::stream_format(stream, "bgezal %s, $%08X", reg[rs], pc + 4 + ((int16_t)op << 2)); break; + case 0x00: util::stream_format(stream, "bltz %s, $%08X", reg[rs], pc + 4 + ((int16_t)op << 2)); if (rs != 0) flags = STEP_COND | step_over_extra(1); break; + case 0x01: util::stream_format(stream, "bgez %s, $%08X", reg[rs], pc + 4 + ((int16_t)op << 2)); if (rs != 0) flags = STEP_COND | step_over_extra(1); break; + case 0x10: util::stream_format(stream, "bltzal %s, $%08X", reg[rs], pc + 4 + ((int16_t)op << 2)); if (rs != 0) flags = STEP_OVER | STEP_COND | step_over_extra(1); break; + case 0x11: util::stream_format(stream, "bgezal %s, $%08X", reg[rs], pc + 4 + ((int16_t)op << 2)); flags = STEP_OVER | step_over_extra(1); if (rs != 0) flags |= STEP_COND; break; default: util::stream_format(stream, "???"); break; } @@ -315,10 +315,10 @@ case 0x02: util::stream_format(stream, "j $%08X", (op & 0x03ffffff) << 2); break; case 0x03: util::stream_format(stream, "jal $%08X", (op & 0x03ffffff) << 2); break; - case 0x04: util::stream_format(stream, "beq %s, %s, $%08X", reg[rs], reg[rt], pc + 4 + ((int16_t)(op) << 2)); break; - case 0x05: util::stream_format(stream, "bne %s, %s, $%08X", reg[rs], reg[rt], pc + 4 + ((int16_t)(op) << 2)); break; - case 0x06: util::stream_format(stream, "blez %s, $%08X", reg[rs], pc + 4 + ((int16_t)(op) << 2)); break; - case 0x07: util::stream_format(stream, "bgtz %s, $%08X", reg[rs], pc + 4 + ((int16_t)(op) << 2)); break; + case 0x04: util::stream_format(stream, "beq %s, %s, $%08X", reg[rs], reg[rt], pc + 4 + ((int16_t)(op) << 2)); if (rs != rt) flags = STEP_COND | step_over_extra(1); break; + case 0x05: util::stream_format(stream, "bne %s, %s, $%08X", reg[rs], reg[rt], pc + 4 + ((int16_t)(op) << 2)); if (rs != rt) flags = STEP_COND | step_over_extra(1); break; + case 0x06: util::stream_format(stream, "blez %s, $%08X", reg[rs], pc + 4 + ((int16_t)(op) << 2)); if (rs != 0) flags = STEP_COND | step_over_extra(1); break; + case 0x07: util::stream_format(stream, "bgtz %s, $%08X", reg[rs], pc + 4 + ((int16_t)(op) << 2)); if (rs != 0) flags = STEP_COND | step_over_extra(1); break; case 0x08: util::stream_format(stream, "addi %s, %s, %s", reg[rt], reg[rs], signed_imm16(op)); break; case 0x09: util::stream_format(stream, "addiu %s, %s, %s", reg[rt], reg[rs], signed_imm16(op)); break; case 0x0a: util::stream_format(stream, "slti %s, %s, %s", reg[rt], reg[rs], signed_imm16(op)); break; diff -Nru mame-0.242+dfsg.1/src/devices/cpu/rw5000/a5000.cpp mame-0.243+dfsg.1/src/devices/cpu/rw5000/a5000.cpp --- mame-0.242+dfsg.1/src/devices/cpu/rw5000/a5000.cpp 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/rw5000/a5000.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,86 @@ +// license:BSD-3-Clause +// copyright-holders:hap +/* + + Rockwell A5000 MCU + +*/ + +#include "emu.h" +#include "a5000.h" + +#include "rw5000d.h" + + +DEFINE_DEVICE_TYPE(A5000, a5000_cpu_device, "a5000", "Rockwell A5000") + + +// constructor +a5000_cpu_device::a5000_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data) : + b5000_cpu_device(mconfig, type, tag, owner, clock, prgwidth, program, datawidth, data) +{ } + +a5000_cpu_device::a5000_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + a5000_cpu_device(mconfig, A5000, tag, owner, clock, 9, address_map_constructor(FUNC(a5000_cpu_device::program_448x8), this), 6, address_map_constructor(FUNC(a5000_cpu_device::data_45x4), this)) +{ } + + +// disasm +std::unique_ptr a5000_cpu_device::create_disassembler() +{ + return std::make_unique(); +} + + +//------------------------------------------------- +// execute +//------------------------------------------------- + +void a5000_cpu_device::execute_one() +{ + switch (m_op) + { + case 0x02: op_illegal(); break; + case 0x03: op_tkb(); break; + case 0x76: m_mtd_step = 1; break; + case 0x77: op_atb(); break; + + // rest is same as B5000 + default: b5000_cpu_device::execute_one(); break; + } +} + + +//------------------------------------------------- +// changed opcodes (no need for separate file) +//------------------------------------------------- + +void a5000_cpu_device::op_mtd_step() +{ + assert(m_mtd_step > 0); + + // MTD: load strobe + segments (multi step) + switch (m_mtd_step) + { + // step 1: disable strobe and segment drivers + case 1: + m_write_str(0); + op_kseg(); + break; + + // step 2: load strobe from Bl + case 2: + m_write_str(1 << m_prev_bl); + break; + + // step 4: load segment drivers + case 4: + seg_w(m_seg | decode_digit(m_prev3_c << 4 | ram_r())); + m_mtd_step = 0; + return; + + default: + break; + } + m_mtd_step++; +} diff -Nru mame-0.242+dfsg.1/src/devices/cpu/rw5000/a5000.h mame-0.243+dfsg.1/src/devices/cpu/rw5000/a5000.h --- mame-0.242+dfsg.1/src/devices/cpu/rw5000/a5000.h 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/rw5000/a5000.h 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,37 @@ +// license:BSD-3-Clause +// copyright-holders:hap +/* + + Rockwell A5000 MCU + +*/ + +#ifndef MAME_CPU_RW5000_A5000_H +#define MAME_CPU_RW5000_A5000_H + +#pragma once + +#include "b5000.h" + + +class a5000_cpu_device : public b5000_cpu_device +{ +public: + a5000_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + +protected: + a5000_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data); + + // device_disasm_interface overrides + virtual std::unique_ptr create_disassembler() override; + + virtual void execute_one() override; + + // opcode handlers + virtual void op_mtd_step() override; +}; + + +DECLARE_DEVICE_TYPE(A5000, a5000_cpu_device) + +#endif // MAME_CPU_RW5000_A5000_H diff -Nru mame-0.242+dfsg.1/src/devices/cpu/rw5000/a5500.cpp mame-0.243+dfsg.1/src/devices/cpu/rw5000/a5500.cpp --- mame-0.242+dfsg.1/src/devices/cpu/rw5000/a5500.cpp 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/rw5000/a5500.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,78 @@ +// license:BSD-3-Clause +// copyright-holders:hap +/* + + Rockwell A5500 MCU + +*/ + +#include "emu.h" +#include "a5500.h" + +#include "rw5000d.h" + + +DEFINE_DEVICE_TYPE(A5500, a5500_cpu_device, "a5500", "Rockwell A5500") + + +// constructor +a5500_cpu_device::a5500_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data) : + a5000_cpu_device(mconfig, type, tag, owner, clock, prgwidth, program, datawidth, data) +{ } + +a5500_cpu_device::a5500_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + a5500_cpu_device(mconfig, A5500, tag, owner, clock, 10, address_map_constructor(FUNC(a5500_cpu_device::program_768x8), this), 6, address_map_constructor(FUNC(a5500_cpu_device::data_48x4), this)) +{ } + + +// internal memory maps +void a5500_cpu_device::program_768x8(address_map &map) +{ + map(0x000, 0x27f).rom(); + map(0x380, 0x3ff).rom(); +} + +void a5500_cpu_device::data_48x4(address_map &map) +{ + map(0x00, 0x0b).ram(); + map(0x10, 0x1b).ram(); + map(0x20, 0x2b).ram(); + map(0x30, 0x3b).ram(); +} + + +// disasm +std::unique_ptr a5500_cpu_device::create_disassembler() +{ + return std::make_unique(); +} + + +//------------------------------------------------- +// execute +//------------------------------------------------- + +void a5500_cpu_device::execute_one() +{ + switch (m_op) + { + case 0x1c: case 0x1d: case 0x1e: case 0x1f: op_lb(11); break; + case 0x38: case 0x39: case 0x3a: case 0x3b: op_tl(); break; + + case 0x0c: op_sc(); break; + case 0x0d: op_rsc(); break; + + // rest is same as A5000 + default: a5000_cpu_device::execute_one(); break; + } +} + +bool a5500_cpu_device::op_is_tl(u8 op) +{ + return a5000_cpu_device::op_is_tl(op) || ((op & 0xfc) == 0x38); +} + +bool a5500_cpu_device::op_is_lb(u8 op) +{ + return a5000_cpu_device::op_is_lb(op) || ((op & 0xfc) == 0x1c); +} diff -Nru mame-0.242+dfsg.1/src/devices/cpu/rw5000/a5500.h mame-0.243+dfsg.1/src/devices/cpu/rw5000/a5500.h --- mame-0.242+dfsg.1/src/devices/cpu/rw5000/a5500.h 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/rw5000/a5500.h 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,43 @@ +// license:BSD-3-Clause +// copyright-holders:hap +/* + + Rockwell A5500 MCU + +*/ + +#ifndef MAME_CPU_RW5000_A5500_H +#define MAME_CPU_RW5000_A5500_H + +#pragma once + +#include "a5000.h" + + +class a5500_cpu_device : public a5000_cpu_device +{ +public: + a5500_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + +protected: + a5500_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data); + + // device_disasm_interface overrides + virtual std::unique_ptr create_disassembler() override; + + // device_execute_interface overrides + virtual void execute_one() override; + + virtual bool op_is_tl(u8 op) override; + virtual bool op_is_lb(u8 op) override; + virtual void reset_pc() override { set_pc(0, 0); } + virtual u8 sr_page() override { return 15; } + + void program_768x8(address_map &map); + void data_48x4(address_map &map); +}; + + +DECLARE_DEVICE_TYPE(A5500, a5500_cpu_device) + +#endif // MAME_CPU_RW5000_A5500_H diff -Nru mame-0.242+dfsg.1/src/devices/cpu/rw5000/a5900.cpp mame-0.243+dfsg.1/src/devices/cpu/rw5000/a5900.cpp --- mame-0.242+dfsg.1/src/devices/cpu/rw5000/a5900.cpp 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/rw5000/a5900.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,42 @@ +// license:BSD-3-Clause +// copyright-holders:hap +/* + + Rockwell A5900 MCU + +TODO: +- what happens when 0 or >1 keys are held down on READ? + +*/ + +#include "emu.h" +#include "a5900.h" + + +DEFINE_DEVICE_TYPE(A5900, a5900_cpu_device, "a5900", "Rockwell A5900") + + +// constructor +a5900_cpu_device::a5900_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + a5000_cpu_device(mconfig, A5900, tag, owner, clock, 9, address_map_constructor(FUNC(a5900_cpu_device::program_512x8), this), 6, address_map_constructor(FUNC(a5900_cpu_device::data_45x4), this)) +{ } + + +// internal memory maps +void a5900_cpu_device::program_512x8(address_map &map) +{ + map(0x000, 0x1ff).rom(); +} + + +//------------------------------------------------- +// changed opcodes (no need for separate file) +//------------------------------------------------- + +void a5900_cpu_device::op_read() +{ + // READ: add _KB (prioritized) to A, skip next on no overflow + m_a += ~((count_leading_zeros_32(m_read_kb() & 0xf) - 28) & 3) & 0xf; + m_skip = !BIT(m_a, 4); + m_a &= 0xf; +} diff -Nru mame-0.242+dfsg.1/src/devices/cpu/rw5000/a5900.h mame-0.243+dfsg.1/src/devices/cpu/rw5000/a5900.h --- mame-0.242+dfsg.1/src/devices/cpu/rw5000/a5900.h 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/rw5000/a5900.h 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,32 @@ +// license:BSD-3-Clause +// copyright-holders:hap +/* + + Rockwell A5900 MCU + +*/ + +#ifndef MAME_CPU_RW5000_A5900_H +#define MAME_CPU_RW5000_A5900_H + +#pragma once + +#include "a5000.h" + + +class a5900_cpu_device : public a5000_cpu_device +{ +public: + a5900_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + +protected: + void program_512x8(address_map &map); + + // opcode handlers + virtual void op_read() override; +}; + + +DECLARE_DEVICE_TYPE(A5900, a5900_cpu_device) + +#endif // MAME_CPU_RW5000_A5900_H diff -Nru mame-0.242+dfsg.1/src/devices/cpu/rw5000/b5000.cpp mame-0.243+dfsg.1/src/devices/cpu/rw5000/b5000.cpp --- mame-0.242+dfsg.1/src/devices/cpu/rw5000/b5000.cpp 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/rw5000/b5000.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,164 @@ +// license:BSD-3-Clause +// copyright-holders:hap +/* + + Rockwell B5000 MCU + +TODO: +- is unmapped ram mirrored? (that goes for subdevices too) +- not sure how 7seg zero suppression works, the only documentation for it + is a block diagram with the logic connected to the 7seg decoder +- fill unknown data in segment decoder, it's not on a neat PLA +- is ATB an unskippable opcode? nothing relies on it + +*/ + +#include "emu.h" +#include "b5000.h" + +#include "rw5000d.h" + + +DEFINE_DEVICE_TYPE(B5000, b5000_cpu_device, "b5000", "Rockwell B5000") + + +// constructor +b5000_cpu_device::b5000_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data) : + rw5000_base_device(mconfig, type, tag, owner, clock, prgwidth, program, datawidth, data) +{ } + +b5000_cpu_device::b5000_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + b5000_cpu_device(mconfig, B5000, tag, owner, clock, 9, address_map_constructor(FUNC(b5000_cpu_device::program_448x8), this), 6, address_map_constructor(FUNC(b5000_cpu_device::data_45x4), this)) +{ } + + +// internal memory maps +void b5000_cpu_device::program_448x8(address_map &map) +{ + map(0x000, 0x0bf).rom(); + map(0x100, 0x1ff).rom(); +} + +void b5000_cpu_device::data_45x4(address_map &map) +{ + map(0x00, 0x0b).ram(); + map(0x10, 0x1a).ram(); + map(0x20, 0x2a).ram(); + map(0x30, 0x3a).ram(); +} + + +// disasm +std::unique_ptr b5000_cpu_device::create_disassembler() +{ + return std::make_unique(); +} + + +// digit segment decoder +u16 b5000_cpu_device::decode_digit(u8 data) +{ + static u8 lut_segs[0x10] = + { + // 0-9 ok (6 and 9 have tails) + 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, + + // ?, ?, newline?, -, ?, ? + 0, 0, 0x00, 0x40, 0, 0 + }; + + u8 dp = BIT(data, 4); + u8 seg = lut_segs[data & 0xf]; + + // zero suppression logic is done in hardware + if (data > 0) + m_suppress0 = false; + if (m_suppress0) + seg = 0; + if ((data & 0xf) >= 0xc) + m_suppress0 = true; + + return seg << 1 | dp; +} + + +//------------------------------------------------- +// execute +//------------------------------------------------- + +void b5000_cpu_device::execute_one() +{ + switch (m_op & 0xf0) + { + case 0x40: op_lax(); break; + case 0x60: + if (m_op != 0x6f) + op_adx(); + else + op_read(); + break; + + case 0x80: case 0x90: case 0xa0: case 0xb0: + case 0xc0: case 0xd0: case 0xe0: case 0xf0: + m_tra_step = 1; break; + + default: + switch (m_op & 0xfc) + { + case 0x04: op_tdin(); break; + case 0x08: op_tm(); break; + case 0x10: op_sm(); break; + case 0x14: op_rsm(); break; + case 0x18: m_ret_step = 1; break; + + case 0x20: op_lb(7); break; + case 0x24: op_lb(10); break; + case 0x28: op_lb(9); break; + case 0x2c: op_lb(8); break; + case 0x3c: op_lb(0); break; + + case 0x30: case 0x34: op_tl(); break; + + case 0x50: op_lda(); break; + case 0x54: op_excp(); break; + case 0x58: op_exc0(); break; + case 0x5c: op_excm(); break; + case 0x70: op_add(); break; + case 0x78: op_comp(); break; + case 0x7c: op_tam(); break; + + default: + switch (m_op) + { + case 0x00: op_nop(); break; + case 0x01: op_tc(); break; + case 0x02: op_tkb(); break; + case 0x03: op_tkbs(); break; + case 0x39: op_rsc(); break; + case 0x3b: op_sc(); break; + case 0x74: op_kseg(); break; + case 0x77: m_atb_step = 1; break; + + default: op_illegal(); break; + } + break; // 0xff + + } + break; // 0xfc + } +} + +bool b5000_cpu_device::op_is_tl(u8 op) +{ + return ((op & 0xf8) == 0x30); +} + +bool b5000_cpu_device::op_is_lb(u8 op) +{ + return ((op & 0xf0) == 0x20) || ((op & 0xfc) == 0x3c); +} + +bool b5000_cpu_device::op_is_atb(u8 op) +{ + return (op == 0x77); +} diff -Nru mame-0.242+dfsg.1/src/devices/cpu/rw5000/b5000.h mame-0.243+dfsg.1/src/devices/cpu/rw5000/b5000.h --- mame-0.242+dfsg.1/src/devices/cpu/rw5000/b5000.h 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/rw5000/b5000.h 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,113 @@ +// license:BSD-3-Clause +// copyright-holders:hap +/* + + Rockwell B5000 MCU + +*/ + +#ifndef MAME_CPU_RW5000_B5000_H +#define MAME_CPU_RW5000_B5000_H + +#pragma once + +#include "rw5000base.h" + +// pinout reference (preliminary, other A/B5xxx pinouts are same or very similar) + +/* + _____ _____ + VSS 1 |* \_/ | 42 NC + CLK? 2 | | 41 NC + VC? 3 | | 40 NC + NC 4 | | 39 VDD + NC 5 | | 38 STR8 + NC 6 | | 37 STR7 + NC 7 | | 36 STR6 + NC 8 | | 35 STR5 + NC 9 | | 34 STR4 + NC 10 | B5000 | 33 STR3 + KB3 11 | | 32 STR2 + DIN1? 12 | | 31 STR1 + KB1 13 | | 30 STR0 + KB2 14 | | 29 SEG7 + KB4 15 | | 28 SEG6 + NC 16 | | 27 SEG5 + NC 17 | | 26 SEG4 + NC 18 | | 25 SEG3 + NC 19 | | 24 SEG2 + NC 20 | _ | 23 SEG1 + NC 21 |_____/ \_____| 22 SEG0 + +*/ + +class b5000_cpu_device : public rw5000_base_device +{ +public: + b5000_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + +protected: + b5000_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data); + + // device_disasm_interface overrides + virtual std::unique_ptr create_disassembler() override; + + // device_execute_interface overrides + virtual void execute_one() override; + + virtual bool op_canskip(u8 op) override { return !op_is_tl(op); } + virtual bool op_is_tl(u8 op); + virtual bool op_is_lb(u8 op); + virtual bool op_is_atb(u8 op); + virtual void reset_pc() override { set_pc(7, 0); } + virtual u8 sr_page() { return 0; } + virtual u16 decode_digit(u8 data); + + void program_448x8(address_map &map); + void data_45x4(address_map &map); + + // opcode helpers + u8 ram_r(); + void ram_w(u8 data); + void set_pc(u8 pu, u8 pl); + void set_bu(u8 bu); + void seg_w(u16 seg); + void op_illegal(); + + // opcode handlers + virtual void op_tl(); + virtual void op_tra_step() override; + virtual void op_ret_step() override; + virtual void op_nop(); + + virtual void op_lb(u8 bl); + virtual void op_atb(); + virtual void op_lda(); + virtual void op_exc0(); + virtual void op_excp(); + virtual void op_excm(); + virtual void op_sm(); + virtual void op_rsm(); + virtual void op_tm(); + virtual void op_tam(); + + virtual void op_lax(); + virtual void op_comp(); + virtual void op_adx(); + virtual void op_add(); + virtual void op_sc(); + virtual void op_rsc(); + virtual void op_tc(); + + virtual void op_kseg(); + virtual void op_atb_step() override; + virtual void op_tkb(); + virtual void op_tkbs(); + virtual void op_read(); + virtual void op_tdin(); +}; + + +DECLARE_DEVICE_TYPE(B5000, b5000_cpu_device) + +#endif // MAME_CPU_RW5000_B5000_H diff -Nru mame-0.242+dfsg.1/src/devices/cpu/rw5000/b5000op.cpp mame-0.243+dfsg.1/src/devices/cpu/rw5000/b5000op.cpp --- mame-0.242+dfsg.1/src/devices/cpu/rw5000/b5000op.cpp 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/rw5000/b5000op.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,331 @@ +// license:BSD-3-Clause +// copyright-holders:hap + +// B5000 common opcode handlers + +#include "emu.h" +#include "b5000.h" + + +// internal helpers + +u8 b5000_cpu_device::ram_r() +{ + return m_data->read_byte(m_ram_addr) & 0xf; +} + +void b5000_cpu_device::ram_w(u8 data) +{ + m_data->write_byte(m_ram_addr, data & 0xf); +} + +void b5000_cpu_device::set_pc(u8 pu, u8 pl) +{ + m_pc = ((pu << 6) | (pl & 0x3f)) & m_prgmask; +} + +void b5000_cpu_device::set_bu(u8 bu) +{ + m_bu = bu & 3; + + // changing to or from 0 delays RAM address modification + if (bool(m_bu) != bool(m_prev_bu)) + m_bu_delay = true; +} + +void b5000_cpu_device::seg_w(u16 seg) +{ + m_write_seg(m_seg = seg); +} + +void b5000_cpu_device::op_illegal() +{ + logerror("unknown opcode $%02X at $%03X\n", m_op, m_prev_pc); +} + + +// opcodes + +// ROM addressing instructions + +void b5000_cpu_device::op_tl() +{ + // TL z: set Pu to z + set_pc(m_op & 0xf, m_pc); + + // S is actually only 6-bit + m_s = (m_pc & ~0x3f) | (m_s & 0x3f); +} + +void b5000_cpu_device::op_tra_step() +{ + assert(m_tra_step > 0); + + // TRA 0/1,x: call/jump to x (multi step) + switch (m_tra_step) + { + // step 1: skip next opcode + // TL is unskippable, that's how it does long jumps + case 1: + m_skip = true; + break; + + // step 2: handle the call/jump + case 2: + if (!m_sr && ~m_prev_op & 0x40) + { + // call: push P to save register + m_sr = true; + m_s = (m_s & ~0x3f) | (m_prev_pc & 0x3f); + } + if (m_sr) + { + // SR set: set Pu to subroutine page + set_pc(sr_page() ^ BIT(m_prev_op, 6), m_pc); + } + + // set Pl to x + set_pc(m_pc >> 6, m_prev_op); + m_tra_step = 0; + return; + + default: + break; + } + m_tra_step++; +} + +void b5000_cpu_device::op_ret_step() +{ + assert(m_ret_step > 0); + + // RET: return from subroutine (multi step) + switch (m_ret_step) + { + // step 1: skip next opcode + // a TL after RET will return to the page specified by TL + case 1: + m_skip = true; + break; + + // step 2: handle the ret + case 2: + m_pc = m_s; + m_sr = false; + m_ret_step = 0; + return; + + default: + break; + } + m_ret_step++; +} + +void b5000_cpu_device::op_nop() +{ + // NOP: no operation +} + + +// RAM addressing instructions + +void b5000_cpu_device::op_lb(u8 bl) +{ + // LB x,y: load B from x,y (successive LB/ATB are ignored) + if (!op_is_lb(m_prev_op) && !op_is_atb(m_prev_op)) + { + m_bl = bl; + set_bu(m_op & 3); + } +} + +void b5000_cpu_device::op_atb() +{ + // ATB: load Bl from A (successive LB/ATB are ignored) + if (!op_is_lb(m_prev_op) && !op_is_atb(m_prev_op)) + { + m_bl = m_a; + m_bl_delay = true; + } +} + +void b5000_cpu_device::op_lda() +{ + // LDA x: load A from RAM, XOR Bu with x + m_a = ram_r(); + set_bu(m_op ^ m_bu); +} + +void b5000_cpu_device::op_exc0() +{ + // EXC x,0: exchange A with RAM, XOR Bu with x + u8 a = m_a; + m_a = ram_r(); + ram_w(a); + set_bu(m_op ^ m_bu); +} + +void b5000_cpu_device::op_excp() +{ + // EXC x,+1: EXC x,0 + increment Bl and skip on 3-bit overflow + op_exc0(); + m_bl = (m_bl + 1) & 0xf; + m_skip = (m_bl & 7) == 0; + m_bl_delay = true; +} + +void b5000_cpu_device::op_excm() +{ + // EXC x,-1: EXC x,0 + decrement Bl and skip on overflow + op_exc0(); + m_bl = (m_bl - 1) & 0xf; + m_skip = (m_bl == 0xf); + m_bl_delay = true; +} + +void b5000_cpu_device::op_sm() +{ + // SM x: set bit x in RAM + ram_w(ram_r() | (1 << (m_op & 3))); +} + +void b5000_cpu_device::op_rsm() +{ + // RSM x: reset bit x in RAM + ram_w(ram_r() & ~(1 << (m_op & 3))); +} + +void b5000_cpu_device::op_tm() +{ + // TM x: skip next if bit x in RAM is clear + m_skip = !BIT(ram_r(), m_op & 3); +} + +void b5000_cpu_device::op_tam() +{ + // TAM: skip next if A equals RAM + m_skip = (m_a == ram_r()); +} + + +// arithmetic instructions + +void b5000_cpu_device::op_lax() +{ + // LAX x: load A from x + m_a = ~m_op & 0xf; +} + +void b5000_cpu_device::op_comp() +{ + // COMP: complement A + m_a ^= 0xf; +} + +void b5000_cpu_device::op_adx() +{ + // ADX x: add x to A, skip on no overflow + m_a += ~m_op & 0xf; + m_skip = !BIT(m_a, 4); + m_a &= 0xf; +} + +void b5000_cpu_device::op_add() +{ + // ADD (C),(S): add RAM to A (optional carry/skip) + m_a += ram_r(); + if (~m_op & 2) + { + m_a += m_c; + m_c = BIT(m_a, 4); + } + if (m_op & 1) + m_skip = !BIT(m_a, 4); + m_a &= 0xf; +} + +void b5000_cpu_device::op_sc() +{ + // SC: set carry + m_c = 1; +} + +void b5000_cpu_device::op_rsc() +{ + // RSC: reset carry + m_c = 0; +} + +void b5000_cpu_device::op_tc() +{ + // TC: skip next on carry + m_skip = bool(m_c); +} + + +// I/O instructions + +void b5000_cpu_device::op_kseg() +{ + // KSEG: reset segment outputs + seg_w(0); +} + +void b5000_cpu_device::op_atb_step() +{ + assert(m_atb_step > 0); + + // ATB: ATB + load strobe (multi step) + switch (m_atb_step) + { + // step 1: ATB + KSEG + case 1: + op_atb(); + op_kseg(); + break; + + // step 3: disable strobe + case 3: + m_write_str(0); + break; + + // step 4: load strobe from Bl + case 4: + m_write_str(1 << m_prev_bl); + m_atb_step = 0; + return; + + default: + break; + } + m_atb_step++; +} + +void b5000_cpu_device::op_tkb() +{ + // TKB: skip next if any KB is high + m_skip = (m_read_kb() & 0xf) != 0; +} + +void b5000_cpu_device::op_tkbs() +{ + // TKBS: TKB + load segments + op_tkb(); + + // note: SEG0(DP) from C flag is delayed 2 cycles + seg_w(m_seg | decode_digit(m_prev3_c << 4 | ram_r())); +} + +void b5000_cpu_device::op_read() +{ + // READ: add _KB to A, skip next on no overflow + m_a += (~m_read_kb() & 0xf); + m_skip = !BIT(m_a, 4); + m_a &= 0xf; +} + +void b5000_cpu_device::op_tdin() +{ + // TDIN x: skip next if DIN x is high + m_skip = bool(BIT(m_read_din(), (m_op - 1) & 3)); +} diff -Nru mame-0.242+dfsg.1/src/devices/cpu/rw5000/b5500.cpp mame-0.243+dfsg.1/src/devices/cpu/rw5000/b5500.cpp --- mame-0.242+dfsg.1/src/devices/cpu/rw5000/b5500.cpp 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/rw5000/b5500.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,48 @@ +// license:BSD-3-Clause +// copyright-holders:hap +/* + + Rockwell B5500 MCU + +*/ + +#include "emu.h" +#include "b5500.h" + +#include "rw5000d.h" + + +DEFINE_DEVICE_TYPE(B5500, b5500_cpu_device, "b5500", "Rockwell B5500") + + +// constructor +b5500_cpu_device::b5500_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + a5500_cpu_device(mconfig, B5500, tag, owner, clock, 10, address_map_constructor(FUNC(b5500_cpu_device::program_768x8), this), 6, address_map_constructor(FUNC(b5500_cpu_device::data_48x4), this)) +{ } + + +// disasm +std::unique_ptr b5500_cpu_device::create_disassembler() +{ + return std::make_unique(); +} + + +//------------------------------------------------- +// execute +//------------------------------------------------- + +void b5500_cpu_device::execute_one() +{ + switch (m_op) + { + case 0x1c: case 0x1d: case 0x1e: case 0x1f: op_lb(11); break; + case 0x38: case 0x39: case 0x3a: case 0x3b: op_tl(); break; + + case 0x0c: op_sc(); break; + case 0x0d: op_rsc(); break; + + // rest is same as B5000 + default: b5000_cpu_device::execute_one(); break; + } +} diff -Nru mame-0.242+dfsg.1/src/devices/cpu/rw5000/b5500.h mame-0.243+dfsg.1/src/devices/cpu/rw5000/b5500.h --- mame-0.242+dfsg.1/src/devices/cpu/rw5000/b5500.h 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/rw5000/b5500.h 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,32 @@ +// license:BSD-3-Clause +// copyright-holders:hap +/* + + Rockwell B5500 MCU + +*/ + +#ifndef MAME_CPU_RW5000_B5500_H +#define MAME_CPU_RW5000_B5500_H + +#pragma once + +#include "a5500.h" + + +class b5500_cpu_device : public a5500_cpu_device +{ +public: + b5500_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + +protected: + // device_disasm_interface overrides + virtual std::unique_ptr create_disassembler() override; + + virtual void execute_one() override; +}; + + +DECLARE_DEVICE_TYPE(B5500, b5500_cpu_device) + +#endif // MAME_CPU_RW5000_B5500_H diff -Nru mame-0.242+dfsg.1/src/devices/cpu/rw5000/b6000.cpp mame-0.243+dfsg.1/src/devices/cpu/rw5000/b6000.cpp --- mame-0.242+dfsg.1/src/devices/cpu/rw5000/b6000.cpp 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/rw5000/b6000.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,116 @@ +// license:BSD-3-Clause +// copyright-holders:hap +/* + + Rockwell B6000 MCU (based on B5900) + +MCU designed for Mattel's electronic games, I/O is a bit more versatile, +and a speaker output was added. It was succeeded by B6100 with a larger ROM. + +TODO: +- any other changed opcodes? +- confirm digit segment decoder (10, 11, 15 are unused by the games) + +*/ + +#include "emu.h" +#include "b6000.h" + +#include "rw5000d.h" + + +DEFINE_DEVICE_TYPE(B6000, b6000_cpu_device, "b6000", "Rockwell B6000") + + +// constructor +b6000_cpu_device::b6000_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data) : + b5000_cpu_device(mconfig, type, tag, owner, clock, prgwidth, program, datawidth, data) +{ } + +b6000_cpu_device::b6000_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + b6000_cpu_device(mconfig, B6000, tag, owner, clock, 9, address_map_constructor(FUNC(b6000_cpu_device::program_512x8), this), 6, address_map_constructor(FUNC(b6000_cpu_device::data_45x4), this)) +{ } + + +// internal memory maps +void b6000_cpu_device::program_512x8(address_map &map) +{ + map(0x000, 0x1ff).rom(); +} + + +// disasm +std::unique_ptr b6000_cpu_device::create_disassembler() +{ + return std::make_unique(); +} + + +// initialize +void b6000_cpu_device::device_reset() +{ + b5000_cpu_device::device_reset(); + + // clear all registers + m_bl = 0; + m_bu = 0; + m_ram_addr = 0; + m_a = 0; + m_c = 0; + + // clear outputs + seg_w(0); + m_write_str(0); + m_write_spk(0); +} + + +// digit segment decoder +u16 b6000_cpu_device::decode_digit(u8 data) +{ + static u8 lut_segs[0x10] = + { + // 0-9 same as B5000 + 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, + + // ?, ?, none, F, G, ? + 0, 0, 0x00, 0x20, 0x40, 0 + }; + return lut_segs[data & 0xf]; +} + + +//------------------------------------------------- +// execute +//------------------------------------------------- + +void b6000_cpu_device::execute_one() +{ + switch (m_op) + { + case 0x76: op_atbz(); break; + case 0x77: op_atb(); break; + + // rest is same as B5000 + default: b5000_cpu_device::execute_one(); break; + } +} + + +//------------------------------------------------- +// changed opcodes (no need for separate file) +//------------------------------------------------- + +void b6000_cpu_device::op_tkbs() +{ + // TKBS: load segments and speaker (no TKB step) + seg_w(m_seg | decode_digit(ram_r())); + m_write_spk(m_c); +} + +void b6000_cpu_device::op_atbz() +{ + // ATBZ: KSEG + load strobe (no ATB step) + op_kseg(); + m_write_str(1 << m_a); +} diff -Nru mame-0.242+dfsg.1/src/devices/cpu/rw5000/b6000.h mame-0.243+dfsg.1/src/devices/cpu/rw5000/b6000.h --- mame-0.242+dfsg.1/src/devices/cpu/rw5000/b6000.h 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/rw5000/b6000.h 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,71 @@ +// license:BSD-3-Clause +// copyright-holders:hap +/* + + Rockwell B6000 MCU + +*/ + +#ifndef MAME_CPU_RW5000_B6000_H +#define MAME_CPU_RW5000_B6000_H + +#pragma once + +#include "b5000.h" + +// pinout reference (preliminary) + +/* + _____ _____ + SEG0 1 |* \_/ | 42 SEG0P + SEG1 2 | | 41 NC + GRD 3 | | 40 NC + SEG2 4 | | 39 KB1 + SEG3 5 | | 38 KB4 + SEG4 6 | | 37 KB2 + SEG5 7 | | 36 DIN1 + SEG6 8 | | 35 ? + SEG7 9 | | 34 KB3 + STR0 10 | B6000 | 33 NC + STR1 11 | | 32 NC + STR2 12 | | 31 NC + STR3 13 | | 30 NC + STR4 14 | | 29 NC + STR5 15 | | 28 NC + STR6 16 | | 27 NC + STR7 17 | | 26 ? + STR8 18 | | 25 ? + VDD 19 | | 24 VC? + VSS 20 | _ | 23 CLK + NC 21 |_____/ \_____| 22 NC + +*/ + +class b6000_cpu_device : public b5000_cpu_device +{ +public: + b6000_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + +protected: + b6000_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data); + + // device_disasm_interface overrides + virtual std::unique_ptr create_disassembler() override; + + // device-level overrides + virtual void device_reset() override; + + virtual void execute_one() override; + virtual u16 decode_digit(u8 data) override; + + void program_512x8(address_map &map); + + // opcode handlers + virtual void op_tkbs() override; + virtual void op_atbz(); +}; + + +DECLARE_DEVICE_TYPE(B6000, b6000_cpu_device) + +#endif // MAME_CPU_RW5000_B6000_H diff -Nru mame-0.242+dfsg.1/src/devices/cpu/rw5000/b6100.cpp mame-0.243+dfsg.1/src/devices/cpu/rw5000/b6100.cpp --- mame-0.242+dfsg.1/src/devices/cpu/rw5000/b6100.cpp 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/rw5000/b6100.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,106 @@ +// license:BSD-3-Clause +// copyright-holders:hap +/* + + Rockwell B6100 MCU (based on B5500+B6000) + +*/ + +#include "emu.h" +#include "b6100.h" + +#include "rw5000d.h" + + +DEFINE_DEVICE_TYPE(B6100, b6100_cpu_device, "b6100", "Rockwell B6100") + + +// constructor +b6100_cpu_device::b6100_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + b6000_cpu_device(mconfig, B6100, tag, owner, clock, 10, address_map_constructor(FUNC(b6100_cpu_device::program_896x8), this), 6, address_map_constructor(FUNC(b6100_cpu_device::data_48x4), this)) +{ } + + +// internal memory maps +void b6100_cpu_device::program_896x8(address_map &map) +{ + map(0x000, 0x2ff).rom(); + map(0x380, 0x3ff).rom(); +} + +void b6100_cpu_device::data_48x4(address_map &map) +{ + map(0x00, 0x0b).ram(); + map(0x10, 0x1b).ram(); + map(0x20, 0x2b).ram(); + map(0x30, 0x3b).ram(); +} + + +// disasm +std::unique_ptr b6100_cpu_device::create_disassembler() +{ + return std::make_unique(); +} + + +// digit segment decoder +u16 b6100_cpu_device::decode_digit(u8 data) +{ + static u16 lut_segs[0x10] = + { + // 0-9 same as B6000 + 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, + + // EFG, BCG, none, SEG8, SEG9, SEG10 + 0x70, 0x46, 0x00, 0x80, 0x100, 0x200 + }; + return lut_segs[data & 0xf]; +} + + +//------------------------------------------------- +// execute +//------------------------------------------------- + +void b6100_cpu_device::execute_one() +{ + switch (m_op) + { + case 0x1c: case 0x1d: case 0x1e: case 0x1f: op_lb(11); break; + case 0x38: case 0x39: case 0x3a: case 0x3b: op_tl(); break; + + case 0x0c: op_sc(); break; + case 0x0d: op_rsc(); break; + + // rest is same as B6000 + default: b6000_cpu_device::execute_one(); break; + } + + // instead of with TKBS, carry flag directly outputs to SPK + if (m_c != m_prev_c) + m_write_spk(m_c); +} + +bool b6100_cpu_device::op_is_tl(u8 op) +{ + return b6000_cpu_device::op_is_tl(op) || ((op & 0xfc) == 0x38); +} + +bool b6100_cpu_device::op_is_lb(u8 op) +{ + return b6000_cpu_device::op_is_lb(op) || ((op & 0xfc) == 0x1c); +} + + +//------------------------------------------------- +// changed opcodes (no need for separate file) +//------------------------------------------------- + +void b6100_cpu_device::op_read() +{ + // READ: add KB to A, skip next on no overflow + m_a += (m_read_kb() & 0xf); + m_skip = !BIT(m_a, 4); + m_a &= 0xf; +} diff -Nru mame-0.242+dfsg.1/src/devices/cpu/rw5000/b6100.h mame-0.243+dfsg.1/src/devices/cpu/rw5000/b6100.h --- mame-0.242+dfsg.1/src/devices/cpu/rw5000/b6100.h 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/rw5000/b6100.h 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,72 @@ +// license:BSD-3-Clause +// copyright-holders:hap +/* + + Rockwell B6100 MCU + +*/ + +#ifndef MAME_CPU_RW5000_B6100_H +#define MAME_CPU_RW5000_B6100_H + +#pragma once + +#include "b6000.h" + +// pinout reference + +/* + _____ _____ + NC 1 |* \_/ | 42 NC + NC 2 | | 41 NC + VSS 3 | | 40 VDD + NC 4 | | 39 STR8 + C12P 5 | | 38 STR7 + NC 6 | | 37 STR6 + NC 7 | | 36 STR5 + NC 8 | | 35 STR4 + VC 9 | | 34 STR3 + DIN4 10 | B6100 | 33 STR2 + DIN2 11 | | 32 STR1 + DIN3 12 | | 31 STR0 + DIN1 13 | | 30 SEG9 + PO 14 | | 29 SEG8 + KB1 15 | | 28 SEG10 + KB2 16 | | 27 SEG1 + KB3 17 | | 26 SEG4 + KB4 18 | | 25 SEG5 + SPKOP 19 | | 24 SEG7 + SPKO 20 | _ | 23 SEG6 + SEG2 21 |_____/ \_____| 22 SEG3 + +*/ + +class b6100_cpu_device : public b6000_cpu_device +{ +public: + b6100_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + +protected: + // device_disasm_interface overrides + virtual std::unique_ptr create_disassembler() override; + + // device_execute_interface overrides + virtual void execute_one() override; + + virtual bool op_is_tl(u8 op) override; + virtual bool op_is_lb(u8 op) override; + virtual void reset_pc() override { set_pc(0, 0); } + virtual u8 sr_page() override { return 15; } + virtual u16 decode_digit(u8 data) override; + + void program_896x8(address_map &map); + void data_48x4(address_map &map); + + // opcode handlers + virtual void op_read() override; +}; + + +DECLARE_DEVICE_TYPE(B6100, b6100_cpu_device) + +#endif // MAME_CPU_RW5000_B6100_H diff -Nru mame-0.242+dfsg.1/src/devices/cpu/rw5000/rw5000base.cpp mame-0.243+dfsg.1/src/devices/cpu/rw5000/rw5000base.cpp --- mame-0.242+dfsg.1/src/devices/cpu/rw5000/rw5000base.cpp 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/rw5000/rw5000base.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,229 @@ +// license:BSD-3-Clause +// copyright-holders:hap +/* + + Rockwell A/B5000 family MCU cores + +This MCU series is right before the more publicly available PPS4/1. +Known part numbers: A/B5000, A5300, A/B5500, A/B5900, B6000, B6100. +The latter two were manufactured for Mattel, with small modifications +useful for making handheld games. In fact, the programmer of the first +Mattel handheld games was a circuit designer at Rockwell. + +The main difference between Axxxx and Bxxxx is that B runs on low power, +there's also a small change with the way they output LEDs. + +A5300 might not be in this series, the page size is 0x3f instead of 0x40. + +A4000 series came out around the same time (possibly even after A5000). +It is similar, but too many differences to emulate in this device, probably. + +*/ + +#include "emu.h" +#include "rw5000base.h" + + +rw5000_base_device::rw5000_base_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data) : + cpu_device(mconfig, type, tag, owner, clock), + m_program_config("program", ENDIANNESS_LITTLE, 8, prgwidth, 0, program), + m_data_config("data", ENDIANNESS_LITTLE, 8, datawidth, 0, data), + m_prgwidth(prgwidth), + m_datawidth(datawidth), + m_read_kb(*this), + m_read_din(*this), + m_write_str(*this), + m_write_seg(*this), + m_write_spk(*this) +{ } + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void rw5000_base_device::device_start() +{ + m_program = &space(AS_PROGRAM); + m_data = &space(AS_DATA); + m_prgmask = (1 << m_prgwidth) - 1; + m_datamask = (1 << m_datawidth) - 1; + + // resolve callbacks + m_read_kb.resolve_safe(0); + m_read_din.resolve_safe(0); + m_write_str.resolve_safe(); + m_write_seg.resolve_safe(); + m_write_spk.resolve_safe(); + + // zerofill + m_pc = 0; + m_prev_pc = 0; + m_s = 0; + m_op = 0; + m_prev_op = 0; + + m_a = 0; + m_bl = 0; + m_bu = 0; + m_prev_bl = 0; + m_prev_bu = 0; + m_bl_delay = false; + m_bu_delay = false; + m_ram_addr = 0; + m_c = 0; + m_prev_c = 0; + m_prev2_c = 0; + m_prev3_c = 0; + m_sr = false; + m_skip = false; + m_seg = 0; + m_suppress0 = false; + + m_atb_step = 0; + m_mtd_step = 0; + m_tra_step = 0; + m_ret_step = 0; + + // register for savestates + save_item(NAME(m_pc)); + save_item(NAME(m_prev_pc)); + save_item(NAME(m_s)); + save_item(NAME(m_op)); + save_item(NAME(m_prev_op)); + + save_item(NAME(m_a)); + save_item(NAME(m_bl)); + save_item(NAME(m_bu)); + save_item(NAME(m_prev_bl)); + save_item(NAME(m_prev_bu)); + save_item(NAME(m_bl_delay)); + save_item(NAME(m_bu_delay)); + save_item(NAME(m_ram_addr)); + save_item(NAME(m_c)); + save_item(NAME(m_prev_c)); + save_item(NAME(m_prev2_c)); + save_item(NAME(m_prev3_c)); + save_item(NAME(m_sr)); + save_item(NAME(m_skip)); + save_item(NAME(m_seg)); + save_item(NAME(m_suppress0)); + + save_item(NAME(m_atb_step)); + save_item(NAME(m_mtd_step)); + save_item(NAME(m_tra_step)); + save_item(NAME(m_ret_step)); + + // register state for debugger + state_add(STATE_GENPC, "GENPC", m_pc).formatstr("%03X").noshow(); + state_add(STATE_GENPCBASE, "CURPC", m_prev_pc).formatstr("%03X").noshow(); + + m_state_count = 0; + state_add(++m_state_count, "PC", m_pc).formatstr("%03X"); // 1 + state_add(++m_state_count, "S", m_s).formatstr("%03X"); // 2 + state_add(++m_state_count, "A", m_a).formatstr("%01X"); // 3 + state_add(++m_state_count, "C", m_c).formatstr("%01X"); // 4 + state_add(++m_state_count, "B", m_ram_addr).formatstr("%02X"); // 5 + state_add(++m_state_count, "BU", m_bu).formatstr("%01X").noshow(); // 6 + state_add(++m_state_count, "BL", m_bl).formatstr("%01X").noshow(); // 7 + + set_icountptr(m_icount); +} + +device_memory_interface::space_config_vector rw5000_base_device::memory_space_config() const +{ + return space_config_vector { + std::make_pair(AS_PROGRAM, &m_program_config), + std::make_pair(AS_DATA, &m_data_config) + }; +} + + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void rw5000_base_device::device_reset() +{ + reset_pc(); + m_prev_pc = m_pc; + m_s = m_pc; + m_op = 0; + m_prev_op = 0; + + m_bl_delay = false; + m_bu_delay = false; + m_sr = false; + m_skip = false; + + m_atb_step = 0; + m_mtd_step = 0; + m_tra_step = 0; + m_ret_step = 0; +} + + +//------------------------------------------------- +// execute +//------------------------------------------------- + +void rw5000_base_device::increment_pc() +{ + // low part is LFSR + int feed = ((m_pc & 0x3e) == 0) ? 1 : 0; + feed ^= (m_pc >> 1 ^ m_pc) & 1; + m_pc = (m_pc & ~0x3f) | (m_pc >> 1 & 0x1f) | (feed << 5); +} + +void rw5000_base_device::execute_run() +{ + while (m_icount > 0) + { + // remember previous state + m_prev_op = m_op; + m_prev_pc = m_pc; + + m_prev_bl = m_bl; + m_prev_bu = m_bu; + m_prev3_c = m_prev2_c; + m_prev2_c = m_prev_c; + m_prev_c = m_c; + + // fetch next opcode + m_op = m_program->read_byte(m_pc); + bool skip = m_skip && op_canskip(m_op); + m_skip = false; + + if (!skip) + debugger_instruction_hook(m_pc); + increment_pc(); + m_icount--; + + // handle opcode if it's not skipped + if (skip) + m_op = 0; // fake nop + else + execute_one(); + + // some opcodes have multiple steps and will run in parallel with next ones, + // eg. it may fetch in order A,B and parts executed in order B,A + if (m_atb_step) op_atb_step(); + if (m_mtd_step) op_mtd_step(); + if (m_tra_step) op_tra_step(); + if (m_ret_step) op_ret_step(); + + // some opcodes delay RAM address adjustment for 1 cycle + m_ram_addr = (m_bu << 4 & 0x30) | (m_bl & 0xf); + + if (m_bl_delay) + { + m_ram_addr = (m_ram_addr & ~0xf) | (m_prev_bl & 0xf); + m_bl_delay = false; + } + if (m_bu_delay) + { + m_ram_addr = (m_ram_addr & 0xf) | (m_prev_bu << 4 & 0x30); + m_bu_delay = false; + } + } +} diff -Nru mame-0.242+dfsg.1/src/devices/cpu/rw5000/rw5000base.h mame-0.243+dfsg.1/src/devices/cpu/rw5000/rw5000base.h --- mame-0.242+dfsg.1/src/devices/cpu/rw5000/rw5000base.h 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/rw5000/rw5000base.h 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,117 @@ +// license:BSD-3-Clause +// copyright-holders:hap +/* + + Rockwell A/B5000 family MCU cores + + Don't include this file, include the specific device header instead, + for example b5000.h + +*/ + +#ifndef MAME_CPU_RW5000_RW5000BASE_H +#define MAME_CPU_RW5000_RW5000BASE_H + +#pragma once + + +class rw5000_base_device : public cpu_device +{ +public: + // configuration helpers + // I/O ports: + + // 4-bit KB inputs + auto read_kb() { return m_read_kb.bind(); } + + // 1-4 DIN inputs + auto read_din() { return m_read_din.bind(); } + + // 9(possibly more) strobe outputs + auto write_str() { return m_write_str.bind(); } + + // 7/8/10 segment outputs + auto write_seg() { return m_write_seg.bind(); } + + // speaker output line (aka SEG0) + auto write_spk() { return m_write_spk.bind(); } + +protected: + // construction/destruction + rw5000_base_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data); + + // device-level overrides + virtual void device_start() override; + virtual void device_reset() override; + + // device_execute_interface overrides + virtual u64 execute_clocks_to_cycles(u64 clocks) const noexcept override { return (clocks + 4 - 1) / 4; } // 4-phase clock + virtual u64 execute_cycles_to_clocks(u64 cycles) const noexcept override { return (cycles * 4); } + virtual u32 execute_min_cycles() const noexcept override { return 1; } + virtual u32 execute_max_cycles() const noexcept override { return 1; } + virtual void execute_run() override; + virtual void execute_one() = 0; + + // device_memory_interface overrides + virtual space_config_vector memory_space_config() const override; + + address_space_config m_program_config; + address_space_config m_data_config; + address_space *m_program; + address_space *m_data; + + int m_icount; + int m_state_count; + + int m_prgwidth; // ROM/RAM address size + int m_datawidth; // " + u16 m_prgmask; // " + u16 m_datamask; // " + + void increment_pc(); + virtual bool op_canskip(u8 op) = 0; + virtual void reset_pc() = 0; + + u16 m_pc; + u16 m_prev_pc; + u16 m_s; + u8 m_op; + u8 m_prev_op; + + u8 m_a; + u8 m_bl; + u8 m_bu; + u8 m_prev_bl; + u8 m_prev_bu; + bool m_bl_delay; + bool m_bu_delay; + u8 m_ram_addr; + u8 m_c; + u8 m_prev_c; + u8 m_prev2_c; + u8 m_prev3_c; + bool m_sr; + bool m_skip; + u16 m_seg; + bool m_suppress0; + + u8 m_atb_step; + u8 m_mtd_step; + u8 m_tra_step; + u8 m_ret_step; + + virtual void op_atb_step() { ; } + virtual void op_mtd_step() { ; } + virtual void op_tra_step() { ; } + virtual void op_ret_step() { ; } + + // i/o handlers + devcb_read8 m_read_kb; + devcb_read8 m_read_din; + devcb_write16 m_write_str; + devcb_write16 m_write_seg; + devcb_write_line m_write_spk; +}; + + +#endif // MAME_CPU_RW5000_RW5000BASE_H diff -Nru mame-0.242+dfsg.1/src/devices/cpu/rw5000/rw5000d.cpp mame-0.243+dfsg.1/src/devices/cpu/rw5000/rw5000d.cpp --- mame-0.242+dfsg.1/src/devices/cpu/rw5000/rw5000d.cpp 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/rw5000/rw5000d.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,330 @@ +// license:BSD-3-Clause +// copyright-holders:hap +/* + + Rockwell A/B5000 family MCU disassembler + +*/ + +#include "emu.h" +#include "rw5000d.h" + +// constructor + +rw5000_common_disassembler::rw5000_common_disassembler() +{ + // init lfsr pc lut + for (u32 i = 0, pc = 0; i < 0x40; i++) + { + m_l2r[i] = pc; + m_r2l[pc] = i; + pc = increment_pc(pc); + } +} + +offs_t rw5000_common_disassembler::increment_pc(offs_t pc) +{ + int feed = ((pc & 0x3e) == 0) ? 1 : 0; + feed ^= (pc >> 1 ^ pc) & 1; + return (pc & ~0x3f) | (pc >> 1 & 0x1f) | (feed << 5); +} + + +// common lookup tables + +const char *const rw5000_common_disassembler::s_name[] = +{ + "?", + "NOP", "RSC", "SC", "TC", "TAM", + "LAX", "ADX", "COMP", "ATB", "ATBZ", + "LDA", "EXC", "EXC", "EXC", "ADD", + "LB", "LB", "LB", "LB", "LB", "LB", + "RSM", "SM", "TM", + "TL", "TRA", "TRA", "RET", + "TKB", "TKBS", "TDIN", "READ", "KSEG", "MTD" +}; + +// number of bits per opcode parameter +// note: d4 means bitmask param, d5 means inverted +const u8 rw5000_common_disassembler::s_bits[] = +{ + 0, + 0, 0, 0, 0, 0, + 0x24, 0x24, 0, 0, 0, + 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, + 0x12, 0x12, 0x12, + 4, 6, 6, 0, + 0, 0, 2, 0, 0, 0 +}; + +const u32 rw5000_common_disassembler::s_flags[] = +{ + 0, + 0, 0, 0, STEP_COND, STEP_COND, + 0, STEP_COND, 0, 0, 0, + 0, 0, STEP_COND, STEP_COND, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, STEP_COND, + 0, STEP_OVER, 0, STEP_OUT, + STEP_COND, STEP_COND, STEP_COND, STEP_COND, 0, 0 +}; + + +// common disasm + +offs_t rw5000_common_disassembler::common_disasm(const u8 *lut_opmap, std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) +{ + // get raw opcode + u8 op = opcodes.r8(pc); + u8 instr = lut_opmap[op]; + u32 flags = s_flags[instr]; + + // get parameter + u8 bits = s_bits[instr]; + u8 mask = (1 << (bits & 0xf)) - 1; + u8 param = (bits & 0x20) ? (~op & mask) : (op & mask); + if (bits & 0x10) + param = 1 << param; + + // TDIN 0 is 4 + if (instr == em_TDIN && param == 0) + param = 4; + + // disassemble it + util::stream_format(stream, "%-6s", s_name[instr]); + + if (bits > 0) + { + // exceptions for opcodes with 2 params + if (instr >= em_EXC0 && instr <= em_EXCM) + { + switch (instr) + { + case em_EXC0: util::stream_format(stream, "%d,0", param); break; + case em_EXCP: util::stream_format(stream, "%d,+1", param); break; + case em_EXCM: util::stream_format(stream, "%d,-1", param); break; + default: break; + } + } + else if (instr == em_ADD) + { + if (param & 1) + flags |= STEP_COND; + + switch (param ^ 2) + { + case 1: stream << "S"; break; // 0,1 + case 2: stream << "C"; break; // 1,0 + case 3: stream << "C,S"; break; // 1,1 + default: break; + } + } + else if (instr >= em_LB0 && instr <= em_LB11) + { + int param2 = (instr == em_LB0) ? 0 : (6 + instr - em_LB0); + util::stream_format(stream, "%d,%d", param, param2); + } + else if (instr == em_TRA0 || instr == em_TRA1) + { + int param2 = (instr == em_TRA1) ? 1 : 0; + util::stream_format(stream, "%d,$%02X", param2, param); + } + else + util::stream_format(stream, "%d", param); + } + + return 1 | flags | SUPPORTED; +} + + +// A5000/A5900 disasm + +const u8 a5000_disassembler::a5000_opmap[0x100] = +{ +/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ + em_NOP, em_TC, 0, em_TKB, em_TDIN, em_TDIN, em_TDIN, em_TDIN, em_TM, em_TM, em_TM, em_TM, 0, 0, 0, 0, // 0 + em_SM, em_SM, em_SM, em_SM, em_RSM, em_RSM, em_RSM, em_RSM, em_RET, em_RET, em_RET, em_RET, 0, 0, 0, 0, // 1 + em_LB7, em_LB7, em_LB7, em_LB7, em_LB10, em_LB10, em_LB10, em_LB10, em_LB9, em_LB9, em_LB9, em_LB9, em_LB8, em_LB8, em_LB8, em_LB8, // 2 + em_TL, em_TL, em_TL, em_TL, em_TL, em_TL, em_TL, em_TL, 0, em_RSC, 0, em_SC, em_LB0, em_LB0, em_LB0, em_LB0, // 3 + + em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, // 4 + em_LDA, em_LDA, em_LDA, em_LDA, em_EXCP, em_EXCP, em_EXCP, em_EXCP, em_EXC0, em_EXC0, em_EXC0, em_EXC0, em_EXCM, em_EXCM, em_EXCM, em_EXCM, // 5 + em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_READ, // 6 + em_ADD, em_ADD, em_ADD, em_ADD, em_KSEG, 0, em_MTD, em_ATB, em_COMP, em_COMP, em_COMP, em_COMP, em_TAM, em_TAM, em_TAM, em_TAM, // 7 + + em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, // 8 + em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, // 9 + em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, // A + em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, // B + + em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, // C + em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, // D + em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, // E + em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, // F +}; + +offs_t a5000_disassembler::disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) +{ + return common_disasm(a5000_opmap, stream, pc, opcodes, params); +} + + +// A5500 disasm (A5000 + LB x,11, SC/RSC moved to make room for more TL) + +const u8 a5500_disassembler::a5500_opmap[0x100] = +{ +/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ + em_NOP, em_TC, 0, em_TKB, em_TDIN, em_TDIN, em_TDIN, em_TDIN, em_TM, em_TM, em_TM, em_TM, em_SC, em_RSC, 0, 0, // 0 + em_SM, em_SM, em_SM, em_SM, em_RSM, em_RSM, em_RSM, em_RSM, em_RET, em_RET, em_RET, em_RET, em_LB11, em_LB11, em_LB11, em_LB11, // 1 + em_LB7, em_LB7, em_LB7, em_LB7, em_LB10, em_LB10, em_LB10, em_LB10, em_LB9, em_LB9, em_LB9, em_LB9, em_LB8, em_LB8, em_LB8, em_LB8, // 2 + em_TL, em_TL, em_TL, em_TL, em_TL, em_TL, em_TL, em_TL, em_TL, em_TL, em_TL, em_TL, em_LB0, em_LB0, em_LB0, em_LB0, // 3 + + em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, // 4 + em_LDA, em_LDA, em_LDA, em_LDA, em_EXCP, em_EXCP, em_EXCP, em_EXCP, em_EXC0, em_EXC0, em_EXC0, em_EXC0, em_EXCM, em_EXCM, em_EXCM, em_EXCM, // 5 + em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_READ, // 6 + em_ADD, em_ADD, em_ADD, em_ADD, em_KSEG, 0, em_MTD, em_ATB, em_COMP, em_COMP, em_COMP, em_COMP, em_TAM, em_TAM, em_TAM, em_TAM, // 7 + + em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, // 8 + em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, // 9 + em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, // A + em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, // B + + em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, // C + em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, // D + em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, // E + em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, // F +}; + +offs_t a5500_disassembler::disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) +{ + return common_disasm(a5500_opmap, stream, pc, opcodes, params); +} + + +// B5000 disasm (A5000 + TKBS added, MTD removed) + +const u8 b5000_disassembler::b5000_opmap[0x100] = +{ +/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ + em_NOP, em_TC, em_TKB, em_TKBS, em_TDIN, em_TDIN, em_TDIN, em_TDIN, em_TM, em_TM, em_TM, em_TM, 0, 0, 0, 0, // 0 + em_SM, em_SM, em_SM, em_SM, em_RSM, em_RSM, em_RSM, em_RSM, em_RET, em_RET, em_RET, em_RET, 0, 0, 0, 0, // 1 + em_LB7, em_LB7, em_LB7, em_LB7, em_LB10, em_LB10, em_LB10, em_LB10, em_LB9, em_LB9, em_LB9, em_LB9, em_LB8, em_LB8, em_LB8, em_LB8, // 2 + em_TL, em_TL, em_TL, em_TL, em_TL, em_TL, em_TL, em_TL, 0, em_RSC, 0, em_SC, em_LB0, em_LB0, em_LB0, em_LB0, // 3 + + em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, // 4 + em_LDA, em_LDA, em_LDA, em_LDA, em_EXCP, em_EXCP, em_EXCP, em_EXCP, em_EXC0, em_EXC0, em_EXC0, em_EXC0, em_EXCM, em_EXCM, em_EXCM, em_EXCM, // 5 + em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_READ, // 6 + em_ADD, em_ADD, em_ADD, em_ADD, em_KSEG, 0, 0, em_ATB, em_COMP, em_COMP, em_COMP, em_COMP, em_TAM, em_TAM, em_TAM, em_TAM, // 7 + + em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, // 8 + em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, // 9 + em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, // A + em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, // B + + em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, // C + em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, // D + em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, // E + em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, // F +}; + +offs_t b5000_disassembler::disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) +{ + return common_disasm(b5000_opmap, stream, pc, opcodes, params); +} + + +// B5500 disasm (B5000 + LB x,11, SC/RSC moved to make room for more TL) + +const u8 b5500_disassembler::b5500_opmap[0x100] = +{ +/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ + em_NOP, em_TC, em_TKB, em_TKBS, em_TDIN, em_TDIN, em_TDIN, em_TDIN, em_TM, em_TM, em_TM, em_TM, em_SC, em_RSC, 0, 0, // 0 + em_SM, em_SM, em_SM, em_SM, em_RSM, em_RSM, em_RSM, em_RSM, em_RET, em_RET, em_RET, em_RET, em_LB11, em_LB11, em_LB11, em_LB11, // 1 + em_LB7, em_LB7, em_LB7, em_LB7, em_LB10, em_LB10, em_LB10, em_LB10, em_LB9, em_LB9, em_LB9, em_LB9, em_LB8, em_LB8, em_LB8, em_LB8, // 2 + em_TL, em_TL, em_TL, em_TL, em_TL, em_TL, em_TL, em_TL, em_TL, em_TL, em_TL, em_TL, em_LB0, em_LB0, em_LB0, em_LB0, // 3 + + em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, // 4 + em_LDA, em_LDA, em_LDA, em_LDA, em_EXCP, em_EXCP, em_EXCP, em_EXCP, em_EXC0, em_EXC0, em_EXC0, em_EXC0, em_EXCM, em_EXCM, em_EXCM, em_EXCM, // 5 + em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_READ, // 6 + em_ADD, em_ADD, em_ADD, em_ADD, em_KSEG, 0, 0, em_ATB, em_COMP, em_COMP, em_COMP, em_COMP, em_TAM, em_TAM, em_TAM, em_TAM, // 7 + + em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, // 8 + em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, // 9 + em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, // A + em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, // B + + em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, // C + em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, // D + em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, // E + em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, // F +}; + +offs_t b5500_disassembler::disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) +{ + return common_disasm(b5500_opmap, stream, pc, opcodes, params); +} + + +// B6000 disasm (B5000 + ATBZ added) + +const u8 b6000_disassembler::b6000_opmap[0x100] = +{ +/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ + em_NOP, em_TC, em_TKB, em_TKBS, em_TDIN, em_TDIN, em_TDIN, em_TDIN, em_TM, em_TM, em_TM, em_TM, 0, 0, 0, 0, // 0 + em_SM, em_SM, em_SM, em_SM, em_RSM, em_RSM, em_RSM, em_RSM, em_RET, em_RET, em_RET, em_RET, 0, 0, 0, 0, // 1 + em_LB7, em_LB7, em_LB7, em_LB7, em_LB10, em_LB10, em_LB10, em_LB10, em_LB9, em_LB9, em_LB9, em_LB9, em_LB8, em_LB8, em_LB8, em_LB8, // 2 + em_TL, em_TL, em_TL, em_TL, em_TL, em_TL, em_TL, em_TL, 0, em_RSC, 0, em_SC, em_LB0, em_LB0, em_LB0, em_LB0, // 3 + + em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, // 4 + em_LDA, em_LDA, em_LDA, em_LDA, em_EXCP, em_EXCP, em_EXCP, em_EXCP, em_EXC0, em_EXC0, em_EXC0, em_EXC0, em_EXCM, em_EXCM, em_EXCM, em_EXCM, // 5 + em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_READ, // 6 + em_ADD, em_ADD, em_ADD, em_ADD, em_KSEG, 0, em_ATBZ, em_ATB, em_COMP, em_COMP, em_COMP, em_COMP, em_TAM, em_TAM, em_TAM, em_TAM, // 7 + + em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, // 8 + em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, // 9 + em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, // A + em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, // B + + em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, // C + em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, // D + em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, // E + em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, // F +}; + +offs_t b6000_disassembler::disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) +{ + return common_disasm(b6000_opmap, stream, pc, opcodes, params); +} + + +// B6100 disasm (B5500 + B6000) + +const u8 b6100_disassembler::b6100_opmap[0x100] = +{ +/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ + em_NOP, em_TC, em_TKB, em_TKBS, em_TDIN, em_TDIN, em_TDIN, em_TDIN, em_TM, em_TM, em_TM, em_TM, em_SC, em_RSC, 0, 0, // 0 + em_SM, em_SM, em_SM, em_SM, em_RSM, em_RSM, em_RSM, em_RSM, em_RET, em_RET, em_RET, em_RET, em_LB11, em_LB11, em_LB11, em_LB11, // 1 + em_LB7, em_LB7, em_LB7, em_LB7, em_LB10, em_LB10, em_LB10, em_LB10, em_LB9, em_LB9, em_LB9, em_LB9, em_LB8, em_LB8, em_LB8, em_LB8, // 2 + em_TL, em_TL, em_TL, em_TL, em_TL, em_TL, em_TL, em_TL, em_TL, em_TL, em_TL, em_TL, em_LB0, em_LB0, em_LB0, em_LB0, // 3 + + em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, em_LAX, // 4 + em_LDA, em_LDA, em_LDA, em_LDA, em_EXCP, em_EXCP, em_EXCP, em_EXCP, em_EXC0, em_EXC0, em_EXC0, em_EXC0, em_EXCM, em_EXCM, em_EXCM, em_EXCM, // 5 + em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_ADX, em_READ, // 6 + em_ADD, em_ADD, em_ADD, em_ADD, em_KSEG, 0, em_ATBZ, em_ATB, em_COMP, em_COMP, em_COMP, em_COMP, em_TAM, em_TAM, em_TAM, em_TAM, // 7 + + em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, // 8 + em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, // 9 + em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, // A + em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, em_TRA0, // B + + em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, // C + em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, // D + em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, // E + em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, em_TRA1, // F +}; + +offs_t b6100_disassembler::disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) +{ + return common_disasm(b6100_opmap, stream, pc, opcodes, params); +} diff -Nru mame-0.242+dfsg.1/src/devices/cpu/rw5000/rw5000d.h mame-0.243+dfsg.1/src/devices/cpu/rw5000/rw5000d.h --- mame-0.242+dfsg.1/src/devices/cpu/rw5000/rw5000d.h 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/rw5000/rw5000d.h 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,124 @@ +// license:BSD-3-Clause +// copyright-holders:hap +/* + + Rockwell A/B5000 family MCU disassembler + +*/ + +#ifndef MAME_CPU_RW5000_RW5000D_H +#define MAME_CPU_RW5000_RW5000D_H + +#pragma once + + +class rw5000_common_disassembler : public util::disasm_interface +{ +public: + rw5000_common_disassembler(); + virtual ~rw5000_common_disassembler() = default; + + 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 6; } + virtual offs_t pc_linear_to_real(offs_t pc) const override { return (pc & ~0x3f) | m_l2r[pc & 0x3f]; } + virtual offs_t pc_real_to_linear(offs_t pc) const override { return (pc & ~0x3f) | m_r2l[pc & 0x3f]; } + +protected: + // opcode mnemonics + enum e_mnemonics + { + em_ILL, + em_NOP, em_RSC, em_SC, em_TC, em_TAM, + em_LAX, em_ADX, em_COMP, em_ATB, em_ATBZ, + em_LDA, em_EXC0, em_EXCP, em_EXCM, em_ADD, + em_LB0, em_LB7, em_LB8, em_LB9, em_LB10, em_LB11, + em_RSM, em_SM, em_TM, + em_TL, em_TRA0, em_TRA1, em_RET, + em_TKB, em_TKBS, em_TDIN, em_READ, em_KSEG, em_MTD + }; + + static const char *const s_name[]; + static const u8 s_bits[]; + static const u32 s_flags[]; + + u8 m_l2r[0x40]; + u8 m_r2l[0x40]; + + offs_t increment_pc(offs_t pc); + offs_t common_disasm(const u8 *lut_opmap, std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms); +}; + +class a5000_disassembler : public rw5000_common_disassembler +{ +public: + a5000_disassembler() = default; + virtual ~a5000_disassembler() = default; + + virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) override; + +private: + static const u8 a5000_opmap[0x100]; +}; + +class a5500_disassembler : public rw5000_common_disassembler +{ +public: + a5500_disassembler() = default; + virtual ~a5500_disassembler() = default; + + virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) override; + +private: + static const u8 a5500_opmap[0x100]; +}; + +class b5000_disassembler : public rw5000_common_disassembler +{ +public: + b5000_disassembler() = default; + virtual ~b5000_disassembler() = default; + + virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) override; + +private: + static const u8 b5000_opmap[0x100]; +}; + +class b5500_disassembler : public rw5000_common_disassembler +{ +public: + b5500_disassembler() = default; + virtual ~b5500_disassembler() = default; + + virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) override; + +private: + static const u8 b5500_opmap[0x100]; +}; + +class b6000_disassembler : public rw5000_common_disassembler +{ +public: + b6000_disassembler() = default; + virtual ~b6000_disassembler() = default; + + virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) override; + +private: + static const u8 b6000_opmap[0x100]; +}; + +class b6100_disassembler : public rw5000_common_disassembler +{ +public: + b6100_disassembler() = default; + virtual ~b6100_disassembler() = default; + + virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) override; + +private: + static const u8 b6100_opmap[0x100]; +}; + +#endif // MAME_CPU_RW5000_RW5000D_H diff -Nru mame-0.242+dfsg.1/src/devices/cpu/rx01/rx01dasm.cpp mame-0.243+dfsg.1/src/devices/cpu/rx01/rx01dasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/rx01/rx01dasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/rx01/rx01dasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -4,6 +4,10 @@ DEC RX01 microcode disassembler + DEC's firmware listing is based on a modified PDP-8 cross-assembler. + The syntax used here differs slightly to improve the disassembly of + double-length instructions (which the PDP-8 generally lacks). + ***************************************************************************/ #include "emu.h" @@ -67,12 +71,12 @@ if (BIT(opcode, 0)) { stream << " IND"; - return 1 | (BIT(opcode, 7) ? STEP_OVER : 0) | SUPPORTED; + return 1 | STEP_COND | SUPPORTED; } else { util::stream_format(stream, " %04o", ((pc + 2) & 07400) | opcodes.r8(pc + 1)); - return 2 | (BIT(opcode, 7) ? STEP_OVER : 0) | SUPPORTED; + return 2 | STEP_COND | SUPPORTED; } } else if (BIT(opcode, 7)) diff -Nru mame-0.242+dfsg.1/src/devices/cpu/s2650/2650dasm.cpp mame-0.243+dfsg.1/src/devices/cpu/s2650/2650dasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/s2650/2650dasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/s2650/2650dasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -235,7 +235,7 @@ util::stream_format(stream, "ret %c", cc[rv]); } else util::stream_format(stream, "retc %c", cc[rv]); - flags = STEP_OUT; + flags = STEP_OUT | (rv != 3 ? STEP_COND : 0); break; case 0x18: case 0x19: case 0x1a: case 0x1b: if (z80) { @@ -246,6 +246,8 @@ } else util::stream_format(stream, "bctr,%c %s", cc[rv], REL(pc, params)); pc+=1; + if (rv != 3) + flags = STEP_COND; break; case 0x1c: case 0x1d: case 0x1e: case 0x1f: if (z80) { @@ -256,6 +258,8 @@ } else util::stream_format(stream, "bcta,%c %s", cc[rv], ADR(pc, params)); pc+=2; + if (rv != 3) + flags = STEP_COND; break; case 0x20: case 0x21: case 0x22: case 0x23: util::stream_format(stream, z80 ? "xor r0,r%d" : "eorz,%d", rv); @@ -283,7 +287,7 @@ util::stream_format(stream, "iret %c", cc[rv]); } else util::stream_format(stream, "rete %c", cc[rv]); - flags = STEP_OUT; + flags = STEP_OUT | (rv != 3 ? STEP_COND : 0); break; case 0x38: case 0x39: case 0x3a: case 0x3b: if (z80) { @@ -294,7 +298,7 @@ } else util::stream_format(stream, "bstr,%c %s", cc[rv], REL(pc, params)); pc+=1; - flags = STEP_OVER; + flags = STEP_OVER | (rv != 3 ? STEP_COND : 0); break; case 0x3c: case 0x3d: case 0x3e: case 0x3f: if (z80) { @@ -305,7 +309,7 @@ } else util::stream_format(stream, "bsta,%c %s", cc[rv], ADR(pc, params)); pc+=2; - flags = STEP_OVER; + flags = STEP_OVER | (rv != 3 ? STEP_COND : 0); break; case 0x40: util::stream_format(stream, "halt"); @@ -335,10 +339,12 @@ case 0x58: case 0x59: case 0x5a: case 0x5b: util::stream_format(stream, z80 ? "jrnz r%d,%s" : "brnr,%d %s", rv, REL(pc, params)); pc+=1; + flags = STEP_COND; break; case 0x5c: case 0x5d: case 0x5e: case 0x5f: util::stream_format(stream, z80 ? "jpnz r%d,%s" : "brna,%d %s", rv, ADR(pc, params)); pc+=2; + flags = STEP_COND; break; case 0x60: case 0x61: case 0x62: case 0x63: util::stream_format(stream, z80 ? "or r0,r%d" : "iorz,%d", rv); @@ -377,12 +383,12 @@ case 0x78: case 0x79: case 0x7a: case 0x7b: util::stream_format(stream, z80 ? "call r%d-nz,%s" : "bsnr,%d %s", rv, REL(pc, params)); pc+=1; - flags = STEP_OVER; + flags = STEP_OVER | STEP_COND; break; case 0x7c: case 0x7d: case 0x7e: case 0x7f: util::stream_format(stream, z80 ? "call r%d-nz,%s" : "bsna,%d %s", rv, ADR(pc, params)); pc+=2; - flags = STEP_OVER; + flags = STEP_OVER | STEP_COND; break; case 0x80: case 0x81: case 0x82: case 0x83: util::stream_format(stream, z80 ? "add r0,r%d" : "addz,%d", rv); @@ -414,6 +420,7 @@ case 0x98: case 0x99: case 0x9a: util::stream_format(stream, z80 ? "jr n%c,%s" : "bcfr,%c %s", cc[rv], REL(pc, params)); pc+=1; + flags = STEP_COND; break; case 0x9b: util::stream_format(stream, z80 ? "jr0 %s" : "zbrr %s", REL0(pc, params)); @@ -459,7 +466,7 @@ case 0xb8: case 0xb9: case 0xba: util::stream_format(stream, z80 ? "calr n%c,%s" : "bsfr,%c %s", cc[rv], REL(pc, params)); pc+=1; - flags = STEP_OVER; + flags = STEP_OVER | STEP_COND; break; case 0xbb: util::stream_format(stream, z80 ? "cal0 %s" : "zbsr %s", REL0(pc, params)); @@ -469,7 +476,7 @@ case 0xbc: case 0xbd: case 0xbe: util::stream_format(stream, z80 ? "call n%c,%s" : "bsfa,%c %s", cc[rv], ADR(pc, params)); pc+=2; - flags = STEP_OVER; + flags = STEP_OVER | STEP_COND; break; case 0xbf: util::stream_format(stream, z80 ? "call %s+r3" : "bsxa %s", ADR(pc, params)); @@ -503,12 +510,12 @@ case 0xd8: case 0xd9: case 0xda: case 0xdb: util::stream_format(stream, z80 ? "ijnz r%d,%s" : "birr,%d %s", rv, REL(pc, params)); pc+=1; - flags = STEP_OVER; + flags = STEP_COND; break; case 0xdc: case 0xdd: case 0xde: case 0xdf: util::stream_format(stream, z80 ? "ijnz r%d,%s" : "bira,%d %s", rv, ADR(pc, params)); pc+=2; - flags = STEP_OVER; + flags = STEP_COND; break; case 0xe0: case 0xe1: case 0xe2: case 0xe3: util::stream_format(stream, z80 ? "cp r0,%d" : "comz,%d", rv); @@ -535,12 +542,12 @@ case 0xf8: case 0xf9: case 0xfa: case 0xfb: util::stream_format(stream, z80 ? "djnz r%d,%s" : "bdrr,%d %s", rv, REL(pc, params)); pc+=1; - flags = STEP_OVER; + flags = STEP_COND; break; case 0xfc: case 0xfd: case 0xfe: case 0xff: util::stream_format(stream, z80 ? "djnz r%d,%s" : "bdra,%d %s", rv, ADR(pc, params)); pc+=2; - flags = STEP_OVER; + flags = STEP_COND; break; } return (pc - PC) | flags | SUPPORTED; diff -Nru mame-0.242+dfsg.1/src/devices/cpu/s2650/s2650.cpp mame-0.243+dfsg.1/src/devices/cpu/s2650/s2650.cpp --- mame-0.242+dfsg.1/src/devices/cpu/s2650/s2650.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/s2650/s2650.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -13,7 +13,6 @@ *************************************************************************/ #include "emu.h" -#include "debugger.h" #include "s2650.h" #include "s2650cpu.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/saturn/saturn.cpp mame-0.243+dfsg.1/src/devices/cpu/saturn/saturn.cpp --- mame-0.242+dfsg.1/src/devices/cpu/saturn/saturn.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/saturn/saturn.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -12,8 +12,6 @@ #include "emu.h" #include "saturn.h" -#include "debugger.h" - //#define VERBOSE 1 #include "logmacro.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/sc61860/sc61860.cpp mame-0.243+dfsg.1/src/devices/cpu/sc61860/sc61860.cpp --- mame-0.242+dfsg.1/src/devices/cpu/sc61860/sc61860.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/sc61860/sc61860.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -20,7 +20,6 @@ #include "emu.h" #include "sc61860.h" #include "scdasm.h" -#include "debugger.h" #define I 0 diff -Nru mame-0.242+dfsg.1/src/devices/cpu/scmp/scmp.cpp mame-0.243+dfsg.1/src/devices/cpu/scmp/scmp.cpp --- mame-0.242+dfsg.1/src/devices/cpu/scmp/scmp.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/scmp/scmp.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -12,8 +12,6 @@ #include "scmp.h" #include "scmpdasm.h" -#include "debugger.h" - //#define VERBOSE 1 #include "logmacro.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/score/score.cpp mame-0.243+dfsg.1/src/devices/cpu/score/score.cpp --- mame-0.242+dfsg.1/src/devices/cpu/score/score.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/score/score.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -14,7 +14,6 @@ ******************************************************************************/ #include "emu.h" -#include "debugger.h" #include "score.h" #include "scoredsm.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/scudsp/scudsp.cpp mame-0.243+dfsg.1/src/devices/cpu/scudsp/scudsp.cpp --- mame-0.242+dfsg.1/src/devices/cpu/scudsp/scudsp.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/scudsp/scudsp.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -94,8 +94,6 @@ #include "scudsp.h" #include "scudspdasm.h" -#include "debugger.h" - DEFINE_DEVICE_TYPE(SCUDSP, scudsp_cpu_device, "scudsp", "Sega SCUDSP") diff -Nru mame-0.242+dfsg.1/src/devices/cpu/se3208/se3208.cpp mame-0.243+dfsg.1/src/devices/cpu/se3208/se3208.cpp --- mame-0.242+dfsg.1/src/devices/cpu/se3208/se3208.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/se3208/se3208.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -4,8 +4,6 @@ #include "se3208.h" #include "se3208dis.h" -#include "debugger.h" - /* SE3208 CPU Emulator by ElSemi diff -Nru mame-0.242+dfsg.1/src/devices/cpu/se3208/se3208dis.cpp mame-0.243+dfsg.1/src/devices/cpu/se3208/se3208dis.cpp --- mame-0.242+dfsg.1/src/devices/cpu/se3208/se3208dis.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/se3208/se3208dis.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -762,7 +762,7 @@ util::stream_format(stream, "JV 0x%x",PC+2+Offset2); CLRFLAG(FLAG_E); - return 0; + return STEP_COND; } INST(JNV) @@ -778,7 +778,7 @@ util::stream_format(stream, "JNV 0x%x",PC+2+Offset2); CLRFLAG(FLAG_E); - return 0; + return STEP_COND; } INST(JC) @@ -794,7 +794,7 @@ util::stream_format(stream, "JC 0x%x",PC+2+Offset2); CLRFLAG(FLAG_E); - return 0; + return STEP_COND; } INST(JNC) @@ -810,7 +810,7 @@ util::stream_format(stream, "JNC 0x%x",PC+2+Offset2); CLRFLAG(FLAG_E); - return 0; + return STEP_COND; } INST(JP) @@ -826,7 +826,7 @@ util::stream_format(stream, "JP 0x%x",PC+2+Offset2); CLRFLAG(FLAG_E); - return 0; + return STEP_COND; } INST(JM) @@ -842,7 +842,7 @@ util::stream_format(stream, "JM 0x%x",PC+2+Offset2); CLRFLAG(FLAG_E); - return 0; + return STEP_COND; } INST(JNZ) @@ -858,7 +858,7 @@ util::stream_format(stream, "JNZ 0x%x",PC+2+Offset2); CLRFLAG(FLAG_E); - return 0; + return STEP_COND; } INST(JZ) @@ -874,7 +874,7 @@ util::stream_format(stream, "JZ 0x%x",PC+2+Offset2); CLRFLAG(FLAG_E); - return 0; + return STEP_COND; } INST(JGE) @@ -890,7 +890,7 @@ util::stream_format(stream, "JGE 0x%x",PC+2+Offset2); CLRFLAG(FLAG_E); - return 0; + return STEP_COND; } INST(JLE) @@ -906,7 +906,7 @@ util::stream_format(stream, "JLE 0x%x",PC+2+Offset2); CLRFLAG(FLAG_E); - return 0; + return STEP_COND; } INST(JHI) @@ -922,7 +922,7 @@ util::stream_format(stream, "JHI 0x%x",PC+2+Offset2); CLRFLAG(FLAG_E); - return 0; + return STEP_COND; } INST(JLS) @@ -938,7 +938,7 @@ util::stream_format(stream, "JLS 0x%x",PC+2+Offset2); CLRFLAG(FLAG_E); - return 0; + return STEP_COND; } INST(JGT) @@ -954,7 +954,7 @@ util::stream_format(stream, "JGT 0x%x",PC+2+Offset2); CLRFLAG(FLAG_E); - return 0; + return STEP_COND; } INST(JLT) @@ -970,7 +970,7 @@ util::stream_format(stream, "JLT 0x%x",PC+2+Offset2); CLRFLAG(FLAG_E); - return 0; + return STEP_COND; } diff -Nru mame-0.242+dfsg.1/src/devices/cpu/sh/sh2comn.cpp mame-0.243+dfsg.1/src/devices/cpu/sh/sh2comn.cpp --- mame-0.242+dfsg.1/src/devices/cpu/sh/sh2comn.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/sh/sh2comn.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -12,8 +12,6 @@ #include "sh2.h" #include "sh2comn.h" -#include "debugger.h" - //#define VERBOSE 1 #include "logmacro.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/sh/sh2.cpp mame-0.243+dfsg.1/src/devices/cpu/sh/sh2.cpp --- mame-0.242+dfsg.1/src/devices/cpu/sh/sh2.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/sh/sh2.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -96,7 +96,6 @@ #include "sh2.h" #include "sh2comn.h" #include "sh_dasm.h" -#include "debugger.h" //#define VERBOSE 1 #include "logmacro.h" @@ -861,7 +860,6 @@ #include "sh2.h" #include "sh2comn.h" #include "cpu/drcumlsh.h" -#include "debugger.h" const opcode_desc* sh2_device::get_desclist(offs_t pc) diff -Nru mame-0.242+dfsg.1/src/devices/cpu/sh/sh3comn.cpp mame-0.243+dfsg.1/src/devices/cpu/sh/sh3comn.cpp --- mame-0.242+dfsg.1/src/devices/cpu/sh/sh3comn.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/sh/sh3comn.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -3,7 +3,6 @@ /* Handlers for SH3 internals */ #include "emu.h" -#include "debugger.h" #include "sh4.h" #include "sh4comn.h" #include "sh3comn.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/sh/sh4comn.cpp mame-0.243+dfsg.1/src/devices/cpu/sh/sh4comn.cpp --- mame-0.242+dfsg.1/src/devices/cpu/sh/sh4comn.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/sh/sh4comn.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -9,7 +9,6 @@ *****************************************************************************/ #include "emu.h" -#include "debugger.h" #include "sh4.h" #include "sh4regs.h" #include "sh4comn.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/sh/sh4.cpp mame-0.243+dfsg.1/src/devices/cpu/sh/sh4.cpp --- mame-0.242+dfsg.1/src/devices/cpu/sh/sh4.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/sh/sh4.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -32,7 +32,6 @@ #include "sh4tmu.h" #include "sh_dasm.h" #include "cpu/drcumlsh.h" -#include "debugger.h" DEFINE_DEVICE_TYPE(SH3LE, sh3_device, "sh3le", "Hitachi SH-3 (little)") diff -Nru mame-0.242+dfsg.1/src/devices/cpu/sh/sh4dmac.cpp mame-0.243+dfsg.1/src/devices/cpu/sh/sh4dmac.cpp --- mame-0.242+dfsg.1/src/devices/cpu/sh/sh4dmac.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/sh/sh4dmac.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -3,7 +3,6 @@ /* SHA3/4 DMA Controller */ #include "emu.h" -#include "debugger.h" #include "sh4.h" #include "sh4comn.h" #include "sh3comn.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/sh/sh4tmu.cpp mame-0.243+dfsg.1/src/devices/cpu/sh/sh4tmu.cpp --- mame-0.242+dfsg.1/src/devices/cpu/sh/sh4tmu.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/sh/sh4tmu.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -3,7 +3,6 @@ /* SH3/4 Timer Unit */ #include "emu.h" -#include "debugger.h" #include "sh4.h" #include "sh4comn.h" #include "sh3comn.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/sh/sh_dasm.cpp mame-0.243+dfsg.1/src/devices/cpu/sh/sh_dasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/sh/sh_dasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/sh/sh_dasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -467,16 +467,16 @@ break; case 9: util::stream_format(stream, "BT $%08X", pc + SIGNX8(opcode & 0xff) * 2 + 2); - break; + return STEP_COND; case 11: util::stream_format(stream, "BF $%08X", pc + SIGNX8(opcode & 0xff) * 2 + 2); - break; + return STEP_COND; case 13: util::stream_format(stream, "BTS $%08X", pc + SIGNX8(opcode & 0xff) * 2 + 2); - break; + return STEP_COND | step_over_extra(1); case 15: util::stream_format(stream, "BFS $%08X", pc + SIGNX8(opcode & 0xff) * 2 + 2); - break; + return STEP_COND | step_over_extra(1); default : util::stream_format(stream, "invalid $%04X", opcode); } diff -Nru mame-0.242+dfsg.1/src/devices/cpu/sharc/sharc.cpp mame-0.243+dfsg.1/src/devices/cpu/sharc/sharc.cpp --- mame-0.242+dfsg.1/src/devices/cpu/sharc/sharc.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/sharc/sharc.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -10,8 +10,6 @@ #include "sharcfe.h" #include "sharcdsm.h" -#include "debugger.h" - #define DISABLE_FAST_REGISTERS 1 diff -Nru mame-0.242+dfsg.1/src/devices/cpu/sharc/sharcdrc.cpp mame-0.243+dfsg.1/src/devices/cpu/sharc/sharcdrc.cpp --- mame-0.242+dfsg.1/src/devices/cpu/sharc/sharcdrc.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/sharc/sharcdrc.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -8,7 +8,6 @@ ******************************************************************************/ #include "emu.h" -#include "debugger.h" #include "sharc.h" #include "sharcfe.h" #include "cpu/drcfe.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/sharc/sharcdsm.cpp mame-0.243+dfsg.1/src/devices/cpu/sharc/sharcdsm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/sharc/sharcdsm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/sharc/sharcdsm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -710,6 +710,8 @@ { util::stream_format(stream, "JUMP"); } + if (cond != 31) + flags |= STEP_COND; if (opcode & 0x10000000000U) /* PC-relative branch */ { @@ -722,6 +724,7 @@ if (j) { util::stream_format(stream, " (DB)"); + flags |= step_over_extra(2); } if (ci) { @@ -753,6 +756,8 @@ { util::stream_format(stream, "JUMP"); } + if (cond != 31) + flags |= STEP_COND; if (opcode & 0x10000000000U) /* PC-relative branch */ { @@ -765,6 +770,7 @@ if (j) { util::stream_format(stream, " (DB)"); + flags |= step_over_extra(2); } if (ci) { @@ -795,6 +801,7 @@ int reladdr = (opcode >> 27) & 0x3f; int dreg = (opcode >> 23) & 0xf; int comp = opcode & 0x7fffff; + uint32_t flags = cond != 31 ? STEP_COND : 0; get_if_condition(stream, cond); util::stream_format(stream, "JUMP"); @@ -822,7 +829,7 @@ { util::stream_format(stream, "DM(%s, %s) = %s", GET_DAG1_I(dmi), GET_DAG1_M(dmm), GET_DREG(dreg)); } - return 0; + return flags; } uint32_t sharc_disassembler::dasm_rts_compute(std::ostream &stream, uint32_t pc, uint64_t opcode) @@ -832,8 +839,11 @@ int lr = (opcode >> 24) & 0x1; int cond = (opcode >> 33) & 0x1f; int comp = opcode & 0x7fffff; + uint32_t flags = STEP_OUT; get_if_condition(stream, cond); + if (cond != 31) + flags |= STEP_COND; if (opcode & 0x10000000000U) { @@ -847,6 +857,7 @@ if (j) { util::stream_format(stream, " (DB)"); + flags |= step_over_extra(2); } if (lr) { @@ -863,7 +874,7 @@ compute(stream, comp); } - return STEP_OUT; + return flags; } uint32_t sharc_disassembler::dasm_do_until_counter(std::ostream &stream, uint32_t pc, uint64_t opcode) diff -Nru mame-0.242+dfsg.1/src/devices/cpu/sm510/sm500.cpp mame-0.243+dfsg.1/src/devices/cpu/sm510/sm500.cpp --- mame-0.242+dfsg.1/src/devices/cpu/sm510/sm500.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/sm510/sm500.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -13,7 +13,6 @@ #include "emu.h" #include "sm500.h" #include "sm510d.h" -#include "debugger.h" // MCU types diff -Nru mame-0.242+dfsg.1/src/devices/cpu/sm510/sm510base.cpp mame-0.243+dfsg.1/src/devices/cpu/sm510/sm510base.cpp --- mame-0.242+dfsg.1/src/devices/cpu/sm510/sm510base.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/sm510/sm510base.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -17,7 +17,6 @@ #include "emu.h" #include "sm510base.h" -#include "debugger.h" //------------------------------------------------- diff -Nru mame-0.242+dfsg.1/src/devices/cpu/sm510/sm510.cpp mame-0.243+dfsg.1/src/devices/cpu/sm510/sm510.cpp --- mame-0.242+dfsg.1/src/devices/cpu/sm510/sm510.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/sm510/sm510.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -9,7 +9,6 @@ #include "emu.h" #include "sm510.h" #include "sm510d.h" -#include "debugger.h" // MCU types diff -Nru mame-0.242+dfsg.1/src/devices/cpu/sm510/sm510d.cpp mame-0.243+dfsg.1/src/devices/cpu/sm510/sm510d.cpp --- mame-0.242+dfsg.1/src/devices/cpu/sm510/sm510d.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/sm510/sm510d.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -115,31 +115,31 @@ { // SM510 0, 0, - 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, STEP_COND, STEP_COND, 0, STEP_OUT, STEP_OUT, 0, STEP_OVER, STEP_OVER, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, STEP_COND, STEP_COND, 0, 0, 0, 0, + STEP_COND, STEP_COND, STEP_COND, STEP_COND, STEP_COND, STEP_COND, STEP_COND, STEP_COND, STEP_COND, STEP_COND, 0, 0, 0, 0, 0, 0, 0, STEP_OVER, 0, 0, 0, 0, 0, // SM500 0, STEP_OUT, STEP_OUT, 0, 0, STEP_OVER, 0, - 0, 0, 0, 0, - 0, 0, 0, + STEP_COND, 0, 0, 0, 0, 0, 0, 0, 0, 0, + STEP_COND, STEP_COND, STEP_COND, // SM530 0, 0, 0, - 0, 0, + STEP_COND, STEP_COND, 0, 0, 0, 0, 0, // SM590 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, STEP_OVER, + STEP_COND, 0, 0, 0, 0, 0, 0, 0, 0, STEP_COND, 0, 0, 0, STEP_OVER, 0, 0, 0, 0, 0, 0, STEP_OVER }; diff -Nru mame-0.242+dfsg.1/src/devices/cpu/sm510/sm511.cpp mame-0.243+dfsg.1/src/devices/cpu/sm510/sm511.cpp --- mame-0.242+dfsg.1/src/devices/cpu/sm510/sm511.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/sm510/sm511.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -16,7 +16,6 @@ #include "emu.h" #include "sm511.h" #include "sm510d.h" -#include "debugger.h" // MCU types diff -Nru mame-0.242+dfsg.1/src/devices/cpu/sm510/sm530.cpp mame-0.243+dfsg.1/src/devices/cpu/sm510/sm530.cpp --- mame-0.242+dfsg.1/src/devices/cpu/sm510/sm530.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/sm510/sm530.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -17,7 +17,6 @@ #include "emu.h" #include "sm530.h" #include "sm510d.h" -#include "debugger.h" // MCU types diff -Nru mame-0.242+dfsg.1/src/devices/cpu/sm510/sm530op.cpp mame-0.243+dfsg.1/src/devices/cpu/sm510/sm530op.cpp --- mame-0.242+dfsg.1/src/devices/cpu/sm510/sm530op.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/sm510/sm530op.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -104,7 +104,7 @@ void sm530_device::op_atf() { - // ATS: output ACC to F + // ATF: output ACC to F m_write_f(m_acc); } diff -Nru mame-0.242+dfsg.1/src/devices/cpu/sm510/sm590.cpp mame-0.243+dfsg.1/src/devices/cpu/sm510/sm590.cpp --- mame-0.242+dfsg.1/src/devices/cpu/sm510/sm590.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/sm510/sm590.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -13,7 +13,6 @@ #include "emu.h" #include "sm590.h" #include "sm510d.h" -#include "debugger.h" // MCU types diff -Nru mame-0.242+dfsg.1/src/devices/cpu/sm510/sm5a.cpp mame-0.243+dfsg.1/src/devices/cpu/sm510/sm5a.cpp --- mame-0.242+dfsg.1/src/devices/cpu/sm510/sm5a.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/sm510/sm5a.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -12,7 +12,6 @@ #include "emu.h" #include "sm5a.h" #include "sm510d.h" -#include "debugger.h" // MCU types diff -Nru mame-0.242+dfsg.1/src/devices/cpu/sm8500/sm8500.cpp mame-0.243+dfsg.1/src/devices/cpu/sm8500/sm8500.cpp --- mame-0.242+dfsg.1/src/devices/cpu/sm8500/sm8500.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/sm8500/sm8500.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -22,7 +22,6 @@ #include "emu.h" #include "sm8500.h" #include "sm8500d.h" -#include "debugger.h" DEFINE_DEVICE_TYPE(SM8500, sm8500_cpu_device, "sm8500", "Sharp SM8500") diff -Nru mame-0.242+dfsg.1/src/devices/cpu/sm8500/sm8500d.cpp mame-0.243+dfsg.1/src/devices/cpu/sm8500/sm8500d.cpp --- mame-0.242+dfsg.1/src/devices/cpu/sm8500/sm8500d.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/sm8500/sm8500d.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -30,9 +30,9 @@ }; const uint32_t sm8500_disassembler::s_flags[] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, STEP_COND, STEP_COND, 0, 0, 0, 0, 0, 0, 0, 0, STEP_OVER, STEP_OVER, 0, - 0, 0, 0, 0, 0, 0, STEP_OVER, 0, + 0, 0, 0, 0, 0, 0, STEP_COND, 0, 0, 0, 0, 0, 0, STEP_OVER, 0, 0, STEP_OUT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, STEP_OUT, 0, 0, @@ -576,5 +576,5 @@ util::stream_format(stream, "%s", s_mnemonic[ instr->mnemonic ]); } - return (pos - pc) | s_flags[instr->mnemonic] | SUPPORTED; + return (pos - pc) | (instr->arguments == AM_cjp && (op & 0x07) != 0 ? STEP_COND : s_flags[instr->mnemonic]) | SUPPORTED; } diff -Nru mame-0.242+dfsg.1/src/devices/cpu/sparc/sparc.cpp mame-0.243+dfsg.1/src/devices/cpu/sparc/sparc.cpp --- mame-0.242+dfsg.1/src/devices/cpu/sparc/sparc.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/sparc/sparc.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -24,8 +24,6 @@ #include "sparc.h" #include "sparcdefs.h" -#include "debugger.h" - #include "softfloat3/source/include/softfloat.h" #define LOG_BIU_CTRL (1U << 1) diff -Nru mame-0.242+dfsg.1/src/devices/cpu/sparc/sparcdasm.cpp mame-0.243+dfsg.1/src/devices/cpu/sparc/sparcdasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/sparc/sparcdasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/sparc/sparcdasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1117,7 +1117,10 @@ //const char * const comment(desc.get_comment ? desc.get_comment(m_config, desc.use_cc, pc, op) : nullptr); //if (comment) util::stream_format(stream, " - %s", comment); - return 4 | SUPPORTED; + if ((COND & 7) != 0) + return 4 | STEP_COND | step_over_extra(1) | SUPPORTED; + else + return 4 | SUPPORTED; // branch never or always } diff -Nru mame-0.242+dfsg.1/src/devices/cpu/sparc/ss1fcode.ipp mame-0.243+dfsg.1/src/devices/cpu/sparc/ss1fcode.ipp --- mame-0.242+dfsg.1/src/devices/cpu/sparc/ss1fcode.ipp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/sparc/ss1fcode.ipp 2022-04-29 05:37:26.000000000 +0000 @@ -23,7 +23,7 @@ if (false)//opcode == 0x6304) { m_log_fcodes = true; - //machine().debugger().debug_break(); + //machine().debug_break(); } else if (!m_log_fcodes) { diff -Nru mame-0.242+dfsg.1/src/devices/cpu/spc700/spc700.cpp mame-0.243+dfsg.1/src/devices/cpu/spc700/spc700.cpp --- mame-0.242+dfsg.1/src/devices/cpu/spc700/spc700.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/spc700/spc700.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -58,8 +58,6 @@ #include "emu.h" #include "spc700.h" -#include "debugger.h" - #include diff -Nru mame-0.242+dfsg.1/src/devices/cpu/spc700/spc700ds.cpp mame-0.243+dfsg.1/src/devices/cpu/spc700/spc700ds.cpp --- mame-0.242+dfsg.1/src/devices/cpu/spc700/spc700ds.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/spc700/spc700ds.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -321,6 +321,8 @@ flags = STEP_OVER; else if (opcode->name == RET || opcode->name == RETI) flags = STEP_OUT; + else if ((opcode->args[0] == REL || opcode->args[1] == REL) && opcode->name != BRA) + flags = STEP_COND; if (opcode->args[0] == DP && (opcode->args[1] == DP || opcode->args[1] == IMM)) { diff -Nru mame-0.242+dfsg.1/src/devices/cpu/ssem/ssem.cpp mame-0.243+dfsg.1/src/devices/cpu/ssem/ssem.cpp --- mame-0.242+dfsg.1/src/devices/cpu/ssem/ssem.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/ssem/ssem.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -7,7 +7,6 @@ */ #include "emu.h" -#include "debugger.h" #include "ssem.h" #include "ssemdasm.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/ssem/ssemdasm.cpp mame-0.243+dfsg.1/src/devices/cpu/ssem/ssemdasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/ssem/ssemdasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/ssem/ssemdasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -66,5 +66,5 @@ break; } - return 4 | SUPPORTED; + return 4 | (instr == 6 ? STEP_COND : 0) | SUPPORTED; } diff -Nru mame-0.242+dfsg.1/src/devices/cpu/ssp1601/ssp1601.cpp mame-0.243+dfsg.1/src/devices/cpu/ssp1601/ssp1601.cpp --- mame-0.242+dfsg.1/src/devices/cpu/ssp1601/ssp1601.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/ssp1601/ssp1601.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -20,8 +20,6 @@ #include "ssp1601.h" #include "ssp1601d.h" -#include "debugger.h" - /* detect ops with unimplemented/invalid fields. * Useful for homebrew or if a new VR revision pops up. */ diff -Nru mame-0.242+dfsg.1/src/devices/cpu/ssp1601/ssp1601d.cpp mame-0.243+dfsg.1/src/devices/cpu/ssp1601/ssp1601d.cpp --- mame-0.242+dfsg.1/src/devices/cpu/ssp1601/ssp1601d.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/ssp1601/ssp1601d.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -243,6 +243,8 @@ case 0x24: util::stream_format(stream, "call %s, %X", get_cond(op), opcodes.r16(pc+1)); flags |= STEP_OVER; + if (((op >> 4) & 0xf) != 0) + flags |= STEP_COND; size = 2; break; @@ -254,6 +256,8 @@ // bra cond, addr case 0x26: util::stream_format(stream, "bra %s, %X", get_cond(op), opcodes.r16(pc+1)); + if (((op >> 4) & 0xf) != 0) + flags |= STEP_COND; size = 2; break; diff -Nru mame-0.242+dfsg.1/src/devices/cpu/st62xx/st62xx_dasm.cpp mame-0.243+dfsg.1/src/devices/cpu/st62xx/st62xx_dasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/st62xx/st62xx_dasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/st62xx/st62xx_dasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -51,6 +51,7 @@ offs_t st62xx_disassembler::disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) { offs_t base_pc = pc; + offs_t flags = 0; const uint8_t op = opcodes.r8(pc); pc++; @@ -63,6 +64,7 @@ { const int8_t e = ((int8_t)op) >> 3; util::stream_format(stream, "JRNZ $%d", e); + flags = STEP_COND; break; } case 0x01: case 0x11: case 0x21: case 0x31: case 0x41: case 0x51: case 0x61: case 0x71: @@ -72,6 +74,7 @@ pc++; const uint16_t abc = ((op & 0xf0) >> 4) | (ab << 4); util::stream_format(stream, "CALL %Xh", abc); + flags = STEP_OVER; break; } case 0x09: case 0x19: case 0x29: case 0x39: case 0x49: case 0x59: case 0x69: case 0x79: @@ -90,6 +93,7 @@ { const int8_t e = ((int8_t)op) >> 3; util::stream_format(stream, "JRNC $%d", e); + flags = STEP_COND; break; } case 0x03: case 0x23: case 0x43: case 0x63: case 0x83: case 0xa3: case 0xc3: case 0xe3: @@ -100,6 +104,7 @@ const int8_t ee = (int8_t)opcodes.r8(pc); pc++; util::stream_format(stream, "JRR %d,%s,$%Xh", b, reg_name(rr), ee); + flags = STEP_COND; break; } case 0x13: case 0x33: case 0x53: case 0x73: case 0x93: case 0xb3: case 0xd3: case 0xf3: @@ -110,6 +115,7 @@ const int8_t ee = (int8_t)opcodes.r8(pc); pc++; util::stream_format(stream, "JRS %d,%s,$%Xh", b, reg_name(rr), ee); + flags = STEP_COND; break; } case 0x0b: case 0x2b: case 0x4b: case 0x6b: case 0x8b: case 0xab: case 0xcb: case 0xeb: @@ -135,6 +141,7 @@ { const int8_t e = ((int8_t)op) >> 3; util::stream_format(stream, "JRZ $%d", e); + flags = STEP_COND; break; } case 0x06: case 0x16: case 0x26: case 0x36: case 0x46: case 0x56: case 0x66: case 0x76: @@ -144,6 +151,7 @@ { const int8_t e = ((int8_t)op) >> 3; util::stream_format(stream, "JRC $%d", e); + flags = STEP_COND; break; } case 0x15: @@ -193,6 +201,7 @@ break; case 0x4d: util::stream_format(stream, "RETI"); + flags = STEP_OUT; break; case 0x5d: util::stream_format(stream, "DEC Y"); // y @@ -214,6 +223,7 @@ break; case 0xcd: util::stream_format(stream, "RET"); + flags = STEP_OUT; break; case 0xdd: util::stream_format(stream, "DEC W"); // w @@ -374,5 +384,5 @@ break; } - return (pc - base_pc) | SUPPORTED; + return (pc - base_pc) | flags | SUPPORTED; } diff -Nru mame-0.242+dfsg.1/src/devices/cpu/superfx/sfx_dasm.cpp mame-0.243+dfsg.1/src/devices/cpu/superfx/sfx_dasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/superfx/sfx_dasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/superfx/sfx_dasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -20,6 +20,7 @@ uint16_t alt = m_config->get_alt(); uint8_t bytes_consumed = 1; + offs_t flags = 0; switch(op) { @@ -45,42 +46,52 @@ case 0x06: // BLT util::stream_format(stream, "BLT %d", (int)(int8_t)param0); bytes_consumed = 2; + flags = STEP_COND; break; case 0x07: // BGE util::stream_format(stream, "BGE %d", (int)(int8_t)param0); bytes_consumed = 2; + flags = STEP_COND; break; case 0x08: // BNE util::stream_format(stream, "BNE %d", (int)(int8_t)param0); bytes_consumed = 2; + flags = STEP_COND; break; case 0x09: // BEQ util::stream_format(stream, "BEQ %d", (int)(int8_t)param0); bytes_consumed = 2; + flags = STEP_COND; break; case 0x0a: // BPL util::stream_format(stream, "BPL %d", (int)(int8_t)param0); bytes_consumed = 2; + flags = STEP_COND; break; case 0x0b: // BMI util::stream_format(stream, "BMI %d", (int)(int8_t)param0); bytes_consumed = 2; + flags = STEP_COND; break; case 0x0c: // BCC util::stream_format(stream, "BCC %d", (int)(int8_t)param0); bytes_consumed = 2; + flags = STEP_COND; break; case 0x0d: // BCS util::stream_format(stream, "BCS %d", (int)(int8_t)param0); bytes_consumed = 2; + flags = STEP_COND; break; case 0x0e: // BVC util::stream_format(stream, "BVC %d", (int)(int8_t)param0); bytes_consumed = 2; + flags = STEP_COND; break; case 0x0f: // BVS util::stream_format(stream, "BVS %d", (int)(int8_t)param0); bytes_consumed = 2; + flags = STEP_COND; break; case 0x10: case 0x11: case 0x12: case 0x13: case 0x14: case 0x15: case 0x16: case 0x17: @@ -423,5 +434,5 @@ break; } - return bytes_consumed | SUPPORTED; + return bytes_consumed | flags | SUPPORTED; } diff -Nru mame-0.242+dfsg.1/src/devices/cpu/superfx/superfx.cpp mame-0.243+dfsg.1/src/devices/cpu/superfx/superfx.cpp --- mame-0.242+dfsg.1/src/devices/cpu/superfx/superfx.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/superfx/superfx.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1,7 +1,6 @@ // license:GPL-2.0+ // copyright-holders:byuu #include "emu.h" -#include "debugger.h" #include "superfx.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/t11/t11.cpp mame-0.243+dfsg.1/src/devices/cpu/t11/t11.cpp --- mame-0.242+dfsg.1/src/devices/cpu/t11/t11.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/t11/t11.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -14,7 +14,6 @@ #include "emu.h" #include "t11.h" #include "t11dasm.h" -#include "debugger.h" /************************************* diff -Nru mame-0.242+dfsg.1/src/devices/cpu/t11/t11dasm.cpp mame-0.243+dfsg.1/src/devices/cpu/t11/t11dasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/t11/t11dasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/t11/t11dasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -184,26 +184,32 @@ case 0001000: case 0001100: case 0001200: case 0001300: offset = 2 * (int8_t)(op & 0377); util::stream_format(stream, "BNE %06o", (pc + offset) & 0177777); + flags = STEP_COND; break; case 0001400: case 0001500: case 0001600: case 0001700: offset = 2 * (int8_t)(op & 0377); util::stream_format(stream, "BEQ %06o", (pc + offset) & 0177777); + flags = STEP_COND; break; case 0002000: case 0002100: case 0002200: case 0002300: offset = 2 * (int8_t)(op & 0377); util::stream_format(stream, "BGE %06o", (pc + offset) & 0177777); + flags = STEP_COND; break; case 0002400: case 0002500: case 0002600: case 0002700: offset = 2 * (int8_t)(op & 0377); util::stream_format(stream, "BLT %06o", (pc + offset) & 0177777); + flags = STEP_COND; break; case 0003000: case 0003100: case 0003200: case 0003300: offset = 2 * (int8_t)(op & 0377); util::stream_format(stream, "BGT %06o", (pc + offset) & 0177777); + flags = STEP_COND; break; case 0003400: case 0003500: case 0003600: case 0003700: offset = 2 * (int8_t)(op & 0377); util::stream_format(stream, "BLE %06o", (pc + offset) & 0177777); + flags = STEP_COND; break; case 0004000: case 0004100: case 0004200: case 0004300: case 0004400: case 0004500: case 0004600: case 0004700: @@ -359,39 +365,48 @@ case 0077000: case 0077100: case 0077200: case 0077300: case 0077400: case 0077500: case 0077600: case 0077700: addr = (pc - 2 * lo) & 0177777; util::stream_format(stream, "SOB %s,%06o", regs[hi & 7], addr); + flags = STEP_COND; break; case 0100000: case 0100100: case 0100200: case 0100300: offset = 2 * (int8_t)(op & 0377); util::stream_format(stream, "BPL %06o", (pc + offset) & 0177777); + flags = STEP_COND; break; case 0100400: case 0100500: case 0100600: case 0100700: offset = 2 * (int8_t)(op & 0377); util::stream_format(stream, "BMI %06o", (pc + offset) & 0177777); + flags = STEP_COND; break; case 0101000: case 0101100: case 0101200: case 0101300: offset = 2 * (int8_t)(op & 0377); util::stream_format(stream, "BHI %06o", (pc + offset) & 0177777); + flags = STEP_COND; break; case 0101400: case 0101500: case 0101600: case 0101700: offset = 2 * (int8_t)(op & 0377); util::stream_format(stream, "BLOS %06o", (pc + offset) & 0177777); + flags = STEP_COND; break; case 0102000: case 0102100: case 0102200: case 0102300: offset = 2 * (int8_t)(op & 0377); util::stream_format(stream, "BVC %06o", (pc + offset) & 0177777); + flags = STEP_COND; break; case 0102400: case 0102500: case 0102600: case 0102700: offset = 2 * (int8_t)(op & 0377); util::stream_format(stream, "BVS %06o", (pc + offset) & 0177777); + flags = STEP_COND; break; case 0103000: case 0103100: case 0103200: case 0103300: offset = 2 * (int8_t)(op & 0377); util::stream_format(stream, "BCC %06o", (pc + offset) & 0177777); + flags = STEP_COND; break; case 0103400: case 0103500: case 0103600: case 0103700: offset = 2 * (int8_t)(op & 0377); util::stream_format(stream, "BCS %06o", (pc + offset) & 0177777); + flags = STEP_COND; break; case 0104000: case 0104100: case 0104200: case 0104300: util::stream_format(stream, "EMT %03o", op & 0377); diff -Nru mame-0.242+dfsg.1/src/devices/cpu/tlcs870/tlcs870.cpp mame-0.243+dfsg.1/src/devices/cpu/tlcs870/tlcs870.cpp --- mame-0.242+dfsg.1/src/devices/cpu/tlcs870/tlcs870.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/tlcs870/tlcs870.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -15,7 +15,6 @@ #include "emu.h" #include "tlcs870.h" #include "tlcs870d.h" -#include "debugger.h" //#define VERBOSE 1 #include "logmacro.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/tlcs870/tlcs870d.cpp mame-0.243+dfsg.1/src/devices/cpu/tlcs870/tlcs870d.cpp --- mame-0.242+dfsg.1/src/devices/cpu/tlcs870/tlcs870d.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/tlcs870/tlcs870d.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -2268,9 +2268,16 @@ util::stream_format (stream, "%-5s", op_names[ m_op ] ); + offs_t flags = 0; if (m_param1_type) { disassemble_param(stream, pc, opcodes, params, m_param1_type, m_param1); + if ((m_param1_type & MODE_MASK) == CONDITIONAL) + flags = STEP_COND; + else if (m_op == CALL || m_op == CALLP || m_op == CALLV || m_op == SWI) + flags = STEP_OVER; + else if (m_op == RET || m_op == RETI || m_op == RETN) + flags = STEP_OUT; } if (m_param2_type) @@ -2281,5 +2288,5 @@ } - return (m_addr - pc) | SUPPORTED; + return (m_addr - pc) | flags | SUPPORTED; } diff -Nru mame-0.242+dfsg.1/src/devices/cpu/tlcs870/tlcs870_ops.cpp mame-0.243+dfsg.1/src/devices/cpu/tlcs870/tlcs870_ops.cpp --- mame-0.242+dfsg.1/src/devices/cpu/tlcs870/tlcs870_ops.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/tlcs870/tlcs870_ops.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -11,7 +11,6 @@ #include "emu.h" #include "tlcs870.h" #include "tlcs870d.h" -#include "debugger.h" // Main dispatch handlers for these diff -Nru mame-0.242+dfsg.1/src/devices/cpu/tlcs870/tlcs870_ops_dst.cpp mame-0.243+dfsg.1/src/devices/cpu/tlcs870/tlcs870_ops_dst.cpp --- mame-0.242+dfsg.1/src/devices/cpu/tlcs870/tlcs870_ops_dst.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/tlcs870/tlcs870_ops_dst.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -25,7 +25,6 @@ #include "emu.h" #include "tlcs870.h" #include "tlcs870d.h" -#include "debugger.h" // Main dispatch handlers for these diff -Nru mame-0.242+dfsg.1/src/devices/cpu/tlcs870/tlcs870_ops_helper.cpp mame-0.243+dfsg.1/src/devices/cpu/tlcs870/tlcs870_ops_helper.cpp --- mame-0.242+dfsg.1/src/devices/cpu/tlcs870/tlcs870_ops_helper.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/tlcs870/tlcs870_ops_helper.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -9,7 +9,6 @@ #include "emu.h" #include "tlcs870.h" #include "tlcs870d.h" -#include "debugger.h" // General Helpers diff -Nru mame-0.242+dfsg.1/src/devices/cpu/tlcs870/tlcs870_ops_reg.cpp mame-0.243+dfsg.1/src/devices/cpu/tlcs870/tlcs870_ops_reg.cpp --- mame-0.242+dfsg.1/src/devices/cpu/tlcs870/tlcs870_ops_reg.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/tlcs870/tlcs870_ops_reg.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -37,7 +37,6 @@ #include "emu.h" #include "tlcs870.h" #include "tlcs870d.h" -#include "debugger.h" // Main dispatch handlers for these diff -Nru mame-0.242+dfsg.1/src/devices/cpu/tlcs870/tlcs870_ops_src.cpp mame-0.243+dfsg.1/src/devices/cpu/tlcs870/tlcs870_ops_src.cpp --- mame-0.242+dfsg.1/src/devices/cpu/tlcs870/tlcs870_ops_src.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/tlcs870/tlcs870_ops_src.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -25,7 +25,6 @@ #include "emu.h" #include "tlcs870.h" #include "tlcs870d.h" -#include "debugger.h" // Main dispatch handlers for these diff -Nru mame-0.242+dfsg.1/src/devices/cpu/tlcs90/tlcs90.cpp mame-0.243+dfsg.1/src/devices/cpu/tlcs90/tlcs90.cpp --- mame-0.242+dfsg.1/src/devices/cpu/tlcs90/tlcs90.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/tlcs90/tlcs90.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -13,7 +13,6 @@ *************************************************************************************************************/ #include "emu.h" -#include "debugger.h" #include "tlcs90.h" #include "tlcs90d.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/tlcs900/dasm900.cpp mame-0.243+dfsg.1/src/devices/cpu/tlcs900/dasm900.cpp --- mame-0.242+dfsg.1/src/devices/cpu/tlcs900/dasm900.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/tlcs900/dasm900.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1822,6 +1822,9 @@ case M_RETI: flags = STEP_OUT; break; + case M_DJNZ: + flags = STEP_COND; + break; } switch( dasm->operand1 ) @@ -1851,6 +1854,8 @@ case O_CC: util::stream_format(stream, " %s", s_cond[op & 0x0F]); + if ((op & 0x07) != 0 && dasm->mnemonic != M_SCC) + flags |= STEP_COND; break; case O_CR8: @@ -2037,6 +2042,8 @@ case O_CC: util::stream_format(stream, ",%s", s_cond[op & 0x0F]); + if ((op & 0x07) != 0 && dasm->mnemonic != M_SCC) + flags |= STEP_COND; break; case O_CR8: diff -Nru mame-0.242+dfsg.1/src/devices/cpu/tms1000/tms0270.cpp mame-0.243+dfsg.1/src/devices/cpu/tms1000/tms0270.cpp --- mame-0.242+dfsg.1/src/devices/cpu/tms1000/tms0270.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/tms1000/tms0270.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -8,7 +8,6 @@ #include "emu.h" #include "tms0270.h" -#include "debugger.h" // TMS0270 is a TMS0980 with earrings and a new hat. The new changes look like a quick afterthought, almost hacky // - RAM, ROM, and main instructions PLAs is the same as TMS0980 diff -Nru mame-0.242+dfsg.1/src/devices/cpu/tms1000/tms0980.cpp mame-0.243+dfsg.1/src/devices/cpu/tms1000/tms0980.cpp --- mame-0.242+dfsg.1/src/devices/cpu/tms1000/tms0980.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/tms1000/tms0980.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -9,7 +9,6 @@ #include "emu.h" #include "tms0980.h" #include "tms1k_dasm.h" -#include "debugger.h" // TMS0980 // - 144x4bit RAM array at the bottom-left (128+16, set up as 8x18x4) diff -Nru mame-0.242+dfsg.1/src/devices/cpu/tms1000/tms1000.cpp mame-0.243+dfsg.1/src/devices/cpu/tms1000/tms1000.cpp --- mame-0.242+dfsg.1/src/devices/cpu/tms1000/tms1000.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/tms1000/tms1000.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -13,7 +13,6 @@ #include "emu.h" #include "tms1000.h" #include "tms1k_dasm.h" -#include "debugger.h" // TMS1000 // - 64x4bit RAM array at the bottom-left diff -Nru mame-0.242+dfsg.1/src/devices/cpu/tms1000/tms1100.cpp mame-0.243+dfsg.1/src/devices/cpu/tms1000/tms1100.cpp --- mame-0.242+dfsg.1/src/devices/cpu/tms1000/tms1100.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/tms1000/tms1100.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -12,7 +12,6 @@ #include "emu.h" #include "tms1100.h" #include "tms1k_dasm.h" -#include "debugger.h" // TMS1100 is nearly the same as TMS1000, some different opcodes, and with double the RAM and ROM DEFINE_DEVICE_TYPE(TMS1100, tms1100_cpu_device, "tms1100", "Texas Instruments TMS1100") // 28-pin DIP, 11 R pins diff -Nru mame-0.242+dfsg.1/src/devices/cpu/tms1000/tms1400.cpp mame-0.243+dfsg.1/src/devices/cpu/tms1000/tms1400.cpp --- mame-0.242+dfsg.1/src/devices/cpu/tms1000/tms1400.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/tms1000/tms1400.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -11,7 +11,6 @@ #include "emu.h" #include "tms1400.h" -#include "debugger.h" // TMS1400 follows the TMS1100, it doubles the ROM size again (4 chapters of 16 pages), and adds a 3-level callstack // - rotate the view and mirror the OR-mask to get the proper layout of the mpla, the default is identical to tms1100 diff -Nru mame-0.242+dfsg.1/src/devices/cpu/tms1000/tms1k_base.cpp mame-0.243+dfsg.1/src/devices/cpu/tms1000/tms1k_base.cpp --- mame-0.242+dfsg.1/src/devices/cpu/tms1000/tms1k_base.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/tms1000/tms1k_base.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -70,7 +70,6 @@ #include "emu.h" #include "tms1k_base.h" -#include "debugger.h" tms1k_base_device::tms1k_base_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u8 o_pins, u8 r_pins, u8 pc_bits, u8 byte_bits, u8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data) : cpu_device(mconfig, type, tag, owner, clock) diff -Nru mame-0.242+dfsg.1/src/devices/cpu/tms1000/tms1k_dasm.cpp mame-0.243+dfsg.1/src/devices/cpu/tms1000/tms1k_dasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/tms1000/tms1k_dasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/tms1000/tms1k_dasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -83,7 +83,7 @@ const u32 tms1000_base_disassembler::s_flags[] = { 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, STEP_OVER, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, STEP_COND, STEP_OVER | STEP_COND, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, STEP_OUT, 0, 0, 0, 0, diff -Nru mame-0.242+dfsg.1/src/devices/cpu/tms1000/tp0320.cpp mame-0.243+dfsg.1/src/devices/cpu/tms1000/tp0320.cpp --- mame-0.242+dfsg.1/src/devices/cpu/tms1000/tp0320.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/tms1000/tp0320.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -12,7 +12,6 @@ #include "emu.h" #include "tp0320.h" #include "tms1k_dasm.h" -#include "debugger.h" // TP0320 is TI's first CMOS MCU with integrated LCD controller, the die is still very similar to TMS0980 // - 2048x9bit ROM, same as on TMS0980 with different row-select diff -Nru mame-0.242+dfsg.1/src/devices/cpu/tms32010/32010dsm.cpp mame-0.243+dfsg.1/src/devices/cpu/tms32010/32010dsm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/tms32010/32010dsm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/tms32010/32010dsm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -282,7 +282,11 @@ switch (*cp++) { case 'A': sprintf(num,"%02Xh",a); break; // was $%02X - case 'B': sprintf(num,"%04Xh",b); break; // was $%04X + case 'B': + if (strncmp(cp, "b ", 3) && strncmp(cp, "cal", 3)) + flags = STEP_COND; + sprintf(num,"%04Xh",b); // was $%04X + break; case 'D': sprintf(num,"%02Xh",d); break; case 'K': sprintf(num,"%d",k); break; case 'N': sprintf(num,"%s",nextar[n]); break; diff -Nru mame-0.242+dfsg.1/src/devices/cpu/tms32010/tms32010.cpp mame-0.243+dfsg.1/src/devices/cpu/tms32010/tms32010.cpp --- mame-0.242+dfsg.1/src/devices/cpu/tms32010/tms32010.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/tms32010/tms32010.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -60,7 +60,6 @@ #include "emu.h" #include "tms32010.h" #include "32010dsm.h" -#include "debugger.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/tms32025/32025dsm.cpp mame-0.243+dfsg.1/src/devices/cpu/tms32025/32025dsm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/tms32025/32025dsm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/tms32025/32025dsm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -440,6 +440,8 @@ flags = STEP_OVER; else if (!strncmp(cp, "ret", 3)) flags = STEP_OUT; + else if ((code & 0xfe000000) == 0x5e000000 || (code >= 0xf0000000 && code < 0xfc000000)) + flags = STEP_COND; while (*cp) { diff -Nru mame-0.242+dfsg.1/src/devices/cpu/tms32025/tms32025.cpp mame-0.243+dfsg.1/src/devices/cpu/tms32025/tms32025.cpp --- mame-0.242+dfsg.1/src/devices/cpu/tms32025/tms32025.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/tms32025/tms32025.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -121,7 +121,6 @@ #include "emu.h" #include "tms32025.h" #include "32025dsm.h" -#include "debugger.h" #define CLK 4 /* 1 cycle equals 4 clock ticks */ /* PE/DI */ diff -Nru mame-0.242+dfsg.1/src/devices/cpu/tms32031/dis32031.cpp mame-0.243+dfsg.1/src/devices/cpu/tms32031/dis32031.cpp --- mame-0.242+dfsg.1/src/devices/cpu/tms32031/dis32031.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/tms32031/dis32031.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -477,6 +477,8 @@ char temp[10]; sprintf(temp, "B%s%s", condition[(op >> 16) & 31], ((op >> 21) & 1) ? "D" : ""); util::stream_format(stream, "%-6s%s", temp, regname[op & 31]); + if (((op >> 16) & 31) != 0) + flags = STEP_COND | ((op >> 21) & 1 ? step_over_extra(1) : 0); break; } @@ -485,6 +487,8 @@ char temp[10]; sprintf(temp, "B%s%s", condition[(op >> 16) & 31], ((op >> 21) & 1) ? "D" : ""); util::stream_format(stream, "%-6s$%06X", temp, (pc + (((op >> 21) & 1) ? 3 : 1) + (int16_t)op) & 0xffffff); + if (((op >> 16) & 31) != 0) + flags = STEP_COND | ((op >> 21) & 1 ? step_over_extra(1) : 0); break; } @@ -494,6 +498,7 @@ char temp[10]; sprintf(temp, "DB%s%s", condition[(op >> 16) & 31], ((op >> 21) & 1) ? "D" : ""); util::stream_format(stream, "%-6sAR%d,%s", temp, (op >> 22) & 7, regname[op & 31]); + flags = STEP_COND | ((op >> 21) & 1 ? step_over_extra(1) : 0); break; } @@ -502,6 +507,7 @@ char temp[10]; sprintf(temp, "DB%s%s", condition[(op >> 16) & 31], ((op >> 21) & 1) ? "D" : ""); util::stream_format(stream, "%-6sAR%d,$%06X", temp, (op >> 22) & 7, (pc + (((op >> 21) & 1) ? 3 : 1) + (int16_t)op) & 0xffffff); + flags = STEP_COND | ((op >> 21) & 1 ? step_over_extra(1) : 0); break; } @@ -537,12 +543,12 @@ case 0x0f0: util::stream_format(stream, "RETI%s", condition[(op >> 16) & 31]); - flags = STEP_OUT; + flags = STEP_OUT | (((op >> 16) & 31) != 0 ? STEP_COND : 0); break; case 0x0f1: util::stream_format(stream, "RETS%s", condition[(op >> 16) & 31]); - flags = STEP_OUT; + flags = STEP_OUT | (((op >> 16) & 31) != 0 ? STEP_COND : 0); break; diff -Nru mame-0.242+dfsg.1/src/devices/cpu/tms32031/tms32031.cpp mame-0.243+dfsg.1/src/devices/cpu/tms32031/tms32031.cpp --- mame-0.242+dfsg.1/src/devices/cpu/tms32031/tms32031.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/tms32031/tms32031.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -73,7 +73,6 @@ #include "emu.h" #include "tms32031.h" #include "dis32031.h" -#include "debugger.h" //************************************************************************** diff -Nru mame-0.242+dfsg.1/src/devices/cpu/tms32051/dis32051.cpp mame-0.243+dfsg.1/src/devices/cpu/tms32051/dis32051.cpp --- mame-0.242+dfsg.1/src/devices/cpu/tms32051/dis32051.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/tms32051/dis32051.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -128,9 +128,10 @@ } } -void tms32051_disassembler::dasm_group_be(uint16_t opcode, offs_t &npc, const data_buffer &opcodes) +uint32_t tms32051_disassembler::dasm_group_be(uint16_t opcode, offs_t &npc, const data_buffer &opcodes) { int subop = opcode & 0xff; + uint32_t flags = 0; switch (subop) { @@ -186,8 +187,8 @@ case 0x4d: util::stream_format(*output, "setc xf"); break; case 0x4e: util::stream_format(*output, "clrc carry"); break; case 0x4f: util::stream_format(*output, "setc carry"); break; - case 0x51: util::stream_format(*output, "trap"); break; - case 0x52: util::stream_format(*output, "nmi"); break; + case 0x51: util::stream_format(*output, "trap"); flags = STEP_OVER; break; + case 0x52: util::stream_format(*output, "nmi"); flags = STEP_OVER; break; case 0x58: util::stream_format(*output, "zpr"); break; case 0x59: util::stream_format(*output, "zap"); break; case 0x5a: util::stream_format(*output, "sath"); break; @@ -200,7 +201,7 @@ case 0x74: case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: case 0x7a: case 0x7b: case 0x7c: case 0x7d: case 0x7e: case 0x7f: - util::stream_format(*output, "intr %d", opcode & 0x1f); break; + util::stream_format(*output, "intr %d", opcode & 0x1f); flags = STEP_OVER; break; case 0x80: util::stream_format(*output, "mpy #%04X", FETCH(npc, opcodes)); break; case 0x81: util::stream_format(*output, "and #%04X", FETCH(npc, opcodes) << 16); break; @@ -212,6 +213,7 @@ default: util::stream_format(*output, "??? (group be)"); break; } + return flags; } void tms32051_disassembler::dasm_group_bf(uint16_t opcode, offs_t &npc, const data_buffer &opcodes) @@ -376,11 +378,11 @@ case 0x78: util::stream_format(*output, "adrk #%02X", opcode & 0xff); break; case 0x79: util::stream_format(*output, "b %04X, %s", FETCH(npc, opcodes), GET_ADDRESS(1, address)); break; case 0x7a: util::stream_format(*output, "call %04X, %s", FETCH(npc, opcodes), GET_ADDRESS(1, address)); flags = STEP_OVER; break; - case 0x7b: util::stream_format(*output, "banz %04X, %s", FETCH(npc, opcodes), GET_ADDRESS(1, address)); break; + case 0x7b: util::stream_format(*output, "banz %04X, %s", FETCH(npc, opcodes), GET_ADDRESS(1, address)); flags = STEP_COND; break; case 0x7c: util::stream_format(*output, "sbrk #%02X", opcode & 0xff); break; case 0x7d: util::stream_format(*output, "bd %04X, %s", FETCH(npc, opcodes), GET_ADDRESS(1, address)); break; - case 0x7e: util::stream_format(*output, "calld %04X, %s", FETCH(npc, opcodes), GET_ADDRESS(1, address)); flags = STEP_OVER; break; - case 0x7f: util::stream_format(*output, "banzd %04X, %s", FETCH(npc, opcodes), GET_ADDRESS(1, address)); break; + case 0x7e: util::stream_format(*output, "calld %04X, %s", FETCH(npc, opcodes), GET_ADDRESS(1, address)); flags = STEP_OVER | step_over_extra(1); break; + case 0x7f: util::stream_format(*output, "banzd %04X, %s", FETCH(npc, opcodes), GET_ADDRESS(1, address)); flags = STEP_COND | step_over_extra(1); break; case 0x80: case 0x81: case 0x82: case 0x83: case 0x84: case 0x85: case 0x86: case 0x87: @@ -454,7 +456,7 @@ util::stream_format(*output, "ldp #%03X", opcode & 0x1ff); break; } - case 0xbe: dasm_group_be(opcode, npc, opcodes); break; + case 0xbe: flags = dasm_group_be(opcode, npc, opcodes); break; case 0xbf: dasm_group_bf(opcode, npc, opcodes); break; case 0xe0: case 0xe1: case 0xe2: case 0xe3: @@ -467,6 +469,7 @@ util::stream_format(*output, "bcnd %04X", FETCH(npc, opcodes)); print_condition_codes(true, zl, cv, tp); + flags = STEP_COND; break; } @@ -482,6 +485,7 @@ util::stream_format(*output, "xc %d", n); print_condition_codes(true, zl, cv, tp); + flags = STEP_COND; break; } @@ -495,6 +499,7 @@ util::stream_format(*output, "cc %04X", FETCH(npc, opcodes)); print_condition_codes(true, zl, cv, tp); + flags = STEP_OVER | STEP_COND; break; } @@ -509,13 +514,14 @@ if (opcode == 0xef00) { util::stream_format(*output, "ret"); + flags = STEP_OUT; } else { util::stream_format(*output, "retc "); print_condition_codes(false, zl, cv, tp); + flags = STEP_OUT | STEP_COND; } - flags = STEP_OUT; break; } @@ -529,6 +535,7 @@ util::stream_format(*output, "bcndd %04X", FETCH(npc, opcodes)); print_condition_codes(true, zl, cv, tp); + flags = STEP_COND | step_over_extra(1); break; } @@ -542,6 +549,7 @@ util::stream_format(*output, "ccd %04X", FETCH(npc, opcodes)); print_condition_codes(true, zl, cv, tp); + flags = STEP_OVER | STEP_COND | step_over_extra(1); break; } @@ -556,13 +564,14 @@ if (opcode == 0xff00) { util::stream_format(*output, "retd"); + flags = STEP_OUT | step_over_extra(1); } else { util::stream_format(*output, "retcd "); print_condition_codes(false, zl, cv, tp); + flags = STEP_OUT | STEP_COND | step_over_extra(1); } - flags = STEP_OUT; break; } diff -Nru mame-0.242+dfsg.1/src/devices/cpu/tms32051/dis32051.h mame-0.243+dfsg.1/src/devices/cpu/tms32051/dis32051.h --- mame-0.242+dfsg.1/src/devices/cpu/tms32051/dis32051.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/tms32051/dis32051.h 2022-04-29 05:37:26.000000000 +0000 @@ -23,7 +23,7 @@ std::string GET_ADDRESS(int addr_mode, int address); std::string GET_SHIFT(int shift); void print_condition_codes(bool pp, int zl, int cv, int tp); - void dasm_group_be(uint16_t opcode, offs_t &npc, const data_buffer &opcodes); + uint32_t dasm_group_be(uint16_t opcode, offs_t &npc, const data_buffer &opcodes); void dasm_group_bf(uint16_t opcode, offs_t &npc, const data_buffer &opcodes); std::ostream *output; diff -Nru mame-0.242+dfsg.1/src/devices/cpu/tms32051/tms32051.cpp mame-0.243+dfsg.1/src/devices/cpu/tms32051/tms32051.cpp --- mame-0.242+dfsg.1/src/devices/cpu/tms32051/tms32051.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/tms32051/tms32051.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -9,7 +9,6 @@ #include "emu.h" #include "tms32051.h" #include "dis32051.h" -#include "debugger.h" enum { diff -Nru mame-0.242+dfsg.1/src/devices/cpu/tms32082/tms32082.cpp mame-0.243+dfsg.1/src/devices/cpu/tms32082/tms32082.cpp --- mame-0.242+dfsg.1/src/devices/cpu/tms32082/tms32082.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/tms32082/tms32082.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -11,7 +11,6 @@ #include "tms32082.h" #include "dis_pp.h" #include "dis_mp.h" -#include "debugger.h" DEFINE_DEVICE_TYPE(TMS32082_MP, tms32082_mp_device, "tms32082_mp", "Texas Instruments TMS32082 MP") DEFINE_DEVICE_TYPE(TMS32082_PP, tms32082_pp_device, "tms32082_pp", "Texas Instruments TMS32082 PP") diff -Nru mame-0.242+dfsg.1/src/devices/cpu/tms34010/34010dsm.cpp mame-0.243+dfsg.1/src/devices/cpu/tms34010/34010dsm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/tms34010/34010dsm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/tms34010/34010dsm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -861,7 +861,7 @@ print_des_reg(stream); stream << ","; print_relative(stream, pc, pos, params); - flags = STEP_OVER; + flags = STEP_COND; break; case 0x01a0: @@ -869,7 +869,7 @@ print_des_reg(stream); stream << ","; print_relative(stream, pc, pos, params); - flags = STEP_OVER; + flags = STEP_COND; break; case 0x01c0: @@ -877,7 +877,7 @@ print_des_reg(stream); stream << ","; print_relative(stream, pc, pos, params); - flags = STEP_OVER; + flags = STEP_COND; break; case 0x01e0: @@ -1063,7 +1063,7 @@ print_des_reg(stream); stream << ","; print_relative_5bit(stream, pc); - flags = STEP_OVER; + flags = STEP_COND; break; @@ -1465,6 +1465,8 @@ util::stream_format(stream, "JR"); } + if ((op & 0x0f00) != 0) + flags = STEP_COND; print_condition_code(stream); stream << " "; diff -Nru mame-0.242+dfsg.1/src/devices/cpu/tms34010/tms34010.cpp mame-0.243+dfsg.1/src/devices/cpu/tms34010/tms34010.cpp --- mame-0.242+dfsg.1/src/devices/cpu/tms34010/tms34010.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/tms34010/tms34010.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -16,7 +16,6 @@ #include "tms34010.h" #include "34010dsm.h" -#include "debugger.h" #include "screen.h" #define LOG_GENERAL (1U << 0) diff -Nru mame-0.242+dfsg.1/src/devices/cpu/tms57002/tms57002.cpp mame-0.243+dfsg.1/src/devices/cpu/tms57002/tms57002.cpp --- mame-0.242+dfsg.1/src/devices/cpu/tms57002/tms57002.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/tms57002/tms57002.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -10,7 +10,6 @@ #include "emu.h" #include "tms57002.h" -#include "debugger.h" #include "57002dsm.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/tms57002/tms57kdec.cpp mame-0.243+dfsg.1/src/devices/cpu/tms57002/tms57kdec.cpp --- mame-0.242+dfsg.1/src/devices/cpu/tms57002/tms57kdec.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/tms57002/tms57kdec.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -9,7 +9,6 @@ ***************************************************************************/ #include "emu.h" -#include "debugger.h" #include "tms57002.h" #include diff -Nru mame-0.242+dfsg.1/src/devices/cpu/tms7000/7000dasm.cpp mame-0.243+dfsg.1/src/devices/cpu/tms7000/7000dasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/tms7000/7000dasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/tms7000/7000dasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -102,29 +102,29 @@ {0x9C, "BR", 45, 0 }, {0xAC, "BR", 12, 0 }, - {0x66, "BTJO", 13, 0 }, - {0x16, "BTJO", 14, 0 }, - {0x36, "BTJO", 15, 0 }, - {0x46, "BTJO", 16, 0 }, - {0x26, "BTJO", 17, 0 }, - {0x56, "BTJO", 18, 0 }, - {0x76, "BTJO", 19, 0 }, - - {0x86, "BTJOP", 20, 0 }, - {0x96, "BTJOP", 21, 0 }, - {0xA6, "BTJOP", 22, 0 }, - - {0x67, "BTJZ", 13, 0 }, - {0x17, "BTJZ", 14, 0 }, - {0x37, "BTJZ", 15, 0 }, - {0x47, "BTJZ", 16, 0 }, - {0x27, "BTJZ", 17, 0 }, - {0x57, "BTJZ", 18, 0 }, - {0x77, "BTJZ", 19, 0 }, - - {0x87, "BTJZP", 20, 0 }, - {0x97, "BTJZP", 21, 0 }, - {0xA7, "BTJZP", 22, 0 }, + {0x66, "BTJO", 13, STEP_COND }, + {0x16, "BTJO", 14, STEP_COND }, + {0x36, "BTJO", 15, STEP_COND }, + {0x46, "BTJO", 16, STEP_COND }, + {0x26, "BTJO", 17, STEP_COND }, + {0x56, "BTJO", 18, STEP_COND }, + {0x76, "BTJO", 19, STEP_COND }, + + {0x86, "BTJOP", 20, STEP_COND }, + {0x96, "BTJOP", 21, STEP_COND }, + {0xA6, "BTJOP", 22, STEP_COND }, + + {0x67, "BTJZ", 13, STEP_COND }, + {0x17, "BTJZ", 14, STEP_COND }, + {0x37, "BTJZ", 15, STEP_COND }, + {0x47, "BTJZ", 16, STEP_COND }, + {0x27, "BTJZ", 17, STEP_COND }, + {0x57, "BTJZ", 18, STEP_COND }, + {0x77, "BTJZ", 19, STEP_COND }, + + {0x87, "BTJZP", 20, STEP_COND }, + {0x97, "BTJZP", 21, STEP_COND }, + {0xA7, "BTJZP", 22, STEP_COND }, {0x8E, "CALL", 43, STEP_OVER }, {0x9E, "CALL", 45, STEP_OVER }, @@ -166,9 +166,9 @@ {0x06, "DINT", 23, 0 }, - {0xBA, "DJNZ", 25, 0 }, - {0xCA, "DJNZ", 26, 0 }, - {0xDA, "DJNZ", 27, 0 }, + {0xBA, "DJNZ", 25, STEP_COND }, + {0xCA, "DJNZ", 26, STEP_COND }, + {0xDA, "DJNZ", 27, STEP_COND }, {0x6F, "DSB", 0, 0 }, {0x1F, "DSB", 1, 0 }, @@ -190,14 +190,14 @@ {0xC4, "INV B", 23, 0 }, {0xD4, "INV", 24, 0 }, - {0xE2, "JEQ", 28, 0 }, - {0xE3, "JHS", 28, 0 }, - {0xE7, "JL", 28, 0 }, + {0xE2, "JEQ", 28, STEP_COND }, + {0xE3, "JHS", 28, STEP_COND }, + {0xE7, "JL", 28, STEP_COND }, {0xE0, "JMP", 28, 0 }, - {0xE1, "JN", 28, 0 }, - {0xE6, "JNZ", 28, 0 }, - {0xE4, "JP", 28, 0 }, - {0xE5, "JPZ", 28, 0 }, + {0xE1, "JN", 28, STEP_COND }, + {0xE6, "JNZ", 28, STEP_COND }, + {0xE4, "JP", 28, STEP_COND }, + {0xE5, "JPZ", 28, STEP_COND }, {0x8A, "LDA", 10, 0 }, {0x9A, "LDA", 45, 0 }, diff -Nru mame-0.242+dfsg.1/src/devices/cpu/tms7000/tms7000.h mame-0.243+dfsg.1/src/devices/cpu/tms7000/tms7000.h --- mame-0.242+dfsg.1/src/devices/cpu/tms7000/tms7000.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/tms7000/tms7000.h 2022-04-29 05:37:26.000000000 +0000 @@ -11,8 +11,6 @@ #pragma once -#include "debugger.h" - enum { TMS7000_PC=1, TMS7000_SP, TMS7000_ST, TMS7000_A, TMS7000_B }; enum diff -Nru mame-0.242+dfsg.1/src/devices/cpu/tms9900/9900dasm.cpp mame-0.243+dfsg.1/src/devices/cpu/tms9900/9900dasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/tms9900/9900dasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/tms9900/9900dasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -412,6 +412,8 @@ case format_2a: /* jump instructions */ displacement = (signed char)BITS(OP,8,15); util::stream_format(stream, "%-4s >%04x", mnemonic, 0xffff & (PC + displacement * 2)); + if (opc != _jmp) + dasmflags |= STEP_COND; break; case format_2b: /* bit I/O instructions */ diff -Nru mame-0.242+dfsg.1/src/devices/cpu/tms9900/ti990_10.h mame-0.243+dfsg.1/src/devices/cpu/tms9900/ti990_10.h --- mame-0.242+dfsg.1/src/devices/cpu/tms9900/ti990_10.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/tms9900/ti990_10.h 2022-04-29 05:37:26.000000000 +0000 @@ -11,7 +11,6 @@ #pragma once -#include "debugger.h" #include "tms99com.h" class ti990_10_device : public cpu_device diff -Nru mame-0.242+dfsg.1/src/devices/cpu/tms9900/tms9900.h mame-0.243+dfsg.1/src/devices/cpu/tms9900/tms9900.h --- mame-0.242+dfsg.1/src/devices/cpu/tms9900/tms9900.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/tms9900/tms9900.h 2022-04-29 05:37:26.000000000 +0000 @@ -13,7 +13,6 @@ #pragma once -#include "debugger.h" #include "tms99com.h" enum diff -Nru mame-0.242+dfsg.1/src/devices/cpu/tms9900/tms9980a.h mame-0.243+dfsg.1/src/devices/cpu/tms9900/tms9980a.h --- mame-0.242+dfsg.1/src/devices/cpu/tms9900/tms9980a.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/tms9900/tms9980a.h 2022-04-29 05:37:26.000000000 +0000 @@ -10,7 +10,6 @@ #pragma once -#include "debugger.h" #include "tms9900.h" enum diff -Nru mame-0.242+dfsg.1/src/devices/cpu/tms9900/tms9995.h mame-0.243+dfsg.1/src/devices/cpu/tms9900/tms9995.h --- mame-0.242+dfsg.1/src/devices/cpu/tms9900/tms9995.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/tms9900/tms9995.h 2022-04-29 05:37:26.000000000 +0000 @@ -12,7 +12,6 @@ #pragma once -#include "debugger.h" #include "tms99com.h" // device type definition diff -Nru mame-0.242+dfsg.1/src/devices/cpu/tx0/tx0.cpp mame-0.243+dfsg.1/src/devices/cpu/tx0/tx0.cpp --- mame-0.242+dfsg.1/src/devices/cpu/tx0/tx0.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/tx0/tx0.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -13,7 +13,6 @@ #include "emu.h" #include "tx0.h" #include "tx0dasm.h" -#include "debugger.h" #define LOG_RIM (1 << 1U) //#define VERBOSE (LOG_RIM) diff -Nru mame-0.242+dfsg.1/src/devices/cpu/tx0/tx0dasm.cpp mame-0.243+dfsg.1/src/devices/cpu/tx0/tx0dasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/tx0/tx0dasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/tx0/tx0dasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -118,6 +118,8 @@ { // Addressable instructions (only 3 in this version) util::stream_format(stream, "%s %06o", s_addressable_insts[(inst & 0600000) >> 13], inst & 0177777); + if (inst >= 0400000) // trn + return 1 | STEP_COND | SUPPORTED; } else dasm_opr(stream, inst); @@ -301,6 +303,8 @@ util::stream_format(stream, "%06o", inst); else util::stream_format(stream, "%s %05o", s_addressable_insts[(inst & 0700000) >> 13], inst & 017777); + if ((inst & 0700000) == 0400000) // trn + return 1 | STEP_COND | SUPPORTED; } else switch (inst) { @@ -346,10 +350,15 @@ { util::stream_format(stream, "%s %05o", str, inst & 017777); - if ((inst & 0760000) == 0440000) // tsx - return 1 | STEP_OVER | SUPPORTED; - else if ((inst & 0760000) == 0520000) // trx - return 1 | STEP_OUT | SUPPORTED; + if (inst >= 0400000) + { + if ((inst & 0760000) == 0440000) // tsx + return 1 | STEP_OVER | SUPPORTED; + else if ((inst & 0760000) == 0520000) // trx + return 1 | STEP_OUT | SUPPORTED; + else if ((inst & 0760000) != 0500000) // trn, tze, tix, tlv + return 1 | STEP_COND | SUPPORTED; + } } } else if ((inst & 037000) == 004000) diff -Nru mame-0.242+dfsg.1/src/devices/cpu/ucom4/ucom4.cpp mame-0.243+dfsg.1/src/devices/cpu/ucom4/ucom4.cpp --- mame-0.242+dfsg.1/src/devices/cpu/ucom4/ucom4.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/ucom4/ucom4.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -23,7 +23,6 @@ #include "emu.h" #include "ucom4.h" #include "ucom4d.h" -#include "debugger.h" // uCOM-43 products: 2000x8 ROM, 96x4 RAM, supports full instruction set diff -Nru mame-0.242+dfsg.1/src/devices/cpu/ucom4/ucom4d.cpp mame-0.243+dfsg.1/src/devices/cpu/ucom4/ucom4d.cpp --- mame-0.242+dfsg.1/src/devices/cpu/ucom4/ucom4d.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/ucom4/ucom4d.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -40,13 +40,13 @@ { 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, STEP_COND, STEP_COND, 0, STEP_COND, STEP_COND, STEP_COND, 0, STEP_COND, 0, 0, + 0, 0, 0, 0, 0, 0, STEP_COND, STEP_COND, STEP_COND, STEP_COND, STEP_COND, 0, 0, 0, 0, 0, 0, 0, 0, 0, STEP_OVER, STEP_OVER, STEP_OUT, STEP_OUT, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, + STEP_COND, STEP_COND, STEP_COND, STEP_COND, STEP_COND, STEP_COND, STEP_COND, STEP_COND, + STEP_COND, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + 0, 0, STEP_COND, STEP_COND, 0, STEP_COND, STEP_COND, 0, STEP_COND, 0, 0 }; diff -Nru mame-0.242+dfsg.1/src/devices/cpu/unsp/unsp.cpp mame-0.243+dfsg.1/src/devices/cpu/unsp/unsp.cpp --- mame-0.242+dfsg.1/src/devices/cpu/unsp/unsp.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/unsp/unsp.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -20,8 +20,6 @@ #include "unsp.h" #include "unspfe.h" -#include "debugger.h" - #include "unspdasm.h" #include diff -Nru mame-0.242+dfsg.1/src/devices/cpu/unsp/unsp_extended.cpp mame-0.243+dfsg.1/src/devices/cpu/unsp/unsp_extended.cpp --- mame-0.242+dfsg.1/src/devices/cpu/unsp/unsp_extended.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/unsp/unsp_extended.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -5,8 +5,6 @@ #include "unsp.h" #include "unspfe.h" -#include "debugger.h" - #include "unspdasm.h" // TODO: the call conventions and general use of 'do_basic_alu_ops' from unsp_other.cpp could be cleaned up diff -Nru mame-0.242+dfsg.1/src/devices/cpu/unsp/unsp_exxx.cpp mame-0.243+dfsg.1/src/devices/cpu/unsp/unsp_exxx.cpp --- mame-0.242+dfsg.1/src/devices/cpu/unsp/unsp_exxx.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/unsp/unsp_exxx.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -5,8 +5,6 @@ #include "unsp.h" #include "unspfe.h" -#include "debugger.h" - #include "unspdasm.h" #define LOG_UNSP_MULS (1U << 1) diff -Nru mame-0.242+dfsg.1/src/devices/cpu/unsp/unsp_fxxx.cpp mame-0.243+dfsg.1/src/devices/cpu/unsp/unsp_fxxx.cpp --- mame-0.242+dfsg.1/src/devices/cpu/unsp/unsp_fxxx.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/unsp/unsp_fxxx.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -5,8 +5,6 @@ #include "unsp.h" #include "unspfe.h" -#include "debugger.h" - #include "unspdasm.h" #include diff -Nru mame-0.242+dfsg.1/src/devices/cpu/unsp/unsp_jumps.cpp mame-0.243+dfsg.1/src/devices/cpu/unsp/unsp_jumps.cpp --- mame-0.242+dfsg.1/src/devices/cpu/unsp/unsp_jumps.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/unsp/unsp_jumps.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -5,8 +5,6 @@ #include "unsp.h" #include "unspfe.h" -#include "debugger.h" - #include "unspdasm.h" void unsp_device::execute_jumps(const uint16_t op) diff -Nru mame-0.242+dfsg.1/src/devices/cpu/unsp/unsp_other.cpp mame-0.243+dfsg.1/src/devices/cpu/unsp/unsp_other.cpp --- mame-0.242+dfsg.1/src/devices/cpu/unsp/unsp_other.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/unsp/unsp_other.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -5,8 +5,6 @@ #include "unsp.h" #include "unspfe.h" -#include "debugger.h" - #include "unspdasm.h" void unsp_device::execute_remaining(const uint16_t op) diff -Nru mame-0.242+dfsg.1/src/devices/cpu/upd7725/dasm7725.cpp mame-0.243+dfsg.1/src/devices/cpu/upd7725/dasm7725.cpp --- mame-0.242+dfsg.1/src/devices/cpu/upd7725/dasm7725.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/upd7725/dasm7725.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -21,6 +21,7 @@ { uint32_t opcode = opcodes.r32(pc) >> 8; uint32_t type = (opcode >> 22); + offs_t flags = 0; // printf("dasm: PC %x opcode %08x\n", pc, opcode); @@ -145,6 +146,7 @@ if(type == 1) { stream << " | ret"; + flags = STEP_OUT; } } @@ -154,44 +156,44 @@ switch(brch) { case 0x000: stream << "jmpso "; break; - case 0x080: stream << "jnca "; break; - case 0x082: stream << "jca "; break; - case 0x084: stream << "jncb "; break; - case 0x086: stream << "jcb "; break; - case 0x088: stream << "jnza "; break; - case 0x08a: stream << "jza "; break; - case 0x08c: stream << "jnzb "; break; - case 0x08e: stream << "jzb "; break; - case 0x090: stream << "jnova0 "; break; - case 0x092: stream << "jova0 "; break; - case 0x094: stream << "jnovb0 "; break; - case 0x096: stream << "jovb0 "; break; - case 0x098: stream << "jnova1 "; break; - case 0x09a: stream << "jova1 "; break; - case 0x09c: stream << "jnovb1 "; break; - case 0x09e: stream << "jovb1 "; break; - case 0x0a0: stream << "jnsa0 "; break; - case 0x0a2: stream << "jsa0 "; break; - case 0x0a4: stream << "jnsb0 "; break; - case 0x0a6: stream << "jsb0 "; break; - case 0x0a8: stream << "jnsa1 "; break; - case 0x0aa: stream << "jsa1 "; break; - case 0x0ac: stream << "jnsb1 "; break; - case 0x0ae: stream << "jsb1 "; break; - case 0x0b0: stream << "jdpl0 "; break; - case 0x0b1: stream << "jdpln0 "; break; - case 0x0b2: stream << "jdplf "; break; - case 0x0b3: stream << "jdplnf "; break; - case 0x0b4: stream << "jnsiak "; break; - case 0x0b6: stream << "jsiak "; break; - case 0x0b8: stream << "jnsoak "; break; - case 0x0ba: stream << "jsoak "; break; - case 0x0bc: stream << "jnrqm "; break; - case 0x0be: stream << "jrqm "; break; + case 0x080: stream << "jnca "; flags = STEP_COND; break; + case 0x082: stream << "jca "; flags = STEP_COND; break; + case 0x084: stream << "jncb "; flags = STEP_COND; break; + case 0x086: stream << "jcb "; flags = STEP_COND; break; + case 0x088: stream << "jnza "; flags = STEP_COND; break; + case 0x08a: stream << "jza "; flags = STEP_COND; break; + case 0x08c: stream << "jnzb "; flags = STEP_COND; break; + case 0x08e: stream << "jzb "; flags = STEP_COND; break; + case 0x090: stream << "jnova0 "; flags = STEP_COND; break; + case 0x092: stream << "jova0 "; flags = STEP_COND; break; + case 0x094: stream << "jnovb0 "; flags = STEP_COND; break; + case 0x096: stream << "jovb0 "; flags = STEP_COND; break; + case 0x098: stream << "jnova1 "; flags = STEP_COND; break; + case 0x09a: stream << "jova1 "; flags = STEP_COND; break; + case 0x09c: stream << "jnovb1 "; flags = STEP_COND; break; + case 0x09e: stream << "jovb1 "; flags = STEP_COND; break; + case 0x0a0: stream << "jnsa0 "; flags = STEP_COND; break; + case 0x0a2: stream << "jsa0 "; flags = STEP_COND; break; + case 0x0a4: stream << "jnsb0 "; flags = STEP_COND; break; + case 0x0a6: stream << "jsb0 "; flags = STEP_COND; break; + case 0x0a8: stream << "jnsa1 "; flags = STEP_COND; break; + case 0x0aa: stream << "jsa1 "; flags = STEP_COND; break; + case 0x0ac: stream << "jnsb1 "; flags = STEP_COND; break; + case 0x0ae: stream << "jsb1 "; flags = STEP_COND; break; + case 0x0b0: stream << "jdpl0 "; flags = STEP_COND; break; + case 0x0b1: stream << "jdpln0 "; flags = STEP_COND; break; + case 0x0b2: stream << "jdplf "; flags = STEP_COND; break; + case 0x0b3: stream << "jdplnf "; flags = STEP_COND; break; + case 0x0b4: stream << "jnsiak "; flags = STEP_COND; break; + case 0x0b6: stream << "jsiak "; flags = STEP_COND; break; + case 0x0b8: stream << "jnsoak "; flags = STEP_COND; break; + case 0x0ba: stream << "jsoak "; flags = STEP_COND; break; + case 0x0bc: stream << "jnrqm "; flags = STEP_COND; break; + case 0x0be: stream << "jrqm "; flags = STEP_COND; break; case 0x100: stream << "ljmp "; break; case 0x101: stream << "hjmp "; break; - case 0x140: stream << "lcall "; break; - case 0x141: stream << "hcall "; break; + case 0x140: stream << "lcall "; flags = STEP_OVER; break; + case 0x141: stream << "hcall "; flags = STEP_OVER; break; default: stream << "?????? "; break; } @@ -225,5 +227,5 @@ } } - return 1 | SUPPORTED; + return 1 | flags | SUPPORTED; } diff -Nru mame-0.242+dfsg.1/src/devices/cpu/upd7725/upd7725.cpp mame-0.243+dfsg.1/src/devices/cpu/upd7725/upd7725.cpp --- mame-0.242+dfsg.1/src/devices/cpu/upd7725/upd7725.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/upd7725/upd7725.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -12,7 +12,6 @@ ****************************************************************************/ #include "emu.h" -#include "debugger.h" #include "upd7725.h" #include "dasm7725.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/upd7810/upd7810.cpp mame-0.243+dfsg.1/src/devices/cpu/upd7810/upd7810.cpp --- mame-0.242+dfsg.1/src/devices/cpu/upd7810/upd7810.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/upd7810/upd7810.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -375,8 +375,6 @@ #include "emu.h" #include "upd7810.h" -#include "debugger.h" - #include "upd7810_macros.h" #include "upd7810_dasm.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/upd78k/upd78k0d.cpp mame-0.243+dfsg.1/src/devices/cpu/upd78k/upd78k0d.cpp --- mame-0.242+dfsg.1/src/devices/cpu/upd78k/upd78k0d.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/upd78k/upd78k0d.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -48,7 +48,7 @@ util::stream_format(stream, ".%d,", (op2 & 0x70) >> 4); } format_jdisp8(stream, pc + 4, opcodes.r8(pc + 3)); - return 4 | SUPPORTED; + return 4 | STEP_COND | SUPPORTED; } else switch (op2 & 0x0f) { @@ -57,36 +57,36 @@ format_sfr(stream, opcodes.r8(pc + 2)); util::stream_format(stream, ".%d,", (op2 & 0x70) >> 4); format_jdisp8(stream, pc + 4, opcodes.r8(pc + 3)); - return 4 | SUPPORTED; + return 4 | STEP_COND | SUPPORTED; case 0x06: util::stream_format(stream, "%-8s", "BT"); format_sfr(stream, opcodes.r8(pc + 2)); util::stream_format(stream, ".%d,", (op2 & 0x70) >> 4); format_jdisp8(stream, pc + 4, opcodes.r8(pc + 3)); - return 4 | SUPPORTED; + return 4 | STEP_COND | SUPPORTED; case 0x07: util::stream_format(stream, "%-8s", "BF"); format_sfr(stream, opcodes.r8(pc + 2)); util::stream_format(stream, ".%d,", (op2 & 0x70) >> 4); format_jdisp8(stream, pc + 4, opcodes.r8(pc + 3)); - return 4 | SUPPORTED; + return 4 | STEP_COND | SUPPORTED; case 0x0d: util::stream_format(stream, "%-8sA.%d,", "BTCLR", (op2 & 0x70) >> 4); format_jdisp8(stream, pc + 3, opcodes.r8(pc + 2)); - return 3 | SUPPORTED; + return 3 | STEP_COND | SUPPORTED; case 0x0e: util::stream_format(stream, "%-8sA.%d,", "BT", (op2 & 0x70) >> 4); format_jdisp8(stream, pc + 3, opcodes.r8(pc + 2)); - return 3 | SUPPORTED; + return 3 | STEP_COND | SUPPORTED; case 0x0f: util::stream_format(stream, "%-8sA.%d,", "BF", (op2 & 0x70) >> 4); format_jdisp8(stream, pc + 3, opcodes.r8(pc + 2)); - return 3 | SUPPORTED; + return 3 | STEP_COND | SUPPORTED; default: return dasm_illegal2(stream, 0x31, op2); @@ -117,17 +117,17 @@ case 0x05: util::stream_format(stream, "%-8s[HL].%d,", "BTCLR", (op2 & 0x70) >> 4); format_jdisp8(stream, pc + 3, opcodes.r8(pc + 2)); - return 3 | SUPPORTED; + return 3 | STEP_COND | SUPPORTED; case 0x06: util::stream_format(stream, "%-8s[HL].%d,", "BT", (op2 & 0x70) >> 4); format_jdisp8(stream, pc + 3, opcodes.r8(pc + 2)); - return 3 | SUPPORTED; + return 3 | STEP_COND | SUPPORTED; case 0x07: util::stream_format(stream, "%-8s[HL].%d,", "BF", (op2 & 0x70) >> 4); format_jdisp8(stream, pc + 3, opcodes.r8(pc + 2)); - return 3 | SUPPORTED; + return 3 | STEP_COND | SUPPORTED; case 0x0a: case 0x0b: if (op2 < 0x90) @@ -305,7 +305,7 @@ format_saddr(stream, opcodes.r8(pc + 1)); stream << ","; format_jdisp8(stream, pc + 3, opcodes.r8(pc + 2)); - return 3 | SUPPORTED; + return 3 | STEP_COND | SUPPORTED; case 0x05: case 0x07: util::stream_format(stream, "%-8sA,[%s]", "XCH", s_rp_names[(op & 0x06) >> 1]); @@ -470,7 +470,7 @@ case 0x8a: case 0x8b: util::stream_format(stream, "%-8s%s,", "DBNZ", s_r_names[op & 0x07]); format_jdisp8(stream, pc + 2, opcodes.r8(pc + 1)); - return 2 | SUPPORTED; + return 2 | STEP_COND | SUPPORTED; case 0x8c: case 0x9c: case 0xac: case 0xbc: case 0xcc: case 0xdc: case 0xec: case 0xfc: { @@ -484,13 +484,13 @@ util::stream_format(stream, ".%d,", (op & 0x70) >> 4); } format_jdisp8(stream, pc + 3, opcodes.r8(pc + 2)); - return 3 | SUPPORTED; + return 3 | STEP_COND | SUPPORTED; } case 0x8d: case 0x9d: util::stream_format(stream, "%-8s", BIT(op, 4) ? "BNC" : "BC"); format_jdisp8(stream, pc + 2, opcodes.r8(pc + 1)); - return 2 | SUPPORTED; + return 2 | STEP_COND | SUPPORTED; case 0x8e: util::stream_format(stream, "%-8sA,", "MOV"); @@ -550,7 +550,7 @@ case 0xad: case 0xbd: util::stream_format(stream, "%-8s", BIT(op, 4) ? "BNZ" : "BZ"); format_jdisp8(stream, pc + 2, opcodes.r8(pc + 1)); - return 2 | SUPPORTED; + return 2 | STEP_COND | SUPPORTED; case 0xae: util::stream_format(stream, "%-8sA,", "MOV"); diff -Nru mame-0.242+dfsg.1/src/devices/cpu/upd78k/upd78k1d.cpp mame-0.243+dfsg.1/src/devices/cpu/upd78k/upd78k1d.cpp --- mame-0.242+dfsg.1/src/devices/cpu/upd78k/upd78k1d.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/upd78k/upd78k1d.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -123,7 +123,7 @@ else util::stream_format(stream, "%s,", s_psw_bits[op2 & 0x07]); format_jdisp8(stream, pc + 3, opcodes.r8(pc + 2)); - return 3 | SUPPORTED; + return 3 | STEP_COND | SUPPORTED; } else return dasm_illegal2(stream, op1, op2); @@ -211,7 +211,7 @@ format_saddr(stream, opcodes.r8(pc + 2)); util::stream_format(stream, ".%d,", op2 & 0x07); format_jdisp8(stream, pc + 4, opcodes.r8(pc + 3)); - return 4 | SUPPORTED; + return 4 | STEP_COND | SUPPORTED; } else return dasm_illegal2(stream, 0x08, op2); @@ -546,7 +546,7 @@ { util::stream_format(stream, "%-8s%s,", "DBNZ", s_r_names[op & 0x07]); format_jdisp8(stream, pc + 2, opcodes.r8(pc + 1)); - return 2 | SUPPORTED; + return 2 | STEP_COND | SUPPORTED; } else { @@ -577,10 +577,15 @@ format_saddr(stream, opcodes.r8(pc + 1)); stream << ","; if (BIT(op, 0)) + { format_jdisp8(stream, pc + 3, opcodes.r8(pc + 2)); + return 3 | STEP_COND | SUPPORTED; + } else + { format_imm8(stream, opcodes.r8(pc + 2)); - return 3 | SUPPORTED; + return 3 | SUPPORTED; + } } else return dasm_38(stream, op, pc, opcodes); @@ -641,7 +646,7 @@ format_saddr(stream, opcodes.r8(pc + 1)); util::stream_format(stream, ".%d,", op & 0x07); format_jdisp8(stream, pc + 3, opcodes.r8(pc + 2)); - return 3 | SUPPORTED; + return 3 | STEP_COND | SUPPORTED; case 0x78: return dasm_78(stream, op, pc, opcodes); @@ -653,7 +658,7 @@ { util::stream_format(stream, "%-8s", s_bcond[op & 0x03]); format_jdisp8(stream, pc + 2, opcodes.r8(pc + 1)); - return 2 | SUPPORTED; + return 2 | STEP_COND | SUPPORTED; } case 0x88: diff -Nru mame-0.242+dfsg.1/src/devices/cpu/upd78k/upd78k3d.cpp mame-0.243+dfsg.1/src/devices/cpu/upd78k/upd78k3d.cpp --- mame-0.242+dfsg.1/src/devices/cpu/upd78k/upd78k3d.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/upd78k/upd78k3d.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -235,7 +235,7 @@ else util::stream_format(stream, "%s,", m_psw_bits[op2 & 0x0f]); format_jdisp8(stream, pc + 3, opcodes.r8(pc + 2)); - return 3 | SUPPORTED; + return 3 | STEP_COND | SUPPORTED; } else return dasm_illegal2(stream, op1, op2); @@ -332,7 +332,7 @@ { util::stream_format(stream, "%-8s", s_bcond_07f8[op2 & 0x07]); format_jdisp8(stream, pc + 3, opcodes.r8(pc + 2)); - return 3 | SUPPORTED; + return 3 | STEP_COND | SUPPORTED; } else if ((op2 & 0xce) == 0xc8) { @@ -409,7 +409,7 @@ format_saddr(stream, opcodes.r8(pc + 2)); util::stream_format(stream, ".%d,", op2 & 0x07); format_jdisp8(stream, pc + 4, opcodes.r8(pc + 3)); - return 4 | SUPPORTED; + return 4 | STEP_COND | SUPPORTED; } else return dasm_illegal2(stream, 0x08, op2); @@ -937,7 +937,7 @@ { util::stream_format(stream, "%-8s%c,", "DBNZ", BIT(op, 0) ? 'B' : 'C'); format_jdisp8(stream, pc + 2, opcodes.r8(pc + 1)); - return 2 | SUPPORTED; + return 2 | STEP_COND | SUPPORTED; } else { @@ -960,10 +960,15 @@ format_saddr(stream, opcodes.r8(pc + 1)); stream << ","; if (BIT(op, 0)) + { format_jdisp8(stream, pc + 3, opcodes.r8(pc + 2)); + return 3 | STEP_COND | SUPPORTED; + } else + { format_imm8(stream, opcodes.r8(pc + 2)); - return 3 | SUPPORTED; + return 3 | SUPPORTED; + } } else return dasm_38(stream, op, pc, opcodes); @@ -1019,7 +1024,7 @@ format_saddr(stream, opcodes.r8(pc + 1)); util::stream_format(stream, ".%d,", op & 0x07); format_jdisp8(stream, pc + 3, opcodes.r8(pc + 2)); - return 3 | SUPPORTED; + return 3 | STEP_COND | SUPPORTED; case 0x78: return dasm_78(stream, op, pc, opcodes); @@ -1027,7 +1032,7 @@ case 0x80: util::stream_format(stream, "%-8s", s_bcond[op & 0x07]); format_jdisp8(stream, pc + 2, opcodes.r8(pc + 1)); - return 2 | SUPPORTED; + return 2 | STEP_COND | SUPPORTED; case 0x88: return dasm_88xx(stream, op, opcodes.r8(pc + 1)); diff -Nru mame-0.242+dfsg.1/src/devices/cpu/upd78k/upd78k4d.cpp mame-0.243+dfsg.1/src/devices/cpu/upd78k/upd78k4d.cpp --- mame-0.242+dfsg.1/src/devices/cpu/upd78k/upd78k4d.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/upd78k/upd78k4d.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -670,7 +670,7 @@ util::stream_format(stream, "%-8s", BIT(op2, 4) ? "BT" : "BF"); util::stream_format(stream, "[%s].%d", s_rg_names[BIT(op2, 3) ? 3 : 2], op2 & 0x07); format_jdisp8(stream, pc + 3, opcodes.r8(pc + 2)); - return 3 | SUPPORTED; + return 3 | STEP_COND | SUPPORTED; } else return dasm_illegal2(stream, 0x3d, op2); @@ -783,7 +783,7 @@ format_saddr1(stream, opcodes.r8(pc + 3)); util::stream_format(stream, ".%d,", op3 & 0x07); format_jdisp8(stream, pc + 5, opcodes.r8(pc + 4)); - return 5 | SUPPORTED; + return 5 | STEP_COND | SUPPORTED; } else return dasm_illegal3(stream, 0x3c, 0x08, op3); diff -Nru mame-0.242+dfsg.1/src/devices/cpu/v30mz/v30mz.cpp mame-0.243+dfsg.1/src/devices/cpu/v30mz/v30mz.cpp --- mame-0.242+dfsg.1/src/devices/cpu/v30mz/v30mz.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/v30mz/v30mz.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -22,7 +22,6 @@ #include "emu.h" #include "v30mz.h" #include "cpu/nec/necdasm.h" -#include "debugger.h" enum SREGS { DS1=0, PS, SS, DS0 }; diff -Nru mame-0.242+dfsg.1/src/devices/cpu/v60/v60.cpp mame-0.243+dfsg.1/src/devices/cpu/v60/v60.cpp --- mame-0.242+dfsg.1/src/devices/cpu/v60/v60.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/v60/v60.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -76,7 +76,6 @@ #include "emu.h" #include "v60.h" #include "v60d.h" -#include "debugger.h" DEFINE_DEVICE_TYPE(V60, v60_device, "v60", "NEC V60") DEFINE_DEVICE_TYPE(V70, v70_device, "v70", "NEC V70") diff -Nru mame-0.242+dfsg.1/src/devices/cpu/v60/v60d.cpp mame-0.243+dfsg.1/src/devices/cpu/v60/v60d.cpp --- mame-0.242+dfsg.1/src/devices/cpu/v60/v60d.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/v60/v60d.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -640,38 +640,38 @@ DEFINE_EASY_OPCODE(ANDBSD, "andbsd", F7b, 0x80, 0x80) DEFINE_EASY_OPCODE(ANDNBSU, "andnbsu", F7b, 0x80, 0x80) DEFINE_EASY_OPCODE(ANDNBSD, "andnbsd", F7b, 0x80, 0x80) -DEFINE_EASY_OPCODE(BGT8, "bgt", F4a, 0, 0) -DEFINE_EASY_OPCODE(BGT16, "bgt", F4b, 0, 0) -DEFINE_EASY_OPCODE(BGE8, "bge", F4a, 0, 0) -DEFINE_EASY_OPCODE(BGE16, "bge", F4b, 0, 0) -DEFINE_EASY_OPCODE(BLT8, "blt", F4a, 0, 0) -DEFINE_EASY_OPCODE(BLT16, "blt", F4b, 0, 0) -DEFINE_EASY_OPCODE(BLE8, "ble", F4a, 0, 0) -DEFINE_EASY_OPCODE(BLE16, "ble", F4b, 0, 0) -DEFINE_EASY_OPCODE(BH8, "bh", F4a, 0, 0) -DEFINE_EASY_OPCODE(BH16, "bh", F4b, 0, 0) -DEFINE_EASY_OPCODE(BNL8, "bnl", F4a, 0, 0) -DEFINE_EASY_OPCODE(BNL16, "bnl", F4b, 0, 0) -DEFINE_EASY_OPCODE(BL8, "bl", F4a, 0, 0) -DEFINE_EASY_OPCODE(BL16, "bl", F4b, 0, 0) -DEFINE_EASY_OPCODE(BNH8, "bnh", F4a, 0, 0) -DEFINE_EASY_OPCODE(BNH16, "bnh", F4b, 0, 0) -DEFINE_EASY_OPCODE(BE8, "be", F4a, 0, 0) -DEFINE_EASY_OPCODE(BE16, "be", F4b, 0, 0) -DEFINE_EASY_OPCODE(BNE8, "bne", F4a, 0, 0) -DEFINE_EASY_OPCODE(BNE16, "bne", F4b, 0, 0) -DEFINE_EASY_OPCODE(BV8, "bv", F4a, 0, 0) -DEFINE_EASY_OPCODE(BV16, "bv", F4b, 0, 0) -DEFINE_EASY_OPCODE(BNV8, "bnv", F4a, 0, 0) -DEFINE_EASY_OPCODE(BNV16, "bnv", F4b, 0, 0) -DEFINE_EASY_OPCODE(BN8, "bn", F4a, 0, 0) -DEFINE_EASY_OPCODE(BN16, "bn", F4b, 0, 0) -DEFINE_EASY_OPCODE(BP8, "bp", F4a, 0, 0) -DEFINE_EASY_OPCODE(BP16, "bp", F4b, 0, 0) +DEFINE_EASY_OPCODE_EX(BGT8, "bgt", F4a, 0, 0, STEP_COND) +DEFINE_EASY_OPCODE_EX(BGT16, "bgt", F4b, 0, 0, STEP_COND) +DEFINE_EASY_OPCODE_EX(BGE8, "bge", F4a, 0, 0, STEP_COND) +DEFINE_EASY_OPCODE_EX(BGE16, "bge", F4b, 0, 0, STEP_COND) +DEFINE_EASY_OPCODE_EX(BLT8, "blt", F4a, 0, 0, STEP_COND) +DEFINE_EASY_OPCODE_EX(BLT16, "blt", F4b, 0, 0, STEP_COND) +DEFINE_EASY_OPCODE_EX(BLE8, "ble", F4a, 0, 0, STEP_COND) +DEFINE_EASY_OPCODE_EX(BLE16, "ble", F4b, 0, 0, STEP_COND) +DEFINE_EASY_OPCODE_EX(BH8, "bh", F4a, 0, 0, STEP_COND) +DEFINE_EASY_OPCODE_EX(BH16, "bh", F4b, 0, 0, STEP_COND) +DEFINE_EASY_OPCODE_EX(BNL8, "bnl", F4a, 0, 0, STEP_COND) +DEFINE_EASY_OPCODE_EX(BNL16, "bnl", F4b, 0, 0, STEP_COND) +DEFINE_EASY_OPCODE_EX(BL8, "bl", F4a, 0, 0, STEP_COND) +DEFINE_EASY_OPCODE_EX(BL16, "bl", F4b, 0, 0, STEP_COND) +DEFINE_EASY_OPCODE_EX(BNH8, "bnh", F4a, 0, 0, STEP_COND) +DEFINE_EASY_OPCODE_EX(BNH16, "bnh", F4b, 0, 0, STEP_COND) +DEFINE_EASY_OPCODE_EX(BE8, "be", F4a, 0, 0, STEP_COND) +DEFINE_EASY_OPCODE_EX(BE16, "be", F4b, 0, 0, STEP_COND) +DEFINE_EASY_OPCODE_EX(BNE8, "bne", F4a, 0, 0, STEP_COND) +DEFINE_EASY_OPCODE_EX(BNE16, "bne", F4b, 0, 0, STEP_COND) +DEFINE_EASY_OPCODE_EX(BV8, "bv", F4a, 0, 0, STEP_COND) +DEFINE_EASY_OPCODE_EX(BV16, "bv", F4b, 0, 0, STEP_COND) +DEFINE_EASY_OPCODE_EX(BNV8, "bnv", F4a, 0, 0, STEP_COND) +DEFINE_EASY_OPCODE_EX(BNV16, "bnv", F4b, 0, 0, STEP_COND) +DEFINE_EASY_OPCODE_EX(BN8, "bn", F4a, 0, 0, STEP_COND) +DEFINE_EASY_OPCODE_EX(BN16, "bn", F4b, 0, 0, STEP_COND) +DEFINE_EASY_OPCODE_EX(BP8, "bp", F4a, 0, 0, STEP_COND) +DEFINE_EASY_OPCODE_EX(BP16, "bp", F4b, 0, 0, STEP_COND) DEFINE_EASY_OPCODE(BR8, "br", F4a, 0, 0) DEFINE_EASY_OPCODE(BR16, "br", F4b, 0, 0) -DEFINE_EASY_OPCODE(BRK, "brk", F5, 0, 0) -DEFINE_EASY_OPCODE(BRKV, "brkv", F5, 0, 0) +DEFINE_EASY_OPCODE_EX(BRK, "brk", F5, 0, 0, STEP_OVER) +DEFINE_EASY_OPCODE_EX(BRKV, "brkv", F5, 0, 0, STEP_OVER | STEP_COND) DEFINE_EASY_OPCODE_EX(BSR, "bsr", F4b, 0, 0, STEP_OVER) DEFINE_EASY_OPCODE_EX(CALL, "call", F1F2, 0, 2, STEP_OVER) DEFINE_EASY_OPCODE(CAXI, "caxi", F1, 2, 2) @@ -698,21 +698,21 @@ DEFINE_EASY_OPCODE(CVTLW, "cvt.lw", F2, 1, 2) DEFINE_EASY_OPCODE(CVTDPZ, "cvtd.pz", F7c, 0, 1) DEFINE_EASY_OPCODE(CVTDZP, "cvtd.zp", F7c, 1, 0) -DEFINE_EASY_OPCODE_EX(DBGT, "dbgt", F6, 0, 0, STEP_OVER) -DEFINE_EASY_OPCODE_EX(DBGE, "dbge", F6, 0, 0, STEP_OVER) -DEFINE_EASY_OPCODE_EX(DBLT, "dbgt", F6, 0, 0, STEP_OVER) -DEFINE_EASY_OPCODE_EX(DBLE, "dbge", F6, 0, 0, STEP_OVER) -DEFINE_EASY_OPCODE_EX(DBH, "dbh", F6, 0, 0, STEP_OVER) -DEFINE_EASY_OPCODE_EX(DBNL, "dbnl", F6, 0, 0, STEP_OVER) -DEFINE_EASY_OPCODE_EX(DBL, "dbl", F6, 0, 0, STEP_OVER) -DEFINE_EASY_OPCODE_EX(DBNH, "dbnh", F6, 0, 0, STEP_OVER) -DEFINE_EASY_OPCODE_EX(DBE, "dbe", F6, 0, 0, STEP_OVER) -DEFINE_EASY_OPCODE_EX(DBNE, "dbne", F6, 0, 0, STEP_OVER) -DEFINE_EASY_OPCODE_EX(DBV, "dbe", F6, 0, 0, STEP_OVER) -DEFINE_EASY_OPCODE_EX(DBNV, "dbne", F6, 0, 0, STEP_OVER) -DEFINE_EASY_OPCODE_EX(DBN, "dbn", F6, 0, 0, STEP_OVER) -DEFINE_EASY_OPCODE_EX(DBP, "dbp", F6, 0, 0, STEP_OVER) -DEFINE_EASY_OPCODE_EX(DBR, "dbr", F6, 0, 0, STEP_OVER) +DEFINE_EASY_OPCODE_EX(DBGT, "dbgt", F6, 0, 0, STEP_COND) +DEFINE_EASY_OPCODE_EX(DBGE, "dbge", F6, 0, 0, STEP_COND) +DEFINE_EASY_OPCODE_EX(DBLT, "dbgt", F6, 0, 0, STEP_COND) +DEFINE_EASY_OPCODE_EX(DBLE, "dbge", F6, 0, 0, STEP_COND) +DEFINE_EASY_OPCODE_EX(DBH, "dbh", F6, 0, 0, STEP_COND) +DEFINE_EASY_OPCODE_EX(DBNL, "dbnl", F6, 0, 0, STEP_COND) +DEFINE_EASY_OPCODE_EX(DBL, "dbl", F6, 0, 0, STEP_COND) +DEFINE_EASY_OPCODE_EX(DBNH, "dbnh", F6, 0, 0, STEP_COND) +DEFINE_EASY_OPCODE_EX(DBE, "dbe", F6, 0, 0, STEP_COND) +DEFINE_EASY_OPCODE_EX(DBNE, "dbne", F6, 0, 0, STEP_COND) +DEFINE_EASY_OPCODE_EX(DBV, "dbe", F6, 0, 0, STEP_COND) +DEFINE_EASY_OPCODE_EX(DBNV, "dbne", F6, 0, 0, STEP_COND) +DEFINE_EASY_OPCODE_EX(DBN, "dbn", F6, 0, 0, STEP_COND) +DEFINE_EASY_OPCODE_EX(DBP, "dbp", F6, 0, 0, STEP_COND) +DEFINE_EASY_OPCODE_EX(DBR, "dbr", F6, 0, 0, STEP_COND) DEFINE_TRIPLE_OPCODE(DEC, "dec", F3) DEFINE_EASY_OPCODE(DISPOSE, "dispose", F5, 0, 0) DEFINE_TRIPLE_OPCODE(DIV, "div", F1F2) @@ -825,7 +825,7 @@ DEFINE_EASY_OPCODE(SUBRDC, "subrdc", F7c, 0, 0) DEFINE_FPU_OPCODE(SUBF, "subf", F2) DEFINE_EASY_OPCODE(TASI, "tasi", F3, 0, 0) -DEFINE_EASY_OPCODE(TB, "tb", F6, 0, 0) +DEFINE_EASY_OPCODE_EX(TB, "tb", F6, 0, 0, STEP_COND) DEFINE_TRIPLE_OPCODE(TEST, "test", F3) DEFINE_EASY_OPCODE(TEST1, "test1", F1F2, 2, 2) DEFINE_EASY_OPCODE_EX(TRAP, "trap", F3, 0, 0, STEP_OVER) diff -Nru mame-0.242+dfsg.1/src/devices/cpu/v810/v810.cpp mame-0.243+dfsg.1/src/devices/cpu/v810/v810.cpp --- mame-0.242+dfsg.1/src/devices/cpu/v810/v810.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/v810/v810.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -30,7 +30,6 @@ #include "emu.h" #include "v810.h" #include "v810dasm.h" -#include "debugger.h" #define clkIF 3 #define clkMEM 3 diff -Nru mame-0.242+dfsg.1/src/devices/cpu/v810/v810dasm.cpp mame-0.243+dfsg.1/src/devices/cpu/v810/v810dasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/v810/v810dasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/v810/v810dasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -115,22 +115,22 @@ case 0x26: case 0x27: switch( (opc>>9) &0xf) { - case 0x0: util::stream_format(stream,"BV %X",pc+D9(opc)); break; - case 0x1: util::stream_format(stream,"BL %X",pc+D9(opc)); break; - case 0x2: util::stream_format(stream,"BE %X",pc+D9(opc)); break; - case 0x3: util::stream_format(stream,"BNH %X",pc+D9(opc)); break; - case 0x4: util::stream_format(stream,"BN %X",pc+D9(opc)); break; + case 0x0: util::stream_format(stream,"BV %X",pc+D9(opc)); flags = STEP_COND; break; + case 0x1: util::stream_format(stream,"BL %X",pc+D9(opc)); flags = STEP_COND; break; + case 0x2: util::stream_format(stream,"BE %X",pc+D9(opc)); flags = STEP_COND; break; + case 0x3: util::stream_format(stream,"BNH %X",pc+D9(opc)); flags = STEP_COND; break; + case 0x4: util::stream_format(stream,"BN %X",pc+D9(opc)); flags = STEP_COND; break; case 0x5: util::stream_format(stream,"BR %X",pc+D9(opc)); break; - case 0x6: util::stream_format(stream,"BLT %X",pc+D9(opc)); break; - case 0x7: util::stream_format(stream,"BLE %X",pc+D9(opc)); break; - case 0x8: util::stream_format(stream,"BNV %X",pc+D9(opc)); break; - case 0x9: util::stream_format(stream,"BNL %X",pc+D9(opc)); break; - case 0xa: util::stream_format(stream,"BNE %X",pc+D9(opc)); break; - case 0xb: util::stream_format(stream,"BH %X",pc+D9(opc)); break; - case 0xc: util::stream_format(stream,"BP %X",pc+D9(opc)); break; + case 0x6: util::stream_format(stream,"BLT %X",pc+D9(opc)); flags = STEP_COND; break; + case 0x7: util::stream_format(stream,"BLE %X",pc+D9(opc)); flags = STEP_COND; break; + case 0x8: util::stream_format(stream,"BNV %X",pc+D9(opc)); flags = STEP_COND; break; + case 0x9: util::stream_format(stream,"BNL %X",pc+D9(opc)); flags = STEP_COND; break; + case 0xa: util::stream_format(stream,"BNE %X",pc+D9(opc)); flags = STEP_COND; break; + case 0xb: util::stream_format(stream,"BH %X",pc+D9(opc)); flags = STEP_COND; break; + case 0xc: util::stream_format(stream,"BP %X",pc+D9(opc)); flags = STEP_COND; break; case 0xd: util::stream_format(stream,"NOP"); break; - case 0xe: util::stream_format(stream,"BGE %X",pc+D9(opc)); break; - case 0xf: util::stream_format(stream,"BGT %X",pc+D9(opc)); break; + case 0xe: util::stream_format(stream,"BGE %X",pc+D9(opc)); flags = STEP_COND; break; + case 0xf: util::stream_format(stream,"BGT %X",pc+D9(opc)); flags = STEP_COND; break; } size=2; break; diff -Nru mame-0.242+dfsg.1/src/devices/cpu/v850/v850dasm.cpp mame-0.243+dfsg.1/src/devices/cpu/v850/v850dasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/v850/v850dasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/v850/v850dasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -991,7 +991,7 @@ { s16 disp9 = s8((opcode & 0xf800) >> 8 | (opcode & 0x0070) >> 4) * 2; util::stream_format(stream, "%-8s0x%08X", s_bconds[BIT(opcode, 0, 4)], pc + disp9); - return 2 | SUPPORTED; + return 2 | (BIT(opcode, 0, 4) != 0b0101 ? STEP_COND : 0) | SUPPORTED; } case 0b1100: diff -Nru mame-0.242+dfsg.1/src/devices/cpu/vax/vaxdasm.cpp mame-0.243+dfsg.1/src/devices/cpu/vax/vaxdasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/vax/vaxdasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/vax/vaxdasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -355,20 +355,20 @@ { "BSBB"sv, { mode::bb, mode::none, mode::none, mode::none, mode::none, mode::none }, vax_disassembler::STEP_OUT }, { "BRB"sv, { mode::bb, mode::none, mode::none, mode::none, mode::none, mode::none }, 0 }, - { "BNEQ"sv, { mode::bb, mode::none, mode::none, mode::none, mode::none, mode::none }, 0 }, // or BNEQU - { "BEQL"sv, { mode::bb, mode::none, mode::none, mode::none, mode::none, mode::none }, 0 }, // or BEQLU - { "BGTR"sv, { mode::bb, mode::none, mode::none, mode::none, mode::none, mode::none }, 0 }, - { "BLEQ"sv, { mode::bb, mode::none, mode::none, mode::none, mode::none, mode::none }, 0 }, + { "BNEQ"sv, { mode::bb, mode::none, mode::none, mode::none, mode::none, mode::none }, vax_disassembler::STEP_COND }, // or BNEQU + { "BEQL"sv, { mode::bb, mode::none, mode::none, mode::none, mode::none, mode::none }, vax_disassembler::STEP_COND }, // or BEQLU + { "BGTR"sv, { mode::bb, mode::none, mode::none, mode::none, mode::none, mode::none }, vax_disassembler::STEP_COND }, + { "BLEQ"sv, { mode::bb, mode::none, mode::none, mode::none, mode::none, mode::none }, vax_disassembler::STEP_COND }, { "JSB"sv, { mode::ab, mode::none, mode::none, mode::none, mode::none, mode::none }, vax_disassembler::STEP_OVER }, { "JMP"sv, { mode::ab, mode::none, mode::none, mode::none, mode::none, mode::none }, 0 }, - { "BGEQ"sv, { mode::bb, mode::none, mode::none, mode::none, mode::none, mode::none }, 0 }, - { "BLSS"sv, { mode::bb, mode::none, mode::none, mode::none, mode::none, mode::none }, 0 }, - { "BGTRU"sv, { mode::bb, mode::none, mode::none, mode::none, mode::none, mode::none }, 0 }, - { "BLEQU"sv, { mode::bb, mode::none, mode::none, mode::none, mode::none, mode::none }, 0 }, - { "BVC"sv, { mode::bb, mode::none, mode::none, mode::none, mode::none, mode::none }, 0 }, - { "BVS"sv, { mode::bb, mode::none, mode::none, mode::none, mode::none, mode::none }, 0 }, - { "BCC"sv, { mode::bb, mode::none, mode::none, mode::none, mode::none, mode::none }, 0 }, // or BGEQU - { "BCS"sv, { mode::bb, mode::none, mode::none, mode::none, mode::none, mode::none }, 0 }, // or BLSSU + { "BGEQ"sv, { mode::bb, mode::none, mode::none, mode::none, mode::none, mode::none }, vax_disassembler::STEP_COND }, + { "BLSS"sv, { mode::bb, mode::none, mode::none, mode::none, mode::none, mode::none }, vax_disassembler::STEP_COND }, + { "BGTRU"sv, { mode::bb, mode::none, mode::none, mode::none, mode::none, mode::none }, vax_disassembler::STEP_COND }, + { "BLEQU"sv, { mode::bb, mode::none, mode::none, mode::none, mode::none, mode::none }, vax_disassembler::STEP_COND }, + { "BVC"sv, { mode::bb, mode::none, mode::none, mode::none, mode::none, mode::none }, vax_disassembler::STEP_COND }, + { "BVS"sv, { mode::bb, mode::none, mode::none, mode::none, mode::none, mode::none }, vax_disassembler::STEP_COND }, + { "BCC"sv, { mode::bb, mode::none, mode::none, mode::none, mode::none, mode::none }, vax_disassembler::STEP_COND }, // or BGEQU + { "BCS"sv, { mode::bb, mode::none, mode::none, mode::none, mode::none, mode::none }, vax_disassembler::STEP_COND }, // or BLSSU { "ADDP4"sv, { mode::rw, mode::ab, mode::rw, mode::ab, mode::none, mode::none }, 0 }, { "ADDP6"sv, { mode::rw, mode::ab, mode::rw, mode::ab, mode::rw, mode::ab }, 0 }, @@ -400,7 +400,7 @@ { "LOCC"sv, { mode::rb, mode::rw, mode::ab, mode::none, mode::none, mode::none }, 0 }, { "SKPC"sv, { mode::rb, mode::rw, mode::ab, mode::none, mode::none, mode::none }, 0 }, { "MOVZWL"sv, { mode::rw, mode::wl, mode::none, mode::none, mode::none, mode::none }, 0 }, - { "ACBW"sv, { mode::srw, mode::srw, mode::mw, mode::bw, mode::none, mode::none }, 0 }, + { "ACBW"sv, { mode::srw, mode::srw, mode::mw, mode::bw, mode::none, mode::none }, vax_disassembler::STEP_COND }, { "MOVAW"sv, { mode::aw, mode::wl, mode::none, mode::none, mode::none, mode::none }, 0 }, { "PUSHAW"sv, { mode::aw, mode::none, mode::none, mode::none, mode::none, mode::none }, 0 }, @@ -419,7 +419,7 @@ { "CVTBF"sv, { mode::srb, mode::wl, mode::none, mode::none, mode::none, mode::none }, 0 }, { "CVTWF"sv, { mode::srw, mode::wl, mode::none, mode::none, mode::none, mode::none }, 0 }, { "CVTLF"sv, { mode::srl, mode::wl, mode::none, mode::none, mode::none, mode::none }, 0 }, - { "ACBF"sv, { mode::rl, mode::rl, mode::ml, mode::bw, mode::none, mode::none }, 0 }, + { "ACBF"sv, { mode::rl, mode::rl, mode::ml, mode::bw, mode::none, mode::none }, vax_disassembler::STEP_COND }, { "MOVF"sv, { mode::rl, mode::wl, mode::none, mode::none, mode::none, mode::none }, 0 }, { "CMPF"sv, { mode::rl, mode::rl, mode::none, mode::none, mode::none, mode::none }, 0 }, @@ -453,7 +453,7 @@ { "CVTBD"sv, { mode::srb, mode::wq, mode::none, mode::none, mode::none, mode::none }, 0 }, { "CVTWD"sv, { mode::srw, mode::wq, mode::none, mode::none, mode::none, mode::none }, 0 }, { "CVTLD"sv, { mode::srl, mode::wq, mode::none, mode::none, mode::none, mode::none }, 0 }, - { "ACBD"sv, { mode::rq, mode::rq, mode::mq, mode::bw, mode::none, mode::none }, 0 }, + { "ACBD"sv, { mode::rq, mode::rq, mode::mq, mode::bw, mode::none, mode::none }, vax_disassembler::STEP_COND }, { "MOVD"sv, { mode::rq, mode::wq, mode::none, mode::none, mode::none, mode::none }, 0 }, { "CMPD"sv, { mode::rq, mode::rq, mode::none, mode::none, mode::none, mode::none }, 0 }, @@ -502,7 +502,7 @@ { "MOVZBL"sv, { mode::rb, mode::wl, mode::none, mode::none, mode::none, mode::none }, 0 }, { "MOVZBW"sv, { mode::rb, mode::ww, mode::none, mode::none, mode::none, mode::none }, 0 }, { "ROTL"sv, { mode::cntb, mode::rl, mode::wl, mode::none, mode::none, mode::none }, 0 }, - { "ACBB"sv, { mode::srb, mode::srb, mode::mb, mode::bw, mode::none, mode::none }, 0 }, + { "ACBB"sv, { mode::srb, mode::srb, mode::mb, mode::bw, mode::none, mode::none }, vax_disassembler::STEP_COND }, { "MOVAB"sv, { mode::ab, mode::wl, mode::none, mode::none, mode::none, mode::none }, 0 }, { "PUSHAB"sv, { mode::ab, mode::none, mode::none, mode::none, mode::none, mode::none }, 0 }, @@ -574,16 +574,16 @@ { "MOVAL"sv, { mode::al, mode::wl, mode::none, mode::none, mode::none, mode::none }, 0 }, // or MOVAF { "PUSHAL"sv, { mode::al, mode::none, mode::none, mode::none, mode::none, mode::none }, 0 }, // or PUSHAF - { "BBS"sv, { mode::posl, mode::vb, mode::bb, mode::none, mode::none, mode::none }, 0 }, - { "BBC"sv, { mode::posl, mode::vb, mode::bb, mode::none, mode::none, mode::none }, 0 }, - { "BBSS"sv, { mode::posl, mode::vb, mode::bb, mode::none, mode::none, mode::none }, 0 }, - { "BBCS"sv, { mode::posl, mode::vb, mode::bb, mode::none, mode::none, mode::none }, 0 }, - { "BBSC"sv, { mode::posl, mode::vb, mode::bb, mode::none, mode::none, mode::none }, 0 }, - { "BBCC"sv, { mode::posl, mode::vb, mode::bb, mode::none, mode::none, mode::none }, 0 }, - { "BBSSI"sv, { mode::posl, mode::vb, mode::bb, mode::none, mode::none, mode::none }, 0 }, - { "BBCCI"sv, { mode::posl, mode::vb, mode::bb, mode::none, mode::none, mode::none }, 0 }, - { "BLBS"sv, { mode::posl, mode::bb, mode::none, mode::none, mode::none, mode::none }, 0 }, - { "BLBC"sv, { mode::posl, mode::bb, mode::none, mode::none, mode::none, mode::none }, 0 }, + { "BBS"sv, { mode::posl, mode::vb, mode::bb, mode::none, mode::none, mode::none }, vax_disassembler::STEP_COND }, + { "BBC"sv, { mode::posl, mode::vb, mode::bb, mode::none, mode::none, mode::none }, vax_disassembler::STEP_COND }, + { "BBSS"sv, { mode::posl, mode::vb, mode::bb, mode::none, mode::none, mode::none }, vax_disassembler::STEP_COND }, + { "BBCS"sv, { mode::posl, mode::vb, mode::bb, mode::none, mode::none, mode::none }, vax_disassembler::STEP_COND }, + { "BBSC"sv, { mode::posl, mode::vb, mode::bb, mode::none, mode::none, mode::none }, vax_disassembler::STEP_COND }, + { "BBCC"sv, { mode::posl, mode::vb, mode::bb, mode::none, mode::none, mode::none }, vax_disassembler::STEP_COND }, + { "BBSSI"sv, { mode::posl, mode::vb, mode::bb, mode::none, mode::none, mode::none }, vax_disassembler::STEP_COND }, + { "BBCCI"sv, { mode::posl, mode::vb, mode::bb, mode::none, mode::none, mode::none }, vax_disassembler::STEP_COND }, + { "BLBS"sv, { mode::posl, mode::bb, mode::none, mode::none, mode::none, mode::none }, vax_disassembler::STEP_COND }, + { "BLBC"sv, { mode::posl, mode::bb, mode::none, mode::none, mode::none, mode::none }, vax_disassembler::STEP_COND }, { "FFS"sv, { mode::posl, mode::cntb, mode::vb, mode::wl, mode::none, mode::none }, 0 }, { "FFC"sv, { mode::posl, mode::cntb, mode::vb, mode::wl, mode::none, mode::none }, 0 }, { "CMPV"sv, { mode::posl, mode::cntb, mode::vb, mode::rl, mode::none, mode::none }, 0 }, @@ -592,11 +592,11 @@ { "EXTZV"sv, { mode::posl, mode::cntb, mode::vb, mode::wl, mode::none, mode::none }, 0 }, { "INSV"sv, { mode::rl, mode::posl, mode::cntb, mode::vb, mode::none, mode::none }, 0 }, - { "ACBL"sv, { mode::srl, mode::srl, mode::ml, mode::bw, mode::none, mode::none }, 0 }, - { "AOBLSS"sv, { mode::srl, mode::ml, mode::bb, mode::none, mode::none, mode::none }, 0 }, - { "AOBLEQ"sv, { mode::srl, mode::ml, mode::bb, mode::none, mode::none, mode::none }, 0 }, - { "SOBGEQ"sv, { mode::ml, mode::bb, mode::none, mode::none, mode::none, mode::none }, 0 }, - { "SOBGTR"sv, { mode::ml, mode::bb, mode::none, mode::none, mode::none, mode::none }, 0 }, + { "ACBL"sv, { mode::srl, mode::srl, mode::ml, mode::bw, mode::none, mode::none }, vax_disassembler::STEP_COND }, + { "AOBLSS"sv, { mode::srl, mode::ml, mode::bb, mode::none, mode::none, mode::none }, vax_disassembler::STEP_COND }, + { "AOBLEQ"sv, { mode::srl, mode::ml, mode::bb, mode::none, mode::none, mode::none }, vax_disassembler::STEP_COND }, + { "SOBGEQ"sv, { mode::ml, mode::bb, mode::none, mode::none, mode::none, mode::none }, vax_disassembler::STEP_COND }, + { "SOBGTR"sv, { mode::ml, mode::bb, mode::none, mode::none, mode::none, mode::none }, vax_disassembler::STEP_COND }, { "CVTLB"sv, { mode::srl, mode::wb, mode::none, mode::none, mode::none, mode::none }, 0 }, { "CVTLW"sv, { mode::srl, mode::ww, mode::none, mode::none, mode::none, mode::none }, 0 }, { "ASHP"sv, { mode::cntb, mode::rw, mode::ab, mode::rb, mode::rw, mode::ab }, 0 }, @@ -639,7 +639,7 @@ { "CVTBG"sv, { mode::srb, mode::wq, mode::none, mode::none, mode::none, mode::none }, 0 }, { "CVTWG"sv, { mode::srw, mode::wq, mode::none, mode::none, mode::none, mode::none }, 0 }, { "CVTLG"sv, { mode::srl, mode::wq, mode::none, mode::none, mode::none, mode::none }, 0 }, - { "ACBG"sv, { mode::rq, mode::rq, mode::mq, mode::bw, mode::none, mode::none }, 0 }, + { "ACBG"sv, { mode::rq, mode::rq, mode::mq, mode::bw, mode::none, mode::none }, vax_disassembler::STEP_COND }, { "MOVG"sv, { mode::rq, mode::wq, mode::none, mode::none, mode::none, mode::none }, 0 }, { "CMPG"sv, { mode::rq, mode::rq, mode::none, mode::none, mode::none, mode::none }, 0 }, @@ -673,7 +673,7 @@ { "CVTBH"sv, { mode::srb, mode::wo, mode::none, mode::none, mode::none, mode::none }, 0 }, { "CVTWH"sv, { mode::srw, mode::wo, mode::none, mode::none, mode::none, mode::none }, 0 }, { "CVTLH"sv, { mode::srl, mode::wo, mode::none, mode::none, mode::none, mode::none }, 0 }, - { "ACBH"sv, { mode::ro, mode::ro, mode::mq, mode::bw, mode::none, mode::none }, 0 }, + { "ACBH"sv, { mode::ro, mode::ro, mode::mq, mode::bw, mode::none, mode::none }, vax_disassembler::STEP_COND }, { "MOVH"sv, { mode::ro, mode::wo, mode::none, mode::none, mode::none, mode::none }, 0 }, { "CMPH"sv, { mode::ro, mode::ro, mode::none, mode::none, mode::none, mode::none }, 0 }, diff -Nru mame-0.242+dfsg.1/src/devices/cpu/vt50/vt50dasm.cpp mame-0.243+dfsg.1/src/devices/cpu/vt50/vt50dasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/vt50/vt50dasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/vt50/vt50dasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -71,12 +71,12 @@ if (BIT(opcode, 7)) { util::stream_format(stream, "LD %03o", opcode & 0177); // execution varies by mode - return 1; + return 1 | SUPPORTED; } else if ((opcode & 0017) == 0) { stream << m_opcodes_w[(opcode & 0160) >> 4]; - return 1; + return 1 | SUPPORTED; } else { @@ -121,9 +121,9 @@ if ((opcode & 0164) == 0124) // IROM adjustment nextpc += 0400; util::stream_format(stream, " %04o", (nextpc & 01400) | opcodes.r8(pc + 1)); - return 2; + return 2 | ((opcode & 0170) != 0130 ? STEP_COND : 0) | SUPPORTED; } else - return 1; + return 1 | SUPPORTED; } } diff -Nru mame-0.242+dfsg.1/src/devices/cpu/vt61/vt61dasm.cpp mame-0.243+dfsg.1/src/devices/cpu/vt61/vt61dasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/vt61/vt61dasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/vt61/vt61dasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -90,13 +90,13 @@ { "T", "F" }, // TRUE H { "NVSR", "VSR" }, // VID SERV REQ L { "?H", "?L" }, - { "?H", "?L" }, - { "?H", "?L" }, - { "?H", "?L" }, - { "?H", "?L" }, - { "?H", "?L" }, - { "?H", "?L" }, - { "?H", "?L" } + { "?H", "?L" }, + { "?H", "?L" }, + { "?H", "?L" }, + { "?H", "?L" }, + { "?H", "?L" }, + { "?H", "?L" }, + { "?H", "?L" } }; u32 vt61_disassembler::opcode_alignment() const @@ -196,6 +196,8 @@ else if (BIT(inst, 14)) { util::stream_format(stream, "JMP %s,%03o", s_conditions[(inst & 017400) >> 8][BIT(inst, 13)], inst & 000377); + if ((inst & 017400) != 013000) + flags |= STEP_COND; } else if (BIT(inst, 13)) { diff -Nru mame-0.242+dfsg.1/src/devices/cpu/we32000/we32100d.cpp mame-0.243+dfsg.1/src/devices/cpu/we32000/we32100d.cpp --- mame-0.242+dfsg.1/src/devices/cpu/we32000/we32100d.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/we32000/we32100d.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -252,7 +252,7 @@ pc += 4; } format_signed(stream, disp); - util::stream_format(stream, "(%%%s) <%x>", s_rnames[15], u32(ppc + disp)); + util::stream_format(stream, "(%%%s) /*0x%x*/", s_rnames[15], u32(ppc + disp)); } else dasm_am(stream, pc, opcodes, n, false, true); @@ -284,7 +284,7 @@ pc += 2; } format_signed(stream, disp); - util::stream_format(stream, " <%x>", u32(ppc + disp)); + util::stream_format(stream, " /*0x%x*/", u32(ppc + disp)); } offs_t we32100_disassembler::dasm_30xx(std::ostream &stream, offs_t &pc, const we32100_disassembler::data_buffer &opcodes) @@ -557,6 +557,7 @@ util::stream_format(stream, "%-8s", BIT(op, 0) ? "BGEB" : "BGEH"); dasm_bdisp(stream, pc, opcodes, BIT(op, 0)); } + flags |= STEP_COND; break; case 0x44: case 0x54: @@ -575,6 +576,7 @@ util::stream_format(stream, "%-8s", BIT(op, 0) ? "BGB" : "BGH"); dasm_bdisp(stream, pc, opcodes, BIT(op, 0)); } + flags |= STEP_COND; break; case 0x48: @@ -588,6 +590,7 @@ util::stream_format(stream, "%-8s", BIT(op, 0) ? "BLB" : "BLH"); dasm_bdisp(stream, pc, opcodes, BIT(op, 0)); } + flags |= STEP_COND; break; case 0x4c: case 0x5c: @@ -606,6 +609,7 @@ util::stream_format(stream, "%-8s", BIT(op, 0) ? "BLEB" : "BLEH"); dasm_bdisp(stream, pc, opcodes, BIT(op, 0)); } + flags |= STEP_COND; break; case 0x50: @@ -619,6 +623,7 @@ util::stream_format(stream, "%-8s", BIT(op, 0) ? "BCC" : "BCC"); dasm_bdisp(stream, pc, opcodes, BIT(op, 0)); } + flags |= STEP_COND; break; case 0x58: @@ -632,6 +637,7 @@ util::stream_format(stream, "%-8s", BIT(op, 0) ? "BCSB" : "BCSH"); dasm_bdisp(stream, pc, opcodes, BIT(op, 0)); } + flags |= STEP_COND; break; case 0x60: @@ -645,6 +651,7 @@ util::stream_format(stream, "%-8s", BIT(op, 0) ? "BVCB" : "BVCH"); dasm_bdisp(stream, pc, opcodes, BIT(op, 0)); } + flags |= STEP_COND; break; case 0x64: case 0x74: @@ -660,6 +667,7 @@ util::stream_format(stream, "%-8s", BIT(op, 0) ? "BNEB" : "BNEH"); dasm_bdisp(stream, pc, opcodes, BIT(op, 0)); } + flags |= STEP_COND; break; case 0x68: @@ -673,6 +681,7 @@ util::stream_format(stream, "%-8s", BIT(op, 0) ? "BVSB" : "BVSH"); dasm_bdisp(stream, pc, opcodes, BIT(op, 0)); } + flags |= STEP_COND; break; case 0x6c: case 0x7c: @@ -688,6 +697,7 @@ util::stream_format(stream, "%-8s", BIT(op, 0) ? "BEB" : "BEH"); dasm_bdisp(stream, pc, opcodes, BIT(op, 0)); } + flags |= STEP_COND; break; case 0x70: diff -Nru mame-0.242+dfsg.1/src/devices/cpu/xavix2/xavix2.cpp mame-0.243+dfsg.1/src/devices/cpu/xavix2/xavix2.cpp --- mame-0.242+dfsg.1/src/devices/cpu/xavix2/xavix2.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/xavix2/xavix2.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -4,7 +4,6 @@ #include "emu.h" #include "xavix2.h" #include "xavix2d.h" -#include "debugger.h" DEFINE_DEVICE_TYPE(XAVIX2, xavix2_device, "xavix2", "Xavix 2 CPU") diff -Nru mame-0.242+dfsg.1/src/devices/cpu/xavix2/xavix2d.cpp mame-0.243+dfsg.1/src/devices/cpu/xavix2/xavix2d.cpp --- mame-0.242+dfsg.1/src/devices/cpu/xavix2/xavix2d.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/xavix2/xavix2d.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -319,22 +319,22 @@ case 0xca: case 0xcb: util::stream_format(stream, "hreg[%s] = %s", val6u(), r1()); break; // cc-cf - case 0xd0: util::stream_format(stream, "bvs %s", rel8()); break; - case 0xd1: util::stream_format(stream, "bltu %s", rel8()); break; - case 0xd2: util::stream_format(stream, "beq %s", rel8()); break; - case 0xd3: util::stream_format(stream, "bleu %s", rel8()); break; - case 0xd4: util::stream_format(stream, "bmi %s", rel8()); break; - case 0xd5: util::stream_format(stream, "bra %s", rel8()); break; - case 0xd6: util::stream_format(stream, "blts %s", rel8()); break; - case 0xd7: util::stream_format(stream, "bles %s", rel8()); break; - case 0xd8: util::stream_format(stream, "bvc %s", rel8()); break; - case 0xd9: util::stream_format(stream, "bgeu %s", rel8()); break; - case 0xda: util::stream_format(stream, "bne %s", rel8()); break; - case 0xdb: util::stream_format(stream, "bgtu %s", rel8()); break; - case 0xdc: util::stream_format(stream, "bpl %s", rel8()); break; - case 0xdd: util::stream_format(stream, "bnv %s", rel8()); break; - case 0xde: util::stream_format(stream, "bges %s", rel8()); break; - case 0xdf: util::stream_format(stream, "bgts %s", rel8()); break; + case 0xd0: util::stream_format(stream, "bvs %s", rel8()); flags = STEP_COND; break; + case 0xd1: util::stream_format(stream, "bltu %s", rel8()); flags = STEP_COND; break; + case 0xd2: util::stream_format(stream, "beq %s", rel8()); flags = STEP_COND; break; + case 0xd3: util::stream_format(stream, "bleu %s", rel8()); flags = STEP_COND; break; + case 0xd4: util::stream_format(stream, "bmi %s", rel8()); flags = STEP_COND; break; + case 0xd5: util::stream_format(stream, "bra %s", rel8()); flags = STEP_COND; break; + case 0xd6: util::stream_format(stream, "blts %s", rel8()); flags = STEP_COND; break; + case 0xd7: util::stream_format(stream, "bles %s", rel8()); flags = STEP_COND; break; + case 0xd8: util::stream_format(stream, "bvc %s", rel8()); flags = STEP_COND; break; + case 0xd9: util::stream_format(stream, "bgeu %s", rel8()); flags = STEP_COND; break; + case 0xda: util::stream_format(stream, "bne %s", rel8()); flags = STEP_COND; break; + case 0xdb: util::stream_format(stream, "bgtu %s", rel8()); flags = STEP_COND; break; + case 0xdc: util::stream_format(stream, "bpl %s", rel8()); flags = STEP_COND; break; + case 0xdd: util::stream_format(stream, "bnv %s", rel8()); flags = STEP_COND; break; + case 0xde: util::stream_format(stream, "bges %s", rel8()); flags = STEP_COND; break; + case 0xdf: util::stream_format(stream, "bgts %s", rel8()); flags = STEP_COND; break; case 0xe0: util::stream_format(stream, "jmp lr"); flags = STEP_OUT; break; case 0xe1: util::stream_format(stream, "rti1"); flags = STEP_OUT; break; diff -Nru mame-0.242+dfsg.1/src/devices/cpu/z180/z180.cpp mame-0.243+dfsg.1/src/devices/cpu/z180/z180.cpp --- mame-0.242+dfsg.1/src/devices/cpu/z180/z180.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/z180/z180.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -57,7 +57,6 @@ #include "emu.h" #include "z180.h" #include "z180dasm.h" -#include "debugger.h" //#define VERBOSE 1 #include "logmacro.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/z180/z180dasm.cpp mame-0.243+dfsg.1/src/devices/cpu/z180/z180dasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/z180/z180dasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/z180/z180dasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -423,6 +423,7 @@ break; } + bool comma = false; if( d->arguments ) { util::stream_format(stream, "%-5s ", s_mnemonic[d->mnemonic]); @@ -474,6 +475,9 @@ case 'I': util::stream_format(stream, "%s", ixy); break; + case ',': + comma = true; + [[fallthrough]]; default: stream << *src; } @@ -485,12 +489,16 @@ util::stream_format(stream, "%s", s_mnemonic[d->mnemonic]); } - if (d->mnemonic == zCALL || d->mnemonic == zCPDR || d->mnemonic == zCPIR || d->mnemonic == zDJNZ || - d->mnemonic == zHLT || d->mnemonic == zINDR || d->mnemonic == zINIR || d->mnemonic == zLDDR || - d->mnemonic == zLDIR || d->mnemonic == zOTDR || d->mnemonic == zOTIR || d->mnemonic == zRST) + if (d->mnemonic == zCALL || d->mnemonic == zHLT || d->mnemonic == zRST) flags = STEP_OVER; else if (d->mnemonic == zRETN || d->mnemonic == zRET || d->mnemonic == zRETI) flags = STEP_OUT; + if (d->mnemonic == zCPDR || d->mnemonic == zCPIR || d->mnemonic == zDJNZ || d->mnemonic == zINDR || + d->mnemonic == zINIR || d->mnemonic == zLDDR || d->mnemonic == zLDIR || d->mnemonic == zOTDR || + d->mnemonic == zOTDMR || d->mnemonic == zOTIR || d->mnemonic == zOTIMR || + ((d->mnemonic == zCALL || d->mnemonic == zJP || d->mnemonic == zJR) && comma) || + (d->mnemonic == zRET && d->arguments)) + flags = STEP_COND; return (pos - pc) | flags | SUPPORTED; } diff -Nru mame-0.242+dfsg.1/src/devices/cpu/z8/z8.cpp mame-0.243+dfsg.1/src/devices/cpu/z8/z8.cpp --- mame-0.242+dfsg.1/src/devices/cpu/z8/z8.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/z8/z8.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -25,7 +25,6 @@ #include "emu.h" #include "z8.h" #include "z8dasm.h" -#include "debugger.h" #define LOG_TIMER (1 << 1U) #define LOG_RECEIVE (1 << 2U) diff -Nru mame-0.242+dfsg.1/src/devices/cpu/z8/z8dasm.cpp mame-0.243+dfsg.1/src/devices/cpu/z8/z8dasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/z8/z8dasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/z8/z8dasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -60,7 +60,7 @@ #define ARG(_formatting, _value) { if (argc) util::stream_format(stream, ", "); util::stream_format(stream, _formatting, _value); argc++; } #define arg_name(_value) ARG("%s", REGISTER_NAME[_value]) -#define arg_cc ARG("%s", CONDITION_CODE[OPH]) +#define arg_cc { ARG("%s", CONDITION_CODE[OPH]); if (OPH & 0x0e) step_cond; } #define arg_r(_value) ARG(r, _value) #define arg_Ir(_value) ARG(Ir, _value) #define arg_Irr(_value) ARG(Irr, _value & 0x0f) @@ -78,6 +78,7 @@ #define bytes(_count) pos += (_count - 1) #define step_over flags = STEP_OVER #define step_out flags = STEP_OUT +#define step_cond flags = STEP_COND /*************************************************************************** DISASSEMBLER @@ -117,7 +118,7 @@ case 0x07: mnemonic("ADD"); arg_IR(B0); arg_IM(B1); bytes(3); break; case 0x08: mnemonic("LD"); arg_r(OPH); arg_R(B0); bytes(2); break; case 0x09: mnemonic("LD"); arg_R(B0); arg_r(OPH); bytes(2); break; - case 0x0a: mnemonic("DJNZ"); arg_r(OPH); arg_RA; bytes(2); step_over; break; + case 0x0a: mnemonic("DJNZ"); arg_r(OPH); arg_RA; bytes(2); step_cond; break; case 0x0b: mnemonic("JR"); arg_cc; arg_RA; bytes(2); break; case 0x0c: mnemonic("LD"); arg_r(OPH); arg_IM(B0); bytes(2); break; case 0x0d: mnemonic("JP"); arg_cc; arg_DA; bytes(3); break; @@ -134,7 +135,7 @@ case 0x17: mnemonic("ADC"); arg_IR(B0); arg_IM(B1); bytes(3); break; case 0x18: mnemonic("LD"); arg_r(OPH); arg_R(B0); bytes(2); break; case 0x19: mnemonic("LD"); arg_R(B0); arg_r(OPH); bytes(2); break; - case 0x1a: mnemonic("DJNZ"); arg_r(OPH); arg_RA; bytes(2); step_over; break; + case 0x1a: mnemonic("DJNZ"); arg_r(OPH); arg_RA; bytes(2); step_cond; break; case 0x1b: mnemonic("JR"); arg_cc; arg_RA; bytes(2); break; case 0x1c: mnemonic("LD"); arg_r(OPH); arg_IM(B0); bytes(2); break; case 0x1d: mnemonic("JP"); arg_cc; arg_DA; bytes(3); break; @@ -151,7 +152,7 @@ case 0x27: mnemonic("SUB"); arg_IR(B0); arg_IM(B1); bytes(3); break; case 0x28: mnemonic("LD"); arg_r(OPH); arg_R(B0); bytes(2); break; case 0x29: mnemonic("LD"); arg_R(B0); arg_r(OPH); bytes(2); break; - case 0x2a: mnemonic("DJNZ"); arg_r(OPH); arg_RA; bytes(2); step_over; break; + case 0x2a: mnemonic("DJNZ"); arg_r(OPH); arg_RA; bytes(2); step_cond; break; case 0x2b: mnemonic("JR"); arg_cc; arg_RA; bytes(2); break; case 0x2c: mnemonic("LD"); arg_r(OPH); arg_IM(B0); bytes(2); break; case 0x2d: mnemonic("JP"); arg_cc; arg_DA; bytes(3); break; @@ -168,7 +169,7 @@ case 0x37: mnemonic("SBC"); arg_IR(B0); arg_IM(B1); bytes(3); break; case 0x38: mnemonic("LD"); arg_r(OPH); arg_R(B0); bytes(2); break; case 0x39: mnemonic("LD"); arg_R(B0); arg_r(OPH); bytes(2); break; - case 0x3a: mnemonic("DJNZ"); arg_r(OPH); arg_RA; bytes(2); step_over; break; + case 0x3a: mnemonic("DJNZ"); arg_r(OPH); arg_RA; bytes(2); step_cond; break; case 0x3b: mnemonic("JR"); arg_cc; arg_RA; bytes(2); break; case 0x3c: mnemonic("LD"); arg_r(OPH); arg_IM(B0); bytes(2); break; case 0x3d: mnemonic("JP"); arg_cc; arg_DA; bytes(3); break; @@ -185,7 +186,7 @@ case 0x47: mnemonic("OR"); arg_IR(B0); arg_IM(B1); bytes(3); break; case 0x48: mnemonic("LD"); arg_r(OPH); arg_R(B0); bytes(2); break; case 0x49: mnemonic("LD"); arg_R(B0); arg_r(OPH); bytes(2); break; - case 0x4a: mnemonic("DJNZ"); arg_r(OPH); arg_RA; bytes(2); step_over; break; + case 0x4a: mnemonic("DJNZ"); arg_r(OPH); arg_RA; bytes(2); step_cond; break; case 0x4b: mnemonic("JR"); arg_cc; arg_RA; bytes(2); break; case 0x4c: mnemonic("LD"); arg_r(OPH); arg_IM(B0); bytes(2); break; case 0x4d: mnemonic("JP"); arg_cc; arg_DA; bytes(3); break; @@ -202,7 +203,7 @@ case 0x57: mnemonic("AND"); arg_IR(B0); arg_IM(B1); bytes(3); break; case 0x58: mnemonic("LD"); arg_r(OPH); arg_R(B0); bytes(2); break; case 0x59: mnemonic("LD"); arg_R(B0); arg_r(OPH); bytes(2); break; - case 0x5a: mnemonic("DJNZ"); arg_r(OPH); arg_RA; bytes(2); step_over; break; + case 0x5a: mnemonic("DJNZ"); arg_r(OPH); arg_RA; bytes(2); step_cond; break; case 0x5b: mnemonic("JR"); arg_cc; arg_RA; bytes(2); break; case 0x5c: mnemonic("LD"); arg_r(OPH); arg_IM(B0); bytes(2); break; case 0x5d: mnemonic("JP"); arg_cc; arg_DA; bytes(3); break; @@ -219,7 +220,7 @@ case 0x67: mnemonic("TCM"); arg_IR(B0); arg_IM(B1); bytes(3); break; case 0x68: mnemonic("LD"); arg_r(OPH); arg_R(B0); bytes(2); break; case 0x69: mnemonic("LD"); arg_R(B0); arg_r(OPH); bytes(2); break; - case 0x6a: mnemonic("DJNZ"); arg_r(OPH); arg_RA; bytes(2); step_over; break; + case 0x6a: mnemonic("DJNZ"); arg_r(OPH); arg_RA; bytes(2); step_cond; break; case 0x6b: mnemonic("JR"); arg_cc; arg_RA; bytes(2); break; case 0x6c: mnemonic("LD"); arg_r(OPH); arg_IM(B0); bytes(2); break; case 0x6d: mnemonic("JP"); arg_cc; arg_DA; bytes(3); break; @@ -236,7 +237,7 @@ case 0x77: mnemonic("TM"); arg_IR(B0); arg_IM(B1); bytes(3); break; case 0x78: mnemonic("LD"); arg_r(OPH); arg_R(B0); bytes(2); break; case 0x79: mnemonic("LD"); arg_R(B0); arg_r(OPH); bytes(2); break; - case 0x7a: mnemonic("DJNZ"); arg_r(OPH); arg_RA; bytes(2); step_over; break; + case 0x7a: mnemonic("DJNZ"); arg_r(OPH); arg_RA; bytes(2); step_cond; break; case 0x7b: mnemonic("JR"); arg_cc; arg_RA; bytes(2); break; case 0x7c: mnemonic("LD"); arg_r(OPH); arg_IM(B0); bytes(2); break; case 0x7d: mnemonic("JP"); arg_cc; arg_DA; bytes(3); break; @@ -253,7 +254,7 @@ case 0x87: illegal; break; case 0x88: mnemonic("LD"); arg_r(OPH); arg_R(B0); bytes(2); break; case 0x89: mnemonic("LD"); arg_R(B0); arg_r(OPH); bytes(2); break; - case 0x8a: mnemonic("DJNZ"); arg_r(OPH); arg_RA; bytes(2); step_over; break; + case 0x8a: mnemonic("DJNZ"); arg_r(OPH); arg_RA; bytes(2); step_cond; break; case 0x8b: mnemonic("JR"); arg_RA; bytes(2); break; case 0x8c: mnemonic("LD"); arg_r(OPH); arg_IM(B0); bytes(2); break; case 0x8d: mnemonic("JP"); arg_DA; bytes(3); break; @@ -270,7 +271,7 @@ case 0x97: illegal; break; case 0x98: mnemonic("LD"); arg_r(OPH); arg_R(B0); bytes(2); break; case 0x99: mnemonic("LD"); arg_R(B0); arg_r(OPH); bytes(2); break; - case 0x9a: mnemonic("DJNZ"); arg_r(OPH); arg_RA; bytes(2); step_over; break; + case 0x9a: mnemonic("DJNZ"); arg_r(OPH); arg_RA; bytes(2); step_cond; break; case 0x9b: mnemonic("JR"); arg_cc; arg_RA; bytes(2); break; case 0x9c: mnemonic("LD"); arg_r(OPH); arg_IM(B0); bytes(2); break; case 0x9d: mnemonic("JP"); arg_cc; arg_DA; bytes(3); break; @@ -287,7 +288,7 @@ case 0xa7: mnemonic("CP"); arg_IR(B0); arg_IM(B1); bytes(3); break; case 0xa8: mnemonic("LD"); arg_r(OPH); arg_R(B0); bytes(2); break; case 0xa9: mnemonic("LD"); arg_R(B0); arg_r(OPH); bytes(2); break; - case 0xaa: mnemonic("DJNZ"); arg_r(OPH); arg_RA; bytes(2); step_over; break; + case 0xaa: mnemonic("DJNZ"); arg_r(OPH); arg_RA; bytes(2); step_cond; break; case 0xab: mnemonic("JR"); arg_cc; arg_RA; bytes(2); break; case 0xac: mnemonic("LD"); arg_r(OPH); arg_IM(B0); bytes(2); break; case 0xad: mnemonic("JP"); arg_cc; arg_DA; bytes(3); break; @@ -304,7 +305,7 @@ case 0xb7: mnemonic("XOR"); arg_IR(B0); arg_IM(B1); bytes(3); break; case 0xb8: mnemonic("LD"); arg_r(OPH); arg_R(B0); bytes(2); break; case 0xb9: mnemonic("LD"); arg_R(B0); arg_r(OPH); bytes(2); break; - case 0xba: mnemonic("DJNZ"); arg_r(OPH); arg_RA; bytes(2); step_over; break; + case 0xba: mnemonic("DJNZ"); arg_r(OPH); arg_RA; bytes(2); step_cond; break; case 0xbb: mnemonic("JR"); arg_cc; arg_RA; bytes(2); break; case 0xbc: mnemonic("LD"); arg_r(OPH); arg_IM(B0); bytes(2); break; case 0xbd: mnemonic("JP"); arg_cc; arg_DA; bytes(3); break; @@ -321,7 +322,7 @@ case 0xc7: mnemonic("LD"); arg_r(B0H); arg_X(B1, B0L); bytes(3); break; case 0xc8: mnemonic("LD"); arg_r(OPH); arg_R(B0); bytes(2); break; case 0xc9: mnemonic("LD"); arg_R(B0); arg_r(OPH); bytes(2); break; - case 0xca: mnemonic("DJNZ"); arg_r(OPH); arg_RA; bytes(2); step_over; break; + case 0xca: mnemonic("DJNZ"); arg_r(OPH); arg_RA; bytes(2); step_cond; break; case 0xcb: mnemonic("JR"); arg_cc; arg_RA; bytes(2); break; case 0xcc: mnemonic("LD"); arg_r(OPH); arg_IM(B0); bytes(2); break; case 0xcd: mnemonic("JP"); arg_cc; arg_DA; bytes(3); break; @@ -338,7 +339,7 @@ case 0xd7: mnemonic("LD"); arg_r(B0L); arg_X(B1, B0H); bytes(3); break; case 0xd8: mnemonic("LD"); arg_r(OPH); arg_R(B0); bytes(2); break; case 0xd9: mnemonic("LD"); arg_R(B0); arg_r(OPH); bytes(2); break; - case 0xda: mnemonic("DJNZ"); arg_r(OPH); arg_RA; bytes(2); step_over; break; + case 0xda: mnemonic("DJNZ"); arg_r(OPH); arg_RA; bytes(2); step_cond; break; case 0xdb: mnemonic("JR"); arg_cc; arg_RA; bytes(2); break; case 0xdc: mnemonic("LD"); arg_r(OPH); arg_IM(B0); bytes(2); break; case 0xdd: mnemonic("JP"); arg_cc; arg_DA; bytes(3); break; @@ -355,7 +356,7 @@ case 0xe7: mnemonic("LD"); arg_IR(B0); arg_IM(B1); bytes(3); break; case 0xe8: mnemonic("LD"); arg_r(OPH); arg_R(B0); bytes(2); break; case 0xe9: mnemonic("LD"); arg_R(B0); arg_r(OPH); bytes(2); break; - case 0xea: mnemonic("DJNZ"); arg_r(OPH); arg_RA; bytes(2); step_over; break; + case 0xea: mnemonic("DJNZ"); arg_r(OPH); arg_RA; bytes(2); step_cond; break; case 0xeb: mnemonic("JR"); arg_cc; arg_RA; bytes(2); break; case 0xec: mnemonic("LD"); arg_r(OPH); arg_IM(B0); bytes(2); break; case 0xed: mnemonic("JP"); arg_cc; arg_DA; bytes(3); break; @@ -372,7 +373,7 @@ case 0xf7: illegal; break; case 0xf8: mnemonic("LD"); arg_r(OPH); arg_R(B0); bytes(2); break; case 0xf9: mnemonic("LD"); arg_R(B0); arg_r(OPH); bytes(2); break; - case 0xfa: mnemonic("DJNZ"); arg_r(OPH); arg_RA; bytes(2); step_over; break; + case 0xfa: mnemonic("DJNZ"); arg_r(OPH); arg_RA; bytes(2); step_cond; break; case 0xfb: mnemonic("JR"); arg_cc; arg_RA; bytes(2); break; case 0xfc: mnemonic("LD"); arg_r(OPH); arg_IM(B0); bytes(2); break; case 0xfd: mnemonic("JP"); arg_cc; arg_DA; bytes(3); break; diff -Nru mame-0.242+dfsg.1/src/devices/cpu/z80/z80.cpp mame-0.243+dfsg.1/src/devices/cpu/z80/z80.cpp --- mame-0.242+dfsg.1/src/devices/cpu/z80/z80.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/z80/z80.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -109,7 +109,6 @@ *****************************************************************************/ #include "emu.h" -#include "debugger.h" #include "z80.h" #include "z80dasm.h" diff -Nru mame-0.242+dfsg.1/src/devices/cpu/z80/z80dasm.cpp mame-0.243+dfsg.1/src/devices/cpu/z80/z80dasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/z80/z80dasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/z80/z80dasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -8,7 +8,6 @@ *****************************************************************************/ #include "emu.h" -#include "debugger.h" #include "z80dasm.h" @@ -28,10 +27,10 @@ const u32 z80_disassembler::s_flags[] = { 0 ,0 ,0 ,0 ,STEP_OVER,0 ,0 ,0 , - STEP_OVER,0 ,STEP_OVER,0 ,0 ,0 ,0 ,0 , - STEP_OVER,0 ,0 ,0 ,STEP_OVER,0 ,0 ,0 , - 0 ,STEP_OVER,0 ,STEP_OVER,0 ,0 ,0 ,0 , - STEP_OVER,0 ,STEP_OVER,0 ,0 ,0 ,STEP_OVER,STEP_OVER, + STEP_COND,0 ,STEP_COND,0 ,0 ,0 ,0 ,0 , + STEP_COND,0 ,0 ,0 ,STEP_OVER,0 ,0 ,0 , + 0 ,STEP_COND,0 ,STEP_COND,0 ,0 ,0 ,0 , + STEP_COND,0 ,STEP_COND,0 ,0 ,0 ,STEP_COND,STEP_COND, 0 ,0 ,0 ,0 ,0 ,0 ,STEP_OUT ,STEP_OUT , STEP_OUT ,0 ,0 ,0 ,0 ,0 ,0 ,0 , 0 ,0 ,0 ,STEP_OVER,0 ,0 ,0 ,0 , @@ -460,6 +459,7 @@ break; } + uint32_t flags = s_flags[d->mnemonic]; if( d->arguments ) { util::stream_format(stream, "%-4s ", s_mnemonic[d->mnemonic]); @@ -474,6 +474,8 @@ case 'A': util::stream_format(stream, "$%04X", params.r16(pos) ); pos += 2; + if (src != d->arguments) + flags |= STEP_COND; break; case 'B': /* Byte op arg */ util::stream_format(stream, "$%02X", params.r8(pos++) ); @@ -484,6 +486,8 @@ break; case 'O': /* Offset relative to PC */ util::stream_format(stream, "$%04X", (pc + s8(params.r8(pos++)) + 2) & 0xffff); + if (src != d->arguments) + flags |= STEP_COND; break; case 'P': /* Port number */ util::stream_format(stream, "$%02X", params.r8(pos++) ); @@ -509,11 +513,13 @@ } src++; } + if (d->mnemonic == zRET) + flags |= STEP_COND; } else { util::stream_format(stream, "%s", s_mnemonic[d->mnemonic]); } - return (pos - pc) | s_flags[d->mnemonic] | SUPPORTED; + return (pos - pc) | flags | SUPPORTED; } diff -Nru mame-0.242+dfsg.1/src/devices/cpu/z8000/8000dasm.cpp mame-0.243+dfsg.1/src/devices/cpu/z8000/8000dasm.cpp --- mame-0.242+dfsg.1/src/devices/cpu/z8000/8000dasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/z8000/8000dasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -79,7 +79,7 @@ { 0x1c18, 0x1cf8, 16, 1, "testl @%rw2", 0 }, { 0x1c19, 0x1cf9, 16, 2, "ldm @%rw2,%rw5,#%n", 0 }, { 0x1d10, 0x1dff, 1, 1, "ldl @%rw2,%rl3", 0 }, - { 0x1e10, 0x1eff, 1, 1, "jp %c3,@%rl2", 0 }, + { 0x1e10, 0x1eff, 1, 1, "jp %c3,@%rl2", STEP_COND }, { 0x1f10, 0x1ff0, 16, 1, "call %rw2", STEP_OVER }, { 0x2000, 0x200f, 1, 2, "ldb %rb3,%#b3", 0 }, { 0x2010, 0x20ff, 1, 1, "ldb %rb3,@%rw2", 0 }, @@ -292,8 +292,8 @@ { 0x5c19, 0x5cf9, 16, 3, "ldm %a2(%rw2),%rw5,#%n", 0 }, { 0x5d00, 0x5d0f, 1, 2, "ldl %a1,%rl3", 0 }, { 0x5d10, 0x5dff, 1, 2, "ldl %a1(%rw2),%rl3", 0 }, - { 0x5e00, 0x5e0f, 1, 2, "jp %c3,%a1", 0 }, - { 0x5e10, 0x5eff, 1, 2, "jp %c3,%a1(%rw2)", 0 }, + { 0x5e00, 0x5e0f, 1, 2, "jp %c3,%a1", STEP_COND }, + { 0x5e10, 0x5eff, 1, 2, "jp %c3,%a1(%rw2)", STEP_COND }, { 0x5f00, 0x5f00, 1, 2, "call %a1", STEP_OVER }, { 0x5f10, 0x5ff0, 16, 2, "call %a1(%rw2)", STEP_OVER }, { 0x6000, 0x600f, 1, 2, "ldb %rb3,%a1", 0 }, @@ -410,7 +410,7 @@ { 0x9b00, 0x9bff, 1, 1, "div %rl3,%rw2", 0 }, { 0x9c00, 0x9cf8, 8, 1, "testl %rl2", 0 }, { 0x9d00, 0x9dff, 1, 1, "rsvd9d", 0 }, - { 0x9e00, 0x9e0f, 1, 1, "ret %c3", STEP_OUT }, + { 0x9e00, 0x9e0f, 1, 1, "ret %c3", STEP_OUT | STEP_COND }, { 0x9f00, 0x9fff, 1, 1, "rsvd9f", 0 }, { 0xa000, 0xa0ff, 1, 1, "ldb %rb3,%rb2", 0 }, { 0xa100, 0xa1ff, 1, 1, "ld %rw3,%rw2", 0 }, @@ -474,64 +474,64 @@ { 0xb81e, 0xb8fe, 16, 2, "trtdrb @%rw2,@%rw6,%rb5", 0 }, { 0xb900, 0xb9ff, 16, 1, "rsvdb9", 0 }, { 0xba10, 0xbaf0, 16, 2, "cpib %rb6,@%rw2,%rw5,%c7", 0 }, - { 0xba11, 0xbaf1, 16, 2, "ldirb @%rw6,@%rw2,%rw5", STEP_OVER }, + { 0xba11, 0xbaf1, 16, 2, "ldirb @%rw6,@%rw2,%rw5", STEP_COND }, { 0xba12, 0xbaf2, 16, 2, "cpsib @%rw6,@%rw2,%rw5,%c7", 0 }, - { 0xba14, 0xbaf4, 16, 2, "cpirb %rb6,@%rw2,%rw5,%c7", STEP_OVER }, - { 0xba16, 0xbaf6, 16, 2, "cpsirb @%rw6,@%rw2,%rw5,%c7", STEP_OVER }, + { 0xba14, 0xbaf4, 16, 2, "cpirb %rb6,@%rw2,%rw5,%c7", STEP_COND }, + { 0xba16, 0xbaf6, 16, 2, "cpsirb @%rw6,@%rw2,%rw5,%c7", STEP_COND }, { 0xba18, 0xbaf8, 16, 2, "cpdb %rb6,@%rw2,%rw5,%c7", 0 }, - { 0xba19, 0xbaf9, 16, 2, "lddrb @%rw2,@%rw6,%rw5", STEP_OVER }, + { 0xba19, 0xbaf9, 16, 2, "lddrb @%rw2,@%rw6,%rw5", STEP_COND }, { 0xba1a, 0xbafa, 16, 2, "cpsdb @%rw6,@%rw2,%rw5,%c7", 0 }, - { 0xba1c, 0xbafc, 16, 2, "cpdrb %rb6,@%rw2,%rw5,%c7", STEP_OVER }, - { 0xba1e, 0xbafe, 16, 2, "cpsdrb @%rw6,@%rw2,%rw5,%c7", STEP_OVER }, + { 0xba1c, 0xbafc, 16, 2, "cpdrb %rb6,@%rw2,%rw5,%c7", STEP_COND }, + { 0xba1e, 0xbafe, 16, 2, "cpsdrb @%rw6,@%rw2,%rw5,%c7", STEP_COND }, { 0xbb10, 0xbbf0, 16, 2, "cpi %rw6,@%rw2,%rw5,%c7", 0 }, - { 0xbb11, 0xbbf1, 16, 2, "ldir @%rw6,@%rw2,%rw5", STEP_OVER }, + { 0xbb11, 0xbbf1, 16, 2, "ldir @%rw6,@%rw2,%rw5", STEP_COND }, { 0xbb12, 0xbbf2, 16, 2, "cpsi @%rw6,@%rw2,%rw5,%c7", 0 }, - { 0xbb14, 0xbbf4, 16, 2, "cpir %rw6,@%rw2,%rw5,%c7", STEP_OVER }, - { 0xbb16, 0xbbf6, 16, 2, "cpsir @%rw6,@%rw2,%rw5,%c7", STEP_OVER }, + { 0xbb14, 0xbbf4, 16, 2, "cpir %rw6,@%rw2,%rw5,%c7", STEP_COND }, + { 0xbb16, 0xbbf6, 16, 2, "cpsir @%rw6,@%rw2,%rw5,%c7", STEP_COND }, { 0xbb18, 0xbbf8, 16, 2, "cpd %rw6,@%rw2,%rw5,%c7", 0 }, - { 0xbb19, 0xbbf9, 16, 2, "lddr @%rw2,@%rw6,%rw5", STEP_OVER }, + { 0xbb19, 0xbbf9, 16, 2, "lddr @%rw2,@%rw6,%rw5", STEP_COND }, { 0xbb1a, 0xbbfa, 16, 2, "cpsd @%rw6,@%rw2,%rw5,%c7", 0 }, - { 0xbb1c, 0xbbfc, 16, 2, "cpdr %rw6,@%rw2,%rw5,%c7", STEP_OVER }, - { 0xbb1e, 0xbbfe, 16, 2, "cpsdr @%rw6,@%rw2,%rw5,%c7", STEP_OVER }, + { 0xbb1c, 0xbbfc, 16, 2, "cpdr %rw6,@%rw2,%rw5,%c7", STEP_COND }, + { 0xbb1e, 0xbbfe, 16, 2, "cpsdr @%rw6,@%rw2,%rw5,%c7", STEP_COND }, { 0xbc00, 0xbcff, 1, 1, "rrdb %rb3,%rb2", 0 }, { 0xbd00, 0xbdff, 1, 1, "ldk %rw2,%3", 0 }, { 0xbe00, 0xbeff, 1, 1, "rldb %rb3,%rb2", 0 }, { 0xbf00, 0xbfff, 1, 1, "rsvdbf", 0 }, { 0xc000, 0xcfff, 1, 1, "ldb %rb1,%#b1", 0 }, { 0xd000, 0xdfff, 1, 1, "calr %d2", STEP_OVER }, - { 0xe000, 0xefff, 1, 1, "jr %c1,%d1", 0 }, - { 0xf000, 0xf07f, 1, 1, "dbjnz %rb1,%d0", STEP_OVER }, - { 0xf100, 0xf17f, 1, 1, "dbjnz %rb1,%d0", STEP_OVER }, - { 0xf200, 0xf27f, 1, 1, "dbjnz %rb1,%d0", STEP_OVER }, - { 0xf300, 0xf37f, 1, 1, "dbjnz %rb1,%d0", STEP_OVER }, - { 0xf400, 0xf47f, 1, 1, "dbjnz %rb1,%d0", STEP_OVER }, - { 0xf500, 0xf57f, 1, 1, "dbjnz %rb1,%d0", STEP_OVER }, - { 0xf600, 0xf67f, 1, 1, "dbjnz %rb1,%d0", STEP_OVER }, - { 0xf700, 0xf77f, 1, 1, "dbjnz %rb1,%d0", STEP_OVER }, - { 0xf800, 0xf87f, 1, 1, "dbjnz %rb1,%d0", STEP_OVER }, - { 0xf900, 0xf97f, 1, 1, "dbjnz %rb1,%d0", STEP_OVER }, - { 0xfa00, 0xfa7f, 1, 1, "dbjnz %rb1,%d0", STEP_OVER }, - { 0xfb00, 0xfb7f, 1, 1, "dbjnz %rb1,%d0", STEP_OVER }, - { 0xfc00, 0xfc7f, 1, 1, "dbjnz %rb1,%d0", STEP_OVER }, - { 0xfd00, 0xfd7f, 1, 1, "dbjnz %rb1,%d0", STEP_OVER }, - { 0xfe00, 0xfe7f, 1, 1, "dbjnz %rb1,%d0", STEP_OVER }, - { 0xff00, 0xff7f, 1, 1, "dbjnz %rb1,%d0", STEP_OVER }, - { 0xf080, 0xf0ff, 1, 1, "djnz %rw1,%d0", STEP_OVER }, - { 0xf180, 0xf1ff, 1, 1, "djnz %rw1,%d0", STEP_OVER }, - { 0xf280, 0xf2ff, 1, 1, "djnz %rw1,%d0", STEP_OVER }, - { 0xf380, 0xf3ff, 1, 1, "djnz %rw1,%d0", STEP_OVER }, - { 0xf480, 0xf4ff, 1, 1, "djnz %rw1,%d0", STEP_OVER }, - { 0xf580, 0xf5ff, 1, 1, "djnz %rw1,%d0", STEP_OVER }, - { 0xf680, 0xf6ff, 1, 1, "djnz %rw1,%d0", STEP_OVER }, - { 0xf780, 0xf7ff, 1, 1, "djnz %rw1,%d0", STEP_OVER }, - { 0xf880, 0xf8ff, 1, 1, "djnz %rw1,%d0", STEP_OVER }, - { 0xf980, 0xf9ff, 1, 1, "djnz %rw1,%d0", STEP_OVER }, - { 0xfa80, 0xfaff, 1, 1, "djnz %rw1,%d0", STEP_OVER }, - { 0xfb80, 0xfbff, 1, 1, "djnz %rw1,%d0", STEP_OVER }, - { 0xfc80, 0xfcff, 1, 1, "djnz %rw1,%d0", STEP_OVER }, - { 0xfd80, 0xfdff, 1, 1, "djnz %rw1,%d0", STEP_OVER }, - { 0xfe80, 0xfeff, 1, 1, "djnz %rw1,%d0", STEP_OVER }, - { 0xff80, 0xffff, 1, 1, "djnz %rw1,%d0", STEP_OVER }, + { 0xe000, 0xefff, 1, 1, "jr %c1,%d1", STEP_COND }, + { 0xf000, 0xf07f, 1, 1, "dbjnz %rb1,%d0", STEP_COND }, + { 0xf100, 0xf17f, 1, 1, "dbjnz %rb1,%d0", STEP_COND }, + { 0xf200, 0xf27f, 1, 1, "dbjnz %rb1,%d0", STEP_COND }, + { 0xf300, 0xf37f, 1, 1, "dbjnz %rb1,%d0", STEP_COND }, + { 0xf400, 0xf47f, 1, 1, "dbjnz %rb1,%d0", STEP_COND }, + { 0xf500, 0xf57f, 1, 1, "dbjnz %rb1,%d0", STEP_COND }, + { 0xf600, 0xf67f, 1, 1, "dbjnz %rb1,%d0", STEP_COND }, + { 0xf700, 0xf77f, 1, 1, "dbjnz %rb1,%d0", STEP_COND }, + { 0xf800, 0xf87f, 1, 1, "dbjnz %rb1,%d0", STEP_COND }, + { 0xf900, 0xf97f, 1, 1, "dbjnz %rb1,%d0", STEP_COND }, + { 0xfa00, 0xfa7f, 1, 1, "dbjnz %rb1,%d0", STEP_COND }, + { 0xfb00, 0xfb7f, 1, 1, "dbjnz %rb1,%d0", STEP_COND }, + { 0xfc00, 0xfc7f, 1, 1, "dbjnz %rb1,%d0", STEP_COND }, + { 0xfd00, 0xfd7f, 1, 1, "dbjnz %rb1,%d0", STEP_COND }, + { 0xfe00, 0xfe7f, 1, 1, "dbjnz %rb1,%d0", STEP_COND }, + { 0xff00, 0xff7f, 1, 1, "dbjnz %rb1,%d0", STEP_COND }, + { 0xf080, 0xf0ff, 1, 1, "djnz %rw1,%d0", STEP_COND }, + { 0xf180, 0xf1ff, 1, 1, "djnz %rw1,%d0", STEP_COND }, + { 0xf280, 0xf2ff, 1, 1, "djnz %rw1,%d0", STEP_COND }, + { 0xf380, 0xf3ff, 1, 1, "djnz %rw1,%d0", STEP_COND }, + { 0xf480, 0xf4ff, 1, 1, "djnz %rw1,%d0", STEP_COND }, + { 0xf580, 0xf5ff, 1, 1, "djnz %rw1,%d0", STEP_COND }, + { 0xf680, 0xf6ff, 1, 1, "djnz %rw1,%d0", STEP_COND }, + { 0xf780, 0xf7ff, 1, 1, "djnz %rw1,%d0", STEP_COND }, + { 0xf880, 0xf8ff, 1, 1, "djnz %rw1,%d0", STEP_COND }, + { 0xf980, 0xf9ff, 1, 1, "djnz %rw1,%d0", STEP_COND }, + { 0xfa80, 0xfaff, 1, 1, "djnz %rw1,%d0", STEP_COND }, + { 0xfb80, 0xfbff, 1, 1, "djnz %rw1,%d0", STEP_COND }, + { 0xfc80, 0xfcff, 1, 1, "djnz %rw1,%d0", STEP_COND }, + { 0xfd80, 0xfdff, 1, 1, "djnz %rw1,%d0", STEP_COND }, + { 0xfe80, 0xfeff, 1, 1, "djnz %rw1,%d0", STEP_COND }, + { 0xff80, 0xffff, 1, 1, "djnz %rw1,%d0", STEP_COND }, { 0, 0, 0, 0, nullptr, 0} }; @@ -667,14 +667,14 @@ tmp = ((n[1] & 0x01) << 8) + (n[3] << 4) + (n[7] & 0x08); switch (tmp) { - case 0x000: util::stream_format(stream, "inirb "); flags = STEP_OVER; break; + case 0x000: util::stream_format(stream, "inirb "); flags = STEP_COND; break; case 0x008: util::stream_format(stream, "inib "); break; - case 0x010: util::stream_format(stream, "sinirb"); flags = STEP_OVER; break; + case 0x010: util::stream_format(stream, "sinirb"); flags = STEP_COND; break; case 0x018: util::stream_format(stream, "sinib "); break; - case 0x020: util::stream_format(stream, "otirb "); flags = STEP_OVER; break; + case 0x020: util::stream_format(stream, "otirb "); flags = STEP_COND; break; case 0x028: util::stream_format(stream, "outib "); break; case 0x030: util::stream_format(stream, "soutib"); break; - case 0x038: util::stream_format(stream, "sotirb"); flags = STEP_OVER; break; + case 0x038: util::stream_format(stream, "sotirb"); flags = STEP_COND; break; case 0x040: util::stream_format(stream, "inb "); break; case 0x048: util::stream_format(stream, "inb "); break; case 0x050: util::stream_format(stream, "sinb "); break; @@ -683,22 +683,22 @@ case 0x068: util::stream_format(stream, "outb "); break; case 0x070: util::stream_format(stream, "soutb "); break; case 0x078: util::stream_format(stream, "soutb "); break; - case 0x080: util::stream_format(stream, "indrb "); flags = STEP_OVER; break; + case 0x080: util::stream_format(stream, "indrb "); flags = STEP_COND; break; case 0x088: util::stream_format(stream, "indb "); break; - case 0x090: util::stream_format(stream, "sindrb"); flags = STEP_OVER; break; + case 0x090: util::stream_format(stream, "sindrb"); flags = STEP_COND; break; case 0x098: util::stream_format(stream, "sindb "); break; - case 0x0a0: util::stream_format(stream, "otdrb "); flags = STEP_OVER; break; + case 0x0a0: util::stream_format(stream, "otdrb "); flags = STEP_COND; break; case 0x0a8: util::stream_format(stream, "outdb "); break; case 0x0b0: util::stream_format(stream, "soutdb"); break; - case 0x0b8: util::stream_format(stream, "sotdrb"); flags = STEP_OVER; break; - case 0x100: util::stream_format(stream, "inir "); flags = STEP_OVER; break; + case 0x0b8: util::stream_format(stream, "sotdrb"); flags = STEP_COND; break; + case 0x100: util::stream_format(stream, "inir "); flags = STEP_COND; break; case 0x108: util::stream_format(stream, "ini "); break; - case 0x110: util::stream_format(stream, "sinir "); flags = STEP_OVER; break; + case 0x110: util::stream_format(stream, "sinir "); flags = STEP_COND; break; case 0x118: util::stream_format(stream, "sini "); break; - case 0x120: util::stream_format(stream, "otir "); flags = STEP_OVER; break; + case 0x120: util::stream_format(stream, "otir "); flags = STEP_COND; break; case 0x128: util::stream_format(stream, "outi "); break; case 0x130: util::stream_format(stream, "souti "); break; - case 0x138: util::stream_format(stream, "sotir "); flags = STEP_OVER; break; + case 0x138: util::stream_format(stream, "sotir "); flags = STEP_COND; break; case 0x140: util::stream_format(stream, "in "); break; case 0x148: util::stream_format(stream, "in "); break; case 0x150: util::stream_format(stream, "sin "); break; @@ -707,14 +707,14 @@ case 0x168: util::stream_format(stream, "out "); break; case 0x170: util::stream_format(stream, "sout "); break; case 0x178: util::stream_format(stream, "sout "); break; - case 0x180: util::stream_format(stream, "indr "); flags = STEP_OVER; break; + case 0x180: util::stream_format(stream, "indr "); flags = STEP_COND; break; case 0x188: util::stream_format(stream, "ind "); break; - case 0x190: util::stream_format(stream, "sindr "); flags = STEP_OVER; break; + case 0x190: util::stream_format(stream, "sindr "); flags = STEP_COND; break; case 0x198: util::stream_format(stream, "sind "); break; - case 0x1a0: util::stream_format(stream, "otdr "); flags = STEP_OVER; break; + case 0x1a0: util::stream_format(stream, "otdr "); flags = STEP_COND; break; case 0x1a8: util::stream_format(stream, "outd "); break; case 0x1b0: util::stream_format(stream, "soutd "); break; - case 0x1b8: util::stream_format(stream, "sotdr "); flags = STEP_OVER; break; + case 0x1b8: util::stream_format(stream, "sotdr "); flags = STEP_COND; break; default: util::stream_format(stream, "unk(0x%x)", tmp); } @@ -747,8 +747,10 @@ /* skip following comma */ if (*src == ',') src++; + flags &= ~STEP_COND; } - else util::stream_format(stream, "%s", cc[n[i]]); + else + util::stream_format(stream, "%s", cc[n[i]]); break; case 'd': /* displacement */ diff -Nru mame-0.242+dfsg.1/src/devices/cpu/z8000/z8000.cpp mame-0.243+dfsg.1/src/devices/cpu/z8000/z8000.cpp --- mame-0.242+dfsg.1/src/devices/cpu/z8000/z8000.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/cpu/z8000/z8000.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -16,9 +16,6 @@ #include "z8000.h" #include "z8000cpu.h" -#include "debugger.h" -#include "debug/debugcon.h" - //#define VERBOSE 1 #include "logmacro.h" diff -Nru mame-0.242+dfsg.1/src/devices/imagedev/chd_cd.cpp mame-0.243+dfsg.1/src/devices/imagedev/chd_cd.cpp --- mame-0.242+dfsg.1/src/devices/imagedev/chd_cd.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/imagedev/chd_cd.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -65,7 +65,7 @@ chd_file *chd = machine().rom_load().get_disk_handle(owner()->tag() ); if( chd != nullptr ) { - m_cdrom_handle = cdrom_open( chd ); + m_cdrom_handle = new cdrom_file( chd ); } else { @@ -76,7 +76,7 @@ void cdrom_image_device::device_stop() { if (m_cdrom_handle) - cdrom_close(m_cdrom_handle); + delete m_cdrom_handle; if( m_self_chd.opened() ) m_self_chd.close(); } @@ -87,7 +87,7 @@ chd_file *chd = nullptr; if (m_cdrom_handle) - cdrom_close(m_cdrom_handle); + delete m_cdrom_handle; if (!loaded_through_softlist()) { if (is_filetype("chd") && is_loaded()) { @@ -105,9 +105,9 @@ /* open the CHD file */ if (chd) { - m_cdrom_handle = cdrom_open(chd); + m_cdrom_handle = new cdrom_file(chd); } else { - m_cdrom_handle = cdrom_open(filename()); + m_cdrom_handle = new cdrom_file(filename()); } if (!m_cdrom_handle) goto error; @@ -125,7 +125,7 @@ void cdrom_image_device::call_unload() { assert(m_cdrom_handle); - cdrom_close(m_cdrom_handle); + delete m_cdrom_handle; m_cdrom_handle = nullptr; if( m_self_chd.opened() ) m_self_chd.close(); diff -Nru mame-0.242+dfsg.1/src/devices/imagedev/diablo.cpp mame-0.243+dfsg.1/src/devices/imagedev/diablo.cpp --- mame-0.242+dfsg.1/src/devices/imagedev/diablo.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/imagedev/diablo.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -83,7 +83,7 @@ chd_file *handle = machine().rom_load().get_disk_handle(tag()); if (handle != nullptr) { - m_hard_disk_handle = hard_disk_open(handle); + m_hard_disk_handle = new hard_disk_file(handle); } else { @@ -94,7 +94,7 @@ void diablo_image_device::device_stop() { if (m_hard_disk_handle) - hard_disk_close(m_hard_disk_handle); + delete m_hard_disk_handle; } image_init_result diablo_image_device::call_load() @@ -154,7 +154,7 @@ if (m_hard_disk_handle != nullptr) { - hard_disk_close(m_hard_disk_handle); + delete m_hard_disk_handle; m_hard_disk_handle = nullptr; } @@ -213,7 +213,7 @@ m_chd = nullptr; if (m_hard_disk_handle) - hard_disk_close(m_hard_disk_handle); + delete m_hard_disk_handle; /* open the CHD file */ if (loaded_through_softlist()) @@ -249,7 +249,7 @@ if (m_chd != nullptr) { /* open the hard disk file */ - m_hard_disk_handle = hard_disk_open(m_chd); + m_hard_disk_handle = new hard_disk_file(m_chd); if (m_hard_disk_handle != nullptr) return image_init_result::PASS; } @@ -262,19 +262,3 @@ return image_init_result::FAIL; } - -/************************************* - * - * Get the CHD file (from the src/chd.c core) - * after an image has been opened with the hd core - * - *************************************/ - -chd_file *diablo_image_device::get_chd_file() -{ - chd_file *result = nullptr; - hard_disk_file *hd_file = get_hard_disk_file(); - if (hd_file) - result = hard_disk_get_chd(hd_file); - return result; -} diff -Nru mame-0.242+dfsg.1/src/devices/imagedev/diablo.h mame-0.243+dfsg.1/src/devices/imagedev/diablo.h --- mame-0.242+dfsg.1/src/devices/imagedev/diablo.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/imagedev/diablo.h 2022-04-29 05:37:26.000000000 +0000 @@ -43,7 +43,6 @@ // specific implementation hard_disk_file *get_hard_disk_file() { return m_hard_disk_handle; } - chd_file *get_chd_file(); protected: // device-level overrides diff -Nru mame-0.242+dfsg.1/src/devices/imagedev/floppy.cpp mame-0.243+dfsg.1/src/devices/imagedev/floppy.cpp --- mame-0.242+dfsg.1/src/devices/imagedev/floppy.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/imagedev/floppy.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -183,9 +183,9 @@ add(FLOPPY_IPF_FORMAT); } -void format_registration::add(floppy_format_type format) +void format_registration::add(const floppy_image_format_t &format) { - m_formats.push_back(format); + m_formats.push_back(&format); } void format_registration::add(const fs::manager_t &fs) @@ -286,8 +286,6 @@ floppy_image_device::~floppy_image_device() { - for(floppy_image_format_t *format : fif_list) - delete format; } void floppy_image_device::setup_load_cb(load_cb cb) @@ -320,17 +318,14 @@ cur_led_cb = cb; } -void floppy_image_device::fs_enum::add(floppy_format_type type, u32 image_size, const char *name, const char *description) +void floppy_image_device::fs_enum::add(const floppy_image_format_t &type, u32 image_size, const char *name, const char *description) { - if(m_manager->can_format()) - m_fid->m_create_fs.emplace_back(fs_info(m_manager, type, image_size, name, description)); - if(m_manager->can_read()) - m_fid->m_io_fs.emplace_back(fs_info(m_manager, type, image_size, name, description)); + m_fid->m_fs.emplace_back(fs_info(m_manager, &type, image_size, name, description)); } void floppy_image_device::fs_enum::add_raw(const char *name, u32 key, const char *description) { - m_fid->m_create_fs.emplace_back(fs_info(name, key, description)); + m_fid->m_fs.emplace_back(fs_info(name, key, description)); } void floppy_image_device::register_formats() @@ -340,14 +335,10 @@ format_registration_cb(fr); extension_list[0] = '\0'; - fif_list.clear(); - for(floppy_format_type fft : fr.m_formats) + fif_list = std::move(fr.m_formats); + for(const floppy_image_format_t *fif : fif_list) { - // allocate a new format - floppy_image_format_t *fif = fft(); - fif_list.push_back(fif); add_format(fif->name(), fif->description(), fif->extensions(), ""); - image_specify_extension( extension_list, 256, fif->extensions() ); } @@ -365,12 +356,12 @@ format_registration_cb = formats; } -const std::vector &floppy_image_device::get_formats() const +const std::vector &floppy_image_device::get_formats() const { return fif_list; } -floppy_image_format_t *floppy_image_device::get_load_format() const +const floppy_image_format_t *floppy_image_device::get_load_format() const { return input_format; } @@ -385,7 +376,7 @@ angular_speed = rpm/60.0*2e8; } -void floppy_image_device::setup_write(floppy_image_format_t *_output_format) +void floppy_image_device::setup_write(const floppy_image_format_t *_output_format) { output_format = _output_format; if(image) @@ -539,7 +530,7 @@ index_resync(); } -floppy_image_format_t *floppy_image_device::identify(std::string filename) +const floppy_image_format_t *floppy_image_device::identify(std::string filename) { util::core_file::ptr fd; std::string revised_path; @@ -556,8 +547,8 @@ } int best = 0; - floppy_image_format_t *best_format = nullptr; - for(floppy_image_format_t *format : fif_list) { + const floppy_image_format_t *best_format = nullptr; + for(const floppy_image_format_t *format : fif_list) { int score = format->identify(*io, form_factor, variants); if(score > best) { best = score; @@ -604,9 +595,11 @@ } int best = 0; - floppy_image_format_t *best_format = nullptr; - for (floppy_image_format_t *format : fif_list) { + const floppy_image_format_t *best_format = nullptr; + for (const floppy_image_format_t *format : fif_list) { int score = format->identify(*io, form_factor, variants); + if(score && format->extension_matches(filename())) + score |= floppy_image_format_t::FIFID_EXT; if(score > best) { best = score; best_format = format; @@ -810,7 +803,7 @@ output_format = nullptr; // search for a suitable format based on the extension - for(floppy_image_format_t *i : fif_list) + for(const floppy_image_format_t *i : fif_list) { // only consider formats that actually support saving if(!i->supports_save()) @@ -843,13 +836,14 @@ auto cfs = fs->m_manager->mount(blockdev); cfs->format(meta); - auto source_format = fs->m_type(); auto io = util::ram_read(img.data(), img.size(), 0xff); - source_format->load(*io, floppy_image::FF_UNKNOWN, variants, image.get()); - delete source_format; + fs->m_type->load(*io, floppy_image::FF_UNKNOWN, variants, image.get()); } else { fs::unformatted_image::format(fs->m_key, image.get()); } + + // intializing a file system makes the floppy dirty + image_dirty = true; } /* write protect, active high @@ -1135,11 +1129,6 @@ return res; } -bool floppy_image_device::test_track_last_entry_warps(const std::vector &buf) const -{ - return !((buf[buf.size() - 1]^buf[0]) & floppy_image::MG_MASK); -} - attotime floppy_image_device::position_to_time(const attotime &base, int position) const { return base + attotime::from_double(position/angular_speed); @@ -1149,19 +1138,13 @@ { int cells = buf.size(); - if(index != 0 || !test_track_last_entry_warps(buf)) { - cache_index = index; - cache_start_time = position_to_time(base, buf[index] & floppy_image::TIME_MASK); - } else { - cache_index = cells - 1; - cache_start_time = position_to_time(base - rev_time, buf[cache_index] & floppy_image::TIME_MASK); - } - + cache_index = index; + cache_start_time = position_to_time(base, buf[index] & floppy_image::TIME_MASK); cache_entry = buf[cache_index]; index ++; if(index >= cells) { - index = test_track_last_entry_warps(buf) ? 1 : 0; + index = 0; base += rev_time; } @@ -1276,162 +1259,147 @@ track_dirty = true; cache_clear(); + std::vector wspans(1); + attotime base; - int start_pos = find_position(base, start); - int end_pos = find_position(base, end); + wspans[0].start = find_position(base, start); + wspans[0].end = find_position(base, end); - std::vector trans_pos(transition_count); for(int i=0; i != transition_count; i++) - trans_pos[i] = find_position(base, transitions[i]); + wspans[0].flux_change_positions.push_back(find_position(base, transitions[i])); + + wspan_split_on_wrap(wspans); std::vector &buf = image->get_buffer(cyl, ss, subcyl); - int index; - if(!buf.empty()) - index = find_index(start_pos, buf); - else { - index = 0; + if(buf.empty()) { buf.push_back(floppy_image::MG_N); + buf.push_back(floppy_image::MG_E | 199999999); } - uint32_t cur_mg; - if((buf[index] & floppy_image::TIME_MASK) == start_pos) { - if(index) - cur_mg = buf[index-1]; - else - cur_mg = buf[buf.size() - 1]; - } else - cur_mg = buf[index]; - - cur_mg &= floppy_image::MG_MASK; - if(cur_mg == floppy_image::MG_N || cur_mg == floppy_image::MG_D) - cur_mg = floppy_image::MG_A; + wspan_remove_damaged(wspans, buf); + wspan_write(wspans, buf); - uint32_t pos = start_pos; - int ti = 0; - int cells = buf.size(); - if(transition_count != 0 && trans_pos[0] == pos) { - cur_mg = cur_mg == floppy_image::MG_A ? floppy_image::MG_B : floppy_image::MG_A; - ti ++; - } - while(pos != end_pos) { - if(buf.size() < cells+10) - buf.resize(cells+200); - uint32_t next_pos; - if(ti != transition_count) - next_pos = trans_pos[ti++]; - else - next_pos = end_pos; - if(next_pos > pos) - write_zone(&buf[0], cells, index, pos, next_pos, cur_mg); - else { - write_zone(&buf[0], cells, index, pos, 200000000, cur_mg); - index = 0; - write_zone(&buf[0], cells, index, 0, next_pos, cur_mg); - } - pos = next_pos; - cur_mg = cur_mg == floppy_image::MG_A ? floppy_image::MG_B : floppy_image::MG_A; - } - - buf.resize(cells); + cache_clear(); } -void floppy_image_device::write_zone(uint32_t *buf, int &cells, int &index, uint32_t spos, uint32_t epos, uint32_t mg) +void floppy_image_device::wspan_split_on_wrap(std::vector &wspans) { - cache_clear(); - while(spos < epos) { - while(index != cells-1 && (buf[index+1] & floppy_image::TIME_MASK) <= spos) - index++; - - uint32_t ref_start = buf[index] & floppy_image::TIME_MASK; - uint32_t ref_end = index == cells-1 ? 200000000 : buf[index+1] & floppy_image::TIME_MASK; - uint32_t ref_mg = buf[index] & floppy_image::MG_MASK; - - // Can't overwrite a damaged zone - if(ref_mg == floppy_image::MG_D) { - spos = ref_end; - continue; - } - - // If the zone is of the type we want, we don't need to touch it - if(ref_mg == mg) { - spos = ref_end; - continue; + int ne = wspans.size(); + for(int i=0; i != ne; i++) + if(wspans[i].end < wspans[i].start) { + wspans.resize(wspans.size()+1); + auto &ws = wspans[i]; + auto &we = wspans.back(); + we.start = 0; + we.end = ws.end; + ws.end = 200000000; + int start = ws.start; + int split_index; + for(split_index = 0; split_index != ws.flux_change_positions.size(); split_index++) + if(ws.flux_change_positions[split_index] < start) + break; + if(split_index == 0) + std::swap(ws.flux_change_positions, we.flux_change_positions); + + else { + we.flux_change_positions.resize(ws.flux_change_positions.size() - split_index); + std::copy(ws.flux_change_positions.begin() + split_index, ws.flux_change_positions.end(), we.flux_change_positions.begin()); + ws.flux_change_positions.erase(ws.flux_change_positions.begin() + split_index, ws.flux_change_positions.end()); + } } +} - // Check the overlaps, act accordingly - if(spos == ref_start) { - if(epos >= ref_end) { - // Full overlap, that cell is dead, we need to see which ones we can extend - uint32_t prev_mg = index != 0 ? buf[index-1] & floppy_image::MG_MASK : ~0; - uint32_t next_mg = index != cells-1 ? buf[index+1] & floppy_image::MG_MASK : ~0; - if(prev_mg == mg) { - if(next_mg == mg) { - // Both match, merge all three in one - memmove(buf+index, buf+index+2, (cells-index-2)*sizeof(uint32_t)); - cells -= 2; - index--; - - } else { - // Previous matches, drop the current cell - memmove(buf+index, buf+index+1, (cells-index-1)*sizeof(uint32_t)); - cells --; - } - - } else { - if(next_mg == mg) { - // Following matches, extend it - memmove(buf+index, buf+index+1, (cells-index-1)*sizeof(uint32_t)); - cells --; - buf[index] = mg | spos; - } else { - // None match, convert the current cell - buf[index] = mg | spos; - index++; - } +void floppy_image_device::wspan_remove_damaged(std::vector &wspans, const std::vector &track) +{ + for(size_t pos = 0; pos != track.size(); pos++) + if((track[pos] & floppy_image::MG_MASK) == floppy_image::MG_D) { + int start = track[pos] & floppy_image::TIME_MASK; + int end = track[pos+1] & floppy_image::TIME_MASK; + int ne = wspans.size(); + for(int i=0; i != ne; i++) { + // D range outside of span range + if(wspans[i].start > end || wspans[i].end <= start) + continue; + + // D range covers span range + if(wspans[i].start >= start && wspans[i].end-1 <= end) { + wspans.erase(wspans.begin() + i); + i --; + ne --; + continue; } - spos = ref_end; - } else { - // Overlap at the start only - // Check if we can just extend the previous cell - if(index != 0 && (buf[index-1] & floppy_image::MG_MASK) == mg) - buf[index] = ref_mg | epos; - else { - // Otherwise we need to insert a new cell - if(index != cells-1) - memmove(buf+index+1, buf+index, (cells-index)*sizeof(uint32_t)); - cells++; - buf[index] = mg | spos; - buf[index+1] = ref_mg | epos; + // D range covers the start of the span range + if(wspans[i].start >= start && wspans[i].end-1 > end) { + wspans[i].start = end+1; + while(!wspans[i].flux_change_positions.empty() && wspans[i].flux_change_positions[0] <= end) + wspans[i].flux_change_positions.erase(wspans[i].flux_change_positions.begin()); + continue; } - spos = epos; - } - } else { - if(epos >= ref_end) { - // Overlap at the end only - // If we can't just extend the following cell, we need to insert a new one - if(index == cells-1 || (buf[index+1] & floppy_image::MG_MASK) != mg) { - if(index != cells-1) - memmove(buf+index+2, buf+index+1, (cells-index-1)*sizeof(uint32_t)); - cells++; + // D range covers the end of the span range + if(wspans[i].start < start && wspans[i].end-1 <= end) { + wspans[i].end = start; + while(!wspans[i].flux_change_positions.empty() && wspans[i].flux_change_positions[wspans[i].flux_change_positions.size()-1] >= start) + wspans[i].flux_change_positions.erase(wspans[i].flux_change_positions.end()-1); + continue; } - buf[index+1] = mg | spos; - index++; - spos = ref_end; + // D range is inside the span range, need to split + int id = wspans.size(); + wspans.resize(id+1); + wspans[id].start = end+1; + wspans[id].end = wspans[i].end; + wspans[id].flux_change_positions = wspans[i].flux_change_positions; + wspans[i].end = start; + while(!wspans[i].flux_change_positions.empty() && wspans[i].flux_change_positions[wspans[i].flux_change_positions.size()-1] >= start) + wspans[i].flux_change_positions.erase(wspans[i].flux_change_positions.end()-1); + while(!wspans[id].flux_change_positions.empty() && wspans[id].flux_change_positions[0] <= end) + wspans[id].flux_change_positions.erase(wspans[id].flux_change_positions.begin()); + } + } +} + +void floppy_image_device::wspan_write(const std::vector &wspans, std::vector &track) +{ + for(const auto &ws : wspans) { + unsigned si, ei; + for(si = 0; si != track.size(); si++) + if((track[si] & floppy_image::TIME_MASK) >= ws.start) + break; + for(ei = si; ei != track.size(); ei++) + if((track[ei] & floppy_image::TIME_MASK) >= ws.end) + break; + + // Reduce neutral zone at the start, if there's one + if(si != track.size() && (track[si] & floppy_image::MG_MASK) == floppy_image::MG_E) { + // Neutral zone is over the whole range, split it and adapt si/ei + if(si == ei) { + track.insert(track.begin() + si, floppy_image::MG_E | (ws.start-1)); + track.insert(track.begin() + si + 1, (track[si-1] & floppy_image::MG_MASK) | ws.end); + si = ei = si+1; } else { - // Full inclusion - // We need to split the zone in 3 - if(index != cells-1) - memmove(buf+index+3, buf+index+1, (cells-index-1)*sizeof(uint32_t)); - cells += 2; - buf[index+1] = mg | spos; - buf[index+2] = ref_mg | epos; - spos = epos; + // Reduce the zone size + track[si] = floppy_image::MG_E | (ws.start-1); + si ++; } } + + // Check for a neutral zone at the end and reduce it if needed + if(ei != track.size() && (track[ei] & floppy_image::MG_MASK) == floppy_image::MG_E) { + track[ei-1] = floppy_image::MG_N | ws.end; + ei --; + } + + // Clear the covered zone + track.erase(track.begin() + si, track.begin() + ei); + + // Insert the flux changes + for(auto f : ws.flux_change_positions) { + track.insert(track.begin() + si, floppy_image::MG_F | f); + si ++; + } } } diff -Nru mame-0.242+dfsg.1/src/devices/imagedev/floppy.h mame-0.243+dfsg.1/src/devices/imagedev/floppy.h --- mame-0.242+dfsg.1/src/devices/imagedev/floppy.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/imagedev/floppy.h 2022-04-29 05:37:26.000000000 +0000 @@ -26,14 +26,14 @@ public: format_registration(); - void add(floppy_format_type format); + void add(const floppy_image_format_t &format); void add(const fs::manager_t &fs); void add_fm_containers(); void add_mfm_containers(); void add_pc_formats(); - std::vector m_formats; + std::vector m_formats; std::vector m_fs; }; @@ -50,13 +50,13 @@ struct fs_info { const fs::manager_t *m_manager; - floppy_format_type m_type; + const floppy_image_format_t *m_type; u32 m_image_size; const char *m_name; u32 m_key; const char *m_description; - fs_info(const fs::manager_t *manager, floppy_format_type type, u32 image_size, const char *name, const char *description) : + fs_info(const fs::manager_t *manager, const floppy_image_format_t *type, u32 image_size, const char *name, const char *description) : m_manager(manager), m_type(type), m_image_size(image_size), @@ -79,11 +79,10 @@ virtual ~floppy_image_device(); void set_formats(std::function formats); - const std::vector &get_formats() const; - const std::vector &get_create_fs() const { return m_create_fs; } - const std::vector &get_io_fs() const { return m_io_fs; } - floppy_image_format_t *get_load_format() const; - floppy_image_format_t *identify(std::string filename); + const std::vector &get_formats() const; + const std::vector &get_fs() const { return m_fs; } + const floppy_image_format_t *get_load_format() const; + const floppy_image_format_t *identify(std::string filename); void set_rpm(float rpm); void init_fs(const fs_info *fs, const fs::meta_data &meta); @@ -101,7 +100,7 @@ virtual const char *file_extensions() const noexcept override { return extension_list; } virtual const char *image_type_name() const noexcept override { return "floppydisk"; } virtual const char *image_brief_type_name() const noexcept override { return "flop"; } - void setup_write(floppy_image_format_t *output_format); + void setup_write(const floppy_image_format_t *output_format); void setup_load_cb(load_cb cb); void setup_unload_cb(unload_cb cb); @@ -161,7 +160,7 @@ fs_enum(floppy_image_device *fid) : fs::manager_t::floppy_enumerator(), m_fid(fid) {} - virtual void add(floppy_format_type type, u32 image_size, const char *name, const char *description) override; + virtual void add(const floppy_image_format_t &type, u32 image_size, const char *name, const char *description) override; virtual void add_raw(const char *name, u32 key, const char *description) override; }; @@ -183,13 +182,13 @@ void init_floppy_load(bool write_supported); std::function format_registration_cb; - floppy_image_format_t *input_format; - floppy_image_format_t *output_format; + const floppy_image_format_t *input_format; + const floppy_image_format_t *output_format; std::vector variants; std::unique_ptr image; char extension_list[256]; - std::vector fif_list; - std::vector m_create_fs, m_io_fs; + std::vector fif_list; + std::vector m_fs; std::vector m_fs_managers; emu_timer *index_timer; @@ -228,7 +227,6 @@ attotime revolution_start_time, rev_time; uint32_t revolution_count; int cyl, subcyl; - /* Current floppy zone cache */ attotime cache_start_time, cache_end_time, cache_weak_start; attotime amplifier_freakout_time; @@ -246,15 +244,24 @@ wpt_cb cur_wpt_cb; led_cb cur_led_cb; + + // Temporary structure storing a write span + struct wspan { + int start, end; + std::vector flux_change_positions; + }; + + static void wspan_split_on_wrap(std::vector &wspans); + static void wspan_remove_damaged(std::vector &wspans, const std::vector &track); + static void wspan_write(const std::vector &wspans, std::vector &track); + void register_formats(); void check_led(); uint32_t find_position(attotime &base, const attotime &when); int find_index(uint32_t position, const std::vector &buf) const; - bool test_track_last_entry_warps(const std::vector &buf) const; attotime position_to_time(const attotime &base, int position) const; - void write_zone(uint32_t *buf, int &cells, int &index, uint32_t spos, uint32_t epos, uint32_t mg); void commit_image(); u32 hash32(u32 val) const; diff -Nru mame-0.242+dfsg.1/src/devices/imagedev/harddriv.cpp mame-0.243+dfsg.1/src/devices/imagedev/harddriv.cpp --- mame-0.242+dfsg.1/src/devices/imagedev/harddriv.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/imagedev/harddriv.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -111,7 +111,7 @@ chd_file *handle = machine().rom_load().get_disk_handle(tag()); if (handle != nullptr) { - m_hard_disk_handle = hard_disk_open(handle); + m_hard_disk_handle = new hard_disk_file(handle); } else { @@ -123,7 +123,7 @@ { if (m_hard_disk_handle != nullptr) { - hard_disk_close(m_hard_disk_handle); + delete m_hard_disk_handle; m_hard_disk_handle = nullptr; } } @@ -184,7 +184,7 @@ if (m_hard_disk_handle) { - hard_disk_close(m_hard_disk_handle); + delete m_hard_disk_handle; m_hard_disk_handle = nullptr; } @@ -247,7 +247,7 @@ if (m_hard_disk_handle) { - hard_disk_close(m_hard_disk_handle); + delete m_hard_disk_handle; m_hard_disk_handle = nullptr; } @@ -294,7 +294,7 @@ if (m_chd) { /* open the hard disk file */ - m_hard_disk_handle = hard_disk_open(m_chd); + m_hard_disk_handle = new hard_disk_file(m_chd); if (m_hard_disk_handle) return image_init_result::PASS; } @@ -325,7 +325,7 @@ } } - m_hard_disk_handle = hard_disk_open(image_core_file(), skip); + m_hard_disk_handle = new hard_disk_file(image_core_file(), skip); if (m_hard_disk_handle) return image_init_result::PASS; } @@ -341,19 +341,3 @@ return image_init_result::FAIL; } - -/************************************* - * - * Get the CHD file (from the src/chd.c core) - * after an image has been opened with the hd core - * - *************************************/ - -chd_file *harddisk_image_device::get_chd_file() -{ - chd_file *result = nullptr; - hard_disk_file *hd_file = get_hard_disk_file(); - if (hd_file) - result = hard_disk_get_chd(hd_file); - return result; -} diff -Nru mame-0.242+dfsg.1/src/devices/imagedev/harddriv.h mame-0.243+dfsg.1/src/devices/imagedev/harddriv.h --- mame-0.242+dfsg.1/src/devices/imagedev/harddriv.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/imagedev/harddriv.h 2022-04-29 05:37:26.000000000 +0000 @@ -65,7 +65,6 @@ // specific implementation hard_disk_file *get_hard_disk_file() { return m_hard_disk_handle; } - chd_file *get_chd_file(); protected: harddisk_image_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); diff -Nru mame-0.242+dfsg.1/src/devices/imagedev/mfmhd.cpp mame-0.243+dfsg.1/src/devices/imagedev/mfmhd.cpp --- mame-0.242+dfsg.1/src/devices/imagedev/mfmhd.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/imagedev/mfmhd.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -270,8 +270,10 @@ **************************************************************************/ #include "emu.h" -#include "harddisk.h" +#include "romload.h" #include "mfmhd.h" +#include "util/ioprocs.h" +#include "util/ioprocsfilter.h" #define LOG_WARN (1U<<1) // Warnings #define LOG_CONFIG (1U<<2) // Configuration @@ -303,16 +305,9 @@ STEP_SETTLE }; -std::string mfm_harddisk_device::tts(const attotime &t) -{ - char buf[256]; - int nsec = t.attoseconds() / ATTOSECONDS_PER_NANOSECOND; - sprintf(buf, "%4d.%03d,%03d,%03d", int(t.seconds()), nsec/1000000, (nsec/1000)%1000, nsec % 1000); - return buf; -} - mfm_harddisk_device::mfm_harddisk_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) - : harddisk_image_device(mconfig, type, tag, owner, clock), + : device_t(mconfig, type, tag, owner, clock), + device_image_interface(mconfig, *this), m_index_timer(nullptr), m_spinup_timer(nullptr), m_seek_timer(nullptr), @@ -421,26 +416,41 @@ */ image_init_result mfm_harddisk_device::call_load() { - image_init_result loaded = harddisk_image_device::call_load(); + std::error_condition err; + + /* open the CHD file */ + if (loaded_through_softlist()) + { + m_chd = machine().rom_load().get_disk_handle(device().subtag("harddriv").c_str()); + } + else + { + auto io = util::random_read_write_fill(image_core_file(), 0xff); + if(!io) { + seterror(std::errc::not_enough_memory, nullptr); + return image_init_result::FAIL; + } + m_chd = new chd_file; + err = m_chd->open(std::move(io), true); + } std::string devtag(tag()); devtag += ":format"; m_format->set_tag(devtag); - if (loaded==image_init_result::PASS) + if (!err) { std::string metadata; - chd_file* chdfile = get_chd_file(); - if (chdfile==nullptr) + if (m_chd==nullptr) { - LOG("chdfile is null\n"); + LOG("m_chd is null\n"); return image_init_result::FAIL; } // Read the hard disk metadata - std::error_condition state = chdfile->read_metadata(HARD_DISK_METADATA_TAG, 0, metadata); + std::error_condition state = m_chd->read_metadata(HARD_DISK_METADATA_TAG, 0, metadata); if (state) { LOG("Failed to read CHD metadata\n"); @@ -474,7 +484,7 @@ param.write_precomp_cylinder = -1; param.reduced_wcurr_cylinder = -1; - state = chdfile->read_metadata(MFM_HARD_DISK_METADATA_TAG, 0, metadata); + state = m_chd->read_metadata(MFM_HARD_DISK_METADATA_TAG, 0, metadata); if (state) { LOGMASKED(LOG_WARN, "Failed to read CHD sector arrangement/recording specs, applying defaults\n"); @@ -493,7 +503,7 @@ LOGMASKED(LOG_CONFIG, "MFM HD rec specs: interleave=%d, cylskew=%d, headskew=%d, wpcom=%d, rwc=%d\n", param.interleave, param.cylskew, param.headskew, param.write_precomp_cylinder, param.reduced_wcurr_cylinder); - state = chdfile->read_metadata(MFM_HARD_DISK_METADATA_TAG, 1, metadata); + state = m_chd->read_metadata(MFM_HARD_DISK_METADATA_TAG, 1, metadata); if (state) { LOGMASKED(LOG_WARN, "Failed to read CHD track gap specs, applying defaults\n"); @@ -540,8 +550,9 @@ else { LOGMASKED(LOG_WARN, "Could not load CHD\n"); + return image_init_result::FAIL; } - return loaded; + return image_init_result::PASS; } const char *MFMHD_REC_METADATA_FORMAT = "IL:%d,CSKEW:%d,HSKEW:%d,WPCOM:%d,RWC:%d"; @@ -559,9 +570,7 @@ if (m_format->save_param(MFMHD_IL) && !params->equals_rec(oldparams)) { LOGMASKED(LOG_WARN, "MFM HD sector arrangement and recording specs have changed; updating CHD metadata\n"); - chd_file* chdfile = get_chd_file(); - - std::error_condition err = chdfile->write_metadata(MFM_HARD_DISK_METADATA_TAG, 0, string_format(MFMHD_REC_METADATA_FORMAT, params->interleave, params->cylskew, params->headskew, params->write_precomp_cylinder, params->reduced_wcurr_cylinder), 0); + std::error_condition err = m_chd->write_metadata(MFM_HARD_DISK_METADATA_TAG, 0, string_format(MFMHD_REC_METADATA_FORMAT, params->interleave, params->cylskew, params->headskew, params->write_precomp_cylinder, params->reduced_wcurr_cylinder), 0); if (err) { LOGMASKED(LOG_WARN, "Failed to save MFM HD sector arrangement/recording specs to CHD\n"); @@ -571,16 +580,15 @@ if (m_format->save_param(MFMHD_GAP1) && !params->equals_gap(oldparams)) { LOGMASKED(LOG_WARN, "MFM HD track gap specs have changed; updating CHD metadata\n"); - chd_file* chdfile = get_chd_file(); - - std::error_condition err = chdfile->write_metadata(MFM_HARD_DISK_METADATA_TAG, 1, string_format(MFMHD_GAP_METADATA_FORMAT, params->gap1, params->gap2, params->gap3, params->sync, params->headerlen, params->ecctype), 0); + std::error_condition err = m_chd->write_metadata(MFM_HARD_DISK_METADATA_TAG, 1, string_format(MFMHD_GAP_METADATA_FORMAT, params->gap1, params->gap2, params->gap3, params->sync, params->headerlen, params->ecctype), 0); if (err) { LOGMASKED(LOG_WARN, "Failed to save MFM HD track gap specs to CHD\n"); } } } - harddisk_image_device::call_unload(); + + m_chd = nullptr; } void mfm_harddisk_device::setup_index_pulse_cb(index_pulse_cb cb) @@ -615,7 +623,7 @@ if (!m_revolution_start_time.is_never()) { endtime = m_revolution_start_time + nexttime; - LOGMASKED(LOG_TIMING, "Track start time = %s, end time = %s\n", tts(m_revolution_start_time).c_str(), tts(endtime).c_str()); + LOGMASKED(LOG_TIMING, "Track start time = %s, end time = %s\n", (m_revolution_start_time).to_string(), (endtime).to_string()); } return endtime; } @@ -712,7 +720,7 @@ m_step_phase = STEP_MOVING; m_seek_timer->adjust(m_step_time * steps); - LOGMASKED(LOG_TIMING, "Head movement takes %s time\n", tts(m_step_time * steps).c_str()); + LOGMASKED(LOG_TIMING, "Head movement takes %s time\n", (m_step_time * steps).to_string()); // We pretend that we already arrived // TODO: Check auto truncation? m_current_cylinder += m_track_delta; @@ -811,7 +819,7 @@ // Reached the end if (bytepos >= m_trackimage_size) { - LOGMASKED(LOG_TIMING, "Reached end: rev_start = %s, live = %s\n", tts(m_revolution_start_time).c_str(), tts(from_when).c_str()); + LOGMASKED(LOG_TIMING, "Reached end: rev_start = %s, live = %s\n", (m_revolution_start_time).to_string(), (from_when).to_string()); m_revolution_start_time += m_rev_time; cell = (from_when - m_revolution_start_time).as_ticks(freq); bytepos = cell / 16; @@ -819,7 +827,7 @@ if (bytepos < 0) { - LOGMASKED(LOG_TIMING, "Negative cell number: rev_start = %s, live = %s\n", tts(m_revolution_start_time).c_str(), tts(from_when).c_str()); + LOGMASKED(LOG_TIMING, "Negative cell number: rev_start = %s, live = %s\n", (m_revolution_start_time).to_string(), (from_when).to_string()); bytepos = 0; } bit = cell % 16; @@ -856,7 +864,7 @@ { // We will deliver a single bit cdata = ((track[bytepos] << bitpos) & 0x8000) >> 15; - LOGMASKED(LOG_BITS, "Reading (c=%d,h=%d,bit=%d) at cell %d [%s] = %d\n", m_current_cylinder, m_current_head, bitpos, ((bytepos<<4) + bitpos), tts(fw).c_str(), cdata); + LOGMASKED(LOG_BITS, "Reading (c=%d,h=%d,bit=%d) at cell %d [%s] = %d\n", m_current_cylinder, m_current_head, bitpos, ((bytepos<<4) + bitpos), fw.to_string(), cdata); } else { @@ -1060,8 +1068,6 @@ m_tracks->dirty = true; } -const char *encnames[] = { "MFM_BITS","MFM_BYTE","SEPARATE","SSIMPLE " }; - /* Initialize the cache by loading the first tracks. */ diff -Nru mame-0.242+dfsg.1/src/devices/imagedev/mfmhd.h mame-0.243+dfsg.1/src/devices/imagedev/mfmhd.h --- mame-0.242+dfsg.1/src/devices/imagedev/mfmhd.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/imagedev/mfmhd.h 2022-04-29 05:37:26.000000000 +0000 @@ -52,7 +52,7 @@ running_machine & m_machine; }; -class mfm_harddisk_device : public harddisk_image_device +class mfm_harddisk_device : public device_t, public device_image_interface { public: ~mfm_harddisk_device(); @@ -61,6 +61,14 @@ typedef delegate ready_cb; typedef delegate seek_complete_cb; + virtual bool is_readable() const noexcept override { return true; } + virtual bool is_writeable() const noexcept override { return true; } + virtual bool is_creatable() const noexcept override { return false; } + virtual bool is_reset_on_load() const noexcept override { return false; } + virtual const char *image_type_name() const noexcept override { return "harddisk"; } + virtual const char *image_brief_type_name() const noexcept override { return "hard"; } + virtual const char *file_extensions() const noexcept override { return "chd"; } + void setup_index_pulse_cb(index_pulse_cb cb); void setup_ready_cb(ready_cb cb); void setup_seek_complete_cb(seek_complete_cb cb); @@ -112,8 +120,6 @@ virtual void device_reset() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param) override; - std::string tts(const attotime &t); - emu_timer *m_index_timer, *m_spinup_timer, *m_seek_timer, *m_cache_timer; index_pulse_cb m_index_pulse_cb; ready_cb m_ready_cb; @@ -158,7 +164,7 @@ std::unique_ptr m_cache; mfmhd_image_format_t* m_format; - + chd_file *m_chd; void head_move(); void recalibrate(); diff -Nru mame-0.242+dfsg.1/src/devices/imagedev/midiin.cpp mame-0.243+dfsg.1/src/devices/imagedev/midiin.cpp --- mame-0.242+dfsg.1/src/devices/imagedev/midiin.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/imagedev/midiin.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -173,7 +173,7 @@ // if the parsing succeeds, schedule the start to happen at least // 10 seconds after starting to allow the keyboards to initialize // TODO: this should perhaps be a driver-configurable parameter? - if (m_sequence.parse(reinterpret_cast(ptr()), length())) + if (m_sequence.parse(image_core_file(), length())) { m_sequence_start = std::max(machine().time(), attotime(10, 0)); m_timer->adjust(attotime::zero); @@ -273,8 +273,8 @@ // midi_parser - constructor //------------------------------------------------- -midiin_device::midi_parser::midi_parser(u8 const *data, u32 length, u32 offset) : - m_data(data), +midiin_device::midi_parser::midi_parser(util::random_read &stream, u32 length, u32 offset) : + m_stream(stream), m_length(length), m_offset(offset) { @@ -290,7 +290,7 @@ midiin_device::midi_parser midiin_device::midi_parser::subset(u32 length) { check_bounds(length); - midi_parser result(m_data + m_offset, length, 0); + midi_parser result(m_stream, m_offset + length, m_offset); m_offset += length; return result; } @@ -328,6 +328,91 @@ //------------------------------------------------- +// byte - read 8 bits of data +//------------------------------------------------- + +u8 midiin_device::midi_parser::byte() +{ + check_bounds(1); + + u8 result = 0; + std::size_t actual = 0; + if (m_stream.read_at(m_offset, &result, 1, actual) || actual != 1) + throw error("Error reading data"); + m_offset++; + return result; +} + + +//------------------------------------------------- +// word_be - read 16 bits of big-endian data +//------------------------------------------------- + +u16 midiin_device::midi_parser::word_be() +{ + check_bounds(2); + + u16 result = 0; + std::size_t actual = 0; + if (m_stream.read_at(m_offset, &result, 2, actual) || actual != 2) + throw error("Error reading data"); + m_offset += 2; + return big_endianize_int16(result); +} + + +//------------------------------------------------- +// triple_be - read 24 bits of big-endian data +//------------------------------------------------- + +u32 midiin_device::midi_parser::triple_be() +{ + check_bounds(3); + + u32 result = 0; + std::size_t actual = 0; + if (m_stream.read_at(m_offset, &result, 3, actual) || actual != 3) + throw error("Error reading data"); + m_offset += 3; + return big_endianize_int32(result) >> 8; +} + + +//------------------------------------------------- +// dword_be - read 32 bits of big-endian data +//------------------------------------------------- + +u32 midiin_device::midi_parser::dword_be() +{ + check_bounds(4); + + u32 result = 0; + std::size_t actual = 0; + if (m_stream.read_at(m_offset, &result, 4, actual) || actual != 4) + throw error("Error reading data"); + m_offset += 4; + return big_endianize_int32(result); +} + + +//------------------------------------------------- +// dword_le - read 32 bits of little-endian data +//------------------------------------------------- + +u32 midiin_device::midi_parser::dword_le() +{ + check_bounds(4); + + u32 result = 0; + std::size_t actual = 0; + if (m_stream.read_at(m_offset, &result, 4, actual) || actual != 4) + throw error("Error reading data"); + m_offset += 4; + return little_endianize_int32(result); +} + + +//------------------------------------------------- // check_bounds - check to see if we have at least // 'length' bytes left to consume; if not, // throw an error @@ -364,13 +449,13 @@ // parse - parse a MIDI sequence from a buffer //------------------------------------------------- -bool midiin_device::midi_sequence::parse(u8 const *data, u32 length) +bool midiin_device::midi_sequence::parse(util::random_read &stream, u32 length) { // start with an empty list of events m_list.clear(); // by default parse the whole data - midi_parser buffer(data, length, 0); + midi_parser buffer(stream, length, 0); // catch errors to make parsing easier try @@ -403,8 +488,9 @@ m_iterator = m_list.begin(); return true; } - catch (midi_parser::error &) + catch (midi_parser::error &err) { + osd_printf_error("MIDI file error: %s\n", err.description()); m_list.clear(); m_iterator = m_list.begin(); return false; diff -Nru mame-0.242+dfsg.1/src/devices/imagedev/midiin.h mame-0.243+dfsg.1/src/devices/imagedev/midiin.h --- mame-0.242+dfsg.1/src/devices/imagedev/midiin.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/imagedev/midiin.h 2022-04-29 05:37:26.000000000 +0000 @@ -84,7 +84,7 @@ }; // construction - midi_parser(u8 const *data, u32 length, u32 offset); + midi_parser(util::random_read &stream, u32 length, u32 offset); // end of buffer? bool eob() const { return (m_offset >= m_length); } @@ -97,11 +97,11 @@ midi_parser &reset() { return rewind(m_offset); } // read data of various sizes and endiannesses - u8 byte() { check_bounds(1); return m_data[m_offset++]; } - u16 word_be() { u16 result = byte() << 8; return result | byte(); } - u32 triple_be() { u32 result = word_be() << 8; return result | byte(); } - u32 dword_be() { u32 result = word_be() << 16; return result | word_be(); } - u32 dword_le() { return swapendian_int32(dword_be()); } + u8 byte(); + u16 word_be(); + u32 triple_be(); + u32 dword_be(); + u32 dword_le(); // special variable reader for MIDI u32 variable(); @@ -111,7 +111,7 @@ void check_bounds(u32 length); // internal state - u8 const *m_data; + util::random_read &m_stream; u32 m_length; u32 m_offset; }; @@ -154,7 +154,7 @@ void clear() { m_list.clear(); } // parse a new sequence - bool parse(u8 const *data, u32 length); + bool parse(util::random_read &stream, u32 length); // rewind to the start of time void rewind(attotime const &basetime); diff -Nru mame-0.242+dfsg.1/src/devices/machine/53c7xx.cpp mame-0.243+dfsg.1/src/devices/machine/53c7xx.cpp --- mame-0.242+dfsg.1/src/devices/machine/53c7xx.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/machine/53c7xx.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -292,7 +292,8 @@ if (ACCESSING_BITS_0_7) { ret = m_dstat; - m_dstat = 0; + // DFE isn't cleared on read + m_dstat &= DSTAT_DFE; update_irqs(); } if (ACCESSING_BITS_8_15) diff -Nru mame-0.242+dfsg.1/src/devices/machine/68340tmu.cpp mame-0.243+dfsg.1/src/devices/machine/68340tmu.cpp --- mame-0.242+dfsg.1/src/devices/machine/68340tmu.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/machine/68340tmu.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -156,7 +156,7 @@ "Period Measurement - not implemented", "Event Count - not implemented", "Timer Bypass (Simple Test Method) - not implemented" - }}[data & REG_CR_MODE_MASK]); + }}[(data & REG_CR_MODE_MASK) >> 2]); LOGTIMER("- OC: %s mode\n", std::array{{"Disabled", "Toggle", "Zero", "One"}}[data & REG_CR_OC_MASK]); diff -Nru mame-0.242+dfsg.1/src/devices/machine/acorn_vidc.cpp mame-0.243+dfsg.1/src/devices/machine/acorn_vidc.cpp --- mame-0.242+dfsg.1/src/devices/machine/acorn_vidc.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/machine/acorn_vidc.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -12,8 +12,10 @@ * nebulus: 20 lines off with aa310; * lotustc2: abuses color flipping; * quazer: needs in-flight DMA; - - improve sound DAC writes; - - subclass this for VIDC20 emulation (RiscPC); + - move DAC handling into a separate sub-device(s), + particularly needed for proper VIDC20 mixing and likely for fixing aliasing + issues in VIDC10; + - complete VIDC20 emulation (RiscPC/ssfindo.cpp); - Are CRTC values correct? VGA modes have a +1 in display line; **********************************************************************************************/ @@ -208,7 +210,7 @@ { m_cursor_enable = false; memset(m_stereo_image, 4, m_sound_max_channels); - for (int ch=0;chadjust(attotime::never); m_sound_timer->adjust(attotime::never); @@ -317,11 +319,11 @@ void acorn_vidc10_device::pal_data_display_w(offs_t offset, u32 data) { - update_4bpp_palette(offset+0x100, data); + update_4bpp_palette(offset + 0x100, data); //printf("%02x: %01x %01x %01x [%d]\n",offset,r,g,b,screen().vpos()); // 8bpp - for(int idx=0;idx<0x100;idx+=0x10) + for (int idx = 0; idx < 0x100; idx += 0x10) { int b = ((data & 0x700) >> 8) | ((idx & 0x80) >> 4); int g = ((data & 0x030) >> 4) | ((idx & 0x60) >> 3); @@ -415,8 +417,8 @@ const float left_gain[8] = { 1.0f, 2.0f, 1.66f, 1.34f, 1.0f, 0.66f, 0.34f, 0.0f }; const float right_gain[8] = { 1.0f, 0.0f, 0.34f, 0.66f, 1.0f, 1.34f, 1.66f, 2.0f }; - m_lspeaker->set_input_gain(channel,left_gain[m_stereo_image[channel]]*m_sound_input_gain); - m_rspeaker->set_input_gain(channel,right_gain[m_stereo_image[channel]]*m_sound_input_gain); + m_lspeaker->set_input_gain(channel, left_gain[m_stereo_image[channel]] * m_sound_input_gain); + m_rspeaker->set_input_gain(channel, right_gain[m_stereo_image[channel]] * m_sound_input_gain); //printf("%d %f %f\n",channel,m_lspeaker->input(channel).gain(),m_rspeaker->input(channel).gain()); } @@ -454,7 +456,7 @@ { // TODO: Range is between 3 and 256 usecs double sndhz = 1e6 / ((m_sound_frequency_latch & 0xff) + 2); - sndhz /= m_sound_internal_divider; + sndhz /= get_dac_mode() == true ? 2.0 : 8.0; m_sound_timer->adjust(attotime::zero, 0, attotime::from_hz(sndhz)); //printf("VIDC: audio DMA start, sound freq %d, sndhz = %f\n", (m_crtc_regs[0xc0] & 0xff)-2, sndhz); } @@ -479,17 +481,17 @@ //printf("%d %d %d %d\n",ystart, ysize, cliprect.min_y, cliprect.max_y); - for (int srcy = raster_ystart; srcy>(xi*pen_byte_size)) & pen_mask); + u16 dot = (pen >> (xi * pen_byte_size)) & pen_mask; if (is_cursor == true && dot == 0) continue; dot += pen_base; @@ -556,7 +558,11 @@ return false; } -// VIDC20 +/* + * + * VIDC20 overrides + * + */ void arm_vidc20_device::regs_map(address_map &map) { @@ -564,6 +570,7 @@ map(0x10, 0x1f).w(FUNC(arm_vidc20_device::vidc20_pal_data_index_w)); map(0x40, 0x7f).w(FUNC(arm_vidc20_device::vidc20_pal_data_cursor_w)); map(0x80, 0x9f).w(FUNC(arm_vidc20_device::vidc20_crtc_w)); +// map(0xa0, 0xa7) stereo image map(0xb0, 0xb0).w(FUNC(arm_vidc20_device::vidc20_sound_frequency_w)); map(0xb1, 0xb1).w(FUNC(arm_vidc20_device::vidc20_sound_control_w)); map(0xd0, 0xdf).w(FUNC(arm_vidc20_device::fsynreg_w)); @@ -572,6 +579,7 @@ arm_vidc20_device::arm_vidc20_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : acorn_vidc10_device(mconfig, ARM_VIDC20, tag, owner, clock, 2) + , m_dac32(*this, "serial_dac_%u", 0) { m_space_config = address_space_config("regs_space", ENDIANNESS_LITTLE, 32, 8, -2, address_map_constructor(FUNC(arm_vidc20_device::regs_map), this)); m_pal_4bpp_base = 0x000; @@ -583,8 +591,20 @@ void arm_vidc20_device::device_add_mconfig(machine_config &config) { acorn_vidc10_device::device_add_mconfig(config); - // ... - // TODO: for simplicity we may as well add separate DACs for 32-bit mode + + // FIXME: disable DACs for the time being + // so that it won't mixin with QS1000 source for ssfindo.cpp games + for (int i = 0; i < m_sound_max_channels; i++) + { + m_dac[i]->reset_routes(); + m_dac[i]->add_route(0, m_lspeaker, 0.0); + m_dac[i]->add_route(0, m_rspeaker, 0.0); + } + + // For simplicity we separate DACs for 32-bit mode + // TODO: how stereo image copes with this if at all? + DAC_16BIT_R2R_TWOS_COMPLEMENT(config, m_dac32[0], 0).add_route(ALL_OUTPUTS, m_lspeaker, 0.25); + DAC_16BIT_R2R_TWOS_COMPLEMENT(config, m_dac32[1], 0).add_route(ALL_OUTPUTS, m_rspeaker, 0.25); } void arm_vidc20_device::device_config_complete() @@ -623,13 +643,30 @@ // TODO: sensible defaults m_vco_r_modulo = 1; m_vco_v_modulo = 1; + + // make sure DACs don't output any undefined behaviour for now + // (will cause wild DC offset in ssfindo.cpp games) + for (int ch = 0; ch < 8; ch ++) + write_dac(ch, 0); + + write_dac32(0, 0); + write_dac32(1, 0); } void arm_vidc20_device::device_timer(emu_timer &timer, device_timer_id id, int param) { acorn_vidc10_device::device_timer(timer, id, param); + // TODO: other timers +} + +inline void arm_vidc20_device::refresh_stereo_image(u8 channel) +{ + // TODO: set_input_gain hampers with both QS1000 and serial DAC mode + // Best option is to move the legacy DAC handling into a separate device, + // make it proper 8 channel output while clients are responsible of mix-ins } + inline void arm_vidc20_device::update_8bpp_palette(u16 index, u32 paldata) { int r,g,b; @@ -732,7 +769,7 @@ // ---- --00: VCLK // ---- --01: HCLK // ---- --10: RCLK ("recommended" 24 MHz) - // ---- --11: undefined, prolly same as RCLK + // ---- --11: undefined, probably same as RCLK m_pixel_source = data & 3; m_pixel_rate = (data & 0x1c) >> 2; // (data & 0x700) >> 8 FIFO load @@ -750,6 +787,26 @@ { // TODO: VIDC10 mode, ext clock bit 0 m_dac_serial_mode = BIT(data, 1); + + if (m_dac_serial_mode) + { + m_dac32[0]->set_output_gain(0, 1.0); + m_dac32[1]->set_output_gain(0, 1.0); + + for (int ch = 0; ch < m_sound_max_channels; ch++) + m_dac[ch]->set_output_gain(0, 0.0); + } + else + { + m_dac32[0]->set_output_gain(0, 0.0); + m_dac32[1]->set_output_gain(0, 0.0); + + for (int ch = 0; ch < m_sound_max_channels; ch++) + { + //m_dac[ch]->set_output_gain(0, 0.0); + refresh_stereo_image(ch); + } + } } void arm_vidc20_device::vidc20_sound_frequency_w(u32 data) @@ -761,7 +818,7 @@ void arm_vidc20_device::write_dac32(u8 channel, u16 data) { - m_dac[channel & 1]->write(data); + m_dac32[channel & 1]->write(data); } bool arm_vidc20_device::get_dac_mode() @@ -774,5 +831,3 @@ // TODO: support for true color modes return acorn_vidc10_device::screen_update(screen, bitmap, cliprect); } - - diff -Nru mame-0.242+dfsg.1/src/devices/machine/acorn_vidc.h mame-0.243+dfsg.1/src/devices/machine/acorn_vidc.h --- mame-0.242+dfsg.1/src/devices/machine/acorn_vidc.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/machine/acorn_vidc.h 2022-04-29 05:37:26.000000000 +0000 @@ -46,6 +46,8 @@ void set_cursor_enable(bool state) { m_cursor_enable = state; } u32 get_cursor_size() { return (m_crtc_regs[CRTC_VCER] - m_crtc_regs[CRTC_VCSR]) * (32/4); } + virtual bool get_dac_mode() { return false; } + protected: acorn_vidc10_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int dac_type); @@ -81,7 +83,6 @@ u16 m_pal_4bpp_base; u16 m_pal_cursor_base; u16 m_pal_border_base; - const double m_sound_internal_divider = 8.0; u8 m_bpp_mode, m_crtc_interlace; u8 m_sound_frequency_latch; @@ -90,9 +91,12 @@ required_device_array m_dac; int m_dac_type; -private: required_device m_lspeaker; required_device m_rspeaker; + + virtual void refresh_stereo_image(u8 channel); + const int m_sound_max_channels = 8; +private: devcb_write_line m_vblank_cb; devcb_write_line m_sound_drq_cb; @@ -124,9 +128,7 @@ bool m_sound_frequency_test_bit; u8 m_stereo_image[8]; const float m_sound_input_gain = 0.05f; - const int m_sound_max_channels = 8; int16_t m_ulaw_lookup[256]; - inline void refresh_stereo_image(u8 channel); }; class acorn_vidc1_device : public acorn_vidc10_device @@ -154,7 +156,7 @@ arm_vidc20_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); void write_dac32(u8 channel, u16 data); - bool get_dac_mode(); + virtual bool get_dac_mode() override; protected: virtual void device_add_mconfig(machine_config &config) override; @@ -167,8 +169,6 @@ u32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); virtual u32 get_pixel_clock() override; - const double m_sound_internal_divider = 1.0; - private: void vidc20_pal_data_display_w(offs_t offset, u32 data); void vidc20_pal_data_index_w(u32 data); @@ -186,6 +186,10 @@ u8 m_pixel_rate; u8 m_vco_r_modulo; u8 m_vco_v_modulo; + + required_device_array m_dac32; + + virtual void refresh_stereo_image(u8 channel) override; }; DECLARE_DEVICE_TYPE(ARM_VIDC20, arm_vidc20_device) diff -Nru mame-0.242+dfsg.1/src/devices/machine/akiko.cpp mame-0.243+dfsg.1/src/devices/machine/akiko.cpp --- mame-0.242+dfsg.1/src/devices/machine/akiko.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/machine/akiko.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -161,21 +161,22 @@ else { // Arcade case - m_cdrom = cdrom_open(machine().rom_load().get_disk_handle(":cdrom")); + chd_file *chd = machine().rom_load().get_disk_handle(":cdrom"); + m_cdrom = chd != nullptr ? new cdrom_file(chd) : nullptr; } /* create the TOC table */ - if ( m_cdrom != nullptr && cdrom_get_last_track(m_cdrom) ) + if ( m_cdrom != nullptr && m_cdrom->get_last_track() ) { uint8_t *p; - int i, addrctrl = cdrom_get_adr_control( m_cdrom, 0 ); + int i, addrctrl = m_cdrom->get_adr_control( 0 ); uint32_t discend; - discend = cdrom_get_track_start(m_cdrom,cdrom_get_last_track(m_cdrom)-1); - discend += cdrom_get_toc(m_cdrom)->tracks[cdrom_get_last_track(m_cdrom)-1].frames; - discend = lba_to_msf(discend); + discend = m_cdrom->get_track_start(m_cdrom->get_last_track()-1); + discend += m_cdrom->get_toc().tracks[m_cdrom->get_last_track()-1].frames; + discend = cdrom_file::lba_to_msf(discend); - m_cdrom_numtracks = cdrom_get_last_track(m_cdrom)+3; + m_cdrom_numtracks = m_cdrom->get_last_track()+3; m_cdrom_toc = std::make_unique(13*m_cdrom_numtracks); memset( m_cdrom_toc.get(), 0, 13*m_cdrom_numtracks); @@ -187,7 +188,7 @@ p += 13; p[1] = 0x01; p[3] = 0xa1; /* last track */ - p[8] = cdrom_get_last_track(m_cdrom); + p[8] = m_cdrom->get_last_track(); p += 13; p[1] = 0x01; p[3] = 0xa2; /* disc end */ @@ -196,12 +197,12 @@ p[10] = discend & 0xff; p += 13; - for( i = 0; i < cdrom_get_last_track(m_cdrom); i++ ) + for( i = 0; i < m_cdrom->get_last_track(); i++ ) { - uint32_t trackpos = cdrom_get_track_start(m_cdrom,i); + uint32_t trackpos = m_cdrom->get_track_start(i); - trackpos = lba_to_msf(trackpos); - addrctrl = cdrom_get_adr_control( m_cdrom, i ); + trackpos = cdrom_file::lba_to_msf(trackpos); + addrctrl = m_cdrom->get_adr_control( i ); p[1] = ((addrctrl & 0x0f) << 4) | ((addrctrl & 0xf0) >> 4); p[3] = dec_2_bcd( i+1 ); @@ -225,8 +226,8 @@ { if( m_cdrom ) { - cdrom_close(m_cdrom); - m_cdrom = (cdrom_file *)nullptr; + delete m_cdrom; + m_cdrom = nullptr; } } } @@ -459,6 +460,9 @@ uint8_t buf[2352]; int index; + if ( m_cdrom == nullptr ) + return; + if ( (m_cdrom_dmacontrol & 0x04000000) == 0 ) return; @@ -469,11 +473,11 @@ if ( m_cdrom_readreqmask & ( 1 << index ) ) { - uint32_t track = cdrom_get_track( m_cdrom, m_cdrom_lba_cur ); - uint32_t datasize;// = cdrom_get_toc(m_cdrom)->tracks[track].datasize; - uint32_t subsize = cdrom_get_toc( m_cdrom )->tracks[track].subsize; + uint32_t track = m_cdrom->get_track( m_cdrom_lba_cur ); + uint32_t datasize;// = m_cdrom->get_toc().tracks[track].datasize; + uint32_t subsize = m_cdrom->get_toc().tracks[track].subsize; - uint32_t curmsf = lba_to_msf( m_cdrom_lba_cur ); + uint32_t curmsf = cdrom_file::lba_to_msf( m_cdrom_lba_cur ); memset( buf, 0, 16 ); buf[3] = m_cdrom_lba_cur - m_cdrom_lba_start; @@ -485,7 +489,7 @@ buf[15] = 0x01; /* mode1 */ datasize = 2048; - if ( !cdrom_read_data( m_cdrom, m_cdrom_lba_cur, &buf[16], CD_TRACK_MODE1 ) ) + if ( !m_cdrom->read_data( m_cdrom_lba_cur, &buf[16], cdrom_file::CD_TRACK_MODE1 ) ) { LOGWARN( "AKIKO: Read error trying to read sector %08x!\n", m_cdrom_lba_cur ); return; @@ -493,7 +497,7 @@ if ( subsize ) { - if ( !cdrom_read_subcode( m_cdrom, m_cdrom_lba_cur, &buf[16+datasize] ) ) + if ( !m_cdrom->read_subcode( m_cdrom_lba_cur, &buf[16+datasize] ) ) { LOGWARN( "AKIKO: Read error trying to read subcode for sector %08x!\n", m_cdrom_lba_cur ); return; @@ -695,9 +699,9 @@ LOGCD("AKIKO CD: Seek - start lba: %08x - end lba: %08x\n", startpos, endpos ); m_cdrom_track_index = 0; - for( i = 0; i < cdrom_get_last_track(m_cdrom); i++ ) + for( i = 0; i < m_cdrom->get_last_track(); i++ ) { - if ( startpos <= cdrom_get_track_start( m_cdrom, i ) ) + if ( startpos <= m_cdrom->get_track_start( i ) ) { /* reset to 0 */ m_cdrom_track_index = i + 2; @@ -726,23 +730,23 @@ (void)cdda_getstatus(&lba); - if ( lba > 0 ) + if ( lba > 0 && m_cdrom != nullptr ) { uint32_t disk_pos; uint32_t track_pos; uint32_t track; int addrctrl; - track = cdrom_get_track(m_cdrom, lba); - addrctrl = cdrom_get_adr_control(m_cdrom, track); + track = m_cdrom->get_track(lba); + addrctrl = m_cdrom->get_adr_control(track); resp[2] = 0x00; resp[3] = ((addrctrl & 0x0f) << 4) | ((addrctrl & 0xf0) >> 4); resp[4] = dec_2_bcd(track+1); resp[5] = 0; /* index */ - disk_pos = lba_to_msf(lba); - track_pos = lba_to_msf(lba - cdrom_get_track_start(m_cdrom, track)); + disk_pos = cdrom_file::lba_to_msf(lba); + track_pos = cdrom_file::lba_to_msf(lba - m_cdrom->get_track_start(track)); /* track position */ resp[6] = (track_pos >> 16) & 0xff; diff -Nru mame-0.242+dfsg.1/src/devices/machine/applefdintf.cpp mame-0.243+dfsg.1/src/devices/machine/applefdintf.cpp --- mame-0.242+dfsg.1/src/devices/machine/applefdintf.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/machine/applefdintf.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -17,7 +17,8 @@ void applefdintf_device::formats_525(format_registration &fr) { - fr.add(FLOPPY_A216S_FORMAT); + fr.add(FLOPPY_A216S_DOS_FORMAT); + fr.add(FLOPPY_A216S_PRODOS_FORMAT); fr.add(FLOPPY_RWTS18_FORMAT); fr.add(FLOPPY_EDD_FORMAT); fr.add(FLOPPY_WOZ_FORMAT); diff -Nru mame-0.242+dfsg.1/src/devices/machine/arm_iomd.cpp mame-0.243+dfsg.1/src/devices/machine/arm_iomd.cpp --- mame-0.242+dfsg.1/src/devices/machine/arm_iomd.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/machine/arm_iomd.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -259,8 +259,6 @@ save_item(NAME(m_sndend)); save_item(NAME(m_sound_dma_on)); save_item(NAME(m_sndcur_buffer)); - save_item(NAME(m_snd_overrun)); - save_item(NAME(m_snd_int)); save_pointer(NAME(m_sndcur_reg), sounddma_ch_size); save_pointer(NAME(m_sndend_reg), sounddma_ch_size); @@ -303,11 +301,11 @@ m_irq_mask[i] = 0; } - for (i=0; iadjust(attotime::never); m_sound_dma_on = false; - for (i=0; i u32 arm_iomd_device::sdcur_r() { return m_sndcur_reg[Which]; } @@ -572,6 +568,7 @@ m_sndend_reg[Which] &= 0x00fffff0; m_sndstop_reg[Which] = BIT(data, 31); m_sndlast_reg[Which] = BIT(data, 30); + m_sndbuffer_ok[Which] = true; } u32 arm_iomd_device::sdcr_r() @@ -594,12 +591,19 @@ // ... } - // TODO: bit 7 resets sound DMA + // TODO: sound DMA reset + // eats samples in ppcar +// if (BIT(data, 7)) +// m_sndbuffer_ok[0] = m_sndbuffer_ok[1] = false; } u32 arm_iomd_device::sdst_r() { - return (m_snd_overrun << 2) | (m_snd_int << 1) | m_sndcur_buffer; + // TODO: confirm implementation + bool sound_overrun = m_sndbuffer_ok[0] == false && m_sndbuffer_ok[1] == false; + bool sound_int = m_sndbuffer_ok[0] == false || m_sndbuffer_ok[1] == false; + + return (sound_overrun << 2) | (sound_int << 1) | m_sndcur_buffer; } // video DMA @@ -706,11 +710,7 @@ { m_sndcur = m_sndcur_reg[m_sndcur_buffer]; m_sndend = m_sndcur + (m_sndend_reg[m_sndcur_buffer] + 0x10); - m_sndbuffer_ok[m_sndcur_buffer] = true; - - // TODO: actual condition for int - m_snd_overrun = false; - m_snd_int = false; +// m_sndbuffer_ok[m_sndcur_buffer] = true; } WRITE_LINE_MEMBER( arm_iomd_device::sound_drq ) @@ -720,21 +720,21 @@ if (m_vidc->get_dac_mode() == true) { - for (int ch=0;ch<2;ch++) + if (!m_sndbuffer_ok[m_sndcur_buffer]) + return; + + for (int ch = 0; ch < 2; ch++) m_vidc->write_dac32(ch, (m_host_space->read_word(m_sndcur + ch*2))); m_sndcur += 4; if (m_sndcur >= m_sndend) { - // TODO: interrupt bit - m_vidc->update_sound_mode(m_sound_dma_on); if (m_sound_dma_on) { m_sndbuffer_ok[m_sndcur_buffer] = false; m_sndcur_buffer ^= 1; - m_snd_overrun = (m_sndbuffer_ok[m_sndcur_buffer] == false); sounddma_swap_buffer(); } else diff -Nru mame-0.242+dfsg.1/src/devices/machine/arm_iomd.h mame-0.243+dfsg.1/src/devices/machine/arm_iomd.h --- mame-0.242+dfsg.1/src/devices/machine/arm_iomd.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/machine/arm_iomd.h 2022-04-29 05:37:26.000000000 +0000 @@ -118,13 +118,12 @@ void cursinit_w(offs_t offset, u32 data, u32 mem_mask = ~0); static constexpr int sounddma_ch_size = 2; - u32 m_sndcur, m_sndend; - u32 m_sndcur_reg[sounddma_ch_size], m_sndend_reg[sounddma_ch_size]; - bool m_sndstop_reg[sounddma_ch_size], m_sndlast_reg[sounddma_ch_size]; - bool m_sndbuffer_ok[sounddma_ch_size]; - bool m_sound_dma_on; - u8 m_sndcur_buffer; - bool m_snd_overrun, m_snd_int; + u32 m_sndcur = 0, m_sndend = 0; + u32 m_sndcur_reg[sounddma_ch_size]{}, m_sndend_reg[sounddma_ch_size]{}; + bool m_sndstop_reg[sounddma_ch_size]{}, m_sndlast_reg[sounddma_ch_size]{}; + bool m_sndbuffer_ok[sounddma_ch_size]{}; + bool m_sound_dma_on = false; + u8 m_sndcur_buffer = 0; inline void sounddma_swap_buffer(); template u32 sdcur_r(); template void sdcur_w(offs_t offset, u32 data, u32 mem_mask = ~0); diff -Nru mame-0.242+dfsg.1/src/devices/machine/ataflash.cpp mame-0.243+dfsg.1/src/devices/machine/ataflash.cpp --- mame-0.242+dfsg.1/src/devices/machine/ataflash.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/machine/ataflash.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -20,13 +20,11 @@ { ide_hdd_device::device_reset(); - uint32_t metalength; - memset(m_cis, 0xff, 512); - - if (m_handle != nullptr) + if (m_disk) { - m_handle->read_metadata(PCMCIA_CIS_METADATA_TAG, 0, m_cis, 512, metalength); + m_disk->get_cis_data(m_cis); } + m_cis.resize(512, 0xff); m_configuration_option = 0; m_configuration_and_status = 0; @@ -137,13 +135,11 @@ { ata_flash_pccard_device::device_reset(); - uint32_t metalength; - memset(m_key, 0, sizeof(m_key)); - - if (m_handle && !m_handle->read_metadata(HARD_DISK_KEY_METADATA_TAG, 0, m_key, 5, metalength)) + if (m_disk && !m_disk->get_disk_key_data(m_key) && m_key.size() == 5) { m_locked = 0x1ff; } + m_key.resize(5, 0); } uint16_t taito_pccard1_device::read_reg(offs_t offset, uint16_t mem_mask) @@ -164,7 +160,7 @@ { uint8_t v = data; int pos = offset - 0x280; - uint8_t k = pos < sizeof(m_key) ? m_key[pos] : 0; + uint8_t k = pos < m_key.size() ? m_key[pos] : 0; // TODO: find out if unlocking the key then using an incorrect key will re-lock the card. if (v == k) @@ -228,13 +224,11 @@ { ata_flash_pccard_device::device_reset(); - uint32_t metalength; - memset(m_key, 0, sizeof(m_key)); - - if (m_handle && !m_handle->read_metadata(HARD_DISK_KEY_METADATA_TAG, 0, m_key, 5, metalength)) + if (m_disk && !m_disk->get_disk_key_data(m_key) && m_key.size() == 5) { m_locked = true; } + m_key.resize(5, 0); } void taito_pccard2_device::process_command() @@ -327,13 +321,11 @@ { ata_flash_pccard_device::device_reset(); - uint32_t metalength; - memset(m_key, 0, sizeof(m_key)); - - if (m_handle && !m_handle->read_metadata(HARD_DISK_KEY_METADATA_TAG, 0, m_key, 5, metalength)) + if (m_disk && !m_disk->get_disk_key_data(m_key) && m_key.size() == 5) { m_locked = true; } + m_key.resize(5, 0); } void taito_compact_flash_device::process_command() diff -Nru mame-0.242+dfsg.1/src/devices/machine/ataflash.h mame-0.243+dfsg.1/src/devices/machine/ataflash.h --- mame-0.242+dfsg.1/src/devices/machine/ataflash.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/machine/ataflash.h 2022-04-29 05:37:26.000000000 +0000 @@ -30,7 +30,7 @@ uint8_t calculate_status() override { return ata_hle_device::calculate_status(); } private: - uint8_t m_cis[512]; + std::vector m_cis; uint8_t m_configuration_option; uint8_t m_configuration_and_status; uint8_t m_pin_replacement; @@ -53,7 +53,7 @@ virtual bool is_ready() override; private: - uint8_t m_key[5]; + std::vector m_key; uint16_t m_locked; }; @@ -75,7 +75,7 @@ static const int IDE_COMMAND_TAITO_GNET_UNLOCK_2 = 0xfc; private: - uint8_t m_key[5]; + std::vector m_key; bool m_locked; }; @@ -95,7 +95,7 @@ static constexpr int IDE_COMMAND_TAITO_COMPACT_FLASH_UNLOCK = 0x0f; private: - uint8_t m_key[5]; + std::vector m_key; bool m_locked; }; diff -Nru mame-0.242+dfsg.1/src/devices/machine/corvushd.cpp mame-0.243+dfsg.1/src/devices/machine/corvushd.cpp --- mame-0.242+dfsg.1/src/devices/machine/corvushd.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/machine/corvushd.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -444,12 +444,12 @@ // wonderful functionality. // if(len == 512) { - hard_disk_write(disk, sector, buffer); + disk->write(sector, buffer); } else { - hard_disk_read(disk, sector, tbuffer); // Read the existing data into our temporary buffer + disk->read(sector, tbuffer); // Read the existing data into our temporary buffer memcpy(tbuffer, buffer, len); // Overlay the data with the buffer passed m_delay += INTERSECTOR_DELAY; // Add another delay because of the Read / Write - hard_disk_write(disk, sector, tbuffer); // Re-write the data + disk->write(sector, tbuffer); // Re-write the data } m_last_cylinder = cylinder; @@ -545,7 +545,7 @@ cylinder = (double) sector / (double) m_sectors_per_track / (double) m_tracks_per_cylinder; m_delay = abs(m_last_cylinder - cylinder) * TRACK_SEEK_TIME + INTERSECTOR_DELAY; - hard_disk_read(disk, sector, tbuffer); + disk->read(sector, tbuffer); memcpy(buffer, tbuffer, len); @@ -1119,12 +1119,12 @@ // Pick up the Head/Cylinder/Sector info hard_disk_file *file = img->get_hard_disk_file(); - hard_disk_info *info = hard_disk_get_info(file); - m_sectors_per_track = info->sectors; - m_tracks_per_cylinder = info->heads; - m_cylinders_per_drive = info->cylinders; + const auto &info = file->get_info(); + m_sectors_per_track = info.sectors; + m_tracks_per_cylinder = info.heads; + m_cylinders_per_drive = info.cylinders; - LOG(("corvus_hdc_file: Attached to drive %u image: H:%d, C:%d, S:%d\n", drv, info->heads, info->cylinders, info->sectors)); + LOG(("corvus_hdc_file: Attached to drive %u image: H:%d, C:%d, S:%d\n", drv, info.heads, info.cylinders, info.sectors)); return file; } diff -Nru mame-0.242+dfsg.1/src/devices/machine/diablo_hd.cpp mame-0.243+dfsg.1/src/devices/machine/diablo_hd.cpp --- mame-0.242+dfsg.1/src/devices/machine/diablo_hd.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/machine/diablo_hd.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -102,7 +102,6 @@ m_sector_callback(nullptr), m_timer(nullptr), m_image(nullptr), - m_handle(nullptr), m_disk(nullptr) { memset(m_description, 0x00, sizeof(m_description)); @@ -312,7 +311,7 @@ // allocate a buffer for this page m_cache[m_page] = std::make_unique(sizeof(diablo_sector_t)); // and read the page from the hard_disk image - if (hard_disk_read(m_disk, m_page, m_cache[m_page].get())) { + if (m_disk->read(m_page, m_cache[m_page].get())) { LOG_DRIVE(2,"[DHD%u] CHS:%03d/%d/%02d => page:%d loaded\n", m_unit, m_cylinder, m_head, m_sector, m_page); } else { LOG_DRIVE(0,"[DHD%u] CHS:%03d/%d/%02d => page:%d read failed\n", m_unit, m_cylinder, m_head, m_sector, m_page); @@ -770,7 +769,7 @@ m_bits[m_page].reset(); if (m_disk) { - if (!hard_disk_write(m_disk, m_page, m_cache[m_page].get())) { + if (!m_disk->write(m_page, m_cache[m_page].get())) { LOG_DRIVE(0,"[DHD%u] write failed for page #%d\n", m_unit, m_page); } } else { @@ -1328,8 +1327,7 @@ m_cache[page] = nullptr; // free previous bits cache m_bits.reset(); - m_handle = m_image->get_chd_file(); - m_diablo31 = true; // FIXME: get from m_handle meta data? + m_diablo31 = true; // FIXME: get from disk meta data? m_disk = m_image->get_hard_disk_file(); if (m_diablo31) { snprintf(m_description, sizeof(m_description), "DIABLO31"); @@ -1350,7 +1348,6 @@ m_cylinders = 2 * DIABLO_CYLINDERS; m_pages = 2 * DIABLO_PAGES; } - LOG_DRIVE(0,"[DHD%u] m_handle : %p\n", m_unit, reinterpret_cast(m_handle)); LOG_DRIVE(0,"[DHD%u] m_disk : %p\n", m_unit, reinterpret_cast(m_disk)); LOG_DRIVE(0,"[DHD%u] rotation time : %.0fns\n", m_unit, m_rotation_time.as_double() * ATTOSECONDS_PER_NANOSECOND); LOG_DRIVE(0,"[DHD%u] sector time : %.0fns\n", m_unit, m_sector_time.as_double() * ATTOSECONDS_PER_NANOSECOND); @@ -1385,7 +1382,7 @@ m_rdfirst = -1; m_rdlast = -1; - if (!m_handle) + if (!m_image) return; // for units with a CHD assigned to them start the timer m_bits = std::make_unique[]>(m_pages); diff -Nru mame-0.242+dfsg.1/src/devices/machine/diablo_hd.h mame-0.243+dfsg.1/src/devices/machine/diablo_hd.h --- mame-0.242+dfsg.1/src/devices/machine/diablo_hd.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/machine/diablo_hd.h 2022-04-29 05:37:26.000000000 +0000 @@ -110,7 +110,6 @@ void (*m_sector_callback)(void*,int); //!< callback to call at the start of each sector emu_timer* m_timer; //!< sector timer diablo_image_device* m_image; //!< diablo_image_device interfacing the CHD - chd_file* m_handle; //!< underlying CHD handle hard_disk_file* m_disk; //!< underlying hard disk file //! translate C/H/S to a page and read the sector diff -Nru mame-0.242+dfsg.1/src/devices/machine/gt64xxx.cpp mame-0.243+dfsg.1/src/devices/machine/gt64xxx.cpp --- mame-0.242+dfsg.1/src/devices/machine/gt64xxx.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/machine/gt64xxx.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -8,6 +8,7 @@ #define LOG_TIMERS (1U << 2) #define LOG_DMA (1U << 3) #define LOG_PCI (1U << 4) +#define LOG_IRQ (1U << 5) //#define VERBOSE (LOG_GENERAL | LOG_GALILEO | LOG_TIMERS | LOG_DMA | LOG_PCI) #include "logmacro.h" @@ -16,26 +17,28 @@ #define LOGTIMERS(...) LOGMASKED(LOG_TIMERS, __VA_ARGS__) #define LOGDMA(...) LOGMASKED(LOG_DMA, __VA_ARGS__) #define LOGPCI(...) LOGMASKED(LOG_PCI, __VA_ARGS__) +#define LOGIRQ(...) LOGMASKED(LOG_IRQ, __VA_ARGS__) -/************************************* - * - * Galileo constants - * - *************************************/ +//************************************ +// +// Galileo constants +// +//************************************ #define TIMER_PERIOD attotime::from_hz(clock()) #define PCI_BUS_CLOCK 33000000 -// Number of dma words to transfer at a time, real hardware configurable between 8-32 +// Number of dma words (32 bits) to transfer at a time, real hardware configurable between 8-32 #define DMA_BURST_SIZE 32 -#define DMA_TIMER_PERIOD attotime::from_hz(PCI_BUS_CLOCK / 48) +// DMA will transfer up to DMA_BURST_SIZE*4 bytes every DMA_TIMER_PERIOD seconds +#define DMA_TIMER_PERIOD attotime::from_hz(PCI_BUS_CLOCK / 64) -/* Galileo registers - 0x000-0x3ff */ +// Galileo registers - 0x000-0x3ff #define GREG_CPU_CONFIG (0x000/4) -#define GREG_R1_0_LO (0x008/4) -#define GREG_R1_0_HI (0x010/4) -#define GREG_R3_2_LO (0x018/4) -#define GREG_R3_2_HI (0x020/4) +#define GREG_R1_0_LO (0x008/4) +#define GREG_R1_0_HI (0x010/4) +#define GREG_R3_2_LO (0x018/4) +#define GREG_R3_2_HI (0x020/4) #define GREG_CS_2_0_LO (0x028/4) #define GREG_CS_2_0_HI (0x030/4) #define GREG_CS_3_BOOT_LO (0x038/4) @@ -51,7 +54,7 @@ #define GREG_PCI_MEM1_LO (0x080/4) #define GREG_PCI_MEM1_HI (0x088/4) -/* Galileo registers - 0x400-0x7ff */ +// Galileo registers - 0x400-0x7ff #define GREG_RAS0_LO (0x400/4) #define GREG_RAS0_HI (0x404/4) #define GREG_RAS1_LO (0x408/4) @@ -82,7 +85,7 @@ #define GREG_DEVICE_BOOT (0x46c/4) #define GREG_ADDRESS_ERROR (0x470/4) -/* Galileo registers - 0x800-0xbff */ +// Galileo registers - 0x800-0xbff #define GREG_DMA0_COUNT (0x800/4) #define GREG_DMA1_COUNT (0x804/4) #define GREG_DMA2_COUNT (0x808/4) @@ -110,20 +113,20 @@ #define GREG_DMA_ARBITER (0x860/4) #define GREG_TIMER_CONTROL (0x864/4) -/* Galileo registers - 0xc00-0xfff */ +// Galileo registers - 0xc00-0xfff #define GREG_PCI_COMMAND (0xc00/4) #define GREG_PCI_TIMEOUT (0xc04/4) -#define GREG_PCI_R1_0 (0xc08/4) -#define GREG_PCI_R3_2 (0xc0c/4) +#define GREG_PCI_R1_0 (0xc08/4) +#define GREG_PCI_R3_2 (0xc0c/4) #define GREG_PCI_CS_2_0 (0xc10/4) #define GREG_PCI_CS_3_BOOT (0xc14/4) -#define GREG_INT_STATE (0xc18/4) -#define GREG_INT_MASK (0xc1c/4) -#define GREG_PCI_INT_MASK (0xc24/4) +#define GREG_INTR_CAUSE (0xc18/4) +#define GREG_CPU_MASK (0xc1c/4) +#define GREG_PCI_MASK (0xc24/4) #define GREG_CONFIG_ADDRESS (0xcf8/4) #define GREG_CONFIG_DATA (0xcfc/4) -/* Galileo interrupts */ +// Galileo interrupts #define GINT_SUMMARY_SHIFT (0) #define GINT_MEMOUT_SHIFT (1) #define GINT_DMAOUT_SHIFT (2) @@ -227,13 +230,15 @@ LOGGALILEO("gt64xxx_device::device_start UPDATE Mapped size: 0x%08X start: 0x1fd00000 end: %08X\n", romSize, 0x1fd00000 + romSize - 1); } - /* allocate timers for the galileo */ + // allocate timers for the galileo m_timer[0].timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gt64xxx_device::timer_callback), this)); m_timer[1].timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gt64xxx_device::timer_callback), this)); m_timer[2].timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gt64xxx_device::timer_callback), this)); m_timer[3].timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gt64xxx_device::timer_callback), this)); // Save states + save_item(NAME(m_irq_pending)); + save_item(NAME(m_irq_state)); save_item(NAME(m_pci_stall_state)); save_item(NAME(m_retry_count)); save_item(NAME(m_pci_cpu_stalled)); @@ -306,6 +311,8 @@ map_cpu_space(); regenerate_config_mapping(); + m_irq_pending = 0; + m_irq_state = CLEAR_LINE; m_pci_stall_state = 0; m_retry_count = 0; m_pci_cpu_stalled = 0; @@ -479,13 +486,13 @@ m_stall_windex--; index++; } - /* resume CPU execution */ + // resume CPU execution machine().scheduler().trigger(45678); - LOGGALILEO("Resuming CPU on PCI Stall\n"); + LOGMASKED(LOG_GALILEO | LOG_PCI | LOG_DMA, "Resuming CPU on PCI Stall\n"); } } - /* set the new state */ + // set the new state m_pci_stall_state = state; } @@ -520,7 +527,7 @@ m_stall_windex++; // Stall cpu until trigger m_cpu_space->device().execute().spin_until_trigger(45678); - LOGMASKED(LOG_GALILEO | LOG_PCI, "%s Stalling CPU on PCI Stall\n", machine().describe_context()); + LOGMASKED(LOG_GALILEO | LOG_PCI | LOG_DMA, "%s Stalling CPU on PCI Stall\n", machine().describe_context()); } else { fatalerror("master_mem0_w: m_stall_windex full\n"); @@ -621,7 +628,7 @@ { uint32_t result = m_reg[offset]; - /* switch off the offset for special cases */ + // switch off the offset for special cases switch (offset) { case GREG_TIMER0_COUNT: @@ -660,10 +667,16 @@ result = config_address_r(); break; - case GREG_INT_STATE: - case GREG_INT_MASK: + case GREG_INTR_CAUSE: + LOGIRQ("%s Galileo GREG_INTR_CAUSE read from offset %03X = %08X\n", machine().describe_context(), offset * 4, result); + break; + + case GREG_CPU_MASK: + LOGGALILEO("%s Galileo GREG_CPU_MASK read from offset %03X = %08X\n", machine().describe_context(), offset*4, result); + break; + case GREG_TIMER_CONTROL: -// LOGGALILEO("%s Galileo read from offset %03X = %08X\n", machine().describe_context(), offset*4, result); + LOGTIMERS("%s Galileo read from offset %03X = %08X\n", machine().describe_context(), offset*4, result); break; default: @@ -686,7 +699,7 @@ uint32_t oldata = m_reg[offset]; COMBINE_DATA(&m_reg[offset]); - /* switch off the offset for special cases */ + // switch off the offset for special cases switch (offset) { case GREG_R1_0_LO: @@ -717,25 +730,33 @@ { int which = offset % 4; - /* keep the read only activity bit */ + // keep the read only activity bit m_reg[offset] &= ~0x4000; m_reg[offset] |= (oldata & 0x4000); - /* fetch next record */ + // fetch next record if (data & 0x2000) dma_fetch_next(space, which); m_reg[offset] &= ~0x2000; - /* if enabling, start the DMA */ + // if enabling, start the DMA if (!(oldata & 0x1000) && (data & 0x1000) && !(m_dma_active & (1<adjust(attotime::zero, 0, DMA_TIMER_PERIOD); + m_dma_timer->adjust(DMA_TIMER_PERIOD, 0, DMA_TIMER_PERIOD); m_dma_active |= (1<< which); //perform_dma(space, which); LOGDMA("%s Galileo starting DMA Chan %i\n", machine().describe_context(), which); } + if ((oldata & 0x1000) && !(data & 0x1000) && (m_dma_active & (1 << which))) + { + m_dma_active &= ~(1 << which); + // Turn off the timer + m_dma_timer->adjust(attotime::never); + LOGDMA("%s Galileo stopping DMA Chan %i\n", machine().describe_context(), which); + } + LOGGALILEO("%s Galileo write to offset %03X = %08X & %08X\n", machine().describe_context(), offset * 4, data, mem_mask); break; } @@ -774,7 +795,7 @@ timer->count &= 0xffffff; } timer->timer->adjust(TIMER_PERIOD * timer->count, which); - LOGTIMERS("Adjusted timer to fire in %f secs\n", (TIMER_PERIOD * timer->count).as_double()); + LOGTIMERS("Adjusted timer%d to fire in %f secs\n", which, (TIMER_PERIOD * timer->count).as_double()); } else if (timer->active && !(data & mask)) { @@ -782,18 +803,25 @@ timer->active = 0; timer->count = (timer->count > elapsed) ? (timer->count - elapsed) : 0; timer->timer->adjust(attotime::never, which); - LOGTIMERS("Disabled timer\n"); + LOGTIMERS("Disabled timer%d\n", which); } } break; } - case GREG_INT_STATE: - LOGGALILEO("%s Galileo write to IRQ clear = %08X & %08X\n", offset*4, data, mem_mask); + case GREG_INTR_CAUSE: + LOGIRQ("%s Galileo GREG_INTR_CAUSE write to offset %03X = %08X & %08X\n", machine().describe_context(), offset * 4, data, mem_mask); m_reg[offset] = oldata & data; update_irqs(); break; + case GREG_CPU_MASK: + LOGGALILEO("%s Galileo GREG_CPU_MASK write to offset %03X = %08X & %08X\n", machine().describe_context(), offset * 4, data, mem_mask); + // Bits 0, 25:21, 31:30 are read only '0' + m_reg[offset] &= 0x3c1ffffe; + update_irqs(); + break; + case GREG_CONFIG_DATA: pci_host_device::config_data_w(offset, data); LOGGALILEO("%s Galileo PCI config data write to offset %03X = %08X & %08X\n", machine().describe_context(), offset*4, data, mem_mask); @@ -829,7 +857,6 @@ case GREG_DMA0_SOURCE: case GREG_DMA1_SOURCE: case GREG_DMA2_SOURCE: case GREG_DMA3_SOURCE: case GREG_DMA0_DEST: case GREG_DMA1_DEST: case GREG_DMA2_DEST: case GREG_DMA3_DEST: case GREG_DMA0_NEXT: case GREG_DMA1_NEXT: case GREG_DMA2_NEXT: case GREG_DMA3_NEXT: - case GREG_INT_MASK: LOGGALILEO("%s Galileo write to offset %03X = %08X & %08X\n", machine().describe_context(), offset*4, data, mem_mask); break; @@ -839,39 +866,65 @@ } } -/************************************* - * - * Galileo timers & interrupts - * - *************************************/ +//************************************ +// +// Galileo timers & interrupts +// +//************************************ void gt64xxx_device::update_irqs() { + // Set cause from pending only if current irq state is clear + // seattle hyprdriv freezes (MT07568) if a DMA0 interrupt is sent while the processor is already in the exception handler + if (!m_irq_state) + { + m_reg[GREG_INTR_CAUSE] = m_irq_pending; + m_irq_pending = 0; + // Set interrupt summary bit + if (m_reg[GREG_INTR_CAUSE] & 0xfffffffe) + m_reg[GREG_INTR_CAUSE] |= (1 << 0); + else + m_reg[GREG_INTR_CAUSE] &= ~(1 << 0); + + // set CPU interrupt summary of bits 29:26, 20:1 + if (m_reg[GREG_INTR_CAUSE] & m_reg[GREG_CPU_MASK] & 0x3c1ffffe) + m_reg[GREG_INTR_CAUSE] |= (1 << 30); + else + m_reg[GREG_INTR_CAUSE] &= ~(1 << 30); + } + // if any unmasked interrupts are active, we generate int state = CLEAR_LINE; - - /* if any unmasked interrupts are live, we generate */ - if (m_reg[GREG_INT_STATE] & m_reg[GREG_INT_MASK]) + if (m_reg[GREG_INTR_CAUSE] & m_reg[GREG_CPU_MASK]) state = ASSERT_LINE; - if (m_irq_num != -1) + + if (m_irq_num != -1 && state != m_irq_state) + { m_cpu->set_input_line(m_irq_num, state); + m_irq_state = state; + LOGIRQ("gt64xxx_device IRQ %s irqNum: %i cause = %08X mask = %08X time: %s\n", (state == ASSERT_LINE) ? "asserted" : "cleared", m_irq_num, m_reg[GREG_INTR_CAUSE], m_reg[GREG_CPU_MASK], machine().time().as_string()); + } - LOGGALILEO("Galileo IRQ %s irqNum: %i state = %08X mask = %08X\n", (state == ASSERT_LINE) ? "asserted" : "cleared", m_irq_num, m_reg[GREG_INT_STATE], m_reg[GREG_INT_MASK]); + // Run again if we cleared and there are new interrupts pending + if (!state && m_irq_pending) + { + LOGIRQ("gt64xxx_device new irq pending %08x time: %s\n", m_irq_pending, machine().time().as_string()); + update_irqs(); + } } - TIMER_CALLBACK_MEMBER(gt64xxx_device::timer_callback) { int which = param; galileo_timer *timer = &m_timer[which]; - LOGTIMERS("timer %d fired\n", which); + LOGTIMERS("timer%d fired at time %s\n", which, machine().time().as_string()); - /* copy the start value from the registers */ + // copy the start value from the registers timer->count = m_reg[GREG_TIMER0_COUNT + which]; if (which != 0) timer->count &= 0xffffff; - /* if we're a timer, adjust the timer to fire again */ + // if we're a timer, adjust the timer to fire again if (m_reg[GREG_TIMER_CONTROL] & (2 << (2 * which))) { // unsure what a 0-length timer should do, but it produces an infinite loop so guard against it @@ -883,8 +936,9 @@ else timer->active = timer->count = 0; - /* trigger the interrupt */ - m_reg[GREG_INT_STATE] |= 1 << (GINT_T0EXP_SHIFT + which); + // trigger the interrupt + //m_reg[GREG_INTR_CAUSE] |= 1 << (GINT_T0EXP_SHIFT + which); + m_irq_pending |= 1 << (GINT_T0EXP_SHIFT + which); update_irqs(); } @@ -908,35 +962,30 @@ offs_t address = 0; uint32_t data; - /* no-op for unchained mode */ + // no-op for unchained mode if (!(m_reg[GREG_DMA0_CONTROL + which] & 0x200)) address = m_reg[GREG_DMA0_NEXT + which]; - /* if we hit the end address, signal an interrupt */ + // exit if we hit the end address if (address == 0) { - if (m_reg[GREG_DMA0_CONTROL + which] & 0x400) - { - m_reg[GREG_INT_STATE] |= 1 << (GINT_DMA0COMP_SHIFT + which); - update_irqs(); - } m_reg[GREG_DMA0_CONTROL + which] &= ~0x5000; return 0; } - /* fetch the byte count */ + // fetch the byte count data = space.read_dword(address); address += 4; m_reg[GREG_DMA0_COUNT + which] = data; - /* fetch the source address */ + // fetch the source address data = space.read_dword(address); address += 4; m_reg[GREG_DMA0_SOURCE + which] = data; - /* fetch the dest address */ + // fetch the dest address data = space.read_dword(address); address += 4; m_reg[GREG_DMA0_DEST + which] = data; - /* fetch the next record address */ + // fetch the next record address data = space.read_dword(address); address += 4; m_reg[GREG_DMA0_NEXT + which] = data; return 1; @@ -960,7 +1009,8 @@ if (which==-1) { logerror("gt64xxx_device::perform_dma Warning! DMA Timer called with no pending DMA. m_dma_active = %08X\n", m_dma_active); - } else + } + else { offs_t srcaddr = m_reg[GREG_DMA0_SOURCE + which]; offs_t dstaddr = m_reg[GREG_DMA0_DEST + which]; @@ -972,7 +1022,7 @@ m_reg[GREG_DMA0_CONTROL + which] |= 0x5000; - /* determine src/dst inc */ + // determine src/dst inc switch ((m_reg[GREG_DMA0_CONTROL + which] >> 2) & 3) { default: @@ -988,36 +1038,39 @@ case 2: dstinc = 0; break; } - LOGDMA("Performing DMA%d: src=%08X dst=%08X bytes=%04X sinc=%d dinc=%d\n", which, srcaddr, dstaddr, bytesleft, srcinc, dstinc); - - int burstCount = 0; - /* standard transfer */ - while (bytesleft > 0 && burstCount < DMA_BURST_SIZE) + // check for pci stall + if (m_pci_stall_state) { - if (m_pci_stall_state) + uint32_t configRetryCount = (m_reg[GREG_PCI_TIMEOUT] >> 16) & 0xff; + m_retry_count++; + if (m_retry_count < 4) + LOGDMA("%s Stalling DMA on voodoo retry_count: %i max: %i time: %s\n", machine().describe_context(), m_retry_count, configRetryCount, machine().time().as_string()); + if (configRetryCount == 0) { - if (m_retry_count<4) LOGDMA("%s Stalling DMA on voodoo retry_count: %i\n", machine().describe_context(), m_retry_count); - // Save info - m_reg[GREG_DMA0_SOURCE + which] = srcaddr; - m_reg[GREG_DMA0_DEST + which] = dstaddr; - m_reg[GREG_DMA0_COUNT + which] = (m_reg[GREG_DMA0_COUNT + which] & ~0xffff) | bytesleft; - - m_retry_count++; - uint32_t configRetryCount = (m_reg[GREG_PCI_TIMEOUT] >> 16) & 0xff; - if (m_retry_count >= configRetryCount && configRetryCount > 0) - { - logerror("gt64xxx_device::perform_dma Error! Too many PCI retries. DMA%d: src=%08X dst=%08X bytes=%04X sinc=%d dinc=%d\n", which, srcaddr, dstaddr, bytesleft, srcinc, dstinc); - // Signal error and abort DMA - m_dma_active &= ~(1 << which); - m_retry_count = 0; - return; - } - else - { - // Come back later - return; - } + // Almost infinite retries, but avoid hanging the machine + if (configRetryCount == ~0x0) + fatalerror("gt64xxx_device::perform_dma Error! PCI is hung. DMA%d: src=%08X dst=%08X bytes=%04X sinc=%d dinc=%d\n", which, srcaddr, dstaddr, bytesleft, srcinc, dstinc); } + else if (m_retry_count >= configRetryCount) + { + logerror("gt64xxx_device::perform_dma Error! Too many PCI retries. DMA%d: src=%08X dst=%08X bytes=%04X sinc=%d dinc=%d\n", which, srcaddr, dstaddr, bytesleft, srcinc, dstinc); + // Signal error and abort DMA + m_dma_active &= ~(1 << which); + m_retry_count = 0; + // Turn off the timer + m_dma_timer->adjust(attotime::never); + // Set the RetryCtr interrupt + m_irq_pending |= 1 << (GINT_DMA0COMP_SHIFT + which); + update_irqs(); + } + return; + } + + // do the transfer + LOGDMA("gt64xxx_device: Starting DMA%d: src=%08X dst=%08X bytes=%04X sinc=%d dinc=%d time=%s\n", which, srcaddr, dstaddr, bytesleft, srcinc, dstinc, machine().time().as_string()); + int burstCount = 0; + while (bytesleft > 0 && burstCount < DMA_BURST_SIZE && !m_pci_stall_state) + { if (bytesleft < 4) { dstSpace->write_byte(dstaddr, srcSpace->read_byte(srcaddr)); @@ -1025,7 +1078,8 @@ dstaddr += dstinc; bytesleft--; } - else { + else + { dstSpace->write_dword(dstaddr, srcSpace->read_dword(srcaddr)); srcaddr += srcinc * 4; dstaddr += dstinc * 4; @@ -1033,29 +1087,37 @@ } burstCount++; } - /* not verified, but seems logical these should be updated byte the end */ + // not verified, but seems logical these should be updated at the end m_reg[GREG_DMA0_SOURCE + which] = srcaddr; m_reg[GREG_DMA0_DEST + which] = dstaddr; m_reg[GREG_DMA0_COUNT + which] = (m_reg[GREG_DMA0_COUNT + which] & ~0xffff) | bytesleft; - /* if we did not hit zero, punt and return later */ - if (bytesleft != 0) - { - return; - } - /* interrupt? */ - if (!(m_reg[GREG_DMA0_CONTROL + which] & 0x400)) + // Check if we are done this descriptor + if (bytesleft == 0) { - m_reg[GREG_INT_STATE] |= 1 << (GINT_DMA0COMP_SHIFT + which); - update_irqs(); - } + // byte count zero interrupt + if (!(m_reg[GREG_DMA0_CONTROL + which] & (1 << 10))) + { + m_irq_pending |= 1 << (GINT_DMA0COMP_SHIFT + which); + update_irqs(); + } - // Fetch the next dma for this channel (to be performed next scheduled burst) - if (dma_fetch_next(*m_cpu_space, which) == 0) - { - m_dma_active &= ~(1 << which); - // Turn off the timer - m_dma_timer->adjust(attotime::never); + // Fetch the next dma for this channel (to be performed next scheduled burst) + if ((m_reg[GREG_DMA0_CONTROL + which] & (1 << 9)) || dma_fetch_next(*m_cpu_space, which) == 0) + { + LOGDMA("gt64xxx_device: Done DMA descriptors time: %s\n", machine().time().as_string()); + m_dma_active &= ~(1 << which); + + // Turn off the timer + m_dma_timer->adjust(attotime::never); + + // no more descriptors interrupt (bit 10) in chained mode (not bit 9) + if ((m_reg[GREG_DMA0_CONTROL + which] & (1 << 10)) && !(m_reg[GREG_DMA0_CONTROL + which] & (1 << 9))) + { + m_irq_pending |= 1 << (GINT_DMA0COMP_SHIFT + which); + update_irqs(); + } + } } } } diff -Nru mame-0.242+dfsg.1/src/devices/machine/gt64xxx.h mame-0.243+dfsg.1/src/devices/machine/gt64xxx.h --- mame-0.242+dfsg.1/src/devices/machine/gt64xxx.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/machine/gt64xxx.h 2022-04-29 05:37:26.000000000 +0000 @@ -104,6 +104,8 @@ int m_irq_num; int m_simm_size[4]; + int m_irq_state; + uint32_t m_irq_pending; int m_pci_stall_state; int m_retry_count; int m_pci_cpu_stalled; diff -Nru mame-0.242+dfsg.1/src/devices/machine/i8214.cpp mame-0.243+dfsg.1/src/devices/machine/i8214.cpp --- mame-0.242+dfsg.1/src/devices/machine/i8214.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/machine/i8214.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -8,8 +8,10 @@ #include "emu.h" #include "i8214.h" +#include //#define VERBOSE 1 +//#define LOG_OUTPUT_STREAM std::cout #include "logmacro.h" @@ -40,7 +42,8 @@ // set interrupt line m_write_int(ASSERT_LINE); - m_write_int(CLEAR_LINE); + + //m_write_int(CLEAR_LINE); } @@ -52,7 +55,12 @@ { if (m_int_dis) { - LOG("not checking interrupts because m_int_dis\n"); + LOG("not checking interrupts because m_int_dis (%02x)\n", m_r); + if (m_r == 0xff) + { + m_int_dis = 0; + m_write_int(CLEAR_LINE); + } return; } if (!m_etlg) @@ -89,6 +97,9 @@ } } } + + m_int_dis = 0; + m_write_int(CLEAR_LINE); } diff -Nru mame-0.242+dfsg.1/src/devices/machine/iwm.cpp mame-0.243+dfsg.1/src/devices/machine/iwm.cpp --- mame-0.242+dfsg.1/src/devices/machine/iwm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/machine/iwm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -30,16 +30,6 @@ m_fclk_q3_ratio = q3_clock ? double(q3_clock)/double(clock) : 0; // ~4 } -u64 iwm_device::q3_to_fclk(u64 cycles) const -{ - return u64(m_q3_fclk_ratio * double(cycles) + 0.5); -} - -u64 iwm_device::fclk_to_q3(u64 cycles) const -{ - return u64(m_fclk_q3_ratio * double(cycles) + 0.5); -} - void iwm_device::device_start() { applefdintf_device::device_start(); @@ -53,6 +43,7 @@ save_item(NAME(m_flux_write)); save_item(NAME(m_flux_write_count)); save_item(NAME(m_q3_clock)); + save_item(NAME(m_q3_clock_active)); save_item(NAME(m_active)); save_item(NAME(m_rw)); save_item(NAME(m_rw_state)); @@ -88,6 +79,7 @@ m_rw_bit_count = 0; m_devsel = 0; m_devsel_cb(0); + m_q3_clock_active = false; } void iwm_device::device_timer(emu_timer &, device_timer_id, int) @@ -199,7 +191,7 @@ if(m_rw != MODE_READ) { if(m_rw == MODE_WRITE) { flush_write(); - m_flux_write_start = 0; + write_clock_stop(); } m_rw = MODE_READ; m_rw_state = S_IDLE; @@ -215,8 +207,7 @@ m_rw_state = S_IDLE; m_whd |= 0x40; m_next_state_change = 0; - m_flux_write_start = m_last_sync; - m_flux_write_count = 0; + write_clock_start(); if(m_floppy) m_floppy->set_write_splice(cycles_to_time(m_flux_write_start)); } @@ -225,7 +216,7 @@ if(m_active == MODE_ACTIVE) { flush_write(); if(m_mode & 0x04) { - m_flux_write_start = 0; + write_clock_stop(); m_active = MODE_IDLE; m_rw = MODE_IDLE; m_rw_state = S_IDLE; @@ -318,12 +309,12 @@ u64 iwm_device::time_to_cycles(const attotime &tm) const { - return tm.as_ticks(clock()); + return tm.as_ticks(m_q3_clock_active ? m_q3_clock : clock()); } attotime iwm_device::cycles_to_time(u64 cycles) const { - return attotime::from_ticks(cycles, clock()); + return attotime::from_ticks(cycles, m_q3_clock_active ? m_q3_clock : clock()); } bool iwm_device::is_sync() const @@ -333,6 +324,9 @@ u64 iwm_device::half_window_size() const { + if(m_q3_clock_active) + return m_mode & 0x08 ? 2 : 4; + switch(m_mode & 0x18) { case 0x00: return 14; case 0x08: return 7; @@ -344,6 +338,9 @@ u64 iwm_device::window_size() const { + if(m_q3_clock_active) + return m_mode & 0x08 ? 4 : 8; + switch(m_mode & 0x18) { case 0x00: return 28; case 0x08: return 14; @@ -358,9 +355,23 @@ return m_mode & 0x08 ? 4 : 8; } -u64 iwm_device::write_sync_half_window_size() const +void iwm_device::write_clock_start() { - return m_mode & 0x08 ? 2 : 4; + if(is_sync() && m_q3_clock) { + m_q3_clock_active = true; + m_last_sync = machine().time().as_ticks(m_q3_clock); + } + m_flux_write_start = m_last_sync; + m_flux_write_count = 0; +} + +void iwm_device::write_clock_stop() +{ + if(m_q3_clock_active) { + m_q3_clock_active = false; + m_last_sync = machine().time().as_ticks(clock()); + } + m_flux_write_start = 0; } void iwm_device::sync() @@ -368,7 +379,7 @@ if(!m_active) return; - u64 next_sync = machine().time().as_ticks(clock()); + u64 next_sync = machine().time().as_ticks(m_q3_clock_active ? m_q3_clock : clock()); switch(m_rw) { case MODE_IDLE: m_last_sync = next_sync; @@ -463,10 +474,7 @@ } else { m_wsh = m_data; m_rw_state = SW_WINDOW_MIDDLE; - if(m_q3_clock) - m_next_state_change = q3_to_fclk(fclk_to_q3(m_last_sync) + write_sync_half_window_size()); - else - m_next_state_change = m_last_sync + half_window_size(); + m_next_state_change = m_last_sync + half_window_size(); } break; @@ -474,7 +482,7 @@ if(m_whd & 0x80) { logerror("underrun\n"); flush_write(next_sync); - m_flux_write_start = 0; + write_clock_stop(); m_whd &= ~0x40; m_last_sync = next_sync; m_rw_state = SW_UNDERRUN; @@ -492,10 +500,7 @@ m_flux_write[m_flux_write_count++] = m_last_sync; m_wsh <<= 1; m_rw_state = SW_WINDOW_END; - if((m_mode & 0x02) || !m_q3_clock) - m_next_state_change = m_last_sync + half_window_size(); - else - m_next_state_change = q3_to_fclk(fclk_to_q3(m_last_sync) + write_sync_half_window_size()); + m_next_state_change = m_last_sync + half_window_size(); break; case SW_WINDOW_END: @@ -512,10 +517,7 @@ m_next_state_change = m_last_sync + half_window_size(); } } else { - if(m_q3_clock) - m_next_state_change = q3_to_fclk(fclk_to_q3(m_last_sync) + write_sync_half_window_size()); - else - m_next_state_change = m_last_sync + half_window_size(); + m_next_state_change = m_last_sync + half_window_size(); m_rw_state = SW_WINDOW_MIDDLE; } break; diff -Nru mame-0.242+dfsg.1/src/devices/machine/iwm.h mame-0.243+dfsg.1/src/devices/machine/iwm.h --- mame-0.242+dfsg.1/src/devices/machine/iwm.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/machine/iwm.h 2022-04-29 05:37:26.000000000 +0000 @@ -62,19 +62,18 @@ double m_q3_fclk_ratio, m_fclk_q3_ratio; u64 m_last_sync, m_next_state_change, m_sync_update, m_async_update; u64 m_flux_write_start; - std::array m_flux_write; + std::array m_flux_write; u32 m_flux_write_count; u32 m_q3_clock; int m_active, m_rw, m_rw_state; u8 m_data, m_whd, m_mode, m_status, m_control, m_rw_bit_count; u8 m_rsh, m_wsh; u8 m_devsel; + bool m_q3_clock_active; u8 control(int offset, u8 data); u64 time_to_cycles(const attotime &tm) const; attotime cycles_to_time(u64 cycles) const; - u64 fclk_to_q3(u64 cycles) const; - u64 q3_to_fclk(u64 cycles) const; void mode_w(u8 data); void data_w(u8 data); @@ -82,9 +81,10 @@ u64 window_size() const; u64 half_window_size() const; u64 read_register_update_delay() const; - u64 write_sync_half_window_size() const; inline bool is_sync() const; void flush_write(u64 when = 0); + void write_clock_start(); + void write_clock_stop(); }; DECLARE_DEVICE_TYPE(IWM, iwm_device) diff -Nru mame-0.242+dfsg.1/src/devices/machine/ldv4200hle.cpp mame-0.243+dfsg.1/src/devices/machine/ldv4200hle.cpp --- mame-0.242+dfsg.1/src/devices/machine/ldv4200hle.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/machine/ldv4200hle.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -78,10 +78,10 @@ , m_chapter(0) , m_time(0) , m_frame(0) - , m_search_chapter(~0U) - , m_search_frame(~0U) - , m_mark_chapter(~0U) - , m_mark_frame(~0U) + , m_search_chapter(~uint32_t(0)) + , m_search_frame(~uint32_t(0)) + , m_mark_chapter(~uint32_t(0)) + , m_mark_frame(~uint32_t(0)) , m_key_lock(0) , m_video_switch(1) , m_audio_switch(0) @@ -209,7 +209,7 @@ break; } - uint32_t value = ~0U; + uint32_t value = ~uint32_t(0); if (is_number(m_cmd_buffer[cmd_index])) { cmd_index += parse_numeric_value(cmd_index, value, err); @@ -347,19 +347,19 @@ set_audio_squelch(true, true); break; case CMD_PLAY: - LOGMASKED(LOG_COMMANDS, "%s: Command: Play [%d] (cancelling search)\n", machine().describe_context(), value == ~0U ? 0 : value); + LOGMASKED(LOG_COMMANDS, "%s: Command: Play [%d] (cancelling search)\n", machine().describe_context(), value == ~uint32_t(0) ? 0 : value); m_speed_accum = 0; m_mode = MODE_PLAY; update_audio_squelch(); update_video_enable(); - if (value != ~0U) + if (value != ~uint32_t(0)) { LOGMASKED(LOG_COMMANDS, "%s: Setting stop frame\n", machine().describe_context()); m_mark_frame = value + 1; m_cmd_running = true; } - m_search_frame = ~0U; - m_search_chapter = ~0U; + m_search_frame = ~uint32_t(0); + m_search_chapter = ~uint32_t(0); break; case CMD_PAUSE: LOGMASKED(LOG_COMMANDS, "%s: Command: Pause\n", machine().describe_context()); @@ -376,14 +376,14 @@ LOGMASKED(LOG_COMMANDS, "%s: Command: Step Forward\n", machine().describe_context()); m_mode = MODE_STILL; set_audio_squelch(true, true); - m_mark_frame = ~0U; + m_mark_frame = ~uint32_t(0); advance_slider(1); break; case CMD_STEP_REVERSE: LOGMASKED(LOG_COMMANDS, "%s: Command: Step Reverse\n", machine().describe_context()); m_mode = MODE_STILL; set_audio_squelch(true, true); - m_mark_frame = ~0U; + m_mark_frame = ~uint32_t(0); advance_slider(-1); break; case CMD_SCAN_FORWARD: @@ -393,12 +393,12 @@ LOGMASKED(LOG_COMMANDS, "%s: Command: Scan Reverse\n", machine().describe_context()); break; case CMD_MULTISPEED_FORWARD: - LOGMASKED(LOG_COMMANDS, "%s: Command: Multi-Speed Forward (%d) (cancelling search)\n", machine().describe_context(), value == ~0U ? 0 : value); - m_search_frame = ~0U; - m_search_chapter = ~0U; + LOGMASKED(LOG_COMMANDS, "%s: Command: Multi-Speed Forward (%d) (cancelling search)\n", machine().describe_context(), value == ~uint32_t(0) ? 0 : value); + m_search_frame = ~uint32_t(0); + m_search_chapter = ~uint32_t(0); if (value + 1 == m_curr_frame) { - LOGMASKED(LOG_COMMANDS, "%s: Already at desired frame, entering still/pause\n", machine().describe_context(), value == ~0U ? 0 : value); + LOGMASKED(LOG_COMMANDS, "%s: Already at desired frame, entering still/pause\n", machine().describe_context(), value == ~uint32_t(0) ? 0 : value); if (is_cav_disc()) { m_mode = MODE_STILL; @@ -413,7 +413,7 @@ else { m_mode = MODE_MS_FORWARD; - if (value != ~0U) + if (value != ~uint32_t(0)) { LOGMASKED(LOG_COMMANDS, "%s: Setting stop frame\n", machine().describe_context()); m_mark_frame = value + 1; @@ -422,12 +422,12 @@ } break; case CMD_MULTISPEED_REVERSE: - LOGMASKED(LOG_COMMANDS, "%s: Command: Multi-Speed Reverse (%d) (cancelling search)\n", machine().describe_context(), value == ~0U ? 0 : value); - m_search_frame = ~0U; - m_search_chapter = ~0U; + LOGMASKED(LOG_COMMANDS, "%s: Command: Multi-Speed Reverse (%d) (cancelling search)\n", machine().describe_context(), value == ~uint32_t(0) ? 0 : value); + m_search_frame = ~uint32_t(0); + m_search_chapter = ~uint32_t(0); if (value + 1 == m_curr_frame) { - LOGMASKED(LOG_COMMANDS, "%s: Already at desired frame, entering still/pause\n", machine().describe_context(), value == ~0U ? 0 : value); + LOGMASKED(LOG_COMMANDS, "%s: Already at desired frame, entering still/pause\n", machine().describe_context(), value == ~uint32_t(0) ? 0 : value); if (is_cav_disc()) { m_mode = MODE_STILL; @@ -442,7 +442,7 @@ else { m_mode = MODE_MS_REVERSE; - if (value != ~0U) + if (value != ~uint32_t(0)) { LOGMASKED(LOG_COMMANDS, "%s: Setting stop frame\n", machine().describe_context()); m_mark_frame = value + 1; @@ -746,10 +746,10 @@ m_chapter = 0; m_time = 0; m_frame = 0; - m_search_chapter = ~0U; - m_search_frame = ~0U; - m_mark_chapter = ~0U; - m_mark_frame = ~0U; + m_search_chapter = ~uint32_t(0); + m_search_frame = ~uint32_t(0); + m_mark_chapter = ~uint32_t(0); + m_mark_frame = ~uint32_t(0); m_key_lock = 0; m_video_switch = 1; m_audio_switch = 0; @@ -800,14 +800,14 @@ if (m_mode != MODE_STILL && m_mode != MODE_PAUSE) { - if (m_mark_frame != ~0U && m_search_frame == ~0U) + if (m_mark_frame != ~uint32_t(0) && m_search_frame == ~uint32_t(0)) { int32_t old_delta = (int32_t)m_mark_frame - (int32_t)old_frame; int32_t curr_delta = (int32_t)m_mark_frame - (int32_t)m_curr_frame; LOGMASKED(LOG_STOPS, "%s: Stop Mark is currently %d, old frame is %d, current frame is %d, old delta %d, curr delta %d\n", machine().describe_context(), m_mark_frame, old_frame, m_curr_frame, old_delta, curr_delta); if (curr_delta == 0 || std::signbit(old_delta) != std::signbit(curr_delta)) { - m_mark_frame = ~0U; + m_mark_frame = ~uint32_t(0); if (is_cav_disc()) { LOGMASKED(LOG_STOPS | LOG_SQUELCHES, "%s: Stop Mark: Zero delta w/ CAV disc, entering still mode and squelching audio\n", machine().describe_context()); @@ -832,7 +832,7 @@ } } - if (m_search_frame != ~0U) + if (m_search_frame != ~uint32_t(0)) { // TODO: Chapter-search support int32_t delta = (int32_t)m_search_frame - (int32_t)m_curr_frame; @@ -840,7 +840,7 @@ if (delta == 0) { // We've found our frame, enter play, pause or still mode. - m_search_frame = ~0U; + m_search_frame = ~uint32_t(0); if (is_cav_disc()) { LOGMASKED(LOG_SEARCHES | LOG_SQUELCHES, "%s: Search Mark: Zero delta w/ CAV disc, entering still mode and squelching audio\n", machine().describe_context()); @@ -926,7 +926,7 @@ if (m_mode == MODE_MS_REVERSE) elapsed_tracks *= -1; - if (m_mark_frame != ~0U) + if (m_mark_frame != ~uint32_t(0)) { int32_t jump_frame = (int32_t)m_curr_frame + elapsed_tracks; int32_t curr_delta = (int32_t)m_mark_frame - (int32_t)m_curr_frame; diff -Nru mame-0.242+dfsg.1/src/devices/machine/spg290_cdservo.cpp mame-0.243+dfsg.1/src/devices/machine/spg290_cdservo.cpp --- mame-0.242+dfsg.1/src/devices/machine/spg290_cdservo.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/machine/spg290_cdservo.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -109,7 +109,7 @@ if (BIT(m_control0, 15)) // CDDA { - cdrom_read_data(m_cdrom->get_cdrom_file(), m_cur_sector - 150 - SPG290_LEADIN_LEN, cdbuf, CD_TRACK_AUDIO); + m_cdrom->get_cdrom_file()->read_data(m_cur_sector - 150 - SPG290_LEADIN_LEN, cdbuf, cdrom_file::CD_TRACK_AUDIO); for (int i=0; i<2352; i++) { @@ -120,13 +120,13 @@ } else { - cdrom_read_data(m_cdrom->get_cdrom_file(), m_cur_sector - 150 - SPG290_LEADIN_LEN, cdbuf, CD_TRACK_MODE1_RAW); + m_cdrom->get_cdrom_file()->read_data(m_cur_sector - 150 - SPG290_LEADIN_LEN, cdbuf, cdrom_file::CD_TRACK_MODE1_RAW); // FIXME: this is required for load iso images - if (cdrom_get_track_type(m_cdrom->get_cdrom_file(), m_qsub[m_cur_sector * 12 + 1] - 1) == CD_TRACK_MODE1) + if (m_cdrom->get_cdrom_file()->get_track_type(m_qsub[m_cur_sector * 12 + 1] - 1) == cdrom_file::CD_TRACK_MODE1) { int lba = (bcd_2_dec(cdbuf[12]) * 60 + bcd_2_dec(cdbuf[13])) * 75 + bcd_2_dec(cdbuf[14]); - uint32_t msf = lba_to_msf(lba + 150); + uint32_t msf = cdrom_file::lba_to_msf(lba + 150); cdbuf[12] = (msf >> 16) & 0xff; cdbuf[13] = (msf >> 8) & 0xff; cdbuf[14] = (msf >> 0) & 0xff; @@ -357,9 +357,9 @@ void spg290_cdservo_device::generate_qsub(cdrom_file *cdrom) { - const cdrom_toc *toc = cdrom_get_toc(cdrom); - int numtracks = cdrom_get_last_track(cdrom); - uint32_t total_sectors = cdrom_get_track_start(cdrom, numtracks - 1) + toc->tracks[numtracks - 1].frames + 150; + const cdrom_file::toc &toc = cdrom->get_toc(); + int numtracks = cdrom->get_last_track(); + uint32_t total_sectors = cdrom->get_track_start(numtracks - 1) + toc.tracks[numtracks - 1].frames + 150; m_tot_sectors = SPG290_LEADIN_LEN + total_sectors + SPG290_LEADOUT_LEN; m_qsub = std::make_unique(m_tot_sectors * 12); @@ -369,54 +369,54 @@ // 7500 sectors lead-in for (int s=0; s < SPG290_LEADIN_LEN; s += numtracks + 3) { - if (lba < SPG290_LEADIN_LEN) add_qsub(lba++, 0x14, 0, 0xa0, lba_to_msf(s + 0), 1 << 16); // first track number - if (lba < SPG290_LEADIN_LEN) add_qsub(lba++, 0x14, 0, 0xa1, lba_to_msf(s + 1), numtracks << 16); // last track number - if (lba < SPG290_LEADIN_LEN) add_qsub(lba++, 0x14, 0, 0xa2, lba_to_msf(s + 2), lba_to_msf(total_sectors)); // start time of lead-out + if (lba < SPG290_LEADIN_LEN) add_qsub(lba++, 0x14, 0, 0xa0, cdrom_file::lba_to_msf(s + 0), 1 << 16); // first track number + if (lba < SPG290_LEADIN_LEN) add_qsub(lba++, 0x14, 0, 0xa1, cdrom_file::lba_to_msf(s + 1), numtracks << 16); // last track number + if (lba < SPG290_LEADIN_LEN) add_qsub(lba++, 0x14, 0, 0xa2, cdrom_file::lba_to_msf(s + 2), cdrom_file::lba_to_msf(total_sectors)); // start time of lead-out for(int track = 0; track < numtracks; track++) { - uint32_t track_start = cdrom_get_track_start(cdrom, track) + 150; + uint32_t track_start = cdrom->get_track_start(track) + 150; if (lba < SPG290_LEADIN_LEN) - add_qsub(lba++, cdrom_get_adr_control(cdrom, track), 0, dec_2_bcd(track + 1), lba_to_msf(s + 3 + track), lba_to_msf(track_start)); + add_qsub(lba++, cdrom->get_adr_control(track), 0, dec_2_bcd(track + 1), cdrom_file::lba_to_msf(s + 3 + track), cdrom_file::lba_to_msf(track_start)); } } // data tracks for(int track = 0; track < numtracks; track++) { - uint32_t control = cdrom_get_adr_control(cdrom, track); - uint32_t track_start = cdrom_get_track_start(cdrom, track); + uint32_t control = cdrom->get_adr_control(track); + uint32_t track_start = cdrom->get_track_start(track); // pregap - uint32_t pregap = toc->tracks[track].pregap; + uint32_t pregap = toc.tracks[track].pregap; // first track should have a 150 frames pregap - if (track == 0 && toc->tracks[0].pregap == 0) + if (track == 0 && toc.tracks[0].pregap == 0) pregap = 150; - else if (track != 0 && toc->tracks[0].pregap == 0) + else if (track != 0 && toc.tracks[0].pregap == 0) track_start += 150; for(int s = 0; s < pregap; s++) - add_qsub(lba++, control, dec_2_bcd(track + 1), 0, lba_to_msf(s), lba_to_msf(track_start + s)); + add_qsub(lba++, control, dec_2_bcd(track + 1), 0, cdrom_file::lba_to_msf(s), cdrom_file::lba_to_msf(track_start + s)); track_start += pregap; - for(int s = 0; s < toc->tracks[track].frames; s++) + for(int s = 0; s < toc.tracks[track].frames; s++) { // TODO: if present use subcode from CHD - add_qsub(lba++, control, dec_2_bcd(track + 1), 1, lba_to_msf(s), lba_to_msf(track_start + s)); + add_qsub(lba++, control, dec_2_bcd(track + 1), 1, cdrom_file::lba_to_msf(s), cdrom_file::lba_to_msf(track_start + s)); } - track_start += toc->tracks[track].frames; + track_start += toc.tracks[track].frames; // postgap - for(int s = 0; s < toc->tracks[track].postgap; s++) - add_qsub(lba++, control, dec_2_bcd(track + 1), 2, lba_to_msf(s), lba_to_msf(track_start + s)); + for(int s = 0; s < toc.tracks[track].postgap; s++) + add_qsub(lba++, control, dec_2_bcd(track + 1), 2, cdrom_file::lba_to_msf(s), cdrom_file::lba_to_msf(track_start + s)); - track_start += toc->tracks[track].postgap; + track_start += toc.tracks[track].postgap; } // 6750 sectors lead-out for(int s = 0; s < SPG290_LEADOUT_LEN; s++) - add_qsub(lba++, 0x14, 0xaa, 1, lba_to_msf(s), lba_to_msf(total_sectors + s)); + add_qsub(lba++, 0x14, 0xaa, 1, cdrom_file::lba_to_msf(s), cdrom_file::lba_to_msf(total_sectors + s)); } diff -Nru mame-0.242+dfsg.1/src/devices/machine/spi_sdcard.cpp mame-0.243+dfsg.1/src/devices/machine/spi_sdcard.cpp --- mame-0.242+dfsg.1/src/devices/machine/spi_sdcard.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/machine/spi_sdcard.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -163,7 +163,7 @@ } LOGMASKED(LOG_GENERAL, "writing LBA %x, data %02x %02x %02x %02x\n", blk, m_data[0], m_data[1], m_data[2], m_data[3]); - if (hard_disk_write(m_harddisk, blk, &m_data[0])) + if (m_harddisk->write(blk, &m_data[0])) { m_data[0] = DATA_RESPONSE_OK; } @@ -182,7 +182,7 @@ if (m_state == SD_STATE_DATA_MULTI && m_out_count == 0) { m_data[0] = 0xfe; // data token - hard_disk_read(m_harddisk, m_blknext++, &m_data[1]); + m_harddisk->read(m_blknext++, &m_data[1]); util::crc16_t crc16 = util::crc16_creator::simple( &m_data[1], m_blksize); m_data[m_blksize + 1] = (crc16 >> 8) & 0xff; @@ -292,7 +292,7 @@ case 16: // CMD16 - SET_BLOCKLEN m_blksize = (u16(m_cmd[3]) << 8) | u16(m_cmd[4]); - if (hard_disk_set_block_size(m_harddisk, m_blksize)) + if (m_harddisk->set_block_size(m_blksize)) { m_data[0] = 0; } @@ -322,7 +322,7 @@ blk /= m_blksize; } LOGMASKED(LOG_GENERAL, "reading LBA %x\n", blk); - hard_disk_read(m_harddisk, blk, &m_data[3]); + m_harddisk->read(blk, &m_data[3]); { util::crc16_t crc16 = util::crc16_creator::simple(&m_data[3], m_blksize); m_data[m_blksize + 3] = (crc16 >> 8) & 0xff; diff -Nru mame-0.242+dfsg.1/src/devices/machine/stvcd.cpp mame-0.243+dfsg.1/src/devices/machine/stvcd.cpp --- mame-0.242+dfsg.1/src/devices/machine/stvcd.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/machine/stvcd.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -478,12 +478,12 @@ uint32_t rel_fad; uint8_t track; - if(cdrom_get_track_type(cdrom, cdrom_get_track(cdrom, fad)) != CD_TRACK_AUDIO) + if(cdrom->get_track_type(cdrom->get_track(fad)) != cdrom_file::CD_TRACK_AUDIO) return 1; - track = cdrom_get_track( cdrom, fad ); + track = cdrom->get_track( fad ); - rel_fad = fad - cdrom_get_track_start( cdrom, track ); + rel_fad = fad - cdrom->get_track_start( track ); if(rel_fad < 150) return 0; @@ -493,15 +493,22 @@ int stvcd_device::sega_cdrom_get_adr_control(cdrom_file *file, int track) { - return bitswap<8>(cdrom_get_adr_control(file, cur_track),3,2,1,0,7,6,5,4); + return bitswap<8>(file->get_adr_control(cur_track),3,2,1,0,7,6,5,4); } void stvcd_device::cr_standard_return(uint16_t cur_status) { - if ((cd_stat & 0x0f00) == CD_STAT_SEEK) + if (!cdrom) + { + cr1 = cur_status; + cr2 = 0; + cr3 = 0; + cr4 = 0; + } + else if ((cd_stat & 0x0f00) == CD_STAT_SEEK) { /* During seek state, values returned are from the target position */ - uint8_t seek_track = cdrom_get_track(cdrom, cd_fad_seek-150); + uint8_t seek_track = cdrom->get_track(cd_fad_seek-150); cr1 = cur_status | (playtype << 7) | 0x00 | (cdda_repeat_count & 0xf); cr2 = (seek_track == 0xff) ? 0xffff : ((sega_cdrom_get_adr_control(cdrom, seek_track)<<8) | seek_track); @@ -511,7 +518,7 @@ else { cr1 = cur_status | (playtype << 7) | 0x00 | (cdda_repeat_count & 0xf); //options << 4 | repeat & 0xf - cr2 = (cur_track == 0xff) ? 0xffff : ((sega_cdrom_get_adr_control(cdrom, cur_track)<<8) | (cdrom_get_track(cdrom, cd_curfad-150)+1)); + cr2 = (cur_track == 0xff) ? 0xffff : ((sega_cdrom_get_adr_control(cdrom, cur_track)<<8) | (cdrom->get_track(cd_curfad-150)+1)); cr3 = (get_track_index(cd_curfad)<<8) | (cd_curfad>>16); //index & 0xff00 cr4 = cd_curfad; } @@ -761,7 +768,7 @@ cd_curfad = start_pos & 0xfffff; logerror("fad mode\n"); - cur_track = cdrom_get_track(cdrom, cd_curfad-150); + cur_track = cdrom->get_track(cd_curfad-150); } else { @@ -769,7 +776,7 @@ if(((start_pos)>>8) != 0) { cur_track = (start_pos)>>8; - cd_fad_seek = cdrom_get_track_start(cdrom, cur_track-1); + cd_fad_seek = cdrom->get_track_start(cur_track-1); cd_stat = CD_STAT_SEEK; m_cdda->pause_audio(0); } @@ -795,7 +802,7 @@ uint8_t end_track; end_track = (end_pos)>>8; - fadstoplay = cdrom_get_track_start(cdrom, end_track) - cd_fad_seek; + fadstoplay = cdrom->get_track_start(end_track) - cd_fad_seek; } } else // play until the end of the disc @@ -811,9 +818,9 @@ else { if(end_pos == 0) - fadstoplay = (cdrom_get_track_start(cdrom, 0xaa)) - cd_curfad; + fadstoplay = (cdrom->get_track_start(0xaa)) - cd_curfad; else - fadstoplay = (cdrom_get_track_start(cdrom, (end_pos & 0xff00) >> 8)) - cd_curfad; + fadstoplay = (cdrom->get_track_start((end_pos & 0xff00) >> 8)) - cd_curfad; } logerror("track mode %08x %08x\n",cd_curfad,fadstoplay); } @@ -828,8 +835,8 @@ // be countless possible combinations ... if(fadstoplay == 0) { - cd_curfad = cdrom_get_track_start(cdrom, cur_track-1); - fadstoplay = cdrom_get_track_start(cdrom, cur_track) - cd_curfad; + cd_curfad = cdrom->get_track_start(cur_track-1); + fadstoplay = cdrom->get_track_start(cur_track) - cd_curfad; } logerror("track resume %08x %08x\n",cd_curfad,fadstoplay); } @@ -845,7 +852,7 @@ playtype = 0; // cdda - if(cdrom_get_track_type(cdrom, cdrom_get_track(cdrom, cd_curfad)) == CD_TRACK_AUDIO) + if(cdrom->get_track_type(cdrom->get_track(cd_curfad)) == cdrom_file::CD_TRACK_AUDIO) { m_cdda->pause_audio(0); //m_cdda->start_audio(cd_curfad, fadstoplay); @@ -892,7 +899,7 @@ { cd_stat = CD_STAT_PAUSE; cur_track = cr2>>8; - cd_curfad = cdrom_get_track_start(cdrom, cur_track-1); + cd_curfad = cdrom->get_track_start(cur_track-1); m_cdda->pause_audio(1); // (index is cr2 low byte) } @@ -952,13 +959,13 @@ xxxx xxxx [11] CRCC */ - msf_abs = lba_to_msf_alt( cd_curfad - 150 ); - track = cdrom_get_track( cdrom, cd_curfad ); - msf_rel = lba_to_msf_alt( cd_curfad - 150 - cdrom_get_track_start( cdrom, track ) ); + msf_abs = cdrom_file::lba_to_msf_alt( cd_curfad - 150 ); + track = cdrom->get_track( cd_curfad ); + msf_rel = cdrom_file::lba_to_msf_alt( cd_curfad - 150 - cdrom->get_track_start( track ) ); xfertype = XFERTYPE_SUBQ; xfercount = 0; - subqbuf[0] = 0x01 | ((cdrom_get_track_type(cdrom, cdrom_get_track(cdrom, track+1)) == CD_TRACK_AUDIO) ? 0x00 : 0x40); + subqbuf[0] = 0x01 | ((cdrom->get_track_type(cdrom->get_track(track+1)) == cdrom_file::CD_TRACK_AUDIO) ? 0x00 : 0x40); subqbuf[1] = dec_2_bcd(track+1); subqbuf[2] = dec_2_bcd(get_track_index(cd_curfad)); subqbuf[3] = dec_2_bcd((msf_rel >> 16) & 0xff); @@ -1912,6 +1919,11 @@ 1) logerror("Command exec %04x %04x %04x %04x %04x (stat %04x)\n", hirqreg, cr1, cr2, cr3, cr4, cd_stat); + if(!cdrom && ((cr1 >> 8) & 0xff) != 0x00) { + hirqreg |= (CMOK); + return; + } + switch ((cr1 >> 8) & 0xff) { case 0x00: cmd_get_status(); break; @@ -2000,13 +2012,16 @@ TIMER_DEVICE_CALLBACK_MEMBER( stvcd_device::stv_sector_cb ) { + if(!cdrom) + return; + //m_sector_timer->reset(); //popmessage("%08x %08x %d %d",cd_curfad,fadstoplay,cmd_pending,cd_speed); cd_playdata(); - if(cdrom_get_track_type(cdrom, cdrom_get_track(cdrom, cd_curfad)) == CD_TRACK_AUDIO) + if(cdrom->get_track_type(cdrom->get_track(cd_curfad)) == cdrom_file::CD_TRACK_AUDIO) m_sector_timer->adjust(attotime::from_hz(75)); // 75 sectors / second = 150kBytes/second (cdda track ignores cd_speed setting) else m_sector_timer->adjust(attotime::from_hz(75*cd_speed)); // 75 / 150 sectors / second = 150 / 300kBytes/second @@ -2069,7 +2084,7 @@ for (i = 0; i < MAX_BLOCKS; i++) { blocks[i].size = -1; - memset(&blocks[i].data, 0, CD_MAX_SECTOR_DATA); + memset(&blocks[i].data, 0, cdrom_file::MAX_SECTOR_DATA); } // open device @@ -2384,7 +2399,7 @@ if (cdrom) { - ntrks = cdrom_get_last_track(cdrom); + ntrks = cdrom->get_last_track(); } else { @@ -2409,7 +2424,7 @@ { //tocbuf[tocptr] = sega_cdrom_get_adr_control(cdrom, i); //HACK: ddsom does not enter ingame with the line above! - tocbuf[tocptr] = cdrom_get_adr_control(cdrom, i)<<4 | 0x01; + tocbuf[tocptr] = cdrom->get_adr_control(i)<<4 | 0x01; } else { @@ -2418,7 +2433,7 @@ if (cdrom) { - fad = cdrom_get_track_start(cdrom, i) + 150; + fad = cdrom->get_track_start(i) + 150; tocbuf[tocptr+1] = (fad>>16)&0xff; tocbuf[tocptr+2] = (fad>>8)&0xff; @@ -2459,7 +2474,7 @@ tocbuf[tocptr+7] = 0; // get total disc length (start of lead-out) - fad = cdrom_get_track_start(cdrom, 0xaa) + 150; + fad = cdrom->get_track_start(0xaa) + 150; tocbuf[tocptr+8] = tocbuf[0]; tocbuf[tocptr+9] = (fad>>16)&0xff; @@ -2493,7 +2508,7 @@ } } - if ((trktype != CD_TRACK_AUDIO) && (curblock.data[15] == 2)) + if ((trktype != cdrom_file::CD_TRACK_AUDIO) && (curblock.data[15] == 2)) { if (flt->mode & 1) // file number { @@ -2630,27 +2645,27 @@ if ((cddevice != nullptr) && (!buffull)) { // find out the track's type - trktype = cdrom_get_track_type(cdrom, cdrom_get_track(cdrom, fad-150)); + trktype = cdrom->get_track_type(cdrom->get_track(fad-150)); // now get a raw 2352 byte sector - if it's mode 1, get mode1_raw - if ((trktype == CD_TRACK_MODE1) || (trktype == CD_TRACK_MODE1_RAW)) + if ((trktype == cdrom_file::CD_TRACK_MODE1) || (trktype == cdrom_file::CD_TRACK_MODE1_RAW)) { - cdrom_read_data(cdrom, fad-150, curblock.data, CD_TRACK_MODE1_RAW); + cdrom->read_data(fad-150, curblock.data, cdrom_file::CD_TRACK_MODE1_RAW); } - else if (trktype != CD_TRACK_AUDIO) // if not audio it must be mode 2 so get mode2_raw + else if (trktype != cdrom_file::CD_TRACK_AUDIO) // if not audio it must be mode 2 so get mode2_raw { - cdrom_read_data(cdrom, fad-150, curblock.data, CD_TRACK_MODE2_RAW); + cdrom->read_data(fad-150, curblock.data, cdrom_file::CD_TRACK_MODE2_RAW); } else { - cdrom_read_data(cdrom, fad-150, curblock.data, CD_TRACK_AUDIO); + cdrom->read_data(fad-150, curblock.data, cdrom_file::CD_TRACK_AUDIO); } curblock.size = sectlenin; curblock.FAD = fad; // if track is Mode 2, get the subheader values - if ((trktype != CD_TRACK_AUDIO) && (curblock.data[15] == 2)) + if ((trktype != cdrom_file::CD_TRACK_AUDIO) && (curblock.data[15] == 2)) { curblock.chan = curblock.data[17]; curblock.fnum = curblock.data[16]; @@ -2714,7 +2729,7 @@ { uint8_t p_ok; - if(cdrom_get_track_type(cdrom, cdrom_get_track(cdrom, cd_curfad)) != CD_TRACK_AUDIO) + if(cdrom->get_track_type(cdrom->get_track(cd_curfad)) != cdrom_file::CD_TRACK_AUDIO) { cd_read_filtered_sector(cd_curfad,&p_ok); m_cdda->stop_audio(); //stop any pending CD-DA @@ -2752,8 +2767,8 @@ if(cdda_repeat_count < 0xe) cdda_repeat_count++; - cd_curfad = cdrom_get_track_start(cdrom, cur_track-1) + 150; - fadstoplay = cdrom_get_track_start(cdrom, cur_track) - cd_curfad; + cd_curfad = cdrom->get_track_start(cur_track-1) + 150; + fadstoplay = cdrom->get_track_start(cur_track) - cd_curfad; } } } @@ -2767,7 +2782,7 @@ { if (cdrom) { - cdrom_read_data(cdrom, fad-150, dat, CD_TRACK_MODE1); + cdrom->read_data(fad-150, dat, cdrom_file::CD_TRACK_MODE1); } } diff -Nru mame-0.242+dfsg.1/src/devices/machine/stvcd.h mame-0.243+dfsg.1/src/devices/machine/stvcd.h --- mame-0.242+dfsg.1/src/devices/machine/stvcd.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/machine/stvcd.h 2022-04-29 05:37:26.000000000 +0000 @@ -82,7 +82,7 @@ { int32_t size; // size of block int32_t FAD; // FAD on disc - uint8_t data[CD_MAX_SECTOR_DATA]; + uint8_t data[cdrom_file::MAX_SECTOR_DATA]; uint8_t chan; // channel uint8_t fnum; // file number uint8_t subm; // subchannel mode diff -Nru mame-0.242+dfsg.1/src/devices/machine/t10mmc.cpp mame-0.243+dfsg.1/src/devices/machine/t10mmc.cpp --- mame-0.242+dfsg.1/src/devices/machine/t10mmc.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/machine/t10mmc.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -72,7 +72,7 @@ int t10mmc::toc_tracks() { int start_track = command[6]; - int end_track = cdrom_get_last_track(m_cdrom); + int end_track = m_cdrom->get_last_track(); if (start_track == 0) { @@ -157,6 +157,14 @@ break; case T10SBC_CMD_READ_10: + if (m_cdrom == nullptr) + { + m_phase = SCSI_PHASE_STATUS; + m_status_code = SCSI_STATUS_CODE_CHECK_CONDITION; + m_transfer_length = 0; + break; + } + m_lba = command[2]<<24 | command[3]<<16 | command[4]<<8 | command[5]; m_blocks = SCSILengthFromUINT16( &command[7] ); @@ -180,6 +188,14 @@ break; case T10MMC_CMD_READ_SUB_CHANNEL: + if (m_cdrom == nullptr) + { + m_phase = SCSI_PHASE_STATUS; + m_status_code = SCSI_STATUS_CODE_CHECK_CONDITION; + m_transfer_length = 0; + break; + } + //m_device->logerror("T10MMC: READ SUB-CHANNEL type %d\n", command[3]); m_phase = SCSI_PHASE_DATAIN; m_status_code = SCSI_STATUS_CODE_GOOD; @@ -188,6 +204,14 @@ case T10MMC_CMD_READ_TOC_PMA_ATIP: { + if (m_cdrom == nullptr) + { + m_phase = SCSI_PHASE_STATUS; + m_status_code = SCSI_STATUS_CODE_CHECK_CONDITION; + m_transfer_length = 0; + break; + } + int length; switch (toc_format()) @@ -221,6 +245,14 @@ break; } case T10MMC_CMD_PLAY_AUDIO_10: + if (m_cdrom == nullptr) + { + m_phase = SCSI_PHASE_STATUS; + m_status_code = SCSI_STATUS_CODE_CHECK_CONDITION; + m_transfer_length = 0; + break; + } + m_lba = command[2]<<24 | command[3]<<16 | command[4]<<8 | command[5]; m_blocks = SCSILengthFromUINT16( &command[7] ); @@ -229,8 +261,8 @@ // A request for LBA 0 will return something different depending on the type of media being played. // For data and mixed media, LBA 0 is assigned to MSF 00:02:00 (= LBA 150). // For audio media, LBA 0 is assigned to the actual starting address of track 1. - if (cdrom_get_track_type(m_cdrom, 0) == CD_TRACK_AUDIO) - m_lba = cdrom_get_track_start(m_cdrom, 0); + if (m_cdrom->get_track_type(0) == cdrom_file::CD_TRACK_AUDIO) + m_lba = m_cdrom->get_track_start(0); else m_lba = 150; } @@ -241,9 +273,9 @@ //m_device->logerror("T10MMC: PLAY AUDIO(10) at LBA %x for %x blocks\n", m_lba, m_blocks); - trk = cdrom_get_track(m_cdrom, m_lba); + trk = m_cdrom->get_track(m_lba); - if (cdrom_get_track_type(m_cdrom, trk) == CD_TRACK_AUDIO) + if (m_cdrom->get_track_type(trk) == cdrom_file::CD_TRACK_AUDIO) { m_cdda->start_audio(m_lba, m_blocks); m_audio_sense = SCSI_SENSE_ASC_ASCQ_AUDIO_PLAY_OPERATION_IN_PROGRESS; @@ -260,13 +292,21 @@ break; case T10MMC_CMD_PLAY_AUDIO_MSF: + if (m_cdrom == nullptr) + { + m_phase = SCSI_PHASE_STATUS; + m_status_code = SCSI_STATUS_CODE_CHECK_CONDITION; + m_transfer_length = 0; + break; + } + m_lba = (command[5] % 75) + ((command[4] * 75) % (60*75)) + (command[3] * (75*60)); m_blocks = (command[8] % 75) + ((command[7] * 75) % (60*75)) + (command[6] * (75*60)) - m_lba; if (m_lba == 0) { - if (cdrom_get_track_type(m_cdrom, 0) == CD_TRACK_AUDIO) - m_lba = cdrom_get_track_start(m_cdrom, 0); + if (m_cdrom->get_track_type(0) == cdrom_file::CD_TRACK_AUDIO) + m_lba = m_cdrom->get_track_start(0); else m_lba = 150; } @@ -278,9 +318,9 @@ //m_device->logerror("T10MMC: PLAY AUDIO MSF at LBA %x for %x blocks (MSF %i:%i:%i - %i:%i:%i)\n", //m_lba, m_blocks, command[3], command[4], command[5], command[6], command[7], command[8]); - trk = cdrom_get_track(m_cdrom, m_lba); + trk = m_cdrom->get_track(m_lba); - if (cdrom_get_track_type(m_cdrom, trk) == CD_TRACK_AUDIO) + if (m_cdrom->get_track_type(trk) == cdrom_file::CD_TRACK_AUDIO) { m_cdda->start_audio(m_lba, m_blocks); m_audio_sense = SCSI_SENSE_ASC_ASCQ_AUDIO_PLAY_OPERATION_IN_PROGRESS; @@ -297,6 +337,14 @@ break; case T10MMC_CMD_PLAY_AUDIO_TRACK_INDEX: + if (m_cdrom == nullptr) + { + m_phase = SCSI_PHASE_STATUS; + m_status_code = SCSI_STATUS_CODE_CHECK_CONDITION; + m_transfer_length = 0; + break; + } + if (command[4] > command[7]) { // TODO: check error @@ -308,7 +356,7 @@ // be careful: tracks here are zero-based, but the SCSI command // uses the real CD track number which is 1-based! //m_device->logerror("T10MMC: PLAY AUDIO T/I: strk %d idx %d etrk %d idx %d frames %d\n", command[4], command[5], command[7], command[8], m_blocks); - int end_track = cdrom_get_last_track(m_cdrom); + int end_track = m_cdrom->get_last_track(); if (end_track > command[7]) end_track = command[7]; @@ -319,11 +367,11 @@ if (m_sotc) end_track = command[4]; - m_lba = cdrom_get_track_start(m_cdrom, command[4] - 1); - m_blocks = cdrom_get_track_start(m_cdrom, end_track) - m_lba; - trk = cdrom_get_track(m_cdrom, m_lba); + m_lba = m_cdrom->get_track_start(command[4] - 1); + m_blocks = m_cdrom->get_track_start(end_track) - m_lba; + trk = m_cdrom->get_track(m_lba); - if (cdrom_get_track_type(m_cdrom, trk) == CD_TRACK_AUDIO) + if (m_cdrom->get_track_type(trk) == cdrom_file::CD_TRACK_AUDIO) { m_cdda->start_audio(m_lba, m_blocks); m_audio_sense = SCSI_SENSE_ASC_ASCQ_AUDIO_PLAY_OPERATION_IN_PROGRESS; @@ -377,13 +425,21 @@ break; case T10MMC_CMD_PLAY_AUDIO_12: + if (m_cdrom == nullptr) + { + m_phase = SCSI_PHASE_STATUS; + m_status_code = SCSI_STATUS_CODE_CHECK_CONDITION; + m_transfer_length = 0; + break; + } + m_lba = command[2]<<24 | command[3]<<16 | command[4]<<8 | command[5]; m_blocks = command[6]<<24 | command[7]<<16 | command[8]<<8 | command[9]; if (m_lba == 0) { - if (cdrom_get_track_type(m_cdrom, 0) == CD_TRACK_AUDIO) - m_lba = cdrom_get_track_start(m_cdrom, 0); + if (m_cdrom->get_track_type(0) == cdrom_file::CD_TRACK_AUDIO) + m_lba = m_cdrom->get_track_start(0); else m_lba = 150; } @@ -394,9 +450,9 @@ //m_device->logerror("T10MMC: PLAY AUDIO(12) at LBA %x for %x blocks\n", m_lba, m_blocks); - trk = cdrom_get_track(m_cdrom, m_lba); + trk = m_cdrom->get_track(m_lba); - if (cdrom_get_track_type(m_cdrom, trk) == CD_TRACK_AUDIO) + if (m_cdrom->get_track_type(trk) == cdrom_file::CD_TRACK_AUDIO) { m_cdda->start_audio(m_lba, m_blocks); m_audio_sense = SCSI_SENSE_ASC_ASCQ_AUDIO_PLAY_OPERATION_IN_PROGRESS; @@ -413,6 +469,14 @@ break; case T10SBC_CMD_READ_12: + if (m_cdrom == nullptr) + { + m_phase = SCSI_PHASE_STATUS; + m_status_code = SCSI_STATUS_CODE_CHECK_CONDITION; + m_transfer_length = 0; + break; + } + m_lba = command[2]<<24 | command[3]<<16 | command[4]<<8 | command[5]; m_blocks = command[7]<<16 | command[8]<<8 | command[9]; @@ -476,7 +540,7 @@ case T10SBC_CMD_READ_CAPACITY: m_device->logerror("T10MMC: READ CAPACITY\n"); - temp = cdrom_get_track_start(m_cdrom, 0xaa); + temp = m_cdrom->get_track_start(0xaa); temp--; // return the last used block on the disc data[0] = (temp>>24) & 0xff; @@ -496,7 +560,7 @@ { while (dataLength > 0) { - if (!cdrom_read_data(m_cdrom, m_lba, tmp_buffer, CD_TRACK_MODE1)) + if (!m_cdrom->read_data(m_lba, tmp_buffer, cdrom_file::CD_TRACK_MODE1)) { m_device->logerror("T10MMC: CD read error!\n"); } @@ -571,7 +635,7 @@ data[3] = 12; // data length data[4] = 0x01; // sub-channel format code data[5] = 0x10 | (audio_active ? 0 : 4); - data[6] = cdrom_get_track(m_cdrom, m_last_lba) + 1; // track + data[6] = m_cdrom->get_track(m_last_lba) + 1; // track data[7] = 0; // index uint32_t frame = m_last_lba; @@ -586,7 +650,7 @@ data[10] = (frame>>8)&0xff; data[11] = frame&0xff; - frame = m_last_lba - cdrom_get_track_start(m_cdrom, data[6] - 1); + frame = m_last_lba - m_cdrom->get_track_start(data[6] - 1); if (msf) { @@ -634,7 +698,7 @@ data[dptr++] = (len>>8) & 0xff; data[dptr++] = (len & 0xff); data[dptr++] = 1; - data[dptr++] = cdrom_get_last_track(m_cdrom); + data[dptr++] = m_cdrom->get_last_track(); int first_track = command[6]; if (first_track == 0) @@ -658,11 +722,11 @@ } data[dptr++] = 0; - data[dptr++] = cdrom_get_adr_control(m_cdrom, cdrom_track); + data[dptr++] = m_cdrom->get_adr_control(cdrom_track); data[dptr++] = track; data[dptr++] = 0; - uint32_t tstart = cdrom_get_track_start(m_cdrom, cdrom_track); + uint32_t tstart = m_cdrom->get_track_start(cdrom_track); if (msf) { @@ -688,11 +752,11 @@ data[dptr++] = 1; data[dptr++] = 0; - data[dptr++] = cdrom_get_adr_control(m_cdrom, 0); + data[dptr++] = m_cdrom->get_adr_control(0); data[dptr++] = 1; data[dptr++] = 0; - uint32_t tstart = cdrom_get_track_start(m_cdrom, 0); + uint32_t tstart = m_cdrom->get_track_start(0); if (msf) { diff -Nru mame-0.242+dfsg.1/src/devices/machine/t10sbc.cpp mame-0.243+dfsg.1/src/devices/machine/t10sbc.cpp --- mame-0.242+dfsg.1/src/devices/machine/t10sbc.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/machine/t10sbc.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -28,8 +28,7 @@ else { // get hard disk sector size from CHD metadata - const hard_disk_info *hdinfo = hard_disk_get_info(m_disk); - m_sector_bytes = hdinfo->sectorbytes; + m_sector_bytes = m_disk->get_info().sectorbytes; } } @@ -278,7 +277,7 @@ m_device->logerror("T10SBC: Reading %d bytes from HD\n", dataLength); while (dataLength > 0) { - if (!hard_disk_read(m_disk, m_lba, data)) + if (!m_disk->read(m_lba, data)) { m_device->logerror("T10SBC: HD read error!\n"); } @@ -320,7 +319,7 @@ m_device->logerror("T10SBC: Writing %d bytes to HD\n", dataLength); while (dataLength > 0) { - if (!hard_disk_write(m_disk, m_lba, data)) + if (!m_disk->write(m_lba, data)) { m_device->logerror("T10SBC: HD write error!\n"); } @@ -350,46 +349,46 @@ void t10sbc::GetFormatPage( format_page_t *page ) { - hard_disk_info *info = hard_disk_get_info(m_disk); + const auto &info = m_disk->get_info(); memset(page, 0, sizeof(format_page_t)); page->m_page_code = 0x03; page->m_page_length = 0x16; - page->m_sectors_per_track_msb = (uint8_t)(info->sectors >> 8); - page->m_sectors_per_track_lsb = (uint8_t)info->sectors; - page->m_bytes_per_sector_msb = (uint8_t)(info->sectorbytes >> 8); - page->m_bytes_per_sector_lsb = (uint8_t)info->sectorbytes; + page->m_sectors_per_track_msb = (uint8_t)(info.sectors >> 8); + page->m_sectors_per_track_lsb = (uint8_t)info.sectors; + page->m_bytes_per_sector_msb = (uint8_t)(info.sectorbytes >> 8); + page->m_bytes_per_sector_lsb = (uint8_t)info.sectorbytes; page->m_format = 0x80; // SSEC, Soft-Sectored } void t10sbc::GetGeometryPage( geometry_page_t *page ) { - hard_disk_info *info = hard_disk_get_info(m_disk); + const auto &info = m_disk->get_info(); memset(page, 0, sizeof(geometry_page_t)); page->m_page_code = 0x04; page->m_page_length = 0x16; - page->m_num_cylinders_msb = (uint8_t)(info->cylinders >> 16); - page->m_num_cylinders_2nd = (uint8_t)(info->cylinders >> 8); - page->m_num_cylinders_lsb = (uint8_t)info->cylinders; - page->m_num_heads = (uint8_t)info->heads; + page->m_num_cylinders_msb = (uint8_t)(info.cylinders >> 16); + page->m_num_cylinders_2nd = (uint8_t)(info.cylinders >> 8); + page->m_num_cylinders_lsb = (uint8_t)info.cylinders; + page->m_num_heads = (uint8_t)info.heads; page->m_rot_rate_msb = (uint8_t)(3600 >> 8); page->m_rot_rate_lsb = (uint8_t)3600; } void t10sbc::ReadCapacity( uint8_t *data ) { - hard_disk_info *info = hard_disk_get_info(m_disk); + const auto &info = m_disk->get_info(); // get # of sectors - uint32_t temp = info->cylinders * info->heads * info->sectors - 1; + uint32_t temp = info.cylinders * info.heads * info.sectors - 1; data[0] = (temp>>24) & 0xff; data[1] = (temp>>16) & 0xff; data[2] = (temp>>8) & 0xff; data[3] = (temp & 0xff); - data[4] = (info->sectorbytes>>24)&0xff; - data[5] = (info->sectorbytes>>16)&0xff; - data[6] = (info->sectorbytes>>8)&0xff; - data[7] = (info->sectorbytes & 0xff); + data[4] = (info.sectorbytes>>24)&0xff; + data[5] = (info.sectorbytes>>16)&0xff; + data[6] = (info.sectorbytes>>8)&0xff; + data[7] = (info.sectorbytes & 0xff); } diff -Nru mame-0.242+dfsg.1/src/devices/machine/tms9901.cpp mame-0.243+dfsg.1/src/devices/machine/tms9901.cpp --- mame-0.242+dfsg.1/src/devices/machine/tms9901.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/machine/tms9901.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -33,7 +33,8 @@ Overview: TMS9901 is a support chip for TMS9900. It handles interrupts, provides several I/O pins, and a timer, which is a register which - decrements regularly and can generate an interrupt when it reaches 0. + decrements continuously and can be set to generate an interrupt when it + reaches 0. It communicates with the TMS9900 with the CRU bus, and with the rest of the world with a number of parallel I/O pins. @@ -79,7 +80,8 @@ The interrupt inputs (INT1*-INT15*) are sampled on each falling edge of the phi* clock. An interrupt mask is applied to mask away levels that shall not trigger an interrupt. The mask can be set using the SBO/SBZ - commands (1=arm, 0=disarm) on each of the 15 bits. + commands (1=arm, 0=disarm) on each of the 15 bits. A disarmed interrupt + input can still be read like a normal input port via CRU access. After each clock cycle, the TMS9901 latches the state of INT1*-INT15* (except those pins which are set as output pins). @@ -98,8 +100,7 @@ and triggers an interrupt at level 7 when asserted. In contrast, when writing to bit 31, P15 (same pin) is configured as an - output, and the written value appears on the pin. When the port is set - as output, the interrupt input on the shared pin is deactivated. + output, and the written value appears on the pin. According to [1], the interrupt mask should be set to 0 for those group 2 pins that are used as input/output pins so that no unwanted interrupts are @@ -108,16 +109,20 @@ Clock mode: The "clock mode" is entered by setting bit 0 to 1; setting to 0 enters "interrupt mode". The internal clock is a 14-bit decrementer that - counts down by 1 every 64 clock ticks. On entering clock mode, the current - value of the decrementer is copied to the clock read register and can be - read by the CRU bits 1 to 14. Writing to these CRU bits modifies the - respective bit of the clock register that serves as the start value. Every - time a bit is written, the decrementer is loaded with the current clock - register value. + counts down by 1 every 64 clock ticks. On every update, the value is copied + into the read register, but only in interrupt mode. In clock mode, the read + register is locked so that it can be read without being changed. + Whenever the counter reaches 0, it is reloaded from the clock register on + the next update. + Setting the clock register is possible via CRU addresses 1 to 14 in clock + mode, with bit 1 being the LSB and bit 14 being the MSB. On each bit write + operation, the current state of the clock register is copied into the counter. + + Interrupt ^ | - [Clock register] -> [Decrementer] -> [Clock read register] + [Clock register] -> [Decrementer] -> [Read register] ^ | | v +--<--- CRU write CRU read---<---+ @@ -126,7 +131,7 @@ and "the clock is disabled by RST1* or by writing a zero value into the clock register". Tests show that when a 0 has been written, the chip still counts down from 0x3FFF to 0. However, no interrupt is raised when reaching 0, so "enable" - or "disable" most likely refer to the interrupt. + or "disable" most likely refers to the interrupt. When enabled, the clock raises an interrupt level 3 when reaching 0, overriding the input from the INT3* input. CRU bit 3 is the mask bit for @@ -394,14 +399,6 @@ // Write to control bit (CB) m_clock_mode = (data!=0); LOGMASKED(LOG_MODE, "Enter %s mode\n", m_clock_mode? "clock" : "interrupt"); - - if (m_clock_mode) - { - // we are switching to clock mode: latch the current value of - // the decrementer register - m_clock_read_register = m_decrementer_value; - LOGMASKED(LOG_MODE, "Clock setting = %d\n", m_clock_read_register); - } break; case 15: @@ -449,6 +446,26 @@ } /* + Update clock line. This is not a real connection to the 9901; it represents + the effect of setting selection line S0 to 1. Since we use a separate + I/O address space, and in the real machine, the same address lines as for + memory access are used, and one of the address lines is connected to S0, + we have settings of S0 even in situations when there is no I/O access but + ordinary memory access. + + Offering a method explicitly for S0 looks inconsistent with the way of + addressing the bits in this chip (that is, we should then offer S1 to S4 as + well). + + Drivers may use this line for higher emulation precision concerning the + clock. +*/ +void tms9901_device::update_clock() +{ + m_clock_read_register = m_decrementer_value; +} + +/* Timer callback Decrementer counts down the value set in clock mode; when it reaches 0, raises an interrupt and resets to the start value @@ -467,6 +484,10 @@ if (clk == ASSERT_LINE) { m_decrementer_value = (m_decrementer_value - 1) & 0x3FFF; + + if (!m_clock_mode) + m_clock_read_register = m_decrementer_value; + LOGMASKED(LOG_CLOCK, "Clock = %04x\n", m_decrementer_value); if (m_decrementer_value==0) { @@ -496,6 +517,9 @@ { timer_clock_in(ASSERT_LINE); + if (!m_clock_mode) + m_clock_read_register = m_decrementer_value; + // We signal the interrupt in sync with the clock line signal_int(); diff -Nru mame-0.242+dfsg.1/src/devices/machine/tms9901.h mame-0.243+dfsg.1/src/devices/machine/tms9901.h --- mame-0.242+dfsg.1/src/devices/machine/tms9901.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/machine/tms9901.h 2022-04-29 05:37:26.000000000 +0000 @@ -86,6 +86,8 @@ void set_poll_int_lines(bool poll) { m_poll_lines = poll; } + void update_clock(); + private: static constexpr device_timer_id DECREMENTER = 0; diff -Nru mame-0.242+dfsg.1/src/devices/machine/wd1000.cpp mame-0.243+dfsg.1/src/devices/machine/wd1000.cpp --- mame-0.242+dfsg.1/src/devices/machine/wd1000.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/machine/wd1000.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -241,35 +241,35 @@ int wd1000_device::get_lbasector() { hard_disk_file *file = m_drives[drive()]->get_hard_disk_file(); - hard_disk_info *info = hard_disk_get_info(file); + const auto &info = file->get_info(); int lbasector; - if (m_cylinder > info->cylinders) + if (m_cylinder > info.cylinders) { - logerror("%s: Unexpected cylinder %d for range 0 to %d\n", machine().describe_context(), m_cylinder, info->cylinders - 1); + logerror("%s: Unexpected cylinder %d for range 0 to %d\n", machine().describe_context(), m_cylinder, info.cylinders - 1); } - if (head() >= info->heads) + if (head() >= info.heads) { - logerror("%s: Unexpected head %d for range 0 to %d\n", machine().describe_context(), head(), info->heads - 1); + logerror("%s: Unexpected head %d for range 0 to %d\n", machine().describe_context(), head(), info.heads - 1); } int16_t sector = m_sector_number - m_sector_base; - if (sector < 0 || sector >= info->sectors) + if (sector < 0 || sector >= info.sectors) { - logerror("%s: Unexpected sector number %d for range %d to %d\n", machine().describe_context(), m_sector_number, m_sector_base, info->sectors + m_sector_base); + logerror("%s: Unexpected sector number %d for range %d to %d\n", machine().describe_context(), m_sector_number, m_sector_base, info.sectors + m_sector_base); } - if (sector_bytes() != info->sectorbytes) + if (sector_bytes() != info.sectorbytes) { - logerror("%s: Unexpected sector bytes %d, expected %d\n", machine().describe_context(), sector_bytes(), info->sectorbytes); + logerror("%s: Unexpected sector bytes %d, expected %d\n", machine().describe_context(), sector_bytes(), info.sectorbytes); } lbasector = m_cylinder; - lbasector *= info->heads; + lbasector *= info.heads; lbasector += head(); - lbasector *= info->sectors; + lbasector *= info.sectors; lbasector += sector; return lbasector; @@ -578,7 +578,7 @@ hard_disk_file *file = m_drives[drive()]->get_hard_disk_file(); uint8_t dma = BIT(m_command, 3); - hard_disk_read(file, get_lbasector(), m_buffer); + file->read(get_lbasector(), m_buffer); m_buffer_index = 0; m_buffer_end = 512; @@ -603,7 +603,7 @@ logerror("%s: Unexpected unfilled buffer on write, only %d or %d bytes filled\n", machine().describe_context(), m_buffer_index, sector_bytes()); } - hard_disk_write(file, get_lbasector(), m_buffer); + file->write(get_lbasector(), m_buffer); end_command(); } @@ -619,7 +619,7 @@ for (int i = 0; i < m_sector_count; i++) { std::fill(std::begin(buffer), std::end(buffer), 0); - hard_disk_write(file, get_lbasector(), buffer); + file->write(get_lbasector(), buffer); } m_sector_count = 0; diff -Nru mame-0.242+dfsg.1/src/devices/machine/wd1010.cpp mame-0.243+dfsg.1/src/devices/machine/wd1010.cpp --- mame-0.242+dfsg.1/src/devices/machine/wd1010.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/machine/wd1010.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -303,13 +303,13 @@ int wd1010_device::get_lbasector() { hard_disk_file *file = m_drives[drive()].drive->get_hard_disk_file(); - hard_disk_info *info = hard_disk_get_info(file); + const auto &info = file->get_info(); int lbasector; lbasector = m_cylinder; - lbasector *= info->heads; + lbasector *= info.heads; lbasector += head(); - lbasector *= info->sectors; + lbasector *= info.sectors; lbasector += m_sector_number; return lbasector; @@ -535,10 +535,10 @@ } hard_disk_file *file = m_drives[drive()].drive->get_hard_disk_file(); - hard_disk_info *info = hard_disk_get_info(file); + const auto &info = file->get_info(); // verify that we can read - if (head() > info->heads) + if (head() > info.heads) { // out of range LOG("--> Head out of range, aborting\n"); @@ -557,7 +557,7 @@ LOGDATA("--> Transferring sector to buffer (lba = %08x)\n", get_lbasector()); - hard_disk_read(file, get_lbasector(), buffer); + file->read(get_lbasector(), buffer); for (int i = 0; i < 512; i++) m_out_data_cb(buffer[i]); @@ -626,7 +626,7 @@ buffer[i] = m_in_data_cb(); } - hard_disk_write(file, get_lbasector(), buffer); + file->write(get_lbasector(), buffer); // save last read head and sector number m_drives[drive()].head = head(); diff -Nru mame-0.242+dfsg.1/src/devices/machine/z80scc.cpp mame-0.243+dfsg.1/src/devices/machine/z80scc.cpp --- mame-0.242+dfsg.1/src/devices/machine/z80scc.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/machine/z80scc.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -136,14 +136,8 @@ #define FUNCNAME __PRETTY_FUNCTION__ #endif -/* LOCAL _BRG is set in z80scc.h, local timer based BRG is not complete and will be removed if not needed for synchrounous mode */ -#if Z80SCC_USE_LOCAL_BRG -#define START_BIT_HUNT 1 -#define START_BIT_ADJUST 1 -#else #define START_BIT_HUNT 0 #define START_BIT_ADJUST 0 -#endif #define CHANA_TAG "cha" #define CHANB_TAG "chb" @@ -1019,11 +1013,9 @@ z80scc_channel::z80scc_channel(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, Z80SCC_CHANNEL, tag, owner, clock), device_serial_interface(mconfig, *this), -#if Z80SCC_USE_LOCAL_BRG + m_baudtimer(0), m_brg_counter(0), -#else m_brg_rate(0), -#endif m_delayed_tx_brg_change(0), m_rx_error(0), m_rx_clock(0), @@ -1077,10 +1069,10 @@ m_tx_fifo_sz = (m_uart->m_variant & z80scc_device::SET_ESCC) ? 4 : 1; m_tx_fifo_wp = m_tx_fifo_rp = 0; -#if Z80SCC_USE_LOCAL_BRG - // baudrate clocks and timers - baudtimer = timer_alloc(TIMER_ID_BAUD); -#endif + m_rxc = 0x00; + m_txc = 0x00; + + m_baudtimer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(z80scc_channel::brg_tick), this)); // state saving save_item(NAME(m_rr0)); @@ -1137,6 +1129,12 @@ save_item(NAME(m_rts)); save_item(NAME(m_tx_int_disarm)); save_item(NAME(m_sync_pattern)); + save_item(NAME(m_rxd)); + save_item(NAME(m_rcv_mode)); + save_item(NAME(m_index)); + save_item(NAME(m_brg_rate)); + save_item(NAME(m_delayed_tx_brg_change)); + save_item(NAME(m_brg_counter)); } @@ -1183,39 +1181,14 @@ m_uart->reset_interrupts(); } m_extint_states = m_rr0; + m_baudtimer->adjust(attotime::never); + m_brg_counter = 0; } -void z80scc_channel::device_timer(emu_timer &timer, device_timer_id id, int param) +TIMER_CALLBACK_MEMBER(z80scc_channel::brg_tick) { -// LOG("%s %d\n", FUNCNAME, id); - -#if Z80SCC_USE_LOCAL_BRG - switch(id) - { - case TIMER_ID_BAUD: - { - //int brconst = m_wr13 << 8 | m_wr12 | 1; // If the counter is 1 the effect is passthrough ehh?! To avoid div0... - if (m_wr14 & WR14_BRG_ENABLE) - { - // int rate = owner()->clock() / brconst; - // attotime attorate = attotime::from_hz(rate); - // timer.adjust(attorate, id, attorate); - txc_w(m_brg_counter & 1); - rxc_w(m_brg_counter & 1); - m_brg_counter++; // Will just keep track of state in timer mode, not hardware counter value. - } - else - { - LOG(" - turning off Baudrate timer\n"); - timer.adjust(attotime::never, 0, attotime::never); - } - } - break; - default: - logerror("Spurious timer %d event\n", id); - break; - } -#endif + // wr15 & WR15_ZEROCOUNT is implied by this timer being running at all + m_uart->trigger_interrupt(m_index, INT_EXTERNAL); } @@ -1616,14 +1589,6 @@ return m_rr3; } -#if 0 // Short cutted in control_read() -/* RR8 is the Receive Data register. */ -uint8_t z80scc_channel::do_sccreg_rr8() -{ - return data_read(): -} -#endif - /* (ESCC and 85C30 Only) On the ESCC, Read Register 9 reflects the contents of Write Register 3 provided the Extended Read option has been enabled. On the NMOS/CMOS version, a read to this location returns an image @@ -2223,6 +2188,8 @@ WR14 contains some miscellaneous control bits */ void z80scc_channel::do_sccreg_wr14(uint8_t data) { + bool brg_change = false; + switch (data & WR14_DPLL_CMD_MASK) { case WR14_CMD_NULL: @@ -2283,23 +2250,13 @@ /* Based on baudrate code from 8530scc.cpp */ if ( !(m_wr14 & WR14_BRG_ENABLE) && (data & WR14_BRG_ENABLE) ) // baud rate generator being enabled? { + brg_change = true; LOG("%s: Misc Control Bits Baudrate generator enabled with %s source\n", FUNCNAME, (data & WR14_BRG_SOURCE) ? "PCLK" : "external clock"); - if (data & WR14_BRG_SOURCE) // Do we use the PCLK as baudrate source - { -#if Z80SCC_USE_LOCAL_BRG - baudtimer->adjust(attotime::from_hz(rate), TIMER_ID_BAUD, attotime::from_hz(rate)); // Start the baudrate generator -#if START_BIT_HUNT - m_rcv_mode = RCV_SEEKING; -#endif -#endif - } } else if ( (m_wr14 & WR14_BRG_ENABLE) && !(data & WR14_BRG_ENABLE) ) // baud rate generator being disabled? { -#if Z80SCC_USE_LOCAL_BRG - baudtimer->adjust(attotime::never, TIMER_ID_BAUD, attotime::never); // Stop the baudrate generator + m_baudtimer->adjust(attotime::never); // Stop the baudrate generator m_brg_counter = 0; -#endif } if (!(m_wr14 & WR14_LOCAL_LOOPBACK) && (data & WR14_LOCAL_LOOPBACK)) @@ -2308,6 +2265,7 @@ // TODO: Add info on the other bits of this register m_wr14 = data; update_serial(); + if (brg_change) update_baudtimer(); } /* WR15 is the External/Status Source Control register. If the External/Status interrupts are enabled @@ -2328,7 +2286,13 @@ LOG("CTS ints : %s\n", data & WR15_CTS ? WR15EN : "disabled"); LOG("Tx underr./EOM ints: %s\n", data & WR15_TX_EOM ? WR15NO : "disabled"); LOG("Break/Abort ints : %s\n", data & WR15_BREAK_ABORT ? WR15NO : "disabled"); + + const bool old_reg = m_wr15; m_wr15 = data; + if ((old_reg & WR15_ZEROCOUNT) != (m_wr15 & WR15_ZEROCOUNT)) + { + update_baudtimer(); + } } void z80scc_channel::scc_register_write(uint8_t reg, uint8_t data) @@ -2769,34 +2733,7 @@ //------------------------------------------------- void z80scc_channel::rxc_w(int state) { -/* Support for external clock as source for BRG yet to be finished */ -#if 0 - //LOG("Receiver Clock Pulse\n"); - if ( ((m_wr3 & WR3_RX_ENABLE) | (m_wr5 & WR5_TX_ENABLE)) && m_wr14 & WR14_BRG_ENABLE) - { - if (!(m_wr14 & WR14_BRG_SOURCE)) // Is the Baud rate Generator driven by RTxC? - { - printf("x"); - if (!m_brg_counter) // Zero crossing?! - { - printf("."); - m_brg_counter = m_wr13 << 8 | m_wr12; // Reload BRG counter - if ((m_wr11 & WR11_TRACLK_SRC_MASK) == WR11_TRACLK_SRC_BR) // Is transmitt clock driven by BRG? - { - printf("+"); - txc_w(state); - } - } - else - { - m_brg_counter--; - if ((m_wr11 & WR11_RCVCLK_SRC_MASK) == WR11_RCVCLK_SRC_BR) // Is receive clock driven by BRG and not zero cross - return; - } - } - } -#endif - + /* Support for external clock as source for BRG has not been added */ if (m_wr3 & WR3_RX_ENABLE) { int clocks = get_clock_mode(); @@ -2883,6 +2820,39 @@ return (rate / (2 * get_clock_mode())); } +void z80scc_channel::update_baudtimer() +{ + unsigned int rate; + unsigned int brg_const; + + if (m_wr14 & WR14_BRG_ENABLE) + { + brg_const = 2 + (m_wr13 << 8 | m_wr12); + if (m_wr14 & WR14_BRG_SOURCE) // Do we use the PCLK as baudrate source + { + rate = owner()->clock() / (brg_const == 0 ? 1 : brg_const); + } + else // Else we use the RTxC as BRG source + { + unsigned int source = (m_index == z80scc_device::CHANNEL_A) ? m_uart->m_rxca : m_uart->m_rxcb; + rate = source / (brg_const == 0 ? 1 : brg_const); + } + + if (m_wr15 & WR15_ZEROCOUNT) + { + m_baudtimer->adjust(attotime::from_hz(rate), 0, attotime::from_hz(rate)); + } + else + { + m_baudtimer->adjust(attotime::never); + } + } + else + { + m_baudtimer->adjust(attotime::never); + } +} + //------------------------------------------------- // update_serial - //------------------------------------------------- diff -Nru mame-0.242+dfsg.1/src/devices/machine/z80scc.h mame-0.243+dfsg.1/src/devices/machine/z80scc.h --- mame-0.242+dfsg.1/src/devices/machine/z80scc.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/machine/z80scc.h 2022-04-29 05:37:26.000000000 +0000 @@ -39,12 +39,6 @@ #include "diserial.h" //************************************************************************** -// DEVICE CONFIGURATION MACROS -//************************************************************************** - -#define Z80SCC_USE_LOCAL_BRG 0 - -//************************************************************************** // TYPE DEFINITIONS //************************************************************************** @@ -64,7 +58,6 @@ // device-level overrides virtual void device_start() override; virtual void device_reset() override; - virtual void device_timer(emu_timer &timer, device_timer_id id, int param) override; // device_serial_interface overrides virtual void tra_callback() override; @@ -129,6 +122,8 @@ void txc_w(int state); void sync_w(int state); + TIMER_CALLBACK_MEMBER(brg_tick); + int m_rxc; int m_txc; @@ -237,22 +232,12 @@ REG_WR15_EXT_ST_INT_CTRL= 15 }; - enum - { - TIMER_ID_BAUD, - TIMER_ID_XTAL, - TIMER_ID_RTXC, - TIMER_ID_TRXC - }; - -#if Z80SCC_USE_LOCAL_BRG - emu_timer *baudtimer; + emu_timer *m_baudtimer; uint16_t m_brg_counter; -#else unsigned int m_brg_rate; -#endif unsigned int m_delayed_tx_brg_change; unsigned int get_brg_rate(); + void update_baudtimer(); void scc_register_write(uint8_t reg, uint8_t data); uint8_t scc_register_read(uint8_t reg); diff -Nru mame-0.242+dfsg.1/src/devices/sound/cdda.cpp mame-0.243+dfsg.1/src/devices/sound/cdda.cpp --- mame-0.242+dfsg.1/src/devices/sound/cdda.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/sound/cdda.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -29,7 +29,7 @@ void cdda_device::device_start() { /* allocate an audio cache */ - m_audio_cache = std::make_unique(CD_MAX_SECTOR_DATA * MAX_SECTORS ); + m_audio_cache = std::make_unique(cdrom_file::MAX_SECTOR_DATA * MAX_SECTORS ); m_stream = stream_alloc(0, 2, clock()); @@ -47,7 +47,7 @@ save_item( NAME(m_audio_ended_normally) ); save_item( NAME(m_audio_lba) ); save_item( NAME(m_audio_length) ); - save_pointer( NAME(m_audio_cache), CD_MAX_SECTOR_DATA * MAX_SECTORS ); + save_pointer( NAME(m_audio_cache), cdrom_file::MAX_SECTOR_DATA * MAX_SECTORS ); save_item( NAME(m_audio_samples) ); save_item( NAME(m_audio_bptr) ); } @@ -114,7 +114,7 @@ uint32_t cdda_device::get_audio_lba() { m_stream->update(); - return m_audio_lba - ((m_audio_samples + (CD_MAX_SECTOR_DATA / 4) - 1) / (CD_MAX_SECTOR_DATA / 4)); + return m_audio_lba - ((m_audio_samples + (cdrom_file::MAX_SECTOR_DATA / 4) - 1) / (cdrom_file::MAX_SECTOR_DATA / 4)); } @@ -207,12 +207,12 @@ for (i = 0; i < sectors; i++) { - cdrom_read_data(m_disc, m_audio_lba, &m_audio_cache[CD_MAX_SECTOR_DATA*i], CD_TRACK_AUDIO); + m_disc->read_data(m_audio_lba, &m_audio_cache[cdrom_file::MAX_SECTOR_DATA*i], cdrom_file::CD_TRACK_AUDIO); m_audio_lba++; } - m_audio_samples = (CD_MAX_SECTOR_DATA*sectors)/4; + m_audio_samples = (cdrom_file::MAX_SECTOR_DATA*sectors)/4; m_audio_length -= sectors; /* reset feedout ptr */ diff -Nru mame-0.242+dfsg.1/src/devices/sound/disc_cls.h mame-0.243+dfsg.1/src/devices/sound/disc_cls.h --- mame-0.242+dfsg.1/src/devices/sound/disc_cls.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/sound/disc_cls.h 2022-04-29 05:37:26.000000000 +0000 @@ -25,7 +25,7 @@ #define DISCRETE_CLASS_NAME(_name) discrete_ ## _name ## _node -#define DISCRETE_CLASS_INPUT(_name, _num) inline double _name (void) { return *(m_input[_num]); } +#define DISCRETE_CLASS_INPUT(_name, _num) inline double _name() { return *(m_input[_num]); } #define DISCRETE_CLASS_CONSTRUCTOR(_name, _base) \ public: \ @@ -34,7 +34,7 @@ #define DISCRETE_CLASS_DESTRUCTOR(_name) \ public: \ - virtual ~ DISCRETE_CLASS_NAME(_name)(void) { } + virtual ~ DISCRETE_CLASS_NAME(_name)() { } #define DISCRETE_CLASS_STEP_RESET(_name, _maxout, _priv) \ class DISCRETE_CLASS_NAME(_name): public discrete_base_node, public discrete_step_interface \ @@ -42,9 +42,9 @@ DISCRETE_CLASS_CONSTRUCTOR(_name, base) \ DISCRETE_CLASS_DESTRUCTOR(_name) \ public: \ - virtual void step(void) override; \ - virtual void reset(void) override; \ - virtual int max_output(void) override { return _maxout; } \ + virtual void step() override; \ + virtual void reset() override; \ + virtual int max_output() override { return _maxout; } \ private: \ _priv \ } @@ -55,34 +55,34 @@ DISCRETE_CLASS_CONSTRUCTOR(_name, base) \ DISCRETE_CLASS_DESTRUCTOR(_name) \ public: \ - virtual void step(void) override; \ - virtual void reset(void) override { this->step(); } \ - virtual int max_output(void) override { return _maxout; } \ + virtual void step() override; \ + virtual void reset() override { this->step(); } \ + virtual int max_output() override { return _maxout; } \ private: \ _priv \ } -#define DISCRETE_CLASS_RESET(_name, _maxout) \ +#define DISCRETE_CLASS_RESET(_name, _maxout) \ class DISCRETE_CLASS_NAME(_name): public discrete_base_node \ { \ DISCRETE_CLASS_CONSTRUCTOR(_name, base) \ DISCRETE_CLASS_DESTRUCTOR(_name) \ public: \ - virtual void reset(void) override; \ - virtual int max_output(void) override { return _maxout; } \ + virtual void reset() override; \ + virtual int max_output() override { return _maxout; } \ } -#define DISCRETE_CLASS(_name, _maxout, _priv) \ +#define DISCRETE_CLASS(_name, _maxout, _priv) \ class DISCRETE_CLASS_NAME(_name): public discrete_base_node, public discrete_step_interface \ { \ DISCRETE_CLASS_DESTRUCTOR(_name) \ DISCRETE_CLASS_CONSTRUCTOR(_name, base) \ public: \ - virtual void step(void) override; \ - virtual void reset(void) override; \ - virtual void start(void) override; \ - virtual void stop(void) override; \ - virtual int max_output(void) override { return _maxout; } \ + virtual void step() override; \ + virtual void reset() override; \ + virtual void start() override; \ + virtual void stop() override; \ + virtual int max_output() override { return _maxout; } \ private: \ _priv \ } @@ -92,7 +92,7 @@ DISCRETE_CLASS_CONSTRUCTOR(special, base) DISCRETE_CLASS_DESTRUCTOR(special) public: - virtual int max_output(void) override { return 0; } + virtual int max_output() override { return 0; } }; class DISCRETE_CLASS_NAME(unimplemented): public discrete_base_node @@ -100,7 +100,7 @@ DISCRETE_CLASS_CONSTRUCTOR(unimplemented, base) DISCRETE_CLASS_DESTRUCTOR(unimplemented) public: - virtual int max_output(void) override { return 0; } + virtual int max_output() override { return 0; } }; /************************************* @@ -116,22 +116,22 @@ DISCRETE_CLASS_CONSTRUCTOR(dso_output, base) DISCRETE_CLASS_DESTRUCTOR(dso_output) public: - virtual void step(void) override { + virtual void step() override { /* Add gain to the output and put into the buffers */ /* Clipping will be handled by the main sound system */ double val = DISCRETE_INPUT(0) * DISCRETE_INPUT(1); m_outview->put(m_outview_sample++, val * (1.0 / 32768.0)); } - virtual int max_output(void) override { return 0; } + virtual int max_output() override { return 0; } virtual void set_output_ptr(write_stream_view &view) override { m_outview = &view; m_outview_sample = 0; } private: - write_stream_view *m_outview; - u32 m_outview_sample; + write_stream_view *m_outview = nullptr; + u32 m_outview_sample = 0U; }; DISCRETE_CLASS(dso_csvlog, 0, - FILE *m_csv_file; - int64_t m_sample_num; + FILE *m_csv_file = nullptr; + int64_t m_sample_num = 0; char m_name[32]; ); @@ -151,15 +151,15 @@ DISCRETE_CLASS_CONSTRUCTOR(dss_adjustment, base) DISCRETE_CLASS_DESTRUCTOR(dss_adjustment) public: - virtual void step(void) override; - virtual void reset(void) override; + virtual void step() override; + virtual void reset() override; private: - ioport_port *m_port; - int32_t m_lastpval; - int32_t m_pmin; - double m_pscale; - double m_min; - double m_scale; + ioport_port *m_port = 0; + int32_t m_lastpval = 0; + int32_t m_pmin = 0; + double m_pscale = 0.0; + double m_min = 0.0; + double m_scale = 0.0; }; DISCRETE_CLASS_RESET(dss_constant, 1); @@ -169,12 +169,12 @@ DISCRETE_CLASS_DESTRUCTOR(dss_input_data) DISCRETE_CLASS_CONSTRUCTOR(dss_input_data, base) public: - virtual void reset(void) override; + virtual void reset() override; virtual void input_write(int sub_node, uint8_t data ) override; private: - double m_gain; /* node gain */ - double m_offset; /* node offset */ - uint8_t m_data; /* data written */ + double m_gain = 0.0; /* node gain */ + double m_offset = 0.0; /* node offset */ + uint8_t m_data = 0; /* data written */ }; class DISCRETE_CLASS_NAME(dss_input_logic): public discrete_base_node, public discrete_input_interface @@ -182,12 +182,12 @@ DISCRETE_CLASS_CONSTRUCTOR(dss_input_logic, base) DISCRETE_CLASS_DESTRUCTOR(dss_input_logic) public: - virtual void reset(void) override; + virtual void reset() override; virtual void input_write(int sub_node, uint8_t data ) override; private: - double m_gain; /* node gain */ - double m_offset; /* node offset */ - uint8_t m_data; /* data written */ + double m_gain = 0.0; /* node gain */ + double m_offset = 0.0; /* node offset */ + uint8_t m_data = 0; /* data written */ }; class DISCRETE_CLASS_NAME(dss_input_not): public discrete_base_node, public discrete_input_interface @@ -195,12 +195,12 @@ DISCRETE_CLASS_CONSTRUCTOR(dss_input_not, base) DISCRETE_CLASS_DESTRUCTOR(dss_input_not) public: - virtual void reset(void) override; + virtual void reset() override; virtual void input_write(int sub_node, uint8_t data ) override; private: - double m_gain; /* node gain */ - double m_offset; /* node offset */ - uint8_t m_data; /* data written */ + double m_gain = 0.0; /* node gain */ + double m_offset = 0.0; /* node offset */ + uint8_t m_data = 0; /* data written */ }; class DISCRETE_CLASS_NAME(dss_input_pulse): public discrete_base_node, public discrete_input_interface, public discrete_step_interface @@ -208,13 +208,13 @@ DISCRETE_CLASS_CONSTRUCTOR(dss_input_pulse, base) DISCRETE_CLASS_DESTRUCTOR(dss_input_pulse) public: - virtual void step(void) override; - virtual void reset(void) override; + virtual void step() override; + virtual void reset() override; virtual void input_write(int sub_node, uint8_t data ) override; private: - //double m_gain; /* node gain */ - //double m_offset; /* node offset */ - uint8_t m_data; /* data written */ + //double m_gain = 0.0; /* node gain */ + //double m_offset = 0.0; /* node offset */ + uint8_t m_data = 0; /* data written */ }; class DISCRETE_CLASS_NAME(dss_input_stream): public discrete_base_node, public discrete_input_interface, public discrete_step_interface @@ -222,28 +222,28 @@ DISCRETE_CLASS_CONSTRUCTOR(dss_input_stream, base) DISCRETE_CLASS_DESTRUCTOR(dss_input_stream) public: - virtual void step(void) override; - virtual void reset(void) override; - virtual void start(void) override; + virtual void step() override; + virtual void reset() override; + virtual void start() override; virtual void input_write(int sub_node, uint8_t data ) override; - virtual bool is_buffered(void) { return false; } + virtual bool is_buffered() { return false; } /* This is called by discrete_sound_device */ - void stream_start(void); + void stream_start(); //protected: - uint32_t m_stream_in_number; - read_stream_view const *m_inview; /* current in ptr for stream */ - uint32_t m_inview_sample; + uint32_t m_stream_in_number = 0; + read_stream_view const *m_inview = nullptr; /* current in ptr for stream */ + uint32_t m_inview_sample = 0; private: void stream_generate(sound_stream &stream, std::vector const &inputs, std::vector &outputs); - double m_gain; /* node gain */ - double m_offset; /* node offset */ - uint8_t m_data; /* data written */ - uint8_t m_is_buffered; + double m_gain = 0.0; /* node gain */ + double m_offset = 0.0; /* node offset */ + uint8_t m_data = 0; /* data written */ + uint8_t m_is_buffered = 0; /* the buffer stream */ - sound_stream *m_buffer_stream; + sound_stream *m_buffer_stream = nullptr; }; class DISCRETE_CLASS_NAME(dss_input_buffer): public DISCRETE_CLASS_NAME(dss_input_stream) @@ -251,7 +251,7 @@ DISCRETE_CLASS_CONSTRUCTOR(dss_input_buffer, dss_input_stream) DISCRETE_CLASS_DESTRUCTOR(dss_input_buffer) public: - virtual bool is_buffered(void) override { return true; } + virtual bool is_buffered() override { return true; } }; #include "disc_wav.h" diff -Nru mame-0.242+dfsg.1/src/devices/sound/disc_dev.hxx mame-0.243+dfsg.1/src/devices/sound/disc_dev.hxx --- mame-0.242+dfsg.1/src/devices/sound/disc_dev.hxx 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/sound/disc_dev.hxx 2022-04-29 05:37:26.000000000 +0000 @@ -63,13 +63,13 @@ int count_f = 0; int count_r = 0; - double dt; /* change in time */ - double x_time = 0; /* time since change happened */ + double dt; /* change in time */ + double x_time = 0; /* time since change happened */ double v_cap = m_cap_voltage; /* Current voltage on capacitor, before dt */ - double v_cap_next = 0; /* Voltage on capacitor, after dt */ + double v_cap_next = 0; /* Voltage on capacitor, after dt */ double v_charge, exponent = 0; - uint8_t flip_flop = m_flip_flop; - uint8_t update_exponent = 0; + uint8_t flip_flop = m_flip_flop; + uint8_t update_exponent = 0; double v_out = 0.0; /* put commonly used stuff in local variables for speed */ diff -Nru mame-0.242+dfsg.1/src/devices/sound/disc_flt.h mame-0.243+dfsg.1/src/devices/sound/disc_flt.h --- mame-0.242+dfsg.1/src/devices/sound/disc_flt.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/sound/disc_flt.h 2022-04-29 05:37:26.000000000 +0000 @@ -25,155 +25,155 @@ struct discrete_filter_coeff { - double x1, x2; /* x[k-1], x[k-2], previous 2 input values */ - double y1, y2; /* y[k-1], y[k-2], previous 2 output values */ - double a1, a2; /* digital filter coefficients, denominator */ - double b0, b1, b2; /* digital filter coefficients, numerator */ + double x1 = 0.0, x2 = 0.0; /* x[k-1], x[k-2], previous 2 input values */ + double y1 = 0.0, y2 = 0.0; /* y[k-1], y[k-2], previous 2 output values */ + double a1 = 0.0, a2 = 0.0; /* digital filter coefficients, denominator */ + double b0 = 0.0, b1 = 0.0, b2 = 0.0; /* digital filter coefficients, numerator */ }; DISCRETE_CLASS_STEP_RESET(dst_filter1, 1, /* uses x1, y1, a1, b0, b1 */ - struct discrete_filter_coeff m_fc; + discrete_filter_coeff m_fc; ); DISCRETE_CLASS_STEP_RESET(dst_filter2, 1, - struct discrete_filter_coeff m_fc; + discrete_filter_coeff m_fc; ); DISCRETE_CLASS_STEP_RESET(dst_sallen_key, 1, - struct discrete_filter_coeff m_fc; + discrete_filter_coeff m_fc; ); DISCRETE_CLASS_STEP_RESET(dst_crfilter, 1, - double m_vCap; - double m_rc; - double m_exponent; - uint8_t m_has_rc_nodes; - //uint8_t m_is_fast; + double m_vCap = 0.0; + double m_rc = 0.0; + double m_exponent = 0.0; + uint8_t m_has_rc_nodes = 0; + //uint8_t m_is_fast = 0; ); DISCRETE_CLASS_STEP_RESET(dst_op_amp_filt, 1, - int m_type; /* What kind of filter */ - int m_is_norton; /* 1 = Norton op-amps */ - double m_vRef; - double m_vP; - double m_vN; - double m_rTotal; /* All input resistance in parallel. */ - double m_iFixed; /* Current supplied by r3 & r4 if used. */ - double m_exponentC1; - double m_exponentC2; - double m_exponentC3; - double m_rRatio; /* divide ratio of resistance network */ - double m_vC1; /* Charge on C1 */ - double m_vC1b; /* Charge on C1, part of C1 charge if needed */ - double m_vC2; /* Charge on C2 */ - double m_vC3; /* Charge on C2 */ - double m_gain; /* Gain of the filter */ - struct discrete_filter_coeff m_fc; + int m_type = 0; /* What kind of filter */ + int m_is_norton = 0; /* 1 = Norton op-amps */ + double m_vRef = 0.0; + double m_vP = 0.0; + double m_vN = 0.0; + double m_rTotal = 0.0; /* All input resistance in parallel. */ + double m_iFixed = 0.0; /* Current supplied by r3 & r4 if used. */ + double m_exponentC1 = 0.0; + double m_exponentC2 = 0.0; + double m_exponentC3 = 0.0; + double m_rRatio = 0.0; /* divide ratio of resistance network */ + double m_vC1 = 0.0; /* Charge on C1 */ + double m_vC1b = 0.0; /* Charge on C1, part of C1 charge if needed */ + double m_vC2 = 0.0; /* Charge on C2 */ + double m_vC3 = 0.0; /* Charge on C2 */ + double m_gain = 0.0; /* Gain of the filter */ + discrete_filter_coeff m_fc; ); DISCRETE_CLASS_STEP_RESET(dst_rc_circuit_1, 1, - double m_v_cap; - double m_v_charge_1_2; - double m_v_drop; - double m_exp_1; - double m_exp_1_2; - double m_exp_2; + double m_v_cap = 0.0; + double m_v_charge_1_2 = 0.0; + double m_v_drop = 0.0; + double m_exp_1 = 0.0; + double m_exp_1_2 = 0.0; + double m_exp_2 = 0.0; ); DISCRETE_CLASS_STEP_RESET(dst_rcdisc, 1, - int m_state; - double m_t; /* time */ - double m_exponent0; + int m_state = 0; + double m_t = 0.0; /* time */ + double m_exponent0 = 0.0; ); DISCRETE_CLASS_STEP_RESET(dst_rcdisc2, 1, - int m_state; - double m_v_out; - double m_t; /* time */ - double m_exponent0; - double m_exponent1; + int m_state = 0; + double m_v_out = 0.0; + double m_t = 0.0; /* time */ + double m_exponent0 = 0.0; + double m_exponent1 = 0.0; ); DISCRETE_CLASS_STEP_RESET(dst_rcdisc3, 1, - int m_state; - double m_v_out; - double m_t; /* time */ - double m_exponent0; - double m_exponent1; - double m_v_diode; /* rcdisc3 */ + int m_state = 0; + double m_v_out = 0.0; + double m_t = 0.0; /* time */ + double m_exponent0 = 0.0; + double m_exponent1 = 0.0; + double m_v_diode = 0.0; /* rcdisc3 */ ); DISCRETE_CLASS_STEP_RESET(dst_rcdisc4, 1, - int m_type; - double m_max_out; - double m_vC1; - double m_v[2]; - double m_exp[2]; + int m_type = 0; + double m_max_out = 0.0; + double m_vC1 = 0.0; + double m_v[2]{ 0.0 }; + double m_exp[2]{ 0.0 }; ); DISCRETE_CLASS_STEP_RESET(dst_rcdisc5, 1, - int m_state; - double m_t; /* time */ - double m_exponent0; - double m_v_cap; /* rcdisc5 */ + int m_state = 0; + double m_t = 0.0; /* time */ + double m_exponent0 = 0.0; + double m_v_cap = 0.0; /* rcdisc5 */ ); DISCRETE_CLASS_STEP_RESET(dst_rcintegrate, 1, - int m_type; - double m_gain_r1_r2; - double m_f; /* r2,r3 gain */ - double m_vCap; - double m_vCE; - double m_exponent0; - double m_exponent1; - double m_exp_exponent0; - double m_exp_exponent1; - double m_c_exp0; - double m_c_exp1; - double m_EM_IC_0_7; + int m_type = 0; + double m_gain_r1_r2 = 0.0; + double m_f = 0.0; /* r2,r3 gain */ + double m_vCap = 0.0; + double m_vCE = 0.0; + double m_exponent0 = 0.0; + double m_exponent1 = 0.0; + double m_exp_exponent0 = 0.0; + double m_exp_exponent1 = 0.0; + double m_c_exp0 = 0.0; + double m_c_exp1 = 0.0; + double m_EM_IC_0_7 = 0.0; ); DISCRETE_CLASS_STEP_RESET(dst_rcdisc_mod, 1, - double m_v_cap; - double m_exp_low[2]; - double m_exp_high[4]; - double m_gain[2]; - double m_vd_gain[4]; + double m_v_cap = 0.0; + double m_exp_low[2]{ 0.0 }; + double m_exp_high[4]{ 0.0 }; + double m_gain[2]{ 0.0 }; + double m_vd_gain[4]{ 0.0 }; ); DISCRETE_CLASS_STEP_RESET(dst_rcfilter, 1, - double m_v_out; - double m_vCap; - double m_rc; - double m_exponent; - uint8_t m_has_rc_nodes; - uint8_t m_is_fast; + double m_v_out = 0.0; + double m_vCap = 0.0; + double m_rc = 0.0; + double m_exponent = 0.0; + uint8_t m_has_rc_nodes = 0; + uint8_t m_is_fast = 0; ); DISCRETE_CLASS_STEP_RESET(dst_rcfilter_sw, 1, - double m_vCap[4]; - double m_exp[4]; - double m_exp0; /* fast case bit 0 */ - double m_exp1; /* fast case bit 1 */ - double m_factor; /* fast case */ - double m_f1[16]; - double m_f2[16]; + double m_vCap[4]{ 0.0 }; + double m_exp[4]{ 0.0 }; + double m_exp0 = 0.0; /* fast case bit 0 */ + double m_exp1 = 0.0; /* fast case bit 1 */ + double m_factor = 0.0; /* fast case */ + double m_f1[16]{ 0.0 }; + double m_f2[16]{ 0.0 }; ); DISCRETE_CLASS_STEP_RESET(dst_rcdiscN, 1, - double m_x1; /* x[k-1], previous input value */ - double m_y1; /* y[k-1], previous output value */ - double m_a1; /* digital filter coefficients, denominator */ - //double m_b[2]; /* digital filter coefficients, numerator */ + double m_x1 = 0.0; /* x[k-1], previous input value */ + double m_y1 = 0.0; /* y[k-1], previous output value */ + double m_a1 = 0.0; /* digital filter coefficients, denominator */ + //double m_b[2]{ 0.0 }; /* digital filter coefficients, numerator */ ); DISCRETE_CLASS_STEP_RESET(dst_rcdisc2N, 1, - struct discrete_filter_coeff m_fc0; - struct discrete_filter_coeff m_fc1; - double m_x1; - double m_y1; + discrete_filter_coeff m_fc0; + discrete_filter_coeff m_fc1; + double m_x1 = 0.0; + double m_y1 = 0.0; ); diff -Nru mame-0.242+dfsg.1/src/devices/sound/disc_mth.h mame-0.243+dfsg.1/src/devices/sound/disc_mth.h --- mame-0.242+dfsg.1/src/devices/sound/disc_mth.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/sound/disc_mth.h 2022-04-29 05:37:26.000000000 +0000 @@ -34,11 +34,11 @@ DISCRETE_CLASS_STEP(dst_logic_inv, 1, /* no context */ ); DISCRETE_CLASS_STEP_RESET(dst_bits_decode, 8, - int m_count; - int m_decode_x_time; - int m_from; - int m_last_val; - int m_last_had_x_time; + int m_count = 0; + int m_decode_x_time = 0; + int m_from = 0; + int m_last_val = 0; + int m_last_had_x_time = 0; ); DISCRETE_CLASS_STEP(dst_logic_and, 1, /* no context */ ); @@ -54,47 +54,47 @@ DISCRETE_CLASS_STEP(dst_logic_nxor, 1, /* no context */ ); DISCRETE_CLASS_STEP_RESET(dst_logic_dff, 1, - int m_last_clk; + int m_last_clk = 0; ); DISCRETE_CLASS_STEP_RESET(dst_logic_jkff, 1, - double m_v_out; - int m_last_clk; + double m_v_out = 0; + int m_last_clk = 0; ); DISCRETE_CLASS_STEP_RESET(dst_logic_shift, 1, - double m_t_left; /* time unused during last sample in seconds */ - uint32_t m_shift_data; - uint32_t m_bit_mask; - uint8_t m_clock_type; - uint8_t m_reset_on_high; - uint8_t m_shift_r; - uint8_t m_last; + double m_t_left = 0.0; /* time unused during last sample in seconds */ + uint32_t m_shift_data = 0; + uint32_t m_bit_mask = 0; + uint8_t m_clock_type = 0; + uint8_t m_reset_on_high = 0; + uint8_t m_shift_r = 0; + uint8_t m_last = 0; ); DISCRETE_CLASS_STEP(dst_lookup_table, 1, /* no context */ ); DISCRETE_CLASS_STEP_RESET(dst_multiplex, 1, - int m_size; + int m_size = 0; ); DISCRETE_CLASS_STEP_RESET(dst_oneshot, 1, - double m_countdown; - int m_state; - int m_last_trig; - int m_type; + double m_countdown = 0.0; + int m_state = 0; + int m_last_trig = 0; + int m_type = 0; ); DISCRETE_CLASS_STEP_RESET(dst_ramp, 1, - double m_v_out; - double m_step; - int m_dir; /* 1 if End is higher then Start */ - int m_last_en; /* Keep track of the last enable value */ + double m_v_out = 0.0; + double m_step = 0.0; + int m_dir = 0; /* 1 if End is higher then Start */ + int m_last_en = 0; /* Keep track of the last enable value */ ); DISCRETE_CLASS_STEP_RESET(dst_samphold, 1, - double m_last_input; - int m_clocktype; + double m_last_input = 0.0; + int m_clocktype = 0; ); DISCRETE_CLASS_STEP(dst_switch, 1, /* no context */ ); @@ -129,102 +129,102 @@ TOK_OR, /* Bitwise OR */ TOK_XOR /* Bitwise XOR */ }; - void step(void) override; - void reset(void) override; + void step() override; + void reset() override; private: DISCRETE_CLASS_INPUT(I_IN0, 0); DISCRETE_CLASS_INPUT(I_IN1, 1); DISCRETE_CLASS_INPUT(I_IN2, 2); DISCRETE_CLASS_INPUT(I_IN3, 3); DISCRETE_CLASS_INPUT(I_IN4, 4); - enum token precomp[32]; + enum token precomp[32]{ TOK_END }; }; /* Component specific */ DISCRETE_CLASS_STEP_RESET(dst_comp_adder, 1, - double m_total[256]; + double m_total[256]{ 0.0 }; ); DISCRETE_CLASS_STEP_RESET(dst_dac_r1, 1, - double m_v_out; - double m_exponent; - double m_last_v; - double m_v_step[256]; - int m_has_c_filter; + double m_v_out = 0.0; + double m_exponent = 0.0; + double m_last_v = 0.0; + double m_v_step[256]{ 0.0 }; + int m_has_c_filter = 0; ); DISCRETE_CLASS_STEP_RESET(dst_diode_mix, 1, - int m_size; - double m_v_junction[8]; + int m_size = 0; + double m_v_junction[8]{ 0.0 }; ); DISCRETE_CLASS_STEP_RESET(dst_integrate, 1, - double m_v_out; - double m_change; - double m_v_max_in; /* v1 - norton VBE */ - double m_v_max_in_d; /* v1 - norton VBE - diode drop */ - double m_v_max_out; + double m_v_out = 0.0; + double m_change = 0.0; + double m_v_max_in = 0.0; /* v1 - norton VBE */ + double m_v_max_in_d = 0.0; /* v1 - norton VBE - diode drop */ + double m_v_max_out = 0.0; ); #define DISC_MIXER_MAX_INPS 8 DISCRETE_CLASS_STEP_RESET(dst_mixer, 1, - int m_type; - int m_size; - int m_r_node_bit_flag; - int m_c_bit_flag; - double m_r_total; - const double * m_r_node[DISC_MIXER_MAX_INPS]; /* Either pointer to resistance node output OR nullptr */ - double m_r_last[DISC_MIXER_MAX_INPS]; - double m_exponent_rc[DISC_MIXER_MAX_INPS]; /* For high pass filtering cause by cIn */ - double m_v_cap[DISC_MIXER_MAX_INPS]; /* cap voltage of each input */ - double m_exponent_c_f; /* Low pass on mixed inputs */ - double m_exponent_c_amp; /* Final high pass caused by out cap and amp input impedance */ - double m_v_cap_f; /* cap voltage of cF */ - double m_v_cap_amp; /* cap voltage of cAmp */ - double m_gain; /* used for DISC_MIXER_IS_OP_AMP_WITH_RI */ + int m_type = 0; + int m_size = 0; + int m_r_node_bit_flag = 0; + int m_c_bit_flag = 0; + double m_r_total = 0.0; + const double * m_r_node[DISC_MIXER_MAX_INPS]{ nullptr }; /* Either pointer to resistance node output OR nullptr */ + double m_r_last[DISC_MIXER_MAX_INPS]{ 0.0 }; + double m_exponent_rc[DISC_MIXER_MAX_INPS]{ 0.0 }; /* For high pass filtering cause by cIn */ + double m_v_cap[DISC_MIXER_MAX_INPS]{ 0.0 }; /* cap voltage of each input */ + double m_exponent_c_f = 0.0; /* Low pass on mixed inputs */ + double m_exponent_c_amp = 0.0; /* Final high pass caused by out cap and amp input impedance */ + double m_v_cap_f = 0.0; /* cap voltage of cF */ + double m_v_cap_amp = 0.0; /* cap voltage of cAmp */ + double m_gain = 0.0; /* used for DISC_MIXER_IS_OP_AMP_WITH_RI */ ); DISCRETE_CLASS_STEP_RESET(dst_op_amp, 1, - uint8_t m_has_cap; - uint8_t m_has_r1; - uint8_t m_has_r4; - double m_v_max; - double m_i_fixed; - double m_v_cap; - double m_exponent; + uint8_t m_has_cap = 0; + uint8_t m_has_r1 = 0; + uint8_t m_has_r4 = 0; + double m_v_max = 0.0; + double m_i_fixed = 0.0; + double m_v_cap = 0.0; + double m_exponent = 0.0; ); DISCRETE_CLASS_STEP_RESET(dst_op_amp_1sht, 1, - double m_v_out; - double m_i_fixed; - double m_v_max; - double m_r34ratio; - double m_v_cap1; - double m_v_cap2; - double m_exponent1c; - double m_exponent1d; - double m_exponent2; + double m_v_out = 0.0; + double m_i_fixed = 0.0; + double m_v_max = 0.0; + double m_r34ratio = 0.0; + double m_v_cap1 = 0.0; + double m_v_cap2 = 0.0; + double m_exponent1c = 0.0; + double m_exponent1d = 0.0; + double m_exponent2 = 0.0; ); DISCRETE_CLASS_STEP_RESET(dst_tvca_op_amp, 1, - double m_v_out_max; /* Maximum output voltage */ - double m_v_trig[2]; /* Voltage used to charge cap1 based on function F3 */ - double m_v_trig2; /* Voltage used to charge cap2 */ - double m_v_trig3; /* Voltage used to charge cap3 */ - double m_i_fixed; /* Fixed current going into - input */ - double m_exponent_c[2]; /* Charge exponents based on function F3 */ - double m_exponent_d[2]; /* Discharge exponents based on function F3 */ - double m_exponent2[2]; /* Discharge/charge exponents based on function F4 */ - double m_exponent3[2]; /* Discharge/charge exponents based on function F5 */ - double m_exponent4; /* Discharge/charge exponents for c4 */ - double m_v_cap1; /* charge on cap c1 */ - double m_v_cap2; /* charge on cap c2 */ - double m_v_cap3; /* charge on cap c3 */ - double m_v_cap4; /* charge on cap c4 */ - double m_r67; /* = r6 + r7 (for easy use later) */ - uint8_t m_has_c4; - uint8_t m_has_r4; + double m_v_out_max = 0.0; /* Maximum output voltage */ + double m_v_trig[2]{ 0.0 }; /* Voltage used to charge cap1 based on function F3 */ + double m_v_trig2 = 0.0; /* Voltage used to charge cap2 */ + double m_v_trig3 = 0.0; /* Voltage used to charge cap3 */ + double m_i_fixed = 0.0; /* Fixed current going into - input */ + double m_exponent_c[2]{ 0.0 }; /* Charge exponents based on function F3 */ + double m_exponent_d[2]{ 0.0 }; /* Discharge exponents based on function F3 */ + double m_exponent2[2]{ 0.0 }; /* Discharge/charge exponents based on function F4 */ + double m_exponent3[2]{ 0.0 }; /* Discharge/charge exponents based on function F5 */ + double m_exponent4 = 0.0; /* Discharge/charge exponents for c4 */ + double m_v_cap1 = 0.0; /* charge on cap c1 */ + double m_v_cap2 = 0.0; /* charge on cap c2 */ + double m_v_cap3 = 0.0; /* charge on cap c3 */ + double m_v_cap4 = 0.0; /* charge on cap c4 */ + double m_r67 = 0.0; /* = r6 + r7 (for easy use later) */ + uint8_t m_has_c4 = 0; + uint8_t m_has_r4 = 0; ); DISCRETE_CLASS_STEP(dst_xtime_buffer, 1, /* no context */ ); diff -Nru mame-0.242+dfsg.1/src/devices/sound/discrete.cpp mame-0.243+dfsg.1/src/devices/sound/discrete.cpp --- mame-0.242+dfsg.1/src/devices/sound/discrete.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/sound/discrete.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -353,7 +353,7 @@ m_input_intf(nullptr), m_output_intf(nullptr) { - m_output[0] = 0.0; + std::fill(std::begin(m_output), std::end(m_output), 0.0); } diff -Nru mame-0.242+dfsg.1/src/devices/sound/discrete.h mame-0.243+dfsg.1/src/devices/sound/discrete.h --- mame-0.242+dfsg.1/src/devices/sound/discrete.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/sound/discrete.h 2022-04-29 05:37:26.000000000 +0000 @@ -7,6 +7,7 @@ #include "machine/rescap.h" +#include #include @@ -4177,8 +4178,6 @@ class discrete_device : public device_t { - //friend class discrete_base_node; - protected: // construction/destruction discrete_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); @@ -4410,7 +4409,7 @@ public: static std::unique_ptr create(discrete_device &pdev, const discrete_block &block) { - std::unique_ptr r = make_unique_clear(); + std::unique_ptr r = std::make_unique(); r->init(&pdev, &block); return r; diff -Nru mame-0.242+dfsg.1/src/devices/sound/disc_wav.h mame-0.243+dfsg.1/src/devices/sound/disc_wav.h --- mame-0.242+dfsg.1/src/devices/sound/disc_wav.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/sound/disc_wav.h 2022-04-29 05:37:26.000000000 +0000 @@ -24,75 +24,75 @@ #include "discrete.h" DISCRETE_CLASS_STEP_RESET(dss_counter, 1, - int m_clock_type; - int m_out_type; - int m_is_7492; - int m_last_clock; - uint32_t m_last_count; - //uint32_t m_last; /* Last clock state */ - uint32_t m_min; - uint32_t m_max; - uint32_t m_diff; - double m_t_left; /* time unused during last sample in seconds */ + int m_clock_type = 0; + int m_out_type = 0; + int m_is_7492 = 0; + int m_last_clock = 0; + uint32_t m_last_count = 0; + //uint32_t m_last = 0; /* Last clock state */ + uint32_t m_min = 0; + uint32_t m_max = 0; + uint32_t m_diff = 0; + double m_t_left = 0.0; /* time unused during last sample in seconds */ ); DISCRETE_CLASS_STEP_RESET(dss_lfsr_noise, 2, - unsigned int m_lfsr_reg; - int m_last; /* Last clock state */ - double m_t_clock; /* fixed counter clock in seconds */ - double m_t_left; /* time unused during last sample in seconds */ - //double m_sample_step; - //double m_t; - uint8_t m_reset_on_high; - uint8_t m_invert_output; - uint8_t m_out_is_f0; - uint8_t m_out_lfsr_reg; + unsigned int m_lfsr_reg = 0; + int m_last = 0; /* Last clock state */ + double m_t_clock = 0.0; /* fixed counter clock in seconds */ + double m_t_left = 0.0; /* time unused during last sample in seconds */ + //double m_sample_step = 0.0; + //double m_t = 0.0; + uint8_t m_reset_on_high = 0; + uint8_t m_invert_output = 0; + uint8_t m_out_is_f0 = 0; + uint8_t m_out_lfsr_reg = 0; ); DISCRETE_CLASS_STEP_RESET(dss_noise, 2, - double m_phase; + double m_phase = 0.0; ); DISCRETE_CLASS_STEP_RESET(dss_note, 1, - int m_clock_type; - int m_out_type; - int m_last; /* Last clock state */ - double m_t_clock; /* fixed counter clock in seconds */ - double m_t_left; /* time unused during last sample in seconds */ - int m_max1; /* Max 1 Count stored as int for easy use. */ - int m_max2; /* Max 2 Count stored as int for easy use. */ - int m_count1; /* current count1 */ - int m_count2; /* current count2 */ + int m_clock_type = 0; + int m_out_type = 0; + int m_last = 0; /* Last clock state */ + double m_t_clock = 0.0; /* fixed counter clock in seconds */ + double m_t_left = 0.0; /* time unused during last sample in seconds */ + int m_max1 = 0; /* Max 1 Count stored as int for easy use. */ + int m_max2 = 0; /* Max 2 Count stored as int for easy use. */ + int m_count1 = 0; /* current count1 */ + int m_count2 = 0; /* current count2 */ ); DISCRETE_CLASS_STEP_RESET(dss_sawtoothwave, 1, - double m_phase; - int m_type; + double m_phase = 0.0; + int m_type = 0; ); DISCRETE_CLASS_STEP_RESET(dss_sinewave, 1, - double m_phase; + double m_phase = 0.0; ); DISCRETE_CLASS_STEP_RESET(dss_squarewave, 1, - double m_phase; - double m_trigger; + double m_phase = 0.0; + double m_trigger = 0.0; ); DISCRETE_CLASS_STEP_RESET(dss_squarewfix, 1, - int m_flip_flop; - double m_sample_step; - double m_t_left; - double m_t_off; - double m_t_on; + int m_flip_flop = 0; + double m_sample_step = 0.0; + double m_t_left = 0.0; + double m_t_off = 0.0; + double m_t_on = 0.0; ); DISCRETE_CLASS_STEP_RESET(dss_squarewave2, 1, - double m_phase; - double m_trigger; + double m_phase = 0.0; + double m_trigger = 0.0; ); DISCRETE_CLASS_STEP_RESET(dss_trianglewave, 1, - double m_phase; + double m_phase = 0.0; ); /* Component specific modules */ @@ -107,13 +107,13 @@ public: struct description { - double vB; - double vOutLow; - double vOutHigh; - double vInFall; // voltage that triggers the gate input to go low (0V) on fall - double vInRise; // voltage that triggers the gate input to go high (vGate) on rise - double clamp; // voltage is clamped to -clamp ... vb+clamp if clamp>= 0; - int options; // bitmapped options + double vB = 0.0; + double vOutLow = 0.0; + double vOutHigh = 0.0; + double vInFall = 0.0; // voltage that triggers the gate input to go low (0V) on fall + double vInRise = 0.0; // voltage that triggers the gate input to go high (vGate) on rise + double clamp = 0.0; // voltage is clamped to -clamp ... vb+clamp if clamp>= 0; + int options = 0.0; // bitmapped options }; enum { IS_TYPE1 = 0x00, @@ -124,8 +124,8 @@ TYPE_MASK = 0x0f, OUT_IS_LOGIC = 0x10 }; - void step(void) override; - void reset(void) override; + void step() override; + void reset() override; protected: inline double tftab(double x); inline double tf(double x); @@ -137,56 +137,56 @@ DISCRETE_CLASS_INPUT(I_C, 4); DISCRETE_CLASS_INPUT(I_R2, 5); - double mc_v_cap; - double mc_v_g2_old; - double mc_w; - double mc_wc; - double mc_rp; - double mc_r1; - double mc_r2; - double mc_c; - double mc_tf_a; - double mc_tf_b; - double mc_tf_tab[DSS_INV_TAB_SIZE]; + double mc_v_cap = 0.0; + double mc_v_g2_old = 0.0; + double mc_w = 0.0; + double mc_wc = 0.0; + double mc_rp = 0.0; + double mc_r1 = 0.0; + double mc_r2 = 0.0; + double mc_c = 0.0; + double mc_tf_a = 0.0; + double mc_tf_b = 0.0; + double mc_tf_tab[DSS_INV_TAB_SIZE]{ 0.0 }; }; DISCRETE_CLASS_STEP_RESET(dss_op_amp_osc, 1, - const double * m_r[8]; /* pointers to resistor values */ - int m_type; - uint8_t m_flip_flop; /* flip/flop output state */ - uint8_t m_flip_flop_xor; /* flip_flop ^ flip_flop_xor, 0 = discharge, 1 = charge */ - uint8_t m_output_type; - uint8_t m_has_enable; - double m_v_out_high; - double m_threshold_low; /* falling threshold */ - double m_threshold_high; /* rising threshold */ - double m_v_cap; /* current capacitor voltage */ - double m_r_total; /* all input resistors in parallel */ - double m_i_fixed; /* fixed current at the input */ - double m_i_enable; /* fixed current at the input if enabled */ - double m_temp1; /* Multi purpose */ - double m_temp2; /* Multi purpose */ - double m_temp3; /* Multi purpose */ - double m_is_linear_charge; - double m_charge_rc[2]; - double m_charge_exp[2]; - double m_charge_v[2]; + const double * m_r[8]{ nullptr }; /* pointers to resistor values */ + int m_type = 0; + uint8_t m_flip_flop = 0; /* flip/flop output state */ + uint8_t m_flip_flop_xor = 0; /* flip_flop ^ flip_flop_xor, 0 = discharge, 1 = charge */ + uint8_t m_output_type = 0; + uint8_t m_has_enable = 0; + double m_v_out_high = 0.0; + double m_threshold_low = 0.0; /* falling threshold */ + double m_threshold_high = 0.0; /* rising threshold */ + double m_v_cap = 0.0; /* current capacitor voltage */ + double m_r_total = 0.0; /* all input resistors in parallel */ + double m_i_fixed = 0.0; /* fixed current at the input */ + double m_i_enable = 0.0; /* fixed current at the input if enabled */ + double m_temp1 = 0.0; /* Multi purpose */ + double m_temp2 = 0.0; /* Multi purpose */ + double m_temp3 = 0.0; /* Multi purpose */ + double m_is_linear_charge = 0.0; + double m_charge_rc[2]{ 0.0 }; + double m_charge_exp[2]{ 0.0 }; + double m_charge_v[2]{ 0.0 }; ); DISCRETE_CLASS_STEP_RESET(dss_schmitt_osc, 1, - double m_ration_in; /* ratio of total charging voltage that comes from the input */ - double m_ratio_feedback; /* ratio of total charging voltage that comes from the feedback */ - double m_v_cap; /* current capacitor voltage */ - double m_rc; /* r*c */ - double m_exponent; - int m_state; /* state of the output */ - int m_enable_type; - uint8_t m_input_is_voltage; + double m_ration_in = 0.0; /* ratio of total charging voltage that comes from the input */ + double m_ratio_feedback = 0.0; /* ratio of total charging voltage that comes from the feedback */ + double m_v_cap = 0.0; /* current capacitor voltage */ + double m_rc = 0.0; /* r*c */ + double m_exponent = 0.0; + int m_state = 0; /* state of the output */ + int m_enable_type = 0; + uint8_t m_input_is_voltage = 0; ); /* Not yet implemented */ DISCRETE_CLASS_STEP_RESET(dss_adsrenv, 1, - //double m_phase; + //double m_phase = 0.0; ); diff -Nru mame-0.242+dfsg.1/src/devices/sound/gb.cpp mame-0.243+dfsg.1/src/devices/sound/gb.cpp --- mame-0.242+dfsg.1/src/devices/sound/gb.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/sound/gb.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -191,13 +191,13 @@ memset(&m_snd_4, 0, sizeof(m_snd_4)); m_snd_1.channel = 1; - m_snd_1.length_mask = 0x3F; + m_snd_1.length_mask = 0x3f; m_snd_2.channel = 2; - m_snd_2.length_mask = 0x3F; + m_snd_2.length_mask = 0x3f; m_snd_3.channel = 3; - m_snd_3.length_mask = 0xFF; + m_snd_3.length_mask = 0xff; m_snd_4.channel = 4; - m_snd_4.length_mask = 0x3F; + m_snd_4.length_mask = 0x3f; sound_w_internal(NR52, 0x00); m_snd_regs[AUD3W0] = 0xac; @@ -224,21 +224,21 @@ gameboy_sound_device::device_reset(); m_snd_regs[AUD3W0] = 0x00; - m_snd_regs[AUD3W1] = 0xFF; + m_snd_regs[AUD3W1] = 0xff; m_snd_regs[AUD3W2] = 0x00; - m_snd_regs[AUD3W3] = 0xFF; + m_snd_regs[AUD3W3] = 0xff; m_snd_regs[AUD3W4] = 0x00; - m_snd_regs[AUD3W5] = 0xFF; + m_snd_regs[AUD3W5] = 0xff; m_snd_regs[AUD3W6] = 0x00; - m_snd_regs[AUD3W7] = 0xFF; + m_snd_regs[AUD3W7] = 0xff; m_snd_regs[AUD3W8] = 0x00; - m_snd_regs[AUD3W9] = 0xFF; + m_snd_regs[AUD3W9] = 0xff; m_snd_regs[AUD3WA] = 0x00; - m_snd_regs[AUD3WB] = 0xFF; + m_snd_regs[AUD3WB] = 0xff; m_snd_regs[AUD3WC] = 0x00; - m_snd_regs[AUD3WD] = 0xFF; + m_snd_regs[AUD3WD] = 0xff; m_snd_regs[AUD3WE] = 0x00; - m_snd_regs[AUD3WF] = 0xFF; + m_snd_regs[AUD3WF] = 0xff; } @@ -272,7 +272,7 @@ snd.sweep_neg_mode_used = (snd.sweep_direction < 0); int32_t new_frequency = snd.frequency + snd.sweep_direction * (snd.frequency >> snd.sweep_shift); - if (new_frequency > 0x7FF) + if (new_frequency > 0x7ff) { snd.on = false; } @@ -288,7 +288,7 @@ if (snd.on && snd.sweep_shift > 0) { snd.frequency = new_frequency; - snd.reg[3] = snd.frequency & 0xFF; + snd.reg[3] = snd.frequency & 0xff; } } @@ -339,7 +339,7 @@ bool gameboy_sound_device::dac_enabled(struct SOUND &snd) { - return (snd.channel != 3) ? snd.reg[2] & 0xF8 : snd.reg[0] & 0x80; + return (snd.channel != 3) ? snd.reg[2] & 0xf8 : snd.reg[0] & 0x80; } @@ -386,11 +386,11 @@ snd.cycles_left -= 2; // Calculate next state - snd.frequency_counter = (snd.frequency_counter + 1) & 0x7FF; + snd.frequency_counter = (snd.frequency_counter + 1) & 0x7ff; snd.sample_reading = false; if (snd.frequency_counter == 0x7ff) { - snd.offset = (snd.offset + 1) & 0x1F; + snd.offset = (snd.offset + 1) & 0x1f; } if (snd.frequency_counter == 0) { @@ -401,7 +401,7 @@ { snd.current_sample >>= 4; } - snd.current_sample = (snd.current_sample & 0x0F) - 8; + snd.current_sample = (snd.current_sample & 0x0f) - 8; snd.signal = snd.level ? snd.current_sample / (1 << (snd.level - 1)) : 0; @@ -432,13 +432,13 @@ // How many times the condition snd.frequency_counter == 0 is true uint64_t counter = 1 + cycles / distance; - snd.offset = (snd.offset + counter) & 0x1F; + snd.offset = (snd.offset + counter) & 0x1f; snd.current_sample = m_snd_regs[AUD3W0 + snd.offset / 2]; if (!(snd.offset & 1)) { snd.current_sample >>= 4; } - snd.current_sample = (snd.current_sample & 0x0F) - 8; + snd.current_sample = (snd.current_sample & 0x0f) - 8; snd.signal = snd.level ? snd.current_sample / (1 << (snd.level - 1)) : 0; cycles %= distance; @@ -572,7 +572,7 @@ if (m_snd_3.on) { - return m_snd_3.sample_reading ? m_snd_regs[AUD3W0 + (m_snd_3.offset/2)] : 0xFF; + return m_snd_3.sample_reading ? m_snd_regs[AUD3W0 + (m_snd_3.offset/2)] : 0xff; } return m_snd_regs[AUD3W0 + offset]; @@ -597,8 +597,8 @@ { static const uint8_t read_mask[0x40] = { - 0x80,0x3F,0x00,0xFF,0xBF,0xFF,0x3F,0x00,0xFF,0xBF,0x7F,0xFF,0x9F,0xFF,0xBF,0xFF, - 0xFF,0x00,0x00,0xBF,0x00,0x00,0x70,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, + 0x80,0x3f,0x00,0xff,0xbf,0xff,0x3f,0x00,0xff,0xbf,0x7f,0xff,0x9f,0xff,0xbf,0xff, + 0xff,0x00,0x00,0xbf,0x00,0x00,0x70,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; @@ -613,11 +613,11 @@ { return (m_snd_regs[NR52]&0xf0) | (m_snd_1.on ? 1 : 0) | (m_snd_2.on ? 2 : 0) | (m_snd_3.on ? 4 : 0) | (m_snd_4.on ? 8 : 0) | 0x70; } - return m_snd_regs[offset] | read_mask[offset & 0x3F]; + return m_snd_regs[offset] | read_mask[offset & 0x3f]; } else { - return read_mask[offset & 0x3F]; + return read_mask[offset & 0x3f]; } } diff -Nru mame-0.242+dfsg.1/src/devices/sound/huc6230.cpp mame-0.243+dfsg.1/src/devices/sound/huc6230.cpp --- mame-0.242+dfsg.1/src/devices/sound/huc6230.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/sound/huc6230.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -23,6 +23,10 @@ { for (int i = 0; i < outputs[0].samples(); i++) { + // TODO: this implies to read from the PSG inputs + // doesn't seem right at all, eventually causes extreme DC offset on BIOS main menu, + // possibly because adpcm_timer runs from a different thread, + // needs to be rechecked once we have better examples ... s32 samp0 = inputs[0].get(i) * 32768.0; s32 samp1 = inputs[1].get(i) * 32768.0; @@ -33,8 +37,9 @@ if (!channel->m_playing) continue; - samp0 = std::clamp(samp0 + ((channel->m_output * channel->m_lvol) >> 3), -32768, 32767); - samp1 = std::clamp(samp1 + ((channel->m_output * channel->m_rvol) >> 3), -32768, 32767); + // TODO: wrong volume scales + samp0 = std::clamp(samp0 + ((channel->m_output * channel->m_lvol) >> 4), -32768, 32767); + samp1 = std::clamp(samp1 + ((channel->m_output * channel->m_rvol) >> 4), -32768, 32767); } outputs[0].put_int(i, samp0, 32768); @@ -124,6 +129,8 @@ } int32_t new_output; + // TODO: BIOS doesn't use interpolation + // which actually is linear interpolation off/on ... if (!channel->m_interpolate) new_output = channel->m_curr_sample; else diff -Nru mame-0.242+dfsg.1/src/devices/sound/mas3507d.cpp mame-0.243+dfsg.1/src/devices/sound/mas3507d.cpp --- mame-0.242+dfsg.1/src/devices/sound/mas3507d.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/sound/mas3507d.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -17,7 +17,7 @@ #define MINIMP3_ONLY_MP3 #define MINIMP3_NO_STDIO #define MINIMP3_IMPLEMENTATION -#define MAX_FRAME_SYNC_MATCHES 1 +#define MAX_FRAME_SYNC_MATCHES 3 #include "minimp3/minimp3.h" #include "minimp3/minimp3_ex.h" @@ -49,7 +49,7 @@ mas3507d_device::mas3507d_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MAS3507D, tag, owner, clock) , device_sound_interface(mconfig, *this) - , cb_sample(*this) + , cb_mpeg_frame_sync(*this), cb_demand(*this) , i2c_bus_state(IDLE), i2c_bus_address(UNKNOWN), i2c_subdest(UNDEFINED), i2c_command(CMD_BAD) , i2c_scli(false), i2c_sclo(false), i2c_sdai(false), i2c_sdao(false) , i2c_bus_curbit(0), i2c_bus_curval(0), i2c_bytecount(0), i2c_io_bank(0), i2c_io_adr(0), i2c_io_count(0), i2c_io_val(0) @@ -58,9 +58,10 @@ void mas3507d_device::device_start() { - current_rate = 44100; // TODO: related to clock/divider - stream = stream_alloc(0, 2, current_rate); - cb_sample.resolve(); + stream = stream_alloc(0, 2, 44100); + + cb_mpeg_frame_sync.resolve(); + cb_demand.resolve(); save_item(NAME(mp3data)); save_item(NAME(samples)); @@ -74,8 +75,8 @@ save_item(NAME(i2c_sdao)); save_item(NAME(i2c_bus_curbit)); save_item(NAME(i2c_bus_curval)); + save_item(NAME(mp3data_count)); - save_item(NAME(current_rate)); save_item(NAME(decoded_frame_count)); save_item(NAME(decoded_samples)); save_item(NAME(sample_count)); @@ -90,6 +91,7 @@ save_item(NAME(i2c_io_val)); save_item(NAME(i2c_sdao_data)); save_item(NAME(playback_status)); + save_item(NAME(mp3_is_buffered)); // This should be removed in the future if/when native MP3 decoding is implemented in MAME save_item(NAME(mp3_dec.mdct_overlap)); @@ -119,6 +121,8 @@ is_muted = false; gain_ll = gain_rr = 0; + stream->set_sample_rate(44100); + reset_playback(); } @@ -355,11 +359,11 @@ LOGOTHER("MAS I2C: got stop\n"); } -int gain_to_db(double val) { +int mas3507d_device::gain_to_db(double val) { return round(20 * log10((0x100000 - val) / 0x80000)); } -float gain_to_percentage(int val) { +float mas3507d_device::gain_to_percentage(int val) { if(val == 0) return 0; // Special case for muting it seems @@ -425,30 +429,53 @@ } } +void mas3507d_device::sid_w(uint8_t byte) +{ + if (mp3data_count >= mp3data.size()) { + std::copy(mp3data.begin() + 1, mp3data.end(), mp3data.begin()); + mp3data_count--; + } + + mp3data[mp3data_count++] = byte; + + if (!mp3_is_buffered) { + // Only start the decoder when a full MP3 frame is found + int free_format_bytes = 0, frame_size = 0; + int frame_offset = mp3d_find_frame(static_cast(&mp3data[0]), mp3data_count, &free_format_bytes, &frame_size); + mp3_is_buffered = frame_size && frame_offset + frame_size < mp3data_count; + } + + cb_demand(!mp3_is_buffered || mp3data_count < mp3data.size()); +} + void mas3507d_device::fill_buffer() { - while(mp3data_count + 2 < mp3data.size()) { - uint16_t v = cb_sample(); - mp3data[mp3data_count++] = v >> 8; - mp3data[mp3data_count++] = v; + cb_mpeg_frame_sync(0); + + if (!mp3_is_buffered) { + cb_demand(!mp3_is_buffered || mp3data_count < mp3data.size()); + return; } + memset(&mp3_info, 0, sizeof(mp3dec_frame_info_t)); sample_count = mp3dec_decode_frame(&mp3_dec, static_cast(&mp3data[0]), mp3data_count, static_cast(&samples[0]), &mp3_info); samples_idx = 0; - playback_status = PLAYBACK_STATE_BUFFER_FULL; - if(sample_count == 0) + if (sample_count == 0) { + // Frame decode failed + reset_playback(); return; + } std::copy(mp3data.begin() + mp3_info.frame_bytes, mp3data.end(), mp3data.begin()); mp3data_count -= mp3_info.frame_bytes; - if(mp3_info.hz != current_rate) { - current_rate = mp3_info.hz; - stream->set_sample_rate(current_rate); - } + stream->set_sample_rate(mp3_info.hz); decoded_frame_count++; + cb_mpeg_frame_sync(1); + + cb_demand(!mp3_is_buffered || mp3data_count < mp3data.size()); } void mas3507d_device::append_buffer(std::vector &outputs, int &pos, int scount) @@ -459,8 +486,6 @@ if(s1 > sample_count) s1 = sample_count; - playback_status = PLAYBACK_STATE_DEMAND_BUFFER; - for(int i = 0; i < s1; i++) { outputs[0].put_int(pos, samples[samples_idx * bytes_per_sample], 32768); outputs[1].put_int(pos, samples[samples_idx * bytes_per_sample + (bytes_per_sample >> 1)], 32768); @@ -478,22 +503,20 @@ void mas3507d_device::reset_playback() { + if (mp3data_count != 0) + std::fill(mp3data.begin(), mp3data.end(), 0); + + if (sample_count != 0 || decoded_samples != 0) + std::fill(samples.begin(), samples.end(), 0); + mp3dec_init(&mp3_dec); mp3data_count = 0; sample_count = 0; decoded_frame_count = 0; decoded_samples = 0; - playback_status = PLAYBACK_STATE_IDLE; - is_started = false; samples_idx = 0; - std::fill(mp3data.begin(), mp3data.end(), 0); - std::fill(samples.begin(), samples.end(), 0); -} -void mas3507d_device::start_playback() -{ - reset_playback(); - is_started = true; + mp3_is_buffered = false; } void mas3507d_device::sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) @@ -502,13 +525,10 @@ int pos = 0; while(pos < csamples) { - if(is_started && sample_count == 0) + if(sample_count == 0) fill_buffer(); - if(!is_started || sample_count <= 0) { - playback_status = PLAYBACK_STATE_IDLE; - decoded_frame_count = 0; - decoded_samples = 0; + if(sample_count <= 0) { outputs[0].fill(0, pos); outputs[1].fill(0, pos); return; diff -Nru mame-0.242+dfsg.1/src/devices/sound/mas3507d.h mame-0.243+dfsg.1/src/devices/sound/mas3507d.h --- mame-0.242+dfsg.1/src/devices/sound/mas3507d.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/sound/mas3507d.h 2022-04-29 05:37:26.000000000 +0000 @@ -12,31 +12,22 @@ class mas3507d_device : public device_t, public device_sound_interface { public: - enum { - PLAYBACK_STATE_IDLE, - PLAYBACK_STATE_BUFFER_FULL, - PLAYBACK_STATE_DEMAND_BUFFER - }; - // construction/destruction mas3507d_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); - auto sample_cb() { return cb_sample.bind(); } + auto mpeg_frame_sync_cb() { return cb_mpeg_frame_sync.bind(); } + auto demand_cb() { return cb_demand.bind(); } int i2c_scl_r(); int i2c_sda_r(); void i2c_scl_w(bool line); void i2c_sda_w(bool line); - uint32_t get_samples() const { return decoded_samples; } - uint32_t get_status() const { return playback_status; } + void sid_w(uint8_t byte); void update_stream() { stream->update(); } void reset_playback(); - void start_playback(); - - bool is_started; protected: virtual void device_start() override; @@ -56,7 +47,11 @@ void fill_buffer(); void append_buffer(std::vector &outputs, int &pos, int scount); - devcb_read16 cb_sample; + int gain_to_db(double val); + float gain_to_percentage(int val); + + devcb_write_line cb_mpeg_frame_sync; + devcb_write_line cb_demand; enum { CMD_DEV_WRITE = 0x3a, @@ -92,7 +87,8 @@ uint32_t i2c_io_bank, i2c_io_adr, i2c_io_count, i2c_io_val; uint32_t i2c_sdao_data; - uint32_t mp3data_count, current_rate; + bool mp3_is_buffered; + uint32_t mp3data_count; uint32_t decoded_frame_count, decoded_samples; int32_t sample_count, samples_idx; diff -Nru mame-0.242+dfsg.1/src/devices/sound/mos6581.cpp mame-0.243+dfsg.1/src/devices/sound/mos6581.cpp --- mame-0.242+dfsg.1/src/devices/sound/mos6581.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/sound/mos6581.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -45,7 +45,6 @@ , m_read_poty(*this) , m_stream(nullptr) , m_variant(variant) - , m_token(make_unique_clear()) { } @@ -202,6 +201,7 @@ m_stream = stream_alloc(0, 1, machine().sample_rate()); // initialize SID engine + m_token = std::make_unique(); m_token->device = this; m_token->mixer_channel = m_stream; m_token->PCMfreq = machine().sample_rate(); diff -Nru mame-0.242+dfsg.1/src/devices/sound/sid.h mame-0.243+dfsg.1/src/devices/sound/sid.h --- mame-0.242+dfsg.1/src/devices/sound/sid.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/sound/sid.h 2022-04-29 05:37:26.000000000 +0000 @@ -17,42 +17,42 @@ { static constexpr uint8_t max_voices = 3; - device_t *device; - sound_stream *mixer_channel; // mame stream/ mixer channel + device_t *device = nullptr; + sound_stream *mixer_channel = nullptr; // mame stream/ mixer channel - int type; - uint32_t clock; + int type = 0; + uint32_t clock = 0; - uint16_t PCMfreq; // samplerate of the current systems soundcard/DAC - uint32_t PCMsid, PCMsidNoise; + uint16_t PCMfreq = 0; // samplerate of the current systems soundcard/DAC + uint32_t PCMsid = 0, PCMsidNoise = 0; #if 0 /* following depends on type */ - ptr2sidVoidFunc ModeNormalTable[16]; - ptr2sidVoidFunc ModeRingTable[16]; + ptr2sidVoidFunc ModeNormalTable[16]{ nullptr }; + ptr2sidVoidFunc ModeRingTable[16]{ nullptr }; // for speed reason it could be better to make them global! - uint8_t* waveform30; - uint8_t* waveform50; - uint8_t* waveform60; - uint8_t* waveform70; + uint8_t *waveform30 = nullptr; + uint8_t *waveform50 = nullptr; + uint8_t *waveform60 = nullptr; + uint8_t *waveform70 = nullptr; #endif - int reg[0x20]; + int reg[0x20]{ 0 }; -// bool sidKeysOn[0x20], sidKeysOff[0x20]; +// bool sidKeysOn[0x20]{ false }, sidKeysOff[0x20]{ false }; - uint8_t masterVolume; - uint16_t masterVolumeAmplIndex; + uint8_t masterVolume = 0; + uint16_t masterVolumeAmplIndex = 0; struct { - int Enabled; - uint8_t Type, CurType; - float Dy, ResDy; - uint16_t Value; + int Enabled = 0; + uint8_t Type = 0, CurType = 0; + float Dy = 0.0, ResDy = 0.0; + uint16_t Value = 0; } filter; sidOperator optr[max_voices]; - int optr3_outputmask; + int optr3_outputmask = 0; void init(); diff -Nru mame-0.242+dfsg.1/src/devices/sound/sidvoice.h mame-0.243+dfsg.1/src/devices/sound/sidvoice.h --- mame-0.242+dfsg.1/src/devices/sound/sidvoice.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/sound/sidvoice.h 2022-04-29 05:37:26.000000000 +0000 @@ -16,81 +16,81 @@ { struct sw_storage { - uint16_t len; + uint16_t len = 0; #if defined(DIRECT_FIXPOINT) - uint32_t stp; + uint32_t stp = 0; #else - uint32_t pnt; - int16_t stp; + uint32_t pnt = 0; + int16_t stp = 0; #endif }; - SID6581_t *sid; - uint8_t reg[7]; - uint32_t SIDfreq; - uint16_t SIDpulseWidth; - uint8_t SIDctrl; - uint8_t SIDAD, SIDSR; - - sidOperator* carrier; - sidOperator* modulator; - int sync; - - uint16_t pulseIndex, newPulseIndex; - uint16_t curSIDfreq; - uint16_t curNoiseFreq; - - uint8_t output;//, outputMask; - - char filtVoiceMask; - int filtEnabled; - float filtLow, filtRef; - int8_t filtIO; + SID6581_t *sid = nullptr; + uint8_t reg[7]{ 0 }; + uint32_t SIDfreq = 0; + uint16_t SIDpulseWidth = 0; + uint8_t SIDctrl = 0; + uint8_t SIDAD = 0, SIDSR = 0; + + sidOperator *carrier = nullptr; + sidOperator *modulator = nullptr; + int sync = 0; + + uint16_t pulseIndex = 0, newPulseIndex = 0; + uint16_t curSIDfreq = 0; + uint16_t curNoiseFreq = 0; + + uint8_t output = 0/*, outputMask = 0*/; + + char filtVoiceMask = 0; + int filtEnabled = 0; + float filtLow = 0, filtRef = 0; + int8_t filtIO = 0; - int32_t cycleLenCount; + int32_t cycleLenCount = 0; #if defined(DIRECT_FIXPOINT) PAIR cycleLen, cycleAddLen; #else - uint32_t cycleAddLenPnt; - uint16_t cycleLen, cycleLenPnt; + uint32_t cycleAddLenPnt = 0; + uint16_t cycleLen, cycleLenPnt = 0; #endif - int8_t (*outProc)(sidOperator *); - void (*waveProc)(sidOperator *); + int8_t (*outProc)(sidOperator *) = nullptr; + void (*waveProc)(sidOperator *) = nullptr; #if defined(DIRECT_FIXPOINT) PAIR waveStep, waveStepAdd; #else - uint16_t waveStep, waveStepAdd; - uint32_t waveStepPnt, waveStepAddPnt; + uint16_t waveStep = 0, waveStepAdd = 0; + uint32_t waveStepPnt = 0, waveStepAddPnt = 0; #endif - uint16_t waveStepOld; + uint16_t waveStepOld = 0; sw_storage wavePre[2]; #if defined(DIRECT_FIXPOINT) PAIR noiseReg; #else - uint32_t noiseReg; + uint32_t noiseReg = 0; #endif - uint32_t noiseStep, noiseStepAdd; - uint8_t noiseOutput; - int noiseIsLocked; - - uint8_t ADSRctrl; -// int gateOnCtrl, gateOffCtrl; - uint16_t (*ADSRproc)(sidOperator *); + uint32_t noiseStep = 0, noiseStepAdd = 0; + uint8_t noiseOutput = 0; + int noiseIsLocked = 0; + + uint8_t ADSRctrl = 0; +// int gateOnCtrl = 0, gateOffCtrl = 0; + uint16_t (*ADSRproc)(sidOperator *) = nullptr; #ifdef SID_FPUENVE - float fenveStep, fenveStepAdd; - uint32_t enveStep; + float fenveStep = 0.0, fenveStepAdd = 0.0; + uint32_t enveStep = 0; #elif defined(DIRECT_FIXPOINT) PAIR enveStep, enveStepAdd; #else - uint16_t enveStep, enveStepAdd; - uint32_t enveStepPnt, enveStepAddPnt; + uint16_t enveStep = 0, enveStepAdd = 0; + uint32_t enveStepPnt = 0, enveStepAddPnt = 0; #endif - uint8_t enveVol, enveSusVol; - uint16_t enveShortAttackCount; + uint8_t enveVol = 0, enveSusVol = 0; + uint16_t enveShortAttackCount = 0; void clear(); diff -Nru mame-0.242+dfsg.1/src/devices/sound/tms5220.cpp mame-0.243+dfsg.1/src/devices/sound/tms5220.cpp --- mame-0.242+dfsg.1/src/devices/sound/tms5220.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/sound/tms5220.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -312,7 +312,7 @@ Pinball: Several (don't know names offhand, have not checked schematics; likely Zaccaria's 'Farfalla') Home computer: Street Electronics Corp.'s Apple II 'Echo 2' Speech synthesizer (later cards only); Texas Instruments' 'Speak and Learn' -scanner wand unit. +scanner wand unit; HP 27201A Speech Output Module (serial port connection). TMS5220C AKA TSP5220C: (on stuff made from 1984 to 1992 or so) Arcade: Atari's 'Indiana Jones and the Temple of Doom', '720', @@ -1564,9 +1564,11 @@ LOGMASKED(LOG_PIN_READS, "irq pin set to state %d\n", state); - if (!m_irq_handler.isnull() && state != m_irq_pin) + if (state != m_irq_pin) + { + m_irq_pin = state; m_irq_handler(!state); - m_irq_pin = state; + } } /********************************************************************************************** @@ -1640,7 +1642,7 @@ } /* resolve callbacks */ - m_irq_handler.resolve(); + m_irq_handler.resolve_safe(); m_readyq_handler.resolve(); m_m0_cb.resolve(); m_m1_cb.resolve(); diff -Nru mame-0.242+dfsg.1/src/devices/video/epic12.cpp mame-0.243+dfsg.1/src/devices/video/epic12.cpp --- mame-0.242+dfsg.1/src/devices/video/epic12.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/video/epic12.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1,6 +1,6 @@ // license:BSD-3-Clause // copyright-holders:David Haywood, Luca Elia, MetalliC -/* emulation of Altera Cyclone EPIC12 FPGA programmed as a blitter */ +/* emulation of Altera Cyclone EP1C12 FPGA programmed as a blitter */ #include "emu.h" #include "epic12.h" @@ -61,6 +61,12 @@ m_blitter_delay_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(epic12_device::blitter_delay_callback),this)); m_blitter_delay_timer->adjust(attotime::never); + m_firmware_pos = 0; + m_firmware.clear(); + m_firmware.resize(290405, 0); + m_firmware_port = 0; + m_firmware_version = -1; + save_item(NAME(m_gfx_addr)); save_item(NAME(m_gfx_scroll_0_x)); save_item(NAME(m_gfx_scroll_0_y)); @@ -74,6 +80,10 @@ save_item(NAME(m_gfx_scroll_1_y_shadowcopy)); save_pointer(NAME(m_ram16_copy), m_main_ramsize/2); save_item(NAME(*m_bitmaps)); + save_item(NAME(m_firmware_pos)); + save_item(NAME(m_firmware_port)); + save_item(NAME(m_firmware)); + save_item(NAME(m_firmware_version)); } void epic12_device::device_reset() @@ -1012,13 +1022,39 @@ return 0xff; } -// todo, store what's written here and checksum it, different microcode probably leads to slightly different blitter timings void epic12_device::fpga_w(offs_t offset, u64 data, u64 mem_mask) { - if (ACCESSING_BITS_24_31) + if (ACCESSING_BITS_0_7) { // data & 0x08 = CE // data & 0x10 = CLK // data & 0x20 = DATA + + if((data & 0x08) && !(m_firmware_port & 0x10) && (data & 0x10)) { + if(m_firmware_pos < 2323240 && (data & 0x20)) + m_firmware[m_firmware_pos >> 3] |= 1 << (m_firmware_pos & 7); + m_firmware_pos++; + } + + m_firmware_port = data; + + if(m_firmware_pos == 2323240) { + u8 checksum = 0; + for(u8 c : m_firmware) + checksum += c; + + switch(checksum) { + case 0x03: m_firmware_version = FW_A; break; + case 0x3e: m_firmware_version = FW_B; break; + case 0xf9: m_firmware_version = FW_C; break; + case 0xe1: m_firmware_version = FW_D; break; + default: m_firmware_version = -1; break; + } + + if(m_firmware_version < 0) + logerror("Unrecognized firmware version\n"); + else + logerror("Detected firmware version %c\n", 'A' + m_firmware_version); + } } } diff -Nru mame-0.242+dfsg.1/src/devices/video/epic12.h mame-0.243+dfsg.1/src/devices/video/epic12.h --- mame-0.242+dfsg.1/src/devices/video/epic12.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/video/epic12.h 2022-04-29 05:37:26.000000000 +0000 @@ -78,6 +78,21 @@ static void *blit_request_callback_unsafe(void *param, int threadid); protected: + // The firmware versions + enum { + // Used by ibara & mushisama + FW_A, // Byte checksum 03 + + // Used by espgal2 + FW_B, // Byte checksum 3e + + // Used by espgal2a, mushitama and mushisamb + FW_C, // Byte checksum f9 + + // Used by everything else + FW_D, // Byte checksum e1 + }; + struct clr_t { // clr_t to r5g5b5 @@ -821,6 +836,12 @@ emu_timer *m_blitter_delay_timer; int m_blitter_busy; + // fpga firmware + std::vector m_firmware; + int m_firmware_pos; + u8 m_firmware_port; + int m_firmware_version; + // debug vram viewer #ifdef DEBUG_VRAM_VIEWER bool m_debug_vram_view_en; diff -Nru mame-0.242+dfsg.1/src/devices/video/huc6272.cpp mame-0.243+dfsg.1/src/devices/video/huc6272.cpp --- mame-0.242+dfsg.1/src/devices/video/huc6272.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/video/huc6272.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -453,8 +453,9 @@ m_adpcm.playing[i] = BIT(data, i); if (!m_adpcm.playing[i]) { - m_adpcm.input[i] = -1; + m_adpcm.input[i] = 0; m_adpcm.pos[i] = 0; + m_adpcm.nibble[i] = 32; } else { @@ -504,6 +505,8 @@ } } +// TODO: clearly written in blind faith +// (interrupt_update fns are untested by the BIOS main menu) uint8_t huc6272_device::adpcm_update(int chan) { if (!m_adpcm.playing[chan]) @@ -513,7 +516,11 @@ m_adpcm.pos[chan]++; if (m_adpcm.pos[chan] >= rate) { - if (m_adpcm.input[chan] == -1) + m_adpcm.nibble[chan] += 4; + if (m_adpcm.nibble[chan] >= 32) + m_adpcm.nibble[chan] = 0; + + if (m_adpcm.nibble[chan] == 0) { m_adpcm.input[chan] = read_dword(((m_page_setting & 0x1000) << 6) | m_adpcm.addr[chan]); m_adpcm.addr[chan] = (m_adpcm.addr[chan] & 0x20000) | ((m_adpcm.addr[chan] + 1) & 0x1ffff); @@ -535,7 +542,7 @@ interrupt_update(); } - if (BIT(m_adpcm.control[chan],0)) // Ring Buffer + if (BIT(m_adpcm.control[chan], 0)) // Ring Buffer { m_adpcm.addr[chan] = m_adpcm.start[chan]; } @@ -545,14 +552,9 @@ return 0; } } - m_adpcm.nibble[chan] = 0; - } - else - { - m_adpcm.nibble[chan] += 4; - if (m_adpcm.nibble[chan] >= 28) - m_adpcm.input[chan] = -1; + //m_adpcm.nibble[chan] = 0; } + m_adpcm.pos[chan] = 0; } diff -Nru mame-0.242+dfsg.1/src/devices/video/imagetek_i4100.cpp mame-0.243+dfsg.1/src/devices/video/imagetek_i4100.cpp --- mame-0.242+dfsg.1/src/devices/video/imagetek_i4100.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/video/imagetek_i4100.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -291,6 +291,9 @@ , m_tilemap_flip_scrolldx{0, 0, 0} , m_tilemap_flip_scrolldy{0, 0, 0} , m_spriteram_buffered(false) + , m_ext_ctrl_0_cb(*this) + , m_ext_ctrl_1_cb(*this) + , m_ext_ctrl_2_cb(*this) { } @@ -385,6 +388,10 @@ m_spritelist = std::make_unique(0x1000 / 8); m_sprite_end = m_spritelist.get(); + + m_ext_ctrl_0_cb.resolve_safe(); + m_ext_ctrl_1_cb.resolve_safe(); + m_ext_ctrl_2_cb.resolve_safe(); } void imagetek_i4300_device::device_start() @@ -459,7 +466,11 @@ return; LOGINT("%s: Interrupts acknowledged (%02X)\n", machine().describe_context(), data); - m_requested_int &= ~data; + // NB: at least i4100 device doesn't have control over bits 5-6-7 + // it's cleared on top of irq services in karatour & ladykill with a 0xffea + // bit 5 seems more like an external irq service that is acknowledged separately, + // and is necessary for those + 3kokushi for updating scroll registers. + m_requested_int &= ~(data & 0x1f); update_irq_state(); } @@ -670,32 +681,41 @@ uint16_t imagetek_i4100_device::scroll_r(offs_t offset) { return m_scroll[offset]; } void imagetek_i4100_device::scroll_w(offs_t offset, uint16_t data, uint16_t mem_mask) { COMBINE_DATA(&m_scroll[offset]); } -/**************************************************** +/* * * Screen Control Register: * - * f--- ---- ---- ---- ? + * f--- ---- ---- ---- ? karatour during POST (CRTC i/f sync?) * -edc b--- ---- ---- - * ---- -a98 ---- ---- ? Leds (see gakusai attract) + * ---- -a98 ---- ---- external control pins + * \- gakusai attract, unknown purpose + * (bit 2 enabled during title photo flashes, + * bit 1 always?, + * bit 0 periodically during gal sequences); + * \- (bit 0) karatour/ladykill/3kokushi external irq level 5 enable, (bit 1-2) unknown; + * \- puzzli [hblank] timer stop/start? 0 during transitions, 7 otherwise + * (including individual printouts of ROM statuses during POST); + * \- mouja (1 during POST, 7 otherwise) * ---- ---- 765- ---- 16x16 Tiles (Layer 2-1-0) * ---- ---- ---4 32-- * ---- ---- ---- --1- Blank Screen * ---- ---- ---- ---0 Flip Screen * - ****************************************************/ + */ void imagetek_i4100_device::screen_ctrl_w(offs_t offset, uint16_t data, uint16_t mem_mask) { - m_layer_tile_select[2] = BIT(data,7); - m_layer_tile_select[1] = BIT(data,6); - m_layer_tile_select[0] = BIT(data,5); + m_ext_ctrl_2_cb(BIT(data, 10)); + m_ext_ctrl_1_cb(BIT(data, 9)); + m_ext_ctrl_0_cb(BIT(data, 8)); + + for (int i = 0; i < 3; i++) + m_layer_tile_select[i] = BIT(data, 5 + i); - // TODO: some of these must be externalized m_screen_blank = BIT(data,1); m_screen_flip = BIT(data,0); if (data & 0xff1c) - logerror("%s warning: screen_ctrl_w write with %04x %04x\n",this->tag(),data,mem_mask); - + logerror("%s warning: screen_ctrl_w write with %04x %04x\n", this->tag(), data, mem_mask); } diff -Nru mame-0.242+dfsg.1/src/devices/video/imagetek_i4100.h mame-0.243+dfsg.1/src/devices/video/imagetek_i4100.h --- mame-0.242+dfsg.1/src/devices/video/imagetek_i4100.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/video/imagetek_i4100.h 2022-04-29 05:37:26.000000000 +0000 @@ -52,6 +52,9 @@ } auto irq_cb() { return m_irq_cb.bind(); } + auto ext_ctrl_0_cb() { return m_ext_ctrl_0_cb.bind(); } + auto ext_ctrl_1_cb() { return m_ext_ctrl_1_cb.bind(); } + auto ext_ctrl_2_cb() { return m_ext_ctrl_2_cb.bind(); } void set_vblank_irq_level(int level) { m_vblank_irq_level = level; } void set_blit_irq_level(int level) { m_blit_irq_level = level; } void set_spriteram_buffered(bool buffer) { m_spriteram_buffered = buffer; } @@ -191,7 +194,6 @@ uint16_t scroll_r(offs_t offset); void scroll_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - uint16_t gfxrom_r(offs_t offset); void crtc_vert_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); void crtc_horz_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); @@ -222,6 +224,10 @@ bool m_inited_hack; DECLARE_GFXDECODE_MEMBER(gfxinfo); DECLARE_GFXDECODE_MEMBER(gfxinfo_ext); + + devcb_write_line m_ext_ctrl_0_cb; + devcb_write_line m_ext_ctrl_1_cb; + devcb_write_line m_ext_ctrl_2_cb; }; class imagetek_i4220_device : public imagetek_i4100_device diff -Nru mame-0.242+dfsg.1/src/devices/video/upd3301.cpp mame-0.243+dfsg.1/src/devices/video/upd3301.cpp --- mame-0.242+dfsg.1/src/devices/video/upd3301.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/video/upd3301.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -12,17 +12,18 @@ - pinpoint how much of pc8001/pc8801 drawing functions should actually be inherited here; - - N interrupt (special control character) - - light pen - - reset counters + - N interrupt (special control character); + - light pen; + - reset counters; - proper DMA timing (now the whole screen is transferred at the end of the frame, accurate timing requires CCLK timer which kills performance) - - DMA burst mode; + - DMA burst mode (reportedly not working in pc8801 arch, + should return a blank screen for reasons); + - DMA underrun (sorcerml in pc8801?). Should throw a status U irq; - cleanup: variable namings should be more verbose - (i.e. not be a single letter like m_y, m_z, m_b ...); - - sorcerml (pc8801) has buggy DMA burst mode, causing an underrun (hence a status U interrupt); + (i.e. not be a single letter like m_y, m_z, m_b ...); - jettermi (pc8801) expects to colorize its underlying 400 b&w mode by masking with the - text color attributes here; + text color attributes here; - xak2 (pc8801) throws text garbage on legacy renderer (verify); */ @@ -32,9 +33,25 @@ #include "screen.h" -//#define VERBOSE 1 +#define LOG_WARN (1U << 1) // Illegal setup attempts +#define LOG_CMD (1U << 2) // Command r/w +#define LOG_CURSOR (1U << 3) // Cursor position (verbose) +#define LOG_CRTC (1U << 4) // CRTC parameters +#define LOG_INT (1U << 5) // INT, VRTC and DRQ lines +#define LOG_HRTC (1U << 6) // HRTC (verbose) + +#define VERBOSE (LOG_WARN) +//#define VERBOSE (LOG_WARN|LOG_CMD) +//#define LOG_OUTPUT_FUNC osd_printf_info + #include "logmacro.h" +#define LOGWARN(...) LOGMASKED(LOG_WARN, __VA_ARGS__) +#define LOGCMD(...) LOGMASKED(LOG_CMD, __VA_ARGS__) +#define LOGCURSOR(...) LOGMASKED(LOG_CURSOR, __VA_ARGS__) +#define LOGCRTC(...) LOGMASKED(LOG_CRTC, __VA_ARGS__) +#define LOGINT(...) LOGMASKED(LOG_INT, __VA_ARGS__) +#define LOGHRTC(...) LOGMASKED(LOG_HRTC, __VA_ARGS__) //************************************************************************** @@ -181,12 +198,15 @@ void upd3301_device::device_reset() { + set_display(0); set_interrupt(0); set_drq(0); m_cm = 0; m_b = 48; m_reverse_display = false; + if (!m_write_rvv.isnull()) + m_write_rvv(m_reverse_display); recompute_parameters(); } @@ -229,6 +249,9 @@ m_attr_frame = 0; m_attr_blink = !m_attr_blink; } + // Clear the buffer here. Needed in particular by PC-88, which usually disables + // DMA transfer in order to show Graphic layer only (i.e. bugattac). + m_bitmap.fill(0, screen().visible_area()); } void upd3301_device::device_timer(emu_timer &timer, device_timer_id id, int param) @@ -236,7 +259,7 @@ switch (id) { case TIMER_HRTC: - LOG("UPD3301 HRTC: %u\n", param); + LOGHRTC("HRTC: %u at beam %d x %d\n", param, screen().hpos(), screen().vpos()); m_write_hrtc(param); m_hrtc = param; @@ -245,25 +268,27 @@ break; case TIMER_VRTC: - LOG("UPD3301 VRTC: %u\n", param); + LOGINT("VRTC: %u at y %d\n", param, screen().vpos()); m_write_vrtc(param); m_vrtc = param; update_vrtc_timer(param); - if(!(m_status & STATUS_VE)) + if(!get_display_status()) break; - if(!param) + if (!param) + { reset_fifo_vrtc(); + set_drq(1); + } if (param && !m_me) { m_status |= STATUS_E; set_interrupt(1); } - else if(!param) - set_drq(1); + break; case TIMER_DRQ: @@ -283,14 +308,14 @@ switch (offset & 0x01) { case 0: // data - // TODO: light pen if (!machine().side_effects_disabled()) - popmessage("light pen reading"); + popmessage("light pen reading?"); break; case 1: // status data = m_status; - m_status &= ~(STATUS_LP | STATUS_E |STATUS_N | STATUS_U); + if (!machine().side_effects_disabled()) + m_status &= ~(STATUS_LP | STATUS_E |STATUS_N | STATUS_U); break; } @@ -319,8 +344,8 @@ m_h = (data & 0x7f) + 2; if (m_h > 80) popmessage("Illegal width set %d", m_h); - LOG("UPD3301 DMA Mode: %s\n", m_dma_mode ? "character" : "burst"); - LOG("UPD3301 H: %u\n", m_h); + LOGCMD("DMA Mode: %s\n", m_dma_mode ? "character" : "burst"); + LOGCMD("H: %u (characters per line)\n", m_h); break; case 1: @@ -329,8 +354,8 @@ // number of lines displayed -1 // (or in other words, tilemap y size) m_l = (data & 0x3f) + 1; - LOG("UPD3301 B: %u\n", m_b); - LOG("UPD3301 L: %u\n", m_l); + LOGCMD("B: %u (cursor blink rate)\n", m_b); + LOGCMD("L: %u (number of lines displayed)\n", m_l); break; case 2: @@ -349,9 +374,9 @@ popmessage("cursor mode %02x", m_c); // Number of lines per character -1 m_r = (data & 0x1f) + 1; - LOG("UPD3301 S: %u\n", m_s); - LOG("UPD3301 C: %u\n", m_c); - LOG("UPD3301 R: %u\n", m_r); + LOGCMD("S: %u (skip line)\n", m_s); + LOGCMD("C: %u (cursor mode)\n", m_c); + LOGCMD("R: %u (number of lines per character)\n", m_r); break; case 3: @@ -359,8 +384,8 @@ m_v = (data >> 5) + 1; // hblank width -2 (6 to 33) m_z = (data & 0x1f) + 2; - LOG("UPD3301 V: %u\n", m_v); - LOG("UPD3301 Z: %u\n", m_z); + LOGCMD("V: %u (vblank lines)\n", m_v); + LOGCMD("Z: %u (hblank width)\n", m_z); recompute_parameters(); break; @@ -376,13 +401,17 @@ //m_at0 = BIT(data, 6); //m_sc = BIT(data, 5); m_gfx_mode = (data & 0xe0) >> 5; - if (m_gfx_mode & 0x5) + if (m_gfx_mode & 0x4) popmessage("attr mode %02x", m_gfx_mode); + // Max number of attributes per line -1 // can't be higher than 20 - m_attr = std::min((data & 0x1f) + 1, 20); - LOG("UPD3301 AT1: %u AT0: %u SC: %u\n", BIT(data, 7), BIT(data, 6), BIT(data, 5)); - LOG("UPD3301 ATTR: %u\n", m_attr); + // overriden to 0 in no attribute/no sc mode + m_attr = (m_gfx_mode == 1) ? 0 : std::min((data & 0x1f) + 1, 20); + LOGCMD("AT1: %u AT0: %u SC: %u (gfx mode = %02x)\n", + BIT(data, 7), BIT(data, 6), BIT(data, 5), m_gfx_mode + ); + LOGCMD("ATTR: %u (num attributes per line)\n", m_attr); m_mode = MODE_NONE; break; @@ -396,12 +425,12 @@ { case 0: m_cx = data & 0x7f; - LOG("UPD3301 CX: %u\n", m_cx); + LOGCURSOR("CX: %u\n", m_cx); break; case 1: m_cy = data & 0x3f; - LOG("UPD3301 CY: %u\n", m_cy); + LOGCURSOR("CY: %u\n", m_cy); m_mode = MODE_NONE; break; @@ -411,7 +440,7 @@ break; default: - LOG("UPD3301 Invalid Parameter Byte %02x!\n", data); + LOGWARN("Invalid Parameter Byte %02x!\n", data); } break; @@ -422,17 +451,20 @@ switch (data & 0xe0) { case COMMAND_RESET: - LOG("UPD3301 Reset\n"); + LOGCMD("Reset\n"); m_mode = MODE_RESET; - // TODO: this also disables external display such as Graphic VRAM in PC-8801 + // This should also disable external display such as Graphic layer in PC-8801 + // sorcerml contradicts with it tho: it just issue a reset command without caring about + // re-enabling display. set_display(0); set_interrupt(0); break; case COMMAND_START_DISPLAY: { - LOG("UPD3301 Start Display\n"); + LOGCMD("Start Display\n"); bool new_rvv = bool(BIT(data, 0)); + LOGCMD("RVV: %u (reverse display)\n", new_rvv); // misscmd (pc8001) enables this if (m_reverse_display != new_rvv) { @@ -440,7 +472,7 @@ if (!m_write_rvv.isnull()) m_write_rvv(m_reverse_display); else if (m_reverse_display == true) - logerror("%s: reverse display enabled (warning)\n", machine().describe_context()); + logerror("%s: RVV reverse display enabled (warning)\n", machine().describe_context()); } set_display(1); reset_counters(); @@ -448,38 +480,38 @@ } case COMMAND_SET_INTERRUPT_MASK: - LOG("UPD3301 Set Interrupt Mask\n"); + LOGCMD("Set Interrupt Mask\n"); // vblank irq mask m_me = BIT(data, 0); // special control character irq mask m_mn = BIT(data, 1); - // TODO: writing a negated bit 0 makes status bit 7 to be held high? - LOG("UPD3301 ME: %u\n", m_me); - LOG("UPD3301 MN: %u\n", m_mn); + // TODO: Apparently unmasking ME should be reflected in undocumented status bit 7 + LOGCMD("ME: %u (vblank irq mask)\n", m_me); + LOGCMD("MN: %u (special control char irq mask)\n", m_mn); break; case COMMAND_READ_LIGHT_PEN: - LOG("UPD3301 Read Light Pen\n"); + LOGCMD("Read Light Pen\n"); // TODO: similar to cursor parameters except on read // (plus an HR to bit 7 param [0]) m_mode = MODE_READ_LIGHT_PEN; break; case COMMAND_LOAD_CURSOR_POSITION: - LOG("UPD3301 Load Cursor Position\n"); + LOGCURSOR("Load Cursor Position\n"); m_mode = MODE_LOAD_CURSOR_POSITION; // (1) show cursor (0) disable cursor m_cm = BIT(data, 0); - LOG("UPD3301 CM: %u\n", m_cm); + LOGCURSOR("CM: %u\n", m_cm); break; case COMMAND_RESET_INTERRUPT: - LOG("UPD3301 Reset Interrupt\n"); + LOGCMD("Reset Interrupt\n"); set_interrupt(0); break; case COMMAND_RESET_COUNTERS: - LOG("UPD3301 Reset Counters\n"); + LOGCMD("Reset Counters\n"); m_mode = MODE_RESET_COUNTERS; reset_counters(); break; @@ -495,6 +527,7 @@ void upd3301_device::dack_w(uint8_t data) { + // TODO: underrun condition if (m_y >= (m_l * m_r)) { return; @@ -545,7 +578,7 @@ //------------------------------------------------- -// hrtc_r - +// hrtc_r - Horizontal ReTraCe //------------------------------------------------- int upd3301_device::hrtc_r() @@ -555,7 +588,7 @@ //------------------------------------------------- -// vrtc_r - +// vrtc_r - Vertical ReTraCe //------------------------------------------------- int upd3301_device::vrtc_r() @@ -573,7 +606,16 @@ const u8 attr_max_size = 80; std::array attr_extend_info; - // TODO: uPD3301 may actually fetch in LIFO order + // elthlead (pc8801) uses b&w no attributes/no special control mode + // 0-fill buffer seems enough + if (m_gfx_mode == 1) + { + std::fill(attr_extend_info.begin(), attr_extend_info.end(), 0x00); + return attr_extend_info; + } + + // TODO: may actually fetch in LIFO order + // Some edge cases in pc8801 N88 Basic (status on bottom), jettermi and play6lim backs up this theory. for (int ex = 0; ex < attr_fifo_size; ex+=2) { u8 attr_start = std::min(attr_row[ex], attr_max_size); @@ -645,9 +687,10 @@ uint32_t upd3301_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - bitmap.fill(rgb_t(0x00,0x00,0x00), cliprect); + // TODO: non-transparent modes + bitmap.fill(0, cliprect); - if (!(m_status & STATUS_VE)) + if (!get_display_status()) return 0; copybitmap(bitmap, m_bitmap, 0, 0, 0, 0, cliprect); @@ -662,7 +705,7 @@ void upd3301_device::set_interrupt(int state) { - LOG("UPD3301 Interrupt: %u\n", state); + LOGINT("Interrupt: %u\n", state); m_write_int(state); @@ -679,7 +722,7 @@ void upd3301_device::set_drq(int state) { - LOG("UPD3301 DRQ: %u\n", state); + LOGINT("DRQ: %u %d\n", state, screen().vpos()); m_write_drq(state); } @@ -689,6 +732,12 @@ // set_display - //------------------------------------------------- +bool upd3301_device::get_display_status() +{ + return bool(m_status & STATUS_VE); +} + + void upd3301_device::set_display(int state) { if (state) @@ -736,11 +785,12 @@ void upd3301_device::update_vrtc_timer(int state) { - int next_y = state ? (m_l * m_r) : 0; + const bool next_state = !state; + int next_y = next_state ? (m_l * m_r) : 0; attotime duration = screen().time_until_pos(next_y, 0); - m_vrtc_timer->adjust(duration, !state); + m_vrtc_timer->adjust(duration, next_state); } @@ -759,8 +809,8 @@ visarea.set(0, (m_h * m_width) - 1, 0, (m_l * m_r) - 1); - LOG("UPD3301 Screen: %u x %u @ %f Hz\n", horiz_pix_total, vert_pix_total, 1 / ATTOSECONDS_TO_DOUBLE(refresh)); - LOG("UPD3301 Visible Area: (%u, %u) - (%u, %u)\n", visarea.min_x, visarea.min_y, visarea.max_x, visarea.max_y); + LOGCRTC("Screen: %u x %u @ %f Hz\n", horiz_pix_total, vert_pix_total, 1 / ATTOSECONDS_TO_DOUBLE(refresh)); + LOGCRTC("Visible Area: (%u, %u) - (%u, %u)\n", visarea.min_x, visarea.min_y, visarea.max_x, visarea.max_y); screen().configure(horiz_pix_total, vert_pix_total, visarea, refresh); diff -Nru mame-0.242+dfsg.1/src/devices/video/upd3301.h mame-0.243+dfsg.1/src/devices/video/upd3301.h --- mame-0.242+dfsg.1/src/devices/video/upd3301.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/video/upd3301.h 2022-04-29 05:37:26.000000000 +0000 @@ -81,6 +81,8 @@ void lpen_w(int state); int hrtc_r(); int vrtc_r(); + int lines_per_char() { return m_r; } + bool get_display_status(); uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); diff -Nru mame-0.242+dfsg.1/src/devices/video/v9938.cpp mame-0.243+dfsg.1/src/devices/video/v9938.cpp --- mame-0.242+dfsg.1/src/devices/video/v9938.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/video/v9938.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -2915,13 +2915,11 @@ /*************************************************************/ uint8_t v99x8_device::command_unit_w(uint8_t Op) { - int SM; - // V9938 ops only work in SCREENs 5-8 - if (m_mode<5) + if (m_mode<5 || m_mode>8) return(0); - SM = m_mode-5; // Screen mode index 0..3 + int SM = m_mode-5; // Screen mode index 0..3 m_mmc.CM = Op>>4; if ((m_mmc.CM & 0x0C) != 0x0C && m_mmc.CM != 0) diff -Nru mame-0.242+dfsg.1/src/devices/video/voodoo.cpp mame-0.243+dfsg.1/src/devices/video/voodoo.cpp --- mame-0.242+dfsg.1/src/devices/video/voodoo.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/devices/video/voodoo.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -2794,7 +2794,7 @@ m_xoffs = hbp; m_yoffs = vbp; m_vsyncstart = vsyncoff; - m_vsyncstop = vsyncon; + m_vsyncstop = 0; logerror("yoffs: %d vsyncstart: %d vsyncstop: %d\n", vbp, m_vsyncstart, m_vsyncstop); adjust_vblank_start_timer(); diff -Nru mame-0.242+dfsg.1/src/emu/debug/debugcmd.cpp mame-0.243+dfsg.1/src/emu/debug/debugcmd.cpp --- mame-0.242+dfsg.1/src/emu/debug/debugcmd.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/emu/debug/debugcmd.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -234,6 +234,9 @@ m_console.register_command("gtime", CMDFLAG_NONE, 0, 1, std::bind(&debugger_commands::execute_go_time, this, _1)); m_console.register_command("gt", CMDFLAG_NONE, 0, 1, std::bind(&debugger_commands::execute_go_time, this, _1)); m_console.register_command("gp", CMDFLAG_NONE, 0, 1, std::bind(&debugger_commands::execute_go_privilege, this, _1)); + m_console.register_command("gbt", CMDFLAG_NONE, 0, 1, std::bind(&debugger_commands::execute_go_branch, this, true, _1)); + m_console.register_command("gbf", CMDFLAG_NONE, 0, 1, std::bind(&debugger_commands::execute_go_branch, this, false, _1)); + m_console.register_command("gni", CMDFLAG_NONE, 0, 1, std::bind(&debugger_commands::execute_go_next_instruction, this, _1)); m_console.register_command("next", CMDFLAG_NONE, 0, 0, std::bind(&debugger_commands::execute_next, this, _1)); m_console.register_command("n", CMDFLAG_NONE, 0, 0, std::bind(&debugger_commands::execute_next, this, _1)); m_console.register_command("focus", CMDFLAG_NONE, 1, 1, std::bind(&debugger_commands::execute_focus, this, _1)); @@ -1356,6 +1359,56 @@ m_console.get_visible_cpu()->debug()->go_privilege((condition.is_empty()) ? "1" : condition.original_string()); } + +/*------------------------------------------------- + execute_go_branch - execute gbt or gbf command +-------------------------------------------------*/ + +void debugger_commands::execute_go_branch(bool sense, const std::vector ¶ms) +{ + parsed_expression condition(m_console.visible_symtable()); + if (params.size() > 0 && !debug_command_parameter_expression(params[0], condition)) + return; + + m_console.get_visible_cpu()->debug()->go_branch(sense, (condition.is_empty()) ? "1" : condition.original_string()); +} + + +/*------------------------------------------------- + execute_go_next_instruction - execute gni command +-------------------------------------------------*/ + +void debugger_commands::execute_go_next_instruction(const std::vector ¶ms) +{ + u64 count = 1; + + // if we have a parameter, use it instead */ + if (params.size() > 0 && !validate_number_parameter(params[0], count)) + return; + if (count == 0) + return; + + device_state_interface *stateintf; + device_t *cpu = m_machine.debugger().console().get_visible_cpu(); + if (!cpu->interface(stateintf)) + { + m_console.printf("No state interface available for %s\n", cpu->name()); + return; + } + u32 pc = stateintf->pcbase(); + + debug_disasm_buffer buffer(*cpu); + while (count-- != 0) + { + // disassemble the current instruction and get the length + u32 result = buffer.disassemble_info(pc); + pc = buffer.next_pc_wrap(pc, result & util::disasm_interface::LENGTHMASK); + } + + cpu->debug()->go(pc); +} + + /*------------------------------------------------- execute_next - execute the next command -------------------------------------------------*/ diff -Nru mame-0.242+dfsg.1/src/emu/debug/debugcmd.h mame-0.243+dfsg.1/src/emu/debug/debugcmd.h --- mame-0.242+dfsg.1/src/emu/debug/debugcmd.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/emu/debug/debugcmd.h 2022-04-29 05:37:26.000000000 +0000 @@ -121,6 +121,8 @@ void execute_go_exception(const std::vector ¶ms); void execute_go_time(const std::vector ¶ms); void execute_go_privilege(const std::vector ¶ms); + void execute_go_branch(bool sense, const std::vector ¶ms); + void execute_go_next_instruction(const std::vector ¶ms); void execute_focus(const std::vector ¶ms); void execute_ignore(const std::vector ¶ms); void execute_observe(const std::vector ¶ms); diff -Nru mame-0.242+dfsg.1/src/emu/debug/debugcpu.cpp mame-0.243+dfsg.1/src/emu/debug/debugcpu.cpp --- mame-0.242+dfsg.1/src/emu/debug/debugcpu.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/emu/debug/debugcpu.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -427,6 +427,7 @@ , m_instrhook(nullptr) , m_stepaddr(0) , m_stepsleft(0) + , m_delay_steps(0) , m_stopaddr(0) , m_stoptime(attotime::zero) , m_stopirq(0) @@ -688,11 +689,11 @@ if ((m_flags & DEBUG_FLAG_STOP_PRIVILEGE) != 0) { bool matched = true; - if (m_privilege_condition && !m_privilege_condition->is_empty()) + if (m_stop_condition && !m_stop_condition->is_empty()) { try { - matched = m_privilege_condition->execute(); + matched = m_stop_condition->execute(); } catch (expression_error &) { @@ -750,19 +751,53 @@ // handle single stepping if (!debugcpu.is_stopped() && (m_flags & DEBUG_FLAG_STEPPING_ANY) != 0) { + bool do_step = true; + if ((m_flags & (DEBUG_FLAG_CALL_IN_PROGRESS | DEBUG_FLAG_TEST_IN_PROGRESS)) != 0) + { + if (curpc == m_stepaddr) + { + if ((~m_flags & (DEBUG_FLAG_TEST_IN_PROGRESS | DEBUG_FLAG_STEPPING_BRANCH_FALSE)) == 0) + { + debugcpu.set_execution_stopped(); + do_step = false; + } + + // reset the breakpoint + m_flags &= ~(DEBUG_FLAG_CALL_IN_PROGRESS | DEBUG_FLAG_TEST_IN_PROGRESS); + m_delay_steps = 0; + } + else if (m_delay_steps != 0) + { + m_delay_steps--; + if (m_delay_steps == 0) + { + // branch taken or subroutine entered (TODO: interrupt acknowledgment or interleaved multithreading can falsely trigger this) + if ((m_flags & DEBUG_FLAG_TEST_IN_PROGRESS) != 0 && (m_flags & (DEBUG_FLAG_STEPPING_OUT | DEBUG_FLAG_STEPPING_BRANCH_TRUE)) != 0) + { + debugcpu.set_execution_stopped(); + do_step = false; + } + if ((m_flags & DEBUG_FLAG_CALL_IN_PROGRESS) != 0) + do_step = false; + m_flags &= ~DEBUG_FLAG_TEST_IN_PROGRESS; + } + } + else + do_step = false; + } + // is this an actual step? - if (m_stepaddr == ~0 || curpc == m_stepaddr) + if (do_step) { - // decrement the count and reset the breakpoint + // decrement the count m_stepsleft--; - m_stepaddr = ~0; // if we hit 0, stop if (m_stepsleft == 0) debugcpu.set_execution_stopped(); // update every 100 steps until we are within 200 of the end - else if ((m_flags & DEBUG_FLAG_STEPPING_OUT) == 0 && (m_stepsleft < 200 || m_stepsleft % 100 == 0)) + else if ((m_flags & (DEBUG_FLAG_STEPPING_OUT | DEBUG_FLAG_STEPPING_BRANCH_TRUE | DEBUG_FLAG_STEPPING_BRANCH_FALSE)) == 0 && (m_stepsleft < 200 || m_stepsleft % 100 == 0)) { machine.debug_view().update_all(); machine.debug_view().flush_osd_updates(); @@ -849,7 +884,7 @@ } // handle step out/over on the instruction we are about to execute - if ((m_flags & (DEBUG_FLAG_STEPPING_OVER | DEBUG_FLAG_STEPPING_OUT)) != 0 && m_stepaddr == ~0) + if ((m_flags & (DEBUG_FLAG_STEPPING_OVER | DEBUG_FLAG_STEPPING_OUT | DEBUG_FLAG_STEPPING_BRANCH)) != 0 && (m_flags & (DEBUG_FLAG_CALL_IN_PROGRESS | DEBUG_FLAG_TEST_IN_PROGRESS)) == 0) prepare_for_step_overout(m_state->pcbase()); // no longer in debugger code @@ -928,7 +963,7 @@ m_device.machine().rewind_capture(); m_stepsleft = numsteps; - m_stepaddr = ~0; + m_delay_steps = 0; m_flags |= DEBUG_FLAG_STEPPING; m_device.machine().debugger().cpu().set_execution_running(); } @@ -945,7 +980,7 @@ m_device.machine().rewind_capture(); m_stepsleft = numsteps; - m_stepaddr = ~0; + m_delay_steps = 0; m_flags |= DEBUG_FLAG_STEPPING_OVER; m_device.machine().debugger().cpu().set_execution_running(); } @@ -961,8 +996,9 @@ assert(m_exec != nullptr); m_device.machine().rewind_capture(); + m_stop_condition.reset(); m_stepsleft = 100; - m_stepaddr = ~0; + m_delay_steps = 0; m_flags |= DEBUG_FLAG_STEPPING_OUT; m_device.machine().debugger().cpu().set_execution_running(); } @@ -1060,13 +1096,30 @@ { assert(m_exec != nullptr); m_device.machine().rewind_invalidate(); - m_privilege_condition = std::make_unique(*m_symtable, condition); + m_stop_condition = std::make_unique(*m_symtable, condition); m_flags |= DEBUG_FLAG_STOP_PRIVILEGE; m_device.machine().debugger().cpu().set_execution_running(); } //------------------------------------------------- +// go_branch - execute until branch taken or +// not taken +//------------------------------------------------- + +void device_debug::go_branch(bool sense, const char *condition) +{ + assert(m_exec != nullptr); + m_device.machine().rewind_invalidate(); + m_stop_condition = std::make_unique(*m_symtable, condition); + m_stepsleft = 100; + m_delay_steps = 0; + m_flags |= sense ? DEBUG_FLAG_STEPPING_BRANCH_TRUE : DEBUG_FLAG_STEPPING_BRANCH_FALSE; + m_device.machine().debugger().cpu().set_execution_running(); +} + + +//------------------------------------------------- // halt_on_next_instruction_impl - halt in the // debugger on the next instruction, internal // implementation which is necessary solely due @@ -1385,7 +1438,6 @@ // track_pc_visited - returns a boolean stating // if this PC has been visited or not. CRC32 is // done in this function on currently active CPU. -// TODO: Take a CPU context as input //------------------------------------------------- bool device_debug::track_pc_visited(offs_t pc) const @@ -1399,7 +1451,6 @@ //------------------------------------------------- // set_track_pc_visited - set this pc as visited. -// TODO: Take a CPU context as input //------------------------------------------------- void device_debug::set_track_pc_visited(offs_t pc) @@ -1625,12 +1676,32 @@ // disassemble the current instruction and get the flags u32 dasmresult = buffer.disassemble_info(pc); + if ((dasmresult & util::disasm_interface::SUPPORTED) == 0) + return; + + bool step_out = (m_flags & DEBUG_FLAG_STEPPING_OUT) != 0 && (dasmresult & util::disasm_interface::STEP_OUT) != 0; + bool test_cond = (dasmresult & util::disasm_interface::STEP_COND) != 0 && ((m_flags & (DEBUG_FLAG_STEPPING_BRANCH_TRUE | DEBUG_FLAG_STEPPING_BRANCH_FALSE)) != 0 || step_out); + if (test_cond && m_stop_condition && !m_stop_condition->is_empty()) + { + try + { + test_cond = m_stop_condition->execute(); + } + catch (expression_error &) + { + test_cond = false; + } + } // if flags are supported and it's a call-style opcode, set a temp breakpoint after that instruction - if ((dasmresult & util::disasm_interface::SUPPORTED) != 0 && (dasmresult & util::disasm_interface::STEP_OVER) != 0) + // (TODO: this completely fails for subroutines that consume inline operands or use alternate returns) + if ((dasmresult & util::disasm_interface::STEP_OVER) != 0 || test_cond) { int extraskip = (dasmresult & util::disasm_interface::OVERINSTMASK) >> util::disasm_interface::OVERINSTSHIFT; pc = buffer.next_pc_wrap(pc, dasmresult & util::disasm_interface::LENGTHMASK); + m_delay_steps = extraskip + 1; + if (m_stepsleft < m_delay_steps) + m_stepsleft = m_delay_steps; // if we need to skip additional instructions, advance as requested while (extraskip-- > 0) { @@ -1638,13 +1709,17 @@ pc = buffer.next_pc_wrap(pc, result & util::disasm_interface::LENGTHMASK); } m_stepaddr = pc; + if ((dasmresult & util::disasm_interface::STEP_OVER) != 0) + m_flags |= DEBUG_FLAG_CALL_IN_PROGRESS; + if (test_cond) + m_flags |= DEBUG_FLAG_TEST_IN_PROGRESS; } // if we're stepping out and this isn't a step out instruction, reset the steps until stop to a high number - // (TODO: this doesn't work with conditional return instructions) - if ((m_flags & DEBUG_FLAG_STEPPING_OUT) != 0) + if ((m_flags & (DEBUG_FLAG_STEPPING_OUT | DEBUG_FLAG_STEPPING_BRANCH_TRUE | DEBUG_FLAG_STEPPING_BRANCH_FALSE)) != 0) { - if ((dasmresult & util::disasm_interface::SUPPORTED) != 0 && (dasmresult & util::disasm_interface::STEP_OUT) == 0) + // make sure to also reset the number of steps for conditionals that may be single-instruction loops + if (test_cond || !step_out) m_stepsleft = 100; else { diff -Nru mame-0.242+dfsg.1/src/emu/debug/debugcpu.h mame-0.243+dfsg.1/src/emu/debug/debugcpu.h --- mame-0.242+dfsg.1/src/emu/debug/debugcpu.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/emu/debug/debugcpu.h 2022-04-29 05:37:26.000000000 +0000 @@ -82,6 +82,7 @@ void go_exception(int exception, const char *condition); void go_milliseconds(u64 milliseconds); void go_privilege(const char *condition); + void go_branch(bool sense, const char *condition); void go_next_device(); template @@ -184,15 +185,16 @@ debug_instruction_hook_func m_instrhook; // per-instruction callback hook // stepping information - offs_t m_stepaddr; // step target address for DEBUG_FLAG_STEPPING_OVER + offs_t m_stepaddr; // step target address for DEBUG_FLAG_STEPPING_OVER or DEBUG_FLAG_STEPPING_BRANCH int m_stepsleft; // number of steps left until done + int m_delay_steps; // number of steps until target address check // execution information offs_t m_stopaddr; // stop address for DEBUG_FLAG_STOP_PC attotime m_stoptime; // stop time for DEBUG_FLAG_STOP_TIME int m_stopirq; // stop IRQ number for DEBUG_FLAG_STOP_INTERRUPT int m_stopexception; // stop exception number for DEBUG_FLAG_STOP_EXCEPTION - std::unique_ptr m_privilege_condition; // expression to evaluate on privilege change + std::unique_ptr m_stop_condition; // expression to evaluate on privilege change std::unique_ptr m_exception_condition; // expression to evaluate on exception hit attotime m_endexectime; // ending time of the current execution u64 m_total_cycles; // current total cycles @@ -322,12 +324,17 @@ static constexpr u32 DEBUG_FLAG_SUSPENDED = 0x00004000; // CPU currently suspended static constexpr u32 DEBUG_FLAG_LIVE_BP = 0x00010000; // there are live breakpoints for this CPU static constexpr u32 DEBUG_FLAG_STOP_PRIVILEGE = 0x00020000; // run until execution level changes + static constexpr u32 DEBUG_FLAG_STEPPING_BRANCH_TRUE = 0x0040000; // run until true branch + static constexpr u32 DEBUG_FLAG_STEPPING_BRANCH_FALSE = 0x0080000; // run until false branch + static constexpr u32 DEBUG_FLAG_CALL_IN_PROGRESS = 0x01000000; // CPU is in the middle of a subroutine call + static constexpr u32 DEBUG_FLAG_TEST_IN_PROGRESS = 0x02000000; // CPU is performing a conditional test and branch - static constexpr u32 DEBUG_FLAG_STEPPING_ANY = DEBUG_FLAG_STEPPING | DEBUG_FLAG_STEPPING_OVER | DEBUG_FLAG_STEPPING_OUT; + static constexpr u32 DEBUG_FLAG_STEPPING_BRANCH = DEBUG_FLAG_STEPPING_BRANCH_TRUE | DEBUG_FLAG_STEPPING_BRANCH_FALSE; + static constexpr u32 DEBUG_FLAG_STEPPING_ANY = DEBUG_FLAG_STEPPING | DEBUG_FLAG_STEPPING_OVER | DEBUG_FLAG_STEPPING_OUT | DEBUG_FLAG_STEPPING_BRANCH; static constexpr u32 DEBUG_FLAG_TRACING_ANY = DEBUG_FLAG_TRACING | DEBUG_FLAG_TRACING_OVER; static constexpr u32 DEBUG_FLAG_TRANSIENT = DEBUG_FLAG_STEPPING_ANY | DEBUG_FLAG_STOP_PC | DEBUG_FLAG_STOP_INTERRUPT | DEBUG_FLAG_STOP_EXCEPTION | DEBUG_FLAG_STOP_VBLANK | - DEBUG_FLAG_STOP_TIME | DEBUG_FLAG_STOP_PRIVILEGE; + DEBUG_FLAG_STOP_TIME | DEBUG_FLAG_STOP_PRIVILEGE | DEBUG_FLAG_CALL_IN_PROGRESS | DEBUG_FLAG_TEST_IN_PROGRESS; }; //************************************************************************** diff -Nru mame-0.242+dfsg.1/src/emu/debug/debughlp.cpp mame-0.243+dfsg.1/src/emu/debug/debughlp.cpp --- mame-0.242+dfsg.1/src/emu/debug/debughlp.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/emu/debug/debughlp.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -132,6 +132,9 @@ " o[ver] [=1] -- single steps over instructions (F10)\n" " out -- single steps until the current subroutine/exception handler is exited (Shift-F11)\n" " g[o] [
] -- resumes execution, sets temp breakpoint at
(F5)\n" + " gbf [] -- resumes execution until next false branch\n" + " gbt [] -- resumes execution until next true branch\n" + " gn[i] [] -- resumes execution, sets temp breakpoint instructions ahead\n" " ge[x] [[,]] -- resumes execution, setting temp breakpoint if is raised\n" " gi[nt] [] -- resumes execution, setting temp breakpoint if is taken (F7)\n" " gt[ime] -- resumes execution until the given delay has elapsed\n" @@ -920,6 +923,65 @@ " Resume execution, stopping at address 1234 unless something else stops us first.\n" }, { + "gbf", + "\n" + " gbf []\n" + "\n" + "The gbf command resumes execution of the current code. Control will not be returned to the " + "debugger until a conditional branch or skip instruction tests false and falls through to the " + "next instruction, or the instruction that follows its delay slot. The optional conditional " + "expression, if provided, will be evaluated at (not after) each conditional branch; execution " + "will not halt regardless of consequent program flow unless its result is true (non-zero).\n" + "\n" + "Examples:\n" + "\n" + "gbf\n" + " Resume execution until the next break/watchpoint or until the next false branch.\n" + "\n" + "gbf {pc != 1234}\n" + " Resume execution until the next false branch, disregarding the instruction at address 1234.\n" + }, + { + "gbt", + "\n" + " gbt []\n" + "\n" + "The gbt command resumes execution of the current code. Control will not be returned to the " + "debugger until a conditional branch or skip instruction tests true and program flow transfers " + "to any instruction other than the next one following the delay slot (if any). The optional " + "conditional expression, if provided, will be evaluated at (not after) each conditional " + "branch; execution will not halt regardless of consequent program flow unless its result is " + "true (non-zero).\n" + "\n" + "Examples:\n" + "\n" + "gbt\n" + " Resume execution until the next break/watchpoint or until the next true branch.\n" + "\n" + "gbt {pc != 1234}\n" + " Resume execution until the next true branch, disregarding the instruction at address 1234.\n" + }, + { + "gni", + "\n" + " gn[i] []\n" + "\n" + "The gni command resumes execution of the current code. Control will not be returned to the " + "debugger until a breakpoint or watchpoint is hit, or until you manually break in using the " + "assigned key. Before executing, the gni command sets a temporary unconditional breakpoint " + " instructions sequentially past the current one, which is automatically removed when " + "hit. If is omitted, its default value is 1." + "\n" + "Examples:\n" + "\n" + "gni\n" + " Resume execution, stopping at the address of the next instruction unless something else " + "stops us first.\n" + "\n" + "gni 2\n" + " Resume execution, stopping at two instructions past the current one.\n" + }, + { "gex", "\n" " ge[x] [,[]]\n" diff -Nru mame-0.242+dfsg.1/src/emu/device.h mame-0.243+dfsg.1/src/emu/device.h --- mame-0.242+dfsg.1/src/emu/device.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/emu/device.h 2022-04-29 05:37:26.000000000 +0000 @@ -210,7 +210,7 @@ assert(!owner); assert(!clock); - return make_unique_clear(mconfig, type, tag); + return std::make_unique(mconfig, type, tag); } create_func const m_creator; diff -Nru mame-0.242+dfsg.1/src/emu/diimage.cpp mame-0.243+dfsg.1/src/emu/diimage.cpp --- mame-0.242+dfsg.1/src/emu/diimage.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/emu/diimage.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -351,43 +351,25 @@ // to be loaded // **************************************************************************** -bool device_image_interface::run_hash(util::core_file &file, u32 skip_bytes, util::hash_collection &hashes, const char *types) +std::error_condition device_image_interface::run_hash(util::random_read &file, u32 skip_bytes, util::hash_collection &hashes, const char *types) { // reset the hash; we want to override existing data hashes.reset(); // figure out the size, and "cap" the skip bytes u64 size; - if (file.length(size)) - return false; + std::error_condition filerr = file.length(size); + if (filerr) + return filerr; skip_bytes = u32(std::min(skip_bytes, size)); - // seek to the beginning - file.seek(skip_bytes, SEEK_SET); // TODO: check error return - u64 position = skip_bytes; - - // keep on reading hashes - hashes.begin(types); - while (position < size) - { - uint8_t buffer[8192]; - - // read bytes - const size_t count = size_t(std::min(size - position, sizeof(buffer))); - size_t actual_count; - const std::error_condition filerr = file.read(buffer, count, actual_count); - if (filerr || !actual_count) - return false; - position += actual_count; + // and compute the hashes + size_t actual_count; + filerr = hashes.compute(file, skip_bytes, size - skip_bytes, actual_count, types); + if (filerr) + return filerr; - // and compute the hashes - hashes.buffer(buffer, actual_count); - } - hashes.end(); - - // cleanup - file.seek(0, SEEK_SET); // TODO: check error return - return true; + return std::error_condition(); } @@ -408,18 +390,18 @@ return true; // run the hash - if (!run_hash(*m_file, unhashed_header_length(), m_hash, util::hash_collection::HASH_TYPES_ALL)) + if (run_hash(*m_file, unhashed_header_length(), m_hash, util::hash_collection::HASH_TYPES_ALL)) return false; } return true; } -util::hash_collection device_image_interface::calculate_hash_on_file(util::core_file &file) const +util::hash_collection device_image_interface::calculate_hash_on_file(util::random_read &file) const { // calculate the hash util::hash_collection hash; - if (!run_hash(file, unhashed_header_length(), hash, util::hash_collection::HASH_TYPES_ALL)) + if (run_hash(file, unhashed_header_length(), hash, util::hash_collection::HASH_TYPES_ALL)) hash.reset(); return hash; } diff -Nru mame-0.242+dfsg.1/src/emu/diimage.h mame-0.243+dfsg.1/src/emu/diimage.h --- mame-0.242+dfsg.1/src/emu/diimage.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/emu/diimage.h 2022-04-29 05:37:26.000000000 +0000 @@ -113,7 +113,7 @@ const util::option_guide &device_get_creation_option_guide() const { return create_option_guide(); } std::string_view error(); - void seterror(std::error_condition err, const char *message); + void seterror(std::error_condition err, const char *message = nullptr); void message(const char *format, ...) ATTR_PRINTF(2,3); bool exists() const noexcept { return !m_image_name.empty(); } @@ -126,7 +126,7 @@ bool is_filetype(std::string_view candidate_filetype) const; bool is_open() const noexcept { return bool(m_file); } - util::core_file &image_core_file() const noexcept { return *m_file; } + util::core_file &image_core_file() const noexcept { assert(is_open()); return *m_file; } bool is_readonly() const noexcept { return m_readonly; } // image file I/O wrappers @@ -165,28 +165,11 @@ m_file->tell(result); return result; } - int fgetc() - { - char ch; - if (fread(&ch, 1) != 1) - ch = '\0'; - return ch; - } - char *fgets(char *buffer, u32 length) - { - check_for_file(); - return m_file->gets(buffer, length); - } bool image_feof() { check_for_file(); return m_file->eof(); } - const void *ptr() - { - check_for_file(); - return m_file->buffer(); - } // allocate and read into buffers u32 fread(std::unique_ptr &ptr, u32 length) { ptr = std::make_unique(length); return fread(ptr.get(), length); } @@ -211,7 +194,7 @@ u32 crc(); util::hash_collection& hash() { return m_hash; } - util::hash_collection calculate_hash_on_file(util::core_file &file) const; + util::hash_collection calculate_hash_on_file(util::random_read &file) const; void battery_load(void *buffer, int length, int fill); void battery_load(void *buffer, int length, const void *def_buffer); @@ -294,7 +277,7 @@ bool load_software_part(std::string_view identifier); bool init_phase() const; - static bool run_hash(util::core_file &file, u32 skip_bytes, util::hash_collection &hashes, const char *types); + static std::error_condition run_hash(util::random_read &file, u32 skip_bytes, util::hash_collection &hashes, const char *types); // loads an image or software items and resets - called internally when we // load an is_reset_on_load() item diff -Nru mame-0.242+dfsg.1/src/emu/emucore.h mame-0.243+dfsg.1/src/emu/emucore.h --- mame-0.242+dfsg.1/src/emu/emucore.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/emu/emucore.h 2022-04-29 05:37:26.000000000 +0000 @@ -13,35 +13,38 @@ #pragma once -// standard C includes -#include -#include -#include -#include -#include -#include - // some cleanups for Solaris for things defined in stdlib.h #if defined(__sun__) && defined(__svr4__) #undef si_status #undef WWORD #endif -// standard C++ includes -#include -#include -#include -#include +// centralised forward declarations +#include "emufwd.h" -// core system includes -#include "osdcomm.h" +// common stuff from lib/util +#include "corealloc.h" #include "coretmpl.h" #include "bitmap.h" #include "endianness.h" #include "strformat.h" #include "vecstream.h" -#include "emufwd.h" +// common stuff from osd +#include "osdcomm.h" + +// standard C++ includes +#include +#include +#include +#include + +// standard C includes +#include +#include +#include +#include +#include //************************************************************************** @@ -421,4 +424,11 @@ return u.vv; } + +//************************************************************************** +// USEFUL UTILITIES +//************************************************************************** + +using util::make_unique_clear; + #endif // MAME_EMU_EMUCORE_H diff -Nru mame-0.242+dfsg.1/src/emu/emu.h mame-0.243+dfsg.1/src/emu/emu.h --- mame-0.242+dfsg.1/src/emu/emu.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/emu/emu.h 2022-04-29 05:37:26.000000000 +0000 @@ -38,7 +38,6 @@ #include "profiler.h" // commonly-referenced utilities imported from lib/util -#include "corealloc.h" #include "corefile.h" #include "delegate.h" #include "hash.h" diff -Nru mame-0.242+dfsg.1/src/emu/fileio.cpp mame-0.243+dfsg.1/src/emu/fileio.cpp --- mame-0.242+dfsg.1/src/emu/fileio.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/emu/fileio.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -259,7 +259,7 @@ // determine which hashes we need std::string needed; for (char scan : types) - if (already_have.find_first_of(scan) == -1) + if (already_have.find_first_of(scan) == std::string::npos) needed.push_back(scan); // if we need nothing, skip it @@ -279,15 +279,14 @@ return m_hashes; } - // read the data if we can - const u8 *filedata = (const u8 *)m_file->buffer(); - if (filedata == nullptr) + std::uint64_t length; + if (m_file->length(length)) return m_hashes; - // compute the hash - std::uint64_t length; - if (!m_file->length(length)) - m_hashes.compute(filedata, length, needed.c_str()); + // hash the data + std::size_t actual; + (void)m_hashes.compute(*m_file, 0U, length, actual, needed.c_str()); // FIXME: need better interface to report errors + return m_hashes; } @@ -805,7 +804,7 @@ m_zipdata.resize(m_ziplength); // read the data into our buffer and return - auto const ziperr = m_zipfile->decompress(&m_zipdata[0], m_zipdata.size()); + auto const ziperr = m_zipfile->decompress(m_zipdata.data(), m_zipdata.size()); if (ziperr) { m_zipdata.clear(); @@ -813,7 +812,7 @@ } // convert to RAM file - std::error_condition const filerr = util::core_file::open_ram(&m_zipdata[0], m_zipdata.size(), m_openflags, m_file); + std::error_condition const filerr = util::core_file::open_ram(m_zipdata.data(), m_zipdata.size(), m_openflags, m_file); if (filerr) { m_zipdata.clear(); diff -Nru mame-0.242+dfsg.1/src/emu/screen.cpp mame-0.243+dfsg.1/src/emu/screen.cpp --- mame-0.242+dfsg.1/src/emu/screen.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/emu/screen.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -555,7 +555,7 @@ , m_curtexture(0) , m_changed(true) , m_last_partial_scan(0) - , m_partial_scan_hpos(-1) + , m_partial_scan_hpos(0) , m_color(rgb_t(0xff, 0xff, 0xff, 0xff)) , m_brightness(0xff) , m_frame_period(DEFAULT_FRAME_PERIOD.as_attoseconds()) @@ -1245,7 +1245,7 @@ // remember where we left off m_last_partial_scan = scanline + 1; - m_partial_scan_hpos = -1; + m_partial_scan_hpos = 0; return true; } @@ -1299,10 +1299,10 @@ if (current_vpos > m_last_partial_scan) { // if the line before us was incomplete, we must do it in two pieces - if (m_partial_scan_hpos >= 0) + if (m_partial_scan_hpos > 0) { // now finish the previous partial scanline - clip.set((std::max)(clip.left(), m_partial_scan_hpos + 1), + clip.set((std::max)(clip.left(), m_partial_scan_hpos), clip.right(), (std::max)(clip.top(), m_last_partial_scan), (std::min)(clip.bottom(), m_last_partial_scan)); @@ -1341,7 +1341,7 @@ m_changed |= ~flags & UPDATE_HAS_NOT_CHANGED; } - m_partial_scan_hpos = -1; + m_partial_scan_hpos = 0; m_last_partial_scan++; } if (current_vpos > m_last_partial_scan) @@ -1351,47 +1351,50 @@ } // now draw this partial scanline - clip = m_visarea; - - clip.set((std::max)(clip.left(), m_partial_scan_hpos + 1), - (std::min)(clip.right(), current_hpos), - (std::max)(clip.top(), current_vpos), - (std::min)(clip.bottom(), current_vpos)); - - // and if there's something to draw, do it - if (!clip.empty()) + if (current_hpos > 0) { - g_profiler.start(PROFILER_VIDEO); + clip = m_visarea; - LOG_PARTIAL_UPDATES(("doing scanline partial draw: Y %d X %d-%d\n", clip.bottom(), clip.left(), clip.right())); + clip.set((std::max)(clip.left(), m_partial_scan_hpos), + (std::min)(clip.right(), current_hpos - 1), + (std::max)(clip.top(), current_vpos), + (std::min)(clip.bottom(), current_vpos)); - u32 flags = 0; - screen_bitmap &curbitmap = m_bitmap[m_curbitmap]; - if (m_video_attributes & VIDEO_VARIABLE_WIDTH) + // and if there's something to draw, do it + if (!clip.empty()) { - pre_update_scanline(current_vpos); - switch (curbitmap.format()) + g_profiler.start(PROFILER_VIDEO); + + LOG_PARTIAL_UPDATES(("doing scanline partial draw: Y %d X %d-%d\n", clip.bottom(), clip.left(), clip.right())); + + u32 flags = 0; + screen_bitmap &curbitmap = m_bitmap[m_curbitmap]; + if (m_video_attributes & VIDEO_VARIABLE_WIDTH) { - default: - case BITMAP_FORMAT_IND16: flags = m_screen_update_ind16(*this, *(bitmap_ind16 *)m_scan_bitmaps[m_curbitmap][current_vpos], clip); break; - case BITMAP_FORMAT_RGB32: flags = m_screen_update_rgb32(*this, *(bitmap_rgb32 *)m_scan_bitmaps[m_curbitmap][current_vpos], clip); break; + pre_update_scanline(current_vpos); + switch (curbitmap.format()) + { + default: + case BITMAP_FORMAT_IND16: flags = m_screen_update_ind16(*this, *(bitmap_ind16 *)m_scan_bitmaps[m_curbitmap][current_vpos], clip); break; + case BITMAP_FORMAT_RGB32: flags = m_screen_update_rgb32(*this, *(bitmap_rgb32 *)m_scan_bitmaps[m_curbitmap][current_vpos], clip); break; + } } - } - else - { - switch (curbitmap.format()) + else { - default: - case BITMAP_FORMAT_IND16: flags = m_screen_update_ind16(*this, curbitmap.as_ind16(), clip); break; - case BITMAP_FORMAT_RGB32: flags = m_screen_update_rgb32(*this, curbitmap.as_rgb32(), clip); break; + switch (curbitmap.format()) + { + default: + case BITMAP_FORMAT_IND16: flags = m_screen_update_ind16(*this, curbitmap.as_ind16(), clip); break; + case BITMAP_FORMAT_RGB32: flags = m_screen_update_rgb32(*this, curbitmap.as_rgb32(), clip); break; + } } - } - m_partial_updates_this_frame++; - g_profiler.stop(); + m_partial_updates_this_frame++; + g_profiler.stop(); - // if we modified the bitmap, we have to commit - m_changed |= ~flags & UPDATE_HAS_NOT_CHANGED; + // if we modified the bitmap, we have to commit + m_changed |= ~flags & UPDATE_HAS_NOT_CHANGED; + } } // remember where we left off @@ -1408,7 +1411,7 @@ void screen_device::reset_partial_updates() { m_last_partial_scan = 0; - m_partial_scan_hpos = -1; + m_partial_scan_hpos = 0; m_partial_updates_this_frame = 0; m_scanline0_timer->adjust(time_until_pos(0)); } diff -Nru mame-0.242+dfsg.1/src/emu/screen.h mame-0.243+dfsg.1/src/emu/screen.h --- mame-0.242+dfsg.1/src/emu/screen.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/emu/screen.h 2022-04-29 05:37:26.000000000 +0000 @@ -225,7 +225,7 @@ screen_device &set_raw(u32 pixclock, u16 htotal, u16 hbend, u16 hbstart, u16 vtotal, u16 vbend, u16 vbstart) { assert(pixclock != 0); - m_clock = pixclock; + set_clock(pixclock); m_refresh = HZ_TO_ATTOSECONDS(pixclock) * htotal * vtotal; m_vblank = m_refresh / vtotal * (vtotal - (vbstart - vbend)); m_width = htotal; diff -Nru mame-0.242+dfsg.1/src/emu/video.cpp mame-0.243+dfsg.1/src/emu/video.cpp --- mame-0.242+dfsg.1/src/emu/video.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/emu/video.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -597,7 +597,7 @@ bool has_live_screen = false; for (screen_device &screen : iter) { - if (screen.partial_scan_hpos() >= 0) // previous update ended mid-scanline + if (screen.partial_scan_hpos() > 0) // previous update ended mid-scanline screen.update_now(); screen.update_partial(screen.visible_area().max_y); diff -Nru mame-0.242+dfsg.1/src/frontend/mame/luaengine.cpp mame-0.243+dfsg.1/src/frontend/mame/luaengine.cpp --- mame-0.242+dfsg.1/src/frontend/mame/luaengine.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/frontend/mame/luaengine.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1797,6 +1797,7 @@ ui_type["single_step"] = sol::property(&mame_ui_manager::single_step, &mame_ui_manager::set_single_step); ui_type["show_fps"] = sol::property(&mame_ui_manager::show_fps, &mame_ui_manager::set_show_fps); ui_type["show_profiler"] = sol::property(&mame_ui_manager::show_profiler, &mame_ui_manager::set_show_profiler); + ui_type["image_display_enabled"] = sol::property(&mame_ui_manager::image_display_enabled, &mame_ui_manager::set_image_display_enabled); /* device_state_entry library diff -Nru mame-0.242+dfsg.1/src/frontend/mame/luaengine_debug.cpp mame-0.243+dfsg.1/src/frontend/mame/luaengine_debug.cpp --- mame-0.242+dfsg.1/src/frontend/mame/luaengine_debug.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/frontend/mame/luaengine_debug.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -101,6 +101,29 @@ symbol_entry &add(char const *name) { return m_table.add(name, symbol_table::READ_WRITE); } symbol_entry &add(char const *name, u64 value) { return m_table.add(name, value); } + symbol_entry &add(char const *name, sol::protected_function getter, std::optional setter, std::optional format) + { + symbol_table::setter_func setfun; + if (setter) + setfun = [cbfunc = std::move(*setter)] (u64 value) { invoke(cbfunc, value); }; + return m_table.add( + name, + [cbfunc = std::move(getter)] () -> u64 + { + auto result = invoke(cbfunc).get >(); + if (result) + { + return *result; + } + else + { + osd_printf_error("[LUA EROR] invalid return from symbol value getter callback\n"); + return 0; + } + }, + std::move(setfun), + (format && *format) ? *format : ""); + } symbol_entry *find(char const *name) const { return m_table.find(name); } symbol_entry *find_deep(char const *name) { return m_table.find_deep(name); } @@ -181,30 +204,6 @@ { "m", EXPSPACE_REGION } }; - auto const do_add_symbol = [] (symbol_table_wrapper &st, char const *name, sol::protected_function getter, std::optional setter, std::optional format) -> symbol_entry & - { - symbol_table::setter_func setfun; - if (setter) - setfun = [cbfunc = std::move(*setter)] (u64 value) { invoke(cbfunc, value); }; - return st.table().add( - name, - [cbfunc = std::move(getter)] () -> u64 - { - auto result = invoke(cbfunc).get >(); - if (result) - { - return *result; - } - else - { - osd_printf_error("[LUA EROR] invalid return from symbol value getter callback\n"); - return 0; - } - }, - std::move(setfun), - (format && *format) ? *format : ""); - }; - auto symbol_table_type = emu.new_usertype( "symbol_table", sol::call_constructor, sol::factories( @@ -229,22 +228,22 @@ symbol_table_type["add"] = sol::overload( static_cast(&symbol_table_wrapper::add), static_cast(&symbol_table_wrapper::add), - do_add_symbol, - [do_add_symbol] (symbol_table_wrapper &st, char const *name, sol::protected_function getter, sol::lua_nil_t, char const *format) -> symbol_entry & + static_cast, std::optional)>(&symbol_table_wrapper::add), + [] (symbol_table_wrapper &st, char const *name, sol::protected_function getter, sol::lua_nil_t, char const *format) -> symbol_entry & { - return do_add_symbol(st, name, getter, std::nullopt, format); + return st.add(name, getter, std::nullopt, format); }, - [do_add_symbol] (symbol_table_wrapper &st, char const *name, sol::protected_function getter, std::optional setter) -> symbol_entry & + [] (symbol_table_wrapper &st, char const *name, sol::protected_function getter, std::optional setter) -> symbol_entry & { - return do_add_symbol(st, name, getter, setter, nullptr); + return st.add(name, getter, setter, nullptr); }, - [do_add_symbol] (symbol_table_wrapper &st, char const *name, sol::protected_function getter, char const *format) -> symbol_entry & + [] (symbol_table_wrapper &st, char const *name, sol::protected_function getter, char const *format) -> symbol_entry & { - return do_add_symbol(st, name, getter, std::nullopt, format); + return st.add(name, getter, std::nullopt, format); }, - [do_add_symbol] (symbol_table_wrapper &st, char const *name, sol::protected_function getter) -> symbol_entry & + [] (symbol_table_wrapper &st, char const *name, sol::protected_function getter) -> symbol_entry & { - return do_add_symbol(st, name, getter, std::nullopt, nullptr); + return st.add(name, getter, std::nullopt, nullptr); }, [] (symbol_table_wrapper &st, sol::this_state s, char const *name, int minparams, int maxparams, sol::protected_function execute) -> symbol_entry & { @@ -259,7 +258,7 @@ sol::stack_aligned_stack_handler_function func(L, -1, traceback); for (int i = 0; numparams > i; ++i) lua_pushinteger(L, paramlist[i]); - auto result = func(sol::stack_count(numparams)).get >(); + auto result = func(sol::stack_count(numparams)).get >(); traceback.pop(); return result ? *result : 0; }); diff -Nru mame-0.242+dfsg.1/src/frontend/mame/luaengine_input.cpp mame-0.243+dfsg.1/src/frontend/mame/luaengine_input.cpp --- mame-0.242+dfsg.1/src/frontend/mame/luaengine_input.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/frontend/mame/luaengine_input.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -160,10 +160,20 @@ input_seq_type seq_type = seq_type_string ? s_seq_type_parser(*seq_type_string) : SEQ_TYPE_STANDARD; return im.type_seq(type, *player, seq_type); }, + [] (ioport_manager &im, ioport_type type, std::optional player) + { + if (!player) + player = 0; + return im.type_seq(type, *player); + }, [] (ioport_manager &im, input_type_entry const &type, std::optional seq_type_string) { input_seq_type seq_type = seq_type_string ? s_seq_type_parser(*seq_type_string) : SEQ_TYPE_STANDARD; return im.type_seq(type.type(), type.player(), seq_type); + }, + [] (ioport_manager &im, input_type_entry const &type) + { + return im.type_seq(type.type(), type.player()); }); ioport_manager_type["set_type_seq"] = sol::overload( [] (ioport_manager &im, ioport_type type, std::optional player, std::optional seq_type_string, input_seq const &seq) diff -Nru mame-0.242+dfsg.1/src/frontend/mame/luaengine.ipp mame-0.243+dfsg.1/src/frontend/mame/luaengine.ipp --- mame-0.242+dfsg.1/src/frontend/mame/luaengine.ipp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/frontend/mame/luaengine.ipp 2022-04-29 05:37:26.000000000 +0000 @@ -546,7 +546,7 @@ } else { - auto result(invoke(cbfunc).get >()); + auto result(invoke(cbfunc).get >()); if (result) { return *result; diff -Nru mame-0.242+dfsg.1/src/frontend/mame/luaengine_mem.cpp mame-0.243+dfsg.1/src/frontend/mame/luaengine_mem.cpp --- mame-0.242+dfsg.1/src/frontend/mame/luaengine_mem.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/frontend/mame/luaengine_mem.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -268,7 +268,7 @@ m_name, [this] (offs_t offset, T &data, T mem_mask) { - auto result = invoke(m_callback, offset, data, mem_mask).template get >(); + auto result = invoke(m_callback, offset, data, mem_mask).template get >(); if (result) data = *result; }, @@ -281,7 +281,7 @@ m_name, [this] (offs_t offset, T &data, T mem_mask) { - auto result = invoke(m_callback, offset, data, mem_mask).template get >(); + auto result = invoke(m_callback, offset, data, mem_mask).template get >(); if (result) data = *result; }, diff -Nru mame-0.242+dfsg.1/src/frontend/mame/media_ident.cpp mame-0.243+dfsg.1/src/frontend/mame/media_ident.cpp --- mame-0.242+dfsg.1/src/frontend/mame/media_ident.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/frontend/mame/media_ident.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -2,7 +2,7 @@ // copyright-holders:Aaron Giles /*************************************************************************** - media_ident.c + media_ident.cpp Media identify. @@ -260,33 +260,27 @@ // load the file and process if it opens and has a valid length util::core_file::ptr file; - if (util::core_file::open(path, OPEN_FLAG_READ, file) || !file) + std::error_condition err = util::core_file::open(path, OPEN_FLAG_READ, file); + if (err || !file) { - osd_printf_error("%s: error opening file\n", path); + osd_printf_error("%s: error opening file (%s)\n", path, err ? err.message() : std::string("could not allocate pointer")); return; } std::uint64_t length; - if (file->length(length)) + err = file->length(length); + if (err) { - osd_printf_error("%s: error getting file length\n", path); + osd_printf_error("%s: error getting file length (%s)\n", path, err.message()); return; } util::hash_collection hashes; - hashes.begin(util::hash_collection::HASH_TYPES_CRC_SHA1); - std::uint8_t buf[1024]; - for (std::uint64_t remaining = length; remaining; ) + std::size_t actual; + err = hashes.compute(*file, 0U, length, actual, util::hash_collection::HASH_TYPES_CRC_SHA1); + if (err) { - std::size_t const block = std::min(remaining, sizeof(buf)); - std::size_t actual; - if (file->read(buf, block, actual) || !actual) - { - osd_printf_error("%s: error reading file\n", path); - return; - } - remaining -= actual; - hashes.buffer(buf, actual); + osd_printf_error("%s: error reading file (%s)\n", path, err.message()); + return; } - hashes.end(); info.emplace_back(path, length, std::move(hashes), file_flavour::RAW); m_total++; } diff -Nru mame-0.242+dfsg.1/src/frontend/mame/ui/datmenu.cpp mame-0.243+dfsg.1/src/frontend/mame/ui/datmenu.cpp --- mame-0.242+dfsg.1/src/frontend/mame/ui/datmenu.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/frontend/mame/ui/datmenu.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -359,7 +359,7 @@ if ((hover() - HOVER_INFO_TEXT - 1) != m_actual) { m_actual = hover() - HOVER_INFO_TEXT - 1; - reset(reset_options::SELECT_FIRST); + reset_layout(); } return true; } diff -Nru mame-0.242+dfsg.1/src/frontend/mame/ui/filecreate.cpp mame-0.243+dfsg.1/src/frontend/mame/ui/filecreate.cpp --- mame-0.242+dfsg.1/src/frontend/mame/ui/filecreate.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/frontend/mame/ui/filecreate.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -231,7 +231,7 @@ // ctor //------------------------------------------------- -menu_select_format::menu_select_format(mame_ui_manager &mui, render_container &container, const std::vector &formats, int ext_match, floppy_image_format_t **result) +menu_select_format::menu_select_format(mame_ui_manager &mui, render_container &container, const std::vector &formats, int ext_match, const floppy_image_format_t **result) : menu(mui, container) { m_formats = formats; @@ -258,11 +258,11 @@ item_append(_("Select image format"), FLAG_DISABLE, nullptr); for (unsigned int i = 0; i != m_formats.size(); i++) { - floppy_image_format_t *fmt = m_formats[i]; + const floppy_image_format_t *fmt = m_formats[i]; if (i && i == m_ext_match) item_append(menu_item_type::SEPARATOR); - item_append(fmt->description(), fmt->name(), 0, fmt); + item_append(fmt->description(), fmt->name(), 0, const_cast(fmt)); } } @@ -290,9 +290,9 @@ // ctor //------------------------------------------------- -menu_select_floppy_init::menu_select_floppy_init(mame_ui_manager &mui, render_container &container, const std::vector &fs, int *result) +menu_select_floppy_init::menu_select_floppy_init(mame_ui_manager &mui, render_container &container, std::vector> &&fs, int *result) : menu(mui, container), - m_fs(fs), + m_fs(std::move(fs)), m_result(result) { @@ -316,7 +316,7 @@ { item_append(_("Select initial contents"), FLAG_DISABLE, nullptr); int id = 0; - for (const auto &fmt : m_fs) + for (const floppy_image_device::fs_info &fmt : m_fs) item_append(fmt.m_description, fmt.m_name, 0, (void *)(uintptr_t)(id++)); } diff -Nru mame-0.242+dfsg.1/src/frontend/mame/ui/filecreate.h mame-0.243+dfsg.1/src/frontend/mame/ui/filecreate.h --- mame-0.242+dfsg.1/src/frontend/mame/ui/filecreate.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/frontend/mame/ui/filecreate.h 2022-04-29 05:37:26.000000000 +0000 @@ -67,7 +67,7 @@ { public: menu_select_format(mame_ui_manager &mui, render_container &container, - const std::vector &formats, int ext_match, floppy_image_format_t **result); + const std::vector &formats, int ext_match, const floppy_image_format_t **result); virtual ~menu_select_format() override; private: @@ -75,9 +75,9 @@ virtual void handle(event const *ev) override; // internal state - std::vector m_formats; - int m_ext_match; - floppy_image_format_t * *m_result; + std::vector m_formats; + int m_ext_match; + const floppy_image_format_t * *m_result; }; // ======================> menu_select_floppy_init @@ -86,7 +86,7 @@ { public: menu_select_floppy_init(mame_ui_manager &mui, render_container &container, - const std::vector &fs, int *result); + std::vector> &&fs, int *result); virtual ~menu_select_floppy_init() override; private: @@ -94,8 +94,8 @@ virtual void handle(event const *ev) override; // internal state - const std::vector &m_fs; - int * m_result; + std::vector> m_fs; + int * m_result; }; diff -Nru mame-0.242+dfsg.1/src/frontend/mame/ui/floppycntrl.cpp mame-0.243+dfsg.1/src/frontend/mame/ui/floppycntrl.cpp --- mame-0.242+dfsg.1/src/frontend/mame/ui/floppycntrl.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/frontend/mame/ui/floppycntrl.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -94,19 +94,24 @@ } } +bool menu_control_floppy_image::can_format(const floppy_image_device::fs_info &fs) +{ + return !fs.m_manager || fs.m_manager->can_format(); +} + void menu_control_floppy_image::menu_activated() { switch (m_state) { case DO_CREATE: { - std::vector format_array; - for(floppy_image_format_t *i : fd.get_formats()) { + std::vector format_array; + for(const floppy_image_format_t *i : fd.get_formats()) { if(!i->supports_save()) continue; if (i->extension_matches(m_current_file.c_str())) format_array.push_back(i); } int ext_match = format_array.size(); - for(floppy_image_format_t *i : fd.get_formats()) { + for(const floppy_image_format_t *i : fd.get_formats()) { if(!i->supports_save()) continue; if (!i->extension_matches(m_current_file.c_str())) @@ -124,26 +129,46 @@ m_state = START_FILE; menu_activated(); } else { - const auto &fs = fd.get_create_fs(); + // get all formatable file systems + std::vector> fs; + for (const auto &this_fs : fd.get_fs()) { + if (can_format(this_fs)) + fs.emplace_back(std::ref(this_fs)); + } + output_filename = util::zippath_combine(m_current_directory, m_current_file); if(fs.size() == 1) { - create_fs = &fs[0]; + create_fs = &(fs[0].get()); do_load_create(); stack_pop(); } else { m_submenu_result.i = -1; - menu::stack_push(ui(), container(), fs, &m_submenu_result.i); + menu::stack_push(ui(), container(), std::move(fs), &m_submenu_result.i); m_state = SELECT_INIT; } } break; case SELECT_INIT: - if(m_submenu_result.i == -1) { + // figure out which (if any) create file system was selected + create_fs = nullptr; + if(m_submenu_result.i >= 0) { + int i = 0; + for (const auto &this_fs : fd.get_fs()) { + if (can_format(this_fs)) { + if (i == m_submenu_result.i) { + create_fs = &this_fs; + break; + } + i++; + } + } + } + + if(!create_fs) { m_state = START_FILE; menu_activated(); } else { - create_fs = &fd.get_create_fs()[m_submenu_result.i]; do_load_create(); stack_pop(); } diff -Nru mame-0.242+dfsg.1/src/frontend/mame/ui/floppycntrl.h mame-0.243+dfsg.1/src/frontend/mame/ui/floppycntrl.h --- mame-0.242+dfsg.1/src/frontend/mame/ui/floppycntrl.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/frontend/mame/ui/floppycntrl.h 2022-04-29 05:37:26.000000000 +0000 @@ -33,12 +33,13 @@ enum { SELECT_FORMAT = LAST_ID, SELECT_MEDIA, SELECT_INIT, SELECT_RW }; floppy_image_device &fd; - floppy_image_format_t *input_format, *output_format; + const floppy_image_format_t *input_format, *output_format; const floppy_image_device::fs_info *create_fs; std::string input_filename, output_filename; void do_load_create(); virtual void hook_load(const std::string &filename) override; + static bool can_format(const floppy_image_device::fs_info &fs); }; } // namespace ui diff -Nru mame-0.242+dfsg.1/src/frontend/mame/ui/ui.cpp mame-0.243+dfsg.1/src/frontend/mame/ui/ui.cpp --- mame-0.242+dfsg.1/src/frontend/mame/ui/ui.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/frontend/mame/ui/ui.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -183,6 +183,7 @@ , m_target_font_height(0) , m_has_warnings(false) , m_unthrottle_mute(false) + , m_image_display_enabled(true) , m_machine_info() , m_unemulated_features() , m_imperfect_features() @@ -1182,7 +1183,7 @@ void mame_ui_manager::image_handler_ingame() { // run display routine for devices - if (machine().phase() == machine_phase::RUNNING) + if (m_image_display_enabled && machine().phase() == machine_phase::RUNNING) { auto layout = create_layout(machine().render().ui_container()); diff -Nru mame-0.242+dfsg.1/src/frontend/mame/ui/ui.h mame-0.243+dfsg.1/src/frontend/mame/ui/ui.h --- mame-0.242+dfsg.1/src/frontend/mame/ui/ui.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/frontend/mame/ui/ui.h 2022-04-29 05:37:26.000000000 +0000 @@ -202,6 +202,8 @@ // other void process_natural_keyboard(); ui::text_layout create_layout(render_container &container, float width = 1.0, ui::text_layout::text_justify justify = ui::text_layout::text_justify::LEFT, ui::text_layout::word_wrapping wrap = ui::text_layout::word_wrapping::WORD); + void set_image_display_enabled(bool image_display_enabled) { m_image_display_enabled = image_display_enabled; } + bool image_display_enabled() const { return m_image_display_enabled; } // draw an outlined box with given line color and filled with a texture void draw_textured_box(render_container &container, float x0, float y0, float x1, float y1, rgb_t backcolor, rgb_t linecolor, render_texture *texture = nullptr, uint32_t flags = PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA)); @@ -248,6 +250,7 @@ float m_target_font_height; bool m_has_warnings; bool m_unthrottle_mute; + bool m_image_display_enabled; std::unique_ptr m_machine_info; device_feature_set m_unemulated_features; diff -Nru mame-0.242+dfsg.1/src/lib/formats/2d_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/2d_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/2d_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/2d_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -38,4 +38,4 @@ {} }; -const floppy_format_type FLOPPY_2D_FORMAT = &floppy_image_format_creator<_2d_format>; +const _2d_format FLOPPY_2D_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/2d_dsk.h mame-0.243+dfsg.1/src/lib/formats/2d_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/2d_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/2d_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -27,6 +27,6 @@ static const format formats[]; }; -extern const floppy_format_type FLOPPY_2D_FORMAT; +extern const _2d_format FLOPPY_2D_FORMAT; #endif // MAME_FORMATS_2D_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/a5105_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/a5105_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/a5105_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/a5105_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -42,4 +42,4 @@ {} }; -const floppy_format_type FLOPPY_A5105_FORMAT = &floppy_image_format_creator; +const a5105_format FLOPPY_A5105_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/a5105_dsk.h mame-0.243+dfsg.1/src/lib/formats/a5105_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/a5105_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/a5105_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -27,6 +27,6 @@ static const format formats[]; }; -extern const floppy_format_type FLOPPY_A5105_FORMAT; +extern const a5105_format FLOPPY_A5105_FORMAT; #endif // MAME_FORMATS_A5105_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/abc1600_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/abc1600_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/abc1600_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/abc1600_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -57,9 +57,9 @@ {} }; -const floppy_format_type FLOPPY_ABC1600_FORMAT = &floppy_image_format_creator; +const abc1600_format FLOPPY_ABC1600_FORMAT; -int abc1600_format::get_image_offset(const format &f, int head, int track) +int abc1600_format::get_image_offset(const format &f, int head, int track) const { int offset = 0; diff -Nru mame-0.242+dfsg.1/src/lib/formats/abc1600_dsk.h mame-0.243+dfsg.1/src/lib/formats/abc1600_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/abc1600_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/abc1600_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -24,12 +24,12 @@ virtual const char *extensions() const override; protected: - virtual int get_image_offset(const format &f, int head, int track) override; + virtual int get_image_offset(const format &f, int head, int track) const override; private: static const format formats[]; }; -extern const floppy_format_type FLOPPY_ABC1600_FORMAT; +extern const abc1600_format FLOPPY_ABC1600_FORMAT; #endif // MAME_FORMATS_ABC1600_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/abc800_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/abc800_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/abc800_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/abc800_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -139,7 +139,7 @@ {} }; -const floppy_format_type FLOPPY_ABC800_FORMAT = &floppy_image_format_creator; +const abc800_format FLOPPY_ABC800_FORMAT; void abc800_format::build_sector_description(const format &f, uint8_t *sectdata, desc_s *sectors, int track, int head) const { diff -Nru mame-0.242+dfsg.1/src/lib/formats/abc800_dsk.h mame-0.243+dfsg.1/src/lib/formats/abc800_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/abc800_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/abc800_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -30,6 +30,6 @@ static const format formats[]; }; -extern const floppy_format_type FLOPPY_ABC800_FORMAT; +extern const abc800_format FLOPPY_ABC800_FORMAT; #endif // MAME_FORMATS_ABC800_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/abcfd2_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/abcfd2_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/abcfd2_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/abcfd2_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -57,4 +57,4 @@ {} }; -const floppy_format_type FLOPPY_ABC_FD2_FORMAT = &floppy_image_format_creator; +const abc_fd2_format FLOPPY_ABC_FD2_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/abcfd2_dsk.h mame-0.243+dfsg.1/src/lib/formats/abcfd2_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/abcfd2_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/abcfd2_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -27,6 +27,6 @@ static const format formats[]; }; -extern const floppy_format_type FLOPPY_ABC_FD2_FORMAT; +extern const abc_fd2_format FLOPPY_ABC_FD2_FORMAT; #endif // MAME_FORMATS_ABCFD2_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/acorn_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/acorn_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/acorn_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/acorn_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -35,7 +35,7 @@ return "ssd,bbc,img"; } -int acorn_ssd_format::find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int acorn_ssd_format::find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint8_t cat[8]; uint32_t sectors0, sectors2; @@ -108,17 +108,17 @@ return -1; } -int acorn_ssd_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int acorn_ssd_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { int type = find_size(io, form_factor, variants); if (type != -1) - return 90; + return FIFID_SIZE; return 0; } -int acorn_ssd_format::get_image_offset(const format &f, int head, int track) +int acorn_ssd_format::get_image_offset(const format &f, int head, int track) const { if (f.sector_base_id == -1) return (track * f.head_count + head) * compute_track_size(f); @@ -187,7 +187,7 @@ return "dsd"; } -int acorn_dsd_format::find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int acorn_dsd_format::find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint8_t cat[8]; uint32_t sectors0, sectors2; @@ -241,17 +241,17 @@ return -1; } -int acorn_dsd_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int acorn_dsd_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { int type = find_size(io, form_factor, variants); if (type != -1) - return 90; + return FIFID_SIZE; return 0; } -int acorn_dsd_format::get_image_offset(const format &f, int head, int track) +int acorn_dsd_format::get_image_offset(const format &f, int head, int track) const { if (f.sector_base_id == -1) return (track * f.head_count + head) * compute_track_size(f); @@ -300,7 +300,7 @@ return "dds"; } -int opus_ddos_format::find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int opus_ddos_format::find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { size_t actual; uint8_t cat[8]; @@ -346,17 +346,17 @@ return -1; } -int opus_ddos_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int opus_ddos_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { int type = find_size(io, form_factor, variants); if (type != -1) - return 90; + return FIFID_SIZE; return 0; } -int opus_ddos_format::get_image_offset(const format &f, int head, int track) +int opus_ddos_format::get_image_offset(const format &f, int head, int track) const { if (f.sector_base_id == -1) return (track * f.head_count + head) * compute_track_size(f); @@ -405,7 +405,7 @@ return "adf,ads,adm,adl"; } -int acorn_adfs_old_format::find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int acorn_adfs_old_format::find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { size_t actual; uint8_t map[3]; @@ -443,17 +443,17 @@ return -1; } -int acorn_adfs_old_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int acorn_adfs_old_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { int type = find_size(io, form_factor, variants); if(type != -1) - return 100; + return FIFID_SIZE; return 0; } -int acorn_adfs_old_format::get_image_offset(const format &f, int head, int track) +int acorn_adfs_old_format::get_image_offset(const format &f, int head, int track) const { if (f.sector_base_id == -1) return (track * f.head_count + head) * compute_track_size(f); @@ -510,7 +510,7 @@ return "adf"; } -int acorn_adfs_new_format::find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int acorn_adfs_new_format::find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { size_t actual; uint8_t dform[4]; @@ -547,17 +547,17 @@ return -1; } -int acorn_adfs_new_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int acorn_adfs_new_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { int type = find_size(io, form_factor, variants); if (type != -1) - return 100; + return FIFID_SIZE; return 0; } -int acorn_adfs_new_format::get_image_offset(const format &f, int head, int track) +int acorn_adfs_new_format::get_image_offset(const format &f, int head, int track) const { if (f.sector_base_id == -1) return (track * f.head_count + head) * compute_track_size(f); @@ -598,7 +598,7 @@ return "img"; } -int acorn_dos_format::find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int acorn_dos_format::find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint64_t size; if (io.length(size)) @@ -628,17 +628,17 @@ return -1; } -int acorn_dos_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int acorn_dos_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { int type = find_size(io, form_factor, variants); if (type != -1) - return 90; + return FIFID_SIZE; return 0; } -int acorn_dos_format::get_image_offset(const format &f, int head, int track) +int acorn_dos_format::get_image_offset(const format &f, int head, int track) const { if (f.sector_base_id == -1) return (track * f.head_count + head) * compute_track_size(f); @@ -680,7 +680,7 @@ return false; } -int opus_ddcpm_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int opus_ddcpm_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { size_t actual; uint8_t h[8]; @@ -695,13 +695,13 @@ } if (size == 819200 && memcmp(h, "Slogger ", 8) == 0) - return 100; + return FIFID_SIGN | FIFID_SIZE; LOG_FORMATS("ddcpm: no match\n"); return 0; } -bool opus_ddcpm_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool opus_ddcpm_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { // Double density discs formatted with DDCPM : // @@ -750,16 +750,16 @@ return true; } -bool opus_ddcpm_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) +bool opus_ddcpm_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const { return false; } -const floppy_format_type FLOPPY_ACORN_SSD_FORMAT = &floppy_image_format_creator; -const floppy_format_type FLOPPY_ACORN_DSD_FORMAT = &floppy_image_format_creator; -const floppy_format_type FLOPPY_ACORN_DOS_FORMAT = &floppy_image_format_creator; -const floppy_format_type FLOPPY_ACORN_ADFS_OLD_FORMAT = &floppy_image_format_creator; -const floppy_format_type FLOPPY_ACORN_ADFS_NEW_FORMAT = &floppy_image_format_creator; -const floppy_format_type FLOPPY_OPUS_DDOS_FORMAT = &floppy_image_format_creator; -const floppy_format_type FLOPPY_OPUS_DDCPM_FORMAT = &floppy_image_format_creator; +const acorn_ssd_format FLOPPY_ACORN_SSD_FORMAT; +const acorn_dsd_format FLOPPY_ACORN_DSD_FORMAT; +const acorn_dos_format FLOPPY_ACORN_DOS_FORMAT; +const acorn_adfs_old_format FLOPPY_ACORN_ADFS_OLD_FORMAT; +const acorn_adfs_new_format FLOPPY_ACORN_ADFS_NEW_FORMAT; +const opus_ddos_format FLOPPY_OPUS_DDOS_FORMAT; +const opus_ddcpm_format FLOPPY_OPUS_DDCPM_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/acorn_dsk.h mame-0.243+dfsg.1/src/lib/formats/acorn_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/acorn_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/acorn_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -20,9 +20,9 @@ public: acorn_ssd_format(); - virtual int find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual int get_image_offset(const format &f, int head, int track) override; + virtual int find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual int get_image_offset(const format &f, int head, int track) const override; virtual const char *name() const override; virtual const char *description() const override; virtual const char *extensions() const override; @@ -36,9 +36,9 @@ public: acorn_dsd_format(); - virtual int find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual int get_image_offset(const format &f, int head, int track) override; + virtual int find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual int get_image_offset(const format &f, int head, int track) const override; virtual const char *name() const override; virtual const char *description() const override; virtual const char *extensions() const override; @@ -52,9 +52,9 @@ public: opus_ddos_format(); - virtual int find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual int get_image_offset(const format &f, int head, int track) override; + virtual int find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual int get_image_offset(const format &f, int head, int track) const override; virtual const char *name() const override; virtual const char *description() const override; virtual const char *extensions() const override; @@ -68,9 +68,9 @@ public: acorn_adfs_old_format(); - virtual int find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual int get_image_offset(const format &f, int head, int track) override; + virtual int find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual int get_image_offset(const format &f, int head, int track) const override; virtual const char *name() const override; virtual const char *description() const override; virtual const char *extensions() const override; @@ -84,9 +84,9 @@ public: acorn_adfs_new_format(); - virtual int find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual int get_image_offset(const format &f, int head, int track) override; + virtual int find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual int get_image_offset(const format &f, int head, int track) const override; virtual const char *name() const override; virtual const char *description() const override; virtual const char *extensions() const override; @@ -100,9 +100,9 @@ public: acorn_dos_format(); - virtual int find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual int get_image_offset(const format &f, int head, int track) override; + virtual int find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual int get_image_offset(const format &f, int head, int track) const override; virtual const char *name() const override; virtual const char *description() const override; virtual const char *extensions() const override; @@ -116,9 +116,9 @@ public: opus_ddcpm_format(); - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; - virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; + virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const override; virtual const char *name() const override; virtual const char *description() const override; @@ -127,12 +127,12 @@ }; -extern const floppy_format_type FLOPPY_ACORN_SSD_FORMAT; -extern const floppy_format_type FLOPPY_ACORN_DSD_FORMAT; -extern const floppy_format_type FLOPPY_ACORN_DOS_FORMAT; -extern const floppy_format_type FLOPPY_ACORN_ADFS_OLD_FORMAT; -extern const floppy_format_type FLOPPY_ACORN_ADFS_NEW_FORMAT; -extern const floppy_format_type FLOPPY_OPUS_DDOS_FORMAT; -extern const floppy_format_type FLOPPY_OPUS_DDCPM_FORMAT; +extern const acorn_ssd_format FLOPPY_ACORN_SSD_FORMAT; +extern const acorn_dsd_format FLOPPY_ACORN_DSD_FORMAT; +extern const acorn_dos_format FLOPPY_ACORN_DOS_FORMAT; +extern const acorn_adfs_old_format FLOPPY_ACORN_ADFS_OLD_FORMAT; +extern const acorn_adfs_new_format FLOPPY_ACORN_ADFS_NEW_FORMAT; +extern const opus_ddos_format FLOPPY_OPUS_DDOS_FORMAT; +extern const opus_ddcpm_format FLOPPY_OPUS_DDCPM_FORMAT; #endif // MAME_FORMATS_ACORN_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/adam_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/adam_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/adam_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/adam_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -65,4 +65,4 @@ {} }; -const floppy_format_type FLOPPY_ADAM_FORMAT = &floppy_image_format_creator; +const adam_format FLOPPY_ADAM_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/adam_dsk.h mame-0.243+dfsg.1/src/lib/formats/adam_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/adam_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/adam_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -27,6 +27,6 @@ static const format formats[]; }; -extern const floppy_format_type FLOPPY_ADAM_FORMAT; +extern const adam_format FLOPPY_ADAM_FORMAT; #endif // MAME_FORMATS_ADAM_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/afs_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/afs_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/afs_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/afs_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -30,17 +30,17 @@ return "adl,img"; } -int afs_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int afs_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { int type = find_size(io, form_factor, variants); if (type != -1) - return 50; + return FIFID_SIZE; return 0; } -int afs_format::get_image_offset(const format &f, int head, int track) +int afs_format::get_image_offset(const format &f, int head, int track) const { if (f.sector_base_id == -1) return (track * f.head_count + head) * compute_track_size(f); @@ -58,4 +58,4 @@ }; -const floppy_format_type FLOPPY_AFS_FORMAT = &floppy_image_format_creator; +const afs_format FLOPPY_AFS_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/afs_dsk.h mame-0.243+dfsg.1/src/lib/formats/afs_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/afs_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/afs_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -20,8 +20,8 @@ public: afs_format(); - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual int get_image_offset(const format &f, int head, int track) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual int get_image_offset(const format &f, int head, int track) const override; virtual const char *name() const override; virtual const char *description() const override; virtual const char *extensions() const override; @@ -31,6 +31,6 @@ }; -extern const floppy_format_type FLOPPY_AFS_FORMAT; +extern const afs_format FLOPPY_AFS_FORMAT; #endif // MAME_FORMATS_AFS_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/aim_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/aim_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/aim_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/aim_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -40,20 +40,20 @@ } -int aim_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int aim_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint64_t size; if (io.length(size)) return 0; if (size == 2068480) - return 100; + return FIFID_SIZE; return 0; } -bool aim_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool aim_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { image->set_variant(floppy_image::DSQD); @@ -133,4 +133,4 @@ } -const floppy_format_type FLOPPY_AIM_FORMAT = &floppy_image_format_creator; +const aim_format FLOPPY_AIM_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/aim_dsk.h mame-0.243+dfsg.1/src/lib/formats/aim_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/aim_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/aim_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -21,8 +21,8 @@ public: aim_format(); - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; virtual const char *name() const override; virtual const char *description() const override; @@ -30,6 +30,6 @@ virtual bool supports_save() const override { return false; } }; -extern const floppy_format_type FLOPPY_AIM_FORMAT; +extern const aim_format FLOPPY_AIM_FORMAT; #endif // MAME_FORMATS_AIM_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/all.cpp mame-0.243+dfsg.1/src/lib/formats/all.cpp --- mame-0.242+dfsg.1/src/lib/formats/all.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/all.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -726,7 +726,8 @@ en.add(fs::PRODOS); #endif #ifdef HAS_FORMATS_AP2_DSK - en.add(FLOPPY_A216S_FORMAT); // ap2_dsk.h + en.add(FLOPPY_A216S_DOS_FORMAT); // ap2_dsk.h + en.add(FLOPPY_A216S_PRODOS_FORMAT); // ap2_dsk.h en.add(FLOPPY_RWTS18_FORMAT); // ap2_dsk.h en.add(FLOPPY_EDD_FORMAT); // ap2_dsk.h en.add(FLOPPY_WOZ_FORMAT); // ap2_dsk.h diff -Nru mame-0.242+dfsg.1/src/lib/formats/all.h mame-0.243+dfsg.1/src/lib/formats/all.h --- mame-0.242+dfsg.1/src/lib/formats/all.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/all.h 2022-04-29 05:37:26.000000000 +0000 @@ -17,7 +17,7 @@ virtual void category(const char *name) = 0; virtual void add(const cassette_image::Format *const *formats) = 0; - virtual void add(floppy_format_type format) = 0; + virtual void add(const floppy_image_format_t &format) = 0; virtual void add(const fs::manager_t &fs) = 0; }; diff -Nru mame-0.242+dfsg.1/src/lib/formats/ami_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/ami_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/ami_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/ami_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -37,19 +37,19 @@ return true; } -int adf_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int adf_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint64_t size; if (io.length(size)) return 0; if ((size == 901120) || (size == 912384) || (size == 1802240)) - return 50; + return FIFID_SIZE; return 0; } -bool adf_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool adf_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { desc_s sectors[22]; uint8_t sectdata[512*22]; @@ -121,7 +121,7 @@ return check & 0x55555555; } -bool adf_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) +bool adf_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const { uint8_t sectdata[512*22]; @@ -159,4 +159,4 @@ return true; } -const floppy_format_type FLOPPY_ADF_FORMAT = &floppy_image_format_creator; +const adf_format FLOPPY_ADF_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/ami_dsk.h mame-0.243+dfsg.1/src/lib/formats/ami_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/ami_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/ami_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -19,9 +19,9 @@ public: adf_format(); - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; - virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; + virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const override; virtual const char *name() const override; virtual const char *description() const override; @@ -33,6 +33,6 @@ static uint32_t checksum(const std::vector &bitsteam, uint32_t pos, int long_count); }; -extern const floppy_format_type FLOPPY_ADF_FORMAT; +extern const adf_format FLOPPY_ADF_FORMAT; #endif // MAME_FORMATS_AMI_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/ap2_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/ap2_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/ap2_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/ap2_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -537,49 +537,141 @@ }; -a2_16sect_format::a2_16sect_format() : floppy_image_format_t(), m_prodos_order(false) +a2_16sect_format::a2_16sect_format(bool prodos_order) : floppy_image_format_t(), m_prodos_order(prodos_order) { } -const char *a2_16sect_format::name() const +a2_16sect_dos_format::a2_16sect_dos_format() : a2_16sect_format(false) { - return "a2_16sect"; } -const char *a2_16sect_format::description() const +const char *a2_16sect_dos_format::name() const { - return "Apple II 16-sector dsk image"; + return "a2_16sect_dos"; } -const char *a2_16sect_format::extensions() const +const char *a2_16sect_dos_format::description() const { - return "dsk,do,po"; + return "Apple II 16-sector dsk image (DOS sector order)"; +} + +const char *a2_16sect_dos_format::extensions() const +{ + return "dsk,do"; +} + +a2_16sect_prodos_format::a2_16sect_prodos_format() : a2_16sect_format(true) +{ +} + +const char *a2_16sect_prodos_format::name() const +{ + return "a2_16sect_prodos"; +} + +const char *a2_16sect_prodos_format::description() const +{ + return "Apple II 16-sector dsk image (ProDos sector order)"; +} + +const char *a2_16sect_prodos_format::extensions() const +{ + return "dsk,po"; } bool a2_16sect_format::supports_save() const { - return true; + return true; } -int a2_16sect_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int a2_16sect_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { - uint64_t size; - if (io.length(size)) - return 0; + uint64_t size; + if (io.length(size)) + return 0; + + //uint32_t expected_size = 35 * 16 * 256; + uint32_t expected_size = APPLE2_TRACK_COUNT * 16 * 256; + + // check standard size plus some oddball sizes in our softlist + if ((size != expected_size) && (size != 35 * 16 * 256) && (size != 143403) && (size != 143363) && (size != 143358)) + { + return 0; + } + + uint8_t sector_data[256*2]; + static const unsigned char pascal_block1[4] = { 0x08, 0xa5, 0x0f, 0x29 }; + static const unsigned char pascal2_block1[4] = { 0xff, 0xa2, 0x00, 0x8e }; + static const unsigned char dos33_block1[4] = { 0xa2, 0x02, 0x8e, 0x52 }; + static const unsigned char sos_block1[4] = { 0xc9, 0x20, 0xf0, 0x3e }; + static const unsigned char a3a2emul_block1[6] = { 0x8d, 0xd0, 0x03, 0x4c, 0xc7, 0xa4 }; + static const unsigned char cpm22_block1[8] = { 0xa2, 0x55, 0xa9, 0x00, 0x9d, 0x00, 0x0d, 0xca }; + static const unsigned char subnod_block1[8] = { 0x63, 0xaa, 0xf0, 0x76, 0x8d, 0x63, 0xaa, 0x8e }; - //uint32_t expected_size = 35 * 16 * 256; - uint32_t expected_size = APPLE2_TRACK_COUNT * 16 * 256; + size_t actual; + io.read_at(0, sector_data, 256*2, actual); - // check standard size plus some oddball sizes in our softlist - if ((size == expected_size) || (size == 35 * 16 * 256) || (size == 143403) || (size == 143363) || (size == 143358)) + bool prodos_order = false; + // check ProDOS boot block + if (!memcmp("PRODOS", §or_data[0x103], 6)) + { + prodos_order = true; + } // check for alternate version ProDOS boot block + if (!memcmp("PRODOS", §or_data[0x121], 6)) + { + prodos_order = true; + } // check for ProDOS order SOS disk + else if (!memcmp(sos_block1, §or_data[0x100], 4)) + { + prodos_order = true; + } // check for Apple III A2 emulator disk in ProDOS order + else if (!memcmp(a3a2emul_block1, §or_data[0x100], 6)) + { + prodos_order = true; + } // check for PCPI Applicard software in ProDOS order + else if (!memcmp("COPYRIGHT (C) 1979, DIGITAL RESEARCH", §or_data[0x118], 36)) + { + prodos_order = true; + } // check Apple II Pascal + else if (!memcmp("SYSTEM.APPLE", §or_data[0xd7], 12)) + { + // Pascal discs can still be DOS order. + // Check for the second half of the boot code at 0x100 + // (which means ProDOS order) + if (!memcmp(pascal_block1, §or_data[0x100], 4)) { - return 50; + prodos_order = true; } + } // check for DOS 3.3 disks in ProDOS order + else if (!memcmp(dos33_block1, §or_data[0x100], 4)) + { + prodos_order = true; + } // check for a later version of the Pascal boot block + else if (!memcmp(pascal2_block1, §or_data[0x100], 4)) + { + prodos_order = true; + } // check for CP/M disks in ProDOS order + else if (!memcmp(cpm22_block1, §or_data[0x100], 8)) + { + prodos_order = true; + } // check for subnodule disk + else if (!memcmp(subnod_block1, §or_data[0x100], 8)) + { + prodos_order = true; + } // check for ProDOS 2.5's new boot block + else if (!memcmp("PRODOS", §or_data[0x3a], 6)) + { + prodos_order = true; + } + else if (!memcmp("PRODOS", §or_data[0x40], 6)) + { + prodos_order = true; + } - return 0; + return FIFID_SIZE | (m_prodos_order == prodos_order ? FIFID_HINT : 0); } -bool a2_16sect_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool a2_16sect_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { uint64_t size; if (io.length(size)) @@ -587,83 +679,16 @@ image->set_form_variant(floppy_image::FF_525, floppy_image::SSSD); - m_prodos_order = false; - m_tracks = (size == (40 * 16 * 256)) ? 40 : 35; + int tracks = (size == (40 * 16 * 256)) ? 40 : 35; int fpos = 0; - for(int track=0; track < m_tracks; track++) { + for(int track=0; track < tracks; track++) { std::vector track_data; uint8_t sector_data[256*16]; - static const unsigned char pascal_block1[4] = { 0x08, 0xa5, 0x0f, 0x29 }; - static const unsigned char pascal2_block1[4] = { 0xff, 0xa2, 0x00, 0x8e }; - static const unsigned char dos33_block1[4] = { 0xa2, 0x02, 0x8e, 0x52 }; - static const unsigned char sos_block1[4] = { 0xc9, 0x20, 0xf0, 0x3e }; - static const unsigned char a3a2emul_block1[6] = { 0x8d, 0xd0, 0x03, 0x4c, 0xc7, 0xa4 }; - static const unsigned char cpm22_block1[8] = { 0xa2, 0x55, 0xa9, 0x00, 0x9d, 0x00, 0x0d, 0xca }; - static const unsigned char subnod_block1[8] = { 0x63, 0xaa, 0xf0, 0x76, 0x8d, 0x63, 0xaa, 0x8e }; size_t actual; io.read_at(fpos, sector_data, 256*16, actual); - if (track == 0 && fpos == 0) - { - // check ProDOS boot block - if (!memcmp("PRODOS", §or_data[0x103], 6)) - { - m_prodos_order = true; - } // check for alternate version ProDOS boot block - if (!memcmp("PRODOS", §or_data[0x121], 6)) - { - m_prodos_order = true; - } // check for ProDOS order SOS disk - else if (!memcmp(sos_block1, §or_data[0x100], 4)) - { - m_prodos_order = true; - } // check for Apple III A2 emulator disk in ProDOS order - else if (!memcmp(a3a2emul_block1, §or_data[0x100], 6)) - { - m_prodos_order = true; - } // check for PCPI Applicard software in ProDOS order - else if (!memcmp("COPYRIGHT (C) 1979, DIGITAL RESEARCH", §or_data[0x118], 36)) - { - m_prodos_order = true; - } // check Apple II Pascal - else if (!memcmp("SYSTEM.APPLE", §or_data[0xd7], 12)) - { - // Pascal discs can still be DOS order. - // Check for the second half of the boot code at 0x100 - // (which means ProDOS order) - if (!memcmp(pascal_block1, §or_data[0x100], 4)) - { - m_prodos_order = true; - } - } // check for DOS 3.3 disks in ProDOS order - else if (!memcmp(dos33_block1, §or_data[0x100], 4)) - { - m_prodos_order = true; - } // check for a later version of the Pascal boot block - else if (!memcmp(pascal2_block1, §or_data[0x100], 4)) - { - m_prodos_order = true; - } // check for CP/M disks in ProDOS order - else if (!memcmp(cpm22_block1, §or_data[0x100], 8)) - { - m_prodos_order = true; - } // check for subnodule disk - else if (!memcmp(subnod_block1, §or_data[0x100], 8)) - { - m_prodos_order = true; - } // check for ProDOS 2.5's new boot block - else if (!memcmp("PRODOS", §or_data[0x3a], 6)) - { - m_prodos_order = true; - } - else if (!memcmp("PRODOS", §or_data[0x40], 6)) - { - m_prodos_order = true; - } - } - fpos += 256*16; for(int i=0; i<49; i++) raw_w(track_data, 10, 0x3fc); @@ -742,13 +767,9 @@ return v; } -void a2_16sect_format::update_chk(const uint8_t *data, int size, uint32_t &chk) -{ -} - //#define VERBOSE_SAVE -bool a2_16sect_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) +bool a2_16sect_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const { int g_tracks, g_heads; int visualgrid[16][APPLE2_TRACK_COUNT]; // visualizer grid, cleared/initialized below @@ -772,20 +793,17 @@ // data postamble is good #define DATAPOST 16 for (auto & elem : visualgrid) { - for (int j = 0; j < m_tracks; j++) { + for (int j = 0; j < APPLE2_TRACK_COUNT; j++) { elem[j] = 0; } } image->get_actual_geometry(g_tracks, g_heads); - if(!m_tracks) - m_tracks = g_tracks; - int head = 0; int pos_data = 0; - for(int track=0; track < m_tracks; track++) { + for(int track=0; track < g_tracks; track++) { uint8_t sectdata[(256)*16]; memset(sectdata, 0, sizeof(sectdata)); int nsect = 16; @@ -976,7 +994,8 @@ return true; } -const floppy_format_type FLOPPY_A216S_FORMAT = &floppy_image_format_creator; +const a2_16sect_dos_format FLOPPY_A216S_DOS_FORMAT; +const a2_16sect_prodos_format FLOPPY_A216S_PRODOS_FORMAT; /* RWTS18 format * Developed by Roland Gustafsson (http://www.acts.org/roland/index.html) for Br0derbund Software around 1986 @@ -1028,16 +1047,16 @@ return true; } -int a2_rwts18_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int a2_rwts18_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint64_t size; if(io.length(size)) return 0; uint32_t const expected_size = APPLE2_TRACK_COUNT * 16 * 256; - return size == expected_size; + return size == expected_size ? FIFID_SIZE : 0; } -bool a2_rwts18_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool a2_rwts18_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { /* TODO: rewrite me properly uint8_t sector_data[(256)*16]; @@ -1083,11 +1102,7 @@ return v; } -void a2_rwts18_format::update_chk(const uint8_t *data, int size, uint32_t &chk) -{ -} - -bool a2_rwts18_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) +bool a2_rwts18_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const { int g_tracks, g_heads; int visualgrid[18][APPLE2_TRACK_COUNT]; // visualizer grid, cleared/initialized below @@ -1488,7 +1503,7 @@ return true; } -const floppy_format_type FLOPPY_RWTS18_FORMAT = &floppy_image_format_creator; +const a2_rwts18_format FLOPPY_RWTS18_FORMAT; a2_edd_format::a2_edd_format() : floppy_image_format_t() { @@ -1514,12 +1529,12 @@ return false; } -int a2_edd_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int a2_edd_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint64_t size; if (io.length(size)) return 0; - return ((size == 2244608) || (size == 2310144)) ? 50 : 0; + return ((size == 2244608) || (size == 2310144)) ? FIFID_SIZE : 0; } uint8_t a2_edd_format::pick(const uint8_t *data, int pos) @@ -1527,7 +1542,7 @@ return ((data[pos>>3] << 8) | data[(pos>>3)+1]) >> (8-(pos & 7)); } -bool a2_edd_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool a2_edd_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { uint8_t nibble[16384], stream[16384]; int npos[16384]; @@ -1611,7 +1626,7 @@ return true; } -const floppy_format_type FLOPPY_EDD_FORMAT = &floppy_image_format_creator; +const a2_edd_format FLOPPY_EDD_FORMAT; a2_woz_format::a2_woz_format() : floppy_image_format_t() @@ -1641,17 +1656,17 @@ const uint8_t a2_woz_format::signature[8] = { 0x57, 0x4f, 0x5a, 0x31, 0xff, 0x0a, 0x0d, 0x0a }; const uint8_t a2_woz_format::signature2[8] = { 0x57, 0x4f, 0x5a, 0x32, 0xff, 0x0a, 0x0d, 0x0a }; -int a2_woz_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int a2_woz_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint8_t header[8]; size_t actual; io.read_at(0, header, 8, actual); - if (!memcmp(header, signature, 8)) return 100; - if (!memcmp(header, signature2, 8)) return 100; + if (!memcmp(header, signature, 8)) return FIFID_SIGN; + if (!memcmp(header, signature2, 8)) return FIFID_SIGN; return 0; } -bool a2_woz_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool a2_woz_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { uint64_t image_size; if(io.length(image_size)) @@ -1728,7 +1743,21 @@ if (r32(img, trks_off + 4) == 0) return false; - generate_track_from_bitstream(track, head, &img[boff], r32(img, trks_off + 4), image, subtrack, 0xffff); + uint32_t track_size = r32(img, trks_off + 4); + + // With 5.25 floppies the end-of-track may be missing + // if unformatted. Accept track length down to 95% of + // 51090, otherwise pad it + + bool short_track = !is_35 && track_size < 48535; + + if(short_track) { + std::vector buffer(6387, 0); + memcpy(buffer.data(), &img[boff], (track_size + 7) / 8); + generate_track_from_bitstream(track, head, buffer.data(), 51090, image, subtrack, 0xffff); + + } else + generate_track_from_bitstream(track, head, &img[boff], track_size, image, subtrack, 0xffff); if(is_35 && !track && head) image->set_variant(r32(img, trks_off + 4) >= 90000 ? floppy_image::DSHD : floppy_image::DSDD); @@ -1740,7 +1769,7 @@ return true; } -bool a2_woz_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) +bool a2_woz_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const { std::vector> tracks(160); bool twosided = false; @@ -1904,7 +1933,7 @@ } -const floppy_format_type FLOPPY_WOZ_FORMAT = &floppy_image_format_creator; +const a2_woz_format FLOPPY_WOZ_FORMAT; a2_nib_format::a2_nib_format() : floppy_image_format_t() @@ -1931,14 +1960,14 @@ return false; } -int a2_nib_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int a2_nib_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint64_t size; if (io.length(size)) return 0; if (size == expected_size_35t || size == expected_size_40t) - return 50; + return FIFID_SIZE; return 0; } @@ -2054,7 +2083,7 @@ return levels; } -bool a2_nib_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool a2_nib_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { uint64_t size; if (io.length(size)) @@ -2080,4 +2109,4 @@ } -const floppy_format_type FLOPPY_NIB_FORMAT = &floppy_image_format_creator; +const a2_nib_format FLOPPY_NIB_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/ap2_dsk.h mame-0.243+dfsg.1/src/lib/formats/ap2_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/ap2_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/ap2_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -40,38 +40,49 @@ class a2_16sect_format : public floppy_image_format_t { public: - a2_16sect_format(); + a2_16sect_format(bool prodos_order); - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; - virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; + virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const override; - virtual const char *name() const override; - virtual const char *description() const override; - virtual const char *extensions() const override; virtual bool supports_save() const override; private: - static const desc_e mac_gcr[]; + const bool m_prodos_order; - uint8_t gb(const std::vector &buf, int &pos, int &wrap); - void update_chk(const uint8_t *data, int size, uint32_t &chk); + static uint8_t gb(const std::vector &buf, int &pos, int &wrap); +}; - bool m_prodos_order; +class a2_16sect_dos_format : public a2_16sect_format +{ +public: + a2_16sect_dos_format(); + virtual const char *name() const override; + virtual const char *description() const override; + virtual const char *extensions() const override; +}; - int m_tracks = 0; +class a2_16sect_prodos_format : public a2_16sect_format +{ +public: + a2_16sect_prodos_format(); + virtual const char *name() const override; + virtual const char *description() const override; + virtual const char *extensions() const override; }; -extern const floppy_format_type FLOPPY_A216S_FORMAT; +extern const a2_16sect_dos_format FLOPPY_A216S_DOS_FORMAT; +extern const a2_16sect_prodos_format FLOPPY_A216S_PRODOS_FORMAT; class a2_rwts18_format : public floppy_image_format_t { public: a2_rwts18_format(); - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; - virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; + virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const override; virtual const char *name() const override; virtual const char *description() const override; @@ -81,11 +92,10 @@ private: static const desc_e mac_gcr[]; - uint8_t gb(const std::vector &buf, int &pos, int &wrap); - void update_chk(const uint8_t *data, int size, uint32_t &chk); + static uint8_t gb(const std::vector &buf, int &pos, int &wrap); }; -extern const floppy_format_type FLOPPY_RWTS18_FORMAT; +extern const a2_rwts18_format FLOPPY_RWTS18_FORMAT; class a2_edd_format : public floppy_image_format_t @@ -93,8 +103,8 @@ public: a2_edd_format(); - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; virtual bool supports_save() const override; virtual const char *name() const override; @@ -105,16 +115,16 @@ static uint8_t pick(const uint8_t *data, int pos); }; -extern const floppy_format_type FLOPPY_EDD_FORMAT; +extern const a2_edd_format FLOPPY_EDD_FORMAT; class a2_woz_format : public floppy_image_format_t { public: a2_woz_format(); - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; - virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; + virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const override; virtual bool supports_save() const override; virtual const char *name() const override; @@ -134,7 +144,7 @@ static uint32_t find_tag(const std::vector &data, uint32_t tag); }; -extern const floppy_format_type FLOPPY_WOZ_FORMAT; +extern const a2_woz_format FLOPPY_WOZ_FORMAT; class a2_nib_format : public floppy_image_format_t @@ -142,8 +152,8 @@ public: a2_nib_format(); - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; virtual bool supports_save() const override; virtual const char *name() const override; @@ -157,9 +167,9 @@ static constexpr auto expected_size_35t = 35 * nibbles_per_track; static constexpr auto expected_size_40t = 40 * nibbles_per_track; - std::vector generate_levels_from_nibbles(const std::vector& nibbles); + static std::vector generate_levels_from_nibbles(const std::vector& nibbles); }; -extern const floppy_format_type FLOPPY_NIB_FORMAT; +extern const a2_nib_format FLOPPY_NIB_FORMAT; #endif // MAME_FORMATS_AP2_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/apd_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/apd_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/apd_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/apd_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -93,10 +93,10 @@ return "apd"; } -int apd_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int apd_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint64_t size; - if (io.length(size)) + if (io.length(size) || !size) return 0; std::vector img(size); @@ -129,13 +129,13 @@ } if (!memcmp(&img[0], APD_HEADER, sizeof(APD_HEADER))) { - return 100; + return FIFID_SIGN; } return 0; } -bool apd_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool apd_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { uint64_t size; if (io.length(size)) @@ -210,4 +210,4 @@ return false; } -const floppy_format_type FLOPPY_APD_FORMAT = &floppy_image_format_creator; +const apd_format FLOPPY_APD_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/apd_dsk.h mame-0.243+dfsg.1/src/lib/formats/apd_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/apd_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/apd_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -23,11 +23,11 @@ virtual const char *description() const override; virtual const char *extensions() const override; - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; virtual bool supports_save() const override; }; -extern const floppy_format_type FLOPPY_APD_FORMAT; +extern const apd_format FLOPPY_APD_FORMAT; #endif // MAME_FORMATS_APD_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/ap_dsk35.cpp mame-0.243+dfsg.1/src/lib/formats/ap_dsk35.cpp --- mame-0.242+dfsg.1/src/lib/formats/ap_dsk35.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/ap_dsk35.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1238,7 +1238,7 @@ return true; } -int dc42_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int dc42_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint64_t size; if(io.length(size) || (size < 0x54)) @@ -1258,10 +1258,10 @@ return 0; } - return (size == 0x54+tsize+dsize && h[0] < 64 && h[0x52] == 1 && h[0x53] == 0) ? 100 : 0; + return (size == 0x54+tsize+dsize && h[0] < 64 && h[0x52] == 1 && h[0x53] == 0) ? FIFID_STRUCT|FIFID_STRUCT : 0; } -bool dc42_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool dc42_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { size_t actual; uint8_t h[0x54]; @@ -1348,7 +1348,7 @@ } } -bool dc42_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) +bool dc42_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const { int g_tracks, g_heads; image->get_actual_geometry(g_tracks, g_heads); @@ -1414,7 +1414,7 @@ return true; } -const floppy_format_type FLOPPY_DC42_FORMAT = &floppy_image_format_creator; +const dc42_format FLOPPY_DC42_FORMAT; apple_gcr_format::apple_gcr_format() : floppy_image_format_t() @@ -1441,19 +1441,19 @@ return true; } -int apple_gcr_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int apple_gcr_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint64_t size; if(io.length(size)) return 0; if(size == 409600 || (size == 819200 && (variants.empty() || has_variant(variants, floppy_image::DSDD)))) - return 50; + return FIFID_SIZE; return 0; } -bool apple_gcr_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool apple_gcr_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { size_t actual; desc_gcr_sector sectors[12]; @@ -1497,7 +1497,7 @@ return true; } -bool apple_gcr_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) +bool apple_gcr_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const { int g_tracks, g_heads; image->get_actual_geometry(g_tracks, g_heads); @@ -1523,7 +1523,7 @@ return true; } -const floppy_format_type FLOPPY_APPLE_GCR_FORMAT = &floppy_image_format_creator; +const apple_gcr_format FLOPPY_APPLE_GCR_FORMAT; // .2MG format apple_2mg_format::apple_2mg_format() : floppy_image_format_t() @@ -1550,26 +1550,26 @@ return true; } -int apple_2mg_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int apple_2mg_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint8_t signature[4]; size_t actual; io.read_at(0, signature, 4, actual); if (!strncmp(reinterpret_cast(signature), "2IMG", 4)) { - return 100; + return FIFID_SIGN; } // Bernie ][ The Rescue wrote 2MGs with the signature byte-flipped, other fields are valid if (!strncmp(reinterpret_cast(signature), "GMI2", 4)) { - return 100; + return FIFID_SIGN; } return 0; } -bool apple_2mg_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool apple_2mg_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { size_t actual; desc_gcr_sector sectors[12]; @@ -1607,7 +1607,7 @@ return true; } -bool apple_2mg_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) +bool apple_2mg_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const { size_t actual; @@ -1648,4 +1648,4 @@ return true; } -const floppy_format_type FLOPPY_APPLE_2MG_FORMAT = &floppy_image_format_creator; +const apple_2mg_format FLOPPY_APPLE_2MG_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/ap_dsk35.h mame-0.243+dfsg.1/src/lib/formats/ap_dsk35.h --- mame-0.242+dfsg.1/src/lib/formats/ap_dsk35.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/ap_dsk35.h 2022-04-29 05:37:26.000000000 +0000 @@ -30,9 +30,9 @@ public: dc42_format(); - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; - virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; + virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const override; virtual const char *name() const override; virtual const char *description() const override; @@ -40,19 +40,19 @@ virtual bool supports_save() const override; private: - void update_chk(const uint8_t *data, int size, uint32_t &chk); + static void update_chk(const uint8_t *data, int size, uint32_t &chk); }; -extern const floppy_format_type FLOPPY_DC42_FORMAT; +extern const dc42_format FLOPPY_DC42_FORMAT; class apple_gcr_format : public floppy_image_format_t { public: apple_gcr_format(); - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; - virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; + virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const override; virtual const char *name() const override; virtual const char *description() const override; @@ -60,16 +60,16 @@ virtual bool supports_save() const override; }; -extern const floppy_format_type FLOPPY_APPLE_GCR_FORMAT; +extern const apple_gcr_format FLOPPY_APPLE_GCR_FORMAT; class apple_2mg_format : public floppy_image_format_t { public: apple_2mg_format(); - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; - virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; + virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const override; virtual const char *name() const override; virtual const char *description() const override; @@ -77,6 +77,6 @@ virtual bool supports_save() const override; }; -extern const floppy_format_type FLOPPY_APPLE_2MG_FORMAT; +extern const apple_2mg_format FLOPPY_APPLE_2MG_FORMAT; #endif // MAME_FORMATS_AP_DSK35_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/apollo_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/apollo_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/apollo_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/apollo_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -45,15 +45,4 @@ {} }; -const floppy_format_type FLOPPY_APOLLO_FORMAT = &floppy_image_format_creator; - -int apollo_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) -{ - uint64_t size; - if (io.length(size)) - return 0; - - constexpr uint32_t expected_size = 77*2*8*1024; - - return ((size == expected_size) || (size == 0)) ? 1 : 0; -} +const apollo_format FLOPPY_APOLLO_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/apollo_dsk.h mame-0.243+dfsg.1/src/lib/formats/apollo_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/apollo_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/apollo_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -19,7 +19,6 @@ public: apollo_format(); - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; virtual const char *name() const override; virtual const char *description() const override; virtual const char *extensions() const override; @@ -28,6 +27,6 @@ static const format formats[]; }; -extern const floppy_format_type FLOPPY_APOLLO_FORMAT; +extern const apollo_format FLOPPY_APOLLO_FORMAT; #endif // MAME_FORMATS_APOLLO_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/applix_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/applix_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/applix_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/applix_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -38,4 +38,4 @@ {} }; -const floppy_format_type FLOPPY_APPLIX_FORMAT = &floppy_image_format_creator; +const applix_format FLOPPY_APPLIX_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/applix_dsk.h mame-0.243+dfsg.1/src/lib/formats/applix_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/applix_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/applix_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -27,6 +27,6 @@ static const format formats[]; }; -extern const floppy_format_type FLOPPY_APPLIX_FORMAT; +extern const applix_format FLOPPY_APPLIX_FORMAT; #endif // MAME_FORMATS_APPLIX_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/apridisk.cpp mame-0.243+dfsg.1/src/lib/formats/apridisk.cpp --- mame-0.242+dfsg.1/src/lib/formats/apridisk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/apridisk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -34,7 +34,7 @@ return "dsk"; } -int apridisk_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int apridisk_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint8_t header[APR_HEADER_SIZE]; size_t actual; @@ -48,7 +48,7 @@ return 0; } -bool apridisk_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool apridisk_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { desc_pc_sector sectors[80][2][18]; std::unique_ptr sector_data(new uint8_t [MAX_SECTORS * SECTOR_SIZE]); @@ -148,14 +148,9 @@ return true; } -bool apridisk_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) -{ - return false; -} - bool apridisk_format::supports_save() const { return false; } -const floppy_format_type FLOPPY_APRIDISK_FORMAT = &floppy_image_format_creator; +const apridisk_format FLOPPY_APRIDISK_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/apridisk.h mame-0.243+dfsg.1/src/lib/formats/apridisk.h --- mame-0.242+dfsg.1/src/lib/formats/apridisk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/apridisk.h 2022-04-29 05:37:26.000000000 +0000 @@ -23,9 +23,8 @@ virtual const char *description() const override; virtual const char *extensions() const override; - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; - virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; virtual bool supports_save() const override; private: @@ -51,6 +50,6 @@ static const int MAX_SECTORS = 2880; // enough for a hd disk image }; -extern const floppy_format_type FLOPPY_APRIDISK_FORMAT; +extern const apridisk_format FLOPPY_APRIDISK_FORMAT; #endif // MAME_FORMATS_APRIDISK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/asst128_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/asst128_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/asst128_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/asst128_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -38,4 +38,4 @@ {} }; -const floppy_format_type FLOPPY_ASST128_FORMAT = &floppy_image_format_creator; +const asst128_format FLOPPY_ASST128_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/asst128_dsk.h mame-0.243+dfsg.1/src/lib/formats/asst128_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/asst128_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/asst128_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -26,6 +26,6 @@ static const format formats[]; }; -extern const floppy_format_type FLOPPY_ASST128_FORMAT; +extern const asst128_format FLOPPY_ASST128_FORMAT; #endif // MAME_FORMATS_ASST128_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/atom_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/atom_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/atom_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/atom_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -30,4 +30,4 @@ {} }; -const floppy_format_type FLOPPY_ATOM_FORMAT = &floppy_image_format_creator; +const atom_format FLOPPY_ATOM_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/atom_dsk.h mame-0.243+dfsg.1/src/lib/formats/atom_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/atom_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/atom_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -21,6 +21,6 @@ static const format formats[]; }; -extern const floppy_format_type FLOPPY_ATOM_FORMAT; +extern const atom_format FLOPPY_ATOM_FORMAT; #endif // MAME_FORMATS_ATOM_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/bw12_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/bw12_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/bw12_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/bw12_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -55,4 +55,4 @@ {} }; -const floppy_format_type FLOPPY_BW12_FORMAT = &floppy_image_format_creator; +const bw12_format FLOPPY_BW12_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/bw12_dsk.h mame-0.243+dfsg.1/src/lib/formats/bw12_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/bw12_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/bw12_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -27,6 +27,6 @@ static const format formats[]; }; -extern const floppy_format_type FLOPPY_BW12_FORMAT; +extern const bw12_format FLOPPY_BW12_FORMAT; #endif // MAME_FORMATS_BW12_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/bw2_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/bw2_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/bw2_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/bw2_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -41,4 +41,4 @@ {} }; -const floppy_format_type FLOPPY_BW2_FORMAT = &floppy_image_format_creator; +const bw2_format FLOPPY_BW2_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/bw2_dsk.h mame-0.243+dfsg.1/src/lib/formats/bw2_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/bw2_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/bw2_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -27,6 +27,6 @@ static const format formats[]; }; -extern const floppy_format_type FLOPPY_BW2_FORMAT; +extern const bw2_format FLOPPY_BW2_FORMAT; #endif // MAME_FORMATS_BW2_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/c3040_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/c3040_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/c3040_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/c3040_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -54,7 +54,7 @@ 12, 12, 12, 12, 12 // 31-35 }; -floppy_image_format_t::desc_e* c3040_format::get_sector_desc(const format &f, int ¤t_size, int sector_count, uint8_t id1, uint8_t id2, int gap_2) +floppy_image_format_t::desc_e* c3040_format::get_sector_desc(const format &f, int ¤t_size, int sector_count, uint8_t id1, uint8_t id2, int gap_2) const { static floppy_image_format_t::desc_e desc[] = { /* 00 */ { SECTOR_LOOP_START, 0, -1 }, @@ -89,11 +89,11 @@ return desc; } -void c3040_format::fix_end_gap(floppy_image_format_t::desc_e* desc, int remaining_size) +void c3040_format::fix_end_gap(floppy_image_format_t::desc_e* desc, int remaining_size) const { desc[19].p2 = remaining_size / 10; desc[20].p2 = remaining_size % 10; desc[20].p1 >>= remaining_size & 0x01; } -const floppy_format_type FLOPPY_C3040_FORMAT = &floppy_image_format_creator; +const c3040_format FLOPPY_C3040_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/c3040_dsk.h mame-0.243+dfsg.1/src/lib/formats/c3040_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/c3040_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/c3040_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -23,10 +23,10 @@ virtual const char *extensions() const override; protected: - virtual int get_sectors_per_track(const format &f, int track) override { return c3040_sectors_per_track[track]; } - virtual floppy_image_format_t::desc_e* get_sector_desc(const format &f, int ¤t_size, int sector_count, uint8_t id1, uint8_t id2, int gap_2) override; - virtual int get_gap2(const format &f, int head, int track) override { return c3040_gap2[track]; } - virtual void fix_end_gap(floppy_image_format_t::desc_e* desc, int remaining_size) override; + virtual int get_sectors_per_track(const format &f, int track) const override { return c3040_sectors_per_track[track]; } + virtual floppy_image_format_t::desc_e* get_sector_desc(const format &f, int ¤t_size, int sector_count, uint8_t id1, uint8_t id2, int gap_2) const override; + virtual int get_gap2(const format &f, int head, int track) const override { return c3040_gap2[track]; } + virtual void fix_end_gap(floppy_image_format_t::desc_e* desc, int remaining_size) const override; static const format file_formats[]; @@ -34,6 +34,6 @@ static const int c3040_sectors_per_track[]; }; -extern const floppy_format_type FLOPPY_C3040_FORMAT; +extern const c3040_format FLOPPY_C3040_FORMAT; #endif // MAME_FORMATS_C3040_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/c4040_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/c4040_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/c4040_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/c4040_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -44,7 +44,7 @@ 12, 12, 12, 12, 12 // 31-35 }; -floppy_image_format_t::desc_e* c4040_format::get_sector_desc(const format &f, int ¤t_size, int sector_count, uint8_t id1, uint8_t id2, int gap_2) +floppy_image_format_t::desc_e* c4040_format::get_sector_desc(const format &f, int ¤t_size, int sector_count, uint8_t id1, uint8_t id2, int gap_2) const { static floppy_image_format_t::desc_e desc[] = { /* 00 */ { SECTOR_LOOP_START, 0, -1 }, @@ -79,11 +79,11 @@ return desc; } -void c4040_format::fix_end_gap(floppy_image_format_t::desc_e* desc, int remaining_size) +void c4040_format::fix_end_gap(floppy_image_format_t::desc_e* desc, int remaining_size) const { desc[19].p2 = remaining_size / 10; desc[20].p2 = remaining_size % 10; desc[20].p1 >>= remaining_size & 0x01; } -const floppy_format_type FLOPPY_C4040_FORMAT = &floppy_image_format_creator; +const c4040_format FLOPPY_C4040_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/c4040_dsk.h mame-0.243+dfsg.1/src/lib/formats/c4040_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/c4040_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/c4040_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -23,15 +23,15 @@ virtual const char *extensions() const override; protected: - virtual floppy_image_format_t::desc_e* get_sector_desc(const format &f, int ¤t_size, int sector_count, uint8_t id1, uint8_t id2, int gap_2) override; - virtual int get_gap2(const format &f, int head, int track) override { return c4040_gap2[track]; } - virtual void fix_end_gap(floppy_image_format_t::desc_e* desc, int remaining_size) override; + virtual floppy_image_format_t::desc_e* get_sector_desc(const format &f, int ¤t_size, int sector_count, uint8_t id1, uint8_t id2, int gap_2) const override; + virtual int get_gap2(const format &f, int head, int track) const override { return c4040_gap2[track]; } + virtual void fix_end_gap(floppy_image_format_t::desc_e* desc, int remaining_size) const override; static const format file_formats[]; static const int c4040_gap2[]; }; -extern const floppy_format_type FLOPPY_C4040_FORMAT; +extern const c4040_format FLOPPY_C4040_FORMAT; #endif // MAME_FORMATS_C4040_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/c8280_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/c8280_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/c8280_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/c8280_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -66,4 +66,4 @@ {} }; -const floppy_format_type FLOPPY_C8280_FORMAT = &floppy_image_format_creator; +const c8280_format FLOPPY_C8280_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/c8280_dsk.h mame-0.243+dfsg.1/src/lib/formats/c8280_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/c8280_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/c8280_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -27,6 +27,6 @@ static const format formats[]; }; -extern const floppy_format_type FLOPPY_C8280_FORMAT; +extern const c8280_format FLOPPY_C8280_FORMAT; #endif // MAME_FORMATS_C8280_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/camplynx_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/camplynx_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/camplynx_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/camplynx_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -52,4 +52,4 @@ {} }; -const floppy_format_type FLOPPY_CAMPLYNX_FORMAT = &floppy_image_format_creator; +const camplynx_format FLOPPY_CAMPLYNX_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/camplynx_dsk.h mame-0.243+dfsg.1/src/lib/formats/camplynx_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/camplynx_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/camplynx_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -27,6 +27,6 @@ static const format formats[]; }; -extern const floppy_format_type FLOPPY_CAMPLYNX_FORMAT; +extern const camplynx_format FLOPPY_CAMPLYNX_FORMAT; #endif // MAME_FORMATS_CAMPLYNX_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/cassimg.cpp mame-0.243+dfsg.1/src/lib/formats/cassimg.cpp --- mame-0.242+dfsg.1/src/lib/formats/cassimg.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/cassimg.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -11,7 +11,7 @@ #include "cassimg.h" #include "imageutl.h" -#include "corealloc.h" // make_unique_clear +#include "corealloc.h" // util::make_unique_clear #include #include @@ -191,7 +191,7 @@ m_blocks.resize(sample_blocknum + 1); if (!m_blocks[sample_blocknum]) - m_blocks[sample_blocknum] = make_unique_clear(SAMPLES_PER_BLOCK); + m_blocks[sample_blocknum] = util::make_unique_clear(SAMPLES_PER_BLOCK); ptr = &m_blocks[sample_blocknum][sample_index]; return error::SUCCESS; diff -Nru mame-0.242+dfsg.1/src/lib/formats/ccvf_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/ccvf_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/ccvf_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/ccvf_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -47,13 +47,13 @@ {} }; -int ccvf_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int ccvf_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { char h[36]; size_t actual; io.read_at(0, h, 36, actual); if (!memcmp(h, "Compucolor Virtual Floppy Disk Image", 36)) - return 100; + return FIFID_SIGN; return 0; } @@ -88,7 +88,7 @@ return desc; } -bool ccvf_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool ccvf_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { const format &f = formats[0]; @@ -156,4 +156,4 @@ return false; } -const floppy_format_type FLOPPY_CCVF_FORMAT = &floppy_image_format_creator; +const ccvf_format FLOPPY_CCVF_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/ccvf_dsk.h mame-0.243+dfsg.1/src/lib/formats/ccvf_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/ccvf_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/ccvf_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -39,18 +39,18 @@ virtual const char *description() const override; virtual const char *extensions() const override; - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; virtual bool supports_save() const override; protected: const format *formats; - floppy_image_format_t::desc_e* get_desc_8n1(const format &f, int ¤t_size); + static floppy_image_format_t::desc_e* get_desc_8n1(const format &f, int ¤t_size); static const format file_formats[]; }; -extern const floppy_format_type FLOPPY_CCVF_FORMAT; +extern const ccvf_format FLOPPY_CCVF_FORMAT; #endif // MAME_FORMATS_CCVF_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/cd90_640_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/cd90_640_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/cd90_640_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/cd90_640_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -53,4 +53,4 @@ {} }; -const floppy_format_type FLOPPY_CD90_640_FORMAT = &floppy_image_format_creator; +const cd90_640_format FLOPPY_CD90_640_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/cd90_640_dsk.h mame-0.243+dfsg.1/src/lib/formats/cd90_640_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/cd90_640_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/cd90_640_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -27,6 +27,6 @@ static const format formats[]; }; -extern const floppy_format_type FLOPPY_CD90_640_FORMAT; +extern const cd90_640_format FLOPPY_CD90_640_FORMAT; #endif // MAME_FORMATS_CD90_640_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/cgenie_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/cgenie_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/cgenie_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/cgenie_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -29,12 +29,12 @@ return "dsk"; } -int cgenie_format::get_track_dam_fm(const format &f, int head, int track) +int cgenie_format::get_track_dam_fm(const format &f, int head, int track) const { return (track == f.track_count/2) ? FM_DDAM : FM_DAM; } -int cgenie_format::get_track_dam_mfm(const format &f, int head, int track) +int cgenie_format::get_track_dam_mfm(const format &f, int head, int track) const { return (track == f.track_count/2) ? MFM_DDAM : MFM_DAM; } @@ -76,4 +76,4 @@ {} }; -const floppy_format_type FLOPPY_CGENIE_FORMAT = &floppy_image_format_creator; +const cgenie_format FLOPPY_CGENIE_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/cgenie_dsk.h mame-0.243+dfsg.1/src/lib/formats/cgenie_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/cgenie_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/cgenie_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -24,13 +24,13 @@ virtual const char *extensions() const override; protected: - virtual int get_track_dam_fm(const format &f, int head, int track) override; - virtual int get_track_dam_mfm(const format &f, int head, int track) override; + virtual int get_track_dam_fm(const format &f, int head, int track) const override; + virtual int get_track_dam_mfm(const format &f, int head, int track) const override; private: static const format formats[]; }; -extern const floppy_format_type FLOPPY_CGENIE_FORMAT; +extern const cgenie_format FLOPPY_CGENIE_FORMAT; #endif // MAME_FORMATS_CGENIE_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/coco_rawdsk.cpp mame-0.243+dfsg.1/src/lib/formats/coco_rawdsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/coco_rawdsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/coco_rawdsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -42,4 +42,4 @@ }; -const floppy_format_type FLOPPY_COCO_RAWDSK_FORMAT = &floppy_image_format_creator; +const coco_rawdsk_format FLOPPY_COCO_RAWDSK_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/coco_rawdsk.h mame-0.243+dfsg.1/src/lib/formats/coco_rawdsk.h --- mame-0.242+dfsg.1/src/lib/formats/coco_rawdsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/coco_rawdsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -28,6 +28,6 @@ }; -extern const floppy_format_type FLOPPY_COCO_RAWDSK_FORMAT; +extern const coco_rawdsk_format FLOPPY_COCO_RAWDSK_FORMAT; #endif // MAME_FORMATS_COCO_RAWDSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/comx35_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/comx35_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/comx35_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/comx35_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -74,4 +74,4 @@ {} }; -const floppy_format_type FLOPPY_COMX35_FORMAT = &floppy_image_format_creator; +const comx35_format FLOPPY_COMX35_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/comx35_dsk.h mame-0.243+dfsg.1/src/lib/formats/comx35_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/comx35_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/comx35_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -27,6 +27,6 @@ static const format formats[]; }; -extern const floppy_format_type FLOPPY_COMX35_FORMAT; +extern const comx35_format FLOPPY_COMX35_FORMAT; #endif // MAME_FORMATS_COMX35_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/concept_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/concept_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/concept_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/concept_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -87,18 +87,18 @@ track_count = head_count = sector_count = 0; } -int cc525dsdd_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int cc525dsdd_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint8_t track_count, head_count, sector_count; find_size(io, track_count, head_count, sector_count); if (track_count) - return 50; + return FIFID_SIZE; return 0; } -bool cc525dsdd_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool cc525dsdd_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { uint8_t track_count, head_count, sector_count; find_size(io, track_count, head_count, sector_count); @@ -125,7 +125,7 @@ return true; } -bool cc525dsdd_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) +bool cc525dsdd_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const { int track_count, head_count, sector_count; get_geometry_mfm_pc(image, 2000, track_count, head_count, sector_count); @@ -154,4 +154,4 @@ return true; } -const floppy_format_type FLOPPY_CONCEPT_525DSDD_FORMAT = &floppy_image_format_creator; +const cc525dsdd_format FLOPPY_CONCEPT_525DSDD_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/concept_dsk.h mame-0.243+dfsg.1/src/lib/formats/concept_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/concept_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/concept_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -17,9 +17,9 @@ public: cc525dsdd_format(); - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; - virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; + virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const override; virtual const char *name() const override; virtual const char *description() const override; @@ -29,9 +29,9 @@ static const desc_e cc_9_desc[]; private: - void find_size(util::random_read &io, uint8_t &track_count, uint8_t &head_count, uint8_t §or_count); + static void find_size(util::random_read &io, uint8_t &track_count, uint8_t &head_count, uint8_t §or_count); }; -extern const floppy_format_type FLOPPY_CONCEPT_525DSDD_FORMAT; +extern const cc525dsdd_format FLOPPY_CONCEPT_525DSDD_FORMAT; #endif // MAME_FORMATS_CONCEPT_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/coupedsk.cpp mame-0.243+dfsg.1/src/lib/formats/coupedsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/coupedsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/coupedsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -64,19 +64,19 @@ return true; } -int mgt_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int mgt_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint64_t size; if(io.length(size)) return 0; if(/*size == 737280 || */ size == 819200) - return 50; + return FIFID_SIZE; return 0; } -bool mgt_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool mgt_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { uint64_t size; if(io.length(size)) @@ -104,7 +104,7 @@ return true; } -bool mgt_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) +bool mgt_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const { int track_count, head_count, sector_count; get_geometry_mfm_pc(image, 2000, track_count, head_count, sector_count); @@ -128,4 +128,4 @@ return true; } -const floppy_format_type FLOPPY_MGT_FORMAT = &floppy_image_format_creator; +const mgt_format FLOPPY_MGT_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/coupedsk.h mame-0.243+dfsg.1/src/lib/formats/coupedsk.h --- mame-0.242+dfsg.1/src/lib/formats/coupedsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/coupedsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -19,9 +19,9 @@ public: mgt_format(); - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; - virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; + virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const override; virtual const char *name() const override; virtual const char *description() const override; @@ -31,6 +31,6 @@ static const floppy_image_format_t::desc_e desc_10[]; }; -extern const floppy_format_type FLOPPY_MGT_FORMAT; +extern const mgt_format FLOPPY_MGT_FORMAT; #endif // MAME_FORMATS_COUPEDSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/cpis_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/cpis_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/cpis_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/cpis_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -54,4 +54,4 @@ {} }; -const floppy_format_type FLOPPY_CPIS_FORMAT = &floppy_image_format_creator; +const cpis_format FLOPPY_CPIS_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/cpis_dsk.h mame-0.243+dfsg.1/src/lib/formats/cpis_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/cpis_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/cpis_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -26,6 +26,6 @@ static const format formats[]; }; -extern const floppy_format_type FLOPPY_CPIS_FORMAT; +extern const cpis_format FLOPPY_CPIS_FORMAT; #endif // MAME_FORMATS_CPIS_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/cqm_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/cqm_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/cqm_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/cqm_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -254,19 +254,19 @@ return "cqm,cqi,dsk"; } -int cqm_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int cqm_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint8_t h[3]; size_t actual; io.read_at(0, h, 3, actual); if (h[0] == 'C' && h[1] == 'Q' && h[2] == 0x14) - return 100; + return FIFID_SIGN; return 0; } -bool cqm_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool cqm_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { size_t actual; const int max_size = 4*1024*1024; // 4MB ought to be large enough for any floppy @@ -366,7 +366,7 @@ return true; } -bool cqm_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) +bool cqm_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const { return false; } @@ -376,4 +376,4 @@ return false; } -const floppy_format_type FLOPPY_CQM_FORMAT = &floppy_image_format_creator; +const cqm_format FLOPPY_CQM_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/cqm_dsk.h mame-0.243+dfsg.1/src/lib/formats/cqm_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/cqm_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/cqm_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -19,9 +19,9 @@ public: cqm_format(); - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; - virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; + virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const override; virtual const char *name() const override; virtual const char *description() const override; @@ -29,6 +29,6 @@ virtual bool supports_save() const override; }; -extern const floppy_format_type FLOPPY_CQM_FORMAT; +extern const cqm_format FLOPPY_CQM_FORMAT; #endif // MAME_FORMATS_CQM_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/d64_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/d64_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/d64_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/d64_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -102,29 +102,29 @@ return -1; } -int d64_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int d64_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { const int type = find_size(io, form_factor); if (type != -1) - return 50; + return FIFID_SIZE; return 0; } -int d64_format::get_physical_track(const format &f, int head, int track) +int d64_format::get_physical_track(const format &f, int head, int track) const { // skip halftracks return track * 2; } -int d64_format::get_disk_id_offset(const format &f) +int d64_format::get_disk_id_offset(const format &f) const { // t18s0 +0xa2 return 0x165a2; } -void d64_format::get_disk_id(const format &f, util::random_read &io, uint8_t &id1, uint8_t &id2) +void d64_format::get_disk_id(const format &f, util::random_read &io, uint8_t &id1, uint8_t &id2) const { uint8_t id[2]; size_t actual; @@ -133,7 +133,7 @@ id2 = id[1]; } -int d64_format::get_image_offset(const format &f, int _head, int _track) +int d64_format::get_image_offset(const format &f, int _head, int _track) const { int offset = 0; if (_head) { @@ -147,22 +147,22 @@ return offset; } -int d64_format::compute_track_size(const format &f, int track) +int d64_format::compute_track_size(const format &f, int track) const { return this->get_sectors_per_track(f, track) * f.sector_base_size; } -uint32_t d64_format::get_cell_size(const format &f, int track) +uint32_t d64_format::get_cell_size(const format &f, int track) const { return cell_size[speed_zone[track]]; } -int d64_format::get_sectors_per_track(const format &f, int track) +int d64_format::get_sectors_per_track(const format &f, int track) const { return sectors_per_track[track]; } -floppy_image_format_t::desc_e* d64_format::get_sector_desc(const format &f, int ¤t_size, int sector_count, uint8_t id1, uint8_t id2, int gap_2) +floppy_image_format_t::desc_e* d64_format::get_sector_desc(const format &f, int ¤t_size, int sector_count, uint8_t id1, uint8_t id2, int gap_2) const { static floppy_image_format_t::desc_e desc[] = { /* 00 */ { SECTOR_LOOP_START, 0, -1 }, @@ -210,14 +210,14 @@ } } -void d64_format::fix_end_gap(floppy_image_format_t::desc_e* desc, int remaining_size) +void d64_format::fix_end_gap(floppy_image_format_t::desc_e* desc, int remaining_size) const { desc[21].p2 = remaining_size / 8; desc[22].p2 = remaining_size & 7; desc[22].p1 >>= remaining_size & 0x01; } -bool d64_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool d64_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { int type = find_size(io, form_factor); if(type == -1) @@ -280,7 +280,7 @@ return true; } -bool d64_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) +bool d64_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const { const format &f = formats[0]; @@ -302,7 +302,7 @@ return true; } -void d64_format::extract_sectors(floppy_image *image, const format &f, desc_s *sdesc, int track, int head, int sector_count) +void d64_format::extract_sectors(floppy_image *image, const format &f, desc_s *sdesc, int track, int head, int sector_count) const { int physical_track = this->get_physical_track(f, head, track); int cell_size = this->get_cell_size(f, track); @@ -318,11 +318,11 @@ else if(sectors[ds.sector_id].size() < ds.size) { memcpy((void *)ds.data, sectors[ds.sector_id].data(), sectors[ds.sector_id].size()); - memset((uint8_t *)ds.data + sectors[ds.sector_id].size(), 0, sectors[ds.sector_id].size() - ds.size); + memset((uint8_t *)ds.data + sectors[ds.sector_id].size(), 0, ds.size - sectors[ds.sector_id].size()); } else memcpy((void *)ds.data, sectors[ds.sector_id].data(), ds.size); } } -const floppy_format_type FLOPPY_D64_FORMAT = &floppy_image_format_creator; +const d64_format FLOPPY_D64_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/d64_dsk.h mame-0.243+dfsg.1/src/lib/formats/d64_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/d64_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/d64_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -37,9 +37,9 @@ virtual const char *description() const override; virtual const char *extensions() const override; - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; - virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; + virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const override; virtual bool supports_save() const override { return true; } protected: @@ -62,18 +62,18 @@ const format *formats; int find_size(util::random_read &io, uint32_t form_factor) const; - virtual int get_physical_track(const format &f, int head, int track); - virtual uint32_t get_cell_size(const format &f, int track); - virtual int get_sectors_per_track(const format &f, int track); - virtual int get_disk_id_offset(const format &f); - void get_disk_id(const format &f, util::random_read &io, uint8_t &id1, uint8_t &id2); - virtual int get_image_offset(const format &f, int head, int track); - int compute_track_size(const format &f, int track); - virtual int get_gap2(const format &f, int head, int track) { return f.gap_2; } - virtual floppy_image_format_t::desc_e* get_sector_desc(const format &f, int ¤t_size, int sector_count, uint8_t id1, uint8_t id2, int gap_2); + virtual int get_physical_track(const format &f, int head, int track) const; + virtual uint32_t get_cell_size(const format &f, int track) const; + virtual int get_sectors_per_track(const format &f, int track) const; + virtual int get_disk_id_offset(const format &f) const; + void get_disk_id(const format &f, util::random_read &io, uint8_t &id1, uint8_t &id2) const; + virtual int get_image_offset(const format &f, int head, int track) const; + int compute_track_size(const format &f, int track) const; + virtual int get_gap2(const format &f, int head, int track) const { return f.gap_2; } + virtual floppy_image_format_t::desc_e* get_sector_desc(const format &f, int ¤t_size, int sector_count, uint8_t id1, uint8_t id2, int gap_2) const; void build_sector_description(const format &f, uint8_t *sectdata, uint32_t sect_offs, uint32_t error_offs, desc_s *sectors, int sector_count) const; - virtual void fix_end_gap(floppy_image_format_t::desc_e* desc, int remaining_size); - void extract_sectors(floppy_image *image, const format &f, desc_s *sdesc, int track, int head, int sector_count); + virtual void fix_end_gap(floppy_image_format_t::desc_e* desc, int remaining_size) const; + void extract_sectors(floppy_image *image, const format &f, desc_s *sdesc, int track, int head, int sector_count) const; static const format file_formats[]; @@ -82,6 +82,6 @@ static const int speed_zone[]; }; -extern const floppy_format_type FLOPPY_D64_FORMAT; +extern const d64_format FLOPPY_D64_FORMAT; #endif // MAME_FORMATS_D64_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/d71_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/d71_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/d71_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/d71_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -36,4 +36,4 @@ {} }; -const floppy_format_type FLOPPY_D71_FORMAT = &floppy_image_format_creator; +const d71_format FLOPPY_D71_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/d71_dsk.h mame-0.243+dfsg.1/src/lib/formats/d71_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/d71_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/d71_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -27,6 +27,6 @@ static const format formats[]; }; -extern const floppy_format_type FLOPPY_D71_FORMAT; +extern const d71_format FLOPPY_D71_FORMAT; #endif // MAME_FORMATS_D71_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/d80_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/d80_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/d80_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/d80_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -71,28 +71,28 @@ 0, 0, 0, 0, 0, 0, 0 // 78-84 }; -int d80_format::get_physical_track(const format &f, int head, int track) +int d80_format::get_physical_track(const format &f, int head, int track) const { return track; } -uint32_t d80_format::get_cell_size(const format &f, int track) +uint32_t d80_format::get_cell_size(const format &f, int track) const { return d80_cell_size[d80_speed_zone[track]]; } -int d80_format::get_sectors_per_track(const format &f, int track) +int d80_format::get_sectors_per_track(const format &f, int track) const { return d80_sectors_per_track[track]; } -int d80_format::get_disk_id_offset(const format &f) +int d80_format::get_disk_id_offset(const format &f) const { // t39s0 +0x18 return 0x44e18; } -floppy_image_format_t::desc_e* d80_format::get_sector_desc(const format &f, int ¤t_size, int sector_count, uint8_t id1, uint8_t id2, int gap_2) +floppy_image_format_t::desc_e* d80_format::get_sector_desc(const format &f, int ¤t_size, int sector_count, uint8_t id1, uint8_t id2, int gap_2) const { static floppy_image_format_t::desc_e desc[] = { /* 00 */ { SECTOR_LOOP_START, 0, -1 }, @@ -125,11 +125,11 @@ return desc; } -void d80_format::fix_end_gap(floppy_image_format_t::desc_e* desc, int remaining_size) +void d80_format::fix_end_gap(floppy_image_format_t::desc_e* desc, int remaining_size) const { desc[19].p2 = remaining_size / 8; desc[20].p2 = remaining_size & 7; desc[20].p1 >>= remaining_size & 0x01; } -const floppy_format_type FLOPPY_D80_FORMAT = &floppy_image_format_creator; +const d80_format FLOPPY_D80_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/d80_dsk.h mame-0.243+dfsg.1/src/lib/formats/d80_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/d80_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/d80_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -27,12 +27,12 @@ protected: const format *formats; - virtual int get_physical_track(const format &f, int head, int track) override; - virtual uint32_t get_cell_size(const format &f, int track) override; - virtual int get_sectors_per_track(const format &f, int track) override; - virtual int get_disk_id_offset(const format &f) override; - virtual floppy_image_format_t::desc_e* get_sector_desc(const format &f, int ¤t_size, int sector_count, uint8_t id1, uint8_t id2, int gap_2) override; - virtual void fix_end_gap(floppy_image_format_t::desc_e* desc, int remaining_size) override; + virtual int get_physical_track(const format &f, int head, int track) const override; + virtual uint32_t get_cell_size(const format &f, int track) const override; + virtual int get_sectors_per_track(const format &f, int track) const override; + virtual int get_disk_id_offset(const format &f) const override; + virtual floppy_image_format_t::desc_e* get_sector_desc(const format &f, int ¤t_size, int sector_count, uint8_t id1, uint8_t id2, int gap_2) const override; + virtual void fix_end_gap(floppy_image_format_t::desc_e* desc, int remaining_size) const override; static const format file_formats[]; @@ -41,6 +41,6 @@ static const int d80_sectors_per_track[]; }; -extern const floppy_format_type FLOPPY_D80_FORMAT; +extern const d80_format FLOPPY_D80_FORMAT; #endif // MAME_FORMATS_D80_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/d81_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/d81_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/d81_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/d81_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -115,7 +115,7 @@ {} }; -floppy_image_format_t::desc_e* d81_format::get_desc_mfm(const format &f, int ¤t_size, int &end_gap_index) +floppy_image_format_t::desc_e* d81_format::get_desc_mfm(const format &f, int ¤t_size, int &end_gap_index) const { static floppy_image_format_t::desc_e desc[25] = { /* 00 */ { MFM, 0x4e, f.gap_1 }, @@ -159,4 +159,4 @@ return desc; } -const floppy_format_type FLOPPY_D81_FORMAT = &floppy_image_format_creator; +const d81_format FLOPPY_D81_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/d81_dsk.h mame-0.243+dfsg.1/src/lib/formats/d81_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/d81_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/d81_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -23,12 +23,12 @@ virtual const char *description() const override; virtual const char *extensions() const override; - virtual floppy_image_format_t::desc_e* get_desc_mfm(const format &f, int ¤t_size, int &end_gap_index) override; + virtual floppy_image_format_t::desc_e* get_desc_mfm(const format &f, int ¤t_size, int &end_gap_index) const override; private: static const format formats[]; }; -extern const floppy_format_type FLOPPY_D81_FORMAT; +extern const d81_format FLOPPY_D81_FORMAT; #endif // MAME_FORMATS_D81_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/d82_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/d82_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/d82_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/d82_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -36,4 +36,4 @@ {} }; -const floppy_format_type FLOPPY_D82_FORMAT = &floppy_image_format_creator; +const d82_format FLOPPY_D82_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/d82_dsk.h mame-0.243+dfsg.1/src/lib/formats/d82_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/d82_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/d82_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -27,6 +27,6 @@ static const format file_formats[]; }; -extern const floppy_format_type FLOPPY_D82_FORMAT; +extern const d82_format FLOPPY_D82_FORMAT; #endif // MAME_FORMATS_D82_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/d88_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/d88_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/d88_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/d88_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -415,7 +415,7 @@ return "d77,d88,1dd"; } -int d88_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int d88_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint64_t size; if(io.length(size)) @@ -426,12 +426,12 @@ io.read_at(0, h, 32, actual); if((little_endianize_int32(*(uint32_t *)(h+0x1c)) == size) && (h[0x1b] == 0x00 || h[0x1b] == 0x10 || h[0x1b] == 0x20 || h[0x1b] == 0x30 || h[0x1b] == 0x40)) - return 100; + return FIFID_SIZE|FIFID_STRUCT; return 0; } -bool d88_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool d88_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { size_t actual; @@ -542,15 +542,9 @@ return true; } - -bool d88_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) -{ - return false; -} - bool d88_format::supports_save() const { return false; } -const floppy_format_type FLOPPY_D88_FORMAT = &floppy_image_format_creator; +const d88_format FLOPPY_D88_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/d88_dsk.h mame-0.243+dfsg.1/src/lib/formats/d88_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/d88_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/d88_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -20,9 +20,8 @@ public: d88_format(); - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; - virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; virtual const char *name() const override; virtual const char *description() const override; @@ -30,6 +29,6 @@ virtual bool supports_save() const override; }; -extern const floppy_format_type FLOPPY_D88_FORMAT; +extern const d88_format FLOPPY_D88_FORMAT; #endif // MAME_FORMATS_D88_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/dcp_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/dcp_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/dcp_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/dcp_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -44,7 +44,7 @@ return "dcp,dcu"; } -int dcp_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int dcp_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint64_t size; if (io.length(size)) @@ -108,16 +108,16 @@ // in theory track map should be enough (former check), but some images have it wrong! // hence, if this check fails, we also allow for images with all tracks and wrong track map if (size - 0xa2 == (heads * count_tracks * spt * bps) || size - 0xa2 == (heads * tracks * spt * bps)) - return 100; + return FIFID_STRUCT|FIFID_SIZE; // for disk type 0x11 the head 0 track 0 has 26 sectors of half width, so we need to compensate calculation if (is_hdb && (size - 0xa2 + (0x80 * 26) == (heads * count_tracks * spt * bps) || size - 0xa2 + (0x80 * 26) == (heads * tracks * spt * bps))) - return 100; + return FIFID_STRUCT|FIFID_SIZE; return 0; } -bool dcp_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool dcp_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { size_t actual; uint8_t h[0xa2]; @@ -305,4 +305,4 @@ return false; } -const floppy_format_type FLOPPY_DCP_FORMAT = &floppy_image_format_creator; +const dcp_format FLOPPY_DCP_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/dcp_dsk.h mame-0.243+dfsg.1/src/lib/formats/dcp_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/dcp_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/dcp_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -20,8 +20,8 @@ public: dcp_format(); - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; virtual const char *name() const override; virtual const char *description() const override; @@ -29,6 +29,6 @@ virtual bool supports_save() const override; }; -extern const floppy_format_type FLOPPY_DCP_FORMAT; +extern const dcp_format FLOPPY_DCP_FORMAT; #endif // MAME_FORMATS_DCP_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/dfi_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/dfi_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/dfi_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/dfi_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -59,15 +59,15 @@ return false; } -int dfi_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int dfi_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { char sign[4]; size_t actual; io.read_at(0, sign, 4, actual); - return memcmp(sign, "DFE2", 4) ? 0 : 100; + return memcmp(sign, "DFE2", 4) ? 0 : FIFID_SIGN; } -bool dfi_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool dfi_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { size_t actual; char sign[4]; @@ -177,9 +177,7 @@ #endif index_count = 0; //index_polarity = 0; - uint32_t mg = floppy_image::MG_A; int tpos = 0; - buf[tpos++] = mg; for(int i=0; i MIN_THRESH) && (trans_time <= MAX_THRESH))) { - mg = mg == floppy_image::MG_A ? floppy_image::MG_B : floppy_image::MG_A; - buf[tpos++] = mg | uint32_t((200000000ULL*cur_time)/index_time); + buf[tpos++] = floppy_image::MG_F | uint32_t((200000000ULL*cur_time)/index_time); prev_time = cur_time; } // the long case: we probably missed a transition, stuff an extra guessed one in there to see if it helps if (trans_time > MAX_THRESH) { - mg = mg == floppy_image::MG_A ? floppy_image::MG_B : floppy_image::MG_A; if (((track%2)==0)&&(head==0)) osd_printf_info("dfi_dsk: missed transition, total time for transition is %d\n",trans_time); #ifndef FAKETRANS_ONE - buf[tpos++] = mg | uint32_t((200000000ULL*(cur_time-(trans_time/2)))/index_time); // generate imaginary transition at half period + buf[tpos++] = floppy_image::MG_F | uint32_t((200000000ULL*(cur_time-(trans_time/2)))/index_time); // generate imaginary transition at half period #else - buf[tpos++] = mg | uint32_t((200000000ULL*(cur_time-((trans_time*2)/3)))/index_time); - mg = mg == floppy_image::MG_A ? floppy_image::MG_B : floppy_image::MG_A; - buf[tpos++] = mg | uint32_t((200000000ULL*(cur_time-(trans_time/3)))/index_time); + buf[tpos++] = floppy_image::MG_F | uint32_t((200000000ULL*(cur_time-((trans_time*2)/3)))/index_time); + buf[tpos++] = floppy_image::MG_F | uint32_t((200000000ULL*(cur_time-(trans_time/3)))/index_time); #endif - mg = mg == floppy_image::MG_A ? floppy_image::MG_B : floppy_image::MG_A; - buf[tpos++] = mg | uint32_t(200000000ULL*cur_time/index_time); // generate transition now + buf[tpos++] = floppy_image::MG_F | uint32_t(200000000ULL*cur_time/index_time); // generate transition now prev_time = cur_time; } } @@ -239,4 +233,4 @@ return true; } -const floppy_format_type FLOPPY_DFI_FORMAT = &floppy_image_format_creator; +const dfi_format FLOPPY_DFI_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/dfi_dsk.h mame-0.243+dfsg.1/src/lib/formats/dfi_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/dfi_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/dfi_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -12,9 +12,8 @@ public: dfi_format(); - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; - // virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image); + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; virtual const char *name() const override; virtual const char *description() const override; @@ -22,6 +21,6 @@ virtual bool supports_save() const override; }; -extern const floppy_format_type FLOPPY_DFI_FORMAT; +extern const dfi_format FLOPPY_DFI_FORMAT; #endif // MAME_FORMATS_DFI_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/dim_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/dim_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/dim_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/dim_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -33,7 +33,7 @@ return "dim"; } -int dim_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int dim_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint8_t h[16]; @@ -41,12 +41,12 @@ io.read_at(0xab, h, 16, actual); if(strncmp((const char *)h, "DIFC HEADER", 11) == 0) - return 100; + return FIFID_SIGN; return 0; } -bool dim_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool dim_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { size_t actual; int offset = 0x100; @@ -126,14 +126,9 @@ } -bool dim_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) -{ - return false; -} - bool dim_format::supports_save() const { return false; } -const floppy_format_type FLOPPY_DIM_FORMAT = &floppy_image_format_creator; +const dim_format FLOPPY_DIM_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/dim_dsk.h mame-0.243+dfsg.1/src/lib/formats/dim_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/dim_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/dim_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -21,9 +21,8 @@ public: dim_format(); - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; - virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; virtual const char *name() const override; virtual const char *description() const override; @@ -31,6 +30,6 @@ virtual bool supports_save() const override; }; -extern const floppy_format_type FLOPPY_DIM_FORMAT; +extern const dim_format FLOPPY_DIM_FORMAT; #endif // MAME_FORMATS_DIM_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/dip_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/dip_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/dip_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/dip_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -38,19 +38,19 @@ return "dip"; } -int dip_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int dip_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint64_t size; if (io.length(size)) return 0; if (size == 0x134000 + 0x100) - return 100; + return FIFID_SIZE; return 0; } -bool dip_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool dip_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { int heads, tracks, spt, bps; @@ -98,4 +98,4 @@ return false; } -const floppy_format_type FLOPPY_DIP_FORMAT = &floppy_image_format_creator; +const dip_format FLOPPY_DIP_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/dip_dsk.h mame-0.243+dfsg.1/src/lib/formats/dip_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/dip_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/dip_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -20,8 +20,8 @@ public: dip_format(); - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; virtual const char *name() const override; virtual const char *description() const override; @@ -29,6 +29,6 @@ virtual bool supports_save() const override; }; -extern const floppy_format_type FLOPPY_DIP_FORMAT; +extern const dip_format FLOPPY_DIP_FORMAT; #endif // MAME_FORMATS_DIP_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/dmk_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/dmk_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/dmk_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/dmk_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -41,7 +41,7 @@ } -int dmk_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int dmk_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint64_t size; if (io.length(size)) @@ -76,14 +76,14 @@ if (size == header_size + heads * tracks * track_size) { - return 70; + return FIFID_STRUCT|FIFID_SIZE; } return 0; } -bool dmk_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool dmk_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { size_t actual; @@ -215,17 +215,10 @@ return true; } - -bool dmk_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) -{ - return false; -} - - bool dmk_format::supports_save() const { return false; } -const floppy_format_type FLOPPY_DMK_FORMAT = &floppy_image_format_creator; +const dmk_format FLOPPY_DMK_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/dmk_dsk.h mame-0.243+dfsg.1/src/lib/formats/dmk_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/dmk_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/dmk_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -21,9 +21,8 @@ public: dmk_format(); - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; - virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; virtual const char *name() const override; virtual const char *description() const override; @@ -31,6 +30,6 @@ virtual bool supports_save() const override; }; -extern const floppy_format_type FLOPPY_DMK_FORMAT; +extern const dmk_format FLOPPY_DMK_FORMAT; #endif // MAME_FORMATS_DMK_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/dmv_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/dmv_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/dmv_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/dmv_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -50,4 +50,4 @@ {} }; -const floppy_format_type FLOPPY_DMV_FORMAT = &floppy_image_format_creator; +const dmv_format FLOPPY_DMV_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/dmv_dsk.h mame-0.243+dfsg.1/src/lib/formats/dmv_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/dmv_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/dmv_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -27,6 +27,6 @@ static const format formats[]; }; -extern const floppy_format_type FLOPPY_DMV_FORMAT; +extern const dmv_format FLOPPY_DMV_FORMAT; #endif // MAME_FORMATS_DMV_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/ds9_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/ds9_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/ds9_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/ds9_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -78,18 +78,18 @@ track_count = head_count = sector_count = 0; } -int ds9_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int ds9_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint8_t track_count, head_count, sector_count; find_size(io, track_count, head_count, sector_count); if (track_count) - return 50; + return FIFID_SIZE; return 0; } -bool ds9_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool ds9_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { uint8_t track_count, head_count, sector_count; find_size(io, track_count, head_count, sector_count); @@ -120,4 +120,4 @@ return true; } -const floppy_format_type FLOPPY_DS9_FORMAT = &floppy_image_format_creator; +const ds9_format FLOPPY_DS9_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/ds9_dsk.h mame-0.243+dfsg.1/src/lib/formats/ds9_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/ds9_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/ds9_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -17,8 +17,8 @@ public: ds9_format(); - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; virtual const char *name() const override; virtual const char *description() const override; @@ -28,9 +28,9 @@ static const desc_e ds9_desc[]; private: - void find_size(util::random_read &io, uint8_t &track_count, uint8_t &head_count, uint8_t §or_count); + static void find_size(util::random_read &io, uint8_t &track_count, uint8_t &head_count, uint8_t §or_count); }; -extern const floppy_format_type FLOPPY_DS9_FORMAT; +extern const ds9_format FLOPPY_DS9_FORMAT; #endif // MAME_FORMATS_DS9_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/dsk_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/dsk_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/dsk_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/dsk_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -302,17 +302,17 @@ return false; } -int dsk_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int dsk_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint8_t header[16]; size_t actual; io.read_at(0, &header, sizeof(header), actual); if ( memcmp( header, DSK_FORMAT_HEADER, 8 ) ==0) { - return 100; + return FIFID_SIGN; } if ( memcmp( header, EXT_FORMAT_HEADER, 16 ) ==0) { - return 100; + return FIFID_SIGN; } return 0; } @@ -348,7 +348,7 @@ #pragma pack() -bool dsk_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool dsk_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { size_t actual; @@ -497,4 +497,4 @@ return true; } -const floppy_format_type FLOPPY_DSK_FORMAT = &floppy_image_format_creator; +const dsk_format FLOPPY_DSK_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/dsk_dsk.h mame-0.243+dfsg.1/src/lib/formats/dsk_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/dsk_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/dsk_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -19,8 +19,8 @@ public: dsk_format(); - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; virtual const char *name() const override; virtual const char *description() const override; @@ -28,6 +28,6 @@ virtual bool supports_save() const override; }; -extern const floppy_format_type FLOPPY_DSK_FORMAT; +extern const dsk_format FLOPPY_DSK_FORMAT; #endif // MAME_FORMATS_DSK_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/dvk_mx_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/dvk_mx_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/dvk_mx_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/dvk_mx_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -113,7 +113,7 @@ } } -int dvk_mx_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int dvk_mx_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint8_t track_count, head_count, sector_count; @@ -126,16 +126,16 @@ io.read_at(512, sectdata, 512, actual); // check value in RT-11 home block. see src/tools/imgtool/modules/rt11.cpp if (pick_integer_le(sectdata, 0724, 2) == 6) - return 100; + return FIFID_SIGN|FIFID_SIZE; else - return 75; + return FIFID_SIZE; } return 0; } -bool dvk_mx_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool dvk_mx_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { uint8_t track_count, head_count, sector_count; @@ -181,4 +181,4 @@ return true; } -const floppy_format_type FLOPPY_DVK_MX_FORMAT = &floppy_image_format_creator; +const dvk_mx_format FLOPPY_DVK_MX_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/dvk_mx_dsk.h mame-0.243+dfsg.1/src/lib/formats/dvk_mx_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/dvk_mx_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/dvk_mx_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -18,8 +18,8 @@ public: dvk_mx_format(); - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; virtual const char *name() const override; virtual const char *description() const override; @@ -30,9 +30,9 @@ static const desc_e dvk_mx_new_desc[]; private: - void find_size(util::random_read &io, uint8_t &track_count, uint8_t &head_count, uint8_t §or_count); + static void find_size(util::random_read &io, uint8_t &track_count, uint8_t &head_count, uint8_t §or_count); }; -extern const floppy_format_type FLOPPY_DVK_MX_FORMAT; +extern const dvk_mx_format FLOPPY_DVK_MX_FORMAT; #endif // MAME_FORMATS_DVK_MX_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/ep64_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/ep64_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/ep64_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/ep64_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -38,4 +38,4 @@ {} }; -const floppy_format_type FLOPPY_EP64_FORMAT = &floppy_image_format_creator; +const ep64_format FLOPPY_EP64_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/ep64_dsk.h mame-0.243+dfsg.1/src/lib/formats/ep64_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/ep64_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/ep64_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -27,6 +27,6 @@ static const format formats[]; }; -extern const floppy_format_type FLOPPY_EP64_FORMAT; +extern const ep64_format FLOPPY_EP64_FORMAT; #endif // MAME_FORMATS_EP64_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/esq16_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/esq16_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/esq16_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/esq16_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -87,17 +87,17 @@ track_count = head_count = sector_count = 0; } -int esqimg_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int esqimg_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint8_t track_count, head_count, sector_count; find_size(io, track_count, head_count, sector_count); if(track_count) - return 50; + return FIFID_SIZE; return 0; } -bool esqimg_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool esqimg_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { uint8_t track_count, head_count, sector_count; find_size(io, track_count, head_count, sector_count); @@ -124,7 +124,7 @@ return true; } -bool esqimg_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) +bool esqimg_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const { int track_count, head_count, sector_count; get_geometry_mfm_pc(image, 2000, track_count, head_count, sector_count); @@ -153,4 +153,4 @@ return true; } -const floppy_format_type FLOPPY_ESQIMG_FORMAT = &floppy_image_format_creator; +const esqimg_format FLOPPY_ESQIMG_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/esq16_dsk.h mame-0.243+dfsg.1/src/lib/formats/esq16_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/esq16_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/esq16_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -21,9 +21,9 @@ public: esqimg_format(); - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; - virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; + virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const override; virtual const char *name() const override; virtual const char *description() const override; @@ -33,9 +33,9 @@ static const desc_e esq_10_desc[]; private: - void find_size(util::random_read &io, uint8_t &track_count, uint8_t &head_count, uint8_t §or_count); + static void find_size(util::random_read &io, uint8_t &track_count, uint8_t &head_count, uint8_t §or_count); }; -extern const floppy_format_type FLOPPY_ESQIMG_FORMAT; +extern const esqimg_format FLOPPY_ESQIMG_FORMAT; #endif // MAME_FORMATS_ESQ16_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/esq8_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/esq8_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/esq8_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/esq8_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -92,18 +92,18 @@ track_count = head_count = sector_count = 0; } -int esq8img_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int esq8img_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { int track_count, head_count, sector_count; find_size(io, track_count, head_count, sector_count); if(track_count) - return 50; + return FIFID_SIZE; return 0; } -bool esq8img_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool esq8img_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { int track_count, head_count, sector_count; find_size(io, track_count, head_count, sector_count); @@ -143,7 +143,7 @@ return true; } -bool esq8img_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) +bool esq8img_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const { uint64_t file_offset = 0; int track_count, head_count, sector_count; @@ -190,4 +190,4 @@ return true; } -const floppy_format_type FLOPPY_ESQ8IMG_FORMAT = &floppy_image_format_creator; +const esq8img_format FLOPPY_ESQ8IMG_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/esq8_dsk.h mame-0.243+dfsg.1/src/lib/formats/esq8_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/esq8_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/esq8_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -23,9 +23,9 @@ public: esq8img_format(); - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; - virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; + virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const override; virtual const char *name() const override; virtual const char *description() const override; @@ -35,9 +35,9 @@ static const desc_e esq_6_desc[]; private: - void find_size(util::random_read &io, int &track_count, int &head_count, int §or_count); + static void find_size(util::random_read &io, int &track_count, int &head_count, int §or_count); }; -extern const floppy_format_type FLOPPY_ESQ8IMG_FORMAT; +extern const esq8img_format FLOPPY_ESQ8IMG_FORMAT; #endif // MAME_FORMATS_ESQ8_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/excali64_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/excali64_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/excali64_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/excali64_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -38,4 +38,4 @@ {} }; -const floppy_format_type FLOPPY_EXCALI64_FORMAT = &floppy_image_format_creator; +const excali64_format FLOPPY_EXCALI64_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/excali64_dsk.h mame-0.243+dfsg.1/src/lib/formats/excali64_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/excali64_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/excali64_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -27,6 +27,6 @@ static const format formats[]; }; -extern const floppy_format_type FLOPPY_EXCALI64_FORMAT; +extern const excali64_format FLOPPY_EXCALI64_FORMAT; #endif // MAME_FORMATS_EXCALI64_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/fdd_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/fdd_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/fdd_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/fdd_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -59,19 +59,19 @@ return "fdd"; } -int fdd_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int fdd_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint8_t h[7]; size_t actual; io.read_at(0, h, 7, actual); if (strncmp((const char *)h, "VFD1.0", 6) == 0) - return 100; + return FIFID_SIGN; return 0; } -bool fdd_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool fdd_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { uint8_t hsec[0x0c]; @@ -153,4 +153,4 @@ return false; } -const floppy_format_type FLOPPY_FDD_FORMAT = &floppy_image_format_creator; +const fdd_format FLOPPY_FDD_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/fdd_dsk.h mame-0.243+dfsg.1/src/lib/formats/fdd_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/fdd_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/fdd_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -20,8 +20,8 @@ public: fdd_format(); - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; virtual const char *name() const override; virtual const char *description() const override; @@ -29,6 +29,6 @@ virtual bool supports_save() const override; }; -extern const floppy_format_type FLOPPY_FDD_FORMAT; +extern const fdd_format FLOPPY_FDD_FORMAT; #endif // MAME_FORMATS_FDD_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/fl1_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/fl1_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/fl1_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/fl1_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -29,7 +29,7 @@ return "fl1"; } -int fl1_format::get_image_offset(const format &f, int head, int track) +int fl1_format::get_image_offset(const format &f, int head, int track) const { return (f.track_count * head + track) * compute_track_size(f); } @@ -54,4 +54,4 @@ {} }; -const floppy_format_type FLOPPY_FL1_FORMAT = &floppy_image_format_creator; +const fl1_format FLOPPY_FL1_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/fl1_dsk.h mame-0.243+dfsg.1/src/lib/formats/fl1_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/fl1_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/fl1_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -24,9 +24,9 @@ private: static const format formats[]; - virtual int get_image_offset(const format &f, int head, int track) override; + virtual int get_image_offset(const format &f, int head, int track) const override; }; -extern const floppy_format_type FLOPPY_FL1_FORMAT; +extern const fl1_format FLOPPY_FL1_FORMAT; #endif // MAME_FORMATS_FL1_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/flex_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/flex_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/flex_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/flex_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -75,22 +75,23 @@ return "dsk"; } -int flex_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int flex_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { int type = find_size(io, form_factor, variants); if (type != -1) - return 75; + return FIFID_SIZE; return 0; } -int flex_format::find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int flex_format::find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint64_t size; if (io.length(size)) return -1; uint8_t boot0[256], boot1[256]; + sysinfo_sector info; size_t actual; // Look at the boot sector. @@ -182,7 +183,7 @@ return -1; } -const wd177x_format::format &flex_format::get_track_format(const format &f, int head, int track) +const wd177x_format::format &flex_format::get_track_format(const format &f, int head, int track) const { int n = -1; @@ -1274,4 +1275,4 @@ {} }; -const floppy_format_type FLOPPY_FLEX_FORMAT = &floppy_image_format_creator; +const flex_format FLOPPY_FLEX_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/flex_dsk.h mame-0.243+dfsg.1/src/lib/formats/flex_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/flex_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/flex_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -21,9 +21,9 @@ virtual const char *name() const override; virtual const char *description() const override; virtual const char *extensions() const override; - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual int find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual const wd177x_format::format &get_track_format(const format &f, int head, int track) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual int find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual const wd177x_format::format &get_track_format(const format &f, int head, int track) const override; private: struct sysinfo_sector @@ -43,13 +43,13 @@ uint8_t last_trk = 0; uint8_t last_sec = 0; uint8_t unused2[216]{}; - } info; + }; static const format formats[]; static const format formats_head1[]; static const format formats_track0[]; static const format formats_head1_track0[]; }; -extern const floppy_format_type FLOPPY_FLEX_FORMAT; +extern const flex_format FLOPPY_FLEX_FORMAT; #endif // MAME_FORMATS_FLEX_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/flopimg.cpp mame-0.243+dfsg.1/src/lib/formats/flopimg.cpp --- mame-0.242+dfsg.1/src/lib/formats/flopimg.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/flopimg.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -91,9 +91,10 @@ const auto &data = track_array[idx][head].cell_data; if(data.empty()) return false; - if(data.size() == 1 && (data[0] & MG_MASK) == MG_N) - return false; - return true; + for(uint32_t mg : data) + if((mg & floppy_image::MG_MASK) == floppy_image::MG_F) + return true; + return false; } const char *floppy_image::get_variant_name(uint32_t form_factor, uint32_t variant) @@ -118,7 +119,7 @@ return false; } -bool floppy_image_format_t::save(util::random_read_write &io, const std::vector &, floppy_image *) +bool floppy_image_format_t::save(util::random_read_write &io, const std::vector &, floppy_image *) const { return false; } @@ -840,17 +841,11 @@ generate_track_from_levels(track, head, buffer, 0, image); } -void floppy_image_format_t::normalize_times(std::vector &buffer) +void floppy_image_format_t::normalize_times(std::vector &buffer, uint32_t last_position) { - unsigned int total_sum = 0; - for(unsigned int i=0; i != buffer.size(); i++) - total_sum += buffer[i] & floppy_image::TIME_MASK; - - unsigned int current_sum = 0; for(unsigned int i=0; i != buffer.size(); i++) { uint32_t time = buffer[i] & floppy_image::TIME_MASK; - buffer[i] = (buffer[i] & floppy_image::MG_MASK) | (200000000ULL * current_sum / total_sum); - current_sum += time; + buffer[i] = (buffer[i] & floppy_image::MG_MASK) | (200000000ULL * time / last_position); } } @@ -859,36 +854,11 @@ std::vector &dest = image->get_buffer(track, head, subtrack); dest.clear(); - // If the bitstream has an odd number of inversions, one needs to be added. - // Put in in the middle of the half window after the center inversion, where - // any fdc ignores it. - - int inversions = 0; for(int i=0; i != track_size; i++) if(trackbuf[i >> 3] & (0x80 >> (i & 7))) - inversions++; - bool need_flux = inversions & 1; - - uint32_t cbit = floppy_image::MG_A; - uint32_t count = 0; - for(int i=0; i != track_size; i++) - if(trackbuf[i >> 3] & (0x80 >> (i & 7))) { - dest.push_back(cbit | (count+2)); - cbit = cbit == floppy_image::MG_A ? floppy_image::MG_B : floppy_image::MG_A; - if(need_flux) { - need_flux = false; - dest.push_back(cbit | 1); - cbit = cbit == floppy_image::MG_A ? floppy_image::MG_B : floppy_image::MG_A; - count = 1; - } else - count = 2; - } else - count += 4; + dest.push_back(floppy_image::MG_F | (i*2+1)); - if(count) - dest.push_back(cbit | count); - - normalize_times(dest); + normalize_times(dest, track_size*2); if(splice >= 0 || splice < track_size) { int splpos = uint64_t(200000000) * splice / track_size; @@ -902,81 +872,23 @@ splice_pos = splice_pos % trackbuf.size(); uint32_t splice_angular_pos = trackbuf[splice_pos] & floppy_image::TIME_MASK; - // Check if we need to invert a cell to get an even number of - // transitions on the whole track - // - // Also check if all MG values are valid - - int transition_count = 0; - for(auto & elem : trackbuf) { - switch(elem & floppy_image::MG_MASK) { - case MG_1: - transition_count++; - break; - - case MG_W: - throw std::runtime_error(util::string_format("Weak bits not yet handled, track %d head %d", track, head)); - - case MG_0: - case floppy_image::MG_N: - case floppy_image::MG_D: - break; - - case floppy_image::MG_A: - case floppy_image::MG_B: - default: - throw std::invalid_argument(util::string_format("Incorrect MG information in generate_track_from_levels, track %d head %d", track, head)); - } - } - - if(transition_count & 1) { - int pos = splice_pos; - while((trackbuf[pos] & floppy_image::MG_MASK) != MG_0 && (trackbuf[pos] & floppy_image::MG_MASK) != MG_1) { - pos++; - if(pos == int(trackbuf.size())) - pos = 0; - if(pos == splice_pos) - goto meh; - } - if((trackbuf[pos] & floppy_image::MG_MASK) == MG_0) - trackbuf[pos] = (trackbuf[pos] & floppy_image::TIME_MASK) | MG_1; - else - trackbuf[pos] = (trackbuf[pos] & floppy_image::TIME_MASK) | MG_0; - - meh: - ; - - } - - // Maximal number of cells which happens when the buffer is all MG_1/MG_N alternated, which would be 3/2 std::vector &dest = image->get_buffer(track, head); dest.clear(); - uint32_t cbit = floppy_image::MG_A; - uint32_t count = 0; + uint32_t total_time = 0; for(auto & elem : trackbuf) { uint32_t bit = elem & floppy_image::MG_MASK; uint32_t time = elem & floppy_image::TIME_MASK; - if(bit == MG_0) { - count += time; - continue; - } - if(bit == MG_1) { - count += time >> 1; - dest.push_back(cbit | count); - cbit = cbit == floppy_image::MG_A ? floppy_image::MG_B : floppy_image::MG_A; - count = time - (time >> 1); - continue; - } - dest.push_back(cbit | count); - dest.push_back(elem); - count = 0; - } + if(bit == MG_1) + dest.push_back(floppy_image::MG_F | (total_time + (time >> 1))); - if(count) - dest.push_back(cbit | count); + else if(bit != MG_0) + dest.push_back(bit | total_time); - normalize_times(dest); + total_time += time; + } + + normalize_times(dest, total_time); image->set_write_splice_position(track, head, splice_angular_pos); } @@ -1390,96 +1302,156 @@ { std::vector trackbuf; std::vector &tbuf = image->get_buffer(track, head, subtrack); - if(tbuf.size() <= 1) { + bool track_has_info = false; + for(uint32_t mg : tbuf) + if((mg & floppy_image::MG_MASK) == floppy_image::MG_F) { + track_has_info = true; + break; + } + + if(!track_has_info) { // Unformatted track int track_size = 200000000/cell_size; trackbuf.resize(track_size, false); return trackbuf; } - // Start at the write splice - uint32_t splice = image->get_write_splice_position(track, head, subtrack); - int cur_pos = splice; - int cur_entry = 0; - while(cur_entry < int(tbuf.size())-1 && (tbuf[cur_entry+1] & floppy_image::TIME_MASK) < cur_pos) - cur_entry++; - - int period = cell_size; - int period_adjust_base = period * 0.05; - - int min_period = int(cell_size*0.75); - int max_period = int(cell_size*1.25); - int phase_adjust = 0; - int freq_hist = 0; - - uint32_t scanned = 0; - while(scanned < 200000000) { - // Note that all magnetic cell type changes are considered - // edges. No randomness added for neutral/damaged cells - int edge = tbuf[cur_entry] & floppy_image::TIME_MASK; - if(edge < cur_pos) - edge += 200000000; - int next = cur_pos + period + phase_adjust; - scanned += period + phase_adjust; - - if(edge >= next) { - // No transition in the window means 0 and pll in free run mode - trackbuf.push_back(false); + class pll { + private: + const std::vector &tbuf; + int cur_pos; + int cur_entry; + int period; + int period_adjust_base; + int min_period; + int max_period; + int phase_adjust; + int freq_hist; + bool next_is_first; + + public: + pll(const std::vector &_tbuf, int cell_size) : tbuf(_tbuf) { + period = cell_size; + period_adjust_base = period * 0.05; + + min_period = int(cell_size*0.75); + max_period = int(cell_size*1.25); phase_adjust = 0; + freq_hist = 0; - } else { - // Transition in the window means 1, and the pll is adjusted - trackbuf.push_back(true); + // Try to go back 16 flux changes from the end of the track, or at most at the start + int flux_to_step = 16; + cur_entry = tbuf.size()-1; + while(cur_entry > 0 && flux_to_step) { + if((tbuf[cur_entry] & floppy_image::MG_MASK) == floppy_image::MG_F) + flux_to_step --; + cur_entry--; + } - int delta = edge - (next - period/2); + // Go back by half-a-period + cur_pos = (tbuf[cur_entry] & floppy_image::TIME_MASK) - period/2; - phase_adjust = 0.65*delta; + // Adjust the entry accordingly + while(cur_entry > 0 && (cur_pos > (tbuf[cur_entry] & floppy_image::TIME_MASK))) + cur_entry --; + + // Now go to the next flux change from there (the no-MG_F case has been handled earlier) + while((tbuf[cur_entry] & floppy_image::MG_MASK) != floppy_image::MG_F) + cur_entry ++; + + next_is_first = false; + } + + std::pair get() { + bool bit, first; + int edge = tbuf[cur_entry] & floppy_image::TIME_MASK; + if(edge < cur_pos) + edge += 200000000; + int next = cur_pos + period + phase_adjust; + + if(edge >= next) { + // No transition in the window means 0 and pll in free run mode + bit = false; + phase_adjust = 0; + + } else { + // Transition in the window means 1, and the pll is adjusted + bit = true; + + int delta = edge - (next - period/2); + + phase_adjust = 0.65*delta; + + if(delta < 0) { + if(freq_hist < 0) + freq_hist--; + else + freq_hist = -1; + } else if(delta > 0) { + if(freq_hist > 0) + freq_hist++; + else + freq_hist = 1; + } else + freq_hist = 0; + + if(freq_hist) { + int afh = freq_hist < 0 ? -freq_hist : freq_hist; + if(afh > 1) { + int aper = period_adjust_base*delta/period; + if(!aper) + aper = freq_hist < 0 ? -1 : 1; + period += aper; + + if(period < min_period) + period = min_period; + else if(period > max_period) + period = max_period; + } + } + } - if(delta < 0) { - if(freq_hist < 0) - freq_hist--; - else - freq_hist = -1; - } else if(delta > 0) { - if(freq_hist > 0) - freq_hist++; + first = next_is_first; + next_is_first = false; + + cur_pos = next; + if(cur_pos >= 200000000) { + cur_pos -= 200000000; + cur_entry = 0; + + if(cur_pos >= period/2) + first = true; else - freq_hist = 1; - } else - freq_hist = 0; - - if(freq_hist) { - int afh = freq_hist < 0 ? -freq_hist : freq_hist; - if(afh > 1) { - int aper = period_adjust_base*delta/period; - if(!aper) - aper = freq_hist < 0 ? -1 : 1; - period += aper; - - if(period < min_period) - period = min_period; - else if(period > max_period) - period = max_period; - } + next_is_first = true; } - } + while(cur_entry < int(tbuf.size())-1 && (tbuf[cur_entry] & floppy_image::TIME_MASK) < cur_pos) + cur_entry++; + + // Wrap around + if(cur_entry == int(tbuf.size())-1 && + (tbuf[cur_entry] & floppy_image::TIME_MASK) < cur_pos) + cur_entry = 0; - cur_pos = next; - if(cur_pos >= 200000000) { - cur_pos -= 200000000; - cur_entry = 0; + return std::make_pair(bit, first); } - while(cur_entry < int(tbuf.size())-1 && (tbuf[cur_entry] & floppy_image::TIME_MASK) < cur_pos) - cur_entry++; + }; + + pll cpll(tbuf, cell_size); - // Wrap around - if(cur_entry == int(tbuf.size())-1 && - (tbuf[cur_entry] & floppy_image::TIME_MASK) < cur_pos) { - // Wrap to index 0 or 1 depending on whether there is a transition exactly at the index hole - cur_entry = (tbuf[int(tbuf.size())-1] & floppy_image::MG_MASK) != (tbuf[0] & floppy_image::MG_MASK) ? - 0 : 1; + for(;;) { + auto r = cpll.get(); + if(r.second) { + trackbuf.push_back(r.first); + break; } } + for(;;) { + auto r = cpll.get(); + if(r.second) + break; + trackbuf.push_back(r.first); + } + return trackbuf; } diff -Nru mame-0.242+dfsg.1/src/lib/formats/flopimg.h mame-0.243+dfsg.1/src/lib/formats/flopimg.h --- mame-0.242+dfsg.1/src/lib/formats/flopimg.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/flopimg.h 2022-04-29 05:37:26.000000000 +0000 @@ -35,6 +35,18 @@ public: virtual ~floppy_image_format_t() = default; + // The result of identify is a binary or of these flags, comparison afterwards is numerical. + // If a match is incorrect (bad signature for instance), result must be 0. The non-zero + // result helps to decide how reliable the identification is, for choice classification. + + enum { + FIFID_HINT = 0x01, // All other things being equal, favorise this format + FIFID_EXT = 0x02, // Extension matches one of the list (set outside of identify) + FIFID_SIZE = 0x04, // File size matches what is expected + FIFID_SIGN = 0x08, // The file signature matches + FIFID_STRUCT = 0x10, // Some file internal structure aspects have been verified + }; + /*! @brief Identify an image. The identify function tests if the image is valid for this particular format. @@ -42,9 +54,9 @@ @param form_factor Physical form factor of disk, from the enum in floppy_image @param variants the variants from floppy_image the drive can handle - @return 1 if image valid, 0 otherwise. + @return Binary or of FIFID flags, 0 if invalid for that format */ - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) = 0; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const = 0; /*! @brief Load an image. The load function opens an image file and converts it to the @@ -56,7 +68,7 @@ @param image output buffer for data in MAME internal format. @return true on success, false otherwise. */ - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) = 0; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const = 0; /*! @brief Save an image. The save function writes back an image from the MAME internal @@ -66,7 +78,7 @@ @param image source buffer containing data in MAME internal format. @return true on success, false otherwise. */ - virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image); + virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const; //! @returns string containing name of format. virtual const char *name() const = 0; @@ -230,8 +242,9 @@ */ static void generate_track_from_levels(int track, int head, std::vector &trackbuf, int splice_pos, floppy_image *image); - //! Normalize the times in a cell buffer to sum up to 200000000 - static void normalize_times(std::vector &buffer); + //! Normalize the times in a cell buffer to bring the + //! 0..last_position range up to 0..200000000 + static void normalize_times(std::vector &buffer, uint32_t last_position); // Some conversion tables for gcr static const uint8_t gcr5fw_tb[0x10], gcr5bw_tb[0x20]; @@ -443,16 +456,6 @@ static int calc_sector_index(int num, int interleave, int skew, int total_sectors, int track_head); }; -// a dce_type is simply a pointer to its alloc function -typedef floppy_image_format_t *(*floppy_format_type)(); - -// this template function creates a stub which constructs a image format -template -floppy_image_format_t *floppy_image_format_creator() -{ - return new _FormatClass(); -} - // ======================> floppy_image //! Class representing floppy image @@ -460,19 +463,22 @@ //! Internal format is close but not identical to the mfi format. //! //! + //! Track data consists of a series of 32-bits lsb-first values -//! representing magnetic cells. Bits 0-27 indicate the absolute -//! position of the start of the cell (not the size), and bits -//! 28-31 the type. Type can be: -//! - 0, MG_A -> Magnetic orientation A -//! - 1, MG_B -> Magnetic orientation B -//! - 2, MG_N -> Non-magnetized zone (neutral) -//! - 3, MG_D -> Damaged zone, reads as neutral but cannot be changed by writing +//! representing the magnetic state. Bits 0-27 indicate the absolute +//! position of encoded event, and bits ! 28-31 the type. Type can be: +//! - 0, MG_F -> Flux orientation change +//! - 1, MG_N -> Start of a non-magnetized zone (neutral) +//! - 2, MG_D -> Start of a damaged zone, reads as neutral but cannot be changed by writing +//! - 3, MG_E -> End of one of the previous zones, *inclusive* //! //! The position is in angular units of 1/200,000,000th of a turn. -//! The last cell implicit end position is of course 200,000,000. +//! A N or D zone must not wrap at the 200,000,000 position, it has to +//! be split in two (the first finishing at 199,999,999, the second +//! starting at 0) //! -//! Unformatted tracks are encoded as zero-size. +//! Unformatted tracks are encoded as zero-size, and are strictly equivalent +//! to (MG_N, 0), (MG_E, 199,999,999) //! //! The "track splice" information indicates where to start writing //! if you try to rewrite a physical disk with the data. Some @@ -501,10 +507,10 @@ TIME_MASK = 0x0fffffff, MG_MASK = 0xf0000000, MG_SHIFT = 28, //!< Bitshift constant for magnetic orientation data - MG_A = (0 << MG_SHIFT), //!< - 0, MG_A -> Magnetic orientation A - MG_B = (1 << MG_SHIFT), //!< - 1, MG_B -> Magnetic orientation B - MG_N = (2 << MG_SHIFT), //!< - 2, MG_N -> Non-magnetized zone (neutral) - MG_D = (3 << MG_SHIFT) //!< - 3, MG_D -> Damaged zone, reads as neutral but cannot be changed by writing + MG_F = (0 << MG_SHIFT), //!< - 0, MG_F -> Flux orientation change + MG_N = (1 << MG_SHIFT), //!< - 1, MG_N -> Non-magnetized zone (neutral) + MG_D = (2 << MG_SHIFT), //!< - 2, MG_D -> Damaged zone, reads as neutral but cannot be changed by writing + MG_E = (3 << MG_SHIFT) //!< - 3, MG_E -> End of zone }; diff -Nru mame-0.242+dfsg.1/src/lib/formats/fmtowns_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/fmtowns_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/fmtowns_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/fmtowns_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -38,4 +38,4 @@ {} }; -const floppy_format_type FLOPPY_FMTOWNS_FORMAT = &floppy_image_format_creator; +const fmtowns_format FLOPPY_FMTOWNS_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/fmtowns_dsk.h mame-0.243+dfsg.1/src/lib/formats/fmtowns_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/fmtowns_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/fmtowns_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -25,6 +25,6 @@ static const format formats[]; }; -extern const floppy_format_type FLOPPY_FMTOWNS_FORMAT; +extern const fmtowns_format FLOPPY_FMTOWNS_FORMAT; #endif // MAME_FORMATS_FMTOWNS_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/fs_coco_os9.cpp mame-0.243+dfsg.1/src/lib/formats/fs_coco_os9.cpp --- mame-0.242+dfsg.1/src/lib/formats/fs_coco_os9.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/fs_coco_os9.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -9,7 +9,7 @@ OS-9 Level 2 Technical Reference, Chapter 5, Random Block File Manager, page 2 - http://www.colorcomputerarchive.com/coco/Documents/Manuals/Operating Systems/OS-9 Level 2 Manual (Tandy).pdf + https://colorcomputerarchive.com/repo/Documents/Manuals/Operating%20Systems/OS-9%20Level%202%20Manual%20(Tandy).pdf ***************************************************************************/ @@ -17,10 +17,147 @@ #include "coco_rawdsk.h" #include "strformat.h" + +//************************************************************************** +// TYPE DECLARATIONS +//************************************************************************** + +namespace { + +using namespace fs; + +// methods +std::string pick_os9_string(std::string_view raw_string); +std::string to_os9_string(std::string_view s, size_t length); +util::arbitrary_datetime from_os9_date(u32 os9_date, u16 os9_time = 0); +std::tuple to_os9_date(const util::arbitrary_datetime &datetime); +u32 pick_integer_be(const u8 *data, int length); +bool validate_filename(std::string_view name); +bool is_ignored_filename(std::string_view name); +std::vector entity_meta_description(); + + +// ======================> volume_header + +class volume_header +{ +public: + volume_header(fsblk_t::block_t &&block); + + u32 total_sectors() const { return m_block.r24b(0); } + u8 track_size_in_sectors() const { return m_block.r8(3); } + u16 allocation_bitmap_bytes() const { return m_block.r16b(4); } + u16 cluster_size() const { return m_block.r16b(6); } + u32 root_dir_lsn() const { return m_block.r24b(8); } + u16 owner_id() const { return m_block.r16b(11); } + u16 disk_id() const { return m_block.r16b(14); } + u8 format_flags() const { return m_block.r8(16); } + u16 sectors_per_track() const { return m_block.r16b(17); } + u32 bootstrap_lsn() const { return m_block.r24b(21); } + u16 bootstrap_size() const { return m_block.r16b(24); } + util::arbitrary_datetime creation_date() const { return from_os9_date(m_block.r24b(26), m_block.r16b(29)); } + u16 sector_size() const { u16 result = m_block.r16b(104); return result != 0 ? result : 256; } + u8 sides() const { return (format_flags() & 0x01) ? 2 : 1; } + bool double_density() const { return (format_flags() & 0x02) != 0; } + bool double_track() const { return (format_flags() & 0x04) != 0; } + bool quad_track_density() const { return (format_flags() & 0x08) != 0; } + bool octal_track_density() const { return (format_flags() & 0x10) != 0; } + + std::string name() const; + +private: + fsblk_t::block_t m_block; +}; + + +// ======================> file_header + +class file_header +{ +public: + file_header(fsblk_t::block_t &&block); + + u8 attributes() const { return m_block.r8(0); } + u16 owner_id() const { return m_block.r16b(1); } + u8 link_count() const { return m_block.r8(8); } + u32 file_size() const { return m_block.r32b(9); } + util::arbitrary_datetime creation_date() const; + bool is_directory() const { return (attributes() & 0x80) != 0; } + bool is_non_sharable() const { return (attributes() & 0x40) != 0; } + bool is_public_execute() const { return (attributes() & 0x20) != 0; } + bool is_public_write() const { return (attributes() & 0x10) != 0; } + bool is_public_read() const { return (attributes() & 0x08) != 0; } + bool is_user_execute() const { return (attributes() & 0x04) != 0; } + bool is_user_write() const { return (attributes() & 0x02) != 0; } + bool is_user_read() const { return (attributes() & 0x01) != 0; } + + meta_data metadata() const; + int get_sector_map_entry_count() const; + void get_sector_map_entry(int entry_number, u32 &start_lsn, u16 &count) const; + +private: + fsblk_t::block_t m_block; +}; + + +// ======================> impl + +class impl : public filesystem_t { +public: + class file : public ifile_t { + public: + file(impl &fs, file_header &&file_header); + virtual ~file() = default; + + virtual void drop_weak_references() override; + + virtual meta_data metadata() override; + virtual std::vector read_all() override; + + private: + impl &m_fs; + file_header m_file_header; + }; + + class directory : public idir_t { + public: + directory(impl &i, file_header &&file_header); + virtual ~directory() = default; + + virtual void drop_weak_references() override; + virtual meta_data metadata() override; + virtual std::vector contents() override; + virtual file_t file_get(u64 key) override; + virtual dir_t dir_get(u64 key) override; + + private: + impl &m_fs; + file_header m_file_header; + }; + + impl(fsblk_t &blockdev, volume_header &&header); + virtual ~impl() = default; + + virtual meta_data metadata() override; + virtual dir_t root() override; + virtual void format(const meta_data &meta) override; + +private: + volume_header m_volume_header; + dir_t m_root; + + directory *open_directory(u32 lsn); + std::vector read_file_data(const file_header &header) const; +}; + +} + namespace fs { const coco_os9_image COCO_OS9; +}; + //************************************************************************** // IMPLEMENTATION @@ -30,7 +167,7 @@ // name //------------------------------------------------- -const char *coco_os9_image::name() const +const char *fs::coco_os9_image::name() const { return "coco_os9"; } @@ -40,7 +177,7 @@ // description //------------------------------------------------- -const char *coco_os9_image::description() const +const char *fs::coco_os9_image::description() const { return "CoCo OS-9"; } @@ -50,7 +187,7 @@ // enumerate_f //------------------------------------------------- -void coco_os9_image::enumerate_f(floppy_enumerator &fe, u32 form_factor, const std::vector &variants) const +void fs::coco_os9_image::enumerate_f(floppy_enumerator &fe, u32 form_factor, const std::vector &variants) const { if (has(form_factor, variants, floppy_image::FF_525, floppy_image::SSDD)) { @@ -64,9 +201,9 @@ // can_format //------------------------------------------------- -bool coco_os9_image::can_format() const +bool fs::coco_os9_image::can_format() const { - return false; + return true; } @@ -74,7 +211,7 @@ // can_read //------------------------------------------------- -bool coco_os9_image::can_read() const +bool fs::coco_os9_image::can_read() const { return true; } @@ -84,7 +221,7 @@ // can_write //------------------------------------------------- -bool coco_os9_image::can_write() const +bool fs::coco_os9_image::can_write() const { return false; } @@ -94,7 +231,7 @@ // has_rsrc //------------------------------------------------- -bool coco_os9_image::has_rsrc() const +bool fs::coco_os9_image::has_rsrc() const { return false; } @@ -104,7 +241,7 @@ // directory_separator //------------------------------------------------- -char coco_os9_image::directory_separator() const +char fs::coco_os9_image::directory_separator() const { return '/'; } @@ -114,10 +251,11 @@ // volume_meta_description //------------------------------------------------- -std::vector coco_os9_image::volume_meta_description() const +std::vector fs::coco_os9_image::volume_meta_description() const { std::vector results; - results.emplace_back(meta_description(meta_name::name, meta_type::string, "UNTITLED", false, [](const meta_value &m) { return m.as_string().size() <= 32; }, "Volume name, up to 32 characters")); + results.emplace_back(meta_description(meta_name::name, "UNTITLED", false, [](const meta_value &m) { return m.as_string().size() <= 32; }, "Volume name, up to 32 characters")); + results.emplace_back(meta_description(meta_name::creation_date, util::arbitrary_datetime::now(), false, nullptr, "Creation time")); return results; } @@ -126,7 +264,7 @@ // file_meta_description //------------------------------------------------- -std::vector coco_os9_image::file_meta_description() const +std::vector fs::coco_os9_image::file_meta_description() const { return entity_meta_description(); } @@ -136,33 +274,17 @@ // directory_meta_description //------------------------------------------------- -std::vector coco_os9_image::directory_meta_description() const +std::vector fs::coco_os9_image::directory_meta_description() const { return entity_meta_description(); } //------------------------------------------------- -// entity_meta_description -//------------------------------------------------- - -std::vector coco_os9_image::entity_meta_description() const -{ - std::vector results; - results.emplace_back(meta_description(meta_name::name, meta_type::string, "", false, [](const meta_value &m) { return validate_filename(m.as_string()); }, "File name")); - results.emplace_back(meta_description(meta_name::creation_date, meta_type::date, util::arbitrary_datetime::now(), false, nullptr, "Creation time")); - results.emplace_back(meta_description(meta_name::owner_id, meta_type::number, 0, true, nullptr, "Owner ID")); - results.emplace_back(meta_description(meta_name::attributes, meta_type::string, 0, true, nullptr, "File attributes")); - results.emplace_back(meta_description(meta_name::length, meta_type::number, 0, true, nullptr, "Size of the file in bytes")); - return results; -} - - -//------------------------------------------------- // mount //------------------------------------------------- -std::unique_ptr coco_os9_image::mount(fsblk_t &blockdev) const +std::unique_ptr fs::coco_os9_image::mount(fsblk_t &blockdev) const { // read the header block blockdev.set_block_size(256); @@ -178,10 +300,28 @@ //------------------------------------------------- +// entity_meta_description +//------------------------------------------------- + +namespace { + +std::vector entity_meta_description() +{ + std::vector results; + results.emplace_back(meta_description(meta_name::name, "", false, [](const meta_value &m) { return validate_filename(m.as_string()); }, "File name")); + results.emplace_back(meta_description(meta_name::creation_date, util::arbitrary_datetime::now(), false, nullptr, "Creation time")); + results.emplace_back(meta_description(meta_name::owner_id, 0, true, nullptr, "Owner ID")); + results.emplace_back(meta_description(meta_name::attributes, "", true, nullptr, "File attributes")); + results.emplace_back(meta_description(meta_name::length, 0, true, nullptr, "Size of the file in bytes")); + return results; +} + + +//------------------------------------------------- // pick_os9_string //------------------------------------------------- -std::string coco_os9_image::pick_os9_string(std::string_view raw_string) +std::string pick_os9_string(std::string_view raw_string) { // find the last NUL or high bit character auto iter = std::find_if(raw_string.begin(), raw_string.end(), [](char ch) @@ -201,10 +341,26 @@ //------------------------------------------------- +// to_os9_string +//------------------------------------------------- + +std::string to_os9_string(std::string_view s, size_t length) +{ + std::string result(length, '\0'); + for (auto i = 0; i < std::min(length, s.size()); i++) + { + result[i] = (s[i] & 0x7F) + | (i == s.size() ? 0x80 : 0x00); + } + return result; +} + + +//------------------------------------------------- // pick_integer_be //------------------------------------------------- -u32 coco_os9_image::pick_integer_be(const u8 *data, int length) +u32 pick_integer_be(const u8 *data, int length) { u32 result = 0; for (int i = 0; i < length; i++) @@ -214,10 +370,42 @@ //------------------------------------------------- +// from_os9_date +//------------------------------------------------- + +util::arbitrary_datetime from_os9_date(u32 os9_date, u16 os9_time) +{ + util::arbitrary_datetime dt; + memset(&dt, 0, sizeof(dt)); + dt.year = ((os9_date >> 16) & 0xFF) + 1900; + dt.month = (os9_date >> 8) & 0xFF; + dt.day_of_month = (os9_date >> 0) & 0xFF; + dt.hour = (os9_time >> 8) & 0xFF; + dt.minute = (os9_time >> 0) & 0xFF; + return dt; +} + + +//------------------------------------------------- +// to_os9_date +//------------------------------------------------- + +std::tuple to_os9_date(const util::arbitrary_datetime &datetime) +{ + u32 os9_date = ((datetime.year - 1900) & 0xFF) << 16 + | (datetime.month & 0xFF) << 8 + | (datetime.day_of_month & 0xFF) << 0; + u16 os9_time = (datetime.hour & 0xFF) << 8 + | (datetime.minute & 0xFF) << 0; + return std::make_tuple(os9_date, os9_time); +} + + +//------------------------------------------------- // validate_filename //------------------------------------------------- -bool coco_os9_image::validate_filename(std::string_view name) +bool validate_filename(std::string_view name) { return !is_ignored_filename(name) && name.size() <= 29 @@ -230,7 +418,7 @@ // ignored if it is in the file system? //------------------------------------------------- -bool coco_os9_image::is_ignored_filename(std::string_view name) +bool is_ignored_filename(std::string_view name) { return name.empty() || name[0] == '\0' @@ -243,7 +431,7 @@ // volume_header ctor //------------------------------------------------- -coco_os9_image::volume_header::volume_header(fsblk_t::block_t &&block) +volume_header::volume_header(fsblk_t::block_t &&block) : m_block(std::move(block)) { } @@ -253,7 +441,7 @@ // volume_header::name //------------------------------------------------- -std::string coco_os9_image::volume_header::name() const +std::string volume_header::name() const { std::string_view raw_name((const char *)&m_block.rodata()[31], 32); return pick_os9_string(raw_name); @@ -264,7 +452,7 @@ // file_header ctor //------------------------------------------------- -coco_os9_image::file_header::file_header(fsblk_t::block_t &&block) +file_header::file_header(fsblk_t::block_t &&block) : m_block(std::move(block)) { } @@ -274,14 +462,9 @@ // file_header::creation_date //------------------------------------------------- -util::arbitrary_datetime coco_os9_image::file_header::creation_date() const +util::arbitrary_datetime file_header::creation_date() const { - util::arbitrary_datetime dt; - memset(&dt, 0, sizeof(dt)); - dt.year = 1900 + m_block.r8(13); - dt.month = m_block.r8(14); - dt.day_of_month = m_block.r8(15); - return dt; + return from_os9_date(m_block.r24b(13)); } @@ -289,7 +472,7 @@ // file_header::metadata //------------------------------------------------- -meta_data coco_os9_image::file_header::metadata() const +meta_data file_header::metadata() const { // format the attributes std::string attributes = util::string_format("%c%c%c%c%c%c%c%c", @@ -315,7 +498,7 @@ // file_header::get_sector_map_entry_count //------------------------------------------------- -int coco_os9_image::file_header::get_sector_map_entry_count() const +int file_header::get_sector_map_entry_count() const { return (m_block.size() - 16) / 5; } @@ -325,7 +508,7 @@ // file_header::get_sector_map_entry //------------------------------------------------- -void coco_os9_image::file_header::get_sector_map_entry(int entry_number, u32 &start_lsn, u16 &count) const +void file_header::get_sector_map_entry(int entry_number, u32 &start_lsn, u16 &count) const { start_lsn = m_block.r24b(16 + (entry_number * 5) + 0); count = m_block.r16b(16 + (entry_number * 5) + 3); @@ -336,7 +519,7 @@ // impl ctor //------------------------------------------------- -coco_os9_image::impl::impl(fsblk_t &blockdev, volume_header &&header) +impl::impl(fsblk_t &blockdev, volume_header &&header) : filesystem_t(blockdev, 256) , m_volume_header(std::move(header)) { @@ -347,10 +530,11 @@ // impl::metadata //------------------------------------------------- -meta_data coco_os9_image::impl::metadata() +meta_data impl::metadata() { meta_data results; results.set(meta_name::name, m_volume_header.name()); + results.set(meta_name::creation_date, m_volume_header.creation_date()); return results; } @@ -359,7 +543,7 @@ // impl::root //------------------------------------------------- -filesystem_t::dir_t coco_os9_image::impl::root() +filesystem_t::dir_t impl::root() { if (!m_root) m_root = open_directory(m_volume_header.root_dir_lsn()); @@ -368,12 +552,112 @@ //------------------------------------------------- -// impl::drop_root_ref +// impl::format //------------------------------------------------- -void coco_os9_image::impl::drop_root_ref() +void impl::format(const meta_data &meta) { - m_root = nullptr; + // for some reason, the OS-9 world favored filling with 0xE5 + m_blockdev.fill(0xE5); + + // identify geometry info + u8 sectors = 18; // TODO - we need a definitive technique to get the floppy geometry + u8 heads = 1; // TODO - we need a definitive technique to get the floppy geometry + u16 sector_bytes = 256; // TODO - we need a definitive technique to get the floppy geometry + bool is_double_density = true; // TODO - we need a definitive technique to get the floppy geometry + u32 tracks = m_blockdev.block_count() / sectors / heads; + + // get attributes from metadata + std::string volume_title = meta.get_string(meta_name::name, "UNTITLED"); + util::arbitrary_datetime creation_datetime = meta.get_date(meta_name::creation_date); + auto [creation_os9date, creation_os9time] = to_os9_date(creation_datetime); + + u32 lsn_count = m_blockdev.block_count(); + u16 cluster_size = 1; + u16 owner_id = 1; + u16 disk_id = 1; + u8 attributes = 0; + u32 allocation_bitmap_bits = lsn_count / cluster_size; + u32 allocation_bitmap_lsns = (allocation_bitmap_bits / 8 + sector_bytes - 1) / sector_bytes; + u8 format_flags = ((heads > 1) ? 0x01 : 0x00) + | (is_double_density ? 0x02 : 0x00); + + // volume header + auto volume_header = m_blockdev.get(0); + volume_header.fill(0x00); + volume_header.w24b(0, lsn_count); // DD.TOT - total secctors + volume_header.w8(3, sectors); // DD.TKS - track size in sectors + volume_header.w16b(4, (allocation_bitmap_bits + 7) / 8); // DD.MAP - allocation bitmap in bytes + volume_header.w16b(6, cluster_size); // DD.BIT - cluster size + volume_header.w24b(8, 1 + allocation_bitmap_lsns); // DD.DIR - root directory LSN + volume_header.w16b(11, owner_id); // DD.OWN - owner ID + volume_header.w8(13, attributes); // DD.ATT - Dattributes + volume_header.w16b(14, disk_id); // DD.DSK - disk ID + volume_header.w8(16, format_flags); // DD.FMT - format flags + volume_header.w16b(17, sectors); // DD.SPT - sectors per track + volume_header.w24b(26, creation_os9date); // DD.DAT - date of creation + volume_header.w16b(29, creation_os9time); // DD.DAT - time of creation + volume_header.wstr(31, to_os9_string(volume_title, 32)); // DD.NAM - title + volume_header.w16b(103, sector_bytes / 256); // sector bytes + + // path descriptor options + volume_header.w8(0x3f + 0x00, 1); // device class + volume_header.w8(0x3f + 0x01, 1); // drive number + volume_header.w8(0x3f + 0x03, 0x20); // device type + volume_header.w8(0x3f + 0x04, 1); // density capability + volume_header.w16b(0x3f + 0x05, tracks); // number of tracks + volume_header.w8(0x3f + 0x07, heads); // number of sides + volume_header.w16b(0x3f + 0x09, sectors); // sectors per track + volume_header.w16b(0x3f + 0x0b, sectors); // sectors on track zero + volume_header.w8(0x3f + 0x0d, 3); // sector interleave factor + volume_header.w8(0x3f + 0x0e, 8); // default sectors per allocation + + // allocation bitmap + u32 total_allocated_sectors = 1 + allocation_bitmap_lsns + 1 + 8; + std::vector abblk_bytes; + abblk_bytes.resize(sector_bytes); + for (u32 i = 0; i < allocation_bitmap_lsns; i++) + { + for (u32 j = 0; j < sector_bytes; j++) + { + u32 pos = (i * sector_bytes + j) * 8; + if (pos + 8 < total_allocated_sectors) + abblk_bytes[j] = 0xFF; + else if (pos >= total_allocated_sectors) + abblk_bytes[j] = 0x00; + else + abblk_bytes[j] = ~((1 << (8 - total_allocated_sectors + pos)) - 1); + } + + auto abblk = m_blockdev.get(1 + i); + abblk.copy(0, abblk_bytes.data(), sector_bytes); + } + + // root directory header + auto roothdr_blk = m_blockdev.get(1 + allocation_bitmap_lsns); + roothdr_blk.fill(0x00); + roothdr_blk.w8(0x00, 0xBF); + roothdr_blk.w8(0x01, 0x00); + roothdr_blk.w8(0x02, 0x00); + roothdr_blk.w24b(0x03, creation_os9date); + roothdr_blk.w16b(0x06, creation_os9time); + roothdr_blk.w8(0x08, 0x01); + roothdr_blk.w8(0x09, 0x00); + roothdr_blk.w8(0x0A, 0x00); + roothdr_blk.w8(0x0B, 0x00); + roothdr_blk.w8(0x0C, 0x40); + roothdr_blk.w24b(0x0D, creation_os9date); + roothdr_blk.w24b(0x10, 1 + allocation_bitmap_lsns + 1); + roothdr_blk.w16b(0x13, 8); + + // root directory data + auto rootdata_blk = m_blockdev.get(1 + allocation_bitmap_lsns + 1); + rootdata_blk.fill(0x00); + rootdata_blk.w8(0x00, 0x2E); + rootdata_blk.w8(0x01, 0xAE); + rootdata_blk.w8(0x1F, 1 + allocation_bitmap_lsns); + rootdata_blk.w8(0x20, 0xAE); + rootdata_blk.w8(0x3F, 1 + allocation_bitmap_lsns); } @@ -381,7 +665,7 @@ // impl::open_directory //------------------------------------------------- -coco_os9_image::impl::directory *coco_os9_image::impl::open_directory(u32 lsn) +impl::directory *impl::open_directory(u32 lsn) { file_header header(m_blockdev.get(lsn)); return new directory(*this, std::move(header)); @@ -392,7 +676,7 @@ // impl::read_file_data //------------------------------------------------- -std::vector coco_os9_image::impl::read_file_data(const file_header &header) const +std::vector impl::read_file_data(const file_header &header) const { std::vector data; data.reserve(header.file_size()); @@ -419,7 +703,7 @@ // file ctor //------------------------------------------------- -coco_os9_image::impl::file::file(impl &i, file_header &&file_header) +impl::file::file(impl &i, file_header &&file_header) : m_fs(i) , m_file_header(std::move(file_header)) { @@ -430,7 +714,7 @@ // file::drop_weak_references //------------------------------------------------- -void coco_os9_image::impl::file::drop_weak_references() +void impl::file::drop_weak_references() { } @@ -439,7 +723,7 @@ // file::metadata //------------------------------------------------- -meta_data coco_os9_image::impl::file::metadata() +meta_data impl::file::metadata() { return m_file_header.metadata(); } @@ -449,7 +733,7 @@ // file::read_all //------------------------------------------------- -std::vector coco_os9_image::impl::file::read_all() +std::vector impl::file::read_all() { return m_fs.read_file_data(m_file_header); } @@ -459,7 +743,7 @@ // directory ctor //------------------------------------------------- -coco_os9_image::impl::directory::directory(impl &i, file_header &&file_header) +impl::directory::directory(impl &i, file_header &&file_header) : m_fs(i) , m_file_header(std::move(file_header)) { @@ -470,7 +754,7 @@ // directory::drop_weak_references //------------------------------------------------- -void coco_os9_image::impl::directory::drop_weak_references() +void impl::directory::drop_weak_references() { } @@ -479,7 +763,7 @@ // directory::metadata //------------------------------------------------- -meta_data coco_os9_image::impl::directory::metadata() +meta_data impl::directory::metadata() { return m_file_header.metadata(); } @@ -489,7 +773,7 @@ // directory::contents //------------------------------------------------- -std::vector coco_os9_image::impl::directory::contents() +std::vector impl::directory::contents() { // read the directory data std::vector directory_data = m_fs.read_file_data(m_file_header); @@ -523,7 +807,7 @@ // directory::file_get //------------------------------------------------- -filesystem_t::file_t coco_os9_image::impl::directory::file_get(u64 key) +filesystem_t::file_t impl::directory::file_get(u64 key) { file_header header(m_fs.m_blockdev.get(u32(key))); return file_t(new file(m_fs, std::move(header))); @@ -534,9 +818,9 @@ // directory::dir_get //------------------------------------------------- -filesystem_t::dir_t coco_os9_image::impl::directory::dir_get(u64 key) +filesystem_t::dir_t impl::directory::dir_get(u64 key) { return dir_t(m_fs.open_directory(u32(key))); } -} // namespace fs +}; diff -Nru mame-0.242+dfsg.1/src/lib/formats/fs_coco_os9.h mame-0.243+dfsg.1/src/lib/formats/fs_coco_os9.h --- mame-0.242+dfsg.1/src/lib/formats/fs_coco_os9.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/fs_coco_os9.h 2022-04-29 05:37:26.000000000 +0000 @@ -23,63 +23,7 @@ class coco_os9_image : public manager_t { public: - class volume_header - { - public: - volume_header(fsblk_t::block_t &&block); - - u32 total_sectors() const { return m_block.r24b(0); } - u8 track_size_in_sectors() const { return m_block.r8(3); } - u16 allocation_bitmap_bytes() const { return m_block.r16b(4); } - u16 cluster_size() const { return m_block.r16b(6); } - u32 root_dir_lsn() const { return m_block.r24b(8); } - u16 owner_id() const { return m_block.r16b(11); } - u16 disk_id() const { return m_block.r16b(14); } - u8 format_flags() const { return m_block.r8(16); } - u16 sectors_per_track() const { return m_block.r16b(17); } - u32 bootstrap_lsn() const { return m_block.r24b(21); } - u16 bootstrap_size() const { return m_block.r16b(24); } - u16 sector_size() const { u16 result = m_block.r16b(104); return result != 0 ? result : 256; } - u8 sides() const { return (format_flags() & 0x01) ? 2 : 1; } - bool double_density() const { return (format_flags() & 0x02) != 0; } - bool double_track() const { return (format_flags() & 0x04) != 0; } - bool quad_track_density() const { return (format_flags() & 0x08) != 0; } - bool octal_track_density() const { return (format_flags() & 0x10) != 0; } - - std::string name() const; - - private: - fsblk_t::block_t m_block; - }; - - class file_header - { - public: - file_header(fsblk_t::block_t &&block); - - u8 attributes() const { return m_block.r8(0); } - u16 owner_id() const { return m_block.r16b(1); } - u8 link_count() const { return m_block.r8(8); } - u32 file_size() const { return m_block.r32b(9); } - util::arbitrary_datetime creation_date() const; - bool is_directory() const { return (attributes() & 0x80) != 0; } - bool is_non_sharable() const { return (attributes() & 0x40) != 0; } - bool is_public_execute() const { return (attributes() & 0x20) != 0; } - bool is_public_write() const { return (attributes() & 0x10) != 0; } - bool is_public_read() const { return (attributes() & 0x08) != 0; } - bool is_user_execute() const { return (attributes() & 0x04) != 0; } - bool is_user_write() const { return (attributes() & 0x02) != 0; } - bool is_user_read() const { return (attributes() & 0x01) != 0; } - - meta_data metadata() const; - int get_sector_map_entry_count() const; - void get_sector_map_entry(int entry_number, u32 &start_lsn, u16 &count) const; - - private: - fsblk_t::block_t m_block; - }; - - coco_os9_image() : manager_t() {} + coco_os9_image() = default; virtual const char *name() const override; virtual const char *description() const override; @@ -96,61 +40,6 @@ virtual std::vector volume_meta_description() const override; virtual std::vector file_meta_description() const override; virtual std::vector directory_meta_description() const override; - std::vector entity_meta_description() const; - -private: - class impl : public filesystem_t { - public: - class file : public ifile_t { - public: - file(impl &fs, file_header &&file_header); - virtual ~file() = default; - - virtual void drop_weak_references() override; - - virtual meta_data metadata() override; - virtual std::vector read_all() override; - - private: - impl & m_fs; - file_header m_file_header; - }; - - class directory : public idir_t { - public: - directory(impl &i, file_header &&file_header); - virtual ~directory() = default; - - virtual void drop_weak_references() override; - virtual meta_data metadata() override; - virtual std::vector contents() override; - virtual file_t file_get(u64 key) override; - virtual dir_t dir_get(u64 key) override; - - private: - impl & m_fs; - file_header m_file_header; - }; - - impl(fsblk_t &blockdev, volume_header &&header); - virtual ~impl() = default; - - virtual meta_data metadata() override; - virtual dir_t root() override; - - private: - volume_header m_volume_header; - dir_t m_root; - - directory *open_directory(u32 lsn); - void drop_root_ref(); - std::vector read_file_data(const file_header &header) const; - }; - - static std::string pick_os9_string(std::string_view raw_string); - static u32 pick_integer_be(const u8 *data, int length); - static bool validate_filename(std::string_view name); - static bool is_ignored_filename(std::string_view name); }; extern const coco_os9_image COCO_OS9; diff -Nru mame-0.242+dfsg.1/src/lib/formats/fs_coco_rsdos.cpp mame-0.243+dfsg.1/src/lib/formats/fs_coco_rsdos.cpp --- mame-0.242+dfsg.1/src/lib/formats/fs_coco_rsdos.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/fs_coco_rsdos.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -17,20 +17,122 @@ #include namespace fs { + const coco_rsdos_image COCO_RSDOS; +}; -const coco_rsdos_image COCO_RSDOS; +using namespace fs; -const char *coco_rsdos_image::name() const +namespace { + +class impl : public filesystem_t { +public: + class root_dir : public idir_t { + public: + root_dir(impl &i) : m_fs(i) {} + virtual ~root_dir() = default; + + virtual void drop_weak_references() override; + virtual meta_data metadata() override; + virtual std::vector contents() override; + virtual file_t file_get(u64 key) override; + virtual dir_t dir_get(u64 key) override; + + private: + impl &m_fs; + }; + + struct rsdos_dirent + { + char m_filename[11]; + u8 m_filetype; + u8 m_asciiflag; + u8 m_first_granule; + u8 m_last_sector_bytes_msb; + u8 m_last_sector_bytes_lsb; + }; + + struct rsdos_dirent_sector + { + struct + { + rsdos_dirent m_dirent; + u8 m_unused[16]; + } m_entries[4]; + }; + + class granule_iterator { + public: + granule_iterator(impl &fs, const rsdos_dirent &dirent); + bool next(u8 &granule, u16 &byte_count); + + private: + fsblk_t::block_t m_granule_map; + std::optional m_current_granule; + u8 m_maximum_granules; + u16 m_last_sector_bytes; + }; + + class file : public ifile_t { + public: + file(impl &fs, rsdos_dirent &&dirent); + virtual ~file() = default; + + virtual void drop_weak_references() override; + + virtual meta_data metadata() override; + virtual std::vector read_all() override; + + private: + impl &m_fs; + rsdos_dirent m_dirent; + }; + + impl(fsblk_t &blockdev); + virtual ~impl() = default; + + virtual meta_data metadata() override; + virtual dir_t root() override; + virtual void format(const meta_data &meta) override; + +private: + dir_t m_root; + + void drop_root_ref(); + fsblk_t::block_t read_sector(int track, int sector) const; + u8 maximum_granules() const; + static std::string get_filename_from_dirent(const rsdos_dirent &dirent); +}; + +// methods +bool validate_filename(std::string_view name); +}; + + +//------------------------------------------------- +// name +//------------------------------------------------- + +const char *fs::coco_rsdos_image::name() const { return "coco_rsdos"; } -const char *coco_rsdos_image::description() const + +//------------------------------------------------- +// description +//------------------------------------------------- + +const char *fs::coco_rsdos_image::description() const { return "CoCo RS-DOS"; } -void coco_rsdos_image::enumerate_f(floppy_enumerator &fe, u32 form_factor, const std::vector &variants) const + +//------------------------------------------------- +// enumerate_f +//------------------------------------------------- + +void fs::coco_rsdos_image::enumerate_f(floppy_enumerator &fe, u32 form_factor, const std::vector &variants) const { if (has(form_factor, variants, floppy_image::FF_525, floppy_image::SSDD)) { @@ -39,43 +141,80 @@ } } -bool coco_rsdos_image::can_format() const + +//------------------------------------------------- +// can_format +//------------------------------------------------- + +bool fs::coco_rsdos_image::can_format() const { - return false; + return true; } -bool coco_rsdos_image::can_read() const + +//------------------------------------------------- +// can_read +//------------------------------------------------- + +bool fs::coco_rsdos_image::can_read() const { return true; } -bool coco_rsdos_image::can_write() const + +//------------------------------------------------- +// can_write +//------------------------------------------------- + +bool fs::coco_rsdos_image::can_write() const { return false; } -bool coco_rsdos_image::has_rsrc() const + +//------------------------------------------------- +// has_rsrc +//------------------------------------------------- + +bool fs::coco_rsdos_image::has_rsrc() const { return false; } -std::vector coco_rsdos_image::file_meta_description() const + +//------------------------------------------------- +// file_meta_description +//------------------------------------------------- + +std::vector fs::coco_rsdos_image::file_meta_description() const { std::vector results; - results.emplace_back(meta_description(meta_name::name, meta_type::string, "", false, [](const meta_value &m) { return validate_filename(m.as_string()); }, "File name, 8.3")); - results.emplace_back(meta_description(meta_name::file_type, meta_type::number, 0, true, nullptr, "Type of the file")); - results.emplace_back(meta_description(meta_name::ascii_flag, meta_type::string, 0, true, nullptr, "Ascii or binary flag")); - results.emplace_back(meta_description(meta_name::size_in_blocks, meta_type::number, 0, true, nullptr, "Number of granules used by the file")); - results.emplace_back(meta_description(meta_name::length, meta_type::number, 0, true, nullptr, "Size of the file in bytes")); + results.emplace_back(meta_description(meta_name::name, "", false, [](const meta_value &m) { return validate_filename(m.as_string()); }, "File name, 8.3")); + results.emplace_back(meta_description(meta_name::file_type, 0, true, nullptr, "Type of the file")); + results.emplace_back(meta_description(meta_name::ascii_flag, "B", true, nullptr, "Ascii or binary flag")); + results.emplace_back(meta_description(meta_name::size_in_blocks, 0, true, nullptr, "Number of granules used by the file")); + results.emplace_back(meta_description(meta_name::length, 0, true, nullptr, "Size of the file in bytes")); return results; } -std::unique_ptr coco_rsdos_image::mount(fsblk_t &blockdev) const + +//------------------------------------------------- +// mount +//------------------------------------------------- + +std::unique_ptr fs::coco_rsdos_image::mount(fsblk_t &blockdev) const { return std::make_unique(blockdev); } -bool coco_rsdos_image::validate_filename(std::string_view name) + +//------------------------------------------------- +// validate_filename +//------------------------------------------------- + +namespace { + +bool validate_filename(std::string_view name) { auto pos = name.find('.'); auto stem_length = pos != std::string::npos ? pos : name.size(); @@ -83,60 +222,121 @@ return stem_length > 0 && stem_length <= 8 && ext_length <= 3; } -coco_rsdos_image::impl::impl(fsblk_t &blockdev) + +//------------------------------------------------- +// impl ctor +//------------------------------------------------- + +impl::impl(fsblk_t &blockdev) : filesystem_t(blockdev, 256) { } -meta_data coco_rsdos_image::impl::metadata() + +//------------------------------------------------- +// impl::metadata +//------------------------------------------------- + +meta_data impl::metadata() { return meta_data(); } -filesystem_t::dir_t coco_rsdos_image::impl::root() + +//------------------------------------------------- +// impl::root +//------------------------------------------------- + +filesystem_t::dir_t impl::root() { if (!m_root) m_root = new root_dir(*this); return m_root.strong(); } -void coco_rsdos_image::impl::drop_root_ref() + +//------------------------------------------------- +// impl::drop_root_ref +//------------------------------------------------- + +void impl::drop_root_ref() { m_root = nullptr; } -fsblk_t::block_t coco_rsdos_image::impl::read_sector(int track, int sector) const + +//------------------------------------------------- +// impl::format +//------------------------------------------------- + +void impl::format(const meta_data &meta) +{ + // formatting RS-DOS is easy - just fill everything with 0xFF + m_blockdev.fill(0xFF); +} + + +//------------------------------------------------- +// fsblk_t::block_t impl::read_sector +//------------------------------------------------- + +fsblk_t::block_t impl::read_sector(int track, int sector) const { // the CoCo RS-DOS world thinks in terms of tracks/sectors, but we have a block device // abstraction return m_blockdev.get(track * 18 + sector - 1); } -u8 coco_rsdos_image::impl::maximum_granules() const + +//------------------------------------------------- +// impl::maximum_granules +//------------------------------------------------- + +u8 impl::maximum_granules() const { u32 sector_count = m_blockdev.block_count(); u32 granule_count = (sector_count / 9) - 2; return granule_count <= 0xFF ? u8(granule_count) : 0xFF; } -std::string coco_rsdos_image::impl::get_filename_from_dirent(const rsdos_dirent &dirent) + +//------------------------------------------------- +// impl::get_filename_from_dirent +//------------------------------------------------- + +std::string impl::get_filename_from_dirent(const rsdos_dirent &dirent) { std::string_view stem = strtrimrightspace(std::string_view(&dirent.m_filename[0], 8)); std::string_view ext = strtrimrightspace(std::string_view(&dirent.m_filename[8], 3)); return util::string_format("%s.%s", stem, ext); } -void coco_rsdos_image::impl::root_dir::drop_weak_references() + +//------------------------------------------------- +// impl::root_dir::drop_weak_references +//------------------------------------------------- + +void impl::root_dir::drop_weak_references() { m_fs.drop_root_ref(); } -meta_data coco_rsdos_image::impl::root_dir::metadata() + +//------------------------------------------------- +// impl::root_dir::metadata +//------------------------------------------------- + +meta_data impl::root_dir::metadata() { return meta_data(); } -std::vector coco_rsdos_image::impl::root_dir::contents() + +//------------------------------------------------- +// impl::root_dir::contents +//------------------------------------------------- + +std::vector impl::root_dir::contents() { u64 key = 0; std::vector results; @@ -163,7 +363,12 @@ return results; } -filesystem_t::file_t coco_rsdos_image::impl::root_dir::file_get(u64 key) + +//------------------------------------------------- +// impl::root_dir::file_get +//------------------------------------------------- + +filesystem_t::file_t impl::root_dir::file_get(u64 key) { auto dir_block = m_fs.read_sector(17, 3 + key / 4); const rsdos_dirent_sector §or = *reinterpret_cast(dir_block.rodata()); @@ -171,12 +376,22 @@ return file_t(new file(m_fs, rsdos_dirent(ent))); } -filesystem_t::dir_t coco_rsdos_image::impl::root_dir::dir_get(u64 key) + +//------------------------------------------------- +// impl::root_dir::dir_get +//------------------------------------------------- + +filesystem_t::dir_t impl::root_dir::dir_get(u64 key) { throw std::logic_error("Directories not supported"); } -coco_rsdos_image::impl::granule_iterator::granule_iterator(impl &fs, const rsdos_dirent &dirent) + +//------------------------------------------------- +// impl::granule_iterator ctor +//------------------------------------------------- + +impl::granule_iterator::granule_iterator(impl &fs, const rsdos_dirent &dirent) : m_granule_map(fs.read_sector(17, 2)) , m_current_granule(dirent.m_first_granule) , m_maximum_granules(fs.maximum_granules()) @@ -184,7 +399,12 @@ { } -bool coco_rsdos_image::impl::granule_iterator::next(u8 &granule, u16 &byte_count) + +//------------------------------------------------- +// impl::granule_iterator::next +//------------------------------------------------- + +bool impl::granule_iterator::next(u8 &granule, u16 &byte_count) { bool success = false; granule = ~0; @@ -219,17 +439,32 @@ return success; } -coco_rsdos_image::impl::file::file(impl &fs, rsdos_dirent &&dirent) + +//------------------------------------------------- +// impl::file ctor +//------------------------------------------------- + +impl::file::file(impl &fs, rsdos_dirent &&dirent) : m_fs(fs) , m_dirent(std::move(dirent)) { } -void coco_rsdos_image::impl::file::drop_weak_references() + +//------------------------------------------------- +// impl::file::drop_weak_references +//------------------------------------------------- + +void impl::file::drop_weak_references() { } -meta_data coco_rsdos_image::impl::file::metadata() + +//------------------------------------------------- +// impl::file::metadata +//------------------------------------------------- + +meta_data impl::file::metadata() { u32 file_size = 0; int granule_count = 0; @@ -257,7 +492,12 @@ return result; } -std::vector coco_rsdos_image::impl::file::read_all() + +//------------------------------------------------- +// impl::file::read_all +//------------------------------------------------- + +std::vector impl::file::read_all() { std::vector result; @@ -294,4 +534,4 @@ return result; } -} // namespace fs +} diff -Nru mame-0.242+dfsg.1/src/lib/formats/fs_coco_rsdos.h mame-0.243+dfsg.1/src/lib/formats/fs_coco_rsdos.h --- mame-0.242+dfsg.1/src/lib/formats/fs_coco_rsdos.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/fs_coco_rsdos.h 2022-04-29 05:37:26.000000000 +0000 @@ -21,7 +21,7 @@ class coco_rsdos_image : public manager_t { public: - coco_rsdos_image() : manager_t() {} + coco_rsdos_image() = default; virtual const char *name() const override; virtual const char *description() const override; @@ -35,89 +35,9 @@ virtual bool has_rsrc() const override; virtual std::vector file_meta_description() const override; - -private: - class impl : public filesystem_t { - public: - class root_dir : public idir_t { - public: - root_dir(impl &i) : m_fs(i) {} - virtual ~root_dir() = default; - - virtual void drop_weak_references() override; - virtual meta_data metadata() override; - virtual std::vector contents() override; - virtual file_t file_get(u64 key) override; - virtual dir_t dir_get(u64 key) override; - - private: - impl &m_fs; - }; - - struct rsdos_dirent - { - char m_filename[11]; - u8 m_filetype; - u8 m_asciiflag; - u8 m_first_granule; - u8 m_last_sector_bytes_msb; - u8 m_last_sector_bytes_lsb; - }; - - struct rsdos_dirent_sector - { - struct - { - rsdos_dirent m_dirent; - u8 m_unused[16]; - } m_entries[4]; - }; - - class granule_iterator { - public: - granule_iterator(impl &fs, const rsdos_dirent &dirent); - bool next(u8 &granule, u16 &byte_count); - - private: - fsblk_t::block_t m_granule_map; - std::optional m_current_granule; - u8 m_maximum_granules; - u16 m_last_sector_bytes; - }; - - class file : public ifile_t { - public: - file(impl &fs, rsdos_dirent &&dirent); - virtual ~file() = default; - - virtual void drop_weak_references() override; - - virtual meta_data metadata() override; - virtual std::vector read_all() override; - - private: - impl & m_fs; - rsdos_dirent m_dirent; - }; - - impl(fsblk_t &blockdev); - virtual ~impl() = default; - - virtual meta_data metadata() override; - virtual dir_t root() override; - - private: - dir_t m_root; - - void drop_root_ref(); - fsblk_t::block_t read_sector(int track, int sector) const; - u8 maximum_granules() const; - static std::string get_filename_from_dirent(const rsdos_dirent &dirent); - }; - - static bool validate_filename(std::string_view name); }; + extern const coco_rsdos_image COCO_RSDOS; } // namespace fs diff -Nru mame-0.242+dfsg.1/src/lib/formats/fsd_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/fsd_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/fsd_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/fsd_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -88,20 +88,20 @@ return false; } -int fsd_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int fsd_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint8_t h[3]; size_t actual; io.read_at(0, h, 3, actual); if (memcmp(h, "FSD", 3) == 0) { - return 100; + return FIFID_SIGN; } LOG_FORMATS("fsd: no match\n"); return 0; } -bool fsd_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool fsd_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { const char* result[255]; result[0x00] = "OK"; @@ -190,4 +190,4 @@ return true; } -const floppy_format_type FLOPPY_FSD_FORMAT = &floppy_image_format_creator; +const fsd_format FLOPPY_FSD_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/fsd_dsk.h mame-0.243+dfsg.1/src/lib/formats/fsd_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/fsd_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/fsd_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -33,10 +33,10 @@ virtual const char *extensions() const override; virtual bool supports_save() const override; - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; }; -extern const floppy_format_type FLOPPY_FSD_FORMAT; +extern const fsd_format FLOPPY_FSD_FORMAT; #endif // MAME_FORMATS_FSD_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/fsmeta.cpp mame-0.243+dfsg.1/src/lib/formats/fsmeta.cpp --- mame-0.242+dfsg.1/src/lib/formats/fsmeta.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/fsmeta.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -7,6 +7,8 @@ #include "strformat.h" +#include + namespace fs { const char *meta_data::entry_name(meta_name name) @@ -32,20 +34,49 @@ return ""; } -std::string meta_value::to_string(meta_type type, const meta_value &m) +template struct overloaded : Ts... { using Ts::operator()...; }; +template overloaded(Ts...)->overloaded; + +meta_type meta_value::type() const { - switch(type) { - case meta_type::string: return m.as_string(); - case meta_type::number: return util::string_format("0x%x", m.as_number()); - case meta_type::flag: return m.as_flag() ? "t" : "f"; - case meta_type::date: { - auto dt = m.as_date(); - return util::string_format("%04d-%02d-%02d %02d:%02d:%02d", - dt.year, dt.month, dt.day_of_month, - dt.hour, dt.minute, dt.second); - } + std::optional result; + std::visit(overloaded + { + [&result](const std::string &) { result = meta_type::string; }, + [&result](std::uint64_t) { result = meta_type::number; }, + [&result](bool) { result = meta_type::flag; }, + [&result](const util::arbitrary_datetime &) { result = meta_type::date; } + }, value); + return *result; +} + +std::string meta_value::to_string() const +{ + std::string result; + + switch (type()) + { + case meta_type::string: + result = as_string(); + break; + case meta_type::number: + result = util::string_format("0x%x", as_number()); + break; + case meta_type::flag: + result = as_flag() ? "t" : "f"; + break; + case meta_type::date: + { + auto dt = as_date(); + result = util::string_format("%04d-%02d-%02d %02d:%02d:%02d", + dt.year, dt.month, dt.day_of_month, + dt.hour, dt.minute, dt.second); + } + break; + default: + throw false; } - return std::string(""); + return result; } } // namespace fs diff -Nru mame-0.242+dfsg.1/src/lib/formats/fsmeta.h mame-0.243+dfsg.1/src/lib/formats/fsmeta.h --- mame-0.242+dfsg.1/src/lib/formats/fsmeta.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/fsmeta.h 2022-04-29 05:37:26.000000000 +0000 @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -46,11 +47,14 @@ class meta_value { public: - static std::string to_string(meta_type type, const meta_value &m); + meta_type type() const; + std::string to_string() const; static meta_value from_string(meta_type type, std::string value); meta_value() { value = false; } - meta_value(std::string str) { value = str; } + meta_value(std::string &&str) { value = std::move(str); } + meta_value(std::string_view str) { value = std::string(str); } + meta_value(const char *str) { value = std::string(str); } meta_value(bool b) { value = b; } meta_value(int32_t num) { value = uint64_t(num); } meta_value(uint32_t num) { value = uint64_t(num); } @@ -77,7 +81,9 @@ bool empty() const { return meta.empty(); } void set(meta_name name, const meta_value &val) { meta[name] = val; } - void set(meta_name name, std::string str) { set(name, meta_value(str)); } + void set(meta_name name, meta_value &&val) { meta[name] = std::move(val); } + void set(meta_name name, std::string &&str) { set(name, meta_value(std::move(str))); } + void set(meta_name name, std::string_view str) { set(name, meta_value(str)); } void set(meta_name name, bool b) { set(name, meta_value(b)); } void set(meta_name name, int32_t num) { set(name, meta_value(num)); } void set(meta_name name, uint32_t num) { set(name, meta_value(num)); } @@ -95,18 +101,18 @@ struct meta_description { meta_name m_name; - meta_type m_type; meta_value m_default; bool m_ro; - std::function m_validator; + std::function m_validator; const char *m_tooltip; - meta_description(meta_name name, meta_type type, int def, bool ro, std::function validator, const char *tooltip) : - m_name(name), m_type(type), m_default(uint64_t(def)), m_ro(ro), m_validator(validator), m_tooltip(tooltip) + template meta_description(meta_name name, T def, bool ro, std::function validator, const char *tooltip) : + meta_description(name, meta_value(def), ro, std::move(validator), tooltip) {} - template meta_description(meta_name name, meta_type type, T def, bool ro, std::function validator, const char *tooltip) : - m_name(name), m_type(type), m_default(def), m_ro(ro), m_validator(validator), m_tooltip(tooltip) +private: + meta_description(meta_name name, meta_value &&def, bool ro, std::function &&validator, const char *tooltip) : + m_name(name), m_default(std::move(def)), m_ro(ro), m_validator(validator), m_tooltip(tooltip) {} }; diff -Nru mame-0.242+dfsg.1/src/lib/formats/fsmgr.h mame-0.243+dfsg.1/src/lib/formats/fsmgr.h --- mame-0.242+dfsg.1/src/lib/formats/fsmgr.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/fsmgr.h 2022-04-29 05:37:26.000000000 +0000 @@ -311,7 +311,7 @@ struct floppy_enumerator { virtual ~floppy_enumerator() = default; - virtual void add(floppy_format_type type, u32 image_size, const char *name, const char *description) = 0; + virtual void add(const floppy_image_format_t &type, u32 image_size, const char *name, const char *description) = 0; virtual void add_raw(const char *name, u32 key, const char *description) = 0; }; diff -Nru mame-0.242+dfsg.1/src/lib/formats/fs_oric_jasmin.cpp mame-0.243+dfsg.1/src/lib/formats/fs_oric_jasmin.cpp --- mame-0.242+dfsg.1/src/lib/formats/fs_oric_jasmin.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/fs_oric_jasmin.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -8,9 +8,10 @@ #include -namespace fs { +using namespace fs; + +namespace fs { const oric_jasmin_image ORIC_JASMIN; } -const oric_jasmin_image ORIC_JASMIN; // Floppy only, format is 41 tracks, 1/2 heads, 17 sectors. // Filesystem has no subdirectories. @@ -44,58 +45,97 @@ // offset 04-05: length of the file in bytes on the first sector, ffff otherwise // offset 06+ : reference to data sectors, (ff, ff) when done -const char *oric_jasmin_image::name() const -{ - return "oric_jasmin"; -} - -const char *oric_jasmin_image::description() const -{ - return "Oric Jasmin"; -} - -void oric_jasmin_image::enumerate_f(floppy_enumerator &fe, u32 form_factor, const std::vector &variants) const -{ - if(has(form_factor, variants, floppy_image::FF_3, floppy_image::DSDD)) - fe.add(FLOPPY_ORIC_JASMIN_FORMAT, 356864, "oric_jasmin_ds", "Oric Jasmin dual-sided"); - if(has(form_factor, variants, floppy_image::FF_3, floppy_image::SSDD)) - fe.add(FLOPPY_ORIC_JASMIN_FORMAT, 178432, "oric_jasmin_ss", "Oric Jasmin single-sided"); -} - -std::unique_ptr oric_jasmin_image::mount(fsblk_t &blockdev) const -{ - return std::make_unique(blockdev); -} - -bool oric_jasmin_image::can_format() const -{ - return true; -} - -bool oric_jasmin_image::can_read() const -{ - return true; -} - -bool oric_jasmin_image::can_write() const -{ - return true; -} - -bool oric_jasmin_image::has_rsrc() const -{ - return false; -} - -std::vector oric_jasmin_image::volume_meta_description() const -{ - std::vector res; - res.emplace_back(meta_description(meta_name::name, meta_type::string, "UNTITLED", false, [](const meta_value &m) { return m.as_string().size() <= 8; }, "Volume name, up to 8 characters")); - - return res; +namespace { +class impl : public filesystem_t { +public: + impl(fsblk_t &blockdev); + virtual ~impl() = default; + + virtual void format(const meta_data &meta) override; + virtual meta_data metadata() override; + virtual void metadata_change(const meta_data &info) override; + virtual dir_t root() override; + + static u32 cs_to_block(u16 ref); + [[maybe_unused]] static u16 block_to_cs(u32 block); + + bool ref_valid(u16 ref); + static std::string read_file_name(const u8 *p); + void drop_root_ref(); + + std::vector allocate_blocks(u32 count); + void free_blocks(const std::vector &blocks); + u32 free_block_count(); + + static std::string file_name_prepare(std::string name); + +private: + dir_t m_root; + + class root_dir : public idir_t { + public: + root_dir(impl &i) : m_fs(i) {} + virtual ~root_dir() = default; + + virtual void drop_weak_references() override; + + virtual meta_data metadata() override; + virtual void metadata_change(const meta_data &info) override; + virtual std::vector contents() override; + virtual file_t file_get(u64 key) override; + virtual dir_t dir_get(u64 key) override; + virtual file_t file_create(const meta_data &info) override; + virtual void file_delete(u64 key) override; + + void update_file(u16 key, const u8 *entry); + + private: + impl &m_fs; + + std::pair get_dir_block(u64 key); + }; + + class file : public impl::ifile_t { + public: + file(impl &fs, root_dir *dir, const u8 *entry, u16 key); + virtual ~file() = default; + + virtual void drop_weak_references() override; + + virtual meta_data metadata() override; + virtual void metadata_change(const meta_data &info) override; + virtual std::vector read_all() override; + virtual void replace(const std::vector &data) override; + + private: + impl &m_fs; + root_dir *m_dir; + u16 m_key; + u8 m_entry[18]; + }; + + class system_file : public impl::ifile_t { + public: + system_file(impl &fs, root_dir *dir, const u8 *entry, u16 key); + virtual ~system_file() = default; + + virtual void drop_weak_references() override; + + virtual meta_data metadata() override; + virtual void metadata_change(const meta_data &info) override; + virtual std::vector read_all() override; + virtual void replace(const std::vector &data) override; + + private: + impl &m_fs; + root_dir *m_dir; + u16 m_key; + u8 m_entry[18]; + }; +}; } -meta_data oric_jasmin_image::impl::metadata() +meta_data impl::metadata() { meta_data res; auto bdir = m_blockdev.get(20*17); @@ -119,17 +159,17 @@ std::vector oric_jasmin_image::file_meta_description() const { std::vector res; - res.emplace_back(meta_description(meta_name::name, meta_type::string, "", false, [](const meta_value &m) { return validate_filename(m.as_string()); }, "File name, 8.3")); - res.emplace_back(meta_description(meta_name::loading_address, meta_type::number, 0x501, false, [](const meta_value &m) { return m.as_number() < 0x10000; }, "Loading address of the file")); - res.emplace_back(meta_description(meta_name::length, meta_type::number, 0, true, nullptr, "Size of the file in bytes")); - res.emplace_back(meta_description(meta_name::size_in_blocks, meta_type::number, 0, true, nullptr, "Number of blocks used by the file")); - res.emplace_back(meta_description(meta_name::locked, meta_type::flag, false, false, nullptr, "File locked")); - res.emplace_back(meta_description(meta_name::sequential, meta_type::flag, true, false, nullptr, "File sequential")); + res.emplace_back(meta_description(meta_name::name, "", false, [](const meta_value &m) { return validate_filename(m.as_string()); }, "File name, 8.3")); + res.emplace_back(meta_description(meta_name::loading_address, 0x501, false, [](const meta_value &m) { return m.as_number() < 0x10000; }, "Loading address of the file")); + res.emplace_back(meta_description(meta_name::length, 0, true, nullptr, "Size of the file in bytes")); + res.emplace_back(meta_description(meta_name::size_in_blocks, 0, true, nullptr, "Number of blocks used by the file")); + res.emplace_back(meta_description(meta_name::locked, false, false, nullptr, "File locked")); + res.emplace_back(meta_description(meta_name::sequential, true, false, nullptr, "File sequential")); return res; } -void oric_jasmin_image::impl::format(const meta_data &meta) +void impl::format(const meta_data &meta) { std::string volume_name = meta.get_string(meta_name::name, "UNTITLED"); u32 blocks = m_blockdev.block_count(); @@ -163,11 +203,11 @@ bdir.w16l(2, 0x0000); } -oric_jasmin_image::impl::impl(fsblk_t &blockdev) : filesystem_t(blockdev, 256), m_root(true) +impl::impl(fsblk_t &blockdev) : filesystem_t(blockdev, 256), m_root(true) { } -bool oric_jasmin_image::impl::ref_valid(u16 ref) +bool impl::ref_valid(u16 ref) { u8 track = ref >> 8; u8 sector = ref & 0xff; @@ -178,21 +218,21 @@ return true; } -u32 oric_jasmin_image::impl::cs_to_block(u16 ref) +u32 impl::cs_to_block(u16 ref) { u8 track = ref >> 8; u8 sector = ref & 0xff; return track * 17 + sector - 1; } -u16 oric_jasmin_image::impl::block_to_cs(u32 block) +u16 impl::block_to_cs(u32 block) { u8 track = block / 17; u8 sector = (block % 17) + 1; return (track << 8) | sector; } -std::string oric_jasmin_image::impl::read_file_name(const u8 *p) +std::string impl::read_file_name(const u8 *p) { int main_len; for(main_len = 8; main_len > 0; main_len--) @@ -211,29 +251,29 @@ } -filesystem_t::dir_t oric_jasmin_image::impl::root() +filesystem_t::dir_t impl::root() { if(!m_root) m_root = new root_dir(*this); return m_root.strong(); } -void oric_jasmin_image::impl::drop_root_ref() +void impl::drop_root_ref() { m_root = nullptr; } -void oric_jasmin_image::impl::root_dir::drop_weak_references() +void impl::root_dir::drop_weak_references() { m_fs.drop_root_ref(); } -meta_data oric_jasmin_image::impl::root_dir::metadata() +meta_data impl::root_dir::metadata() { return meta_data(); } -std::vector oric_jasmin_image::impl::root_dir::contents() +std::vector impl::root_dir::contents() { std::vector res; @@ -261,7 +301,7 @@ return res; } -std::pair oric_jasmin_image::impl::root_dir::get_dir_block(u64 key) +std::pair impl::root_dir::get_dir_block(u64 key) { auto bdir = m_fs.m_blockdev.get(20*17+1); while(key >= 14) { @@ -274,7 +314,7 @@ return std::pair(bdir, 4 + key * 18); } -filesystem_t::file_t oric_jasmin_image::impl::root_dir::file_get(u64 key) +filesystem_t::file_t impl::root_dir::file_get(u64 key) { u64 rkey = key; auto [bdir, off] = get_dir_block(rkey); @@ -288,19 +328,19 @@ return file_t(new file(m_fs, this, bdir.rodata() + off, key)); } -void oric_jasmin_image::impl::root_dir::update_file(u16 key, const u8 *entry) +void impl::root_dir::update_file(u16 key, const u8 *entry) { u64 rkey = key; auto [bdir, off] = get_dir_block(rkey); bdir.copy(off, entry, 18); } -filesystem_t::dir_t oric_jasmin_image::impl::root_dir::dir_get(u64 key) +filesystem_t::dir_t impl::root_dir::dir_get(u64 key) { throw std::logic_error("Directories not supported"); } -std::string oric_jasmin_image::impl::file_name_prepare(std::string fname) +std::string impl::file_name_prepare(std::string fname) { std::string nname; size_t i; @@ -320,16 +360,16 @@ return nname; } -oric_jasmin_image::impl::file::file(impl &fs, root_dir *dir, const u8 *entry, u16 key) : m_fs(fs), m_dir(dir), m_key(key) +impl::file::file(impl &fs, root_dir *dir, const u8 *entry, u16 key) : m_fs(fs), m_dir(dir), m_key(key) { memcpy(m_entry, entry, 18); } -void oric_jasmin_image::impl::file::drop_weak_references() +void impl::file::drop_weak_references() { } -meta_data oric_jasmin_image::impl::file::metadata() +meta_data impl::file::metadata() { meta_data res; @@ -346,7 +386,7 @@ return res; } -std::vector oric_jasmin_image::impl::file::read_all() +std::vector impl::file::read_all() { std::vector data; u16 ref = r16b(m_entry); @@ -374,16 +414,16 @@ return data; } -oric_jasmin_image::impl::system_file::system_file(impl &fs, root_dir *dir, const u8 *entry, u16 key) : m_fs(fs), m_dir(dir), m_key(key) +impl::system_file::system_file(impl &fs, root_dir *dir, const u8 *entry, u16 key) : m_fs(fs), m_dir(dir), m_key(key) { memcpy(m_entry, entry, 18); } -void oric_jasmin_image::impl::system_file::drop_weak_references() +void impl::system_file::drop_weak_references() { } -meta_data oric_jasmin_image::impl::system_file::metadata() +meta_data impl::system_file::metadata() { meta_data res; @@ -396,7 +436,7 @@ return res; } -std::vector oric_jasmin_image::impl::system_file::read_all() +std::vector impl::system_file::read_all() { std::vector data(0x3e00); for(u32 i = 0; i != 62; i++) { @@ -406,7 +446,7 @@ return data; } -oric_jasmin_image::impl::file_t oric_jasmin_image::impl::root_dir::file_create(const meta_data &info) +impl::file_t impl::root_dir::file_create(const meta_data &info) { // One block of sector list, one block of data u32 nb = 2; @@ -460,11 +500,11 @@ -void oric_jasmin_image::impl::root_dir::file_delete(u64 key) +void impl::root_dir::file_delete(u64 key) { } -void oric_jasmin_image::impl::file::replace(const std::vector &data) +void impl::file::replace(const std::vector &data) { u32 cur_ns = r16l(m_entry + 0x10); // Data sectors first @@ -523,11 +563,11 @@ m_dir->update_file(m_key, m_entry); } -void oric_jasmin_image::impl::root_dir::metadata_change(const meta_data &info) +void impl::root_dir::metadata_change(const meta_data &info) { } -void oric_jasmin_image::impl::metadata_change(const meta_data &info) +void impl::metadata_change(const meta_data &info) { if(info.has(meta_name::name)) { std::string volume_name = info.get_string(meta_name::name); @@ -536,7 +576,7 @@ } } -void oric_jasmin_image::impl::file::metadata_change(const meta_data &info) +void impl::file::metadata_change(const meta_data &info) { if(info.has(meta_name::locked)) w8 (m_entry+0x02, info.get_flag(meta_name::locked) ? 'L' : 'U'); @@ -549,7 +589,7 @@ m_dir->update_file(m_key, m_entry); } -void oric_jasmin_image::impl::system_file::replace(const std::vector &data) +void impl::system_file::replace(const std::vector &data) { if(data.size() != 0x3e00) return; @@ -558,7 +598,7 @@ m_fs.m_blockdev.get(i).copy(0, data.data() + i * 256, 256); } -void oric_jasmin_image::impl::system_file::metadata_change(const meta_data &info) +void impl::system_file::metadata_change(const meta_data &info) { if(info.has(meta_name::locked)) w8 (m_entry+0x02, info.get_flag(meta_name::locked) ? 'L' : 'U'); @@ -571,7 +611,7 @@ m_dir->update_file(m_key, m_entry); } -std::vector oric_jasmin_image::impl::allocate_blocks(u32 count) +std::vector impl::allocate_blocks(u32 count) { std::vector blocks; if(free_block_count() < count) @@ -596,7 +636,7 @@ return blocks; } -void oric_jasmin_image::impl::free_blocks(const std::vector &blocks) +void impl::free_blocks(const std::vector &blocks) { auto fmap = m_blockdev.get(20*17); for(u16 ref : blocks) { @@ -610,7 +650,7 @@ } } -u32 oric_jasmin_image::impl::free_block_count() +u32 impl::free_block_count() { auto fmap = m_blockdev.get(20*17); u32 nf = 0; @@ -625,4 +665,53 @@ return nf; } -} // namespace fs +const char *oric_jasmin_image::name() const +{ + return "oric_jasmin"; +} + +const char *oric_jasmin_image::description() const +{ + return "Oric Jasmin"; +} + +void oric_jasmin_image::enumerate_f(floppy_enumerator &fe, u32 form_factor, const std::vector &variants) const +{ + if(has(form_factor, variants, floppy_image::FF_3, floppy_image::DSDD)) + fe.add(FLOPPY_ORIC_JASMIN_FORMAT, 356864, "oric_jasmin_ds", "Oric Jasmin dual-sided"); + if(has(form_factor, variants, floppy_image::FF_3, floppy_image::SSDD)) + fe.add(FLOPPY_ORIC_JASMIN_FORMAT, 178432, "oric_jasmin_ss", "Oric Jasmin single-sided"); +} + +std::unique_ptr oric_jasmin_image::mount(fsblk_t &blockdev) const +{ + return std::make_unique(blockdev); +} + +bool oric_jasmin_image::can_format() const +{ + return true; +} + +bool oric_jasmin_image::can_read() const +{ + return true; +} + +bool oric_jasmin_image::can_write() const +{ + return true; +} + +bool oric_jasmin_image::has_rsrc() const +{ + return false; +} + +std::vector oric_jasmin_image::volume_meta_description() const +{ + std::vector res; + res.emplace_back(meta_description(meta_name::name, "UNTITLED", false, [](const meta_value &m) { return m.as_string().size() <= 8; }, "Volume name, up to 8 characters")); + + return res; +} diff -Nru mame-0.242+dfsg.1/src/lib/formats/fs_oric_jasmin.h mame-0.243+dfsg.1/src/lib/formats/fs_oric_jasmin.h --- mame-0.242+dfsg.1/src/lib/formats/fs_oric_jasmin.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/fs_oric_jasmin.h 2022-04-29 05:37:26.000000000 +0000 @@ -14,94 +14,6 @@ class oric_jasmin_image : public manager_t { public: - class impl : public filesystem_t { - public: - class root_dir : public idir_t { - public: - root_dir(impl &i) : m_fs(i) {} - virtual ~root_dir() = default; - - virtual void drop_weak_references() override; - - virtual meta_data metadata() override; - virtual void metadata_change(const meta_data &info) override; - virtual std::vector contents() override; - virtual file_t file_get(u64 key) override; - virtual dir_t dir_get(u64 key) override; - virtual file_t file_create(const meta_data &info) override; - virtual void file_delete(u64 key) override; - - void update_file(u16 key, const u8 *entry); - - private: - impl &m_fs; - - std::pair get_dir_block(u64 key); - }; - - class file : public ifile_t { - public: - file(impl &fs, root_dir *dir, const u8 *entry, u16 key); - virtual ~file() = default; - - virtual void drop_weak_references() override; - - virtual meta_data metadata() override; - virtual void metadata_change(const meta_data &info) override; - virtual std::vector read_all() override; - virtual void replace(const std::vector &data) override; - - private: - impl &m_fs; - root_dir *m_dir; - u16 m_key; - u8 m_entry[18]; - }; - - class system_file : public ifile_t { - public: - system_file(impl &fs, root_dir *dir, const u8 *entry, u16 key); - virtual ~system_file() = default; - - virtual void drop_weak_references() override; - - virtual meta_data metadata() override; - virtual void metadata_change(const meta_data &info) override; - virtual std::vector read_all() override; - virtual void replace(const std::vector &data) override; - - private: - impl &m_fs; - root_dir *m_dir; - u16 m_key; - u8 m_entry[18]; - }; - - impl(fsblk_t &blockdev); - virtual ~impl() = default; - - virtual void format(const meta_data &meta) override; - virtual meta_data metadata() override; - virtual void metadata_change(const meta_data &info) override; - virtual dir_t root() override; - - static u32 cs_to_block(u16 ref); - static u16 block_to_cs(u32 block); - - bool ref_valid(u16 ref); - static std::string read_file_name(const u8 *p); - void drop_root_ref(); - - std::vector allocate_blocks(u32 count); - void free_blocks(const std::vector &blocks); - u32 free_block_count(); - - static std::string file_name_prepare(std::string name); - - private: - dir_t m_root; - }; - oric_jasmin_image() : manager_t() {} virtual const char *name() const override; diff -Nru mame-0.242+dfsg.1/src/lib/formats/fs_prodos.cpp mame-0.243+dfsg.1/src/lib/formats/fs_prodos.cpp --- mame-0.242+dfsg.1/src/lib/formats/fs_prodos.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/fs_prodos.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -10,10 +10,86 @@ #include +using namespace fs; -namespace fs { +namespace fs { const prodos_image PRODOS; } + +namespace { +class impl : public filesystem_t { +public: + impl(fsblk_t &blockdev); + virtual ~impl() = default; + + virtual void format(const meta_data &meta) override; + + virtual meta_data metadata() override; + virtual dir_t root() override; + + void drop_root_ref(); + + static util::arbitrary_datetime prodos_to_dt(u32 date); + std::vector contents(u16 block); + +private: + static const u8 boot[512]; + + dir_t m_root; + + class root_dir : public idir_t { + public: + root_dir(impl &fs, u16 base_block) : m_fs(fs), m_base_block(base_block) { } + virtual ~root_dir() = default; + + virtual void drop_weak_references() override; + + virtual meta_data metadata() override; + virtual std::vector contents() override; + virtual file_t file_get(u64 key) override; + virtual dir_t dir_get(u64 key) override; + + protected: + impl &m_fs; + u16 m_base_block; + + std::pair get_entry_ro(u64 key); + [[maybe_unused]] std::pair get_entry(u64 key); + }; + + class dir : public root_dir { + public: + dir(impl &fs, const u8 *entry, u16 base_block, u16 key, root_dir *parent_dir); + virtual ~dir() = default; + + virtual meta_data metadata() override; + + protected: + root_dir *m_parent_dir; + u16 m_key; + u8 m_entry[39]; + }; + + class file : public ifile_t { + public: + file(impl &fs, const u8 *entry, u16 key, root_dir *parent_dir); + virtual ~file() = default; + + virtual void drop_weak_references() override; + + virtual meta_data metadata() override; + virtual std::vector read_all() override; + virtual std::vector rsrc_read_all() override; + + private: + impl &m_fs; + root_dir *m_parent_dir; + u16 m_key; + u8 m_entry[39]; + + std::vector any_read_all(u8 type, u16 block, u32 length); + }; +}; +} -const prodos_image PRODOS; const char *prodos_image::name() const { @@ -25,7 +101,7 @@ return "Apple ProDOS"; } -const u8 prodos_image::impl::boot[512] = { +const u8 impl::boot[512] = { 0x01, 0x38, 0xb0, 0x03, 0x4c, 0x1c, 0x09, 0x78, 0x86, 0x43, 0xc9, 0x03, 0x08, 0x8a, 0x29, 0x70, 0x4a, 0x4a, 0x4a, 0x4a, 0x09, 0xc0, 0x85, 0x49, 0xa0, 0xff, 0x84, 0x48, 0x28, 0xc8, 0xb1, 0x48, 0xd0, 0x3a, 0xb0, 0x0e, 0xa9, 0x03, 0x8d, 0x00, 0x08, 0xe6, 0x3d, 0xa5, 0x49, 0x48, 0xa9, 0x5b, @@ -101,45 +177,45 @@ std::vector prodos_image::volume_meta_description() const { std::vector res; - res.emplace_back(meta_description(meta_name::name, meta_type::string, "UNTITLED", false, [](const meta_value &m) { return m.as_string().size() <= 15; }, "Volume name, up to 15 characters")); - res.emplace_back(meta_description(meta_name::os_version, meta_type::number, 5, false, [](const meta_value &m) { return m.as_number() <= 255; }, "Creator OS version")); - res.emplace_back(meta_description(meta_name::os_minimum_version, meta_type::number, 5, false, [](const meta_value &m) { return m.as_number() <= 255; }, "Minimum OS version")); + res.emplace_back(meta_description(meta_name::name, "UNTITLED", false, [](const meta_value &m) { return m.as_string().size() <= 15; }, "Volume name, up to 15 characters")); + res.emplace_back(meta_description(meta_name::os_version, 5, false, [](const meta_value &m) { return m.as_number() <= 255; }, "Creator OS version")); + res.emplace_back(meta_description(meta_name::os_minimum_version, 5, false, [](const meta_value &m) { return m.as_number() <= 255; }, "Minimum OS version")); auto now = util::arbitrary_datetime::now(); - res.emplace_back(meta_description(meta_name::creation_date, meta_type::date, now, false, nullptr, "Creation time")); - res.emplace_back(meta_description(meta_name::modification_date, meta_type::date, now, false, nullptr, "Modification time")); + res.emplace_back(meta_description(meta_name::creation_date, now, false, nullptr, "Creation time")); + res.emplace_back(meta_description(meta_name::modification_date, now, false, nullptr, "Modification time")); return res; } std::vector prodos_image::file_meta_description() const { std::vector res; - res.emplace_back(meta_description(meta_name::name, meta_type::string, "Empty file", false, [](const meta_value &m) { return m.as_string().size() <= 15; }, "File name, up to 15 characters")); - res.emplace_back(meta_description(meta_name::length, meta_type::number, 0, true, nullptr, "Size of the file in bytes")); - res.emplace_back(meta_description(meta_name::rsrc_length, meta_type::number, 0, true, nullptr, "Size of the resource fork in bytes")); - res.emplace_back(meta_description(meta_name::os_version, meta_type::number, 5, false, [](const meta_value &m) { return m.as_number() <= 255; }, "Creator OS version")); - res.emplace_back(meta_description(meta_name::os_minimum_version, meta_type::number, 5, false, [](const meta_value &m) { return m.as_number() <= 255; }, "Minimum OS version")); + res.emplace_back(meta_description(meta_name::name, "Empty file", false, [](const meta_value &m) { return m.as_string().size() <= 15; }, "File name, up to 15 characters")); + res.emplace_back(meta_description(meta_name::length, 0, true, nullptr, "Size of the file in bytes")); + res.emplace_back(meta_description(meta_name::rsrc_length, 0, true, nullptr, "Size of the resource fork in bytes")); + res.emplace_back(meta_description(meta_name::os_version, 5, false, [](const meta_value &m) { return m.as_number() <= 255; }, "Creator OS version")); + res.emplace_back(meta_description(meta_name::os_minimum_version, 5, false, [](const meta_value &m) { return m.as_number() <= 255; }, "Minimum OS version")); auto now = util::arbitrary_datetime::now(); - res.emplace_back(meta_description(meta_name::creation_date, meta_type::date, now, false, nullptr, "Creation time")); - res.emplace_back(meta_description(meta_name::modification_date, meta_type::date, now, false, nullptr, "Modification time")); + res.emplace_back(meta_description(meta_name::creation_date, now, false, nullptr, "Creation time")); + res.emplace_back(meta_description(meta_name::modification_date, now, false, nullptr, "Modification time")); return res; } std::vector prodos_image::directory_meta_description() const { std::vector res; - res.emplace_back(meta_description(meta_name::name, meta_type::string, "Empty directory", false, [](const meta_value &m) { return m.as_string().size() <= 15; }, "Directory name, up to 15 characters")); - res.emplace_back(meta_description(meta_name::os_version, meta_type::number, 5, false, [](const meta_value &m) { return m.as_number() <= 255; }, "Creator OS version")); - res.emplace_back(meta_description(meta_name::os_minimum_version, meta_type::number, 5, false, [](const meta_value &m) { return m.as_number() <= 255; }, "Minimum OS version")); + res.emplace_back(meta_description(meta_name::name, "Empty directory", false, [](const meta_value &m) { return m.as_string().size() <= 15; }, "Directory name, up to 15 characters")); + res.emplace_back(meta_description(meta_name::os_version, 5, false, [](const meta_value &m) { return m.as_number() <= 255; }, "Creator OS version")); + res.emplace_back(meta_description(meta_name::os_minimum_version, 5, false, [](const meta_value &m) { return m.as_number() <= 255; }, "Minimum OS version")); auto now = util::arbitrary_datetime::now(); - res.emplace_back(meta_description(meta_name::creation_date, meta_type::date, now, false, nullptr, "Creation time")); - res.emplace_back(meta_description(meta_name::modification_date, meta_type::date, now, false, nullptr, "Modification time")); + res.emplace_back(meta_description(meta_name::creation_date, now, false, nullptr, "Creation time")); + res.emplace_back(meta_description(meta_name::modification_date, now, false, nullptr, "Modification time")); return res; } -void prodos_image::impl::format(const meta_data &meta) +void impl::format(const meta_data &meta) { std::string volume_name = meta.get_string(meta_name::name, "UNTITLED"); u32 blocks = m_blockdev.block_count(); @@ -205,11 +281,11 @@ } } -prodos_image::impl::impl(fsblk_t &blockdev) : filesystem_t(blockdev, 512), m_root(true) +impl::impl(fsblk_t &blockdev) : filesystem_t(blockdev, 512), m_root(true) { } -util::arbitrary_datetime prodos_image::impl::prodos_to_dt(u32 date) +util::arbitrary_datetime impl::prodos_to_dt(u32 date) { util::arbitrary_datetime dt; dt.second = 0; @@ -224,7 +300,7 @@ return dt; } -meta_data prodos_image::impl::metadata() +meta_data impl::metadata() { meta_data res; auto bdir = m_blockdev.get(2); @@ -237,31 +313,31 @@ return res; } -filesystem_t::dir_t prodos_image::impl::root() +filesystem_t::dir_t impl::root() { if(!m_root) m_root = new root_dir(*this, 2); return m_root.strong(); } -void prodos_image::impl::drop_root_ref() +void impl::drop_root_ref() { m_root = nullptr; } -void prodos_image::impl::root_dir::drop_weak_references() +void impl::root_dir::drop_weak_references() { if(m_base_block == 2) m_fs.drop_root_ref(); } -meta_data prodos_image::impl::root_dir::metadata() +meta_data impl::root_dir::metadata() { return meta_data(); } -std::vector prodos_image::impl::root_dir::contents() +std::vector impl::root_dir::contents() { std::vector res; @@ -290,7 +366,7 @@ } -std::pair prodos_image::impl::root_dir::get_entry_ro(u64 key) +std::pair impl::root_dir::get_entry_ro(u64 key) { std::pair res; res.first = m_fs.m_blockdev.get(m_base_block); @@ -308,7 +384,7 @@ return res; } -std::pair prodos_image::impl::root_dir::get_entry(u64 key) +std::pair impl::root_dir::get_entry(u64 key) { std::pair res; res.first = m_fs.m_blockdev.get(m_base_block); @@ -326,7 +402,7 @@ return res; } -filesystem_t::file_t prodos_image::impl::root_dir::file_get(u64 key) +filesystem_t::file_t impl::root_dir::file_get(u64 key) { auto [blk, entry] = get_entry_ro(key); if(!blk) @@ -337,7 +413,7 @@ return new file(m_fs, entry, key, this); } -filesystem_t::dir_t prodos_image::impl::root_dir::dir_get(u64 key) +filesystem_t::dir_t impl::root_dir::dir_get(u64 key) { auto [blk, entry] = get_entry_ro(key); if(!blk) @@ -349,25 +425,25 @@ return new dir(m_fs, entry, r16l(entry+0x11), key, this); } -prodos_image::impl::dir::dir(impl &fs, const u8 *entry, u16 base_block, u16 key, root_dir *parent_dir) : root_dir(fs, base_block), m_parent_dir(parent_dir), m_key(key) +impl::dir::dir(impl &fs, const u8 *entry, u16 base_block, u16 key, root_dir *parent_dir) : root_dir(fs, base_block), m_parent_dir(parent_dir), m_key(key) { memcpy(m_entry, entry, 39); (void)m_key; (void)m_parent_dir; } -prodos_image::impl::file::file(impl &fs, const u8 *entry, u16 key, root_dir *parent_dir) : m_fs(fs), m_parent_dir(parent_dir), m_key(key) +impl::file::file(impl &fs, const u8 *entry, u16 key, root_dir *parent_dir) : m_fs(fs), m_parent_dir(parent_dir), m_key(key) { memcpy(m_entry, entry, 39); (void)m_key; (void)m_parent_dir; } -void prodos_image::impl::file::drop_weak_references() +void impl::file::drop_weak_references() { } -meta_data prodos_image::impl::file::metadata() +meta_data impl::file::metadata() { meta_data res; u8 type = r8(m_entry); @@ -383,12 +459,12 @@ res.set(meta_name::length, r24l(m_entry + 0x15)); else - throw std::runtime_error(util::string_format("prodos_image::impl::file::metadata: Unhandled file type %d", type)); + throw std::runtime_error(util::string_format("impl::file::metadata: Unhandled file type %d", type)); return res; } -meta_data prodos_image::impl::dir::metadata() +meta_data impl::dir::metadata() { meta_data res; u8 type = r8(m_entry); @@ -398,7 +474,7 @@ return res; } -std::vector prodos_image::impl::file::any_read_all(u8 type, u16 block, u32 length) +std::vector impl::file::any_read_all(u8 type, u16 block, u32 length) { std::vector data((length + 511) & ~511); u32 nb = data.size()/512; @@ -438,14 +514,14 @@ } default: - throw std::runtime_error(util::string_format("prodos_image::impl::file::get_file_blocks: unknown file type %d", type)); + throw std::runtime_error(util::string_format("impl::file::get_file_blocks: unknown file type %d", type)); } data.resize(length); return data; } -std::vector prodos_image::impl::file::read_all() +std::vector impl::file::read_all() { u8 type = r8(m_entry) >> 4; if(type >= 1 && type <= 3) @@ -456,10 +532,10 @@ return any_read_all(kblk.r8(0x000), kblk.r16l(0x001), kblk.r24l(0x005)); } else - throw std::runtime_error(util::string_format("prodos_image::impl::file::read_all: Unhandled file type %d", type)); + throw std::runtime_error(util::string_format("impl::file::read_all: Unhandled file type %d", type)); } -std::vector prodos_image::impl::file::rsrc_read_all() +std::vector impl::file::rsrc_read_all() { u8 type = r8(m_entry) >> 4; @@ -468,7 +544,5 @@ return any_read_all(kblk.r8(0x100), kblk.r16l(0x101), kblk.r24l(0x105)); } else - throw std::runtime_error(util::string_format("prodos_image::impl::file::rsrc_blocks: Unhandled file type %d", type)); + throw std::runtime_error(util::string_format("impl::file::rsrc_blocks: Unhandled file type %d", type)); } - -} // namespace fs diff -Nru mame-0.242+dfsg.1/src/lib/formats/fs_prodos.h mame-0.243+dfsg.1/src/lib/formats/fs_prodos.h --- mame-0.242+dfsg.1/src/lib/formats/fs_prodos.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/fs_prodos.h 2022-04-29 05:37:26.000000000 +0000 @@ -14,80 +14,6 @@ class prodos_image : public manager_t { public: - class impl : public filesystem_t { - public: - class root_dir : public idir_t { - public: - root_dir(impl &fs, u16 base_block) : m_fs(fs), m_base_block(base_block) { } - virtual ~root_dir() = default; - - virtual void drop_weak_references() override; - - virtual meta_data metadata() override; - virtual std::vector contents() override; - virtual file_t file_get(u64 key) override; - virtual dir_t dir_get(u64 key) override; - - protected: - impl &m_fs; - u16 m_base_block; - - std::pair get_entry_ro(u64 key); - std::pair get_entry(u64 key); - }; - - class dir : public root_dir { - public: - dir(impl &fs, const u8 *entry, u16 base_block, u16 key, root_dir *parent_dir); - virtual ~dir() = default; - - virtual meta_data metadata() override; - - protected: - root_dir *m_parent_dir; - u16 m_key; - u8 m_entry[39]; - }; - - class file : public ifile_t { - public: - file(impl &fs, const u8 *entry, u16 key, root_dir *parent_dir); - virtual ~file() = default; - - virtual void drop_weak_references() override; - - virtual meta_data metadata() override; - virtual std::vector read_all() override; - virtual std::vector rsrc_read_all() override; - - private: - impl &m_fs; - root_dir *m_parent_dir; - u16 m_key; - u8 m_entry[39]; - - std::vector any_read_all(u8 type, u16 block, u32 length); - }; - - impl(fsblk_t &blockdev); - virtual ~impl() = default; - - virtual void format(const meta_data &meta) override; - - virtual meta_data metadata() override; - virtual dir_t root() override; - - void drop_root_ref(); - - static util::arbitrary_datetime prodos_to_dt(u32 date); - std::vector contents(u16 block); - - private: - static const u8 boot[512]; - - dir_t m_root; - }; - prodos_image() : manager_t() {} virtual const char *name() const override; diff -Nru mame-0.242+dfsg.1/src/lib/formats/fs_vtech.cpp mame-0.243+dfsg.1/src/lib/formats/fs_vtech.cpp --- mame-0.242+dfsg.1/src/lib/formats/fs_vtech.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/fs_vtech.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -83,10 +83,10 @@ std::vector vtech_image::file_meta_description() const { std::vector res; - res.emplace_back(meta_description(meta_name::name, meta_type::string, "", false, [](const meta_value &m) { return m.as_string().size() <= 8; }, "File name, 8 chars")); - res.emplace_back(meta_description(meta_name::loading_address, meta_type::number, 0x7ae9, false, [](const meta_value &m) { return m.as_number() < 0x10000; }, "Loading address of the file")); - res.emplace_back(meta_description(meta_name::length, meta_type::number, 0, true, nullptr, "Size of the file in bytes")); - res.emplace_back(meta_description(meta_name::basic, meta_type::flag, true, true, nullptr, "Basic file")); + res.emplace_back(meta_description(meta_name::name, "", false, [](const meta_value &m) { return m.as_string().size() <= 8; }, "File name, 8 chars")); + res.emplace_back(meta_description(meta_name::loading_address, 0x7ae9, false, [](const meta_value &m) { return m.as_number() < 0x10000; }, "Loading address of the file")); + res.emplace_back(meta_description(meta_name::length, 0, true, nullptr, "Size of the file in bytes")); + res.emplace_back(meta_description(meta_name::basic, true, true, nullptr, "Basic file")); return res; } diff -Nru mame-0.242+dfsg.1/src/lib/formats/g64_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/g64_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/g64_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/g64_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -31,19 +31,19 @@ 3250 // 16MHz/13/4 }; -int g64_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int g64_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { char h[8]; size_t actual; io.read_at(0, h, 8, actual); if (!memcmp(h, G64_FORMAT_HEADER, 8)) - return 100; + return FIFID_SIGN; return 0; } -bool g64_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool g64_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { uint64_t size; if (io.length(size)) @@ -118,7 +118,7 @@ return ((actual_cell_size >= cell_size-10) && (actual_cell_size <= cell_size+10)) ? speed_zone : -1; } -bool g64_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) +bool g64_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const { uint8_t const zerofill[] = { 0x00, 0x00, 0x00, 0x00 }; std::vector const prefill(TRACK_LENGTH, 0xff); @@ -204,4 +204,4 @@ return "g64,g41,g71"; } -const floppy_format_type FLOPPY_G64_FORMAT = &floppy_image_format_creator; +const g64_format FLOPPY_G64_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/g64_dsk.h mame-0.243+dfsg.1/src/lib/formats/g64_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/g64_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/g64_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -20,9 +20,9 @@ public: g64_format(); - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; - virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; + virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const override; virtual const char *name() const override; virtual const char *description() const override; @@ -47,9 +47,9 @@ static const uint32_t c1541_cell_size[]; - int generate_bitstream(int track, int head, int speed_zone, std::vector &trackbuf, floppy_image *image); + static int generate_bitstream(int track, int head, int speed_zone, std::vector &trackbuf, floppy_image *image); }; -extern const floppy_format_type FLOPPY_G64_FORMAT; +extern const g64_format FLOPPY_G64_FORMAT; #endif // MAME_FORMATS_G64_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/guab_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/guab_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/guab_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/guab_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -39,4 +39,4 @@ {} }; -const floppy_format_type FLOPPY_GUAB_FORMAT = &floppy_image_format_creator; +const guab_format FLOPPY_GUAB_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/guab_dsk.h mame-0.243+dfsg.1/src/lib/formats/guab_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/guab_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/guab_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -27,6 +27,6 @@ static const format formats[]; }; -extern const floppy_format_type FLOPPY_GUAB_FORMAT; +extern const guab_format FLOPPY_GUAB_FORMAT; #endif // MAME_FORMATS_GUAB_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/hector_minidisc.cpp mame-0.243+dfsg.1/src/lib/formats/hector_minidisc.cpp --- mame-0.242+dfsg.1/src/lib/formats/hector_minidisc.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/hector_minidisc.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -38,4 +38,4 @@ {} }; -const floppy_format_type FLOPPY_HMD_FORMAT = &floppy_image_format_creator; +const hmd_format FLOPPY_HMD_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/hector_minidisc.h mame-0.243+dfsg.1/src/lib/formats/hector_minidisc.h --- mame-0.242+dfsg.1/src/lib/formats/hector_minidisc.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/hector_minidisc.h 2022-04-29 05:37:26.000000000 +0000 @@ -27,6 +27,6 @@ static const format formats[]; }; -extern const floppy_format_type FLOPPY_HMD_FORMAT; +extern const hmd_format FLOPPY_HMD_FORMAT; #endif // MAME_FORMATS_HECTOR_MINIDISC_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/hpi_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/hpi_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/hpi_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/hpi_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -81,7 +81,7 @@ (void)HPI_RED_IMAGE_SIZE; } -int hpi_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int hpi_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint64_t size; if (io.length(size)) { @@ -95,7 +95,7 @@ unsigned dummy_tracks; if (((form_factor == floppy_image::FF_8) || (form_factor == floppy_image::FF_UNKNOWN)) && geometry_from_size(size , dummy_heads , dummy_tracks)) { - return 50; + return FIFID_SIZE; } else { return 0; } @@ -148,7 +148,7 @@ } } -bool hpi_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool hpi_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { unsigned heads; unsigned cylinders; @@ -201,7 +201,7 @@ return true; } -bool hpi_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) +bool hpi_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const { int tracks; int heads; @@ -497,4 +497,4 @@ { 0x00 , 0x00 } // Interleave = 29 }; -const floppy_format_type FLOPPY_HPI_FORMAT = &floppy_image_format_creator; +const hpi_format FLOPPY_HPI_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/hpi_dsk.h mame-0.243+dfsg.1/src/lib/formats/hpi_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/hpi_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/hpi_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -28,9 +28,9 @@ public: hpi_format(); - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; - virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; + virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const override; virtual const char *name() const override; virtual const char *description() const override; virtual const char *extensions() const override; @@ -40,19 +40,19 @@ typedef std::array sector_list_t; static bool geometry_from_size(uint64_t image_size , unsigned& heads , unsigned& tracks); static void interleaved_sectors(unsigned il_factor , sector_list_t& sector_list); - void write_mmfm_bit(std::vector &buffer , bool data_bit , bool clock_bit); - void write_mmfm_byte(std::vector &buffer , uint8_t data , uint8_t clock = 0); - void write_sync(std::vector &buffer); - void write_crc(std::vector &buffer , uint16_t crc); - void write_sector(std::vector &buffer , uint8_t track_no , uint8_t sect_head_no , const uint8_t *sect_data); - void fill_with_gap3(std::vector &buffer); + static void write_mmfm_bit(std::vector &buffer , bool data_bit , bool clock_bit); + static void write_mmfm_byte(std::vector &buffer , uint8_t data , uint8_t clock = 0); + static void write_sync(std::vector &buffer); + static void write_crc(std::vector &buffer , uint16_t crc); + static void write_sector(std::vector &buffer , uint8_t track_no , uint8_t sect_head_no , const uint8_t *sect_data); + static void fill_with_gap3(std::vector &buffer); static unsigned chs_to_lba(unsigned cylinder , unsigned head , unsigned sector , unsigned heads); - std::vector get_next_id_n_block(const std::vector &bitstream , int& pos , int& start_pos); - bool get_next_sector(const std::vector &bitstream , int& pos , unsigned& track , unsigned& head , unsigned& sector , uint8_t *sector_data); + static std::vector get_next_id_n_block(const std::vector &bitstream , int& pos , int& start_pos); + static bool get_next_sector(const std::vector &bitstream , int& pos , unsigned& track , unsigned& head , unsigned& sector , uint8_t *sector_data); static const uint8_t m_track_skew[ HPI_SECTORS - 1 ][ HPI_HEADS ]; }; -extern const floppy_format_type FLOPPY_HPI_FORMAT; +extern const hpi_format FLOPPY_HPI_FORMAT; #endif // MAME_FORMATS_HPI_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/hp_ipc_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/hp_ipc_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/hp_ipc_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/hp_ipc_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -36,5 +36,5 @@ {} }; -const floppy_format_type FLOPPY_HP_IPC_FORMAT = &floppy_image_format_creator; +const hp_ipc_format FLOPPY_HP_IPC_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/hp_ipc_dsk.h mame-0.243+dfsg.1/src/lib/formats/hp_ipc_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/hp_ipc_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/hp_ipc_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -27,6 +27,6 @@ static const format formats[]; }; -extern const floppy_format_type FLOPPY_HP_IPC_FORMAT; +extern const hp_ipc_format FLOPPY_HP_IPC_FORMAT; #endif // MAME_FORMATS_HP_IPC_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/hxchfe_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/hxchfe_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/hxchfe_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/hxchfe_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -111,21 +111,7 @@ #define HEADER_LENGTH 512 #define TRACK_TABLE_LENGTH 1024 -hfe_format::hfe_format() : floppy_image_format_t(), - m_cylinders(0), - m_heads(0), - m_track_encoding(UNKNOWN_ENCODING), - m_bit_rate(0), - m_floppy_rpm(0), - m_interface_mode(DISABLE_FLOPPYMODE), - m_write_allowed(true), - m_single_step(true), - m_track0s0_has_altencoding(false), - m_track0s0_encoding(UNKNOWN_ENCODING), - m_track0s1_has_altencoding(false), - m_track0s1_encoding(UNKNOWN_ENCODING), - m_selected_mode(DISABLE_FLOPPYMODE), - m_selected_encoding(UNKNOWN_ENCODING) +hfe_format::hfe_format() : floppy_image_format_t() { } @@ -146,26 +132,27 @@ bool hfe_format::supports_save() const { - return true; + return false; } -int hfe_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int hfe_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint8_t header[8]; size_t actual; io.read_at(0, &header, sizeof(header), actual); if ( memcmp( header, HFE_FORMAT_HEADER, 8 ) ==0) { - return 100; + return FIFID_SIGN; } return 0; } -bool hfe_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool hfe_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { size_t actual; uint8_t header[HEADER_LENGTH]; uint8_t track_table[TRACK_TABLE_LENGTH]; + header_info info; int drivecyl, driveheads; image->get_maximal_geometry(drivecyl, driveheads); @@ -181,101 +168,101 @@ return false; } - m_cylinders = header[9] & 0xff; - m_heads = header[10] & 0xff; + info.m_cylinders = header[9] & 0xff; + info.m_heads = header[10] & 0xff; - if (drivecyl < m_cylinders) + if (drivecyl < info.m_cylinders) { - if (m_cylinders - drivecyl > DUMP_THRESHOLD) + if (info.m_cylinders - drivecyl > DUMP_THRESHOLD) { - osd_printf_error("hxchfe: Floppy disk has too many tracks for this drive (floppy tracks=%d, drive tracks=%d).\n", m_cylinders, drivecyl); + osd_printf_error("hxchfe: Floppy disk has too many tracks for this drive (floppy tracks=%d, drive tracks=%d).\n", info.m_cylinders, drivecyl); return false; } else { // Some dumps has a few excess tracks to be safe, // lets be nice and just skip those tracks - osd_printf_warning("hxchfe: Floppy disk has a slight excess of tracks for this drive that will be discarded (floppy tracks=%d, drive tracks=%d).\n", m_cylinders, drivecyl); - m_cylinders = drivecyl; + osd_printf_warning("hxchfe: Floppy disk has a slight excess of tracks for this drive that will be discarded (floppy tracks=%d, drive tracks=%d).\n", info.m_cylinders, drivecyl); + info.m_cylinders = drivecyl; } } - if (m_cylinders <= drivecyl/2) + if (info.m_cylinders <= drivecyl/2) { - osd_printf_error("hxchfe: Double stepping not yet supported (floppy tracks=%d, drive tracks=%d).\n", m_cylinders, drivecyl); + osd_printf_error("hxchfe: Double stepping not yet supported (floppy tracks=%d, drive tracks=%d).\n", info.m_cylinders, drivecyl); return false; } - m_track_encoding = (encoding_t)(header[11] & 0xff); + info.m_track_encoding = (encoding_t)(header[11] & 0xff); - if (m_track_encoding > EMU_FM_ENCODING) + if (info.m_track_encoding > EMU_FM_ENCODING) { - osd_printf_error("hxchfe: Unknown track encoding %d.\n", m_track_encoding); + osd_printf_error("hxchfe: Unknown track encoding %d.\n", info.m_track_encoding); return false; } - m_bit_rate = (header[12] & 0xff) | ((header[13] & 0xff)<<8); + info.m_bit_rate = (header[12] & 0xff) | ((header[13] & 0xff)<<8); - if (m_bit_rate > 500) + if (info.m_bit_rate > 500) { - osd_printf_error("hxchfe: Unsupported bit rate %d.\n", m_bit_rate); + osd_printf_error("hxchfe: Unsupported bit rate %d.\n", info.m_bit_rate); return false; } - int samplelength = 500000 / m_bit_rate; + int samplelength = 500000 / info.m_bit_rate; // Not used in the HxC emulator - m_floppy_rpm = (header[14] & 0xff) | ((header[15] & 0xff)<<8); + info.m_floppy_rpm = (header[14] & 0xff) | ((header[15] & 0xff)<<8); - m_interface_mode = (floppymode_t)(header[16] & 0xff); - if (m_interface_mode > S950_HD_FLOPPYMODE) + info.m_interface_mode = (floppymode_t)(header[16] & 0xff); + if (info.m_interface_mode > S950_HD_FLOPPYMODE) { - osd_printf_error("hxchfe: Unknown interface mode %d.\n", m_interface_mode); + osd_printf_error("hxchfe: Unknown interface mode %d.\n", info.m_interface_mode); return false; } - m_write_allowed = (header[20] != 0); - m_single_step = (header[21] != 0); - m_track0s0_has_altencoding = (header[22] == 0x00); - m_track0s0_encoding = (encoding_t)(header[23] & 0xff); - m_track0s1_has_altencoding = (header[24] == 0x00); - m_track0s1_encoding = (encoding_t)(header[25] & 0xff); + info.m_write_allowed = (header[20] != 0); + info.m_single_step = (header[21] != 0); + info.m_track0s0_has_altencoding = (header[22] == 0x00); + info.m_track0s0_encoding = (encoding_t)(header[23] & 0xff); + info.m_track0s1_has_altencoding = (header[24] == 0x00); + info.m_track0s1_encoding = (encoding_t)(header[25] & 0xff); // read track lookup table (multiple of 512) int table_offset = (header[18] & 0xff) | ((header[19] & 0xff)<<8); io.read_at(table_offset<<9, track_table, TRACK_TABLE_LENGTH, actual); - for (int i=0; i < m_cylinders; i++) + for (int i=0; i < info.m_cylinders; i++) { - m_cyl_offset[i] = (track_table[4*i] & 0xff) | ((track_table[4*i+1] & 0xff)<<8); - m_cyl_length[i] = (track_table[4*i+2] & 0xff) | ((track_table[4*i+3] & 0xff)<<8); + info.m_cyl_offset[i] = (track_table[4*i] & 0xff) | ((track_table[4*i+1] & 0xff)<<8); + info.m_cyl_length[i] = (track_table[4*i+2] & 0xff) | ((track_table[4*i+3] & 0xff)<<8); } // Load the tracks std::vector cylinder_buffer; - for(int cyl=0; cyl < m_cylinders; cyl++) + for(int cyl=0; cyl < info.m_cylinders; cyl++) { // actual data read // The HFE format defines an interleave of the two sides per cylinder // at every 256 bytes - cylinder_buffer.resize(m_cyl_length[cyl]); - io.read_at(m_cyl_offset[cyl]<<9, &cylinder_buffer[0], m_cyl_length[cyl], actual); + cylinder_buffer.resize(info.m_cyl_length[cyl]); + io.read_at(info.m_cyl_offset[cyl]<<9, &cylinder_buffer[0], info.m_cyl_length[cyl], actual); - generate_track_from_hfe_bitstream(cyl, 0, samplelength, &cylinder_buffer[0], m_cyl_length[cyl], image); - if (m_heads == 2) - generate_track_from_hfe_bitstream(cyl, 1, samplelength, &cylinder_buffer[0], m_cyl_length[cyl], image); + generate_track_from_hfe_bitstream(cyl, 0, samplelength, &cylinder_buffer[0], info.m_cyl_length[cyl], image); + if (info.m_heads == 2) + generate_track_from_hfe_bitstream(cyl, 1, samplelength, &cylinder_buffer[0], info.m_cyl_length[cyl], image); } bool success = true; // Find variant - if (m_track_encoding == ISOIBM_FM_ENCODING || m_track_encoding == EMU_FM_ENCODING) + if (info.m_track_encoding == ISOIBM_FM_ENCODING || info.m_track_encoding == EMU_FM_ENCODING) // FM is for single density - image->set_variant((m_heads==1)? floppy_image::SSSD : floppy_image::DSSD); + image->set_variant((info.m_heads==1)? floppy_image::SSSD : floppy_image::DSSD); else { // MFM encoding is for everything else - if (m_track_encoding == ISOIBM_MFM_ENCODING || m_track_encoding == AMIGA_MFM_ENCODING) + if (info.m_track_encoding == ISOIBM_MFM_ENCODING || info.m_track_encoding == AMIGA_MFM_ENCODING) { // Each cylinder contains the samples of both sides, 8 samples per // byte; the bitRate determines how many samples constitute a cell @@ -286,7 +273,7 @@ // DSED: 2.8 MiB = 2*80*36*512 bytes; 400000 cells/track, 500 ns, 1 Mbit/s // Use cylinder 1 (cyl 0 may have special encodings) - int cellcount = (m_cyl_length[1] * 8 / 2) * 250 / m_bit_rate; + int cellcount = (info.m_cyl_length[1] * 8 / 2) * 250 / info.m_bit_rate; if (cellcount > 300000) image->set_variant(floppy_image::DSED); else @@ -297,7 +284,7 @@ { if (cellcount > 90000) // We cannot distinguish DSDD from DSQD without knowing the size of the floppy disk - image->set_variant((m_heads==1)? floppy_image::SSDD : floppy_image::DSDD); + image->set_variant((info.m_heads==1)? floppy_image::SSDD : floppy_image::DSDD); } } } @@ -329,17 +316,11 @@ // HFE does not define subtracks; set to 0 // MG_1 / MG_0 are (logical) levels that indicate transition / no change - // MG_A / MG_B are physical flux directions - // - // Cell: | AAAABBBB | = MG_1 = | BBBBAAAA | - // | AAAAAAAA | = MG_0 = | BBBBBBBB | + // MG_F is the position of a flux transition std::vector &dest = image->get_buffer(cyl, head, 0); dest.clear(); - // Start with MG_A - uint32_t cbit = floppy_image::MG_A; - int offset = 0x100; if (head==0) @@ -351,10 +332,6 @@ uint8_t current = 0; int time = 0; - dest.push_back(cbit | time); - - cbit = floppy_image::MG_B; - // Oversampled FM images (250 kbit/s) start with a 0, where a 1 is // expected for 125 kbit/s. // In order to make an oversampled image look like a normally sampled one, @@ -397,13 +374,8 @@ { time += samplelength; if ((current & 1)!=0) - { // Append another transition to the vector - dest.push_back(cbit | time); - - // Toggle the cell level - cbit = (cbit == floppy_image::MG_A)? floppy_image::MG_B : floppy_image::MG_A; - } + dest.push_back(floppy_image::MG_F | time); // HFE uses little-endian bit order current >>= 1; @@ -419,292 +391,6 @@ image->set_write_splice_position(cyl, head, 0, 0); } -bool hfe_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) -{ - size_t actual; - std::vector cylbuf; - - // Create a buffer that is big enough to handle HD formats. We don't - // know the track length until we generate the HFE bitstream. - cylbuf.resize(0x10000); - - uint8_t header[HEADER_LENGTH]; - uint8_t track_table[TRACK_TABLE_LENGTH]; - - int track_end = 0x61c0; - int samplelength = 2000; - - // Set up header - const char* sig = "HXCPICFE"; - memcpy(header, sig, 8); - - header[8] = 0; - // Can we change the number of tracks or heads? - image->get_actual_geometry(m_cylinders, m_heads); - - header[9] = m_cylinders; - header[10] = m_heads; - // Floppy RPM is not used - header[14] = 0; - header[15] = 0; - - // Bit rate and encoding will be set later, they may have changed by - // reformatting. The selected encoding is UNKNOWN_ENCODING unless - // explicitly set - m_track_encoding = m_selected_encoding; - - // Take the old mode, unless we have specified a mode - header[16] = (m_selected_mode != DISABLE_FLOPPYMODE)? m_selected_mode : m_interface_mode; - header[17] = 0; - - // The track lookup table is located at offset 0x200 (as 512 multiple) - header[18] = 1; - header[19] = 0; - - header[20] = m_write_allowed? 0xff : 0x00; - header[21] = m_single_step? 0xff : 0x00; - - // TODO: Allow for divergent track 0 format - header[22] = m_track0s0_has_altencoding? 0x00 : 0xff; - header[23] = m_track0s0_encoding; - header[24] = m_track0s1_has_altencoding? 0x00 : 0xff; - header[25] = m_track0s1_encoding; - - // Fill the remaining bytes with 0xff - for (int i=26; i < HEADER_LENGTH; i++) header[i] = 0xff; - - // Don't write yet; we still have to find out the bit rate. - - // We won't have more than 200000 cells on the track - for (int cyl=0; cyl < m_cylinders; cyl++) - { - // After the call, the encoding will be set to FM or MFM - generate_hfe_bitstream_from_track(cyl, 0, samplelength, m_track_encoding, &cylbuf[0], track_end, image); - if (m_heads == 2) - generate_hfe_bitstream_from_track(cyl, 1, samplelength, m_track_encoding, &cylbuf[0], track_end, image); - - if (cyl==0) - { - // Complete the header and write it - header[11] = m_track_encoding; - m_bit_rate = 500000/samplelength; - header[12] = m_bit_rate & 0xff; - header[13] = (m_bit_rate >> 8) & 0xff; - - // Now write the header - io.write_at(0, header, HEADER_LENGTH, actual); - - // Set up the track lookup table - // We need the encoding value to be sure about the track length - int len = (m_track_encoding==ISOIBM_FM_ENCODING)? 0x61b0 : 0x61c0; - int pos = 0x400; - - for (int i=0; i < m_cylinders; i++) - { - m_cyl_offset[i] = (pos >> 9); - m_cyl_length[i] = len; - pos += (len + 0x1ff) & 0xfe00; - track_table[i*4] = m_cyl_offset[i] & 0xff; - track_table[i*4+1] = (m_cyl_offset[i]>>8) & 0xff; - track_table[i*4+2] = len & 0xff; - track_table[i*4+3] = (len>>8) & 0xff; - } - // Set the remainder to 0xff - for (int i=m_cylinders*4; i < TRACK_TABLE_LENGTH; i++) - track_table[i] = 0xff; - - io.write_at(0x200, track_table, TRACK_TABLE_LENGTH, actual); - } - // Write the current cylinder - io.write_at(m_cyl_offset[cyl]<<9, &cylbuf[0], (m_cyl_length[cyl] + 0x1ff) & 0xfe00, actual); - } - return true; -} - -void hfe_format::generate_hfe_bitstream_from_track(int cyl, int head, int& samplelength, encoding_t& encoding, uint8_t *cylinder_buffer, int track_end, floppy_image *image) -{ - // We are using an own implementation here because the result of the - // parent class method would require some post-processing that we - // can easily avoid. - - // See floppy_image_format_t::generate_bitstream_from_track - // as the original code - - // No subtracks definded - std::vector &tbuf = image->get_buffer(cyl, head, 0); - if (tbuf.size() <= 1) - { - // Unformatted track - // TODO must handle that according to HFE - int track_size = 200000000/samplelength; - memset(cylinder_buffer, 0, (track_size+7)/8); - return; - } - - // Find out whether we have FM or MFM recording, and determine the bit rate. - // This is needed for the format header. - // - // The encoding may have changed by reformatting; we cannot rely on the - // header when loading. - // - // FM: encoding 1 -> flux length = 4 us (min) ambivalent - // encoding 10 -> flux length = 8 us (max) ambivalent - // MFM: encoding 10 -> flux length = 4 us (min, DD) ambivalent - // encoding 100 -> flux length = 6 us (DD) significant - // encoding 1000 -> flux length = 8 us (max, DD) ambivalent - // encoding 10 -> flux length = 2 us (min, HD) significant - // encoding 100 -> flux length = 3 us (max, HD) significant - - // If we have MFM, we should very soon detect a flux length of 6 us. - // But if we have FM, how long should we search to be sure? - // We assume that after 2000 us we should have reached the first IDAM, - // which contains a sequence 1001, implying a flux length of 6 us. - // If there was no such flux in that area, this can safely be assumed to be FM. - - // Do it only for the first track; the format only supports one encoding. - if (encoding == UNKNOWN_ENCODING) - { - bool mfm_recording = false; - int time0 = 0; - int minflux = 4000; - int fluxlen = 0; - // Skip the beginning (may have a short cell) - for (int i=2; (i < tbuf.size()-1) && (time0 < 2000000) && !mfm_recording; i++) - { - time0 = tbuf[i] & floppy_image::TIME_MASK; - fluxlen = (tbuf[i+1] & floppy_image::TIME_MASK) - time0; - if ((fluxlen < 3500) || (fluxlen > 5500 && fluxlen < 6500)) - mfm_recording = true; - if (fluxlen < minflux) minflux = fluxlen; - } - encoding = mfm_recording? ISOIBM_MFM_ENCODING : ISOIBM_FM_ENCODING; - - // samplelength = 1000ns => 10^6 cells/sec => 500 kbit/s - // samplelength = 2000ns => 250 kbit/s - // We stay with double sampling at 250 kbit/s for FM - if (minflux < 3500) samplelength = 1000; - else samplelength = 2000; - } - - // Start at the write splice - uint32_t splice = image->get_write_splice_position(cyl, head, 0); - - int cur_pos = splice; - int cur_entry = 0; - - // Fast-forward to the write splice position (always 0 in this format) - while (cur_entry < int(tbuf.size())-1 && (tbuf[cur_entry+1] & floppy_image::TIME_MASK) < cur_pos) - cur_entry++; - - int period = samplelength; - int period_adjust_base = period * 0.05; - - int min_period = int(samplelength*0.75); - int max_period = int(samplelength*1.25); - int phase_adjust = 0; - int freq_hist = 0; - uint32_t next = 0; - - int offset = 0x100; - - // Prepare offset for the format storage - if (head==0) - { - offset = 0; - track_end -= 0x0100; - } - - uint8_t bit = 0x01; - uint8_t current = 0; - - while (next < 200000000) { - int edge = tbuf[cur_entry] & floppy_image::TIME_MASK; - - // Start of track? Use next entry. - if (edge==0) - { - edge = tbuf[++cur_entry] & floppy_image::TIME_MASK; - } - - // Wrapped over end? - if (edge < cur_pos) edge += 200000000; - - // End of cell - next = cur_pos + period + phase_adjust; - - // End of the window is at next; edge is the actual transition - if (edge >= next) - { - // No transition in the window -> 0 - phase_adjust = 0; - } - else - { - // Transition in the window -> 1 - current |= bit; - int delta = edge - (next - period/2); - - phase_adjust = 0.65*delta; - - if (delta < 0) - { - if (freq_hist < 0) freq_hist--; - else freq_hist = -1; - } - else - { - if (delta > 0) - { - if(freq_hist > 0) freq_hist++; - else freq_hist = 1; - } - else freq_hist = 0; - } - - if (freq_hist) - { - int afh = freq_hist < 0 ? -freq_hist : freq_hist; - if (afh > 1) - { - int aper = period_adjust_base*delta/period; - if (!aper) - aper = freq_hist < 0 ? -1 : 1; - period += aper; - - if (period < min_period) period = min_period; - else if (period > max_period) period = max_period; - } - } - } - - cur_pos = next; - - bit = (bit << 1) & 0xff; - if (bit == 0) - { - bit = 0x01; - cylinder_buffer[offset++] = current; - if ((offset & 0xff)==0) offset += 0x100; - current = 0; - } - - // Fast-forward to next cell - while (cur_entry < int(tbuf.size())-1 && (tbuf[cur_entry] & floppy_image::TIME_MASK) < cur_pos) - cur_entry++; - - // Reaching the end of the track - if (cur_entry == int(tbuf.size())-1 && (tbuf[cur_entry] & floppy_image::TIME_MASK) < cur_pos) - { - // Wrap to index 0 or 1 depending on whether there is a transition exactly at the index hole - cur_entry = (tbuf[int(tbuf.size())-1] & floppy_image::MG_MASK) != (tbuf[0] & floppy_image::MG_MASK) ? - 0 : 1; - } - } - // Write the current byte when not done - if (bit != 0x01) - cylinder_buffer[offset] = current; -} - -const floppy_format_type FLOPPY_HFE_FORMAT = &floppy_image_format_creator; +const hfe_format FLOPPY_HFE_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/hxchfe_dsk.h mame-0.243+dfsg.1/src/lib/formats/hxchfe_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/hxchfe_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/hxchfe_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -47,44 +47,44 @@ hfe_format(); - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; - virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; virtual const char *name() const override; virtual const char *description() const override; virtual const char *extensions() const override; virtual bool supports_save() const override; - void set_floppy_mode(floppymode_t mode) { m_selected_mode = mode; } - void set_encoding(encoding_t enc) { m_selected_encoding = enc; } - private: - void generate_track_from_hfe_bitstream(int track, int head, int samplelength, const uint8_t *trackbuf, int track_end, floppy_image *image); - void generate_hfe_bitstream_from_track(int track, int head, int& samplelength, encoding_t& encoding, uint8_t *trackbuf, int track_end, floppy_image *image); + static void generate_track_from_hfe_bitstream(int track, int head, int samplelength, const uint8_t *trackbuf, int track_end, floppy_image *image); // Header fields from the HFE format - int m_cylinders; // Number of track in the file - int m_heads; // Number of valid side - encoding_t m_track_encoding; // Track Encoding mode - int m_bit_rate; // Bitrate in Kbit/s (max: 500) - int m_floppy_rpm; // Rotation per minute - floppymode_t m_interface_mode; // Floppy interface mode. - - bool m_write_allowed; - bool m_single_step; - bool m_track0s0_has_altencoding; - encoding_t m_track0s0_encoding; // alternate track_encoding for track 0 Side 0 - bool m_track0s1_has_altencoding; - encoding_t m_track0s1_encoding; // alternate track_encoding for track 0 Side 1 - - int m_cyl_offset[256]; - int m_cyl_length[256]; + struct header_info { + int m_cylinders = 0; // Number of track in the file + int m_heads = 0; // Number of valid side + encoding_t m_track_encoding = UNKNOWN_ENCODING; // Track Encoding mode + int m_bit_rate = 0; // Bitrate in Kbit/s (max: 500) + int m_floppy_rpm = 0; // Rotation per minute + floppymode_t m_interface_mode = DISABLE_FLOPPYMODE; // Floppy interface mode. + + bool m_write_allowed = true; + bool m_single_step = true; + bool m_track0s0_has_altencoding = false; + encoding_t m_track0s0_encoding = UNKNOWN_ENCODING; // alternate track_encoding for track 0 Side 0 + bool m_track0s1_has_altencoding = false; + encoding_t m_track0s1_encoding = UNKNOWN_ENCODING; // alternate track_encoding for track 0 Side 1 + + int m_cyl_offset[256]; + int m_cyl_length[256]; + + floppymode_t m_selected_mode = DISABLE_FLOPPYMODE; + encoding_t m_selected_encoding = UNKNOWN_ENCODING; + }; - floppymode_t m_selected_mode; - encoding_t m_selected_encoding; + static void set_floppy_mode(header_info &info, floppymode_t mode) { info.m_selected_mode = mode; } + static void set_encoding(header_info &info, encoding_t enc) { info.m_selected_encoding = enc; } }; -extern const floppy_format_type FLOPPY_HFE_FORMAT; +extern const hfe_format FLOPPY_HFE_FORMAT; #endif // MAME_FORMATS_HXCHFE_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/hxcmfm_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/hxcmfm_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/hxcmfm_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/hxcmfm_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -60,19 +60,19 @@ return true; } -int mfm_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int mfm_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint8_t header[7]; size_t actual; io.read_at(0, &header, sizeof(header), actual); if ( memcmp( header, MFM_FORMAT_HEADER, 6 ) ==0) { - return 100; + return FIFID_SIGN; } return 0; } -bool mfm_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool mfm_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { size_t actual; MFMIMG header; @@ -114,7 +114,7 @@ return true; } -bool mfm_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) +bool mfm_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const { // TODO: HD support size_t actual; @@ -160,4 +160,4 @@ return true; } -const floppy_format_type FLOPPY_MFM_FORMAT = &floppy_image_format_creator; +const mfm_format FLOPPY_MFM_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/hxcmfm_dsk.h mame-0.243+dfsg.1/src/lib/formats/hxcmfm_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/hxcmfm_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/hxcmfm_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -19,9 +19,9 @@ public: mfm_format(); - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; - virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; + virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const override; virtual const char *name() const override; virtual const char *description() const override; @@ -29,6 +29,6 @@ virtual bool supports_save() const override; }; -extern const floppy_format_type FLOPPY_MFM_FORMAT; +extern const mfm_format FLOPPY_MFM_FORMAT; #endif // MAME_FORMATS_HXCMFM_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/ibmxdf_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/ibmxdf_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/ibmxdf_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/ibmxdf_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -55,16 +55,16 @@ return "xdf,img"; } -int ibmxdf_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int ibmxdf_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { int type = find_size(io, form_factor, variants); if (type != -1) - return 75; + return FIFID_SIZE; return 0; } -int ibmxdf_format::find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int ibmxdf_format::find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint64_t size; if (io.length(size)) @@ -76,12 +76,12 @@ return 0; } -int ibmxdf_format::get_image_offset(const format &f, int head, int track) +int ibmxdf_format::get_image_offset(const format &f, int head, int track) const { return (2 * track) * compute_track_size(formats[0]); } -const wd177x_format::format &ibmxdf_format::get_track_format(const format &f, int head, int track) +const wd177x_format::format &ibmxdf_format::get_track_format(const format &f, int head, int track) const { int n = -1; @@ -178,7 +178,7 @@ {} }; -bool ibmxdf_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool ibmxdf_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { int type = find_size(io, form_factor, variants); if(type == -1) @@ -264,5 +264,5 @@ } } -const floppy_format_type FLOPPY_IBMXDF_FORMAT = &floppy_image_format_creator; +const ibmxdf_format FLOPPY_IBMXDF_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/ibmxdf_dsk.h mame-0.243+dfsg.1/src/lib/formats/ibmxdf_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/ibmxdf_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/ibmxdf_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -23,13 +23,13 @@ virtual const char *description() const override; virtual const char *extensions() const override; - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; virtual bool supports_save() const override { return false; } - virtual int find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual int get_image_offset(const format &f, int head, int track) override; - virtual const wd177x_format::format &get_track_format(const format &f, int head, int track) override; + virtual int find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual int get_image_offset(const format &f, int head, int track) const override; + virtual const wd177x_format::format &get_track_format(const format &f, int head, int track) const override; private: static const format formats[]; @@ -40,6 +40,6 @@ virtual void build_sector_description(const format &d, uint8_t *sectdata, desc_s *sectors, int track, int head) const override; }; -extern const floppy_format_type FLOPPY_IBMXDF_FORMAT; +extern const ibmxdf_format FLOPPY_IBMXDF_FORMAT; #endif // MAME_FORMATS_IBMXDF_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/imd_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/imd_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/imd_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/imd_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -413,20 +413,32 @@ }; } -int imd_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int imd_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { char h[4]; size_t actual; io.read_at(0, h, 4, actual); if(!memcmp(h, "IMD ", 4)) - return 100; + return FIFID_SIGN; return 0; } -bool imd_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool imd_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { + std::vector comment; + std::vector > snum; + std::vector > tnum; + std::vector > hnum; + + std::vector mode; + std::vector track; + std::vector head; + std::vector sector_count; + std::vector ssize; + + int trackmult; uint64_t size; if(io.length(size)) return false; @@ -438,8 +450,8 @@ for(pos=0; pos < size && img[pos] != 0x1a; pos++) { } pos++; - m_comment.resize(pos); - memcpy(&m_comment[0], &img[0], pos); + comment.resize(pos); + memcpy(&comment[0], &img[0], pos); if(pos >= size) return false; @@ -447,12 +459,12 @@ int tracks, heads; image->get_maximal_geometry(tracks, heads); - m_mode.clear(); - m_track.clear(); - m_head.clear(); - m_sector_count.clear(); - m_ssize.clear(); - m_trackmult = 1; + mode.clear(); + track.clear(); + head.clear(); + sector_count.clear(); + ssize.clear(); + trackmult = 1; // we have to walk the whole file to find out the number of tracks savepos = pos; @@ -509,7 +521,7 @@ (has_variant(variants, floppy_image::DSHD))) { if (maxtrack <= 39) - m_trackmult = 2; + trackmult = 2; } else { @@ -520,79 +532,79 @@ pos = savepos; while(pos < size) { - m_mode.push_back(img[pos++]); - m_track.push_back(img[pos++]); - m_head.push_back(img[pos++]); - m_sector_count.push_back(img[pos++]); - m_ssize.push_back(img[pos++]); + mode.push_back(img[pos++]); + track.push_back(img[pos++]); + head.push_back(img[pos++]); + sector_count.push_back(img[pos++]); + ssize.push_back(img[pos++]); - if(m_track.back() >= tracks) + if(track.back() >= tracks) { - osd_printf_error("imd_format: Track %d exceeds maximum of %d\n", m_track.back(), tracks); + osd_printf_error("imd_format: Track %d exceeds maximum of %d\n", track.back(), tracks); return false; } - if((m_head.back() & 0x3f) >= heads) + if((head.back() & 0x3f) >= heads) { - osd_printf_error("imd_format: Head %d exceeds maximum of %d\n", m_head.back() & 0x3f, heads); + osd_printf_error("imd_format: Head %d exceeds maximum of %d\n", head.back() & 0x3f, heads); return false; } - if(m_ssize.back() == 0xff) + if(ssize.back() == 0xff) { - osd_printf_error("imd_format: Unsupported variable sector size on track %d head %d", m_track.back(), m_head.back() & 0x3f); + osd_printf_error("imd_format: Unsupported variable sector size on track %d head %d", track.back(), head.back() & 0x3f); return false; } - uint32_t actual_size = m_ssize.back() < 7 ? 128 << m_ssize.back() : 8192; + uint32_t actual_size = ssize.back() < 7 ? 128 << ssize.back() : 8192; static const int rates[3] = { 500000, 300000, 250000 }; - bool fm = m_mode.back() < 3; - int rate = rates[m_mode.back() % 3]; + bool fm = mode.back() < 3; + int rate = rates[mode.back() % 3]; int rpm = form_factor == floppy_image::FF_8 || (form_factor == floppy_image::FF_525 && rate >= 300000) ? 360 : 300; int cell_count = (fm ? 1 : 2)*rate*60/rpm; //const uint8_t *snum = &img[pos]; - m_snum.push_back(std::vector(m_sector_count.back())); - memcpy(&m_snum.back()[0], &img[pos], m_sector_count.back()); - pos += m_sector_count.back(); + snum.push_back(std::vector(sector_count.back())); + memcpy(&snum.back()[0], &img[pos], sector_count.back()); + pos += sector_count.back(); //const uint8_t *tnum = head & 0x80 ? &img[pos] : nullptr; - if (m_head.back() & 0x80) + if (head.back() & 0x80) { - m_tnum.push_back(std::vector(m_sector_count.back())); - memcpy(&m_tnum.back()[0], &img[pos], m_sector_count.back()); - pos += m_sector_count.back(); + tnum.push_back(std::vector(sector_count.back())); + memcpy(&tnum.back()[0], &img[pos], sector_count.back()); + pos += sector_count.back(); } else { - m_tnum.push_back(std::vector(0)); + tnum.push_back(std::vector(0)); } //const uint8_t *hnum = head & 0x40 ? &img[pos] : nullptr; - if (m_head.back() & 0x40) + if (head.back() & 0x40) { - m_hnum.push_back(std::vector(m_sector_count.back())); - memcpy(&m_hnum.back()[0], &img[pos], m_sector_count.back()); - pos += m_sector_count.back(); + hnum.push_back(std::vector(sector_count.back())); + memcpy(&hnum.back()[0], &img[pos], sector_count.back()); + pos += sector_count.back(); } else { - m_hnum.push_back(std::vector(0)); + hnum.push_back(std::vector(0)); } - uint8_t head = m_head.back() & 0x3f; + uint8_t chead = head.back() & 0x3f; int gap_3 = calc_default_pc_gap3_size(form_factor, actual_size); desc_pc_sector sects[256]; - for(int i=0; i 8) { @@ -611,15 +623,15 @@ } } - if(m_sector_count.back()) { + if(sector_count.back()) { if(fm) { - build_pc_track_fm(m_track.back()*m_trackmult, head, image, cell_count, m_sector_count.back(), sects, gap_3); + build_pc_track_fm(track.back()*trackmult, chead, image, cell_count, sector_count.back(), sects, gap_3); } else { - build_pc_track_mfm(m_track.back()*m_trackmult, head, image, cell_count, m_sector_count.back(), sects, gap_3); + build_pc_track_mfm(track.back()*trackmult, chead, image, cell_count, sector_count.back(), sects, gap_3); } } - for(int i=0; i< m_sector_count.back(); i++) + for(int i=0; i< sector_count.back(); i++) if(sects[i].data && (sects[i].data < &img[0] || sects[i].data >= (&img[0] + size))) delete [] sects[i].data; } @@ -627,90 +639,9 @@ return true; } -bool can_compress(const uint8_t* buffer, uint8_t ptrn, uint64_t size) -{ - for (; size > 0; size--) - if (*buffer++ != ptrn) - return false; - return true; -} - -bool imd_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) -{ - if(io.seek(0, SEEK_SET)) - return false; - - size_t written; - io.write(&m_comment[0], m_comment.size(), written); - - for (int i = 0; i < m_mode.size(); i++) - { - io.write(&m_mode[i], 1, written); - io.write(&m_track[i], 1, written); - io.write(&m_head[i], 1, written); - io.write(&m_sector_count[i], 1, written); - io.write(&m_ssize[i], 1, written); - - io.write(&m_snum[i][0], m_sector_count[i], written); - - if (m_tnum[i].size()) - io.write(&m_tnum[i][0], m_sector_count[i], written); - - if (m_hnum[i].size()) - io.write(&m_hnum[i][0], m_sector_count[i], written); - - uint32_t const actual_size = m_ssize[i] < 7 ? 128 << m_ssize[i] : 8192; - uint8_t const head = m_head[i] & 0x3f; - - bool const fm = m_mode[i]< 3; - - auto bitstream = generate_bitstream_from_track(m_track[i]*m_trackmult, head, fm ? 4000 : 2000, image); - std::vector> sectors; - - if (fm) - sectors = extract_sectors_from_bitstream_fm_pc(bitstream); - else - sectors = extract_sectors_from_bitstream_mfm_pc(bitstream); - - uint8_t sdata[8192]; - for (int j = 0; j < m_sector_count[i]; j++) { - - const auto &data = sectors[m_snum[i][j]]; - - if (data.empty()) - { - uint8_t const mode = 0; - io.write(&mode, 1, written); - continue; - } - else if (data.size() < actual_size) { - memcpy((void*)sdata, data.data(), data.size()); - memset((uint8_t*)sdata + data.size(), 0, data.size() - actual_size); - } - else - memcpy((void*)sdata, data.data(), actual_size); - - if (can_compress(sdata, sdata[0], actual_size)) - { - uint8_t const mode = 2; - io.write(&mode, 1, written); - io.write(&sdata[0], 1, written); - } - else - { - uint8_t const mode = 1; - io.write(&mode, 1, written); - io.write(&sdata, actual_size, written); - } - } - } - - return true; -} - bool imd_format::supports_save() const { - return true; + return false; } -const floppy_format_type FLOPPY_IMD_FORMAT = &floppy_image_format_creator; +const imd_format FLOPPY_IMD_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/imd_dsk.h mame-0.243+dfsg.1/src/lib/formats/imd_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/imd_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/imd_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -17,9 +17,8 @@ public: imd_format(); - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; - virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image* image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; virtual const char *name() const override; virtual const char *description() const override; @@ -28,21 +27,8 @@ private: void fixnum(char *start, char *end) const; - - std::vector m_comment; - std::vector > m_snum; - std::vector > m_tnum; - std::vector > m_hnum; - - std::vector m_mode; - std::vector m_track; - std::vector m_head; - std::vector m_sector_count; - std::vector m_ssize; - - int m_trackmult = 1; }; -extern const floppy_format_type FLOPPY_IMD_FORMAT; +extern const imd_format FLOPPY_IMD_FORMAT; #endif // MAME_FORMATS_IMD_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/img_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/img_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/img_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/img_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -43,7 +43,7 @@ { } -int img_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int img_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint64_t size; if (io.length(size)) { @@ -52,13 +52,13 @@ if (((form_factor == floppy_image::FF_8) || (form_factor == floppy_image::FF_UNKNOWN)) && size == IMG_IMAGE_SIZE) { - return 50; + return FIFID_SIZE; } else { return 0; } } -bool img_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool img_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { uint64_t size; if (io.length(size) || (size != IMG_IMAGE_SIZE)) { @@ -104,7 +104,7 @@ return true; } -bool img_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) +bool img_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const { for (int cyl = 0; cyl < TRACKS; cyl++) { auto bitstream = generate_bitstream_from_track(cyl , 0 , CELL_SIZE , image , 0); @@ -386,4 +386,4 @@ return true; } -const floppy_format_type FLOPPY_IMG_FORMAT = &floppy_image_format_creator; +const img_format FLOPPY_IMG_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/img_dsk.h mame-0.243+dfsg.1/src/lib/formats/img_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/img_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/img_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -27,9 +27,9 @@ img_format(); - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; - virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; + virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const override; virtual const char *name() const override; virtual const char *description() const override; virtual const char *extensions() const override; @@ -37,17 +37,17 @@ private: static std::vector interleaved_sectors(unsigned il_factor); - void write_mmfm_bit(std::vector &buffer , bool data_bit , bool clock_bit , uint16_t &crc); - void write_mmfm_byte(std::vector &buffer , uint8_t data , uint16_t &crc , uint8_t clock = 0); - void write_sync(std::vector &buffer); - void write_crc(std::vector &buffer , uint16_t crc); - void write_gap(std::vector &buffer , unsigned size_00 , unsigned size_ff); - void write_sector(std::vector &buffer , uint8_t track_no , uint8_t sect_no , const uint8_t *sect_data); - void fill_with_gap4(std::vector &buffer); - std::vector get_next_id_n_block(const std::vector &bitstream , int& pos , int& start_pos); - bool get_next_sector(const std::vector &bitstream , int& pos , unsigned& track , unsigned& sector , uint8_t *sector_data); + static void write_mmfm_bit(std::vector &buffer , bool data_bit , bool clock_bit , uint16_t &crc); + static void write_mmfm_byte(std::vector &buffer , uint8_t data , uint16_t &crc , uint8_t clock = 0); + static void write_sync(std::vector &buffer); + static void write_crc(std::vector &buffer , uint16_t crc); + static void write_gap(std::vector &buffer , unsigned size_00 , unsigned size_ff); + static void write_sector(std::vector &buffer , uint8_t track_no , uint8_t sect_no , const uint8_t *sect_data); + static void fill_with_gap4(std::vector &buffer); + static std::vector get_next_id_n_block(const std::vector &bitstream , int& pos , int& start_pos); + static bool get_next_sector(const std::vector &bitstream , int& pos , unsigned& track , unsigned& sector , uint8_t *sector_data); }; -extern const floppy_format_type FLOPPY_IMG_FORMAT; +extern const img_format FLOPPY_IMG_FORMAT; #endif // MAME_FORMATS_IMG_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/ipf_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/ipf_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/ipf_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/ipf_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -7,7 +7,7 @@ #include -const floppy_format_type FLOPPY_IPF_FORMAT = &floppy_image_format_creator; +const ipf_format FLOPPY_IPF_FORMAT; const char *ipf_format::name() const { @@ -29,7 +29,7 @@ return false; } -int ipf_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int ipf_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { static const uint8_t refh[12] = { 0x43, 0x41, 0x50, 0x53, 0x00, 0x00, 0x00, 0x0c, 0x1c, 0xd5, 0x73, 0xba }; uint8_t h[12]; @@ -37,12 +37,12 @@ io.read_at(0, h, 12, actual); if(!memcmp(h, refh, 12)) - return 100; + return FIFID_SIGN; return 0; } -bool ipf_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool ipf_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { uint64_t size; if (io.length(size)) diff -Nru mame-0.242+dfsg.1/src/lib/formats/ipf_dsk.h mame-0.243+dfsg.1/src/lib/formats/ipf_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/ipf_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/ipf_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -12,8 +12,8 @@ class ipf_format : public floppy_image_format_t { public: - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; virtual const char *name() const override; virtual const char *description() const override; @@ -88,6 +88,6 @@ }; }; -extern const floppy_format_type FLOPPY_IPF_FORMAT; +extern const ipf_format FLOPPY_IPF_FORMAT; #endif // MAME_FORMATS_IPF_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/iq151_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/iq151_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/iq151_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/iq151_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -42,4 +42,4 @@ {} }; -const floppy_format_type FLOPPY_IQ151_FORMAT = &floppy_image_format_creator; +const iq151_format FLOPPY_IQ151_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/iq151_dsk.h mame-0.243+dfsg.1/src/lib/formats/iq151_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/iq151_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/iq151_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -27,6 +27,6 @@ static const format formats[]; }; -extern const floppy_format_type FLOPPY_IQ151_FORMAT; +extern const iq151_format FLOPPY_IQ151_FORMAT; #endif // MAME_FORMATS_IQ151_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/itt3030_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/itt3030_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/itt3030_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/itt3030_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -54,4 +54,4 @@ -const floppy_format_type FLOPPY_ITT3030_FORMAT = &floppy_image_format_creator; +const itt3030_format FLOPPY_ITT3030_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/itt3030_dsk.h mame-0.243+dfsg.1/src/lib/formats/itt3030_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/itt3030_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/itt3030_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -28,6 +28,6 @@ }; -extern const floppy_format_type FLOPPY_ITT3030_FORMAT; +extern const itt3030_format FLOPPY_ITT3030_FORMAT; #endif // MAME_FORMATS_ITT3030_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/jfd_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/jfd_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/jfd_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/jfd_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -189,11 +189,12 @@ return "jfd"; } -int jfd_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int jfd_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint64_t size; - if (io.length(size)) + if (io.length(size) || !size) return 0; + std::vector img(size); size_t actual; io.read_at(0, &img[0], size, actual); @@ -224,13 +225,13 @@ } if (!memcmp(&img[0], JFD_HEADER, sizeof(JFD_HEADER))) { - return 100; + return FIFID_SIGN; } return 0; } -bool jfd_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool jfd_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { uint64_t size; if (io.length(size)) @@ -375,4 +376,4 @@ return false; } -const floppy_format_type FLOPPY_JFD_FORMAT = &floppy_image_format_creator; +const jfd_format FLOPPY_JFD_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/jfd_dsk.h mame-0.243+dfsg.1/src/lib/formats/jfd_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/jfd_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/jfd_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -23,11 +23,11 @@ virtual const char *description() const override; virtual const char *extensions() const override; - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; virtual bool supports_save() const override; }; -extern const floppy_format_type FLOPPY_JFD_FORMAT; +extern const jfd_format FLOPPY_JFD_FORMAT; #endif // MAME_FORMATS_JFD_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/juku_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/juku_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/juku_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/juku_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -42,4 +42,4 @@ {} }; -const floppy_format_type FLOPPY_JUKU_FORMAT = &floppy_image_format_creator; +const juku_format FLOPPY_JUKU_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/juku_dsk.h mame-0.243+dfsg.1/src/lib/formats/juku_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/juku_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/juku_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -27,6 +27,6 @@ static const format formats[]; }; -extern const floppy_format_type FLOPPY_JUKU_FORMAT; +extern const juku_format FLOPPY_JUKU_FORMAT; #endif // MAME_FORMATS_JUKU_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/jvc_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/jvc_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/jvc_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/jvc_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -135,7 +135,7 @@ // The JVC format has a header whose size is the size of the image modulo 256. Currently, we only // handle up to five header bytes uint64_t size; - if (io.length(size)) + if (io.length(size) || !size) return false; header_size = size % 256; uint8_t header[5]; @@ -175,13 +175,13 @@ return tracks * heads * sectors * sector_size == (size - header_size); } -int jvc_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int jvc_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { int header_size, tracks, heads, sectors, sector_size, sector_base_id; - return parse_header(io, header_size, tracks, heads, sectors, sector_size, sector_base_id) ? 50 : 0; + return parse_header(io, header_size, tracks, heads, sectors, sector_size, sector_base_id) ? FIFID_STRUCT|FIFID_SIZE : 0; } -bool jvc_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool jvc_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { int header_size, track_count, head_count, sector_count, sector_size, sector_base_id; int max_tracks, max_heads; @@ -246,7 +246,7 @@ return true; } -bool jvc_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) +bool jvc_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const { uint64_t file_offset = 0; @@ -295,4 +295,4 @@ return true; } -const floppy_format_type FLOPPY_JVC_FORMAT = &floppy_image_format_creator; +const jvc_format FLOPPY_JVC_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/jvc_dsk.h mame-0.243+dfsg.1/src/lib/formats/jvc_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/jvc_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/jvc_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -35,15 +35,15 @@ virtual const char *description() const override; virtual const char *extensions() const override; - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; - virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; + virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const override; virtual bool supports_save() const override; private: - bool parse_header(util::random_read &io, int &header_size, int &tracks, int &heads, int §ors, int §or_size, int &base_sector_id); + static bool parse_header(util::random_read &io, int &header_size, int &tracks, int &heads, int §ors, int §or_size, int &base_sector_id); }; -extern const floppy_format_type FLOPPY_JVC_FORMAT; +extern const jvc_format FLOPPY_JVC_FORMAT; #endif // MAME_FORMATS_JVC_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/kaypro_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/kaypro_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/kaypro_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/kaypro_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -72,5 +72,5 @@ {} }; -const floppy_format_type FLOPPY_KAYPROII_FORMAT = &floppy_image_format_creator; -const floppy_format_type FLOPPY_KAYPRO2X_FORMAT = &floppy_image_format_creator; +const kayproii_format FLOPPY_KAYPROII_FORMAT; +const kaypro2x_format FLOPPY_KAYPRO2X_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/kaypro_dsk.h mame-0.243+dfsg.1/src/lib/formats/kaypro_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/kaypro_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/kaypro_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -37,7 +37,7 @@ static const format formats[]; }; -extern const floppy_format_type FLOPPY_KAYPROII_FORMAT; -extern const floppy_format_type FLOPPY_KAYPRO2X_FORMAT; +extern const kayproii_format FLOPPY_KAYPROII_FORMAT; +extern const kaypro2x_format FLOPPY_KAYPRO2X_FORMAT; #endif // MAME_FORMATS_KAYPRO_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/kc85_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/kc85_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/kc85_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/kc85_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -58,4 +58,4 @@ {} }; -const floppy_format_type FLOPPY_KC85_FORMAT = &floppy_image_format_creator; +const kc85_format FLOPPY_KC85_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/kc85_dsk.h mame-0.243+dfsg.1/src/lib/formats/kc85_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/kc85_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/kc85_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -26,6 +26,6 @@ static const format formats[]; }; -extern const floppy_format_type FLOPPY_KC85_FORMAT; +extern const kc85_format FLOPPY_KC85_FORMAT; #endif // MAME_FORMATS_KC85_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/m20_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/m20_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/m20_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/m20_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -43,19 +43,19 @@ return true; } -int m20_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int m20_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint64_t size; if (io.length(size)) return 0; if (size == 286720) - return 50; + return FIFID_SIZE; return 0; } -bool m20_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool m20_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { for (int track = 0; track < 35; track++) for (int head = 0; head < 2; head ++) { @@ -85,7 +85,7 @@ return true; } -bool m20_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) +bool m20_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const { uint64_t file_offset = 0; @@ -125,4 +125,4 @@ return true; } -const floppy_format_type FLOPPY_M20_FORMAT = &floppy_image_format_creator; +const m20_format FLOPPY_M20_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/m20_dsk.h mame-0.243+dfsg.1/src/lib/formats/m20_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/m20_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/m20_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -18,9 +18,9 @@ public: m20_format(); - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; - virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; + virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const override; virtual const char *name() const override; virtual const char *description() const override; @@ -28,6 +28,6 @@ virtual bool supports_save() const override; }; -extern const floppy_format_type FLOPPY_M20_FORMAT; +extern const m20_format FLOPPY_M20_FORMAT; #endif // MAME_FORMATS_M20_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/m5_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/m5_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/m5_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/m5_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -42,4 +42,4 @@ {} }; -const floppy_format_type FLOPPY_M5_FORMAT = &floppy_image_format_creator; +const m5_format FLOPPY_M5_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/m5_dsk.h mame-0.243+dfsg.1/src/lib/formats/m5_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/m5_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/m5_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -26,6 +26,6 @@ static const format formats[]; }; -extern const floppy_format_type FLOPPY_M5_FORMAT; +extern const m5_format FLOPPY_M5_FORMAT; #endif // MAME_FORMATS_M5_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/mdos_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/mdos_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/mdos_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/mdos_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -74,17 +74,17 @@ return "dsk"; } -int mdos_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int mdos_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { int type = find_size(io, form_factor, variants); if (type != -1) - return 75; + return FIFID_SIZE; return 0; } -bool mdos_format::check_ascii(uint8_t *str, size_t len, const char* name) +bool mdos_format::check_ascii(const uint8_t *str, size_t len, const char* name) { LOG_FORMATS(" %s: \"", name); for (int i = 0; i < len; i++) { @@ -101,7 +101,7 @@ return 1; } -int mdos_format::parse_date_field(uint8_t *str) +int mdos_format::parse_date_field(const uint8_t *str) { uint8_t high = str[0]; uint8_t low = str[1]; @@ -112,13 +112,14 @@ return (high - 0x30) * 10 + (low - 0x30); } -int mdos_format::find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int mdos_format::find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { size_t actual; uint64_t size; if (io.length(size)) return -1; + disk_id_sector info; // Look at the disk id sector. io.read_at(0, &info, sizeof(struct disk_id_sector), actual); @@ -227,7 +228,7 @@ return -1; } -const wd177x_format::format &mdos_format::get_track_format(const format &f, int head, int track) +const wd177x_format::format &mdos_format::get_track_format(const format &f, int head, int track) const { int n = -1; @@ -287,4 +288,4 @@ {} }; -const floppy_format_type FLOPPY_MDOS_FORMAT = &floppy_image_format_creator; +const mdos_format FLOPPY_MDOS_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/mdos_dsk.h mame-0.243+dfsg.1/src/lib/formats/mdos_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/mdos_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/mdos_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -19,9 +19,9 @@ virtual const char *name() const override; virtual const char *description() const override; virtual const char *extensions() const override; - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual int find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual const wd177x_format::format &get_track_format(const format &f, int head, int track) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual int find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual const wd177x_format::format &get_track_format(const format &f, int head, int track) const override; private: struct disk_id_sector @@ -33,13 +33,13 @@ uint8_t username[20]; uint8_t rib_addr[20]; uint8_t unused[70]; - } info; + }; static const format formats[]; static const format formats_head1[]; - bool check_ascii(uint8_t *, size_t len, const char* name); - int parse_date_field(uint8_t *str); + static bool check_ascii(const uint8_t *, size_t len, const char* name); + static int parse_date_field(const uint8_t *str); }; -extern const floppy_format_type FLOPPY_MDOS_FORMAT; +extern const mdos_format FLOPPY_MDOS_FORMAT; #endif // MAME_FORMATS_MDOS_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/mfi_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/mfi_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/mfi_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/mfi_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -7,6 +7,7 @@ #include #include +#include /* @@ -31,31 +32,27 @@ simple "compress" function. Track data consists of a series of 32-bits lsb-first values - representing magnetic cells. Bits 0-27 indicate the sizes, and bits - 28-31 the types. Type can be: - - 0, MG_A -> Magnetic orientation A - - 1, MG_B -> Magnetic orientation B - - 2, MG_N -> Non-magnetized zone (neutral) - - 3, MG_D -> Damaged zone, reads as neutral but cannot be changed by writing - - Remember that the fdcs detect transitions, not absolute levels, so - the actual physical significance of the orientation A and B is - arbitrary. + representing magnetic cells. Bits 0-27 indicate the position, + delta-packed (e.g. difference with the previous position, starts at + 0), and bits 28-31 the types. Type can be: + + - 0, MG_F -> Flux orientation change + - 1, MG_N -> Non-magnetized zone (neutral) + - 2, MG_D -> Damaged zone, reads as neutral but cannot be changed by writing + - 3, MG_E -> End of zone Tracks data is aligned so that the index pulse is at the start, whether the disk is hard-sectored or not. - The size is the angular size in units of 1/200,000,000th of a turn. - Such a size, not coincidentally at all, is also the flyover time in - nanoseconds for a perfectly stable 300rpm drive. That makes the - standard cell size of a MFM 3.5" DD floppy at 2000 exactly for - instance (2us). Smallest expected cell size is 500 (ED density - drives). + The position is the angular position in units of 1/200,000,000th of + a turn. A size in such units, not coincidentally at all, is also + the flyover time in nanoseconds for a perfectly stable 300rpm drive. + That makes the standard cell size of a MFM 3.5" DD floppy at 2000 + exactly for instance (2us). Smallest expected cell size is 500 (ED + density drives). - The sum of all sizes must of course be 200,000,000. - - An unformatted track is equivalent to one big MG_N cell covering a - whole turn, but is encoded as zero-size. + An unformatted track is equivalent to a pair (MG_N, 0), (MG_E, + 199999999) but is encoded as zero-size. The "track splice" information indicates where to start writing if you try to rewrite a physical disk with the data. Some @@ -72,7 +69,8 @@ TODO: big-endian support */ -const char mfi_format::sign[16] = "MESSFLOPPYIMAGE"; // Includes the final \0 +const char mfi_format::sign_old[16] = "MESSFLOPPYIMAGE"; // Includes the final \0 +const char mfi_format::sign[16] = "MAMEFLOPPYIMAGE"; // Includes the final \0 mfi_format::mfi_format() : floppy_image_format_t() { @@ -85,7 +83,7 @@ const char *mfi_format::description() const { - return "MESS floppy image"; + return "MAME floppy image"; } const char *mfi_format::extensions() const @@ -98,22 +96,22 @@ return true; } -int mfi_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int mfi_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { header h; size_t actual; io.read_at(0, &h, sizeof(header), actual); - if(memcmp( h.sign, sign, 16 ) == 0 && + if((memcmp( h.sign, sign, 16) == 0 || memcmp( h.sign, sign_old, 16) == 0) && (h.cyl_count & CYLINDER_MASK) <= 84 && (h.cyl_count >> RESOLUTION_SHIFT) < 3 && h.head_count <= 2 && (!form_factor || !h.form_factor || h.form_factor == form_factor)) - return 100; + return FIFID_SIGN|FIFID_STRUCT; return 0; } -bool mfi_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool mfi_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { size_t actual; header h; @@ -129,7 +127,46 @@ if(!h.cyl_count) return true; + std::function &src, std::vector &track)> converter; + + if(!memcmp( h.sign, sign, 16)) { + converter = [](const std::vector &src, std::vector &track) -> void { + uint32_t ctime = 0; + for(uint32_t mg : src) { + ctime += mg & TIME_MASK; + track.push_back((mg & MG_MASK) | ctime); + } + }; + + } else { + converter = [](const std::vector &src, std::vector &track) -> void { + unsigned int cell_count = src.size(); + uint32_t mg = src[0] & MG_MASK; + uint32_t wmg = src[cell_count - 1] & MG_MASK; + if(mg != wmg && (mg == OLD_MG_A || mg == OLD_MG_B) && (wmg == OLD_MG_A && wmg == OLD_MG_B)) + // Flux change at 0, add it + track.push_back(MG_F | 0); + + uint32_t ctime = 0; + for(unsigned int i=0; i != cell_count; i++) { + uint32_t nmg = src[i] & MG_MASK; + if(nmg == OLD_MG_N || nmg == OLD_MG_D) { + track.push_back((nmg == OLD_MG_N ? MG_N : MG_D) | ctime); + ctime += src[i] & TIME_MASK; + track.push_back(MG_E | (ctime-1)); + nmg = 0xffffffff; + } else { + if(mg != 0xffffffff && mg != nmg) + track.push_back(MG_F | ctime); + ctime += src[i] & TIME_MASK; + } + mg = nmg; + } + }; + } + std::vector compressed; + std::vector uncompressed; entry *ent = entries; for(unsigned int cyl=0; cyl <= (h.cyl_count - 1) << 2; cyl += 4 >> resolution) @@ -143,39 +180,29 @@ continue; } + unsigned int cell_count = ent->uncompressed_size/4; compressed.resize(ent->compressed_size); + uncompressed.resize(cell_count); io.read_at(ent->offset, &compressed[0], ent->compressed_size, actual); - unsigned int cell_count = ent->uncompressed_size/4; - std::vector &trackbuf = image->get_buffer(cyl >> 2, head, cyl & 3);; - trackbuf.resize(cell_count); - uLongf size = ent->uncompressed_size; - if(uncompress((Bytef *)&trackbuf[0], &size, &compressed[0], ent->compressed_size) != Z_OK) { + if(uncompress((Bytef *)uncompressed.data(), &size, &compressed[0], ent->compressed_size) != Z_OK) { fprintf(stderr, "fail1\n"); return false; } - uint32_t cur_time = 0; - for(unsigned int i=0; i != cell_count; i++) { - uint32_t next_cur_time = cur_time + (trackbuf[i] & TIME_MASK); - trackbuf[i] = (trackbuf[i] & MG_MASK) | cur_time; - cur_time = next_cur_time; - } - if(cur_time != 200000000) { - fprintf(stderr, "fail2 %d\n", cur_time); - return false; - } + std::vector &trackbuf = image->get_buffer(cyl >> 2, head, cyl & 3);; + trackbuf.clear(); + converter(uncompressed, trackbuf); ent++; } - fprintf(stderr, "tick\n"); return true; } -bool mfi_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) +bool mfi_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const { size_t actual; int tracks, heads; @@ -215,13 +242,11 @@ continue; } - memcpy(&precomp[0], &buffer[0], tsize*4); - for(int j=0; j; +const mfi_format FLOPPY_MFI_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/mfi_dsk.h mame-0.243+dfsg.1/src/lib/formats/mfi_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/mfi_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/mfi_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -12,9 +12,9 @@ public: mfi_format(); - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; - virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; + virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const override; virtual const char *name() const override; virtual const char *description() const override; @@ -27,15 +27,21 @@ MG_MASK = 0xf0000000, MG_SHIFT = 28, - MG_A = (0 << MG_SHIFT), - MG_B = (1 << MG_SHIFT), - MG_N = (2 << MG_SHIFT), - MG_D = (3 << MG_SHIFT), + OLD_MG_A = (0 << MG_SHIFT), + OLD_MG_B = (1 << MG_SHIFT), + OLD_MG_N = (2 << MG_SHIFT), + OLD_MG_D = (3 << MG_SHIFT), + + MG_F = (0 << MG_SHIFT), //!< - 0, MG_F -> Flux orientation change + MG_N = (1 << MG_SHIFT), //!< - 1, MG_N -> Non-magnetized zone (neutral) + MG_D = (2 << MG_SHIFT), //!< - 2, MG_D -> Damaged zone, reads as neutral but cannot be changed by writing + MG_E = (3 << MG_SHIFT), //!< - 3, MG_E -> End of zone RESOLUTION_SHIFT = 30, CYLINDER_MASK = 0x3fffffff }; + static const char sign_old[16]; static const char sign[16]; struct header { @@ -49,6 +55,6 @@ }; }; -extern const floppy_format_type FLOPPY_MFI_FORMAT; +extern const mfi_format FLOPPY_MFI_FORMAT; #endif // MAME_FORMATS_MFI_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/mm_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/mm_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/mm_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/mm_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -84,5 +84,5 @@ {} }; -const floppy_format_type FLOPPY_MM1_FORMAT = &floppy_image_format_creator; -const floppy_format_type FLOPPY_MM2_FORMAT = &floppy_image_format_creator; +const mm1_format FLOPPY_MM1_FORMAT; +const mm2_format FLOPPY_MM2_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/mm_dsk.h mame-0.243+dfsg.1/src/lib/formats/mm_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/mm_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/mm_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -38,7 +38,7 @@ static const format formats[]; }; -extern const floppy_format_type FLOPPY_MM1_FORMAT; -extern const floppy_format_type FLOPPY_MM2_FORMAT; +extern const mm1_format FLOPPY_MM1_FORMAT; +extern const mm2_format FLOPPY_MM2_FORMAT; #endif // MAME_FORMATS_MM_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/ms0515_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/ms0515_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/ms0515_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/ms0515_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -50,4 +50,4 @@ {} }; -const floppy_format_type FLOPPY_MS0515_FORMAT = &floppy_image_format_creator; +const ms0515_format FLOPPY_MS0515_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/ms0515_dsk.h mame-0.243+dfsg.1/src/lib/formats/ms0515_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/ms0515_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/ms0515_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -25,6 +25,6 @@ static const format formats[]; }; -extern const floppy_format_type FLOPPY_MS0515_FORMAT; +extern const ms0515_format FLOPPY_MS0515_FORMAT; #endif // MAME_FORMATS_MS0515_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/msx_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/msx_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/msx_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/msx_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -58,4 +58,4 @@ {} }; -const floppy_format_type FLOPPY_MSX_FORMAT = &floppy_image_format_creator; +const msx_format FLOPPY_MSX_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/msx_dsk.h mame-0.243+dfsg.1/src/lib/formats/msx_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/msx_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/msx_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -12,10 +12,8 @@ #pragma once -//#include "wd177x_dsk.h" #include "upd765_dsk.h" -//class msx_format : public wd177x_format { class msx_format: public upd765_format { public: @@ -29,6 +27,6 @@ static const format formats[]; }; -extern const floppy_format_type FLOPPY_MSX_FORMAT; +extern const msx_format FLOPPY_MSX_FORMAT; #endif // MAME_FORMATS_MSX_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/mtx_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/mtx_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/mtx_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/mtx_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -50,4 +50,4 @@ {} }; -const floppy_format_type FLOPPY_MTX_FORMAT = &floppy_image_format_creator; +const mtx_format FLOPPY_MTX_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/mtx_dsk.h mame-0.243+dfsg.1/src/lib/formats/mtx_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/mtx_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/mtx_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -27,6 +27,6 @@ static const format formats[]; }; -extern const floppy_format_type FLOPPY_MTX_FORMAT; +extern const mtx_format FLOPPY_MTX_FORMAT; #endif // MAME_FORMATS_MTX_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/nanos_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/nanos_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/nanos_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/nanos_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -43,4 +43,4 @@ {} }; -const floppy_format_type FLOPPY_NANOS_FORMAT = &floppy_image_format_creator; +const nanos_format FLOPPY_NANOS_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/nanos_dsk.h mame-0.243+dfsg.1/src/lib/formats/nanos_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/nanos_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/nanos_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -26,6 +26,6 @@ static const format formats[]; }; -extern const floppy_format_type FLOPPY_NANOS_FORMAT; +extern const nanos_format FLOPPY_NANOS_FORMAT; #endif // MAME_FORMATS_NANOS_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/nascom_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/nascom_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/nascom_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/nascom_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -50,4 +50,4 @@ {} }; -const floppy_format_type FLOPPY_NASCOM_FORMAT = &floppy_image_format_creator; +const nascom_format FLOPPY_NASCOM_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/nascom_dsk.h mame-0.243+dfsg.1/src/lib/formats/nascom_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/nascom_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/nascom_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -27,6 +27,6 @@ static const format formats[]; }; -extern const floppy_format_type FLOPPY_NASCOM_FORMAT; +extern const nascom_format FLOPPY_NASCOM_FORMAT; #endif // MAME_FORMATS_NASCOM_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/naslite_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/naslite_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/naslite_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/naslite_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -50,4 +50,4 @@ } } -const floppy_format_type FLOPPY_NASLITE_FORMAT = &floppy_image_format_creator; +const naslite_format FLOPPY_NASLITE_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/naslite_dsk.h mame-0.243+dfsg.1/src/lib/formats/naslite_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/naslite_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/naslite_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -29,6 +29,6 @@ virtual void build_sector_description(const format &d, uint8_t *sectdata, desc_s *sectors, int track, int head) const override; }; -extern const floppy_format_type FLOPPY_NASLITE_FORMAT; +extern const naslite_format FLOPPY_NASLITE_FORMAT; #endif // MAME_FORMATS_NASLITE_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/nfd_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/nfd_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/nfd_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/nfd_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -105,19 +105,19 @@ return "nfd"; } -int nfd_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int nfd_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint8_t h[16]; size_t actual; io.read_at(0, h, 16, actual); if (strncmp((const char *)h, "T98FDDIMAGE.R0", 14) == 0 || strncmp((const char *)h, "T98FDDIMAGE.R1", 14) == 0) - return 100; + return FIFID_SIGN; return 0; } -bool nfd_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool nfd_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { size_t actual; uint64_t size; @@ -288,4 +288,4 @@ return false; } -const floppy_format_type FLOPPY_NFD_FORMAT = &floppy_image_format_creator; +const nfd_format FLOPPY_NFD_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/nfd_dsk.h mame-0.243+dfsg.1/src/lib/formats/nfd_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/nfd_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/nfd_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -20,8 +20,8 @@ public: nfd_format(); - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; virtual const char *name() const override; virtual const char *description() const override; @@ -29,6 +29,6 @@ virtual bool supports_save() const override; }; -extern const floppy_format_type FLOPPY_NFD_FORMAT; +extern const nfd_format FLOPPY_NFD_FORMAT; #endif // MAME_FORMATS_NFD_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/opd_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/opd_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/opd_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/opd_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -30,17 +30,17 @@ return "opd,opu"; } -int opd_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int opd_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { int const type = find_size(io, form_factor, variants); if (type != -1) - return 90; + return FIFID_SIZE; return 0; } -int opd_format::get_image_offset(const format &f, int head, int track) +int opd_format::get_image_offset(const format &f, int head, int track) const { return (f.track_count * head + track) * compute_track_size(f); } @@ -59,4 +59,4 @@ }; -const floppy_format_type FLOPPY_OPD_FORMAT = &floppy_image_format_creator; +const opd_format FLOPPY_OPD_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/opd_dsk.h mame-0.243+dfsg.1/src/lib/formats/opd_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/opd_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/opd_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -21,8 +21,8 @@ public: opd_format(); - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual int get_image_offset(const format &f, int head, int track) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual int get_image_offset(const format &f, int head, int track) const override; virtual const char *name() const override; virtual const char *description() const override; virtual const char *extensions() const override; @@ -32,6 +32,6 @@ }; -extern const floppy_format_type FLOPPY_OPD_FORMAT; +extern const opd_format FLOPPY_OPD_FORMAT; #endif // MAME_FORMATS_OPD_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/oric_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/oric_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/oric_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/oric_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -35,7 +35,7 @@ return true; } -int oric_dsk_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int oric_dsk_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint8_t h[256]; size_t actual; @@ -54,10 +54,10 @@ if(sides < 0 || sides > 2 || geom != 1 || size != 256+6400*sides*tracks) return 0; - return 100; + return FIFID_SIGN|FIFID_SIZE|FIFID_STRUCT; } -bool oric_dsk_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool oric_dsk_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { size_t actual; uint8_t h[256]; @@ -107,13 +107,7 @@ return true; } -bool oric_dsk_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) -{ - // FIXME: surely this should return false, since it does't actually save anything? - return true; -} - -const floppy_format_type FLOPPY_ORIC_DSK_FORMAT = &floppy_image_format_creator; +const oric_dsk_format FLOPPY_ORIC_DSK_FORMAT; const char *oric_jasmin_format::name() const @@ -136,7 +130,7 @@ return true; } -int oric_jasmin_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int oric_jasmin_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint64_t size; if(io.length(size)) @@ -144,12 +138,12 @@ bool const can_ds = variants.empty() || has_variant(variants, floppy_image::DSDD); if(size == 41*17*256 || (can_ds && size == 41*17*256*2)) - return 50; + return FIFID_SIZE; return 0; } -bool oric_jasmin_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool oric_jasmin_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { uint64_t size; if(io.length(size)) @@ -189,7 +183,7 @@ return true; } -bool oric_jasmin_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) +bool oric_jasmin_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const { int tracks, heads; image->get_actual_geometry(tracks, heads); @@ -215,4 +209,4 @@ return true; } -const floppy_format_type FLOPPY_ORIC_JASMIN_FORMAT = &floppy_image_format_creator; +const oric_jasmin_format FLOPPY_ORIC_JASMIN_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/oric_dsk.h mame-0.243+dfsg.1/src/lib/formats/oric_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/oric_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/oric_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -18,9 +18,8 @@ { public: oric_dsk_format() = default; - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; - virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; virtual const char *name() const override; virtual const char *description() const override; @@ -28,16 +27,16 @@ virtual bool supports_save() const override; }; -extern const floppy_format_type FLOPPY_ORIC_DSK_FORMAT; +extern const oric_dsk_format FLOPPY_ORIC_DSK_FORMAT; class oric_jasmin_format : public floppy_image_format_t { public: oric_jasmin_format() = default; - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; - virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; + virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const override; virtual const char *name() const override; virtual const char *description() const override; @@ -45,6 +44,6 @@ virtual bool supports_save() const override; }; -extern const floppy_format_type FLOPPY_ORIC_JASMIN_FORMAT; +extern const oric_jasmin_format FLOPPY_ORIC_JASMIN_FORMAT; #endif // MAME_FORMATS_ORIC_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/os9_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/os9_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/os9_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/os9_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -70,17 +70,17 @@ return "os9,dsk"; } -int os9_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int os9_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { int const type = find_size(io, form_factor, variants); if (type != -1) - return 75; + return FIFID_SIZE; return 0; } -int os9_format::find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int os9_format::find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint64_t size; if (io.length(size)) @@ -224,7 +224,7 @@ return -1; } -const wd177x_format::format &os9_format::get_track_format(const format &f, int head, int track) +const wd177x_format::format &os9_format::get_track_format(const format &f, int head, int track) const { int n = -1; @@ -583,4 +583,4 @@ {} }; -const floppy_format_type FLOPPY_OS9_FORMAT = &floppy_image_format_creator; +const os9_format FLOPPY_OS9_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/os9_dsk.h mame-0.243+dfsg.1/src/lib/formats/os9_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/os9_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/os9_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -21,15 +21,15 @@ virtual const char *name() const override; virtual const char *description() const override; virtual const char *extensions() const override; - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual int find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual const wd177x_format::format &get_track_format(const format &f, int head, int track) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual int find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual const wd177x_format::format &get_track_format(const format &f, int head, int track) const override; private: static const format formats[]; static const format formats_track0[]; }; -extern const floppy_format_type FLOPPY_OS9_FORMAT; +extern const os9_format FLOPPY_OS9_FORMAT; #endif // MAME_FORMATS_OS9_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/pasti_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/pasti_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/pasti_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/pasti_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -41,7 +41,7 @@ return false; } -int pasti_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int pasti_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint8_t h[16]; size_t actual; @@ -49,7 +49,7 @@ if(!memcmp(h, "RSY\0\3\0", 6) && (1 || (h[10] >= 80 && h[10] <= 82) || (h[10] >= 160 && h[10] <= 164))) - return 100; + return FIFID_SIGN; return 0; } @@ -64,7 +64,7 @@ } } -bool pasti_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool pasti_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { size_t actual; uint8_t fh[16]; @@ -165,7 +165,7 @@ return true; } -const floppy_format_type FLOPPY_PASTI_FORMAT = &floppy_image_format_creator; +const pasti_format FLOPPY_PASTI_FORMAT; void pasti_format::wd_generate_track_from_observations(int track, int head, floppy_image *image, wd_obs &obs) diff -Nru mame-0.242+dfsg.1/src/lib/formats/pasti_dsk.h mame-0.243+dfsg.1/src/lib/formats/pasti_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/pasti_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/pasti_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -12,8 +12,8 @@ public: pasti_format(); - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; virtual const char *name() const override; virtual const char *description() const override; @@ -37,7 +37,7 @@ int track_size, sector_count; }; - void wd_generate_track_from_observations(int track, int head, floppy_image *image, wd_obs &obs); + static void wd_generate_track_from_observations(int track, int head, floppy_image *image, wd_obs &obs); private: struct wd_sect_info { @@ -46,21 +46,21 @@ bool hsynced, dsynced; }; - void map_sectors_in_track(wd_obs &obs, wd_sect_info *sect_infos); - void match_mfm_data(wd_obs &obs, int tpos, const uint8_t *data, int size, uint8_t context, int &bcount, int &ccount, bool &synced); - void match_raw_data(wd_obs &obs, int tpos, const uint8_t *data, int size, uint8_t context, int &bcount, int &ccount); - uint16_t byte_to_mfm(uint8_t data, bool context); - uint16_t calc_crc(const uint8_t *data, int size, uint16_t crc); - - void wd_generate_unsynced_gap(std::vector &track, const wd_obs &obs, int tstart, int tend, uint32_t cell_size); - void wd_generate_synced_gap(std::vector &track, const wd_obs &obs, int tstart, int tend, uint32_t cell_size); - void wd_generate_gap(std::vector &track, const wd_obs &obs, int tstart, int tend, bool synced, uint32_t cell_size_start, uint32_t cell_size_end); - void wd_generate_sector_header(std::vector &track, const wd_obs &obs, int sector, int tstart, uint32_t cell_size); - void wd_generate_sector_data(std::vector &track, const wd_obs &obs, int sector, int tstart, uint32_t cell_size); - void wd_generate_track_from_sectors_and_track(int track, int head, floppy_image *image, wd_obs &obs); - void wd_generate_track_from_sectors_only(int track, int head, floppy_image *image, wd_obs &obs); + static void map_sectors_in_track(wd_obs &obs, wd_sect_info *sect_infos); + static void match_mfm_data(wd_obs &obs, int tpos, const uint8_t *data, int size, uint8_t context, int &bcount, int &ccount, bool &synced); + static void match_raw_data(wd_obs &obs, int tpos, const uint8_t *data, int size, uint8_t context, int &bcount, int &ccount); + static uint16_t byte_to_mfm(uint8_t data, bool context); + static uint16_t calc_crc(const uint8_t *data, int size, uint16_t crc); + + static void wd_generate_unsynced_gap(std::vector &track, const wd_obs &obs, int tstart, int tend, uint32_t cell_size); + static void wd_generate_synced_gap(std::vector &track, const wd_obs &obs, int tstart, int tend, uint32_t cell_size); + static void wd_generate_gap(std::vector &track, const wd_obs &obs, int tstart, int tend, bool synced, uint32_t cell_size_start, uint32_t cell_size_end); + static void wd_generate_sector_header(std::vector &track, const wd_obs &obs, int sector, int tstart, uint32_t cell_size); + static void wd_generate_sector_data(std::vector &track, const wd_obs &obs, int sector, int tstart, uint32_t cell_size); + static void wd_generate_track_from_sectors_and_track(int track, int head, floppy_image *image, wd_obs &obs); + static void wd_generate_track_from_sectors_only(int track, int head, floppy_image *image, wd_obs &obs); }; -extern const floppy_format_type FLOPPY_PASTI_FORMAT; +extern const pasti_format FLOPPY_PASTI_FORMAT; #endif // MAME_FORMATS_PASTI_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/pc98_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/pc98_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/pc98_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/pc98_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -87,4 +87,4 @@ }; -const floppy_format_type FLOPPY_PC98_FORMAT = &floppy_image_format_creator; +const pc98_format FLOPPY_PC98_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/pc98_dsk.h mame-0.243+dfsg.1/src/lib/formats/pc98_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/pc98_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/pc98_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -31,6 +31,6 @@ static const format formats[]; }; -extern const floppy_format_type FLOPPY_PC98_FORMAT; +extern const pc98_format FLOPPY_PC98_FORMAT; #endif // MAME_FORMATS_PC98_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/pc98fdi_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/pc98fdi_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/pc98fdi_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/pc98fdi_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -34,7 +34,7 @@ return "fdi"; } -int pc98fdi_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int pc98fdi_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint64_t size; if(io.length(size)) @@ -51,12 +51,12 @@ uint32_t const sides = little_endianize_int32(*(uint32_t *) (h + 0x18)); uint32_t const ntrk = little_endianize_int32(*(uint32_t *) (h + 0x1c)); if(size == hsize + psize && psize == ssize*scnt*sides*ntrk) - return 100; + return FIFID_STRUCT; return 0; } -bool pc98fdi_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool pc98fdi_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { size_t actual; @@ -104,4 +104,4 @@ return false; } -const floppy_format_type FLOPPY_PC98FDI_FORMAT = &floppy_image_format_creator; +const pc98fdi_format FLOPPY_PC98FDI_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/pc98fdi_dsk.h mame-0.243+dfsg.1/src/lib/formats/pc98fdi_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/pc98fdi_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/pc98fdi_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -20,8 +20,8 @@ public: pc98fdi_format(); - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; virtual const char *name() const override; virtual const char *description() const override; @@ -29,6 +29,6 @@ virtual bool supports_save() const override; }; -extern const floppy_format_type FLOPPY_PC98FDI_FORMAT; +extern const pc98fdi_format FLOPPY_PC98FDI_FORMAT; #endif // MAME_FORMATS_PC98FDI_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/pc_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/pc_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/pc_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/pc_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -34,31 +34,6 @@ return "dsk,ima,img,ufi,360"; } -int pc_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) -{ - uint64_t size; - if (io.length(size)) { - return 0; - } - - /* some 360K images have a 512-byte header */ - if (size == 368640 + 0x200) { - file_header_skip_bytes = 0x200; - } - - /* Disk Copy 4.2 images have an 84-byte header */ - if (size == 1474560 + 84) { - file_header_skip_bytes = 84; - } - - /* some 1.44MB images have a 1024-byte footer */ - if (size == 1474560 + 0x400) { - file_footer_skip_bytes = 0x400; - } - - return upd765_format::identify(io, form_factor, variants); -} - const pc_format::format pc_format::formats[] = { { /* 160K 5 1/4 inch double density single sided */ floppy_image::FF_525, floppy_image::SSDD, floppy_image::MFM, @@ -119,4 +94,4 @@ {} }; -const floppy_format_type FLOPPY_PC_FORMAT = &floppy_image_format_creator; +const pc_format FLOPPY_PC_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/pc_dsk.h mame-0.243+dfsg.1/src/lib/formats/pc_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/pc_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/pc_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -20,8 +20,6 @@ public: pc_format(); - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual const char *name() const override; virtual const char *description() const override; virtual const char *extensions() const override; @@ -30,6 +28,6 @@ static const format formats[]; }; -extern const floppy_format_type FLOPPY_PC_FORMAT; +extern const pc_format FLOPPY_PC_FORMAT; #endif // MAME_FORMATS_PC_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/pk8020_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/pk8020_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/pk8020_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/pk8020_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -41,4 +41,4 @@ {} }; -const floppy_format_type FLOPPY_PK8020_FORMAT = &floppy_image_format_creator; +const pk8020_format FLOPPY_PK8020_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/pk8020_dsk.h mame-0.243+dfsg.1/src/lib/formats/pk8020_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/pk8020_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/pk8020_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -27,6 +27,6 @@ static const format formats[]; }; -extern const floppy_format_type FLOPPY_PK8020_FORMAT; +extern const pk8020_format FLOPPY_PK8020_FORMAT; #endif // MAME_FORMATS_PK8020_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/poly_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/poly_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/poly_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/poly_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -39,7 +39,7 @@ return true; } -int poly_cpm_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int poly_cpm_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint64_t size; if (io.length(size)) @@ -54,14 +54,14 @@ io.read_at(0, boot, 16, actual); if (memcmp(boot, "\x86\xc3\xb7\x00\x00\x8e\x10\xc0\xbf\x00\x01\xbf\xe0\x60\x00\x00", 16) == 0) { - return 100; + return FIFID_SIZE|FIFID_SIGN; } } return 0; } -bool poly_cpm_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool poly_cpm_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { uint64_t size; if (io.length(size) || io.seek(0, SEEK_SET)) @@ -124,4 +124,4 @@ return true; } -const floppy_format_type FLOPPY_POLY_CPM_FORMAT = &floppy_image_format_creator; +const poly_cpm_format FLOPPY_POLY_CPM_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/poly_dsk.h mame-0.243+dfsg.1/src/lib/formats/poly_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/poly_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/poly_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -20,11 +20,11 @@ virtual const char *name() const override; virtual const char *description() const override; virtual const char *extensions() const override; - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; virtual bool supports_save() const override; }; -extern const floppy_format_type FLOPPY_POLY_CPM_FORMAT; +extern const poly_cpm_format FLOPPY_POLY_CPM_FORMAT; #endif // MAME_FORMATS_POLY_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/ppg_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/ppg_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/ppg_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/ppg_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -62,4 +62,4 @@ } } -const floppy_format_type FLOPPY_PPG_FORMAT = &floppy_image_format_creator; +const ppg_format FLOPPY_PPG_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/ppg_dsk.h mame-0.243+dfsg.1/src/lib/formats/ppg_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/ppg_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/ppg_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -29,6 +29,6 @@ virtual void build_sector_description(const format &d, uint8_t *sectdata, desc_s *sectors, int track, int head) const override; }; -extern const floppy_format_type FLOPPY_PPG_FORMAT; +extern const ppg_format FLOPPY_PPG_FORMAT; #endif // MAME_FORMATS_PPG_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/pyldin_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/pyldin_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/pyldin_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/pyldin_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -43,4 +43,4 @@ {} }; -const floppy_format_type FLOPPY_PYLDIN_FORMAT = &floppy_image_format_creator; +const pyldin_format FLOPPY_PYLDIN_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/pyldin_dsk.h mame-0.243+dfsg.1/src/lib/formats/pyldin_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/pyldin_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/pyldin_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -27,6 +27,6 @@ static const format formats[]; }; -extern const floppy_format_type FLOPPY_PYLDIN_FORMAT; +extern const pyldin_format FLOPPY_PYLDIN_FORMAT; #endif // MAME_FORMATS_PYLDIN_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/ql_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/ql_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/ql_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/ql_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -50,4 +50,4 @@ {} }; -const floppy_format_type FLOPPY_QL_FORMAT = &floppy_image_format_creator; +const ql_format FLOPPY_QL_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/ql_dsk.h mame-0.243+dfsg.1/src/lib/formats/ql_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/ql_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/ql_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -27,6 +27,6 @@ static const format formats[]; }; -extern const floppy_format_type FLOPPY_QL_FORMAT; +extern const ql_format FLOPPY_QL_FORMAT; #endif // MAME_FORMATS_QL_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/rc759_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/rc759_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/rc759_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/rc759_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -38,4 +38,4 @@ {} }; -const floppy_format_type FLOPPY_RC759_FORMAT = &floppy_image_format_creator; +const rc759_format FLOPPY_RC759_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/rc759_dsk.h mame-0.243+dfsg.1/src/lib/formats/rc759_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/rc759_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/rc759_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -28,6 +28,6 @@ static const format formats[]; }; -extern const floppy_format_type FLOPPY_RC759_FORMAT; +extern const rc759_format FLOPPY_RC759_FORMAT; #endif // MAME_FORMATS_RC759_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/rx50_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/rx50_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/rx50_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/rx50_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -129,18 +129,18 @@ track_count = head_count = sector_count = 0; } -int rx50img_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int rx50img_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint8_t track_count, head_count, sector_count; find_size(io, track_count, head_count, sector_count); if(track_count) - return 50; + return FIFID_SIZE; return 0; } // /* Sectors are numbered 1 to 10 */ -bool rx50img_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool rx50img_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { uint8_t track_count, head_count, sector_count; find_size(io, track_count, head_count, sector_count); @@ -169,7 +169,7 @@ return true; } -bool rx50img_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) +bool rx50img_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const { int track_count, head_count, sector_count; get_geometry_mfm_pc(image, 2000, track_count, head_count, sector_count); @@ -212,7 +212,7 @@ return true; } -const floppy_format_type FLOPPY_RX50IMG_FORMAT = &floppy_image_format_creator; +const rx50img_format FLOPPY_RX50IMG_FORMAT; /* diff -Nru mame-0.242+dfsg.1/src/lib/formats/rx50_dsk.h mame-0.243+dfsg.1/src/lib/formats/rx50_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/rx50_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/rx50_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -23,9 +23,9 @@ public: rx50img_format(); - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; - virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; + virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const override; virtual const char *name() const override; virtual const char *description() const override; @@ -35,9 +35,9 @@ static const desc_e rx50_10_desc[]; private: - void find_size(util::random_read &io, uint8_t &track_count, uint8_t &head_count, uint8_t §or_count); + static void find_size(util::random_read &io, uint8_t &track_count, uint8_t &head_count, uint8_t §or_count); }; -extern const floppy_format_type FLOPPY_RX50IMG_FORMAT; +extern const rx50img_format FLOPPY_RX50IMG_FORMAT; #endif // MAME_FORMATS_RX50_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/sdd_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/sdd_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/sdd_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/sdd_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -32,7 +32,7 @@ return "sdd"; } -int sdd_format::get_image_offset(const format &f, int head, int track) +int sdd_format::get_image_offset(const format &f, int head, int track) const { return (f.track_count * head + track) * compute_track_size(f); } @@ -61,4 +61,4 @@ {} }; -const floppy_format_type FLOPPY_SDD_FORMAT = &floppy_image_format_creator; +const sdd_format FLOPPY_SDD_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/sdd_dsk.h mame-0.243+dfsg.1/src/lib/formats/sdd_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/sdd_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/sdd_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -24,9 +24,9 @@ private: static const format formats[]; - virtual int get_image_offset(const format &f, int head, int track) override; + virtual int get_image_offset(const format &f, int head, int track) const override; }; -extern const floppy_format_type FLOPPY_SDD_FORMAT; +extern const sdd_format FLOPPY_SDD_FORMAT; #endif // MAME_FORMATS_SDD_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/sdf_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/sdf_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/sdf_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/sdf_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -39,7 +39,7 @@ } -int sdf_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int sdf_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint8_t header[HEADER_SIZE]; @@ -69,14 +69,14 @@ if (size == HEADER_SIZE + heads * tracks * TOTAL_TRACK_SIZE) { - return 100; + return FIFID_SIGN|FIFID_SIZE|FIFID_STRUCT; } return 0; } -bool sdf_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool sdf_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { size_t actual; uint8_t header[HEADER_SIZE]; @@ -184,16 +184,10 @@ } -bool sdf_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) -{ - return false; -} - - bool sdf_format::supports_save() const { return false; } -const floppy_format_type FLOPPY_SDF_FORMAT = &floppy_image_format_creator; +const sdf_format FLOPPY_SDF_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/sdf_dsk.h mame-0.243+dfsg.1/src/lib/formats/sdf_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/sdf_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/sdf_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -22,9 +22,8 @@ public: sdf_format(); - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; - virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; virtual const char *name() const override; virtual const char *description() const override; @@ -41,6 +40,6 @@ static constexpr int SECTOR_SLOT_COUNT = 31; }; -extern const floppy_format_type FLOPPY_SDF_FORMAT; +extern const sdf_format FLOPPY_SDF_FORMAT; #endif // MAME_FORMATS_SDF_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/sf7000_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/sf7000_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/sf7000_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/sf7000_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -42,4 +42,4 @@ {} }; -const floppy_format_type FLOPPY_SF7000_FORMAT = &floppy_image_format_creator; +const sf7000_format FLOPPY_SF7000_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/sf7000_dsk.h mame-0.243+dfsg.1/src/lib/formats/sf7000_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/sf7000_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/sf7000_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -27,6 +27,6 @@ static const format formats[]; }; -extern const floppy_format_type FLOPPY_SF7000_FORMAT; +extern const sf7000_format FLOPPY_SF7000_FORMAT; #endif // MAME_FORMATS_SF7000_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/smx_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/smx_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/smx_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/smx_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -43,4 +43,4 @@ {} }; -const floppy_format_type FLOPPY_SMX_FORMAT = &floppy_image_format_creator; +const smx_format FLOPPY_SMX_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/smx_dsk.h mame-0.243+dfsg.1/src/lib/formats/smx_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/smx_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/smx_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -27,6 +27,6 @@ static const format formats[]; }; -extern const floppy_format_type FLOPPY_SMX_FORMAT; +extern const smx_format FLOPPY_SMX_FORMAT; #endif // MAME_FORMATS_SMX_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/st_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/st_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/st_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/st_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -52,17 +52,17 @@ track_count = head_count = sector_count = 0; } -int st_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int st_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint8_t track_count, head_count, sector_count; find_size(io, track_count, head_count, sector_count); if(track_count) - return 50; + return FIFID_SIZE; return 0; } -bool st_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool st_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { uint8_t track_count, head_count, sector_count; find_size(io, track_count, head_count, sector_count); @@ -90,7 +90,7 @@ return true; } -bool st_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) +bool st_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const { int track_count, head_count, sector_count; get_geometry_mfm_pc(image, 2000, track_count, head_count, sector_count); @@ -214,7 +214,7 @@ return dst < usize; } -int msa_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int msa_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint16_t sign, sect, head, strack, etrack; read_header(io, sign, sect, head, strack, etrack); @@ -224,11 +224,11 @@ (head == 0 || head == 1) && strack <= etrack && etrack < 82) - return 100; + return FIFID_SIGN | FIFID_STRUCT; return 0; } -bool msa_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool msa_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { uint16_t sign, sect, heads, strack, etrack; read_header(io, sign, sect, heads, strack, etrack); @@ -267,7 +267,7 @@ } -bool msa_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) +bool msa_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const { int track_count, head_count, sector_count; get_geometry_mfm_pc(image, 2000, track_count, head_count, sector_count); @@ -330,5 +330,5 @@ return true; } -const floppy_format_type FLOPPY_ST_FORMAT = &floppy_image_format_creator; -const floppy_format_type FLOPPY_MSA_FORMAT = &floppy_image_format_creator; +const st_format FLOPPY_ST_FORMAT; +const msa_format FLOPPY_MSA_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/st_dsk.h mame-0.243+dfsg.1/src/lib/formats/st_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/st_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/st_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -19,9 +19,9 @@ public: st_format(); - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; - virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; + virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const override; virtual const char *name() const override; virtual const char *description() const override; @@ -29,7 +29,7 @@ virtual bool supports_save() const override; private: - void find_size(util::random_read &io, uint8_t &track_count, uint8_t &head_count, uint8_t §or_count); + static void find_size(util::random_read &io, uint8_t &track_count, uint8_t &head_count, uint8_t §or_count); }; class msa_format : public floppy_image_format_t @@ -37,9 +37,9 @@ public: msa_format(); - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; - virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; + virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const override; virtual const char *name() const override; virtual const char *description() const override; @@ -47,12 +47,12 @@ virtual bool supports_save() const override; private: - bool uncompress(uint8_t *buffer, int csize, int usize); - bool compress(const uint8_t *src, int usize, uint8_t *dest, int &csize); - void read_header(util::random_read &io, uint16_t &sign, uint16_t §, uint16_t &head, uint16_t &strack, uint16_t &etrack); + static bool uncompress(uint8_t *buffer, int csize, int usize); + static bool compress(const uint8_t *src, int usize, uint8_t *dest, int &csize); + static void read_header(util::random_read &io, uint16_t &sign, uint16_t §, uint16_t &head, uint16_t &strack, uint16_t &etrack); }; -extern const floppy_format_type FLOPPY_ST_FORMAT; -extern const floppy_format_type FLOPPY_MSA_FORMAT; +extern const st_format FLOPPY_ST_FORMAT; +extern const msa_format FLOPPY_MSA_FORMAT; #endif // MAME_FORMATS_ST_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/svi_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/svi_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/svi_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/svi_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -32,19 +32,19 @@ return "dsk"; } -int svi_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int svi_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint64_t size; if (io.length(size)) return 0; if (size == 172032 || size == 346112) - return 50; + return FIFID_SIZE; return 0; } -bool svi_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool svi_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { uint64_t size; if (io.length(size)) @@ -99,7 +99,7 @@ return true; } -bool svi_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) +bool svi_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const { if (io.seek(0, SEEK_SET)) return false; @@ -144,4 +144,4 @@ return true; } -const floppy_format_type FLOPPY_SVI_FORMAT = &floppy_image_format_creator; +const svi_format FLOPPY_SVI_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/svi_dsk.h mame-0.243+dfsg.1/src/lib/formats/svi_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/svi_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/svi_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -23,12 +23,12 @@ virtual const char *description() const override; virtual const char *extensions() const override; - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; - virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; + virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const override; virtual bool supports_save() const override; }; -extern const floppy_format_type FLOPPY_SVI_FORMAT; +extern const svi_format FLOPPY_SVI_FORMAT; #endif // MAME_FORMATS_SVI_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/swd_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/swd_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/swd_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/swd_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -29,7 +29,7 @@ return "swd"; } -int swd_format::get_image_offset(const format &f, int head, int track) +int swd_format::get_image_offset(const format &f, int head, int track) const { return (f.track_count * head + track) * compute_track_size(f); } @@ -47,4 +47,4 @@ {} }; -const floppy_format_type FLOPPY_SWD_FORMAT = &floppy_image_format_creator; +const swd_format FLOPPY_SWD_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/swd_dsk.h mame-0.243+dfsg.1/src/lib/formats/swd_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/swd_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/swd_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -24,9 +24,9 @@ private: static const format formats[]; - virtual int get_image_offset(const format &f, int head, int track) override; + virtual int get_image_offset(const format &f, int head, int track) const override; }; -extern const floppy_format_type FLOPPY_SWD_FORMAT; +extern const swd_format FLOPPY_SWD_FORMAT; #endif // MAME_FORMATS_SWD_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/tandy2k_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/tandy2k_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/tandy2k_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/tandy2k_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -37,4 +37,4 @@ {} }; -const floppy_format_type FLOPPY_TANDY_2000_FORMAT = &floppy_image_format_creator; +const tandy2k_format FLOPPY_TANDY_2000_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/tandy2k_dsk.h mame-0.243+dfsg.1/src/lib/formats/tandy2k_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/tandy2k_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/tandy2k_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -27,6 +27,6 @@ static const format formats[]; }; -extern const floppy_format_type FLOPPY_TANDY_2000_FORMAT; +extern const tandy2k_format FLOPPY_TANDY_2000_FORMAT; #endif // MAME_FORMATS_TANDY2K_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/td0_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/td0_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/td0_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/td0_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -808,7 +808,7 @@ return "td0"; } -int td0_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int td0_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { size_t actual; uint8_t h[7]; @@ -816,12 +816,12 @@ io.read_at(0, h, 7, actual); if(((h[0] == 'T') && (h[1] == 'D')) || ((h[0] == 't') && (h[1] == 'd'))) { - return 100; + return FIFID_SIGN; } return 0; } -bool td0_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool td0_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { size_t actual; int track_count = 0; @@ -1023,14 +1023,9 @@ } -bool td0_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) -{ - return false; -} - bool td0_format::supports_save() const { return false; } -const floppy_format_type FLOPPY_TD0_FORMAT = &floppy_image_format_creator; +const td0_format FLOPPY_TD0_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/td0_dsk.h mame-0.243+dfsg.1/src/lib/formats/td0_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/td0_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/td0_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -13,9 +13,8 @@ public: td0_format(); - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; - virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; virtual const char *name() const override; virtual const char *description() const override; @@ -23,6 +22,6 @@ virtual bool supports_save() const override; }; -extern const floppy_format_type FLOPPY_TD0_FORMAT; +extern const td0_format FLOPPY_TD0_FORMAT; #endif // MAME_FORMATS_TD0_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/thom_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/thom_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/thom_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/thom_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -82,5 +82,5 @@ {} }; -const floppy_format_type FLOPPY_THOMSON_525_FORMAT = &floppy_image_format_creator; -const floppy_format_type FLOPPY_THOMSON_35_FORMAT = &floppy_image_format_creator; +const thomson_525_format FLOPPY_THOMSON_525_FORMAT; +const thomson_35_format FLOPPY_THOMSON_35_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/thom_dsk.h mame-0.243+dfsg.1/src/lib/formats/thom_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/thom_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/thom_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -34,7 +34,7 @@ }; -extern const floppy_format_type FLOPPY_THOMSON_525_FORMAT; -extern const floppy_format_type FLOPPY_THOMSON_35_FORMAT; +extern const thomson_525_format FLOPPY_THOMSON_525_FORMAT; +extern const thomson_35_format FLOPPY_THOMSON_35_FORMAT; #endif // MAME_FORMATS_THOM_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/ti99_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/ti99_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/ti99_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/ti99_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -81,7 +81,7 @@ /* Load the image from disk and convert it into a sequence of flux levels. */ -bool ti99_floppy_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool ti99_floppy_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { uint64_t file_size; if (io.length(file_size)) @@ -215,7 +215,7 @@ /* Save all tracks to the image file. */ -bool ti99_floppy_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) +bool ti99_floppy_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const { uint8_t sectordata[9216]; // max size (36*256) @@ -920,7 +920,7 @@ return "dsk"; } -int ti99_sdf_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int ti99_sdf_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint64_t file_size; if (io.length(file_size)) @@ -943,7 +943,7 @@ case 368640: // DSDD case 737280: // DSDD80 case 1474560: // DSQD - vote = 50; + vote = FIFID_SIZE; break; default: vote = 0; @@ -961,7 +961,7 @@ if ((vib.id[0]=='D')&&(vib.id[1]=='S')&&(vib.id[2]=='K')) { LOGMASKED(LOG_INFO, "[ti99_dsk] Found formatted SDF disk medium\n"); - vote = 100; + vote |= FIFID_SIGN; } else { @@ -972,7 +972,7 @@ return vote; } -void ti99_sdf_format::determine_sizes(util::random_read &io, int& cell_size, int& sector_count, int& heads, int& tracks) +void ti99_sdf_format::determine_sizes(util::random_read &io, int& cell_size, int& sector_count, int& heads, int& tracks) const { uint64_t file_size; if (io.length(file_size)) @@ -1068,12 +1068,12 @@ } } -int ti99_sdf_format::get_track_size(int sector_count) +int ti99_sdf_format::get_track_size(int sector_count) const { return sector_count * SECTOR_SIZE; } -void ti99_sdf_format::load_track(util::random_read &io, uint8_t *sectordata, int *sector, int *secoffset, int head, int track, int sectorcount, int trackcount) +void ti99_sdf_format::load_track(util::random_read &io, uint8_t *sectordata, int *sector, int *secoffset, int head, int track, int sectorcount, int trackcount) const { // Calculate the track offset from the beginning of the image file int logicaltrack = (head==0)? track : (2*trackcount - track - 1); @@ -1118,7 +1118,7 @@ /* For debugging. Outputs the byte array in a xxd-like way. */ -void ti99_floppy_format::dumpbytes(uint8_t* trackdata, int length) +void ti99_floppy_format::dumpbytes(const uint8_t* trackdata, int length) { for (int i=0; i < length; i+=16) { @@ -1126,7 +1126,7 @@ } } -std::string ti99_floppy_format::dumpline(uint8_t* line, int address) const +std::string ti99_floppy_format::dumpline(const uint8_t* line, int address) { std::ostringstream stream; stream << std::hex << std::setfill('0') << std::setw(6) << unsigned(address); @@ -1148,7 +1148,7 @@ Write the data to the disk. We have a list of sector positions, so we just need to go through that list and save each sector in the sector data. */ -void ti99_sdf_format::write_track(util::random_read_write &io, uint8_t *sectordata, int *sector, int track, int head, int sector_count, int track_count) +void ti99_sdf_format::write_track(util::random_read_write &io, uint8_t *sectordata, int *sector, int track, int head, int sector_count, int track_count) const { int logicaltrack = head * track_count; logicaltrack += ((head&1)==0)? track : (track_count - 1 - track); @@ -1164,7 +1164,7 @@ } -const floppy_format_type FLOPPY_TI99_SDF_FORMAT = &floppy_image_format_creator; +const ti99_sdf_format FLOPPY_TI99_SDF_FORMAT; /* Track Dump Format @@ -1223,7 +1223,7 @@ /* Determine whether the image file can be interpreted as a track dump */ -int ti99_tdf_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int ti99_tdf_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { int vote = 0; uint8_t fulltrack[6872]; @@ -1239,7 +1239,7 @@ // Do we have a plausible image size? From the size alone we only give a 50 percent vote. if (sector_count != 0) - vote = 50; + vote = FIFID_SIZE; if (vote > 0) { @@ -1283,7 +1283,7 @@ else { LOGMASKED(LOG_INFO, "[ti99_dsk] Image format complies with TDF\n"); - vote = 100; + vote |= FIFID_STRUCT; } } else LOGMASKED(LOG_INFO, "[ti99_dsk] Disk image is not a TDF image\n"); @@ -1294,7 +1294,7 @@ Find the proper format for a given image file. Tracks are counted per side. Note that only two formats are actually compatible with the PC99 emulator. */ -void ti99_tdf_format::determine_sizes(util::random_read &io, int& cell_size, int& sector_count, int& heads, int& tracks) +void ti99_tdf_format::determine_sizes(util::random_read &io, int& cell_size, int& sector_count, int& heads, int& tracks) const { uint64_t file_size; if (io.length(file_size)) @@ -1356,7 +1356,7 @@ track from scratch. TDF is not as flexible as it suggests, it does not allow different gap lengths and so on. */ -void ti99_tdf_format::load_track(util::random_read &io, uint8_t *sectordata, int *sector, int *secoffset, int head, int track, int sectorcount, int trackcount) +void ti99_tdf_format::load_track(util::random_read &io, uint8_t *sectordata, int *sector, int *secoffset, int head, int track, int sectorcount, int trackcount) const { size_t actual; uint8_t fulltrack[12544]; // space for a full TDF track @@ -1452,7 +1452,7 @@ need the sector contents and the sector sequence, which are passed via sectordata, sector, and sector_count. */ -void ti99_tdf_format::write_track(util::random_read_write &io, uint8_t *sectordata, int *sector, int track, int head, int sector_count, int track_count) +void ti99_tdf_format::write_track(util::random_read_write &io, uint8_t *sectordata, int *sector, int track, int head, int sector_count, int track_count) const { uint8_t trackdata[12544]; int offset = ((track_count * head) + track) * get_track_size(sector_count); @@ -1510,7 +1510,7 @@ io.write_at(offset, trackdata, get_track_size(sector_count), actual); } -int ti99_tdf_format::get_track_size(int sector_count) +int ti99_tdf_format::get_track_size(int sector_count) const { switch (sector_count) { @@ -1526,4 +1526,4 @@ return 0; } -const floppy_format_type FLOPPY_TI99_TDF_FORMAT = &floppy_image_format_creator; +const ti99_tdf_format FLOPPY_TI99_TDF_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/ti99_dsk.h mame-0.243+dfsg.1/src/lib/formats/ti99_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/ti99_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/ti99_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -23,28 +23,28 @@ { public: bool supports_save() const override { return true; } - bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; - bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) override; + bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; + bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const override; protected: - uint8_t get_data_from_encoding(uint16_t raw); - int get_sectors(const std::vector &bitstream, int encoding, int track, int head, int sectors, uint8_t *sectordata, int *secnumber); + static uint8_t get_data_from_encoding(uint16_t raw); + static int get_sectors(const std::vector &bitstream, int encoding, int track, int head, int sectors, uint8_t *sectordata, int *secnumber); - virtual int min_heads() =0; + virtual int min_heads() const =0; - virtual void determine_sizes(util::random_read &io, int& cell_size, int& sector_count, int& heads, int& tracks) =0; - virtual int get_track_size(int sector_count) =0; - virtual void load_track(util::random_read &io, uint8_t *sectordata, int *sector, int *secoffset, int head, int track, int sectorcount, int trackcount) =0; - virtual void write_track(util::random_read_write &io, uint8_t *sectordata, int *sector, int track, int head, int sector_count, int track_count) =0; + virtual void determine_sizes(util::random_read &io, int& cell_size, int& sector_count, int& heads, int& tracks) const =0; + virtual int get_track_size(int sector_count) const=0; + virtual void load_track(util::random_read &io, uint8_t *sectordata, int *sector, int *secoffset, int head, int track, int sectorcount, int trackcount) const=0; + virtual void write_track(util::random_read_write &io, uint8_t *sectordata, int *sector, int track, int head, int sector_count, int track_count) const=0; - int get_encoding(int cell_size); + static int get_encoding(int cell_size); - void generate_fm_track_from_sectors(floppy_image *image, uint8_t *sectordata, int sector_count, int *sector, int *secoffset, int track, int trackid, int head); - void generate_mfm_track_from_sectors(floppy_image *image, uint8_t *sectordata, int sector_count, int *sector, int *secoffset, int track, int trackid, int head); + static void generate_fm_track_from_sectors(floppy_image *image, uint8_t *sectordata, int sector_count, int *sector, int *secoffset, int track, int trackid, int head); + static void generate_mfm_track_from_sectors(floppy_image *image, uint8_t *sectordata, int sector_count, int *sector, int *secoffset, int track, int trackid, int head); // Debugging - void dumpbytes(uint8_t* trackdata, int length); - std::string dumpline(uint8_t* line, int address) const; + static void dumpbytes(const uint8_t* trackdata, int length); + static std::string dumpline(const uint8_t* line, int address); }; /* @@ -53,19 +53,19 @@ class ti99_sdf_format : public ti99_floppy_format { public: - int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; + int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; const char *name() const override; const char *description() const override; const char *extensions() const override; private: - void determine_sizes(util::random_read &io, int& cell_size, int& sector_count, int& heads, int& tracks) override; - int get_track_size(int sector_count) override; - void write_track(util::random_read_write &io, uint8_t *sectordata, int *sector, int track, int head, int sector_count, int track_count) override; - void load_track(util::random_read &io, uint8_t *sectordata, int *sector, int *secoffset, int head, int track, int sector_count, int track_count) override; + void determine_sizes(util::random_read &io, int& cell_size, int& sector_count, int& heads, int& tracks) const override; + int get_track_size(int sector_count) const override; + void write_track(util::random_read_write &io, uint8_t *sectordata, int *sector, int track, int head, int sector_count, int track_count) const override; + void load_track(util::random_read &io, uint8_t *sectordata, int *sector, int *secoffset, int head, int track, int sector_count, int track_count) const override; // This format supports single-sided images - int min_heads() override { return 1; } + int min_heads() const override { return 1; } struct ti99vib { @@ -84,7 +84,7 @@ }; }; -extern const floppy_format_type FLOPPY_TI99_SDF_FORMAT; +extern const ti99_sdf_format FLOPPY_TI99_SDF_FORMAT; /* Implementation of the track dump format. @@ -92,21 +92,21 @@ class ti99_tdf_format : public ti99_floppy_format { public: - int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; + int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; const char *name() const override; const char *description() const override; const char *extensions() const override; private: - void determine_sizes(util::random_read &io, int& cell_size, int& sector_count, int& heads, int& tracks) override; - void load_track(util::random_read &io, uint8_t *sectordata, int *sector, int *secoffset, int head, int track, int sectorcount, int trackcount) override; - void write_track(util::random_read_write &io, uint8_t *sectordata, int *sector, int track, int head, int sector_count, int track_count) override; - int get_track_size(int sector_count) override; + void determine_sizes(util::random_read &io, int& cell_size, int& sector_count, int& heads, int& tracks) const override; + void load_track(util::random_read &io, uint8_t *sectordata, int *sector, int *secoffset, int head, int track, int sectorcount, int trackcount) const override; + void write_track(util::random_read_write &io, uint8_t *sectordata, int *sector, int track, int head, int sector_count, int track_count) const override; + int get_track_size(int sector_count) const override; // This format only supports double-sided images - int min_heads() override { return 2; } + int min_heads() const override { return 2; } }; -extern const floppy_format_type FLOPPY_TI99_TDF_FORMAT; +extern const ti99_tdf_format FLOPPY_TI99_TDF_FORMAT; #endif // MAME_FORMATS_TI99_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/tiki100_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/tiki100_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/tiki100_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/tiki100_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -114,4 +114,4 @@ {} }; -const floppy_format_type FLOPPY_TIKI100_FORMAT = &floppy_image_format_creator; +const tiki100_format FLOPPY_TIKI100_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/tiki100_dsk.h mame-0.243+dfsg.1/src/lib/formats/tiki100_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/tiki100_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/tiki100_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -27,6 +27,6 @@ static const format formats[]; }; -extern const floppy_format_type FLOPPY_TIKI100_FORMAT; +extern const tiki100_format FLOPPY_TIKI100_FORMAT; #endif // MAME_FORMATS_TIKI100_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/trd_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/trd_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/trd_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/trd_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -32,7 +32,7 @@ return "trd"; } -int trd_format::find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int trd_format::find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint64_t size; if (io.length(size)) @@ -110,4 +110,4 @@ {} }; -const floppy_format_type FLOPPY_TRD_FORMAT = &floppy_image_format_creator; +const trd_format FLOPPY_TRD_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/trd_dsk.h mame-0.243+dfsg.1/src/lib/formats/trd_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/trd_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/trd_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -24,9 +24,9 @@ private: static const format formats[]; - virtual int find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; + virtual int find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; }; -extern const floppy_format_type FLOPPY_TRD_FORMAT; +extern const trd_format FLOPPY_TRD_FORMAT; #endif // MAME_FORMATS_TRD_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/trs80_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/trs80_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/trs80_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/trs80_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -90,7 +90,7 @@ return "jv1,dsk"; } -int jv1_format::get_track_dam_fm(const format &f, int head, int track) +int jv1_format::get_track_dam_fm(const format &f, int head, int track) const { return (track == 17 && head == 0) ? FM_DDAM : FM_DAM; } @@ -112,7 +112,7 @@ {} }; -const floppy_format_type FLOPPY_JV1_FORMAT = &floppy_image_format_creator; +const jv1_format FLOPPY_JV1_FORMAT; #define MAX_SECTORS 19 @@ -137,7 +137,7 @@ return "jv3,dsk"; } -int jv3_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int jv3_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint64_t image_size; if (io.length(image_size)) @@ -226,10 +226,10 @@ return 0; } - return 80; + return FIFID_STRUCT; } -bool jv3_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool jv3_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { // disk has already been validated in every way except if it exceeds drive tracks, we do that below osd_printf_info("Disk detected as JV3\n"); @@ -356,7 +356,7 @@ return true; } -bool jv3_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) +bool jv3_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const { int track_count, head_count; image->get_actual_geometry(track_count, head_count); @@ -455,5 +455,5 @@ return true; } -const floppy_format_type FLOPPY_JV3_FORMAT = &floppy_image_format_creator; +const jv3_format FLOPPY_JV3_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/trs80_dsk.h mame-0.243+dfsg.1/src/lib/formats/trs80_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/trs80_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/trs80_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -24,7 +24,7 @@ virtual const char *extensions() const override; protected: - virtual int get_track_dam_fm(const format &f, int head, int track) override; + virtual int get_track_dam_fm(const format &f, int head, int track) const override; private: static const format formats[]; @@ -35,9 +35,9 @@ public: jv3_format(); - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; - virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; + virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const override; virtual const char *name() const override; virtual const char *description() const override; @@ -45,7 +45,7 @@ virtual bool supports_save() const override; }; -extern const floppy_format_type FLOPPY_JV1_FORMAT; -extern const floppy_format_type FLOPPY_JV3_FORMAT; +extern const jv1_format FLOPPY_JV1_FORMAT; +extern const jv3_format FLOPPY_JV3_FORMAT; #endif // MAME_FORMATS_TRS80_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/tvc_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/tvc_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/tvc_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/tvc_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -43,4 +43,4 @@ {} }; -const floppy_format_type FLOPPY_TVC_FORMAT = &floppy_image_format_creator; +const tvc_format FLOPPY_TVC_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/tvc_dsk.h mame-0.243+dfsg.1/src/lib/formats/tvc_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/tvc_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/tvc_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -27,6 +27,6 @@ static const format formats[]; }; -extern const floppy_format_type FLOPPY_TVC_FORMAT; +extern const tvc_format FLOPPY_TVC_FORMAT; #endif // MAME_FORMATS_TVC_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/uniflex_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/uniflex_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/uniflex_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/uniflex_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -34,17 +34,17 @@ return "dsk"; } -int uniflex_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int uniflex_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { int const type = find_size(io, form_factor, variants); if (type != -1) - return 75; + return FIFID_SIZE; return 0; } -int uniflex_format::find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int uniflex_format::find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint64_t size; if (io.length(size)) @@ -154,4 +154,4 @@ {} }; -const floppy_format_type FLOPPY_UNIFLEX_FORMAT = &floppy_image_format_creator; +const uniflex_format FLOPPY_UNIFLEX_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/uniflex_dsk.h mame-0.243+dfsg.1/src/lib/formats/uniflex_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/uniflex_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/uniflex_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -19,14 +19,14 @@ virtual const char *name() const override; virtual const char *description() const override; virtual const char *extensions() const override; - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual int find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual int find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; void build_sector_description(const format &f, uint8_t *sectdata, desc_s *sectors, int track, int head) const override; private: static const format formats[]; }; -extern const floppy_format_type FLOPPY_UNIFLEX_FORMAT; +extern const uniflex_format FLOPPY_UNIFLEX_FORMAT; #endif // MAME_FORMATS_UNIFLEX_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/upd765_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/upd765_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/upd765_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/upd765_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -17,7 +17,7 @@ #include -upd765_format::upd765_format(const format *_formats) : file_header_skip_bytes(0), file_footer_skip_bytes(0), formats(_formats) +upd765_format::upd765_format(const format *_formats) : formats(_formats) { } @@ -34,18 +34,18 @@ if(!variants.empty() && !has_variant(variants, f.variant)) continue; - if(size == file_header_skip_bytes + (uint64_t) compute_track_size(f) * f.track_count * f.head_count + file_footer_skip_bytes) + if(size == compute_track_size(f) * f.track_count * f.head_count) return i; } return -1; } -int upd765_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int upd765_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { int type = find_size(io, form_factor, variants); if(type != -1) - return 50; + return FIFID_SIZE; return 0; } @@ -85,7 +85,7 @@ } } -floppy_image_format_t::desc_e* upd765_format::get_desc_fm(const format &f, int ¤t_size, int &end_gap_index) +floppy_image_format_t::desc_e* upd765_format::get_desc_fm(const format &f, int ¤t_size, int &end_gap_index) const { static floppy_image_format_t::desc_e desc[26] = { /* 00 */ { FM, 0xff, f.gap_4a }, @@ -130,7 +130,7 @@ return desc; } -floppy_image_format_t::desc_e* upd765_format::get_desc_mfm(const format &f, int ¤t_size, int &end_gap_index) +floppy_image_format_t::desc_e* upd765_format::get_desc_mfm(const format &f, int ¤t_size, int &end_gap_index) const { static floppy_image_format_t::desc_e desc[29] = { /* 00 */ { MFM, 0x4e, 0 }, @@ -184,7 +184,7 @@ return desc; } -bool upd765_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool upd765_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { int type = find_size(io, form_factor, variants); if(type == -1) @@ -232,7 +232,7 @@ for(int head=0; head < f.head_count; head++) { build_sector_description(f, sectdata, sectors, track, head); size_t actual; - io.read_at(file_header_skip_bytes + (track*f.head_count + head)*track_size, sectdata, track_size, actual); + io.read_at((track*f.head_count + head)*track_size, sectdata, track_size, actual); generate_track(desc, track, head, sectors, f.sector_count, total_size, image); } @@ -246,7 +246,7 @@ return true; } -bool upd765_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) +bool upd765_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const { // Count the number of formats int formats_count; @@ -363,7 +363,7 @@ return true; } -void upd765_format::check_compatibility(floppy_image *image, std::vector &candidates) +void upd765_format::check_compatibility(floppy_image *image, std::vector &candidates) const { // Extract the sectors auto bitstream = generate_bitstream_from_track(0, 0, formats[candidates[0]].cell_size, image); @@ -413,7 +413,7 @@ } -void upd765_format::extract_sectors(floppy_image *image, const format &f, desc_s *sdesc, int track, int head) +void upd765_format::extract_sectors(floppy_image *image, const format &f, desc_s *sdesc, int track, int head) const { // Extract the sectors auto bitstream = generate_bitstream_from_track(track, head, f.cell_size, image); diff -Nru mame-0.242+dfsg.1/src/lib/formats/upd765_dsk.h mame-0.243+dfsg.1/src/lib/formats/upd765_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/upd765_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/upd765_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -39,22 +39,19 @@ // End the array with {} upd765_format(const format *formats); - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; - virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; + virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const override; virtual bool supports_save() const override; protected: - uint64_t file_header_skip_bytes; - uint64_t file_footer_skip_bytes; - - floppy_image_format_t::desc_e* get_desc_fm(const format &f, int ¤t_size, int &end_gap_index); - floppy_image_format_t::desc_e* get_desc_mfm(const format &f, int ¤t_size, int &end_gap_index); + floppy_image_format_t::desc_e* get_desc_fm(const format &f, int ¤t_size, int &end_gap_index) const; + floppy_image_format_t::desc_e* get_desc_mfm(const format &f, int ¤t_size, int &end_gap_index) const; int find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) const; int compute_track_size(const format &f) const; virtual void build_sector_description(const format &d, uint8_t *sectdata, desc_s *sectors, int track, int head) const; - void check_compatibility(floppy_image *image, std::vector &candidates); - void extract_sectors(floppy_image *image, const format &f, desc_s *sdesc, int track, int head); + void check_compatibility(floppy_image *image, std::vector &candidates) const; + void extract_sectors(floppy_image *image, const format &f, desc_s *sdesc, int track, int head) const; private: format const *const formats; diff -Nru mame-0.242+dfsg.1/src/lib/formats/vdk_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/vdk_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/vdk_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/vdk_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -34,19 +34,19 @@ return "vdk"; } -int vdk_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int vdk_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { size_t actual; uint8_t id[2]; io.read_at(0, id, 2, actual); if (id[0] == 'd' && id[1] == 'k') - return 50; + return FIFID_SIGN; else return 0; } -bool vdk_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool vdk_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { size_t actual; if (io.seek(0, SEEK_SET)) @@ -93,7 +93,7 @@ return true; } -bool vdk_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) +bool vdk_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const { size_t actual; if (io.seek(0, SEEK_SET)) @@ -141,4 +141,4 @@ return true; } -const floppy_format_type FLOPPY_VDK_FORMAT = &floppy_image_format_creator; +const vdk_format FLOPPY_VDK_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/vdk_dsk.h mame-0.243+dfsg.1/src/lib/formats/vdk_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/vdk_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/vdk_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -25,9 +25,9 @@ virtual const char *description() const override; virtual const char *extensions() const override; - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; - virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; + virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const override; virtual bool supports_save() const override; private: @@ -36,6 +36,6 @@ static const int FIRST_SECTOR_ID = 1; }; -extern const floppy_format_type FLOPPY_VDK_FORMAT; +extern const vdk_format FLOPPY_VDK_FORMAT; #endif // MAME_FORMATS_VDK_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/vector06_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/vector06_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/vector06_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/vector06_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -45,4 +45,4 @@ {} }; -const floppy_format_type FLOPPY_VECTOR06_FORMAT = &floppy_image_format_creator; +const vector06_format FLOPPY_VECTOR06_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/vector06_dsk.h mame-0.243+dfsg.1/src/lib/formats/vector06_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/vector06_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/vector06_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -27,6 +27,6 @@ static const format formats[]; }; -extern const floppy_format_type FLOPPY_VECTOR06_FORMAT; +extern const vector06_format FLOPPY_VECTOR06_FORMAT; #endif // MAME_FORMATS_VECTOR06_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/victor9k_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/victor9k_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/victor9k_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/victor9k_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -141,12 +141,12 @@ return -1; } -int victor9k_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int victor9k_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { int type = find_size(io, form_factor); if (type != -1) - return 50; + return FIFID_SIZE; return 0; } @@ -248,7 +248,7 @@ return desc; } -void victor9k_format::build_sector_description(const format &f, uint8_t *sectdata, uint32_t sect_offs, desc_s *sectors, int sector_count) const +void victor9k_format::build_sector_description(const format &f, uint8_t *sectdata, uint32_t sect_offs, desc_s *sectors, int sector_count) { for (int i = 0; i < sector_count; i++) { sectors[i].data = sectdata + sect_offs; @@ -259,7 +259,7 @@ } } -bool victor9k_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool victor9k_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { int const type = find_size(io, form_factor); if(type == -1) @@ -408,7 +408,7 @@ 252, 267, 283, 300, 321, 342, 368, 401, 417 }; -bool victor9k_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) +bool victor9k_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const { const format &f = formats[0]; @@ -449,4 +449,4 @@ } } -const floppy_format_type FLOPPY_VICTOR_9000_FORMAT = &floppy_image_format_creator; +const victor9k_format FLOPPY_VICTOR_9000_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/victor9k_dsk.h mame-0.243+dfsg.1/src/lib/formats/victor9k_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/victor9k_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/victor9k_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -34,9 +34,9 @@ virtual const char *description() const override; virtual const char *extensions() const override; - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; - virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; + virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const override; virtual bool supports_save() const override { return true; } static int get_rpm(int head, int track); @@ -49,16 +49,16 @@ static const int speed_zone[2][80]; static const int rpm[9]; - int find_size(util::random_read &io, uint32_t form_factor); - void log_boot_sector(uint8_t *data); - floppy_image_format_t::desc_e* get_sector_desc(const format &f, int ¤t_size, int sector_count); - void build_sector_description(const format &f, uint8_t *sectdata, uint32_t sect_offs, desc_s *sectors, int sector_count) const; - int get_image_offset(const format &f, int head, int track); - int compute_track_size(const format &f, int head, int track); - void extract_sectors(floppy_image *image, const format &f, desc_s *sdesc, int track, int head, int sector_count); + static int find_size(util::random_read &io, uint32_t form_factor); + static void log_boot_sector(uint8_t *data); + static floppy_image_format_t::desc_e* get_sector_desc(const format &f, int ¤t_size, int sector_count); + static void build_sector_description(const format &f, uint8_t *sectdata, uint32_t sect_offs, desc_s *sectors, int sector_count); + static int get_image_offset(const format &f, int head, int track); + static int compute_track_size(const format &f, int head, int track); + static void extract_sectors(floppy_image *image, const format &f, desc_s *sdesc, int track, int head, int sector_count); }; -extern const floppy_format_type FLOPPY_VICTOR_9000_FORMAT; +extern const victor9k_format FLOPPY_VICTOR_9000_FORMAT; #endif // MAME_FORMATS_VICTOR9K_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/vt_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/vt_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/vt_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/vt_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -17,23 +17,20 @@ // One = | 2237 | 6950 | // 0.5us ~= 143 -void vtech_common_format::wbit(std::vector &buffer, uint32_t &pos, uint32_t &mg, bool bit) +void vtech_common_format::wbit(std::vector &buffer, uint32_t &pos, bool bit) { - buffer.push_back(pos | mg); - mg = mg == floppy_image::MG_A ? floppy_image::MG_B : floppy_image::MG_A; if(bit) { pos += 2237; - buffer.push_back(pos | mg); - mg = mg == floppy_image::MG_A ? floppy_image::MG_B : floppy_image::MG_A; + buffer.push_back(pos | floppy_image::MG_F); pos += 6950; } else pos += 9187; } -void vtech_common_format::wbyte(std::vector &buffer, uint32_t &pos, uint32_t &mg, uint8_t byte) +void vtech_common_format::wbyte(std::vector &buffer, uint32_t &pos, uint8_t byte) { for(int i = 7; i >= 0; i--) - wbit(buffer, pos, mg, (byte >> i) & 1); + wbit(buffer, pos, (byte >> i) & 1); } void vtech_common_format::image_to_flux(const std::vector &bdata, floppy_image *image) @@ -44,40 +41,39 @@ for(int track = 0; track != 40; track ++) { uint32_t pos = 0; - uint32_t mg = floppy_image::MG_A; std::vector &buffer = image->get_buffer(track, 0); buffer.clear(); image->set_write_splice_position(track, 0, 0); // One window of pad at the start to avoid problems with the write splice - wbit(buffer, pos, mg, 0); + wbit(buffer, pos, 0); for(int sector = 0; sector != 16; sector ++) { uint8_t sid = sector_map[sector]; for(int i=0; i != 7; i++) - wbyte(buffer, pos, mg, 0x80); - wbyte(buffer, pos, mg, 0x00); - wbyte(buffer, pos, mg, 0xfe); - wbyte(buffer, pos, mg, 0xe7); - wbyte(buffer, pos, mg, 0x18); - wbyte(buffer, pos, mg, 0xc3); - wbyte(buffer, pos, mg, track); - wbyte(buffer, pos, mg, sid); - wbyte(buffer, pos, mg, track+sid); + wbyte(buffer, pos, 0x80); + wbyte(buffer, pos, 0x00); + wbyte(buffer, pos, 0xfe); + wbyte(buffer, pos, 0xe7); + wbyte(buffer, pos, 0x18); + wbyte(buffer, pos, 0xc3); + wbyte(buffer, pos, track); + wbyte(buffer, pos, sid); + wbyte(buffer, pos, track+sid); for(int i=0; i != 5; i++) - wbyte(buffer, pos, mg, 0x80); - wbyte(buffer, pos, mg, 0x00); - wbyte(buffer, pos, mg, 0xc3); - wbyte(buffer, pos, mg, 0x18); - wbyte(buffer, pos, mg, 0xe7); - wbyte(buffer, pos, mg, 0xfe); + wbyte(buffer, pos, 0x80); + wbyte(buffer, pos, 0x00); + wbyte(buffer, pos, 0xc3); + wbyte(buffer, pos, 0x18); + wbyte(buffer, pos, 0xe7); + wbyte(buffer, pos, 0xfe); uint16_t chk = 0; const uint8_t *src = bdata.data() + 16*128*track + 128*sid; for(int i=0; i != 128; i++) { chk += src[i]; - wbyte(buffer, pos, mg, src[i]); + wbyte(buffer, pos, src[i]); } - wbyte(buffer, pos, mg, chk); - wbyte(buffer, pos, mg, chk >> 8); + wbyte(buffer, pos, chk); + wbyte(buffer, pos, chk >> 8); } // Rest is just not formatted buffer.push_back(pos | floppy_image::MG_N); @@ -95,29 +91,37 @@ continue; std::vector bitstream; - int lpos = -1; - bool looped = !((buffer[sz-1] ^ buffer[0]) & floppy_image::MG_MASK); - int cpos = looped ? sz-1 : 0; - while(cpos != lpos) { - int dt = looped && cpos == sz-1 ? (200000000 - (buffer[cpos] & floppy_image::TIME_MASK)) + (buffer[1] & floppy_image::TIME_MASK) : - cpos == sz-1 ? 200000000 - (buffer[cpos] & floppy_image::TIME_MASK) : - (buffer[cpos+1] & floppy_image::TIME_MASK) - (buffer[cpos] & floppy_image::TIME_MASK); - int t = dt >= 9187 - 143 ? 0 : - dt >= 2237 - 143 && dt <= 2237 + 143 ? 1 : - 2; - if(t <= 1) { - if(lpos == -1) - lpos = cpos; - bitstream.push_back(t); + int cpos = 0; + while((buffer[cpos] & floppy_image::MG_MASK) != floppy_image::MG_F) { + cpos++; + if(cpos == sz) { + cpos = -1; + break; } - cpos += 1; - if(cpos == sz) - cpos = looped ? 1 : 0; + } + if(cpos == -1) + continue; + for(;;) { + int npos = cpos; + for(;;) { + npos ++; + if(npos == sz) + npos = 0; + if((buffer[npos] & floppy_image::MG_MASK) == floppy_image::MG_F) + break; + } + int dt = (buffer[npos] & floppy_image::TIME_MASK) - (buffer[cpos] & floppy_image::TIME_MASK); + if(dt < 0) + cpos += 200000000; + bitstream.push_back(dt < 9187 - 143); + if(npos <= cpos) + break; + cpos = npos; } int mode = 0; - looped = false; int pos = 0; int count = 0; + bool looped = false; uint8_t *dest = nullptr; [[maybe_unused]] uint16_t checksum = 0; uint64_t buf = 0; @@ -216,19 +220,19 @@ return "dsk"; } -int vtech_bin_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int vtech_bin_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint64_t size; if(io.length(size)) return 0; if(size == 40*16*256) - return 50; + return FIFID_SIZE; return 0; } -int vtech_dsk_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int vtech_dsk_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint64_t size; if(io.length(size)) @@ -252,10 +256,10 @@ count_sd++; } - return count_sh >= 30*16 && count_sd >= 30*16 ? 100 : 0; + return count_sh >= 30*16 && count_sd >= 30*16 ? FIFID_STRUCT : 0; } -bool vtech_bin_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool vtech_bin_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { uint64_t size; if(io.length(size) || (size != 40*16*256)) @@ -270,7 +274,7 @@ return true; } -bool vtech_dsk_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool vtech_dsk_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { uint64_t size; if(io.length(size)) @@ -340,7 +344,7 @@ return true; } -bool vtech_bin_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) +bool vtech_bin_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const { int tracks, heads; image->get_maximal_geometry(tracks, heads); @@ -353,7 +357,7 @@ return true; } -bool vtech_dsk_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) +bool vtech_dsk_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const { int tracks, heads; image->get_maximal_geometry(tracks, heads); @@ -407,5 +411,5 @@ } -const floppy_format_type FLOPPY_VTECH_BIN_FORMAT = &floppy_image_format_creator; -const floppy_format_type FLOPPY_VTECH_DSK_FORMAT = &floppy_image_format_creator; +const vtech_bin_format FLOPPY_VTECH_BIN_FORMAT; +const vtech_dsk_format FLOPPY_VTECH_DSK_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/vt_dsk.h mame-0.243+dfsg.1/src/lib/formats/vt_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/vt_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/vt_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -22,8 +22,8 @@ static void image_to_flux(const std::vector &bdata, floppy_image *image); static std::vector flux_to_image(floppy_image *image); - static void wbit(std::vector &buffer, uint32_t &pos, uint32_t &mg, bool bit); - static void wbyte(std::vector &buffer, uint32_t &pos, uint32_t &mg, uint8_t byte); + static void wbit(std::vector &buffer, uint32_t &pos, bool bit); + static void wbyte(std::vector &buffer, uint32_t &pos, uint8_t byte); }; class vtech_bin_format : public vtech_common_format { @@ -34,9 +34,9 @@ virtual const char *description() const override; virtual const char *extensions() const override; - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; - virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; + virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const override; }; class vtech_dsk_format : public vtech_common_format { @@ -47,12 +47,12 @@ virtual const char *description() const override; virtual const char *extensions() const override; - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; - virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; + virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const override; }; -extern const floppy_format_type FLOPPY_VTECH_BIN_FORMAT; -extern const floppy_format_type FLOPPY_VTECH_DSK_FORMAT; +extern const vtech_bin_format FLOPPY_VTECH_BIN_FORMAT; +extern const vtech_dsk_format FLOPPY_VTECH_DSK_FORMAT; #endif // MAME_FORMATS_VT_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/wd177x_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/wd177x_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/wd177x_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/wd177x_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -27,7 +27,7 @@ // encoded disk, or a track with an different sector IDs etc. Only the track // encoding is used from the returned format, the number of track_count is not // accessed. -const wd177x_format::format &wd177x_format::get_track_format(const format &f, int head, int track) +const wd177x_format::format &wd177x_format::get_track_format(const format &f, int head, int track) const { return f; } @@ -35,7 +35,7 @@ /* Default implementation for find_size. May be overwritten by subclasses. */ -int wd177x_format::find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int wd177x_format::find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { uint64_t size; if(io.length(size)) @@ -62,18 +62,18 @@ return -1; } -int wd177x_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) +int wd177x_format::identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const { int const type = find_size(io, form_factor, variants); if(type != -1) - return 50; + return FIFID_SIZE; return 0; } // A track specific format is to be supplied. -int wd177x_format::compute_track_size(const format &f) const +int wd177x_format::compute_track_size(const format &f) { int track_size; if(f.sector_base_size) @@ -111,7 +111,7 @@ } // A track specific format is to be supplied. -floppy_image_format_t::desc_e* wd177x_format::get_desc_fm(const format &f, int ¤t_size, int &end_gap_index) +floppy_image_format_t::desc_e* wd177x_format::get_desc_fm(const format &f, int ¤t_size, int &end_gap_index) const { static floppy_image_format_t::desc_e desc[23] = { /* 00 */ { FM, 0xff, 0 }, @@ -159,7 +159,7 @@ } // A track specific format is to be supplied. -floppy_image_format_t::desc_e* wd177x_format::get_desc_mfm(const format &f, int ¤t_size, int &end_gap_index) +floppy_image_format_t::desc_e* wd177x_format::get_desc_mfm(const format &f, int ¤t_size, int &end_gap_index) const { static floppy_image_format_t::desc_e desc[25] = { /* 00 */ { MFM, 0x4e, 0 }, @@ -208,7 +208,7 @@ return desc; } -bool wd177x_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) +bool wd177x_format::load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const { int const type = find_size(io, form_factor, variants); if(type == -1) @@ -277,7 +277,7 @@ return true; } -bool wd177x_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) +bool wd177x_format::save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const { // Count the number of formats int formats_count; @@ -401,7 +401,7 @@ Default implementation of the image offset computation. May be overwritten by subclasses. */ -int wd177x_format::get_image_offset(const format &f, int head, int track) +int wd177x_format::get_image_offset(const format &f, int head, int track) const { int offset = 0; @@ -422,20 +422,20 @@ } // A track specific format is to be supplied. -int wd177x_format::get_track_dam_fm(const format &f, int head, int track) +int wd177x_format::get_track_dam_fm(const format &f, int head, int track) const { // everything marked as data by default return FM_DAM; } // A track specific format is to be supplied. -int wd177x_format::get_track_dam_mfm(const format &f, int head, int track) +int wd177x_format::get_track_dam_mfm(const format &f, int head, int track) const { // everything marked as data by default return MFM_DAM; } -void wd177x_format::check_compatibility(floppy_image *image, std::vector &candidates) +void wd177x_format::check_compatibility(floppy_image *image, std::vector &candidates) const { // Check compatibility with every candidate, copy in-place int *ok_cands = &candidates[0]; diff -Nru mame-0.242+dfsg.1/src/lib/formats/wd177x_dsk.h mame-0.243+dfsg.1/src/lib/formats/wd177x_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/wd177x_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/wd177x_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -38,9 +38,9 @@ // End the array with {} wd177x_format(const format *formats); - virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) override; - virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) override; - virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) override; + virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector &variants) const override; + virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector &variants, floppy_image *image) const override; + virtual bool save(util::random_read_write &io, const std::vector &variants, floppy_image *image) const override; virtual bool supports_save() const override; protected: @@ -48,18 +48,18 @@ const format *formats; - virtual const wd177x_format::format &get_track_format(const format &f, int head, int track); - virtual floppy_image_format_t::desc_e* get_desc_fm(const format &f, int ¤t_size, int &end_gap_index); - virtual floppy_image_format_t::desc_e* get_desc_mfm(const format &f, int ¤t_size, int &end_gap_index); - virtual int find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants); - virtual int get_image_offset(const format &f, int head, int track); - virtual int get_track_dam_fm(const format &f, int head, int track); - virtual int get_track_dam_mfm(const format &f, int head, int track); + virtual const wd177x_format::format &get_track_format(const format &f, int head, int track) const; + virtual floppy_image_format_t::desc_e* get_desc_fm(const format &f, int ¤t_size, int &end_gap_index) const; + virtual floppy_image_format_t::desc_e* get_desc_mfm(const format &f, int ¤t_size, int &end_gap_index) const; + virtual int find_size(util::random_read &io, uint32_t form_factor, const std::vector &variants) const; + virtual int get_image_offset(const format &f, int head, int track) const; + virtual int get_track_dam_fm(const format &f, int head, int track) const; + virtual int get_track_dam_mfm(const format &f, int head, int track) const; - int compute_track_size(const format &f) const; + static int compute_track_size(const format &f); virtual void build_sector_description(const format &d, uint8_t *sectdata, desc_s *sectors, int track, int head) const; - virtual void check_compatibility(floppy_image *image, std::vector &candidates); - void extract_sectors(floppy_image *image, const format &f, desc_s *sdesc, int track, int head); + virtual void check_compatibility(floppy_image *image, std::vector &candidates) const; + static void extract_sectors(floppy_image *image, const format &f, desc_s *sdesc, int track, int head); }; #endif // MAME_FORMATS_WD177X_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/formats/xdf_dsk.cpp mame-0.243+dfsg.1/src/lib/formats/xdf_dsk.cpp --- mame-0.242+dfsg.1/src/lib/formats/xdf_dsk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/xdf_dsk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -42,4 +42,4 @@ {} }; -const floppy_format_type FLOPPY_XDF_FORMAT = &floppy_image_format_creator; +const xdf_format FLOPPY_XDF_FORMAT; diff -Nru mame-0.242+dfsg.1/src/lib/formats/xdf_dsk.h mame-0.243+dfsg.1/src/lib/formats/xdf_dsk.h --- mame-0.242+dfsg.1/src/lib/formats/xdf_dsk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/formats/xdf_dsk.h 2022-04-29 05:37:26.000000000 +0000 @@ -27,6 +27,6 @@ static const format formats[]; }; -extern const floppy_format_type FLOPPY_XDF_FORMAT; +extern const xdf_format FLOPPY_XDF_FORMAT; #endif // MAME_FORMATS_XDF_DSK_H diff -Nru mame-0.242+dfsg.1/src/lib/util/cdrom.cpp mame-0.243+dfsg.1/src/lib/util/cdrom.cpp --- mame-0.242+dfsg.1/src/lib/util/cdrom.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/util/cdrom.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Aaron Giles +// copyright-holders:Aaron Giles,R. Belmont /*************************************************************************** cdrom.c @@ -18,8 +18,9 @@ #include "cdrom.h" -#include "chdcd.h" -#include "corefile.h" +#include "corestr.h" +#include "osdfile.h" +#include "strformat.h" #include #include @@ -31,6 +32,7 @@ /** @brief The verbose. */ #define VERBOSE (0) +#define EXTRA_VERBOSE (0) #if VERBOSE /** @@ -70,58 +72,6 @@ /*************************************************************************** - CONSTANTS -***************************************************************************/ - -/** @brief offset within sector. */ -const int SYNC_OFFSET = 0x000; -/** @brief 12 bytes. */ -const int SYNC_NUM_BYTES = 12; - -/** @brief offset within sector. */ -const int MODE_OFFSET = 0x00f; - -/** @brief offset within sector. */ -const int ECC_P_OFFSET = 0x81c; -/** @brief 2 lots of 86. */ -const int ECC_P_NUM_BYTES = 86; -/** @brief 24 bytes each. */ -const int ECC_P_COMP = 24; - -/** @brief The ECC q offset. */ -const int ECC_Q_OFFSET = ECC_P_OFFSET + 2 * ECC_P_NUM_BYTES; -/** @brief 2 lots of 52. */ -const int ECC_Q_NUM_BYTES = 52; -/** @brief 43 bytes each. */ -const int ECC_Q_COMP = 43; - - - -/*************************************************************************** - TYPE DEFINITIONS -***************************************************************************/ - -/** - * @struct cdrom_file - * - * @brief A cdrom file. - */ - -struct cdrom_file -{ - /** @brief The chd. */ - chd_file * chd; /* CHD file */ - /** @brief The cdtoc. */ - cdrom_toc cdtoc; /* TOC for the CD */ - /** @brief Information describing the track. */ - chdcd_track_input_info track_info; /* track info */ - /** @brief The fhandle[ CD maximum tracks]. */ - util::core_file::ptr fhandle[CD_MAX_TRACKS];/* file handle */ -}; - - - -/*************************************************************************** INLINE FUNCTIONS ***************************************************************************/ @@ -131,27 +81,23 @@ -------------------------------------------------*/ /** - * @fn static inline uint32_t physical_to_chd_lba(cdrom_file *file, uint32_t physlba, uint32_t &tracknum) + * @fn static inline uint32_t physical_to_chd_lba(uint32_t physlba, uint32_t &tracknum) * * @brief Physical to chd lba. * - * @param [in,out] file If non-null, the file. * @param physlba The physlba. * @param [in,out] tracknum The tracknum. * * @return An uint32_t. */ -static inline uint32_t physical_to_chd_lba(cdrom_file *file, uint32_t physlba, uint32_t &tracknum) +uint32_t cdrom_file::physical_to_chd_lba(uint32_t physlba, uint32_t &tracknum) const { - uint32_t chdlba; - int track; - - /* loop until our current LBA is less than the start LBA of the next track */ - for (track = 0; track < file->cdtoc.numtrks; track++) - if (physlba < file->cdtoc.tracks[track + 1].physframeofs) + // loop until our current LBA is less than the start LBA of the next track + for (int track = 0; track < cdtoc.numtrks; track++) + if (physlba < cdtoc.tracks[track + 1].physframeofs) { - chdlba = physlba - file->cdtoc.tracks[track].physframeofs + file->cdtoc.tracks[track].chdframeofs; + uint32_t chdlba = physlba - cdtoc.tracks[track].physframeofs + cdtoc.tracks[track].chdframeofs; tracknum = track; return chdlba; } @@ -165,30 +111,26 @@ -------------------------------------------------*/ /** - * @fn static inline uint32_t logical_to_chd_lba(cdrom_file *file, uint32_t loglba, uint32_t &tracknum) + * @fn uint32_t logical_to_chd_lba(uint32_t loglba, uint32_t &tracknum) * * @brief Logical to chd lba. * - * @param [in,out] file If non-null, the file. * @param loglba The loglba. * @param [in,out] tracknum The tracknum. * * @return An uint32_t. */ -static inline uint32_t logical_to_chd_lba(cdrom_file *file, uint32_t loglba, uint32_t &tracknum) +uint32_t cdrom_file::logical_to_chd_lba(uint32_t loglba, uint32_t &tracknum) const { - uint32_t chdlba, physlba; - int track; - // loop until our current LBA is less than the start LBA of the next track - for (track = 0; track < file->cdtoc.numtrks; track++) + for (int track = 0; track < cdtoc.numtrks; track++) { - if (loglba < file->cdtoc.tracks[track + 1].logframeofs) + if (loglba < cdtoc.tracks[track + 1].logframeofs) { // convert to physical and proceed - physlba = file->cdtoc.tracks[track].physframeofs + (loglba - file->cdtoc.tracks[track].logframeofs); - chdlba = physlba - file->cdtoc.tracks[track].physframeofs + file->cdtoc.tracks[track].chdframeofs; + uint32_t physlba = cdtoc.tracks[track].physframeofs + (loglba - cdtoc.tracks[track].logframeofs); + uint32_t chdlba = physlba - cdtoc.tracks[track].physframeofs + cdtoc.tracks[track].chdframeofs; tracknum = track; return chdlba; } @@ -203,107 +145,103 @@ ***************************************************************************/ /** - * @fn cdrom_file *cdrom_open(const char *inputfile) + * @fn constructor * - * @brief Queries if a given cdrom open. + * @brief Open a cdrom for a file. * * @param inputfile The inputfile. - * - * @return null if it fails, else a cdrom_file*. */ -cdrom_file *cdrom_open(const char *inputfile) +cdrom_file::cdrom_file(std::string_view inputfile) { - int i; - cdrom_file *file; - uint32_t physofs, logofs; - - // allocate memory for the CD-ROM file - file = new (std::nothrow) cdrom_file(); - if (file == nullptr) - return nullptr; - // set up the CD-ROM module and get the disc info - std::error_condition err = chdcd_parse_toc(inputfile, file->cdtoc, file->track_info); + std::error_condition err = parse_toc(inputfile, cdtoc, cdtrack_info); if (err) { fprintf(stderr, "Error reading input file: %s\n", err.message().c_str()); - delete file; - return nullptr; + throw nullptr; } // fill in the data - file->chd = nullptr; + chd = nullptr; - LOG(("CD has %d tracks\n", file->cdtoc.numtrks)); + LOG(("CD has %d tracks\n", cdtoc.numtrks)); - for (i = 0; i < file->cdtoc.numtrks; i++) + for (int i = 0; i < cdtoc.numtrks; i++) { - std::error_condition const filerr = util::core_file::open(file->track_info.track[i].fname, OPEN_FLAG_READ, file->fhandle[i]); + osd_file::ptr file; + std::uint64_t length; + std::error_condition const filerr = osd_file::open(cdtrack_info.track[i].fname, OPEN_FLAG_READ, file, length); if (filerr) { - fprintf(stderr, "Unable to open file: %s\n", file->track_info.track[i].fname.c_str()); - cdrom_close(file); - return nullptr; + fprintf(stderr, "Unable to open file: %s\n", cdtrack_info.track[i].fname.c_str()); + throw nullptr; + } + fhandle[i] = util::osd_file_read(std::move(file)); + if (!fhandle[i]) + { + fprintf(stderr, "Unable to open file: %s\n", cdtrack_info.track[i].fname.c_str()); + throw nullptr; } } /* calculate the starting frame for each track, keeping in mind that CHDMAN pads tracks out with extra frames to fit 4-frame size boundries */ - physofs = logofs = 0; - for (i = 0; i < file->cdtoc.numtrks; i++) + uint32_t physofs = 0, logofs = 0; + for (int i = 0; i < cdtoc.numtrks; i++) { - file->cdtoc.tracks[i].logframeofs = 0; + track_info &track = cdtoc.tracks[i]; + track.logframeofs = 0; - if (file->cdtoc.tracks[i].pgdatasize == 0) + if (track.pgdatasize == 0) { - logofs += file->cdtoc.tracks[i].pregap; + logofs += track.pregap; } else { - file->cdtoc.tracks[i].logframeofs = file->cdtoc.tracks[i].pregap; + track.logframeofs = track.pregap; } - file->cdtoc.tracks[i].physframeofs = physofs; - file->cdtoc.tracks[i].chdframeofs = 0; - file->cdtoc.tracks[i].logframeofs += logofs; - file->cdtoc.tracks[i].logframes = file->cdtoc.tracks[i].frames - file->cdtoc.tracks[i].pregap; + track.physframeofs = physofs; + track.chdframeofs = 0; + track.logframeofs += logofs; + track.logframes = track.frames - track.pregap; // postgap adds to the track length - logofs += file->cdtoc.tracks[i].postgap; + logofs += track.postgap; - physofs += file->cdtoc.tracks[i].frames; - logofs += file->cdtoc.tracks[i].frames; + physofs += track.frames; + logofs += track.frames; -/* printf("Track %02d is format %d subtype %d datasize %d subsize %d frames %d extraframes %d pregap %d pgmode %d presize %d postgap %d logofs %d physofs %d chdofs %d logframes %d\n", i+1, - file->cdtoc.tracks[i].trktype, - file->cdtoc.tracks[i].subtype, - file->cdtoc.tracks[i].datasize, - file->cdtoc.tracks[i].subsize, - file->cdtoc.tracks[i].frames, - file->cdtoc.tracks[i].extraframes, - file->cdtoc.tracks[i].pregap, - file->cdtoc.tracks[i].pgtype, - file->cdtoc.tracks[i].pgdatasize, - file->cdtoc.tracks[i].postgap, - file->cdtoc.tracks[i].logframeofs, - file->cdtoc.tracks[i].physframeofs, - file->cdtoc.tracks[i].chdframeofs, - file->cdtoc.tracks[i].logframes);*/ + if (EXTRA_VERBOSE) + printf("Track %02d is format %d subtype %d datasize %d subsize %d frames %d extraframes %d pregap %d pgmode %d presize %d postgap %d logofs %d physofs %d chdofs %d logframes %d\n", i+1, + track.trktype, + track.subtype, + track.datasize, + track.subsize, + track.frames, + track.extraframes, + track.pregap, + track.pgtype, + track.pgdatasize, + track.postgap, + track.logframeofs, + track.physframeofs, + track.chdframeofs, + track.logframes); } // fill out dummy entries for the last track to help our search - file->cdtoc.tracks[i].physframeofs = physofs; - file->cdtoc.tracks[i].logframeofs = logofs; - file->cdtoc.tracks[i].chdframeofs = 0; - file->cdtoc.tracks[i].logframes = 0; - - return file; + track_info &track = cdtoc.tracks[cdtoc.numtrks]; + track.physframeofs = physofs; + track.logframeofs = logofs; + track.chdframeofs = 0; + track.logframes = 0; } /*------------------------------------------------- - cdrom_open - "open" a CD-ROM file from an + constructor - "open" a CD-ROM file from an already-opened CHD file -------------------------------------------------*/ @@ -317,128 +255,102 @@ * @return null if it fails, else a cdrom_file*. */ -cdrom_file *cdrom_open(chd_file *chd) +cdrom_file::cdrom_file(chd_file *_chd) { - // punt if no CHD - if (!chd) - return nullptr; + chd = _chd; /* validate the CHD information */ - if (chd->hunk_bytes() % CD_FRAME_SIZE != 0) - return nullptr; - if (chd->unit_bytes() != CD_FRAME_SIZE) - return nullptr; - - /* allocate memory for the CD-ROM file */ - cdrom_file *file = new (std::nothrow) cdrom_file(); - if (!file) - return nullptr; - - /* fill in the data */ - file->chd = chd; + if (chd->hunk_bytes() % FRAME_SIZE != 0) + throw nullptr; + if (chd->unit_bytes() != FRAME_SIZE) + throw nullptr; /* read the CD-ROM metadata */ - std::error_condition err = cdrom_parse_metadata(chd, &file->cdtoc); + std::error_condition err = parse_metadata(chd, cdtoc); if (err) - { - delete file; - return nullptr; - } + throw nullptr; - LOG(("CD has %d tracks\n", file->cdtoc.numtrks)); + LOG(("CD has %d tracks\n", cdtoc.numtrks)); /* calculate the starting frame for each track, keeping in mind that CHDMAN pads tracks out with extra frames to fit 4-frame size boundries */ uint32_t physofs = 0, chdofs = 0, logofs = 0; - int i; - for (i = 0; i < file->cdtoc.numtrks; i++) + for (int i = 0; i < cdtoc.numtrks; i++) { - file->cdtoc.tracks[i].logframeofs = 0; + track_info &track = cdtoc.tracks[i]; + track.logframeofs = 0; - if (file->cdtoc.tracks[i].pgdatasize == 0) + if (track.pgdatasize == 0) { // Anything that isn't cue. // toc (cdrdao): Pregap data seems to be included at the end of previous track. // START/PREGAP is only issued in special cases, for instance alongside ZERO commands. // ZERO and SILENCE commands are supposed to generate additional data that's not included // in the image directly, so the total logofs value must be offset to point to index 1. - logofs += file->cdtoc.tracks[i].pregap; + logofs += track.pregap; } else { // cues: Pregap is the difference between index 0 and index 1 unless PREGAP is specified. // The data is assumed to be in the bin and not generated separately, so the pregap should // only be added to the current track's lba to offset it to index 1. - file->cdtoc.tracks[i].logframeofs = file->cdtoc.tracks[i].pregap; + track.logframeofs = track.pregap; } - file->cdtoc.tracks[i].physframeofs = physofs; - file->cdtoc.tracks[i].chdframeofs = chdofs; - file->cdtoc.tracks[i].logframeofs += logofs; - file->cdtoc.tracks[i].logframes = file->cdtoc.tracks[i].frames - file->cdtoc.tracks[i].pregap; + track.physframeofs = physofs; + track.chdframeofs = chdofs; + track.logframeofs += logofs; + track.logframes = track.frames - track.pregap; // postgap counts against the next track - logofs += file->cdtoc.tracks[i].postgap; + logofs += track.postgap; - physofs += file->cdtoc.tracks[i].frames; - chdofs += file->cdtoc.tracks[i].frames; - chdofs += file->cdtoc.tracks[i].extraframes; - logofs += file->cdtoc.tracks[i].frames; - -/* printf("Track %02d is format %d subtype %d datasize %d subsize %d frames %d extraframes %d pregap %d pgmode %d presize %d postgap %d logofs %d physofs %d chdofs %d logframes %d\n", i+1, - file->cdtoc.tracks[i].trktype, - file->cdtoc.tracks[i].subtype, - file->cdtoc.tracks[i].datasize, - file->cdtoc.tracks[i].subsize, - file->cdtoc.tracks[i].frames, - file->cdtoc.tracks[i].extraframes, - file->cdtoc.tracks[i].pregap, - file->cdtoc.tracks[i].pgtype, - file->cdtoc.tracks[i].pgdatasize, - file->cdtoc.tracks[i].postgap, - file->cdtoc.tracks[i].logframeofs, - file->cdtoc.tracks[i].physframeofs, - file->cdtoc.tracks[i].chdframeofs, - file->cdtoc.tracks[i].logframes);*/ + physofs += track.frames; + chdofs += track.frames; + chdofs += track.extraframes; + logofs += track.frames; + + if (EXTRA_VERBOSE) + printf("Track %02d is format %d subtype %d datasize %d subsize %d frames %d extraframes %d pregap %d pgmode %d presize %d postgap %d logofs %d physofs %d chdofs %d logframes %d\n", i+1, + track.trktype, + track.subtype, + track.datasize, + track.subsize, + track.frames, + track.extraframes, + track.pregap, + track.pgtype, + track.pgdatasize, + track.postgap, + track.logframeofs, + track.physframeofs, + track.chdframeofs, + track.logframes); } // fill out dummy entries for the last track to help our search - file->cdtoc.tracks[i].physframeofs = physofs; - file->cdtoc.tracks[i].logframeofs = logofs; - file->cdtoc.tracks[i].chdframeofs = chdofs; - file->cdtoc.tracks[i].logframes = 0; - - return file; + track_info &track = cdtoc.tracks[cdtoc.numtrks]; + track.physframeofs = physofs; + track.logframeofs = logofs; + track.chdframeofs = chdofs; + track.logframes = 0; } /*------------------------------------------------- - cdrom_close - "close" a CD-ROM file + destructor - "close" a CD-ROM file -------------------------------------------------*/ -/** - * @fn void cdrom_close(cdrom_file *file) - * - * @brief Cdrom close. - * - * @param [in,out] file If non-null, the file. - */ - -void cdrom_close(cdrom_file *file) +cdrom_file::~cdrom_file() { - if (file == nullptr) - return; - - if (file->chd == nullptr) + if (chd == nullptr) { - for (int i = 0; i < file->cdtoc.numtrks; i++) + for (int i = 0; i < cdtoc.numtrks; i++) { - file->fhandle[i].reset(); + fhandle[i].reset(); } } - - delete file; } @@ -448,11 +360,10 @@ ***************************************************************************/ /** - * @fn std::error_condition read_partial_sector(cdrom_file *file, void *dest, uint32_t lbasector, uint32_t chdsector, uint32_t tracknum, uint32_t startoffs, uint32_t length) + * @fn std::error_condition read_partial_sector(void *dest, uint32_t lbasector, uint32_t chdsector, uint32_t tracknum, uint32_t startoffs, uint32_t length) * * @brief Reads partial sector. * - * @param [in,out] file If non-null, the file. * @param [in,out] dest If non-null, destination for the. * @param lbasector The lbasector. * @param chdsector The chdsector. @@ -463,7 +374,7 @@ * @return The partial sector. */ -std::error_condition read_partial_sector(cdrom_file *file, void *dest, uint32_t lbasector, uint32_t chdsector, uint32_t tracknum, uint32_t startoffs, uint32_t length, bool phys=false) +std::error_condition cdrom_file::read_partial_sector(void *dest, uint32_t lbasector, uint32_t chdsector, uint32_t tracknum, uint32_t startoffs, uint32_t length, bool phys) { std::error_condition result; bool needswap = false; @@ -471,44 +382,46 @@ // if this is pregap info that isn't actually in the file, just return blank data if (!phys) { - if ((file->cdtoc.tracks[tracknum].pgdatasize == 0) && (lbasector < file->cdtoc.tracks[tracknum].logframeofs)) + if ((cdtoc.tracks[tracknum].pgdatasize == 0) && (lbasector < cdtoc.tracks[tracknum].logframeofs)) { - //printf("PG missing sector: LBA %d, trklog %d\n", lbasector, file->cdtoc.tracks[tracknum].logframeofs); + if (EXTRA_VERBOSE) + printf("PG missing sector: LBA %d, trklog %d\n", lbasector, cdtoc.tracks[tracknum].logframeofs); memset(dest, 0, length); return result; } } // if a CHD, just read - if (file->chd != nullptr) + if (chd != nullptr) { - if (!phys && file->cdtoc.tracks[tracknum].pgdatasize != 0) + if (!phys && cdtoc.tracks[tracknum].pgdatasize != 0) { // chdman (phys=true) relies on chdframeofs to point to index 0 instead of index 1 for extractcd. // Actually playing CDs requires it to point to index 1 instead of index 0, so adjust the offset when phys=false. - chdsector += file->cdtoc.tracks[tracknum].pregap; + chdsector += cdtoc.tracks[tracknum].pregap; } - result = file->chd->read_bytes(uint64_t(chdsector) * uint64_t(CD_FRAME_SIZE) + startoffs, dest, length); + result = chd->read_bytes(uint64_t(chdsector) * uint64_t(FRAME_SIZE) + startoffs, dest, length); // swap CDDA in the case of LE GDROMs - if ((file->cdtoc.flags & CD_FLAG_GDROMLE) && (file->cdtoc.tracks[tracknum].trktype == CD_TRACK_AUDIO)) + if ((cdtoc.flags & CD_FLAG_GDROMLE) && (cdtoc.tracks[tracknum].trktype == CD_TRACK_AUDIO)) needswap = true; } else { // else read from the appropriate file - util::core_file &srcfile = *file->fhandle[tracknum]; + util::random_read &srcfile = *fhandle[tracknum]; - int bytespersector = file->cdtoc.tracks[tracknum].datasize + file->cdtoc.tracks[tracknum].subsize; - uint64_t sourcefileoffset = file->track_info.track[tracknum].offset; + int bytespersector = cdtoc.tracks[tracknum].datasize + cdtoc.tracks[tracknum].subsize; + uint64_t sourcefileoffset = cdtrack_info.track[tracknum].offset; - if (file->cdtoc.tracks[tracknum].pgdatasize != 0) - chdsector += file->cdtoc.tracks[tracknum].pregap; + if (cdtoc.tracks[tracknum].pgdatasize != 0) + chdsector += cdtoc.tracks[tracknum].pregap; sourcefileoffset += chdsector * bytespersector + startoffs; - // printf("Reading sector %d from track %d at offset %lu\n", chdsector, tracknum, sourcefileoffset); + if (EXTRA_VERBOSE) + printf("Reading sector %d from track %d at offset %lu\n", chdsector, tracknum, (unsigned long)sourcefileoffset); size_t actual; result = srcfile.seek(sourcefileoffset, SEEK_SET); @@ -516,7 +429,7 @@ result = srcfile.read(dest, length, actual); // FIXME: if (actual < length) report error - needswap = file->track_info.track[tracknum].swap; + needswap = cdtrack_info.track[tracknum].swap; } if (needswap) @@ -539,11 +452,10 @@ -------------------------------------------------*/ /** - * @fn uint32_t cdrom_read_data(cdrom_file *file, uint32_t lbasector, void *buffer, uint32_t datatype, bool phys) + * @fn bool read_data(uint32_t lbasector, void *buffer, uint32_t datatype, bool phys) * * @brief Cdrom read data. * - * @param [in,out] file If non-null, the file. * @param lbasector The lbasector. * @param [in,out] buffer If non-null, the buffer. * @param datatype The datatype. @@ -552,37 +464,34 @@ * @return An uint32_t. */ -uint32_t cdrom_read_data(cdrom_file *file, uint32_t lbasector, void *buffer, uint32_t datatype, bool phys) +bool cdrom_file::read_data(uint32_t lbasector, void *buffer, uint32_t datatype, bool phys) { - if (file == nullptr) - return 0; - // compute CHD sector and tracknumber uint32_t tracknum = 0; uint32_t chdsector; if (phys) { - chdsector = physical_to_chd_lba(file, lbasector, tracknum); + chdsector = physical_to_chd_lba(lbasector, tracknum); } else { - chdsector = logical_to_chd_lba(file, lbasector, tracknum); + chdsector = logical_to_chd_lba(lbasector, tracknum); } // copy out the requested sector - uint32_t tracktype = file->cdtoc.tracks[tracknum].trktype; + uint32_t tracktype = cdtoc.tracks[tracknum].trktype; if ((datatype == tracktype) || (datatype == CD_TRACK_RAW_DONTCARE)) { - return !read_partial_sector(file, buffer, lbasector, chdsector, tracknum, 0, file->cdtoc.tracks[tracknum].datasize, phys); + return !read_partial_sector(buffer, lbasector, chdsector, tracknum, 0, cdtoc.tracks[tracknum].datasize, phys); } else { // return 2048 bytes of mode 1 data from a 2352 byte mode 1 raw sector if ((datatype == CD_TRACK_MODE1) && (tracktype == CD_TRACK_MODE1_RAW)) { - return !read_partial_sector(file, buffer, lbasector, chdsector, tracknum, 16, 2048, phys); + return !read_partial_sector(buffer, lbasector, chdsector, tracknum, 16, 2048, phys); } // return 2352 byte mode 1 raw sector from 2048 bytes of mode 1 data @@ -598,25 +507,25 @@ bufptr[14] = msf&0xff; bufptr[15] = 1; // mode 1 LOG(("CDROM: promotion of mode1/form1 sector to mode1 raw is not complete!\n")); - return !read_partial_sector(file, bufptr+16, lbasector, chdsector, tracknum, 0, 2048, phys); + return !read_partial_sector(bufptr+16, lbasector, chdsector, tracknum, 0, 2048, phys); } // return 2048 bytes of mode 1 data from a mode2 form1 or raw sector if ((datatype == CD_TRACK_MODE1) && ((tracktype == CD_TRACK_MODE2_FORM1)||(tracktype == CD_TRACK_MODE2_RAW))) { - return !read_partial_sector(file, buffer, lbasector, chdsector, tracknum, 24, 2048, phys); + return !read_partial_sector(buffer, lbasector, chdsector, tracknum, 24, 2048, phys); } // return 2048 bytes of mode 1 data from a mode2 form2 or XA sector if ((datatype == CD_TRACK_MODE1) && (tracktype == CD_TRACK_MODE2_FORM_MIX)) { - return !read_partial_sector(file, buffer, lbasector, chdsector, tracknum, 8, 2048, phys); + return !read_partial_sector(buffer, lbasector, chdsector, tracknum, 8, 2048, phys); } // return mode 2 2336 byte data from a 2352 byte mode 1 or 2 raw sector (skip the header) if ((datatype == CD_TRACK_MODE2) && ((tracktype == CD_TRACK_MODE1_RAW) || (tracktype == CD_TRACK_MODE2_RAW))) { - return !read_partial_sector(file, buffer, lbasector, chdsector, tracknum, 16, 2336, phys); + return !read_partial_sector(buffer, lbasector, chdsector, tracknum, 16, 2336, phys); } LOG(("CDROM: Conversion from type %d to type %d not supported!\n", tracktype, datatype)); @@ -626,46 +535,42 @@ /*------------------------------------------------- - cdrom_read_subcode - read subcode data for + read_subcode - read subcode data for a sector -------------------------------------------------*/ /** - * @fn uint32_t cdrom_read_subcode(cdrom_file *file, uint32_t lbasector, void *buffer, bool phys) + * @fn bool read_subcode(uint32_t lbasector, void *buffer, bool phys) * * @brief Cdrom read subcode. * - * @param [in,out] file If non-null, the file. * @param lbasector The lbasector. * @param [in,out] buffer If non-null, the buffer. * @param phys true to physical. * - * @return An uint32_t. + * @return false on failure. */ -uint32_t cdrom_read_subcode(cdrom_file *file, uint32_t lbasector, void *buffer, bool phys) +bool cdrom_file::read_subcode(uint32_t lbasector, void *buffer, bool phys) { - if (file == nullptr) - return ~0; - // compute CHD sector and tracknumber uint32_t tracknum = 0; uint32_t chdsector; if (phys) { - chdsector = physical_to_chd_lba(file, lbasector, tracknum); + chdsector = physical_to_chd_lba(lbasector, tracknum); } else { - chdsector = logical_to_chd_lba(file, lbasector, tracknum); + chdsector = logical_to_chd_lba(lbasector, tracknum); } - if (file->cdtoc.tracks[tracknum].subsize == 0) - return 0; + if (cdtoc.tracks[tracknum].subsize == 0) + return false; // read the data - std::error_condition err = read_partial_sector(file, buffer, lbasector, chdsector, tracknum, file->cdtoc.tracks[tracknum].datasize, file->cdtoc.tracks[tracknum].subsize); + std::error_condition err = read_partial_sector(buffer, lbasector, chdsector, tracknum, cdtoc.tracks[tracknum].datasize, cdtoc.tracks[tracknum].subsize); return !err; } @@ -676,220 +581,43 @@ ***************************************************************************/ /*------------------------------------------------- - cdrom_get_track - get the track number + get_track - get the track number for a physical frame number -------------------------------------------------*/ /** - * @fn uint32_t cdrom_get_track(cdrom_file *file, uint32_t frame) + * @fn uint32_t get_track(uint32_t frame) * * @brief Cdrom get track. * - * @param [in,out] file If non-null, the file. * @param frame The frame. * * @return An uint32_t. */ -uint32_t cdrom_get_track(cdrom_file *file, uint32_t frame) +uint32_t cdrom_file::get_track(uint32_t frame) const { uint32_t track = 0; - if (file == nullptr) - return ~0; - /* convert to a CHD sector offset and get track information */ - logical_to_chd_lba(file, frame, track); + logical_to_chd_lba(frame, track); return track; } -/*------------------------------------------------- - cdrom_get_track_start - get the frame number - that a track starts at --------------------------------------------------*/ - -/** - * @fn uint32_t cdrom_get_track_start(cdrom_file *file, uint32_t track) - * - * @brief Cdrom get track start. - * - * @param [in,out] file If non-null, the file. - * @param track The track. - * - * @return An uint32_t. - */ - -uint32_t cdrom_get_track_start(cdrom_file *file, uint32_t track) -{ - if (file == nullptr) - return ~0; - - /* handle lead-out specially */ - if (track == 0xaa) - track = file->cdtoc.numtrks; - - return file->cdtoc.tracks[track].logframeofs; -} - -/*------------------------------------------------- - cdrom_get_track_start_phys - get the - physical frame number that a track starts at --------------------------------------------------*/ - -/** - * @fn uint32_t cdrom_get_track_start_phys(cdrom_file *file, uint32_t track) - * - * @brief Cdrom get track start physical. - * - * @param [in,out] file If non-null, the file. - * @param track The track. - * - * @return An uint32_t. - */ - -uint32_t cdrom_get_track_start_phys(cdrom_file *file, uint32_t track) -{ - if (file == nullptr) - return ~0; - - /* handle lead-out specially */ - if (track == 0xaa) - track = file->cdtoc.numtrks; - - return file->cdtoc.tracks[track].physframeofs; -} - -/*------------------------------------------------- - cdrom_get_chd - get a handle to a CHD - from a cdrom --------------------------------------------------*/ - -chd_file *cdrom_get_chd(cdrom_file *file) -{ - return file->chd; -} - -/*************************************************************************** - TOC UTILITIES -***************************************************************************/ - -/*------------------------------------------------- - cdrom_get_last_track - returns the last track - number --------------------------------------------------*/ - -/** - * @fn int cdrom_get_last_track(cdrom_file *file) - * - * @brief Cdrom get last track. - * - * @param [in,out] file If non-null, the file. - * - * @return An int. - */ - -int cdrom_get_last_track(cdrom_file *file) -{ - if (file == nullptr) - return -1; - - return file->cdtoc.numtrks; -} - - -/*------------------------------------------------- - cdrom_get_adr_control - get the ADR | CONTROL - for a track --------------------------------------------------*/ - -/** - * @fn int cdrom_get_adr_control(cdrom_file *file, int track) - * - * @brief Cdrom get address control. - * - * @param [in,out] file If non-null, the file. - * @param track The track. - * - * @return An int. - */ - -int cdrom_get_adr_control(cdrom_file *file, int track) -{ - if (file == nullptr) - return -1; - - if (track == 0xaa || file->cdtoc.tracks[track].trktype == CD_TRACK_AUDIO) - { - return 0x10; // audio track, subchannel is position - } - - return 0x14; // data track, subchannel is position -} - - -/*------------------------------------------------- - cdrom_get_track_type - return the track type --------------------------------------------------*/ - -/** - * @fn int cdrom_get_track_type(cdrom_file *file, int track) - * - * @brief Cdrom get track type. - * - * @param [in,out] file If non-null, the file. - * @param track The track. - * - * @return An int. - */ - -int cdrom_get_track_type(cdrom_file *file, int track) -{ - if (file == nullptr) - return -1; - - return file->cdtoc.tracks[track].trktype; -} - - -/*------------------------------------------------- - cdrom_get_toc - return the TOC data for a - CD-ROM --------------------------------------------------*/ - -/** - * @fn const cdrom_toc *cdrom_get_toc(cdrom_file *file) - * - * @brief Cdrom get TOC. - * - * @param [in,out] file If non-null, the file. - * - * @return null if it fails, else a cdrom_toc*. - */ - -const cdrom_toc *cdrom_get_toc(cdrom_file *file) -{ - if (file == nullptr) - return nullptr; - - return &file->cdtoc; -} - - - /*************************************************************************** EXTRA UTILITIES ***************************************************************************/ /*------------------------------------------------- - cdrom_get_info_from_type_string + get_info_from_type_string take a string and convert it into track type and track data size -------------------------------------------------*/ /** - * @fn static void cdrom_get_info_from_type_string(const char *typestring, uint32_t *trktype, uint32_t *datasize) + * @fn static void get_info_from_type_string(const char *typestring, uint32_t *trktype, uint32_t *datasize) * * @brief Cdrom get information from type string. * @@ -898,7 +626,7 @@ * @param [in,out] datasize If non-null, the datasize. */ -static void cdrom_get_info_from_type_string(const char *typestring, uint32_t *trktype, uint32_t *datasize) +void cdrom_file::get_info_from_type_string(const char *typestring, uint32_t *trktype, uint32_t *datasize) { if (!strcmp(typestring, "MODE1")) { @@ -983,61 +711,61 @@ } /*------------------------------------------------- - cdrom_convert_type_string_to_track_info - + convert_type_string_to_track_info - take a string and convert it into track type and track data size -------------------------------------------------*/ /** - * @fn void cdrom_convert_type_string_to_track_info(const char *typestring, cdrom_track_info *info) + * @fn void convert_type_string_to_track_info(const char *typestring, track_info *info) * - * @brief Cdrom convert type string to track information. + * @brief Convert type string to track information. * * @param typestring The typestring. * @param [in,out] info If non-null, the information. */ -void cdrom_convert_type_string_to_track_info(const char *typestring, cdrom_track_info *info) +void cdrom_file::convert_type_string_to_track_info(const char *typestring, track_info *info) { - cdrom_get_info_from_type_string(typestring, &info->trktype, &info->datasize); + get_info_from_type_string(typestring, &info->trktype, &info->datasize); } /*------------------------------------------------- - cdrom_convert_type_string_to_pregap_info - + convert_type_string_to_pregap_info - take a string and convert it into pregap type and pregap data size -------------------------------------------------*/ /** - * @fn void cdrom_convert_type_string_to_pregap_info(const char *typestring, cdrom_track_info *info) + * @fn void convert_type_string_to_pregap_info(const char *typestring, track_info *info) * - * @brief Cdrom convert type string to pregap information. + * @brief Convert type string to pregap information. * * @param typestring The typestring. * @param [in,out] info If non-null, the information. */ -void cdrom_convert_type_string_to_pregap_info(const char *typestring, cdrom_track_info *info) +void cdrom_file::convert_type_string_to_pregap_info(const char *typestring, track_info *info) { - cdrom_get_info_from_type_string(typestring, &info->pgtype, &info->pgdatasize); + get_info_from_type_string(typestring, &info->pgtype, &info->pgdatasize); } /*------------------------------------------------- - cdrom_convert_subtype_string_to_track_info - + convert_subtype_string_to_track_info - take a string and convert it into track subtype and track subcode data size -------------------------------------------------*/ /** - * @fn void cdrom_convert_subtype_string_to_track_info(const char *typestring, cdrom_track_info *info) + * @fn void convert_subtype_string_to_track_info(const char *typestring, track_info *info) * - * @brief Cdrom convert subtype string to track information. + * @brief Convert subtype string to track information. * * @param typestring The typestring. * @param [in,out] info If non-null, the information. */ -void cdrom_convert_subtype_string_to_track_info(const char *typestring, cdrom_track_info *info) +void cdrom_file::convert_subtype_string_to_track_info(const char *typestring, track_info *info) { if (!strcmp(typestring, "RW")) { @@ -1052,21 +780,21 @@ } /*------------------------------------------------- - cdrom_convert_subtype_string_to_pregap_info - + convert_subtype_string_to_pregap_info - take a string and convert it into track subtype and track subcode data size -------------------------------------------------*/ /** - * @fn void cdrom_convert_subtype_string_to_pregap_info(const char *typestring, cdrom_track_info *info) + * @fn void convert_subtype_string_to_pregap_info(const char *typestring, track_info *info) * - * @brief Cdrom convert subtype string to pregap information. + * @brief Convert subtype string to pregap information. * * @param typestring The typestring. * @param [in,out] info If non-null, the information. */ -void cdrom_convert_subtype_string_to_pregap_info(const char *typestring, cdrom_track_info *info) +void cdrom_file::convert_subtype_string_to_pregap_info(const char *typestring, track_info *info) { if (!strcmp(typestring, "RW")) { @@ -1081,21 +809,21 @@ } /*------------------------------------------------- - cdrom_get_type_string - get the string + get_type_string - get the string associated with the given type -------------------------------------------------*/ /** - * @fn const char *cdrom_get_type_string(uint32_t trktype) + * @fn const char *get_type_string(uint32_t trktype) * - * @brief Cdrom get type string. + * @brief Get type string. * * @param trktype The trktype. * * @return null if it fails, else a char*. */ -const char *cdrom_get_type_string(uint32_t trktype) +const char *cdrom_file::get_type_string(uint32_t trktype) { switch (trktype) { @@ -1113,21 +841,21 @@ /*------------------------------------------------- - cdrom_get_subtype_string - get the string + get_subtype_string - get the string associated with the given subcode type -------------------------------------------------*/ /** - * @fn const char *cdrom_get_subtype_string(uint32_t subtype) + * @fn const char *get_subtype_string(uint32_t subtype) * - * @brief Cdrom get subtype string. + * @brief Get subtype string. * * @param subtype The subtype. * * @return null if it fails, else a char*. */ -const char *cdrom_get_subtype_string(uint32_t subtype) +const char *cdrom_file::get_subtype_string(uint32_t subtype) { switch (subtype) { @@ -1144,14 +872,14 @@ ***************************************************************************/ /*------------------------------------------------- - cdrom_parse_metadata - parse metadata into the + parse_metadata - parse metadata into the TOC structure -------------------------------------------------*/ /** - * @fn std::error_condition cdrom_parse_metadata(chd_file *chd, cdrom_toc *toc) + * @fn std::error_condition cdrom_parse_metadata(chd_file *chd, toc *toc) * - * @brief Cdrom parse metadata. + * @brief Parse metadata. * * @param [in,out] chd If non-null, the chd. * @param [in,out] toc If non-null, the TOC. @@ -1159,24 +887,24 @@ * @return A std::error_condition. */ -std::error_condition cdrom_parse_metadata(chd_file *chd, cdrom_toc *toc) +std::error_condition cdrom_file::parse_metadata(chd_file *chd, toc &toc) { std::string metadata; std::error_condition err; - toc->flags = 0; + toc.flags = 0; /* start with no tracks */ - for (toc->numtrks = 0; toc->numtrks < CD_MAX_TRACKS; toc->numtrks++) + for (toc.numtrks = 0; toc.numtrks < MAX_TRACKS; toc.numtrks++) { int tracknum = -1, frames = 0, pregap, postgap, padframes; char type[16], subtype[16], pgtype[16], pgsub[16]; - cdrom_track_info *track; + track_info *track; pregap = postgap = padframes = 0; /* fetch the metadata for this track */ - err = chd->read_metadata(CDROM_TRACK_METADATA_TAG, toc->numtrks, metadata); + err = chd->read_metadata(CDROM_TRACK_METADATA_TAG, toc.numtrks, metadata); if (!err) { /* parse the metadata */ @@ -1184,13 +912,13 @@ pgtype[0] = pgsub[0] = 0; if (sscanf(metadata.c_str(), CDROM_TRACK_METADATA_FORMAT, &tracknum, type, subtype, &frames) != 4) return chd_file::error::INVALID_DATA; - if (tracknum == 0 || tracknum > CD_MAX_TRACKS) + if (tracknum == 0 || tracknum > MAX_TRACKS) return chd_file::error::INVALID_DATA; - track = &toc->tracks[tracknum - 1]; + track = &toc.tracks[tracknum - 1]; } else { - err = chd->read_metadata(CDROM_TRACK_METADATA2_TAG, toc->numtrks, metadata); + err = chd->read_metadata(CDROM_TRACK_METADATA2_TAG, toc.numtrks, metadata); if (!err) { /* parse the metadata */ @@ -1198,18 +926,18 @@ pregap = postgap = 0; if (sscanf(metadata.c_str(), CDROM_TRACK_METADATA2_FORMAT, &tracknum, type, subtype, &frames, &pregap, pgtype, pgsub, &postgap) != 8) return chd_file::error::INVALID_DATA; - if (tracknum == 0 || tracknum > CD_MAX_TRACKS) + if (tracknum == 0 || tracknum > MAX_TRACKS) return chd_file::error::INVALID_DATA; - track = &toc->tracks[tracknum - 1]; + track = &toc.tracks[tracknum - 1]; } else { - err = chd->read_metadata(GDROM_OLD_METADATA_TAG, toc->numtrks, metadata); + err = chd->read_metadata(GDROM_OLD_METADATA_TAG, toc.numtrks, metadata); if (!err) /* legacy GDROM track was detected */ - toc->flags |= CD_FLAG_GDROMLE; + toc.flags |= CD_FLAG_GDROMLE; else - err = chd->read_metadata(GDROM_TRACK_METADATA_TAG, toc->numtrks, metadata); + err = chd->read_metadata(GDROM_TRACK_METADATA_TAG, toc.numtrks, metadata); if (!err) { @@ -1218,10 +946,10 @@ pregap = postgap = 0; if (sscanf(metadata.c_str(), GDROM_TRACK_METADATA_FORMAT, &tracknum, type, subtype, &frames, &padframes, &pregap, pgtype, pgsub, &postgap) != 9) return chd_file::error::INVALID_DATA; - if (tracknum == 0 || tracknum > CD_MAX_TRACKS) + if (tracknum == 0 || tracknum > MAX_TRACKS) return chd_file::error::INVALID_DATA; - track = &toc->tracks[tracknum - 1]; - toc->flags |= CD_FLAG_GDROM; + track = &toc.tracks[tracknum - 1]; + toc.flags |= CD_FLAG_GDROM; } else { @@ -1233,20 +961,20 @@ /* extract the track type and determine the data size */ track->trktype = CD_TRACK_MODE1; track->datasize = 0; - cdrom_convert_type_string_to_track_info(type, track); + convert_type_string_to_track_info(type, track); if (track->datasize == 0) return chd_file::error::INVALID_DATA; /* extract the subtype and determine the subcode data size */ track->subtype = CD_SUB_NONE; track->subsize = 0; - cdrom_convert_subtype_string_to_track_info(subtype, track); + convert_subtype_string_to_track_info(subtype, track); /* set the frames and extra frames data */ track->frames = frames; track->padframes = padframes; - int padded = (frames + CD_TRACK_PADDING - 1) / CD_TRACK_PADDING; - track->extraframes = padded * CD_TRACK_PADDING - frames; + int padded = (frames + TRACK_PADDING - 1) / TRACK_PADDING; + track->extraframes = padded * TRACK_PADDING - frames; /* set the pregap info */ track->pregap = pregap; @@ -1258,10 +986,10 @@ { if (pgtype[0] == 'V') { - cdrom_convert_type_string_to_pregap_info(&pgtype[1], track); + convert_type_string_to_pregap_info(&pgtype[1], track); } - cdrom_convert_subtype_string_to_pregap_info(pgsub, track); + convert_subtype_string_to_pregap_info(pgsub, track); } /* set the postgap info */ @@ -1269,10 +997,10 @@ } /* if we got any tracks this way, we're done */ - if (toc->numtrks > 0) + if (toc.numtrks > 0) return std::error_condition(); - printf("toc->numtrks = %u?!\n", toc->numtrks); + printf("toc.numtrks = %u?!\n", toc.numtrks); /* look for old-style metadata */ std::vector oldmetadata; @@ -1282,37 +1010,37 @@ /* reconstruct the TOC from it */ auto *mrp = reinterpret_cast(&oldmetadata[0]); - toc->numtrks = *mrp++; + toc.numtrks = *mrp++; - for (int i = 0; i < CD_MAX_TRACKS; i++) + for (int i = 0; i < MAX_TRACKS; i++) { - toc->tracks[i].trktype = *mrp++; - toc->tracks[i].subtype = *mrp++; - toc->tracks[i].datasize = *mrp++; - toc->tracks[i].subsize = *mrp++; - toc->tracks[i].frames = *mrp++; - toc->tracks[i].extraframes = *mrp++; - toc->tracks[i].pregap = 0; - toc->tracks[i].postgap = 0; - toc->tracks[i].pgtype = 0; - toc->tracks[i].pgsub = 0; - toc->tracks[i].pgdatasize = 0; - toc->tracks[i].pgsubsize = 0; + toc.tracks[i].trktype = *mrp++; + toc.tracks[i].subtype = *mrp++; + toc.tracks[i].datasize = *mrp++; + toc.tracks[i].subsize = *mrp++; + toc.tracks[i].frames = *mrp++; + toc.tracks[i].extraframes = *mrp++; + toc.tracks[i].pregap = 0; + toc.tracks[i].postgap = 0; + toc.tracks[i].pgtype = 0; + toc.tracks[i].pgsub = 0; + toc.tracks[i].pgdatasize = 0; + toc.tracks[i].pgsubsize = 0; } /* TODO: I don't know why sometimes the data is one endian and sometimes another */ - if (toc->numtrks > CD_MAX_TRACKS) + if (toc.numtrks > MAX_TRACKS) { - toc->numtrks = swapendian_int32(toc->numtrks); - for (int i = 0; i < CD_MAX_TRACKS; i++) + toc.numtrks = swapendian_int32(toc.numtrks); + for (int i = 0; i < MAX_TRACKS; i++) { - toc->tracks[i].trktype = swapendian_int32(toc->tracks[i].trktype); - toc->tracks[i].subtype = swapendian_int32(toc->tracks[i].subtype); - toc->tracks[i].datasize = swapendian_int32(toc->tracks[i].datasize); - toc->tracks[i].subsize = swapendian_int32(toc->tracks[i].subsize); - toc->tracks[i].frames = swapendian_int32(toc->tracks[i].frames); - toc->tracks[i].padframes = swapendian_int32(toc->tracks[i].padframes); - toc->tracks[i].extraframes = swapendian_int32(toc->tracks[i].extraframes); + toc.tracks[i].trktype = swapendian_int32(toc.tracks[i].trktype); + toc.tracks[i].subtype = swapendian_int32(toc.tracks[i].subtype); + toc.tracks[i].datasize = swapendian_int32(toc.tracks[i].datasize); + toc.tracks[i].subsize = swapendian_int32(toc.tracks[i].subsize); + toc.tracks[i].frames = swapendian_int32(toc.tracks[i].frames); + toc.tracks[i].padframes = swapendian_int32(toc.tracks[i].padframes); + toc.tracks[i].extraframes = swapendian_int32(toc.tracks[i].extraframes); } } @@ -1321,13 +1049,13 @@ /*------------------------------------------------- - cdrom_write_metadata - write metadata + write_metadata - write metadata -------------------------------------------------*/ /** - * @fn std::error_condition cdrom_write_metadata(chd_file *chd, const cdrom_toc *toc) + * @fn std::error_condition write_metadata(chd_file *chd, const toc *toc) * - * @brief Cdrom write metadata. + * @brief Write metadata. * * @param [in,out] chd If non-null, the chd. * @param toc The TOC. @@ -1335,40 +1063,40 @@ * @return A std::error_condition. */ -std::error_condition cdrom_write_metadata(chd_file *chd, const cdrom_toc *toc) +std::error_condition cdrom_file::write_metadata(chd_file *chd, const toc &toc) { std::error_condition err; /* write the metadata */ - for (int i = 0; i < toc->numtrks; i++) + for (int i = 0; i < toc.numtrks; i++) { std::string metadata; - if (!(toc->flags & CD_FLAG_GDROM)) + if (!(toc.flags & CD_FLAG_GDROM)) { char submode[32]; - if (toc->tracks[i].pgdatasize > 0) + if (toc.tracks[i].pgdatasize > 0) { - strcpy(&submode[1], cdrom_get_type_string(toc->tracks[i].pgtype)); + strcpy(&submode[1], get_type_string(toc.tracks[i].pgtype)); submode[0] = 'V'; // indicate valid submode } else { - strcpy(submode, cdrom_get_type_string(toc->tracks[i].pgtype)); + strcpy(submode, get_type_string(toc.tracks[i].pgtype)); } - metadata = util::string_format(CDROM_TRACK_METADATA2_FORMAT, i + 1, cdrom_get_type_string(toc->tracks[i].trktype), - cdrom_get_subtype_string(toc->tracks[i].subtype), toc->tracks[i].frames, toc->tracks[i].pregap, - submode, cdrom_get_subtype_string(toc->tracks[i].pgsub), - toc->tracks[i].postgap); + metadata = util::string_format(CDROM_TRACK_METADATA2_FORMAT, i + 1, get_type_string(toc.tracks[i].trktype), + get_subtype_string(toc.tracks[i].subtype), toc.tracks[i].frames, toc.tracks[i].pregap, + submode, get_subtype_string(toc.tracks[i].pgsub), + toc.tracks[i].postgap); err = chd->write_metadata(CDROM_TRACK_METADATA2_TAG, i, metadata); } else { - metadata = util::string_format(GDROM_TRACK_METADATA_FORMAT, i + 1, cdrom_get_type_string(toc->tracks[i].trktype), - cdrom_get_subtype_string(toc->tracks[i].subtype), toc->tracks[i].frames, toc->tracks[i].padframes, - toc->tracks[i].pregap, cdrom_get_type_string(toc->tracks[i].pgtype), - cdrom_get_subtype_string(toc->tracks[i].pgsub), toc->tracks[i].postgap); + metadata = util::string_format(GDROM_TRACK_METADATA_FORMAT, i + 1, get_type_string(toc.tracks[i].trktype), + get_subtype_string(toc.tracks[i].subtype), toc.tracks[i].frames, toc.tracks[i].padframes, + toc.tracks[i].pregap, get_type_string(toc.tracks[i].pgtype), + get_subtype_string(toc.tracks[i].pgsub), toc.tracks[i].postgap); err = chd->write_metadata(GDROM_TRACK_METADATA_TAG, i, metadata); } @@ -1384,7 +1112,7 @@ * -------------------------------------------------. */ -static const uint8_t ecclow[256] = +const uint8_t cdrom_file::ecclow[256] = { 0x00, 0x02, 0x04, 0x06, 0x08, 0x0a, 0x0c, 0x0e, 0x10, 0x12, 0x14, 0x16, 0x18, 0x1a, 0x1c, 0x1e, 0x20, 0x22, 0x24, 0x26, 0x28, 0x2a, 0x2c, 0x2e, 0x30, 0x32, 0x34, 0x36, 0x38, 0x3a, 0x3c, 0x3e, @@ -1405,7 +1133,7 @@ }; /** @brief The ecchigh[ 256]. */ -static const uint8_t ecchigh[256] = +const uint8_t cdrom_file::ecchigh[256] = { 0x00, 0xf4, 0xf5, 0x01, 0xf7, 0x03, 0x02, 0xf6, 0xf3, 0x07, 0x06, 0xf2, 0x04, 0xf0, 0xf1, 0x05, 0xfb, 0x0f, 0x0e, 0xfa, 0x0c, 0xf8, 0xf9, 0x0d, 0x08, 0xfc, 0xfd, 0x09, 0xff, 0x0b, 0x0a, 0xfe, @@ -1432,7 +1160,7 @@ * -------------------------------------------------. */ -static const uint16_t poffsets[ECC_P_NUM_BYTES][ECC_P_COMP] = +const uint16_t cdrom_file::poffsets[cdrom_file::ECC_P_NUM_BYTES][cdrom_file::ECC_P_COMP] = { { 0x000,0x056,0x0ac,0x102,0x158,0x1ae,0x204,0x25a,0x2b0,0x306,0x35c,0x3b2,0x408,0x45e,0x4b4,0x50a,0x560,0x5b6,0x60c,0x662,0x6b8,0x70e,0x764,0x7ba }, { 0x001,0x057,0x0ad,0x103,0x159,0x1af,0x205,0x25b,0x2b1,0x307,0x35d,0x3b3,0x409,0x45f,0x4b5,0x50b,0x561,0x5b7,0x60d,0x663,0x6b9,0x70f,0x765,0x7bb }, @@ -1529,7 +1257,7 @@ * -------------------------------------------------. */ -static const uint16_t qoffsets[ECC_Q_NUM_BYTES][ECC_Q_COMP] = +const uint16_t cdrom_file::qoffsets[ECC_Q_NUM_BYTES][ECC_Q_COMP] = { { 0x000,0x058,0x0b0,0x108,0x160,0x1b8,0x210,0x268,0x2c0,0x318,0x370,0x3c8,0x420,0x478,0x4d0,0x528,0x580,0x5d8,0x630,0x688,0x6e0,0x738,0x790,0x7e8,0x840,0x898,0x034,0x08c,0x0e4,0x13c,0x194,0x1ec,0x244,0x29c,0x2f4,0x34c,0x3a4,0x3fc,0x454,0x4ac,0x504,0x55c,0x5b4 }, { 0x001,0x059,0x0b1,0x109,0x161,0x1b9,0x211,0x269,0x2c1,0x319,0x371,0x3c9,0x421,0x479,0x4d1,0x529,0x581,0x5d9,0x631,0x689,0x6e1,0x739,0x791,0x7e9,0x841,0x899,0x035,0x08d,0x0e5,0x13d,0x195,0x1ed,0x245,0x29d,0x2f5,0x34d,0x3a5,0x3fd,0x455,0x4ad,0x505,0x55d,0x5b5 }, @@ -1592,7 +1320,7 @@ // particular to a mode //------------------------------------------------- -inline uint8_t ecc_source_byte(const uint8_t *sector, uint32_t offset) +uint8_t cdrom_file::ecc_source_byte(const uint8_t *sector, uint32_t offset) { // in mode 2 always treat these as 0 bytes return (sector[MODE_OFFSET] == 2 && offset < 4) ? 0x00 : sector[SYNC_OFFSET + SYNC_NUM_BYTES + offset]; @@ -1612,7 +1340,7 @@ * @param [in,out] val2 The second value. */ -void ecc_compute_bytes(const uint8_t *sector, const uint16_t *row, int rowlen, uint8_t &val1, uint8_t &val2) +void cdrom_file::ecc_compute_bytes(const uint8_t *sector, const uint16_t *row, int rowlen, uint8_t &val1, uint8_t &val2) { val1 = val2 = 0; for (int component = 0; component < rowlen; component++) @@ -1637,7 +1365,7 @@ * @return true if it succeeds, false if it fails. */ -bool ecc_verify(const uint8_t *sector) +bool cdrom_file::ecc_verify(const uint8_t *sector) { // first verify P bytes for (int byte = 0; byte < ECC_P_NUM_BYTES; byte++) @@ -1670,7 +1398,7 @@ * @param [in,out] sector If non-null, the sector. */ -void ecc_generate(uint8_t *sector) +void cdrom_file::ecc_generate(uint8_t *sector) { // first verify P bytes for (int byte = 0; byte < ECC_P_NUM_BYTES; byte++) @@ -1691,8 +1419,1812 @@ * @param [in,out] sector If non-null, the sector. */ -void ecc_clear(uint8_t *sector) +void cdrom_file::ecc_clear(uint8_t *sector) { memset(§or[ECC_P_OFFSET], 0, 2 * ECC_P_NUM_BYTES); memset(§or[ECC_Q_OFFSET], 0, 2 * ECC_Q_NUM_BYTES); } + +/*************************************************************************** + + TOC parser + Handles CDRDAO .toc, CDRWIN .cue, Nero .nrg, and Sega GDROM .gdi + +***************************************************************************/ + +/*************************************************************************** + CONSTANTS & DEFINES +***************************************************************************/ + +/** + * @def TOKENIZE(); + * + * @brief A macro that defines tokenize. + * + * @param linebuffer The linebuffer. + * @param i Zero-based index of the. + * @param sizeof(linebuffer) The sizeof(linebuffer) + * @param token The token. + * @param sizeof(token) The sizeof(token) + */ + +#define TOKENIZE i = tokenize( linebuffer, i, sizeof(linebuffer), token, sizeof(token) ); + + +/*************************************************************************** + IMPLEMENTATION +***************************************************************************/ + +/** + * @fn std::string get_file_path(std::string &path) + * + * @brief Gets file path. + * + * @param [in,out] path Full pathname of the file. + * + * @return The file path. + */ + +std::string cdrom_file::get_file_path(std::string &path) +{ + int pos = path.find_last_of('\\'); + if (pos!=-1) { + path = path.substr(0,pos+1); + } else { + pos = path.find_last_of('/'); + path = path.substr(0,pos+1); + } + return path; +} +/*------------------------------------------------- + get_file_size - get the size of a file +-------------------------------------------------*/ + +/** + * @fn static uint64_t get_file_size(std::string_view filename) + * + * @brief Gets file size. + * + * @param filename Filename of the file. + * + * @return The file size. + */ + +uint64_t cdrom_file::get_file_size(std::string_view filename) +{ + osd_file::ptr file; + std::uint64_t filesize = 0; + + osd_file::open(std::string(filename), OPEN_FLAG_READ, file, filesize); // FIXME: allow osd_file to accept std::string_view + + return filesize; +} + + +/*------------------------------------------------- + tokenize - get a token from the line buffer +-------------------------------------------------*/ + +/** + * @fn static int tokenize( const char *linebuffer, int i, int linebuffersize, char *token, int tokensize ) + * + * @brief Tokenizes. + * + * @param linebuffer The linebuffer. + * @param i Zero-based index of the. + * @param linebuffersize The linebuffersize. + * @param [in,out] token If non-null, the token. + * @param tokensize The tokensize. + * + * @return An int. + */ + +int cdrom_file::tokenize( const char *linebuffer, int i, int linebuffersize, char *token, int tokensize ) +{ + int j = 0; + int singlequote = 0; + int doublequote = 0; + + while ((i < linebuffersize) && isspace((uint8_t)linebuffer[i])) + { + i++; + } + + while ((i < linebuffersize) && (j < tokensize)) + { + if (!singlequote && linebuffer[i] == '"' ) + { + doublequote = !doublequote; + } + else if (!doublequote && linebuffer[i] == '\'') + { + singlequote = !singlequote; + } + else if (!singlequote && !doublequote && isspace((uint8_t)linebuffer[i])) + { + break; + } + else + { + token[j] = linebuffer[i]; + j++; + } + + i++; + } + + token[j] = '\0'; + + return i; +} + + +/*------------------------------------------------- + msf_to_frames - convert m:s:f into a number of frames +-------------------------------------------------*/ + +/** + * @fn static int msf_to_frames( char *token ) + * + * @brief Msf to frames. + * + * @param [in,out] token If non-null, the token. + * + * @return An int. + */ + +int cdrom_file::msf_to_frames( char *token ) +{ + int m = 0; + int s = 0; + int f = 0; + + if( sscanf( token, "%d:%d:%d", &m, &s, &f ) == 1 ) + { + f = m; + } + else + { + /* convert to just frames */ + s += (m * 60); + f += (s * 75); + } + + return f; +} + +/*------------------------------------------------- + parse_wav_sample - takes a .WAV file, verifies + that the file is 16 bits, and returns the + length in bytes of the data and the offset in + bytes to where the data starts in the file. +-------------------------------------------------*/ + +/** + * @fn static uint32_t parse_wav_sample(std::string_view filename, uint32_t *dataoffs) + * + * @brief Parse WAV sample. + * + * @param filename Filename of the file. + * @param [in,out] dataoffs If non-null, the dataoffs. + * + * @return An uint32_t. + */ + +uint32_t cdrom_file::parse_wav_sample(std::string_view filename, uint32_t *dataoffs) +{ + unsigned long offset = 0; + uint32_t length, rate, filesize; + uint16_t bits, temp16; + char buf[32]; + osd_file::ptr file; + uint64_t fsize = 0; + std::uint32_t actual; + + std::string fname = std::string(filename); + std::error_condition const filerr = osd_file::open(fname, OPEN_FLAG_READ, file, fsize); + if (filerr) + { + printf("ERROR: could not open (%s)\n", fname.c_str()); + return 0; + } + + /* read the core header and make sure it's a WAVE file */ + file->read(buf, 0, 4, actual); + offset += actual; + if (offset < 4) + { + printf("ERROR: unexpected RIFF offset %lu (%s)\n", offset, fname.c_str()); + return 0; + } + if (memcmp(&buf[0], "RIFF", 4) != 0) + { + printf("ERROR: could not find RIFF header (%s)\n", fname.c_str()); + return 0; + } + + /* get the total size */ + file->read(&filesize, offset, 4, actual); + offset += actual; + if (offset < 8) + { + printf("ERROR: unexpected size offset %lu (%s)\n", offset, fname.c_str()); + return 0; + } + filesize = little_endianize_int32(filesize); + + /* read the RIFF file type and make sure it's a WAVE file */ + file->read(buf, offset, 4, actual); + offset += actual; + if (offset < 12) + { + printf("ERROR: unexpected WAVE offset %lu (%s)\n", offset, fname.c_str()); + return 0; + } + if (memcmp(&buf[0], "WAVE", 4) != 0) + { + printf("ERROR: could not find WAVE header (%s)\n", fname.c_str()); + return 0; + } + + /* seek until we find a format tag */ + while (true) + { + file->read(buf, offset, 4, actual); + offset += actual; + file->read(&length, offset, 4, actual); + offset += actual; + length = little_endianize_int32(length); + if (memcmp(&buf[0], "fmt ", 4) == 0) + break; + + /* seek to the next block */ + offset += length; + if (offset >= filesize) + { + printf("ERROR: could not find fmt tag (%s)\n", fname.c_str()); + return 0; + } + } + + /* read the format -- make sure it is PCM */ + file->read(&temp16, offset, 2, actual); + offset += actual; + temp16 = little_endianize_int16(temp16); + if (temp16 != 1) + { + printf("ERROR: unsupported format %u - only PCM is supported (%s)\n", temp16, fname.c_str()); + return 0; + } + + /* number of channels -- only stereo is supported */ + file->read(&temp16, offset, 2, actual); + offset += actual; + temp16 = little_endianize_int16(temp16); + if (temp16 != 2) + { + printf("ERROR: unsupported number of channels %u - only stereo is supported (%s)\n", temp16, fname.c_str()); + return 0; + } + + /* sample rate */ + file->read(&rate, offset, 4, actual); + offset += actual; + rate = little_endianize_int32(rate); + if (rate != 44100) + { + printf("ERROR: unsupported samplerate %u - only 44100 is supported (%s)\n", rate, fname.c_str()); + return 0; + } + + /* bytes/second and block alignment are ignored */ + file->read(buf, offset, 6, actual); + offset += actual; + + /* bits/sample */ + file->read(&bits, offset, 2, actual); + offset += actual; + bits = little_endianize_int16(bits); + if (bits != 16) + { + printf("ERROR: unsupported bits/sample %u - only 16 is supported (%s)\n", bits, fname.c_str()); + return 0; + } + + /* seek past any extra data */ + offset += length - 16; + + /* seek until we find a data tag */ + while (true) + { + file->read(buf, offset, 4, actual); + offset += actual; + file->read(&length, offset, 4, actual); + offset += actual; + length = little_endianize_int32(length); + if (memcmp(&buf[0], "data", 4) == 0) + break; + + /* seek to the next block */ + offset += length; + if (offset >= filesize) + { + printf("ERROR: could not find data tag (%s)\n", fname.c_str()); + return 0; + } + } + + /* if there was a 0 length data block, we're done */ + if (length == 0) + { + printf("ERROR: empty data block (%s)\n", fname.c_str()); + return 0; + } + + *dataoffs = offset; + + return length; +} + +/** + * @fn uint16_t read_uint16(FILE *infile) + * + * @brief Reads uint 16. + * + * @param [in,out] infile If non-null, the infile. + * + * @return The uint 16. + */ + +uint16_t cdrom_file::read_uint16(FILE *infile) +{ + uint16_t res = 0; + unsigned char buffer[2]; + + fread(buffer, 2, 1, infile); + + res = buffer[1] | buffer[0]<<8; + + return res; +} + +/** + * @fn uint32_t read_uint32(FILE *infile) + * + * @brief Reads uint 32. + * + * @param [in,out] infile If non-null, the infile. + * + * @return The uint 32. + */ + +uint32_t cdrom_file::read_uint32(FILE *infile) +{ + uint32_t res = 0; + unsigned char buffer[4]; + + fread(buffer, 4, 1, infile); + + res = buffer[3] | buffer[2]<<8 | buffer[1]<<16 | buffer[0]<<24; + + return res; +} + +/** + * @fn uint64_t read_uint64(FILE *infile) + * + * @brief Reads uint 64. + * + * @param [in,out] infile If non-null, the infile. + * + * @return The uint 64. + */ + +uint64_t cdrom_file::read_uint64(FILE *infile) +{ + uint64_t res0(0), res1(0); + uint64_t res; + unsigned char buffer[8]; + + fread(buffer, 8, 1, infile); + + res0 = buffer[3] | buffer[2]<<8 | buffer[1]<<16 | buffer[0]<<24; + res1 = buffer[7] | buffer[6]<<8 | buffer[5]<<16 | buffer[4]<<24; + + res = res0<<32 | res1; + + return res; +} + +/*------------------------------------------------- + parse_nero - parse a Nero .NRG file +-------------------------------------------------*/ + +/** + * @fn std::error_condition parse_nero(std::string_view tocfname, toc &outtoc, track_input_info &outinfo) + * + * @brief Chdcd parse nero. + * + * @param tocfname The tocfname. + * @param [in,out] outtoc The outtoc. + * @param [in,out] outinfo The outinfo. + * + * @return A std::error_condition. + */ + +std::error_condition cdrom_file::parse_nero(std::string_view tocfname, toc &outtoc, track_input_info &outinfo) +{ + unsigned char buffer[12]; + uint32_t chain_offs, chunk_size; + int done = 0; + + std::string path = std::string(tocfname); + + FILE *infile = fopen(path.c_str(), "rb"); + if (!infile) + { + return std::error_condition(errno, std::generic_category()); + } + + path = get_file_path(path); + + /* clear structures */ + memset(&outtoc, 0, sizeof(outtoc)); + outinfo.reset(); + + // seek to 12 bytes before the end + fseek(infile, -12, SEEK_END); + fread(buffer, 12, 1, infile); + + if (memcmp(buffer, "NER5", 4)) + { + printf("ERROR: Not a Nero 5.5 or later image!\n"); + fclose(infile); + return chd_file::error::UNSUPPORTED_FORMAT; + } + + chain_offs = buffer[11] | (buffer[10]<<8) | (buffer[9]<<16) | (buffer[8]<<24); + + if ((buffer[7] != 0) || (buffer[6] != 0) || (buffer[5] != 0) || (buffer[4] != 0)) + { + printf("ERROR: File size is > 4GB, this version of CHDMAN cannot handle it."); + fclose(infile); + return chd_file::error::UNSUPPORTED_FORMAT; + } + +// printf("NER5 detected, chain offset: %x\n", chain_offs); + + while (!done) + { + fseek(infile, chain_offs, SEEK_SET); + fread(buffer, 8, 1, infile); + + chunk_size = (buffer[7] | buffer[6]<<8 | buffer[5]<<16 | buffer[4]<<24); + +// printf("Chunk type: %c%c%c%c, size %x\n", buffer[0], buffer[1], buffer[2], buffer[3], chunk_size); + + // we want the DAOX chunk, which has the TOC information + if (!memcmp(buffer, "DAOX", 4)) + { + // skip second chunk size and UPC code + fseek(infile, 20, SEEK_CUR); + + uint8_t start, end; + fread(&start, 1, 1, infile); + fread(&end, 1, 1, infile); + +// printf("Start track %d End track: %d\n", start, end); + + outtoc.numtrks = (end-start) + 1; + + uint32_t offset = 0; + for (int track = start; track <= end; track++) + { + uint32_t size, mode; + uint64_t index0, index1, track_end; + + fseek(infile, 12, SEEK_CUR); // skip ISRC code + size = read_uint16(infile); + mode = read_uint16(infile); + fseek(infile, 2, SEEK_CUR); + index0 = read_uint64(infile); + index1 = read_uint64(infile); + track_end = read_uint64(infile); + +// printf("Track %d: sector size %d mode %x index0 %llx index1 %llx track_end %llx (pregap %d sectors, length %d sectors)\n", track, size, mode, index0, index1, track_end, (uint32_t)(index1-index0)/size, (uint32_t)(track_end-index1)/size); + outinfo.track[track-1].fname.assign(tocfname); + outinfo.track[track-1].offset = offset + (uint32_t)(index1-index0); + outinfo.track[track-1].idx0offs = 0; + outinfo.track[track-1].idx1offs = 0; + + switch (mode) + { + case 0x0000: // 2048 byte data + outtoc.tracks[track-1].trktype = CD_TRACK_MODE1; + outinfo.track[track-1].swap = false; + break; + + case 0x0300: // Mode 2 Form 1 + printf("ERROR: Mode 2 Form 1 tracks not supported\n"); + fclose(infile); + return chd_file::error::UNSUPPORTED_FORMAT; + + case 0x0500: // raw data + printf("ERROR: Raw data tracks not supported\n"); + fclose(infile); + return chd_file::error::UNSUPPORTED_FORMAT; + + case 0x0600: // 2352 byte mode 2 raw + outtoc.tracks[track-1].trktype = CD_TRACK_MODE2_RAW; + outinfo.track[track-1].swap = false; + break; + + case 0x0700: // 2352 byte audio + outtoc.tracks[track-1].trktype = CD_TRACK_AUDIO; + outinfo.track[track-1].swap = true; + break; + + case 0x0f00: // raw data with sub-channel + printf("ERROR: Raw data tracks with sub-channel not supported\n"); + fclose(infile); + return chd_file::error::UNSUPPORTED_FORMAT; + + case 0x1000: // audio with sub-channel + printf("ERROR: Audio tracks with sub-channel not supported\n"); + fclose(infile); + return chd_file::error::UNSUPPORTED_FORMAT; + + case 0x1100: // raw Mode 2 Form 1 with sub-channel + printf("ERROR: Raw Mode 2 Form 1 tracks with sub-channel not supported\n"); + fclose(infile); + return chd_file::error::UNSUPPORTED_FORMAT; + + default: + printf("ERROR: Unknown track type %x, contact MAMEDEV!\n", mode); + fclose(infile); + return chd_file::error::UNSUPPORTED_FORMAT; + } + + outtoc.tracks[track-1].datasize = size; + + outtoc.tracks[track-1].subtype = CD_SUB_NONE; + outtoc.tracks[track-1].subsize = 0; + + outtoc.tracks[track-1].pregap = (uint32_t)(index1-index0)/size; + outtoc.tracks[track-1].frames = (uint32_t)(track_end-index1)/size; + outtoc.tracks[track-1].postgap = 0; + outtoc.tracks[track-1].pgtype = 0; + outtoc.tracks[track-1].pgsub = CD_SUB_NONE; + outtoc.tracks[track-1].pgdatasize = 0; + outtoc.tracks[track-1].pgsubsize = 0; + outtoc.tracks[track-1].padframes = 0; + + offset += (uint32_t)track_end-index1; + } + } + + if (!memcmp(buffer, "END!", 4)) + { + done = 1; + } + else + { + chain_offs += chunk_size + 8; + } + } + + fclose(infile); + + return std::error_condition(); +} + +/*------------------------------------------------- + parse_iso - parse a .ISO file +-------------------------------------------------*/ + +/** + * @fn std::error_condition parse_iso(std::string_view tocfname, toc &outtoc, track_input_info &outinfo) + * + * @brief Parse ISO. + * + * @param tocfname The tocfname. + * @param [in,out] outtoc The outtoc. + * @param [in,out] outinfo The outinfo. + * + * @return A std::error_condition. + */ + +std::error_condition cdrom_file::parse_iso(std::string_view tocfname, toc &outtoc, track_input_info &outinfo) +{ + std::string path = std::string(tocfname); + + FILE *infile = fopen(path.c_str(), "rb"); + if (!infile) + { + return std::error_condition(errno, std::generic_category()); + } + + path = get_file_path(path); + + /* clear structures */ + memset(&outtoc, 0, sizeof(outtoc)); + outinfo.reset(); + + uint64_t size = get_file_size(tocfname); + fclose(infile); + + + outtoc.numtrks = 1; + + outinfo.track[0].fname = tocfname; + outinfo.track[0].offset = 0; + outinfo.track[0].idx0offs = 0; + outinfo.track[0].idx1offs = 0; + + if ((size % 2048)==0 ) { + outtoc.tracks[0].trktype = CD_TRACK_MODE1; + outtoc.tracks[0].frames = size / 2048; + outtoc.tracks[0].datasize = 2048; + outinfo.track[0].swap = false; + } else if ((size % 2336)==0 ) { + // 2352 byte mode 2 + outtoc.tracks[0].trktype = CD_TRACK_MODE2; + outtoc.tracks[0].frames = size / 2336; + outtoc.tracks[0].datasize = 2336; + outinfo.track[0].swap = false; + } else if ((size % 2352)==0 ) { + // 2352 byte mode 2 raw + outtoc.tracks[0].trktype = CD_TRACK_MODE2_RAW; + outtoc.tracks[0].frames = size / 2352; + outtoc.tracks[0].datasize = 2352; + outinfo.track[0].swap = false; + } else { + printf("ERROR: Unrecognized track type\n"); + return chd_file::error::UNSUPPORTED_FORMAT; + } + + outtoc.tracks[0].subtype = CD_SUB_NONE; + outtoc.tracks[0].subsize = 0; + + outtoc.tracks[0].pregap = 0; + + outtoc.tracks[0].postgap = 0; + outtoc.tracks[0].pgtype = 0; + outtoc.tracks[0].pgsub = CD_SUB_NONE; + outtoc.tracks[0].pgdatasize = 0; + outtoc.tracks[0].pgsubsize = 0; + outtoc.tracks[0].padframes = 0; + + + return std::error_condition(); +} + +/*------------------------------------------------- + parse_gdi - parse a Sega GD-ROM rip +-------------------------------------------------*/ + +/** + * @fn static std::error_condition parse_gdi(std::string_view tocfname, toc &outtoc, track_input_info &outinfo) + * + * @brief Chdcd parse GDI. + * + * @param tocfname The tocfname. + * @param [in,out] outtoc The outtoc. + * @param [in,out] outinfo The outinfo. + * + * @return A std::error_condition. + */ + +std::error_condition cdrom_file::parse_gdi(std::string_view tocfname, toc &outtoc, track_input_info &outinfo) +{ + int i, numtracks; + + std::string path = std::string(tocfname); + + FILE *infile = fopen(path.c_str(), "rt"); + if (!infile) + { + return std::error_condition(errno, std::generic_category()); + } + + path = get_file_path(path); + + /* clear structures */ + memset(&outtoc, 0, sizeof(outtoc)); + outinfo.reset(); + + outtoc.flags = CD_FLAG_GDROM; + + char linebuffer[512]; + fgets(linebuffer,511,infile); + numtracks=atoi(linebuffer); + + for(i=0;i 4 && outtoc.tracks[outtoc.numtrks-1].pgtype == CD_TRACK_MODE1_RAW) + { + if (outtoc.tracks[outtoc.numtrks-2].pgtype == CD_TRACK_AUDIO) + disc_pattern = TYPE_III_SPLIT; + else + disc_pattern = TYPE_III; + } + else if (outtoc.numtrks > 3) + { + if (outtoc.tracks[outtoc.numtrks-1].pgtype == CD_TRACK_AUDIO) + disc_pattern = TYPE_II; + else + disc_pattern = TYPE_III; + } + else if (outtoc.numtrks == 3) + { + disc_pattern = TYPE_I; + } + + /* + * Strip pregaps from Redump tracks and adjust the LBA offset to match TOSEC layout + */ + for (trknum = 1; trknum < outtoc.numtrks; trknum++) + { + uint32_t prev_pregap = outtoc.tracks[trknum-1].pregap; + uint32_t prev_offset = prev_pregap * (outtoc.tracks[trknum-1].datasize + outtoc.tracks[trknum-1].subsize); + uint32_t this_pregap = outtoc.tracks[trknum].pregap; + uint32_t this_offset = this_pregap * (outtoc.tracks[trknum].datasize + outtoc.tracks[trknum].subsize); + + if (outtoc.tracks[trknum-1].pgtype != CD_TRACK_AUDIO) + { + // pad previous DATA track to match TOSEC layout + outtoc.tracks[trknum-1].frames += this_pregap; + outtoc.tracks[trknum-1].padframes += this_pregap; + } + + if (outtoc.tracks[trknum-1].pgtype == CD_TRACK_AUDIO && outtoc.tracks[trknum].pgtype == CD_TRACK_AUDIO) + { + // shift previous AUDIO track to match TOSEC layout + outinfo.track[trknum-1].offset += prev_offset; + outtoc.tracks[trknum-1].splitframes += prev_pregap; + } + + if (outtoc.tracks[trknum-1].pgtype == CD_TRACK_AUDIO && outtoc.tracks[trknum].pgtype != CD_TRACK_AUDIO) + { + // shrink previous AUDIO track to match TOSEC layout + outtoc.tracks[trknum-1].frames -= prev_pregap; + outinfo.track[trknum-1].offset += prev_offset; + } + + if (outtoc.tracks[trknum].pgtype == CD_TRACK_AUDIO && trknum == outtoc.numtrks-1) + { + // shrink final AUDIO track to match TOSEC layout + outtoc.tracks[trknum].frames -= this_pregap; + outinfo.track[trknum].offset += this_offset; + } + } + + /* + * Special handling for TYPE_III_SPLIT, pregap in last track contains 75 frames audio and 150 frames data + */ + if (disc_pattern == TYPE_III_SPLIT) + { + assert(outtoc.tracks[outtoc.numtrks-1].pregap == 225); + + // grow the AUDIO track into DATA track by 75 frames as per Pattern III + outtoc.tracks[outtoc.numtrks-2].frames += 225; + outtoc.tracks[outtoc.numtrks-2].padframes += 150; + outinfo.track[outtoc.numtrks-2].offset = 150 * (outtoc.tracks[outtoc.numtrks-2].datasize+outtoc.tracks[outtoc.numtrks-2].subsize); + outtoc.tracks[outtoc.numtrks-2].splitframes = 75; + + // skip the pregap when reading the DATA track + outtoc.tracks[outtoc.numtrks-1].frames -= 225; + outinfo.track[outtoc.numtrks-1].offset += 225 * (outtoc.tracks[outtoc.numtrks-1].datasize+outtoc.tracks[outtoc.numtrks-1].subsize); + } + + /* + * TOC now matches TOSEC layout, set LBA for every track with HIGH-DENSITY area @ LBA 45000 + */ + for (trknum = 1; trknum < outtoc.numtrks; trknum++) + { + if (outtoc.tracks[trknum].multicuearea == HIGH_DENSITY && outtoc.tracks[trknum-1].multicuearea == SINGLE_DENSITY) + { + outtoc.tracks[trknum].physframeofs = 45000; + int dif=outtoc.tracks[trknum].physframeofs-(outtoc.tracks[trknum-1].frames+outtoc.tracks[trknum-1].physframeofs); + outtoc.tracks[trknum-1].frames += dif; + outtoc.tracks[trknum-1].padframes = dif; + } + else + { + outtoc.tracks[trknum].physframeofs = outtoc.tracks[trknum-1].physframeofs + outtoc.tracks[trknum-1].frames; + } + + // no longer need the pregap info, zeroed out to match TOSEC layout + outtoc.tracks[trknum].pregap = 0; + outtoc.tracks[trknum].pgtype = 0; + } + + if (EXTRA_VERBOSE) + for (trknum = 0; trknum < outtoc.numtrks; trknum++) + { + printf("trk %d: %d frames @ offset %d, pad=%d, split=%d, area=%d, phys=%d, pregap=%d, pgtype=%d, idx0=%d, idx1=%d, (true %d)\n", + trknum+1, + outtoc.tracks[trknum].frames, + outinfo.track[trknum].offset, + outtoc.tracks[trknum].padframes, + outtoc.tracks[trknum].splitframes, + outtoc.tracks[trknum].multicuearea, + outtoc.tracks[trknum].physframeofs, + outtoc.tracks[trknum].pregap, + outtoc.tracks[trknum].pgtype, + outinfo.track[trknum].idx0offs, + outinfo.track[trknum].idx1offs, + outtoc.tracks[trknum].frames - outtoc.tracks[trknum].padframes); + } + + return std::error_condition(); +} + +/*------------------------------------------------- + parse_toc - parse a CDRDAO format TOC file +-------------------------------------------------*/ + +/** + * @fn std::error_condition parse_toc(std::string_view tocfname, toc &outtoc, track_input_info &outinfo) + * + * @brief Chdcd parse TOC. + * + * @param tocfname The tocfname. + * @param [in,out] outtoc The outtoc. + * @param [in,out] outinfo The outinfo. + * + * @return A std::error_condition. + */ + +std::error_condition cdrom_file::parse_toc(std::string_view tocfname, toc &outtoc, track_input_info &outinfo) +{ + static char token[512]; + + auto pos = tocfname.rfind('.'); + std::string tocfext = pos == std::string_view::npos ? std::string() : strmakelower(tocfname.substr(pos + 1)); + + if (tocfext == "gdi") + { + return parse_gdi(tocfname, outtoc, outinfo); + } + + if (tocfext == "cue") + { + if (is_gdicue(tocfname)) + return parse_gdicue(tocfname, outtoc, outinfo); + else + return parse_cue(tocfname, outtoc, outinfo); + } + + if (tocfext == "nrg") + { + return parse_nero(tocfname, outtoc, outinfo); + } + + if (tocfext == "iso" || tocfext == "cdr" || tocfext == "toast") + { + return parse_iso(tocfname, outtoc, outinfo); + } + + std::string path = std::string(tocfname); + + FILE *infile = fopen(path.c_str(), "rt"); + if (!infile) + { + return std::error_condition(errno, std::generic_category()); + } + + path = get_file_path(path); + + /* clear structures */ + memset(&outtoc, 0, sizeof(outtoc)); + outinfo.reset(); + + int trknum = -1; + + char linebuffer[512]; + while (!feof(infile)) + { + /* get the next line */ + fgets(linebuffer, 511, infile); + + /* if EOF didn't hit, keep going */ + if (!feof(infile)) + { + int i = 0; + + TOKENIZE + + if ((!strcmp(token, "DATAFILE")) || (!strcmp(token, "AUDIOFILE")) || (!strcmp(token, "FILE"))) + { + int f; + + /* found the data file for a track */ + TOKENIZE + + /* keep the filename */ + outinfo.track[trknum].fname.assign(path).append(token); + + /* get either the offset or the length */ + TOKENIZE + + if (!strcmp(token, "SWAP")) + { + TOKENIZE + + outinfo.track[trknum].swap = true; + } + else + { + outinfo.track[trknum].swap = false; + } + + if (token[0] == '#') + { + /* it's a decimal offset, use it */ + f = strtoul(&token[1], nullptr, 10); + } + else if (isdigit((uint8_t)token[0])) + { + /* convert the time to an offset */ + f = msf_to_frames( token ); + + f *= (outtoc.tracks[trknum].datasize + outtoc.tracks[trknum].subsize); + } + else + { + f = 0; + } + + outinfo.track[trknum].offset = f; + + TOKENIZE + + if (isdigit((uint8_t)token[0])) + { + // this could be the length or an offset from the previous field. + f = msf_to_frames( token ); + + TOKENIZE + + if (isdigit((uint8_t)token[0])) + { + // it was an offset. + f *= (outtoc.tracks[trknum].datasize + outtoc.tracks[trknum].subsize); + + outinfo.track[trknum].offset += f; + + // this is the length. + f = msf_to_frames( token ); + } + } + else if( trknum == 0 && outinfo.track[trknum].offset != 0 ) + { + /* the 1st track might have a length with no offset */ + f = outinfo.track[trknum].offset / (outtoc.tracks[trknum].datasize + outtoc.tracks[trknum].subsize); + outinfo.track[trknum].offset = 0; + } + else + { + /* guesstimate the track length? */ + f = 0; + } + + outtoc.tracks[trknum].frames = f; + } + else if (!strcmp(token, "TRACK")) + { + trknum++; + + /* next token on the line is the track type */ + TOKENIZE + + outtoc.tracks[trknum].trktype = CD_TRACK_MODE1; + outtoc.tracks[trknum].datasize = 0; + outtoc.tracks[trknum].subtype = CD_SUB_NONE; + outtoc.tracks[trknum].subsize = 0; + outtoc.tracks[trknum].pgsub = CD_SUB_NONE; + outtoc.tracks[trknum].padframes = 0; + + convert_type_string_to_track_info(token, &outtoc.tracks[trknum]); + if (outtoc.tracks[trknum].datasize == 0) + { + fclose(infile); + printf("ERROR: Unknown track type [%s]. Contact MAMEDEV.\n", token); + return chd_file::error::UNSUPPORTED_FORMAT; + } + + /* next (optional) token on the line is the subcode type */ + TOKENIZE + + convert_subtype_string_to_track_info(token, &outtoc.tracks[trknum]); + } + else if (!strcmp(token, "START")) + { + int frames; + + /* get index */ + TOKENIZE + frames = msf_to_frames( token ); + + outtoc.tracks[trknum].pregap = frames; + } + } + } + + /* close the input TOC */ + fclose(infile); + + /* store the number of tracks found */ + outtoc.numtrks = trknum + 1; + + return std::error_condition(); +} diff -Nru mame-0.242+dfsg.1/src/lib/util/cdrom.h mame-0.243+dfsg.1/src/lib/util/cdrom.h --- mame-0.242+dfsg.1/src/lib/util/cdrom.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/util/cdrom.h 2022-04-29 05:37:26.000000000 +0000 @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Aaron Giles +// copyright-holders:Aaron Giles,R. Belmont /*************************************************************************** cdrom.h @@ -13,175 +13,252 @@ #pragma once #include "chd.h" - +#include "ioprocs.h" #include "osdcore.h" +class cdrom_file { +public: + // tracks are padded to a multiple of this many frames + static constexpr uint32_t TRACK_PADDING = 4; + + static constexpr uint32_t MAX_TRACKS = 99; /* AFAIK the theoretical limit */ + static constexpr uint32_t MAX_SECTOR_DATA = 2352; + static constexpr uint32_t MAX_SUBCODE_DATA = 96; + + static constexpr uint32_t FRAME_SIZE = MAX_SECTOR_DATA + MAX_SUBCODE_DATA; + static constexpr uint32_t FRAMES_PER_HUNK = 8; + + static constexpr uint32_t METADATA_WORDS = 1 + MAX_TRACKS * 6; + + enum + { + CD_TRACK_MODE1 = 0, /* mode 1 2048 bytes/sector */ + CD_TRACK_MODE1_RAW, /* mode 1 2352 bytes/sector */ + CD_TRACK_MODE2, /* mode 2 2336 bytes/sector */ + CD_TRACK_MODE2_FORM1, /* mode 2 2048 bytes/sector */ + CD_TRACK_MODE2_FORM2, /* mode 2 2324 bytes/sector */ + CD_TRACK_MODE2_FORM_MIX, /* mode 2 2336 bytes/sector */ + CD_TRACK_MODE2_RAW, /* mode 2 2352 bytes / sector */ + CD_TRACK_AUDIO, /* redbook audio track 2352 bytes/sector (588 samples) */ + + CD_TRACK_RAW_DONTCARE /* special flag for cdrom_read_data: just return me whatever is there */ + }; + + enum + { + CD_SUB_NORMAL = 0, /* "cooked" 96 bytes per sector */ + CD_SUB_RAW, /* raw uninterleaved 96 bytes per sector */ + CD_SUB_NONE /* no subcode data stored */ + }; + + enum + { + CD_FLAG_GDROM = 0x00000001, // disc is a GD-ROM, all tracks should be stored with GD-ROM metadata + CD_FLAG_GDROMLE = 0x00000002 // legacy GD-ROM, with little-endian CDDA data + }; + + struct track_info + { + /* fields used by CHDMAN and in MAME */ + uint32_t trktype; /* track type */ + uint32_t subtype; /* subcode data type */ + uint32_t datasize; /* size of data in each sector of this track */ + uint32_t subsize; /* size of subchannel data in each sector of this track */ + uint32_t frames; /* number of frames in this track */ + uint32_t extraframes; /* number of "spillage" frames in this track */ + uint32_t pregap; /* number of pregap frames */ + uint32_t postgap; /* number of postgap frames */ + uint32_t pgtype; /* type of sectors in pregap */ + uint32_t pgsub; /* type of subchannel data in pregap */ + uint32_t pgdatasize; /* size of data in each sector of the pregap */ + uint32_t pgsubsize; /* size of subchannel data in each sector of the pregap */ + + /* fields used in CHDMAN only */ + uint32_t padframes; /* number of frames of padding to add to the end of the track; needed for GDI */ + uint32_t splitframes; /* number of frames to read from the next file; needed for Redump split-bin GDI */ + + /* fields used in MAME/MESS only */ + uint32_t logframeofs; /* logical frame of actual track data - offset by pregap size if pregap not physically present */ + uint32_t physframeofs; /* physical frame of actual track data in CHD data */ + uint32_t chdframeofs; /* frame number this track starts at on the CHD */ + uint32_t logframes; /* number of frames from logframeofs until end of track data */ + + /* fields used in multi-cue GDI */ + uint32_t multicuearea; + }; + + + struct toc + { + uint32_t numtrks; /* number of tracks */ + uint32_t flags; /* see FLAG_ above */ + track_info tracks[MAX_TRACKS]; + }; + + struct track_input_entry + { + track_input_entry() { reset(); } + void reset() { fname.clear(); offset = idx0offs = idx1offs = 0; swap = false; } + + std::string fname; // filename for each track + uint32_t offset; // offset in the data file for each track + bool swap; // data needs to be byte swapped + uint32_t idx0offs; + uint32_t idx1offs; + }; + + struct track_input_info + { + void reset() { for (auto & elem : track) elem.reset(); } + + track_input_entry track[MAX_TRACKS]; + }; + + + cdrom_file(chd_file *chd); + cdrom_file(std::string_view inputfile); + ~cdrom_file(); + + + /* core read access */ + bool read_data(uint32_t lbasector, void *buffer, uint32_t datatype, bool phys=false); + bool read_subcode(uint32_t lbasector, void *buffer, bool phys=false); + + /* handy utilities */ + uint32_t get_track(uint32_t frame) const; + uint32_t get_track_start(uint32_t track) const {return cdtoc.tracks[track == 0xaa ? cdtoc.numtrks : track].logframeofs; } + uint32_t get_track_start_phys(uint32_t track) const { return cdtoc.tracks[track == 0xaa ? cdtoc.numtrks : track].physframeofs; } + + /* TOC utilities */ + static std::error_condition parse_nero(std::string_view tocfname, toc &outtoc, track_input_info &outinfo); + static std::error_condition parse_iso(std::string_view tocfname, toc &outtoc, track_input_info &outinfo); + static std::error_condition parse_gdi(std::string_view tocfname, toc &outtoc, track_input_info &outinfo); + static std::error_condition parse_cue(std::string_view tocfname, toc &outtoc, track_input_info &outinfo); + static bool is_gdicue(std::string_view tocfname); + static std::error_condition parse_gdicue(std::string_view tocfname, toc &outtoc, track_input_info &outinfo); + static std::error_condition parse_toc(std::string_view tocfname, toc &outtoc, track_input_info &outinfo); + int get_last_track() const { return cdtoc.numtrks; } + int get_adr_control(int track) const { return track == 0xaa || cdtoc.tracks[track].trktype == CD_TRACK_AUDIO ? 0x10 : 0x14; } + int get_track_type(int track) const { return cdtoc.tracks[track].trktype; } + const toc &get_toc() const { return cdtoc; } + + /* extra utilities */ + static void convert_type_string_to_track_info(const char *typestring, track_info *info); + static void convert_type_string_to_pregap_info(const char *typestring, track_info *info); + static void convert_subtype_string_to_track_info(const char *typestring, track_info *info); + static void convert_subtype_string_to_pregap_info(const char *typestring, track_info *info); + static const char *get_type_string(uint32_t trktype); + static const char *get_subtype_string(uint32_t subtype); + static std::error_condition parse_metadata(chd_file *chd, toc &toc); + static std::error_condition write_metadata(chd_file *chd, const toc &toc); + + // ECC utilities + static bool ecc_verify(const uint8_t *sector); + static void ecc_generate(uint8_t *sector); + static void ecc_clear(uint8_t *sector); + + + + static inline uint32_t msf_to_lba(uint32_t msf) + { + return ( ((msf&0x00ff0000)>>16) * 60 * 75) + (((msf&0x0000ff00)>>8) * 75) + ((msf&0x000000ff)>>0); + } + + static inline uint32_t lba_to_msf(uint32_t lba) + { + uint8_t m, s, f; + + m = lba / (60 * 75); + lba -= m * (60 * 75); + s = lba / 75; + f = lba % 75; - -/*************************************************************************** - CONSTANTS -***************************************************************************/ - -// tracks are padded to a multiple of this many frames -const uint32_t CD_TRACK_PADDING = 4; - -#define CD_MAX_TRACKS (99) /* AFAIK the theoretical limit */ -#define CD_MAX_SECTOR_DATA (2352) -#define CD_MAX_SUBCODE_DATA (96) - -#define CD_FRAME_SIZE (CD_MAX_SECTOR_DATA + CD_MAX_SUBCODE_DATA) -#define CD_FRAMES_PER_HUNK (8) - -#define CD_METADATA_WORDS (1+(CD_MAX_TRACKS * 6)) - -enum -{ - CD_TRACK_MODE1 = 0, /* mode 1 2048 bytes/sector */ - CD_TRACK_MODE1_RAW, /* mode 1 2352 bytes/sector */ - CD_TRACK_MODE2, /* mode 2 2336 bytes/sector */ - CD_TRACK_MODE2_FORM1, /* mode 2 2048 bytes/sector */ - CD_TRACK_MODE2_FORM2, /* mode 2 2324 bytes/sector */ - CD_TRACK_MODE2_FORM_MIX, /* mode 2 2336 bytes/sector */ - CD_TRACK_MODE2_RAW, /* mode 2 2352 bytes / sector */ - CD_TRACK_AUDIO, /* redbook audio track 2352 bytes/sector (588 samples) */ - - CD_TRACK_RAW_DONTCARE /* special flag for cdrom_read_data: just return me whatever is there */ -}; - -enum -{ - CD_SUB_NORMAL = 0, /* "cooked" 96 bytes per sector */ - CD_SUB_RAW, /* raw uninterleaved 96 bytes per sector */ - CD_SUB_NONE /* no subcode data stored */ -}; - -#define CD_FLAG_GDROM 0x00000001 // disc is a GD-ROM, all tracks should be stored with GD-ROM metadata -#define CD_FLAG_GDROMLE 0x00000002 // legacy GD-ROM, with little-endian CDDA data - -/*************************************************************************** - TYPE DEFINITIONS -***************************************************************************/ - -struct cdrom_file; - -struct cdrom_track_info -{ - /* fields used by CHDMAN and in MAME */ - uint32_t trktype; /* track type */ - uint32_t subtype; /* subcode data type */ - uint32_t datasize; /* size of data in each sector of this track */ - uint32_t subsize; /* size of subchannel data in each sector of this track */ - uint32_t frames; /* number of frames in this track */ - uint32_t extraframes; /* number of "spillage" frames in this track */ - uint32_t pregap; /* number of pregap frames */ - uint32_t postgap; /* number of postgap frames */ - uint32_t pgtype; /* type of sectors in pregap */ - uint32_t pgsub; /* type of subchannel data in pregap */ - uint32_t pgdatasize; /* size of data in each sector of the pregap */ - uint32_t pgsubsize; /* size of subchannel data in each sector of the pregap */ - - /* fields used in CHDMAN only */ - uint32_t padframes; /* number of frames of padding to add to the end of the track; needed for GDI */ - uint32_t splitframes; /* number of frames to read from the next file; needed for Redump split-bin GDI */ - - /* fields used in MAME/MESS only */ - uint32_t logframeofs; /* logical frame of actual track data - offset by pregap size if pregap not physically present */ - uint32_t physframeofs; /* physical frame of actual track data in CHD data */ - uint32_t chdframeofs; /* frame number this track starts at on the CHD */ - uint32_t logframes; /* number of frames from logframeofs until end of track data */ - - /* fields used in multi-cue GDI */ - uint32_t multicuearea; -}; - - -struct cdrom_toc -{ - uint32_t numtrks; /* number of tracks */ - uint32_t flags; /* see FLAG_ above */ - cdrom_track_info tracks[CD_MAX_TRACKS]; -}; - - - -/*************************************************************************** - FUNCTION PROTOTYPES -***************************************************************************/ - -/* base functionality */ -cdrom_file *cdrom_open(chd_file *chd); -void cdrom_close(cdrom_file *file); - -cdrom_file *cdrom_open(const char *inputfile); - -/* core read access */ -uint32_t cdrom_read_data(cdrom_file *file, uint32_t lbasector, void *buffer, uint32_t datatype, bool phys=false); -uint32_t cdrom_read_subcode(cdrom_file *file, uint32_t lbasector, void *buffer, bool phys=false); - -/* handy utilities */ -uint32_t cdrom_get_track(cdrom_file *file, uint32_t frame); -uint32_t cdrom_get_track_start(cdrom_file *file, uint32_t track); -uint32_t cdrom_get_track_start_phys(cdrom_file *file, uint32_t track); -chd_file *cdrom_get_chd(cdrom_file *file); - -/* TOC utilities */ -int cdrom_get_last_track(cdrom_file *file); -int cdrom_get_adr_control(cdrom_file *file, int track); -int cdrom_get_track_type(cdrom_file *file, int track); -const cdrom_toc *cdrom_get_toc(cdrom_file *file); - -/* extra utilities */ -void cdrom_convert_type_string_to_track_info(const char *typestring, cdrom_track_info *info); -void cdrom_convert_type_string_to_pregap_info(const char *typestring, cdrom_track_info *info); -void cdrom_convert_subtype_string_to_track_info(const char *typestring, cdrom_track_info *info); -void cdrom_convert_subtype_string_to_pregap_info(const char *typestring, cdrom_track_info *info); -const char *cdrom_get_type_string(uint32_t trktype); -const char *cdrom_get_subtype_string(uint32_t subtype); -std::error_condition cdrom_parse_metadata(chd_file *chd, cdrom_toc *toc); -std::error_condition cdrom_write_metadata(chd_file *chd, const cdrom_toc *toc); - -// ECC utilities -bool ecc_verify(const uint8_t *sector); -void ecc_generate(uint8_t *sector); -void ecc_clear(uint8_t *sector); - - - -/*************************************************************************** - INLINE FUNCTIONS -***************************************************************************/ - -static inline uint32_t msf_to_lba(uint32_t msf) -{ - return ( ((msf&0x00ff0000)>>16) * 60 * 75) + (((msf&0x0000ff00)>>8) * 75) + ((msf&0x000000ff)>>0); -} - -static inline uint32_t lba_to_msf(uint32_t lba) -{ - uint8_t m, s, f; - - m = lba / (60 * 75); - lba -= m * (60 * 75); - s = lba / 75; - f = lba % 75; - - return ((m / 10) << 20) | ((m % 10) << 16) | + return ((m / 10) << 20) | ((m % 10) << 16) | ((s / 10) << 12) | ((s % 10) << 8) | ((f / 10) << 4) | ((f % 10) << 0); -} + } -// segacd needs it like this.. investigate -// Angelo also says PCE tracks often start playing at the -// wrong address.. related? -static inline uint32_t lba_to_msf_alt(int lba) -{ - uint32_t ret = 0; - - ret |= ((lba / (60 * 75))&0xff)<<16; - ret |= (((lba / 75) % 60)&0xff)<<8; - ret |= ((lba % 75)&0xff)<<0; - - return ret; -} + // segacd needs it like this.. investigate + // Angelo also says PCE tracks often start playing at the + // wrong address.. related? + static inline uint32_t lba_to_msf_alt(int lba) + { + uint32_t ret = 0; + + ret |= ((lba / (60 * 75))&0xff)<<16; + ret |= (((lba / 75) % 60)&0xff)<<8; + ret |= ((lba % 75)&0xff)<<0; + + return ret; + } + +private: + enum gdi_area { + SINGLE_DENSITY, + HIGH_DENSITY + }; + + enum gdi_pattern { + TYPE_UNKNOWN = 0, + TYPE_I, + TYPE_II, + TYPE_III, + TYPE_III_SPLIT + }; + + /** @brief offset within sector. */ + static constexpr int SYNC_OFFSET = 0x000; + /** @brief 12 bytes. */ + static constexpr int SYNC_NUM_BYTES = 12; + + /** @brief offset within sector. */ + static constexpr int MODE_OFFSET = 0x00f; + + /** @brief offset within sector. */ + static constexpr int ECC_P_OFFSET = 0x81c; + /** @brief 2 lots of 86. */ + static constexpr int ECC_P_NUM_BYTES = 86; + /** @brief 24 bytes each. */ + static constexpr int ECC_P_COMP = 24; + + /** @brief The ECC q offset. */ + static constexpr int ECC_Q_OFFSET = ECC_P_OFFSET + 2 * ECC_P_NUM_BYTES; + /** @brief 2 lots of 52. */ + static constexpr int ECC_Q_NUM_BYTES = 52; + /** @brief 43 bytes each. */ + static constexpr int ECC_Q_COMP = 43; + + // ECC tables + static const uint8_t ecclow[256]; + static const uint8_t ecchigh[256]; + static const uint16_t poffsets[ECC_P_NUM_BYTES][ECC_P_COMP]; + static const uint16_t qoffsets[ECC_Q_NUM_BYTES][ECC_Q_COMP]; + + /** @brief The chd. */ + chd_file * chd; /* CHD file */ + /** @brief The cdtoc. */ + toc cdtoc; /* TOC for the CD */ + /** @brief Information describing the track. */ + track_input_info cdtrack_info; /* track info */ + /** @brief The fhandle[ CD maximum tracks]. */ + util::random_read::ptr fhandle[MAX_TRACKS];/* file handle */ + + inline uint32_t physical_to_chd_lba(uint32_t physlba, uint32_t &tracknum) const; + inline uint32_t logical_to_chd_lba(uint32_t physlba, uint32_t &tracknum) const; + + static void get_info_from_type_string(const char *typestring, uint32_t *trktype, uint32_t *datasize); + static uint8_t ecc_source_byte(const uint8_t *sector, uint32_t offset); + static void ecc_compute_bytes(const uint8_t *sector, const uint16_t *row, int rowlen, uint8_t &val1, uint8_t &val2); + std::error_condition read_partial_sector(void *dest, uint32_t lbasector, uint32_t chdsector, uint32_t tracknum, uint32_t startoffs, uint32_t length, bool phys=false); + + static std::string get_file_path(std::string &path); + static uint64_t get_file_size(std::string_view filename); + static int tokenize( const char *linebuffer, int i, int linebuffersize, char *token, int tokensize ); + static int msf_to_frames( char *token ); + static uint32_t parse_wav_sample(std::string_view filename, uint32_t *dataoffs); + static uint16_t read_uint16(FILE *infile); + static uint32_t read_uint32(FILE *infile); + static uint64_t read_uint64(FILE *infile); +}; #endif // MAME_LIB_UTIL_CDROM_H diff -Nru mame-0.242+dfsg.1/src/lib/util/chdcd.cpp mame-0.243+dfsg.1/src/lib/util/chdcd.cpp --- mame-0.242+dfsg.1/src/lib/util/chdcd.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/util/chdcd.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,1848 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:R. Belmont -/*************************************************************************** - - TOC parser for CHD compression frontend - Handles CDRDAO .toc, CDRWIN .cue, Nero .nrg, and Sega GDROM .gdi - -***************************************************************************/ - -#include "chdcd.h" - -#include "chd.h" -#include "corefile.h" -#include "corestr.h" - -#include "osdcore.h" - -#include -#include -#include -#include - - - -/*************************************************************************** - CONSTANTS & DEFINES -***************************************************************************/ - -/** - * @def TOKENIZE(); - * - * @brief A macro that defines tokenize. - * - * @param linebuffer The linebuffer. - * @param i Zero-based index of the. - * @param sizeof(linebuffer) The sizeof(linebuffer) - * @param token The token. - * @param sizeof(token) The sizeof(token) - */ - -#define TOKENIZE i = tokenize( linebuffer, i, sizeof(linebuffer), token, sizeof(token) ); - - -enum gdi_area { - SINGLE_DENSITY, - HIGH_DENSITY -}; - -enum gdi_pattern { - TYPE_UNKNOWN = 0, - TYPE_I, - TYPE_II, - TYPE_III, - TYPE_III_SPLIT -}; - - -/*************************************************************************** - GLOBAL VARIABLES -***************************************************************************/ - -/** @brief The linebuffer[ 512]. */ -static char linebuffer[512]; - - - -/*************************************************************************** - IMPLEMENTATION -***************************************************************************/ - -/** - * @fn static std::string get_file_path(std::string &path) - * - * @brief Gets file path. - * - * @param [in,out] path Full pathname of the file. - * - * @return The file path. - */ - -static std::string get_file_path(std::string &path) -{ - int pos = path.find_last_of('\\'); - if (pos!=-1) { - path = path.substr(0,pos+1); - } else { - pos = path.find_last_of('/'); - path = path.substr(0,pos+1); - } - return path; -} -/*------------------------------------------------- - get_file_size - get the size of a file --------------------------------------------------*/ - -/** - * @fn static uint64_t get_file_size(const char *filename) - * - * @brief Gets file size. - * - * @param filename Filename of the file. - * - * @return The file size. - */ - -static uint64_t get_file_size(const char *filename) -{ - osd_file::ptr file; - std::uint64_t filesize = 0; - - osd_file::open(filename, OPEN_FLAG_READ, file, filesize); - - return filesize; -} - - -/*------------------------------------------------- - tokenize - get a token from the line buffer --------------------------------------------------*/ - -/** - * @fn static int tokenize( const char *linebuffer, int i, int linebuffersize, char *token, int tokensize ) - * - * @brief Tokenizes. - * - * @param linebuffer The linebuffer. - * @param i Zero-based index of the. - * @param linebuffersize The linebuffersize. - * @param [in,out] token If non-null, the token. - * @param tokensize The tokensize. - * - * @return An int. - */ - -static int tokenize( const char *linebuffer, int i, int linebuffersize, char *token, int tokensize ) -{ - int j = 0; - int singlequote = 0; - int doublequote = 0; - - while ((i < linebuffersize) && isspace((uint8_t)linebuffer[i])) - { - i++; - } - - while ((i < linebuffersize) && (j < tokensize)) - { - if (!singlequote && linebuffer[i] == '"' ) - { - doublequote = !doublequote; - } - else if (!doublequote && linebuffer[i] == '\'') - { - singlequote = !singlequote; - } - else if (!singlequote && !doublequote && isspace((uint8_t)linebuffer[i])) - { - break; - } - else - { - token[j] = linebuffer[i]; - j++; - } - - i++; - } - - token[j] = '\0'; - - return i; -} - - -/*------------------------------------------------- - msf_to_frames - convert m:s:f into a number of frames --------------------------------------------------*/ - -/** - * @fn static int msf_to_frames( char *token ) - * - * @brief Msf to frames. - * - * @param [in,out] token If non-null, the token. - * - * @return An int. - */ - -static int msf_to_frames( char *token ) -{ - int m = 0; - int s = 0; - int f = 0; - - if( sscanf( token, "%d:%d:%d", &m, &s, &f ) == 1 ) - { - f = m; - } - else - { - /* convert to just frames */ - s += (m * 60); - f += (s * 75); - } - - return f; -} - -/*------------------------------------------------- - parse_wav_sample - takes a .WAV file, verifies - that the file is 16 bits, and returns the - length in bytes of the data and the offset in - bytes to where the data starts in the file. --------------------------------------------------*/ - -/** - * @fn static uint32_t parse_wav_sample(const char *filename, uint32_t *dataoffs) - * - * @brief Parse WAV sample. - * - * @param filename Filename of the file. - * @param [in,out] dataoffs If non-null, the dataoffs. - * - * @return An uint32_t. - */ - -static uint32_t parse_wav_sample(const char *filename, uint32_t *dataoffs) -{ - unsigned long offset = 0; - uint32_t length, rate, filesize; - uint16_t bits, temp16; - char buf[32]; - osd_file::ptr file; - uint64_t fsize = 0; - std::uint32_t actual; - - std::error_condition const filerr = osd_file::open(filename, OPEN_FLAG_READ, file, fsize); - if (filerr) - { - printf("ERROR: could not open (%s)\n", filename); - return 0; - } - - /* read the core header and make sure it's a WAVE file */ - file->read(buf, 0, 4, actual); - offset += actual; - if (offset < 4) - { - printf("ERROR: unexpected RIFF offset %lu (%s)\n", offset, filename); - return 0; - } - if (memcmp(&buf[0], "RIFF", 4) != 0) - { - printf("ERROR: could not find RIFF header (%s)\n", filename); - return 0; - } - - /* get the total size */ - file->read(&filesize, offset, 4, actual); - offset += actual; - if (offset < 8) - { - printf("ERROR: unexpected size offset %lu (%s)\n", offset, filename); - return 0; - } - filesize = little_endianize_int32(filesize); - - /* read the RIFF file type and make sure it's a WAVE file */ - file->read(buf, offset, 4, actual); - offset += actual; - if (offset < 12) - { - printf("ERROR: unexpected WAVE offset %lu (%s)\n", offset, filename); - return 0; - } - if (memcmp(&buf[0], "WAVE", 4) != 0) - { - printf("ERROR: could not find WAVE header (%s)\n", filename); - return 0; - } - - /* seek until we find a format tag */ - while (true) - { - file->read(buf, offset, 4, actual); - offset += actual; - file->read(&length, offset, 4, actual); - offset += actual; - length = little_endianize_int32(length); - if (memcmp(&buf[0], "fmt ", 4) == 0) - break; - - /* seek to the next block */ - offset += length; - if (offset >= filesize) - { - printf("ERROR: could not find fmt tag (%s)\n", filename); - return 0; - } - } - - /* read the format -- make sure it is PCM */ - file->read(&temp16, offset, 2, actual); - offset += actual; - temp16 = little_endianize_int16(temp16); - if (temp16 != 1) - { - printf("ERROR: unsupported format %u - only PCM is supported (%s)\n", temp16, filename); - return 0; - } - - /* number of channels -- only stereo is supported */ - file->read(&temp16, offset, 2, actual); - offset += actual; - temp16 = little_endianize_int16(temp16); - if (temp16 != 2) - { - printf("ERROR: unsupported number of channels %u - only stereo is supported (%s)\n", temp16, filename); - return 0; - } - - /* sample rate */ - file->read(&rate, offset, 4, actual); - offset += actual; - rate = little_endianize_int32(rate); - if (rate != 44100) - { - printf("ERROR: unsupported samplerate %u - only 44100 is supported (%s)\n", rate, filename); - return 0; - } - - /* bytes/second and block alignment are ignored */ - file->read(buf, offset, 6, actual); - offset += actual; - - /* bits/sample */ - file->read(&bits, offset, 2, actual); - offset += actual; - bits = little_endianize_int16(bits); - if (bits != 16) - { - printf("ERROR: unsupported bits/sample %u - only 16 is supported (%s)\n", bits, filename); - return 0; - } - - /* seek past any extra data */ - offset += length - 16; - - /* seek until we find a data tag */ - while (true) - { - file->read(buf, offset, 4, actual); - offset += actual; - file->read(&length, offset, 4, actual); - offset += actual; - length = little_endianize_int32(length); - if (memcmp(&buf[0], "data", 4) == 0) - break; - - /* seek to the next block */ - offset += length; - if (offset >= filesize) - { - printf("ERROR: could not find data tag (%s)\n", filename); - return 0; - } - } - - /* if there was a 0 length data block, we're done */ - if (length == 0) - { - printf("ERROR: empty data block (%s)\n", filename); - return 0; - } - - *dataoffs = offset; - - return length; -} - -/** - * @fn uint16_t read_uint16(FILE *infile) - * - * @brief Reads uint 16. - * - * @param [in,out] infile If non-null, the infile. - * - * @return The uint 16. - */ - -uint16_t read_uint16(FILE *infile) -{ - uint16_t res = 0; - unsigned char buffer[2]; - - fread(buffer, 2, 1, infile); - - res = buffer[1] | buffer[0]<<8; - - return res; -} - -/** - * @fn uint32_t read_uint32(FILE *infile) - * - * @brief Reads uint 32. - * - * @param [in,out] infile If non-null, the infile. - * - * @return The uint 32. - */ - -uint32_t read_uint32(FILE *infile) -{ - uint32_t res = 0; - unsigned char buffer[4]; - - fread(buffer, 4, 1, infile); - - res = buffer[3] | buffer[2]<<8 | buffer[1]<<16 | buffer[0]<<24; - - return res; -} - -/** - * @fn uint64_t read_uint64(FILE *infile) - * - * @brief Reads uint 64. - * - * @param [in,out] infile If non-null, the infile. - * - * @return The uint 64. - */ - -uint64_t read_uint64(FILE *infile) -{ - uint64_t res0(0), res1(0); - uint64_t res; - unsigned char buffer[8]; - - fread(buffer, 8, 1, infile); - - res0 = buffer[3] | buffer[2]<<8 | buffer[1]<<16 | buffer[0]<<24; - res1 = buffer[7] | buffer[6]<<8 | buffer[5]<<16 | buffer[4]<<24; - - res = res0<<32 | res1; - - return res; -} - -/*------------------------------------------------- - chdcd_parse_nero - parse a Nero .NRG file --------------------------------------------------*/ - -/** - * @fn std::error_condition chdcd_parse_nero(const char *tocfname, cdrom_toc &outtoc, chdcd_track_input_info &outinfo) - * - * @brief Chdcd parse nero. - * - * @param tocfname The tocfname. - * @param [in,out] outtoc The outtoc. - * @param [in,out] outinfo The outinfo. - * - * @return A std::error_condition. - */ - -std::error_condition chdcd_parse_nero(const char *tocfname, cdrom_toc &outtoc, chdcd_track_input_info &outinfo) -{ - unsigned char buffer[12]; - uint32_t chain_offs, chunk_size; - int done = 0; - - std::string path = std::string(tocfname); - - FILE *infile = fopen(tocfname, "rb"); - if (!infile) - { - return std::error_condition(errno, std::generic_category()); - } - - path = get_file_path(path); - - /* clear structures */ - memset(&outtoc, 0, sizeof(outtoc)); - outinfo.reset(); - - // seek to 12 bytes before the end - fseek(infile, -12, SEEK_END); - fread(buffer, 12, 1, infile); - - if (memcmp(buffer, "NER5", 4)) - { - printf("ERROR: Not a Nero 5.5 or later image!\n"); - fclose(infile); - return chd_file::error::UNSUPPORTED_FORMAT; - } - - chain_offs = buffer[11] | (buffer[10]<<8) | (buffer[9]<<16) | (buffer[8]<<24); - - if ((buffer[7] != 0) || (buffer[6] != 0) || (buffer[5] != 0) || (buffer[4] != 0)) - { - printf("ERROR: File size is > 4GB, this version of CHDMAN cannot handle it."); - fclose(infile); - return chd_file::error::UNSUPPORTED_FORMAT; - } - -// printf("NER5 detected, chain offset: %x\n", chain_offs); - - while (!done) - { - uint32_t offset; - uint8_t start, end; - int track; - - fseek(infile, chain_offs, SEEK_SET); - fread(buffer, 8, 1, infile); - - chunk_size = (buffer[7] | buffer[6]<<8 | buffer[5]<<16 | buffer[4]<<24); - -// printf("Chunk type: %c%c%c%c, size %x\n", buffer[0], buffer[1], buffer[2], buffer[3], chunk_size); - - // we want the DAOX chunk, which has the TOC information - if (!memcmp(buffer, "DAOX", 4)) - { - // skip second chunk size and UPC code - fseek(infile, 20, SEEK_CUR); - - fread(&start, 1, 1, infile); - fread(&end, 1, 1, infile); - -// printf("Start track %d End track: %d\n", start, end); - - outtoc.numtrks = (end-start) + 1; - - offset = 0; - for (track = start; track <= end; track++) - { - uint32_t size, mode; - uint64_t index0, index1, track_end; - - fseek(infile, 12, SEEK_CUR); // skip ISRC code - size = read_uint16(infile); - mode = read_uint16(infile); - fseek(infile, 2, SEEK_CUR); - index0 = read_uint64(infile); - index1 = read_uint64(infile); - track_end = read_uint64(infile); - -// printf("Track %d: sector size %d mode %x index0 %llx index1 %llx track_end %llx (pregap %d sectors, length %d sectors)\n", track, size, mode, index0, index1, track_end, (uint32_t)(index1-index0)/size, (uint32_t)(track_end-index1)/size); - outinfo.track[track-1].fname.assign(tocfname); - outinfo.track[track-1].offset = offset + (uint32_t)(index1-index0); - outinfo.track[track-1].idx0offs = 0; - outinfo.track[track-1].idx1offs = 0; - - switch (mode) - { - case 0x0000: // 2048 byte data - outtoc.tracks[track-1].trktype = CD_TRACK_MODE1; - outinfo.track[track-1].swap = false; - break; - - case 0x0300: // Mode 2 Form 1 - printf("ERROR: Mode 2 Form 1 tracks not supported\n"); - fclose(infile); - return chd_file::error::UNSUPPORTED_FORMAT; - - case 0x0500: // raw data - printf("ERROR: Raw data tracks not supported\n"); - fclose(infile); - return chd_file::error::UNSUPPORTED_FORMAT; - - case 0x0600: // 2352 byte mode 2 raw - outtoc.tracks[track-1].trktype = CD_TRACK_MODE2_RAW; - outinfo.track[track-1].swap = false; - break; - - case 0x0700: // 2352 byte audio - outtoc.tracks[track-1].trktype = CD_TRACK_AUDIO; - outinfo.track[track-1].swap = true; - break; - - case 0x0f00: // raw data with sub-channel - printf("ERROR: Raw data tracks with sub-channel not supported\n"); - fclose(infile); - return chd_file::error::UNSUPPORTED_FORMAT; - - case 0x1000: // audio with sub-channel - printf("ERROR: Audio tracks with sub-channel not supported\n"); - fclose(infile); - return chd_file::error::UNSUPPORTED_FORMAT; - - case 0x1100: // raw Mode 2 Form 1 with sub-channel - printf("ERROR: Raw Mode 2 Form 1 tracks with sub-channel not supported\n"); - fclose(infile); - return chd_file::error::UNSUPPORTED_FORMAT; - - default: - printf("ERROR: Unknown track type %x, contact MAMEDEV!\n", mode); - fclose(infile); - return chd_file::error::UNSUPPORTED_FORMAT; - } - - outtoc.tracks[track-1].datasize = size; - - outtoc.tracks[track-1].subtype = CD_SUB_NONE; - outtoc.tracks[track-1].subsize = 0; - - outtoc.tracks[track-1].pregap = (uint32_t)(index1-index0)/size; - outtoc.tracks[track-1].frames = (uint32_t)(track_end-index1)/size; - outtoc.tracks[track-1].postgap = 0; - outtoc.tracks[track-1].pgtype = 0; - outtoc.tracks[track-1].pgsub = CD_SUB_NONE; - outtoc.tracks[track-1].pgdatasize = 0; - outtoc.tracks[track-1].pgsubsize = 0; - outtoc.tracks[track-1].padframes = 0; - - offset += (uint32_t)track_end-index1; - } - } - - if (!memcmp(buffer, "END!", 4)) - { - done = 1; - } - else - { - chain_offs += chunk_size + 8; - } - } - - fclose(infile); - - return std::error_condition(); -} - -/*------------------------------------------------- - chdcd_parse_iso - parse a .ISO file --------------------------------------------------*/ - -/** - * @fn std::error_condition chdcd_parse_iso(const char *tocfname, cdrom_toc &outtoc, chdcd_track_input_info &outinfo) - * - * @brief Chdcd parse ISO. - * - * @param tocfname The tocfname. - * @param [in,out] outtoc The outtoc. - * @param [in,out] outinfo The outinfo. - * - * @return A std::error_condition. - */ - -std::error_condition chdcd_parse_iso(const char *tocfname, cdrom_toc &outtoc, chdcd_track_input_info &outinfo) -{ - std::string path = std::string(tocfname); - - FILE *infile = fopen(tocfname, "rb"); - if (!infile) - { - return std::error_condition(errno, std::generic_category()); - } - - path = get_file_path(path); - - /* clear structures */ - memset(&outtoc, 0, sizeof(outtoc)); - outinfo.reset(); - - uint64_t size = get_file_size(tocfname); - fclose(infile); - - - outtoc.numtrks = 1; - - outinfo.track[0].fname = tocfname; - outinfo.track[0].offset = 0; - outinfo.track[0].idx0offs = 0; - outinfo.track[0].idx1offs = 0; - - if ((size % 2048)==0 ) { - outtoc.tracks[0].trktype = CD_TRACK_MODE1; - outtoc.tracks[0].frames = size / 2048; - outtoc.tracks[0].datasize = 2048; - outinfo.track[0].swap = false; - } else if ((size % 2336)==0 ) { - // 2352 byte mode 2 - outtoc.tracks[0].trktype = CD_TRACK_MODE2; - outtoc.tracks[0].frames = size / 2336; - outtoc.tracks[0].datasize = 2336; - outinfo.track[0].swap = false; - } else if ((size % 2352)==0 ) { - // 2352 byte mode 2 raw - outtoc.tracks[0].trktype = CD_TRACK_MODE2_RAW; - outtoc.tracks[0].frames = size / 2352; - outtoc.tracks[0].datasize = 2352; - outinfo.track[0].swap = false; - } else { - printf("ERROR: Unrecognized track type\n"); - return chd_file::error::UNSUPPORTED_FORMAT; - } - - outtoc.tracks[0].subtype = CD_SUB_NONE; - outtoc.tracks[0].subsize = 0; - - outtoc.tracks[0].pregap = 0; - - outtoc.tracks[0].postgap = 0; - outtoc.tracks[0].pgtype = 0; - outtoc.tracks[0].pgsub = CD_SUB_NONE; - outtoc.tracks[0].pgdatasize = 0; - outtoc.tracks[0].pgsubsize = 0; - outtoc.tracks[0].padframes = 0; - - - return std::error_condition(); -} - -/*------------------------------------------------- - chdcd_parse_gdi - parse a Sega GD-ROM rip --------------------------------------------------*/ - -/** - * @fn static std::error_condition chdcd_parse_gdi(const char *tocfname, cdrom_toc &outtoc, chdcd_track_input_info &outinfo) - * - * @brief Chdcd parse GDI. - * - * @param tocfname The tocfname. - * @param [in,out] outtoc The outtoc. - * @param [in,out] outinfo The outinfo. - * - * @return A std::error_condition. - */ - -static std::error_condition chdcd_parse_gdi(const char *tocfname, cdrom_toc &outtoc, chdcd_track_input_info &outinfo) -{ - int i, numtracks; - - std::string path = std::string(tocfname); - - FILE *infile = fopen(tocfname, "rt"); - if (!infile) - { - return std::error_condition(errno, std::generic_category()); - } - - path = get_file_path(path); - - /* clear structures */ - memset(&outtoc, 0, sizeof(outtoc)); - outinfo.reset(); - - outtoc.flags = CD_FLAG_GDROM; - - fgets(linebuffer,511,infile); - numtracks=atoi(linebuffer); - - for(i=0;i 4 && outtoc.tracks[outtoc.numtrks-1].pgtype == CD_TRACK_MODE1_RAW) - { - if (outtoc.tracks[outtoc.numtrks-2].pgtype == CD_TRACK_AUDIO) - disc_pattern = TYPE_III_SPLIT; - else - disc_pattern = TYPE_III; - } - else if (outtoc.numtrks > 3) - { - if (outtoc.tracks[outtoc.numtrks-1].pgtype == CD_TRACK_AUDIO) - disc_pattern = TYPE_II; - else - disc_pattern = TYPE_III; - } - else if (outtoc.numtrks == 3) - { - disc_pattern = TYPE_I; - } - - /* - * Strip pregaps from Redump tracks and adjust the LBA offset to match TOSEC layout - */ - for (trknum = 1; trknum < outtoc.numtrks; trknum++) - { - uint32_t prev_pregap = outtoc.tracks[trknum-1].pregap; - uint32_t prev_offset = prev_pregap * (outtoc.tracks[trknum-1].datasize + outtoc.tracks[trknum-1].subsize); - uint32_t this_pregap = outtoc.tracks[trknum].pregap; - uint32_t this_offset = this_pregap * (outtoc.tracks[trknum].datasize + outtoc.tracks[trknum].subsize); - - if (outtoc.tracks[trknum-1].pgtype != CD_TRACK_AUDIO) - { - // pad previous DATA track to match TOSEC layout - outtoc.tracks[trknum-1].frames += this_pregap; - outtoc.tracks[trknum-1].padframes += this_pregap; - } - - if (outtoc.tracks[trknum-1].pgtype == CD_TRACK_AUDIO && outtoc.tracks[trknum].pgtype == CD_TRACK_AUDIO) - { - // shift previous AUDIO track to match TOSEC layout - outinfo.track[trknum-1].offset += prev_offset; - outtoc.tracks[trknum-1].splitframes += prev_pregap; - } - - if (outtoc.tracks[trknum-1].pgtype == CD_TRACK_AUDIO && outtoc.tracks[trknum].pgtype != CD_TRACK_AUDIO) - { - // shrink previous AUDIO track to match TOSEC layout - outtoc.tracks[trknum-1].frames -= prev_pregap; - outinfo.track[trknum-1].offset += prev_offset; - } - - if (outtoc.tracks[trknum].pgtype == CD_TRACK_AUDIO && trknum == outtoc.numtrks-1) - { - // shrink final AUDIO track to match TOSEC layout - outtoc.tracks[trknum].frames -= this_pregap; - outinfo.track[trknum].offset += this_offset; - } - } - - /* - * Special handling for TYPE_III_SPLIT, pregap in last track contains 75 frames audio and 150 frames data - */ - if (disc_pattern == TYPE_III_SPLIT) - { - assert(outtoc.tracks[outtoc.numtrks-1].pregap == 225); - - // grow the AUDIO track into DATA track by 75 frames as per Pattern III - outtoc.tracks[outtoc.numtrks-2].frames += 225; - outtoc.tracks[outtoc.numtrks-2].padframes += 150; - outinfo.track[outtoc.numtrks-2].offset = 150 * (outtoc.tracks[outtoc.numtrks-2].datasize+outtoc.tracks[outtoc.numtrks-2].subsize); - outtoc.tracks[outtoc.numtrks-2].splitframes = 75; - - // skip the pregap when reading the DATA track - outtoc.tracks[outtoc.numtrks-1].frames -= 225; - outinfo.track[outtoc.numtrks-1].offset += 225 * (outtoc.tracks[outtoc.numtrks-1].datasize+outtoc.tracks[outtoc.numtrks-1].subsize); - } - - /* - * TOC now matches TOSEC layout, set LBA for every track with HIGH-DENSITY area @ LBA 45000 - */ - for (trknum = 1; trknum < outtoc.numtrks; trknum++) - { - if (outtoc.tracks[trknum].multicuearea == HIGH_DENSITY && outtoc.tracks[trknum-1].multicuearea == SINGLE_DENSITY) - { - outtoc.tracks[trknum].physframeofs = 45000; - int dif=outtoc.tracks[trknum].physframeofs-(outtoc.tracks[trknum-1].frames+outtoc.tracks[trknum-1].physframeofs); - outtoc.tracks[trknum-1].frames += dif; - outtoc.tracks[trknum-1].padframes = dif; - } - else - { - outtoc.tracks[trknum].physframeofs = outtoc.tracks[trknum-1].physframeofs + outtoc.tracks[trknum-1].frames; - } - - // no longer need the pregap info, zeroed out to match TOSEC layout - outtoc.tracks[trknum].pregap = 0; - outtoc.tracks[trknum].pgtype = 0; - } - -#if 0 - for (trknum = 0; trknum < outtoc.numtrks; trknum++) - { - printf("trk %d: %d frames @ offset %d, pad=%d, split=%d, area=%d, phys=%d, pregap=%d, pgtype=%d, idx0=%d, idx1=%d, (true %d)\n", - trknum+1, - outtoc.tracks[trknum].frames, - outinfo.track[trknum].offset, - outtoc.tracks[trknum].padframes, - outtoc.tracks[trknum].splitframes, - outtoc.tracks[trknum].multicuearea, - outtoc.tracks[trknum].physframeofs, - outtoc.tracks[trknum].pregap, - outtoc.tracks[trknum].pgtype, - outinfo.track[trknum].idx0offs, - outinfo.track[trknum].idx1offs, - outtoc.tracks[trknum].frames - outtoc.tracks[trknum].padframes); - } -#endif - - return std::error_condition(); -} - -/*------------------------------------------------- - chdcd_parse_toc - parse a CDRDAO format TOC file --------------------------------------------------*/ - -/** - * @fn std::error_condition chdcd_parse_toc(const char *tocfname, cdrom_toc &outtoc, chdcd_track_input_info &outinfo) - * - * @brief Chdcd parse TOC. - * - * @param tocfname The tocfname. - * @param [in,out] outtoc The outtoc. - * @param [in,out] outinfo The outinfo. - * - * @return A std::error_condition. - */ - -std::error_condition chdcd_parse_toc(const char *tocfname, cdrom_toc &outtoc, chdcd_track_input_info &outinfo) -{ - int i, trknum; - static char token[512]; - char tocftemp[512]; - - strcpy(tocftemp, tocfname); - for (i = 0; i < strlen(tocfname); i++) - { - tocftemp[i] = tolower(tocftemp[i]); - } - - if (strstr(tocftemp,".gdi")) - { - return chdcd_parse_gdi(tocfname, outtoc, outinfo); - } - - if (strstr(tocftemp,".cue")) - { - if (chdcd_is_gdicue(tocfname)) - return chdcd_parse_gdicue(tocfname, outtoc, outinfo); - else - return chdcd_parse_cue(tocfname, outtoc, outinfo); - } - - if (strstr(tocftemp,".nrg")) - { - return chdcd_parse_nero(tocfname, outtoc, outinfo); - } - - if (strstr(tocftemp,".iso") || strstr(tocftemp,".cdr") || strstr(tocftemp,".toast")) - { - return chdcd_parse_iso(tocfname, outtoc, outinfo); - } - - std::string path = std::string(tocfname); - - FILE *infile = fopen(tocfname, "rt"); - if (!infile) - { - return std::error_condition(errno, std::generic_category()); - } - - path = get_file_path(path); - - /* clear structures */ - memset(&outtoc, 0, sizeof(outtoc)); - outinfo.reset(); - - trknum = -1; - - while (!feof(infile)) - { - /* get the next line */ - fgets(linebuffer, 511, infile); - - /* if EOF didn't hit, keep going */ - if (!feof(infile)) - { - i = 0; - - TOKENIZE - - if ((!strcmp(token, "DATAFILE")) || (!strcmp(token, "AUDIOFILE")) || (!strcmp(token, "FILE"))) - { - int f; - - /* found the data file for a track */ - TOKENIZE - - /* keep the filename */ - outinfo.track[trknum].fname.assign(path).append(token); - - /* get either the offset or the length */ - TOKENIZE - - if (!strcmp(token, "SWAP")) - { - TOKENIZE - - outinfo.track[trknum].swap = true; - } - else - { - outinfo.track[trknum].swap = false; - } - - if (token[0] == '#') - { - /* it's a decimal offset, use it */ - f = strtoul(&token[1], nullptr, 10); - } - else if (isdigit((uint8_t)token[0])) - { - /* convert the time to an offset */ - f = msf_to_frames( token ); - - f *= (outtoc.tracks[trknum].datasize + outtoc.tracks[trknum].subsize); - } - else - { - f = 0; - } - - outinfo.track[trknum].offset = f; - - TOKENIZE - - if (isdigit((uint8_t)token[0])) - { - // this could be the length or an offset from the previous field. - f = msf_to_frames( token ); - - TOKENIZE - - if (isdigit((uint8_t)token[0])) - { - // it was an offset. - f *= (outtoc.tracks[trknum].datasize + outtoc.tracks[trknum].subsize); - - outinfo.track[trknum].offset += f; - - // this is the length. - f = msf_to_frames( token ); - } - } - else if( trknum == 0 && outinfo.track[trknum].offset != 0 ) - { - /* the 1st track might have a length with no offset */ - f = outinfo.track[trknum].offset / (outtoc.tracks[trknum].datasize + outtoc.tracks[trknum].subsize); - outinfo.track[trknum].offset = 0; - } - else - { - /* guesstimate the track length? */ - f = 0; - } - - outtoc.tracks[trknum].frames = f; - } - else if (!strcmp(token, "TRACK")) - { - trknum++; - - /* next token on the line is the track type */ - TOKENIZE - - outtoc.tracks[trknum].trktype = CD_TRACK_MODE1; - outtoc.tracks[trknum].datasize = 0; - outtoc.tracks[trknum].subtype = CD_SUB_NONE; - outtoc.tracks[trknum].subsize = 0; - outtoc.tracks[trknum].pgsub = CD_SUB_NONE; - outtoc.tracks[trknum].padframes = 0; - - cdrom_convert_type_string_to_track_info(token, &outtoc.tracks[trknum]); - if (outtoc.tracks[trknum].datasize == 0) - { - fclose(infile); - printf("ERROR: Unknown track type [%s]. Contact MAMEDEV.\n", token); - return chd_file::error::UNSUPPORTED_FORMAT; - } - - /* next (optional) token on the line is the subcode type */ - TOKENIZE - - cdrom_convert_subtype_string_to_track_info(token, &outtoc.tracks[trknum]); - } - else if (!strcmp(token, "START")) - { - int frames; - - /* get index */ - TOKENIZE - frames = msf_to_frames( token ); - - outtoc.tracks[trknum].pregap = frames; - } - } - } - - /* close the input TOC */ - fclose(infile); - - /* store the number of tracks found */ - outtoc.numtrks = trknum + 1; - - return std::error_condition(); -} diff -Nru mame-0.242+dfsg.1/src/lib/util/chdcd.h mame-0.243+dfsg.1/src/lib/util/chdcd.h --- mame-0.242+dfsg.1/src/lib/util/chdcd.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/util/chdcd.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,40 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:R. Belmont -/*************************************************************************** - - CDRDAO TOC parser for CHD compression frontend - -***************************************************************************/ -#ifndef MAME_LIB_UTIL_CHDCD_H -#define MAME_LIB_UTIL_CHDCD_H - -#pragma once - -#include "cdrom.h" - -#include - - -struct chdcd_track_input_entry -{ - chdcd_track_input_entry() { reset(); } - void reset() { fname.clear(); offset = idx0offs = idx1offs = 0; swap = false; } - - std::string fname; // filename for each track - uint32_t offset; // offset in the data file for each track - bool swap; // data needs to be byte swapped - uint32_t idx0offs; - uint32_t idx1offs; -}; - -struct chdcd_track_input_info -{ - void reset() { for (auto & elem : track) elem.reset(); } - - chdcd_track_input_entry track[CD_MAX_TRACKS]; -}; - - -std::error_condition chdcd_parse_toc(const char *tocfname, cdrom_toc &outtoc, chdcd_track_input_info &outinfo); - -#endif // MAME_LIB_UTIL_CHDCD_H diff -Nru mame-0.242+dfsg.1/src/lib/util/chdcodec.cpp mame-0.243+dfsg.1/src/lib/util/chdcodec.cpp --- mame-0.242+dfsg.1/src/lib/util/chdcodec.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/util/chdcodec.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -300,12 +300,12 @@ // construction/destruction chd_cd_compressor(chd_file &chd, uint32_t hunkbytes, bool lossy) : chd_compressor(chd, hunkbytes, lossy), - m_base_compressor(chd, (hunkbytes / CD_FRAME_SIZE) * CD_MAX_SECTOR_DATA, lossy), - m_subcode_compressor(chd, (hunkbytes / CD_FRAME_SIZE) * CD_MAX_SUBCODE_DATA, lossy), - m_buffer(hunkbytes + (hunkbytes / CD_FRAME_SIZE) * CD_MAX_SUBCODE_DATA) + m_base_compressor(chd, (hunkbytes / cdrom_file::FRAME_SIZE) * cdrom_file::MAX_SECTOR_DATA, lossy), + m_subcode_compressor(chd, (hunkbytes / cdrom_file::FRAME_SIZE) * cdrom_file::MAX_SUBCODE_DATA, lossy), + m_buffer(hunkbytes + (hunkbytes / cdrom_file::FRAME_SIZE) * cdrom_file::MAX_SUBCODE_DATA) { // make sure the CHD's hunk size is an even multiple of the frame size - if (hunkbytes % CD_FRAME_SIZE != 0) + if (hunkbytes % cdrom_file::FRAME_SIZE != 0) throw std::error_condition(chd_file::error::CODEC_ERROR); } @@ -313,7 +313,7 @@ virtual uint32_t compress(const uint8_t *src, uint32_t srclen, uint8_t *dest) override { // determine header bytes - uint32_t frames = srclen / CD_FRAME_SIZE; + uint32_t frames = srclen / cdrom_file::FRAME_SIZE; uint32_t complen_bytes = (srclen < 65536) ? 2 : 3; uint32_t ecc_bytes = (frames + 7) / 8; uint32_t header_bytes = ecc_bytes + complen_bytes; @@ -324,21 +324,21 @@ // copy audio data followed by subcode data for (uint32_t framenum = 0; framenum < frames; framenum++) { - memcpy(&m_buffer[framenum * CD_MAX_SECTOR_DATA], &src[framenum * CD_FRAME_SIZE], CD_MAX_SECTOR_DATA); - memcpy(&m_buffer[frames * CD_MAX_SECTOR_DATA + framenum * CD_MAX_SUBCODE_DATA], &src[framenum * CD_FRAME_SIZE + CD_MAX_SECTOR_DATA], CD_MAX_SUBCODE_DATA); + memcpy(&m_buffer[framenum * cdrom_file::MAX_SECTOR_DATA], &src[framenum * cdrom_file::FRAME_SIZE], cdrom_file::MAX_SECTOR_DATA); + memcpy(&m_buffer[frames * cdrom_file::MAX_SECTOR_DATA + framenum * cdrom_file::MAX_SUBCODE_DATA], &src[framenum * cdrom_file::FRAME_SIZE + cdrom_file::MAX_SECTOR_DATA], cdrom_file::MAX_SUBCODE_DATA); // clear out ECC data if we can - uint8_t *sector = &m_buffer[framenum * CD_MAX_SECTOR_DATA]; - if (memcmp(sector, f_cd_sync_header, sizeof(f_cd_sync_header)) == 0 && ecc_verify(sector)) + uint8_t *sector = &m_buffer[framenum * cdrom_file::MAX_SECTOR_DATA]; + if (memcmp(sector, f_cd_sync_header, sizeof(f_cd_sync_header)) == 0 && cdrom_file::ecc_verify(sector)) { dest[framenum / 8] |= 1 << (framenum % 8); memset(sector, 0, sizeof(f_cd_sync_header)); - ecc_clear(sector); + cdrom_file::ecc_clear(sector); } } // encode the base portion - uint32_t complen = m_base_compressor.compress(&m_buffer[0], frames * CD_MAX_SECTOR_DATA, &dest[header_bytes]); + uint32_t complen = m_base_compressor.compress(&m_buffer[0], frames * cdrom_file::MAX_SECTOR_DATA, &dest[header_bytes]); if (complen >= srclen) throw std::error_condition(chd_file::error::COMPRESSION_ERROR); @@ -349,7 +349,7 @@ dest[ecc_bytes + 2] = complen >> ((complen_bytes - 3) * 8); // encode the subcode - return header_bytes + complen + m_subcode_compressor.compress(&m_buffer[frames * CD_MAX_SECTOR_DATA], frames * CD_MAX_SUBCODE_DATA, &dest[header_bytes + complen]); + return header_bytes + complen + m_subcode_compressor.compress(&m_buffer[frames * cdrom_file::MAX_SECTOR_DATA], frames * cdrom_file::MAX_SUBCODE_DATA, &dest[header_bytes + complen]); } private: @@ -369,12 +369,12 @@ // construction/destruction chd_cd_decompressor(chd_file &chd, uint32_t hunkbytes, bool lossy) : chd_decompressor(chd, hunkbytes, lossy), - m_base_decompressor(chd, (hunkbytes / CD_FRAME_SIZE) * CD_MAX_SECTOR_DATA, lossy), - m_subcode_decompressor(chd, (hunkbytes / CD_FRAME_SIZE) * CD_MAX_SUBCODE_DATA, lossy), + m_base_decompressor(chd, (hunkbytes / cdrom_file::FRAME_SIZE) * cdrom_file::MAX_SECTOR_DATA, lossy), + m_subcode_decompressor(chd, (hunkbytes / cdrom_file::FRAME_SIZE) * cdrom_file::MAX_SUBCODE_DATA, lossy), m_buffer(hunkbytes) { // make sure the CHD's hunk size is an even multiple of the frame size - if (hunkbytes % CD_FRAME_SIZE != 0) + if (hunkbytes % cdrom_file::FRAME_SIZE != 0) throw std::error_condition(chd_file::error::CODEC_ERROR); } @@ -382,7 +382,7 @@ virtual void decompress(const uint8_t *src, uint32_t complen, uint8_t *dest, uint32_t destlen) override { // determine header bytes - uint32_t frames = destlen / CD_FRAME_SIZE; + uint32_t frames = destlen / cdrom_file::FRAME_SIZE; uint32_t complen_bytes = (destlen < 65536) ? 2 : 3; uint32_t ecc_bytes = (frames + 7) / 8; uint32_t header_bytes = ecc_bytes + complen_bytes; @@ -393,21 +393,21 @@ complen_base = (complen_base << 8) | src[ecc_bytes + 2]; // reset and decode - m_base_decompressor.decompress(&src[header_bytes], complen_base, &m_buffer[0], frames * CD_MAX_SECTOR_DATA); - m_subcode_decompressor.decompress(&src[header_bytes + complen_base], complen - complen_base - header_bytes, &m_buffer[frames * CD_MAX_SECTOR_DATA], frames * CD_MAX_SUBCODE_DATA); + m_base_decompressor.decompress(&src[header_bytes], complen_base, &m_buffer[0], frames * cdrom_file::MAX_SECTOR_DATA); + m_subcode_decompressor.decompress(&src[header_bytes + complen_base], complen - complen_base - header_bytes, &m_buffer[frames * cdrom_file::MAX_SECTOR_DATA], frames * cdrom_file::MAX_SUBCODE_DATA); // reassemble the data for (uint32_t framenum = 0; framenum < frames; framenum++) { - memcpy(&dest[framenum * CD_FRAME_SIZE], &m_buffer[framenum * CD_MAX_SECTOR_DATA], CD_MAX_SECTOR_DATA); - memcpy(&dest[framenum * CD_FRAME_SIZE + CD_MAX_SECTOR_DATA], &m_buffer[frames * CD_MAX_SECTOR_DATA + framenum * CD_MAX_SUBCODE_DATA], CD_MAX_SUBCODE_DATA); + memcpy(&dest[framenum * cdrom_file::FRAME_SIZE], &m_buffer[framenum * cdrom_file::MAX_SECTOR_DATA], cdrom_file::MAX_SECTOR_DATA); + memcpy(&dest[framenum * cdrom_file::FRAME_SIZE + cdrom_file::MAX_SECTOR_DATA], &m_buffer[frames * cdrom_file::MAX_SECTOR_DATA + framenum * cdrom_file::MAX_SUBCODE_DATA], cdrom_file::MAX_SUBCODE_DATA); // reconstitute the ECC data and sync header - uint8_t *sector = &dest[framenum * CD_FRAME_SIZE]; + uint8_t *sector = &dest[framenum * cdrom_file::FRAME_SIZE]; if ((src[framenum / 8] & (1 << (framenum % 8))) != 0) { memcpy(sector, f_cd_sync_header, sizeof(f_cd_sync_header)); - ecc_generate(sector); + cdrom_file::ecc_generate(sector); } } } @@ -1427,7 +1427,7 @@ m_buffer(hunkbytes) { // make sure the CHD's hunk size is an even multiple of the frame size - if (hunkbytes % CD_FRAME_SIZE != 0) + if (hunkbytes % cdrom_file::FRAME_SIZE != 0) throw std::error_condition(chd_file::error::CODEC_ERROR); // determine whether we want native or swapped samples @@ -1438,7 +1438,7 @@ // configure the encoder m_encoder.set_sample_rate(44100); m_encoder.set_num_channels(2); - m_encoder.set_block_size(blocksize((hunkbytes / CD_FRAME_SIZE) * CD_MAX_SECTOR_DATA)); + m_encoder.set_block_size(blocksize((hunkbytes / cdrom_file::FRAME_SIZE) * cdrom_file::MAX_SECTOR_DATA)); m_encoder.set_strip_metadata(true); // initialize the deflater @@ -1473,25 +1473,25 @@ uint32_t chd_cd_flac_compressor::compress(const uint8_t *src, uint32_t srclen, uint8_t *dest) { // copy audio data followed by subcode data - uint32_t frames = hunkbytes() / CD_FRAME_SIZE; + uint32_t frames = hunkbytes() / cdrom_file::FRAME_SIZE; for (uint32_t framenum = 0; framenum < frames; framenum++) { - memcpy(&m_buffer[framenum * CD_MAX_SECTOR_DATA], &src[framenum * CD_FRAME_SIZE], CD_MAX_SECTOR_DATA); - memcpy(&m_buffer[frames * CD_MAX_SECTOR_DATA + framenum * CD_MAX_SUBCODE_DATA], &src[framenum * CD_FRAME_SIZE + CD_MAX_SECTOR_DATA], CD_MAX_SUBCODE_DATA); + memcpy(&m_buffer[framenum * cdrom_file::MAX_SECTOR_DATA], &src[framenum * cdrom_file::FRAME_SIZE], cdrom_file::MAX_SECTOR_DATA); + memcpy(&m_buffer[frames * cdrom_file::MAX_SECTOR_DATA + framenum * cdrom_file::MAX_SUBCODE_DATA], &src[framenum * cdrom_file::FRAME_SIZE + cdrom_file::MAX_SECTOR_DATA], cdrom_file::MAX_SUBCODE_DATA); } // reset and encode the audio portion m_encoder.reset(dest, hunkbytes()); uint8_t *buffer = &m_buffer[0]; - if (!m_encoder.encode_interleaved(reinterpret_cast(buffer), frames * CD_MAX_SECTOR_DATA/4, m_swap_endian)) + if (!m_encoder.encode_interleaved(reinterpret_cast(buffer), frames * cdrom_file::MAX_SECTOR_DATA/4, m_swap_endian)) throw std::error_condition(chd_file::error::COMPRESSION_ERROR); // finish up uint32_t complen = m_encoder.finish(); // deflate the subcode data - m_deflater.next_in = const_cast(&m_buffer[frames * CD_MAX_SECTOR_DATA]); - m_deflater.avail_in = frames * CD_MAX_SUBCODE_DATA; + m_deflater.next_in = const_cast(&m_buffer[frames * cdrom_file::MAX_SECTOR_DATA]); + m_deflater.avail_in = frames * cdrom_file::MAX_SUBCODE_DATA; m_deflater.total_in = 0; m_deflater.next_out = &dest[complen]; m_deflater.avail_out = hunkbytes() - complen; @@ -1526,7 +1526,7 @@ { // for CDs it seems that CD_MAX_SECTOR_DATA is the right target uint32_t blocksize = bytes / 4; - while (blocksize > CD_MAX_SECTOR_DATA) + while (blocksize > cdrom_file::MAX_SECTOR_DATA) blocksize /= 2; return blocksize; } @@ -1556,7 +1556,7 @@ m_buffer(hunkbytes) { // make sure the CHD's hunk size is an even multiple of the frame size - if (hunkbytes % CD_FRAME_SIZE != 0) + if (hunkbytes % cdrom_file::FRAME_SIZE != 0) throw std::error_condition(chd_file::error::CODEC_ERROR); // determine whether we want native or swapped samples @@ -1609,11 +1609,11 @@ void chd_cd_flac_decompressor::decompress(const uint8_t *src, uint32_t complen, uint8_t *dest, uint32_t destlen) { // reset and decode - uint32_t frames = destlen / CD_FRAME_SIZE; - if (!m_decoder.reset(44100, 2, chd_cd_flac_compressor::blocksize(frames * CD_MAX_SECTOR_DATA), src, complen)) + uint32_t frames = destlen / cdrom_file::FRAME_SIZE; + if (!m_decoder.reset(44100, 2, chd_cd_flac_compressor::blocksize(frames * cdrom_file::MAX_SECTOR_DATA), src, complen)) throw std::error_condition(chd_file::error::DECOMPRESSION_ERROR); uint8_t *buffer = &m_buffer[0]; - if (!m_decoder.decode_interleaved(reinterpret_cast(buffer), frames * CD_MAX_SECTOR_DATA/4, m_swap_endian)) + if (!m_decoder.decode_interleaved(reinterpret_cast(buffer), frames * cdrom_file::MAX_SECTOR_DATA/4, m_swap_endian)) throw std::error_condition(chd_file::error::DECOMPRESSION_ERROR); // inflate the subcode data @@ -1621,8 +1621,8 @@ m_inflater.next_in = const_cast(src + offset); m_inflater.avail_in = complen - offset; m_inflater.total_in = 0; - m_inflater.next_out = &m_buffer[frames * CD_MAX_SECTOR_DATA]; - m_inflater.avail_out = frames * CD_MAX_SUBCODE_DATA; + m_inflater.next_out = &m_buffer[frames * cdrom_file::MAX_SECTOR_DATA]; + m_inflater.avail_out = frames * cdrom_file::MAX_SUBCODE_DATA; m_inflater.total_out = 0; int zerr = inflateReset(&m_inflater); if (zerr != Z_OK) @@ -1632,14 +1632,14 @@ zerr = inflate(&m_inflater, Z_FINISH); if (zerr != Z_STREAM_END) throw std::error_condition(chd_file::error::DECOMPRESSION_ERROR); - if (m_inflater.total_out != frames * CD_MAX_SUBCODE_DATA) + if (m_inflater.total_out != frames * cdrom_file::MAX_SUBCODE_DATA) throw std::error_condition(chd_file::error::DECOMPRESSION_ERROR); // reassemble the data for (uint32_t framenum = 0; framenum < frames; framenum++) { - memcpy(&dest[framenum * CD_FRAME_SIZE], &m_buffer[framenum * CD_MAX_SECTOR_DATA], CD_MAX_SECTOR_DATA); - memcpy(&dest[framenum * CD_FRAME_SIZE + CD_MAX_SECTOR_DATA], &m_buffer[frames * CD_MAX_SECTOR_DATA + framenum * CD_MAX_SUBCODE_DATA], CD_MAX_SUBCODE_DATA); + memcpy(&dest[framenum * cdrom_file::FRAME_SIZE], &m_buffer[framenum * cdrom_file::MAX_SECTOR_DATA], cdrom_file::MAX_SECTOR_DATA); + memcpy(&dest[framenum * cdrom_file::FRAME_SIZE + cdrom_file::MAX_SECTOR_DATA], &m_buffer[frames * cdrom_file::MAX_SECTOR_DATA + framenum * cdrom_file::MAX_SUBCODE_DATA], cdrom_file::MAX_SUBCODE_DATA); } } diff -Nru mame-0.242+dfsg.1/src/lib/util/chd.cpp mame-0.243+dfsg.1/src/lib/util/chd.cpp --- mame-0.242+dfsg.1/src/lib/util/chd.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/util/chd.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1273,7 +1273,7 @@ // if we didn't find it, just return metadata_entry metaentry; if (!metadata_find(searchtag, searchindex, metaentry)) - throw std::error_condition(error::METADATA_NOT_FOUND); + return std::error_condition(error::METADATA_NOT_FOUND); // read the metadata output.assign(metaentry.length, '\0'); @@ -1743,7 +1743,7 @@ !read_metadata(CDROM_TRACK_METADATA2_TAG, 0, metadata) || !read_metadata(GDROM_OLD_METADATA_TAG, 0, metadata) || !read_metadata(GDROM_TRACK_METADATA_TAG, 0, metadata)) - return CD_FRAME_SIZE; + return cdrom_file::FRAME_SIZE; // otherwise, just map 1:1 with the hunk size return m_hunkbytes; diff -Nru mame-0.242+dfsg.1/src/lib/util/corealloc.h mame-0.243+dfsg.1/src/lib/util/corealloc.h --- mame-0.242+dfsg.1/src/lib/util/corealloc.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/util/corealloc.h 2022-04-29 05:37:26.000000000 +0000 @@ -13,54 +13,37 @@ #pragma once +#include #include -#include #include #include #include #include -#include - // global allocation helpers -template struct MakeUniqClearT { typedef std::unique_ptr single_object; }; +namespace util { -template struct MakeUniqClearT { typedef std::unique_ptr array; }; +namespace detail { -template struct MakeUniqClearT { struct invalid_type { }; }; +template struct make_unique_clear_traits { }; +template struct make_unique_clear_traits { using unbounded_array_ptr = std::unique_ptr; }; +template struct make_unique_clear_traits { }; -/// make_unique_clear for single objects -template -inline typename MakeUniqClearT::single_object make_unique_clear(Params&&... args) -{ - void *const ptr = ::operator new(sizeof(Tp)); // allocate memory - std::memset(ptr, 0, sizeof(Tp)); - return std::unique_ptr(new(ptr) Tp(std::forward(args)...)); -} +} // namespace detail /// make_unique_clear for arrays of unknown bound -template -inline typename MakeUniqClearT::array make_unique_clear(size_t num) +template +inline typename detail::make_unique_clear_traits::unbounded_array_ptr make_unique_clear(size_t num) { - auto size = sizeof(std::remove_extent_t) * num; - unsigned char* ptr = new unsigned char[size]; // allocate memory + static_assert(std::is_trivially_constructible_v >, "make_unique_clear is only suitable for trivially constructible types"); + auto const size = sizeof(std::remove_extent_t) * num; + unsigned char* ptr = new unsigned char [size]; // allocate memory - this assumes new expression overhead is the same for all array types std::memset(ptr, 0, size); - return std::unique_ptr(new(ptr) std::remove_extent_t[num]()); -} - -template -inline typename MakeUniqClearT::array make_unique_clear(size_t num) -{ - auto size = sizeof(std::remove_extent_t) * num; - unsigned char* ptr = new unsigned char[size]; // allocate memory - std::memset(ptr, F, size); - return std::unique_ptr(new(ptr) std::remove_extent_t[num]()); + return std::unique_ptr(new (ptr) std::remove_extent_t [num]); } -/// Disable make_unique_clear for arrays of known bound -template -inline typename MakeUniqClearT::invalid_type make_unique_clear(Params&&...) = delete; +} // namespace util #endif // MAME_LIB_UTIL_COREALLOC_H diff -Nru mame-0.242+dfsg.1/src/lib/util/corefile.cpp mame-0.243+dfsg.1/src/lib/util/corefile.cpp --- mame-0.242+dfsg.1/src/lib/util/corefile.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/util/corefile.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -2,7 +2,7 @@ // copyright-holders:Aaron Giles, Vas Crabb /*************************************************************************** - corefile.c + corefile.cpp File access functions. @@ -64,7 +64,6 @@ virtual int getc() override { return m_file.getc(); } virtual int ungetc(int c) override { return m_file.ungetc(c); } virtual char *gets(char *s, int n) override { return m_file.gets(s, n); } - virtual void const *buffer() override { return m_file.buffer(); } virtual int puts(std::string_view s) override { return m_file.puts(s); } virtual int vprintf(util::format_argument_pack const &args) override { return m_file.vprintf(args); } @@ -121,15 +120,45 @@ }; -class core_in_memory_file : public core_text_file +class core_basic_file : public core_text_file { public: - core_in_memory_file(std::uint32_t openflags, void const *data, std::size_t length, bool copy) noexcept + virtual std::error_condition seek(std::int64_t offset, int whence) noexcept override; + virtual std::error_condition tell(std::uint64_t &result) noexcept override { result = m_index; return std::error_condition(); } + virtual std::error_condition length(std::uint64_t &result) noexcept override { result = m_size; return std::error_condition(); } + + virtual bool eof() const override; + +protected: + core_basic_file(std::uint32_t openflags, std::uint64_t length) noexcept : core_text_file(openflags) + , m_index(0) + , m_size(length) + { + } + + std::uint64_t index() const noexcept { return m_index; } + void add_offset(std::size_t increment) noexcept { m_index += increment; m_size = (std::max)(m_size, m_index); } + std::uint64_t size() const noexcept { return m_size; } + void set_size(std::uint64_t value) noexcept { m_size = value; } + + static std::size_t safe_buffer_copy( + void const *source, std::size_t sourceoffs, std::size_t sourcelen, + void *dest, std::size_t destoffs, std::size_t destlen) noexcept; + + +private: + std::uint64_t m_index; // current file offset + std::uint64_t m_size; // total file length +}; + +class core_in_memory_file final : public core_basic_file +{ +public: + core_in_memory_file(std::uint32_t openflags, void const *data, std::size_t length, bool copy) noexcept + : core_basic_file(openflags, length) , m_data_allocated(false) , m_data(copy ? nullptr : data) - , m_offset(0) - , m_length(length) { if (copy) { @@ -141,10 +170,6 @@ ~core_in_memory_file() override { purge(); } - virtual std::error_condition seek(std::int64_t offset, int whence) noexcept override; - virtual std::error_condition tell(std::uint64_t &result) noexcept override { result = m_offset; return std::error_condition(); } - virtual std::error_condition length(std::uint64_t &result) noexcept override { result = m_length; return std::error_condition(); } - virtual std::error_condition read(void *buffer, std::size_t length, std::size_t &actual) noexcept override; virtual std::error_condition read_at(std::uint64_t offset, void *buffer, std::size_t length, std::size_t &actual) noexcept override; @@ -153,29 +178,16 @@ virtual std::error_condition write(void const *buffer, std::size_t length, std::size_t &actual) noexcept override { actual = 0; return std::errc::bad_file_descriptor; } virtual std::error_condition write_at(std::uint64_t offset, void const *buffer, std::size_t length, std::size_t &actual) noexcept override { actual = 0; return std::errc::bad_file_descriptor; } - virtual bool eof() const override; - - virtual void const *buffer() override { return m_data; } + void const *buffer() const { return m_data; } virtual std::error_condition truncate(std::uint64_t offset) override; protected: - core_in_memory_file(std::uint32_t openflags, std::uint64_t length) noexcept - : core_text_file(openflags) - , m_data_allocated(false) - , m_data(nullptr) - , m_offset(0) - , m_length(length) - { - } - - bool is_loaded() const noexcept { return nullptr != m_data; } - void *allocate() noexcept { - if (m_data || (std::numeric_limits::max() < m_length)) + if (m_data || (std::numeric_limits::max() < size())) return nullptr; - void *data = malloc(m_length); + void *data = malloc(size()); if (data) { m_data_allocated = true; @@ -192,28 +204,17 @@ m_data = nullptr; } - std::uint64_t offset() const noexcept { return m_offset; } - void add_offset(std::size_t increment) noexcept { m_offset += increment; m_length = (std::max)(m_length, m_offset); } - std::uint64_t length() const noexcept { return m_length; } - void set_length(std::uint64_t value) noexcept { m_length = value; } - - static std::size_t safe_buffer_copy( - void const *source, std::size_t sourceoffs, std::size_t sourcelen, - void *dest, std::size_t destoffs, std::size_t destlen) noexcept; - private: bool m_data_allocated; // was the data allocated by us? void const * m_data; // file data, if RAM-based - std::uint64_t m_offset; // current file offset - std::uint64_t m_length; // total file length }; -class core_osd_file final : public core_in_memory_file +class core_osd_file final : public core_basic_file { public: core_osd_file(std::uint32_t openmode, osd_file::ptr &&file, std::uint64_t length) - : core_in_memory_file(openmode, length) + : core_basic_file(openmode, length) , m_file(std::move(file)) { } @@ -227,12 +228,9 @@ virtual std::error_condition write(void const *buffer, std::size_t length, std::size_t &actual) noexcept override; virtual std::error_condition write_at(std::uint64_t offset, void const *buffer, std::size_t length, std::size_t &actual) noexcept override; - virtual void const *buffer() override; - virtual std::error_condition truncate(std::uint64_t offset) override; protected: - bool is_buffered(std::uint64_t offset) const noexcept { return (offset >= m_bufferbase) && (offset < (m_bufferbase + m_bufferbytes)); } private: @@ -246,13 +244,13 @@ -/*************************************************************************** - core_text_file -***************************************************************************/ - -/*------------------------------------------------- - getc - read a character from a file --------------------------------------------------*/ +//************************************************************************** +// core_text_file +//************************************************************************** + +//------------------------------------------------- +// getc - read a character from a file +//------------------------------------------------- int core_text_file::getc() { @@ -406,10 +404,10 @@ } -/*------------------------------------------------- - ungetc - put back a character read from a - file --------------------------------------------------*/ +//------------------------------------------------- +// ungetc - put back a character read from a +// file +//------------------------------------------------- int core_text_file::ungetc(int c) { @@ -419,9 +417,9 @@ } -/*------------------------------------------------- - gets - read a line from a text file --------------------------------------------------*/ +//------------------------------------------------- +// gets - read a line from a text file +//------------------------------------------------- char *core_text_file::gets(char *s, int n) { @@ -466,9 +464,9 @@ } -/*------------------------------------------------- - puts - write a string to a text file --------------------------------------------------*/ +//------------------------------------------------- +// puts - write a string to a text file +//------------------------------------------------- int core_text_file::puts(std::string_view s) { @@ -535,9 +533,9 @@ } -/*------------------------------------------------- - vprintf - vfprintf to a text file --------------------------------------------------*/ +//------------------------------------------------- +// vprintf - vfprintf to a text file +//------------------------------------------------- int core_text_file::vprintf(util::format_argument_pack const &args) { @@ -550,15 +548,15 @@ -/*************************************************************************** - core_in_memory_file -***************************************************************************/ - -/*------------------------------------------------- - seek - seek within a file --------------------------------------------------*/ +//************************************************************************** +// core_basic_file +//************************************************************************** + +//------------------------------------------------- +// seek - seek within a file +//------------------------------------------------- -std::error_condition core_in_memory_file::seek(std::int64_t offset, int whence) noexcept +std::error_condition core_basic_file::seek(std::int64_t offset, int whence) noexcept { // flush any buffered char clear_putback(); // TODO: report errors; also, should the argument check happen before this? @@ -569,33 +567,33 @@ case SEEK_SET: if (0 > offset) return std::errc::invalid_argument; - m_offset = offset; + m_index = offset; return std::error_condition(); case SEEK_CUR: if (0 > offset) { - if (std::uint64_t(-offset) > m_offset) + if (std::uint64_t(-offset) > m_index) return std::errc::invalid_argument; } - else if ((std::numeric_limits::max() - offset) < m_offset) + else if ((std::numeric_limits::max() - offset) < m_index) { return std::errc::invalid_argument; } - m_offset += offset; + m_index += offset; return std::error_condition(); case SEEK_END: if (0 > offset) { - if (std::uint64_t(-offset) > m_length) + if (std::uint64_t(-offset) > m_size) return std::errc::invalid_argument; } - else if ((std::numeric_limits::max() - offset) < m_length) + else if ((std::numeric_limits::max() - offset) < m_size) { return std::errc::invalid_argument; } - m_offset = m_length + offset; + m_index = m_size + offset; return std::error_condition(); default: @@ -604,35 +602,63 @@ } -/*------------------------------------------------- - eof - return 1 if we're at the end of file --------------------------------------------------*/ +//------------------------------------------------- +// eof - return true if we're at the end of file +//------------------------------------------------- -bool core_in_memory_file::eof() const +bool core_basic_file::eof() const { // check for buffered chars if (has_putback()) return false; // if the offset == length, we're at EOF - return (m_offset >= m_length); + return (m_index >= m_size); } -/*------------------------------------------------- - read - read from a file --------------------------------------------------*/ +//------------------------------------------------- +// safe_buffer_copy - copy safely from one +// bounded buffer to another +//------------------------------------------------- + +std::size_t core_basic_file::safe_buffer_copy( + void const *source, std::size_t sourceoffs, std::size_t sourcelen, + void *dest, std::size_t destoffs, std::size_t destlen) noexcept +{ + auto const sourceavail = sourcelen - sourceoffs; + auto const destavail = destlen - destoffs; + auto const bytes_to_copy = (std::min)(sourceavail, destavail); + if (bytes_to_copy > 0) + { + std::memcpy( + reinterpret_cast(dest) + destoffs, + reinterpret_cast(source) + sourceoffs, + bytes_to_copy); + } + return bytes_to_copy; +} + + + +//************************************************************************** +// core_in_memory_file +//************************************************************************** + +//------------------------------------------------- +// read - read from a file +//------------------------------------------------- std::error_condition core_in_memory_file::read(void *buffer, std::size_t length, std::size_t &actual) noexcept { clear_putback(); // handle RAM-based files - if (m_offset < m_length) - actual = safe_buffer_copy(m_data, std::size_t(m_offset), std::size_t(m_length), buffer, 0, length); + if (index() < size()) + actual = safe_buffer_copy(m_data, std::size_t(index()), std::size_t(size()), buffer, 0, length); else actual = 0U; - m_offset += actual; + add_offset(actual); return std::error_condition(); } @@ -641,60 +667,36 @@ clear_putback(); // handle RAM-based files - if (offset < m_length) - actual = safe_buffer_copy(m_data, std::size_t(offset), std::size_t(m_length), buffer, 0, length); + if (offset < size()) + actual = safe_buffer_copy(m_data, std::size_t(offset), std::size_t(size()), buffer, 0, length); else actual = 0U; return std::error_condition(); } -/*------------------------------------------------- - truncate - truncate a file --------------------------------------------------*/ +//------------------------------------------------- +// truncate - truncate a file +//------------------------------------------------- std::error_condition core_in_memory_file::truncate(std::uint64_t offset) { - if (m_length < offset) + if (size() < offset) return std::errc::io_error; // TODO: revisit this error code // adjust to new length and offset - set_length(offset); + set_size(offset); return std::error_condition(); } -/*------------------------------------------------- - safe_buffer_copy - copy safely from one - bounded buffer to another --------------------------------------------------*/ - -std::size_t core_in_memory_file::safe_buffer_copy( - void const *source, std::size_t sourceoffs, std::size_t sourcelen, - void *dest, std::size_t destoffs, std::size_t destlen) noexcept -{ - auto const sourceavail = sourcelen - sourceoffs; - auto const destavail = destlen - destoffs; - auto const bytes_to_copy = (std::min)(sourceavail, destavail); - if (bytes_to_copy > 0) - { - std::memcpy( - reinterpret_cast(dest) + destoffs, - reinterpret_cast(source) + sourceoffs, - bytes_to_copy); - } - return bytes_to_copy; -} - - - -/*************************************************************************** - core_osd_file -***************************************************************************/ - -/*------------------------------------------------- - closes a file --------------------------------------------------*/ +//************************************************************************** +// core_osd_file +//************************************************************************** + +//------------------------------------------------- +// closes a file +//------------------------------------------------- core_osd_file::~core_osd_file() { @@ -702,15 +704,15 @@ } -/*------------------------------------------------- - read - read from a file --------------------------------------------------*/ +//------------------------------------------------- +// read - read from a file +//------------------------------------------------- std::error_condition core_osd_file::read(void *buffer, std::size_t length, std::size_t &actual) noexcept { // since osd_file works like pread/pwrite, implement in terms of read_at // core_osd_file is declared final, so a derived class can't interfere - std::error_condition err = read_at(offset(), buffer, length, actual); + std::error_condition err = read_at(index(), buffer, length, actual); add_offset(actual); return err; } @@ -718,8 +720,11 @@ std::error_condition core_osd_file::read_at(std::uint64_t offset, void *buffer, std::size_t length, std::size_t &actual) noexcept { - if (!m_file || is_loaded()) - return core_in_memory_file::read_at(offset, buffer, length, actual); + if (!m_file) + { + actual = 0U; + return std::errc::bad_file_descriptor; + } // flush any buffered char clear_putback(); @@ -768,55 +773,15 @@ } -/*------------------------------------------------- - buffer - return a pointer to the file buffer; - if it doesn't yet exist, load the file into - RAM first --------------------------------------------------*/ - -void const *core_osd_file::buffer() -{ - // if we already have data, just return it - if (!is_loaded() && length()) - { - // allocate some memory - void *const buf = allocate(); - if (!buf) - return nullptr; - - // read the file - std::uint64_t bytes_read = 0; - std::uint64_t remaining = length(); - std::uint8_t *ptr = reinterpret_cast(buf); - while (remaining) - { - std::uint32_t const chunk = std::min >(std::numeric_limits::max(), remaining); - std::uint32_t read_length; - std::error_condition const filerr = m_file->read(ptr, bytes_read, chunk, read_length); - if (filerr || !read_length) - { - purge(); - return core_in_memory_file::buffer(); - } - bytes_read += read_length; - remaining -= read_length; - ptr += read_length; - } - m_file.reset(); // close the file because we don't need it anymore - } - return core_in_memory_file::buffer(); -} - - -/*------------------------------------------------- - write - write to a file --------------------------------------------------*/ +//------------------------------------------------- +// write - write to a file +//------------------------------------------------- std::error_condition core_osd_file::write(void const *buffer, std::size_t length, std::size_t &actual) noexcept { // since osd_file works like pread/pwrite, implement in terms of write_at // core_osd_file is declared final, so a derived class can't interfere - std::error_condition err = write_at(offset(), buffer, length, actual); + std::error_condition err = write_at(index(), buffer, length, actual); add_offset(actual); return err; } @@ -824,10 +789,6 @@ std::error_condition core_osd_file::write_at(std::uint64_t offset, void const *buffer, std::size_t length, std::size_t &actual) noexcept { - // can't write to RAM-based stuff - if (is_loaded()) - return core_in_memory_file::write_at(offset, buffer, length, actual); - // flush any buffered char clear_putback(); @@ -849,50 +810,41 @@ buffer = reinterpret_cast(buffer) + bytes_written; length -= bytes_written; actual += bytes_written; - set_length((std::max)(this->length(), offset)); + set_size((std::max)(size(), offset)); } return std::error_condition(); } -/*------------------------------------------------- - truncate - truncate a file --------------------------------------------------*/ +//------------------------------------------------- +// truncate - truncate a file +//------------------------------------------------- std::error_condition core_osd_file::truncate(std::uint64_t offset) { - if (is_loaded()) - return core_in_memory_file::truncate(offset); - // truncate file std::error_condition err = m_file->truncate(offset); if (err) return err; // and adjust to new length and offset - set_length(offset); + set_size(offset); return std::error_condition(); } -/*------------------------------------------------- - flush - flush file buffers --------------------------------------------------*/ +//------------------------------------------------- +// flush - flush file buffers +//------------------------------------------------- std::error_condition core_osd_file::finalize() noexcept { - if (is_loaded()) - return core_in_memory_file::finalize(); - return std::error_condition(); } std::error_condition core_osd_file::flush() noexcept { - if (is_loaded()) - return core_in_memory_file::flush(); - // flush any buffered char clear_putback(); @@ -906,14 +858,14 @@ -/*************************************************************************** - core_file -***************************************************************************/ - -/*------------------------------------------------- - open - open a file for access and - return an error code --------------------------------------------------*/ +//************************************************************************** +// core_file +//************************************************************************** + +//------------------------------------------------- +// open - open a file for access and +// return an error code +//------------------------------------------------- std::error_condition core_file::open(std::string_view filename, std::uint32_t openflags, ptr &file) noexcept { @@ -931,10 +883,10 @@ } -/*------------------------------------------------- - open_ram - open a RAM-based buffer for file- - like access and return an error code --------------------------------------------------*/ +//------------------------------------------------- +// open_ram - open a RAM-based buffer for file- +// like access and return an error code +//------------------------------------------------- std::error_condition core_file::open_ram(void const *data, std::size_t length, std::uint32_t openflags, ptr &file) noexcept { @@ -959,11 +911,11 @@ } -/*------------------------------------------------- - open_ram_copy - open a copy of a RAM-based - buffer for file-like access and return an - error code --------------------------------------------------*/ +//------------------------------------------------- +// open_ram_copy - open a copy of a RAM-based +// buffer for file-like access and return an +// error code +//------------------------------------------------- std::error_condition core_file::open_ram_copy(void const *data, std::size_t length, std::uint32_t openflags, ptr &file) noexcept { @@ -979,7 +931,7 @@ if (std::uint64_t(length) != length) return std::errc::file_too_large; - ptr result(new (std::nothrow) core_in_memory_file(openflags, data, length, true)); + std::unique_ptr result(new (std::nothrow) core_in_memory_file(openflags, data, length, true)); if (!result || !result->buffer()) return std::errc::not_enough_memory; @@ -988,10 +940,10 @@ } -/*------------------------------------------------- - open_proxy - open a proxy to an existing file - object and return an error code --------------------------------------------------*/ +//------------------------------------------------- +// open_proxy - open a proxy to an existing file +// object and return an error code +//------------------------------------------------- std::error_condition core_file::open_proxy(core_file &file, ptr &proxy) noexcept { @@ -1004,20 +956,20 @@ } -/*------------------------------------------------- - closes a file --------------------------------------------------*/ +//------------------------------------------------- +// closes a file +//------------------------------------------------- core_file::~core_file() { } -/*------------------------------------------------- - load - open a file with the specified - filename, read it into memory, and return a - pointer --------------------------------------------------*/ +//------------------------------------------------- +// load - open a file with the specified +// filename, read it into memory, and return a +// pointer +//------------------------------------------------- std::error_condition core_file::load(std::string_view filename, void **data, std::uint32_t &length) noexcept { diff -Nru mame-0.242+dfsg.1/src/lib/util/corefile.h mame-0.243+dfsg.1/src/lib/util/corefile.h --- mame-0.242+dfsg.1/src/lib/util/corefile.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/util/corefile.h 2022-04-29 05:37:26.000000000 +0000 @@ -76,10 +76,6 @@ // read a full line of text from the file virtual char *gets(char *s, int n) = 0; - // get a pointer to a buffer that holds the full file data in RAM - // this function may cause the full file data to be read - virtual const void *buffer() = 0; - // open a file with the specified filename, read it into memory, and return a pointer static std::error_condition load(std::string_view filename, void **data, std::uint32_t &length) noexcept; static std::error_condition load(std::string_view filename, std::vector &data) noexcept; diff -Nru mame-0.242+dfsg.1/src/lib/util/disasmintf.h mame-0.243+dfsg.1/src/lib/util/disasmintf.h --- mame-0.242+dfsg.1/src/lib/util/disasmintf.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/util/disasmintf.h 2022-04-29 05:37:26.000000000 +0000 @@ -39,8 +39,9 @@ static constexpr u32 SUPPORTED = 0x80000000; // are disassembly flags supported? static constexpr u32 STEP_OUT = 0x40000000; // this instruction should be the end of a step out sequence static constexpr u32 STEP_OVER = 0x20000000; // this instruction should be stepped over by setting a breakpoint afterwards - static constexpr u32 OVERINSTMASK = 0x18000000; // number of extra instructions to skip when stepping over - static constexpr u32 OVERINSTSHIFT = 27; // bits to shift after masking to get the value + static constexpr u32 STEP_COND = 0x10000000; // this instruction may conditionally result in a program transfer or short skip + static constexpr u32 OVERINSTMASK = 0x0c000000; // number of extra instructions to skip when stepping over + static constexpr u32 OVERINSTSHIFT = 26; // bits to shift after masking to get the value static constexpr u32 LENGTHMASK = 0x0000ffff; // the low 16-bits contain the actual length static inline u32 step_over_extra(u32 x) { diff -Nru mame-0.242+dfsg.1/src/lib/util/harddisk.cpp mame-0.243+dfsg.1/src/lib/util/harddisk.cpp --- mame-0.242+dfsg.1/src/lib/util/harddisk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/util/harddisk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -15,88 +15,51 @@ #include -/*************************************************************************** - TYPE DEFINITIONS -***************************************************************************/ - -struct hard_disk_file -{ - chd_file * chd; // CHD file - util::random_read_write * fhandle; // file if not a CHD - hard_disk_info info; // hard disk info -}; - - - -/*************************************************************************** - CORE IMPLEMENTATION -***************************************************************************/ - /*------------------------------------------------- - hard_disk_open - open a hard disk handle, + constructor - open a hard disk handle, given a chd_file -------------------------------------------------*/ -hard_disk_file *hard_disk_open(chd_file *chd) +hard_disk_file::hard_disk_file(chd_file *_chd) { - int cylinders, heads, sectors, sectorbytes; - hard_disk_file *file; + chd = _chd; + fhandle = nullptr; + fileoffset = 0; + std::string metadata; std::error_condition err; /* punt if no CHD */ if (chd == nullptr) - return nullptr; + throw nullptr; /* read the hard disk metadata */ - err = chd->read_metadata(HARD_DISK_METADATA_TAG, 0, metadata); + err = _chd->read_metadata(HARD_DISK_METADATA_TAG, 0, metadata); if (err) - return nullptr; + throw nullptr; /* parse the metadata */ - if (sscanf(metadata.c_str(), HARD_DISK_METADATA_FORMAT, &cylinders, &heads, §ors, §orbytes) != 4) - return nullptr; - - /* allocate memory for the hard disk file */ - file = (hard_disk_file *)malloc(sizeof(hard_disk_file)); - if (file == nullptr) - return nullptr; - - /* fill in the data */ - file->chd = chd; - file->fhandle = nullptr; - file->info.cylinders = cylinders; - file->info.heads = heads; - file->info.sectors = sectors; - file->info.sectorbytes = sectorbytes; - file->info.fileoffset = 0; - return file; + if (sscanf(metadata.c_str(), HARD_DISK_METADATA_FORMAT, &hdinfo.cylinders, &hdinfo.heads, &hdinfo.sectors, &hdinfo.sectorbytes) != 4) + throw nullptr; } -hard_disk_file *hard_disk_open(util::random_read_write &corefile, uint32_t skipoffs) +hard_disk_file::hard_disk_file(util::random_read_write &corefile, uint32_t skipoffs) { // bail if getting the file length fails std::uint64_t length; if (corefile.length(length)) - return nullptr; - - hard_disk_file *file; + throw nullptr; - // allocate memory for the hard disk file - file = (hard_disk_file *)malloc(sizeof(hard_disk_file)); - if (file == nullptr) - return nullptr; - - file->chd = nullptr; - file->fhandle = &corefile; - file->info.sectorbytes = 512; - file->info.cylinders = 0; - file->info.heads = 0; - file->info.sectors = 0; - file->info.fileoffset = skipoffs; + chd = nullptr; + fhandle = &corefile; + hdinfo.sectorbytes = 512; + hdinfo.cylinders = 0; + hdinfo.heads = 0; + hdinfo.sectors = 0; + fileoffset = skipoffs; // attempt to guess geometry in case this is an ATA situation - for (uint32_t totalsectors = (length - skipoffs) / file->info.sectorbytes; ; totalsectors++) + for (uint32_t totalsectors = (length - skipoffs) / hdinfo.sectorbytes; ; totalsectors++) for (uint32_t cursectors = 63; cursectors > 1; cursectors--) if (totalsectors % cursectors == 0) { @@ -104,146 +67,103 @@ for (uint32_t curheads = 16; curheads > 1; curheads--) if (totalheads % curheads == 0) { - file->info.cylinders = totalheads / curheads; - file->info.heads = curheads; - file->info.sectors = cursectors; - osd_printf_verbose("Guessed CHS of %d/%d/%d\n", file->info.cylinders, file->info.heads, file->info.sectors); - return file; + hdinfo.cylinders = totalheads / curheads; + hdinfo.heads = curheads; + hdinfo.sectors = cursectors; + osd_printf_verbose("Guessed CHS of %d/%d/%d\n", hdinfo.cylinders, hdinfo.heads, hdinfo.sectors); + return; } } - - return file; -} - - -/*------------------------------------------------- - hard_disk_close - close a hard disk handle --------------------------------------------------*/ - -void hard_disk_close(hard_disk_file *file) -{ - if (file->fhandle) - file->fhandle->flush(); - - free(file); -} - - -/*------------------------------------------------- - hard_disk_get_chd - get a handle to a CHD - from a hard disk --------------------------------------------------*/ - -chd_file *hard_disk_get_chd(hard_disk_file *file) -{ - return file->chd; } /*------------------------------------------------- - hard_disk_get_info - return information about - a hard disk + destructor - close a hard disk handle -------------------------------------------------*/ -/** - * @fn hard_disk_info *hard_disk_get_info(hard_disk_file *file) - * - * @brief Hard disk get information. - * - * @param [in,out] file The hard disk file object to operate on. - * - * @return null if it fails, else a hard_disk_info*. - */ - -hard_disk_info *hard_disk_get_info(hard_disk_file *file) +hard_disk_file::~hard_disk_file() { - return &file->info; + if (fhandle) + fhandle->flush(); } /*------------------------------------------------- - hard_disk_read - read sectors from a hard - disk + read - read sectors from a hard disk -------------------------------------------------*/ /** - * @fn bool hard_disk_read(hard_disk_file *file, uint32_t lbasector, void *buffer) + * @fn bool read(uint32_t lbasector, void *buffer) * * @brief Hard disk read. * - * @param [in,out] file The hard disk file object to operate on. * @param lbasector The sector number (Linear Block Address) to read. * @param buffer The buffer where the hard disk data will be placed. * * @return True if the operation succeeded */ -bool hard_disk_read(hard_disk_file *file, uint32_t lbasector, void *buffer) +bool hard_disk_file::read(uint32_t lbasector, void *buffer) { - std::error_condition err; - if (file->chd) + if (chd) { - err = file->chd->read_units(lbasector, buffer); + std::error_condition err = chd->read_units(lbasector, buffer); return !err; } else { size_t actual = 0; - err = file->fhandle->seek(file->info.fileoffset + (lbasector * file->info.sectorbytes), SEEK_SET); + std::error_condition err = fhandle->seek(fileoffset + (lbasector * hdinfo.sectorbytes), SEEK_SET); if (!err) - err = file->fhandle->read(buffer, file->info.sectorbytes, actual); - return !err && (actual == file->info.sectorbytes); + err = fhandle->read(buffer, hdinfo.sectorbytes, actual); + return !err && (actual == hdinfo.sectorbytes); } } /*------------------------------------------------- - hard_disk_write - write sectors to a hard - disk + write - write sectors to a hard disk -------------------------------------------------*/ /** - * @fn bool hard_disk_write(hard_disk_file *file, uint32_t lbasector, const void *buffer) + * @fn bool write(uint32_t lbasector, const void *buffer) * * @brief Hard disk write. * - * @param [in,out] file The hard disk file object to operate on. * @param lbasector The sector number (Linear Block Address) to write. * @param buffer The buffer containing the data to write. * * @return True if the operation succeeded */ -bool hard_disk_write(hard_disk_file *file, uint32_t lbasector, const void *buffer) +bool hard_disk_file::write(uint32_t lbasector, const void *buffer) { - std::error_condition err; - if (file->chd) + if (chd) { - err = file->chd->write_units(lbasector, buffer); + std::error_condition err = chd->write_units(lbasector, buffer); return !err; } else { size_t actual = 0; - err = file->fhandle->seek(file->info.fileoffset + (lbasector * file->info.sectorbytes), SEEK_SET); + std::error_condition err = fhandle->seek(fileoffset + (lbasector * hdinfo.sectorbytes), SEEK_SET); if (!err) - err = file->fhandle->write(buffer, file->info.sectorbytes, actual); - return !err && (actual == file->info.sectorbytes); + err = fhandle->write(buffer, hdinfo.sectorbytes, actual); + return !err && (actual == hdinfo.sectorbytes); } } /*------------------------------------------------- - hard_disk_set_block_size - sets the block size + set_block_size - sets the block size for a non-CHD-backed hard disk (a bare file). -------------------------------------------------*/ /** - * @fn bool hard_disk_set_block_size(hard_disk_file *file, uint32_t blocksize) + * @fn bool set_block_size(uint32_t blocksize) * * @brief Hard disk set block size (works only for non-CHD-files) * - * @param [in,out] file The hard_disk_file object to operate on. * @param blocksize The block size of this hard disk, in bytes. * * @return true on success, false on failure. Failure means a CHD is in use and the CHD @@ -251,12 +171,12 @@ * sizes match, success is returned). */ -bool hard_disk_set_block_size(hard_disk_file *file, uint32_t blocksize) +bool hard_disk_file::set_block_size(uint32_t blocksize) { - if (file->chd) + if (chd) { // if the CHD block size matches our block size, we're OK. - if (file->chd->unit_bytes() == blocksize) + if (chd->unit_bytes() == blocksize) { return true; } @@ -266,7 +186,32 @@ } else { - file->info.sectorbytes = blocksize; + hdinfo.sectorbytes = blocksize; return true; } } + + +std::error_condition hard_disk_file::get_inquiry_data(std::vector &data) const +{ + if(chd) + return chd->read_metadata(HARD_DISK_IDENT_METADATA_TAG, 0, data); + else + return std::error_condition(chd_file::error::METADATA_NOT_FOUND); +} + +std::error_condition hard_disk_file::get_cis_data(std::vector &data) const +{ + if(chd) + return chd->read_metadata(PCMCIA_CIS_METADATA_TAG, 0, data); + else + return std::error_condition(chd_file::error::METADATA_NOT_FOUND); +} + +std::error_condition hard_disk_file::get_disk_key_data(std::vector &data) const +{ + if(chd) + return chd->read_metadata(HARD_DISK_KEY_METADATA_TAG, 0, data); + else + return std::error_condition(chd_file::error::METADATA_NOT_FOUND); +} diff -Nru mame-0.242+dfsg.1/src/lib/util/harddisk.h mame-0.243+dfsg.1/src/lib/util/harddisk.h --- mame-0.242+dfsg.1/src/lib/util/harddisk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/util/harddisk.h 2022-04-29 05:37:26.000000000 +0000 @@ -19,38 +19,37 @@ #include "osdcore.h" -/*************************************************************************** - TYPE DEFINITIONS -***************************************************************************/ - -struct hard_disk_file; - -struct hard_disk_info -{ - uint32_t cylinders; - uint32_t heads; - uint32_t sectors; - uint32_t sectorbytes; - uint32_t fileoffset; // offset in the file where the HDD image starts. not valid for CHDs. +class hard_disk_file { +public: + struct info + { + uint32_t cylinders; + uint32_t heads; + uint32_t sectors; + uint32_t sectorbytes; + }; + + hard_disk_file(chd_file *chd); + hard_disk_file(util::random_read_write &corefile, uint32_t skipoffs); + + ~hard_disk_file(); + + const info &get_info() const { return hdinfo; } + + bool set_block_size(uint32_t blocksize); + + bool read(uint32_t lbasector, void *buffer); + bool write(uint32_t lbasector, const void *buffer); + + std::error_condition get_inquiry_data(std::vector &data) const; + std::error_condition get_cis_data(std::vector &data) const; + std::error_condition get_disk_key_data(std::vector &data) const; + +private: + chd_file * chd; // CHD file + util::random_read_write * fhandle; // file if not a CHD + info hdinfo; // hard disk info + uint32_t fileoffset; // offset in the file where the HDD image starts. not valid for CHDs. }; - - -/*************************************************************************** - FUNCTION PROTOTYPES -***************************************************************************/ - -hard_disk_file *hard_disk_open(chd_file *chd); -hard_disk_file *hard_disk_open(util::random_read_write &corefile, uint32_t skipoffs); - -void hard_disk_close(hard_disk_file *file); - -chd_file *hard_disk_get_chd(hard_disk_file *file); -hard_disk_info *hard_disk_get_info(hard_disk_file *file); - -bool hard_disk_set_block_size(hard_disk_file *file, uint32_t blocksize); - -bool hard_disk_read(hard_disk_file *file, uint32_t lbasector, void *buffer); -bool hard_disk_write(hard_disk_file *file, uint32_t lbasector, const void *buffer); - #endif // MAME_LIB_UTIL_HARDDISK_H diff -Nru mame-0.242+dfsg.1/src/lib/util/hash.cpp mame-0.243+dfsg.1/src/lib/util/hash.cpp --- mame-0.242+dfsg.1/src/lib/util/hash.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/util/hash.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -12,8 +12,11 @@ #include "hash.h" +#include "ioprocs.h" + #include #include +#include namespace util { @@ -27,48 +30,68 @@ char const *const hash_collection::HASH_TYPES_ALL = "RS"; - //************************************************************************** -// HASH COLLECTION +// HASH CREATOR //************************************************************************** -//------------------------------------------------- -// hash_collection - constructor -//------------------------------------------------- - -hash_collection::hash_collection() - : m_has_crc32(false), - m_has_sha1(false), - m_creator(nullptr) +class hash_collection::hash_creator { -} +public: + // constructor + hash_creator(bool doing_crc32, bool doing_sha1) + { + if (doing_crc32) + m_crc32_creator.emplace(); + if (doing_sha1) + m_sha1_creator.emplace(); + } + // add the given buffer to the hash + void append(void const *buffer, std::size_t length) + { + // append to each active hash + if (m_crc32_creator) + m_crc32_creator->append(buffer, length); + if (m_sha1_creator) + m_sha1_creator->append(buffer, length); + } -hash_collection::hash_collection(std::string_view string) - : m_has_crc32(false), - m_has_sha1(false), - m_creator(nullptr) -{ - from_internal_string(string); -} + // stop hashing + void finish(hash_collection &hashes) + { + // finish up the CRC32 + if (m_crc32_creator) + { + hashes.add_crc(m_crc32_creator->finish()); + m_crc32_creator.reset(); + } + // finish up the SHA1 + if (m_sha1_creator) + { + hashes.add_sha1(m_sha1_creator->finish()); + m_sha1_creator.reset(); + } + } -hash_collection::hash_collection(const hash_collection &src) - : m_has_crc32(false), - m_has_sha1(false), - m_creator(nullptr) -{ - copyfrom(src); -} +private: + std::optional m_crc32_creator; + std::optional m_sha1_creator; +}; +//************************************************************************** +// HASH COLLECTION +//************************************************************************** + //------------------------------------------------- -// ~hash_collection - destructor +// hash_collection - constructor //------------------------------------------------- -hash_collection::~hash_collection() +hash_collection::hash_collection() + : m_has_crc32(false) + , m_has_sha1(false) { - delete m_creator; } @@ -138,8 +161,6 @@ { m_flags.clear(); m_has_crc32 = m_has_sha1 = false; - delete m_creator; - m_creator = nullptr; } @@ -336,69 +357,75 @@ //------------------------------------------------- -// begin - begin hashing +// create - begin hashing //------------------------------------------------- -void hash_collection::begin(const char *types) +std::unique_ptr hash_collection::create(const char *types) { - // nuke previous creator and make a new one - delete m_creator; - m_creator = new hash_creator; - // by default use all types if (types == nullptr) - m_creator->m_doing_crc32 = m_creator->m_doing_sha1 = true; + return std::make_unique(true, true); // otherwise, just allocate the ones that are specified else - { - m_creator->m_doing_crc32 = (strchr(types, HASH_CRC) != nullptr); - m_creator->m_doing_sha1 = (strchr(types, HASH_SHA1) != nullptr); - } + return std::make_unique(strchr(types, HASH_CRC) != nullptr, strchr(types, HASH_SHA1) != nullptr); } //------------------------------------------------- -// buffer - add the given buffer to the hash +// compute - hash a block of data //------------------------------------------------- -void hash_collection::buffer(const uint8_t *data, uint32_t length) +void hash_collection::compute(const uint8_t *data, uint32_t length, const char *types) { - assert(m_creator != nullptr); + // begin + std::unique_ptr creator = create(types); + + // run the hashes + creator->append(data, length); - // append to each active hash - if (m_creator->m_doing_crc32) - m_creator->m_crc32_creator.append(data, length); - if (m_creator->m_doing_sha1) - m_creator->m_sha1_creator.append(data, length); + // end + creator->finish(*this); } //------------------------------------------------- -// end - stop hashing +// compute - hash data from a stream //------------------------------------------------- -void hash_collection::end() +std::error_condition hash_collection::compute(random_read &stream, uint64_t offset, size_t length, size_t &actual, const char *types) { - assert(m_creator != nullptr); + // begin + std::unique_ptr creator = create(types); - // finish up the CRC32 - if (m_creator->m_doing_crc32) - { - m_has_crc32 = true; - m_crc32 = m_creator->m_crc32_creator.finish(); - } + // local buffer of arbitrary size + uint8_t buffer[2048]; - // finish up the SHA1 - if (m_creator->m_doing_sha1) + // run the hashes + actual = 0U; + while (length) { - m_has_sha1 = true; - m_sha1 = m_creator->m_sha1_creator.finish(); - } + // determine the size of the next chunk + unsigned const chunk_length = std::min(length, sizeof(buffer)); - // nuke the creator - delete m_creator; - m_creator = nullptr; + // read one chunk + std::size_t bytes_read; + std::error_condition err = stream.read_at(offset, buffer, chunk_length, bytes_read); + if (err) + return err; + if (!bytes_read) // EOF? + break; + offset += bytes_read; + length -= chunk_length; + + // append the chunk + creator->append(buffer, bytes_read); + actual += bytes_read; + } + + // end + creator->finish(*this); + return std::error_condition(); } @@ -417,9 +444,6 @@ m_crc32 = src.m_crc32; m_has_sha1 = src.m_has_sha1; m_sha1 = src.m_sha1; - - // don't copy creators - m_creator = nullptr; } } // namespace util diff -Nru mame-0.242+dfsg.1/src/lib/util/hash.h mame-0.243+dfsg.1/src/lib/util/hash.h --- mame-0.242+dfsg.1/src/lib/util/hash.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/lib/util/hash.h 2022-04-29 05:37:26.000000000 +0000 @@ -16,6 +16,10 @@ #pragma once #include "hashing.h" +#include "utilfwd.h" + +#include +#include //************************************************************************** @@ -40,6 +44,9 @@ // a collection of the various supported hashes and flags class hash_collection { + // forward declaration + class hash_creator; + public: // hash types are identified by non-hex alpha values (G-Z) static constexpr char HASH_CRC = 'R'; @@ -56,9 +63,8 @@ // construction/destruction hash_collection(); - hash_collection(std::string_view string); - hash_collection(const hash_collection &src); - ~hash_collection(); + hash_collection(std::string_view string) : hash_collection() { from_internal_string(string); } + hash_collection(const hash_collection &src) : hash_collection() { copyfrom(src); } // operators hash_collection &operator=(const hash_collection &src); @@ -89,13 +95,12 @@ bool from_internal_string(std::string_view string); // creation - void begin(const char *types = nullptr); - void buffer(const uint8_t *data, uint32_t length); - void end(); - void compute(const uint8_t *data, uint32_t length, const char *types = nullptr) { begin(types); buffer(data, length); end(); } + void compute(const uint8_t *data, uint32_t length, const char *types = nullptr); + std::error_condition compute(random_read &stream, uint64_t offset, size_t length, size_t &actual, const char *types = nullptr); private: // internal helpers + std::unique_ptr create(const char *types = nullptr); void copyfrom(const hash_collection &src); // internal state @@ -104,16 +109,6 @@ crc32_t m_crc32; bool m_has_sha1; sha1_t m_sha1; - - // creators - struct hash_creator - { - bool m_doing_crc32; - crc32_creator m_crc32_creator; - bool m_doing_sha1; - sha1_creator m_sha1_creator; - }; - hash_creator * m_creator; }; diff -Nru mame-0.242+dfsg.1/src/mame/arcade.flt mame-0.243+dfsg.1/src/mame/arcade.flt --- mame-0.242+dfsg.1/src/mame/arcade.flt 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/arcade.flt 2022-04-29 05:37:26.000000000 +0000 @@ -96,6 +96,7 @@ aztarac.cpp backfire.cpp badlands.cpp +badlands_ms.cpp badlandsbl.cpp bagman.cpp bailey.cpp @@ -693,6 +694,7 @@ legionna.cpp leland.cpp lemmings.cpp +lependu.cpp lethal.cpp lethalj.cpp lgp.cpp @@ -953,6 +955,7 @@ pandoras.cpp pangofun.cpp panicr.cpp +paokaipc.cpp paradise.cpp paranoia.cpp parodius.cpp @@ -1101,7 +1104,6 @@ s6.cpp s7.cpp s8.cpp -s8a.cpp s9.cpp safarir.cpp sam.cpp @@ -1200,6 +1202,7 @@ skylncr.cpp skyraid.cpp slapfght.cpp +slapfght_ms.cpp slapshot.cpp sleic.cpp sliver.cpp @@ -1222,6 +1225,7 @@ spartanxtec.cpp spbactn.cpp spcforce.cpp +spdamjes.cpp spdheat.cpp spdodgeb.cpp special_gambl.cpp diff -Nru mame-0.242+dfsg.1/src/mame/audio/arcadia.h mame-0.243+dfsg.1/src/mame/audio/arcadia.h --- mame-0.242+dfsg.1/src/mame/audio/arcadia.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/audio/arcadia.h 2022-04-29 05:37:26.000000000 +0000 @@ -23,12 +23,12 @@ virtual void device_reset() override; virtual void sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) override; - sound_stream *m_channel; - uint8_t m_reg[3]; - int m_size, m_pos,m_tval,m_nval; - unsigned m_mode, m_omode; - unsigned m_volume; - unsigned m_lfsr; + sound_stream *m_channel = nullptr; + uint8_t m_reg[3]{}; + int m_size = 0, m_pos = 0, m_tval = 0, m_nval = 0; + unsigned m_mode = 0, m_omode = 0; + unsigned m_volume = 0; + unsigned m_lfsr = 0; }; // device type definition diff -Nru mame-0.242+dfsg.1/src/mame/audio/bally.h mame-0.243+dfsg.1/src/mame/audio/bally.h --- mame-0.242+dfsg.1/src/mame/audio/bally.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/audio/bally.h 2022-04-29 05:37:26.000000000 +0000 @@ -81,10 +81,10 @@ virtual void device_start() override; private: - uint8_t m_sound_select; - uint8_t m_snd_sel; - uint8_t m_snd_tone_gen; - uint8_t m_snd_div; + uint8_t m_sound_select = 0; + uint8_t m_snd_sel = 0; + uint8_t m_snd_tone_gen = 0; + uint8_t m_snd_div = 1; required_region_ptr m_snd_prom; required_device m_discrete; required_device m_timer_s_freq; @@ -154,10 +154,10 @@ void pia_portb_w(uint8_t data); private: - bool m_bc1; - bool m_bdir; - uint8_t m_sound_select; - uint8_t m_ay_data; + bool m_bc1 = false; + bool m_bdir = false; + uint8_t m_sound_select = 0; + uint8_t m_ay_data = 0; // internal communications TIMER_CALLBACK_MEMBER(sound_select_sync); @@ -234,9 +234,9 @@ required_device m_dac; private: - uint8_t m_sound_select; - bool m_sound_int; - bool m_sound_ack; + uint8_t m_sound_select = 0; + bool m_sound_int = 0; + bool m_sound_ack = 0; devcb_write_line m_sound_ack_w_handler; output_finder<1> m_leds; @@ -293,7 +293,7 @@ required_device m_speech_filter; required_device m_tms5200; - uint8_t m_sound_select; + uint8_t m_sound_select = 0; uint8_t pia2_porta_r(); @@ -323,9 +323,9 @@ uint8_t pia2_porta_r(); private: - bool m_bc1; - bool m_bdir; - uint8_t m_ay_data; + bool m_bc1 = false; + bool m_bdir = false; + uint8_t m_ay_data = 0; required_device_array m_ay_filters; required_device m_ay; diff -Nru mame-0.242+dfsg.1/src/mame/audio/bzone.cpp mame-0.243+dfsg.1/src/mame/audio/bzone.cpp --- mame-0.242+dfsg.1/src/mame/audio/bzone.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/audio/bzone.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -236,17 +236,17 @@ #define CD4066_R_ON 270 DISCRETE_CLASS_STEP_RESET(bzone_custom_filter, 1, - double m_v_in1_gain; - double m_v_p; - double m_exponent; - double m_gain[2]; - double m_out_v; + double m_v_in1_gain = 0; + double m_v_p = 0; + double m_exponent = 0; + double m_gain[2]{}; + double m_out_v = 0; ); DISCRETE_STEP(bzone_custom_filter) { int in0 = (BZONE_CUSTOM_FILTER__IN0 == 0) ? 0 : 1; - double v; + double v = 0; if (BZONE_CUSTOM_FILTER__IN1 > 0) v = 0; diff -Nru mame-0.242+dfsg.1/src/mame/audio/cage.cpp mame-0.243+dfsg.1/src/mame/audio/cage.cpp --- mame-0.242+dfsg.1/src/mame/audio/cage.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/audio/cage.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -4,12 +4,84 @@ Atari CAGE Audio Board + Atari CH31.2 sound board layout: + -------------------------------- + + ATARI GAMES (C) 93 MADE IN U.S.A. + |-----------------------------------------------------------| + | JXBUS|---------------------------------| | + | |---------------------------------| JPWR | + | |---------| | + |JROMBUS| 11A | | + | |--| |---------| | + | | ||-----------| | + | | || 11B | | + | | ||-----------| | + | | ||-----------| 3B | + | | || 11C | RAM RAM RAM RAM | + | | ||-----------| | + | | ||-----------| | + | | || 11D | | + | | ||-----------| 3D | + | | ||-----------| |-----------| | + | | || 11E | | | | + | | ||-----------| | DSP | | + | | | | | AMP | + | |--|OSC |-----------| JSPKR | + | | + |-----------------------------------------------------------| + + DSP: TMS320C31 33.8688MHz + OSC: 33.8688MHz + 11A: DIP32 EPROM for Boot + 11B, 11C, 11D, 11E: DIP42 Mask ROM for Data + RAM: 32Kx8 bit SRAM + 3B: AK4316-VS DAC, Not populated in primal rage (no quad channel sound support) + 3D: AK4316-VS DAC + AMP: TDA1554Q Audio amplifier for connect speaker directly + JROMBUS: ROM expansion connector + JXBUS: X-Bus host interface + JSPKR: Audio output connector, Connect to external speaker or motherboard/AMP board + JPWR: Power supply connector, Connect to external power distribution board or motherboard + + Pinouts: + + JSPKR: + --------------- + 01 Channel 1 + + 02 Channel 1 - + 03 Channel 2 + + 04 Channel 2 - + 05 Key + 06 Channel 3 + + 07 Channel 3 - + 08 Channel 4 + + 09 Channel 4 - + 10 Subwoofer + + 11 Subwoofer - + + JPWR: + ---------------- + 01 +5V + 02 +5V + 03 Key + 04 GND + 05 GND + 06 +12V + 07 +12V + 08 -5V + 09 GND + + TODO: + - Move DSP internal functions into tms32031.cpp + - Further support for variable sound output channel + - Support subwoofer output + ****************************************************************************/ #include "emu.h" #include "cage.h" -#include "speaker.h" #define LOG_COMM (0) @@ -23,7 +95,7 @@ * *************************************/ -#define DAC_BUFFER_CHANNELS 4 +#define DAC_BUFFER_CHANNELS 4 // 5; 4 channel + subwoofer? #define STACK_SOUND_BUFSIZE (1024) /************************************* @@ -105,6 +177,7 @@ * *************************************/ +// uses Atari CH31(.2) external sound board DEFINE_DEVICE_TYPE(ATARI_CAGE, atari_cage_device, "atari_cage", "Atari CAGE") @@ -119,6 +192,7 @@ atari_cage_device::atari_cage_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_mixer_interface(mconfig, *this, 5), // 5 output routines in JSPKR m_cpu(*this, "cpu"), m_cageram(*this, "cageram"), m_soundlatch(*this, "soundlatch"), @@ -337,7 +411,7 @@ freq = m_serial_period_per_word.as_hz() / DAC_BUFFER_CHANNELS; if (freq > 0 && freq < 100000) { - for (int i = 0; i < 4; i++) + for (int i = 0; i < DAC_BUFFER_CHANNELS; i++) { m_dmadac[i]->set_frequency(freq); m_dmadac[i]->enable(1); @@ -617,7 +691,7 @@ void atari_cage_device::device_add_mconfig(machine_config &config) { /* basic machine hardware */ - TMS32031(config, m_cpu, 33868800); + TMS32031(config, m_cpu, XTAL(33'868'800)); m_cpu->set_addrmap(AS_PROGRAM, &atari_cage_device::cage_map); m_cpu->set_mcbl_mode(true); @@ -626,27 +700,25 @@ TIMER(config, m_timer[1]).configure_generic(DEVICE_SELF, FUNC(atari_cage_device::cage_timer_callback)); /* sound hardware */ - SPEAKER(config, "lspeaker").front_left(); - SPEAKER(config, "rspeaker").front_right(); - GENERIC_LATCH_16(config, m_soundlatch); #if (DAC_BUFFER_CHANNELS == 4) - DMADAC(config, m_dmadac[0]).add_route(ALL_OUTPUTS, "rspeaker", 0.50); + DMADAC(config, m_dmadac[0]).add_route(ALL_OUTPUTS, *this, 0.50, AUTO_ALLOC_INPUT, 0); - DMADAC(config, m_dmadac[1]).add_route(ALL_OUTPUTS, "lspeaker", 0.50); + DMADAC(config, m_dmadac[1]).add_route(ALL_OUTPUTS, *this, 0.50, AUTO_ALLOC_INPUT, 1); - DMADAC(config, m_dmadac[2]).add_route(ALL_OUTPUTS, "lspeaker", 0.50); + DMADAC(config, m_dmadac[2]).add_route(ALL_OUTPUTS, *this, 0.50, AUTO_ALLOC_INPUT, 2); - DMADAC(config, m_dmadac[3]).add_route(ALL_OUTPUTS, "rspeaker", 0.50); + DMADAC(config, m_dmadac[3]).add_route(ALL_OUTPUTS, *this, 0.50, AUTO_ALLOC_INPUT, 3); #else - DMADAC(config, m_dmadac[0]).add_route(ALL_OUTPUTS, "lspeaker", 1.0); + DMADAC(config, m_dmadac[0]).add_route(ALL_OUTPUTS, *this, 1.0, AUTO_ALLOC_INPUT, 0); - DMADAC(config, m_dmadac[1]).add_route(ALL_OUTPUTS, "rspeaker", 1.0); + DMADAC(config, m_dmadac[1]).add_route(ALL_OUTPUTS, *this, 1.0, AUTO_ALLOC_INPUT, 1); #endif + //add_route(ALL_OUTPUTS, *this, 0.50, AUTO_ALLOC_INPUT, 4); Subwoofer output } - +// Embedded in San francisco Rush Motherboard, 4 channel output connected to Quad Amp PCB and expanded to 5 channel (4 channel + subwoofer) DEFINE_DEVICE_TYPE(ATARI_CAGE_SEATTLE, atari_cage_seattle_device, "atari_cage_seattle", "Atari CAGE Seattle") diff -Nru mame-0.242+dfsg.1/src/mame/audio/cage.h mame-0.243+dfsg.1/src/mame/audio/cage.h --- mame-0.242+dfsg.1/src/mame/audio/cage.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/audio/cage.h 2022-04-29 05:37:26.000000000 +0000 @@ -17,7 +17,7 @@ #include "sound/dmadac.h" -class atari_cage_device : public device_t +class atari_cage_device : public device_t, public device_mixer_interface { public: enum diff -Nru mame-0.242+dfsg.1/src/mame/audio/cmi01a.h mame-0.243+dfsg.1/src/mame/audio/cmi01a.h --- mame-0.242+dfsg.1/src/mame/audio/cmi01a.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/audio/cmi01a.h 2022-04-29 05:37:26.000000000 +0000 @@ -79,52 +79,52 @@ void update_wave_addr(int inc); uint32_t m_channel; - emu_timer * m_zx_timer; - uint8_t m_zx_flag; - uint8_t m_zx_ff; + emu_timer * m_zx_timer = nullptr; + uint8_t m_zx_flag = 0; + uint8_t m_zx_ff = 0; - emu_timer * m_eosi_timer; + emu_timer * m_eosi_timer = nullptr; - emu_timer * m_bcas_timer; + emu_timer * m_bcas_timer = nullptr; std::unique_ptr m_wave_ram; - uint16_t m_segment_cnt; - uint8_t m_new_addr; // Flag - uint8_t m_vol_latch; - uint8_t m_flt_latch; - uint8_t m_rp; - uint8_t m_ws; - int m_dir; - int m_env_dir; - uint8_t m_env; - int m_pia0_cb2_state; - - uint8_t m_bcas_q1_ticks; - uint8_t m_bcas_q1; - uint8_t m_bcas_q2_ticks; - uint8_t m_bcas_q2; - - double m_freq; - - int m_ptm_o1; - int m_ptm_o2; - int m_ptm_o3; - - bool m_load; - bool m_run; - bool m_gzx; - bool m_nwpe; - bool m_tri; - bool m_pia1_ca2; - - bool m_eclk; - bool m_env_clk; - bool m_ediv_out; - uint8_t m_ediv_rate; - uint8_t m_ediv_count; + uint16_t m_segment_cnt = 0; + uint8_t m_new_addr = 0; // Flag + uint8_t m_vol_latch = 0; + uint8_t m_flt_latch = 0; + uint8_t m_rp = 0; + uint8_t m_ws = 0; + int m_dir = 0; + int m_env_dir = 0; + uint8_t m_env = 0; + int m_pia0_cb2_state = 0; + + uint8_t m_bcas_q1_ticks = 0; + uint8_t m_bcas_q1 = 0; + uint8_t m_bcas_q2_ticks = 0; + uint8_t m_bcas_q2 = 0; + + double m_freq = 0; + + int m_ptm_o1 = 0; + int m_ptm_o2 = 0; + int m_ptm_o3 = 0; + + bool m_load = 0; + bool m_run = 0; + bool m_gzx = 0; + bool m_nwpe = 0; + bool m_tri = 0; + bool m_pia1_ca2 = 0; + + bool m_eclk = false; + bool m_env_clk = false; + bool m_ediv_out = false; + uint8_t m_ediv_rate = 0; + uint8_t m_ediv_count = 0; - uint16_t m_pitch; - uint8_t m_octave; + uint16_t m_pitch = 0; + uint8_t m_octave = 0; devcb_write_line m_irq_cb; diff -Nru mame-0.242+dfsg.1/src/mame/audio/copsnrob.cpp mame-0.243+dfsg.1/src/mame/audio/copsnrob.cpp --- mame-0.242+dfsg.1/src/mame/audio/copsnrob.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/audio/copsnrob.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -268,13 +268,13 @@ #define COPSNROB_CUSTOM_NOISE__FREQ DISCRETE_INPUT(0) DISCRETE_CLASS_STEP_RESET(copsnrob_custom_noise, 2, - int m_flip_flop; - int m_noise1_had_xtime; - int m_noise2_had_xtime; - uint8_t m_high_byte; - uint8_t m_low_byte; - double m_t_used; - double m_t1; + int m_flip_flop = 0; + int m_noise1_had_xtime = 0; + int m_noise2_had_xtime = 0; + uint8_t m_high_byte = 0; + uint8_t m_low_byte = 0; + double m_t_used = 0; + double m_t1 = 0; ); #define COPSNROB_CUSTOM_NOISE_HIGH 4.2 @@ -284,9 +284,9 @@ double t_used = m_t_used; double t1 = m_t1; double x_time = 0; - uint8_t low_byte = m_low_byte; - uint8_t high_byte = m_high_byte; - uint8_t xnor_out; /* IC F2, pin 2 */ + uint8_t low_byte = m_low_byte; + uint8_t high_byte = m_high_byte; + uint8_t xnor_out; /* IC F2, pin 2 */ int last_noise1_bit = (low_byte >> 4) & 0x01; int last_noise2_bit = (low_byte >> 5) & 0x01; @@ -374,10 +374,10 @@ #define COPSNROB_CUSTOM_ZINGS_555_MONOSTABLE__C DISCRETE_INPUT(2) DISCRETE_CLASS_STEP_RESET(copsnrob_zings_555_monostable, 1, - double m_rc; - double m_exponent; - double m_v_cap; - int m_flip_flop; + double m_rc = 0; + double m_exponent = 0; + double m_v_cap = 0; + int m_flip_flop = 0; ); DISCRETE_STEP(copsnrob_zings_555_monostable) @@ -471,13 +471,13 @@ #define COPSNROB_CUSTOM_ZINGS_555_ASTABLE__HIGH 4.5 DISCRETE_CLASS_STEP_RESET(copsnrob_zings_555_astable, 1, - double m_r2c2; - double m_r_total_cv; - double m_exponent1; - double m_exponent2; - double m_v_cap1; - double m_v_cap2; - int m_flip_flop; + double m_r2c2 = 0; + double m_r_total_cv = 0; + double m_exponent1 = 0; + double m_exponent2 = 0; + double m_v_cap1 = 0; + double m_v_cap2 = 0; + int m_flip_flop = 0; ); DISCRETE_STEP(copsnrob_zings_555_astable) diff -Nru mame-0.242+dfsg.1/src/mame/audio/dai_snd.h mame-0.243+dfsg.1/src/mame/audio/dai_snd.h --- mame-0.242+dfsg.1/src/mame/audio/dai_snd.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/audio/dai_snd.h 2022-04-29 05:37:26.000000000 +0000 @@ -30,10 +30,10 @@ virtual void sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) override; private: - sound_stream * m_mixer_channel; - int m_dai_input[3]; - uint8_t m_osc_volume[3]; - uint8_t m_noise_volume; + sound_stream * m_mixer_channel = nullptr; + int m_dai_input[3]{}; + uint8_t m_osc_volume[3]{}; + uint8_t m_noise_volume = 0; static const uint16_t s_osc_volume_table[]; static const uint16_t s_noise_volume_table[]; diff -Nru mame-0.242+dfsg.1/src/mame/audio/decobsmt.h mame-0.243+dfsg.1/src/mame/audio/decobsmt.h --- mame-0.242+dfsg.1/src/mame/audio/decobsmt.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/audio/decobsmt.h 2022-04-29 05:37:26.000000000 +0000 @@ -42,9 +42,9 @@ required_device m_ourcpu; required_device m_bsmt; - uint8_t m_bsmt_latch; - uint8_t m_bsmt_reset; - uint8_t m_bsmt_comms; + uint8_t m_bsmt_latch = 0; + uint8_t m_bsmt_reset = 0; + uint8_t m_bsmt_comms = 0; INTERRUPT_GEN_MEMBER(decobsmt_firq_interrupt); diff -Nru mame-0.242+dfsg.1/src/mame/audio/dkong.cpp mame-0.243+dfsg.1/src/mame/audio/dkong.cpp --- mame-0.242+dfsg.1/src/mame/audio/dkong.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/audio/dkong.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -294,11 +294,11 @@ #define DKONG_CUSTOM_V DISCRETE_INPUT(7) DISCRETE_CLASS_STEP_RESET(dkong_custom_mixer, 1, - double m_i_in1[2]; - double m_r_in[2]; - double m_r_total[2]; - double m_exp[2]; - double m_out_v; + double m_i_in1[2]{ 0.0 }; + double m_r_in[2]{ 0.0 }; + double m_r_total[2]{ 0.0 }; + double m_exp[2]{ 0.0 }; + double m_out_v = 0; ); DISCRETE_STEP( dkong_custom_mixer ) diff -Nru mame-0.242+dfsg.1/src/mame/audio/exidy.h mame-0.243+dfsg.1/src/mame/audio/exidy.h --- mame-0.242+dfsg.1/src/mame/audio/exidy.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/audio/exidy.h 2022-04-29 05:37:26.000000000 +0000 @@ -19,11 +19,11 @@ /* 6840 variables */ struct sh6840_timer_channel { - uint8_t cr; - uint8_t state; - uint8_t leftovers; - uint16_t timer; - uint32_t clocks; + uint8_t cr = 0; + uint8_t state = 0; + uint8_t leftovers = 0; + uint16_t timer = 0; + uint32_t clocks = 0; union { #ifdef LSB_FIRST @@ -90,11 +90,11 @@ { struct sh8253_timer_channel { - uint8_t clstate; - uint8_t enable; - uint16_t count; - uint32_t step; - uint32_t fraction; + uint8_t clstate = 0; + uint8_t enable = 0; + uint16_t count = 0; + uint32_t step = 0; + uint32_t fraction = 0; }; protected: @@ -224,8 +224,8 @@ TIMER_CALLBACK_MEMBER( delayed_command_w ); - int m_pia_ca1; - int m_pia_cb1; + int m_pia_ca1 = 0; + int m_pia_cb1 = 0; }; DECLARE_DEVICE_TYPE(EXIDY_VICTORY, victory_sound_device) diff -Nru mame-0.242+dfsg.1/src/mame/audio/flower.h mame-0.243+dfsg.1/src/mame/audio/flower.h --- mame-0.242+dfsg.1/src/mame/audio/flower.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/audio/flower.h 2022-04-29 05:37:26.000000000 +0000 @@ -41,7 +41,7 @@ virtual space_config_vector memory_space_config() const override; virtual void sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) override; - address_space *m_iospace; + address_space *m_iospace = nullptr; private: const address_space_config m_io_space_config; diff -Nru mame-0.242+dfsg.1/src/mame/audio/galaxian.h mame-0.243+dfsg.1/src/mame/audio/galaxian.h --- mame-0.242+dfsg.1/src/mame/audio/galaxian.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/audio/galaxian.h 2022-04-29 05:37:26.000000000 +0000 @@ -31,7 +31,7 @@ private: // internal state - uint8_t m_lfo_val; + uint8_t m_lfo_val = 0; }; class mooncrst_sound_device : public galaxian_sound_device diff -Nru mame-0.242+dfsg.1/src/mame/audio/leland.h mame-0.243+dfsg.1/src/mame/audio/leland.h --- mame-0.242+dfsg.1/src/mame/audio/leland.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/audio/leland.h 2022-04-29 05:37:26.000000000 +0000 @@ -49,7 +49,7 @@ virtual void device_start() override; virtual void device_reset() override; virtual void device_add_mconfig(machine_config &config) override; - int m_type; + int m_type = 0; enum { TYPE_LELAND, @@ -75,15 +75,15 @@ void set_clock_line(int which, int state) { m_clock_active = state ? (m_clock_active | (1< m_master; diff -Nru mame-0.242+dfsg.1/src/mame/audio/micro3d.h mame-0.243+dfsg.1/src/mame/audio/micro3d.h --- mame-0.242+dfsg.1/src/mame/audio/micro3d.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/audio/micro3d.h 2022-04-29 05:37:26.000000000 +0000 @@ -45,23 +45,23 @@ void init(double fs); void recompute(double k, double q, double fc); - float history[2 * 2]; - float coef[4 * 2 + 1]; - double fs; - biquad proto_coef[2]; + float history[2 * 2]{}; + float coef[4 * 2 + 1]{}; + double fs = 0; + biquad proto_coef[2]{}; }; struct m3d_filter_state { void configure(double r, double c); - double capval; - double exponent; + double capval = 0; + double exponent = 0; }; - u8 m_dac_data; + u8 m_dac_data = 0; - u8 m_dac[4]; + u8 m_dac[4]{}; float m_gain; u32 m_noise_shift; diff -Nru mame-0.242+dfsg.1/src/mame/audio/phoenix.h mame-0.243+dfsg.1/src/mame/audio/phoenix.h --- mame-0.242+dfsg.1/src/mame/audio/phoenix.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/audio/phoenix.h 2022-04-29 05:37:26.000000000 +0000 @@ -27,25 +27,25 @@ private: struct c_state { - int32_t counter; - int32_t level; + int32_t counter = 0; + int32_t level = 0; }; struct n_state { - int32_t counter; - int32_t polyoffs; - int32_t polybit; - int32_t lowpass_counter; - int32_t lowpass_polybit; + int32_t counter = 0; + int32_t polyoffs = 0; + int32_t polybit = 0; + int32_t lowpass_counter = 0; + int32_t lowpass_polybit = 0; }; // internal state struct c_state m_c24_state; struct c_state m_c25_state; struct n_state m_noise_state; - uint8_t m_sound_latch_a; - sound_stream * m_channel; + uint8_t m_sound_latch_a = 0; + sound_stream * m_channel = nullptr; std::unique_ptr m_poly18; required_device m_discrete; required_device m_tms; diff -Nru mame-0.242+dfsg.1/src/mame/audio/redalert.h mame-0.243+dfsg.1/src/mame/audio/redalert.h --- mame-0.242+dfsg.1/src/mame/audio/redalert.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/audio/redalert.h 2022-04-29 05:37:26.000000000 +0000 @@ -49,12 +49,12 @@ TIMER_CALLBACK_MEMBER(audio_irq_on); TIMER_CALLBACK_MEMBER(audio_irq_off); - emu_timer *m_audio_irq_on_timer; - emu_timer *m_audio_irq_off_timer; + emu_timer *m_audio_irq_on_timer = nullptr; + emu_timer *m_audio_irq_off_timer = nullptr; - uint8_t m_sound_hs; - uint8_t m_ay8910_latch_1; - uint8_t m_ay8910_latch_2; + uint8_t m_sound_hs = 0; + uint8_t m_ay8910_latch_1 = 0; + uint8_t m_ay8910_latch_2 = 0; }; @@ -117,11 +117,11 @@ required_device m_sndpia; required_device m_soundlatch; - emu_timer *m_audio_irq_on_timer; - emu_timer *m_audio_irq_off_timer; + emu_timer *m_audio_irq_on_timer = nullptr; + emu_timer *m_audio_irq_off_timer = nullptr; - uint8_t m_ay8910_latch_1; - uint8_t m_ay8910_latch_2; + uint8_t m_ay8910_latch_1 = 0; + uint8_t m_ay8910_latch_2 = 0; }; #endif // MAME_AUDIO_REDALERT_H diff -Nru mame-0.242+dfsg.1/src/mame/audio/skyraid.cpp mame-0.243+dfsg.1/src/mame/audio/skyraid.cpp --- mame-0.242+dfsg.1/src/mame/audio/skyraid.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/audio/skyraid.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -144,9 +144,9 @@ #define SKYRAID_MISSLE_CUSTOM_C DISCRETE_INPUT(4) DISCRETE_CLASS_STEP_RESET(skyraid_missle_custom_charge, 2, - double m_v_charge[2]; - double m_v_cap; - double m_exp[2]; + double m_v_charge[2]{ 0.0 }; + double m_v_cap = 0.0; + double m_exp[2]{ 0.0 }; ); /* the high charge is clamped by the diode to 0.7V above the 5V line */ @@ -154,7 +154,7 @@ DISCRETE_STEP( skyraid_missle_custom_charge ) { - int in_1 = (SKYRAID_MISSLE_CUSTOM_IN1 == 0) ? 0 : 1; + int const in_1 = (SKYRAID_MISSLE_CUSTOM_IN1 == 0) ? 0 : 1; /* charge/discharge cap */ m_v_cap += (m_v_charge[in_1] - m_v_cap) * m_exp[in_1]; diff -Nru mame-0.242+dfsg.1/src/mame/audio/socrates.h mame-0.243+dfsg.1/src/mame/audio/socrates.h --- mame-0.242+dfsg.1/src/mame/audio/socrates.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/audio/socrates.h 2022-04-29 05:37:26.000000000 +0000 @@ -28,14 +28,14 @@ static const uint8_t s_volumeLUT[]; // internal state - sound_stream * m_stream; - uint8_t m_freq[2]; // channel 1,2 frequencies - uint8_t m_vol[2]; // channel 1,2 volume - uint8_t m_enable[2]; // channel 1,2 enable - uint8_t m_channel3; // channel 3 weird register - uint8_t m_state[3]; // output states for channels 1,2,3 - uint8_t m_accum[3]; // accumulators for channels 1,2,3 - uint16_t m_DAC_output; // output + sound_stream * m_stream = nullptr; + uint8_t m_freq[2]{}; // channel 1,2 frequencies + uint8_t m_vol[2]{}; // channel 1,2 volume + uint8_t m_enable[2]{}; // channel 1,2 enable + uint8_t m_channel3 = 0; // channel 3 weird register + uint8_t m_state[3]{}; // output states for channels 1,2,3 + uint8_t m_accum[3]{}; // accumulators for channels 1,2,3 + uint16_t m_DAC_output = 0; // output }; DECLARE_DEVICE_TYPE(SOCRATES_SOUND, socrates_snd_device) diff -Nru mame-0.242+dfsg.1/src/mame/audio/t5182.h mame-0.243+dfsg.1/src/mame/audio/t5182.h --- mame-0.242+dfsg.1/src/mame/audio/t5182.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/audio/t5182.h 2022-04-29 05:37:26.000000000 +0000 @@ -54,7 +54,7 @@ int m_irqstate; int m_semaphore_main; int m_semaphore_snd; - emu_timer *m_setirq_cb; + emu_timer *m_setirq_cb = nullptr; TIMER_CALLBACK_MEMBER( setirq_callback ); void sharedram_semaphore_snd_acquire_w(uint8_t data); diff -Nru mame-0.242+dfsg.1/src/mame/audio/vboy.h mame-0.243+dfsg.1/src/mame/audio/vboy.h --- mame-0.242+dfsg.1/src/mame/audio/vboy.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/audio/vboy.h 2022-04-29 05:37:26.000000000 +0000 @@ -27,28 +27,28 @@ uint8_t read(offs_t offset); void write(offs_t offset, uint8_t data); - sound_stream *m_stream; + sound_stream *m_stream = nullptr; protected: static constexpr unsigned CHANNELS = 4; struct s_snd_channel { - int8_t playing; // the sound is playing + int8_t playing = 0; // the sound is playing // state when sound was enabled - uint32_t env_steptime; // Envelope step time - uint8_t env0; // Envelope data - uint8_t env1; // Envelope data - uint8_t volLeft; // Left output volume - uint8_t volRight; // Right output volume - uint8_t sample[580]; // sample to play - int sample_len; // length of sample + uint32_t env_steptime = 0; // Envelope step time + uint8_t env0 = 0; // Envelope data + uint8_t env1 = 0; // Envelope data + uint8_t volLeft = 0; // Left output volume + uint8_t volRight = 0; // Right output volume + uint8_t sample[580]{}; // sample to play + int sample_len = 0; // length of sample // values that change, as the sample is played - int offset; // current offset in sample - int time; // the duration that this sample is to be played - uint8_t envelope; // Current envelope level (604) - int env_time; // The duration between envelope decay/grow (608) + int offset = 0; // current offset in sample + int time = 0; // the duration that this sample is to be played + uint8_t envelope = 0; // Current envelope level (604) + int env_time = 0; // The duration between envelope decay/grow (608) }; struct s_regchan { @@ -80,7 +80,7 @@ uint16_t waveTimer2LenTbl[32]; uint16_t waveEnv2LenTbl[8]; - emu_timer *m_timer; + emu_timer *m_timer = nullptr; uint8_t m_aram[0x600]; }; diff -Nru mame-0.242+dfsg.1/src/mame/audio/vicdual-97271p.h mame-0.243+dfsg.1/src/mame/audio/vicdual-97271p.h --- mame-0.242+dfsg.1/src/mame/audio/vicdual-97271p.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/audio/vicdual-97271p.h 2022-04-29 05:37:26.000000000 +0000 @@ -29,7 +29,7 @@ private: required_device m_samples; - uint8_t m_state; + uint8_t m_state = 0; }; // device type definition diff -Nru mame-0.242+dfsg.1/src/mame/audio/warpwarp.h mame-0.243+dfsg.1/src/mame/audio/warpwarp.h --- mame-0.242+dfsg.1/src/mame/audio/warpwarp.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/audio/warpwarp.h 2022-04-29 05:37:26.000000000 +0000 @@ -35,8 +35,8 @@ // internal state std::unique_ptr m_decay; sound_stream *m_channel; - u32 m_clock_16h; - u32 m_clock_1v; + u32 m_clock_16h = 0; + u32 m_clock_1v = 0; int m_sound_latch; int m_music1_latch; int m_music2_latch; diff -Nru mame-0.242+dfsg.1/src/mame/audio/wpcsnd.cpp mame-0.243+dfsg.1/src/mame/audio/wpcsnd.cpp --- mame-0.242+dfsg.1/src/mame/audio/wpcsnd.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/audio/wpcsnd.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -121,6 +121,10 @@ { // resolve callback m_reply_cb.resolve_safe(); + // save states + save_item(NAME(m_latch)); + save_item(NAME(m_reply)); + save_item(NAME(m_reply_available)); } void wpcsnd_device::device_reset() diff -Nru mame-0.242+dfsg.1/src/mame/audio/wpcsnd.h mame-0.243+dfsg.1/src/mame/audio/wpcsnd.h --- mame-0.242+dfsg.1/src/mame/audio/wpcsnd.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/audio/wpcsnd.h 2022-04-29 05:37:26.000000000 +0000 @@ -47,8 +47,8 @@ virtual void device_add_mconfig(machine_config &config) override; private: - uint8_t m_latch; - uint8_t m_reply; + uint8_t m_latch = 0; + uint8_t m_reply = 0; bool m_reply_available; // callback diff -Nru mame-0.242+dfsg.1/src/mame/audio/wswan.h mame-0.243+dfsg.1/src/mame/audio/wswan.h --- mame-0.242+dfsg.1/src/mame/audio/wswan.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/audio/wswan.h 2022-04-29 05:37:26.000000000 +0000 @@ -78,7 +78,7 @@ u8 m_external_speaker; u16 m_noise_shift; u8 m_master_volume; - u8 m_system_volume; + u8 m_system_volume = 0; }; DECLARE_DEVICE_TYPE(WSWAN_SND, wswan_sound_device) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/1942.cpp mame-0.243+dfsg.1/src/mame/drivers/1942.cpp --- mame-0.242+dfsg.1/src/mame/drivers/1942.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/1942.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -59,6 +59,109 @@ at the sound CPU. +*************************************************************************** + +1942, Capcom 1984 +Hardware info by Guru + +PCB layout +---------- +(Note the two boards are mounted solder side to solder side with components facing outwards) + +Top board: + +84100-01A-03 + |-------------| |---------| +|------|-------------|----------------|---------|-------| +|HA1368 VOL 82S129.F1 | +| | +| M58725(3) SR02.F2 | +| SR03.N3 | +| | +| J1 SR04.N4 | +|2 | +|8 SR05.N5 | +|W | +|A SWA 82S129.K6 SR06.N6 | +|Y | +| SWB J2 SR07.N7 | +| X | +|AY-3-8910 M58725(2) M58725(1)| +| | +|AY-3-8910 SR01.C11 Z80A(2) 12MHz Z80A(1) M58725(1)| +|-------------------------------------------------------| +Notes: + Z80A(1) - Z80A CPU. Clock 3.000MHz [12/4] (Main CPU) + Z80A(2) - Z80A CPU. Clock 3.000MHz [12/4] (Sound CPU) + AY-3-8910 - General Instrument AY-3-8910 Programmable Sound Generator (PSG). Clock 1.500MHz [12/8, both chips) + SWA/B - 8-position DIP switch + J1 - Wire link set to lower position marked '100' + J2 - Wire link set to right position marked '100' + 28WAY - Uses unique Capcom 28-way pinout for 1942. This is not JAMMA + VOL - 2k-ohm Volume Pot + HA1368 - Hitachi HA1368 5.3W Audio Power Amplifier + M58725(1) - Mitsubishi M58725 2kBx8-bit SRAM (main program RAM. 'W-RAM' on the test screen) + M58725(2) - Mitsubishi M58725 2kBx8-bit SRAM (sound program RAM. 'S-RAM' on the test screen) + M58725(3) - Mitsubishi M58725 2kBx8-bit SRAM (character RAM. 'V-RAM' on the test screen) + X - Empty DIP28 location (no ROM or socket) + SR01.C11 - 27C128 16kBx8-bit EPROM (sound program) + SR02.F2 - 27C64 8kBx8-bit EPROM (characters) + SR03.N3 - \ + SR04.N4 - | + SR05.N5 - | 27C128 16kBx8-bit EPROM (main program) + SR07.N7 - / + SR06.N6 - 27C64 8kBx8-bit EPROM (part of main program) + 82S129.F1 - Signetics 82S129 256x4-bit Bipolar PROM (character lookup table) + 82S129.K6 - Signetics 82S129 256x4-bit Bipolar PROM (interrupt timing) + HSync - 15.6173kHz + VSync - 59.6079Hz + + +Bottom board: + +84100-02A-3 +|-------------------------------------------------------| +| SR08.A1 82S129.D1 SR14.L1 SR16.N1| +| SR09.A2 82S129.D2 6148 SR15.L2 SR17.N2| +| | +| SR10.A3 82S129.K3 | +| SR11.A4 6148 | +| | +| SR12.A5 | +| SR13.A6 82S129.D6 | +| | +| MB8128 | +| 82S129.E8 5114 | +| | +| 82S129.E9 5114 | +| | +| 82S129.E10 | +| 82S129.M11 | +|------|-------------|----------------|---------|-------| + |-------------| |---------| +Notes: + MB8128 - Fujitsu MB8128 2kBx8-bit SRAM (background tile RAM) + 6148 - Hitachi HM6148 1kBx4-bit SRAM (sprite generator RAM) + 5114 - Sharp LH5114 1kBx4-bit SRAM (sprite display RAM) + SR14.L1 \ + SR16.N1 | + SR15.L2 | 27C128 16kBx8-bit EPROM (sprites) + SR17.N2 / + SR08.A1 \ + SR09.A2 | + SR10.A3 | 27C64 8kBx8-bit EPROM (background tiles) + SR11.A4 | + SR12.A5 | + SR13.A6 / + 82S129.D1 - Signetics 82S129 256x4-bit Bipolar PROM (tile palette selector) + 82S129.D2 - Signetics 82S129 256x4-bit Bipolar PROM (tile palette selector) + 82S129.K3 - Signetics 82S129 256x4-bit Bipolar PROM (sprite lookup table) + 82S129.D6 - Signetics 82S129 256x4-bit Bipolar PROM (tile lookup table) + 82S129.E8 - Signetics 82S129 256x4-bit Bipolar PROM (red color PROM) + 82S129.E9 - Signetics 82S129 256x4-bit Bipolar PROM (green color PROM) + 82S129.E10 - Signetics 82S129 256x4-bit Bipolar PROM (blue color PROM) + 82S129.M11 - Signetics 82S129 256x4-bit Bipolar PROM (video timing) + ***************************************************************************/ #include "emu.h" @@ -75,7 +178,7 @@ /* 12mhz OSC */ constexpr XTAL MASTER_CLOCK(12_MHz_XTAL); -constexpr XTAL MAIN_CPU_CLOCK(MASTER_CLOCK/3); +constexpr XTAL MAIN_CPU_CLOCK(MASTER_CLOCK/4); constexpr XTAL SOUND_CPU_CLOCK(MASTER_CLOCK/4); constexpr XTAL AUDIO_CLOCK(MASTER_CLOCK/8); /* 20mhz OSC - both Z80s are 4 MHz */ @@ -499,12 +602,12 @@ void _1942_state::_1942(machine_config &config) { /* basic machine hardware */ - Z80(config, m_maincpu, MAIN_CPU_CLOCK); /* 4 MHz ??? */ + Z80(config, m_maincpu, MAIN_CPU_CLOCK); /* 3 MHz */ m_maincpu->set_addrmap(AS_PROGRAM, &_1942_state::_1942_map); TIMER(config, "scantimer").configure_scanline(FUNC(_1942_state::_1942_scanline), "screen", 0, 1); - Z80(config, m_audiocpu, SOUND_CPU_CLOCK); /* 3 MHz ??? */ + Z80(config, m_audiocpu, SOUND_CPU_CLOCK); /* 3 MHz */ m_audiocpu->set_addrmap(AS_PROGRAM, &_1942_state::sound_map); /* video hardware */ diff -Nru mame-0.242+dfsg.1/src/mame/drivers/4enlinea.cpp mame-0.243+dfsg.1/src/mame/drivers/4enlinea.cpp --- mame-0.242+dfsg.1/src/mame/drivers/4enlinea.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/4enlinea.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -700,6 +700,22 @@ ROM_LOAD( "cuatro_en_linea_gal16v8a.ic04", 0x0000, 0x0117, CRC(1edaf06c) SHA1(51e44c2e6b54991330d6ef945e98fa2c8a49408d) ) ROM_END +/* + Unknown darts game. + Oper Coin. 1991. + + Running in 487 System I. + +*/ +ROM_START( unkdarts ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "diana_iv_video_27-1-92.bin", 0x0000, 0x8000, CRC(f23b5313) SHA1(488cf9bedce7b0c7b474bd93da70181c81fa300b) ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) + ROM_LOAD( "diana_iv_master_27-1-92.bin", 0x0000, 0x8000, CRC(4b2c868a) SHA1(91120a32fac9c5a6e7746d2e2587921f7d42eaa3) ) +ROM_END + + /* Kursaal K7 Olympic Darts PCB __________________________________________________ SUBBOARD CM3080 | ________ __ ______ ______________ | ________________ @@ -773,9 +789,10 @@ * Game Drivers * ***********************************/ -// YEAR NAME PARENT MACHINE INPUT CLASS INIT ROT COMPANY FULLNAME FLAGS -GAME( 1991, 4enlinea, 0, _4enlinea, 4enlinea, _4enlinea_state, empty_init, ROT0, "Compumatic / CIC Play", "Cuatro en Linea (rev. A-07)", MACHINE_NOT_WORKING ) -GAME( 1991, 4enlineb, 4enlinea, _4enlinea, 4enlinea, _4enlinea_state, empty_init, ROT0, "Compumatic / CIC Play", "Cuatro en Linea (rev. A-06)", MACHINE_NOT_WORKING ) -GAME( 1994, k7_olym, 0, k7_olym, k7_olym, _4enlinea_state, empty_init, ROT0, "K7 Kursaal / NMI Electronics", "Olympic Darts K7 (v3.11)", MACHINE_NOT_WORKING | MACHINE_MECHANICAL ) -GAME( 1994, k7_olym30, k7_olym, k7_olym, k7_olym, _4enlinea_state, empty_init, ROT0, "K7 Kursaal / NMI Electronics", "Olympic Darts K7 (v3.00)", MACHINE_NOT_WORKING | MACHINE_MECHANICAL ) -GAME( 1993, sprtdart, 0, k7_olym, k7_olym, _4enlinea_state, empty_init, ROT0, "Compumatic / Desarrollos y Recambios S.L.", "Sport Darts T.V.", MACHINE_NOT_WORKING | MACHINE_MECHANICAL ) +// YEAR NAME PARENT MACHINE INPUT CLASS INIT ROT COMPANY FULLNAME FLAGS +GAME( 1991, 4enlinea, 0, _4enlinea, 4enlinea, _4enlinea_state, empty_init, ROT0, "Compumatic / CIC Play", "Cuatro en Linea (rev. A-07)", MACHINE_NOT_WORKING ) +GAME( 1991, 4enlineb, 4enlinea, _4enlinea, 4enlinea, _4enlinea_state, empty_init, ROT0, "Compumatic / CIC Play", "Cuatro en Linea (rev. A-06)", MACHINE_NOT_WORKING ) +GAME( 1992, unkdarts, 0, _4enlinea, 4enlinea, _4enlinea_state, empty_init, ROT0, "Oper Coin", "unknown darts game (487 System I)", MACHINE_NOT_WORKING ) +GAME( 1994, k7_olym, 0, k7_olym, k7_olym, _4enlinea_state, empty_init, ROT0, "K7 Kursaal / NMI Electronics", "Olympic Darts K7 (v3.11)", MACHINE_NOT_WORKING | MACHINE_MECHANICAL ) +GAME( 1994, k7_olym30, k7_olym, k7_olym, k7_olym, _4enlinea_state, empty_init, ROT0, "K7 Kursaal / NMI Electronics", "Olympic Darts K7 (v3.00)", MACHINE_NOT_WORKING | MACHINE_MECHANICAL ) +GAME( 1993, sprtdart, 0, k7_olym, k7_olym, _4enlinea_state, empty_init, ROT0, "Compumatic / Desarrollos y Recambios S.L.", "Sport Darts T.V.", MACHINE_NOT_WORKING | MACHINE_MECHANICAL ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/8080bw.cpp mame-0.243+dfsg.1/src/mame/drivers/8080bw.cpp --- mame-0.242+dfsg.1/src/mame/drivers/8080bw.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/8080bw.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -136,7 +136,7 @@ + Figure out the difference between the Taito and Midway discrete boards and emulate them both properly. + Figure out what the current discrete setup is trying to emulate. - * Remove Space Invaders 'invaders' set from mw8080bw.c, it does not belong + * Remove Space Invaders 'invaders' set from mw8080bw.cpp, it does not belong there at all - Space Chaser (schaser) @@ -723,12 +723,19 @@ static INPUT_PORTS_START( sinvzen ) PORT_INCLUDE( sicv ) + PORT_MODIFY("IN0") + PORT_DIPNAME( 0x01, 0x00, DEF_STR( Difficulty ) ) /* [code: 0x18ca-d1] */ + PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) + PORT_DIPSETTING( 0x01, DEF_STR( Hard ) ) + PORT_MODIFY("IN2") PORT_DIPNAME( 0x80, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:8") PORT_DIPSETTING( 0x80, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) INPUT_PORTS_END + + /*******************************************************/ /* */ /* bootleg "Space Attack II" */ @@ -738,6 +745,11 @@ static INPUT_PORTS_START( spaceat2 ) PORT_INCLUDE( sicv ) + PORT_MODIFY("IN0") + PORT_DIPNAME( 0x04, 0x00, DEF_STR( Difficulty ) ) /* [code: 0x18ca-d1] */ + PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) + PORT_DIPSETTING( 0x04, DEF_STR( Hard ) ) + PORT_MODIFY("IN2") PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x00, "SW1:5" ) PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x00, "SW1:6" ) @@ -745,10 +757,6 @@ PORT_DIPNAME( 0x80, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:8") PORT_DIPSETTING( 0x80, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) - - /* Dummy port for cocktail mode (not used) */ - PORT_MODIFY(INVADERS_CAB_TYPE_PORT_TAG) - PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNKNOWN ) INPUT_PORTS_END @@ -2304,9 +2312,11 @@ /* Dummy controls port, P1 */ INVADERS_CONTROL_PORT_P1 + + /* Dummy controls port, P2 */ INVADERS_CONTROL_PORT_P2 - /* Dummy port for cocktail mode (not used) */ + /* Dummy port for cocktail mode */ INVADERS_CAB_TYPE_PORT INPUT_PORTS_END @@ -3533,12 +3543,8 @@ PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(mw8080bw_state, invaders_in2_control_r) PORT_DIPUNUSED_DIPLOC( 0x80, 0x00, "SW:1" ) - /* fake port for cabinet type */ - PORT_START(INVADERS_CAB_TYPE_PORT_TAG) - PORT_CONFNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) - PORT_CONFSETTING( 0x00, DEF_STR( Upright ) ) - PORT_CONFSETTING( 0x01, DEF_STR( Cocktail ) ) - PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNUSED ) + /* Dummy port for cocktail mode */ + INVADERS_CAB_TYPE_PORT /* fake ports for handling the various input ports based on cabinet type */ PORT_START(INVADERS_SW6_SW7_PORT_TAG) @@ -3550,17 +3556,12 @@ PORT_DIPUNUSED_DIPLOC( 0x01, 0x00, "SW:5" ) PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_START(INVADERS_P1_CONTROL_PORT_TAG) - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(1) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(1) - PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED ) - - PORT_START(INVADERS_P2_CONTROL_PORT_TAG) - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2) - PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED ) + /* Dummy controls port, P1 */ + INVADERS_CONTROL_PORT_P1 + + /* Dummy controls port, P2 */ + INVADERS_CONTROL_PORT_P2 + INPUT_PORTS_END void _8080bw_state::invmulti_map(address_map &map) @@ -5749,18 +5750,19 @@ GAMEL(1979, cosmicmo, invaders, cosmicmo, cosmicmo, _8080bw_state, empty_init, ROT270, "bootleg (Universal)", "Cosmic Monsters (version II)", MACHINE_SUPPORTS_SAVE, layout_cosmicm ) // Taito sued, and as settlement they were allowed to sell Universal's Galaxy Wars GAMEL(1979, cosmicm2, invaders, cosmicmo, cosmicmo, _8080bw_state, empty_init, ROT270, "bootleg (Universal)", "Cosmic Monsters 2", MACHINE_SUPPORTS_SAVE, layout_cosmicm ) // " GAMEL(1980?,sinvzen, invaders, invaders, sinvzen, mw8080bw_state, empty_init, ROT270, "Taito / Zenitone-Microsec Ltd.", "Super Invaders (Zenitone-Microsec)", MACHINE_SUPPORTS_SAVE, layout_invaders ) // Unclassified, licensed or bootleg? +GAMEL(1980, spaceat2, invaders, invaders, spaceat2, mw8080bw_state, empty_init, ROT270, "bootleg (Video Games UK)", "Space Attack II (bootleg of Super Invaders)", MACHINE_SUPPORTS_SAVE, layout_invaders ) // Bootleg of Zenitone-Microsec Super Invaders +GAMEL(1980, invader4, invaders, invaders, spaceat2, mw8080bw_state, empty_init, ROT270, "bootleg", "Space Invaders Part Four (bootleg of Space Attack II)", MACHINE_SUPPORTS_SAVE, layout_invaders ) // Bootleg of Space Attack II GAMEL(1980, ultrainv, invaders, invaders, sicv, mw8080bw_state, empty_init, ROT270, "Taito / Konami", "Ultra Invaders", MACHINE_SUPPORTS_SAVE, layout_invaders ) // Unclassified, licensed or bootleg? GAMEL(1978, spaceatt, invaders, invaders, sicv, mw8080bw_state, empty_init, ROT270, "bootleg (Video Games GmbH)", "Space Attack (bootleg of Space Invaders)", MACHINE_SUPPORTS_SAVE, layout_invaders ) -GAMEL(1978, spaceattbp, invaders, invaders, sicv, mw8080bw_state, empty_init, ROT270, "bootleg (Video Games GmbH)", "Space Attack (bproms)(bootleg of Space Invaders)", MACHINE_SUPPORTS_SAVE, layout_invaders ) -GAMEL(1978, spaceatt2k, invaders, invaders, sicv, mw8080bw_state, empty_init, ROT270, "bootleg (Video Games GmbH)", "Space Attack (2k roms)(bootleg of Space Invaders)", MACHINE_SUPPORTS_SAVE, layout_invaders ) +GAMEL(1978, spaceattbp, invaders, invaders, sicv, mw8080bw_state, empty_init, ROT270, "bootleg (Video Games GmbH)", "Space Attack (bootleg of Space Invaders, bproms)", MACHINE_SUPPORTS_SAVE, layout_invaders ) +GAMEL(1978, spaceatt2k, invaders, invaders, sicv, mw8080bw_state, empty_init, ROT270, "bootleg (Video Games GmbH)", "Space Attack (bootleg of Space Invaders, 2k roms)", MACHINE_SUPPORTS_SAVE, layout_invaders ) GAMEL(1978, cosmicin, invaders, invaders, sicv, mw8080bw_state, empty_init, ROT270, "bootleg", "Cosmic Invaders (bootleg of Space Invaders)", MACHINE_SUPPORTS_SAVE, layout_invaders ) GAMEL(1978, galmonst, invaders, invaders, sicv, mw8080bw_state, empty_init, ROT270, "bootleg (Laguna S.A.)", "Galaxy Monsters (Laguna S.A. Spanish bootleg of Space Invaders)", MACHINE_SUPPORTS_SAVE, layout_invaders ) -GAMEL(1980, spaceat2, invaders, invaders, spaceat2, mw8080bw_state, empty_init, ROT270, "bootleg (Video Games UK)", "Space Attack II (bootleg of Super Invaders)", MACHINE_SUPPORTS_SAVE, layout_invaders ) // Bootleg of Zenitone-Microsec Super Invaders GAMEL(1979, spacecom, invaders, spacecom, spacecom, _8080bw_state, init_spacecom, ROT270, "bootleg", "Space Combat (bootleg of Space Invaders)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE, layout_spacecom ) GAME( 1978, spacerng, invaders, spacerng, sitv, _8080bw_state, empty_init, ROT90, "bootleg (Leisure Time Electronics)", "Space Ranger", MACHINE_WRONG_COLORS | MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND ) // Many modifications GAMEL(19??, invasion, invaders, invaders, invasion, mw8080bw_state, empty_init, ROT270, "bootleg (Sidam)", "Invasion (Sidam)", MACHINE_SUPPORTS_SAVE, layout_invaders ) -GAMEL(1979, invasiona, invaders, invaders, invasion, mw8080bw_state, empty_init, ROT270, "bootleg", "UFO Robot Attack (bootleg of Invasion, newer set)", MACHINE_SUPPORTS_SAVE, layout_invaders ) // Has Sidam replaced with 'Ufo Monster Attack' and standard GFX -GAMEL(1979, invasiona2, invaders, invaders, invasion, mw8080bw_state, empty_init, ROT270, "bootleg", "UFO Robot Attack (bootleg of Invasion, older set)", MACHINE_SUPPORTS_SAVE, layout_invaders ) // Has Sidam replaced with 'Ufo Monster Attack' and standard GFX +GAMEL(1979, invasiona, invaders, invaders, invasion, mw8080bw_state, empty_init, ROT270, "bootleg", "UFO Robot Attack (bootleg of Invasion, newer set)", MACHINE_SUPPORTS_SAVE, layout_invaders ) // Has Sidam replaced with 'UFO Monster Attack' and standard GFX +GAMEL(1979, invasiona2, invaders, invaders, invasion, mw8080bw_state, empty_init, ROT270, "bootleg", "UFO Robot Attack (bootleg of Invasion, older set)", MACHINE_SUPPORTS_SAVE, layout_invaders ) // Has Sidam replaced with 'UFO Monster Attack' and standard GFX GAMEL(1979, invasionb, invaders, invaders, invasion, mw8080bw_state, empty_init, ROT270, "bootleg", "Invasion (Italian bootleg)", MACHINE_SUPPORTS_SAVE, layout_invaders ) GAMEL(1979, invasionrz, invaders, invaders, invasion, mw8080bw_state, empty_init, ROT270, "bootleg (R Z SRL Bologna)", "Invasion (bootleg set 1, R Z SRL Bologna)", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING, layout_invaders ) GAMEL(1979, invasionrza, invaders, invaders, invasion, mw8080bw_state, empty_init, ROT270, "bootleg (R Z SRL Bologna)", "Invasion (bootleg set 2, R Z SRL Bologna)", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING, layout_invaders ) @@ -5775,9 +5777,8 @@ GAMEL(19??, alieninvp2, invaders, invaders, searthin, mw8080bw_state, empty_init, ROT270, "bootleg", "Alien Invasion Part II", MACHINE_SUPPORTS_SAVE, layout_invaders ) GAMEL(1979, jspecter, invaders, invaders, jspecter, mw8080bw_state, empty_init, ROT270, "bootleg (Jatre)", "Jatre Specter (set 1)", MACHINE_SUPPORTS_SAVE, layout_invaders ) GAMEL(1979, jspecter2, invaders, invaders, jspecter, mw8080bw_state, empty_init, ROT270, "bootleg (Jatre)", "Jatre Specter (set 2)", MACHINE_SUPPORTS_SAVE, layout_invaders ) -GAMEL(1978, spacewr3, invaders, spcewars, sicv, _8080bw_state, empty_init, ROT270, "bootleg", "Space War Part 3", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE, layout_invaders ) // Unrelated to Sanritsu's version? -GAMEL(1978, swipeout, invaders, spcewars, sicv, _8080bw_state, empty_init, ROT270, "bootleg (Beyer and Brown)", "Space Wipeout", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE, layout_invaders ) -GAMEL(1978, invader4, invaders, invaders, sicv, mw8080bw_state, empty_init, ROT270, "bootleg", "Space Invaders Part Four", MACHINE_SUPPORTS_SAVE, layout_invaders ) +GAMEL(1978, spacewr3, invaders, spcewars, sicv, _8080bw_state, empty_init, ROT270, "bootleg", "Space War Part 3", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE, layout_invaders ) // Bootleg of Sanritsu's Space War +GAMEL(1978, swipeout, invaders, spcewars, sicv, _8080bw_state, empty_init, ROT270, "bootleg (Beyer and Brown)", "Space Wipeout", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE, layout_invaders ) // Bootleg of Sanritsu's Space War GAME( 1978, darthvdr, invaders, darthvdr, darthvdr, _8080bw_state, empty_init, ROT270, "bootleg", "Darth Vader (bootleg of Space Invaders)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND ) GAMEL(19??, tst_invd, invaders, invaders, sicv, mw8080bw_state, empty_init, ROT0, "", "Space Invaders Test ROM", MACHINE_SUPPORTS_SAVE, layout_invaders ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/a1supply.cpp mame-0.243+dfsg.1/src/mame/drivers/a1supply.cpp --- mame-0.242+dfsg.1/src/mame/drivers/a1supply.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/a1supply.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -103,7 +103,7 @@ // Intel D4201A 2334A // Intel P4002-1 x2 (empty socket right next to these 2) ROM_START( tv21_3 ) - ROM_REGION( 0x1000, "maincpu", ROMREGION_ERASE00 ) + ROM_REGION( 0x1040, "maincpu", ROMREGION_ERASE00 ) ROM_LOAD( "750135.9", 0x0000, 0x0800, CRC(c821464c) SHA1(5334e6011ff8cd76b6215af05e697e4538921260) ) // 2716 looking chip FIXED BITS (xx000000) BADADDR ---xxxxxxxx ROM_LOAD( "750030.42", 0x0800, 0x0200, CRC(d8595357) SHA1(44805f2b3dad8e764dda246ed19d328927679062) ) // 82s141 ROM_LOAD( "750026a.47", 0x0a00, 0x0200, CRC(165f590a) SHA1(d4d001ac710d28b983f8f5ce4a2e9364c2e73179) ) // 82s141 @@ -115,9 +115,9 @@ ROM_LOAD( "7500116a.24", 0x0f40, 0x0020, CRC(ebed85b7) SHA1(b62f099c3e6350cf88f9c70750d227c82c8c4608) ) // 82s23n ROM_LOAD( "7500115a.25", 0x0f60, 0x0020, CRC(b663d121) SHA1(ddf09dd624ad3cddc8f10406bdb22cf746361571) ) // 82s23n ROM_LOAD( "700117a.41", 0x0f80, 0x0020, NO_DUMP ) // PROM1-0512-5B 7645, unknown chip type and size - ROM_LOAD( "700120.46", 0x0fa0, 0x0020, NO_DUMP ) // PROM1-0512-5B 7704, unknown chip type and size - ROM_LOAD( "700118.51", 0x0fc0, 0x0020, NO_DUMP ) // PROM1-0512-5B 7704, unknown chip type and size - ROM_LOAD( "750029.53", 0x0fe0, 0x0020, CRC(d8c22608) SHA1(170e6f552fc013fec6903e45e2c7ec07e44d725c) ) // 82s23n, same contents as tvpoker's 90204100.69 + ROM_LOAD( "700120.46", 0x0fa0, 0x0040, CRC(a4f265de) SHA1(147a457a3a6b6e4350c9a765e4757b5f075fa2bb) ) // PROM1-0512-5B 7704, unknown chip type, hand read + ROM_LOAD( "700118.51", 0x0fe0, 0x0040, CRC(57bdc886) SHA1(890e3a0c48aa17a8d8bc1838264264c0bcc3bc1b) ) // PROM1-0512-5B 7704, unknown chip type, hand read + ROM_LOAD( "750029.53", 0x1020, 0x0020, CRC(d8c22608) SHA1(170e6f552fc013fec6903e45e2c7ec07e44d725c) ) // 82s23n, same contents as tvpoker's 90204100.69 ROM_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/a5105.cpp mame-0.243+dfsg.1/src/mame/drivers/a5105.cpp --- mame-0.242+dfsg.1/src/mame/drivers/a5105.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/a5105.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Angelo Salese, Robbbert +// copyright-holders:Angelo Salese /*************************************************************************** A5105 diff -Nru mame-0.242+dfsg.1/src/mame/drivers/abc1600.cpp mame-0.243+dfsg.1/src/mame/drivers/abc1600.cpp --- mame-0.242+dfsg.1/src/mame/drivers/abc1600.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/abc1600.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -424,7 +424,7 @@ break; case 4: // PARTST - m_partst = state; + m_mac->partst_w(state); break; case 5: // _DMADIS @@ -815,7 +815,6 @@ save_item(NAME(m_dmadis)); save_item(NAME(m_sysscc)); save_item(NAME(m_sysfs)); - save_item(NAME(m_partst)); save_item(NAME(m_cs7)); save_item(NAME(m_bus0)); save_item(NAME(m_csb)); diff -Nru mame-0.242+dfsg.1/src/mame/drivers/acefruit.cpp mame-0.243+dfsg.1/src/mame/drivers/acefruit.cpp --- mame-0.242+dfsg.1/src/mame/drivers/acefruit.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/acefruit.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -90,10 +90,9 @@ void acefruit_state::acefruit_update_irq(int vpos) { - int col; int row = vpos / 8; - for( col = 0; col < 32; col++ ) + for( int col = 0; col < 32; col++ ) { int tile_index = ( col * 32 ) + row; int color = m_colorram[ tile_index ]; @@ -225,52 +224,31 @@ template int acefruit_state::sidewndr_payout_r() { - switch (Mask) - { - case 0x01: - return ((m_port_payout->read() & Mask) >> 0); - case 0x02: - return ((m_port_payout->read() & Mask) >> 1); - default: - logerror("sidewndr_payout_r : invalid %02X bit_mask\n",Mask); - return 0; - } + if (Mask < 2) + return BIT(m_port_payout->read(), Mask); + + logerror("sidewndr_payout_r : invalid %02X bit_mask\n",Mask); + return 0; } template int acefruit_state::starspnr_coinage_r() { - switch (Mask) - { - case 0x01: - return ((m_port_coinage->read() & Mask) >> 0); - case 0x02: - return ((m_port_coinage->read() & Mask) >> 1); - case 0x04: - return ((m_port_coinage->read() & Mask) >> 2); - case 0x08: - return ((m_port_coinage->read() & Mask) >> 3); - default: - logerror("starspnr_coinage_r : invalid %02X bit_mask\n",Mask); - return 0; - } + if (Mask < 4) + return BIT(m_port_coinage->read(), Mask); + + logerror("starspnr_coinage_r : invalid %02X bit_mask\n",Mask); + return 0; } template int acefruit_state::starspnr_payout_r() { - switch (Mask) - { - case 0x01: - return ((m_port_payout->read() & Mask) >> 0); - case 0x02: - return ((m_port_payout->read() & Mask) >> 1); - case 0x04: - return ((m_port_payout->read() & Mask) >> 2); - default: - logerror("starspnr_payout_r : invalid %02X bit_mask\n",Mask); - return 0; - } + if (Mask < 3) + return BIT(m_port_payout->read(), Mask); + + logerror("starspnr_payout_r : invalid %02X bit_mask\n",Mask); + return 0; } void acefruit_state::acefruit_colorram_w(offs_t offset, uint8_t data) @@ -373,14 +351,14 @@ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME( "Cancel/Clear" ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME( "Refill" ) PORT_TOGGLE PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 ) /* "Token in" - also "Refill" when "Refill" mode ON */ - PORT_BIT( 0x08, 0x00, IPT_CUSTOM) PORT_READ_LINE_MEMBER(acefruit_state, sidewndr_payout_r<0x01>) + PORT_BIT( 0x08, 0x00, IPT_CUSTOM) PORT_READ_LINE_MEMBER(acefruit_state, sidewndr_payout_r<0x00>) PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("IN3") // 3 PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME( "Hold/Nudge 1" ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME( "Accountancy System" ) PORT_TOGGLE PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN4 ) /* "50P in" */ - PORT_BIT( 0x08, 0x00, IPT_CUSTOM) PORT_READ_LINE_MEMBER(acefruit_state, sidewndr_payout_r<0x02>) + PORT_BIT( 0x08, 0x00, IPT_CUSTOM) PORT_READ_LINE_MEMBER(acefruit_state, sidewndr_payout_r<0x01>) PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("IN4") // 4 @@ -487,7 +465,7 @@ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME( "Collect/Cancel" ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 ) /* tested at 0xeed7 with IN1 bit 3 - before coins are tested - table at 0xef55 (4 * 3 bytes) */ - PORT_BIT( 0x08, 0x00, IPT_CUSTOM) PORT_READ_LINE_MEMBER(acefruit_state, starspnr_coinage_r<0x08>) /* to be confirmed */ + PORT_BIT( 0x08, 0x00, IPT_CUSTOM) PORT_READ_LINE_MEMBER(acefruit_state, starspnr_coinage_r<0x03>) /* to be confirmed */ PORT_START("IN2") // 2 /* tested at 0xe83c */ @@ -497,7 +475,7 @@ /* tested at 0xef82 after IN5 bit 1 and after IN1 bit 3 - after coins are tested - table at 0xefa8 (3 bytes) */ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* tested at 0xeeba with IN3 bit 3 - before coins are tested - table at 0xef55 (4 * 3 bytes) */ - PORT_BIT( 0x08, 0x00, IPT_CUSTOM) PORT_READ_LINE_MEMBER(acefruit_state, starspnr_coinage_r<0x02>) /* to be confirmed */ + PORT_BIT( 0x08, 0x00, IPT_CUSTOM) PORT_READ_LINE_MEMBER(acefruit_state, starspnr_coinage_r<0x01>) /* to be confirmed */ /* tested at 0x1b0f */ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) @@ -506,7 +484,7 @@ /* tested at 0xe8ea and 0xecbe */ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* tested at 0xeeba with IN2 bit 3 - before coins are tested - table at 0xef55 (4 * 3 bytes) */ - PORT_BIT( 0x08, 0x00, IPT_CUSTOM) PORT_READ_LINE_MEMBER(acefruit_state, starspnr_coinage_r<0x01>) /* to be confirmed */ + PORT_BIT( 0x08, 0x00, IPT_CUSTOM) PORT_READ_LINE_MEMBER(acefruit_state, starspnr_coinage_r<0x00>) /* to be confirmed */ /* tested at 0x0178 */ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) @@ -517,7 +495,7 @@ /* tested at 0xed86 */ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* tested at 0xeed7 with IN1 bit 3 - before coins are tested - table at 0xef55 (4 * 3 bytes) */ - PORT_BIT( 0x08, 0x00, IPT_CUSTOM) PORT_READ_LINE_MEMBER(acefruit_state, starspnr_coinage_r<0x04>) /* to be confirmed */ + PORT_BIT( 0x08, 0x00, IPT_CUSTOM) PORT_READ_LINE_MEMBER(acefruit_state, starspnr_coinage_r<0x02>) /* to be confirmed */ PORT_START("IN5") // 5 PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON9 ) PORT_NAME( "Hold 3" ) @@ -526,7 +504,7 @@ /* tested at 0xec6f */ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* tested at 0x1d60 with IN6 bit 3 and IN7 bit 3 - table at 0x1d90 (8 * 3 bytes) */ - PORT_BIT( 0x08, 0x00, IPT_CUSTOM) PORT_READ_LINE_MEMBER(acefruit_state, starspnr_payout_r<0x01>) /* to be confirmed */ + PORT_BIT( 0x08, 0x00, IPT_CUSTOM) PORT_READ_LINE_MEMBER(acefruit_state, starspnr_payout_r<0x00>) /* to be confirmed */ /* tested at 0xe312 and 0xe377 */ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) @@ -535,7 +513,7 @@ /* tested at 0xee42, 0xee5e and 0xeff5 before IN1 bit 0 - invalid code after 0xf000 */ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* tested at 0x1d60 with IN5 bit 3 and IN7 bit 3 - table at 0x1d90 (8 * 3 bytes) */ - PORT_BIT( 0x08, 0x00, IPT_CUSTOM) PORT_READ_LINE_MEMBER(acefruit_state, starspnr_payout_r<0x02>) /* to be confirmed */ + PORT_BIT( 0x08, 0x00, IPT_CUSTOM) PORT_READ_LINE_MEMBER(acefruit_state, starspnr_payout_r<0x01>) /* to be confirmed */ /* tested at 0xe8dd and 0xec1c */ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) @@ -547,7 +525,7 @@ /* tested at 0xedcb */ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* tested at 0x1d60 with IN5 bit 3 and IN6 bit 3 - table at 0x1d90 (8 * 3 bytes) */ - PORT_BIT( 0x08, 0x00, IPT_CUSTOM) PORT_READ_LINE_MEMBER(acefruit_state, starspnr_payout_r<0x04>) /* to be confirmed */ + PORT_BIT( 0x08, 0x00, IPT_CUSTOM) PORT_READ_LINE_MEMBER(acefruit_state, starspnr_payout_r<0x02>) /* to be confirmed */ /* tested at 0xec2a */ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/acommand.cpp mame-0.243+dfsg.1/src/mame/drivers/acommand.cpp --- mame-0.242+dfsg.1/src/mame/drivers/acommand.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/acommand.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -440,21 +440,8 @@ PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) INPUT_PORTS_END -static const gfx_layout tilelayout = -{ - 16,16, - RGN_FRAC(1,1), - 4, - { 0, 1, 2, 3 }, - { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4, - 16*32+0*4, 16*32+1*4, 16*32+2*4, 16*32+3*4, 16*32+4*4, 16*32+5*4, 16*32+6*4, 16*32+7*4 }, - { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32, - 8*32, 9*32, 10*32, 11*32, 12*32, 13*32, 14*32, 15*32 }, - 32*32 -}; - static GFXDECODE_START( gfx_acommand ) - GFXDECODE_ENTRY( "gfx3", 0, tilelayout, 0x1800, 256 ) + GFXDECODE_ENTRY( "gfx3", 0, gfx_8x8x4_col_2x2_group_packed_msb, 0x1800, 256 ) GFXDECODE_END TIMER_DEVICE_CALLBACK_MEMBER(acommand_state::acommand_scanline) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/acrnsys.cpp mame-0.243+dfsg.1/src/mame/drivers/acrnsys.cpp --- mame-0.242+dfsg.1/src/mame/drivers/acrnsys.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/acrnsys.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Robbbert, Nigel Barnes +// copyright-holders:Nigel Barnes /*************************************************************************** Acorn System 2, 3, 4, and 5 diff -Nru mame-0.242+dfsg.1/src/mame/drivers/adm31.cpp mame-0.243+dfsg.1/src/mame/drivers/adm31.cpp --- mame-0.242+dfsg.1/src/mame/drivers/adm31.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/adm31.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -69,7 +69,7 @@ required_ioport m_baud; output_finder<> m_caps_lamp; - u8 m_kbd_scan; + u8 m_kbd_scan = 0; }; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/advision.cpp mame-0.243+dfsg.1/src/mame/drivers/advision.cpp --- mame-0.242+dfsg.1/src/mame/drivers/advision.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/advision.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -2,26 +2,100 @@ // copyright-holders:Dan Boris /************************************************************************* - Driver for the Entex Adventure Vision +Driver for the Entex Adventure Vision -**************************************************************************/ - -/* +TODO: +- convert to discrete sound +- screen pincushion distortion - TODO: - - - convert to discrete sound - - screen pincushion distortion - -*/ +**************************************************************************/ #include "emu.h" -#include "includes/advision.h" - #include "screen.h" #include "softlist_dev.h" #include "speaker.h" +#include "bus/generic/slot.h" +#include "bus/generic/carts.h" +#include "cpu/cop400/cop400.h" +#include "cpu/mcs48/mcs48.h" +#include "sound/dac.h" +#include "emupal.h" + +namespace { +#define I8048_TAG "i8048" +#define COP411_TAG "cop411" + +class advision_state : public driver_device +{ +public: + advision_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, I8048_TAG) + , m_soundcpu(*this, COP411_TAG) + , m_dac(*this, "dac") + , m_cart(*this, "cartslot") + , m_bank1(*this, "bank1") + , m_joy(*this, "joystick") + , m_palette(*this, "palette") + { } + + required_device m_maincpu; + required_device m_soundcpu; + required_device m_dac; + required_device m_cart; + required_memory_bank m_bank1; + required_ioport m_joy; + required_device m_palette; + + virtual void machine_start() override; + virtual void machine_reset() override; + + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + void update_dac(); + void vh_write(int data); + void vh_update(int x); + + uint8_t rom_r(offs_t offset); + uint8_t ext_ram_r(offs_t offset); + void ext_ram_w(offs_t offset, uint8_t data); + uint8_t controller_r(); + void bankswitch_w(uint8_t data); + void av_control_w(uint8_t data); + DECLARE_READ_LINE_MEMBER( vsync_r ); + + TIMER_CALLBACK_MEMBER( sound_cmd_sync ); + uint8_t sound_cmd_r(); + void sound_g_w(uint8_t data); + void sound_d_w(uint8_t data); + + memory_region *m_cart_rom = nullptr; + + int m_ea_bank = 0; + + /* external RAM state */ + std::vector m_ext_ram; + int m_rambank = 0; + + /* video state */ + int m_frame_count = 0; + int m_frame_start = 0; + int m_video_enable = 0; + int m_video_bank = 0; + int m_video_hpos = 0; + uint8_t m_led_latch[8] = {}; + std::unique_ptr m_display; + + /* sound state */ + int m_sound_cmd = 0; + int m_sound_d = 0; + int m_sound_g = 0; + void advision_palette(palette_device &palette) const; + void advision(machine_config &config); + void io_map(address_map &map); + void program_map(address_map &map); +}; /* Memory Maps */ @@ -56,6 +130,274 @@ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_8WAY INPUT_PORTS_END +/* + 8048 Ports: + + P1 Bit 0..1 - RAM bank select + Bit 3..7 - Keypad input + + P2 Bit 0..3 - A8-A11 + Bit 4..7 - Sound control/Video write address + + T1 Mirror sync pulse +*/ + +/* Machine Initialization */ + +void advision_state::machine_start() +{ + std::string region_tag; + m_cart_rom = memregion(region_tag.assign(m_cart->tag()).append(GENERIC_ROM_REGION_TAG).c_str()); + + /* configure EA banking */ + m_bank1->configure_entry(0, memregion(I8048_TAG)->base()); + if (m_cart_rom) + m_bank1->configure_entry(1, m_cart_rom->base()); + m_maincpu->space(AS_PROGRAM).install_readwrite_bank(0x0000, 0x03ff, m_bank1); + m_bank1->set_entry(0); + + m_sound_d = 0; + m_sound_g = 0; + + m_video_hpos = 0; + m_display = std::make_unique(8 * 8 * 256); + std::fill_n(m_display.get(), 8 * 8 * 256, 0); + + /* allocate external RAM */ + m_ext_ram.resize(0x400); + save_item(NAME(m_ext_ram)); + + save_item(NAME(m_ea_bank)); + save_item(NAME(m_rambank)); + save_item(NAME(m_frame_count)); + save_item(NAME(m_frame_start)); + save_item(NAME(m_video_enable)); + save_item(NAME(m_video_bank)); + save_item(NAME(m_led_latch)); + save_item(NAME(m_sound_cmd)); + save_item(NAME(m_sound_d)); + save_item(NAME(m_sound_g)); + save_pointer(NAME(m_display), 8 * 8 * 256); + save_item(NAME(m_video_hpos)); +} + +void advision_state::machine_reset() +{ + m_ea_bank = 1; + m_rambank = 0x300; + m_frame_start = 0; + m_video_enable = 0; + m_sound_cmd = 0; + + /* enable internal ROM */ + m_maincpu->set_input_line(MCS48_INPUT_EA, CLEAR_LINE); + if (m_cart_rom) + m_bank1->set_entry(m_ea_bank); + + /* reset sound CPU */ + m_soundcpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); +} + +/* Bank Switching */ + +void advision_state::bankswitch_w(uint8_t data) +{ + m_ea_bank = BIT(data, 2); + m_rambank = (data & 0x03) << 8; + + m_maincpu->set_input_line(MCS48_INPUT_EA, m_ea_bank ? ASSERT_LINE : CLEAR_LINE); + if (m_cart_rom) + m_bank1->set_entry(m_ea_bank); +} + +/* External RAM */ + +uint8_t advision_state::ext_ram_r(offs_t offset) +{ + uint8_t data = m_ext_ram[m_rambank + offset]; + + /* the video hardware interprets reads as writes */ + vh_write(data); + + if (m_video_bank == 0x06) + { + m_soundcpu->set_input_line(INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE); + } + + return data; +} + +void advision_state::ext_ram_w(offs_t offset, uint8_t data) +{ + m_ext_ram[m_rambank + offset] = data; +} + +/* Sound */ + +TIMER_CALLBACK_MEMBER( advision_state::sound_cmd_sync ) +{ + m_sound_cmd = param; +} + +uint8_t advision_state::sound_cmd_r() +{ + return m_sound_cmd; +} + +void advision_state::update_dac() +{ + int translate[] = { 2, 0, 0, 1 }; + m_dac->write(translate[(m_sound_g << 1) | m_sound_d]); +} + +void advision_state::sound_g_w(uint8_t data) +{ + m_sound_g = data & 0x01; + + update_dac(); +} + +void advision_state::sound_d_w(uint8_t data) +{ + m_sound_d = data & 0x01; + + update_dac(); +} + +/* Video */ + +void advision_state::av_control_w(uint8_t data) +{ + machine().scheduler().synchronize(timer_expired_delegate(FUNC(advision_state::sound_cmd_sync), this), data >> 4); + + if ((m_video_enable == 0x00) && (data & 0x10)) + { + vh_update(m_video_hpos); + + m_video_hpos++; + + if (m_video_hpos > 255) + { + m_video_hpos = 0; + logerror("HPOS OVERFLOW\n"); + } + } + + m_video_enable = data & 0x10; + m_video_bank = (data & 0xe0) >> 5; +} + +READ_LINE_MEMBER( advision_state::vsync_r ) +{ + if (m_frame_start) + { + m_frame_start = 0; + + return 0; + } + else + { + return 1; + } +} + +/* Input */ + +uint8_t advision_state::controller_r() +{ + // Get joystick switches + uint8_t in = m_joy->read(); + uint8_t data = in | 0x0f; + + // Get buttons + if (in & 0x02) data = data & 0xf7; /* Button 3 */ + if (in & 0x08) data = data & 0xcf; /* Button 1 */ + if (in & 0x04) data = data & 0xaf; /* Button 2 */ + if (in & 0x01) data = data & 0x6f; /* Button 4 */ + + data &= 0xf8; + data |= (m_ea_bank << 2); + data |= (m_rambank >> 8); + return data; +} + + +/*************************************************************************** + + Initialise the palette. + +***************************************************************************/ + +void advision_state::advision_palette(palette_device &palette) const +{ + // 8 shades of RED + for (int i = 0; i < 8; i++) + m_palette->set_pen_color(i, pal3bit(i), 0x00, 0x00); +} + +/*************************************************************************** + + Update the display data. + +***************************************************************************/ + +void advision_state::vh_write(int data) +{ + if (m_video_bank >= 1 && m_video_bank <=5) + m_led_latch[m_video_bank] = data; +} + +void advision_state::vh_update(int x) +{ + uint8_t *dst = &m_display[x]; + + for (int y = 0; y < 8; y++) + { + uint8_t data = m_led_latch[7 - y]; + + for (int i = 0; i < 8; i++) + { + if (!BIT(data, 7 - i)) + dst[i * 256] = 8; + } + + m_led_latch[7 - y] = 0xff; + dst += 8 * 256; + } +} + + +/*************************************************************************** + + Refresh the video screen + +***************************************************************************/ + +uint32_t advision_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + if ((m_frame_count++ % 4) == 0) + { + m_frame_start = 1; + m_video_hpos = 0; + } + + for (int x = 0; x < 150; x++) + { + uint8_t *led = &m_display[x]; + + for (int y = 0; y < 128; y+=2) + { + if (*led > 0) + bitmap.pix(30 + y, 85 + x) = --(*led); + else + bitmap.pix(30 + y, 85 + x) = 0; + + led += 256; + } + } + return 0; +} + /* Machine Driver */ void advision_state::advision(machine_config &config) @@ -76,7 +418,7 @@ m_soundcpu->write_d().set(FUNC(advision_state::sound_d_w)); /* video hardware */ - screen_device &screen(SCREEN(config, SCREEN_TAG, SCREEN_TYPE_RASTER)); + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(4*15); screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ screen.set_screen_update(FUNC(advision_state::screen_update)); @@ -107,7 +449,7 @@ ROM_LOAD( "b8223__cop411l-kcn_n.u8", 0x000, 0x200, CRC(81e95975) SHA1(8b6f8c30dd3e9d8e43f1ea20fba2361b383790eb) ) // " /B8223 \\ COP411L-KCN/N" ROM_END -/* Game Driver */ +} // Anonymous namespace /* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ CONS( 1982, advision, 0, 0, advision, advision, advision_state, empty_init, "Entex", "Adventure Vision", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/aerofgt.cpp mame-0.243+dfsg.1/src/mame/drivers/aerofgt.cpp --- mame-0.242+dfsg.1/src/mame/drivers/aerofgt.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/aerofgt.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1311,18 +1311,6 @@ 128*8 }; -static const gfx_layout spikes91_spritelayout = -{ - 16,16, - RGN_FRAC(1,4), - 4, - { RGN_FRAC(3,4), RGN_FRAC(2,4), RGN_FRAC(1,4), RGN_FRAC(0,4) }, - { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 }, - { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16, - 8*16, 9*16, 10*16, 11*16, 12*16, 13*16, 14*16, 15*16 }, - 16*16 -}; - static const gfx_layout aerfboot_spritelayout = @@ -1390,7 +1378,7 @@ static GFXDECODE_START( gfx_spikes91 ) GFXDECODE_ENTRY( "gfx1", 0, pspikesb_charlayout, 0, 64 ) /* colors 0-1023 in 8 banks */ - GFXDECODE_ENTRY( "gfx2", 0, spikes91_spritelayout, 1024, 64 ) /* colors 1024-2047 in 4 banks */ + GFXDECODE_ENTRY( "gfx2", 0, gfx_16x16x4_planar, 1024, 64 ) /* colors 1024-2047 in 4 banks */ GFXDECODE_END static GFXDECODE_START( gfx_kickball ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/ajax.cpp mame-0.243+dfsg.1/src/mame/drivers/ajax.cpp --- mame-0.242+dfsg.1/src/mame/drivers/ajax.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/ajax.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -13,50 +13,433 @@ ***************************************************************************/ #include "emu.h" -#include "includes/ajax.h" + #include "includes/konamipt.h" +#include "video/k051316.h" +#include "video/k051960.h" +#include "video/k052109.h" +#include "video/konami_helper.h" -#include "cpu/z80/z80.h" #include "cpu/m6809/hd6309.h" #include "cpu/m6809/konami.h" +#include "cpu/z80/z80.h" +#include "machine/gen_latch.h" +#include "machine/watchdog.h" +#include "sound/k007232.h" #include "sound/ymopm.h" + +#include "emupal.h" #include "speaker.h" -void ajax_state::ajax_main_map(address_map &map) +// configurable logging +#define LOG_LS138 (1U << 1) + +//#define VERBOSE (LOG_GENERAL | LOG_LS138) + +#include "logmacro.h" + +#define LOGLS138(...) LOGMASKED(LOG_LS138, __VA_ARGS__) + + +namespace { + +class ajax_state : public driver_device +{ +public: + ajax_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_subcpu(*this, "sub"), + m_watchdog(*this, "watchdog"), + m_k007232(*this, "k007232_%u", 1U), + m_k052109(*this, "k052109"), + m_k051960(*this, "k051960"), + m_k051316(*this, "k051316"), + m_palette(*this, "palette"), + m_soundlatch(*this, "soundlatch"), + m_mainbank(*this, "mainbank"), + m_subbank(*this, "subbank"), + m_system(*this, "SYSTEM"), + m_pl(*this, "P%u", 1U), + m_dsw(*this, "DSW%u", 1U), + m_lamps(*this, "lamp%u", 0U) + { } + + void ajax(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + +private: + // devices + required_device m_maincpu; + required_device m_audiocpu; + required_device m_subcpu; + required_device m_watchdog; + required_device_array m_k007232; + required_device m_k052109; + required_device m_k051960; + required_device m_k051316; + required_device m_palette; + required_device m_soundlatch; + + required_memory_bank m_mainbank; + required_memory_bank m_subbank; + + required_ioport m_system; + required_ioport_array<2> m_pl; + required_ioport_array<3> m_dsw; + output_finder<8> m_lamps; + + // video-related + uint8_t m_priority = 0U; + + // misc + uint8_t m_firq_enable = 0; + + void sound_bank_w(uint8_t data); + uint8_t ls138_f10_r(offs_t offset); + void ls138_f10_w(offs_t offset, uint8_t data); + void sub_bankswitch_w(uint8_t data); + void main_bankswitch_w(uint8_t data); + void lamps_w(uint8_t data); + void k007232_extvol_w(uint8_t data); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void volume_callback0(uint8_t data); + void volume_callback1(uint8_t data); + K051316_CB_MEMBER(zoom_callback); + K052109_CB_MEMBER(tile_callback); + K051960_CB_MEMBER(sprite_callback); + + void main_map(address_map &map); + void sound_map(address_map &map); + void sub_map(address_map &map); +}; + + +// video + +/*************************************************************************** + + Callbacks for the K052109 + +***************************************************************************/ + +K052109_CB_MEMBER(ajax_state::tile_callback) +{ + static const int layer_colorbase[] = { 1024 / 16, 0 / 16, 512 / 16 }; + + *code |= ((*color & 0x0f) << 8) | (bank << 12); + *color = layer_colorbase[layer] + ((*color & 0xf0) >> 4); +} + + +/*************************************************************************** + + Callbacks for the K051960 + +***************************************************************************/ + +K051960_CB_MEMBER(ajax_state::sprite_callback) +{ + enum { sprite_colorbase = 256 / 16 }; + + /* priority bits: + 4 over zoom (0 = have priority) + 5 over B (0 = have priority) + 6 over A (1 = have priority) + never over F + */ + *priority = 0; + if ( *color & 0x10) *priority |= GFX_PMASK_4; // Z = 4 + if (~*color & 0x40) *priority |= GFX_PMASK_2; // A = 2 + if ( *color & 0x20) *priority |= GFX_PMASK_1; // B = 1 + *color = sprite_colorbase + (*color & 0x0f); +} + + +/*************************************************************************** + + Callbacks for the K051316 + +***************************************************************************/ + +K051316_CB_MEMBER(ajax_state::zoom_callback) +{ + enum { zoom_colorbase = 768 / 128 }; + + *code |= ((*color & 0x07) << 8); + *color = zoom_colorbase + ((*color & 0x08) >> 3); +} + + +/*************************************************************************** + + Display Refresh + +***************************************************************************/ + +uint32_t ajax_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + m_k052109->tilemap_update(); + + screen.priority().fill(0, cliprect); + + bitmap.fill(m_palette->black_pen(), cliprect); + m_k052109->tilemap_draw(screen, bitmap, cliprect, 2, 0, 1); + if (m_priority) + { + // basic layer order is B, zoom, A, F + m_k051316->zoom_draw(screen, bitmap, cliprect, 0, 4); + m_k052109->tilemap_draw(screen, bitmap, cliprect, 1, 0, 2); + } + else + { + // basic layer order is B, A, zoom, F + m_k052109->tilemap_draw(screen, bitmap, cliprect, 1, 0, 2); + m_k051316->zoom_draw(screen, bitmap, cliprect, 0, 4); + } + m_k051960->k051960_sprites_draw(bitmap, cliprect, screen.priority(), -1, -1); + m_k052109->tilemap_draw(screen, bitmap, cliprect, 0, 0, 0); + return 0; +} + + +// machine + +/* main_bankswitch_w: + Handled by the LS273 Octal +ve edge trigger D-type Flip-flop with Reset at H11: + + Bit Description + --- ----------- + 7 MRB3 Selects ROM N11/N12 + 6 CCOUNT2 Coin Counter 2 (*) + 5 CCOUNT1 Coin Counter 1 (*) + 4 SRESET Slave CPU Reset? + 3 PRI0 Layer Priority Selector + 2 MRB2 \ + 1 MRB1 | ROM Bank Select + 0 MRB0 / + + (*) The Coin Counters are handled by the Konami Custom 051550 +*/ + +void ajax_state::main_bankswitch_w(uint8_t data) +{ + int bank = 0; + + // ROM select + if (!(data & 0x80)) + bank += 4; + + // coin counters + machine().bookkeeping().coin_counter_w(0, data & 0x20); + machine().bookkeeping().coin_counter_w(1, data & 0x40); + + // priority + m_priority = data & 0x08; + + // bank # (ROMS N11 and N12) + bank += (data & 0x07); + m_mainbank->set_entry(bank); +} + +/* lamps_w: + Handled by the LS273 Octal +ve edge trigger D-type Flip-flop with Reset at B9: + + Bit Description + --- ----------- + 7 LAMP7 & LAMP8 - Game over lamps (*) + 6 LAMP3 & LAMP4 - Game over lamps (*) + 5 LAMP1 - Start lamp (*) + 4 Control panel quaking (**) + 3 Joystick vibration (**) + 2 LAMP5 & LAMP6 - Power up lamps (*) + 1 LAMP2 - Super weapon lamp (*) + 0 unused + + (*) The Lamps are handled by the M54585P + (**)Vibration/Quaking handled by these chips: + Chip Location Description + ---- -------- ----------- + PS2401-4 B21 ??? + UPA1452H B22 ??? + LS74 H2 Dual +ve edge trigger D-type Flip-flop with SET and RESET + LS393 C20 Dual -ve edge trigger 4-bit Binary Ripple Counter with Resets +*/ + +void ajax_state::lamps_w(uint8_t data) +{ + m_lamps[1] = BIT(data, 1); // super weapon lamp + m_lamps[2] = BIT(data, 2); // power up lamps + m_lamps[5] = BIT(data, 2); // power up lamps + m_lamps[0] = BIT(data, 5); // start lamp + m_lamps[3] = BIT(data, 6); // game over lamps + m_lamps[6] = BIT(data, 6); // game over lamps + m_lamps[4] = BIT(data, 7); // game over lamps + m_lamps[7] = BIT(data, 7); // game over lamps +} + +/* ajax_ls138_f10: + The LS138 1-of-8 Decoder/Demultiplexer at F10 selects what to do: + + Address R/W Description + ------- --- ----------- + 0x0000 (r) ??? I think this read is because a CPU core bug + (w) 0x0000 NSFIRQ Trigger FIRQ on the M6809 + 0x0020 AFR Watchdog reset (handled by the 051550) + 0x0040 (w) SOUND Cause interrupt on the Z80 + 0x0080 (w) SOUNDDATA Sound code number + 0x00c0 (w) MBL1 Enables the LS273 at H11 (Banking + Coin counters) + 0x0100 (r) MBL2 Enables 2P Inputs reading + 0x0140 (w) MBL3 Enables the LS273 at B9 (Lamps + Vibration) + 0x0180 (r) MIO1 Enables 1P Inputs + DIPSW #1 & #2 reading + 0x01c0 (r) MIO2 Enables DIPSW #3 reading +*/ + +uint8_t ajax_state::ls138_f10_r(offs_t offset) +{ + int data = 0, index; + + switch ((offset & 0x01c0) >> 6) + { + case 0x00: // ??? + data = machine().rand(); + break; + case 0x04: // 2P inputs + data = m_pl[1]->read(); + break; + case 0x06: // 1P inputs + DIPSW #1 & #2 + index = offset & 0x01; + data = (offset & 0x02) ? m_dsw[index]->read() : index ? m_pl[0]->read() : m_system->read(); + break; + case 0x07: // DIPSW #3 + data = m_dsw[2]->read(); + break; + + default: + LOGLS138("%04x: (ls138_f10) read from an unknown address %02x\n", m_maincpu->pc(), offset); + } + + return data; +} + +void ajax_state::ls138_f10_w(offs_t offset, uint8_t data) +{ + switch ((offset & 0x01c0) >> 6) + { + case 0x00: // NSFIRQ + AFR + if (offset) + m_watchdog->watchdog_reset(); + else{ + if (m_firq_enable) // Cause interrupt on slave CPU + m_subcpu->set_input_line(M6809_FIRQ_LINE, HOLD_LINE); + } + break; + case 0x01: // Cause interrupt on audio CPU + m_audiocpu->set_input_line(0, HOLD_LINE); + break; + case 0x02: // Sound command number + m_soundlatch->write(data); + break; + case 0x03: // Bankswitch + coin counters + priority + main_bankswitch_w(data); + break; + case 0x05: // Lamps + Joystick vibration + Control panel quaking + lamps_w(data); + break; + + default: + LOGLS138("%04x: (ls138_f10) write %02x to an unknown address %02x\n", m_maincpu->pc(), data, offset); + } +} + +/* sub_bankswitch_w: + Handled by the LS273 Octal +ve edge trigger D-type Flip-flop with Reset at K14: + + Bit Description + --- ----------- + 7 unused + 6 RMRD Enable char ROM reading through the video RAM + 5 RVO enables 051316 wraparound + 4 FIRQST FIRQ control + 3 SRB3 \ + 2 SRB2 | + 1 SRB1 | ROM Bank Select + 0 SRB0 / +*/ + +void ajax_state::sub_bankswitch_w(uint8_t data) +{ + // enable char ROM reading through the video RAM + m_k052109->set_rmrd_line((data & 0x40) ? ASSERT_LINE : CLEAR_LINE); + + // bit 5 enables 051316 wraparound + m_k051316->wraparound_enable(data & 0x20); + + // FIRQ control + m_firq_enable = data & 0x10; + + // bank # (ROMS G16 and I16) + m_subbank->set_entry(data & 0x0f); +} + +void ajax_state::machine_start() { - map(0x0000, 0x01c0).rw(FUNC(ajax_state::ls138_f10_r), FUNC(ajax_state::ls138_f10_w)); /* bankswitch + sound command + FIRQ command */ - map(0x0800, 0x0807).rw(m_k051960, FUNC(k051960_device::k051937_r), FUNC(k051960_device::k051937_w)); /* sprite control registers */ - map(0x0c00, 0x0fff).rw(m_k051960, FUNC(k051960_device::k051960_r), FUNC(k051960_device::k051960_w)); /* sprite RAM 2128SL at J7 */ - map(0x1000, 0x1fff).ram().w(m_palette, FUNC(palette_device::write8)).share("palette");/* palette */ - map(0x2000, 0x3fff).ram().share("share1"); /* shared RAM with the 6809 */ - map(0x4000, 0x5fff).ram(); /* RAM 6264L at K10 */ - map(0x6000, 0x7fff).bankr("mainbank"); /* banked ROM */ - map(0x8000, 0xffff).rom(); /* ROM N11 */ -} - -void ajax_state::ajax_sub_map(address_map &map) -{ - map(0x0000, 0x07ff).rw(m_k051316, FUNC(k051316_device::read), FUNC(k051316_device::write)); /* 051316 zoom/rotation layer */ - map(0x0800, 0x080f).w(m_k051316, FUNC(k051316_device::ctrl_w)); /* 051316 control registers */ - map(0x1000, 0x17ff).r(m_k051316, FUNC(k051316_device::rom_r)); /* 051316 (ROM test) */ - map(0x1800, 0x1800).w(FUNC(ajax_state::bankswitch_2_w)); /* bankswitch control */ - map(0x2000, 0x3fff).ram().share("share1"); /* shared RAM with the 052001 */ - map(0x4000, 0x7fff).rw(m_k052109, FUNC(k052109_device::read), FUNC(k052109_device::write)); /* video RAM + color RAM + video registers */ - map(0x8000, 0x9fff).bankr("subbank"); /* banked ROM */ - map(0xa000, 0xffff).rom().region("sub", 0x12000); /* ROM I16 */ -} - -void ajax_state::ajax_sound_map(address_map &map) -{ - map(0x0000, 0x7fff).rom(); /* ROM F6 */ - map(0x8000, 0x87ff).ram(); /* RAM 2128SL at D16 */ - map(0x9000, 0x9000).w(FUNC(ajax_state::sound_bank_w)); /* 007232 bankswitch */ - map(0xa000, 0xa00d).rw(m_k007232_1, FUNC(k007232_device::read), FUNC(k007232_device::write)); /* 007232 registers (chip 1) */ - map(0xb000, 0xb00d).rw(m_k007232_2, FUNC(k007232_device::read), FUNC(k007232_device::write)); /* 007232 registers (chip 2) */ - map(0xb80c, 0xb80c).w(FUNC(ajax_state::k007232_extvol_w)); /* extra volume, goes to the 007232 w/ A11 */ - /* selecting a different latch for the external port */ - map(0xc000, 0xc001).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)); /* YM2151 */ + uint8_t *main = memregion("maincpu")->base(); + uint8_t *sub = memregion("sub")->base(); + + m_lamps.resolve(); + m_mainbank->configure_entries(0, 4, &main[0x00000], 0x2000); + m_mainbank->configure_entries(4, 8, &main[0x10000], 0x2000); + m_subbank->configure_entries(0, 9, &sub[0x00000], 0x2000); + + save_item(NAME(m_priority)); + save_item(NAME(m_firq_enable)); +} + +void ajax_state::machine_reset() +{ + m_priority = 0; + m_firq_enable = 0; +} + +void ajax_state::main_map(address_map &map) +{ + map(0x0000, 0x01c0).rw(FUNC(ajax_state::ls138_f10_r), FUNC(ajax_state::ls138_f10_w)); // bankswitch + sound command + FIRQ command + map(0x0800, 0x0807).rw(m_k051960, FUNC(k051960_device::k051937_r), FUNC(k051960_device::k051937_w)); // sprite control registers + map(0x0c00, 0x0fff).rw(m_k051960, FUNC(k051960_device::k051960_r), FUNC(k051960_device::k051960_w)); // sprite RAM 2128SL at J7 + map(0x1000, 0x1fff).ram().w(m_palette, FUNC(palette_device::write8)).share("palette"); + map(0x2000, 0x3fff).ram().share("main_sub_ram"); // shared RAM with the 6809 + map(0x4000, 0x5fff).ram(); // RAM 6264L at K10 + map(0x6000, 0x7fff).bankr(m_mainbank); // banked ROM + map(0x8000, 0xffff).rom(); // ROM N11 +} + +void ajax_state::sub_map(address_map &map) +{ + map(0x0000, 0x07ff).rw(m_k051316, FUNC(k051316_device::read), FUNC(k051316_device::write)); // 051316 zoom/rotation layer + map(0x0800, 0x080f).w(m_k051316, FUNC(k051316_device::ctrl_w)); // 051316 control registers + map(0x1000, 0x17ff).r(m_k051316, FUNC(k051316_device::rom_r)); // 051316 (ROM test) + map(0x1800, 0x1800).w(FUNC(ajax_state::sub_bankswitch_w)); // bankswitch control + map(0x2000, 0x3fff).ram().share("main_sub_ram"); // shared RAM with the 052001 + map(0x4000, 0x7fff).rw(m_k052109, FUNC(k052109_device::read), FUNC(k052109_device::write)); // video RAM + color RAM + video registers + map(0x8000, 0x9fff).bankr(m_subbank); // banked ROM + map(0xa000, 0xffff).rom().region("sub", 0x12000); // ROM I16 +} + +void ajax_state::sound_map(address_map &map) +{ + map(0x0000, 0x7fff).rom(); // ROM F6 + map(0x8000, 0x87ff).ram(); // RAM 2128SL at D16 + map(0x9000, 0x9000).w(FUNC(ajax_state::sound_bank_w)); // 007232 bankswitch + map(0xa000, 0xa00d).rw(m_k007232[0], FUNC(k007232_device::read), FUNC(k007232_device::write)); + map(0xb000, 0xb00d).rw(m_k007232[1], FUNC(k007232_device::read), FUNC(k007232_device::write)); + map(0xb80c, 0xb80c).w(FUNC(ajax_state::k007232_extvol_w)); // extra volume, goes to the 007232 w/ A11 selecting a different latch for the external port + map(0xc000, 0xc001).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)); // YM2151 map(0xe000, 0xe000).r(m_soundlatch, FUNC(generic_latch_8_device::read)); } @@ -64,7 +447,7 @@ static INPUT_PORTS_START( ajax ) PORT_START("DSW1") KONAMI_COINAGE_LOC(DEF_STR( Free_Play ), "No Coin B", SW1) - /* "No Coin B" = coins produce sound, but no effect on coin counter */ + // "No Coin B" = coins produce sound, but no effect on coin counter PORT_START("DSW2") PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:1,2") @@ -102,10 +485,10 @@ PORT_DIPSETTING( 0x00, "Inverted" ) PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("SYSTEM") /* COINSW & START */ + PORT_START("SYSTEM") // COINSW & START PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 ) /* service */ + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 ) // service PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -138,57 +521,55 @@ void ajax_state::sound_bank_w(uint8_t data) { - int bank_A, bank_B; - - /* banks # for the 007232 (chip 1) */ - bank_A = BIT(data, 1); - bank_B = BIT(data, 0); - m_k007232_1->set_bank(bank_A, bank_B); + // banks # for the 007232 (chip 1) + int bank_A = BIT(data, 1); + int bank_B = BIT(data, 0); + m_k007232[0]->set_bank(bank_A, bank_B); - /* banks # for the 007232 (chip 2) */ + // banks # for the 007232 (chip 2) bank_A = ((data >> 4) & 0x03); bank_B = ((data >> 2) & 0x03); - m_k007232_2->set_bank(bank_A, bank_B); + m_k007232[1]->set_bank(bank_A, bank_B); } void ajax_state::volume_callback0(uint8_t data) { - m_k007232_1->set_volume(0, (data >> 4) * 0x11, 0); - m_k007232_1->set_volume(1, 0, (data & 0x0f) * 0x11); + m_k007232[0]->set_volume(0, (data >> 4) * 0x11, 0); + m_k007232[0]->set_volume(1, 0, (data & 0x0f) * 0x11); } void ajax_state::k007232_extvol_w(uint8_t data) { - /* channel A volume (mono) */ - m_k007232_2->set_volume(0, (data & 0x0f) * 0x11/2, (data & 0x0f) * 0x11/2); + // channel A volume (mono) + m_k007232[1]->set_volume(0, (data & 0x0f) * 0x11 / 2, (data & 0x0f) * 0x11 / 2); } void ajax_state::volume_callback1(uint8_t data) { - /* channel B volume/pan */ - m_k007232_2->set_volume(1, (data & 0x0f) * 0x11/2, (data >> 4) * 0x11/2); + // channel B volume/pan + m_k007232[1]->set_volume(1, (data & 0x0f) * 0x11 / 2, (data >> 4) * 0x11 / 2); } void ajax_state::ajax(machine_config &config) { - /* basic machine hardware */ - KONAMI(config, m_maincpu, XTAL(24'000'000)/2/4); /* 052001 12/4 MHz*/ - m_maincpu->set_addrmap(AS_PROGRAM, &ajax_state::ajax_main_map); + // basic machine hardware + KONAMI(config, m_maincpu, XTAL(24'000'000) / 2 / 4); // 052001 12/4 MHz + m_maincpu->set_addrmap(AS_PROGRAM, &ajax_state::main_map); - HD6309E(config, m_subcpu, 3000000); /* ? */ - m_subcpu->set_addrmap(AS_PROGRAM, &ajax_state::ajax_sub_map); + HD6309E(config, m_subcpu, 3000000); // ? + m_subcpu->set_addrmap(AS_PROGRAM, &ajax_state::sub_map); - Z80(config, m_audiocpu, 3579545); /* 3.58 MHz */ - m_audiocpu->set_addrmap(AS_PROGRAM, &ajax_state::ajax_sound_map); + Z80(config, m_audiocpu, 3579545); // 3.58 MHz + m_audiocpu->set_addrmap(AS_PROGRAM, &ajax_state::sound_map); config.set_maximum_quantum(attotime::from_hz(600)); WATCHDOG_TIMER(config, m_watchdog); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); - screen.set_raw(XTAL(24'000'000)/3, 528, 108, 412, 256, 16, 240); + screen.set_raw(XTAL(24'000'000) / 3, 528, 108, 412, 256, 16, 240); // 6MHz dotclock is more realistic, however needs drawing updates. replace when ready // screen.set_raw(XTAL(24'000'000)/4, 396, hbend, hbstart, 256, 16, 240); screen.set_screen_update(FUNC(ajax_state::screen_update)); @@ -214,7 +595,7 @@ m_k051316->set_bpp(7); m_k051316->set_zoom_callback(FUNC(ajax_state::zoom_callback)); - /* sound hardware */ + // sound hardware SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); @@ -222,23 +603,23 @@ YM2151(config, "ymsnd", 3579545).add_route(0, "lspeaker", 1.0).add_route(1, "rspeaker", 1.0); - K007232(config, m_k007232_1, 3579545); - m_k007232_1->port_write().set(FUNC(ajax_state::volume_callback0)); - m_k007232_1->add_route(0, "lspeaker", 0.20); - m_k007232_1->add_route(0, "rspeaker", 0.20); - m_k007232_1->add_route(1, "lspeaker", 0.20); - m_k007232_1->add_route(1, "rspeaker", 0.20); - - K007232(config, m_k007232_2, 3579545); - m_k007232_2->port_write().set(FUNC(ajax_state::volume_callback1)); - m_k007232_2->add_route(0, "lspeaker", 0.50); - m_k007232_2->add_route(1, "rspeaker", 0.50); + K007232(config, m_k007232[0], 3579545); + m_k007232[0]->port_write().set(FUNC(ajax_state::volume_callback0)); + m_k007232[0]->add_route(0, "lspeaker", 0.20); + m_k007232[0]->add_route(0, "rspeaker", 0.20); + m_k007232[0]->add_route(1, "lspeaker", 0.20); + m_k007232[0]->add_route(1, "rspeaker", 0.20); + + K007232(config, m_k007232[1], 3579545); + m_k007232[1]->port_write().set(FUNC(ajax_state::volume_callback1)); + m_k007232[1]->add_route(0, "lspeaker", 0.50); + m_k007232[1]->add_route(1, "rspeaker", 0.50); } /* - This set is using 27512 Roms on a sub-board instead of Mask roms + This set is using 27512 ROMs on a sub-board instead of Mask ROMs -- info from Phil Morris These are normally on the main board in the form of large mask ROMs, but at one stage @@ -248,18 +629,18 @@ */ ROM_START( ajax ) - ROM_REGION( 0x20000, "maincpu", 0 ) /* 052001 code */ - ROM_LOAD( "770_m01.n11", 0x00000, 0x10000, CRC(4a64e53a) SHA1(acd249bfcb5f248c41b3e40c7c1bce1b8c645d3a) ) /* last 0x8000 fixed, first 0x8000 banked */ - ROM_LOAD( "770_l02.n12", 0x10000, 0x10000, CRC(ad7d592b) SHA1(c75d9696b16de231c479379dd02d33fe54021d88) ) /* banked ROM */ - - ROM_REGION( 0x18000, "sub", 0 ) /* 96k */ - ROM_LOAD( "770_f04.g16", 0x00000, 0x10000, CRC(e0e4ec9c) SHA1(15ae09c3ad67ec626d8178ec1417f0c57ca4eca4) ) /* banked ROM */ - ROM_LOAD( "770_l05.i16", 0x10000, 0x08000, CRC(ed64fbb2) SHA1(429046edaf1299afa7fb9c385b4ef0c244ec2409) ) /* last 0x6000 fixed, first 0x2000 banked */ + ROM_REGION( 0x20000, "maincpu", 0 ) // 052001 code + ROM_LOAD( "770_m01.n11", 0x00000, 0x10000, CRC(4a64e53a) SHA1(acd249bfcb5f248c41b3e40c7c1bce1b8c645d3a) ) // last 0x8000 fixed, first 0x8000 banked + ROM_LOAD( "770_l02.n12", 0x10000, 0x10000, CRC(ad7d592b) SHA1(c75d9696b16de231c479379dd02d33fe54021d88) ) // banked ROM + + ROM_REGION( 0x18000, "sub", 0 ) + ROM_LOAD( "770_f04.g16", 0x00000, 0x10000, CRC(e0e4ec9c) SHA1(15ae09c3ad67ec626d8178ec1417f0c57ca4eca4) ) // banked ROM + ROM_LOAD( "770_l05.i16", 0x10000, 0x08000, CRC(ed64fbb2) SHA1(429046edaf1299afa7fb9c385b4ef0c244ec2409) ) // last 0x6000 fixed, first 0x2000 banked - ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the SOUND CPU */ + ROM_REGION( 0x08000, "audiocpu", 0 ) ROM_LOAD( "770_h03.f16", 0x00000, 0x08000, CRC(2ffd2afc) SHA1(ca2ef684f87bcf9b70b3ec66ec80685edaf04b9b) ) - ROM_REGION( 0x080000, "k052109", 0 ) /* tiles */ + ROM_REGION( 0x080000, "k052109", 0 ) // tiles ROM_LOAD32_BYTE( "770c13-a.f3", 0x000000, 0x010000, CRC(4ef6fff2) SHA1(0a2953f6907738b795d96184329431539386a463) ) ROM_LOAD32_BYTE( "770c13-c.f4", 0x000001, 0x010000, CRC(97ffbab6) SHA1(97d9a39600eed918e12908a9abed0d4161c20ef6) ) ROM_LOAD32_BYTE( "770c12-a.f5", 0x000002, 0x010000, CRC(6c0ade68) SHA1(35e4548a37e19210c767ef2ed4c514dbde6806c2) ) @@ -269,7 +650,7 @@ ROM_LOAD32_BYTE( "770c12-b.e5", 0x040002, 0x010000, CRC(5f221cc6) SHA1(9a7a9c7853a3b582c4034b773cef08aee5391d6e) ) ROM_LOAD32_BYTE( "770c12-d.e6", 0x040003, 0x010000, CRC(f1edb2f4) SHA1(3e66cc711e25cbf6e6a747d43a9efec0710d5b7a) ) - ROM_REGION( 0x100000, "k051960", 0 ) /* sprites */ + ROM_REGION( 0x100000, "k051960", 0 ) // sprites ROM_LOAD32_BYTE( "770c09-a.f8", 0x000000, 0x010000, CRC(76690fb8) SHA1(afe267a37b65d63d3765dc3b88d8a8262446f786) ) ROM_LOAD32_BYTE( "770c09-e.f9", 0x000001, 0x010000, CRC(17b482c9) SHA1(3535197956f5bf5b564fec1ddbb3e3ea3bf1f7bd) ) ROM_LOAD32_BYTE( "770c08-a.f10", 0x000002, 0x010000, CRC(efd29a56) SHA1(2a9f138d1242a35162a3f092b0343dff899e3b83) ) @@ -287,20 +668,20 @@ ROM_LOAD32_BYTE( "770c08-d.c10", 0x0c0002, 0x010000, CRC(91591777) SHA1(53f416a51f7075f070168bced7b6f925f54c7b84) ) ROM_LOAD32_BYTE( "770c08-h.c11", 0x0c0003, 0x010000, CRC(d97d4b15) SHA1(e3d7d7adeec8c8c808acb9f84641fd3a6bf249be) ) - ROM_REGION( 0x080000, "k051316", 0 ) /* zoom/rotate */ + ROM_REGION( 0x080000, "k051316", 0 ) // zoom/rotate ROM_LOAD( "770c06.f4", 0x000000, 0x040000, CRC(d0c592ee) SHA1(c1be73dd259f2779d715659b177e47513776a0d4) ) ROM_LOAD( "770c07.h4", 0x040000, 0x040000, CRC(0b399fb1) SHA1(fbe26f9aa9a655d08bebcdd79719d35134ca4dd5) ) ROM_REGION( 0x0200, "proms", 0 ) - ROM_LOAD( "63s241.j11", 0x0000, 0x0200, CRC(9bdd719f) SHA1(de98e562080a97714047a8ad17abc6662c188897) ) /* priority encoder (not used) */ + ROM_LOAD( "63s241.j11", 0x0000, 0x0200, CRC(9bdd719f) SHA1(de98e562080a97714047a8ad17abc6662c188897) ) // priority encoder (not used) - ROM_REGION( 0x040000, "k007232_1", 0 ) /* 007232 data (chip 1) */ + ROM_REGION( 0x040000, "k007232_1", 0 ) ROM_LOAD( "770c10-a.a7", 0x000000, 0x010000, CRC(e45ec094) SHA1(540c56e1d778e6082db23aa3da64f6179b1f3635) ) ROM_LOAD( "770c10-b.a6", 0x010000, 0x010000, CRC(349db7d3) SHA1(210da067038abeb021a77b3bf2664c9a49b3410a) ) ROM_LOAD( "770c10-c.a5", 0x020000, 0x010000, CRC(71cb1f05) SHA1(57399806746b659f52114fb7bd4e11a7992a2c5d) ) ROM_LOAD( "770c10-d.a4", 0x030000, 0x010000, CRC(e8ab1844) SHA1(dc22c4d11d6396a051398ba9ec6380aa3f856e71) ) - ROM_REGION( 0x080000, "k007232_2", 0 ) /* 007232 data (chip 2) */ + ROM_REGION( 0x080000, "k007232_2", 0 ) ROM_LOAD( "770c11-a.c6", 0x000000, 0x010000, CRC(8cccd9e0) SHA1(73e50a896ed212462046b7bfa04aad5e266425ca) ) ROM_LOAD( "770c11-b.c5", 0x010000, 0x010000, CRC(0af2fedd) SHA1(038189210a73f668a0d913ff2dfc4ffa2e6bd5f4) ) ROM_LOAD( "770c11-c.c4", 0x020000, 0x010000, CRC(7471f24a) SHA1(04d7a69ddc01017a773485fa891711d94c8ad47c) ) @@ -312,73 +693,75 @@ ROM_END ROM_START( typhoon ) - ROM_REGION( 0x20000, "maincpu", 0 ) /* 052001 code */ - ROM_LOAD( "770_k01.n11", 0x00000, 0x10000, CRC(5ba74a22) SHA1(897d3309f2efb3bfa56e86581ee4a492e656788c) ) /* last 0x8000 fixed, first 0x8000 banked */ - ROM_LOAD( "770_k02.n12", 0x10000, 0x10000, CRC(3bcf782a) SHA1(4b6127bced0b2519f8ad30587f32588a16368071) ) /* banked ROM */ - - ROM_REGION( 0x18000, "sub", 0 ) /* 96k */ - ROM_LOAD( "770_f04.g16", 0x00000, 0x10000, CRC(e0e4ec9c) SHA1(15ae09c3ad67ec626d8178ec1417f0c57ca4eca4) ) /* banked ROM */ - ROM_LOAD( "770_k05.i16", 0x10000, 0x08000, CRC(0f1bebbb) SHA1(012a8867ee0febaaadd7bcbc91e462bda5d3a411) ) /* last 0x6000 fixed, first 0x2000 banked */ + ROM_REGION( 0x20000, "maincpu", 0 ) // 052001 code + ROM_LOAD( "770_k01.n11", 0x00000, 0x10000, CRC(5ba74a22) SHA1(897d3309f2efb3bfa56e86581ee4a492e656788c) ) // last 0x8000 fixed, first 0x8000 banked + ROM_LOAD( "770_k02.n12", 0x10000, 0x10000, CRC(3bcf782a) SHA1(4b6127bced0b2519f8ad30587f32588a16368071) ) // banked ROM + + ROM_REGION( 0x18000, "sub", 0 ) + ROM_LOAD( "770_f04.g16", 0x00000, 0x10000, CRC(e0e4ec9c) SHA1(15ae09c3ad67ec626d8178ec1417f0c57ca4eca4) ) // banked ROM + ROM_LOAD( "770_k05.i16", 0x10000, 0x08000, CRC(0f1bebbb) SHA1(012a8867ee0febaaadd7bcbc91e462bda5d3a411) ) // last 0x6000 fixed, first 0x2000 banked - ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the SOUND CPU */ + ROM_REGION( 0x08000, "audiocpu", 0 ) ROM_LOAD( "770_h03.f16", 0x00000, 0x08000, CRC(2ffd2afc) SHA1(ca2ef684f87bcf9b70b3ec66ec80685edaf04b9b) ) - ROM_REGION( 0x080000, "k052109", 0 ) /* tiles */ + ROM_REGION( 0x080000, "k052109", 0 ) // tiles ROM_LOAD32_WORD( "770c13.n22", 0x000000, 0x040000, CRC(b859ca4e) SHA1(f58678d503683f78cca0d5ed2d79f6f68ab3495a) ) ROM_LOAD32_WORD( "770c12.k22", 0x000002, 0x040000, CRC(50d14b72) SHA1(e3ff4a5aeefa6c10b5f7fec18297948b7c5acfdf) ) - ROM_REGION( 0x100000, "k051960", 0 ) /* sprites */ + ROM_REGION( 0x100000, "k051960", 0 ) // sprites ROM_LOAD32_WORD( "770c09.n4", 0x000000, 0x080000, CRC(1ab4a7ff) SHA1(fa007b41027f95d29d2a9f931a2fe235844db637) ) ROM_LOAD32_WORD( "770c08.k4", 0x000002, 0x080000, CRC(a8e80586) SHA1(0401f59baa691905287cef94427f39e0c3f0adc6) ) - ROM_REGION( 0x080000, "k051316", 0 ) /* zoom/rotate */ + ROM_REGION( 0x080000, "k051316", 0 ) // zoom/rotate ROM_LOAD( "770c06.f4", 0x000000, 0x040000, CRC(d0c592ee) SHA1(c1be73dd259f2779d715659b177e47513776a0d4) ) ROM_LOAD( "770c07.h4", 0x040000, 0x040000, CRC(0b399fb1) SHA1(fbe26f9aa9a655d08bebcdd79719d35134ca4dd5) ) ROM_REGION( 0x0200, "proms", 0 ) - ROM_LOAD( "63s241.j11", 0x0000, 0x0200, CRC(9bdd719f) SHA1(de98e562080a97714047a8ad17abc6662c188897) ) /* priority encoder (not used) */ + ROM_LOAD( "63s241.j11", 0x0000, 0x0200, CRC(9bdd719f) SHA1(de98e562080a97714047a8ad17abc6662c188897) ) // priority encoder (not used) - ROM_REGION( 0x040000, "k007232_1", 0 ) /* 007232 data (chip 1) */ + ROM_REGION( 0x040000, "k007232_1", 0 ) ROM_LOAD( "770c10", 0x000000, 0x040000, CRC(7fac825f) SHA1(581522d7a02dad16d2803ff344b4db133f767e6b) ) - ROM_REGION( 0x080000, "k007232_2", 0 ) /* 007232 data (chip 2) */ + ROM_REGION( 0x080000, "k007232_2", 0 ) ROM_LOAD( "770c11", 0x000000, 0x080000, CRC(299a615a) SHA1(29cdcc21998c72f4cf311792b904b79bde236bab) ) ROM_END ROM_START( ajaxj ) - ROM_REGION( 0x20000, "maincpu", 0 ) /* 052001 code */ - ROM_LOAD( "770_l01.n11", 0x00000, 0x10000, CRC(7cea5274) SHA1(8e3b2b11a8189e3a1703b3b4b453fbb386f5537f) ) /* last 0x8000 fixed, first 0x8000 banked */ - ROM_LOAD( "770_l02.n12", 0x10000, 0x10000, CRC(ad7d592b) SHA1(c75d9696b16de231c479379dd02d33fe54021d88) ) /* banked ROM */ - - ROM_REGION( 0x18000, "sub", 0 ) /* 96k */ - ROM_LOAD( "770_f04.g16", 0x00000, 0x10000, CRC(e0e4ec9c) SHA1(15ae09c3ad67ec626d8178ec1417f0c57ca4eca4) ) /* banked ROM */ - ROM_LOAD( "770_l05.i16", 0x10000, 0x8000, CRC(ed64fbb2) SHA1(429046edaf1299afa7fb9c385b4ef0c244ec2409) ) /* last 0x6000 fixed, first 0x2000 banked */ + ROM_REGION( 0x20000, "maincpu", 0 ) // 052001 code + ROM_LOAD( "770_l01.n11", 0x00000, 0x10000, CRC(7cea5274) SHA1(8e3b2b11a8189e3a1703b3b4b453fbb386f5537f) ) // last 0x8000 fixed, first 0x8000 banked + ROM_LOAD( "770_l02.n12", 0x10000, 0x10000, CRC(ad7d592b) SHA1(c75d9696b16de231c479379dd02d33fe54021d88) ) // banked ROM + + ROM_REGION( 0x18000, "sub", 0 ) + ROM_LOAD( "770_f04.g16", 0x00000, 0x10000, CRC(e0e4ec9c) SHA1(15ae09c3ad67ec626d8178ec1417f0c57ca4eca4) ) // banked ROM + ROM_LOAD( "770_l05.i16", 0x10000, 0x08000, CRC(ed64fbb2) SHA1(429046edaf1299afa7fb9c385b4ef0c244ec2409) ) // last 0x6000 fixed, first 0x2000 banked - ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the SOUND CPU */ + ROM_REGION( 0x08000, "audiocpu", 0 ) ROM_LOAD( "770_f03.f16", 0x00000, 0x08000, CRC(3fe914fd) SHA1(c691920402bd859e2bf765084704a8bfad302cfa) ) - ROM_REGION( 0x080000, "k052109", 0 ) /* tiles */ + ROM_REGION( 0x080000, "k052109", 0 ) // tiles ROM_LOAD32_WORD( "770c13.n22", 0x000000, 0x040000, CRC(b859ca4e) SHA1(f58678d503683f78cca0d5ed2d79f6f68ab3495a) ) ROM_LOAD32_WORD( "770c12.k22", 0x000002, 0x040000, CRC(50d14b72) SHA1(e3ff4a5aeefa6c10b5f7fec18297948b7c5acfdf) ) - ROM_REGION( 0x100000, "k051960", 0 ) /* sprites */ + ROM_REGION( 0x100000, "k051960", 0 ) // sprites ROM_LOAD32_WORD( "770c09.n4", 0x000000, 0x080000, CRC(1ab4a7ff) SHA1(fa007b41027f95d29d2a9f931a2fe235844db637) ) ROM_LOAD32_WORD( "770c08.k4", 0x000002, 0x080000, CRC(a8e80586) SHA1(0401f59baa691905287cef94427f39e0c3f0adc6) ) - ROM_REGION( 0x080000, "k051316", 0 ) /* zoom/rotate */ + ROM_REGION( 0x080000, "k051316", 0 ) // zoom/rotate ROM_LOAD( "770c06.f4", 0x000000, 0x040000, CRC(d0c592ee) SHA1(c1be73dd259f2779d715659b177e47513776a0d4) ) ROM_LOAD( "770c07.h4", 0x040000, 0x040000, CRC(0b399fb1) SHA1(fbe26f9aa9a655d08bebcdd79719d35134ca4dd5) ) ROM_REGION( 0x0200, "proms", 0 ) - ROM_LOAD( "63s241.j11", 0x0000, 0x0200, CRC(9bdd719f) SHA1(de98e562080a97714047a8ad17abc6662c188897) ) /* priority encoder (not used) */ + ROM_LOAD( "63s241.j11", 0x0000, 0x0200, CRC(9bdd719f) SHA1(de98e562080a97714047a8ad17abc6662c188897) ) // priority encoder (not used) - ROM_REGION( 0x040000, "k007232_1", 0 ) /* 007232 data (chip 1) */ + ROM_REGION( 0x040000, "k007232_1", 0 ) ROM_LOAD( "770c10", 0x000000, 0x040000, CRC(7fac825f) SHA1(581522d7a02dad16d2803ff344b4db133f767e6b) ) - ROM_REGION( 0x080000, "k007232_2", 0 ) /* 007232 data (chip 2) */ + ROM_REGION( 0x080000, "k007232_2", 0 ) ROM_LOAD( "770c11", 0x000000, 0x080000, CRC(299a615a) SHA1(29cdcc21998c72f4cf311792b904b79bde236bab) ) ROM_END +} // anonymous namespace + GAME( 1987, ajax, 0, ajax, ajax, ajax_state, empty_init, ROT90, "Konami", "Ajax", MACHINE_SUPPORTS_SAVE ) GAME( 1987, typhoon, ajax, ajax, ajax, ajax_state, empty_init, ROT90, "Konami", "Typhoon", MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/akkaarrh.cpp mame-0.243+dfsg.1/src/mame/drivers/akkaarrh.cpp --- mame-0.242+dfsg.1/src/mame/drivers/akkaarrh.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/akkaarrh.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -359,31 +359,9 @@ * *************************************/ -static const gfx_layout pflayout = -{ - 8,8, - RGN_FRAC(1,4), - 4, - { RGN_FRAC(3,4), RGN_FRAC(2,4), RGN_FRAC(1,4), RGN_FRAC(0,4) }, - { 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 const gfx_layout spritelayout = -{ - 16,16, - RGN_FRAC(1,4), - 4, - { RGN_FRAC(3,4), RGN_FRAC(2,4), RGN_FRAC(1,4), RGN_FRAC(0,4) }, - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, - { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16, 8*16, 9*16, 10*16, 11*16, 12*16, 13*16, 14*16, 15*16 }, - 16*16 -}; - static GFXDECODE_START( gfx_akkaarrh ) - GFXDECODE_ENTRY( "gfx1", 0x0000, pflayout, 0, 16 ) - GFXDECODE_ENTRY( "gfx2", 0x0000, spritelayout, 0, 16 ) + GFXDECODE_ENTRY( "gfx1", 0x0000, gfx_8x8x4_planar, 0, 16 ) + GFXDECODE_ENTRY( "gfx2", 0x0000, gfx_16x16x4_planar, 0, 16 ) GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/allied.cpp mame-0.243+dfsg.1/src/mame/drivers/allied.cpp --- mame-0.242+dfsg.1/src/mame/drivers/allied.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/allied.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -99,7 +99,7 @@ u32 m_player_score[6]{}; u8 m_display = 0U; u8 m_bit_counter = 0U; - bool m_disp_data = 0; + bool m_disp_data = false; u8 m_ic5a = 0U; u8 m_ic6a0 = 0U; u8 m_ic6a1 = 0U; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/alpha68k_n.cpp mame-0.243+dfsg.1/src/mame/drivers/alpha68k_n.cpp --- mame-0.242+dfsg.1/src/mame/drivers/alpha68k_n.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/alpha68k_n.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -774,13 +774,13 @@ void kyros_state::kyros(machine_config &config) { base_config(config); - /* basic machine hardware */ - M68000(config, m_maincpu, 24_MHz_XTAL / 4); /* Verified on bootleg PCB */ + // basic machine hardware + M68000(config, m_maincpu, 24_MHz_XTAL / 4); // Verified on original PCB m_maincpu->set_addrmap(AS_PROGRAM, &kyros_state::main_map); m_maincpu->set_vblank_int("screen", FUNC(kyros_state::irq1_line_hold)); m_maincpu->set_periodic_int(FUNC(kyros_state::irq2_line_hold), attotime::from_hz(60)); // MCU irq - Z80(config, m_audiocpu, 24_MHz_XTAL / 6); /* Verified on bootleg PCB */ + Z80(config, m_audiocpu, 16_MHz_XTAL / 4); // Verified on original PCB m_audiocpu->set_addrmap(AS_PROGRAM, &kyros_state::sound_map); m_audiocpu->set_addrmap(AS_IO, &kyros_state::sound_iomap); m_audiocpu->set_vblank_int("screen", FUNC(kyros_state::irq0_line_hold)); @@ -792,16 +792,16 @@ GFXDECODE(config, m_gfxdecode, m_palette, gfx_kyros); // sound hardware - ym2203_device &ym(YM2203(config, "ym", 24_MHz_XTAL / 12)); // Verified on bootleg PCB + ym2203_device &ym(YM2203(config, "ym", 16_MHz_XTAL / 8)); // Verified on original PCB ym.add_route(ALL_OUTPUTS, "speaker", 0.30); - ay8910_device &aysnd1(AY8910(config, "aysnd1", 24_MHz_XTAL / 12)); // Verified on bootleg PCB + ay8910_device &aysnd1(AY8910(config, "aysnd1", 16_MHz_XTAL / 8)); // Verified on original PCB aysnd1.add_route(ALL_OUTPUTS, "speaker", 0.30); - ay8910_device &aysnd2(AY8910(config, "aysnd2", 24_MHz_XTAL / 12)); // Verified on bootleg PCB + ay8910_device &aysnd2(AY8910(config, "aysnd2", 16_MHz_XTAL / 8)); // Verified on original PCB aysnd2.add_route(ALL_OUTPUTS, "speaker", 0.6); - DAC_8BIT_R2R(config, "dac", 0).add_route(ALL_OUTPUTS, "speaker", 0.50); // unknown DAC + DAC_8BIT_R2R(config, "dac", 0).add_route(ALL_OUTPUTS, "speaker", 0.50); } void jongbou_state::jongbou(machine_config &config) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/altos8600.cpp mame-0.243+dfsg.1/src/mame/drivers/altos8600.cpp --- mame-0.242+dfsg.1/src/mame/drivers/altos8600.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/altos8600.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -105,7 +105,7 @@ int m_secoff; u8 m_cmd, m_stat; bool m_cylhi, m_sechi; - const struct hard_disk_info* m_geom; + const struct hard_disk_file::info* m_geom; u8 m_sector[512]; }; @@ -136,7 +136,7 @@ save_item(NAME(m_sector)); if(m_hdd->get_hard_disk_file()) - m_geom = hard_disk_get_info(m_hdd->get_hard_disk_file()); + m_geom = &m_hdd->get_hard_disk_file()->get_info(); else m_geom = nullptr; } @@ -152,7 +152,7 @@ m_cylhi = m_sechi = false; m_stat = 0; if(m_hdd->get_hard_disk_file()) - m_geom = hard_disk_get_info(m_hdd->get_hard_disk_file()); + m_geom = &m_hdd->get_hard_disk_file()->get_info(); else m_geom = nullptr; } @@ -198,7 +198,7 @@ secoff -= 3; } if(!secoff) - hard_disk_read(m_hdd->get_hard_disk_file(), m_lba, m_sector); + m_hdd->get_hard_disk_file()->read(m_lba, m_sector); if(secoff >= 511) { m_dmac->drq1_w(CLEAR_LINE); @@ -220,7 +220,7 @@ { m_stat &= ~1; m_stat |= 2; - hard_disk_write(m_hdd->get_hard_disk_file(), m_lba, m_sector); + m_hdd->get_hard_disk_file()->write(m_lba, m_sector); m_dmac->drq1_w(CLEAR_LINE); m_pic[1]->ir0_w(ASSERT_LINE); return true; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/alvg.cpp mame-0.243+dfsg.1/src/mame/drivers/alvg.cpp --- mame-0.242+dfsg.1/src/mame/drivers/alvg.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/alvg.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -174,7 +174,7 @@ u8 m_dmd_page = 0U; u8 m_dmd_row = 0U; u8 m_dmd_col = 0U; - bool m_dmd_plan = 0; + bool m_dmd_plan = false; u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; @@ -1047,19 +1047,19 @@ } // Anonymous namespace -GAME( 1991, agsoccer, 0, group1, alvg, alvg_state, empty_init, ROT0, "Alvin G", "A.G. Soccer Ball (R18u, 2.5L sound)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1991, agsoccera, agsoccer, group1, alvg, alvg_state, empty_init, ROT0, "Alvin G", "A.G. Soccer Ball (R18u, 2.1 sound)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1991, agsoccer07, agsoccer, group1, alvg, alvg_state, empty_init, ROT0, "Alvin G", "A.G. Soccer Ball (R07u)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1992, wrldtour, 0, group3, alvg, alvg_state, empty_init, ROT0, "Alvin G", "Al's Garage Band Goes On A World Tour (R01c)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1992, wrldtour2, wrldtour, group3, alvg, alvg_state, empty_init, ROT0, "Alvin G", "Al's Garage Band Goes On A World Tour (R02b)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1992, wrldtour3, wrldtour, group3, alvg, alvg_state, empty_init, ROT0, "Alvin G", "Al's Garage Band Goes On A World Tour (R06a)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1993, usafootb, 0, group1, alvg, alvg_state, empty_init, ROT0, "Alvin G", "U.S.A. Football (R06u)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1993, usafootba, usafootb, group1, alvg, alvg_state, empty_init, ROT0, "Alvin G", "U.S.A. Football (R01u)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1994, usafootf, 0, group1, alvg, alvg_state, empty_init, ROT0, "Alvin G", "U.S.A. Football (P08, redemption)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1993, mystcast, 0, group3, alvg, alvg_state, empty_init, ROT0, "Alvin G", "Mystery Castle (R02)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1993, mystcasta, mystcast, group3, alvg, alvg_state, empty_init, ROT0, "Alvin G", "Mystery Castle (R03)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1993, pstlpkr, 0, group3, alvg, alvg_state, empty_init, ROT0, "Alvin G", "Pistol Poker (R02)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1993, pstlpkr1, pstlpkr, group3, alvg, alvg_state, empty_init, ROT0, "Alvin G", "Pistol Poker (R01)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1993, punchy, 0, group1, alvg, alvg_state, empty_init, ROT0, "Alvin G", "Punchy The Clown (R02)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1993, punchy3, punchy, group1, alvg, alvg_state, empty_init, ROT0, "Alvin G", "Punchy The Clown (R03)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1993, dinoeggs, 0, group2, alvg, alvg_state, empty_init, ROT0, "Alvin G", "Dinosaur Eggs (R02)", MACHINE_IS_SKELETON_MECHANICAL) +GAME( 1991, agsoccer, 0, group1, alvg, alvg_state, empty_init, ROT0, "Alvin G", "A.G. Soccer Ball (R18u, 2.5L sound)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1991, agsoccera, agsoccer, group1, alvg, alvg_state, empty_init, ROT0, "Alvin G", "A.G. Soccer Ball (R18u, 2.1 sound)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1991, agsoccer07, agsoccer, group1, alvg, alvg_state, empty_init, ROT0, "Alvin G", "A.G. Soccer Ball (R07u)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1992, wrldtour, 0, group3, alvg, alvg_state, empty_init, ROT0, "Alvin G", "Al's Garage Band Goes On A World Tour (R01c)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1992, wrldtour2, wrldtour, group3, alvg, alvg_state, empty_init, ROT0, "Alvin G", "Al's Garage Band Goes On A World Tour (R02b)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1992, wrldtour3, wrldtour, group3, alvg, alvg_state, empty_init, ROT0, "Alvin G", "Al's Garage Band Goes On A World Tour (R06a)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1993, usafootb, 0, group1, alvg, alvg_state, empty_init, ROT0, "Alvin G", "U.S.A. Football (R06u)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1993, usafootba, usafootb, group1, alvg, alvg_state, empty_init, ROT0, "Alvin G", "U.S.A. Football (R01u)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1994, usafootf, 0, group1, alvg, alvg_state, empty_init, ROT0, "Alvin G", "U.S.A. Football (P08, redemption)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1993, mystcast, 0, group3, alvg, alvg_state, empty_init, ROT0, "Alvin G", "Mystery Castle (R02)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1993, mystcasta, mystcast, group3, alvg, alvg_state, empty_init, ROT0, "Alvin G", "Mystery Castle (R03)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1993, pstlpkr, 0, group3, alvg, alvg_state, empty_init, ROT0, "Alvin G", "Pistol Poker (R02)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1993, pstlpkr1, pstlpkr, group3, alvg, alvg_state, empty_init, ROT0, "Alvin G", "Pistol Poker (R01)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1993, punchy, 0, group1, alvg, alvg_state, empty_init, ROT0, "Alvin G", "Punchy The Clown (R02)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1993, punchy3, punchy, group1, alvg, alvg_state, empty_init, ROT0, "Alvin G", "Punchy The Clown (R03)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1993, dinoeggs, 0, group2, alvg, alvg_state, empty_init, ROT0, "Alvin G", "Dinosaur Eggs (R02)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/angelkds.cpp mame-0.243+dfsg.1/src/mame/drivers/angelkds.cpp --- mame-0.242+dfsg.1/src/mame/drivers/angelkds.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/angelkds.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -18,15 +18,16 @@ */ -/* started 23/01/2002 */ +// started 23/01/2002 -/* notes / todo: +/* notes / TODO: -Unknown Reads / Writes -Whats the Prom for? nothing important? -the progress sprite on the side of the screen re-appears at the bottom when you get -to the top, but the wrap-around is needed for other things, actual game bug? -Angel Kids service mode doesn't seem to work, did it ever? +* Unknown Reads / Writes +* Whats the PROM for? nothing important? + the progress sprite on the side of the screen re-appears at the bottom when you get + to the top, but the wrap-around is needed for other things, actual game bug? +* Angel Kids service mode doesn't seem to work, did it ever? +* Enable / disable tilemap bits might be wrong */ @@ -126,30 +127,279 @@ #include "emu.h" -#include "includes/angelkds.h" + +#include "machine/segacrp2_device.h" #include "cpu/z80/z80.h" #include "machine/i8255.h" -#include "machine/segacrp2_device.h" #include "sound/ymopn.h" #include "emupal.h" #include "screen.h" #include "speaker.h" +#include "tilemap.h" + + +namespace { + +class angelkds_state : public driver_device +{ +public: + angelkds_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_bgvideoram(*this, "bgvideoram%u", 0U), + m_txvideoram(*this, "txvideoram"), + m_spriteram(*this, "spriteram"), + m_decrypted_opcodes(*this, "decrypted_opcodes"), + m_mainbank(*this, "mainbank"), + m_maincpu(*this, "maincpu"), + m_audiocpu(*this, "audiocpu"), + m_gfxdecode(*this, "gfxdecode") + { } + + void angelkds(machine_config &config); + void spcpostn(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; + +private: + // memory pointers + required_shared_ptr_array m_bgvideoram; + required_shared_ptr m_txvideoram; + required_shared_ptr m_spriteram; + optional_shared_ptr m_decrypted_opcodes; + required_memory_bank m_mainbank; + + // devices + required_device m_maincpu; + required_device m_audiocpu; + required_device m_gfxdecode; + + tilemap_t *m_tx_tilemap = nullptr; + tilemap_t *m_bg_tilemap[2]{}; + uint8_t m_txbank = 0; + uint8_t m_bgbank[2]{}; + + uint8_t m_sound[4]{}; + uint8_t m_sound2[4]{}; + uint8_t m_layer_ctrl = 0; + + void cpu_bank_w(uint8_t data); + void main_sound_w(offs_t offset, uint8_t data); + uint8_t main_sound_r(offs_t offset); + void audio_sound_w(offs_t offset, uint8_t data); + uint8_t audio_sound_r(offs_t offset); + void txvideoram_w(offs_t offset, uint8_t data); + void txbank_w(uint8_t data); + template void bgvideoram_w(offs_t offset, uint8_t data); + template void bgbank_w(uint8_t data); + template void bgscroll_w(uint8_t data); + void layer_ctrl_w(uint8_t data); + TILE_GET_INFO_MEMBER(get_tx_tile_info); + template TILE_GET_INFO_MEMBER(get_bg_tile_info); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int enable_n); + + void decrypted_opcodes_map(address_map &map); + void main_map(address_map &map); + void main_portmap(address_map &map); + void sound_map(address_map &map); + void sound_portmap(address_map &map); +}; + + +// video + + +// Text Layer Tilemap + +TILE_GET_INFO_MEMBER(angelkds_state::get_tx_tile_info) +{ + int tileno = m_txvideoram[tile_index] + (m_txbank * 0x100); + tileinfo.set(0, tileno, 0, 0); +} + +void angelkds_state::txvideoram_w(offs_t offset, uint8_t data) +{ + m_txvideoram[offset] = data; + m_tx_tilemap->mark_tile_dirty(offset); +} + +void angelkds_state::txbank_w(uint8_t data) +{ + if (m_txbank != data) + { + m_txbank = data; + m_tx_tilemap->mark_all_dirty(); + } +} + +// Top (0) and Bottom (1) Half Background Tilemap + +template +TILE_GET_INFO_MEMBER(angelkds_state::get_bg_tile_info) +{ + int tileno = m_bgvideoram[Which][tile_index]; + + tileno += m_bgbank[Which] * 0x100 ; + tileinfo.set(Which + 1, tileno, Which, 0); +} + +template +void angelkds_state::bgvideoram_w(offs_t offset, uint8_t data) +{ + m_bgvideoram[Which][offset] = data; + m_bg_tilemap[Which]->mark_tile_dirty(offset); +} + +template +void angelkds_state::bgbank_w(uint8_t data) +{ + if (m_bgbank[Which] != data) + { + m_bgbank[Which] = data; + m_bg_tilemap[Which]->mark_all_dirty(); + } +} +template +void angelkds_state::bgscroll_w(uint8_t data) +{ + m_bg_tilemap[Which]->set_scrollx(0, data); +} +void angelkds_state::layer_ctrl_w(uint8_t data) +{ + m_layer_ctrl = data; +} + +/* Sprites -/*** CPU Banking +the sprites are similar to the tilemaps in the sense that there is +a split down the middle of the screen */ -void angelkds_state::angelkds_cpu_bank_write(uint8_t data) +void angelkds_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int enable_n) { - membank("bank1")->set_entry(data & 0x0f); // shall we check (data & 0x0f) < # of available banks (8 or 10 resp.)? + const uint8_t *source = m_spriteram + 0x100 - 4; + const uint8_t *finish = m_spriteram; + gfx_element *gfx = m_gfxdecode->gfx(3); + + while (source >= finish) + { + /* + + nnnn nnnn - EeFf B?cc - yyyy yyyy - xxxx xxxx + + n = sprite number + E = Sprite Enabled in Top Half of Screen + e = Sprite Enabled in Bottom Half of Screen + F = Flip Y + f = Flip X + B = Tile Bank + ? = unknown, nothing / unused? recheck + c = color + y = Y position + x = X position + + */ + uint16_t tile_no = source[0]; + uint8_t attr = source[1]; + uint8_t ypos = source[2]; + uint8_t xpos = source[3]; + + uint8_t enable = attr & 0xc0; + uint8_t flipx = (attr & 0x10) >> 4; + uint8_t flipy = (attr & 0x20) >> 5; + uint8_t bank = attr & 0x08; + uint8_t color = attr & 0x03; + + if (bank) + tile_no += 0x100; + + ypos = 0xff - ypos; + + if (enable & enable_n) + { + gfx->transpen(bitmap, cliprect, tile_no, color * 4, flipx, flipy, xpos, ypos, 15); + // wraparound + if (xpos > 240) + gfx->transpen(bitmap, cliprect, tile_no, color * 4, flipx, flipy, xpos - 256, ypos, 15); + // wraparound + if (ypos > 240) + { + gfx->transpen(bitmap, cliprect, tile_no, color * 4, flipx, flipy, xpos, ypos - 256, 15); + // wraparound + if (xpos > 240) + gfx->transpen(bitmap, cliprect, tile_no, color * 4, flipx, flipy, xpos - 256, ypos - 256, 15); + } + } + + source -= 0x04; + } +} + + +// Video Start & Update + +void angelkds_state::video_start() +{ + m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(angelkds_state::get_tx_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); + m_tx_tilemap->set_transparent_pen(0); + + m_bg_tilemap[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(angelkds_state::get_bg_tile_info<1>)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); + m_bg_tilemap[1]->set_transparent_pen(15); + + m_bg_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(angelkds_state::get_bg_tile_info<0>)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); + m_bg_tilemap[0]->set_transparent_pen(15); } +// enable bits are uncertain + +uint32_t angelkds_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + const rectangle &visarea = screen.visible_area(); + rectangle clip; + + bitmap.fill(0x3f, cliprect); // is there a register controlling the colour?, we currently use the last colour of the tx palette + + // draw top of screen + clip.set(8 * 0, 8 * 16 - 1, visarea.min_y, visarea.max_y); + if ((m_layer_ctrl & 0x80) == 0x00) + m_bg_tilemap[0]->draw(screen, bitmap, clip, 0, 0); + draw_sprites(bitmap, clip, 0x80); + + if ((m_layer_ctrl & 0x20) == 0x00) + m_tx_tilemap->draw(screen, bitmap, clip, 0, 0); + + // draw bottom of screen + clip.set(8 * 16, 8 * 32 - 1, visarea.min_y, visarea.max_y); + + if ((m_layer_ctrl & 0x40) == 0x00) + m_bg_tilemap[1]->draw(screen, bitmap, clip, 0, 0); + + draw_sprites(bitmap, clip, 0x40); + + if ((m_layer_ctrl & 0x20) == 0x00) + m_tx_tilemap->draw(screen, bitmap, clip, 0, 0); + + return 0; +} + +// machine + +// CPU Banking + +void angelkds_state::cpu_bank_w(uint8_t data) +{ + m_mainbank->set_entry(data & 0x0f); // shall we check (data & 0x0f) < # of available banks (8 or 10 resp.)? +} /*** Memory Structures @@ -171,27 +421,27 @@ void angelkds_state::main_map(address_map &map) { map(0x0000, 0x7fff).rom(); - map(0x8000, 0xbfff).bankr("bank1"); + map(0x8000, 0xbfff).bankr(m_mainbank); map(0xc000, 0xdfff).ram(); - map(0xe000, 0xe3ff).ram().w(FUNC(angelkds_state::angelkds_bgtopvideoram_w)).share("bgtopvideoram"); /* Top Half of Screen */ - map(0xe400, 0xe7ff).ram().w(FUNC(angelkds_state::angelkds_bgbotvideoram_w)).share("bgbotvideoram"); /* Bottom Half of Screen */ - map(0xe800, 0xebff).ram().w(FUNC(angelkds_state::angelkds_txvideoram_w)).share("txvideoram"); - map(0xec00, 0xecff).ram().share("spriteram"); + map(0xe000, 0xe3ff).ram().w(FUNC(angelkds_state::bgvideoram_w<0>)).share(m_bgvideoram[0]); // Top Half of Screen + map(0xe400, 0xe7ff).ram().w(FUNC(angelkds_state::bgvideoram_w<1>)).share(m_bgvideoram[1]); // Bottom Half of Screen + map(0xe800, 0xebff).ram().w(FUNC(angelkds_state::txvideoram_w)).share(m_txvideoram); + map(0xec00, 0xecff).ram().share(m_spriteram); map(0xed00, 0xedff).ram().w("palette", FUNC(palette_device::write8)).share("palette"); map(0xee00, 0xeeff).ram().w("palette", FUNC(palette_device::write8_ext)).share("palette_ext"); map(0xef00, 0xefff).ram(); - map(0xf000, 0xf000).w(FUNC(angelkds_state::angelkds_bgtopbank_write)); - map(0xf001, 0xf001).w(FUNC(angelkds_state::angelkds_bgtopscroll_write)); - map(0xf002, 0xf002).w(FUNC(angelkds_state::angelkds_bgbotbank_write)); - map(0xf003, 0xf003).w(FUNC(angelkds_state::angelkds_bgbotscroll_write)); - map(0xf004, 0xf004).w(FUNC(angelkds_state::angelkds_txbank_write)); - map(0xf005, 0xf005).w(FUNC(angelkds_state::angelkds_layer_ctrl_write)); + map(0xf000, 0xf000).w(FUNC(angelkds_state::bgbank_w<0>)); + map(0xf001, 0xf001).w(FUNC(angelkds_state::bgscroll_w<0>)); + map(0xf002, 0xf002).w(FUNC(angelkds_state::bgbank_w<1>)); + map(0xf003, 0xf003).w(FUNC(angelkds_state::bgscroll_w<1>)); + map(0xf004, 0xf004).w(FUNC(angelkds_state::txbank_w)); + map(0xf005, 0xf005).w(FUNC(angelkds_state::layer_ctrl_w)); } void angelkds_state::decrypted_opcodes_map(address_map &map) { - map(0x0000, 0x7fff).rom().share("decrypted_opcodes"); - map(0x8000, 0xbfff).bankr("bank1"); + map(0x0000, 0x7fff).rom().share(m_decrypted_opcodes); + map(0x8000, 0xbfff).bankr(m_mainbank); } void angelkds_state::main_portmap(address_map &map) @@ -202,16 +452,16 @@ map(0x40, 0x43).rw("ppi8255_0", FUNC(i8255_device::read), FUNC(i8255_device::write)); map(0x80, 0x83).rw("ppi8255_1", FUNC(i8255_device::read), FUNC(i8255_device::write)); - map(0xc0, 0xc3).rw(FUNC(angelkds_state::angelkds_main_sound_r), FUNC(angelkds_state::angelkds_main_sound_w)); // 02 various points + map(0xc0, 0xc3).rw(FUNC(angelkds_state::main_sound_r), FUNC(angelkds_state::main_sound_w)); // 02 various points } -/* sub cpu */ +// audio CPU -void angelkds_state::sub_map(address_map &map) +void angelkds_state::sound_map(address_map &map) { map(0x0000, 0x7fff).rom(); map(0x8000, 0x87ff).ram(); @@ -220,16 +470,16 @@ map(0xaaac, 0xaaac).nopr(); } -void angelkds_state::sub_portmap(address_map &map) +void angelkds_state::sound_portmap(address_map &map) { map.global_mask(0xff); map(0x00, 0x01).rw("ym1", FUNC(ym2203_device::read), FUNC(ym2203_device::write)); map(0x40, 0x41).rw("ym2", FUNC(ym2203_device::read), FUNC(ym2203_device::write)); - map(0x80, 0x83).rw(FUNC(angelkds_state::angelkds_sub_sound_r), FUNC(angelkds_state::angelkds_sub_sound_w)); // spcpostn + map(0x80, 0x83).rw(FUNC(angelkds_state::audio_sound_r), FUNC(angelkds_state::audio_sound_w)); // spcpostn } -/* Input Ports */ +// Input Ports #define ANGELDSK_PLAYERS_INPUT( player ) \ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP ) PORT_PLAYER(player) PORT_8WAY \ @@ -249,18 +499,18 @@ Joystick Test: Set SW1:1-7 ON & SW1:8 OFF (A:Free Play & B:3C_1C), hold test switch and reboot. Joystick Test Coin_A & Coin_B seem to be switched, only works when setting A to 3C_1C and B to Free Play. */ - PORT_START("I40") /* inport $40 */ + PORT_START("I40") // inport $40 PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3,4") PORT_DIPSETTING( 0x70, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x80, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x90, DEF_STR( 2C_1C ) ) -// PORT_DIPSETTING( 0x60, DEF_STR( 2C_1C ) ) -// PORT_DIPSETTING( 0x50, DEF_STR( 2C_1C ) ) -// PORT_DIPSETTING( 0x40, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x60, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x50, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x40, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0xf0, DEF_STR( 1C_1C ) ) -// PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) ) -// PORT_DIPSETTING( 0x20, DEF_STR( 1C_1C ) ) -// PORT_DIPSETTING( 0x10, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x20, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x10, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0xe0, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0xd0, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0xc0, DEF_STR( 1C_4C ) ) @@ -272,13 +522,13 @@ PORT_DIPSETTING( 0x07, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x08, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x09, DEF_STR( 2C_1C ) ) -// PORT_DIPSETTING( 0x06, DEF_STR( 2C_1C ) ) -// PORT_DIPSETTING( 0x05, DEF_STR( 2C_1C ) ) -// PORT_DIPSETTING( 0x04, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x06, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x05, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x04, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x0f, DEF_STR( 1C_1C ) ) -// PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) ) -// PORT_DIPSETTING( 0x02, DEF_STR( 1C_1C ) ) -// PORT_DIPSETTING( 0x01, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x02, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x01, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x0e, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x0d, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x0c, DEF_STR( 1C_4C ) ) @@ -286,7 +536,7 @@ PORT_DIPSETTING( 0x0a, DEF_STR( 1C_6C ) ) PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) - PORT_START("I41") /* inport $41 */ + PORT_START("I41") // inport $41 PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:1") PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) PORT_DIPSETTING( 0x01, DEF_STR( Cocktail ) ) @@ -303,14 +553,14 @@ PORT_DIPSETTING( 0x20, "4" ) PORT_DIPSETTING( 0x10, "5" ) PORT_DIPSETTING( 0x00, "99 (Cheat)" ) - PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:7,8") /* Stored at 0xc023 */ + PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:7,8") // Stored at 0xc023 PORT_DIPSETTING( 0xc0, DEF_STR( Very_Easy ) ) PORT_DIPSETTING( 0x40, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x80, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x00, DEF_STR( Very_Hard ) ) - PORT_START("I80") /* inport $80 */ + PORT_START("I80") // inport $80 PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) @@ -320,16 +570,16 @@ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) - PORT_START("I81") /* inport $81 */ + PORT_START("I81") // inport $81 ANGELDSK_PLAYERS_INPUT( 1 ) - PORT_START("I82") /* inport $82 */ + PORT_START("I82") // inport $82 ANGELDSK_PLAYERS_INPUT( 2 ) INPUT_PORTS_END static INPUT_PORTS_START( spcpostn ) - PORT_START("I40") /* inport $40 */ + PORT_START("I40") // inport $40 PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3,4") PORT_DIPSETTING( 0x02, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x05, DEF_STR( 3C_1C ) ) @@ -365,7 +615,7 @@ PORT_DIPSETTING( 0xa0, DEF_STR( 1C_6C ) ) PORT_DIPSETTING( 0x90, DEF_STR( 1C_7C ) ) - PORT_START("I41") /* inport $41 */ + PORT_START("I41") // inport $41 PORT_DIPNAME( 0x01, 0x01, DEF_STR(Allow_Continue ) ) PORT_DIPLOCATION("SW2:1") PORT_DIPSETTING( 0x01, DEF_STR( No ) ) PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) @@ -385,9 +635,9 @@ PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:7") PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW2:8" ) /* Listed as "Unused" */ + PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW2:8" ) // Listed as "Unused" - PORT_START("I80") /* inport $80 */ + PORT_START("I80") // inport $80 PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) @@ -397,7 +647,7 @@ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) - PORT_START("I81") /* inport $81 */ + PORT_START("I81") // inport $81 PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_8WAY PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_8WAY PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_8WAY @@ -407,7 +657,7 @@ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_PLAYER(1) // probably unused PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_PLAYER(1) // probably unused - PORT_START("I82") /* inport $82 */ + PORT_START("I82") // inport $82 PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_8WAY PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_8WAY PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_8WAY @@ -419,53 +669,41 @@ INPUT_PORTS_END -/*** Sound Hardware +/* Sound Hardware -todo: verify / correct things +TODO: verify / correct things seems a bit strange are all the addresses really sound related ? */ -void angelkds_state::angelkds_main_sound_w(offs_t offset, uint8_t data) +void angelkds_state::main_sound_w(offs_t offset, uint8_t data) { m_sound[offset] = data; } -uint8_t angelkds_state::angelkds_main_sound_r(offs_t offset) +uint8_t angelkds_state::main_sound_r(offs_t offset) { return m_sound2[offset]; } -void angelkds_state::angelkds_sub_sound_w(offs_t offset, uint8_t data) +void angelkds_state::audio_sound_w(offs_t offset, uint8_t data) { m_sound2[offset] = data; } -uint8_t angelkds_state::angelkds_sub_sound_r(offs_t offset) +uint8_t angelkds_state::audio_sound_r(offs_t offset) { return m_sound[offset]; } -/*** Graphics Decoding +/* Graphics Decoding all the 8x8 tiles are in one format, the 16x16 sprites in another */ -static const gfx_layout angelkds_charlayout = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { 0,1,2,3 }, - { 0, 4, 8, 12, 16, 20, 24, 28 }, - { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 }, - 8*32 -}; - - static const gfx_layout angelkds_spritelayout = { 16,16, @@ -478,15 +716,15 @@ }; static GFXDECODE_START( gfx_angelkds ) - GFXDECODE_ENTRY( "gfx1", 0, angelkds_charlayout, 0x30, 1 ) - GFXDECODE_ENTRY( "gfx3", 0, angelkds_charlayout, 0, 16 ) - GFXDECODE_ENTRY( "gfx4", 0, angelkds_charlayout, 0, 16 ) - GFXDECODE_ENTRY( "gfx2", 0, angelkds_spritelayout, 0x20, 0x0d ) + GFXDECODE_ENTRY( "chars", 0, gfx_8x8x4_packed_msb, 0x30, 1 ) + GFXDECODE_ENTRY( "bgtiles_top", 0, gfx_8x8x4_packed_msb, 0, 16 ) + GFXDECODE_ENTRY( "bgtiles_bottom", 0, gfx_8x8x4_packed_msb, 0, 16 ) + GFXDECODE_ENTRY( "sprites", 0, angelkds_spritelayout, 0x20, 0x0d ) GFXDECODE_END -/*** Machine Driver +/* Machine Driver - 2 x z80 (one for game, one for sound) + 2 x Z80 (one for game, one for sound) 2 x YM2203 (for sound) all fairly straightforward @@ -495,19 +733,19 @@ void angelkds_state::machine_start() { + uint8_t *rom = memregion("banked_roms")->base(); + m_mainbank->configure_entries(0, 16, &rom[0x0000], 0x4000); + save_item(NAME(m_layer_ctrl)); save_item(NAME(m_txbank)); - save_item(NAME(m_bgbotbank)); - save_item(NAME(m_bgtopbank)); + save_item(NAME(m_bgbank)); save_item(NAME(m_sound)); save_item(NAME(m_sound2)); } void angelkds_state::machine_reset() { - int i; - - for (i = 0; i < 4; i++) + for (int i = 0; i < 4; i++) { m_sound[i] = 0; m_sound2[i] = 0; @@ -515,8 +753,7 @@ m_layer_ctrl = 0; m_txbank = 0; - m_bgbotbank = 0; - m_bgtopbank = 0; + m_bgbank[0] = m_bgbank[1] = 0; } void angelkds_state::angelkds(machine_config &config) @@ -526,15 +763,15 @@ m_maincpu->set_addrmap(AS_IO, &angelkds_state::main_portmap); m_maincpu->set_vblank_int("screen", FUNC(angelkds_state::irq0_line_hold)); - Z80(config, m_subcpu, XTAL(4'000'000)); - m_subcpu->set_addrmap(AS_PROGRAM, &angelkds_state::sub_map); - m_subcpu->set_addrmap(AS_IO, &angelkds_state::sub_portmap); + Z80(config, m_audiocpu, XTAL(4'000'000)); + m_audiocpu->set_addrmap(AS_PROGRAM, &angelkds_state::sound_map); + m_audiocpu->set_addrmap(AS_IO, &angelkds_state::sound_portmap); i8255_device &ppi0(I8255A(config, "ppi8255_0")); ppi0.in_pa_callback().set_ioport("I40"); ppi0.in_pb_callback().set_ioport("I41"); - ppi0.in_pc_callback().set(FUNC(angelkds_state::angeklds_ff_r)); // or left inputs don't work - ppi0.out_pc_callback().set(FUNC(angelkds_state::angelkds_cpu_bank_write)); + ppi0.in_pc_callback().set_constant(0xff); // or left inputs don't work + ppi0.out_pc_callback().set(FUNC(angelkds_state::cpu_bank_w)); i8255_device &ppi1(I8255A(config, "ppi8255_1")); ppi1.in_pa_callback().set_ioport("I80"); @@ -543,13 +780,13 @@ config.set_maximum_quantum(attotime::from_hz(6000)); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(60); screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); screen.set_size(32*8, 32*8); screen.set_visarea(0*8, 32*8-1, 1*8, 31*8-1); - screen.set_screen_update(FUNC(angelkds_state::screen_update_angelkds)); + screen.set_screen_update(FUNC(angelkds_state::screen_update)); screen.set_palette("palette"); GFXDECODE(config, m_gfxdecode, "palette", gfx_angelkds); @@ -558,7 +795,7 @@ SPEAKER(config, "mono").front_center(); ym2203_device &ym1(YM2203(config, "ym1", XTAL(4'000'000))); - ym1.irq_handler().set_inputline(m_subcpu, 0); + ym1.irq_handler().set_inputline(m_audiocpu, 0); ym1.add_route(0, "mono", 0.65); ym1.add_route(1, "mono", 0.65); ym1.add_route(2, "mono", 0.65); @@ -575,7 +812,7 @@ { angelkds(config); - /* encryption */ + // encryption sega_317_0005_device &maincpu(SEGA_317_0005(config.replace(), m_maincpu, XTAL(6'000'000))); maincpu.set_addrmap(AS_PROGRAM, &angelkds_state::main_map); maincpu.set_addrmap(AS_IO, &angelkds_state::main_portmap); @@ -584,43 +821,31 @@ maincpu.set_decrypted_tag(m_decrypted_opcodes); } -/*** Rom Loading - - "maincpu" for the main code - "user1" for the banked data - "sub" for the sound cpu code - "gfx1" for the 8x8 Txt Layer Tiles - "gfx2" for the 16x16 Sprites - "gfx3" for the 8x8 Bg Layer Tiles (top tilemap) - "gfx4" for the 8x8 Bg Layer Tiles (bottom tilemap) - "proms" for the Prom (same between games) - -*/ ROM_START( angelkds ) - /* Nasco X090-PC-A (Sega 837-6600) */ + // Nasco X090-PC-A (Sega 837-6600) ROM_REGION( 0x8000, "maincpu", 0 ) ROM_LOAD( "epr-11428.c10", 0x00000, 0x08000, CRC(90daacd2) SHA1(7e50ad1cbed0c1e6bad04ef1611cad25538c905f) ) - ROM_REGION( 0x40000, "user1", 0 ) /* Banked Code */ + ROM_REGION( 0x40000, "banked_roms", 0 ) ROM_LOAD( "epr-11424.c1", 0x00000, 0x08000, CRC(b55997f6) SHA1(7ed746becac1851f39591f1fdbeff64aa97d6206) ) ROM_LOAD( "epr-11425.c2", 0x08000, 0x08000, CRC(299359de) SHA1(f531dd3bfe6f64e9e043cb4f85d5657455241dc7) ) ROM_LOAD( "epr-11426.c3", 0x10000, 0x08000, CRC(5fad8bd3) SHA1(4d865342eb10dcfb779eee4ac1e159bb9ec140cb) ) ROM_LOAD( "epr-11427.c4", 0x18000, 0x08000, CRC(ef920c74) SHA1(81c0fbe4ace5441e4cd99ba423e0190cc541da31) ) - ROM_REGION( 0x10000, "sub", 0 ) + ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "epr-11429.d4", 0x00000, 0x08000, CRC(0ca50a66) SHA1(cccb081b447419138b1ebd309e7f291e392a44d5) ) - /* Nasco X090-PC-B */ - ROM_REGION( 0x08000, "gfx1", 0 ) + // Nasco X090-PC-B + ROM_REGION( 0x08000, "chars", 0 ) ROM_LOAD( "epr-11446", 0x00000, 0x08000, CRC(45052470) SHA1(c2312a9f814d6dbe42aa465147a04a2bd9b2aa1b) ) - ROM_REGION( 0x10000, "gfx2", 0 ) + ROM_REGION( 0x10000, "sprites", 0 ) ROM_LOAD( "epr-11447.f7", 0x08000, 0x08000, CRC(b3afc5b3) SHA1(376d527f60e9044f18d19a5535bca77606efbd4c) ) ROM_LOAD( "epr-11448.h7", 0x00000, 0x08000, CRC(05dab626) SHA1(73feaca6e23c673a7d8c9e972714b20bd8f2d51e) ) - /* both tilemaps on angelkds use the same gfx */ - ROM_REGION( 0x40000, "gfx3", 0 ) + // both tilemaps on angelkds use the same GFX + ROM_REGION( 0x40000, "bgtiles_top", 0 ) ROM_LOAD( "epr-11437", 0x00000, 0x08000, CRC(a520b628) SHA1(2b51f59e760e740e5e6b06dad61bbc23fc84a72b) ) ROM_LOAD( "epr-11436", 0x08000, 0x08000, CRC(469ab216) SHA1(8223f072a6f9135ff84841c95410368bcea073d8) ) ROM_LOAD( "epr-11435", 0x10000, 0x08000, CRC(b0f8c245) SHA1(882e27eaceac46c397fdae8427a082caa7d6b7dc) ) @@ -630,7 +855,7 @@ ROM_LOAD( "epr-11431", 0x30000, 0x08000, CRC(ac2025af) SHA1(2aba145df3ccdb1a7f0fec524bd2de3f9aab4161) ) ROM_LOAD( "epr-11430", 0x38000, 0x08000, CRC(d640f89e) SHA1(38fb67bcb2a3d1ad614fc62e42f22a66bc757137) ) - ROM_REGION( 0x40000, "gfx4", 0 ) + ROM_REGION( 0x40000, "bgtiles_bottom", 0 ) ROM_LOAD( "epr-11445", 0x00000, 0x08000, CRC(a520b628) SHA1(2b51f59e760e740e5e6b06dad61bbc23fc84a72b) ) ROM_LOAD( "epr-11444", 0x08000, 0x08000, CRC(469ab216) SHA1(8223f072a6f9135ff84841c95410368bcea073d8) ) ROM_LOAD( "epr-11443", 0x10000, 0x08000, CRC(b0f8c245) SHA1(882e27eaceac46c397fdae8427a082caa7d6b7dc) ) @@ -645,34 +870,34 @@ ROM_END ROM_START( spcpostn ) - /* X090-PC-A 171-5383 (Sega 834-6089 SPACE POSITION) */ - ROM_REGION( 0x8000, "maincpu", 0 ) /* D317-0005 (NEC Z80 Custom) */ - ROM_LOAD( "epr-10125.c10", 0x00000, 0x08000, CRC(bffd38c6) SHA1(af02907124343ddecd21439d25f1ebb81ef9f51a) ) /* encrypted */ + // X090-PC-A 171-5383 (Sega 834-6089 SPACE POSITION) + ROM_REGION( 0x8000, "maincpu", 0 ) // D317-0005 (NEC Z80 Custom) + ROM_LOAD( "epr-10125.c10", 0x00000, 0x08000, CRC(bffd38c6) SHA1(af02907124343ddecd21439d25f1ebb81ef9f51a) ) // encrypted - ROM_REGION( 0x40000, "user1", 0 ) /* Banked Code */ + ROM_REGION( 0x40000, "banked_roms", 0 ) ROM_LOAD( "epr-10120.c1", 0x00000, 0x08000, CRC(d6399f99) SHA1(4c7d19a8798e5a10b688bf793ca74f5170fd9b51) ) ROM_LOAD( "epr-10121.c2", 0x08000, 0x08000, CRC(d4861560) SHA1(74d28c36a08880abbd3c398cc3e990e8986caccb) ) ROM_LOAD( "epr-10122.c3", 0x10000, 0x08000, CRC(7a1bff1b) SHA1(e1bda8430fd632c1813dd78e0f210a358e1b0d2f) ) ROM_LOAD( "epr-10123.c4", 0x18000, 0x08000, CRC(6aed2925) SHA1(75848c8086c460b72494da2367f592d7d5dcf9f1) ) ROM_LOAD( "epr-10124.c5", 0x20000, 0x08000, CRC(a1d7ae6b) SHA1(ec81fecf63e0515cae2077e2623262227adfdf37) ) - ROM_REGION( 0x10000, "sub", 0 ) /* NEC D780C-1 */ + ROM_REGION( 0x10000, "audiocpu", 0 ) // NEC D780C-1 ROM_LOAD( "epr-10126.d4", 0x00000, 0x08000, CRC(ab17f852) SHA1(dc0db427ddb4df97bb40dfb6fc65cb9354a6b9ad) ) - /* X090-PC-B 171-5384 */ - ROM_REGION( 0x08000, "gfx1", 0 ) + // X090-PC-B 171-5384 + ROM_REGION( 0x08000, "chars", 0 ) ROM_LOAD( "epr-10133.17", 0x00000, 0x08000, CRC(642e6609) SHA1(2dfb4cc66f89543b55ed2a5b914e2c9304e821ca) ) - ROM_REGION( 0x10000, "gfx2", 0 ) + ROM_REGION( 0x10000, "sprites", 0 ) ROM_LOAD( "epr-10134.18", 0x08000, 0x08000, CRC(c674ff88) SHA1(9f240910a1ffb7c9e09d2326de280e6a5dd84565) ) ROM_LOAD( "epr-10135.19", 0x00000, 0x08000, CRC(0685c4fa) SHA1(6950d9ad9ec13236cf24e83e87adb62aa53af7bb) ) - ROM_REGION( 0x30000, "gfx3", 0 ) + ROM_REGION( 0x30000, "bgtiles_top", 0 ) ROM_LOAD( "epr-10130.14", 0x10000, 0x08000, CRC(b68fcb36) SHA1(3943dd550b13f2911d56d8dad675410da79196e6) ) ROM_LOAD( "epr-10131.15", 0x08000, 0x08000, CRC(de223817) SHA1(1860db0a19c926fcfaabe676cb57fff38c4df8e6) ) ROM_LOAD( "epr-10132.16", 0x00000, 0x08000, CRC(2df8b1bd) SHA1(cad8befa3f2c158d2aa74073066ccd2b54e68825) ) - ROM_REGION( 0x18000, "gfx4", 0 ) + ROM_REGION( 0x18000, "bgtiles_bottom", 0 ) ROM_LOAD( "epr-10127.06", 0x10000, 0x08000, CRC(b68fcb36) SHA1(3943dd550b13f2911d56d8dad675410da79196e6) ) ROM_LOAD( "epr-10128.07", 0x08000, 0x08000, CRC(de223817) SHA1(1860db0a19c926fcfaabe676cb57fff38c4df8e6) ) ROM_LOAD( "epr-10129.08", 0x00000, 0x08000, CRC(a6f21023) SHA1(8d573446a2d3d3428409707d0c59b118d1463131) ) @@ -681,14 +906,8 @@ ROM_LOAD( "63s081n.u5", 0x00, 0x20, CRC(36b98627) SHA1(d2d54d92d1d47e7cc85104989ee421ce5d80a42a) ) ROM_END - -void angelkds_state::init_angelkds() -{ - uint8_t *RAM = memregion("user1")->base(); - membank("bank1")->configure_entries(0, 16, &RAM[0x0000], 0x4000); -} - +} // anonymous namespace -GAME( 1988, angelkds, 0, angelkds, angelkds, angelkds_state, init_angelkds, ROT90, "Sega / Nasco?", "Angel Kids (Japan)" , MACHINE_SUPPORTS_SAVE) /* Nasco not displayed but 'Exa Planning' is */ -GAME( 1986, spcpostn, 0, spcpostn, spcpostn, angelkds_state, init_angelkds, ROT90, "Sega / Nasco", "Space Position (Japan)" , MACHINE_SUPPORTS_SAVE) /* encrypted */ +GAME( 1988, angelkds, 0, angelkds, angelkds, angelkds_state, empty_init, ROT90, "Sega / Nasco?", "Angel Kids (Japan)" , MACHINE_SUPPORTS_SAVE) // Nasco not displayed but 'Exa Planning' is +GAME( 1986, spcpostn, 0, spcpostn, spcpostn, angelkds_state, empty_init, ROT90, "Sega / Nasco", "Space Position (Japan)" , MACHINE_SUPPORTS_SAVE) // encrypted diff -Nru mame-0.242+dfsg.1/src/mame/drivers/apple1.cpp mame-0.243+dfsg.1/src/mame/drivers/apple1.cpp --- mame-0.242+dfsg.1/src/mame/drivers/apple1.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/apple1.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -174,14 +174,11 @@ // header is "LOAD:abcdDATA:" where abcd is the starting address SNAPSHOT_LOAD_MEMBER(apple1_state::snapshot_cb) { - uint64_t snapsize; - uint8_t *data; - uint16_t start, end; static const char hd1[6] = "LOAD:"; static const char hd2[6] = "DATA:"; // get the snapshot's size - snapsize = image.length(); + uint64_t snapsize = image.length(); if (snapsize < 12) { @@ -195,21 +192,21 @@ return image_init_result::FAIL; } - data = (uint8_t *)image.ptr(); - if (!data) + auto data = std::make_unique(snapsize); + if (image.fread(data.get(), snapsize) != snapsize) { logerror("Internal error loading snapshot\n"); return image_init_result::FAIL; } - if ((memcmp(hd1, data, 5)) || (memcmp(hd2, &data[7], 5))) + if ((memcmp(hd1, &data[0], 5)) || (memcmp(hd2, &data[7], 5))) { logerror("Snapshot is invalid\n"); return image_init_result::FAIL; } - start = (data[5]<<8) | data[6]; - end = (snapsize - 12) + start; + uint16_t start = (data[5]<<8) | data[6]; + uint16_t end = (snapsize - 12) + start; // check if this fits in RAM; load below 0xe000 must fit in RAMSIZE, // load at 0xe000 must fit in 4K diff -Nru mame-0.242+dfsg.1/src/mame/drivers/apple2e.cpp mame-0.243+dfsg.1/src/mame/drivers/apple2e.cpp --- mame-0.242+dfsg.1/src/mame/drivers/apple2e.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/apple2e.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -2320,6 +2320,7 @@ else if (m_accel_unlocked) { // disable acceleration + m_accel_fast = false; accel_normal_speed(); } } @@ -2328,6 +2329,7 @@ case 0x5b: // Zip full speed if (m_accel_unlocked) { + m_accel_fast = true; accel_full_speed(); } break; @@ -2344,6 +2346,10 @@ { m_accel_gameio = data; } + else + { + do_io(offset, false); + } break; case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: diff -Nru mame-0.242+dfsg.1/src/mame/drivers/apple2gs.cpp mame-0.243+dfsg.1/src/mame/drivers/apple2gs.cpp --- mame-0.242+dfsg.1/src/mame/drivers/apple2gs.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/apple2gs.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -315,9 +315,9 @@ ADBSTATE_INRESPONSE }; - bool m_adb_line; + bool m_adb_line = false; - address_space *m_maincpu_space; + address_space *m_maincpu_space = nullptr; TIMER_DEVICE_CALLBACK_MEMBER(apple2_interrupt); TIMER_DEVICE_CALLBACK_MEMBER(accel_timer); @@ -335,9 +335,9 @@ void devsel_w(uint8_t devsel); void hdsel_w(int hdsel); - floppy_image_device *m_cur_floppy; - int m_devsel; - u8 m_diskreg; + floppy_image_device *m_cur_floppy = nullptr; + int m_devsel = 0; + u8 m_diskreg = 0; u8 ram0000_r(offs_t offset); void ram0000_w(offs_t offset, u8 data); @@ -435,91 +435,91 @@ offs_t dasm_trampoline(std::ostream &stream, offs_t pc, const util::disasm_interface::data_buffer &opcodes, const util::disasm_interface::data_buffer ¶ms); void wdm_trampoline(offs_t offset, u8 data) { }; //m_a2host->wdm_w(space, offset, data); } - bool m_is_rom3; - int m_speaker_state; + bool m_is_rom3 = false; + int m_speaker_state = 0; - double m_joystick_x1_time, m_joystick_y1_time, m_joystick_x2_time, m_joystick_y2_time; + double m_joystick_x1_time = 0, m_joystick_y1_time = 0, m_joystick_x2_time = 0, m_joystick_y2_time = 0; - int m_inh_slot, m_cnxx_slot; - int m_motoroff_time; + int m_inh_slot = 0, m_cnxx_slot = 0; + int m_motoroff_time = 0; - bool m_romswitch; + bool m_romswitch = false; - bool m_page2; - bool m_an0, m_an1, m_an2, m_an3; + bool m_page2 = false; + bool m_an0 = false, m_an1 = false, m_an2 = false, m_an3 = false; - bool m_vbl; + bool m_vbl = false; - int m_irqmask; + int m_irqmask = 0; - bool m_intcxrom; - bool m_80store; - bool m_slotc3rom; - bool m_altzp; - bool m_ramrd, m_ramwrt; - bool m_lcram, m_lcram2, m_lcprewrite, m_lcwriteenable; - bool m_ioudis; - bool m_rombank; + bool m_intcxrom = false; + bool m_80store = false; + bool m_slotc3rom = false; + bool m_altzp = false; + bool m_ramrd = false, m_ramwrt = false; + bool m_lcram = false, m_lcram2 = false, m_lcprewrite = false, m_lcwriteenable = false; + bool m_ioudis = false; + bool m_rombank = false; - u8 m_shadow, m_speed, m_textcol; - u8 m_motors_active, m_slotromsel, m_intflag, m_vgcint, m_inten, m_newvideo; + u8 m_shadow = 0, m_speed = 0, m_textcol = 0; + u8 m_motors_active = 0, m_slotromsel = 0, m_intflag = 0, m_vgcint = 0, m_inten = 0, m_newvideo = 0; - bool m_last_speed; + bool m_last_speed = false; // Sound GLU variables - u8 m_sndglu_ctrl; - int m_sndglu_addr; - int m_sndglu_dummy_read; + u8 m_sndglu_ctrl = 0; + int m_sndglu_addr = 0; + int m_sndglu_dummy_read = 0; // Key GLU variables - u8 m_glu_regs[12], m_glu_bus; - bool m_glu_mcu_read_kgs, m_glu_816_read_dstat, m_glu_mouse_read_stat; - int m_glu_kbd_y; + u8 m_glu_regs[12]{}, m_glu_bus = 0; + bool m_glu_mcu_read_kgs = false, m_glu_816_read_dstat = false, m_glu_mouse_read_stat = false; + int m_glu_kbd_y = 0; - u8 *m_ram_ptr; - int m_ram_size; - u8 m_megaii_ram[0x20000]; // 128K of "slow RAM" at $E0/0000 + u8 *m_ram_ptr = nullptr; + int m_ram_size = 0; + u8 m_megaii_ram[0x20000]{}; // 128K of "slow RAM" at $E0/0000 - int m_inh_bank; + int m_inh_bank = 0; - bool m_slot_irq; + bool m_slot_irq = false; - double m_x_calibration, m_y_calibration; + double m_x_calibration = 0, m_y_calibration = 0; - device_a2bus_card_interface *m_slotdevice[8]; + device_a2bus_card_interface *m_slotdevice[8]{}; - u32 m_slow_counter; + u32 m_slow_counter = 0; // clock/BRAM - u8 m_clkdata, m_clock_control, m_clock_read, m_clock_reg1; + u8 m_clkdata = 0, m_clock_control = 0, m_clock_read = 0, m_clock_reg1 = 0; apple2gs_clock_mode m_clock_mode; u32 m_clock_curtime; seconds_t m_clock_curtime_interval; - u8 m_clock_bram[256]; - int m_clock_frame; + u8 m_clock_bram[256]{}; + int m_clock_frame = 0; // ADB simulation #if !RUN_ADB_MICRO adbstate_t m_adb_state; - u8 m_adb_command; - u8 m_adb_mode; - u8 m_adb_kmstatus; - u8 m_adb_pending_status; - u8 m_adb_latent_result; - s32 m_adb_command_length; - s32 m_adb_command_pos; - u8 m_adb_response_length; - s32 m_adb_response_pos; - u8 m_adb_command_bytes[8]; - u8 m_adb_response_bytes[8]; - u8 m_adb_memory[0x100]; - int m_adb_address_keyboard; - int m_adb_address_mouse; - - u16 m_lastchar, m_strobe; - u8 m_transchar; - bool m_anykeydown; - int m_repeatdelay; + u8 m_adb_command = 0; + u8 m_adb_mode = 0; + u8 m_adb_kmstatus = 0; + u8 m_adb_pending_status = 0; + u8 m_adb_latent_result = 0; + s32 m_adb_command_length = 0; + s32 m_adb_command_pos = 0; + u8 m_adb_response_length = 0; + s32 m_adb_response_pos = 0; + u8 m_adb_command_bytes[8]{}; + u8 m_adb_response_bytes[8]{}; + u8 m_adb_memory[0x100]{}; + int m_adb_address_keyboard = 0; + int m_adb_address_mouse = 0; + + u16 m_lastchar = 0, m_strobe = 0; + u8 m_transchar = 0; + bool m_anykeydown = false; + int m_repeatdelay = 0; u8 adb_read_datareg(); u8 adb_read_kmstatus(); @@ -559,13 +559,13 @@ void process_clock(); // ZipGS stuff - bool m_accel_unlocked; - bool m_accel_fast; - bool m_accel_present; - bool m_accel_temp_slowdown; - int m_accel_stage; - u32 m_accel_speed; - u8 m_accel_slotspk, m_accel_gsxsettings, m_accel_percent; + bool m_accel_unlocked = false; + bool m_accel_fast = false; + bool m_accel_present = false; + bool m_accel_temp_slowdown = false; + int m_accel_stage = 0; + u32 m_accel_speed = 0; + u8 m_accel_slotspk = 0, m_accel_gsxsettings = 0, m_accel_percent = 0; void accel_full_speed() { @@ -620,11 +620,13 @@ // FF6ACF is speed test routine in ROM 3 +// slow_cycle() - take a 1 MHz cycle. Theory: a 2.8 MHz cycle is 14M / 5. +// 1 MHz is 14M / 14. 14/5 = 2.8 * 65536 (16.16 fixed point) = 0x2cccd. #define slow_cycle() \ { \ if (!machine().side_effects_disabled() && m_last_speed) \ {\ - m_slow_counter += 0x0001999a; \ + m_slow_counter += 0x0002cccd; \ int cycles = (m_slow_counter >> 16) & 0xffff; \ m_slow_counter &= 0xffff; \ m_maincpu->adjust_icount(-cycles); \ @@ -2617,9 +2619,7 @@ (m_rombank ? 0x02 : 0x00) | (m_intcxrom ? 0x01 : 0x00); - case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: - case 0x78: case 0x79: case 0x7a: case 0x7b: case 0x7c: case 0x7d: case 0x7e: case 0x7f: - // todo: does reading these on the IIgs also trigger the joysticks? + case 0x70: // PTRIG - triggers paddles on read or write if (!machine().side_effects_disabled()) { // Zip paddle slowdown (does ZipGS also use the old Zip flag?) @@ -2651,7 +2651,11 @@ } return m_rom[offset + 0x3c000]; - break; + + // The ROM IRQ vectors point here + case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: + case 0x78: case 0x79: case 0x7a: case 0x7b: case 0x7c: case 0x7d: case 0x7e: case 0x7f: + return m_rom[offset + 0x3c000]; default: do_io(offset); @@ -4804,7 +4808,7 @@ A2BUS_SLOT(config, "sl6", m_a2bus, apple2gs_cards, nullptr); A2BUS_SLOT(config, "sl7", m_a2bus, apple2gs_cards, nullptr); - IWM(config, m_iwm, A2GS_7M, 1021800*2); + IWM(config, m_iwm, A2GS_7M, A2GS_MASTER_CLOCK/14); m_iwm->phases_cb().set(FUNC(apple2gs_state::phases_w)); m_iwm->sel35_cb().set(FUNC(apple2gs_state::sel35_w)); m_iwm->devsel_cb().set(FUNC(apple2gs_state::devsel_w)); diff -Nru mame-0.242+dfsg.1/src/mame/drivers/apple3.cpp mame-0.243+dfsg.1/src/mame/drivers/apple3.cpp --- mame-0.242+dfsg.1/src/mame/drivers/apple3.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/apple3.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -41,7 +41,8 @@ void apple3_state::floppy_formats(format_registration &fr) { - fr.add(FLOPPY_A216S_FORMAT); + fr.add(FLOPPY_A216S_DOS_FORMAT); + fr.add(FLOPPY_A216S_PRODOS_FORMAT); fr.add(FLOPPY_RWTS18_FORMAT); fr.add(FLOPPY_EDD_FORMAT); fr.add(FLOPPY_WOZ_FORMAT); diff -Nru mame-0.242+dfsg.1/src/mame/drivers/apricotf.cpp mame-0.243+dfsg.1/src/mame/drivers/apricotf.cpp --- mame-0.242+dfsg.1/src/mame/drivers/apricotf.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/apricotf.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -7,11 +7,6 @@ preliminary driver by Angelo Salese -11/09/2011 - modernised. The portable doesn't seem to have - scroll registers, and it sets the palette to black. - I've added a temporary video output so that you can get - an idea of what the screen should look like. [Robbbert] - ****************************************************************************/ /* @@ -84,8 +79,8 @@ , m_centronics(*this, CENTRONICS_TAG) , m_cent_data_out(*this, "cent_data_out") , m_irqs(*this, "irqs") - , m_p_scrollram(*this, "p_scrollram") - , m_p_paletteram(*this, "p_paletteram") + , m_p_scrollram(*this, "scrollram") + , m_p_paletteram(*this, "paletteram") , m_palette(*this, "palette") { } @@ -272,9 +267,9 @@ { map.unmap_value_high(); map(0x00000, 0x01dff).ram(); - map(0x01e00, 0x01fff).ram().share("p_scrollram"); + map(0x01e00, 0x01fff).ram().share("scrollram"); map(0x02000, 0x3ffff).ram(); - map(0xe0000, 0xe001f).rw(FUNC(f1_state::palette_r), FUNC(f1_state::palette_w)).share("p_paletteram"); + map(0xe0000, 0xe001f).rw(FUNC(f1_state::palette_r), FUNC(f1_state::palette_w)).share("paletteram"); map(0xf8000, 0xfffff).rom().region(I8086_TAG, 0); } diff -Nru mame-0.242+dfsg.1/src/mame/drivers/arcadecl.cpp mame-0.243+dfsg.1/src/mame/drivers/arcadecl.cpp --- mame-0.242+dfsg.1/src/mame/drivers/arcadecl.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/arcadecl.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -290,20 +290,8 @@ * *************************************/ -static const gfx_layout molayout = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { STEP4(0,1) }, - { STEP8(0,4) }, - { STEP8(0,4*8) }, - 8*8*4 -}; - - static GFXDECODE_START( gfx_arcadecl ) - GFXDECODE_ENTRY( "gfx1", 0, molayout, 256, 16 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x4_packed_msb, 256, 16 ) GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/astrocde.cpp mame-0.243+dfsg.1/src/mame/drivers/astrocde.cpp --- mame-0.242+dfsg.1/src/mame/drivers/astrocde.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/astrocde.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -772,7 +772,9 @@ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_COCKTAIL PORT_NAME("P2 Aim Left") PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_COCKTAIL PORT_NAME("P2 Aim Right") PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL - PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "JU:1" ) + PORT_DIPNAME( 0x20, 0x20, DEF_STR( Lives ) ) PORT_DIPLOCATION("JU:1") + PORT_DIPSETTING( 0x20, "3" ) + PORT_DIPSETTING( 0x00, "4" ) PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("P3HANDLE") diff -Nru mame-0.242+dfsg.1/src/mame/drivers/atari_4x4.cpp mame-0.243+dfsg.1/src/mame/drivers/atari_4x4.cpp --- mame-0.242+dfsg.1/src/mame/drivers/atari_4x4.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/atari_4x4.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -117,4 +117,4 @@ } // Anonymous namespace -GAME( 1982, fourx4, 0, fourx4, atari_4x4, atari_4x4_state, empty_init, ROT0, "Atari", "4x4", MACHINE_IS_SKELETON_MECHANICAL ) +GAME( 1982, fourx4, 0, fourx4, atari_4x4, atari_4x4_state, empty_init, ROT0, "Atari", "4x4", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/atarig1.cpp mame-0.243+dfsg.1/src/mame/drivers/atarig1.cpp --- mame-0.242+dfsg.1/src/mame/drivers/atarig1.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/atarig1.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -289,21 +289,10 @@ 8*8 }; -static const gfx_layout anlayout = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { STEP4(0,1) }, - { STEP8(0,4) }, - { STEP8(0,32) }, - 32*8 -}; - static GFXDECODE_START( gfx_atarig1 ) GFXDECODE_ENTRY( "gfx1", 0, pflayout, 0x300, 8 ) - GFXDECODE_ENTRY( "gfx2", 0, anlayout, 0x100, 16 ) + GFXDECODE_ENTRY( "gfx2", 0, gfx_8x8x4_packed_msb, 0x100, 16 ) GFXDECODE_ENTRY( "gfx1", 0, pftoplayout, 0x300, 8 ) GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/atarig42.cpp mame-0.243+dfsg.1/src/mame/drivers/atarig42.cpp --- mame-0.242+dfsg.1/src/mame/drivers/atarig42.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/atarig42.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -495,20 +495,9 @@ 16*8 }; -static const gfx_layout anlayout = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { 0, 1, 2, 3 }, - { 0, 4, 8, 12, 16, 20, 24, 28 }, - { 0*8, 4*8, 8*8, 12*8, 16*8, 20*8, 24*8, 28*8 }, - 32*8 -}; - static GFXDECODE_START( gfx_atarig42 ) GFXDECODE_ENTRY( "gfx1", 0, pflayout, 0x000, 64 ) - GFXDECODE_ENTRY( "gfx2", 0, anlayout, 0x000, 16 ) + GFXDECODE_ENTRY( "gfx2", 0, gfx_8x8x4_packed_msb, 0x000, 16 ) GFXDECODE_ENTRY( "gfx1", 0, pftoplayout, 0x000, 64 ) GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/atarigt.cpp mame-0.243+dfsg.1/src/mame/drivers/atarigt.cpp --- mame-0.242+dfsg.1/src/mame/drivers/atarigt.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/atarigt.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -58,6 +58,7 @@ #include "cpu/m68000/m68000.h" #include "machine/eeprompar.h" +#include "speaker.h" #define LOG_PROTECTION (0) @@ -787,21 +788,9 @@ }; -static const gfx_layout anlayout = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { STEP4(0,1) }, - { STEP8(0,4) }, - { STEP8(0,4*8) }, - 32*8 -}; - - static GFXDECODE_START( gfx_atarigt ) GFXDECODE_ENTRY( "gfx1", 0, pflayout, 0x000, 64 ) - GFXDECODE_ENTRY( "gfx2", 0, anlayout, 0x000, 16 ) + GFXDECODE_ENTRY( "gfx2", 0, gfx_8x8x4_packed_msb, 0x000, 16 ) GFXDECODE_ENTRY( "gfx1", 0, pftoplayout, 0x000, 64 ) GFXDECODE_END @@ -866,6 +855,26 @@ m_cage->irq_handler().set(FUNC(atarigt_state::cage_irq_callback)); } +// for stereo + subwoofer output configuration +void atarigt_state::atarigt_stereo(machine_config &config) +{ + atarigt(config); + + // 3 Channel output directly from CAGE or through motherboard JAMMA output + // based on dedicated cabinet configuration; + // 'universal' kit supports mono and stereo, with/without subwoofer. + SPEAKER(config, "lspeaker").front_left(); + SPEAKER(config, "rspeaker").front_right(); + SPEAKER(config, "subwoofer").front_floor(); // Next to the coin door at dedicated cabinet, just silence for now (not implemented) + + // TODO: correct? sound board has only 1 DAC populated. + m_cage->add_route(0, "rspeaker", 1.0); + m_cage->add_route(1, "lspeaker", 1.0); + m_cage->add_route(2, "lspeaker", 1.0); + m_cage->add_route(3, "rspeaker", 1.0); + m_cage->add_route(4, "subwoofer", 1.0); +} + void atarigt_state::tmek(machine_config &config) { atarigt(config); @@ -876,19 +885,30 @@ m_adc->in_callback<6>().set_ioport("AN2"); m_adc->in_callback<7>().set_ioport("AN3"); + // 5 Channel output (4 Channel input connected to Quad Amp PCB) + SPEAKER(config, "flspeaker").front_left(); + SPEAKER(config, "frspeaker").front_right(); + SPEAKER(config, "rlspeaker").headrest_left(); + SPEAKER(config, "rrspeaker").headrest_right(); + //SPEAKER(config, "subwoofer").seat(); Not implemented, Quad Amp PCB output; + m_cage->set_speedup(0x4fad); + m_cage->add_route(0, "frspeaker", 1.0); // Foward Right + m_cage->add_route(1, "rlspeaker", 1.0); // Back Left + m_cage->add_route(2, "flspeaker", 1.0); // Foward Left + m_cage->add_route(3, "rrspeaker", 1.0); // Back Right } void atarigt_state::primrage(machine_config &config) { - atarigt(config); + atarigt_stereo(config); m_cage->set_speedup(0x42f2); } void atarigt_state::primrage20(machine_config &config) { - atarigt(config); + atarigt_stereo(config); m_cage->set_speedup(0x48a4); } diff -Nru mame-0.242+dfsg.1/src/mame/drivers/atari_s1.cpp mame-0.243+dfsg.1/src/mame/drivers/atari_s1.cpp --- mame-0.242+dfsg.1/src/mame/drivers/atari_s1.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/atari_s1.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -610,9 +610,9 @@ } // Anonymous namespace -GAME( 1976, atarians, 0, atarians, atari_s1, atari_s1_state, empty_init, ROT0, "Atari", "The Atarians", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1977, time2000, 0, atari_s1, atari_s1, atari_s1_state, empty_init, ROT0, "Atari", "Time 2000", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1977, aavenger, 0, atari_s1, atari_s1, atari_s1_state, empty_init, ROT0, "Atari", "Airborne Avenger", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1978, midearth, 0, midearth, atari_s1, atari_s1_state, empty_init, ROT0, "Atari", "Middle Earth", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1978, mideartha, midearth, midearth, atari_s1, atari_s1_state, empty_init, ROT0, "Atari", "Middle Earth (alternate)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1978, spcrider, 0, atari_s1, atari_s1, atari_s1_state, empty_init, ROT0, "Atari", "Space Riders", MACHINE_IS_SKELETON_MECHANICAL ) +GAME( 1976, atarians, 0, atarians, atari_s1, atari_s1_state, empty_init, ROT0, "Atari", "The Atarians", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1977, time2000, 0, atari_s1, atari_s1, atari_s1_state, empty_init, ROT0, "Atari", "Time 2000", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1977, aavenger, 0, atari_s1, atari_s1, atari_s1_state, empty_init, ROT0, "Atari", "Airborne Avenger", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1978, midearth, 0, midearth, atari_s1, atari_s1_state, empty_init, ROT0, "Atari", "Middle Earth", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1978, mideartha, midearth, midearth, atari_s1, atari_s1_state, empty_init, ROT0, "Atari", "Middle Earth (alternate)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1978, spcrider, 0, atari_s1, atari_s1, atari_s1_state, empty_init, ROT0, "Atari", "Space Riders", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/atari_s2.cpp mame-0.243+dfsg.1/src/mame/drivers/atari_s2.cpp --- mame-0.242+dfsg.1/src/mame/drivers/atari_s2.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/atari_s2.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -68,7 +68,7 @@ void atari_s2_map(address_map &map); void atari_s3_map(address_map &map); - bool m_timer_sb = 0; + bool m_timer_sb = false; u8 m_timer_s[5]{}; u8 m_sound0 = 0U; u8 m_sound1 = 0U; @@ -582,6 +582,6 @@ } // Anonymous namespace -GAME( 1979, supermap, 0, atari_s2, atari_s2, atari_s2_state, empty_init, ROT0, "Atari", "Superman (Pinball)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1979, hercules, 0, atari_s2, hercules, atari_s2_state, empty_init, ROT0, "Atari", "Hercules", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1979, roadrunr, 0, atari_s3, atari_s2, atari_s2_state, empty_init, ROT0, "Atari", "Road Runner", MACHINE_IS_SKELETON_MECHANICAL ) +GAME( 1979, supermap, 0, atari_s2, atari_s2, atari_s2_state, empty_init, ROT0, "Atari", "Superman (Pinball)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1979, hercules, 0, atari_s2, hercules, atari_s2_state, empty_init, ROT0, "Atari", "Hercules", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1979, roadrunr, 0, atari_s3, atari_s2, atari_s2_state, empty_init, ROT0, "Atari", "Road Runner", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/atarisy4.cpp mame-0.243+dfsg.1/src/mame/drivers/atarisy4.cpp --- mame-0.242+dfsg.1/src/mame/drivers/atarisy4.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/atarisy4.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -338,7 +338,7 @@ void atarisy4_state::atarisy4_renderer::draw_polygon(uint16_t color) { rectangle clip; - vertex_t v1, v2, v3; + vertex_t v1{}, v2{}, v3{}; atarisy4_polydata &extradata = object_data().next(); render_delegate rd_scan = render_delegate(&atarisy4_renderer::draw_scanline, this); diff -Nru mame-0.242+dfsg.1/src/mame/drivers/atlantis.cpp mame-0.243+dfsg.1/src/mame/drivers/atlantis.cpp --- mame-0.242+dfsg.1/src/mame/drivers/atlantis.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/atlantis.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -625,7 +625,7 @@ void atlantis_state::machine_start() { /* set the fastest DRC options */ - m_maincpu->mips3drc_set_options(MIPS3DRC_FASTEST_OPTIONS); + m_maincpu->mips3drc_set_options(MIPS3DRC_FASTEST_OPTIONS | MIPS3DRC_STRICT_VERIFY | MIPS3DRC_EXTRA_INSTR_CHECK); // Allocate adc timer m_adc_ready_timer = timer_alloc(0); diff -Nru mame-0.242+dfsg.1/src/mame/drivers/badlands_ms.cpp mame-0.243+dfsg.1/src/mame/drivers/badlands_ms.cpp --- mame-0.242+dfsg.1/src/mame/drivers/badlands_ms.cpp 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/badlands_ms.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,200 @@ +// license:BSD-3-Clause +// copyright-holders: + +/* + Bad Lands(Modular System) + + As with most of the 'Modular System' setups, the hardware is heavily modified from the original + and consists of a multi-board stack in a cage, hence different driver. + + This set was assembled from a stack of loose PCBs, so for this game the Modular System cage contains + at least 5 main boards and 1 sub board, but there are almost surely more (MOD 21/1? Something else?). + + MOD-6/1 - MC68000P10, 4 ROMs, RAMs, 20 MHz XTAL. + MOD 1/4 - Sound board (Z8400BB1, 2 x YM2203C). 2 8-dips banks + small sub board with OKI M5205. + MOD 51/1 - Sprite board, has logic + 4 empty ROM sockets. Sprite ROMs are actually on the below board. + MODULAR SYSTEM 2 MOD 5/1 - red sprite ROM board, 12 sprite ROMs populated (maximum 24 ROMs) + MOD 4/3 - Tilemap board, has logic + 4 tilemap ROMs, long thin sub-board (C0477 SOLD) with no chips, just routing along one edge. + + TODO: + - everything, + - derive from badlands_state (badlands.cpp) or badlandsbl_state (badlandsbl.cpp) once all the common points and differences are verified. +*/ + + +#include "emu.h" + +#include "cpu/m68000/m68000.h" +#include "cpu/z80/z80.h" +#include "machine/gen_latch.h" +#include "sound/msm5205.h" +#include "sound/ymopn.h" + +#include "emupal.h" +#include "screen.h" +#include "speaker.h" +#include "tilemap.h" + + +namespace { + +class badlands_ms_state : public driver_device +{ +public: + badlands_ms_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_screen(*this, "screen") + { } + + void badlandsm(machine_config &config); + +protected: + virtual void machine_start() override; + +private: + required_device m_maincpu; + required_device m_screen; + + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + void main_map(address_map &map); +}; + + +uint32_t badlands_ms_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + return 0; +} + + +void badlands_ms_state::machine_start() +{ +} + + +void badlands_ms_state::main_map(address_map &map) +{ + map(0x000000, 0x03ffff).rom(); + map(0xfff000, 0xffffff).ram(); +} + + +static INPUT_PORTS_START( badlandsm ) + PORT_START("DSW") + PORT_DIPUNKNOWN_DIPLOC(0x0001, 0x0001, "SW1:1") + PORT_DIPUNKNOWN_DIPLOC(0x0002, 0x0002, "SW1:2") + PORT_DIPUNKNOWN_DIPLOC(0x0004, 0x0004, "SW1:3") + PORT_DIPUNKNOWN_DIPLOC(0x0008, 0x0008, "SW1:4") + PORT_DIPUNKNOWN_DIPLOC(0x0010, 0x0010, "SW1:5") + PORT_DIPUNKNOWN_DIPLOC(0x0020, 0x0020, "SW1:6") + PORT_DIPUNKNOWN_DIPLOC(0x0040, 0x0040, "SW1:7") + PORT_DIPUNKNOWN_DIPLOC(0x0080, 0x0080, "SW1:8") + PORT_DIPUNKNOWN_DIPLOC(0x0100, 0x0100, "SW2:1") + PORT_DIPUNKNOWN_DIPLOC(0x0200, 0x0200, "SW2:2") + PORT_DIPUNKNOWN_DIPLOC(0x0400, 0x0400, "SW2:3") + PORT_DIPUNKNOWN_DIPLOC(0x0800, 0x0800, "SW2:4") + PORT_DIPUNKNOWN_DIPLOC(0x1000, 0x1000, "SW2:5") + PORT_DIPUNKNOWN_DIPLOC(0x2000, 0x2000, "SW2:6") + PORT_DIPUNKNOWN_DIPLOC(0x4000, 0x4000, "SW2:7") + PORT_DIPUNKNOWN_DIPLOC(0x8000, 0x8000, "SW2:8") +INPUT_PORTS_END + + +static const gfx_layout tiles_layout = +{ + 16,16, + RGN_FRAC(1,1), + 4, + { 0,8,16,24 }, + { 0,1,2,3,4,5,6,7, 512,513,514,515,516,517,518,519 }, + { STEP16(0,32) }, + 16 * 16 * 4 +}; + +static GFXDECODE_START( gfx_badlandsm ) // TODO: needs adjusting, especially sprites + GFXDECODE_ENTRY( "tiles", 0, tiles_layout, 0, 8 ) + GFXDECODE_ENTRY( "sprites", 0, tiles_layout, 128, 8 ) +GFXDECODE_END + + +void badlands_ms_state::badlandsm(machine_config &config) +{ + // basic machine hardware + M68000(config, m_maincpu, 20_MHz_XTAL / 2); // divisor unknown + m_maincpu->set_addrmap(AS_PROGRAM, &badlands_ms_state::main_map); + + Z80(config, "audiocpu", 20_MHz_XTAL / 5).set_disable(); // divisor unknown + + // video hardware + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); // all wrong + 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(0, 256-1, 0, 256-32-1); + m_screen->set_screen_update(FUNC(badlands_ms_state::screen_update)); + m_screen->set_palette("palette"); + + PALETTE(config, "palette").set_format(palette_device::IRGB_1555, 256).set_membits(8); + + GFXDECODE(config, "gfxdecode", "palette", gfx_badlandsm); + + // sound hardware + SPEAKER(config, "mono").front_center(); + + GENERIC_LATCH_8(config, "soundlatch"); + + YM2203(config, "ym1", 20_MHz_XTAL / 5).add_route(ALL_OUTPUTS, "mono", 0.15); // divisor unknown + + YM2203(config, "ym2", 20_MHz_XTAL / 5).add_route(ALL_OUTPUTS, "mono", 0.15); // divisor unknown + + MSM5205(config, "msm", 20_MHz_XTAL / 5).add_route(ALL_OUTPUTS, "mono", 0.15); // divisor unknown +} + +ROM_START( badlandsm ) + ROM_REGION( 0x100000, "maincpu", 0 ) // on MOD 6/1 board, very similar to badlandsb + ROM_LOAD16_BYTE( "mod-6-1_cpu_ba_603a.ic17", 0x00000, 0x10000, CRC(ee03753e) SHA1(42b3f214aa889cb62096016cc214ea7f5dde5e93) ) + ROM_LOAD16_BYTE( "mod-6-1_cpu_ba_606a.ic8", 0x00001, 0x10000, CRC(f22364a2) SHA1(d077bdcad3c0d301007e3fa539039b4a40bbc399) ) + ROM_LOAD16_BYTE( "mod-6-1_cpu_ba_602.ic20", 0x20000, 0x10000, CRC(0e2e807f) SHA1(5b61de066dca12c44335aa68a13c821845657866) ) + ROM_LOAD16_BYTE( "mod-6-1_cpu_ba_605.ic11", 0x20001, 0x10000, CRC(99a20c2c) SHA1(9b0a5a5dafb8816e72330d302c60339b600b49a8) ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) // on MOD 1/4 board + ROM_LOAD( "mod-1-4_sound_ba_401.ic12", 0x00000, 0x10000, CRC(6cddace7) SHA1(f53c3d6fdec22bc2d39814d482db76aa0fc18af7) ) + + ROM_REGION( 0x80000, "tiles", ROMREGION_INVERT ) // on MOD 4/2 board, different format from original and other bootlegs + ROM_LOAD32_BYTE( "mod-4-3_ba_401.ic17", 0x00003, 0x20000, CRC(a943e878) SHA1(4330c5599c23818044ccba82331abe31b1d8216a) ) + ROM_LOAD32_BYTE( "mod-4-3_ba_402.ic16", 0x00002, 0x20000, CRC(cbf9f01d) SHA1(390aaed71b247099320118d8b8d59ec10f65a11c) ) + ROM_LOAD32_BYTE( "mod-4-3_ba_403.ic15", 0x00001, 0x20000, CRC(b27dc32a) SHA1(8e56a0a17d505e3a65a5d2c2c6314f21a4630485) ) + ROM_LOAD32_BYTE( "mod-4-3_ba_404.ic14", 0x00000, 0x20000, CRC(263f474f) SHA1(86b6762bcc28117e65cb201c9bc5a12c3f350e46) ) + + ROM_REGION( 0xc0000, "sprites", ROMREGION_ERASEFF | ROMREGION_INVERT ) // on MODULAR SYSTEM 2 MOD 5/1 board, different format from original and other bootlegs. TODO: verify ROM loading + ROM_LOAD32_BYTE( "mod-5-1_ba_503.ic3", 0x00003, 0x10000, CRC(4f3c9a22) SHA1(6ee806aaf663540902a372c04592d2e3030934aa) ) // xxxxxxxxxxxx1xxx = 0x00 + ROM_LOAD32_BYTE( "mod-5-1_ba_512.ic12", 0x00002, 0x10000, CRC(352f2167) SHA1(dd4aea8450e42b6f70801bbb1091df63bffbe463) ) // xxxxxxxxxxxx1xxx = 0x00 + ROM_LOAD32_BYTE( "mod-5-1_ba_518.ic18", 0x00001, 0x10000, CRC(834aa5ef) SHA1(0761110de2a27453fc654970f8a7540fcd2c2615) ) // xxxxxxxxxxxx1xxx = 0x00 + ROM_LOAD32_BYTE( "mod-5-1_ba_524.ic24", 0x00000, 0x10000, CRC(5d7f2231) SHA1(685ab5214c800ef49a6da1cdea5a672a03c281b3) ) // xxxxxxxxxxxx1xxx = 0x00 + ROM_LOAD32_BYTE( "mod-5-1_ba_504.ic4", 0x40003, 0x10000, CRC(690fc050) SHA1(5d77b674ff3fa5701d8fe0f4d4aa4d6821d4da7c) ) + ROM_LOAD32_BYTE( "mod-5-1_ba_513.ic13", 0x40002, 0x10000, CRC(d239ac97) SHA1(4809760dc4c3c3b830402450bd24ccc161bf01f1) ) + ROM_LOAD32_BYTE( "mod-5-1_ba_519.ic19", 0x40001, 0x10000, CRC(bf2cc0f9) SHA1(9175eeac707c04795e1198e8d3a4aac8e64f74d1) ) // xxxxxxxxxxxx1xxx = 0x00 + ROM_LOAD32_BYTE( "mod-5-1_ba_525.ic25", 0x40000, 0x10000, CRC(26d53fc5) SHA1(f0eebbe31fb887ce7c91f5268af2af373ecc88c2) ) // xxxxxxxxxxxx1xxx = 0x00 + ROM_LOAD32_BYTE( "mod-5-1_ba_505.ic5", 0x80003, 0x10000, CRC(a5f91533) SHA1(add36c54a6caec431434b138180d7ca38411d84e) ) + ROM_LOAD32_BYTE( "mod-5-1_ba_514.ic14", 0x80002, 0x10000, CRC(5d3e52e8) SHA1(f8bbc9067058af6ee5ca2ac79c5deba6fd6a366b) ) + ROM_LOAD32_BYTE( "mod-5-1_ba_520.ic20", 0x80001, 0x10000, CRC(f4e132ae) SHA1(c34b4a3b204035e2f4d5209aee48673f758f3ceb) ) + ROM_LOAD32_BYTE( "mod-5-1_ba_526.ic26", 0x80000, 0x10000, CRC(243a6bc8) SHA1(7f3e6031824c28f37afafc80fc9757bb5f80e660) ) + + ROM_REGION( 0x120, "proms", 0 ) // PROMs (function unknown) + ROM_LOAD( "mod-1-4_sound_105_82s123.ic20", 0x000, 0x020, CRC(14d72781) SHA1(372dc021d8aaf4aa6fd46e69a3d8f1c68113426f) ) + ROM_LOAD( "mod-51-1_502_82s129a.ic10", 0x020, 0x100, CRC(15085e44) SHA1(646e7100fcb112594023cf02be036bd3d42cc13c) ) + + ROM_REGION( 0x1000, "plds", ROMREGION_ERASEFF ) + ROM_LOAD( "mod-6-1_cpu_644_gal16v8.ic13", 0x000, 0x117, NO_DUMP ) + ROM_LOAD( "mod-6-1_cpu_643_gal16v8.ic7", 0x000, 0x117, CRC(d05b2c26) SHA1(51b718554bfba96a3c9e7b3a000fc80679044cb3) ) + ROM_LOAD( "mod-4-3_403_gal16v8.ic29", 0x000, 0x117, CRC(c136de93) SHA1(116f6d3b456d20621ab07a005c1421f57569915c) ) + ROM_LOAD( "mod-51-1_50503_pal16r6.ic46", 0x000, 0x104, CRC(07eb86d2) SHA1(482eb325df5bc60353bac85412cf45429cd03c6d) ) + ROM_LOAD( "mod-5-1_5143_gal16v8.ic9", 0x000, 0x117, CRC(2d9cf890) SHA1(b8e3bdfe8543a8729e0397166780036b074f4bc5) ) + ROM_LOAD( "mod-5-1_5242_gal16v8.ic8", 0x000, 0x117, NO_DUMP ) +ROM_END + +} // anonymous namespace + + +GAME( 199?, badlandsm, badlands, badlandsm, badlandsm, badlands_ms_state, empty_init, ROT0, "bootleg (Gaelco / Ervisa)", "Bad Lands (Modular System)", MACHINE_IS_SKELETON ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/baraduke.cpp mame-0.243+dfsg.1/src/mame/drivers/baraduke.cpp --- mame-0.242+dfsg.1/src/mame/drivers/baraduke.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/baraduke.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -336,24 +336,11 @@ 16*8 }; -static const gfx_layout spritelayout = -{ - 16,16, - RGN_FRAC(1,1), - 4, - { 0, 1, 2, 3 }, - { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4, - 8*4, 9*4, 10*4, 11*4, 12*4, 13*4, 14*4, 15*4 }, - { 8*8*0, 8*8*1, 8*8*2, 8*8*3, 8*8*4, 8*8*5, 8*8*6, 8*8*7, - 8*8*8, 8*8*9, 8*8*10, 8*8*11, 8*8*12, 8*8*13, 8*8*14, 8*8*15 }, - 128*8 -}; - static GFXDECODE_START( gfx_baraduke ) - GFXDECODE_ENTRY( "gfx1", 0, text_layout, 0, 512 ) - GFXDECODE_ENTRY( "gfx2", 0x0000, tile_layout, 0, 256 ) - GFXDECODE_ENTRY( "gfx2", 0x4000, tile_layout, 0, 256 ) - GFXDECODE_ENTRY( "gfx3", 0, spritelayout, 0, 128 ) + GFXDECODE_ENTRY( "gfx1", 0, text_layout, 0, 512 ) + GFXDECODE_ENTRY( "gfx2", 0x0000, tile_layout, 0, 256 ) + GFXDECODE_ENTRY( "gfx2", 0x4000, tile_layout, 0, 256 ) + GFXDECODE_ENTRY( "gfx3", 0, gfx_16x16x4_packed_msb, 0, 128 ) GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/barni.cpp mame-0.243+dfsg.1/src/mame/drivers/barni.cpp --- mame-0.242+dfsg.1/src/mame/drivers/barni.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/barni.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -20,6 +20,11 @@ - Skeletons TODO: +- Inputs +- Outputs +- Save states +- Sound +- Mechanical sounds - Almost everything - Value of crystal on audio cpu - Outputs (solenoids, lamps) @@ -244,7 +249,7 @@ m_audiocpu->set_addrmap(AS_PROGRAM, &barni_state::audiocpu_map); PIA6821(config, m_pias1, 0); // U12 - m_pias1->writepa_handler().set(m_speech, FUNC(tms5200_device::data_w)); + m_pias1->writepa_handler().set(m_speech, FUNC(tms5220_device::data_w)); m_pias1->writepb_handler().set(FUNC(barni_state::pias1_pb_w)); m_pias1->irqa_handler().set_inputline(m_maincpu, M6802_IRQ_LINE); m_pias1->irqb_handler().set_inputline(m_maincpu, M6802_IRQ_LINE); diff -Nru mame-0.242+dfsg.1/src/mame/drivers/battlex.cpp mame-0.243+dfsg.1/src/mame/drivers/battlex.cpp --- mame-0.242+dfsg.1/src/mame/drivers/battlex.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/battlex.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -238,17 +238,6 @@ * *************************************/ -static const gfx_layout battlex_charlayout = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { 0,1,2,3 }, - { 0, 4, 8, 12, 16, 20, 24, 28 }, - { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 }, - 8*8*4 -}; - static const gfx_layout battlex_spritelayout = { 16,16, @@ -263,8 +252,8 @@ }; static GFXDECODE_START( gfx_battlex ) - GFXDECODE_ENTRY( "gfx1", 0, battlex_charlayout, 64, 8 ) - GFXDECODE_ENTRY( "gfx2", 0, battlex_spritelayout, 0, 8 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x4_packed_msb, 64, 8 ) + GFXDECODE_ENTRY( "gfx2", 0, battlex_spritelayout, 0, 8 ) GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/bbusters.cpp mame-0.243+dfsg.1/src/mame/drivers/bbusters.cpp --- mame-0.242+dfsg.1/src/mame/drivers/bbusters.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/bbusters.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -463,18 +463,6 @@ /******************************************************************************/ -static const gfx_layout charlayout = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { STEP4(0,1) }, - { STEP8(0,4) }, - { STEP8(0,4*8) }, - 32*8 -}; - - static const gfx_layout tilelayout = { 16,16, /* 16*16 sprites */ @@ -487,7 +475,7 @@ }; static GFXDECODE_START( gfx_bbusters ) - GFXDECODE_ENTRY( "tx_tiles", 0, charlayout, 0, 16 ) + GFXDECODE_ENTRY( "tx_tiles", 0, gfx_8x8x4_packed_msb, 0, 16 ) GFXDECODE_ENTRY( "gfx4", 0, tilelayout, 768, 16 ) GFXDECODE_ENTRY( "gfx5", 0, tilelayout, 1024+256, 16 ) GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/bionicc.cpp mame-0.243+dfsg.1/src/mame/drivers/bionicc.cpp --- mame-0.242+dfsg.1/src/mame/drivers/bionicc.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/bionicc.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -164,8 +164,8 @@ void audiocpu_nmi_w(u8 data); // protection mcu - u8 m_audiocpu_to_mcu; // ls374 at 4a - u8 m_mcu_to_audiocpu; // ls374 at 5a + u8 m_audiocpu_to_mcu = 0; // ls374 at 4a + u8 m_mcu_to_audiocpu = 0; // ls374 at 5a u8 m_mcu_p1 = 0; u8 m_mcu_p3; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/blitz68k.cpp mame-0.243+dfsg.1/src/mame/drivers/blitz68k.cpp --- mame-0.242+dfsg.1/src/mame/drivers/blitz68k.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/blitz68k.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -111,6 +111,7 @@ void init_maxidbl(); void init_cj3play(); void init_surpr5(); + void init_super97(); void init_texasrls(); void init_cjbj(); void init_megadblj(); @@ -2463,6 +2464,29 @@ ROM_LOAD( "gal16v8d_dec.u70", 0x000, 0x117, NO_DUMP ) ROM_END +ROM_START( super97 ) // CJ-8L REV-B, all labels but the MCU's one handwritten + ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code + ROM_LOAD16_WORD( "super 97 1.00-a.u65", 0x00000, 0x80000, CRC(934a121f) SHA1(9490537946364de38cae6428e2c212c7d2ee8588) ) // 27C040, 1ST AND 2ND HALF IDENTICAL + + ROM_REGION( 0x2000, "mcu", 0 ) // 68HC705C8P code + ROM_LOAD( "cj-super97 2.2 for cj-8l 10-02-1997.u30", 0x0000, 0x2000, NO_DUMP ) + + ROM_REGION16_BE( 0x200000, "blitter", ROMREGION_ERASE00 ) // data for the blitter + ROM_LOAD16_BYTE( "super97 0.02-d.u68", 0x000000, 0x80000, CRC(97526727) SHA1(12a39695aa7401e82e071c5d6fbb81d6ea6caaff) ) // 27C040 + ROM_LOAD16_BYTE( "super97 0.02-c.u75", 0x000001, 0x80000, CRC(96d5f53a) SHA1(c160a44f4851fc5d333772b62ae4bf5a9298baf4) ) // 27C040 + // u51 and u61 not populated + + ROM_REGION( 0x40000, "samples", 0 ) // 8 bit unsigned + ROM_LOAD( "super97 0.02-g.u50", 0x00000, 0x40000, CRC(f97c2cc5) SHA1(e9b8d689aaac8e2e35f6a471b4b6a709617d9ec1) ) // 27C020, 1xxxxxxxxxxxxxxxxx = 0xFF + + ROM_REGION( 0x117, "plds", 0 ) + ROM_LOAD( "gal16v8d_vdp.u15", 0x000, 0x117, NO_DUMP ) + ROM_LOAD( "gal16v8d_vdo.u53", 0x000, 0x117, NO_DUMP ) + ROM_LOAD( "gal16v8d_ck2.u64", 0x000, 0x117, NO_DUMP ) + ROM_LOAD( "gal16v8d_ck1.u69", 0x000, 0x117, NO_DUMP ) + ROM_LOAD( "gal16v8d_dec.u70", 0x000, 0x117, NO_DUMP ) +ROM_END + ROM_START( cjplus ) ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code ROM_LOAD16_WORD( "a.u65", 0x00000, 0x80000, CRC(7a98f02d) SHA1(60f6b6ae91f9be7ebff84b7f55d04045931bdb4e) ) @@ -3112,6 +3136,17 @@ rom[0x1fd56/2] = 0x6054; } +void blitz68k_state::init_super97() +{ + uint16_t *rom = (uint16_t *)memregion("maincpu")->base(); + + // WRONG C8 #1 + rom[0x9e9c/2] = 0x6028; + + // ERROR CHECKSUM ROM PROGRAM + rom[0x17158/2] = 0x6054; +} + void blitz68k_state::init_cjplus() { uint16_t *rom = (uint16_t *)memregion("maincpu")->base(); @@ -3233,6 +3268,7 @@ GAME( 1995, hermit, 0, hermit, hermit, blitz68k_state, init_hermit, ROT0, "Dugamex", "The Hermit (Ver. 1.14)", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION | MACHINE_NO_SOUND ) // APRIL 1995 GAME( 1997, deucesw2, 0, deucesw2, deucesw2, blitz68k_state, init_deucesw2, ROT0, "", "Deuces Wild 2 - American Heritage (Ver. 2.02F)", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION | MACHINE_NO_SOUND ) // APRIL 10TH, 1997 GAME( 1997, surpr5, 0, cjffruit, surpr5, blitz68k_state, init_surpr5, ROT0, "Cadillac Jack", "Surprise 5 (Ver. 1.19)", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION | MACHINE_NO_SOUND ) // APRIL 25TH, 1997 +GAME( 1997, super97, 0, cjffruit, surpr5, blitz68k_state, init_super97, ROT0, "Cadillac Jack", "Super 97 (Ver. 1.00)", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION | MACHINE_NO_SOUND ) // OCTOBER 22ND, 1997 GAME( 1998, cj3play, 0, cjffruit, cjffruit, blitz68k_state, init_cj3play, ROT0, "Cadillac Jack", "Triple Play (Ver. 1.10)", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION | MACHINE_NO_SOUND ) // FEBRUARY 24TH, 1999 GAME( 1998, cjffruit, 0, cjffruit, cjffruit, blitz68k_state, init_cjffruit, ROT0, "Cadillac Jack", "Funny Fruit (Ver. 1.13)", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION | MACHINE_NO_SOUND ) // APRIL 21ST, 1999 GAME( 1998, texasrls, 0, texasrls, cjffruit, blitz68k_state, init_texasrls, ROT0, "Cadillac Jack", "Texas Reels (Ver. 2.00)", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION | MACHINE_NO_SOUND ) // OCTOBER 15TH, 2002 diff -Nru mame-0.242+dfsg.1/src/mame/drivers/blktiger_ms.cpp mame-0.243+dfsg.1/src/mame/drivers/blktiger_ms.cpp --- mame-0.242+dfsg.1/src/mame/drivers/blktiger_ms.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/blktiger_ms.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -355,8 +355,8 @@ void blktiger_ms_state::init_blktigerm() { - uint8_t *src = memregion("maincpu")->base(); - int len = 0x50000; + uint8_t *const src = memregion("maincpu")->base(); + int const len = 0x50000; // bitswap data for (int i = 0; i < len; i++) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/bloodbro_ms.cpp mame-0.243+dfsg.1/src/mame/drivers/bloodbro_ms.cpp --- mame-0.242+dfsg.1/src/mame/drivers/bloodbro_ms.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/bloodbro_ms.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -243,7 +243,7 @@ ROM_LOAD( "1-2_bb101.ic12", 0x00000, 0x10000, CRC(3e184e74) SHA1(031cd37fe6d09daf8c9e88562da99fde03f52109) ) // dumper's note: ROMs [bb4b1, bb4b2, bb4b3, bb4b4] and [bb4a1, bb4a2, bb4a3, bb4a4] have a strange setup - // with pins 32, 31 and 31 soldered together and pin 2 connected between all four chips, + // with pins 32, 31 and 30 soldered together and pin 2 connected between all four chips, // while the sockets are for 28 pin chips (with 27C512 silkscreened on the PCB behind the chips) ROM_REGION( 0x80000, "gfx1", 0 ) // on one of the MOD 4/3 boards ROM_LOAD32_BYTE( "4-3-a_bb4a1.ic17", 0x00003, 0x20000, CRC(499c91db) SHA1(bd7142a311a4f3e606f8a31aafc0b504f3d5a2e4) ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/bob85.cpp mame-0.243+dfsg.1/src/mame/drivers/bob85.cpp --- mame-0.242+dfsg.1/src/mame/drivers/bob85.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/bob85.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -53,10 +53,10 @@ DECLARE_WRITE_LINE_MEMBER(sod_w); DECLARE_READ_LINE_MEMBER(sid_r); TIMER_DEVICE_CALLBACK_MEMBER(kansas_r); - uint8_t m_prev_key; - uint8_t m_count_key; - u16 m_casscnt; - bool m_cassold, m_cassbit; + uint8_t m_prev_key = 0; + uint8_t m_count_key = 0; + u16 m_casscnt = 0; + bool m_cassold = false, m_cassbit = false; void machine_start() override; required_device m_maincpu; required_device m_cass; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/bottom9.cpp mame-0.243+dfsg.1/src/mame/drivers/bottom9.cpp --- mame-0.242+dfsg.1/src/mame/drivers/bottom9.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/bottom9.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -15,16 +15,167 @@ ***************************************************************************/ #include "emu.h" -#include "includes/bottom9.h" + #include "includes/konamipt.h" +#include "video/k051316.h" +#include "video/k051960.h" +#include "video/k052109.h" +#include "video/konami_helper.h" -#include "cpu/z80/z80.h" #include "cpu/m6809/hd6309.h" +#include "cpu/z80/z80.h" #include "machine/gen_latch.h" #include "machine/watchdog.h" +#include "sound/k007232.h" + +#include "emupal.h" +#include "screen.h" #include "speaker.h" +namespace { + +class bottom9_state : public driver_device +{ +public: + bottom9_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_k007232(*this, "k007232_%u", 1U), + m_k052109(*this, "k052109"), + m_k051960(*this, "k051960"), + m_k051316(*this, "k051316"), + m_palette(*this, "palette"), + m_mainbank(*this, "mainbank") + { } + + void bottom9(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + +private: + // misc + uint8_t m_video_enable = 0; + uint8_t m_zoomreadroms = 0; + uint8_t m_k052109_selected = 0; + uint8_t m_nmienable = 0; + + static constexpr int m_layer_colorbase[3] = { 0 / 16, 0 / 16, 256 / 16 }; + + // devices + required_device m_maincpu; + required_device m_audiocpu; + required_device_array m_k007232; + required_device m_k052109; + required_device m_k051960; + required_device m_k051316; + required_device m_palette; + + required_memory_bank m_mainbank; + + uint8_t k052109_051960_r(offs_t offset); + void k052109_051960_w(offs_t offset, uint8_t data); + uint8_t bankedram1_r(offs_t offset); + void bankedram1_w(offs_t offset, uint8_t data); + uint8_t bankedram2_r(offs_t offset); + void bankedram2_w(offs_t offset, uint8_t data); + void bankswitch_w(uint8_t data); + void _1f90_w(uint8_t data); + void sh_irqtrigger_w(uint8_t data); + void nmi_enable_w(uint8_t data); + void sound_bank_w(uint8_t data); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + INTERRUPT_GEN_MEMBER(sound_interrupt); + template void volume_callback(uint8_t data); + K051316_CB_MEMBER(zoom_callback); + K052109_CB_MEMBER(tile_callback); + K051960_CB_MEMBER(sprite_callback); + void audio_map(address_map &map); + void main_map(address_map &map); +}; + + +// video + +/*************************************************************************** + + Callbacks for the K052109 + +***************************************************************************/ + +K052109_CB_MEMBER(bottom9_state::tile_callback) +{ + *code |= (*color & 0x3f) << 8; + *color = m_layer_colorbase[layer] + ((*color & 0xc0) >> 6); +} + + +/*************************************************************************** + + Callbacks for the K051960 + +***************************************************************************/ + +K051960_CB_MEMBER(bottom9_state::sprite_callback) +{ + enum { sprite_colorbase = 512 / 16 }; + + // bit 4 = priority over zoom (0 = have priority) + // bit 5 = priority over B (1 = have priority) + *priority = 0; + if ( *color & 0x10) *priority |= GFX_PMASK_1; + if (~*color & 0x20) *priority |= GFX_PMASK_2; + + *color = sprite_colorbase + (*color & 0x0f); +} + + +/*************************************************************************** + + Callbacks for the K051316 + +***************************************************************************/ + +K051316_CB_MEMBER(bottom9_state::zoom_callback) +{ + enum { zoom_colorbase = 768 / 16 }; + + *flags = (*color & 0x40) ? TILE_FLIPX : 0; + *code |= ((*color & 0x03) << 8); + *color = zoom_colorbase + ((*color & 0x3c) >> 2); +} + + +/*************************************************************************** + + Display refresh + +***************************************************************************/ + +uint32_t bottom9_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + m_k052109->tilemap_update(); + + // note: FIX layer is not used + bitmap.fill(m_layer_colorbase[1], cliprect); + screen.priority().fill(0, cliprect); + +// if (m_video_enable) + { + m_k051316->zoom_draw(screen, bitmap, cliprect, 0, 1); + m_k052109->tilemap_draw(screen, bitmap, cliprect, 2, 0, 2); + m_k051960->k051960_sprites_draw(bitmap, cliprect, screen.priority(), -1, -1); + m_k052109->tilemap_draw(screen, bitmap, cliprect, 1, 0, 0); + } + return 0; +} + + +// machine + uint8_t bottom9_state::k052109_051960_r(offs_t offset) { if (m_k052109->get_rmrd_line() == CLEAR_LINE) @@ -50,7 +201,7 @@ m_k051960->k051960_w(offset - 0x3c00, data); } -uint8_t bottom9_state::bottom9_bankedram1_r(offs_t offset) +uint8_t bottom9_state::bankedram1_r(offs_t offset) { if (m_k052109_selected) return k052109_051960_r(offset); @@ -63,7 +214,7 @@ } } -void bottom9_state::bottom9_bankedram1_w(offs_t offset, uint8_t data) +void bottom9_state::bankedram1_w(offs_t offset, uint8_t data) { if (m_k052109_selected) k052109_051960_w(offset, data); @@ -71,7 +222,7 @@ m_k051316->write(offset, data); } -uint8_t bottom9_state::bottom9_bankedram2_r(offs_t offset) +uint8_t bottom9_state::bankedram2_r(offs_t offset) { if (m_k052109_selected) return k052109_051960_r(offset + 0x2000); @@ -79,7 +230,7 @@ return m_palette->basemem().read8(offset); } -void bottom9_state::bottom9_bankedram2_w(offs_t offset, uint8_t data) +void bottom9_state::bankedram2_w(offs_t offset, uint8_t data) { if (m_k052109_selected) k052109_051960_w(offset + 0x2000, data); @@ -89,46 +240,46 @@ void bottom9_state::bankswitch_w(uint8_t data) { - int bank; - - /* bit 0 = RAM bank */ + // bit 0 = RAM bank if ((data & 1) == 0) - popmessage("bankswitch RAM bank 0"); + logerror("bankswitch RAM bank 0"); + + // bit 1-4 = ROM bank + int bank; - /* bit 1-4 = ROM bank */ if (data & 0x10) bank = 8 + ((data & 0x06) >> 1); else bank = ((data & 0x0e) >> 1); - membank("bank1")->set_entry(bank); + m_mainbank->set_entry(bank); } -void bottom9_state::bottom9_1f90_w(uint8_t data) +void bottom9_state::_1f90_w(uint8_t data) { - /* bits 0/1 = coin counters */ + // bits 0/1 = coin counters machine().bookkeeping().coin_counter_w(0, data & 0x01); machine().bookkeeping().coin_counter_w(1, data & 0x02); - /* bit 2 = enable char ROM reading through the video RAM */ + // bit 2 = enable char ROM reading through the video RAM m_k052109->set_rmrd_line((data & 0x04) ? ASSERT_LINE : CLEAR_LINE); - /* bit 3 = disable video */ + // bit 3 = disable video m_video_enable = ~data & 0x08; - /* bit 4 = enable 051316 ROM reading */ + // bit 4 = enable 051316 ROM reading m_zoomreadroms = data & 0x10; - /* bit 5 = RAM bank */ + // bit 5 = RAM bank m_k052109_selected = data & 0x20; } -void bottom9_state::bottom9_sh_irqtrigger_w(uint8_t data) +void bottom9_state::sh_irqtrigger_w(uint8_t data) { m_audiocpu->set_input_line_and_vector(0, HOLD_LINE, 0xff); // Z80 } -INTERRUPT_GEN_MEMBER(bottom9_state::bottom9_sound_interrupt) +INTERRUPT_GEN_MEMBER(bottom9_state::sound_interrupt) { if (m_nmienable) device.execute().pulse_input_line(INPUT_LINE_NMI, attotime::zero); @@ -141,37 +292,35 @@ void bottom9_state::sound_bank_w(uint8_t data) { - int bank_A, bank_B; - - bank_A = ((data >> 0) & 0x03); - bank_B = ((data >> 2) & 0x03); - m_k007232_1->set_bank(bank_A, bank_B); + int bank_A = ((data >> 0) & 0x03); + int bank_B = ((data >> 2) & 0x03); + m_k007232[0]->set_bank(bank_A, bank_B); bank_A = ((data >> 4) & 0x03); bank_B = ((data >> 6) & 0x03); - m_k007232_2->set_bank(bank_A, bank_B); + m_k007232[1]->set_bank(bank_A, bank_B); } void bottom9_state::main_map(address_map &map) { map(0x0000, 0x3fff).rw(FUNC(bottom9_state::k052109_051960_r), FUNC(bottom9_state::k052109_051960_w)); - map(0x0000, 0x07ff).rw(FUNC(bottom9_state::bottom9_bankedram1_r), FUNC(bottom9_state::bottom9_bankedram1_w)); + map(0x0000, 0x07ff).rw(FUNC(bottom9_state::bankedram1_r), FUNC(bottom9_state::bankedram1_w)); map(0x1f80, 0x1f80).w(FUNC(bottom9_state::bankswitch_w)); - map(0x1f90, 0x1f90).w(FUNC(bottom9_state::bottom9_1f90_w)); + map(0x1f90, 0x1f90).w(FUNC(bottom9_state::_1f90_w)); map(0x1fa0, 0x1fa0).w("watchdog", FUNC(watchdog_timer_device::reset_w)); map(0x1fb0, 0x1fb0).w("soundlatch", FUNC(generic_latch_8_device::write)); - map(0x1fc0, 0x1fc0).w(FUNC(bottom9_state::bottom9_sh_irqtrigger_w)); + map(0x1fc0, 0x1fc0).w(FUNC(bottom9_state::sh_irqtrigger_w)); map(0x1fd0, 0x1fd0).portr("SYSTEM"); map(0x1fd1, 0x1fd1).portr("P1"); map(0x1fd2, 0x1fd2).portr("P2"); map(0x1fd3, 0x1fd3).portr("DSW1"); map(0x1fe0, 0x1fe0).portr("DSW2"); map(0x1ff0, 0x1fff).w(m_k051316, FUNC(k051316_device::ctrl_w)); - map(0x2000, 0x27ff).rw(FUNC(bottom9_state::bottom9_bankedram2_r), FUNC(bottom9_state::bottom9_bankedram2_w)).share("palette"); + map(0x2000, 0x27ff).rw(FUNC(bottom9_state::bankedram2_r), FUNC(bottom9_state::bankedram2_w)).share("palette"); map(0x4000, 0x5fff).ram(); - map(0x6000, 0x7fff).bankr("bank1"); - map(0x8000, 0xffff).rom(); + map(0x6000, 0x7fff).bankr(m_mainbank); + map(0x8000, 0xffff).rom().region("maincpu", 0x18000); } void bottom9_state::audio_map(address_map &map) @@ -179,8 +328,8 @@ map(0x0000, 0x7fff).rom(); map(0x8000, 0x87ff).ram(); map(0x9000, 0x9000).w(FUNC(bottom9_state::sound_bank_w)); - map(0xa000, 0xa00d).rw(m_k007232_1, FUNC(k007232_device::read), FUNC(k007232_device::write)); - map(0xb000, 0xb00d).rw(m_k007232_2, FUNC(k007232_device::read), FUNC(k007232_device::write)); + map(0xa000, 0xa00d).rw(m_k007232[0], FUNC(k007232_device::read), FUNC(k007232_device::write)); + map(0xb000, 0xb00d).rw(m_k007232[1], FUNC(k007232_device::read), FUNC(k007232_device::write)); map(0xd000, 0xd000).r("soundlatch", FUNC(generic_latch_8_device::read)); map(0xf000, 0xf000).w(FUNC(bottom9_state::nmi_enable_w)); } @@ -228,7 +377,7 @@ PORT_DIPNAME( 0x10, 0x10, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW3:1") PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "SW3:2" ) /* According to manual: N/U */ + PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "SW3:2" ) // According to manual: N/U PORT_SERVICE_DIPLOC( 0x40, IP_ACTIVE_LOW, "SW3:3" ) PORT_DIPNAME( 0x80, 0x80, "Fielder Control" ) PORT_DIPLOCATION("SW3:4") PORT_DIPSETTING( 0x80, DEF_STR( Normal ) ) @@ -262,23 +411,16 @@ -void bottom9_state::volume_callback0(uint8_t data) -{ - m_k007232_1->set_volume(0, (data >> 4) * 0x11, 0); - m_k007232_1->set_volume(1, 0, (data & 0x0f) * 0x11); -} - -void bottom9_state::volume_callback1(uint8_t data) +template +void bottom9_state::volume_callback(uint8_t data) { - m_k007232_2->set_volume(0, (data >> 4) * 0x11, 0); - m_k007232_2->set_volume(1, 0, (data & 0x0f) * 0x11); + m_k007232[Which]->set_volume(0, (data >> 4) * 0x11, 0); + m_k007232[Which]->set_volume(1, 0, (data & 0x0f) * 0x11); } void bottom9_state::machine_start() { - uint8_t *ROM = memregion("maincpu")->base(); - - membank("bank1")->configure_entries(0, 12, &ROM[0x10000], 0x2000); + m_mainbank->configure_entries(0, 12, memregion("maincpu")->base(), 0x2000); save_item(NAME(m_video_enable)); save_item(NAME(m_zoomreadroms)); @@ -296,23 +438,23 @@ void bottom9_state::bottom9(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware HD6309E(config, m_maincpu, XTAL(24'000'000) / 8); // 63C09E m_maincpu->set_addrmap(AS_PROGRAM, &bottom9_state::main_map); Z80(config, m_audiocpu, XTAL(3'579'545)); m_audiocpu->set_addrmap(AS_PROGRAM, &bottom9_state::audio_map); - m_audiocpu->set_periodic_int(FUNC(bottom9_state::bottom9_sound_interrupt), attotime::from_hz(8*60)); /* irq is triggered by the main CPU */ + m_audiocpu->set_periodic_int(FUNC(bottom9_state::sound_interrupt), attotime::from_hz(8 * 60)); // IRQ is triggered by the main CPU WATCHDOG_TIMER(config, "watchdog"); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(60); screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); screen.set_size(64*8, 32*8); screen.set_visarea(14*8, (64-14)*8-1, 2*8, 30*8-1); - screen.set_screen_update(FUNC(bottom9_state::screen_update_bottom9)); + screen.set_screen_update(FUNC(bottom9_state::screen_update)); screen.set_palette(m_palette); PALETTE(config, m_palette).set_format(palette_device::xBGR_555, 1024); @@ -333,20 +475,20 @@ m_k051316->set_palette(m_palette); m_k051316->set_zoom_callback(FUNC(bottom9_state::zoom_callback)); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); GENERIC_LATCH_8(config, "soundlatch"); - K007232(config, m_k007232_1, XTAL(3'579'545)); - m_k007232_1->port_write().set(FUNC(bottom9_state::volume_callback0)); - m_k007232_1->add_route(0, "mono", 0.40); - m_k007232_1->add_route(1, "mono", 0.40); - - K007232(config, m_k007232_2, XTAL(3'579'545)); - m_k007232_2->port_write().set(FUNC(bottom9_state::volume_callback1)); - m_k007232_2->add_route(0, "mono", 0.40); - m_k007232_2->add_route(1, "mono", 0.40); + K007232(config, m_k007232[0], XTAL(3'579'545)); + m_k007232[0]->port_write().set(FUNC(bottom9_state::volume_callback<0>)); + m_k007232[0]->add_route(0, "mono", 0.40); + m_k007232[0]->add_route(1, "mono", 0.40); + + K007232(config, m_k007232[1], XTAL(3'579'545)); + m_k007232[1]->port_write().set(FUNC(bottom9_state::volume_callback<1>)); + m_k007232[1]->add_route(0, "mono", 0.40); + m_k007232[1]->add_route(1, "mono", 0.40); } @@ -357,15 +499,14 @@ ***************************************************************************/ ROM_START( bottom9 ) - ROM_REGION( 0x28000, "maincpu", 0 ) /* code + banked roms */ - ROM_LOAD( "891n03.k17", 0x10000, 0x10000, CRC(8b083ff3) SHA1(045fef944b192e4bb147fa0f28680c0602af7377) ) - ROM_LOAD( "891-t02.k15", 0x20000, 0x08000, CRC(2c10ced2) SHA1(ecd43825a67b495cade94a454c96a19143d87760) ) - ROM_CONTINUE( 0x08000, 0x08000 ) + ROM_REGION( 0x20000, "maincpu", 0 ) // code + banked roms + ROM_LOAD( "891n03.k17", 0x00000, 0x10000, CRC(8b083ff3) SHA1(045fef944b192e4bb147fa0f28680c0602af7377) ) + ROM_LOAD( "891-t02.k15", 0x10000, 0x10000, CRC(2c10ced2) SHA1(ecd43825a67b495cade94a454c96a19143d87760) ) - ROM_REGION( 0x10000, "audiocpu", 0 ) /* Z80 code */ + ROM_REGION( 0x8000, "audiocpu", 0 ) // Z80 code ROM_LOAD( "891j01.g8", 0x0000, 0x8000, CRC(31b0a0a8) SHA1(8e047f81c19f25de97fa22e70dcfe9e06bfae699) ) - ROM_REGION( 0x080000, "k052109", 0 ) /* tiles */ + ROM_REGION( 0x080000, "k052109", 0 ) // tiles ROM_LOAD32_BYTE( "891e10c", 0x00000, 0x10000, CRC(209b0431) SHA1(07f05f63267d5ed5c99b5f786bb66a87045db9e1) ) ROM_LOAD32_BYTE( "891e10a", 0x00001, 0x10000, CRC(8020a9e8) SHA1(3792794a1b875506089da63cae955668cc61f54b) ) ROM_LOAD32_BYTE( "891e09c", 0x00002, 0x10000, CRC(9dcaefbf) SHA1(8b61b1627737b959158aa6c7ea5db63f6aec7436) ) @@ -375,8 +516,8 @@ ROM_LOAD32_BYTE( "891e09d", 0x40002, 0x10000, CRC(4e1335e6) SHA1(b892ab40a41978a89658ea2e7aabe9b073430b5d) ) ROM_LOAD32_BYTE( "891e09b", 0x40003, 0x10000, CRC(b6f914fb) SHA1(e95f3e899c2ead15ef8a529dbc67e8f4a0f88bdd) ) - ROM_REGION( 0x100000, "k051960", 0 ) /* graphics ( don't dispose as the program can read them, 0 ) */ - ROM_LOAD32_BYTE( "891e06e", 0x00000, 0x10000, CRC(0b04db1c) SHA1(0beae7bb8da49379915c0253ce03091eb71a58b5) ) /* sprites */ + ROM_REGION( 0x100000, "k051960", 0 ) // sprites + ROM_LOAD32_BYTE( "891e06e", 0x00000, 0x10000, CRC(0b04db1c) SHA1(0beae7bb8da49379915c0253ce03091eb71a58b5) ) ROM_LOAD32_BYTE( "891e06a", 0x00001, 0x10000, CRC(5ee37327) SHA1(f63ddaf63af06ea5421b0361315940582ef57922) ) ROM_LOAD32_BYTE( "891e05e", 0x00002, 0x10000, CRC(b356e729) SHA1(2cda591415b0f139fdb1f80c349d432bb0579d8e) ) ROM_LOAD32_BYTE( "891e05a", 0x00003, 0x10000, CRC(bfd5487e) SHA1(24e0de9f12f6df6bde6268d090fe9e1ea827c0dc) ) @@ -394,19 +535,19 @@ ROM_LOAD32_BYTE( "891e05d", 0xc0003, 0x10000, CRC(f6d3f886) SHA1(b8bdcc9470aa93849b8c8a1f03971281cacc6d44) ) ROM_REGION( 0x020000, "k051316", 0 ) - ROM_LOAD( "891e07a", 0x00000, 0x10000, CRC(b8d8b939) SHA1(ee91fb46d70db2d17f5909c4ea7ee1cf2d317d10) ) /* zoom/rotate */ + ROM_LOAD( "891e07a", 0x00000, 0x10000, CRC(b8d8b939) SHA1(ee91fb46d70db2d17f5909c4ea7ee1cf2d317d10) ) // zoom/rotate ROM_LOAD( "891e07b", 0x10000, 0x10000, CRC(83b2f92d) SHA1(c4972018e1f8109656784fae3e023a5522622c4b) ) - ROM_REGION( 0x0200, "proms", 0 ) - ROM_LOAD( "891b11.f23", 0x0000, 0x0100, CRC(ecb854aa) SHA1(3bd321ca3076d4e0042e0af656d51909fa6a5b3b) ) /* priority encoder (not used) */ + ROM_REGION( 0x0100, "proms", 0 ) + ROM_LOAD( "891b11.f23", 0x0000, 0x0100, CRC(ecb854aa) SHA1(3bd321ca3076d4e0042e0af656d51909fa6a5b3b) ) // priority encoder (not used) - ROM_REGION( 0x40000, "k007232_1", 0 ) /* samples for 007232 #0 */ + ROM_REGION( 0x40000, "k007232_1", 0 ) // samples ROM_LOAD( "891e08a", 0x00000, 0x10000, CRC(cef667bf) SHA1(e773fc0ced45e01e13cdee18c404d609356d2d0e) ) ROM_LOAD( "891e08b", 0x10000, 0x10000, CRC(f7c14a7a) SHA1(05261a065de33e158e8d72d74eb657035abb5d03) ) ROM_LOAD( "891e08c", 0x20000, 0x10000, CRC(756b7f3c) SHA1(6f36f0b4e08db27a8b6e180d12be6427677ad62d) ) ROM_LOAD( "891e08d", 0x30000, 0x10000, CRC(cd0d7305) SHA1(82403ce1f38014ebf94008a66c98697a572303f9) ) - ROM_REGION( 0x40000, "k007232_2", 0 ) /* samples for 007232 #1 */ + ROM_REGION( 0x40000, "k007232_2", 0 ) // samples ROM_LOAD( "891e04a", 0x00000, 0x10000, CRC(daebbc74) SHA1(f61daebf80e5e4640c4cea4ea5767e64a49d928d) ) ROM_LOAD( "891e04b", 0x10000, 0x10000, CRC(5ffb9ad1) SHA1(e8f00c63dc3091aa344e82dc29f41aedd5a764b4) ) ROM_LOAD( "891e04c", 0x20000, 0x10000, CRC(2dbbf16b) SHA1(84b2005a1fe61a6a0cf1aa6e0fdf7ff8b1f8f82a) ) @@ -414,15 +555,14 @@ ROM_END ROM_START( bottom9n ) - ROM_REGION( 0x28000, "maincpu", 0 ) /* code + banked roms */ - ROM_LOAD( "891n03.k17", 0x10000, 0x10000, CRC(8b083ff3) SHA1(045fef944b192e4bb147fa0f28680c0602af7377) ) - ROM_LOAD( "891n02.k15", 0x20000, 0x08000, CRC(d44d9ed4) SHA1(2a12bcfba81ab7e074569e2ad2da6a237a1c0ce5) ) - ROM_CONTINUE( 0x08000, 0x08000 ) + ROM_REGION( 0x20000, "maincpu", 0 ) // code + banked roms + ROM_LOAD( "891n03.k17", 0x00000, 0x10000, CRC(8b083ff3) SHA1(045fef944b192e4bb147fa0f28680c0602af7377) ) + ROM_LOAD( "891n02.k15", 0x10000, 0x10000, CRC(d44d9ed4) SHA1(2a12bcfba81ab7e074569e2ad2da6a237a1c0ce5) ) - ROM_REGION( 0x10000, "audiocpu", 0 ) /* Z80 code */ + ROM_REGION( 0x8000, "audiocpu", 0 ) // Z80 code ROM_LOAD( "891j01.g8", 0x0000, 0x8000, CRC(31b0a0a8) SHA1(8e047f81c19f25de97fa22e70dcfe9e06bfae699) ) - ROM_REGION( 0x080000, "k052109", 0 ) /* tiles */ + ROM_REGION( 0x080000, "k052109", 0 ) // tiles ROM_LOAD32_BYTE( "891e10c", 0x00000, 0x10000, CRC(209b0431) SHA1(07f05f63267d5ed5c99b5f786bb66a87045db9e1) ) ROM_LOAD32_BYTE( "891e10a", 0x00001, 0x10000, CRC(8020a9e8) SHA1(3792794a1b875506089da63cae955668cc61f54b) ) ROM_LOAD32_BYTE( "891e09c", 0x00002, 0x10000, CRC(9dcaefbf) SHA1(8b61b1627737b959158aa6c7ea5db63f6aec7436) ) @@ -432,8 +572,8 @@ ROM_LOAD32_BYTE( "891e09d", 0x40002, 0x10000, CRC(4e1335e6) SHA1(b892ab40a41978a89658ea2e7aabe9b073430b5d) ) ROM_LOAD32_BYTE( "891e09b", 0x40003, 0x10000, CRC(b6f914fb) SHA1(e95f3e899c2ead15ef8a529dbc67e8f4a0f88bdd) ) - ROM_REGION( 0x100000, "k051960", 0 ) /* graphics ( don't dispose as the program can read them, 0 ) */ - ROM_LOAD32_BYTE( "891e06e", 0x00000, 0x10000, CRC(0b04db1c) SHA1(0beae7bb8da49379915c0253ce03091eb71a58b5) ) /* sprites */ + ROM_REGION( 0x100000, "k051960", 0 ) // sprites + ROM_LOAD32_BYTE( "891e06e", 0x00000, 0x10000, CRC(0b04db1c) SHA1(0beae7bb8da49379915c0253ce03091eb71a58b5) ) ROM_LOAD32_BYTE( "891e06a", 0x00001, 0x10000, CRC(5ee37327) SHA1(f63ddaf63af06ea5421b0361315940582ef57922) ) ROM_LOAD32_BYTE( "891e05e", 0x00002, 0x10000, CRC(b356e729) SHA1(2cda591415b0f139fdb1f80c349d432bb0579d8e) ) ROM_LOAD32_BYTE( "891e05a", 0x00003, 0x10000, CRC(bfd5487e) SHA1(24e0de9f12f6df6bde6268d090fe9e1ea827c0dc) ) @@ -452,19 +592,19 @@ ROM_REGION( 0x020000, "k051316", 0 ) - ROM_LOAD( "891e07a", 0x00000, 0x10000, CRC(b8d8b939) SHA1(ee91fb46d70db2d17f5909c4ea7ee1cf2d317d10) ) /* zoom/rotate */ + ROM_LOAD( "891e07a", 0x00000, 0x10000, CRC(b8d8b939) SHA1(ee91fb46d70db2d17f5909c4ea7ee1cf2d317d10) ) // zoom/rotate ROM_LOAD( "891e07b", 0x10000, 0x10000, CRC(83b2f92d) SHA1(c4972018e1f8109656784fae3e023a5522622c4b) ) - ROM_REGION( 0x0200, "proms", 0 ) - ROM_LOAD( "891b11.f23", 0x0000, 0x0100, CRC(ecb854aa) SHA1(3bd321ca3076d4e0042e0af656d51909fa6a5b3b) ) /* priority encoder (not used) */ + ROM_REGION( 0x0100, "proms", 0 ) + ROM_LOAD( "891b11.f23", 0x0000, 0x0100, CRC(ecb854aa) SHA1(3bd321ca3076d4e0042e0af656d51909fa6a5b3b) ) // priority encoder (not used) - ROM_REGION( 0x40000, "k007232_1", 0 ) /* samples for 007232 #0 */ + ROM_REGION( 0x40000, "k007232_1", 0 ) // samples ROM_LOAD( "891e08a", 0x00000, 0x10000, CRC(cef667bf) SHA1(e773fc0ced45e01e13cdee18c404d609356d2d0e) ) ROM_LOAD( "891e08b", 0x10000, 0x10000, CRC(f7c14a7a) SHA1(05261a065de33e158e8d72d74eb657035abb5d03) ) ROM_LOAD( "891e08c", 0x20000, 0x10000, CRC(756b7f3c) SHA1(6f36f0b4e08db27a8b6e180d12be6427677ad62d) ) ROM_LOAD( "891e08d", 0x30000, 0x10000, CRC(cd0d7305) SHA1(82403ce1f38014ebf94008a66c98697a572303f9) ) - ROM_REGION( 0x40000, "k007232_2", 0 ) /* samples for 007232 #1 */ + ROM_REGION( 0x40000, "k007232_2", 0 ) // samples ROM_LOAD( "891e04a", 0x00000, 0x10000, CRC(daebbc74) SHA1(f61daebf80e5e4640c4cea4ea5767e64a49d928d) ) ROM_LOAD( "891e04b", 0x10000, 0x10000, CRC(5ffb9ad1) SHA1(e8f00c63dc3091aa344e82dc29f41aedd5a764b4) ) ROM_LOAD( "891e04c", 0x20000, 0x10000, CRC(2dbbf16b) SHA1(84b2005a1fe61a6a0cf1aa6e0fdf7ff8b1f8f82a) ) @@ -472,15 +612,14 @@ ROM_END ROM_START( mstadium ) - ROM_REGION( 0x28000, "maincpu", 0 ) /* code + banked roms */ - ROM_LOAD( "891-403.k17", 0x10000, 0x10000, CRC(1c00c4e8) SHA1(8a3400a8df44f21616422e5af3bca84d0f390f63) ) - ROM_LOAD( "891-402.k15", 0x20000, 0x08000, CRC(b850bbce) SHA1(a64300d1b1068e59eb59c427946c9bff164e2da8) ) - ROM_CONTINUE( 0x08000, 0x08000 ) + ROM_REGION( 0x20000, "maincpu", 0 ) // code + banked roms + ROM_LOAD( "891-403.k17", 0x00000, 0x10000, CRC(1c00c4e8) SHA1(8a3400a8df44f21616422e5af3bca84d0f390f63) ) + ROM_LOAD( "891-402.k15", 0x10000, 0x10000, CRC(b850bbce) SHA1(a64300d1b1068e59eb59c427946c9bff164e2da8) ) - ROM_REGION( 0x10000, "audiocpu", 0 ) /* Z80 code */ + ROM_REGION( 0x8000, "audiocpu", 0 ) // Z80 code ROM_LOAD( "891w01.g8", 0x0000, 0x8000, CRC(edec565a) SHA1(69cba0d00c6ef76c4ce2b553e3fd15de8abbbf31) ) - ROM_REGION( 0x080000, "k052109", 0 ) /* tiles */ + ROM_REGION( 0x080000, "k052109", 0 ) // tiles ROM_LOAD32_BYTE( "891e10c", 0x00000, 0x10000, CRC(209b0431) SHA1(07f05f63267d5ed5c99b5f786bb66a87045db9e1) ) ROM_LOAD32_BYTE( "891e10a", 0x00001, 0x10000, CRC(8020a9e8) SHA1(3792794a1b875506089da63cae955668cc61f54b) ) ROM_LOAD32_BYTE( "891e09c", 0x00002, 0x10000, CRC(9dcaefbf) SHA1(8b61b1627737b959158aa6c7ea5db63f6aec7436) ) @@ -490,7 +629,7 @@ ROM_LOAD32_BYTE( "891e09d", 0x40002, 0x10000, CRC(4e1335e6) SHA1(b892ab40a41978a89658ea2e7aabe9b073430b5d) ) ROM_LOAD32_BYTE( "891e09b", 0x40003, 0x10000, CRC(b6f914fb) SHA1(e95f3e899c2ead15ef8a529dbc67e8f4a0f88bdd) ) - ROM_REGION( 0x100000, "k051960", 0 ) /* sprites */ + ROM_REGION( 0x100000, "k051960", 0 ) ROM_LOAD32_BYTE( "891e06e", 0x00000, 0x10000, CRC(0b04db1c) SHA1(0beae7bb8da49379915c0253ce03091eb71a58b5) ) ROM_LOAD32_BYTE( "891e06a", 0x00001, 0x10000, CRC(5ee37327) SHA1(f63ddaf63af06ea5421b0361315940582ef57922) ) ROM_LOAD32_BYTE( "891e05e", 0x00002, 0x10000, CRC(b356e729) SHA1(2cda591415b0f139fdb1f80c349d432bb0579d8e) ) @@ -509,25 +648,26 @@ ROM_LOAD32_BYTE( "891e05d", 0xc0003, 0x10000, CRC(f6d3f886) SHA1(b8bdcc9470aa93849b8c8a1f03971281cacc6d44) ) ROM_REGION( 0x020000, "k051316", 0 ) - ROM_LOAD( "891e07a", 0x00000, 0x10000, CRC(b8d8b939) SHA1(ee91fb46d70db2d17f5909c4ea7ee1cf2d317d10) ) /* zoom/rotate */ + ROM_LOAD( "891e07a", 0x00000, 0x10000, CRC(b8d8b939) SHA1(ee91fb46d70db2d17f5909c4ea7ee1cf2d317d10) ) // zoom/rotate ROM_LOAD( "891e07b", 0x10000, 0x10000, CRC(83b2f92d) SHA1(c4972018e1f8109656784fae3e023a5522622c4b) ) - ROM_REGION( 0x0200, "proms", 0 ) - ROM_LOAD( "891b11.f23", 0x0000, 0x0100, CRC(ecb854aa) SHA1(3bd321ca3076d4e0042e0af656d51909fa6a5b3b) ) /* priority encoder (not used) */ + ROM_REGION( 0x0100, "proms", 0 ) + ROM_LOAD( "891b11.f23", 0x0000, 0x0100, CRC(ecb854aa) SHA1(3bd321ca3076d4e0042e0af656d51909fa6a5b3b) ) // priority encoder (not used) - ROM_REGION( 0x40000, "k007232_1", 0 ) /* samples for 007232 #0 */ + ROM_REGION( 0x40000, "k007232_1", 0 ) // samples ROM_LOAD( "891e08a", 0x00000, 0x10000, CRC(cef667bf) SHA1(e773fc0ced45e01e13cdee18c404d609356d2d0e) ) ROM_LOAD( "891e08b", 0x10000, 0x10000, CRC(f7c14a7a) SHA1(05261a065de33e158e8d72d74eb657035abb5d03) ) ROM_LOAD( "891e08c", 0x20000, 0x10000, CRC(756b7f3c) SHA1(6f36f0b4e08db27a8b6e180d12be6427677ad62d) ) ROM_LOAD( "891e08d", 0x30000, 0x10000, CRC(cd0d7305) SHA1(82403ce1f38014ebf94008a66c98697a572303f9) ) - ROM_REGION( 0x40000, "k007232_2", 0 ) /* samples for 007232 #1 */ + ROM_REGION( 0x40000, "k007232_2", 0 ) // samples ROM_LOAD( "891e04a", 0x00000, 0x10000, CRC(daebbc74) SHA1(f61daebf80e5e4640c4cea4ea5767e64a49d928d) ) ROM_LOAD( "891e04b", 0x10000, 0x10000, CRC(5ffb9ad1) SHA1(e8f00c63dc3091aa344e82dc29f41aedd5a764b4) ) ROM_LOAD( "891e04c", 0x20000, 0x10000, CRC(2dbbf16b) SHA1(84b2005a1fe61a6a0cf1aa6e0fdf7ff8b1f8f82a) ) ROM_LOAD( "891e04d", 0x30000, 0x10000, CRC(8b0cd2cc) SHA1(e14109c69fa24d309aed4ff3589cc6619e29f97f) ) ROM_END +} // anonymous namespace GAME( 1989, bottom9, 0, bottom9, bottom9, bottom9_state, empty_init, ROT0, "Konami", "Bottom of the Ninth (version T)", MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/btime.cpp mame-0.243+dfsg.1/src/mame/drivers/btime.cpp --- mame-0.242+dfsg.1/src/mame/drivers/btime.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/btime.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1130,17 +1130,6 @@ // and the coinage DIP switches are ignored in this case INPUT_PORTS_END -static const gfx_layout tile8layout = -{ - 8,8, - RGN_FRAC(1,3), - 3, - { RGN_FRAC(2,3), RGN_FRAC(1,3), RGN_FRAC(0,3) }, - { STEP8(0,1) }, - { STEP8(0,8) }, - 8*8 -}; - static const gfx_layout disco_tile8layout = { 8,8, @@ -1187,32 +1176,32 @@ }; static GFXDECODE_START( gfx_btime ) - GFXDECODE_ENTRY( "gfx1", 0, tile8layout, 0, 1 ) /* char set #1 */ - GFXDECODE_ENTRY( "gfx1", 0, tile16layout, 0, 1 ) /* sprites */ - GFXDECODE_ENTRY( "gfx2", 0, tile16layout, 8, 1 ) /* background tiles */ + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x3_planar, 0, 1 ) /* char set #1 */ + GFXDECODE_ENTRY( "gfx1", 0, tile16layout, 0, 1 ) /* sprites */ + GFXDECODE_ENTRY( "gfx2", 0, tile16layout, 8, 1 ) /* background tiles */ GFXDECODE_END static GFXDECODE_START( gfx_cookrace ) - GFXDECODE_ENTRY( "gfx1", 0, tile8layout, 0, 1 ) /* char set #1 */ - GFXDECODE_ENTRY( "gfx1", 0, tile16layout, 0, 1 ) /* sprites */ - GFXDECODE_ENTRY( "gfx2", 0, tile8layout, 8, 1 ) /* background tiles */ + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x3_planar, 0, 1 ) /* char set #1 */ + GFXDECODE_ENTRY( "gfx1", 0, tile16layout, 0, 1 ) /* sprites */ + GFXDECODE_ENTRY( "gfx2", 0, gfx_8x8x3_planar, 8, 1 ) /* background tiles */ GFXDECODE_END static GFXDECODE_START( gfx_lnc ) - GFXDECODE_ENTRY( "gfx1", 0, tile8layout, 0, 1 ) /* char set #1 */ - GFXDECODE_ENTRY( "gfx1", 0, tile16layout, 0, 1 ) /* sprites */ + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x3_planar, 0, 1 ) /* char set #1 */ + GFXDECODE_ENTRY( "gfx1", 0, tile16layout, 0, 1 ) /* sprites */ GFXDECODE_END static GFXDECODE_START( gfx_bnj ) - GFXDECODE_ENTRY( "gfx1", 0, tile8layout, 0, 1 ) /* char set #1 */ - GFXDECODE_ENTRY( "gfx1", 0, tile16layout, 0, 1 ) /* sprites */ - GFXDECODE_ENTRY( "gfx2", 0, bnj_tile16layout,8, 1 ) /* background tiles */ + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x3_planar, 0, 1 ) /* char set #1 */ + GFXDECODE_ENTRY( "gfx1", 0, tile16layout, 0, 1 ) /* sprites */ + GFXDECODE_ENTRY( "gfx2", 0, bnj_tile16layout, 8, 1 ) /* background tiles */ GFXDECODE_END static GFXDECODE_START( gfx_zoar ) - GFXDECODE_ENTRY( "gfx1", 0, tile8layout, 0, 8 ) /* char set #1 */ - GFXDECODE_ENTRY( "gfx3", 0, tile16layout, 0, 8 ) /* sprites */ - GFXDECODE_ENTRY( "gfx2", 0, tile16layout, 0, 8 ) /* background tiles */ + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x3_planar, 0, 8 ) /* char set #1 */ + GFXDECODE_ENTRY( "gfx3", 0, tile16layout, 0, 8 ) /* sprites */ + GFXDECODE_ENTRY( "gfx2", 0, tile16layout, 0, 8 ) /* background tiles */ GFXDECODE_END static GFXDECODE_START( gfx_disco ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/buggychl.cpp mame-0.243+dfsg.1/src/mame/drivers/buggychl.cpp --- mame-0.242+dfsg.1/src/mame/drivers/buggychl.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/buggychl.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -87,32 +87,366 @@ QC output = "CLK" = 6mhz "1/2phi" = 24M / 3 = 8mhz -The z80B main cpu is clocked by (depending on a jumper) either "1/2CLK"/2 OR "1/2PHI"/2, so either 6mhz or 4mhz. +The z80B main CPU is clocked by (depending on a jumper) either "1/2CLK"/2 OR "1/2PHI"/2, so either 6mhz or 4mhz. Schematics show the jumper set to the 6mhz setting. ***************************************************************************/ #include "emu.h" -#include "includes/buggychl.h" -#include "cpu/z80/z80.h" +#include "machine/taito68705interface.h" + #include "cpu/m6805/m6805.h" +#include "cpu/z80/z80.h" +#include "machine/gen_latch.h" +#include "machine/input_merger.h" #include "machine/watchdog.h" +#include "sound/ay8910.h" +#include "sound/msm5232.h" +#include "sound/ta7630.h" + +#include "emupal.h" +#include "screen.h" #include "speaker.h" #include "buggychl.lh" +namespace { + +class buggychl_state : public driver_device +{ +public: + buggychl_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_charram(*this, "charram"), + m_videoram(*this, "videoram"), + m_spriteram(*this, "spriteram"), + m_scrollv(*this, "scrollv"), + m_scrollh(*this, "scrollh"), + m_mainbank(*this, "mainbank"), + m_sprite_zoom_table(*this, "sprite_zoom_table"), + m_audiocpu(*this, "audiocpu"), + m_maincpu(*this, "maincpu"), + m_bmcu(*this, "bmcu"), + m_ta7630(*this, "ta7630"), + m_msm(*this, "msm"), + m_ay(*this, "ay%u", 1U), + m_gfxdecode(*this, "gfxdecode"), + m_screen(*this, "screen"), + m_palette(*this, "palette"), + m_soundnmi(*this, "soundnmi"), + m_soundlatch(*this, "soundlatch%u", 1U), + m_pedal_input(*this, "PEDAL"), + m_led(*this, "led%u", 0U) + { } + + void buggychl(machine_config &config); + + DECLARE_CUSTOM_INPUT_MEMBER(pedal_in_r); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; + +private: + // memory pointers + required_shared_ptr m_charram; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; + required_shared_ptr m_scrollv; + required_shared_ptr m_scrollh; + required_memory_bank m_mainbank; + required_region_ptr m_sprite_zoom_table; + + // devices + required_device m_audiocpu; + required_device m_maincpu; + required_device m_bmcu; + required_device m_ta7630; + required_device m_msm; + required_device_array m_ay; + required_device m_gfxdecode; + required_device m_screen; + required_device m_palette; + required_device m_soundnmi; + required_device_array m_soundlatch; + required_ioport m_pedal_input; + + output_finder<1> m_led; + + // video-related + bitmap_ind16 m_tmp_bitmap[2]; + uint16_t m_sl_bank; + uint8_t m_bg_clip_on; + uint8_t m_sky_on; + uint8_t m_sprite_color_base; + int32_t m_bg_scrollx; + uint8_t m_sprite_lookup[0x2000]; + + void bankswitch_w(uint8_t data); + void sound_enable_w(uint8_t data); + uint8_t mcu_status_r(); + uint8_t sound_status_main_r(); + uint8_t sound_status_sound_r(); + void chargen_w(offs_t offset, uint8_t data); + void sprite_lookup_bank_w(uint8_t data); + void sprite_lookup_w(offs_t offset, uint8_t data); + void ctrl_w(uint8_t data); + void bg_scrollx_w(uint8_t data); + template void ta7630_volbal_ay_w(uint8_t data); + template void port_b_w(uint8_t data); + void ta7630_volbal_msm_w(uint8_t data); + void palette(palette_device &palette) const; + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void draw_sky(bitmap_ind16 &bitmap, const rectangle &cliprect); + void draw_bg(bitmap_ind16 &bitmap, const rectangle &cliprect); + void draw_fg(bitmap_ind16 &bitmap, const rectangle &cliprect); + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); + + void main_map(address_map &map); + void sound_map(address_map &map); +}; + + +// video + +void buggychl_state::palette(palette_device &palette) const +{ + // arbitrary blue shading for the sky, estimation + for (int i = 0; i < 128; i++) + palette.set_pen_color(i + 128, rgb_t(0, 240 - i, 255)); +} + +void buggychl_state::video_start() +{ + m_screen->register_screen_bitmap(m_tmp_bitmap[0]); + m_screen->register_screen_bitmap(m_tmp_bitmap[1]); + + save_item(NAME(m_tmp_bitmap[0])); + save_item(NAME(m_tmp_bitmap[1])); + + m_gfxdecode->gfx(0)->set_source(m_charram); +} + +void buggychl_state::chargen_w(offs_t offset, uint8_t data) +{ + if (m_charram[offset] != data) + { + m_charram[offset] = data; + m_gfxdecode->gfx(0)->mark_dirty((offset / 8) & 0xff); + } +} + +void buggychl_state::sprite_lookup_bank_w(uint8_t data) +{ + m_sl_bank = (data & 0x10) << 8; +} + +void buggychl_state::sprite_lookup_w(offs_t offset, uint8_t data) +{ + m_sprite_lookup[offset + m_sl_bank] = data; +} + +void buggychl_state::ctrl_w(uint8_t data) +{ +/* + bit7 = lamp + bit6 = lockout + bit4 = OJMODE + bit3 = SKY OFF + bit2 = /SN3OFF + bit1 = HINV + bit0 = VINV +*/ + + flip_screen_y_set(data & 0x01); + flip_screen_x_set(data & 0x02); + + m_bg_clip_on = data & 0x04; + m_sky_on = data & 0x08; + + m_sprite_color_base = (data & 0x10) ? 1 * 16 : 3 * 16; + + machine().bookkeeping().coin_lockout_global_w((~data & 0x40) >> 6); + m_led[0] = BIT(~data, 7); +} + +void buggychl_state::bg_scrollx_w(uint8_t data) +{ + m_bg_scrollx = -(data - 0x12); +} + + +void buggychl_state::draw_sky(bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + for (int y = 0; y < 256; y++) + for (int x = 0; x < 256; x++) + bitmap.pix(y, x) = 128 + x / 2; +} + + +void buggychl_state::draw_bg(bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + // prevent wraparound + rectangle clip = cliprect; + + // enable clipping if on (title screen disables this to cover all of the area) + if (m_bg_clip_on) + { + if (flip_screen_x()) clip.min_x += 8 * 8; + else clip.max_x -= 8 * 8; + } + + for (int offs = 0; offs < 0x400; offs++) + { + int code = m_videoram[0x400 + offs]; + + int sx = offs % 32; + int sy = offs / 32; + + if (flip_screen_x()) + sx = 31 - sx; + if (flip_screen_y()) + sy = 31 - sy; + + m_gfxdecode->gfx(0)->opaque(m_tmp_bitmap[0], m_tmp_bitmap[0].cliprect(), + code, + 2, + flip_screen_x(), flip_screen_y(), + 8 * sx, 8 * sy); + } + + int scroll[256]; + + // first copy to a temp bitmap doing column scroll + for (int offs = 0; offs < 256; offs++) + scroll[offs] = -m_scrollv[offs / 8]; + + copyscrollbitmap(m_tmp_bitmap[1], m_tmp_bitmap[0], 1, &m_bg_scrollx, 256, scroll, m_tmp_bitmap[1].cliprect()); + + // then copy to the screen doing row scroll + for (int offs = 0; offs < 256; offs++) + scroll[offs] = -m_scrollh[offs]; + + copyscrollbitmap_trans(bitmap, m_tmp_bitmap[1], 256, scroll, 0, nullptr, clip, 32); +} + + +void buggychl_state::draw_fg(bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + for (int offs = 0; offs < 0x400; offs++) + { + int sx = offs % 32; + int sy = offs / 32; + int flipx = flip_screen_x(); + int flipy = flip_screen_y(); + + int code = m_videoram[offs]; + + if (flipx) + sx = 31 - sx; + if (flipy) + sy = 31 - sy; + + m_gfxdecode->gfx(0)->transpen(bitmap, cliprect, + code, + 0, + flipx, flipy, + 8 * sx, 8 * sy, + 0); + } +} + + +void buggychl_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + g_profiler.start(PROFILER_USER1); + + for (int offs = 0; offs < m_spriteram.bytes(); offs += 4) + { + int sx = m_spriteram[offs + 3] - ((m_spriteram[offs + 2] & 0x80) << 1); + int sy = 256 - 64 - m_spriteram[offs] + ((m_spriteram[offs + 1] & 0x80) << 1); + int flipy = m_spriteram[offs + 1] & 0x40; + int zoom = m_spriteram[offs + 1] & 0x3f; + uint8_t const *const zoomy_rom = &m_sprite_zoom_table[zoom << 6]; + uint8_t const *const zoomx_rom = &m_sprite_zoom_table[0x2000 + (zoom << 3)]; + + uint8_t const *const lookup = m_sprite_lookup + ((m_spriteram[offs + 2] & 0x7f) << 6); + + for (int y = 0; y < 64; y++) + { + int dy = flip_screen_y() ? (255 - sy - y) : (sy + y); + + if ((dy & ~0xff) == 0) + { + int charline = zoomy_rom[y] & 0x07; + int base_pos = zoomy_rom[y] & 0x38; + if (flipy) + base_pos ^= 0x38; + + int px = 0; + for (int ch = 0; ch < 4; ch++) + { + int pos = base_pos + 2 * ch; + int code = 8 * (lookup[pos] | ((lookup[pos + 1] & 0x07) << 8)); + int realflipy = (lookup[pos + 1] & 0x80) ? !flipy : flipy; + code += (realflipy ? (charline ^ 7) : charline); + uint8_t const *const pendata = m_gfxdecode->gfx(1)->get_data(code); + + for (int x = 0; x < 16; x++) + { + int col = pendata[x]; + if (col) + { + int dx = flip_screen_x() ? (255 - sx - px) : (sx + px); + if ((dx & ~0xff) == 0) + bitmap.pix(dy, dx) = m_sprite_color_base + col; + } + + // the following line is almost certainly wrong + if (zoomx_rom[7 - (2 * ch + x / 8)] & (1 << (x & 7))) + px++; + } + } + } + } + } + + g_profiler.stop(); +} + + +uint32_t buggychl_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + if (m_sky_on) + draw_sky(bitmap, cliprect); + else + bitmap.fill(0x20, cliprect); // stage 3 disables sky, wants background pen to be blue + + draw_bg(bitmap, cliprect); + + draw_sprites(bitmap, cliprect); + + draw_fg(bitmap, cliprect); + + return 0; +} + + +// machine + void buggychl_state::bankswitch_w(uint8_t data) { - membank("bank1")->set_entry(data & 0x07); // shall we check if data&7 < # banks? + m_mainbank->set_entry(data & 0x07); // shall we check if data & 7 < # banks? } void buggychl_state::sound_enable_w(uint8_t data) { // does this really only control the sound irq 'timer' enable state, rather than the entire sound system? // this would be more in line with the (admittedly incorrect) schematic... - //logerror("Sound_enable_w written with data of %02x\n", data); + // logerror("Sound_enable_w written with data of %02x\n", data); machine().sound().system_mute(!BIT(data, 0)); } @@ -125,26 +459,26 @@ ((CLEAR_LINE != m_bmcu->mcu_semaphore_r()) ? 0x02 : 0x00); } -// the schematics show that the two sound semaphore latch bits are actually flipped backwards when read by the sound cpu -// vs when read by the main cpu. -// Given the other schematic errors, and the fact that the sound board schematic is for the wrong pcb, is this even correct? -// It isn't even obvious if the maincpu or sound cpu read the semaphores at all, ever. -// a cpu write to soundlatch sets ic12.2 so /Q is low, so cpu bit 1 and sound bit 0 read as clear -// a sound write to soundlatch2 clears ic12.1 so /Q is high, so cpu bit 0 and sound bit 1 read as set -// a cpu read of soundlatch2 sets ic12.1 so /Q is low, so cpu bit 0 and sound bit 1 read as clear -// a sound read of soundlatch clears ic12.2 so /Q is high, so cpu bit 1 and sound bit 0 read as set +// the schematics show that the two sound semaphore latch bits are actually flipped backwards when read by the sound CPU +// vs when read by the main CPU. +// Given the other schematic errors, and the fact that the sound board schematic is for the wrong PCB, is this even correct? +// It isn't even obvious if the main CPU or sound CPU read the semaphores at all, ever. +// a CPU write to soundlatch[0] sets ic12.2 so /Q is low, so CPU bit 1 and sound bit 0 read as clear +// a sound write to soundlatch[1] clears ic12.1 so /Q is high, so CPU bit 0 and sound bit 1 read as set +// a CPU read of soundlatch[1] sets ic12.1 so /Q is low, so CPU bit 0 and sound bit 1 read as clear +// a sound read of soundlatch[0] clears ic12.2 so /Q is high, so CPU bit 1 and sound bit 0 read as set // ic12.1 is set and ic12.2 is cleared by /SRESET uint8_t buggychl_state::sound_status_main_r() { - return (m_soundlatch2->pending_r() ? 1 : 0) | (m_soundlatch->pending_r() ? 0 : 2); + return (m_soundlatch[1]->pending_r() ? 1 : 0) | (m_soundlatch[0]->pending_r() ? 0 : 2); } uint8_t buggychl_state::sound_status_sound_r() { - return (m_soundlatch2->pending_r() ? 2 : 0) | (m_soundlatch->pending_r() ? 0 : 1); + return (m_soundlatch[1]->pending_r() ? 2 : 0) | (m_soundlatch[0]->pending_r() ? 0 : 1); } -/* Main cpu address map ( * = used within this section; x = don't care ) +/* Main CPU address map ( * = used within this section; x = don't care ) | | | 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 * * R 74LS139 @ ic53 @@ -197,64 +531,64 @@ 1 1 1 0 ? ? ? ? ? ? ? ? ? ? ? ? ? (unknown, cut off on schematic) 1 1 1 1 ? ? ? ? ? ? ? ? ? ? ? ? ? (unknown, cut off on schematic) */ -void buggychl_state::buggychl_map(address_map &map) +void buggychl_state::main_map(address_map &map) { - map(0x0000, 0x3fff).rom(); /* A22-04 (23) */ - map(0x4000, 0x7fff).rom(); /* A22-05 (22) */ - map(0x8000, 0x87ff).ram(); /* 6116 SRAM (36) */ - map(0x8800, 0x8fff).ram(); /* 6116 SRAM (35) */ - map(0x9000, 0x9fff).w(FUNC(buggychl_state::buggychl_sprite_lookup_w)); - map(0xa000, 0xbfff).bankr("bank1").w(FUNC(buggychl_state::buggychl_chargen_w)).share("charram"); - map(0xc800, 0xcfff).ram().share("videoram"); + map(0x0000, 0x3fff).rom(); // A22-04 (23) + map(0x4000, 0x7fff).rom(); // A22-05 (22) + map(0x8000, 0x87ff).ram(); // 6116 SRAM (36) + map(0x8800, 0x8fff).ram(); // 6116 SRAM (35) + map(0x9000, 0x9fff).w(FUNC(buggychl_state::sprite_lookup_w)); + map(0xa000, 0xbfff).bankr(m_mainbank).w(FUNC(buggychl_state::chargen_w)).share(m_charram); + map(0xc800, 0xcfff).ram().share(m_videoram); map(0xd000, 0xd000).nopw(); // ??? - map(0xd100, 0xd100).mirror(0x00ff).w(FUNC(buggychl_state::buggychl_ctrl_w)); + map(0xd100, 0xd100).mirror(0x00ff).w(FUNC(buggychl_state::ctrl_w)); map(0xd200, 0xd200).mirror(0x00ff).w(FUNC(buggychl_state::bankswitch_w)); map(0xd300, 0xd300).mirror(0x00f8).w("watchdog", FUNC(watchdog_timer_device::reset_w)); // d301 = flp stuff, unused? // d302 = mcu reset latched d0 - map(0xd303, 0xd303).mirror(0x00f8).w(FUNC(buggychl_state::buggychl_sprite_lookup_bank_w)); + map(0xd303, 0xd303).mirror(0x00f8).w(FUNC(buggychl_state::sprite_lookup_bank_w)); map(0xd304, 0xd307).nopw(); // d304-d307 is SCCON, which seems to be for a bezel mounted 7seg score/time display like Grand Champion has map(0xd400, 0xd400).mirror(0x00fc).rw(m_bmcu, FUNC(taito68705_mcu_device::data_r), FUNC(taito68705_mcu_device::data_w)); map(0xd401, 0xd401).mirror(0x00fc).r(FUNC(buggychl_state::mcu_status_r)); - map(0xd500, 0xd57f).writeonly().share("spriteram"); + map(0xd500, 0xd57f).writeonly().share(m_spriteram); map(0xd600, 0xd600).mirror(0x00e4).portr("DSW1"); map(0xd601, 0xd601).mirror(0x00e4).portr("DSW2"); map(0xd602, 0xd602).mirror(0x00e4).portr("DSW3"); - map(0xd603, 0xd603).mirror(0x00e4).portr("IN0"); /* player inputs */ + map(0xd603, 0xd603).mirror(0x00e4).portr("IN0"); // player inputs map(0xd608, 0xd608).mirror(0x00e4).portr("WHEEL"); - map(0xd609, 0xd609).mirror(0x00e4).portr("IN1"); /* coin + accelerator */ + map(0xd609, 0xd609).mirror(0x00e4).portr("IN1"); // coin + accelerator // map(0xd60a, 0xd60a).mirror(0x00e4); // other inputs, not used? // map(0xd60b, 0xd60b).mirror(0x00e4); // other inputs, not used? - map(0xd610, 0xd610).mirror(0x00e4).r(m_soundlatch2, FUNC(generic_latch_8_device::read)).w(m_soundlatch, FUNC(generic_latch_8_device::write)); + map(0xd610, 0xd610).mirror(0x00e4).r(m_soundlatch[1], FUNC(generic_latch_8_device::read)).w(m_soundlatch[0], FUNC(generic_latch_8_device::write)); map(0xd611, 0xd611).mirror(0x00e4).r(FUNC(buggychl_state::sound_status_main_r)); // map(0xd613, 0xd613).mirror(0x00e4).w(FUNC(buggychl_state::sound_reset_w)); - map(0xd618, 0xd618).mirror(0x00e7).nopw(); /* accelerator clear; TODO: should we emulate the proper quadrature counter here? */ + map(0xd618, 0xd618).mirror(0x00e7).nopw(); // accelerator clear; TODO: should we emulate the proper quadrature counter here? map(0xd700, 0xd7ff).w(m_palette, FUNC(palette_device::write8)).share("palette"); map(0xd820, 0xd83f).ram(); // TODO - map(0xd840, 0xd85f).writeonly().share("scrollv"); - map(0xdb00, 0xdbff).writeonly().share("scrollh"); - map(0xdc04, 0xdc04).nopw(); /* should be fg scroll */ - map(0xdc06, 0xdc06).w(FUNC(buggychl_state::buggychl_bg_scrollx_w)); + map(0xd840, 0xd85f).writeonly().share(m_scrollv); + map(0xdb00, 0xdbff).writeonly().share(m_scrollh); + map(0xdc04, 0xdc04).nopw(); // should be fg scroll + map(0xdc06, 0xdc06).w(FUNC(buggychl_state::bg_scrollx_w)); } -/* The schematics for buggy challenge has the wrong sound board schematic attached to it. - (The schematic is for an unknown taito game, possibly never released.) - The final buggy challenge sound board is more similar to Fairyland Story sound +/* The schematics for Buggy Challenge have the wrong sound board schematic attached to it. + (The schematic is for an unknown Taito game, possibly never released.) + The final Buggy Challenge sound board is more similar to Fairyland Story sound hardware, except it has two YM2149 chips instead of one, and much less ROM space. */ void buggychl_state::sound_map(address_map &map) { map(0x0000, 0x3fff).rom(); map(0x4000, 0x47ff).ram(); - map(0x4800, 0x4801).w(m_ay1, FUNC(ay8910_device::address_data_w)); - map(0x4802, 0x4803).w(m_ay2, FUNC(ay8910_device::address_data_w)); + map(0x4800, 0x4801).w(m_ay[0], FUNC(ay8910_device::address_data_w)); + map(0x4802, 0x4803).w(m_ay[1], FUNC(ay8910_device::address_data_w)); map(0x4810, 0x481d).w(m_msm, FUNC(msm5232_device::write)); - map(0x4820, 0x4820).w(FUNC(buggychl_state::ta7630_volbal_msm_w)); /* VOL/BAL for the 7630 on the MSM5232 output */ - map(0x4830, 0x4830).ram(); /* TRBL/BASS for the 7630 on the MSM5232 output */ - map(0x5000, 0x5000).r(m_soundlatch, FUNC(generic_latch_8_device::read)).w(m_soundlatch2, FUNC(generic_latch_8_device::write)); + map(0x4820, 0x4820).w(FUNC(buggychl_state::ta7630_volbal_msm_w)); // VOL/BAL for the 7630 on the MSM5232 output + map(0x4830, 0x4830).ram(); // TRBL/BASS for the 7630 on the MSM5232 output + map(0x5000, 0x5000).r(m_soundlatch[0], FUNC(generic_latch_8_device::read)).w(m_soundlatch[1], FUNC(generic_latch_8_device::write)); map(0x5001, 0x5001).r(FUNC(buggychl_state::sound_status_sound_r)).w(m_soundnmi, FUNC(input_merger_device::in_set<1>)); map(0x5002, 0x5002).w(m_soundnmi, FUNC(input_merger_device::in_clear<1>)); map(0x5003, 0x5003).w(FUNC(buggychl_state::sound_enable_w)); // unclear what this actually controls - map(0xe000, 0xefff).rom(); /* space for diagnostics ROM */ + map(0xe000, 0xefff).rom(); // space for diagnostics ROM } /* Here is the memory maps from the 'wrong' sound schematic @@ -290,28 +624,28 @@ 0 1 1 1 0 0 1 x x x x x x x x x W OPEN BUS 0 1 1 1 0 1 0 x x x x x x x x x W Main VR Control voltage DAC 0 1 1 1 0 1 1 x x x x x x x x x W OPEN BUS - 0 1 1 1 1 0 0 x x x x x x x x x W CHA Level (selectively gate the 4 dac bits for 2x 4bit r2r dac, one on d7-4, one d3-0, for front right) - 0 1 1 1 1 0 1 x x x x x x x x x W CHB Level (selectively gate the 4 dac bits for 2x 4bit r2r dac, one on d7-4, one d3-0, for rear right) - 0 1 1 1 1 1 0 x x x x x x x x x W CHC Level (selectively gate the 4 dac bits for 2x 4bit r2r dac, one on d7-4, one d3-0, for front left) - 0 1 1 1 1 1 1 x x x x x x x x x W CHD Level (selectively gate the 4 dac bits for 2x 4bit r2r dac, one on d7-4, one d3-0, for rear left) + 0 1 1 1 1 0 0 x x x x x x x x x W CHA Level (selectively gate the 4 DAC bits for 2x 4bit r2r DAC, one on d7-4, one d3-0, for front right) + 0 1 1 1 1 0 1 x x x x x x x x x W CHB Level (selectively gate the 4 DAC bits for 2x 4bit r2r DAC, one on d7-4, one d3-0, for rear right) + 0 1 1 1 1 1 0 x x x x x x x x x W CHC Level (selectively gate the 4 DAC bits for 2x 4bit r2r DAC, one on d7-4, one d3-0, for front left) + 0 1 1 1 1 1 1 x x x x x x x x x W CHD Level (selectively gate the 4 DAC bits for 2x 4bit r2r DAC, one on d7-4, one d3-0, for rear left) 1 0 0 x x x x x x x x x x * * * SM-8 /CS (inject ?4? SM waitstates cycles) 1 0 0 x x x x x x x x x x 0 0 x W OPEN BUS 1 0 0 x x x x x x x x x x 0 1 0 W AY #1 @ic42 Address write 1 0 0 x x x x x x x x x x 0 1 1 W AY #1 @ic42 Data write - AY #1 IOB7-4 connect to an r2r dac+opamp controlling ay1 TA7630P Treble - AY #1 IOB3-0 connect to an r2r dac+opamp controlling ay1 TA7630P Bass - AY #1 IOA7-4 connect to an r2r dac+opamp controlling ay1 TA7630P Volume - AY #1 IOA3-0 connect to an r2r dac+opamp controlling ay1 TA7630P Balance + AY #1 IOB7-4 connect to an r2r DAC+opamp controlling ay1 TA7630P Treble + AY #1 IOB3-0 connect to an r2r DAC+opamp controlling ay1 TA7630P Bass + AY #1 IOA7-4 connect to an r2r DAC+opamp controlling ay1 TA7630P Volume + AY #1 IOA3-0 connect to an r2r DAC+opamp controlling ay1 TA7630P Balance 1 0 0 x x x x x x x x x x 1 0 0 W AY #2 @ic41 Address write 1 0 0 x x x x x x x x x x 1 0 1 W AY #2 @ic41 Data write - AY #2 IOB7-4 connect to an r2r dac+opamp controlling ay2 TA7630P Treble - AY #2 IOB3-0 connect to an r2r dac+opamp controlling ay2 TA7630P Bass - AY #2 IOA7-4 connect to an r2r dac+opamp controlling ay2 TA7630P Volume - AY #2 IOA3-0 connect to an r2r dac+opamp controlling ay2 TA7630P Balance + AY #2 IOB7-4 connect to an r2r DAC+opamp controlling ay2 TA7630P Treble + AY #2 IOB3-0 connect to an r2r DAC+opamp controlling ay2 TA7630P Bass + AY #2 IOA7-4 connect to an r2r DAC+opamp controlling ay2 TA7630P Volume + AY #2 IOA3-0 connect to an r2r DAC+opamp controlling ay2 TA7630P Balance 1 0 0 x x x x x x x x x x 1 1 x W OPEN BUS - 1 0 1 * * * * * * * * * * * * * RW SM-A /CS (read or write to slave cpu address space 0000-1fff; slave cpu is held in waitstate during this) + 1 0 1 * * * * * * * * * * * * * RW SM-A /CS (read or write to slave CPU address space 0000-1fff; slave CPU is held in waitstate during this) 1 1 0 x x * * * * * * * * * * * RW SRAM (ic3) - 1 1 1 x x x x x x x x x x x x x OPEN BUS (diag rom may map here?) + 1 1 1 x x x x x x x x x x x x x OPEN BUS (diag ROM may map here?) */ /******************************************************************************/ @@ -325,7 +659,7 @@ static INPUT_PORTS_START( buggychl ) PORT_START("DSW1") - PORT_DIPNAME( 0x03, 0x03, "Game Over Bonus" ) PORT_DIPLOCATION("SW1:1,2") /* Arks/Flags/Fuel */ + PORT_DIPNAME( 0x03, 0x03, "Game Over Bonus" ) PORT_DIPLOCATION("SW1:1,2") // Arks/Flags/Fuel PORT_DIPSETTING( 0x03, "2000/1000/50" ) PORT_DIPSETTING( 0x02, "1000/500/30" ) PORT_DIPSETTING( 0x01, "500/200/10" ) @@ -334,15 +668,15 @@ PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x18, 0x18, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:4,5") - PORT_DIPSETTING( 0x18, DEF_STR( Easy ) ) /* 1300 units of fuel */ - PORT_DIPSETTING( 0x10, DEF_STR( Normal ) ) /* 1200 units of fuel */ - PORT_DIPSETTING( 0x08, DEF_STR( Hard ) ) /* 1100 units of fuel */ - PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) /* 1000 units of fuel */ + PORT_DIPSETTING( 0x18, DEF_STR( Easy ) ) // 1300 units of fuel + PORT_DIPSETTING( 0x10, DEF_STR( Normal ) ) // 1200 units of fuel + PORT_DIPSETTING( 0x08, DEF_STR( Hard ) ) // 1100 units of fuel + PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) // 1000 units of fuel PORT_SERVICE_DIPLOC( 0x20, IP_ACTIVE_LOW, "SW1:6" ) PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:7") PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) /* Only listed as OFF in the manual */ + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) // Only listed as OFF in the manual PORT_START("DSW2") PORT_DIPNAME( 0x0f, 0x00, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:1,2,3,4") @@ -384,11 +718,11 @@ PORT_DIPNAME( 0x01, 0x01, "Start button needed" ) PORT_DIPLOCATION("SW3:1") PORT_DIPSETTING( 0x00, DEF_STR( No ) ) PORT_DIPSETTING( 0x01, DEF_STR( Yes ) ) - PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, "SW3:2" ) /* Only listed as OFF in the manual */ + PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, "SW3:2" ) // Only listed as OFF in the manual PORT_DIPNAME( 0x04, 0x04, "Fuel loss (Cheat)") PORT_DIPLOCATION("SW3:3") PORT_DIPSETTING( 0x04, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x00, "Crash only" ) - PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "SW3:4" ) /* Only listed as OFF in the manual */ + PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "SW3:4" ) // Only listed as OFF in the manual PORT_DIPNAME( 0x10, 0x10, "Coinage Display" ) PORT_DIPLOCATION("SW3:5") PORT_DIPSETTING( 0x00, DEF_STR( No ) ) PORT_DIPSETTING( 0x10, DEF_STR( Yes ) ) @@ -406,7 +740,7 @@ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_TOGGLE PORT_NAME("P1 Gear Shift") /* shift */ + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_TOGGLE PORT_NAME("P1 Gear Shift") PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Test Button") PORT_CODE(KEYCODE_F1) PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) @@ -420,9 +754,9 @@ PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(buggychl_state, pedal_in_r) PORT_START("PEDAL") - PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_MINMAX(0x00, 0xff) PORT_NAME("P1 Pedal") PORT_SENSITIVITY(100) PORT_KEYDELTA(15) /* accelerator */ + PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_MINMAX(0x00, 0xff) PORT_NAME("P1 Pedal") PORT_SENSITIVITY(100) PORT_KEYDELTA(15) // accelerator - PORT_START("WHEEL") /* wheel */ + PORT_START("WHEEL") PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(10) PORT_KEYDELTA(10) PORT_REVERSE INPUT_PORTS_END @@ -452,9 +786,9 @@ }; static GFXDECODE_START( gfx_buggychl ) - GFXDECODE_ENTRY( nullptr, 0, charlayout, 0, 8 ) /* decoded at runtime */ - /* sprites are drawn pixel by pixel by draw_sprites() */ - GFXDECODE_ENTRY( "gfx1", 0, spritelayout, 0, 8 ) + GFXDECODE_ENTRY( nullptr, 0, charlayout, 0, 8 ) // decoded at runtime + // sprites are drawn pixel by pixel by draw_sprites() + GFXDECODE_ENTRY( "sprites", 0, spritelayout, 0, 8 ) GFXDECODE_END @@ -463,33 +797,25 @@ m_ta7630->set_device_volume(m_msm, data >> 4); } -void buggychl_state::ta7630_volbal_ay1_w(uint8_t data) +template +void buggychl_state::ta7630_volbal_ay_w(uint8_t data) { - /* VOL/BAL for the 7630 on this 8910 output */ - m_ta7630->set_device_volume(m_ay1, data >> 4); + // VOL/BAL for the 7630 on this 8910 output + m_ta7630->set_device_volume(m_ay[Which], data >> 4); } -void buggychl_state::port_b_0_w(uint8_t data) +template +void buggychl_state::port_b_w(uint8_t data) { - /* TRBL/BASS for the 7630 on this 8910 output */ + // TRBL/BASS for the 7630 on this 8910 output } -void buggychl_state::ta7630_volbal_ay2_w(uint8_t data) -{ - /* VOL/BAL for the 7630 on this 8910 output */ - m_ta7630->set_device_volume(m_ay2, data >> 4); -} - -void buggychl_state::port_b_1_w(uint8_t data) -{ - /* TRBL/BASS for the 7630 on this 8910 output */ -} void buggychl_state::machine_start() { uint8_t *ROM = memregion("maincpu")->base(); - membank("bank1")->configure_entries(0, 6, &ROM[0x10000], 0x2000); + m_mainbank->configure_entries(0, 6, &ROM[0x10000], 0x2000); save_item(NAME(m_sprite_lookup)); save_item(NAME(m_sl_bank)); @@ -512,65 +838,65 @@ void buggychl_state::buggychl(machine_config &config) { - /* basic machine hardware */ - Z80(config, m_maincpu, 48_MHz_XTAL/8); /* 6 MHz according to schematics, though it can be jumpered for 4MHz as well */ - m_maincpu->set_addrmap(AS_PROGRAM, &buggychl_state::buggychl_map); + // basic machine hardware + Z80(config, m_maincpu, 48_MHz_XTAL / 8); // 6 MHz according to schematics, though it can be jumpered for 4MHz as well + m_maincpu->set_addrmap(AS_PROGRAM, &buggychl_state::main_map); m_maincpu->set_vblank_int("screen", FUNC(buggychl_state::irq0_line_hold)); - Z80(config, m_audiocpu, 8_MHz_XTAL/2); /* 4 MHz according to schematics */ + Z80(config, m_audiocpu, 8_MHz_XTAL / 2); // 4 MHz according to schematics m_audiocpu->set_addrmap(AS_PROGRAM, &buggychl_state::sound_map); - m_audiocpu->set_periodic_int(FUNC(buggychl_state::irq0_line_hold), attotime::from_hz(8_MHz_XTAL/2/2/256/64)); // timer irq - //TIMER(config, "soundirq").configure_periodic(m_audiocpu, FUNC(buggychl_state::irq0_line_hold), 8_MHz_XTAL/2/2/256/64); + m_audiocpu->set_periodic_int(FUNC(buggychl_state::irq0_line_hold), attotime::from_hz(8_MHz_XTAL / 2 / 2 / 256 / 64)); // timer IRQ + //TIMER(config, "soundirq").configure_periodic(m_audiocpu, FUNC(buggychl_state::irq0_line_hold), 8_MHz_XTAL / 2 / 2 / 256 / 64); // The schematics (which are at least partly for the wrong sound board) show a configurable timer with rates of - // 61.035Hz (8_MHz_XTAL/2/2/256/128) - // or 122.0Hz (8_MHz_XTAL/2/2/256/64) + // 61.035Hz (8_MHz_XTAL / 2 / 2 / 256 / 128) + // or 122.0Hz (8_MHz_XTAL / 2 / 2 / 256 / 64) // similar to flstory.cpp and other Taito MSM5232 based games. - // The real sound pcb probably lacks the latch for this configurable timer, but does have a jumper which likely has a similar function. - // The game code implies the timer int is enable/disabled by one of the "sound_enable_w" bits? + // The real sound PCB probably lacks the latch for this configurable timer, but does have a jumper which likely has a similar function. + // The game code implies the timer int is enabled/disabled by one of the "sound_enable_w" bits? // TODO: actually hook this up? - /* audiocpu nmi is caused by (main->sound semaphore)&&(sound_nmi_enabled), identical to bubble bobble. */ + // audiocpu NMI is caused by (main->sound semaphore)&&(sound_nmi_enabled), identical to Bubble Bobble. - TAITO68705_MCU(config, m_bmcu, 48_MHz_XTAL/8/2); /* CPUspeed/2 MHz according to schematics, so 3MHz if cpu is jumpered for 6MHz */ + TAITO68705_MCU(config, m_bmcu, 48_MHz_XTAL / 8 / 2); // CPUspeed/2 MHz according to schematics, so 3MHz if CPU is jumpered for 6MHz WATCHDOG_TIMER(config, "watchdog").set_vblank_count("screen", 128); // typical Taito 74ls392 - /* video hardware */ + // video hardware SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_refresh_hz(60); - m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); // not accurate m_screen->set_size(32*8, 32*8); m_screen->set_visarea(0*8, 32*8-1, 2*8, 30*8-1); // derived from ladyfrog.cpp, causes glitches? // m_screen->set_raw(8_MHz_XTAL, 510, 0, 256, 262, 2*8, 30*8); // pixel clock appears to run at 8 MHz - m_screen->set_screen_update(FUNC(buggychl_state::screen_update_buggychl)); + m_screen->set_screen_update(FUNC(buggychl_state::screen_update)); m_screen->set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_buggychl); - PALETTE(config, m_palette, FUNC(buggychl_state::buggychl_palette)).set_format(palette_device::xRGB_444, 128 + 128); + PALETTE(config, m_palette, FUNC(buggychl_state::palette)).set_format(palette_device::xRGB_444, 128 + 128); m_palette->set_endianness(ENDIANNESS_BIG); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); - GENERIC_LATCH_8(config, m_soundlatch).data_pending_callback().set(m_soundnmi, FUNC(input_merger_device::in_w<0>)); - GENERIC_LATCH_8(config, m_soundlatch2); + GENERIC_LATCH_8(config, m_soundlatch[0]).data_pending_callback().set(m_soundnmi, FUNC(input_merger_device::in_w<0>)); + GENERIC_LATCH_8(config, m_soundlatch[1]); INPUT_MERGER_ALL_HIGH(config, m_soundnmi).output_handler().set_inputline(m_audiocpu, INPUT_LINE_NMI); TA7630(config, m_ta7630); - YM2149(config, m_ay1, 8_MHz_XTAL/4); - m_ay1->port_a_write_callback().set(FUNC(buggychl_state::ta7630_volbal_ay1_w)); - m_ay1->port_b_write_callback().set(FUNC(buggychl_state::port_b_0_w)); - m_ay1->add_route(ALL_OUTPUTS, "mono", 0.50); - - YM2149(config, m_ay2, 8_MHz_XTAL/4); - m_ay2->port_a_write_callback().set(FUNC(buggychl_state::ta7630_volbal_ay2_w)); - m_ay2->port_b_write_callback().set(FUNC(buggychl_state::port_b_1_w)); - m_ay2->add_route(ALL_OUTPUTS, "mono", 0.50); + YM2149(config, m_ay[0], 8_MHz_XTAL / 4); + m_ay[0]->port_a_write_callback().set(FUNC(buggychl_state::ta7630_volbal_ay_w<0>)); + m_ay[0]->port_b_write_callback().set(FUNC(buggychl_state::port_b_w<0>)); + m_ay[0]->add_route(ALL_OUTPUTS, "mono", 0.50); + + YM2149(config, m_ay[1], 8_MHz_XTAL / 4); + m_ay[1]->port_a_write_callback().set(FUNC(buggychl_state::ta7630_volbal_ay_w<1>)); + m_ay[1]->port_b_write_callback().set(FUNC(buggychl_state::port_b_w<1>)); + m_ay[1]->add_route(ALL_OUTPUTS, "mono", 0.50); - MSM5232(config, m_msm, 8_MHz_XTAL/4); - m_msm->set_capacitors(0.39e-6, 0.39e-6, 0.39e-6, 0.39e-6, 0.39e-6, 0.39e-6, 0.39e-6, 0.39e-6); /* default 0.39 uF capacitors (not verified) */ + MSM5232(config, m_msm, 8_MHz_XTAL / 4); + m_msm->set_capacitors(0.39e-6, 0.39e-6, 0.39e-6, 0.39e-6, 0.39e-6, 0.39e-6, 0.39e-6, 0.39e-6); // default 0.39 uF capacitors (not verified) m_msm->add_route(0, "mono", 1.0); // pin 28 2'-1 m_msm->add_route(1, "mono", 1.0); // pin 29 4'-1 m_msm->add_route(2, "mono", 1.0); // pin 30 8'-1 @@ -594,17 +920,17 @@ ROM_REGION( 0x1c000, "maincpu", 0 ) ROM_LOAD( "a22-04-2.23", 0x00000, 0x4000, CRC(16445a6a) SHA1(5ce7b0b1aeb3b6cd400965467f913558f39c251f) ) ROM_LOAD( "a22-05-2.22", 0x04000, 0x4000, CRC(d57430b2) SHA1(3e5b8c21a342d8e26c12a78535748073bc5b8742) ) - ROM_LOAD( "a22-01.3", 0x10000, 0x4000, CRC(af3b7554) SHA1(fd4f5a6cf9253f64c7e86d566802a02baae3b379) ) /* banked */ - ROM_LOAD( "a22-02.2", 0x14000, 0x4000, CRC(b8a645fb) SHA1(614a0656dee0cfa1d7e16ec1e0138a423ecaf18b) ) /* banked */ - ROM_LOAD( "a22-03.1", 0x18000, 0x4000, CRC(5f45d469) SHA1(3a1b9ab2d57c06bfffb1271583944c90d3f6b5a2) ) /* banked */ + ROM_LOAD( "a22-01.3", 0x10000, 0x4000, CRC(af3b7554) SHA1(fd4f5a6cf9253f64c7e86d566802a02baae3b379) ) // banked + ROM_LOAD( "a22-02.2", 0x14000, 0x4000, CRC(b8a645fb) SHA1(614a0656dee0cfa1d7e16ec1e0138a423ecaf18b) ) // banked + ROM_LOAD( "a22-03.1", 0x18000, 0x4000, CRC(5f45d469) SHA1(3a1b9ab2d57c06bfffb1271583944c90d3f6b5a2) ) // banked - ROM_REGION( 0x10000, "audiocpu", 0 ) /* sound Z80 */ + ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 ROM_LOAD( "a22-24.28", 0x00000, 0x4000, CRC(1e7f841f) SHA1(2dc0787b08d32acb78291b689c02dbb83d04d08c) ) - ROM_REGION( 0x0800, "bmcu:mcu", 0 ) /* 8k for the microcontroller */ + ROM_REGION( 0x0800, "bmcu:mcu", 0 ) ROM_LOAD( "a22-19.31", 0x00000, 0x0800, CRC(06a71df0) SHA1(28183e6769e1471e7f28dc2a9f5b54e14b7ef339) ) - ROM_REGION( 0x20000, "gfx1", 0 ) /* sprites */ + ROM_REGION( 0x20000, "sprites", 0 ) ROM_LOAD( "a22-06.111", 0x00000, 0x4000, CRC(1df91b17) SHA1(440d33bf984042fb4eac8f17bb385992ccdc6113) ) ROM_LOAD( "a22-07.110", 0x04000, 0x4000, CRC(2f0ab9b7) SHA1(07b98e23d12da834d522e29fe7891503dc258b05) ) ROM_LOAD( "a22-08.109", 0x08000, 0x4000, CRC(49cb2134) SHA1(f9998617c097b90be7257ba6fc1e46ff9e1f8916) ) @@ -614,27 +940,27 @@ ROM_LOAD( "a22-12.105", 0x18000, 0x4000, CRC(8b365b24) SHA1(a306c1f6fe1f5563602ab424f1b4f6ac17d1e47d) ) ROM_LOAD( "a22-13.104", 0x1c000, 0x4000, CRC(2c6d68fe) SHA1(9e1a0e44ae2b9986d0ebff49a0fd4df3e8a7f4e7) ) - ROM_REGION( 0x4000, "gfx2", 0 ) /* sprite zoom tables */ - ROM_LOAD( "a22-14.59", 0x0000, 0x2000, CRC(a450b3ef) SHA1(42646bfaed19ea01ffe06996bb6c2fd6c70076d6) ) /* vertical */ - ROM_LOAD( "a22-15.115", 0x2000, 0x1000, CRC(337a0c14) SHA1(2aa6814f74497c5c55bf7098d7f6f5508845e36c) ) /* horizontal */ - ROM_LOAD( "a22-16.116", 0x3000, 0x1000, CRC(337a0c14) SHA1(2aa6814f74497c5c55bf7098d7f6f5508845e36c) ) /* horizontal */ + ROM_REGION( 0x4000, "sprite_zoom_table", 0 ) + ROM_LOAD( "a22-14.59", 0x0000, 0x2000, CRC(a450b3ef) SHA1(42646bfaed19ea01ffe06996bb6c2fd6c70076d6) ) // vertical + ROM_LOAD( "a22-15.115", 0x2000, 0x1000, CRC(337a0c14) SHA1(2aa6814f74497c5c55bf7098d7f6f5508845e36c) ) // horizontal + ROM_LOAD( "a22-16.116", 0x3000, 0x1000, CRC(337a0c14) SHA1(2aa6814f74497c5c55bf7098d7f6f5508845e36c) ) // horizontal ROM_END ROM_START( buggychlt ) ROM_REGION( 0x1c000, "maincpu", 0 ) ROM_LOAD( "bu04.bin", 0x00000, 0x4000, CRC(f90ab854) SHA1(d4536c98be35de3d888548e2de15f8435ca4f08c) ) ROM_LOAD( "bu05.bin", 0x04000, 0x4000, CRC(543d0949) SHA1(b7b0b0319f5376e7cfcfd0e8a4fa6fea566e0206) ) - ROM_LOAD( "a22-01.3", 0x10000, 0x4000, CRC(af3b7554) SHA1(fd4f5a6cf9253f64c7e86d566802a02baae3b379) ) /* banked */ - ROM_LOAD( "a22-02.2", 0x14000, 0x4000, CRC(b8a645fb) SHA1(614a0656dee0cfa1d7e16ec1e0138a423ecaf18b) ) /* banked */ - ROM_LOAD( "a22-03.1", 0x18000, 0x4000, CRC(5f45d469) SHA1(3a1b9ab2d57c06bfffb1271583944c90d3f6b5a2) ) /* banked */ + ROM_LOAD( "a22-01.3", 0x10000, 0x4000, CRC(af3b7554) SHA1(fd4f5a6cf9253f64c7e86d566802a02baae3b379) ) // banked + ROM_LOAD( "a22-02.2", 0x14000, 0x4000, CRC(b8a645fb) SHA1(614a0656dee0cfa1d7e16ec1e0138a423ecaf18b) ) // banked + ROM_LOAD( "a22-03.1", 0x18000, 0x4000, CRC(5f45d469) SHA1(3a1b9ab2d57c06bfffb1271583944c90d3f6b5a2) ) // banked - ROM_REGION( 0x10000, "audiocpu", 0 ) /* sound Z80 */ + ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 ROM_LOAD( "a22-24.28", 0x00000, 0x4000, CRC(1e7f841f) SHA1(2dc0787b08d32acb78291b689c02dbb83d04d08c) ) - ROM_REGION( 0x0800, "bmcu:mcu", 0 ) /* 8k for the microcontroller */ + ROM_REGION( 0x0800, "bmcu:mcu", 0 ) ROM_LOAD( "a22-19.31", 0x00000, 0x0800, CRC(06a71df0) SHA1(28183e6769e1471e7f28dc2a9f5b54e14b7ef339) ) - ROM_REGION( 0x20000, "gfx1", 0 ) /* sprites */ + ROM_REGION( 0x20000, "sprites", 0 ) ROM_LOAD( "a22-06.111", 0x00000, 0x4000, CRC(1df91b17) SHA1(440d33bf984042fb4eac8f17bb385992ccdc6113) ) ROM_LOAD( "a22-07.110", 0x04000, 0x4000, CRC(2f0ab9b7) SHA1(07b98e23d12da834d522e29fe7891503dc258b05) ) ROM_LOAD( "a22-08.109", 0x08000, 0x4000, CRC(49cb2134) SHA1(f9998617c097b90be7257ba6fc1e46ff9e1f8916) ) @@ -644,12 +970,14 @@ ROM_LOAD( "a22-12.105", 0x18000, 0x4000, CRC(8b365b24) SHA1(a306c1f6fe1f5563602ab424f1b4f6ac17d1e47d) ) ROM_LOAD( "a22-13.104", 0x1c000, 0x4000, CRC(2c6d68fe) SHA1(9e1a0e44ae2b9986d0ebff49a0fd4df3e8a7f4e7) ) - ROM_REGION( 0x4000, "gfx2", 0 ) /* sprite zoom tables */ - ROM_LOAD( "a22-14.59", 0x0000, 0x2000, CRC(a450b3ef) SHA1(42646bfaed19ea01ffe06996bb6c2fd6c70076d6) ) /* vertical */ - ROM_LOAD( "a22-15.115", 0x2000, 0x1000, CRC(337a0c14) SHA1(2aa6814f74497c5c55bf7098d7f6f5508845e36c) ) /* horizontal */ - ROM_LOAD( "a22-16.116", 0x3000, 0x1000, CRC(337a0c14) SHA1(2aa6814f74497c5c55bf7098d7f6f5508845e36c) ) /* horizontal */ + ROM_REGION( 0x4000, "sprite_zoom_table", 0 ) + ROM_LOAD( "a22-14.59", 0x0000, 0x2000, CRC(a450b3ef) SHA1(42646bfaed19ea01ffe06996bb6c2fd6c70076d6) ) // vertical + ROM_LOAD( "a22-15.115", 0x2000, 0x1000, CRC(337a0c14) SHA1(2aa6814f74497c5c55bf7098d7f6f5508845e36c) ) // horizontal + ROM_LOAD( "a22-16.116", 0x3000, 0x1000, CRC(337a0c14) SHA1(2aa6814f74497c5c55bf7098d7f6f5508845e36c) ) // horizontal ROM_END +} // anonymous namespace + GAMEL( 1984, buggychl, 0, buggychl, buggychl, buggychl_state, empty_init, ROT270, "Taito Corporation", "Buggy Challenge", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE, layout_buggychl ) GAMEL( 1984, buggychlt, buggychl, buggychl, buggychl, buggychl_state, empty_init, ROT270, "Taito Corporation (Tecfri license)", "Buggy Challenge (Tecfri)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE, layout_buggychl ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/bw2.cpp mame-0.243+dfsg.1/src/mame/drivers/bw2.cpp --- mame-0.242+dfsg.1/src/mame/drivers/bw2.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/bw2.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -477,7 +477,7 @@ } //------------------------------------------------- -// floppy_format_type floppy_formats +// floppy_formats //------------------------------------------------- WRITE_LINE_MEMBER( bw2_state::fdc_drq_w ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/by17.cpp mame-0.243+dfsg.1/src/mame/drivers/by17.cpp --- mame-0.242+dfsg.1/src/mame/drivers/by17.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/by17.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -93,11 +93,11 @@ uint8_t m_u10b = 0U; uint8_t m_u11a = 0U; uint8_t m_u11b = 0U; - bool m_u10_ca2 = 0; - bool m_u10_cb1 = 0; - bool m_u10_cb2 = 0; - bool m_u11_ca1 = 0; - bool m_u11_cb2 = 0; + bool m_u10_ca2 = false; + bool m_u10_cb1 = false; + bool m_u10_cb2 = false; + bool m_u11_ca1 = false; + bool m_u11_cb2 = false; uint8_t m_segment[6]{}; uint8_t m_lamp_decode = 0U; uint8_t m_solenoid_features[20][4]{}; @@ -1179,15 +1179,15 @@ } // anonymous namespace -GAME( 1976, bowarrow, 0, by17, by17, by17_state, init_by17, ROT0, "Bally", "Bow & Arrow (Prototype, rev. 23)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1976, bowarrowa, bowarrow, by17, by17, by17_state, init_by17, ROT0, "Bally", "Bow & Arrow (Prototype, rev. 22)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1977, freedom, 0, by17, by17, by17_state, init_by17, ROT0, "Bally", "Freedom", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1977, nightrdr, 0, by17, by17, by17_state, init_by17, ROT0, "Bally", "Night Rider (rev. 21)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1977, nightr20, nightrdr, by17, by17, by17_state, init_by17, ROT0, "Bally", "Night Rider (rev. 20)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1978, blackjck, 0, by17, by17, by17_state, init_by17, ROT0, "Bally", "Black Jack (Pinball)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1977, evelknie, 0, by17, by17, by17_state, init_by17, ROT0, "Bally", "Evel Knievel", MACHINE_IS_SKELETON_MECHANICAL) -GAMEL( 1978, matahari, 0, by17, matahari, by17_state, init_matahari, ROT0, "Bally", "Mata Hari", MACHINE_MECHANICAL | MACHINE_NOT_WORKING, layout_by17_matahari) -GAME( 1977, eightbll, 0, by17, by17, by17_state, init_by17, ROT0, "Bally", "Eight Ball (rev. 20)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1977, eightblo, eightbll, by17, by17, by17_state, init_by17, ROT0, "Bally", "Eight Ball (rev. 17)", MACHINE_IS_SKELETON_MECHANICAL) -GAMEL( 1978, pwerplay, 0, by17, pwerplay, by17_state, init_pwerplay, ROT0, "Bally", "Power Play (Pinball)", MACHINE_MECHANICAL | MACHINE_NOT_WORKING, layout_by17_pwerplay) +GAME( 1976, bowarrow, 0, by17, by17, by17_state, init_by17, ROT0, "Bally", "Bow & Arrow (Prototype, rev. 23)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1976, bowarrowa, bowarrow, by17, by17, by17_state, init_by17, ROT0, "Bally", "Bow & Arrow (Prototype, rev. 22)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1977, freedom, 0, by17, by17, by17_state, init_by17, ROT0, "Bally", "Freedom", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1977, nightrdr, 0, by17, by17, by17_state, init_by17, ROT0, "Bally", "Night Rider (rev. 21)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1977, nightr20, nightrdr, by17, by17, by17_state, init_by17, ROT0, "Bally", "Night Rider (rev. 20)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1978, blackjck, 0, by17, by17, by17_state, init_by17, ROT0, "Bally", "Black Jack (Pinball)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1977, evelknie, 0, by17, by17, by17_state, init_by17, ROT0, "Bally", "Evel Knievel", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAMEL( 1978, matahari, 0, by17, matahari, by17_state, init_matahari, ROT0, "Bally", "Mata Hari", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE, layout_by17_matahari) +GAME( 1977, eightbll, 0, by17, by17, by17_state, init_by17, ROT0, "Bally", "Eight Ball (rev. 20)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1977, eightblo, eightbll, by17, by17, by17_state, init_by17, ROT0, "Bally", "Eight Ball (rev. 17)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAMEL( 1978, pwerplay, 0, by17, pwerplay, by17_state, init_pwerplay, ROT0, "Bally", "Power Play (Pinball)", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE, layout_by17_pwerplay) GAME( 1978, stk_sprs, 0, by17, by17, by17_state, init_by17, ROT0, "Bally", "Strikes and Spares", MACHINE_IS_SKELETON_MECHANICAL) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/by35.cpp mame-0.243+dfsg.1/src/mame/drivers/by35.cpp --- mame-0.242+dfsg.1/src/mame/drivers/by35.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/by35.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -240,12 +240,12 @@ static solenoid_feature_data const s_solenoid_features_default; private: - bool m_u10_ca2 = 0; - bool m_u10_cb1 = 0; - bool m_u10_cb2 = 0; - bool m_u11_ca1 = 0; - bool m_u11_cb2 = 0; - bool m_7d = 0; + bool m_u10_ca2 = false; + bool m_u10_cb1 = false; + bool m_u10_cb2 = false; + bool m_u11_ca1 = false; + bool m_u11_cb2 = false; + bool m_7d = false; uint8_t m_segment[6]{}; uint8_t m_lamp_decode = 0U; solenoid_feature_data const &m_solenoid_features; @@ -2881,86 +2881,86 @@ // AS-2888 sound -GAME( 1979, sst, 0, as2888, by35, by35_state, init_by35_6, ROT0, "Bally", "Supersonic", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) -GAMEL(1978, playboy, 0, as2888, playboy, by35_state, init_by35_6, ROT0, "Bally", "Playboy", MACHINE_MECHANICAL | MACHINE_NOT_WORKING, layout_by35_playboy) -GAME( 1978, lostwrlp, 0, as2888, by35, by35_state, init_by35_6, ROT0, "Bally", "Lost World", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) -GAME( 1978, smman, 0, as2888, by35, by35_state, init_by35_6, ROT0, "Bally", "Six Million Dollar Man", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) -GAME( 1978, voltan, 0, as2888, by35, by35_state, init_by35_6, ROT0, "Bally", "Voltan Escapes Cosmic Doom", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) -GAME( 1979, startrep, 0, as2888, by35, by35_state, init_by35_6, ROT0, "Bally", "Star Trek (Pinball)", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) -GAME( 1979, kiss, 0, as2888, by35, by35_state, init_by35_6, ROT0, "Bally", "Kiss", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) -GAME( 1979, hglbtrtr, 0, as2888, by35_os35, by35_state, init_by35_6, ROT0, "Bally", "Harlem Globetrotters On Tour", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) -GAME( 1979, dollyptn, 0, as2888, by35_os35, by35_state, init_by35_6, ROT0, "Bally", "Dolly Parton", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) -GAME( 1979, paragon, 0, as2888, by35, by35_state, init_by35_6, ROT0, "Bally", "Paragon", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) +GAME( 1979, sst, 0, as2888, by35, by35_state, init_by35_6, ROT0, "Bally", "Supersonic", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAMEL(1978, playboy, 0, as2888, playboy, by35_state, init_by35_6, ROT0, "Bally", "Playboy", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE, layout_by35_playboy) +GAME( 1978, lostwrlp, 0, as2888, by35, by35_state, init_by35_6, ROT0, "Bally", "Lost World", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1978, smman, 0, as2888, by35, by35_state, init_by35_6, ROT0, "Bally", "Six Million Dollar Man", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1978, voltan, 0, as2888, by35, by35_state, init_by35_6, ROT0, "Bally", "Voltan Escapes Cosmic Doom", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1979, startrep, 0, as2888, by35, by35_state, init_by35_6, ROT0, "Bally", "Star Trek (Pinball)", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1979, kiss, 0, as2888, by35, by35_state, init_by35_6, ROT0, "Bally", "Kiss", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1979, hglbtrtr, 0, as2888, by35_os35, by35_state, init_by35_6, ROT0, "Bally", "Harlem Globetrotters On Tour", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1979, dollyptn, 0, as2888, by35_os35, by35_state, init_by35_6, ROT0, "Bally", "Dolly Parton", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1979, paragon, 0, as2888, by35, by35_state, init_by35_6, ROT0, "Bally", "Paragon", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // AS-3022 sound -GAME( 1980, ngndshkr, 0, as3022, by35_os35, by35_state, init_by35_6, ROT0, "Bally", "Nitro Ground Shaker", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) -GAME( 1980, slbmania, 0, as3022, by35_os35, by35_state, init_by35_6, ROT0, "Bally", "Silverball Mania", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) -GAME( 1979, futurspa, 0, as3022, by35_os35, by35_state, init_by35_6, ROT0, "Bally", "Future Spa", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) -GAME( 1980, spaceinv, 0, as3022, by35_os35, by35_state, init_by35_6, ROT0, "Bally", "Space Invaders", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) -GAME( 1980, rollston, 0, as3022, by35_os35, by35_state, init_by35_6, ROT0, "Bally", "Rolling Stones", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) -GAME( 1980, mystic, 0, as3022, by35_os35, by35_state, init_by35_6, ROT0, "Bally", "Mystic", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) -GAME( 1980, xenon, 0, sounds_plus, by35_os40, by35_state, init_by35_6, ROT0, "Bally", "Xenon", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) -GAME( 1980, xenonf, xenon, sounds_plus, by35_os40, by35_state, init_by35_6, ROT0, "Bally", "Xenon (French)", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) -GAME( 1980, viking, 0, as3022, by35_os35, by35_state, init_by35_6, ROT0, "Bally", "Viking", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) -GAME( 1980, hotdoggn, 0, as3022, by35_os35, by35_state, init_by35_6, ROT0, "Bally", "Hotdoggin'", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) -GAME( 1980, skatebll, 0, as3022, by35_os40, by35_state, init_by35_7, ROT0, "Bally", "Skateball", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) -GAME( 1980, frontier, 0, as3022, frontier, by35_state, init_by35_7, ROT0, "Bally", "Frontier", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) -GAME( 1982, speakesy, 0, as3022, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Speakeasy", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) -GAME( 1982, speakesy4p, speakesy, as3022, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Speakeasy 4 Player", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) -GAME( 1983, bmx, 0, as3022, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "BMX", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) -GAME( 1983, granslam, 0, as3022, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Grand Slam", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) -GAME( 1983, granslam4, granslam, as3022, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Grand Slam (4 Players)", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) -GAME( 1983, goldball, 0, as3022, by35, by35_state, init_by35_7, ROT0, "Bally", "Gold Ball (set 1)", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) -GAME( 1983, goldballn, goldball, as3022, by35, by35_state, init_by35_7, ROT0, "Bally", "Gold Ball (Field Service Upgrade)", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) +GAME( 1980, ngndshkr, 0, as3022, by35_os35, by35_state, init_by35_6, ROT0, "Bally", "Nitro Ground Shaker", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1980, slbmania, 0, as3022, by35_os35, by35_state, init_by35_6, ROT0, "Bally", "Silverball Mania", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1979, futurspa, 0, as3022, by35_os35, by35_state, init_by35_6, ROT0, "Bally", "Future Spa", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1980, spaceinv, 0, as3022, by35_os35, by35_state, init_by35_6, ROT0, "Bally", "Space Invaders", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1980, rollston, 0, as3022, by35_os35, by35_state, init_by35_6, ROT0, "Bally", "Rolling Stones", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1980, mystic, 0, as3022, by35_os35, by35_state, init_by35_6, ROT0, "Bally", "Mystic", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1980, xenon, 0, sounds_plus, by35_os40, by35_state, init_by35_6, ROT0, "Bally", "Xenon", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1980, xenonf, xenon, sounds_plus, by35_os40, by35_state, init_by35_6, ROT0, "Bally", "Xenon (French)", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1980, viking, 0, as3022, by35_os35, by35_state, init_by35_6, ROT0, "Bally", "Viking", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1980, hotdoggn, 0, as3022, by35_os35, by35_state, init_by35_6, ROT0, "Bally", "Hotdoggin'", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1980, skatebll, 0, as3022, by35_os40, by35_state, init_by35_7, ROT0, "Bally", "Skateball", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1980, frontier, 0, as3022, frontier, by35_state, init_by35_7, ROT0, "Bally", "Frontier", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1982, speakesy, 0, as3022, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Speakeasy", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1982, speakesy4p, speakesy, as3022, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Speakeasy 4 Player", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1983, bmx, 0, as3022, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "BMX", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1983, granslam, 0, as3022, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Grand Slam", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1983, granslam4, granslam, as3022, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Grand Slam (4 Players)", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1983, goldball, 0, as3022, by35, by35_state, init_by35_7, ROT0, "Bally", "Gold Ball (set 1)", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1983, goldballn, goldball, as3022, by35, by35_state, init_by35_7, ROT0, "Bally", "Gold Ball (Field Service Upgrade)", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // Squawk & Talk sound -GAME( 1981, flashgdn, 0, squawk_n_talk_ay, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Flash Gordon", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) -GAME( 1981, flashgdnf, flashgdn, squawk_n_talk_ay, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Flash Gordon (French)", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) -GAME( 1981, flashgdnv, flashgdn, sounds_plus, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Flash Gordon (Vocalizer sound)", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) -GAME( 1981, flashgdnfv, flashgdn, sounds_plus, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Flash Gordon (French Vocalizer sound)", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) -GAME( 1981, fball_ii, 0, squawk_n_talk_ay, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Fireball II", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) -GAME( 1981, eballdlx, 0, squawk_n_talk_ay, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Eight Ball Deluxe (rev. 15)", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) -GAME( 1981, eballd14, eballdlx, squawk_n_talk_ay, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Eight Ball Deluxe (rev. 14)", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) -GAME( 1981, embryon, 0, squawk_n_talk, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Embryon", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) -GAME( 1981, fathom, 0, squawk_n_talk, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Fathom", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) -GAME( 1981, centaur, 0, squawk_n_talk, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Centaur", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) -GAME( 1981, medusa, 0, squawk_n_talk, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Medusa", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) -GAME( 1982, vector, 0, squawk_n_talk_ay, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Vector", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) -GAME( 1981, elektra, 0, squawk_n_talk_ay, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Elektra", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) -GAME( 1982, spectrm, 0, squawk_n_talk, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Spectrum", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) -GAME( 1982, spectrm4, spectrm, squawk_n_talk, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Spectrum (ver 4)", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) -GAME( 1982, rapidfip, 0, squawk_n_talk, by35, by35_state, init_by35_7, ROT0, "Bally", "Rapid Fire", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) -GAME( 1982, m_mpac, 0, squawk_n_talk_ay, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Mr. and Mrs. PacMan", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) -GAME( 1982, mysteria, 0, squawk_n_talk_ay, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Mysterian (prototype)", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) // uses 2 sound boards +GAME( 1981, flashgdn, 0, squawk_n_talk_ay, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Flash Gordon", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1981, flashgdnf, flashgdn, squawk_n_talk_ay, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Flash Gordon (French)", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1981, flashgdnv, flashgdn, sounds_plus, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Flash Gordon (Vocalizer sound)", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1981, flashgdnfv, flashgdn, sounds_plus, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Flash Gordon (French Vocalizer sound)", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1981, fball_ii, 0, squawk_n_talk_ay, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Fireball II", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1981, eballdlx, 0, squawk_n_talk_ay, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Eight Ball Deluxe (rev. 15)", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1981, eballd14, eballdlx, squawk_n_talk_ay, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Eight Ball Deluxe (rev. 14)", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1981, embryon, 0, squawk_n_talk, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Embryon", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1981, fathom, 0, squawk_n_talk, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Fathom", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1981, centaur, 0, squawk_n_talk, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Centaur", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1981, medusa, 0, squawk_n_talk, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Medusa", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1982, vector, 0, squawk_n_talk_ay, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Vector", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1981, elektra, 0, squawk_n_talk_ay, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Elektra", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1982, spectrm, 0, squawk_n_talk, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Spectrum", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1982, spectrm4, spectrm, squawk_n_talk, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Spectrum (ver 4)", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1982, rapidfip, 0, squawk_n_talk, by35, by35_state, init_by35_7, ROT0, "Bally", "Rapid Fire", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1982, m_mpac, 0, squawk_n_talk_ay, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Mr. and Mrs. PacMan", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1982, mysteria, 0, squawk_n_talk_ay, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Mysterian (prototype)", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // uses 2 sound boards // Cheap Squeak sound -GAME( 1984, kosteel, 0, cheap_squeak, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Kings of Steel", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) -GAME( 1983, xsandos, 0, cheap_squeak, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "X's & O's", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) -GAME( 1984, spyhuntr, 0, cheap_squeak, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Spy Hunter (Pinball)", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) -GAME( 1984, fbclass, 0, cheap_squeak, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Fireball Classic", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) -GAME( 1984, blakpyra, 0, cheap_squeak, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Black Pyramid", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) -GAME( 1985, cybrnaut, 0, cheap_squeak, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Cybernaut", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) +GAME( 1984, kosteel, 0, cheap_squeak, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Kings of Steel", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1983, xsandos, 0, cheap_squeak, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "X's & O's", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1984, spyhuntr, 0, cheap_squeak, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Spy Hunter (Pinball)", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1984, fbclass, 0, cheap_squeak, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Fireball Classic", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1984, blakpyra, 0, cheap_squeak, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Black Pyramid", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1985, cybrnaut, 0, cheap_squeak, by35_os5x, by35_state, init_by35_7, ROT0, "Bally", "Cybernaut", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // Other manufacturers -GAME( 1984, suprbowl, xsandos, by35, by35, by35_state, init_by35_7, ROT0, "Bell Games", "Super Bowl", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1984, tigerrag, kosteel, by35, by35, by35_state, init_by35_7, ROT0, "Bell Games", "Tiger Rag", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1985, cosflash, flashgdn, by35, by35, by35_state, init_by35_7, ROT0, "Bell Games", "Cosmic Flash", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1985, newwave, blakpyra, by35, by35, by35_state, init_by35_7, ROT0, "Bell Games", "New Wave", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1985, saturn2, spyhuntr, by35, by35, by35_state, init_by35_7, ROT0, "Bell Games", "Saturn 2", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1985, worlddef, 0, by35, by35, by35_state, init_by35_7, ROT0, "Bell Games", "World Defender", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1986, spacehaw, cybrnaut, by35, by35, by35_state, init_by35_7, ROT0, "Nuova Bell Games", "Space Hawks", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1986, darkshad, 0, nuovo, by35, by35_state, init_by35_7, ROT0, "Nuova Bell Games", "Dark Shadow", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1986, skflight, 0, nuovo, by35, by35_state, init_by35_7, ROT0, "Nuova Bell Games", "Skill Flight", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1987, cobrap, 0, nuovo, by35, by35_state, init_by35_7, ROT0, "Nuova Bell Games", "Cobra", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1987, futrquen, 0, nuovo, by35, by35_state, init_by35_7, ROT0, "Nuova Bell Games", "Future Queen", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1987, f1gpp, 0, nuovo, by35, by35_state, init_by35_7, ROT0, "Nuova Bell Games", "F1 Grand Prix (Nuova Bell Games)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1988, toppin, 0, nuovo, by35, by35_state, init_by35_7, ROT0, "Nuova Bell Games", "Top Pin", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1988, uboat65, 0, nuovo, by35, by35_state, init_by35_7, ROT0, "Nuova Bell Games", "U-boat 65", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1986, bullseye, 0, by35, by35, by35_state, init_by35_7, ROT0, "Grand Products", "301/Bullseye (301 Darts Scoring)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1986, bullseyn, bullseye, by35, by35, by35_state, init_by35_7, ROT0, "Grand Products", "301/Bullseye (Traditional Scoring)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1988, bbbowlin, 0, by35, by35, by35_state, init_by35_7, ROT0, "United", "Big Ball Bowling (Bowler)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1988, monrobwl, 0, by35, by35, by35_state, init_by35_7, ROT0, "Monroe Bowling Co.", "Stars & Strikes (Bowler)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1984, bigbat, 0, squawk_n_talk_ay, by35, by35_state, init_by35_7, ROT0, "Bally Midway", "Big Bat (Bat game)", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) -GAME( 1984, mdntmrdr, 0, squawk_n_talk_ay, by35, by35_state, init_by35_6, ROT0, "Bally Midway", "Midnight Marauders (Gun game)", MACHINE_MECHANICAL | MACHINE_NOT_WORKING) -GAME( 1984, blbeauty, 0, by35, by35, by35_state, init_by35_7, ROT0, "Stern", "Black Beauty (Shuffle)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1984, myststar, 0, by35, by35, by35_state, init_by35_6, ROT0, "Zaccaria", "Mystic Star", MACHINE_IS_SKELETON_MECHANICAL) +GAME( 1984, suprbowl, xsandos, by35, by35, by35_state, init_by35_7, ROT0, "Bell Games", "Super Bowl", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1984, tigerrag, kosteel, by35, by35, by35_state, init_by35_7, ROT0, "Bell Games", "Tiger Rag", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1985, cosflash, flashgdn, by35, by35, by35_state, init_by35_7, ROT0, "Bell Games", "Cosmic Flash", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1985, newwave, blakpyra, by35, by35, by35_state, init_by35_7, ROT0, "Bell Games", "New Wave", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1985, saturn2, spyhuntr, by35, by35, by35_state, init_by35_7, ROT0, "Bell Games", "Saturn 2", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1985, worlddef, 0, by35, by35, by35_state, init_by35_7, ROT0, "Bell Games", "World Defender", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1986, spacehaw, cybrnaut, by35, by35, by35_state, init_by35_7, ROT0, "Nuova Bell Games", "Space Hawks", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1986, darkshad, 0, nuovo, by35, by35_state, init_by35_7, ROT0, "Nuova Bell Games", "Dark Shadow", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1986, skflight, 0, nuovo, by35, by35_state, init_by35_7, ROT0, "Nuova Bell Games", "Skill Flight", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1987, cobrap, 0, nuovo, by35, by35_state, init_by35_7, ROT0, "Nuova Bell Games", "Cobra", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1987, futrquen, 0, nuovo, by35, by35_state, init_by35_7, ROT0, "Nuova Bell Games", "Future Queen", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1987, f1gpp, 0, nuovo, by35, by35_state, init_by35_7, ROT0, "Nuova Bell Games", "F1 Grand Prix (Nuova Bell Games)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1988, toppin, 0, nuovo, by35, by35_state, init_by35_7, ROT0, "Nuova Bell Games", "Top Pin", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1988, uboat65, 0, nuovo, by35, by35_state, init_by35_7, ROT0, "Nuova Bell Games", "U-boat 65", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1986, bullseye, 0, by35, by35, by35_state, init_by35_7, ROT0, "Grand Products", "301/Bullseye (301 Darts Scoring)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1986, bullseyn, bullseye, by35, by35, by35_state, init_by35_7, ROT0, "Grand Products", "301/Bullseye (Traditional Scoring)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1988, bbbowlin, 0, by35, by35, by35_state, init_by35_7, ROT0, "United", "Big Ball Bowling (Bowler)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1988, monrobwl, 0, by35, by35, by35_state, init_by35_7, ROT0, "Monroe Bowling Co.", "Stars & Strikes (Bowler)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1984, bigbat, 0, squawk_n_talk_ay, by35, by35_state, init_by35_7, ROT0, "Bally Midway", "Big Bat (Bat game)", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1984, mdntmrdr, 0, squawk_n_talk_ay, by35, by35_state, init_by35_6, ROT0, "Bally Midway", "Midnight Marauders (Gun game)", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1984, blbeauty, 0, by35, by35, by35_state, init_by35_7, ROT0, "Stern", "Black Beauty (Shuffle)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1984, myststar, 0, by35, by35, by35_state, init_by35_6, ROT0, "Zaccaria", "Mystic Star", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/by6803.cpp mame-0.243+dfsg.1/src/mame/drivers/by6803.cpp --- mame-0.242+dfsg.1/src/mame/drivers/by6803.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/by6803.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -134,8 +134,8 @@ u8 m_pia0_b = 0U; u8 m_pia1_a = 0U; u8 m_pia1_b = 0U; - bool m_pia0_cb2 = 0; - bool m_pia0_timer = 0; + bool m_pia0_cb2 = false; + bool m_pia0_timer = false; u8 m_port1 = 0U, m_port2 = 0U; u8 m_digit = 0U; u8 m_segment[5]{}; @@ -876,34 +876,34 @@ // 1st gen -GAME( 1985, eballchp, 0, gen1, by6803, by6803_state, empty_init, ROT0, "Bally", "Eight Ball Champ", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1985, beatclck, 0, gen1, by6803, by6803_state, empty_init, ROT0, "Bally", "Beat the Clock", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1985, beatclck2, beatclck, gen1, by6803, by6803_state, empty_init, ROT0, "Bally", "Beat the Clock (with flasher support)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1986, ladyluck, 0, gen1, by6803, by6803_state, empty_init, ROT0, "Bally", "Lady Luck", MACHINE_IS_SKELETON_MECHANICAL ) +GAME( 1985, eballchp, 0, gen1, by6803, by6803_state, empty_init, ROT0, "Bally", "Eight Ball Champ", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1985, beatclck, 0, gen1, by6803, by6803_state, empty_init, ROT0, "Bally", "Beat the Clock", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1985, beatclck2, beatclck, gen1, by6803, by6803_state, empty_init, ROT0, "Bally", "Beat the Clock (with flasher support)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1986, ladyluck, 0, gen1, by6803, by6803_state, empty_init, ROT0, "Bally", "Lady Luck", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // 2nd gen -GAME( 1986, motrdome, 0, by6803, by6803, by6803_state, empty_init, ROT0, "Bally", "MotorDome (rev. D)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1986, motrdomeb, motrdome, by6803, by6803, by6803_state, empty_init, ROT0, "Bally", "MotorDome (rev. B)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1986, motrdomeg, motrdome, by6803, by6803, by6803_state, empty_init, ROT0, "Bally", "MotorDome (German rev. B)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1986, strngsci, 0, by6803, by6803, by6803_state, empty_init, ROT0, "Bally", "Strange Science (Rev C)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1986, strngscia, strngsci, by6803, by6803, by6803_state, empty_init, ROT0, "Bally", "Strange Science (Rev A)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1986, strngscig, strngsci, by6803, by6803, by6803_state, empty_init, ROT0, "Bally", "Strange Science (German, Rev A)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1986, specforc, 0, by6803, by6803, by6803_state, empty_init, ROT0, "Bally", "Special Force", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1986, blackblt, 0, by6803, by6803, by6803_state, empty_init, ROT0, "Bally", "Black Belt", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1986, blackblt2, blackblt, by6803, by6803, by6803_state, empty_init, ROT0, "Bally", "Black Belt (Squawk and Talk)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1987, cityslck, 0, by6803, by6803, by6803_state, empty_init, ROT0, "Bally", "City Slicker", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1987, hardbody, 0, by6803, by6803, by6803_state, empty_init, ROT0, "Bally", "Hardbody (rev. D)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1987, hardbodyc, hardbody, by6803, by6803, by6803_state, empty_init, ROT0, "Bally", "Hardbody (rev. C)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1987, hardbodyg, hardbody, by6803, by6803, by6803_state, empty_init, ROT0, "Bally", "Hardbody (German rev. B)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1987, prtyanim, 0, by6803, by6803, by6803_state, empty_init, ROT0, "Bally", "Party Animal", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1987, prtyanimg, prtyanim, by6803, by6803, by6803_state, empty_init, ROT0, "Bally", "Party Animal (German)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1987, hvymetap, 0, by6803, by6803, by6803_state, empty_init, ROT0, "Bally", "Heavy Metal Meltdown", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1987, hvymetapg, hvymetap, by6803, by6803, by6803_state, empty_init, ROT0, "Bally", "Heavy Metal Meltdown (German)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1987, esclwrld, 0, by6803, by6803, by6803_state, empty_init, ROT0, "Bally", "Escape from the Lost World", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1987, esclwrldg, esclwrld, by6803, by6803, by6803_state, empty_init, ROT0, "Bally", "Escape from the Lost World (German)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1987, dungdrag, 0, by6803, by6803, by6803_state, empty_init, ROT0, "Bally", "Dungeons & Dragons", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1988, black100, 0, by6803, by6803, by6803_state, empty_init, ROT0, "Bally", "Blackwater 100", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1988, black100s, black100, by6803, by6803, by6803_state, empty_init, ROT0, "Bally", "Blackwater 100 (Single Ball Play)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1988, trucksp3, 0, s11, by6803, by6803_state, empty_init, ROT0, "Bally", "Truck Stop (P-3)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1988, trucksp2, trucksp3, s11, by6803, by6803_state, empty_init, ROT0, "Bally", "Truck Stop (P-2)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1989, atlantip, 0, s11, by6803, by6803_state, empty_init, ROT0, "Bally", "Atlantis (rev. 3)", MACHINE_IS_SKELETON_MECHANICAL ) +GAME( 1986, motrdome, 0, by6803, by6803, by6803_state, empty_init, ROT0, "Bally", "MotorDome (rev. D)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1986, motrdomeb, motrdome, by6803, by6803, by6803_state, empty_init, ROT0, "Bally", "MotorDome (rev. B)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1986, motrdomeg, motrdome, by6803, by6803, by6803_state, empty_init, ROT0, "Bally", "MotorDome (German rev. B)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1986, strngsci, 0, by6803, by6803, by6803_state, empty_init, ROT0, "Bally", "Strange Science (Rev C)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1986, strngscia, strngsci, by6803, by6803, by6803_state, empty_init, ROT0, "Bally", "Strange Science (Rev A)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1986, strngscig, strngsci, by6803, by6803, by6803_state, empty_init, ROT0, "Bally", "Strange Science (German, Rev A)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1986, specforc, 0, by6803, by6803, by6803_state, empty_init, ROT0, "Bally", "Special Force", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1986, blackblt, 0, by6803, by6803, by6803_state, empty_init, ROT0, "Bally", "Black Belt", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1986, blackblt2, blackblt, by6803, by6803, by6803_state, empty_init, ROT0, "Bally", "Black Belt (Squawk and Talk)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1987, cityslck, 0, by6803, by6803, by6803_state, empty_init, ROT0, "Bally", "City Slicker", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1987, hardbody, 0, by6803, by6803, by6803_state, empty_init, ROT0, "Bally", "Hardbody (rev. D)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1987, hardbodyc, hardbody, by6803, by6803, by6803_state, empty_init, ROT0, "Bally", "Hardbody (rev. C)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1987, hardbodyg, hardbody, by6803, by6803, by6803_state, empty_init, ROT0, "Bally", "Hardbody (German rev. B)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1987, prtyanim, 0, by6803, by6803, by6803_state, empty_init, ROT0, "Bally", "Party Animal", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1987, prtyanimg, prtyanim, by6803, by6803, by6803_state, empty_init, ROT0, "Bally", "Party Animal (German)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1987, hvymetap, 0, by6803, by6803, by6803_state, empty_init, ROT0, "Bally", "Heavy Metal Meltdown", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1987, hvymetapg, hvymetap, by6803, by6803, by6803_state, empty_init, ROT0, "Bally", "Heavy Metal Meltdown (German)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1987, esclwrld, 0, by6803, by6803, by6803_state, empty_init, ROT0, "Bally", "Escape from the Lost World", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1987, esclwrldg, esclwrld, by6803, by6803, by6803_state, empty_init, ROT0, "Bally", "Escape from the Lost World (German)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1987, dungdrag, 0, by6803, by6803, by6803_state, empty_init, ROT0, "Bally", "Dungeons & Dragons", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1988, black100, 0, by6803, by6803, by6803_state, empty_init, ROT0, "Bally", "Blackwater 100", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1988, black100s, black100, by6803, by6803, by6803_state, empty_init, ROT0, "Bally", "Blackwater 100 (Single Ball Play)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1988, trucksp3, 0, s11, by6803, by6803_state, empty_init, ROT0, "Bally", "Truck Stop (P-3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1988, trucksp2, trucksp3, s11, by6803, by6803_state, empty_init, ROT0, "Bally", "Truck Stop (P-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1989, atlantip, 0, s11, by6803, by6803_state, empty_init, ROT0, "Bally", "Atlantis (rev. 3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/by68701.cpp mame-0.243+dfsg.1/src/mame/drivers/by68701.cpp --- mame-0.242+dfsg.1/src/mame/drivers/by68701.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/by68701.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -146,9 +146,9 @@ ROM_END -GAME( 1981, flashgdnp1, flashgdn, by68701, by68701, by68701_state, init_by68701, ROT0, "Bally", "Flash Gordon (prototype rev. 1)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1981, flashgdnp2, flashgdn, by68701, by68701, by68701_state, init_by68701, ROT0, "Bally", "Flash Gordon (prototype rev. 2)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1981, eballdlxp1, eballdlx, by68701, by68701, by68701_state, init_by68701, ROT0, "Bally", "Eight Ball Deluxe (prototype rev. 1)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1981, eballdlxp2, eballdlx, by68701, by68701, by68701_state, init_by68701, ROT0, "Bally", "Eight Ball Deluxe (prototype rev. 2)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1981, eballdlxp3, eballdlx, by68701, by68701, by68701_state, init_by68701, ROT0, "Bally", "Eight Ball Deluxe (prototype rev. 3)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1981, eballdlxp4, eballdlx, by68701, by68701, by68701_state, init_by68701, ROT0, "Bally", "Eight Ball Deluxe (prototype rev. 4)", MACHINE_IS_SKELETON_MECHANICAL) +GAME( 1981, flashgdnp1, flashgdn, by68701, by68701, by68701_state, init_by68701, ROT0, "Bally", "Flash Gordon (prototype rev. 1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1981, flashgdnp2, flashgdn, by68701, by68701, by68701_state, init_by68701, ROT0, "Bally", "Flash Gordon (prototype rev. 2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1981, eballdlxp1, eballdlx, by68701, by68701, by68701_state, init_by68701, ROT0, "Bally", "Eight Ball Deluxe (prototype rev. 1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1981, eballdlxp2, eballdlx, by68701, by68701, by68701_state, init_by68701, ROT0, "Bally", "Eight Ball Deluxe (prototype rev. 2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1981, eballdlxp3, eballdlx, by68701, by68701, by68701_state, init_by68701, ROT0, "Bally", "Eight Ball Deluxe (prototype rev. 3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1981, eballdlxp4, eballdlx, by68701, by68701, by68701_state, init_by68701, ROT0, "Bally", "Eight Ball Deluxe (prototype rev. 4)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/byvid.cpp mame-0.243+dfsg.1/src/mame/drivers/byvid.cpp --- mame-0.242+dfsg.1/src/mame/drivers/byvid.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/byvid.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -110,12 +110,12 @@ u8 m_u7b = 0U; u8 m_u10a = 0U; u8 m_u10b = 0U; - bool m_u10_cb2 = 0; - bool m_u11_cb2 = 0; + bool m_u10_cb2 = false; + bool m_u11_cb2 = false; u8 m_u11a = 0U; u8 m_u11b = 0U; - bool m_u10_timer = 0; - bool m_u11_timer = 0; + bool m_u10_timer = false; + bool m_u11_timer = false; required_device m_maincpu; required_device m_videocpu; required_device m_cheap_squeak; @@ -915,6 +915,6 @@ } // Anonymous namespace -GAME( 1982, babypac, 0, by133, babypac, by133_state, empty_init, ROT90, "Dave Nutting Associates / Bally", "Baby Pac-Man (set 1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1982, babypac2, babypac, by133, babypac, by133_state, empty_init, ROT90, "Dave Nutting Associates / Bally", "Baby Pac-Man (set 2)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1984, granny, 0, granny, granny, by133_state, empty_init, ROT0, "Bally", "Granny and the Gators", MACHINE_IS_SKELETON_MECHANICAL ) +GAME( 1982, babypac, 0, by133, babypac, by133_state, empty_init, ROT90, "Dave Nutting Associates / Bally", "Baby Pac-Man (set 1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1982, babypac2, babypac, by133, babypac, by133_state, empty_init, ROT90, "Dave Nutting Associates / Bally", "Baby Pac-Man (set 2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1984, granny, 0, granny, granny, by133_state, empty_init, ROT0, "Bally", "Granny and the Gators", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/c80.cpp mame-0.243+dfsg.1/src/mame/drivers/c80.cpp --- mame-0.242+dfsg.1/src/mame/drivers/c80.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/c80.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -2,7 +2,7 @@ // copyright-holders:Curt Coder /*************************************************************************** -C-80 +C-80 Trainer (East Germany) Pasting: 0-F : as is @@ -50,15 +50,76 @@ When MEM is chosen, enter the address, press UP, enter data, press UP, enter data of next byte, and so on. +Cassette SAVE: Press F1 1 aaaa DOWN bbbb UP +Cassette LOAD: Press F1 2 aaaa DOWN bbbb UP +(where aaaa = 4-digit beginning address, bbbb = 4-digit ending address) + ****************************************************************************/ #include "emu.h" -#include "includes/c80.h" - +#include "cpu/z80/z80.h" +#include "machine/z80daisy.h" +#include "machine/z80pio.h" +#include "imagedev/cassette.h" #include "speaker.h" - #include "c80.lh" +namespace { + +#define Z80_TAG "d2" +#define Z80PIO1_TAG "d11" +#define Z80PIO2_TAG "d12" +// You could use a piezo at 455 kHz, or a crystal 500 to 2500 kHz. +// Cassette successfully tested at 455 kHz +#define MASTER_CLOCK 455000 + +class c80_state : public driver_device +{ +public: + c80_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, Z80_TAG) + , m_pio1(*this, Z80PIO1_TAG) + , m_pio2(*this, Z80PIO2_TAG) + , m_cassette(*this, "cassette") + , m_row0(*this, "ROW0") + , m_row1(*this, "ROW1") + , m_row2(*this, "ROW2") + , m_digits(*this, "digit%d", 0U) + { } + + DECLARE_INPUT_CHANGED_MEMBER( trigger_reset ); + DECLARE_INPUT_CHANGED_MEMBER( trigger_nmi ); + void c80(machine_config &config); + +private: + required_device m_maincpu; + required_device m_pio1; + required_device m_pio2; + required_device m_cassette; + required_ioport m_row0; + required_ioport m_row1; + required_ioport m_row2; + output_finder<8> m_digits; + + virtual void machine_start() override; + + uint8_t pio1_pa_r(); + void pio1_pa_w(uint8_t data); + void pio1_pb_w(uint8_t data); + DECLARE_WRITE_LINE_MEMBER( pio1_brdy_w ); + + /* keyboard state */ + u8 m_keylatch = 0; + + /* display state */ + u8 m_digit = 0; + bool m_pio1_a5 = false; + u8 m_pio1_brdy = 0; + void c80_io(address_map &map); + void c80_mem(address_map &map); +}; + /* Memory Maps */ @@ -72,7 +133,8 @@ void c80_state::c80_io(address_map &map) { map.global_mask(0xff); - map(0x7c, 0x7f).rw(Z80PIO2_TAG, FUNC(z80pio_device::read), FUNC(z80pio_device::write)); + map.unmap_value_high(); + map(0x7c, 0x7f).rw(m_pio2, FUNC(z80pio_device::read), FUNC(z80pio_device::write)); map(0xbc, 0xbf).rw(m_pio1, FUNC(z80pio_device::read), FUNC(z80pio_device::write)); } @@ -143,11 +205,9 @@ */ - uint8_t data = !m_pio1_brdy << 4 | 0x07; - - int i; + uint8_t data = m_pio1_brdy | 0x07; - for (i = 0; i < 8; i++) + for (u8 i = 0; i < 8; i++) { if (!BIT(m_keylatch, i)) { @@ -206,7 +266,7 @@ */ - if (!m_pio1_a5) + if (!m_pio1_a5 && (m_digit < 8)) { m_digits[m_digit] = data; } @@ -216,7 +276,7 @@ WRITE_LINE_MEMBER( c80_state::pio1_brdy_w ) { - m_pio1_brdy = state; + m_pio1_brdy = state ? 0 : 0x10; if (state) { @@ -255,45 +315,41 @@ void c80_state::c80(machine_config &config) { - /* basic machine hardware */ - Z80(config, m_maincpu, 2500000); /* U880D */ + // CPU + Z80(config, m_maincpu, MASTER_CLOCK); // U880D m_maincpu->set_addrmap(AS_PROGRAM, &c80_state::c80_mem); m_maincpu->set_addrmap(AS_IO, &c80_state::c80_io); m_maincpu->set_daisy_config(c80_daisy_chain); - /* video hardware */ + // video config.set_default_layout(layout_c80); - /* devices */ - Z80PIO(config, m_pio1, 2500000); + // devices + Z80PIO(config, m_pio1, MASTER_CLOCK); // U855D m_pio1->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0); m_pio1->in_pa_callback().set(FUNC(c80_state::pio1_pa_r)); m_pio1->out_pa_callback().set(FUNC(c80_state::pio1_pa_w)); m_pio1->out_pb_callback().set(FUNC(c80_state::pio1_pb_w)); m_pio1->out_brdy_callback().set(FUNC(c80_state::pio1_brdy_w)); - z80pio_device& pio2(Z80PIO(config, Z80PIO2_TAG, XTAL(2500000))); - pio2.out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0); + Z80PIO(config, m_pio2, MASTER_CLOCK); // U855D + m_pio2->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0); + // cassette SPEAKER(config, "mono").front_center(); - CASSETTE(config, m_cassette); m_cassette->set_default_state(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED); m_cassette->add_route(ALL_OUTPUTS, "mono", 0.05); - - /* internal ram */ - RAM(config, RAM_TAG).set_default_size("1K"); } /* ROMs */ ROM_START( c80 ) - ROM_REGION( 0x10000, Z80_TAG, 0 ) + ROM_REGION( 0x0800, Z80_TAG, ROMREGION_ERASEFF ) ROM_LOAD( "c80.d3", 0x0000, 0x0400, CRC(ad2b3296) SHA1(14f72cb73a4068b7a5d763cc0e254639c251ce2e) ) ROM_END - -/* System Drivers */ +} // Anonymous namespace /* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ COMP( 1986, c80, 0, 0, c80, c80, c80_state, empty_init, "Joachim Czepa", "C-80", MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/calomega.cpp mame-0.243+dfsg.1/src/mame/drivers/calomega.cpp --- mame-0.242+dfsg.1/src/mame/drivers/calomega.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/calomega.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -161,7 +161,7 @@ 16.6 | Nudge Bingo | ? | | NBCG | 6300040 | BCOLOR | 6600040 | Amusement | No | | No 16.7 | Poker | ? | | PCG | 6300010 | POKCLR | 6600020 | Amusement | No | | No 16.8 | Keno | 903 | MAR/83 | KCG | 6300060 | POKCLR | 6600020 | Amusement | Yes | OK | Yes - 17.0 | Poker | 905 | | POKERCGs | 6300010 | PKRCLR | 6600020 | Amusement | No | | No + 17.0 | Poker | 905 | | POKERCGs | 6300010 | PKRCLR | 6600020 | Amusement | Yes | | Yes 17.1 | Nudge Bingo | ? | | NBCG | 6300040 | BCOLOR | 6600040 | Amusement | No | | No 17.2 | Double/Double Poker | 905 | MAY/83 | JKRPKR | 6300100 | WLDCLR | 6600010 | Amusement | Yes | OK | Yes 17.3 | Casino Poker | ? | | PKCG | 6300010 | POKCLR | 6600020 | Nevada Gaming | No | | No @@ -3198,6 +3198,87 @@ INPUT_PORTS_END +static INPUT_PORTS_START( comg170 ) + PORT_START("IN0-0") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_POKER_HOLD1 ) PORT_NAME("Discard 1") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_POKER_HOLD2 ) PORT_NAME("Discard 2") + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_POKER_HOLD3 ) PORT_NAME("Discard 3") + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_POKER_HOLD4 ) PORT_NAME("Discard 4") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_POKER_HOLD5 ) PORT_NAME("Discard 5") + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("IN0-1") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) PORT_NAME("Play (Bet)") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_DEAL ) PORT_NAME("Deal / Draw") + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Learn") PORT_CODE(KEYCODE_8) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Clr Data") PORT_CODE(KEYCODE_0) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Audit") PORT_CODE(KEYCODE_9) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Test") + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("IN0-2") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_POKER_CANCEL ) PORT_NAME("Cancel") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_STAND ) PORT_NAME("Stand") + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_NAME("Coin-In A") PORT_IMPULSE(2) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_NAME("Coin-In B") PORT_IMPULSE(2) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("IN0-3") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Tilt") PORT_CODE(KEYCODE_T) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_TAKE ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_D_UP ) PORT_NAME("Double") + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_HIGH ) PORT_NAME("Big") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_LOW ) PORT_NAME("Small") + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) + + // For System 905, SW1 uses the whole PIA1 portA. + + PORT_START("SW1") // settings (PIA1) + PORT_DIPNAME( 0x07, 0x07, "Max Bet" ) PORT_DIPLOCATION("SW1:1,2,3") + PORT_DIPSETTING( 0x00, "01" ) + PORT_DIPSETTING( 0x01, "02" ) + PORT_DIPSETTING( 0x02, "03" ) + PORT_DIPSETTING( 0x03, "04" ) + PORT_DIPSETTING( 0x04, "05" ) + PORT_DIPSETTING( 0x05, "10" ) + PORT_DIPSETTING( 0x06, "20" ) + PORT_DIPSETTING( 0x07, "50" ) + PORT_DIPNAME( 0x08, 0x08, "Attract" ) PORT_DIPLOCATION("SW1:4") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x08, DEF_STR( On ) ) + PORT_DIPNAME( 0x30, 0x30, "Lower Pair to Win" ) PORT_DIPLOCATION("SW1:5,6") + PORT_DIPSETTING( 0x00, "Jacks" ) + PORT_DIPSETTING( 0x20, "Queens" ) + PORT_DIPSETTING( 0x30, "Kings" ) + PORT_DIPSETTING( 0x10, "Aces" ) + PORT_DIPNAME( 0xc0, 0xc0, "Coin Lockout" ) PORT_DIPLOCATION("SW1:7,8") + PORT_DIPSETTING( 0xc0, "No Lockout" ) + PORT_DIPSETTING( 0x40, "No Lockout" ) + PORT_DIPSETTING( 0x80, "1-Coin Lockout" ) + PORT_DIPSETTING( 0x00, "2-Coin Lockout" ) + +// RGB analogic pots (defaults are in %) + + PORT_START("POT1_RED") + PORT_ADJUSTER( 0, "RED Preset" ) + + PORT_START("POT2_GREEN") + PORT_ADJUSTER( 0, "GREEN Preset" ) + + PORT_START("POT3_BLUE") + PORT_ADJUSTER( 75, "BLUE Preset" ) + +INPUT_PORTS_END + + static INPUT_PORTS_START( comg172 ) PORT_START("IN0-0") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_POKER_HOLD1 ) PORT_NAME("Discard 1") @@ -5108,6 +5189,40 @@ ROM_LOAD( "903kstec.0", 0x0000, 0x0800, CRC(c1636ab5) SHA1(5a3ad24918751ca6a6640807e421e80f6b4cc844) ) ROM_END +/* + Cal Omega v17.0 (Amusement Poker) + + Discard poker game with attract. + The game is only for amusement. It doesn't give back money. + + To clean the credits, enter the audit mode and press the service button. + In audit mode, pressing the BET button a column of extra red values appear. + To exit the audit mode, just press DEAL. + + Test Mode: Press F2. + To exit pres DISCARD buttons 1, 2 & 3 simultaneously. + +*/ +ROM_START( comg170 ) // Cal Omega v17.0 (Amusement Poker) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_FILL( 0x3000, 0x1000, 0xff ) // empty socket + ROM_FILL( 0x4000, 0x1000, 0xff ) // empty socket + ROM_LOAD( "17-03.u7", 0x5000, 0x1000, CRC(56ca24db) SHA1(27793d48060b6d1ee080da27d19737a724395f35) ) + ROM_LOAD( "17-04.u8", 0x6000, 0x1000, CRC(9fcc5761) SHA1(9b1fb265219517c89af8d3700b04d9487b1db45e) ) + ROM_LOAD( "17-05.u9", 0x7000, 0x1000, CRC(cfdbd4b9) SHA1(7f7d5b0d86d009c2e1af54338d9ead24c97eb3e7) ) + + ROM_REGION( 0x0800, "gfx1", 0 ) + ROM_LOAD( "pkcg0.u67", 0x0000, 0x0800, CRC(b626ad89) SHA1(551b75f4559d11a4f8f56e38982114a21c77d4e7) ) + + ROM_REGION( 0x1800, "gfx2", 0 ) + ROM_LOAD( "pkcgc.u70", 0x0000, 0x0800, CRC(f2f94661) SHA1(f37f7c0dff680fd02897dae64e13e297d0fdb3e7) ) + ROM_LOAD( "pkcgb.u69", 0x0800, 0x0800, CRC(6bbb1e2d) SHA1(51ee282219bf84218886ad11a24bc6a8e7337527) ) + ROM_LOAD( "pkcga.u68", 0x1000, 0x0800, CRC(6e3e9b1d) SHA1(14eb8d14ce16719a6ad7d13db01e47c8f05955f0) ) + + ROM_REGION( 0x100, "proms", 0 ) + ROM_LOAD( "pokclr.u28", 0x0000, 0x0100, CRC(a8191ef7) SHA1(d6f777980179ab091e2713ee815d46bf9c0ac486) ) +ROM_END + ROM_START( comg172 ) // Cal Omega v17.2 (Double Double Poker) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_FILL( 0x3000, 0x1000, 0xff ) // empty socket @@ -6034,6 +6149,7 @@ GAME( 1983, comg159, 0, sys905, comg159, calomega_state, empty_init, ROT0, "Cal Omega Inc.", "Cal Omega - Game 15.9 (Wild Double-Up)", MACHINE_SUPPORTS_SAVE ) GAMEL( 1983, comg164, 0, sys903kb, keno_903, calomega_state, empty_init, ROT0, "Cal Omega Inc.", "Cal Omega - Game 16.4 (Keno)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE, layout_kenokb ) // incomplete dump GAMEL( 1983, comg168, 0, sys903kb, keno_903, calomega_state, empty_init, ROT0, "Cal Omega Inc.", "Cal Omega - Game 16.8 (Keno)", MACHINE_SUPPORTS_SAVE, layout_kenokb ) +GAME( 1983, comg170, 0, sys905, comg170, calomega_state, empty_init, ROT0, "Cal Omega Inc.", "Cal Omega - Game 17.0 (Amusement Poker)", MACHINE_SUPPORTS_SAVE ) GAME( 1983, comg172, 0, sys905, comg172, calomega_state, empty_init, ROT0, "Cal Omega Inc.", "Cal Omega - Game 17.2 (Double Double Poker)", MACHINE_SUPPORTS_SAVE ) GAME( 1984, comg175, 0, sys903, gdrwpkrd, calomega_state, empty_init, ROT0, "Cal Omega / Casino Electronics Inc.", "Cal Omega - Game 17.51 (Gaming Draw Poker)", MACHINE_SUPPORTS_SAVE ) GAME( 1982, comg176, 0, sys903, nudgensw, calomega_state, init_comg176, ROT0, "Cal Omega Inc.", "Cal Omega - Game 17.6 (Nudge)", MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/carpolo.cpp mame-0.243+dfsg.1/src/mame/drivers/carpolo.cpp --- mame-0.242+dfsg.1/src/mame/drivers/carpolo.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/carpolo.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -208,21 +208,10 @@ 0 }; -static const gfx_layout alphalayout = -{ - 8,8, - RGN_FRAC(1,1), - 1, - { 0 }, - { STEP8(0,1) }, - { STEP8(0,8) }, - 8*8 -}; - static GFXDECODE_START( gfx_carpolo ) GFXDECODE_ENTRY( "gfx1", 0, spritelayout, 0, 12 ) GFXDECODE_ENTRY( "gfx2", 0, goallayout, 12*2, 2 ) - GFXDECODE_ENTRY( "gfx3", 0, alphalayout, 12*2+2*16, 4 ) + GFXDECODE_ENTRY( "gfx3", 0, gfx_8x8x1, 12*2+2*16, 4 ) GFXDECODE_END /************************************* diff -Nru mame-0.242+dfsg.1/src/mame/drivers/cbasebal.cpp mame-0.243+dfsg.1/src/mame/drivers/cbasebal.cpp --- mame-0.242+dfsg.1/src/mame/drivers/cbasebal.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/cbasebal.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -15,71 +15,267 @@ ***************************************************************************/ #include "emu.h" -#include "includes/cbasebal.h" #include "cpu/z80/z80.h" #include "machine/kabuki.h" // needed for decoding functions only #include "machine/eepromser.h" #include "sound/okim6295.h" #include "sound/ymopl.h" + +#include "emupal.h" #include "screen.h" #include "speaker.h" +#include "tilemap.h" -/************************************* - * - * Memory handlers - * - *************************************/ +namespace { -void cbasebal_state::cbasebal_bankswitch_w(uint8_t data) +class cbasebal_state : public driver_device { - /* bits 0-4 select ROM bank */ - //logerror("%04x: bankswitch %02x\n", m_maincpu->pc(), data); - membank("bank1")->set_entry(data & 0x1f); - membank("bank1d")->set_entry(data & 0x1f); +public: + cbasebal_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_spriteram(*this, "spriteram"), + m_textram(*this, "textram"), + m_scrollram(*this, "scrollram"), + m_databank(*this, "databank"), + m_opbank(*this, "opbank"), + m_bankedram(*this, "bankedram") { } + + void init_cbasebal(); + void cbasebal(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; + +private: + // devices + required_device m_maincpu; + required_device m_gfxdecode; + required_device m_palette; + + // memory pointers + required_shared_ptr m_spriteram; + required_shared_ptr m_textram; + required_shared_ptr m_scrollram; + required_memory_bank m_databank; + required_memory_bank m_opbank; + memory_view m_bankedram; + + // video-related + tilemap_t *m_fg_tilemap = nullptr; + tilemap_t *m_bg_tilemap = nullptr; + std::unique_ptr m_decoded; + uint8_t m_scroll_x[2]{}; + uint8_t m_scroll_y[2]{}; + uint8_t m_tilebank = 0; + uint8_t m_spritebank = 0; + uint8_t m_text_on = 0; + uint8_t m_bg_on = 0; + uint8_t m_obj_on = 0; + uint8_t m_flipscreen = 0; + + void bankswitch_w(uint8_t data); + void coinctrl_w(uint8_t data); + void textram_w(offs_t offset, uint8_t data); + void scrollram_w(offs_t offset, uint8_t data); + void gfxctrl_w(uint8_t data); + void scrollx_w(offs_t offset, uint8_t data); + void scrolly_w(offs_t offset, uint8_t data); + + TILE_GET_INFO_MEMBER(get_bg_tile_info); + TILE_GET_INFO_MEMBER(get_fg_tile_info); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); + + void prg_map(address_map &map); + void port_map(address_map &map); + void decrypted_opcodes_map(address_map &map); +}; + + +// video + +/*************************************************************************** + + Callbacks for the TileMap code + +***************************************************************************/ + +TILE_GET_INFO_MEMBER(cbasebal_state::get_bg_tile_info) +{ + uint8_t attr = m_scrollram[2 * tile_index + 1]; + tileinfo.set(1, + m_scrollram[2 * tile_index] + ((attr & 0x07) << 8) + 0x800 * m_tilebank, + (attr & 0xf0) >> 4, + (attr & 0x08) ? TILE_FLIPX : 0); +} + +TILE_GET_INFO_MEMBER(cbasebal_state::get_fg_tile_info) +{ + uint8_t attr = m_textram[tile_index + 0x800]; + tileinfo.set(0, + m_textram[tile_index] + ((attr & 0xf0) << 4), + attr & 0x07, + (attr & 0x08) ? TILE_FLIPX : 0); +} + + + +/*************************************************************************** + + Start the video hardware emulation. - /* bit 5 used but unknown */ +***************************************************************************/ + +void cbasebal_state::video_start() +{ + m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(cbasebal_state::get_bg_tile_info)), TILEMAP_SCAN_ROWS, 16, 16, 64, 32); + m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(cbasebal_state::get_fg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); - /* bits 6-7 select RAM bank */ - m_rambank = (data & 0xc0) >> 6; + m_fg_tilemap->set_transparent_pen(3); } -uint8_t cbasebal_state::bankedram_r(offs_t offset) + +/*************************************************************************** + + Memory handlers + +***************************************************************************/ + +void cbasebal_state::textram_w(offs_t offset, uint8_t data) +{ + m_textram[offset] = data; + m_fg_tilemap->mark_tile_dirty(offset & 0x7ff); +} + +void cbasebal_state::scrollram_w(offs_t offset, uint8_t data) +{ + m_scrollram[offset] = data; + m_bg_tilemap->mark_tile_dirty(offset / 2); +} + +void cbasebal_state::gfxctrl_w(uint8_t data) { - switch (m_rambank) + // bit 0 is unknown - toggles continuously + + // bit 1 is flip screen + m_flipscreen = data & 0x02; + machine().tilemap().set_flip_all(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); + + // bit 2 is unknown - unused? + + // bit 3 is tile bank + if (m_tilebank != ((data & 0x08) >> 3)) { - case 2: - return cbasebal_textram_r(offset); /* VRAM */ - case 1: - if (offset < 0x800) - return m_palette->basemem().read8(offset); - else - return 0; - default: - return cbasebal_scrollram_r(offset); /* SCROLL */ + m_tilebank = (data & 0x08) >> 3; + m_bg_tilemap->mark_all_dirty(); } + + // bit 4 is sprite bank + m_spritebank = (data & 0x10) >> 4; + + // bits 5 is text enable + m_text_on = ~data & 0x20; + + // bits 6-7 are bg/sprite enable (don't know which is which) + m_bg_on = ~data & 0x40; + m_obj_on = ~data & 0x80; } -void cbasebal_state::bankedram_w(offs_t offset, uint8_t data) +void cbasebal_state::scrollx_w(offs_t offset, uint8_t data) { - switch (m_rambank) + m_scroll_x[offset] = data; + m_bg_tilemap->set_scrollx(0, m_scroll_x[0] + 256 * m_scroll_x[1]); +} + +void cbasebal_state::scrolly_w(offs_t offset, uint8_t data) +{ + m_scroll_y[offset] = data; + m_bg_tilemap->set_scrolly(0, m_scroll_y[0] + 256 * m_scroll_y[1]); +} + + + +/*************************************************************************** + + Display refresh + +***************************************************************************/ + +void cbasebal_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + // the last entry is not a sprite, we skip it otherwise spang (mitchell.cpp) shows a bubble moving diagonally across the screen + for (int offs = m_spriteram.bytes() - 8; offs >= 0; offs -= 4) { - case 2: - cbasebal_textram_w(offset, data); - break; - case 1: - if (offset < 0x800) - m_palette->write8(offset, data); - break; - default: - cbasebal_scrollram_w(offset, data); - break; + int code = m_spriteram[offs]; + int attr = m_spriteram[offs + 1]; + int color = attr & 0x07; + int flipx = attr & 0x08; + int sx = m_spriteram[offs + 3] + ((attr & 0x10) << 4); + int sy = ((m_spriteram[offs + 2] + 8) & 0xff) - 8; + code += (attr & 0xe0) << 3; + code += m_spritebank * 0x800; + + if (m_flipscreen) + { + sx = 496 - sx; + sy = 240 - sy; + flipx = !flipx; + } + + m_gfxdecode->gfx(2)->transpen(bitmap, cliprect, + code, + color, + flipx, m_flipscreen, + sx, sy, 15); } } -void cbasebal_state::cbasebal_coinctrl_w(uint8_t data) +uint32_t cbasebal_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + if (m_bg_on) + m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); + else + bitmap.fill(768, cliprect); + + if (m_obj_on) + draw_sprites(bitmap, cliprect); + + if (m_text_on) + m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); + return 0; +} + + +// machine + +/************************************* + * + * Memory handlers + * + *************************************/ + +void cbasebal_state::bankswitch_w(uint8_t data) +{ + // bits 0-4 select ROM bank + //logerror("%04x: bankswitch %02x\n", m_maincpu->pc(), data); + m_databank->set_entry(data & 0x1f); + m_opbank->set_entry(data & 0x1f); + + // bit 5 used but unknown + + // bits 6-7 select RAM bank + m_bankedram.select((data & 0xc0) >> 6); +} + +void cbasebal_state::coinctrl_w(uint8_t data) { machine().bookkeeping().coin_lockout_w(0, ~data & 0x04); machine().bookkeeping().coin_lockout_w(1, ~data & 0x08); @@ -94,37 +290,41 @@ * *************************************/ -void cbasebal_state::cbasebal_map(address_map &map) +void cbasebal_state::prg_map(address_map &map) { map(0x0000, 0x7fff).rom(); - map(0x8000, 0xbfff).bankr("bank1"); - map(0xc000, 0xcfff).rw(FUNC(cbasebal_state::bankedram_r), FUNC(cbasebal_state::bankedram_w)).share("palette"); /* palette + vram + scrollram */ - map(0xe000, 0xfdff).ram(); /* work RAM */ - map(0xfe00, 0xffff).ram().share("spriteram"); + map(0x8000, 0xbfff).bankr(m_databank); + map(0xc000, 0xcfff).view(m_bankedram); // palette + VRAM + scrollram + m_bankedram[0](0xc000, 0xcfff).ram().w(FUNC(cbasebal_state::scrollram_w)).share(m_scrollram); + m_bankedram[1](0xc000, 0xc7ff).ram().w(m_palette, FUNC(palette_device::write8)).share("palette"); + m_bankedram[2](0xc000, 0xcfff).ram().w(FUNC(cbasebal_state::textram_w)).share(m_textram); + m_bankedram[3](0xc000, 0xcfff).ram().w(FUNC(cbasebal_state::scrollram_w)).share(m_scrollram); + map(0xe000, 0xfdff).ram(); // work RAM + map(0xfe00, 0xffff).ram().share(m_spriteram); } void cbasebal_state::decrypted_opcodes_map(address_map &map) { - map(0x0000, 0x7fff).bankr("bank0d"); - map(0x8000, 0xbfff).bankr("bank1d"); + map(0x0000, 0x7fff).bankr("opbase"); + map(0x8000, 0xbfff).bankr(m_opbank); } -void cbasebal_state::cbasebal_portmap(address_map &map) +void cbasebal_state::port_map(address_map &map) { map.global_mask(0xff); - map(0x00, 0x00).w(FUNC(cbasebal_state::cbasebal_bankswitch_w)); + map(0x00, 0x00).w(FUNC(cbasebal_state::bankswitch_w)); map(0x01, 0x01).portw("IO_01"); map(0x02, 0x02).portw("IO_02"); map(0x03, 0x03).portw("IO_03"); map(0x05, 0x05).w("oki", FUNC(okim6295_device::write)); map(0x06, 0x07).w("ymsnd", FUNC(ym2413_device::write)); - map(0x08, 0x09).w(FUNC(cbasebal_state::cbasebal_scrollx_w)); - map(0x0a, 0x0b).w(FUNC(cbasebal_state::cbasebal_scrolly_w)); + map(0x08, 0x09).w(FUNC(cbasebal_state::scrollx_w)); + map(0x0a, 0x0b).w(FUNC(cbasebal_state::scrolly_w)); map(0x10, 0x10).portr("P1"); map(0x11, 0x11).portr("P2"); map(0x12, 0x12).portr("SYSTEM"); - map(0x13, 0x13).w(FUNC(cbasebal_state::cbasebal_gfxctrl_w)); - map(0x14, 0x14).w(FUNC(cbasebal_state::cbasebal_coinctrl_w)); + map(0x13, 0x13).w(FUNC(cbasebal_state::gfxctrl_w)); + map(0x14, 0x14).w(FUNC(cbasebal_state::coinctrl_w)); } @@ -162,7 +362,7 @@ PORT_SERVICE( 0x08, IP_ACTIVE_LOW ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") /* ? */ + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") // ? PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, do_read) PORT_START( "IO_01" ) @@ -185,45 +385,45 @@ static const gfx_layout cbasebal_textlayout = { - 8,8, /* 8*8 characters */ - 4096, /* 4096 characters */ - 2, /* 2 bits per pixel */ + 8,8, // 8*8 characters + 4096, // 4096 characters + 2, // 2 bits per pixel { 0, 4 }, { 8+3, 8+2, 8+1, 8+0, 3, 2, 1, 0 }, { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16 }, - 16*8 /* every char takes 16 consecutive bytes */ + 16*8 // every char takes 16 consecutive bytes }; static const gfx_layout cbasebal_tilelayout = { - 16,16, /* 16*16 tiles */ - 4096, /* 4096 tiles */ - 4, /* 4 bits per pixel */ + 16,16, // 16*16 tiles + 4096, // 4096 tiles + 4, // 4 bits per pixel { 4096*64*8+4, 4096*64*8+0,4, 0 }, { 0, 1, 2, 3, 8+0, 8+1, 8+2, 8+3, 16*16+0, 16*16+1, 16*16+2, 16*16+3, 16*16+8+0, 16*16+8+1, 16*16+8+2, 16*16+8+3 }, { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16, 8*16, 9*16, 10*16, 11*16, 12*16, 13*16, 14*16, 15*16 }, - 64*8 /* every tile takes 64 consecutive bytes */ + 64*8 // every tile takes 64 consecutive bytes }; static const gfx_layout cbasebal_spritelayout = { - 16,16, /* 16*16 sprites */ - 4096, /* 2048 sprites */ - 4, /* 4 bits per pixel */ + 16,16, // 16*16 sprites + 4096, // 2048 sprites + 4, // 4 bits per pixel { 4096*64*8+4, 4096*64*8+0, 4, 0 }, { 0, 1, 2, 3, 8+0, 8+1, 8+2, 8+3, 32*8+0, 32*8+1, 32*8+2, 32*8+3, 33*8+0, 33*8+1, 33*8+2, 33*8+3 }, { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16, 8*16, 9*16, 10*16, 11*16, 12*16, 13*16, 14*16, 15*16 }, - 64*8 /* every sprite takes 64 consecutive bytes */ + 64*8 // every sprite takes 64 consecutive bytes }; static GFXDECODE_START( gfx_cbasebal ) - GFXDECODE_ENTRY( "gfx1", 0, cbasebal_textlayout, 256, 8 ) /* colors 256- 287 */ - GFXDECODE_ENTRY( "gfx2", 0, cbasebal_tilelayout, 768, 16 ) /* colors 768-1023 */ - GFXDECODE_ENTRY( "gfx3", 0, cbasebal_spritelayout, 512, 8 ) /* colors 512- 639 */ + GFXDECODE_ENTRY( "text", 0, cbasebal_textlayout, 256, 8 ) // colors 256 - 287 + GFXDECODE_ENTRY( "tiles", 0, cbasebal_tilelayout, 768, 16 ) // colors 768 - 1023 + GFXDECODE_ENTRY( "sprites", 0, cbasebal_spritelayout, 512, 8 ) // colors 512 - 639 GFXDECODE_END @@ -235,7 +435,6 @@ void cbasebal_state::machine_start() { - save_item(NAME(m_rambank)); save_item(NAME(m_tilebank)); save_item(NAME(m_spritebank)); save_item(NAME(m_text_on)); @@ -248,7 +447,6 @@ void cbasebal_state::machine_reset() { - m_rambank = 0; m_tilebank = 0; m_spritebank = 0; m_text_on = 0; @@ -263,30 +461,30 @@ void cbasebal_state::cbasebal(machine_config &config) { - /* basic machine hardware */ - Z80(config, m_maincpu, 6000000); /* ??? */ - m_maincpu->set_addrmap(AS_PROGRAM, &cbasebal_state::cbasebal_map); - m_maincpu->set_addrmap(AS_IO, &cbasebal_state::cbasebal_portmap); + // basic machine hardware + Z80(config, m_maincpu, 6000000); // ??? + m_maincpu->set_addrmap(AS_PROGRAM, &cbasebal_state::prg_map); + m_maincpu->set_addrmap(AS_IO, &cbasebal_state::port_map); m_maincpu->set_addrmap(AS_OPCODES, &cbasebal_state::decrypted_opcodes_map); - m_maincpu->set_vblank_int("screen", FUNC(cbasebal_state::irq0_line_hold)); /* ??? */ + m_maincpu->set_vblank_int("screen", FUNC(cbasebal_state::irq0_line_hold)); // ??? EEPROM_93C46_16BIT(config, "eeprom"); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); screen.set_refresh_hz(60); - screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500) /* not accurate */); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); // not accurate screen.set_size(64*8, 32*8); screen.set_visarea(8*8, (64-8)*8-1, 2*8, 30*8-1 ); - screen.set_screen_update(FUNC(cbasebal_state::screen_update_cbasebal)); + screen.set_screen_update(FUNC(cbasebal_state::screen_update)); screen.set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_cbasebal); PALETTE(config, m_palette).set_format(palette_device::xBRG_444, 1024); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); OKIM6295(config, "oki", 1056000, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 0.50); // clock frequency & pin 7 not verified @@ -308,24 +506,24 @@ ROM_LOAD( "cbj07.16f", 0x10000, 0x20000, CRC(8111d13f) SHA1(264e21e824c87f55da326440c6ed71e1c287a63e) ) ROM_LOAD( "cbj06.14f", 0x30000, 0x20000, CRC(9aaa0e37) SHA1(1a7b96b44c66b58f06707aafb1806520747b8c76) ) ROM_LOAD( "cbj05.13f", 0x50000, 0x20000, CRC(d0089f37) SHA1(32354c3f4693a65e297791c4d8faac3aa9cff5a1) ) - /* 0x70000-0x8ffff empty (space for 04) */ + // 0x70000-0x8ffff empty (space for 04) - ROM_REGION( 0x10000, "gfx1", 0 ) - ROM_LOAD( "cbj13.16m", 0x00000, 0x10000, CRC(2359fa0a) SHA1(3a37532ea43dd4b150c53a240d35a57a9b76d23d) ) /* text */ + ROM_REGION( 0x10000, "text", 0 ) + ROM_LOAD( "cbj13.16m", 0x00000, 0x10000, CRC(2359fa0a) SHA1(3a37532ea43dd4b150c53a240d35a57a9b76d23d) ) - ROM_REGION( 0x80000, "gfx2", 0 ) - ROM_LOAD( "cbj02.1f", 0x00000, 0x20000, CRC(d6740535) SHA1(2ece885525718fd5fe52b8fa4c07930695b89659) ) /* tiles */ + ROM_REGION( 0x80000, "tiles", 0 ) + ROM_LOAD( "cbj02.1f", 0x00000, 0x20000, CRC(d6740535) SHA1(2ece885525718fd5fe52b8fa4c07930695b89659) ) ROM_LOAD( "cbj03.2f", 0x20000, 0x20000, CRC(88098dcd) SHA1(caddebeea581129d6a62fc9f7f354d61eef175c7) ) ROM_LOAD( "cbj08.1j", 0x40000, 0x20000, CRC(5f3344bf) SHA1(1d3193078108e86e31bbfce15a8d2443cfbf2ff6) ) ROM_LOAD( "cbj09.2j", 0x60000, 0x20000, CRC(aafffdae) SHA1(26e76b55fff49811df8e5b1f165be20ec8dd196a) ) - ROM_REGION( 0x80000, "gfx3", 0 ) - ROM_LOAD( "cbj11.1m", 0x00000, 0x20000, CRC(bdc1507d) SHA1(efeaf3066acfb7186d73ad8e5b291d6e61965de2) ) /* sprites */ + ROM_REGION( 0x80000, "sprites", 0 ) + ROM_LOAD( "cbj11.1m", 0x00000, 0x20000, CRC(bdc1507d) SHA1(efeaf3066acfb7186d73ad8e5b291d6e61965de2) ) ROM_LOAD( "cbj12.2m", 0x20000, 0x20000, CRC(973f3efe) SHA1(d776499d5ac4bc23eb5d1f28b88447cc07d8ac99) ) ROM_LOAD( "cbj14.1n", 0x40000, 0x20000, CRC(765dabaa) SHA1(742d1c50b65f649f23eac7976fe26c2d7400e4e1) ) ROM_LOAD( "cbj15.2n", 0x60000, 0x20000, CRC(74756de5) SHA1(791d6620cdb563f0b3a717432aa4647981b0a10e) ) - ROM_REGION( 0x80000, "oki", 0 ) /* OKIM */ + ROM_REGION( 0x80000, "oki", 0 ) ROM_LOAD( "cbj01.1e", 0x00000, 0x20000, CRC(1d8968bd) SHA1(813e475d1d0c343e7dad516f1fe564d00c9c27fb) ) ROM_END @@ -342,11 +540,13 @@ int size = memregion("maincpu")->bytes(); m_decoded = std::make_unique(size); pang_decode(src, m_decoded.get(), size); - membank("bank1")->configure_entries(0, 32, src + 0x10000, 0x4000); - membank("bank0d")->set_base(m_decoded.get()); - membank("bank1d")->configure_entries(0, 32, m_decoded.get() + 0x10000, 0x4000); + m_databank->configure_entries(0, 32, src + 0x10000, 0x4000); + membank("opbase")->set_base(m_decoded.get()); + m_opbank->configure_entries(0, 32, m_decoded.get() + 0x10000, 0x4000); } +} // anonymous namespace + /************************************* * diff -Nru mame-0.242+dfsg.1/src/mame/drivers/ccs2810.cpp mame-0.243+dfsg.1/src/mame/drivers/ccs2810.cpp --- mame-0.242+dfsg.1/src/mame/drivers/ccs2810.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/ccs2810.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -271,7 +271,7 @@ map(0x34, 0x34).rw(FUNC(ccs300_state::port34_r), FUNC(ccs300_state::port34_w)); map(0x40, 0x40).w(FUNC(ccs300_state::port40_w)); map(0xf0, 0xf0).rw("dma", FUNC(z80dma_device::read), FUNC(z80dma_device::write)); - map(0xf2, 0xf2); // dip or jumper? only used by CCS-400 + map(0xf2, 0xf2).portr("MODEL"); // dip or jumper? only used by CCS-400 } @@ -847,6 +847,16 @@ INPUT_PORTS_END static INPUT_PORTS_START( ccs300 ) + // No information available on this system, but it may be assumed that + // the 300 is floppy-only, while the 400 boots off a hard drive. + // Plugging in the HDC cable would ground this pin to inform the bios + // it should be a 400. This "dip" is so you can see (and trace) what + // happens. + PORT_START("MODEL") + PORT_DIPNAME(0x08, 0x08, "Model") + PORT_DIPSETTING(0x00, "CCS-400") + PORT_DIPSETTING(0x08, "CCS-300") + PORT_BIT(0xf7, IP_ACTIVE_LOW, IPT_UNUSED) INPUT_PORTS_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/centiped.cpp mame-0.243+dfsg.1/src/mame/drivers/centiped.cpp --- mame-0.242+dfsg.1/src/mame/drivers/centiped.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/centiped.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1719,17 +1719,6 @@ * *************************************/ -static const gfx_layout charlayout = -{ - 8,8, - RGN_FRAC(1,2), - 2, - { RGN_FRAC(1,2), 0 }, - { 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 const gfx_layout spritelayout = { 8,16, @@ -1743,13 +1732,13 @@ }; static GFXDECODE_START( gfx_centiped ) - GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 1 ) - GFXDECODE_ENTRY( "gfx1", 0, spritelayout, 4, 4*4*4 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x2_planar, 0, 1 ) + GFXDECODE_ENTRY( "gfx1", 0, spritelayout, 4, 4*4*4 ) GFXDECODE_END static GFXDECODE_START( gfx_milliped ) - GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 4 ) - GFXDECODE_ENTRY( "gfx1", 0, spritelayout, 4*4, 4*4*4*4 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x2_planar, 0, 4 ) + GFXDECODE_ENTRY( "gfx1", 0, spritelayout, 4*4, 4*4*4*4 ) GFXDECODE_END @@ -2314,6 +2303,25 @@ ROM_END +/* +This is a conversion daughterboard for Atari Centipede PCBs. +The Bullseye Darts PCB is screened (C) 1984 CVS Technology. +PROM and PAL data recovered by mark shostak - 09 Feb 2003. + +The PCB utilizes a MAB2650A CPU; SN76496N DAC for sound; Century 109 +40-pin custom chip for protection, one 2114 (1024x4) SRAM and +one 8-pin dip that has been rendered unidentifiable. + +Two jumper wires have been run to the Centipede PCB. The red wire +runs from the 'audio' designation on the Bullseye Darts PCB (TP.A) +to both C65 and R81. The second jumper wire, blue, is run from +TP.B to the 'negative' side of R12. + +The board has two barnicles as follows: +1) 2650 pin 22 to N82SS153 pin 4 +2) 2114 pin 10 to N82SS153 pin 14 +*/ + ROM_START( bullsdrt ) ROM_REGION( 0x8000, "maincpu", 0 ) ROM_LOAD( "27128.bin", 0x0000, 0x1000, CRC(2729f585) SHA1(6ffbfa5b62c497c3932ab71d0e3f407cae99cb59) ) @@ -2327,6 +2335,9 @@ ROM_REGION( 0x0200, "proms", 0 ) /* unknown */ ROM_LOAD( "82s147.bin", 0x0000, 0x0200, CRC(d841b7e0) SHA1(aab32645a613cd027aed98437db24704763cc147) ) + + ROM_REGION( 0xeb, "plds", 0 ) + ROM_LOAD( "82s153.bin", 0x00, 0xeb, CRC(ff7e0ced) SHA1(b11dcb1937e01c23a3fad1d8c3cf0d969a80a122) ) ROM_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/ceres.cpp mame-0.243+dfsg.1/src/mame/drivers/ceres.cpp --- mame-0.242+dfsg.1/src/mame/drivers/ceres.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/ceres.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -202,14 +202,14 @@ LOG("read sector drive %d chs %d,%d,%d count %d\n", (m_wfc_sdh >> 3) & 3, m_wfc_cylinder & 0x3ff, (m_wfc_sdh >> 0) & 7, m_wfc_sector, m_wfc_count); if (hdf) - hard_disk_read(hdf, get_lbasector(hdf), m_wfc_sram); + hdf->read(get_lbasector(hdf), m_wfc_sram); m_wfc_offset = 0; break; case 3: LOG("write sector drive %d chs %d,%d,%d count %d\n", (m_wfc_sdh >> 3) & 3, m_wfc_cylinder & 0x3ff, (m_wfc_sdh >> 0) & 7, m_wfc_sector, m_wfc_count); if (hdf) - hard_disk_write(hdf, get_lbasector(hdf), m_wfc_sram); + hdf->write(get_lbasector(hdf), m_wfc_sram); m_wfc_offset = 0; break; case 4: @@ -229,12 +229,12 @@ int ceres1_state::get_lbasector(hard_disk_file *hdf) { - hard_disk_info const *info = hard_disk_get_info(hdf); + const auto &info = hdf->get_info(); int lbasector = m_wfc_cylinder & 0x3ff; - lbasector *= info->heads; + lbasector *= info.heads; lbasector += (m_wfc_sdh >> 0) & 7; - lbasector *= info->sectors; + lbasector *= info.sectors; lbasector += m_wfc_sector; return lbasector; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/chinagat.cpp mame-0.243+dfsg.1/src/mame/drivers/chinagat.cpp --- mame-0.242+dfsg.1/src/mame/drivers/chinagat.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/chinagat.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -477,7 +477,7 @@ } } - m_adpcm_addr = ((m_adpcm_addr & 0x07fff) | (data & 0x70 << 11)); + m_adpcm_addr = ((m_adpcm_addr & 0x07fff) | ((data & 0x70) << 11)); m_pcm_nibble = saiyugoub1_adpcm_rom[m_adpcm_addr & 0x3ffff]; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/cinemat.cpp mame-0.243+dfsg.1/src/mame/drivers/cinemat.cpp --- mame-0.242+dfsg.1/src/mame/drivers/cinemat.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/cinemat.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -12,7 +12,7 @@ Games supported: * Space Wars * Barrier - * Star Hawk + * Starhawk * Star Castle * Tailgunner * Rip Off @@ -1591,7 +1591,7 @@ GAME( 1978, spaceshp, spacewar, spacewar, spaceshp, cinemat_state, empty_init, ORIENTATION_FLIP_Y, "Cinematronics (Sega license)", "Space Ship", MACHINE_SUPPORTS_SAVE ) GAMEL( 1979, barrier, 0, barrier, barrier, cinemat_state, empty_init, ORIENTATION_FLIP_X ^ ROT270, "Cinematronics (Vectorbeam license)", "Barrier", MACHINE_SUPPORTS_SAVE, layout_barrier ) // developed by Cinematronics, then (when they noticed it wasn't going to be a successful game) sold to Vectorbeam, and ultimately back in the hands of Cinematronics again after they bought the dying company Vectorbeam GAMEL( 1979, speedfrk, 0, speedfrk, speedfrk, cinemat_state, init_speedfrk, ORIENTATION_FLIP_Y, "Vectorbeam", "Speed Freak", MACHINE_SUPPORTS_SAVE, layout_speedfrk ) -GAME( 1979, starhawk, 0, starhawk, starhawk, cinemat_state, empty_init, ORIENTATION_FLIP_Y, "Cinematronics", "Star Hawk", MACHINE_SUPPORTS_SAVE ) +GAME( 1979, starhawk, 0, starhawk, starhawk, cinemat_state, empty_init, ORIENTATION_FLIP_Y, "Cinematronics", "Starhawk", MACHINE_SUPPORTS_SAVE ) GAMEL( 1979, sundance, 0, sundance, sundance, cinemat_16level_state, init_sundance, ORIENTATION_FLIP_X ^ ROT270, "Cinematronics", "Sundance", MACHINE_SUPPORTS_SAVE, layout_sundance ) GAMEL( 1979, tailg, 0, tailg, tailg, cinemat_state, empty_init, ORIENTATION_FLIP_Y, "Cinematronics", "Tailgunner", MACHINE_SUPPORTS_SAVE, layout_tailg ) GAMEL( 1979, warrior, 0, warrior, warrior, cinemat_state, empty_init, ORIENTATION_FLIP_Y, "Vectorbeam", "Warrior", MACHINE_SUPPORTS_SAVE, layout_warrior ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/cm1800.cpp mame-0.243+dfsg.1/src/mame/drivers/cm1800.cpp --- mame-0.242+dfsg.1/src/mame/drivers/cm1800.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/cm1800.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Miodrag Milanovic, Robbbert +// copyright-holders:Miodrag Milanovic /*************************************************************************** CM-1800 diff -Nru mame-0.242+dfsg.1/src/mame/drivers/cmi.cpp mame-0.243+dfsg.1/src/mame/drivers/cmi.cpp --- mame-0.242+dfsg.1/src/mame/drivers/cmi.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/cmi.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -252,8 +252,8 @@ template uint8_t perr_r(offs_t offset); template void perr_w(offs_t offset, uint8_t data); - uint16_t m_aic_ad565_in[16]; - uint8_t m_aic_mux_latch; + uint16_t m_aic_ad565_in[16]{}; + uint8_t m_aic_mux_latch = 0; uint8_t aic_ad574_r(); template void aic_dac_w(uint8_t data); @@ -403,15 +403,15 @@ required_device m_cpu1_periphs; required_device m_cpu2_periphs; - address_space *m_cpu1space; - address_space *m_cpu2space; + address_space *m_cpu1space = nullptr; + address_space *m_cpu2space = nullptr; private: - emu_timer *m_map_switch_timer; - emu_timer *m_hblank_timer; - emu_timer *m_jam_timeout_timer; + emu_timer *m_map_switch_timer = nullptr; + emu_timer *m_hblank_timer = nullptr; + emu_timer *m_jam_timeout_timer = nullptr; - uint8_t m_video_data; + uint8_t m_video_data = 0; // Memory bool map_is_active(int cpunum, int map, uint8_t *map_info); @@ -427,52 +427,52 @@ void fdc_dma_transfer(); // Q133 CPU Card - uint8_t *m_q133_rom; + uint8_t *m_q133_rom = nullptr; - uint16_t m_int_state[2]; - uint8_t m_lp_int; - uint8_t m_hp_int; + uint16_t m_int_state[2]{}; + uint8_t m_lp_int = 0; + uint8_t m_hp_int = 0; std::unique_ptr m_shared_ram; std::unique_ptr m_scratch_ram[2]; /* Memory management */ - uint8_t m_map_sel[16]; + uint8_t m_map_sel[16]{}; std::unique_ptr m_map_ram[2]; std::unique_ptr m_q256_ram[2]; - uint8_t m_map_ram_latch; - int m_cpu_active_space[2]; - int m_cpu_map_switch[2]; - uint8_t m_curr_mapinfo[2]; - uint8_t m_irq_address[2][2]; - int m_m6809_bs_hack_cnt[2]; + uint8_t m_map_ram_latch = 0; + int m_cpu_active_space[2]{}; + int m_cpu_map_switch[2]{}; + uint8_t m_curr_mapinfo[2]{}; + uint8_t m_irq_address[2][2]{}; + int m_m6809_bs_hack_cnt[2]{}; /* Q219 lightpen/graphics card */ std::unique_ptr m_video_ram; - uint16_t m_x_pos; - uint8_t m_y_pos; - uint16_t m_lp_x; - uint8_t m_lp_y; - uint8_t m_q219_b_touch; + uint16_t m_x_pos = 0; + uint8_t m_y_pos = 0; + uint16_t m_lp_x = 0; + uint8_t m_lp_y = 0; + uint8_t m_q219_b_touch = 0; /* QFC9 floppy disk controller card */ - uint8_t * m_qfc9_region_ptr; - int m_fdc_drq; - uint8_t m_fdc_addr; - uint8_t m_fdc_ctrl; - uint8_t m_fdc_status; - PAIR m_fdc_dma_addr; - PAIR m_fdc_dma_cnt; + uint8_t * m_qfc9_region_ptr = 0; + int m_fdc_drq = 0; + uint8_t m_fdc_addr = 0; + uint8_t m_fdc_ctrl = 0; + uint8_t m_fdc_status = 0; + PAIR m_fdc_dma_addr{}; + PAIR m_fdc_dma_cnt{}; /* CMI-07 */ - uint8_t m_cmi07_ctrl; - bool m_cmi07_base_enable[2]; - uint16_t m_cmi07_base_addr; + uint8_t m_cmi07_ctrl = 0; + bool m_cmi07_base_enable[2]{}; + uint16_t m_cmi07_base_addr = 0; - uint8_t m_msm5832_addr; + uint8_t m_msm5832_addr = 0; // Master card (CMI-02) - int m_cmi02_ptm_irq; - uint8_t m_cmi02_pia_chsel; + int m_cmi02_ptm_irq = 0; + uint8_t m_cmi02_pia_chsel = 0; }; /************************************** @@ -1356,7 +1356,7 @@ /* Active low */ m_fdc_status &= ~FDC_STATUS_DRIVER_LOAD; - int i; + int i = 0; for (i = 0; i < NUM_Q256_CARDS; ++i) { p_info = m_map_ram[i][(map << PAGE_SHIFT) | page]; @@ -1452,7 +1452,7 @@ int cpu_page = (m_fdc_dma_addr.w.l & ~PAGE_MASK) / PAGE_SIZE; int phys_page = 0; - int i; + int i = 0; for (i = 0; i < NUM_Q256_CARDS; ++i) { phys_page = m_map_ram[i][(map << PAGE_SHIFT) | cpu_page]; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/coco12.cpp mame-0.243+dfsg.1/src/mame/drivers/coco12.cpp --- mame-0.242+dfsg.1/src/mame/drivers/coco12.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/coco12.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -145,13 +145,13 @@ INPUT_PORTS_START( coco_joystick ) PORT_START(JOYSTICK_RX_TAG) - PORT_BIT( 0x3ff, 0x140, IPT_AD_STICK_X) PORT_NAME("Right Joystick X") PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0x00,0x280) PORT_CODE_DEC(KEYCODE_4_PAD) PORT_CODE_INC(KEYCODE_6_PAD) PORT_CODE_DEC(JOYCODE_X_LEFT_SWITCH) PORT_CODE_INC(JOYCODE_X_RIGHT_SWITCH) PORT_PLAYER(1) PORT_CONDITION(CTRL_SEL_TAG, 0x0f, EQUALS, 0x01) + PORT_BIT( 0x3ff, 0x200, IPT_AD_STICK_X) PORT_NAME("Right Joystick X") PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0,1023) PORT_CODE_DEC(KEYCODE_4_PAD) PORT_CODE_INC(KEYCODE_6_PAD) PORT_CODE_DEC(JOYCODE_X_LEFT_SWITCH) PORT_CODE_INC(JOYCODE_X_RIGHT_SWITCH) PORT_PLAYER(1) PORT_CONDITION(CTRL_SEL_TAG, 0x0f, EQUALS, 0x01) PORT_START(JOYSTICK_RY_TAG) - PORT_BIT( 0x3ff, 0x140, IPT_AD_STICK_Y) PORT_NAME("Right Joystick Y") PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0x00,0x280) PORT_CODE_DEC(KEYCODE_8_PAD) PORT_CODE_INC(KEYCODE_2_PAD) PORT_CODE_DEC(JOYCODE_Y_UP_SWITCH) PORT_CODE_INC(JOYCODE_Y_DOWN_SWITCH) PORT_PLAYER(1) PORT_CONDITION(CTRL_SEL_TAG, 0x0f, EQUALS, 0x01) + PORT_BIT( 0x3ff, 0x200, IPT_AD_STICK_Y) PORT_NAME("Right Joystick Y") PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0,1023) PORT_CODE_DEC(KEYCODE_8_PAD) PORT_CODE_INC(KEYCODE_2_PAD) PORT_CODE_DEC(JOYCODE_Y_UP_SWITCH) PORT_CODE_INC(JOYCODE_Y_DOWN_SWITCH) PORT_PLAYER(1) PORT_CONDITION(CTRL_SEL_TAG, 0x0f, EQUALS, 0x01) PORT_START(JOYSTICK_LX_TAG) - PORT_BIT( 0x3ff, 0x140, IPT_AD_STICK_X) PORT_NAME("Left Joystick X") PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0x00,0x280) PORT_CODE_DEC(KEYCODE_4_PAD) PORT_CODE_INC(KEYCODE_6_PAD) PORT_CODE_DEC(JOYCODE_X_LEFT_SWITCH) PORT_CODE_INC(JOYCODE_X_RIGHT_SWITCH) PORT_PLAYER(2) PORT_CONDITION(CTRL_SEL_TAG, 0xf0, EQUALS, 0x10) + PORT_BIT( 0x3ff, 0x200, IPT_AD_STICK_X) PORT_NAME("Left Joystick X") PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0,1023) PORT_CODE_DEC(KEYCODE_4_PAD) PORT_CODE_INC(KEYCODE_6_PAD) PORT_CODE_DEC(JOYCODE_X_LEFT_SWITCH) PORT_CODE_INC(JOYCODE_X_RIGHT_SWITCH) PORT_PLAYER(2) PORT_CONDITION(CTRL_SEL_TAG, 0xf0, EQUALS, 0x10) PORT_START(JOYSTICK_LY_TAG) - PORT_BIT( 0x3ff, 0x140, IPT_AD_STICK_Y) PORT_NAME("Left Joystick Y") PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0x00,0x280) PORT_CODE_DEC(KEYCODE_8_PAD) PORT_CODE_INC(KEYCODE_2_PAD) PORT_CODE_DEC(JOYCODE_Y_UP_SWITCH) PORT_CODE_INC(JOYCODE_Y_DOWN_SWITCH) PORT_PLAYER(2) PORT_CONDITION(CTRL_SEL_TAG, 0xf0, EQUALS, 0x10) + PORT_BIT( 0x3ff, 0x200, IPT_AD_STICK_Y) PORT_NAME("Left Joystick Y") PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0,1023) PORT_CODE_DEC(KEYCODE_8_PAD) PORT_CODE_INC(KEYCODE_2_PAD) PORT_CODE_DEC(JOYCODE_Y_UP_SWITCH) PORT_CODE_INC(JOYCODE_Y_DOWN_SWITCH) PORT_PLAYER(2) PORT_CONDITION(CTRL_SEL_TAG, 0xf0, EQUALS, 0x10) PORT_START(JOYSTICK_BUTTONS_TAG) PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Right Button") PORT_CHANGED_MEMBER(DEVICE_SELF, coco12_state, coco_state::keyboard_changed, 0) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(JOYCODE_BUTTON1) PORT_CODE(MOUSECODE_BUTTON1) PORT_PLAYER(1) PORT_CONDITION(CTRL_SEL_TAG, 0x0f, EQUALS, 0x01) PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Left Button") PORT_CHANGED_MEMBER(DEVICE_SELF, coco12_state, coco_state::keyboard_changed, 0) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(JOYCODE_BUTTON1) PORT_CODE(MOUSECODE_BUTTON1) PORT_PLAYER(2) PORT_CONDITION(CTRL_SEL_TAG, 0xf0, EQUALS, 0x10) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/coco3.cpp mame-0.243+dfsg.1/src/mame/drivers/coco3.cpp --- mame-0.242+dfsg.1/src/mame/drivers/coco3.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/coco3.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -156,13 +156,13 @@ static INPUT_PORTS_START( coco3_joystick ) PORT_START(JOYSTICK_RX_TAG) - PORT_BIT( 0x3ff, 0x140, IPT_AD_STICK_X) PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0x00,0x280) PORT_CODE_DEC(KEYCODE_4_PAD) PORT_CODE_INC(KEYCODE_6_PAD) PORT_CODE_DEC(JOYCODE_X_LEFT_SWITCH) PORT_CODE_INC(JOYCODE_X_RIGHT_SWITCH) PORT_PLAYER(1) PORT_CONDITION(CTRL_SEL_TAG, 0x0f, EQUALS, 0x01) + PORT_BIT( 0x3ff, 0x200, IPT_AD_STICK_X) PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0, 1023) PORT_CODE_DEC(KEYCODE_4_PAD) PORT_CODE_INC(KEYCODE_6_PAD) PORT_CODE_DEC(JOYCODE_X_LEFT_SWITCH) PORT_CODE_INC(JOYCODE_X_RIGHT_SWITCH) PORT_PLAYER(1) PORT_CONDITION(CTRL_SEL_TAG, 0x0f, EQUALS, 0x01) PORT_START(JOYSTICK_RY_TAG) - PORT_BIT( 0x3ff, 0x140, IPT_AD_STICK_Y) PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0x00,0x280) PORT_CODE_DEC(KEYCODE_8_PAD) PORT_CODE_INC(KEYCODE_2_PAD) PORT_CODE_DEC(JOYCODE_Y_UP_SWITCH) PORT_CODE_INC(JOYCODE_Y_DOWN_SWITCH) PORT_PLAYER(1) PORT_CONDITION(CTRL_SEL_TAG, 0x0f, EQUALS, 0x01) + PORT_BIT( 0x3ff, 0x200, IPT_AD_STICK_Y) PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0, 1023) PORT_CODE_DEC(KEYCODE_8_PAD) PORT_CODE_INC(KEYCODE_2_PAD) PORT_CODE_DEC(JOYCODE_Y_UP_SWITCH) PORT_CODE_INC(JOYCODE_Y_DOWN_SWITCH) PORT_PLAYER(1) PORT_CONDITION(CTRL_SEL_TAG, 0x0f, EQUALS, 0x01) PORT_START(JOYSTICK_LX_TAG) - PORT_BIT( 0x3ff, 0x140, IPT_AD_STICK_X) PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0x00,0x280) PORT_CODE_DEC(KEYCODE_4_PAD) PORT_CODE_INC(KEYCODE_6_PAD) PORT_CODE_DEC(JOYCODE_X_LEFT_SWITCH) PORT_CODE_INC(JOYCODE_X_RIGHT_SWITCH) PORT_PLAYER(2) PORT_CONDITION(CTRL_SEL_TAG, 0xf0, EQUALS, 0x10) + PORT_BIT( 0x3ff, 0x200, IPT_AD_STICK_X) PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0, 1023) PORT_CODE_DEC(KEYCODE_4_PAD) PORT_CODE_INC(KEYCODE_6_PAD) PORT_CODE_DEC(JOYCODE_X_LEFT_SWITCH) PORT_CODE_INC(JOYCODE_X_RIGHT_SWITCH) PORT_PLAYER(2) PORT_CONDITION(CTRL_SEL_TAG, 0xf0, EQUALS, 0x10) PORT_START(JOYSTICK_LY_TAG) - PORT_BIT( 0x3ff, 0x140, IPT_AD_STICK_Y) PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0x00,0x280) PORT_CODE_DEC(KEYCODE_8_PAD) PORT_CODE_INC(KEYCODE_2_PAD) PORT_CODE_DEC(JOYCODE_Y_UP_SWITCH) PORT_CODE_INC(JOYCODE_Y_DOWN_SWITCH) PORT_PLAYER(2) PORT_CONDITION(CTRL_SEL_TAG, 0xf0, EQUALS, 0x10) + PORT_BIT( 0x3ff, 0x200, IPT_AD_STICK_Y) PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0, 1023) PORT_CODE_DEC(KEYCODE_8_PAD) PORT_CODE_INC(KEYCODE_2_PAD) PORT_CODE_DEC(JOYCODE_Y_UP_SWITCH) PORT_CODE_INC(JOYCODE_Y_DOWN_SWITCH) PORT_PLAYER(2) PORT_CONDITION(CTRL_SEL_TAG, 0xf0, EQUALS, 0x10) PORT_START(JOYSTICK_BUTTONS_TAG) PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Right Button 1") PORT_CHANGED_MEMBER(DEVICE_SELF, coco3_state, coco_state::keyboard_changed, 0) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(JOYCODE_BUTTON1) PORT_CODE(MOUSECODE_BUTTON1) PORT_PLAYER(1) PORT_CONDITION(CTRL_SEL_TAG, 0x0f, EQUALS, 0x01) PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Right Button 2") PORT_CHANGED_MEMBER(DEVICE_SELF, coco3_state, coco_state::keyboard_changed, 0) PORT_CODE(KEYCODE_DEL_PAD) PORT_CODE(JOYCODE_BUTTON2) PORT_CODE(MOUSECODE_BUTTON2) PORT_PLAYER(1) PORT_CONDITION(CTRL_SEL_TAG, 0x0f, EQUALS, 0x01) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/contra.cpp mame-0.243+dfsg.1/src/mame/drivers/contra.cpp --- mame-0.242+dfsg.1/src/mame/drivers/contra.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/contra.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -16,32 +16,435 @@ 2008-07 Dip locations and factory settings verified with manual +*************************************************************************** + +Contra / Gryzor, Konami 1987 +Hardware info by Guru + +GX633 PWB302160 +|-------------------------------------------------------| +|CN1 LA4445 CN3 CN4 YM2151 68B09 633M03.18A | +| VOL 633I02.17A 63C09 | +|CN2 VOL 633E01.12A 007324 | +| 005924 LM324 YM3012 | +| | +| 8416 8464 | +| DIPSW1 24MHz 007452 | +|005273(x5) 3.579545MHz 007766 | +| DIPSW2 | +|J 633E04.7D 633E06.16D | +|A DIPSW3 |-----------| |-----------| | +|M | |5164 | |5164 | +|M | KONAMI | | KONAMI | | +|A|--------| | 007121 | | 007121 | | +| | | | | | | | +| | KONAMI | | | | | | +| | 007593 | |-----------| |-----------| | +| | | | +| | |633E05.7F 633E07.16F | +| |--------| 633E08.10G 4464 4464 633E10.18G 4464 4464| +| 633E09.12G 633E11.20G | +|-------------------------------------------------------| +Notes: + LA4445 - Sanyo LA4445 2-Channel (Stereo) 5.5W Audio Power Amplifier + 68B09 - 1.7897725MHz [3.579545/2] (audio CPU) + 63C09 - 3.000MHz [24/8] (main CPU) + YM2151 - Yamaha YM2151 FM Operator Type-M (OPM) sound chip. Clock input 3.579545MHz + YM3012 - Yamaha YM3012 2-Channel Serial Input Floating D/A Converter (DAC-MS). Clock input 1.7897725MHz [3.579545/2] + LM324 - Texas Instruments LM324 Quad Operational Amplifier + CN1 - 4-pin connector for additional composite sync output + CN2 - 4-pin connector for 2nd speaker for stereo audio output + CN3 - 4-pin connector for mono output selector \ with loopback plug connected to either CN3 or CN4 + CN4 - 4-pin connector for stereo output selector / + 8416 - Fujitsu MB8416 2kBx8-bit SRAM (sound program RAM) + 8464 - Fujitsu MB8464 8kBx8-bit SRAM (main program RAM) + 5164 - Sharp LH5164 or Fujitsu MB8464 8kBx8-bit SRAM (background RAM) + 4464 - NEC D4464 64kBx8-bit DRAM (sprite RAM) + 005273 - Konami custom resistor pack for controls/inputs + 005924 - Konami custom ceramic coin counter driver + 007766 - PAL16L8 marked '007766' at location 20D + 007121 - Konami custom sprite / background generator + 007324 - Resistor array package containing 8x 150 ohm resistors. The IC looks like a DIP16 logic chip + but with an epoxy top. The schematics show it connected to the 6309 data lines (D0-D7) and the + program ROM data lines (D0-D7). It is a simple resistor array. + 007452 - Konami custom chip + 007593 - Konami custom ceramic color mixer and RGB video DAC + Contains some logic and 2x 2kBx8-bit SRAMs for color RAM. + This IC also has 16x I/O lines but they are not connected on this PCB. + 633I02.17A - 27512 64kBx8-bit EPROM \ + 633M03.18A - 27512 64kBx8-bit EPROM / (main program) + 633E01.12A - 27256 32kBx8-bit EPROM (sound program) + 633E04.7D - \ + 633E05.7F - | + 633E06.16D - | 256kBx8-bit (2Mbit) DIP40 mask ROM (graphics) + 633E07.16F - / + 633E08.10G - MMI 63S141 256x4-bit Bipolar PROM, compatible with 82S129 (sprite lookup table) + 633E09.12G - MMI 63S141 256x4-bit Bipolar PROM, compatible with 82S129 (character lookup table) + 633E10.18G - MMI 63S141 256x4-bit Bipolar PROM, compatible with 82S129 (sprite lookup table) + 633E11.20G - MMI 63S141 256x4-bit Bipolar PROM, compatible with 82S129 (character lookup table) + DIPSW3 - 4-position DIP switch + DIPSW1/2 - 8-position DIP switch + + +Contra / Gryzor bootleg +Hardware info by Guru + +(no PCB number) +|-------------------------------------------------------------------------------------| +| C1182 51C64 51C64 51C64 51C64 51C64 G-4.A17| A +| VOL PAL16R6 51C64 51C64 51C64 51C64 51C64 4016 82S129.B15 G-5.B17| B +| |------------------| 82S129.C15 | C +| 18MHz PAL16R8| | G-6.D17| D +| | | | E +| |----SUB-BOARD-----| G-7.F17| F +| G-3.G2 PAL16R4 PAL16L8 G-8.G17| G +| PAL16R4 | H +|J G-2.J2 G-9.J17| J +|A 68B09(1) 6264 PAL16L8 G-10.K17| K +|M LM324 YM3012 4016 G-11.L17| L +|M DIPSW3 YM2151 G-12.M17| M +|A 68B09(2) PAL20L8 PAL20L8 | N +| G-13.P17| P +| DIPSW1 DIPSW2 G-1.P5 2063 2063 PAL16R8 G-14.Q17| Q +|14.31818MHz 2015 | R +| G-15.S17| S +| 82S129.T16 G-16.T17| T +| 82S129.U16 | U +| G-17.V17| V +| 6116 6116 G-18.W17| W +|-------------------------------------------------------------------------------------| + 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 + +Notes: + 68B09(1) - Motorola MC68B09EP CPU. Clock input 3.000MHz [18/6] + 68B09(2) - Motorola MC68B09EP CPU. Clock input 1.7897725MHz [14.31818/8] + YM3012 - Yamaha YM3012 2-Channel Serial Input Floating D/A Converter (DAC-MS). Clock input 1.7897725MHz [3.579545/2] + YM2151 - Yamaha YM2151 FM Operator Type-M (OPM) sound chip. Clock input 3.579545MHz [14.31818/4] + 51C64 - Hynix HY51C64 64kBx1-bit DRAM (sprite RAM). Total RAM is 80kBx8-bit whereas the original board has 128kBx8-bit DRAM (4x 4464 chips). + 6116 - HM6116 2kBx8-bit SRAM (color RAM). At power-on, this is tested as one RAM equivalent to the + internal 4kBx8-bit SRAM in the custom color mixer/RGB DAC at 1F on the original board. + 6264 - Hitachi HM6264 8kBx8-bit SRAM (main program RAM) + 2063 - Toshiba TMM2063 8kBx8-bit SRAM (background RAM front layer) + 4016 - NEC D4016 2kBx8-bit SRAM (background RAM back layer) + 2015 - Toshiba TMM2015 2kBx8-bit SRAM (sound program RAM) + C1182 - NEC C1182 Audio Power Amplifier + LM324 - Texas Instruments LM324 Quad Operational Amplifier + SUB-BOARD - Daughter board containing logic plugged into a DIP40 socket. Might be a re-implementation + of Konami 007452 custom chip modified to fit a DIP40 socket. + DIPSW3 - 4-position DIP switch + DIPSW1/2 - 8-position DIP switch + HSync - 15.35929kHz + VSync - 61.0208Hz + ***************************************************************************/ + #include "emu.h" -#include "includes/contra.h" + #include "includes/konamipt.h" +#include "machine/k007452.h" +#include "video/k007121.h" #include "cpu/m6809/hd6309.h" #include "cpu/m6809/m6809.h" #include "machine/gen_latch.h" -#include "machine/k007452.h" #include "sound/ymopm.h" +#include "video/bufsprite.h" + +#include "emupal.h" +#include "screen.h" #include "speaker.h" +#include "tilemap.h" + + +namespace { + +class contra_state : public driver_device +{ +public: + contra_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_cram(*this, "cram%u", 0U), + m_vram(*this, "vram%u", 0U), + m_mainbank(*this, "mainbank"), + m_buffered_spriteram(*this, "spriteram%u", 1U), + m_audiocpu(*this, "audiocpu"), + m_k007121(*this, "k007121_%u", 1U), + m_maincpu(*this, "maincpu"), + m_gfxdecode(*this, "gfxdecode"), + m_screen(*this, "screen"), + m_palette(*this, "palette") + { } + + void contra(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; + +private: + // memory pointers + required_shared_ptr_array m_cram; + required_shared_ptr_array m_vram; + required_memory_bank m_mainbank; + + // video-related + tilemap_t *m_tilemap[3]{}; + rectangle m_clip[3]{}; + + // devices + required_device_array m_buffered_spriteram; + required_device m_audiocpu; + required_device_array m_k007121; + required_device m_maincpu; + required_device m_gfxdecode; + required_device m_screen; + required_device m_palette; + + void bankswitch_w(uint8_t data); + void sh_irqtrigger_w(uint8_t data); + void sirq_clear_w(uint8_t data); + void coin_counter_w(uint8_t data); + template void vram_w(offs_t offset, uint8_t data); + template void cram_w(offs_t offset, uint8_t data); + template void K007121_ctrl_w(offs_t offset, uint8_t data); + template TILE_GET_INFO_MEMBER(get_tile_info); + TILE_GET_INFO_MEMBER(get_tx_tile_info); + void palette(palette_device &palette) const; + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + INTERRUPT_GEN_MEMBER(interrupt); + template void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap); + + void main_map(address_map &map); + void sound_map(address_map &map); +}; + + +// video + +/*************************************************************************** +** +** Contra has palette RAM, but it also has four lookup table PROMs +** +** 0 sprites #0 +** 1 tiles #0 +** 2 sprites #1 +** 3 tiles #1 +** +***************************************************************************/ + +void contra_state::palette(palette_device &palette) const +{ + uint8_t const *const color_prom = memregion("proms")->base(); + + for (int chip = 0; chip < 2; chip++) + { + for (int pal = 0; pal < 8; pal++) + { + int const clut = (chip << 1) | (pal & 1); + + for (int i = 0; i < 0x100; i++) + { + uint8_t ctabentry; + + if (((pal & 0x01) == 0) && (color_prom[(clut << 8) | i] == 0)) + ctabentry = 0; + else + ctabentry = (pal << 4) | (color_prom[(clut << 8) | i] & 0x0f); + + palette.set_pen_indirect((chip << 11) | (pal << 8) | i, ctabentry); + } + } + } +} + + + +/*************************************************************************** + + Callbacks for the TileMap code + +***************************************************************************/ + +template +TILE_GET_INFO_MEMBER(contra_state::get_tile_info) +{ + uint8_t ctrl_3 = m_k007121[Which]->ctrlram_r(3); + uint8_t ctrl_4 = m_k007121[Which]->ctrlram_r(4); + uint8_t ctrl_5 = m_k007121[Which]->ctrlram_r(5); + uint8_t ctrl_6 = m_k007121[Which]->ctrlram_r(6); + int attr = m_cram[Which][tile_index]; + int bit0 = (ctrl_5 >> 0) & 0x03; + int bit1 = (ctrl_5 >> 2) & 0x03; + int bit2 = (ctrl_5 >> 4) & 0x03; + int bit3 = (ctrl_5 >> 6) & 0x03; + int bank = ((attr & 0x80) >> 7) | + ((attr >> (bit0 + 2)) & 0x02) | + ((attr >> (bit1 + 1)) & 0x04) | + ((attr >> (bit2 )) & 0x08) | + ((attr >> (bit3 - 1)) & 0x10) | + ((ctrl_3 & 0x01) << 5); + int mask = (ctrl_4 & 0xf0) >> 4; + + bank = (bank & ~(mask << 1)) | ((ctrl_4 & mask) << 1); + + tileinfo.set(Which, + m_vram[Which][tile_index] + bank * 256, + ((ctrl_6 & 0x30) * 2 + 16) + (attr & 7), + 0); +} + + +TILE_GET_INFO_MEMBER(contra_state::get_tx_tile_info) +{ + uint8_t ctrl_5 = m_k007121[0]->ctrlram_r(5); + uint8_t ctrl_6 = m_k007121[0]->ctrlram_r(6); + int attr = m_cram[2][tile_index]; + int bit0 = (ctrl_5 >> 0) & 0x03; + int bit1 = (ctrl_5 >> 2) & 0x03; + int bit2 = (ctrl_5 >> 4) & 0x03; + int bit3 = (ctrl_5 >> 6) & 0x03; + int bank = ((attr & 0x80) >> 7) | + ((attr >> (bit0 + 2)) & 0x02) | + ((attr >> (bit1 + 1)) & 0x04) | + ((attr >> (bit2 )) & 0x08) | + ((attr >> (bit3 - 1)) & 0x10); + + tileinfo.set(0, + m_vram[2][tile_index] + bank * 256, + ((ctrl_6 & 0x30) * 2 + 16) + (attr & 7), + 0); +} + + +/*************************************************************************** + + Start the video hardware emulation. + +***************************************************************************/ + +void contra_state::video_start() +{ + m_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(contra_state::get_tile_info<0>)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); + m_tilemap[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(contra_state::get_tile_info<1>)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); + m_tilemap[2] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(contra_state::get_tx_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); + + m_clip[1] = m_screen->visible_area(); + m_clip[1].min_x += 40; + m_clip[0] = m_clip[1]; -INTERRUPT_GEN_MEMBER(contra_state::contra_interrupt) + m_clip[2] = m_screen->visible_area(); + m_clip[2].max_x = 39; + m_clip[2].min_x = 0; + + m_tilemap[0]->set_transparent_pen(0); +} + + +/*************************************************************************** + + Memory handlers + +***************************************************************************/ + +template +void contra_state::vram_w(offs_t offset, uint8_t data) +{ + m_vram[Which][offset] = data; + m_tilemap[Which]->mark_tile_dirty(offset); +} + +template +void contra_state::cram_w(offs_t offset, uint8_t data) { - if (m_k007121_1->ctrlram_r(7) & 0x02) + m_cram[Which][offset] = data; + m_tilemap[Which]->mark_tile_dirty(offset); +} + +template +void contra_state::K007121_ctrl_w(offs_t offset, uint8_t data) +{ + uint8_t ctrl_6 = m_k007121[Which]->ctrlram_r(6); + + if (offset == 3) + { + if ((data & 0x8) == 0) + m_buffered_spriteram[Which]->copy(0x800, 0x800); + else + m_buffered_spriteram[Which]->copy(0x000, 0x800); + } + + if (offset == 6) + { + if (ctrl_6 != data) + m_tilemap[Which]->mark_all_dirty(); + } + + if (offset == 7) + m_tilemap[Which]->set_flip((data & 0x08) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); + + m_k007121[Which]->ctrl_w(offset, data); +} + + +/*************************************************************************** + + Display Refresh + +***************************************************************************/ + +template +void contra_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap) +{ + int base_color = (m_k007121[Which]->ctrlram_r(6) & 0x30) * 2; + + m_k007121[Which]->sprites_draw(bitmap, cliprect, m_gfxdecode->gfx(Which), *m_palette, m_buffered_spriteram[Which]->buffer(), base_color, 40, 0, priority_bitmap, (uint32_t)-1); +} + +uint32_t contra_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + uint8_t ctrl_1_0 = m_k007121[0]->ctrlram_r(0); + uint8_t ctrl_1_2 = m_k007121[0]->ctrlram_r(2); + uint8_t ctrl_2_0 = m_k007121[1]->ctrlram_r(0); + uint8_t ctrl_2_2 = m_k007121[1]->ctrlram_r(2); + rectangle bg_finalclip = m_clip[1]; + rectangle fg_finalclip = m_clip[0]; + rectangle tx_finalclip = m_clip[2]; + + bg_finalclip &= cliprect; + fg_finalclip &= cliprect; + tx_finalclip &= cliprect; + + m_tilemap[0]->set_scrollx(0, ctrl_1_0 - 40); + m_tilemap[0]->set_scrolly(0, ctrl_1_2); + m_tilemap[1]->set_scrollx(0, ctrl_2_0 - 40); + m_tilemap[1]->set_scrolly(0, ctrl_2_2); + + m_tilemap[1]->draw(screen, bitmap, bg_finalclip, 0 ,0); + m_tilemap[0]->draw(screen, bitmap, fg_finalclip, 0 ,0); + draw_sprites<0>(bitmap, cliprect, screen.priority()); + draw_sprites<1>(bitmap, cliprect, screen.priority()); + m_tilemap[2]->draw(screen, bitmap, tx_finalclip, 0 ,0); + return 0; +} + + +// machine + +INTERRUPT_GEN_MEMBER(contra_state::interrupt) +{ + if (m_k007121[0]->ctrlram_r(7) & 0x02) device.execute().set_input_line(HD6309_IRQ_LINE, HOLD_LINE); } -void contra_state::contra_bankswitch_w(uint8_t data) +void contra_state::bankswitch_w(uint8_t data) { - membank("bank1")->set_entry(data & 0x0f); + m_mainbank->set_entry(data & 0x0f); } -void contra_state::contra_sh_irqtrigger_w(uint8_t data) +void contra_state::sh_irqtrigger_w(uint8_t data) { m_audiocpu->set_input_line(M6809_IRQ_LINE, ASSERT_LINE); } @@ -51,18 +454,15 @@ m_audiocpu->set_input_line(M6809_IRQ_LINE, CLEAR_LINE); } -void contra_state::contra_coin_counter_w(uint8_t data) +void contra_state::coin_counter_w(uint8_t data) { - if (data & 0x01) - machine().bookkeeping().coin_counter_w(0, data & 0x01); - - if (data & 0x02) - machine().bookkeeping().coin_counter_w(1, (data & 0x02) >> 1); + machine().bookkeeping().coin_counter_w(0, data & 0x01); + machine().bookkeeping().coin_counter_w(1, data & 0x02); } -void contra_state::contra_map(address_map &map) +void contra_state::main_map(address_map &map) { - map(0x0000, 0x0007).w(FUNC(contra_state::contra_K007121_ctrl_0_w)); + map(0x0000, 0x0007).w(FUNC(contra_state::K007121_ctrl_w<0>)); map(0x0008, 0x000f).rw("k007452", FUNC(k007452_device::read), FUNC(k007452_device::write)); map(0x0010, 0x0010).portr("SYSTEM"); map(0x0011, 0x0011).portr("P1"); @@ -72,39 +472,39 @@ map(0x0015, 0x0015).portr("DSW2"); map(0x0016, 0x0016).portr("DSW3"); - map(0x0018, 0x0018).w(FUNC(contra_state::contra_coin_counter_w)); - map(0x001a, 0x001a).w(FUNC(contra_state::contra_sh_irqtrigger_w)); + map(0x0018, 0x0018).w(FUNC(contra_state::coin_counter_w)); + map(0x001a, 0x001a).w(FUNC(contra_state::sh_irqtrigger_w)); map(0x001c, 0x001c).w("soundlatch", FUNC(generic_latch_8_device::write)); - map(0x001e, 0x001e).nopw(); /* ? */ - map(0x0060, 0x0067).w(FUNC(contra_state::contra_K007121_ctrl_1_w)); + map(0x001e, 0x001e).nopw(); // ? + map(0x0060, 0x0067).w(FUNC(contra_state::K007121_ctrl_w<1>)); map(0x0c00, 0x0cff).ram().w(m_palette, FUNC(palette_device::write_indirect)).share("palette"); map(0x1000, 0x1fff).ram(); - map(0x2000, 0x23ff).ram().w(FUNC(contra_state::contra_fg_cram_w)).share("fg_cram"); - map(0x2400, 0x27ff).ram().w(FUNC(contra_state::contra_fg_vram_w)).share("fg_vram"); - map(0x2800, 0x2bff).ram().w(FUNC(contra_state::contra_text_cram_w)).share("tx_cram"); - map(0x2c00, 0x2fff).ram().w(FUNC(contra_state::contra_text_vram_w)).share("tx_vram"); - map(0x3000, 0x3fff).ram().share("spriteram"); - map(0x4000, 0x43ff).ram().w(FUNC(contra_state::contra_bg_cram_w)).share("bg_cram"); - map(0x4400, 0x47ff).ram().w(FUNC(contra_state::contra_bg_vram_w)).share("bg_vram"); + map(0x2000, 0x23ff).ram().w(FUNC(contra_state::cram_w<0>)).share(m_cram[0]); + map(0x2400, 0x27ff).ram().w(FUNC(contra_state::vram_w<0>)).share(m_vram[0]); + map(0x2800, 0x2bff).ram().w(FUNC(contra_state::cram_w<2>)).share(m_cram[2]); + map(0x2c00, 0x2fff).ram().w(FUNC(contra_state::vram_w<2>)).share(m_vram[2]); + map(0x3000, 0x3fff).ram().share("spriteram1"); + map(0x4000, 0x43ff).ram().w(FUNC(contra_state::cram_w<1>)).share(m_cram[1]); + map(0x4400, 0x47ff).ram().w(FUNC(contra_state::vram_w<1>)).share(m_vram[1]); map(0x4800, 0x4fff).ram(); - map(0x5000, 0x5fff).ram().share("spriteram_2"); + map(0x5000, 0x5fff).ram().share("spriteram2"); - map(0x6000, 0x7fff).bankr("bank1"); - map(0x7000, 0x7000).w(FUNC(contra_state::contra_bankswitch_w)); + map(0x6000, 0x7fff).bankr(m_mainbank); + map(0x7000, 0x7000).w(FUNC(contra_state::bankswitch_w)); - map(0x8000, 0xffff).rom(); + map(0x8000, 0xffff).rom().region("maincpu", 0x18000); } void contra_state::sound_map(address_map &map) { map(0x0000, 0x0000).r("soundlatch", FUNC(generic_latch_8_device::read)); map(0x2000, 0x2001).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)); - map(0x4000, 0x4000).w(FUNC(contra_state::sirq_clear_w)); /* read triggers irq reset and latch read (in the hardware only). */ + map(0x4000, 0x4000).w(FUNC(contra_state::sirq_clear_w)); // read triggers irq reset and latch read (in the hardware only). map(0x6000, 0x67ff).ram(); - map(0x8000, 0xffff).rom(); + map(0x8000, 0xffff).rom().region("audiocpu", 0); } @@ -121,7 +521,7 @@ PORT_START("DSW1") KONAMI_COINAGE_LOC(DEF_STR( Free_Play ), "No Coin B", SW1) - /* "No Coin B" = coins produce sound, but no effect on coin counter */ + // "No Coin B" = coins produce sound, but no effect on coin counter PORT_START("DSW2") PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:1,2") @@ -165,40 +565,27 @@ PORT_INCLUDE( contra ) PORT_MODIFY("DSW2") - PORT_DIPNAME( 0x04, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:3") /* Not Used according to manual, used in gryzor sets */ + PORT_DIPNAME( 0x04, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:3") // Not Used according to manual, used in gryzor sets PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) PORT_DIPSETTING( 0x04, DEF_STR( Cocktail ) ) PORT_MODIFY("DSW3") - PORT_DIPNAME( 0x02, 0x02, "Upright Controls" ) PORT_DIPLOCATION("SW3:2") /* Not Used according to manual, used in gryzor sets */ + PORT_DIPNAME( 0x02, 0x02, "Upright Controls" ) PORT_DIPLOCATION("SW3:2") // Not Used according to manual, used in gryzor sets PORT_DIPSETTING( 0x02, DEF_STR( Single ) ) PORT_DIPSETTING( 0x00, DEF_STR( Dual ) ) INPUT_PORTS_END -static const gfx_layout gfxlayout = -{ - 8,8, - 0x4000, - 4, - { 0, 1, 2, 3 }, - { 0, 4, 8, 12, 16, 20, 24, 28 }, - { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 }, - 32*8 -}; - static GFXDECODE_START( gfx_contra ) - GFXDECODE_ENTRY( "gfx1", 0, gfxlayout, 0, 8*16 ) - GFXDECODE_ENTRY( "gfx2", 0, gfxlayout, 8*16*16, 8*16 ) + GFXDECODE_ENTRY( "k007121_1", 0, gfx_8x8x4_packed_msb, 0, 8*16 ) + GFXDECODE_ENTRY( "k007121_2", 0, gfx_8x8x4_packed_msb, 8*16*16, 8*16 ) GFXDECODE_END void contra_state::machine_start() { - uint8_t *ROM = memregion("maincpu")->base(); - - membank("bank1")->configure_entries(0, 16, &ROM[0x10000], 0x2000); + m_mainbank->configure_entries(0, 16, memregion("maincpu")->base(), 0x2000); } void contra_state::machine_reset() @@ -208,40 +595,44 @@ void contra_state::contra(machine_config &config) { - /* basic machine hardware */ - HD6309E(config, m_maincpu, XTAL(24'000'000) / 8); /* (HD63C09EP) */ - m_maincpu->set_addrmap(AS_PROGRAM, &contra_state::contra_map); - m_maincpu->set_vblank_int("screen", FUNC(contra_state::contra_interrupt)); + // basic machine hardware + HD6309E(config, m_maincpu, XTAL(24'000'000) / 8); // (HD63C09EP) + m_maincpu->set_addrmap(AS_PROGRAM, &contra_state::main_map); + m_maincpu->set_vblank_int("screen", FUNC(contra_state::interrupt)); - MC6809E(config, m_audiocpu, XTAL(3'579'545) / 2 ); /* (HD68B09EP) */ + MC6809E(config, m_audiocpu, XTAL(3'579'545) / 2); // (HD68B09EP) m_audiocpu->set_addrmap(AS_PROGRAM, &contra_state::sound_map); - config.set_maximum_quantum(attotime::from_hz(6000)); /* enough for the sound CPU to read all commands */ + config.set_maximum_quantum(attotime::from_hz(6000)); // enough for the sound CPU to read all commands KONAMI_007452_MATH(config, "k007452"); - /* video hardware */ + // video hardware + BUFFERED_SPRITERAM8(config, m_buffered_spriteram[0]); + + BUFFERED_SPRITERAM8(config, m_buffered_spriteram[1]); + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_refresh_hz(60); - m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500) /* not accurate */); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); // not accurate m_screen->set_size(37*8, 32*8); m_screen->set_visarea(0*8, 35*8-1, 2*8, 30*8-1); - m_screen->set_screen_update(FUNC(contra_state::screen_update_contra)); + m_screen->set_screen_update(FUNC(contra_state::screen_update)); m_screen->set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_contra); - PALETTE(config, m_palette, FUNC(contra_state::contra_palette)); + PALETTE(config, m_palette, FUNC(contra_state::palette)); m_palette->set_format(palette_device::xBGR_555, 2 * 8 * 16 * 16); m_palette->set_indirect_entries(128); m_palette->set_endianness(ENDIANNESS_LITTLE); - K007121(config, m_k007121_1, 0); - m_k007121_1->set_palette_tag(m_palette); - K007121(config, m_k007121_2, 0); - m_k007121_2->set_palette_tag(m_palette); + K007121(config, m_k007121[0], 0); + m_k007121[0]->set_palette_tag(m_palette); + K007121(config, m_k007121[1], 0); + m_k007121[1]->set_palette_tag(m_palette); - /* sound hardware */ + // sound hardware SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); @@ -252,70 +643,67 @@ ROM_START( contra ) - ROM_REGION( 0x30000, "maincpu", ROMREGION_ERASEFF ) /* 64k for code + 96k for banked ROMs */ - ROM_LOAD( "633m03.18a", 0x20000, 0x08000, CRC(d045e1da) SHA1(ec781e98a6efb14861223250c6239b06ec98ed0b) ) - ROM_CONTINUE( 0x08000, 0x08000 ) - ROM_LOAD( "633i02.17a", 0x10000, 0x10000, CRC(b2f7bd9a) SHA1(6c29568419bc49f0be3995b0c34edd9038f6f8d9) ) + ROM_REGION( 0x20000, "maincpu", ROMREGION_ERASEFF ) + ROM_LOAD( "633i02.17a", 0x00000, 0x10000, CRC(b2f7bd9a) SHA1(6c29568419bc49f0be3995b0c34edd9038f6f8d9) ) + ROM_LOAD( "633m03.18a", 0x10000, 0x10000, CRC(d045e1da) SHA1(ec781e98a6efb14861223250c6239b06ec98ed0b) ) - ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for SOUND code */ - ROM_LOAD( "633e01.12a", 0x08000, 0x08000, CRC(d1549255) SHA1(d700c7de36746ba247e3a5d0410b7aa036aa4073) ) + ROM_REGION( 0x8000, "audiocpu", 0 ) + ROM_LOAD( "633e01.12a", 0x0000, 0x8000, CRC(d1549255) SHA1(d700c7de36746ba247e3a5d0410b7aa036aa4073) ) - ROM_REGION( 0x80000, "gfx1", 0 ) + ROM_REGION( 0x80000, "k007121_1", 0 ) ROM_LOAD16_BYTE( "633e04.7d", 0x00000, 0x40000, CRC(14ddc542) SHA1(c7d8592672a6e50c2fe6b0670001c340022f16f9) ) ROM_LOAD16_BYTE( "633e05.7f", 0x00001, 0x40000, CRC(42185044) SHA1(a6e2598d766e6995c1a912e4a04987e6f4d547ff) ) - ROM_REGION( 0x80000, "gfx2", 0 ) + ROM_REGION( 0x80000, "k007121_2", 0 ) ROM_LOAD16_BYTE( "633e06.16d", 0x00000, 0x40000, CRC(9cf6faae) SHA1(9ab79c06cb541ce6fdac322886b8a14a2f3f5cf7) ) ROM_LOAD16_BYTE( "633e07.16f", 0x00001, 0x40000, CRC(f2d06638) SHA1(0fa0fbfc53ab5c31b9de22f90153d9af37ff22ce) ) ROM_REGION( 0x0500, "proms", 0 ) - ROM_LOAD( "633e08.10g", 0x0000, 0x0100, CRC(9f0949fa) SHA1(7c8fefdcae4523d008a7d39062194c7a80aa3500) ) /* 007121 #0 sprite lookup table */ - ROM_LOAD( "633e09.12g", 0x0100, 0x0100, CRC(14ca5e19) SHA1(eeee2f8b3d1e4acf47de1e74c4e507ff924591e7) ) /* 007121 #0 char lookup table */ - ROM_LOAD( "633f10.18g", 0x0200, 0x0100, CRC(2b244d84) SHA1(c3bde7afb501bae58d07721c637dc06938c22150) ) /* 007121 #1 sprite lookup table */ - ROM_LOAD( "633f11.20g", 0x0300, 0x0100, CRC(14ca5e19) SHA1(eeee2f8b3d1e4acf47de1e74c4e507ff924591e7) ) /* 007121 #1 char lookup table */ + ROM_LOAD( "633e08.10g", 0x0000, 0x0100, CRC(9f0949fa) SHA1(7c8fefdcae4523d008a7d39062194c7a80aa3500) ) // 007121 #0 sprite lookup table + ROM_LOAD( "633e09.12g", 0x0100, 0x0100, CRC(14ca5e19) SHA1(eeee2f8b3d1e4acf47de1e74c4e507ff924591e7) ) // 007121 #0 char lookup table + ROM_LOAD( "633f10.18g", 0x0200, 0x0100, CRC(2b244d84) SHA1(c3bde7afb501bae58d07721c637dc06938c22150) ) // 007121 #1 sprite lookup table + ROM_LOAD( "633f11.20g", 0x0300, 0x0100, CRC(14ca5e19) SHA1(eeee2f8b3d1e4acf47de1e74c4e507ff924591e7) ) // 007121 #1 char lookup table ROM_REGION( 0x0001, "pals", 0 ) - ROM_LOAD( "007766.20d.bin", 0x0000, 0x0001, NO_DUMP ) /* PAL16L8A-2CN */ + ROM_LOAD( "007766.20d.bin", 0x0000, 0x0001, NO_DUMP ) // PAL16L8A-2CN ROM_END ROM_START( contra1 ) - ROM_REGION( 0x30000, "maincpu", ROMREGION_ERASEFF ) /* 64k for code + 96k for banked ROMs */ - ROM_LOAD( "633i03.18a", 0x20000, 0x08000, CRC(7fc0d8cf) SHA1(cf1cf15646a4e5dc72671e957bc51ca44d30995c) ) - ROM_CONTINUE( 0x08000, 0x08000 ) - ROM_LOAD( "633i02.17a", 0x10000, 0x10000, CRC(b2f7bd9a) SHA1(6c29568419bc49f0be3995b0c34edd9038f6f8d9) ) + ROM_REGION( 0x20000, "maincpu", ROMREGION_ERASEFF ) + ROM_LOAD( "633i02.17a", 0x00000, 0x10000, CRC(b2f7bd9a) SHA1(6c29568419bc49f0be3995b0c34edd9038f6f8d9) ) + ROM_LOAD( "633i03.18a", 0x10000, 0x10000, CRC(7fc0d8cf) SHA1(cf1cf15646a4e5dc72671e957bc51ca44d30995c) ) - ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for SOUND code */ - ROM_LOAD( "633e01.12a", 0x08000, 0x08000, CRC(d1549255) SHA1(d700c7de36746ba247e3a5d0410b7aa036aa4073) ) + ROM_REGION( 0x8000, "audiocpu", 0 ) + ROM_LOAD( "633e01.12a", 0x0000, 0x8000, CRC(d1549255) SHA1(d700c7de36746ba247e3a5d0410b7aa036aa4073) ) - ROM_REGION( 0x80000, "gfx1", 0 ) + ROM_REGION( 0x80000, "k007121_1", 0 ) ROM_LOAD16_BYTE( "633e04.7d", 0x00000, 0x40000, CRC(14ddc542) SHA1(c7d8592672a6e50c2fe6b0670001c340022f16f9) ) ROM_LOAD16_BYTE( "633e05.7f", 0x00001, 0x40000, CRC(42185044) SHA1(a6e2598d766e6995c1a912e4a04987e6f4d547ff) ) - ROM_REGION( 0x80000, "gfx2", 0 ) + ROM_REGION( 0x80000, "k007121_2", 0 ) ROM_LOAD16_BYTE( "633e06.16d", 0x00000, 0x40000, CRC(9cf6faae) SHA1(9ab79c06cb541ce6fdac322886b8a14a2f3f5cf7) ) ROM_LOAD16_BYTE( "633e07.16f", 0x00001, 0x40000, CRC(f2d06638) SHA1(0fa0fbfc53ab5c31b9de22f90153d9af37ff22ce) ) ROM_REGION( 0x0400, "proms", 0 ) - ROM_LOAD( "633e08.10g", 0x0000, 0x0100, CRC(9f0949fa) SHA1(7c8fefdcae4523d008a7d39062194c7a80aa3500) ) /* 007121 #0 sprite lookup table */ - ROM_LOAD( "633e09.12g", 0x0100, 0x0100, CRC(14ca5e19) SHA1(eeee2f8b3d1e4acf47de1e74c4e507ff924591e7) ) /* 007121 #0 char lookup table */ - ROM_LOAD( "633f10.18g", 0x0200, 0x0100, CRC(2b244d84) SHA1(c3bde7afb501bae58d07721c637dc06938c22150) ) /* 007121 #1 sprite lookup table */ - ROM_LOAD( "633f11.20g", 0x0300, 0x0100, CRC(14ca5e19) SHA1(eeee2f8b3d1e4acf47de1e74c4e507ff924591e7) ) /* 007121 #1 char lookup table */ + ROM_LOAD( "633e08.10g", 0x0000, 0x0100, CRC(9f0949fa) SHA1(7c8fefdcae4523d008a7d39062194c7a80aa3500) ) // 007121 #0 sprite lookup table + ROM_LOAD( "633e09.12g", 0x0100, 0x0100, CRC(14ca5e19) SHA1(eeee2f8b3d1e4acf47de1e74c4e507ff924591e7) ) // 007121 #0 char lookup table + ROM_LOAD( "633f10.18g", 0x0200, 0x0100, CRC(2b244d84) SHA1(c3bde7afb501bae58d07721c637dc06938c22150) ) // 007121 #1 sprite lookup table + ROM_LOAD( "633f11.20g", 0x0300, 0x0100, CRC(14ca5e19) SHA1(eeee2f8b3d1e4acf47de1e74c4e507ff924591e7) ) // 007121 #1 char lookup table ROM_REGION( 0x0001, "pals", 0 ) - ROM_LOAD( "007766.20d.bin", 0x0000, 0x0001, NO_DUMP ) /* PAL16L8A-2CN */ + ROM_LOAD( "007766.20d.bin", 0x0000, 0x0001, NO_DUMP ) // PAL16L8A-2CN ROM_END ROM_START( contrae ) - ROM_REGION( 0x30000, "maincpu", ROMREGION_ERASEFF ) /* 64k for code + 96k for banked ROMs */ - ROM_LOAD( "633_e03.18a", 0x20000, 0x08000, CRC(7ebdb314) SHA1(b42c032cce7ae0c9b3eea6a41b7ffa5cb7fced5d) ) - ROM_CONTINUE( 0x08000, 0x08000 ) - ROM_LOAD( "633_e02.17a", 0x10000, 0x10000, CRC(9d5ebe66) SHA1(5218426e1494b4f6dec667f1ade7ada13aa04f2b) ) + ROM_REGION( 0x20000, "maincpu", ROMREGION_ERASEFF ) + ROM_LOAD( "633_e02.17a", 0x00000, 0x10000, CRC(9d5ebe66) SHA1(5218426e1494b4f6dec667f1ade7ada13aa04f2b) ) + ROM_LOAD( "633_e03.18a", 0x10000, 0x10000, CRC(7ebdb314) SHA1(b42c032cce7ae0c9b3eea6a41b7ffa5cb7fced5d) ) - ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for SOUND code */ - ROM_LOAD( "633e01.12a", 0x08000, 0x08000, CRC(d1549255) SHA1(d700c7de36746ba247e3a5d0410b7aa036aa4073) ) + ROM_REGION( 0x8000, "audiocpu", 0 ) + ROM_LOAD( "633e01.12a", 0x000, 0x8000, CRC(d1549255) SHA1(d700c7de36746ba247e3a5d0410b7aa036aa4073) ) - // this PCB used official Konami riser-boards in place of the mask roms - ROM_REGION( 0x80000, "gfx1", 0 ) + // this PCB used official Konami riser-boards in place of the mask ROMs + ROM_REGION( 0x80000, "k007121_1", 0 ) ROM_LOAD16_BYTE( "633_e04_a.7d", 0x00000, 0x10000, CRC(e027f330) SHA1(e3480c0ed9f5ed5df829e66eb72e01ea39d5fca3) ) ROM_LOAD16_BYTE( "633_e04_b.7d", 0x20000, 0x10000, CRC(a71230f5) SHA1(c2c92b42a04adbb4c7ba3d4632b9a9db0555840e) ) ROM_LOAD16_BYTE( "633_e04_c.7d", 0x40000, 0x10000, CRC(0b103d01) SHA1(95e7feb7103d71b43ba921b7a376a2faf642621b) ) @@ -325,7 +713,7 @@ ROM_LOAD16_BYTE( "633_e05_c.7f", 0x40001, 0x10000, CRC(acba86bf) SHA1(c248c837b1f8093bcaf465b0c75b67f1f67a3f61) ) ROM_LOAD16_BYTE( "633_e05_d.7f", 0x60001, 0x10000, CRC(59cf234d) SHA1(4a6bb30789e581c0600c55d8e8fba778e30ba299) ) - ROM_REGION( 0x80000, "gfx2", 0 ) + ROM_REGION( 0x80000, "k007121_2", 0 ) ROM_LOAD16_BYTE( "633_e06_a.16d", 0x00000, 0x10000, CRC(030079c5) SHA1(3f93e05e9df0a9dde570b771e04b719cf0ace967) ) ROM_LOAD16_BYTE( "633_e06_b.16d", 0x20000, 0x10000, CRC(e17d5807) SHA1(15ebbf62d026cc8ac75c9877304458cbc0c5d5e0) ) ROM_LOAD16_BYTE( "633_e06_c.16d", 0x40000, 0x10000, CRC(7d6a28cd) SHA1(9fbbe0460406bb8b3e2e572c4d5a2f8be4ba9c2e) ) @@ -336,136 +724,131 @@ ROM_LOAD16_BYTE( "633_e07_d.16f", 0x60001, 0x10000, CRC(cfab0988) SHA1(3961bcbc3093b787211ab2815914f90a89df78b1) ) ROM_REGION( 0x0500, "proms", 0 ) - ROM_LOAD( "633e08.10g", 0x0000, 0x0100, CRC(9f0949fa) SHA1(7c8fefdcae4523d008a7d39062194c7a80aa3500) ) /* 007121 #0 sprite lookup table */ - ROM_LOAD( "633e09.12g", 0x0100, 0x0100, CRC(14ca5e19) SHA1(eeee2f8b3d1e4acf47de1e74c4e507ff924591e7) ) /* 007121 #0 char lookup table */ - ROM_LOAD( "633e10.18g", 0x0200, 0x0100, CRC(e782c494) SHA1(9459e721a4361fc4fbace3a017211f0199dee24d) ) /* 007121 #1 sprite lookup table */ // earlier rev - ROM_LOAD( "633e11.20g", 0x0300, 0x0100, CRC(14ca5e19) SHA1(eeee2f8b3d1e4acf47de1e74c4e507ff924591e7) ) /* 007121 #1 char lookup table */ + ROM_LOAD( "633e08.10g", 0x0000, 0x0100, CRC(9f0949fa) SHA1(7c8fefdcae4523d008a7d39062194c7a80aa3500) ) // 007121 #0 sprite lookup table + ROM_LOAD( "633e09.12g", 0x0100, 0x0100, CRC(14ca5e19) SHA1(eeee2f8b3d1e4acf47de1e74c4e507ff924591e7) ) // 007121 #0 char lookup table + ROM_LOAD( "633e10.18g", 0x0200, 0x0100, CRC(e782c494) SHA1(9459e721a4361fc4fbace3a017211f0199dee24d) ) // 007121 #1 sprite lookup table // earlier rev + ROM_LOAD( "633e11.20g", 0x0300, 0x0100, CRC(14ca5e19) SHA1(eeee2f8b3d1e4acf47de1e74c4e507ff924591e7) ) // 007121 #1 char lookup table ROM_REGION( 0x0001, "pals", 0 ) - ROM_LOAD( "007766.20d.bin", 0x0000, 0x0001, NO_DUMP ) /* PAL16L8A-2CN */ + ROM_LOAD( "007766.20d.bin", 0x0000, 0x0001, NO_DUMP ) // PAL16L8A-2CN ROM_END ROM_START( contraj ) - ROM_REGION( 0x30000, "maincpu", ROMREGION_ERASEFF ) /* 64k for code + 96k for banked ROMs */ - ROM_LOAD( "633n03.18a", 0x20000, 0x08000, CRC(fedab568) SHA1(7fd4546335bdeef7f8326d4cbde7fa36d74e5cfc) ) - ROM_CONTINUE( 0x08000, 0x08000 ) - ROM_LOAD( "633k02.17a", 0x10000, 0x10000, CRC(5d5f7438) SHA1(489fe56ca57ef4f6a7792fba07a9656009f3f285) ) + ROM_REGION( 0x20000, "maincpu", ROMREGION_ERASEFF ) + ROM_LOAD( "633k02.17a", 0x00000, 0x10000, CRC(5d5f7438) SHA1(489fe56ca57ef4f6a7792fba07a9656009f3f285) ) + ROM_LOAD( "633n03.18a", 0x10000, 0x10000, CRC(fedab568) SHA1(7fd4546335bdeef7f8326d4cbde7fa36d74e5cfc) ) - ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for SOUND code */ - ROM_LOAD( "633e01.12a", 0x08000, 0x08000, CRC(d1549255) SHA1(d700c7de36746ba247e3a5d0410b7aa036aa4073) ) + ROM_REGION( 0x8000, "audiocpu", 0 ) + ROM_LOAD( "633e01.12a", 0x0000, 0x8000, CRC(d1549255) SHA1(d700c7de36746ba247e3a5d0410b7aa036aa4073) ) - ROM_REGION( 0x80000, "gfx1", 0 ) + ROM_REGION( 0x80000, "k007121_1", 0 ) ROM_LOAD16_BYTE( "633e04.7d", 0x00000, 0x40000, CRC(14ddc542) SHA1(c7d8592672a6e50c2fe6b0670001c340022f16f9) ) ROM_LOAD16_BYTE( "633e05.7f", 0x00001, 0x40000, CRC(42185044) SHA1(a6e2598d766e6995c1a912e4a04987e6f4d547ff) ) - ROM_REGION( 0x80000, "gfx2", 0 ) + ROM_REGION( 0x80000, "k007121_2", 0 ) ROM_LOAD16_BYTE( "633e06.16d", 0x00000, 0x40000, CRC(9cf6faae) SHA1(9ab79c06cb541ce6fdac322886b8a14a2f3f5cf7) ) ROM_LOAD16_BYTE( "633e07.16f", 0x00001, 0x40000, CRC(f2d06638) SHA1(0fa0fbfc53ab5c31b9de22f90153d9af37ff22ce) ) ROM_REGION( 0x0400, "proms", 0 ) - ROM_LOAD( "633e08.10g", 0x0000, 0x0100, CRC(9f0949fa) SHA1(7c8fefdcae4523d008a7d39062194c7a80aa3500) ) /* 007121 #0 sprite lookup table */ - ROM_LOAD( "633e09.12g", 0x0100, 0x0100, CRC(14ca5e19) SHA1(eeee2f8b3d1e4acf47de1e74c4e507ff924591e7) ) /* 007121 #0 char lookup table */ - ROM_LOAD( "633f10.18g", 0x0200, 0x0100, CRC(2b244d84) SHA1(c3bde7afb501bae58d07721c637dc06938c22150) ) /* 007121 #1 sprite lookup table */ - ROM_LOAD( "633f11.20g", 0x0300, 0x0100, CRC(14ca5e19) SHA1(eeee2f8b3d1e4acf47de1e74c4e507ff924591e7) ) /* 007121 #1 char lookup table */ + ROM_LOAD( "633e08.10g", 0x0000, 0x0100, CRC(9f0949fa) SHA1(7c8fefdcae4523d008a7d39062194c7a80aa3500) ) // 007121 #0 sprite lookup table + ROM_LOAD( "633e09.12g", 0x0100, 0x0100, CRC(14ca5e19) SHA1(eeee2f8b3d1e4acf47de1e74c4e507ff924591e7) ) // 007121 #0 char lookup table + ROM_LOAD( "633f10.18g", 0x0200, 0x0100, CRC(2b244d84) SHA1(c3bde7afb501bae58d07721c637dc06938c22150) ) // 007121 #1 sprite lookup table + ROM_LOAD( "633f11.20g", 0x0300, 0x0100, CRC(14ca5e19) SHA1(eeee2f8b3d1e4acf47de1e74c4e507ff924591e7) ) // 007121 #1 char lookup table ROM_REGION( 0x0001, "pals", 0 ) - ROM_LOAD( "007766.20d.bin", 0x0000, 0x0001, NO_DUMP ) /* PAL16L8A-2CN */ + ROM_LOAD( "007766.20d.bin", 0x0000, 0x0001, NO_DUMP ) // PAL16L8A-2CN ROM_END ROM_START( contraj1 ) - ROM_REGION( 0x30000, "maincpu", ROMREGION_ERASEFF ) /* 64k for code + 96k for banked ROMs */ - ROM_LOAD( "633k03.18a", 0x20000, 0x08000, CRC(bdb9196d) SHA1(fad170e8fda94c9c9d7b82433daa30b80af12efc) ) - ROM_CONTINUE( 0x08000, 0x08000 ) - ROM_LOAD( "633k02.17a", 0x10000, 0x10000, CRC(5d5f7438) SHA1(489fe56ca57ef4f6a7792fba07a9656009f3f285) ) + ROM_REGION( 0x20000, "maincpu", ROMREGION_ERASEFF ) + ROM_LOAD( "633k02.17a", 0x00000, 0x10000, CRC(5d5f7438) SHA1(489fe56ca57ef4f6a7792fba07a9656009f3f285) ) + ROM_LOAD( "633k03.18a", 0x10000, 0x10000, CRC(bdb9196d) SHA1(fad170e8fda94c9c9d7b82433daa30b80af12efc) ) - ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for SOUND code */ - ROM_LOAD( "633e01.12a", 0x08000, 0x08000, CRC(d1549255) SHA1(d700c7de36746ba247e3a5d0410b7aa036aa4073) ) + ROM_REGION( 0x8000, "audiocpu", 0 ) + ROM_LOAD( "633e01.12a", 0x0000, 0x8000, CRC(d1549255) SHA1(d700c7de36746ba247e3a5d0410b7aa036aa4073) ) - ROM_REGION( 0x80000, "gfx1", 0 ) + ROM_REGION( 0x80000, "k007121_1", 0 ) ROM_LOAD16_BYTE( "633e04.7d", 0x00000, 0x40000, CRC(14ddc542) SHA1(c7d8592672a6e50c2fe6b0670001c340022f16f9) ) ROM_LOAD16_BYTE( "633e05.7f", 0x00001, 0x40000, CRC(42185044) SHA1(a6e2598d766e6995c1a912e4a04987e6f4d547ff) ) - ROM_REGION( 0x80000, "gfx2", 0 ) + ROM_REGION( 0x80000, "k007121_2", 0 ) ROM_LOAD16_BYTE( "633e06.16d", 0x00000, 0x40000, CRC(9cf6faae) SHA1(9ab79c06cb541ce6fdac322886b8a14a2f3f5cf7) ) ROM_LOAD16_BYTE( "633e07.16f", 0x00001, 0x40000, CRC(f2d06638) SHA1(0fa0fbfc53ab5c31b9de22f90153d9af37ff22ce) ) ROM_REGION( 0x0400, "proms", 0 ) - ROM_LOAD( "633e08.10g", 0x0000, 0x0100, CRC(9f0949fa) SHA1(7c8fefdcae4523d008a7d39062194c7a80aa3500) ) /* 007121 #0 sprite lookup table */ - ROM_LOAD( "633e09.12g", 0x0100, 0x0100, CRC(14ca5e19) SHA1(eeee2f8b3d1e4acf47de1e74c4e507ff924591e7) ) /* 007121 #0 char lookup table */ - ROM_LOAD( "633f10.18g", 0x0200, 0x0100, CRC(2b244d84) SHA1(c3bde7afb501bae58d07721c637dc06938c22150) ) /* 007121 #1 sprite lookup table */ - ROM_LOAD( "633f11.20g", 0x0300, 0x0100, CRC(14ca5e19) SHA1(eeee2f8b3d1e4acf47de1e74c4e507ff924591e7) ) /* 007121 #1 char lookup table */ + ROM_LOAD( "633e08.10g", 0x0000, 0x0100, CRC(9f0949fa) SHA1(7c8fefdcae4523d008a7d39062194c7a80aa3500) ) // 007121 #0 sprite lookup table + ROM_LOAD( "633e09.12g", 0x0100, 0x0100, CRC(14ca5e19) SHA1(eeee2f8b3d1e4acf47de1e74c4e507ff924591e7) ) // 007121 #0 char lookup table + ROM_LOAD( "633f10.18g", 0x0200, 0x0100, CRC(2b244d84) SHA1(c3bde7afb501bae58d07721c637dc06938c22150) ) // 007121 #1 sprite lookup table + ROM_LOAD( "633f11.20g", 0x0300, 0x0100, CRC(14ca5e19) SHA1(eeee2f8b3d1e4acf47de1e74c4e507ff924591e7) ) // 007121 #1 char lookup table ROM_REGION( 0x0001, "pals", 0 ) - ROM_LOAD( "007766.20d.bin", 0x0000, 0x0001, NO_DUMP ) /* PAL16L8A-2CN */ + ROM_LOAD( "007766.20d.bin", 0x0000, 0x0001, NO_DUMP ) // PAL16L8A-2CN ROM_END ROM_START( gryzor ) - ROM_REGION( 0x30000, "maincpu", ROMREGION_ERASEFF ) /* 64k for code + 96k for banked ROMs */ - ROM_LOAD( "633j03.18a", 0x20000, 0x08000, CRC(20919162) SHA1(2f375166428ee03f6e8ac0372a373bb8ab35e64c) ) - ROM_CONTINUE( 0x08000, 0x08000 ) - ROM_LOAD( "633j02.17a", 0x10000, 0x10000, CRC(b5922f9a) SHA1(441a23dc99a908ec2c09c855e73070dbab8c5ae2) ) + ROM_REGION( 0x20000, "maincpu", ROMREGION_ERASEFF ) + ROM_LOAD( "633j02.17a", 0x00000, 0x10000, CRC(b5922f9a) SHA1(441a23dc99a908ec2c09c855e73070dbab8c5ae2) ) + ROM_LOAD( "633j03.18a", 0x10000, 0x10000, CRC(20919162) SHA1(2f375166428ee03f6e8ac0372a373bb8ab35e64c) ) - ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for SOUND code */ - ROM_LOAD( "633e01.12a", 0x08000, 0x08000, CRC(d1549255) SHA1(d700c7de36746ba247e3a5d0410b7aa036aa4073) ) + ROM_REGION( 0x8000, "audiocpu", 0 ) + ROM_LOAD( "633e01.12a", 0x0000, 0x8000, CRC(d1549255) SHA1(d700c7de36746ba247e3a5d0410b7aa036aa4073) ) - ROM_REGION( 0x80000, "gfx1", 0 ) + ROM_REGION( 0x80000, "k007121_1", 0 ) ROM_LOAD16_BYTE( "633e04.7d", 0x00000, 0x40000, CRC(14ddc542) SHA1(c7d8592672a6e50c2fe6b0670001c340022f16f9) ) ROM_LOAD16_BYTE( "633e05.7f", 0x00001, 0x40000, CRC(42185044) SHA1(a6e2598d766e6995c1a912e4a04987e6f4d547ff) ) - ROM_REGION( 0x80000, "gfx2", 0 ) + ROM_REGION( 0x80000, "k007121_2", 0 ) ROM_LOAD16_BYTE( "633e06.16d", 0x00000, 0x40000, CRC(9cf6faae) SHA1(9ab79c06cb541ce6fdac322886b8a14a2f3f5cf7) ) ROM_LOAD16_BYTE( "633e07.16f", 0x00001, 0x40000, CRC(f2d06638) SHA1(0fa0fbfc53ab5c31b9de22f90153d9af37ff22ce) ) ROM_REGION( 0x0400, "proms", 0 ) - ROM_LOAD( "633e08.10g", 0x0000, 0x0100, CRC(9f0949fa) SHA1(7c8fefdcae4523d008a7d39062194c7a80aa3500) ) /* 007121 #0 sprite lookup table */ - ROM_LOAD( "633e09.12g", 0x0100, 0x0100, CRC(14ca5e19) SHA1(eeee2f8b3d1e4acf47de1e74c4e507ff924591e7) ) /* 007121 #0 char lookup table */ - ROM_LOAD( "633f10.18g", 0x0200, 0x0100, CRC(2b244d84) SHA1(c3bde7afb501bae58d07721c637dc06938c22150) ) /* 007121 #1 sprite lookup table */ - ROM_LOAD( "633f11.20g", 0x0300, 0x0100, CRC(14ca5e19) SHA1(eeee2f8b3d1e4acf47de1e74c4e507ff924591e7) ) /* 007121 #1 char lookup table */ + ROM_LOAD( "633e08.10g", 0x0000, 0x0100, CRC(9f0949fa) SHA1(7c8fefdcae4523d008a7d39062194c7a80aa3500) ) // 007121 #0 sprite lookup table + ROM_LOAD( "633e09.12g", 0x0100, 0x0100, CRC(14ca5e19) SHA1(eeee2f8b3d1e4acf47de1e74c4e507ff924591e7) ) // 007121 #0 char lookup table + ROM_LOAD( "633f10.18g", 0x0200, 0x0100, CRC(2b244d84) SHA1(c3bde7afb501bae58d07721c637dc06938c22150) ) // 007121 #1 sprite lookup table + ROM_LOAD( "633f11.20g", 0x0300, 0x0100, CRC(14ca5e19) SHA1(eeee2f8b3d1e4acf47de1e74c4e507ff924591e7) ) // 007121 #1 char lookup table ROM_REGION( 0x0001, "pals", 0 ) - ROM_LOAD( "007766.20d.bin", 0x0000, 0x0001, NO_DUMP ) /* PAL16L8A-2CN */ + ROM_LOAD( "007766.20d.bin", 0x0000, 0x0001, NO_DUMP ) // PAL16L8A-2CN ROM_END ROM_START( gryzor1 ) - ROM_REGION( 0x30000, "maincpu", ROMREGION_ERASEFF ) /* 64k for code + 96k for banked ROMs */ - ROM_LOAD( "633g2.18a", 0x20000, 0x08000, CRC(92ca77bd) SHA1(3a56f51a617edff9f2a60df0141dff040881b82a) ) - ROM_CONTINUE( 0x08000, 0x08000 ) - ROM_LOAD( "633g3.17a", 0x10000, 0x10000, CRC(bbd9e95e) SHA1(fd5de1bcc485de7b8fc2e321351c2e3ddd25d053) ) + ROM_REGION( 0x20000, "maincpu", ROMREGION_ERASEFF ) + ROM_LOAD( "633g3.17a", 0x00000, 0x10000, CRC(bbd9e95e) SHA1(fd5de1bcc485de7b8fc2e321351c2e3ddd25d053) ) + ROM_LOAD( "633g2.18a", 0x10000, 0x10000, CRC(92ca77bd) SHA1(3a56f51a617edff9f2a60df0141dff040881b82a) ) - ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for SOUND code */ - ROM_LOAD( "633e01.12a", 0x08000, 0x08000, CRC(d1549255) SHA1(d700c7de36746ba247e3a5d0410b7aa036aa4073) ) + ROM_REGION( 0x8000, "audiocpu", 0 ) + ROM_LOAD( "633e01.12a", 0x0000, 0x8000, CRC(d1549255) SHA1(d700c7de36746ba247e3a5d0410b7aa036aa4073) ) - ROM_REGION( 0x80000, "gfx1", 0 ) + ROM_REGION( 0x80000, "k007121_1", 0 ) ROM_LOAD16_BYTE( "633e04.7d", 0x00000, 0x40000, CRC(14ddc542) SHA1(c7d8592672a6e50c2fe6b0670001c340022f16f9) ) ROM_LOAD16_BYTE( "633e05.7f", 0x00001, 0x40000, CRC(42185044) SHA1(a6e2598d766e6995c1a912e4a04987e6f4d547ff) ) - ROM_REGION( 0x80000, "gfx2", 0 ) + ROM_REGION( 0x80000, "k007121_2", 0 ) ROM_LOAD16_BYTE( "633e06.16d", 0x00000, 0x40000, CRC(9cf6faae) SHA1(9ab79c06cb541ce6fdac322886b8a14a2f3f5cf7) ) ROM_LOAD16_BYTE( "633e07.16f", 0x00001, 0x40000, CRC(f2d06638) SHA1(0fa0fbfc53ab5c31b9de22f90153d9af37ff22ce) ) ROM_REGION( 0x0400, "proms", 0 ) - ROM_LOAD( "633e08.10g", 0x0000, 0x0100, CRC(9f0949fa) SHA1(7c8fefdcae4523d008a7d39062194c7a80aa3500) ) /* 007121 #0 sprite lookup table */ - ROM_LOAD( "633e09.12g", 0x0100, 0x0100, CRC(14ca5e19) SHA1(eeee2f8b3d1e4acf47de1e74c4e507ff924591e7) ) /* 007121 #0 char lookup table */ - ROM_LOAD( "633f10.18g", 0x0200, 0x0100, CRC(2b244d84) SHA1(c3bde7afb501bae58d07721c637dc06938c22150) ) /* 007121 #1 sprite lookup table */ - ROM_LOAD( "633f11.20g", 0x0300, 0x0100, CRC(14ca5e19) SHA1(eeee2f8b3d1e4acf47de1e74c4e507ff924591e7) ) /* 007121 #1 char lookup table */ + ROM_LOAD( "633e08.10g", 0x0000, 0x0100, CRC(9f0949fa) SHA1(7c8fefdcae4523d008a7d39062194c7a80aa3500) ) // 007121 #0 sprite lookup table + ROM_LOAD( "633e09.12g", 0x0100, 0x0100, CRC(14ca5e19) SHA1(eeee2f8b3d1e4acf47de1e74c4e507ff924591e7) ) // 007121 #0 char lookup table + ROM_LOAD( "633f10.18g", 0x0200, 0x0100, CRC(2b244d84) SHA1(c3bde7afb501bae58d07721c637dc06938c22150) ) // 007121 #1 sprite lookup table + ROM_LOAD( "633f11.20g", 0x0300, 0x0100, CRC(14ca5e19) SHA1(eeee2f8b3d1e4acf47de1e74c4e507ff924591e7) ) // 007121 #1 char lookup table ROM_REGION( 0x0001, "pals", 0 ) - ROM_LOAD( "007766.20d.bin", 0x0000, 0x0001, NO_DUMP ) /* PAL16L8A-2CN */ + ROM_LOAD( "007766.20d.bin", 0x0000, 0x0001, NO_DUMP ) // PAL16L8A-2CN ROM_END -/* Bootlegs */ +// Bootlegs ROM_START( contrab ) - ROM_REGION( 0x30000, "maincpu", ROMREGION_ERASEFF ) /* 64k for code + 96k for banked ROMs */ - ROM_LOAD( "3.ic20", 0x20000, 0x08000, CRC(d045e1da) SHA1(ec781e98a6efb14861223250c6239b06ec98ed0b) ) /* == 633m03.18a */ - ROM_CONTINUE( 0x08000, 0x08000 ) - ROM_LOAD( "1.ic19", 0x10000, 0x10000, CRC(b2f7bd9a) SHA1(6c29568419bc49f0be3995b0c34edd9038f6f8d9) ) /* == 633i03.18a */ + ROM_REGION( 0x20000, "maincpu", ROMREGION_ERASEFF ) + ROM_LOAD( "1.ic19", 0x00000, 0x10000, CRC(b2f7bd9a) SHA1(6c29568419bc49f0be3995b0c34edd9038f6f8d9) ) // == 633i03.18a + ROM_LOAD( "3.ic20", 0x10000, 0x10000, CRC(d045e1da) SHA1(ec781e98a6efb14861223250c6239b06ec98ed0b) ) // == 633m03.18a - ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for SOUND code */ - ROM_LOAD( "3.ic63", 0x08000, 0x08000, CRC(d1549255) SHA1(d700c7de36746ba247e3a5d0410b7aa036aa4073) ) /* == 633k01.12a */ + ROM_REGION( 0x8000, "audiocpu", 0 ) + ROM_LOAD( "3.ic63", 0x0000, 0x8000, CRC(d1549255) SHA1(d700c7de36746ba247e3a5d0410b7aa036aa4073) ) // == 633k01.12a - ROM_REGION( 0x80000, "gfx1", 0 ) - /* bootleg versions use smaller gfx ROMs, but the data is the same */ + ROM_REGION( 0x80000, "k007121_1", 0 ) + // bootleg versions use smaller gfx ROMs, but the data is the same ROM_LOAD( "7.rom", 0x00000, 0x10000, CRC(57f467d2) SHA1(e30be315980f421143d1357174af678362836285) ) ROM_LOAD( "10.rom", 0x10000, 0x10000, CRC(e6db9685) SHA1(4d5ccfe95b082fe9830e7a316f88fd6f02464900) ) ROM_LOAD( "9.rom", 0x20000, 0x10000, CRC(875c61de) SHA1(e8dc42fef810a9f5471d96cb5297eb29296ba472) ) @@ -475,8 +858,8 @@ ROM_LOAD( "17.rom", 0x60000, 0x10000, CRC(ce4330b9) SHA1(0a2bd31baa0bc5e3745ee5ddac995557a551d58c) ) ROM_LOAD( "18.rom", 0x70000, 0x10000, CRC(1571ce42) SHA1(04082ed78b5e7f20b99d6edfb6c363574abd6158) ) - ROM_REGION( 0x80000, "gfx2", 0 ) - /* bootleg versions use smaller gfx ROMs, but the data is the same */ + ROM_REGION( 0x80000, "k007121_2", 0 ) + // bootleg versions use smaller gfx ROMs, but the data is the same ROM_LOAD( "4.rom", 0x00000, 0x10000, CRC(2cc7e52c) SHA1(7598a63346bf06dd34fd643fdff53fc3de6768a6) ) ROM_LOAD( "5.rom", 0x10000, 0x10000, CRC(e01a5b9c) SHA1(58c99cf99f209c584da757320a2f107244056d4c) ) ROM_LOAD( "6.rom", 0x20000, 0x10000, CRC(aeea6744) SHA1(220b42f707db99967bdcbd9ac66fcc83675a72aa) ) @@ -484,27 +867,26 @@ ROM_LOAD( "11.rom", 0x40000, 0x10000, CRC(bd9ba92c) SHA1(e7f65ed20cd7754cc476e8fab7e56105cedcdb98) ) ROM_LOAD( "12.rom", 0x50000, 0x10000, CRC(d0be7ec2) SHA1(5aa829b8ffbe3f5f92ba672b1c24bfb7836ba1a3) ) ROM_LOAD( "13.rom", 0x60000, 0x10000, CRC(2b513d12) SHA1(152ebd849751cc2e95513134ce773a6b2eeb320e) ) - /* This last section, 0x70000-0x7ffff is empty */ + // This last section, 0x70000-0x7ffff is empty ROM_REGION( 0x0500, "proms", 0 ) - ROM_LOAD( "633e08.10g", 0x0000, 0x0100, CRC(9f0949fa) SHA1(7c8fefdcae4523d008a7d39062194c7a80aa3500) ) /* 007121 #0 sprite lookup table */ - ROM_LOAD( "633e09.12g", 0x0100, 0x0100, CRC(14ca5e19) SHA1(eeee2f8b3d1e4acf47de1e74c4e507ff924591e7) ) /* 007121 #0 char lookup table */ - ROM_LOAD( "633f10.18g", 0x0200, 0x0100, CRC(2b244d84) SHA1(c3bde7afb501bae58d07721c637dc06938c22150) ) /* 007121 #1 sprite lookup table */ - ROM_LOAD( "633f11.20g", 0x0300, 0x0100, CRC(14ca5e19) SHA1(eeee2f8b3d1e4acf47de1e74c4e507ff924591e7) ) /* 007121 #1 char lookup table */ - ROM_LOAD( "conprom.53", 0x0400, 0x0100, CRC(05a1da7e) SHA1(ec0bdfc9da05c99e6a283014769db6d641f1a0aa) ) /* unknown (only present in this bootleg) */ + ROM_LOAD( "633e08.10g", 0x0000, 0x0100, CRC(9f0949fa) SHA1(7c8fefdcae4523d008a7d39062194c7a80aa3500) ) // 007121 #0 sprite lookup table + ROM_LOAD( "633e09.12g", 0x0100, 0x0100, CRC(14ca5e19) SHA1(eeee2f8b3d1e4acf47de1e74c4e507ff924591e7) ) // 007121 #0 char lookup table + ROM_LOAD( "633f10.18g", 0x0200, 0x0100, CRC(2b244d84) SHA1(c3bde7afb501bae58d07721c637dc06938c22150) ) // 007121 #1 sprite lookup table + ROM_LOAD( "633f11.20g", 0x0300, 0x0100, CRC(14ca5e19) SHA1(eeee2f8b3d1e4acf47de1e74c4e507ff924591e7) ) // 007121 #1 char lookup table + ROM_LOAD( "conprom.53", 0x0400, 0x0100, CRC(05a1da7e) SHA1(ec0bdfc9da05c99e6a283014769db6d641f1a0aa) ) // unknown (only present in this bootleg) ROM_END ROM_START( contrabj ) - ROM_REGION( 0x30000, "maincpu", ROMREGION_ERASEFF ) /* 64k for code + 96k for banked ROMs */ - ROM_LOAD( "2.2k", 0x20000, 0x08000, CRC(fedab568) SHA1(7fd4546335bdeef7f8326d4cbde7fa36d74e5cfc) ) /* == 633n03.18a */ - ROM_CONTINUE( 0x08000, 0x08000 ) - ROM_LOAD( "1.2h", 0x10000, 0x10000, CRC(5d5f7438) SHA1(489fe56ca57ef4f6a7792fba07a9656009f3f285) ) /* == 633k02.17a */ + ROM_REGION( 0x20000, "maincpu", ROMREGION_ERASEFF ) + ROM_LOAD( "1.2h", 0x00000, 0x10000, CRC(5d5f7438) SHA1(489fe56ca57ef4f6a7792fba07a9656009f3f285) ) // == 633k02.17a + ROM_LOAD( "2.2k", 0x10000, 0x10000, CRC(fedab568) SHA1(7fd4546335bdeef7f8326d4cbde7fa36d74e5cfc) ) // == 633n03.18a - ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for SOUND code */ - ROM_LOAD( "a3.4p", 0x08000, 0x08000, CRC(d1549255) SHA1(d700c7de36746ba247e3a5d0410b7aa036aa4073) ) /* == 633k01.12a */ + ROM_REGION( 0x8000, "audiocpu", 0 ) + ROM_LOAD( "a3.4p", 0x0000, 0x8000, CRC(d1549255) SHA1(d700c7de36746ba247e3a5d0410b7aa036aa4073) ) // == 633k01.12a - ROM_REGION( 0x80000, "gfx1", 0 ) - /* bootleg versions use smaller gfx ROMs, but the data is the same */ + ROM_REGION( 0x80000, "k007121_1", 0 ) + // bootleg versions use smaller gfx ROMs, but the data is the same ROM_LOAD( "a7.14f", 0x00000, 0x10000, CRC(57f467d2) SHA1(e30be315980f421143d1357174af678362836285) ) ROM_LOAD( "a10.14l", 0x10000, 0x10000, CRC(e6db9685) SHA1(4d5ccfe95b082fe9830e7a316f88fd6f02464900) ) ROM_LOAD( "a9.14k", 0x20000, 0x10000, CRC(875c61de) SHA1(e8dc42fef810a9f5471d96cb5297eb29296ba472) ) @@ -514,36 +896,35 @@ ROM_LOAD( "a17.14v", 0x60000, 0x10000, CRC(ce4330b9) SHA1(0a2bd31baa0bc5e3745ee5ddac995557a551d58c) ) ROM_LOAD( "a18.14w", 0x70000, 0x10000, CRC(1571ce42) SHA1(04082ed78b5e7f20b99d6edfb6c363574abd6158) ) - ROM_REGION( 0x80000, "gfx2", 0 ) - /* bootleg versions use smaller gfx ROMs, but the data is the same */ + ROM_REGION( 0x80000, "k007121_2", 0 ) + // bootleg versions use smaller gfx ROMs, but the data is the same ROM_LOAD( "a4.14a", 0x00000, 0x10000, CRC(2cc7e52c) SHA1(7598a63346bf06dd34fd643fdff53fc3de6768a6) ) ROM_LOAD( "a5.14c", 0x10000, 0x10000, CRC(e01a5b9c) SHA1(58c99cf99f209c584da757320a2f107244056d4c) ) - ROM_LOAD( "e6.14d", 0x20000, 0x10000, CRC(aeea6744) SHA1(220b42f707db99967bdcbd9ac66fcc83675a72aa) ) /* Yes, this one was labeled "E" and not "A" */ + ROM_LOAD( "e6.14d", 0x20000, 0x10000, CRC(aeea6744) SHA1(220b42f707db99967bdcbd9ac66fcc83675a72aa) ) // Yes, this one was labeled "E" and not "A" ROM_LOAD( "a14.14q", 0x30000, 0x10000, CRC(765afdc7) SHA1(b7f6871cb154ee7e42e683bce08b73b00e61b0bc) ) ROM_LOAD( "a11.14m", 0x40000, 0x10000, CRC(bd9ba92c) SHA1(e7f65ed20cd7754cc476e8fab7e56105cedcdb98) ) ROM_LOAD( "a12.14n", 0x50000, 0x10000, CRC(d0be7ec2) SHA1(5aa829b8ffbe3f5f92ba672b1c24bfb7836ba1a3) ) ROM_LOAD( "a13.14p", 0x60000, 0x10000, CRC(2b513d12) SHA1(152ebd849751cc2e95513134ce773a6b2eeb320e) ) - /* This last section, 0x70000-0x7ffff is empty */ + // This last section, 0x70000-0x7ffff is empty ROM_REGION( 0x0400, "proms", 0 ) - ROM_LOAD( "633e08.10g", 0x0000, 0x0100, CRC(9f0949fa) SHA1(7c8fefdcae4523d008a7d39062194c7a80aa3500) ) /* 007121 #0 sprite lookup table */ - ROM_LOAD( "633e09.12g", 0x0100, 0x0100, CRC(14ca5e19) SHA1(eeee2f8b3d1e4acf47de1e74c4e507ff924591e7) ) /* 007121 #0 char lookup table */ - ROM_LOAD( "633f10.18g", 0x0200, 0x0100, CRC(2b244d84) SHA1(c3bde7afb501bae58d07721c637dc06938c22150) ) /* 007121 #1 sprite lookup table */ - ROM_LOAD( "633f11.20g", 0x0300, 0x0100, CRC(14ca5e19) SHA1(eeee2f8b3d1e4acf47de1e74c4e507ff924591e7) ) /* 007121 #1 char lookup table */ + ROM_LOAD( "633e08.10g", 0x0000, 0x0100, CRC(9f0949fa) SHA1(7c8fefdcae4523d008a7d39062194c7a80aa3500) ) // 007121 #0 sprite lookup table + ROM_LOAD( "633e09.12g", 0x0100, 0x0100, CRC(14ca5e19) SHA1(eeee2f8b3d1e4acf47de1e74c4e507ff924591e7) ) // 007121 #0 char lookup table + ROM_LOAD( "633f10.18g", 0x0200, 0x0100, CRC(2b244d84) SHA1(c3bde7afb501bae58d07721c637dc06938c22150) ) // 007121 #1 sprite lookup table + ROM_LOAD( "633f11.20g", 0x0300, 0x0100, CRC(14ca5e19) SHA1(eeee2f8b3d1e4acf47de1e74c4e507ff924591e7) ) // 007121 #1 char lookup table ROM_END ROM_START( contrabj1 ) - ROM_REGION( 0x30000, "maincpu", ROMREGION_ERASEFF ) /* 64k for code + 96k for banked ROMs */ - ROM_LOAD( "2__,contrabtj2.2k", 0x20000, 0x08000, CRC(bdb9196d) SHA1(fad170e8fda94c9c9d7b82433daa30b80af12efc) ) /* == 633k03.18a */ - ROM_CONTINUE( 0x08000, 0x08000 ) - ROM_LOAD( "1.2h", 0x10000, 0x10000, CRC(5d5f7438) SHA1(489fe56ca57ef4f6a7792fba07a9656009f3f285) ) /* == 633k02.17a */ + ROM_REGION( 0x20000, "maincpu", ROMREGION_ERASEFF ) + ROM_LOAD( "1.2h", 0x00000, 0x10000, CRC(5d5f7438) SHA1(489fe56ca57ef4f6a7792fba07a9656009f3f285) ) // == 633k02.17a + ROM_LOAD( "2__,contrabtj2.2k", 0x10000, 0x10000, CRC(bdb9196d) SHA1(fad170e8fda94c9c9d7b82433daa30b80af12efc) ) // == 633k03.18a - ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for SOUND code */ - ROM_LOAD( "a3.4p", 0x08000, 0x08000, CRC(d1549255) SHA1(d700c7de36746ba247e3a5d0410b7aa036aa4073) ) /* == 633k01.12a */ + ROM_REGION( 0x8000, "audiocpu", 0 ) + ROM_LOAD( "a3.4p", 0x0000, 0x8000, CRC(d1549255) SHA1(d700c7de36746ba247e3a5d0410b7aa036aa4073) ) // == 633k01.12a - ROM_REGION( 0x80000, "gfx1", 0 ) - /* bootleg versions use smaller gfx ROMs, but the data is the same */ + ROM_REGION( 0x80000, "k007121_1", 0 ) + // bootleg versions use smaller gfx ROMs, but the data is the same ROM_LOAD( "a7.14f", 0x00000, 0x10000, CRC(57f467d2) SHA1(e30be315980f421143d1357174af678362836285) ) ROM_LOAD( "a10.14l", 0x10000, 0x10000, CRC(e6db9685) SHA1(4d5ccfe95b082fe9830e7a316f88fd6f02464900) ) ROM_LOAD( "a9.14k", 0x20000, 0x10000, CRC(875c61de) SHA1(e8dc42fef810a9f5471d96cb5297eb29296ba472) ) @@ -553,25 +934,28 @@ ROM_LOAD( "a17.14v", 0x60000, 0x10000, CRC(ce4330b9) SHA1(0a2bd31baa0bc5e3745ee5ddac995557a551d58c) ) ROM_LOAD( "a18.14w", 0x70000, 0x10000, CRC(1571ce42) SHA1(04082ed78b5e7f20b99d6edfb6c363574abd6158) ) - ROM_REGION( 0x80000, "gfx2", 0 ) - /* bootleg versions use smaller gfx ROMs, but the data is the same */ + ROM_REGION( 0x80000, "k007121_2", 0 ) + // bootleg versions use smaller gfx ROMs, but the data is the same ROM_LOAD( "a4.14a", 0x00000, 0x10000, CRC(2cc7e52c) SHA1(7598a63346bf06dd34fd643fdff53fc3de6768a6) ) ROM_LOAD( "a5.14c", 0x10000, 0x10000, CRC(e01a5b9c) SHA1(58c99cf99f209c584da757320a2f107244056d4c) ) - ROM_LOAD( "e6.14d", 0x20000, 0x10000, CRC(aeea6744) SHA1(220b42f707db99967bdcbd9ac66fcc83675a72aa) ) /* Yes, this one was labeled "E" and not "A" */ + ROM_LOAD( "e6.14d", 0x20000, 0x10000, CRC(aeea6744) SHA1(220b42f707db99967bdcbd9ac66fcc83675a72aa) ) // Yes, this one was labeled "E" and not "A" ROM_LOAD( "a14.14q", 0x30000, 0x10000, CRC(765afdc7) SHA1(b7f6871cb154ee7e42e683bce08b73b00e61b0bc) ) ROM_LOAD( "a11.14m", 0x40000, 0x10000, CRC(bd9ba92c) SHA1(e7f65ed20cd7754cc476e8fab7e56105cedcdb98) ) ROM_LOAD( "a12.14n", 0x50000, 0x10000, CRC(d0be7ec2) SHA1(5aa829b8ffbe3f5f92ba672b1c24bfb7836ba1a3) ) ROM_LOAD( "a13.14p", 0x60000, 0x10000, CRC(2b513d12) SHA1(152ebd849751cc2e95513134ce773a6b2eeb320e) ) - /* This last section, 0x70000-0x7ffff is empty */ + // This last section, 0x70000-0x7ffff is empty ROM_REGION( 0x0400, "proms", 0 ) - ROM_LOAD( "633e08.10g", 0x0000, 0x0100, CRC(9f0949fa) SHA1(7c8fefdcae4523d008a7d39062194c7a80aa3500) ) /* 007121 #0 sprite lookup table */ - ROM_LOAD( "633e09.12g", 0x0100, 0x0100, CRC(14ca5e19) SHA1(eeee2f8b3d1e4acf47de1e74c4e507ff924591e7) ) /* 007121 #0 char lookup table */ - ROM_LOAD( "633f10.18g", 0x0200, 0x0100, CRC(2b244d84) SHA1(c3bde7afb501bae58d07721c637dc06938c22150) ) /* 007121 #1 sprite lookup table */ - ROM_LOAD( "633f11.20g", 0x0300, 0x0100, CRC(14ca5e19) SHA1(eeee2f8b3d1e4acf47de1e74c4e507ff924591e7) ) /* 007121 #1 char lookup table */ + ROM_LOAD( "633e08.10g", 0x0000, 0x0100, CRC(9f0949fa) SHA1(7c8fefdcae4523d008a7d39062194c7a80aa3500) ) // 007121 #0 sprite lookup table + ROM_LOAD( "633e09.12g", 0x0100, 0x0100, CRC(14ca5e19) SHA1(eeee2f8b3d1e4acf47de1e74c4e507ff924591e7) ) // 007121 #0 char lookup table + ROM_LOAD( "633f10.18g", 0x0200, 0x0100, CRC(2b244d84) SHA1(c3bde7afb501bae58d07721c637dc06938c22150) ) // 007121 #1 sprite lookup table + ROM_LOAD( "633f11.20g", 0x0300, 0x0100, CRC(14ca5e19) SHA1(eeee2f8b3d1e4acf47de1e74c4e507ff924591e7) ) // 007121 #1 char lookup table ROM_END +} // anonymous namespace + + GAME( 1987, contra, 0, contra, contra, contra_state, empty_init, ROT90, "Konami", "Contra (US / Asia, set 1)", MACHINE_SUPPORTS_SAVE ) GAME( 1987, contra1, contra, contra, contra, contra_state, empty_init, ROT90, "Konami", "Contra (US / Asia, set 2)", MACHINE_SUPPORTS_SAVE ) GAME( 1987, contrae, contra, contra, contra, contra_state, empty_init, ROT90, "Konami", "Contra (US / Asia, set 3)", MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/cop01.cpp mame-0.243+dfsg.1/src/mame/drivers/cop01.cpp --- mame-0.242+dfsg.1/src/mame/drivers/cop01.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/cop01.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -376,17 +376,6 @@ * *************************************/ -static const gfx_layout tilelayout = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { 0, 1, 2, 3 }, - { 4+8*0, 0+8*0, 4+8*1, 0+8*1, 4+8*2, 0+8*2, 4+8*3, 0+8*3 }, - { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 }, - 32*8 -}; - static const gfx_layout spritelayout = { 16,16, @@ -407,8 +396,8 @@ }; static GFXDECODE_START( gfx_cop01 ) - GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x4_packed_lsb, 0, 1 ) - GFXDECODE_ENTRY( "gfx2", 0, tilelayout, 16, 8 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x4_packed_lsb, 0, 1 ) + GFXDECODE_ENTRY( "gfx2", 0, gfx_8x8x4_packed_lsb, 16, 8 ) GFXDECODE_ENTRY( "gfx3", 0, spritelayout, 16+8*16, 16 ) GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/cortex.cpp mame-0.243+dfsg.1/src/mame/drivers/cortex.cpp --- mame-0.242+dfsg.1/src/mame/drivers/cortex.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/cortex.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -36,12 +36,6 @@ - Memory mapping unit (74LS610) - Various CRU I/O -Note that the MAME implementation of CRU addresses is not the same as real -hardware. For writing, MAME uses the correct address (R12/2 + offset), with -the bit (0 or 1), being in 'data'. However, for reading, 8 CRU bits are -packed into a single address-byte (CRU 0 = bit 0, etc). So the address is -(R12/2 + offset) >> 3. - ****************************************************************************/ #include "emu.h" diff -Nru mame-0.242+dfsg.1/src/mame/drivers/cosmos_playc8f.cpp mame-0.243+dfsg.1/src/mame/drivers/cosmos_playc8f.cpp --- mame-0.242+dfsg.1/src/mame/drivers/cosmos_playc8f.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/cosmos_playc8f.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -19,6 +19,32 @@ No Universal Space Amusement Equipment Ltd. Colorama 4 Player PLAYC8F + SY-MUSIC01 (music) No Universal Space Amusement Equipment Ltd. / Bromley Incorporated Ghost Hunter PLAYC8E + SY-MUSIC01 (music) + + Sound PCB "SY-MUSIC01": + ___________________________________________________________________ +| ___ __ __ __________________ | +| ··· ·· ·· :::::::::::::::::: | +| CN1 CN2 CN3 CN4 | +| __ __ __ __ __ __ __ __ | +| |_ ||__||__||__||__||__||__||__| | +| ________ | +| _______ SN74HC138N | +| Xtal |OKI | | +| 4.096MHz |M9811 | _____________ | +| |______| | ROM1 | | +| |____________| | +| _______________ _____________ | +| | MCU MCS51 | | ROM2 | | +| |______________| |____________| | +| ____ _____________ | +| 4558D | ROM3 | | +| |____________| | +| ______ ______ _____________ | +| |__ _| ······ | ROM4 | | +| | | CN5 SY-MUSIC01 PCB (V1.1) |____________| | +|____| |___________________________________________________________| + |_|<- Volume + ***********************************************************************************************************************************************/ #include "emu.h" diff -Nru mame-0.242+dfsg.1/src/mame/drivers/cp1.cpp mame-0.243+dfsg.1/src/mame/drivers/cp1.cpp --- mame-0.242+dfsg.1/src/mame/drivers/cp1.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/cp1.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -236,15 +236,26 @@ QUICKLOAD_LOAD_MEMBER(cp1_state::quickload_cb) { - char line[0x10]; - int addr = 0; - while (image.fgets(line, 10) && addr < 0x100) + uint8_t byte = 0; + unsigned addr = 0; + + char ch = '\0'; + uint32_t actual = 0; + while ((actual = image.fread(&ch, 1)) != 0 && addr < 0x100) { - int op = 0, arg = 0; - if (sscanf(line, "%d.%d", &op, &arg) == 2) + // Format: nn.nnn + if (ch >= '0' && ch <= '9') + byte = (byte * 10) + (ch - '0'); + else if (ch == '.' && (addr & 1) == 0) + { + m_i8155->memory_w(addr++, byte); + byte = 0; + } + else if (ch == '\r' || ch == '\n') { - m_i8155->memory_w(addr++, op); - m_i8155->memory_w(addr++, arg); + if ((addr & 1) != 0) + m_i8155->memory_w(addr++, byte); + byte = 0; } else { diff -Nru mame-0.242+dfsg.1/src/mame/drivers/cps1.cpp mame-0.243+dfsg.1/src/mame/drivers/cps1.cpp --- mame-0.242+dfsg.1/src/mame/drivers/cps1.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/cps1.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -14030,16 +14030,16 @@ uint16_t cps_state::sf2ceblp_prot_r() { - if (sf2ceblp_prot == 0x0) + if (m_sf2ceblp_prot == 0x0) return 0x1992; - if (sf2ceblp_prot == 0x04) + if (m_sf2ceblp_prot == 0x04) return 0x0408; return 0xffff; } void cps_state::sf2ceblp_prot_w(uint16_t data) { - sf2ceblp_prot = data; + m_sf2ceblp_prot = data; } @@ -14180,16 +14180,16 @@ */ uint16_t cps_state::pang3b4_prot_r() { - if ((pang3b4_prot & 0xff) >=0 && (pang3b4_prot & 0xff) <=7) - return (pang3b4_prot & 0xff) + 0x20; // Game level + extend - if (pang3b4_prot == 0x17) - return 0x7321; // Guessed from code @0x314 + if ((m_pang3b4_prot & 0xff) <=7) + return (m_pang3b4_prot & 0xff) + 0x20; // Game level + extend + if (m_pang3b4_prot == 0x17) + return 0x7321; // Guessed from code @0x314 return 0xffff; } void cps_state::pang3b4_prot_w(uint16_t data) { - pang3b4_prot = data; + m_pang3b4_prot = data; } diff -Nru mame-0.242+dfsg.1/src/mame/drivers/cps3.cpp mame-0.243+dfsg.1/src/mame/drivers/cps3.cpp --- mame-0.242+dfsg.1/src/mame/drivers/cps3.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/cps3.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -89,6 +89,8 @@ Street Fighter III 2nd Impact: Giant Attack 3GA97a00F CP300000G JAPAN X CAP-3GA000 ? ? 971016* Street Fighter III 2nd Impact: Giant Attack 3GA97aA0F CP3000C0G ASIA X 970930 Street Fighter III 2nd Impact: Giant Attack 3GA97aA0F CP3000C0G ASIA X 971016* +Street Fighter III 2nd Impact: Giant Attack 3GA97aA0F CP3000H0G MEXICO X CAP-3GA0A0 CAP-3GA000 CAP-3GA-1 970930 +Street Fighter III 2nd Impact: Giant Attack 3GA97aA0F CP3000H0G MEXICO X CAP-3GA0A0 ? ? 971016* Street Fighter III 2nd Impact: Giant Attack 3GA97aA0F CP3000U0G USA X CAP-3GA0A0 CAP-3GA000 CAP-3GA-1 970930 Street Fighter III 2nd Impact: Giant Attack 3GA97aA0F CP3000U0G USA X CAP-3GA0A0 ? ? 971016* @@ -2615,7 +2617,7 @@ /* CD sets - use CD BIOS roms */ ROM_START( redearth ) - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "redearth_euro.29f400.u2", 0x000000, 0x080000, CRC(02e0f336) SHA1(acc37e830dfeb9674f5a0fb24f4cc23217ae4ff5) ) DISK_REGION( "scsi:1:cdrom" ) @@ -2623,7 +2625,7 @@ ROM_END ROM_START( redearthr1 ) - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "redearth_euro.29f400.u2", 0x000000, 0x080000, CRC(02e0f336) SHA1(acc37e830dfeb9674f5a0fb24f4cc23217ae4ff5) ) DISK_REGION( "scsi:1:cdrom" ) @@ -2631,7 +2633,7 @@ ROM_END ROM_START( warzard ) - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "warzard_japan.29f400.u2", 0x000000, 0x080000, CRC(f8e2f0c6) SHA1(93d6a986f44c211fff014e55681eca4d2a2774d6) ) DISK_REGION( "scsi:1:cdrom" ) @@ -2639,7 +2641,7 @@ ROM_END ROM_START( warzardr1 ) - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "warzard_japan.29f400.u2", 0x000000, 0x080000, CRC(f8e2f0c6) SHA1(93d6a986f44c211fff014e55681eca4d2a2774d6) ) DISK_REGION( "scsi:1:cdrom" ) @@ -2648,7 +2650,7 @@ ROM_START( sfiii ) - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "sfiii_euro.29f400.u2", 0x000000, 0x080000, CRC(27699ddc) SHA1(d8b525cd27e584560b129598df31fd2c5b2a682a) ) DISK_REGION( "scsi:1:cdrom" ) @@ -2656,7 +2658,7 @@ ROM_END ROM_START( sfiiiu ) - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "sfiii_usa_region_b1.29f400.u2", 0x000000, 0x080000, CRC(fb172a8e) SHA1(48ebf59910f246835f7dc0c588da30f7a908072f) ) DISK_REGION( "scsi:1:cdrom" ) @@ -2664,7 +2666,7 @@ ROM_END ROM_START( sfiiia ) - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "sfiii_asia_region_bd.29f400.u2", 0x000000, 0x080000, CRC(cbd28de7) SHA1(9c15ecb73b9587d20850e62e8683930a45caa01b) ) DISK_REGION( "scsi:1:cdrom" ) @@ -2672,7 +2674,7 @@ ROM_END ROM_START( sfiiij ) - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "sfiii_japan.29f400.u2", 0x000000, 0x080000, CRC(74205250) SHA1(c3e83ace7121d32da729162662ec6b5285a31211) ) DISK_REGION( "scsi:1:cdrom" ) @@ -2680,7 +2682,7 @@ ROM_END ROM_START( sfiiih ) - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "sfiii_hispanic.29f400.u2", 0x000000, 0x080000, CRC(d2b3cd48) SHA1(00ebb270c24a66515c97e35331de54ff5358000e) ) DISK_REGION( "scsi:1:cdrom" ) @@ -2689,7 +2691,7 @@ ROM_START( sfiii2 ) - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "sfiii2_usa.29f400.u2", 0x000000, 0x080000, CRC(75dd72e0) SHA1(5a12d6ea6734df5de00ecee6f9ef470749d2f242) ) DISK_REGION( "scsi:1:cdrom" ) @@ -2697,16 +2699,23 @@ ROM_END ROM_START( sfiii2j ) - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "sfiii2_japan.29f400.u2", 0x000000, 0x080000, CRC(faea0a3e) SHA1(a03cd63bcf52e4d57f7a598c8bc8e243694624ec) ) DISK_REGION( "scsi:1:cdrom" ) DISK_IMAGE_READONLY( "cap-3ga000", 0, SHA1(a0c11a5c3057dc1ad3962aa38adf95acb3430bec) ) ROM_END +ROM_START( sfiii2h ) + ROM_REGION32_BE( 0x080000, "bios", 0 ) + ROM_LOAD( "sfiii2_hispanic.29f400.u2", 0x000000, 0x080000, CRC(5c799526) SHA1(5a56345b500cd7e20d5fb6cabc791655c6ff4ed2) ) + + DISK_REGION( "scsi:1:cdrom" ) + DISK_IMAGE_READONLY( "cap-3ga000", 0, SHA1(a0c11a5c3057dc1ad3962aa38adf95acb3430bec) ) +ROM_END ROM_START( jojo ) - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "jojo_euro.29f400.u2", 0x000000, 0x080000, CRC(513e40ec) SHA1(03b91f0fbd5be56d24feed4698c7543d4df07837) ) DISK_REGION( "scsi:1:cdrom" ) @@ -2714,7 +2723,7 @@ ROM_END ROM_START( jojor1 ) - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "jojo_euro.29f400.u2", 0x000000, 0x080000, CRC(513e40ec) SHA1(03b91f0fbd5be56d24feed4698c7543d4df07837) ) DISK_REGION( "scsi:1:cdrom" ) @@ -2722,7 +2731,7 @@ ROM_END ROM_START( jojor2 ) - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "jojo_euro.29f400.u2", 0x000000, 0x080000, CRC(513e40ec) SHA1(03b91f0fbd5be56d24feed4698c7543d4df07837) ) DISK_REGION( "scsi:1:cdrom" ) @@ -2730,7 +2739,7 @@ ROM_END ROM_START( jojou ) - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "jojo_usa.29f400.u2", 0x000000, 0x080000, CRC(8d40f7be) SHA1(2a4bd83db2f959c33b071e517941aa55a0f919c0) ) DISK_REGION( "scsi:1:cdrom" ) @@ -2738,7 +2747,7 @@ ROM_END ROM_START( jojour1 ) - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "jojo_usa.29f400.u2", 0x000000, 0x080000, CRC(8d40f7be) SHA1(2a4bd83db2f959c33b071e517941aa55a0f919c0) ) DISK_REGION( "scsi:1:cdrom" ) @@ -2746,7 +2755,7 @@ ROM_END ROM_START( jojour2 ) - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "jojo_usa.29f400.u2", 0x000000, 0x080000, CRC(8d40f7be) SHA1(2a4bd83db2f959c33b071e517941aa55a0f919c0) ) DISK_REGION( "scsi:1:cdrom" ) @@ -2754,7 +2763,7 @@ ROM_END ROM_START( jojoj ) - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "jojo_japan.29f400.u2", 0x000000, 0x080000, CRC(02778f60) SHA1(a167f9ebe030592a0cdb0c6a3c75835c6a43be4c) ) DISK_REGION( "scsi:1:cdrom" ) @@ -2762,7 +2771,7 @@ ROM_END ROM_START( jojojr1 ) - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "jojo_japan.29f400.u2", 0x000000, 0x080000, CRC(02778f60) SHA1(a167f9ebe030592a0cdb0c6a3c75835c6a43be4c) ) DISK_REGION( "scsi:1:cdrom" ) @@ -2770,7 +2779,7 @@ ROM_END ROM_START( jojojr2 ) - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "jojo_japan.29f400.u2", 0x000000, 0x080000, CRC(02778f60) SHA1(a167f9ebe030592a0cdb0c6a3c75835c6a43be4c) ) DISK_REGION( "scsi:1:cdrom" ) @@ -2778,7 +2787,7 @@ ROM_END ROM_START( jojoa ) - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "jojo_asia.29f400.u2", 0x000000, 0x080000, CRC(789aa72a) SHA1(afcefb963d7c103514585f4a6738b2deb5b7d27a) ) DISK_REGION( "scsi:1:cdrom" ) @@ -2786,7 +2795,7 @@ ROM_END ROM_START( jojoar1 ) - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "jojo_asia.29f400.u2", 0x000000, 0x080000, CRC(789aa72a) SHA1(afcefb963d7c103514585f4a6738b2deb5b7d27a) ) DISK_REGION( "scsi:1:cdrom" ) @@ -2794,7 +2803,7 @@ ROM_END ROM_START( jojoar2 ) - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "jojo_asia.29f400.u2", 0x000000, 0x080000, CRC(789aa72a) SHA1(afcefb963d7c103514585f4a6738b2deb5b7d27a) ) DISK_REGION( "scsi:1:cdrom" ) @@ -2803,7 +2812,7 @@ ROM_START( sfiii3 ) - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "sfiii3_euro.29f400.u2", 0x000000, 0x080000, CRC(30bbf293) SHA1(f094c2eeaf4f6709060197aca371a4532346bf78) ) DISK_REGION( "scsi:1:cdrom" ) @@ -2811,7 +2820,7 @@ ROM_END ROM_START( sfiii3r1 ) - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "sfiii3_euro.29f400.u2", 0x000000, 0x080000, CRC(30bbf293) SHA1(f094c2eeaf4f6709060197aca371a4532346bf78) ) DISK_REGION( "scsi:1:cdrom" ) @@ -2819,7 +2828,7 @@ ROM_END ROM_START( sfiii3u ) - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "sfiii3_usa.29f400.u2", 0x000000, 0x080000, CRC(ecc545c1) SHA1(e39083820aae914fd8b80c9765129bedb745ceba) ) DISK_REGION( "scsi:1:cdrom" ) @@ -2827,7 +2836,7 @@ ROM_END ROM_START( sfiii3ur1 ) - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "sfiii3_usa.29f400.u2", 0x000000, 0x080000, CRC(ecc545c1) SHA1(e39083820aae914fd8b80c9765129bedb745ceba) ) DISK_REGION( "scsi:1:cdrom" ) @@ -2835,7 +2844,7 @@ ROM_END ROM_START( sfiii3j ) - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "sfiii3_japan.29f400.u2", 0x000000, 0x080000, CRC(63f23d1f) SHA1(58559403c325454f8c8d3eb0f569a531aa22db26) ) DISK_REGION( "scsi:1:cdrom" ) @@ -2843,7 +2852,7 @@ ROM_END ROM_START( sfiii3jr1 ) - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "sfiii3_japan.29f400.u2", 0x000000, 0x080000, CRC(63f23d1f) SHA1(58559403c325454f8c8d3eb0f569a531aa22db26) ) DISK_REGION( "scsi:1:cdrom" ) @@ -2852,7 +2861,7 @@ ROM_START( jojoba ) - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "jojoba_euro.29f400.u2", 0x000000, 0x080000, CRC(63cc8800) SHA1(f0c7e6abb205a16dab7a114e017b193521071a4b) ) DISK_REGION( "scsi:1:cdrom" ) @@ -2860,7 +2869,7 @@ ROM_END ROM_START( jojobaj ) - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "jojoba_japan.29f400.u2", 0x000000, 0x080000, CRC(3085478c) SHA1(055eab1fc42816f370a44b17fd7e87ffcb10e8b7) ) DISK_REGION( "scsi:1:cdrom" ) @@ -2868,7 +2877,7 @@ ROM_END ROM_START( jojobar1 ) - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "jojoba_euro.29f400.u2", 0x000000, 0x080000, CRC(63cc8800) SHA1(f0c7e6abb205a16dab7a114e017b193521071a4b) ) DISK_REGION( "scsi:1:cdrom" ) @@ -2876,7 +2885,7 @@ ROM_END ROM_START( jojobajr1 ) - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "jojoba_japan.29f400.u2", 0x000000, 0x080000, CRC(3085478c) SHA1(055eab1fc42816f370a44b17fd7e87ffcb10e8b7) ) DISK_REGION( "scsi:1:cdrom" ) @@ -2890,7 +2899,7 @@ /* NO CD sets - use NO CD BIOS roms - don't require the CD image to boot */ ROM_START( sfiiin ) - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "sfiii_asia_nocd.29f400.u2", 0x000000, 0x080000, CRC(ca2b715f) SHA1(86319987f9af4afd272a2488e73de8382743cb37) ) // this is a different VERSION of the bios compared to all other sets, not just an alt region code ROM_REGION( 0x200000, "simm1.0", 0 ) @@ -2944,7 +2953,7 @@ ROM_START( sfiiina ) - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "sfiii_asia_nocd.29f400.u2", 0x000000, 0x080000, CRC(73e32463) SHA1(45d144e533e4b20cc5a744ca4f618e288430c601) ) // sldh ROM_REGION( 0x200000, "simm1.0", 0 ) @@ -2997,7 +3006,7 @@ ROM_END ROM_START( sfiii2n ) - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "sfiii2_asia_nocd.29f400.u2", 0x000000, 0x080000, CRC(fd297c0d) SHA1(4323deda2789f104b53f32a663196ec16de73215) ) ROM_REGION( 0x200000, "simm1.0", 0 ) @@ -3071,7 +3080,7 @@ ROM_END ROM_START( jojon ) - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "jojo_asia_nocd.29f400.u2", 0x000000, 0x080000, CRC(05b4f953) SHA1(c746c7bb5359acc9adced817cb4870b1912eaefd) ) ROM_REGION( 0x200000, "simm1.0", 0 ) @@ -3133,7 +3142,7 @@ ROM_END ROM_START( jojonr1 ) - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "jojo_asia_nocd.29f400.u2", 0x000000, 0x080000, CRC(05b4f953) SHA1(c746c7bb5359acc9adced817cb4870b1912eaefd) ) ROM_REGION( 0x200000, "simm1.0", 0 ) @@ -3195,7 +3204,7 @@ ROM_END ROM_START( jojonr2 ) - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "jojo_asia_nocd.29f400.u2", 0x000000, 0x080000, CRC(05b4f953) SHA1(c746c7bb5359acc9adced817cb4870b1912eaefd) ) ROM_REGION( 0x200000, "simm1.0", 0 ) @@ -3257,7 +3266,7 @@ ROM_END ROM_START( sfiii3n ) - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "sfiii3_japan_nocd.29f400.u2", 0x000000, 0x080000, CRC(1edc6366) SHA1(60b4b9adeb030a33059d74fdf03873029e465b52) ) ROM_REGION( 0x200000, "simm1.0", 0 ) @@ -3348,7 +3357,7 @@ ROM_END ROM_START( sfiii3nr1 ) - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "sfiii3_japan_nocd.29f400.u2", 0x000000, 0x080000, CRC(1edc6366) SHA1(60b4b9adeb030a33059d74fdf03873029e465b52) ) ROM_REGION( 0x200000, "simm1.0", 0 ) @@ -3439,7 +3448,7 @@ ROM_END ROM_START( jojoban ) - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "jojoba_japan_nocd.29f400.u2", 0x000000, 0x080000, CRC(4dab19f5) SHA1(ba07190e7662937fc267f07285c51e99a45c061e) ) ROM_REGION( 0x200000, "simm1.0", 0 ) @@ -3513,7 +3522,7 @@ ROM_END ROM_START( jojobanr1 ) - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "jojoba_japan_nocd.29f400.u2", 0x000000, 0x080000, CRC(4dab19f5) SHA1(ba07190e7662937fc267f07285c51e99a45c061e) ) ROM_REGION( 0x200000, "simm1.0", 0 ) @@ -3587,7 +3596,7 @@ ROM_END ROM_START( jojobane ) - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "jojoba_euro_nocd.29f400.u2", 0x000000, 0x080000, CRC(1ee2d679) SHA1(9e129b454a376606b3f7e8aec64de425cf9c635c) ) ROM_REGION( 0x200000, "simm1.0", 0 ) @@ -3661,7 +3670,7 @@ ROM_END ROM_START( jojobaner1 ) - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "jojoba_euro_nocd.29f400.u2", 0x000000, 0x080000, CRC(1ee2d679) SHA1(9e129b454a376606b3f7e8aec64de425cf9c635c) ) ROM_REGION( 0x200000, "simm1.0", 0 ) @@ -3737,7 +3746,7 @@ /* Bootlegs for use with modified security carts */ ROM_START( cps3boot ) // for cart with standard SH2 - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "no-battery_bios_29f400_for_hd6417095_sh2.u2", 0x000000, 0x080000, CRC(cb9bd5b0) SHA1(ea7ecb3deb69f5307a62d8f0d7d8e68d49013d07)) DISK_REGION( "scsi:1:cdrom" ) @@ -3745,7 +3754,7 @@ ROM_END ROM_START( cps3booto ) // for cart with standard SH2 - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "no-battery_bios_29f400_for_hd6417095_sh2.u2", 0x000000, 0x080000, CRC(cb9bd5b0) SHA1(ea7ecb3deb69f5307a62d8f0d7d8e68d49013d07)) DISK_REGION( "scsi:1:cdrom" ) @@ -3753,7 +3762,7 @@ ROM_END ROM_START( cps3booto2 ) // for cart with standard SH2 - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "no-battery_bios_29f400_for_hd6417095_sh2.u2", 0x000000, 0x080000, CRC(cb9bd5b0) SHA1(ea7ecb3deb69f5307a62d8f0d7d8e68d49013d07)) DISK_REGION( "scsi:1:cdrom" ) @@ -3761,7 +3770,7 @@ ROM_END ROM_START( cps3bs32 ) // for cart with standard SH2 - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "no-battery_bios_29f400_for_hd6417095_sh2.u2", 0x000000, 0x080000, CRC(cb9bd5b0) SHA1(ea7ecb3deb69f5307a62d8f0d7d8e68d49013d07)) DISK_REGION( "scsi:1:cdrom" ) @@ -3769,7 +3778,7 @@ ROM_END ROM_START( cps3bs32a ) // for cart with standard SH2 - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "no-battery_bios_29f400_for_hd6417095_sh2.u2", 0x000000, 0x080000, CRC(cb9bd5b0) SHA1(ea7ecb3deb69f5307a62d8f0d7d8e68d49013d07)) DISK_REGION( "scsi:1:cdrom" ) @@ -3777,7 +3786,7 @@ ROM_END ROM_START( cps3boota ) // for cart with dead custom SH2 (or 2nd Impact CPU which is the same as a dead one) - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "no-battery_bios_29f400_for_dead_security_cart.u2", 0x000000, 0x080000, CRC(0fd56fb3) SHA1(5a8bffc07eb7da73cf4bca6718df72e471296bfd) ) DISK_REGION( "scsi:1:cdrom" ) @@ -3785,7 +3794,7 @@ ROM_END ROM_START( cps3bootao ) // for cart with dead custom SH2 (or 2nd Impact CPU which is the same as a dead one) - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "no-battery_bios_29f400_for_dead_security_cart.u2", 0x000000, 0x080000, CRC(0fd56fb3) SHA1(5a8bffc07eb7da73cf4bca6718df72e471296bfd) ) DISK_REGION( "scsi:1:cdrom" ) @@ -3794,7 +3803,7 @@ ROM_START( cps3bootao2 ) // for cart with dead custom SH2 (or 2nd Impact CPU which is the same as a dead one) - ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */ + ROM_REGION32_BE( 0x080000, "bios", 0 ) ROM_LOAD( "no-battery_bios_29f400_for_dead_security_cart.u2", 0x000000, 0x080000, CRC(0fd56fb3) SHA1(5a8bffc07eb7da73cf4bca6718df72e471296bfd) ) DISK_REGION( "scsi:1:cdrom" ) @@ -3976,6 +3985,7 @@ // 970930 GAMEL(1997, sfiii2, 0, sfiii2, cps3, cps3_state, init_sfiii2, ROT0, "Capcom", "Street Fighter III 2nd Impact: Giant Attack (USA 970930)", MACHINE_SUPPORTS_SAVE, layout_sfiii2 ) // layout is for widescreen support GAMEL(1997, sfiii2j, sfiii2, sfiii2, cps3, cps3_state, init_sfiii2, ROT0, "Capcom", "Street Fighter III 2nd Impact: Giant Attack (Japan 970930)", MACHINE_SUPPORTS_SAVE, layout_sfiii2 ) +GAMEL(1997, sfiii2h, sfiii2, sfiii2, cps3, cps3_state, init_sfiii2, ROT0, "Capcom", "Street Fighter III 2nd Impact: Giant Attack (Hispanic 970930)", MACHINE_SUPPORTS_SAVE, layout_sfiii2 ) GAMEL(1997, sfiii2n, sfiii2, sfiii2, cps3, cps3_state, init_sfiii2, ROT0, "Capcom", "Street Fighter III 2nd Impact: Giant Attack (Asia 970930, NO CD)", MACHINE_SUPPORTS_SAVE, layout_sfiii2 ) /* JoJo's Venture / JoJo no Kimyou na Bouken */ diff -Nru mame-0.242+dfsg.1/src/mame/drivers/crgolf.cpp mame-0.243+dfsg.1/src/mame/drivers/crgolf.cpp --- mame-0.242+dfsg.1/src/mame/drivers/crgolf.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/crgolf.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -75,7 +75,7 @@ | YUVO CO., LTD | |----------------------------------------------- - next to rom M-GF_A10.12K + next to ROM M-GF_A10.12K the box must contain at least a Z80 DASM Notes: @@ -84,23 +84,255 @@ otherwise. During irq routines it also checks if bit 7 is active for $640a-$6415, modifies this area if condition is true. -Neither of above matches what we have in the rom data banks, so it's either +Neither of above matches what we have in the ROM data banks, so it's either protected or a snippet should do the aforementioned string copy. ***************************************************************************/ #include "emu.h" -#include "includes/crgolf.h" #include "cpu/z80/z80.h" #include "machine/74259.h" #include "machine/gen_latch.h" #include "sound/ay8910.h" #include "sound/msm5205.h" + +#include "emupal.h" #include "screen.h" #include "speaker.h" +namespace { + +class crgolf_state : public driver_device +{ +public: + crgolf_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_palette(*this, "palette"), + m_videoram(*this, "vram%u", 0U, 0x6000U, ENDIANNESS_LITTLE), + m_mainbank(*this, "mainbank"), + m_stick(*this, "STICK%u", 0U), + m_ioport(*this, { "IN0", "IN1", "P1", "P2", "DSW", "UNUSED0", "UNUSED1" }) + { } + + void crgolf(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + + // devices + required_device m_maincpu; + required_device m_audiocpu; + required_device m_palette; + + void sound_map(address_map &map); + +private: + // memory pointers + memory_share_array_creator m_videoram; + required_memory_bank m_mainbank; + + required_ioport_array<2> m_stick; + required_ioport_array<7> m_ioport; + + bool m_color_select = false; + bool m_screen_flip = false; + bool m_screen_enable[2] = { false, false }; + + // misc + uint8_t m_port_select = 0U; + + void rom_bank_select_w(uint8_t data); + uint8_t switch_input_r(); + uint8_t analog_input_r(); + void switch_input_select_w(uint8_t data); + void unknown_w(uint8_t data); + DECLARE_WRITE_LINE_MEMBER(color_select_w); + DECLARE_WRITE_LINE_MEMBER(screen_flip_w); + DECLARE_WRITE_LINE_MEMBER(screen_select_w); + template DECLARE_WRITE_LINE_MEMBER(screen_enable_w); + void palette(palette_device &palette) const; + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void main_map(address_map &map); +}; + +class crgolfhi_state : public crgolf_state +{ +public: + crgolfhi_state(const machine_config &mconfig, device_type type, const char *tag) : + crgolf_state(mconfig, type, tag), + m_adpcm_rom(*this, "adpcm"), + m_msm(*this, "msm") + { } + + void crgolfhi(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + +private: + // memory pointers + required_region_ptr m_adpcm_rom; + + // devices + required_device m_msm; + + // misc + uint16_t m_sample_offset = 0U; + uint8_t m_sample_count = 0U; + + void sample_w(offs_t offset, uint8_t data); + DECLARE_WRITE_LINE_MEMBER(vck_callback); + + void sound_map(address_map &map); +}; + +class mastrglf_state : public crgolfhi_state +{ +public: + mastrglf_state(const machine_config &mconfig, device_type type, const char *tag) : + crgolfhi_state(mconfig, type, tag) + { } + + void mastrglf(machine_config &config); + +private: + uint8_t unk_sound_02_r(); + uint8_t unk_sound_05_r(); + uint8_t unk_sound_07_r(); + void unk_sound_0c_w(uint8_t data); + void palette(palette_device &palette) const; + void main_io_map(address_map &map); + void main_prg_map(address_map &map); + void sound_io_map(address_map &map); + void sound_prg_map(address_map &map); +}; + +// video + + +/************************************* + * + * Video startup + * + *************************************/ + +void crgolf_state::palette(palette_device &palette) const +{ + uint8_t const *const prom = memregion("proms")->base(); + static constexpr uint8_t NUM_PENS = 0x20; + + for (offs_t offs = 0; offs < NUM_PENS; offs++) + { + uint8_t const data = prom[offs]; + + // red component + int bit0 = BIT(data, 0); + int bit1 = BIT(data, 1); + int bit2 = BIT(data, 2); + int const r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; + + // green component + bit0 = BIT(data, 3); + bit1 = BIT(data, 4); + bit2 = BIT(data, 5); + int const g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; + + // blue component + bit0 = BIT(data, 6); + bit1 = BIT(data, 7); + int const b = 0x4f * bit0 + 0xa8 * bit1; + + m_palette->set_pen_color(offs, r, g, b); + } +} + +void mastrglf_state::palette(palette_device &palette) const +{ + // TODO: once PROMs are dumped +} + +/************************************* + * + * Video update + * + *************************************/ + +uint32_t crgolf_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + int flip = m_screen_flip; + static constexpr uint16_t VIDEORAM_SIZE = 0x2000 * 3; + + // for each byte in the video RAM + for (offs_t offs = 0; offs < VIDEORAM_SIZE / 3; offs++) + { + uint8_t y = (offs & 0x1fe0) >> 5; + uint8_t x = (offs & 0x001f) << 3; + + uint8_t data_a0 = m_videoram[0][0x2000 | offs]; + uint8_t data_a1 = m_videoram[0][0x0000 | offs]; + uint8_t data_a2 = m_videoram[0][0x4000 | offs]; + uint8_t data_b0 = m_videoram[1][0x2000 | offs]; + uint8_t data_b1 = m_videoram[1][0x0000 | offs]; + uint8_t data_b2 = m_videoram[1][0x4000 | offs]; + + if (flip) + { + y = ~y; + x = ~x; + } + + // for each pixel in the byte + for (int i = 0; i < 8; i++) + { + offs_t color; + uint8_t data_b = 0; + uint8_t data_a = 0; + + if (!m_screen_enable[0]) + data_a = ((data_a0 & 0x80) >> 7) | ((data_a1 & 0x80) >> 6) | ((data_a2 & 0x80) >> 5); + + if (!m_screen_enable[1]) + data_b = ((data_b0 & 0x80) >> 7) | ((data_b1 & 0x80) >> 6) | ((data_b2 & 0x80) >> 5); + + // screen A has priority over B + if (data_a) + color = data_a; + else + color = data_b | 0x08; + + // add HI bit if enabled + if (m_color_select) + color = color | 0x10; + + bitmap.pix(y, x) = color; + + // next pixel + data_a0 = data_a0 << 1; + data_a1 = data_a1 << 1; + data_a2 = data_a2 << 1; + data_b0 = data_b0 << 1; + data_b1 = data_b1 << 1; + data_b2 = data_b2 << 1; + + if (flip) + x = x - 1; + else + x = x + 1; + } + } + + return 0; +} + + +// machine + /************************************* * * ROM banking @@ -109,35 +341,44 @@ void crgolf_state::rom_bank_select_w(uint8_t data) { - membank("bank1")->set_entry(data & 15); + m_mainbank->set_entry(data & 15); // TODO: mastrglf has more banks } void crgolf_state::machine_start() { - if (membank("bank1")) - { - uint32_t size = memregion("maindata")->bytes(); + uint32_t size = memregion("maindata")->bytes(); - /* configure the banking */ - membank("bank1")->configure_entries(0, size/0x2000, memregion("maindata")->base(), 0x2000); - membank("bank1")->set_entry(0); - } + // configure the banking + m_mainbank->configure_entries(0, size / 0x2000, memregion("maindata")->base(), 0x2000); + m_mainbank->set_entry(0); + membank("vrambank")->configure_entry(0, m_videoram[0]); + membank("vrambank")->configure_entry(1, m_videoram[1]); - /* register for save states */ + // register for save states save_item(NAME(m_port_select)); - save_item(NAME(m_sample_offset)); - save_item(NAME(m_sample_count)); save_item(NAME(m_color_select)); save_item(NAME(m_screen_flip)); - save_item(NAME(m_screena_enable)); - save_item(NAME(m_screenb_enable)); + save_item(NAME(m_screen_enable)); } +void crgolfhi_state::machine_start() +{ + crgolf_state::machine_start(); + + save_item(NAME(m_sample_offset)); + save_item(NAME(m_sample_count)); +} void crgolf_state::machine_reset() { m_port_select = 0; +} + +void crgolfhi_state::machine_reset() +{ + crgolf_state::machine_reset(); + m_sample_offset = 0; m_sample_count = 0; } @@ -151,27 +392,21 @@ uint8_t crgolf_state::switch_input_r() { - static const char *const portnames[] = { "IN0", "IN1", "P1", "P2", "DSW", "UNUSED0", "UNUSED1" }; - - return ioport(portnames[m_port_select])->read(); + return m_ioport[m_port_select]->read(); } uint8_t crgolf_state::analog_input_r() { - return ((ioport("STICK0")->read() >> 4) | (ioport("STICK1")->read() & 0xf0)) ^ 0x88; + return ((m_stick[0]->read() >> 4) | (m_stick[1]->read() & 0xf0)) ^ 0x88; } void crgolf_state::switch_input_select_w(uint8_t data) { - if (!(data & 0x40)) m_port_select = 6; - if (!(data & 0x20)) m_port_select = 5; - if (!(data & 0x10)) m_port_select = 4; - if (!(data & 0x08)) m_port_select = 3; - if (!(data & 0x04)) m_port_select = 2; - if (!(data & 0x02)) m_port_select = 1; - if (!(data & 0x01)) m_port_select = 0; + for (int i = 6; i >= 0; i--) + if (!(BIT(data, i))) + m_port_select = i; } @@ -188,23 +423,23 @@ * *************************************/ -WRITE_LINE_MEMBER(crgolf_state::vck_callback) +WRITE_LINE_MEMBER(crgolfhi_state::vck_callback) { - /* only play back if we have data remaining */ + // only play back if we have data remaining if (m_sample_count != 0xff) { - uint8_t data = memregion("adpcm")->base()[m_sample_offset >> 1]; + uint8_t data = m_adpcm_rom[m_sample_offset >> 1]; - /* write the next nibble and advance */ + // write the next nibble and advance m_msm->data_w((data >> (4 * (~m_sample_offset & 1))) & 0x0f); m_sample_offset++; - /* every 256 clocks, we decrement the length */ + // every 256 clocks, we decrement the length if (!(m_sample_offset & 0xff)) { m_sample_count--; - /* if we hit 0xff, automatically turn off playback */ + // if we hit 0xff, automatically turn off playback if (m_sample_count == 0xff) m_msm->reset_w(1); } @@ -212,26 +447,26 @@ } -void crgolf_state::crgolfhi_sample_w(offs_t offset, uint8_t data) +void crgolfhi_state::sample_w(offs_t offset, uint8_t data) { switch (offset) { - /* offset 0 holds the MSM5205 in reset */ + // offset 0 holds the MSM5205 in reset case 0: m_msm->reset_w(1); break; - /* offset 1 is the length/256 nibbles */ + // offset 1 is the length/256 nibbles case 1: m_sample_count = data; break; - /* offset 2 is the offset/256 nibbles */ + // offset 2 is the offset/256 nibbles case 2: m_sample_offset = data << 8; break; - /* offset 3 turns on playback */ + // offset 3 turns on playback case 3: m_msm->reset_w(0); break; @@ -251,21 +486,10 @@ } -WRITE_LINE_MEMBER(crgolf_state::screen_select_w) +template +WRITE_LINE_MEMBER(crgolf_state::screen_enable_w) { - m_vrambank->set_bank(state); -} - - -WRITE_LINE_MEMBER(crgolf_state::screena_enable_w) -{ - m_screena_enable = state; -} - - -WRITE_LINE_MEMBER(crgolf_state::screenb_enable_w) -{ - m_screenb_enable = state; + m_screen_enable[Which] = state; } @@ -280,18 +504,12 @@ { map(0x0000, 0x3fff).rom(); map(0x4000, 0x5fff).ram(); - map(0x6000, 0x7fff).bankr("bank1"); + map(0x6000, 0x7fff).bankr(m_mainbank); map(0x8000, 0x8007).w("mainlatch", FUNC(ls259_device::write_d0)); map(0x8800, 0x8800).r("soundlatch2", FUNC(generic_latch_8_device::read)); map(0x8800, 0x8800).w("soundlatch1", FUNC(generic_latch_8_device::write)); map(0x9000, 0x9000).w(FUNC(crgolf_state::rom_bank_select_w)); - map(0xa000, 0xffff).m(m_vrambank, FUNC(address_map_bank_device::amap8)); -} - -void crgolf_state::vrambank_map(address_map &map) -{ - map(0x0000, 0x5fff).ram().share("vrama"); - map(0x8000, 0xdfff).ram().share("vramb"); + map(0xa000, 0xffff).bankrw("vrambank"); } @@ -313,24 +531,28 @@ map(0xe003, 0xe003).w("soundlatch2", FUNC(generic_latch_8_device::write)); } +void crgolfhi_state::sound_map(address_map &map) +{ + crgolf_state::sound_map(map); + map(0xa000, 0xa003).w(FUNC(crgolfhi_state::sample_w)); +} - -void crgolf_state::mastrglf_map(address_map &map) +void mastrglf_state::main_prg_map(address_map &map) { map(0x0000, 0x3fff).rom(); - map(0x4000, 0x5fff).bankr("bank1"); + map(0x4000, 0x5fff).bankr("mainbank"); map(0x6000, 0x8fff).ram(); // maybe RAM and ROM here? map(0x9000, 0x9fff).ram(); - map(0xa000, 0xffff).m(m_vrambank, FUNC(address_map_bank_device::amap8)); + map(0xa000, 0xffff).bankrw("vrambank"); } -void crgolf_state::mastrglf_io(address_map &map) +void mastrglf_state::main_io_map(address_map &map) { map.global_mask(0xff); map(0x00, 0x07).w("mainlatch", FUNC(ls259_device::write_d0)); @@ -341,43 +563,43 @@ -void crgolf_state::mastrglf_submap(address_map &map) +void mastrglf_state::sound_prg_map(address_map &map) { map(0x0000, 0x7fff).rom(); map(0x8000, 0x87ff).ram(); } -uint8_t crgolf_state::unk_sub_02_r() +uint8_t mastrglf_state::unk_sound_02_r() { return 0x00; } -uint8_t crgolf_state::unk_sub_05_r() +uint8_t mastrglf_state::unk_sound_05_r() { return 0x00; } -uint8_t crgolf_state::unk_sub_07_r() +uint8_t mastrglf_state::unk_sound_07_r() { return 0x00; } -void crgolf_state::unk_sub_0c_w(uint8_t data) +void mastrglf_state::unk_sound_0c_w(uint8_t data) { } -void crgolf_state::mastrglf_subio(address_map &map) +void mastrglf_state::sound_io_map(address_map &map) { map.global_mask(0xff); map(0x00, 0x00).r("soundlatch1", FUNC(generic_latch_8_device::read)).nopw(); - map(0x02, 0x02).r(FUNC(crgolf_state::unk_sub_02_r)); - map(0x05, 0x05).r(FUNC(crgolf_state::unk_sub_05_r)); + map(0x02, 0x02).r(FUNC(mastrglf_state::unk_sound_02_r)); + map(0x05, 0x05).r(FUNC(mastrglf_state::unk_sound_05_r)); map(0x06, 0x06).nopr(); - map(0x07, 0x07).r(FUNC(crgolf_state::unk_sub_07_r)); + map(0x07, 0x07).r(FUNC(mastrglf_state::unk_sound_07_r)); map(0x08, 0x08).w("soundlatch2", FUNC(generic_latch_8_device::write)); - map(0x0c, 0x0c).w(FUNC(crgolf_state::unk_sub_0c_w)); + map(0x0c, 0x0c).w(FUNC(mastrglf_state::unk_sound_0c_w)); map(0x10, 0x11).w("aysnd", FUNC(ay8910_device::address_data_w)); } @@ -390,12 +612,12 @@ *************************************/ static INPUT_PORTS_START( crgolf ) - PORT_START("IN0") /* CREDIT */ + PORT_START("IN0") // CREDIT PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_BIT( 0xfc, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_START("IN1") /* SELECT */ + PORT_START("IN1") // SELECT PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START1 ) PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START2 ) @@ -404,24 +626,24 @@ PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_START("P1") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_PLAYER(1) /* club select */ - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) /* backward address */ - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(1) /* forward address */ - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(1) /* open stance */ - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_PLAYER(1) /* closed stance */ - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) /* direction left */ - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) /* direction right */ - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) /* shot switch */ + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_PLAYER(1) // club select + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) // backward address + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(1) // forward address + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(1) // open stance + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_PLAYER(1) // closed stance + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) // direction left + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) // direction right + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) // shot switch PORT_START("P2") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_COCKTAIL /* club select */ - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL /* backward address */ - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_COCKTAIL /* forward address */ - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_COCKTAIL /* open stance */ - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_COCKTAIL /* closed stance */ - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL /* direction left */ - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL /* direction right */ - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL /* shot switch */ + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_COCKTAIL // club select + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL // backward address + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_COCKTAIL // forward address + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_COCKTAIL // open stance + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_COCKTAIL // closed stance + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL // direction left + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL // direction right + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL // shot switch PORT_START("DSW") PORT_DIPNAME( 0x01, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW:2") @@ -488,12 +710,14 @@ void crgolf_state::crgolf(machine_config &config) { - /* basic machine hardware */ - Z80(config, m_maincpu, MASTER_CLOCK/3/2); + static constexpr XTAL MASTER_CLOCK = XTAL(18'432'000); + + // basic machine hardware + Z80(config, m_maincpu, MASTER_CLOCK / 3 / 2); m_maincpu->set_addrmap(AS_PROGRAM, &crgolf_state::main_map); m_maincpu->set_vblank_int("screen", FUNC(crgolf_state::irq0_line_hold)); - Z80(config, m_audiocpu, MASTER_CLOCK/3/2); + Z80(config, m_audiocpu, MASTER_CLOCK / 3 / 2); m_audiocpu->set_addrmap(AS_PROGRAM, &crgolf_state::sound_map); m_audiocpu->set_vblank_int("screen", FUNC(crgolf_state::irq0_line_hold)); @@ -502,56 +726,55 @@ ls259_device &mainlatch(LS259(config, "mainlatch")); // 1H mainlatch.q_out_cb<3>().set(FUNC(crgolf_state::color_select_w)); mainlatch.q_out_cb<4>().set(FUNC(crgolf_state::screen_flip_w)); - mainlatch.q_out_cb<5>().set(FUNC(crgolf_state::screen_select_w)); - mainlatch.q_out_cb<6>().set(FUNC(crgolf_state::screenb_enable_w)); - mainlatch.q_out_cb<7>().set(FUNC(crgolf_state::screena_enable_w)); + mainlatch.q_out_cb<5>().set_membank("vrambank"); + mainlatch.q_out_cb<6>().set(FUNC(crgolf_state::screen_enable_w<1>)); + mainlatch.q_out_cb<7>().set(FUNC(crgolf_state::screen_enable_w<0>)); GENERIC_LATCH_8(config, "soundlatch1").data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI); GENERIC_LATCH_8(config, "soundlatch2").data_pending_callback().set_inputline(m_maincpu, INPUT_LINE_NMI); - /* stride is technically 0x6000, but powers of 2 makes the memory map / address masking cleaner. */ - ADDRESS_MAP_BANK(config, "vrambank").set_map(&crgolf_state::vrambank_map).set_options(ENDIANNESS_LITTLE, 8, 16, 0x8000); - - PALETTE(config, m_palette, FUNC(crgolf_state::crgolf_palette), 0x20); + PALETTE(config, m_palette, FUNC(crgolf_state::palette), 0x20); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(60); - screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ + screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); // not accurate screen.set_size(256, 256); screen.set_visarea(0, 255, 8, 247); - screen.set_screen_update(FUNC(crgolf_state::screen_update_crgolf)); + screen.set_screen_update(FUNC(crgolf_state::screen_update)); screen.set_palette(m_palette); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); - AY8910(config, "aysnd", MASTER_CLOCK/3/2/2).add_route(ALL_OUTPUTS, "mono", 1.0); + AY8910(config, "aysnd", MASTER_CLOCK / 3 / 2 / 2).add_route(ALL_OUTPUTS, "mono", 1.0); } -void crgolf_state::crgolfhi(machine_config &config) +void crgolfhi_state::crgolfhi(machine_config &config) { crgolf(config); + m_audiocpu->set_addrmap(AS_PROGRAM, &crgolfhi_state::sound_map); + MSM5205(config, m_msm, 384000); - m_msm->vck_legacy_callback().set(FUNC(crgolf_state::vck_callback)); + m_msm->vck_legacy_callback().set(FUNC(crgolfhi_state::vck_callback)); m_msm->set_prescaler_selector(msm5205_device::S64_4B); m_msm->add_route(ALL_OUTPUTS, "mono", 1.0); } -void crgolf_state::mastrglf(machine_config &config) +void mastrglf_state::mastrglf(machine_config &config) { crgolfhi(config); - /* basic machine hardware */ - m_maincpu->set_addrmap(AS_PROGRAM, &crgolf_state::mastrglf_map); - m_maincpu->set_addrmap(AS_IO, &crgolf_state::mastrglf_io); - m_maincpu->set_vblank_int("screen", FUNC(crgolf_state::irq0_line_hold)); + // basic machine hardware + m_maincpu->set_addrmap(AS_PROGRAM, &mastrglf_state::main_prg_map); + m_maincpu->set_addrmap(AS_IO, &mastrglf_state::main_io_map); + m_maincpu->set_vblank_int("screen", FUNC(mastrglf_state::irq0_line_hold)); + + m_audiocpu->set_addrmap(AS_PROGRAM, &mastrglf_state::sound_prg_map); + m_audiocpu->set_addrmap(AS_IO, &mastrglf_state::sound_io_map); + m_audiocpu->set_vblank_int("screen", FUNC(mastrglf_state::irq0_line_hold)); - m_audiocpu->set_addrmap(AS_PROGRAM, &crgolf_state::mastrglf_submap); - m_audiocpu->set_addrmap(AS_IO, &crgolf_state::mastrglf_subio); - m_audiocpu->set_vblank_int("screen", FUNC(crgolf_state::irq0_line_hold)); - - PALETTE(config.replace(), m_palette, FUNC(crgolf_state::mastrglf_palette), 0x100); + PALETTE(config.replace(), m_palette, FUNC(mastrglf_state::palette), 0x100); } @@ -588,7 +811,7 @@ ROM_LOAD( "pr5877.1s", 0x0000, 0x0020, CRC(f880b95d) SHA1(5ad0ee39e2b9befaf3895ec635d5865b7b1e562b) ) ROM_REGION( 0x0200, "plds", 0 ) // pal16l8 - ROM_LOAD( "cg.3e.bin", 0x0000, 0x0104, CRC(beef5560) SHA1(cd7462dea015151cf29029e2275e10b949537cd2) ) /* PAL is read protected */ + ROM_LOAD( "cg.3e.bin", 0x0000, 0x0104, CRC(beef5560) SHA1(cd7462dea015151cf29029e2275e10b949537cd2) ) // PAL is read protected ROM_END ROM_START( crgolfa ) // 834-5419-03 @@ -618,7 +841,7 @@ ROM_LOAD( "pr5877.1s", 0x0000, 0x0020, CRC(f880b95d) SHA1(5ad0ee39e2b9befaf3895ec635d5865b7b1e562b) ) ROM_REGION( 0x0200, "plds", 0 ) // pal16l8 - ROM_LOAD( "cg.3e.bin", 0x0000, 0x0104, CRC(beef5560) SHA1(cd7462dea015151cf29029e2275e10b949537cd2) ) /* PAL is read protected */ + ROM_LOAD( "cg.3e.bin", 0x0000, 0x0104, CRC(beef5560) SHA1(cd7462dea015151cf29029e2275e10b949537cd2) ) // PAL is read protected ROM_END @@ -766,21 +989,7 @@ ROM_LOAD( "tbp24s10n.2", 0x0200, 0x0100, NO_DUMP ) ROM_END - - - - -/************************************* - * - * Game-specific init - * - *************************************/ - -void crgolf_state::init_crgolfhi() -{ - m_audiocpu->space(AS_PROGRAM).install_write_handler(0xa000, 0xa003, write8sm_delegate(*this, FUNC(crgolf_state::crgolfhi_sample_w))); -} - +} // anonymous namespace /************************************* @@ -789,11 +998,11 @@ * *************************************/ -GAME( 1984, crgolf, 0, crgolf, crgolf, crgolf_state, empty_init, ROT0, "Nasco Japan", "Crowns Golf (834-5419-04)", MACHINE_SUPPORTS_SAVE ) -GAME( 1984, crgolfa, crgolf, crgolf, crgolfa, crgolf_state, empty_init, ROT0, "Nasco Japan", "Crowns Golf (834-5419-03)", MACHINE_SUPPORTS_SAVE ) -GAME( 1984, crgolfb, crgolf, crgolf, crgolfb, crgolf_state, empty_init, ROT0, "Nasco Japan", "Crowns Golf (set 3)", MACHINE_SUPPORTS_SAVE ) -GAME( 1984, crgolfc, crgolf, crgolf, crgolfb, crgolf_state, empty_init, ROT0, "Nasco Japan", "Champion Golf", MACHINE_SUPPORTS_SAVE ) -GAME( 1984, crgolfbt, crgolf, crgolf, crgolfb, crgolf_state, empty_init, ROT0, "bootleg", "Champion Golf (bootleg)", MACHINE_SUPPORTS_SAVE ) -GAME( 1985, crgolfhi, 0, crgolfhi, crgolfa, crgolf_state, init_crgolfhi, ROT0, "Nasco Japan", "Crowns Golf in Hawaii", MACHINE_SUPPORTS_SAVE ) +GAME( 1984, crgolf, 0, crgolf, crgolf, crgolf_state, empty_init, ROT0, "Nasco Japan", "Crowns Golf (834-5419-04)", MACHINE_SUPPORTS_SAVE ) +GAME( 1984, crgolfa, crgolf, crgolf, crgolfa, crgolf_state, empty_init, ROT0, "Nasco Japan", "Crowns Golf (834-5419-03)", MACHINE_SUPPORTS_SAVE ) +GAME( 1984, crgolfb, crgolf, crgolf, crgolfb, crgolf_state, empty_init, ROT0, "Nasco Japan", "Crowns Golf (set 3)", MACHINE_SUPPORTS_SAVE ) +GAME( 1984, crgolfc, crgolf, crgolf, crgolfb, crgolf_state, empty_init, ROT0, "Nasco Japan", "Champion Golf", MACHINE_SUPPORTS_SAVE ) +GAME( 1984, crgolfbt, crgolf, crgolf, crgolfb, crgolf_state, empty_init, ROT0, "bootleg", "Champion Golf (bootleg)", MACHINE_SUPPORTS_SAVE ) +GAME( 1985, crgolfhi, 0, crgolfhi, crgolfa, crgolfhi_state, empty_init, ROT0, "Nasco Japan", "Crowns Golf in Hawaii", MACHINE_SUPPORTS_SAVE ) -GAME( 1985, mastrglf, 0, mastrglf, crgolf, crgolf_state, empty_init, ROT0, "Nasco", "Master's Golf", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION ) +GAME( 1985, mastrglf, 0, mastrglf, crgolf, mastrglf_state, empty_init, ROT0, "Nasco", "Master's Golf", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/crshrace.cpp mame-0.243+dfsg.1/src/mame/drivers/crshrace.cpp --- mame-0.242+dfsg.1/src/mame/drivers/crshrace.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/crshrace.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -368,23 +368,10 @@ 128*8 }; -static const gfx_layout spritelayout = -{ - 16,16, - RGN_FRAC(1,1), - 4, - { 0, 1, 2, 3 }, - { 1*4, 0*4, 3*4, 2*4, 5*4, 4*4, 7*4, 6*4, - 9*4, 8*4, 11*4, 10*4, 13*4, 12*4, 15*4, 14*4 }, - { 0*64, 1*64, 2*64, 3*64, 4*64, 5*64, 6*64, 7*64, - 8*64, 9*64, 10*64, 11*64, 12*64, 13*64, 14*64, 15*64 }, - 128*8 -}; - static GFXDECODE_START( gfx_crshrace ) - GFXDECODE_ENTRY( "chars", 0, charlayout, 0, 1 ) - GFXDECODE_ENTRY( "tiles", 0, tilelayout, 256, 16 ) - GFXDECODE_ENTRY( "sprites", 0, spritelayout, 512, 32 ) + GFXDECODE_ENTRY( "chars", 0, charlayout, 0, 1 ) + GFXDECODE_ENTRY( "tiles", 0, tilelayout, 256, 16 ) + GFXDECODE_ENTRY( "sprites", 0, gfx_16x16x4_packed_lsb, 512, 32 ) GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/cybstorm.cpp mame-0.243+dfsg.1/src/mame/drivers/cybstorm.cpp --- mame-0.242+dfsg.1/src/mame/drivers/cybstorm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/cybstorm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -216,22 +216,10 @@ }; -static const gfx_layout molayout = -{ - 8,8, - RGN_FRAC(1,6), - 6, - { RGN_FRAC(5,6), RGN_FRAC(4,6), RGN_FRAC(3,6), RGN_FRAC(2,6), RGN_FRAC(1,6), RGN_FRAC(0,6) }, - { 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_cybstorm ) - GFXDECODE_ENTRY( "gfx2", 0, pflayout, 0, 16 ) /* sprites & playfield */ - GFXDECODE_ENTRY( "gfx3", 0, molayout, 4096, 64 ) /* sprites & playfield */ - GFXDECODE_ENTRY( "gfx1", 0, anlayout, 16384, 64 ) /* characters 8x8 */ + GFXDECODE_ENTRY( "gfx2", 0, pflayout, 0, 16 ) /* sprites & playfield */ + GFXDECODE_ENTRY( "gfx3", 0, gfx_8x8x6_planar, 4096, 64 ) /* sprites & playfield */ + GFXDECODE_ENTRY( "gfx1", 0, anlayout, 16384, 64 ) /* characters 8x8 */ GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/dblcrown.cpp mame-0.243+dfsg.1/src/mame/drivers/dblcrown.cpp --- mame-0.242+dfsg.1/src/mame/drivers/dblcrown.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/dblcrown.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -501,17 +501,6 @@ PORT_DIPSETTING( 0x00, DEF_STR( On ) ) INPUT_PORTS_END -static const gfx_layout char_8x8_layout = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { 0,1,2,3 }, - { 4,0, 12,8, 20,16, 28,24 }, - { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 }, - 32*8 -}; - static const gfx_layout char_16x16_layout = { 16,16, @@ -526,7 +515,7 @@ static GFXDECODE_START( gfx_dblcrown ) #ifdef DEBUG_VRAM - GFXDECODE_ENTRY( "vram", 0, char_8x8_layout, 0, 0x10 ) + GFXDECODE_ENTRY( "vram", 0, gfx_8x8x4_packed_lsb, 0, 0x10 ) #endif GFXDECODE_ENTRY( "gfx1", 0, char_16x16_layout, 0, 0x10 ) GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/dbox.cpp mame-0.243+dfsg.1/src/mame/drivers/dbox.cpp --- mame-0.242+dfsg.1/src/mame/drivers/dbox.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/dbox.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -466,9 +466,9 @@ uint16_t sysflash_r(offs_t offset); void sysflash_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); private: - uint16_t * m_sysflash; - uint32_t m_sf_mode; - uint32_t m_sf_state; + uint16_t * m_sysflash = nullptr; + uint32_t m_sf_mode = 0; + uint32_t m_sf_state = 0; #endif }; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/dbz.cpp mame-0.243+dfsg.1/src/mame/drivers/dbz.cpp --- mame-0.242+dfsg.1/src/mame/drivers/dbz.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/dbz.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -291,22 +291,9 @@ /**********************************************************************************/ -static const gfx_layout bglayout = -{ - 16,16, - RGN_FRAC(1,1), - 4, - { 0, 1, 2, 3 }, - { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4, 8*4, - 9*4, 10*4, 11*4, 12*4, 13*4, 14*4, 15*4 }, - { 0*64, 1*64, 2*64, 3*64, 4*64, 5*64, 6*64, 7*64, - 8*64, 9*64, 10*64, 11*64, 12*64, 13*64, 14*64, 15*64 }, - 128*8 -}; - static GFXDECODE_START( gfx_dbz ) - GFXDECODE_ENTRY( "gfx3", 0, bglayout, 0, 512 ) - GFXDECODE_ENTRY( "gfx4", 0, bglayout, 0, 512 ) + GFXDECODE_ENTRY( "gfx3", 0, gfx_16x16x4_packed_msb, 0, 512 ) + GFXDECODE_ENTRY( "gfx4", 0, gfx_16x16x4_packed_msb, 0, 512 ) GFXDECODE_END /**********************************************************************************/ diff -Nru mame-0.242+dfsg.1/src/mame/drivers/ddenlovr.cpp mame-0.243+dfsg.1/src/mame/drivers/ddenlovr.cpp --- mame-0.242+dfsg.1/src/mame/drivers/ddenlovr.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/ddenlovr.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -222,9 +222,6 @@ DECLARE_VIDEO_START(ddenlovr); private: DECLARE_MACHINE_START(rongrong); -protected: - DECLARE_MACHINE_START(hanakanz); -private: DECLARE_MACHINE_START(sryudens); DECLARE_VIDEO_START(mjflove); DECLARE_MACHINE_START(seljan2); @@ -392,9 +389,6 @@ void mjmyster_map(address_map &map); void mjmyster_portmap(address_map &map); void mjmywrld_portmap(address_map &map); -protected: - void hanakanz_map(address_map &map); -private: void mjschuka_portmap(address_map &map); void nettoqc_map(address_map &map); void quiz365_map(address_map &map); @@ -556,6 +550,9 @@ public: hanakanz_state(const machine_config &mconfig, device_type type, const char *tag) : ddenlovr_state(mconfig, type, tag) + , m_banked_nvram(*this, "nvram", 0x8000, ENDIANNESS_LITTLE) + , m_bank1(*this, "bank1") + , m_bank2(*this, "bank2") , m_led(*this, "led") { } @@ -572,6 +569,7 @@ void init_momotaro(); private: + DECLARE_MACHINE_START(hanakanz); DECLARE_VIDEO_START(hanakanz); DECLARE_MACHINE_RESET(hanakanz); @@ -616,6 +614,7 @@ void mjchuuka_get_romdata(); + void hanakanz_map(address_map &map); void daimyojn_portmap(address_map &map); void hanakanz_portmap(address_map &map); void hkagerou_portmap(address_map &map); @@ -626,6 +625,9 @@ void mjgnight_portmap(address_map &map); void mjreach1_portmap(address_map &map); + memory_share_creator m_banked_nvram; + required_memory_bank m_bank1; + required_memory_bank m_bank2; output_finder<> m_led; uint8_t m_romdata[2]{}; @@ -2738,16 +2740,16 @@ void hanakanz_state::hanakanz_rombank_w(uint8_t data) { - membank("bank1")->set_entry(data & 0x0f); - membank("bank2")->set_entry(((data & 0xf0) >> 4)); + m_bank1->set_entry(data & 0x0f); + m_bank2->set_entry((data & 0xf0) >> 4); } -void ddenlovr_state::hanakanz_map(address_map &map) +void hanakanz_state::hanakanz_map(address_map &map) { - map(0x0000, 0x5fff).rom(); // ROM - map(0x6000, 0x6fff).ram(); // RAM + map(0x0000, 0x5fff).rom(); // ROM + map(0x6000, 0x6fff).bankrw("bank0"); // RAM map(0x7000, 0x7fff).bankrw("bank2"); // RAM (Banked) - map(0x8000, 0xffff).bankr("bank1"); // ROM (Banked) + map(0x8000, 0xffff).bankr("bank1"); // ROM (Banked) } @@ -9709,11 +9711,13 @@ MACHINE_RESET_CALL_MEMBER(ddenlovr); } -MACHINE_START_MEMBER(ddenlovr_state,hanakanz) +MACHINE_START_MEMBER(hanakanz_state,hanakanz) { uint8_t *rom = memregion("maincpu")->base(); - membank("bank1")->configure_entries(0, 0x10, &rom[0x10000], 0x8000); - membank("bank2")->configure_entries(0, 0x10, &rom[0x90000], 0x1000); + membank("bank0")->set_base(&m_banked_nvram[0]); + m_bank1->configure_entries(0, 0x10, &rom[0], 0x8000); + m_bank2->configure_entries(0, 0x08, &m_banked_nvram[0], 0x1000); + m_bank2->configure_entries(0x08, 0x08, &m_banked_nvram[0], 0x1000); // mirror to be safe MACHINE_START_CALL_MEMBER(ddenlovr); } @@ -10065,6 +10069,8 @@ MCFG_MACHINE_START_OVERRIDE(hanakanz_state,hanakanz) MCFG_MACHINE_RESET_OVERRIDE(hanakanz_state,hanakanz) + NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); + /* video hardware */ SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_refresh_hz(60); @@ -10116,6 +10122,8 @@ MCFG_MACHINE_START_OVERRIDE(hanakanz_state,hanakanz) MCFG_MACHINE_RESET_OVERRIDE(hanakanz_state,hanakanz) + NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); + /* video hardware */ SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_refresh_hz(60.1656); // HSync 15.1015kHz @@ -10230,7 +10238,7 @@ tmpz.out_pa_callback().set(FUNC(ddenlovr_state::sryudens_rambank_w)); tmpz.out_pb_callback().set(FUNC(ddenlovr_state::mjflove_rombank_w)); - MCFG_MACHINE_START_OVERRIDE(ddenlovr_state,hanakanz) + MCFG_MACHINE_START_OVERRIDE(ddenlovr_state,sryudens) MCFG_MACHINE_RESET_OVERRIDE(ddenlovr_state,ddenlovr) /* video hardware */ @@ -10525,6 +10533,8 @@ MCFG_MACHINE_START_OVERRIDE(hanakanz_state,hanakanz) MCFG_MACHINE_RESET_OVERRIDE(hanakanz_state,hanakanz) + NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); + /* video hardware */ SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_refresh_hz(60); @@ -10620,7 +10630,7 @@ maincpu.out_pa_callback().set(FUNC(ddenlovr_state::sryudens_rambank_w)); maincpu.out_pb_callback().set(FUNC(ddenlovr_state::mjflove_rombank_w)); - MCFG_MACHINE_START_OVERRIDE(ddenlovr_state,hanakanz) + MCFG_MACHINE_START_OVERRIDE(ddenlovr_state,sryudens) MCFG_MACHINE_RESET_OVERRIDE(ddenlovr_state,ddenlovr) /* video hardware */ @@ -10742,9 +10752,11 @@ maincpu.out_p3_callback().set(FUNC(hanakanz_state::jongtei_dsw_keyb_w)); maincpu.in_p4_callback().set(FUNC(hanakanz_state::hanakanz_dsw_r)); - MCFG_MACHINE_START_OVERRIDE(hanakanz_state,mjflove) + MCFG_MACHINE_START_OVERRIDE(hanakanz_state,hanakanz) MCFG_MACHINE_RESET_OVERRIDE(hanakanz_state,hanakanz) + NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); + /* video hardware */ SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_refresh_hz(59.7922); // HSync 15.4248kHz @@ -11525,9 +11537,8 @@ ***************************************************************************/ ROM_START( hanakanz ) - ROM_REGION( 0x90000+16*0x1000, "maincpu", 0 ) /* Z80 Code */ + ROM_REGION( 0x80000, "maincpu", 0 ) /* Z80 Code */ ROM_LOAD( "50720.5b", 0x00000, 0x80000, CRC(dc40fcfc) SHA1(32c8b3d23039ac47504c881552572f2c22afa585) ) - ROM_RELOAD( 0x10000, 0x80000 ) ROM_REGION( 0x300000, "blitter", 0 ) /* blitter data */ ROM_LOAD16_BYTE( "50740.8b", 0x000000, 0x80000, CRC(999e70ce) SHA1(421c137b43522fbf9f3f5aa86692dc563af86880) ) @@ -11572,9 +11583,8 @@ ***************************************************************************/ ROM_START( hkagerou ) - ROM_REGION( 0x90000+16*0x1000, "maincpu", 0 ) /* ! KL5C80 Code ! */ + ROM_REGION( 0x80000, "maincpu", 0 ) /* ! KL5C80 Code ! */ ROM_LOAD( "nm5102.5b", 0x00000, 0x80000, CRC(c56c0856) SHA1(9b3c17c80498c9fa0ea91aa876aa4853c95ebb8c) ) - ROM_RELOAD( 0x10000, 0x80000 ) ROM_REGION( 0xe80000, "blitter", 0 ) /* blitter data */ @@ -11617,9 +11627,8 @@ ***************************************************************************/ ROM_START( kotbinyo ) - ROM_REGION( 0x90000+16*0x1000, "maincpu", 0 ) /* ! KL5C80 Code ! */ + ROM_REGION( 0x80000, "maincpu", 0 ) /* ! KL5C80 Code ! */ ROM_LOAD( "prg.5b", 0x00000, 0x80000, CRC(673c90d5) SHA1(0588c624a177423a483ce466c0ae66dfa511773e) ) - ROM_RELOAD( 0x10000, 0x80000 ) ROM_REGION( 0x280000, "blitter", 0 ) /* blitter data */ ROM_LOAD16_BYTE( "gfx.8b", 0x000000, 0x80000, CRC(126f3591) SHA1(f21236587f555035ec25f1a9f5eb651a533446b2) ) @@ -11650,9 +11659,8 @@ ***************************************************************************/ ROM_START( kotbinsp ) - ROM_REGION( 0x90000+16*0x1000, "maincpu", 0 ) /* ! KL5C80 Code ! */ + ROM_REGION( 0x80000, "maincpu", 0 ) /* ! KL5C80 Code ! */ ROM_LOAD( "prg.5c", 0x00000, 0x80000, CRC(c917f791) SHA1(78611118f7f33096364ea3e34e4cd5356c1d1cce) ) - ROM_RELOAD( 0x10000, 0x80000 ) ROM_REGION( 0x2000000, "blitter", 0 ) /* blitter data */ ROM_LOAD16_BYTE( "909036.8b", 0x000000, 0x100000, CRC(c468bdda) SHA1(4942d48815af55b5a6b1bd9debc7ce0051a33a49) ) @@ -11706,9 +11714,8 @@ ***************************************************************************/ ROM_START( mjreach1 ) - ROM_REGION( 0x90000+16*0x1000, "maincpu", 0 ) /* ! KL5C80 Code ! */ + ROM_REGION( 0x80000, "maincpu", 0 ) /* ! KL5C80 Code ! */ ROM_LOAD( "52602-n.5b", 0x00000, 0x80000, CRC(6bef7978) SHA1(56e38448fb03e868094d75e5b7de4e4f4a4e850a) ) - ROM_RELOAD( 0x10000, 0x80000 ) ROM_REGION( 0x500000, "blitter", 0 ) /* blitter data */ ROM_LOAD16_BYTE( "52604.8b", 0x000000, 0x100000, CRC(6ce01bb4) SHA1(800043d8203ab5560ed0b24e0a4e01c14b6a3ac0) ) @@ -11763,9 +11770,8 @@ ***************************************************************************/ ROM_START( mjchuuka ) - ROM_REGION( 0x90000+16*0x1000, "maincpu", 0 ) /* Z80 Code */ + ROM_REGION( 0x80000, "maincpu", 0 ) /* Z80 Code */ ROM_LOAD( "d12102.5b", 0x00000, 0x80000, CRC(585a0a8e) SHA1(94b3eede36117fe0a34b61454484c72cd7f0ce6a) ) - ROM_RELOAD( 0x10000, 0x80000 ) ROM_REGION( 0x300000, "blitter", ROMREGION_ERASEFF ) /* blitter data */ ROM_LOAD16_BYTE( "d12103.11c", 0x000000, 0x080000, CRC(83bfc841) SHA1(36547e737244f95004c598adeb46cebce9ab3231) ) @@ -11844,9 +11850,8 @@ ***************************************************************************/ ROM_START( mjdchuka ) - ROM_REGION( 0x90000+16*0x1000, "maincpu", 0 ) /* Z80 Code */ + ROM_REGION( 0x80000, "maincpu", 0 ) /* Z80 Code */ ROM_LOAD( "2.5b", 0x00000, 0x80000, CRC(7957b4e7) SHA1(8b76c15694e42ff0b2ec5aeae059bf342f6bf476) ) - ROM_RELOAD( 0x10000, 0x80000 ) ROM_REGION( 0x100000, "blitter", ROMREGION_ERASEFF ) /* blitter data */ ROM_LOAD16_BYTE( "3.11c", 0x000000, 0x080000, CRC(c66553c3) SHA1(6e5380fdb97cc8b52986f3a3a8cac43c0f38cf54) ) @@ -12740,9 +12745,8 @@ ***************************************************************************/ ROM_START( jongtei ) - ROM_REGION( 0x90000+16*0x1000, "maincpu", 0 ) /* Z80 Code */ + ROM_REGION( 0x80000, "maincpu", 0 ) /* Z80 Code */ ROM_LOAD( "53202.5b", 0x00000, 0x80000, CRC(fa95a7f2) SHA1(bb67d74acb8908c222acdc92ee13d4a644358aef) ) - ROM_RELOAD( 0x10000, 0x80000 ) ROM_REGION( 0x800000, "blitter", 0 ) /* blitter data */ ROM_LOAD( "53203.7b", 0x000000, 0x200000, CRC(55d6522a) SHA1(47996be70481a98ead10211645566613d20b5880) ) @@ -12764,9 +12768,8 @@ ***************************************************************************/ ROM_START( mjgnight ) - ROM_REGION( 0x90000+16*0x1000, "maincpu", 0 ) /* Z80 Code */ + ROM_REGION( 0x80000, "maincpu", 0 ) /* Z80 Code */ ROM_LOAD( "00302.5b", 0x00000, 0x80000, CRC(7169611a) SHA1(90744799b57001a4f6d0767db639362f24d3797c) ) - ROM_RELOAD( 0x10000, 0x80000 ) ROM_REGION( 0x800000, "blitter", 0 ) /* blitter data */ ROM_LOAD( "00303.7b", 0x000000, 0x200000, CRC(5b2f28a5) SHA1(12fff6d5736e58e32b0efd6d136952bc4c03e661) ) @@ -12882,9 +12885,8 @@ ***************************************************************************/ ROM_START( daimyojn ) - ROM_REGION( 0x90000+16*0x1000, "maincpu", 0 ) /* Z80 Code */ + ROM_REGION( 0x80000, "maincpu", 0 ) /* Z80 Code */ ROM_LOAD( "p0172.6b", 0x00000, 0x80000, CRC(478442bd) SHA1(50efe7e014a55a5e5ac359628438ad2963df181c) ) - ROM_RELOAD( 0x10000, 0x80000 ) ROM_REGION( 0x400000, "blitter", 0 ) /* blitter data */ ROM_LOAD( "t0173.7b", 0x000000, 0x200000, CRC(b54c7b02) SHA1(54a750708c91041caa89adb033d8133b409b0706) ) @@ -12895,9 +12897,8 @@ ROM_END ROM_START( momotaro ) - ROM_REGION( 0x90000+16*0x1000, "maincpu", 0 ) /* Z80 Code */ + ROM_REGION( 0x80000, "maincpu", 0 ) /* Z80 Code */ ROM_LOAD( "r0272m1.6e", 0x00000, 0x80000, CRC(71c83332) SHA1(c949cb9e23e5cc77dbd64fc28e62a88f1dc811a3) ) - ROM_RELOAD( 0x10000, 0x80000 ) ROM_REGION( 0x400000, "blitter", 0 ) /* blitter data */ // no table at top, half size or encrypted? diff -Nru mame-0.242+dfsg.1/src/mame/drivers/ddragon.cpp mame-0.243+dfsg.1/src/mame/drivers/ddragon.cpp --- mame-0.242+dfsg.1/src/mame/drivers/ddragon.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/ddragon.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -710,10 +710,10 @@ PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x08, DEF_STR( Normal ) ) PORT_DIPNAME( 0x30, 0x10, "Timer" ) PORT_DIPLOCATION("SW2:5,6") - PORT_DIPSETTING( 0x00, "60" ) - PORT_DIPSETTING( 0x10, "65" ) - PORT_DIPSETTING( 0x30, "70" ) - PORT_DIPSETTING( 0x20, "80" ) + PORT_DIPSETTING( 0x00, "Very Fast" ) + PORT_DIPSETTING( 0x10, "Fast" ) + PORT_DIPSETTING( 0x30, "Normal" ) + PORT_DIPSETTING( 0x20, "Slow" ) PORT_DIPNAME( 0xc0, 0x80, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:7,8") PORT_DIPSETTING( 0xc0, "1" ) PORT_DIPSETTING( 0x80, "2" ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/de_2.cpp mame-0.243+dfsg.1/src/mame/drivers/de_2.cpp --- mame-0.242+dfsg.1/src/mame/drivers/de_2.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/de_2.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -129,8 +129,8 @@ output_finder<> m_diag_digit; uint8_t m_sample_data = 0U; - bool m_more_data = 0; - bool m_nmi_enable = 0; + bool m_more_data = false; + bool m_nmi_enable = false; uint32_t m_segment1 = 0U; uint32_t m_segment2 = 0U; @@ -979,31 +979,31 @@ } // Anonymous namespace -GAME( 1990, bttf_a28, 0, de_type3, de2, de_2_state, empty_init, ROT0, "Data East", "Back to the Future - The Pinball (2.8)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1990, bttf_a27, bttf_a28, de_type3, de2, de_2_state, empty_init, ROT0, "Data East", "Back to the Future - The Pinball (2.7)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1990, bttf_a20, bttf_a28, de_type3, de2, de_2_state, empty_init, ROT0, "Data East", "Back to the Future - The Pinball (2.0)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1990, bttf_a21, bttf_a28, de_type3, de2, de_2_state, empty_init, ROT0, "Data East", "Back to the Future - The Pinball (2.1)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 199?, bttf_g27, bttf_a28, de_type3, de2, de_2_state, empty_init, ROT0, "Data East", "Back to the Future - The Pinball (2.7, Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1990, kiko_a10, 0, de_type3, de2, de_2_state, empty_init, ROT0, "Data East", "King Kong (1.0)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1987, lwar_a83, 0, de_type1, de2, de_2_state, empty_init, ROT0, "Data East", "Laser War (8.3)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1987, lwar_a81, lwar_a83, de_type1, de2, de_2_state, empty_init, ROT0, "Data East", "Laser War (8.1)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1987, lwar_e90, lwar_a83, de_type1, de2, de_2_state, empty_init, ROT0, "Data East", "Laser War (9.0 Europe)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1989, mnfb_c29, 0, de_type2_alpha3, de2, de_2_state, empty_init, ROT0, "Data East", "Monday Night Football (2.9, 50cts)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1989, mnfb_c27, mnfb_c29, de_type2_alpha3, de2, de_2_state, empty_init, ROT0, "Data East", "Monday Night Football (2.7, 50cts)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1990, poto_a32, 0, de_type2_alpha3, de2, de_2_state, empty_init, ROT0, "Data East", "The Phantom of the Opera (3.2)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1990, poto_a31, poto_a32, de_type2_alpha3, de2, de_2_state, empty_init, ROT0, "Data East", "The Phantom of the Opera (3.1)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1990, poto_a29, poto_a32, de_type2_alpha3, de2, de_2_state, empty_init, ROT0, "Data East", "The Phantom of the Opera (2.9)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1989, play_a24, 0, de_type2, de2, de_2_state, empty_init, ROT0, "Data East", "Playboy 35th Anniversary (2.4)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1989, robo_a34, 0, de_type3, de2, de_2_state, empty_init, ROT0, "Data East", "Robocop (3.4)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1989, robo_a30, robo_a34, de_type3, de2, de_2_state, empty_init, ROT0, "Data East", "Robocop (3.0)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1989, robo_a29, robo_a34, de_type3, de2, de_2_state, empty_init, ROT0, "Data East", "Robocop (2.9)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1988, ssvc_a26, 0, de_type2, de2, de_2_state, empty_init, ROT0, "Data East", "Secret Service (2.6)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1988, ssvc_b26, ssvc_a26, de_type2, de2, de_2_state, empty_init, ROT0, "Data East", "Secret Service (2.6 alternate sound)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1988, ssvc_a42, ssvc_a26, de_type2, de2, de_2_state, empty_init, ROT0, "Data East", "Secret Service (4.2 alternate sound)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1990, simp_a27, 0, de_type3, de2, de_2_state, empty_init, ROT0, "Data East", "The Simpsons (2.7)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1990, simp_a20, simp_a27, de_type3, de2, de_2_state, empty_init, ROT0, "Data East", "The Simpsons (2.0)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1988, tmac_a24, 0, de_type2, de2, de_2_state, empty_init, ROT0, "Data East", "Time Machine (2.4)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1988, tmac_a18, tmac_a24, de_type2, de2, de_2_state, empty_init, ROT0, "Data East", "Time Machine (1.8)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1988, tmac_g18, tmac_a24, de_type2, de2, de_2_state, empty_init, ROT0, "Data East", "Time Machine (1.8, Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1988, torp_e21, 0, de_type2, de2, de_2_state, empty_init, ROT0, "Data East", "Torpedo Alley (2.1, Europe)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1988, torp_a16, torp_e21, de_type2, de2, de_2_state, empty_init, ROT0, "Data East", "Torpedo Alley (1.6)", MACHINE_IS_SKELETON_MECHANICAL) +GAME( 1990, bttf_a28, 0, de_type3, de2, de_2_state, empty_init, ROT0, "Data East", "Back to the Future - The Pinball (2.8)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1990, bttf_a27, bttf_a28, de_type3, de2, de_2_state, empty_init, ROT0, "Data East", "Back to the Future - The Pinball (2.7)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1990, bttf_a20, bttf_a28, de_type3, de2, de_2_state, empty_init, ROT0, "Data East", "Back to the Future - The Pinball (2.0)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1990, bttf_a21, bttf_a28, de_type3, de2, de_2_state, empty_init, ROT0, "Data East", "Back to the Future - The Pinball (2.1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 199?, bttf_g27, bttf_a28, de_type3, de2, de_2_state, empty_init, ROT0, "Data East", "Back to the Future - The Pinball (2.7, Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1990, kiko_a10, 0, de_type3, de2, de_2_state, empty_init, ROT0, "Data East", "King Kong (1.0)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1987, lwar_a83, 0, de_type1, de2, de_2_state, empty_init, ROT0, "Data East", "Laser War (8.3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1987, lwar_a81, lwar_a83, de_type1, de2, de_2_state, empty_init, ROT0, "Data East", "Laser War (8.1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1987, lwar_e90, lwar_a83, de_type1, de2, de_2_state, empty_init, ROT0, "Data East", "Laser War (9.0 Europe)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1989, mnfb_c29, 0, de_type2_alpha3, de2, de_2_state, empty_init, ROT0, "Data East", "Monday Night Football (2.9, 50cts)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1989, mnfb_c27, mnfb_c29, de_type2_alpha3, de2, de_2_state, empty_init, ROT0, "Data East", "Monday Night Football (2.7, 50cts)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1990, poto_a32, 0, de_type2_alpha3, de2, de_2_state, empty_init, ROT0, "Data East", "The Phantom of the Opera (3.2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1990, poto_a31, poto_a32, de_type2_alpha3, de2, de_2_state, empty_init, ROT0, "Data East", "The Phantom of the Opera (3.1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1990, poto_a29, poto_a32, de_type2_alpha3, de2, de_2_state, empty_init, ROT0, "Data East", "The Phantom of the Opera (2.9)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1989, play_a24, 0, de_type2, de2, de_2_state, empty_init, ROT0, "Data East", "Playboy 35th Anniversary (2.4)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1989, robo_a34, 0, de_type3, de2, de_2_state, empty_init, ROT0, "Data East", "Robocop (3.4)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1989, robo_a30, robo_a34, de_type3, de2, de_2_state, empty_init, ROT0, "Data East", "Robocop (3.0)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1989, robo_a29, robo_a34, de_type3, de2, de_2_state, empty_init, ROT0, "Data East", "Robocop (2.9)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1988, ssvc_a26, 0, de_type2, de2, de_2_state, empty_init, ROT0, "Data East", "Secret Service (2.6)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1988, ssvc_b26, ssvc_a26, de_type2, de2, de_2_state, empty_init, ROT0, "Data East", "Secret Service (2.6 alternate sound)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1988, ssvc_a42, ssvc_a26, de_type2, de2, de_2_state, empty_init, ROT0, "Data East", "Secret Service (4.2 alternate sound)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1990, simp_a27, 0, de_type3, de2, de_2_state, empty_init, ROT0, "Data East", "The Simpsons (2.7)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1990, simp_a20, simp_a27, de_type3, de2, de_2_state, empty_init, ROT0, "Data East", "The Simpsons (2.0)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1988, tmac_a24, 0, de_type2, de2, de_2_state, empty_init, ROT0, "Data East", "Time Machine (2.4)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1988, tmac_a18, tmac_a24, de_type2, de2, de_2_state, empty_init, ROT0, "Data East", "Time Machine (1.8)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1988, tmac_g18, tmac_a24, de_type2, de2, de_2_state, empty_init, ROT0, "Data East", "Time Machine (1.8, Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1988, torp_e21, 0, de_type2, de2, de_2_state, empty_init, ROT0, "Data East", "Torpedo Alley (2.1, Europe)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1988, torp_a16, torp_e21, de_type2, de2, de_2_state, empty_init, ROT0, "Data East", "Torpedo Alley (1.6)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/de_3.cpp mame-0.243+dfsg.1/src/mame/drivers/de_3.cpp --- mame-0.242+dfsg.1/src/mame/drivers/de_3.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/de_3.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -107,8 +107,8 @@ void sample_w(uint8_t data); uint8_t m_sample_data = 0U; uint8_t m_sound_data = 0U; - bool m_more_data = 0; - bool m_nmi_enable = 0; + bool m_more_data = false; + bool m_nmi_enable = false; uint8_t switch_r(); void switch_w(uint8_t data); @@ -1941,105 +1941,105 @@ } // Anonymous namespace -GAME(1993, rab_320, 0, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Adventures of Rocky and Bullwinkle and Friends (USA 3.20, display A3.00)", MACHINE_IS_SKELETON_MECHANICAL) // ROCKY+BULLWINKLE AUGUST 12, 1993 USA CPU 3.20. DISPLAY VERSION- BULLWINKLE A3.00 5/24/1993 -GAME(1993, rab_130, rab_320, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Adventures of Rocky and Bullwinkle and Friends (USA 1.30, display A1.30)", MACHINE_IS_SKELETON_MECHANICAL) // ROCKY+BULLWINKLE APRIL 1, 1993 USA CPU 1.30. DISPLAY VERSION- BULLWINKLE A1.30 4/1/1993 -GAME(1993, rab_103s, rab_320, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Adventures of Rocky and Bullwinkle and Friends (USA 1.03, display S1.03)", MACHINE_IS_SKELETON_MECHANICAL) // ROCKY+BULLWINKLE FEBRUARY 3, 1993 USA CPU 1.03. DISPLAY VERSION- BULLWINKLE S1.03 2/2/1993 -GAME(1992, aar_101, 0, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Aaron Spelling (1.01)", MACHINE_IS_SKELETON_MECHANICAL) // AARON SPELLING V1.01 12/23/92 -GAME(1991, btmn_106, 0, de_3_dmd1, de3, de_3_state, empty_init, ROT0, "Data East", "Batman (USA 1.06, display A1.02)", MACHINE_IS_SKELETON_MECHANICAL) // BATMAN USA 1.06. DISP VER: BATMAN A1.02 -GAME(1991, btmn_103, btmn_106, de_3_dmd1, de3, de_3_state, empty_init, ROT0, "Data East", "Batman (USA 1.03, display A1.02)", MACHINE_IS_SKELETON_MECHANICAL) // BATMAN USA 1.03. DISP VER: BATMAN A1.02 -GAME(1991, btmn_103f, btmn_106, de_3_dmd1, de3, de_3_state, empty_init, ROT0, "Data East", "Batman (France 1.03, display F1.03)", MACHINE_IS_SKELETON_MECHANICAL) // BATMAN FRANCE 1.03. DISP VER: BATMAN F1.03 -GAME(1991, btmn_103g, btmn_106, de_3_dmd1, de3, de_3_state, empty_init, ROT0, "Data East", "Batman (Germany 1.03, display G1.04)", MACHINE_IS_SKELETON_MECHANICAL) // BATMAN GERMANY 1.03. DISP VER: BATMAN G1.04 -GAME(1991, btmn_101, btmn_106, de_3_dmd1, de3, de_3_state, empty_init, ROT0, "Data East", "Batman (USA 1.01, display A1.02)", MACHINE_IS_SKELETON_MECHANICAL) // BATMAN USA 1.01 -GAME(1991, ckpt_a17, 0, de_3_dmdo, de3, de_3_state, empty_init, ROT0, "Data East", "Checkpoint (1.7)", MACHINE_IS_SKELETON_MECHANICAL) // CP80 3/6/91 -GAME(1994, gnr_300, 0, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Guns N Roses (USA 3.00, display A3.00)", MACHINE_IS_SKELETON_MECHANICAL) // GUNS-N-ROSES AUGUST 21, 1994 USA CPU 3.00. DISPLAY VERSION- GNR A3.00 AUGUST 16, 1994 -GAME(1994, gnr_300f, gnr_300, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Guns N Roses (French 3.00, display F3.00)", MACHINE_IS_SKELETON_MECHANICAL) // GUNS-N-ROSES AUGUST 21, 1994 FRENCH CPU 3.00. DISPLAY VERSION- GNR F3.00 AUGUST 16, 1994 -GAME(1994, gnr_300d, gnr_300, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Guns N Roses (Dutch 3.00, display A3.00)", MACHINE_IS_SKELETON_MECHANICAL) // GUNS-N-ROSES AUGUST 21, 1994 DUTCH CPU 3.00. DISPLAY VERSION- GNR A3.00 AUGUST 16, 1994 -GAME(1994, gnr_200, gnr_300, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Guns N Roses (USA 2.00, display A3.00)", MACHINE_IS_SKELETON_MECHANICAL) // GUNS-N-ROSES JULY 5, 1994 USA CPU 2.00 -GAME(1992, hook_408, 0, de_3_dmd1, de3, de_3_state, empty_init, ROT0, "Data East", "Hook (USA 4.08, display A4.01)", MACHINE_IS_SKELETON_MECHANICAL) // HOOK USA 4.08. DISPLAY: HOOK A4.01 -GAME(1992, hook_404, hook_408, de_3_dmd1, de3, de_3_state, empty_init, ROT0, "Data East", "Hook (USA 4.04, display A4.01)", MACHINE_IS_SKELETON_MECHANICAL) // HOOK USA 4.04 -GAME(1992, hook_401, hook_408, de_3_dmd1, de3, de_3_state, empty_init, ROT0, "Data East", "Hook (USA 4.01, display A4.01)", MACHINE_IS_SKELETON_MECHANICAL) // HOOK USA 4.01 -GAME(1992, hook_401_p, hook_408, de_3_dmd1, de3, de_3_state, empty_init, ROT0, "Data East", "Hook (USA 4.01 with prototype sound, display A4.01)", MACHINE_IS_SKELETON_MECHANICAL) // HOOK USA 4.01 -GAME(1992, hook_e406, hook_408, de_3_dmd1, de3, de_3_state, empty_init, ROT0, "Data East", "Hook (UK 4.06, display A4.01)", MACHINE_IS_SKELETON_MECHANICAL) // HOOK U.K. 4.06 -GAME(1993, jupk_513, 0, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Jurassic Park (USA 5.13, display A5.10)", MACHINE_IS_SKELETON_MECHANICAL) // JURASSIC PARK SEP. 28, 1993 USA CPU 5.13. DISPLAY VERSION- JURASSIC A5.10 8/24/1993 -GAME(1993, jupk_501, jupk_513, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Jurassic Park (USA 5.01, display A5.01)", MACHINE_IS_SKELETON_MECHANICAL) // JURASSIC PARK JUNE 28, 1993 USA CPU 5.01. DISPLAY VERSION- JURASSIC A5.01 6/24/1993 -GAME(1993, jupk_501g, jupk_513, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Jurassic Park (USA 5.01 Germany, display G5.01)", MACHINE_IS_SKELETON_MECHANICAL) // JURASSIC PARK JUNE 28, 1993 USA CPU 5.01. DISPLAY VERSION- JURASSIC G5.01 6/24/1993 -GAME(1993, jupk_307, jupk_513, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Jurassic Park (USA 3.07, display A4.00)", MACHINE_IS_SKELETON_MECHANICAL) // JURASSIC PARK. MAY 25, 1993. USA CPU 3.05 -GAME(1993, jupk_305, jupk_513, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Jurassic Park (USA 3.05, display A4.00)", MACHINE_IS_SKELETON_MECHANICAL) // JURASSIC PARK. MAY 25, 1993. USA CPU 3.05 -GAME(1993, lah_112, 0, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Last Action Hero (USA 1.12, display A1.06)", MACHINE_IS_SKELETON_MECHANICAL) // LAST ACTION HERO NOV. 10, 1993 USA CPU 1.12. DISPLAY VERSION- ACTION HERO A1.06 11/11/1993 -GAME(1993, lah_110, lah_112, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Last Action Hero (USA 1.10, display A1.06)", MACHINE_IS_SKELETON_MECHANICAL) // LAST ACTION HERO OCT. 18, 1993 USA CPU 1.10 -GAME(1993, lah_xxx_s105, lah_112, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Last Action Hero (unknown CPU, display L1.05)", MACHINE_IS_SKELETON_MECHANICAL) // DISPLAY VERSION- ACTION HERO L1.05 11/11/1993 -GAME(1993, lah_108s, lah_112, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Last Action Hero (USA 1.08, display L1.04)", MACHINE_IS_SKELETON_MECHANICAL) // LAST ACTION HERO SEPT. 28, 1993 USA CPU 1.08. DISPLAY VERSION- ACTION HERO L1.04 9/5/1993 -GAME(1993, lah_107, lah_112, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Last Action Hero (USA 1.07, display A1.06)", MACHINE_IS_SKELETON_MECHANICAL) // LAST ACTION HERO SEPT. 22, 1993 USA CPU 1.07 -GAME(1993, lah_106c, lah_112, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Last Action Hero (Canada 1.06, display A1.04)", MACHINE_IS_SKELETON_MECHANICAL) // LAST ACTION HERO SEPT. 20, 1993 CANADA CPU 1.06. DISPLAY VERSION- ACTION HERO A1.04 9/5/1993 -GAME(1993, lah_104f, lah_112, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Last Action Hero (USA 1.04, display F1.01)", MACHINE_IS_SKELETON_MECHANICAL) // LAST ACTION HERO SEPT. 1, 1993 USA CPU 1.04. DISPLAY VERSION- ACTION HERO F1.01 8/18/1993 -GAME(1993, lah_104s, lah_112, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Last Action Hero (USA 1.04, display L1.02)", MACHINE_IS_SKELETON_MECHANICAL) // LAST ACTION HERO SEPT. 1, 1993 USA CPU 1.04. DISPLAY VERSION- ACTION HERO L1.02 8/30/1993 -GAME(1992, lw3_208, 0, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Lethal Weapon 3 (USA 2.08, display A2.06)", MACHINE_IS_SKELETON_MECHANICAL) // LW3 11/17/92 USA CPU 2.08. DISPLAY VERSION- LETHAL WEAPON A2.06 9/29/1992 -GAME(1992, lw3_207, lw3_208, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Lethal Weapon 3 (USA 2.07, display A2.06)", MACHINE_IS_SKELETON_MECHANICAL) // LW3 AUG 31, 1992 USA CPU 2.07 -GAME(1992, lw3_207c, lw3_208, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Lethal Weapon 3 (Canada 2.07, display A2.06)", MACHINE_IS_SKELETON_MECHANICAL) // LW3 AUG 31, 1992 CANADA CPU 2.07 -GAME(1992, lw3_205, lw3_208, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Lethal Weapon 3 (USA 2.05, display A2.05)", MACHINE_IS_SKELETON_MECHANICAL) // LW3 JULY 30, 1992 USA CPU 2.05. DISPLAY VERSION- LETHAL WEAPON A2.05 8/14/1992 -GAME(1992, lw3_204e, lw3_208, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Lethal Weapon 3 (England 2.04, display A2.02)", MACHINE_IS_SKELETON_MECHANICAL) // LW3 JULY 30. 1992 ENGLAND CPU 2.04. DISPLAY VERSION LETHAL WEAPON A2.02 7/17/1992 -GAME(1992, lw3_203, lw3_208, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Lethal Weapon 3 (USA 2.03, display A2.04)", MACHINE_IS_SKELETON_MECHANICAL) // LW3 JULY 17, 1992 USA CPU 2.03. DISPLAY VERSION- LETHAL WEAPON A2.04 7/29/1992 -GAME(1992, lw3_200, lw3_208, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Lethal Weapon 3 (USA 2.00, display A2.04)", MACHINE_IS_SKELETON_MECHANICAL) // LW3 JUNE 16, 1992 USA CPU 2.00. DISPLAY VERSION- LETHAL WEAPON A2.04 7/29/1992 -GAME(1992, mj_130, 0, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Michael Jordan (1.30, display A1.03)", MACHINE_IS_SKELETON_MECHANICAL) // MICHAEL JORDAN V 1.30 11/4/92. DISPLAY VERSION- JORDAN A1.03 8/13/1993 -GAME(1992, trek_201, 0, de_3_dmd1, de3, de_3_state, empty_init, ROT0, "Data East", "Star Trek 25th Anniversary (USA 2.01, display A1.09)", MACHINE_IS_SKELETON_MECHANICAL) // STARTREK 4/30/92 USA VER. 2.01. DISPLAY: STARTREK A1.09 -GAME(1992, trek_200, trek_201, de_3_dmd1, de3, de_3_state, empty_init, ROT0, "Data East", "Star Trek 25th Anniversary (USA 2.00, display A1.09)", MACHINE_IS_SKELETON_MECHANICAL) // STARTREK 4/16/92 USA VER. 2.00 -GAME(1992, trek_120, trek_201, de_3_dmd1, de3, de_3_state, empty_init, ROT0, "Data East", "Star Trek 25th Anniversary (USA 1.20, display A1.06)", MACHINE_IS_SKELETON_MECHANICAL) // STAR TREK 1/10 USA VER. 1.20. DISPLAY: STARTREK A1.06 -GAME(1992, trek_117, trek_201, de_3_dmd1, de3, de_3_state, empty_init, ROT0, "Data East", "Star Trek 25th Anniversary (USA 1.17, display A1.09)", MACHINE_IS_SKELETON_MECHANICAL) // STAR TREK 12/9 USA VER. 1.17 -GAME(1992, trek_110, trek_201, de_3_dmd1, de3, de_3_state, empty_init, ROT0, "Data East", "Star Trek 25th Anniversary (USA 1.10, display A1.06)", MACHINE_IS_SKELETON_MECHANICAL) // STAR TREK 11/14 USA VER. 1.10. DISPLAY: STARTREK A1.06 -GAME(1992, trek_110_a027, trek_201, de_3_dmd1, de3, de_3_state, empty_init, ROT0, "Data East", "Star Trek 25th Anniversary (USA 1.10, display A0.27)", MACHINE_IS_SKELETON_MECHANICAL) // STAR TREK 11/14 USA VER. 1.10. DISPLAY: STARTREK A0.27 -GAME(1992, stwr_106, 0, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Star Wars (Unofficial 1.06, display A1.05)", MACHINE_IS_SKELETON_MECHANICAL) // STAR WARS 2016 UNOFFICIAL 1.06. DISPLAY VERSION- STAR WARS A1.05 12/4/1992 -GAME(1992, stwr_106_s105, stwr_106, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Star Wars (Unofficial 1.06, display S1.05)", MACHINE_IS_SKELETON_MECHANICAL) // DISPLAY VERSION- STAR WARS S1.05 12/4/1992 -GAME(1992, stwr_106_a046, stwr_106, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Star Wars (Unofficial 1.06, display A0.46)", MACHINE_IS_SKELETON_MECHANICAL) // DISPLAY VERSION- STAR WARS A0.46 10/9/1992 -GAME(1992, stwr_104, stwr_106, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Star Wars (USA 1.04, display A1.05)", MACHINE_IS_SKELETON_MECHANICAL) // STAR WARS USA CPU 1.04 -GAME(1992, stwr_103, stwr_106, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Star Wars (USA 1.03, display A1.05)", MACHINE_IS_SKELETON_MECHANICAL) // STAR WARS USA CPU 1.03 -GAME(1992, stwr_103_a104, stwr_106, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Star Wars (USA 1.03, display A1.04)", MACHINE_IS_SKELETON_MECHANICAL) // STAR WARS USA CPU 1.03. DISPLAY VERSION- STAR WARS A1.04 11/20/1992 -GAME(1992, stwr_102, stwr_106, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Star Wars (USA 1.02, display A1.05)", MACHINE_IS_SKELETON_MECHANICAL) // STAR WARS USA CPU 1.02 -GAME(1992, stwr_102e, stwr_106, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Star Wars (England 1.02, display A1.05)", MACHINE_IS_SKELETON_MECHANICAL) // STAR WARS ENGLAND CPU 1.02 -GAME(1992, stwr_101, stwr_106, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Star Wars (USA 1.01, display A1.02)", MACHINE_IS_SKELETON_MECHANICAL) // STAR WARS USA CPU 1.01. DISPLAY VERSION- STAR WARS A1.02 10/29/1992 -GAME(1992, stwr_101g, stwr_106, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Star Wars (German 1.01, display G1.02)", MACHINE_IS_SKELETON_MECHANICAL) // STAR WARS GERMAN CPU 1.01. DISPLAY VERSION- STAR WARS G1.02 29/10/1992 -GAME(1993, tftc_303, 0, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Tales From the Crypt (USA 3.03, display A3.01)", MACHINE_IS_SKELETON_MECHANICAL) // TFTC FEBRUARY 22,1994 USA CPU 3.03. DISPLAY VERSION- CRYPT A3.01 12/28/1993 -GAME(1993, tftc_302, tftc_303, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Tales From the Crypt (Dutch 3.02, display A3.01)", MACHINE_IS_SKELETON_MECHANICAL) // TFTC JANUARY 06, 1994 DUTCH CPU 3.02 -GAME(1993, tftc_300, tftc_303, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Tales From the Crypt (USA 3.00, display A3.00)", MACHINE_IS_SKELETON_MECHANICAL) // TFTC DECEMBER 15, 1993 USA CPU 3.00. DISPLAY VERSION- CRYPT A3.00 12/16/1993 -GAME(1993, tftc_200, tftc_303, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Tales From the Crypt (USA 2.00, display A2.00)", MACHINE_IS_SKELETON_MECHANICAL) // TFTC DECEMBER 03, 1993 USA CPU 2.00. DISPLAY VERSION- CRYPT A2.00 12/3/1993 -GAME(1993, tftc_104s, tftc_303, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Tales From the Crypt (USA 1.04, display L1.03)", MACHINE_IS_SKELETON_MECHANICAL) // TFTC NOVEMBER 19, 1993 USA CPU 1.04. DISPLAY VERSION- CRYPT L1.03 11/11/1993 -GAME(1991, tmnt_104, 0, de_3_dmdo, de3, de_3_state, empty_init, ROT0, "Data East", "Teenage Mutant Ninja Turtles (USA 1.04, display A1.04)", MACHINE_IS_SKELETON_MECHANICAL) // T.M.N.T. USA 1.04. DISPLAY VER: TMNT A1.04 -GAME(1991, tmnt_104g, tmnt_104, de_3_dmdo, de3, de_3_state, empty_init, ROT0, "Data East", "Teenage Mutant Ninja Turtles (Germany 1.04, display A1.04)", MACHINE_IS_SKELETON_MECHANICAL) // T.M.N.T. GERMANY 1.04. -GAME(1991, tmnt_103, tmnt_104, de_3_dmdo, de3, de_3_state, empty_init, ROT0, "Data East", "Teenage Mutant Ninja Turtles (1.03)", MACHINE_IS_SKELETON_MECHANICAL) // T.M.N.T. A 1.03 -GAME(1991, tmnt_101, tmnt_104, de_3_dmdo, de3, de_3_state, empty_init, ROT0, "Data East", "Teenage Mutant Ninja Turtles (1.01)", MACHINE_IS_SKELETON_MECHANICAL) // T.M.N.T. A 1.01 -GAME(1994, tomy_400, 0, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "The Who's Tommy Pinball Wizard (USA 4.00, display A4.00)", MACHINE_IS_SKELETON_MECHANICAL) // TOMMY APRIL 6, 1994 USA CPU 4.00. DISPLAY VERSION- TOMMY A4.00 MAY 5, 1994 -GAME(1994, tomy_300h, tomy_400, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "The Who's Tommy Pinball Wizard (Dutch 3.00, display A3.00)", MACHINE_IS_SKELETON_MECHANICAL) // TOMMY FEBRUARY 16, 1994 DUTCH CPU 3.00. DISPLAY VERSION- TOMMY A3.00 FEBRUARY 15, 1994 -GAME(1994, tomy_102, tomy_400, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "The Who's Tommy Pinball Wizard (USA 1.02, display A3.00)", MACHINE_IS_SKELETON_MECHANICAL) // TOMMY JANUARY 26, 1994 USA CPU 1.02. DISPLAY VERSION- TOMMY A3.00 FEBRUARY 15, 1994 -GAME(1994, wwfr_106, 0, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "WWF Royal Rumble (USA 1.06, display A1.02)", MACHINE_IS_SKELETON_MECHANICAL) // RUMBLIN' AN' A TUMBLIN' WWF WRESTLING AUG. 01, 1994 USA CPU 1.06. DISPLAY VERSION- WWF A1.02 JUNE 29, 1994 -GAME(1994, wwfr_103, wwfr_106, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "WWF Royal Rumble (USA 1.03, display A1.01)", MACHINE_IS_SKELETON_MECHANICAL) // RUMBLIN' AN' A TUMBLIN' WWF WRESTLING APR. 28, 1994 USA CPU 1.03. DISPLAY VERSION- WWF A1.01 APRIL 14, 1994 -GAME(1994, wwfr_103f, wwfr_106, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "WWF Royal Rumble (French 1.03, display F1.01)", MACHINE_IS_SKELETON_MECHANICAL) // RUMBLIN' AN' A TUMBLIN' WWF WRESTLING APR. 28, 1994 FRENCH CPU 1.03. DISPLAY VERSION- WWF F1.01 APRIL 14, 1994 -GAME(1995, batmanf, 0, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Batman Forever (4.0)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1995, batmanf3, batmanf, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Batman Forever (3.0)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1995, batmanf2, batmanf, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Batman Forever (2.02)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1995, batmanf1, batmanf, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Batman Forever (1.02)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1995, bmf_uk, batmanf, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Batman Forever (English)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1995, bmf_cn, batmanf, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Batman Forever (Canadian)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1995, bmf_no, batmanf, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Batman Forever (Norwegian)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1995, bmf_sv, batmanf, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Batman Forever (Swedish)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1995, bmf_at, batmanf, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Batman Forever (Austrian)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1995, bmf_ch, batmanf, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Batman Forever (Swiss)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1995, bmf_de, batmanf, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Batman Forever (German)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1995, bmf_be, batmanf, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Batman Forever (Belgian)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1995, bmf_fr, batmanf, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Batman Forever (French)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1995, bmf_nl, batmanf, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Batman Forever (Dutch)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1995, bmf_it, batmanf, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Batman Forever (Italian)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1995, bmf_sp, batmanf, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Batman Forever (Spanish)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1995, bmf_jp, batmanf, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Batman Forever (Japanese)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1995, bmf_time, batmanf, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Batman Forever (Timed Play)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1995, baywatch, 0, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Baywatch", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1995, bay_d300, baywatch, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Baywatch (3.00 Dutch)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1995, bay_d400, baywatch, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Baywatch (4.00 English)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1995, bay_e400, baywatch, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Baywatch (4.00 Dutch)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1995, bay_f201, baywatch, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Baywatch (2.01 French)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1994, frankst, 0, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Mary Shelley's Frankenstein", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1995, frankstg, frankst, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Mary Shelley's Frankenstein (Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1994, mav_402, 0, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Maverick (Display Rev. 4.02)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1994, mav_401, mav_402, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Maverick (Display Rev. 4.01)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1994, mav_400, mav_402, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Maverick (Display Rev. 4.00)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1994, mav_100, mav_402, de_3b, de3, de_3_state, empty_init, ROT0, "Data East", "Maverick (1.00)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1998, detest, 0, detest, de3, de_3_state, empty_init, ROT0, "Data East", "Data East Test Chip", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1996, ctcheese, 0, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Cut The Cheese (Redemption)", MACHINE_IS_SKELETON_MECHANICAL) +GAME(1993, rab_320, 0, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Adventures of Rocky and Bullwinkle and Friends (USA 3.20, display A3.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // ROCKY+BULLWINKLE AUGUST 12, 1993 USA CPU 3.20. DISPLAY VERSION- BULLWINKLE A3.00 5/24/1993 +GAME(1993, rab_130, rab_320, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Adventures of Rocky and Bullwinkle and Friends (USA 1.30, display A1.30)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // ROCKY+BULLWINKLE APRIL 1, 1993 USA CPU 1.30. DISPLAY VERSION- BULLWINKLE A1.30 4/1/1993 +GAME(1993, rab_103s, rab_320, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Adventures of Rocky and Bullwinkle and Friends (USA 1.03, display S1.03)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // ROCKY+BULLWINKLE FEBRUARY 3, 1993 USA CPU 1.03. DISPLAY VERSION- BULLWINKLE S1.03 2/2/1993 +GAME(1992, aar_101, 0, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Aaron Spelling (1.01)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // AARON SPELLING V1.01 12/23/92 +GAME(1991, btmn_106, 0, de_3_dmd1, de3, de_3_state, empty_init, ROT0, "Data East", "Batman (USA 1.06, display A1.02)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // BATMAN USA 1.06. DISP VER: BATMAN A1.02 +GAME(1991, btmn_103, btmn_106, de_3_dmd1, de3, de_3_state, empty_init, ROT0, "Data East", "Batman (USA 1.03, display A1.02)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // BATMAN USA 1.03. DISP VER: BATMAN A1.02 +GAME(1991, btmn_103f, btmn_106, de_3_dmd1, de3, de_3_state, empty_init, ROT0, "Data East", "Batman (France 1.03, display F1.03)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // BATMAN FRANCE 1.03. DISP VER: BATMAN F1.03 +GAME(1991, btmn_103g, btmn_106, de_3_dmd1, de3, de_3_state, empty_init, ROT0, "Data East", "Batman (Germany 1.03, display G1.04)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // BATMAN GERMANY 1.03. DISP VER: BATMAN G1.04 +GAME(1991, btmn_101, btmn_106, de_3_dmd1, de3, de_3_state, empty_init, ROT0, "Data East", "Batman (USA 1.01, display A1.02)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // BATMAN USA 1.01 +GAME(1991, ckpt_a17, 0, de_3_dmdo, de3, de_3_state, empty_init, ROT0, "Data East", "Checkpoint (1.7)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // CP80 3/6/91 +GAME(1994, gnr_300, 0, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Guns N Roses (USA 3.00, display A3.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // GUNS-N-ROSES AUGUST 21, 1994 USA CPU 3.00. DISPLAY VERSION- GNR A3.00 AUGUST 16, 1994 +GAME(1994, gnr_300f, gnr_300, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Guns N Roses (French 3.00, display F3.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // GUNS-N-ROSES AUGUST 21, 1994 FRENCH CPU 3.00. DISPLAY VERSION- GNR F3.00 AUGUST 16, 1994 +GAME(1994, gnr_300d, gnr_300, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Guns N Roses (Dutch 3.00, display A3.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // GUNS-N-ROSES AUGUST 21, 1994 DUTCH CPU 3.00. DISPLAY VERSION- GNR A3.00 AUGUST 16, 1994 +GAME(1994, gnr_200, gnr_300, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Guns N Roses (USA 2.00, display A3.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // GUNS-N-ROSES JULY 5, 1994 USA CPU 2.00 +GAME(1992, hook_408, 0, de_3_dmd1, de3, de_3_state, empty_init, ROT0, "Data East", "Hook (USA 4.08, display A4.01)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // HOOK USA 4.08. DISPLAY: HOOK A4.01 +GAME(1992, hook_404, hook_408, de_3_dmd1, de3, de_3_state, empty_init, ROT0, "Data East", "Hook (USA 4.04, display A4.01)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // HOOK USA 4.04 +GAME(1992, hook_401, hook_408, de_3_dmd1, de3, de_3_state, empty_init, ROT0, "Data East", "Hook (USA 4.01, display A4.01)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // HOOK USA 4.01 +GAME(1992, hook_401_p, hook_408, de_3_dmd1, de3, de_3_state, empty_init, ROT0, "Data East", "Hook (USA 4.01 with prototype sound, display A4.01)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // HOOK USA 4.01 +GAME(1992, hook_e406, hook_408, de_3_dmd1, de3, de_3_state, empty_init, ROT0, "Data East", "Hook (UK 4.06, display A4.01)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // HOOK U.K. 4.06 +GAME(1993, jupk_513, 0, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Jurassic Park (USA 5.13, display A5.10)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // JURASSIC PARK SEP. 28, 1993 USA CPU 5.13. DISPLAY VERSION- JURASSIC A5.10 8/24/1993 +GAME(1993, jupk_501, jupk_513, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Jurassic Park (USA 5.01, display A5.01)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // JURASSIC PARK JUNE 28, 1993 USA CPU 5.01. DISPLAY VERSION- JURASSIC A5.01 6/24/1993 +GAME(1993, jupk_501g, jupk_513, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Jurassic Park (USA 5.01 Germany, display G5.01)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // JURASSIC PARK JUNE 28, 1993 USA CPU 5.01. DISPLAY VERSION- JURASSIC G5.01 6/24/1993 +GAME(1993, jupk_307, jupk_513, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Jurassic Park (USA 3.07, display A4.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // JURASSIC PARK. MAY 25, 1993. USA CPU 3.05 +GAME(1993, jupk_305, jupk_513, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Jurassic Park (USA 3.05, display A4.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // JURASSIC PARK. MAY 25, 1993. USA CPU 3.05 +GAME(1993, lah_112, 0, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Last Action Hero (USA 1.12, display A1.06)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // LAST ACTION HERO NOV. 10, 1993 USA CPU 1.12. DISPLAY VERSION- ACTION HERO A1.06 11/11/1993 +GAME(1993, lah_110, lah_112, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Last Action Hero (USA 1.10, display A1.06)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // LAST ACTION HERO OCT. 18, 1993 USA CPU 1.10 +GAME(1993, lah_xxx_s105, lah_112, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Last Action Hero (unknown CPU, display L1.05)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // DISPLAY VERSION- ACTION HERO L1.05 11/11/1993 +GAME(1993, lah_108s, lah_112, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Last Action Hero (USA 1.08, display L1.04)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // LAST ACTION HERO SEPT. 28, 1993 USA CPU 1.08. DISPLAY VERSION- ACTION HERO L1.04 9/5/1993 +GAME(1993, lah_107, lah_112, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Last Action Hero (USA 1.07, display A1.06)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // LAST ACTION HERO SEPT. 22, 1993 USA CPU 1.07 +GAME(1993, lah_106c, lah_112, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Last Action Hero (Canada 1.06, display A1.04)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // LAST ACTION HERO SEPT. 20, 1993 CANADA CPU 1.06. DISPLAY VERSION- ACTION HERO A1.04 9/5/1993 +GAME(1993, lah_104f, lah_112, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Last Action Hero (USA 1.04, display F1.01)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // LAST ACTION HERO SEPT. 1, 1993 USA CPU 1.04. DISPLAY VERSION- ACTION HERO F1.01 8/18/1993 +GAME(1993, lah_104s, lah_112, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Last Action Hero (USA 1.04, display L1.02)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // LAST ACTION HERO SEPT. 1, 1993 USA CPU 1.04. DISPLAY VERSION- ACTION HERO L1.02 8/30/1993 +GAME(1992, lw3_208, 0, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Lethal Weapon 3 (USA 2.08, display A2.06)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // LW3 11/17/92 USA CPU 2.08. DISPLAY VERSION- LETHAL WEAPON A2.06 9/29/1992 +GAME(1992, lw3_207, lw3_208, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Lethal Weapon 3 (USA 2.07, display A2.06)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // LW3 AUG 31, 1992 USA CPU 2.07 +GAME(1992, lw3_207c, lw3_208, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Lethal Weapon 3 (Canada 2.07, display A2.06)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // LW3 AUG 31, 1992 CANADA CPU 2.07 +GAME(1992, lw3_205, lw3_208, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Lethal Weapon 3 (USA 2.05, display A2.05)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // LW3 JULY 30, 1992 USA CPU 2.05. DISPLAY VERSION- LETHAL WEAPON A2.05 8/14/1992 +GAME(1992, lw3_204e, lw3_208, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Lethal Weapon 3 (England 2.04, display A2.02)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // LW3 JULY 30. 1992 ENGLAND CPU 2.04. DISPLAY VERSION LETHAL WEAPON A2.02 7/17/1992 +GAME(1992, lw3_203, lw3_208, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Lethal Weapon 3 (USA 2.03, display A2.04)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // LW3 JULY 17, 1992 USA CPU 2.03. DISPLAY VERSION- LETHAL WEAPON A2.04 7/29/1992 +GAME(1992, lw3_200, lw3_208, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Lethal Weapon 3 (USA 2.00, display A2.04)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // LW3 JUNE 16, 1992 USA CPU 2.00. DISPLAY VERSION- LETHAL WEAPON A2.04 7/29/1992 +GAME(1992, mj_130, 0, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Michael Jordan (1.30, display A1.03)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // MICHAEL JORDAN V 1.30 11/4/92. DISPLAY VERSION- JORDAN A1.03 8/13/1993 +GAME(1992, trek_201, 0, de_3_dmd1, de3, de_3_state, empty_init, ROT0, "Data East", "Star Trek 25th Anniversary (USA 2.01, display A1.09)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // STARTREK 4/30/92 USA VER. 2.01. DISPLAY: STARTREK A1.09 +GAME(1992, trek_200, trek_201, de_3_dmd1, de3, de_3_state, empty_init, ROT0, "Data East", "Star Trek 25th Anniversary (USA 2.00, display A1.09)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // STARTREK 4/16/92 USA VER. 2.00 +GAME(1992, trek_120, trek_201, de_3_dmd1, de3, de_3_state, empty_init, ROT0, "Data East", "Star Trek 25th Anniversary (USA 1.20, display A1.06)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // STAR TREK 1/10 USA VER. 1.20. DISPLAY: STARTREK A1.06 +GAME(1992, trek_117, trek_201, de_3_dmd1, de3, de_3_state, empty_init, ROT0, "Data East", "Star Trek 25th Anniversary (USA 1.17, display A1.09)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // STAR TREK 12/9 USA VER. 1.17 +GAME(1992, trek_110, trek_201, de_3_dmd1, de3, de_3_state, empty_init, ROT0, "Data East", "Star Trek 25th Anniversary (USA 1.10, display A1.06)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // STAR TREK 11/14 USA VER. 1.10. DISPLAY: STARTREK A1.06 +GAME(1992, trek_110_a027, trek_201, de_3_dmd1, de3, de_3_state, empty_init, ROT0, "Data East", "Star Trek 25th Anniversary (USA 1.10, display A0.27)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // STAR TREK 11/14 USA VER. 1.10. DISPLAY: STARTREK A0.27 +GAME(1992, stwr_106, 0, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Star Wars (Unofficial 1.06, display A1.05)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // STAR WARS 2016 UNOFFICIAL 1.06. DISPLAY VERSION- STAR WARS A1.05 12/4/1992 +GAME(1992, stwr_106_s105, stwr_106, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Star Wars (Unofficial 1.06, display S1.05)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // DISPLAY VERSION- STAR WARS S1.05 12/4/1992 +GAME(1992, stwr_106_a046, stwr_106, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Star Wars (Unofficial 1.06, display A0.46)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // DISPLAY VERSION- STAR WARS A0.46 10/9/1992 +GAME(1992, stwr_104, stwr_106, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Star Wars (USA 1.04, display A1.05)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // STAR WARS USA CPU 1.04 +GAME(1992, stwr_103, stwr_106, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Star Wars (USA 1.03, display A1.05)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // STAR WARS USA CPU 1.03 +GAME(1992, stwr_103_a104, stwr_106, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Star Wars (USA 1.03, display A1.04)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // STAR WARS USA CPU 1.03. DISPLAY VERSION- STAR WARS A1.04 11/20/1992 +GAME(1992, stwr_102, stwr_106, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Star Wars (USA 1.02, display A1.05)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // STAR WARS USA CPU 1.02 +GAME(1992, stwr_102e, stwr_106, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Star Wars (England 1.02, display A1.05)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // STAR WARS ENGLAND CPU 1.02 +GAME(1992, stwr_101, stwr_106, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Star Wars (USA 1.01, display A1.02)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // STAR WARS USA CPU 1.01. DISPLAY VERSION- STAR WARS A1.02 10/29/1992 +GAME(1992, stwr_101g, stwr_106, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Star Wars (German 1.01, display G1.02)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // STAR WARS GERMAN CPU 1.01. DISPLAY VERSION- STAR WARS G1.02 29/10/1992 +GAME(1993, tftc_303, 0, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Tales From the Crypt (USA 3.03, display A3.01)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // TFTC FEBRUARY 22,1994 USA CPU 3.03. DISPLAY VERSION- CRYPT A3.01 12/28/1993 +GAME(1993, tftc_302, tftc_303, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Tales From the Crypt (Dutch 3.02, display A3.01)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // TFTC JANUARY 06, 1994 DUTCH CPU 3.02 +GAME(1993, tftc_300, tftc_303, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Tales From the Crypt (USA 3.00, display A3.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // TFTC DECEMBER 15, 1993 USA CPU 3.00. DISPLAY VERSION- CRYPT A3.00 12/16/1993 +GAME(1993, tftc_200, tftc_303, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Tales From the Crypt (USA 2.00, display A2.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // TFTC DECEMBER 03, 1993 USA CPU 2.00. DISPLAY VERSION- CRYPT A2.00 12/3/1993 +GAME(1993, tftc_104s, tftc_303, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "Tales From the Crypt (USA 1.04, display L1.03)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // TFTC NOVEMBER 19, 1993 USA CPU 1.04. DISPLAY VERSION- CRYPT L1.03 11/11/1993 +GAME(1991, tmnt_104, 0, de_3_dmdo, de3, de_3_state, empty_init, ROT0, "Data East", "Teenage Mutant Ninja Turtles (USA 1.04, display A1.04)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // T.M.N.T. USA 1.04. DISPLAY VER: TMNT A1.04 +GAME(1991, tmnt_104g, tmnt_104, de_3_dmdo, de3, de_3_state, empty_init, ROT0, "Data East", "Teenage Mutant Ninja Turtles (Germany 1.04, display A1.04)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // T.M.N.T. GERMANY 1.04. +GAME(1991, tmnt_103, tmnt_104, de_3_dmdo, de3, de_3_state, empty_init, ROT0, "Data East", "Teenage Mutant Ninja Turtles (1.03)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // T.M.N.T. A 1.03 +GAME(1991, tmnt_101, tmnt_104, de_3_dmdo, de3, de_3_state, empty_init, ROT0, "Data East", "Teenage Mutant Ninja Turtles (1.01)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // T.M.N.T. A 1.01 +GAME(1994, tomy_400, 0, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "The Who's Tommy Pinball Wizard (USA 4.00, display A4.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // TOMMY APRIL 6, 1994 USA CPU 4.00. DISPLAY VERSION- TOMMY A4.00 MAY 5, 1994 +GAME(1994, tomy_300h, tomy_400, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "The Who's Tommy Pinball Wizard (Dutch 3.00, display A3.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // TOMMY FEBRUARY 16, 1994 DUTCH CPU 3.00. DISPLAY VERSION- TOMMY A3.00 FEBRUARY 15, 1994 +GAME(1994, tomy_102, tomy_400, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "The Who's Tommy Pinball Wizard (USA 1.02, display A3.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // TOMMY JANUARY 26, 1994 USA CPU 1.02. DISPLAY VERSION- TOMMY A3.00 FEBRUARY 15, 1994 +GAME(1994, wwfr_106, 0, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "WWF Royal Rumble (USA 1.06, display A1.02)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // RUMBLIN' AN' A TUMBLIN' WWF WRESTLING AUG. 01, 1994 USA CPU 1.06. DISPLAY VERSION- WWF A1.02 JUNE 29, 1994 +GAME(1994, wwfr_103, wwfr_106, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "WWF Royal Rumble (USA 1.03, display A1.01)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // RUMBLIN' AN' A TUMBLIN' WWF WRESTLING APR. 28, 1994 USA CPU 1.03. DISPLAY VERSION- WWF A1.01 APRIL 14, 1994 +GAME(1994, wwfr_103f, wwfr_106, de_3_dmd2, de3, de_3_state, empty_init, ROT0, "Data East", "WWF Royal Rumble (French 1.03, display F1.01)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // RUMBLIN' AN' A TUMBLIN' WWF WRESTLING APR. 28, 1994 FRENCH CPU 1.03. DISPLAY VERSION- WWF F1.01 APRIL 14, 1994 +GAME(1995, batmanf, 0, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Batman Forever (4.0)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, batmanf3, batmanf, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Batman Forever (3.0)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, batmanf2, batmanf, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Batman Forever (2.02)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, batmanf1, batmanf, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Batman Forever (1.02)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, bmf_uk, batmanf, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Batman Forever (English)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, bmf_cn, batmanf, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Batman Forever (Canadian)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, bmf_no, batmanf, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Batman Forever (Norwegian)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, bmf_sv, batmanf, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Batman Forever (Swedish)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, bmf_at, batmanf, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Batman Forever (Austrian)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, bmf_ch, batmanf, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Batman Forever (Swiss)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, bmf_de, batmanf, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Batman Forever (German)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, bmf_be, batmanf, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Batman Forever (Belgian)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, bmf_fr, batmanf, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Batman Forever (French)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, bmf_nl, batmanf, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Batman Forever (Dutch)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, bmf_it, batmanf, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Batman Forever (Italian)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, bmf_sp, batmanf, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Batman Forever (Spanish)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, bmf_jp, batmanf, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Batman Forever (Japanese)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, bmf_time, batmanf, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Batman Forever (Timed Play)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, baywatch, 0, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Baywatch", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, bay_d300, baywatch, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Baywatch (3.00 Dutch)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, bay_d400, baywatch, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Baywatch (4.00 English)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, bay_e400, baywatch, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Baywatch (4.00 Dutch)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, bay_f201, baywatch, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Baywatch (2.01 French)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, frankst, 0, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Mary Shelley's Frankenstein", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, frankstg, frankst, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Mary Shelley's Frankenstein (Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, mav_402, 0, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Maverick (Display Rev. 4.02)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, mav_401, mav_402, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Maverick (Display Rev. 4.01)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, mav_400, mav_402, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Maverick (Display Rev. 4.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, mav_100, mav_402, de_3b, de3, de_3_state, empty_init, ROT0, "Data East", "Maverick (1.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1998, detest, 0, detest, de3, de_3_state, empty_init, ROT0, "Data East", "Data East Test Chip", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1996, ctcheese, 0, de_3b, de3, de_3_state, empty_init, ROT0, "Sega", "Cut The Cheese (Redemption)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/deniam.cpp mame-0.243+dfsg.1/src/mame/drivers/deniam.cpp --- mame-0.242+dfsg.1/src/mame/drivers/deniam.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/deniam.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -200,21 +200,9 @@ -static const gfx_layout charlayout = -{ - 8,8, - RGN_FRAC(1,3), - 3, - { RGN_FRAC(2,3), RGN_FRAC(1,3), RGN_FRAC(0,3) }, - { 0, 1, 2, 3, 4, 5, 6, 7 }, - { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, - 8*8 -}; - - static GFXDECODE_START( gfx_deniam ) - GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 128 ) /* colors 0-1023 */ - /* sprites use colors 1024-2047 */ + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x3_planar, 0, 128 ) /* colors 0-1023 */ + /* sprites use colors 1024-2047 */ GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/dim68k.cpp mame-0.243+dfsg.1/src/mame/drivers/dim68k.cpp --- mame-0.242+dfsg.1/src/mame/drivers/dim68k.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/dim68k.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:R. Belmont, Robbbert +// copyright-holders:R. Belmont /*************************************************************************** Micro Craft Dimension 68000 diff -Nru mame-0.242+dfsg.1/src/mame/drivers/discoboy.cpp mame-0.243+dfsg.1/src/mame/drivers/discoboy.cpp --- mame-0.242+dfsg.1/src/mame/drivers/discoboy.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/discoboy.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -31,8 +31,8 @@ +------------------------------------------+ Notes: - Zilog Z0840004PSC (Z80 cpu, main program CPU) - Goldstar Z8400B PS (Z80 cpu, sound CPU) + Zilog Z0840004PSC (Z80 CPU, main program CPU) + Goldstar Z8400B PS (Z80 CPU, sound CPU) Yamaha YM3014/YM3812 (rebadged as 83142/5A12) OKI M5205 TI TPC1020AFN-084C @@ -42,17 +42,30 @@ #include "emu.h" + #include "cpu/z80/z80.h" #include "machine/74157.h" -#include "machine/bankdev.h" #include "machine/gen_latch.h" #include "sound/msm5205.h" #include "sound/ymopl.h" + #include "emupal.h" #include "screen.h" #include "speaker.h" +// configurable logging +#define LOG_UNKWRITE (1U << 1) + +//#define VERBOSE (LOG_GENERAL | LOG_UNKWRITE) + +#include "logmacro.h" + +#define LOGUNKWRITE(...) LOGMASKED(LOG_UNKWRITE, __VA_ARGS__) + + +namespace { + class discoboy_state : public driver_device { public: @@ -64,144 +77,119 @@ m_adpcm_select(*this, "adpcm_select"), m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette"), - m_soundlatch(*this, "soundlatch"), m_ram_att(*this, "att_ram"), - m_rambank1(*this, "rambank1"), - m_ram_1(*this, "ram_1"), - m_ram_2(*this, "ram_2") { } + m_palram(*this, "palram_%u", 1U, 0x800U, ENDIANNESS_LITTLE), + m_spriteram(*this, "spriteram", 0x1000U, ENDIANNESS_LITTLE), + m_tileram(*this, "tileram", 0x1000U, ENDIANNESS_LITTLE), + m_main_rombank(*this, "main_rombank"), + m_soundbank(*this, "soundbank"), + m_palrambank(*this, "palrambank"), + m_spritetilebank(*this, "spritetilebank") { } void discoboy(machine_config &config); - void init_discoboy(); +protected: + virtual void machine_start() override; + virtual void machine_reset() override; private: - /* video-related */ - uint8_t m_gfxbank = 0; - uint8_t m_port_00 = 0; + // video-related + uint8_t m_gfxbank = 0; + uint8_t m_port_00 = 0; - bool m_toggle = false; + bool m_toggle = false; - /* devices */ + // devices required_device m_maincpu; required_device m_audiocpu; required_device m_msm; required_device m_adpcm_select; required_device m_gfxdecode; required_device m_palette; - required_device m_soundlatch; - /* memory */ + // memory required_shared_ptr m_ram_att; - required_device m_rambank1; - required_shared_ptr m_ram_1; - required_shared_ptr m_ram_2; - uint8_t m_ram_3[0x1000]; - uint8_t m_ram_4[0x1000]; - void rambank_select_w(uint8_t data); + memory_share_array_creator m_palram; + memory_share_creator m_spriteram; + memory_share_creator m_tileram; + required_memory_bank m_main_rombank; + required_memory_bank m_soundbank; + required_memory_bank m_palrambank; + required_memory_bank m_spritetilebank; + + void palrambank_select_w(uint8_t data); void port_00_w(uint8_t data); void port_01_w(uint8_t data); void port_06_w(uint8_t data); - uint8_t rambank2_r(offs_t offset); - void rambank2_w(offs_t offset, uint8_t data); uint8_t port_06_r(); - void yunsung8_sound_bankswitch_w(uint8_t data); - virtual void machine_start() override; - virtual void machine_reset() override; + void sound_bankswitch_w(uint8_t data); uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); - DECLARE_WRITE_LINE_MEMBER(yunsung8_adpcm_int); - void discoboy_map(address_map &map); + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); + DECLARE_WRITE_LINE_MEMBER(adpcm_int); + void main_prg_map(address_map &map); void io_map(address_map &map); - void rambank1_map(address_map &map); - void sound_map(address_map &map); + void sound_prg_map(address_map &map); }; -void discoboy_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ) +void discoboy_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) { int flipscreen = 0; - int offs, sx, sy; - for (offs = 0x1000 - 0x40; offs >= 0; offs -= 0x20) + for (int offs = 0x1000 - 0x40; offs >= 0; offs -= 0x20) { - int code = m_ram_4[offs]; - int attr = m_ram_4[offs + 1]; + int code = m_spriteram[offs]; + int attr = m_spriteram[offs + 1]; int color = attr & 0x0f; - sx = m_ram_4[offs + 3] + ((attr & 0x10) << 4); - sy = ((m_ram_4[offs + 2] + 8) & 0xff) - 8; + int sx = m_spriteram[offs + 3] + ((attr & 0x10) << 4); + int sy = ((m_spriteram[offs + 2] + 8) & 0xff) - 8; code += (attr & 0xe0) << 3; if (code >= 0x400) { - if ((m_gfxbank & 0x30) == 0x00) - { - code = 0x400 + (code & 0x3ff); - } - else if ((m_gfxbank & 0x30) == 0x10) - { - code = 0x400 + (code & 0x3ff) + 0x400; - } - else if ((m_gfxbank & 0x30) == 0x20) - { - code = 0x400 + (code & 0x3ff) + 0x800; - } - else if ((m_gfxbank & 0x30) == 0x30) - { - code = 0x400 + (code & 0x3ff) + 0xc00; - } - else + switch (m_gfxbank & 0x30) { - code = machine().rand(); + case 0x00: code = 0x400 + (code & 0x3ff); break; + case 0x10: code = 0x400 + (code & 0x3ff) + 0x400; break; + case 0x20: code = 0x400 + (code & 0x3ff) + 0x800; break; + case 0x30: code = 0x400 + (code & 0x3ff) + 0xc00; break; + default: code = machine().rand(); } } - m_gfxdecode->gfx(0)->transpen(bitmap,cliprect, + m_gfxdecode->gfx(0)->transpen(bitmap, cliprect, code, color, - flipscreen,0, - sx,sy,15); + flipscreen, 0, + sx, sy, 15); } } uint32_t discoboy_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - uint16_t x, y; - int i; int count = 0; - for (i = 0; i < 0x800; i += 2) + for (int j = 0; j < 2; j++) { - uint16_t pal; - int r, g, b; - pal = m_ram_1[i] | (m_ram_1[i + 1] << 8); - - b = ((pal >> 0) & 0xf) << 4; - g = ((pal >> 4) & 0xf) << 4; - r = ((pal >> 8) & 0xf) << 4; - - m_palette->set_pen_color(i / 2, rgb_t(r, g, b)); - } + for (int i = 0; i < 0x800; i += 2) + { + uint16_t pal = m_palram[j][i] | (m_palram[j][i + 1] << 8); - for (i = 0; i < 0x800; i += 2) - { - uint16_t pal; - int r,g,b; - pal = m_ram_2[i] | (m_ram_2[i + 1] << 8); - - b = ((pal >> 0) & 0xf) << 4; - g = ((pal >> 4) & 0xf) << 4; - r = ((pal >> 8) & 0xf) << 4; + int b = ((pal >> 0) & 0xf) << 4; + int g = ((pal >> 4) & 0xf) << 4; + int r = ((pal >> 8) & 0xf) << 4; - m_palette->set_pen_color((i / 2) + 0x400, rgb_t(r, g, b)); + m_palette->set_pen_color((i / 2) + j * 0x400, rgb_t(r, g, b)); + } } bitmap.fill(0x3ff, cliprect); - for (y = 0; y < 32; y++) + for (uint8_t y = 0; y < 32; y++) { - for (x = 0; x < 64; x++) + for (uint8_t x = 0; x < 64; x++) { - uint16_t tileno = m_ram_3[count] | (m_ram_3[count + 1] << 8); + uint16_t tileno = m_tileram[count] | (m_tileram[count + 1] << 8); if (tileno > 0x2000) { @@ -223,78 +211,45 @@ return 0; } -void discoboy_state::rambank_select_w(uint8_t data) +void discoboy_state::palrambank_select_w(uint8_t data) { - if (data & 0x20) - m_rambank1->set_bank(1); - else - m_rambank1->set_bank(0); + m_palrambank->set_entry(BIT(data, 5)); - if (data &= 0x83) logerror("rambank_select_w !!!!!"); + if (data &= 0x83) LOGUNKWRITE("palrambank_select_w !!!!! %02x\n", data); } void discoboy_state::port_00_w(uint8_t data) { - if (data & 0xfe) logerror("unk port_00_w %02x\n",data); - m_port_00 = data; + if (data & 0xfe) LOGUNKWRITE("unk port_00_w %02x\n", data); + m_spritetilebank->set_entry(BIT(data, 0)); } void discoboy_state::port_01_w(uint8_t data) { // 00 10 20 30 during gameplay 1,2,3 other times?? title screen bit 0x40 toggle - //printf("unk port_01_w %02x\n",data); + LOGUNKWRITE("unk port_01_w %02x\n", data); // discoboy gfxbank m_gfxbank = data & 0xf0; - membank("mainbank")->set_entry(data & 0x07); + m_main_rombank->set_entry(data & 0x07); } void discoboy_state::port_06_w(uint8_t data) { - //printf("unk discoboy_port_06_w %02x\n",data); - if (data != 0) logerror("port 06!!!! %02x\n",data); -} - -uint8_t discoboy_state::rambank2_r(offs_t offset) -{ - if (m_port_00 == 0x00) - return m_ram_3[offset]; - else if (m_port_00 == 0x01) - return m_ram_4[offset]; - else - printf("unk rb2_r\n"); - - return machine().rand(); -} - -void discoboy_state::rambank2_w(offs_t offset, uint8_t data) -{ - if (m_port_00 == 0x00) - m_ram_3[offset] = data; - else if (m_port_00 == 0x01) - m_ram_4[offset] = data; - else - printf("unk rb2_w\n"); + if (data != 0) LOGUNKWRITE("port 06!!!! %02x\n",data); } -void discoboy_state::discoboy_map(address_map &map) +void discoboy_state::main_prg_map(address_map &map) { map(0x0000, 0x7fff).rom(); - map(0x8000, 0xbfff).bankr("mainbank"); - map(0xc000, 0xc7ff).m(m_rambank1, FUNC(address_map_bank_device::amap8)); - map(0xc800, 0xcfff).ram().share("att_ram"); - map(0xd000, 0xdfff).rw(FUNC(discoboy_state::rambank2_r), FUNC(discoboy_state::rambank2_w)); + map(0x8000, 0xbfff).bankr(m_main_rombank); + map(0xc000, 0xc7ff).bankrw(m_palrambank); + map(0xc800, 0xcfff).ram().share(m_ram_att); + map(0xd000, 0xdfff).bankrw(m_spritetilebank); map(0xe000, 0xefff).ram(); map(0xf000, 0xffff).ram(); } -void discoboy_state::rambank1_map(address_map &map) -{ - map(0x0000, 0x07ff).ram().share("ram_1"); - map(0x0800, 0x0fff).ram().share("ram_2"); -} - - uint8_t discoboy_state::port_06_r() { return 0x00; @@ -306,34 +261,34 @@ map(0x00, 0x00).portr("DSWA").w(FUNC(discoboy_state::port_00_w)); map(0x01, 0x01).portr("SYSTEM").w(FUNC(discoboy_state::port_01_w)); map(0x02, 0x02).portr("P1"); - map(0x03, 0x03).portr("P2").w(m_soundlatch, FUNC(generic_latch_8_device::write)); + map(0x03, 0x03).portr("P2").w("soundlatch", FUNC(generic_latch_8_device::write)); map(0x04, 0x04).portr("DSWB"); map(0x06, 0x06).rw(FUNC(discoboy_state::port_06_r), FUNC(discoboy_state::port_06_w)); // ??? - map(0x07, 0x07).w(FUNC(discoboy_state::rambank_select_w)); // 0x20 is palette bank bit.. others? + map(0x07, 0x07).w(FUNC(discoboy_state::palrambank_select_w)); // 0x20 is palette bank bit.. others? } -/* Sound */ +// Sound -void discoboy_state::yunsung8_sound_bankswitch_w(uint8_t data) +void discoboy_state::sound_bankswitch_w(uint8_t data) { - /* Note: this is bit 5 on yunsung8.cpp */ + // Note: this is bit 5 on yunsung8.cpp m_msm->reset_w((data & 0x08) >> 3); - membank("sndbank")->set_entry(data & 0x07); + m_soundbank->set_entry(data & 0x07); if (data != (data & (~0x0f))) - logerror("%s: Bank %02X\n", machine().describe_context(), data); + LOGUNKWRITE("%s: Bank %02X\n", machine().describe_context(), data); } -void discoboy_state::sound_map(address_map &map) +void discoboy_state::sound_prg_map(address_map &map) { map(0x0000, 0x7fff).rom(); - map(0x8000, 0xbfff).bankr("sndbank"); - map(0xe000, 0xe000).w(FUNC(discoboy_state::yunsung8_sound_bankswitch_w)); + map(0x8000, 0xbfff).bankr(m_soundbank); + map(0xe000, 0xe000).w(FUNC(discoboy_state::sound_bankswitch_w)); map(0xe400, 0xe400).w(m_adpcm_select, FUNC(ls157_device::ba_w)); map(0xec00, 0xec01).w("ymsnd", FUNC(ym3812_device::write)); map(0xf000, 0xf7ff).ram(); - map(0xf800, 0xf800).r(m_soundlatch, FUNC(generic_latch_8_device::read)); + map(0xf800, 0xf800).r("soundlatch", FUNC(generic_latch_8_device::read)); } @@ -428,13 +383,27 @@ }; static GFXDECODE_START( gfx_discoboy ) - GFXDECODE_ENTRY( "gfx1", 0, tiles8x8_layout, 0x000, 128 ) + GFXDECODE_ENTRY( "sprites", 0, tiles8x8_layout, 0x000, 128 ) GFXDECODE_ENTRY( "bgtiles", 0, tiles8x8_layout2, 0x000, 128 ) GFXDECODE_ENTRY( "bgtiles_bank", 0, tiles8x8_layout2, 0x000, 128 ) GFXDECODE_END void discoboy_state::machine_start() { + uint8_t *rom = memregion("maincpu")->base(); + uint8_t *audio = memregion("audiocpu")->base(); + + m_main_rombank->configure_entries(0, 8, &rom[0x10000], 0x4000); + m_main_rombank->set_entry(0); + m_soundbank->configure_entries(0, 8, &audio[0x00000], 0x4000); + m_soundbank->set_entry(0); + + m_palrambank->configure_entry(0, m_palram[0]); + m_palrambank->configure_entry(1, m_palram[1]); + + m_spritetilebank->configure_entry(0, m_tileram); + m_spritetilebank->configure_entry(1, m_spriteram); + save_item(NAME(m_port_00)); save_item(NAME(m_gfxbank)); save_item(NAME(m_toggle)); @@ -447,7 +416,7 @@ m_toggle = false; } -WRITE_LINE_MEMBER(discoboy_state::yunsung8_adpcm_int) +WRITE_LINE_MEMBER(discoboy_state::adpcm_int) { if (!state) return; @@ -459,18 +428,16 @@ void discoboy_state::discoboy(machine_config &config) { - /* basic machine hardware */ - Z80(config, m_maincpu, XTAL(12'000'000)/2); /* 6 MHz? */ - m_maincpu->set_addrmap(AS_PROGRAM, &discoboy_state::discoboy_map); + // basic machine hardware + Z80(config, m_maincpu, XTAL(12'000'000) / 2); // 6 MHz? + m_maincpu->set_addrmap(AS_PROGRAM, &discoboy_state::main_prg_map); m_maincpu->set_addrmap(AS_IO, &discoboy_state::io_map); m_maincpu->set_vblank_int("screen", FUNC(discoboy_state::irq0_line_hold)); - Z80(config, m_audiocpu, XTAL(10'000'000)/2); /* 5 MHz? */ - m_audiocpu->set_addrmap(AS_PROGRAM, &discoboy_state::sound_map); + Z80(config, m_audiocpu, XTAL(10'000'000) / 2); // 5 MHz? + m_audiocpu->set_addrmap(AS_PROGRAM, &discoboy_state::sound_prg_map); - ADDRESS_MAP_BANK(config, "rambank1").set_map(&discoboy_state::rambank1_map).set_options(ENDIANNESS_BIG, 8, 13, 0x800); - - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(60); screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); @@ -482,14 +449,13 @@ GFXDECODE(config, m_gfxdecode, m_palette, gfx_discoboy); PALETTE(config, m_palette).set_entries(0x1000); - /* sound hardware */ + // sound hardware SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - GENERIC_LATCH_8(config, m_soundlatch); - m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, 0); + GENERIC_LATCH_8(config, "soundlatch").data_pending_callback().set_inputline(m_audiocpu, 0); - ym3812_device &ymsnd(YM3812(config, "ymsnd", XTAL(10'000'000)/4)); /* 2.5 MHz? */ + ym3812_device &ymsnd(YM3812(config, "ymsnd", XTAL(10'000'000) / 4)); // 2.5 MHz? ymsnd.add_route(ALL_OUTPUTS, "lspeaker", 0.6); ymsnd.add_route(ALL_OUTPUTS, "rspeaker", 0.6); @@ -497,8 +463,8 @@ m_adpcm_select->out_callback().set("msm", FUNC(msm5205_device::data_w)); MSM5205(config, m_msm, XTAL(400'000)); - m_msm->vck_legacy_callback().set(FUNC(discoboy_state::yunsung8_adpcm_int)); /* interrupt function */ - m_msm->set_prescaler_selector(msm5205_device::S96_4B); /* 4KHz, 4 Bits */ + m_msm->vck_legacy_callback().set(FUNC(discoboy_state::adpcm_int)); // interrupt function + m_msm->set_prescaler_selector(msm5205_device::S96_4B); // 4KHz, 4 Bits m_msm->add_route(ALL_OUTPUTS, "lspeaker", 0.80); m_msm->add_route(ALL_OUTPUTS, "rspeaker", 0.80); } @@ -513,7 +479,7 @@ ROM_LOAD( "2.u28", 0x00000, 0x10000, CRC(7c2ed174) SHA1(ace209dc4cc7a4ffca062842defd84cefc5b10d2) ) ROM_LOAD( "1.u45", 0x10000, 0x10000, CRC(c266c6df) SHA1(f76e38ded43f56a486cf6569c679ddb57a4165fb) ) - ROM_REGION( 0x100000, "gfx1", ROMREGION_INVERT ) + ROM_REGION( 0x100000, "sprites", ROMREGION_INVERT ) ROM_LOAD( "5.u94", 0x00000, 0x10000, CRC(dbd20836) SHA1(d97651626b1dc16b93f8aed28bac19fd177e626f) ) ROM_LOAD( "6.u124", 0x10000, 0x40000, CRC(e20d41f8) SHA1(792294a34840867072bc484d6f3cae3502c8bc28) ) ROM_LOAD( "7.u95", 0x80000, 0x10000, CRC(1d5617a2) SHA1(6b6bd50c1984748dc8bf6600431d9bb6fe443873) ) @@ -542,7 +508,7 @@ ROM_LOAD( "discob.u28", 0x00000, 0x10000, CRC(7c2ed174) SHA1(ace209dc4cc7a4ffca062842defd84cefc5b10d2) ) ROM_LOAD( "discob.u45", 0x10000, 0x10000, CRC(c266c6df) SHA1(f76e38ded43f56a486cf6569c679ddb57a4165fb) ) - ROM_REGION( 0x100000, "gfx1", ROMREGION_INVERT ) + ROM_REGION( 0x100000, "sprites", ROMREGION_INVERT ) ROM_LOAD( "discob.u94", 0x00000, 0x10000, CRC(c436f1e5) SHA1(511e23b85f1b4fc732bd9648c0582848c20e6378) ) ROM_LOAD( "discob.u124", 0x10000, 0x40000, CRC(0b0bf653) SHA1(ce609e9ee270eda6e74612ed5334fd6c3c81ef18) ) ROM_LOAD( "discob.u95", 0x80000, 0x10000, CRC(ddea540e) SHA1(b69b94409bb15174f7780c637b183a2563c3d6c3) ) @@ -561,23 +527,8 @@ ROM_LOAD( "discob.u49", 0x0c0000, 0x40000, CRC(9f884db4) SHA1(fd916b0ac54961bbd9b3f23d3ee5d35d747cbf17) ) ROM_END -void discoboy_state::init_discoboy() -{ - uint8_t *ROM = memregion("maincpu")->base(); - uint8_t *AUDIO = memregion("audiocpu")->base(); - - memset(m_ram_3, 0, sizeof(m_ram_3)); - memset(m_ram_4, 0, sizeof(m_ram_4)); - - save_item(NAME(m_ram_3)); - save_item(NAME(m_ram_4)); - - membank("mainbank")->configure_entries(0, 8, &ROM[0x10000], 0x4000); - membank("mainbank")->set_entry(0); - membank("sndbank")->configure_entries(0, 8, &AUDIO[0x00000], 0x4000); - membank("sndbank")->set_entry(0); -} +} // anonymous namespace -GAME( 1993, discoboy, 0, discoboy, discoboy, discoboy_state, init_discoboy, ROT270, "Soft Art Co.", "Disco Boy", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 1993, discoboyp, discoboy, discoboy, discoboy, discoboy_state, init_discoboy, ROT270, "Soft Art Co.", "Disco Boy (Promat license?)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1993, discoboy, 0, discoboy, discoboy, discoboy_state, empty_init, ROT270, "Soft Art Co.", "Disco Boy", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1993, discoboyp, discoboy, discoboy, discoboy, discoboy_state, empty_init, ROT270, "Soft Art Co.", "Disco Boy (Promat license?)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/diverboy.cpp mame-0.243+dfsg.1/src/mame/drivers/diverboy.cpp --- mame-0.242+dfsg.1/src/mame/drivers/diverboy.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/diverboy.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -251,22 +251,9 @@ -static const gfx_layout diverboy_spritelayout = -{ - 16,16, - RGN_FRAC(1,1), - 4, - { 0,1,2,3 }, - { 4, 0, 12, 8, 20, 16, 28, 24, - 36, 32, 44, 40, 52, 48, 60, 56 }, - { 0*64, 1*64, 2*64, 3*64, 4*64, 5*64, 6*64, 7*64, - 8*64, 9*64, 10*64, 11*64, 12*64, 13*64, 14*64, 15*64 }, - 16*64 -}; - static GFXDECODE_START( gfx_diverboy ) - GFXDECODE_ENTRY( "gfx1", 0, diverboy_spritelayout, 0, 4*16 ) - GFXDECODE_ENTRY( "gfx2", 0, diverboy_spritelayout, 0, 4*16 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_16x16x4_packed_lsb, 0, 4*16 ) + GFXDECODE_ENTRY( "gfx2", 0, gfx_16x16x4_packed_lsb, 0, 4*16 ) GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/docastle.cpp mame-0.243+dfsg.1/src/mame/drivers/docastle.cpp --- mame-0.242+dfsg.1/src/mame/drivers/docastle.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/docastle.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -513,17 +513,6 @@ /* Graphics Layouts */ -static const gfx_layout charlayout = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { 0, 1, 2, 3 }, - { STEP8(0,4) }, - { STEP8(0,32) }, - 32*8 -}; - static const gfx_layout spritelayout = { 16,16, @@ -538,7 +527,7 @@ /* Graphics Decode Information */ static GFXDECODE_START( gfx_docastle ) - GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 64 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x4_packed_msb, 0, 64 ) GFXDECODE_ENTRY( "gfx2", 0, spritelayout, 0, 32*2 ) GFXDECODE_END @@ -1033,8 +1022,8 @@ ROM_REGION( 0x8000, "gfx1", 0 ) ROM_LOAD( "indoor.e6", 0x0000, 0x4000, CRC(a57c7a11) SHA1(9faebad0050da05101811427f350e163a7811396) ) - // some graphic / sound roms also differ on this set - verify them - // the sound rom causes bad sound, but the implementation is hacked anyway so I'm not 100% convinced it's bad yet + // some graphic / sound ROMs also differ on this set - verify them + // the sound ROM causes bad sound, but the implementation is hacked ROM_REGION( 0x20000, "gfx2", 0 ) ROM_LOAD( "indoor.p3", 0x00000, 0x8000, CRC(b42a6f4a) SHA1(ddce4438b3649610bd3703cbd7592aaa9a3eda0e) ) ROM_LOAD( "indoor.n3", 0x08000, 0x8000, CRC(fa2b1c77) SHA1(0d8e9db065c76621deb58575f01c6ec5ee6cf6b0) ) @@ -1042,7 +1031,7 @@ ROM_LOAD( "indoor.k3", 0x18000, 0x8000, CRC(a2a69223) SHA1(6bd9b76e0119643450c9f64c80b52e9056da82d6) ) ROM_REGION( 0x10000, "adpcm", 0 ) - ROM_LOAD( "indoor.ic1", 0x0000, 0x4000, CRC(3bb65dc7) SHA1(499151903b3da9fa2455b3d2c04863b3e33e853d) ) // different (causes bad sound in attract, but doesn't simply look like a bad dump?) + ROM_LOAD( "indoor.ic1", 0x0000, 0x4000, CRC(3bb65dc7) SHA1(499151903b3da9fa2455b3d2c04863b3e33e853d) ) // different (causes bad sound in attract, but isn't a bad dump since it has been confirmed on multiple boards) ROM_LOAD( "indoor.ic3", 0x8000, 0x4000, CRC(27bebba3) SHA1(cf752b22603c1e2a0b33958481c652d6d56ebf68) ) ROM_LOAD( "indoor.ic4", 0xc000, 0x4000, CRC(dd5ffaa2) SHA1(4bc4330a54ca93448a8fe05207d3fb1a3a9872e1) ) @@ -1050,6 +1039,37 @@ ROM_LOAD( "indoor.d3", 0x0000, 0x0200, CRC(d9b2550c) SHA1(074253b1ede42a743f1a8858756640693126209f) ) // different ROM_END +ROM_START( idsoccert ) // UNIVERSAL 8461-A (with TECFRI SA logo) + UNIVERSAL 8461-SUB-1 PCBs. Uses a SY6845BA with a 10MHz XTAL instead. + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "1.e10", 0x0000, 0x2000, CRC(1fa5ad7d) SHA1(f9d8dd0c8300085e84472014f8573cad637dbea2) ) + ROM_LOAD( "2.f10", 0x2000, 0x2000, CRC(68b9764b) SHA1(73811d71aef4c43ea99a8a578b38e7836d377536) ) + ROM_LOAD( "3.h10", 0x6000, 0x2000, CRC(5baabe1f) SHA1(12afaeac45ce03499614708edd171f20f3b4a73d) ) + + ROM_REGION( 0x10000, "slave", 0 ) + ROM_LOAD( "9.e2", 0x0000, 0x4000, CRC(c4bacc14) SHA1(d457a24b084726fe6b2f97a1be44e67c0a61a97b) ) + + ROM_REGION( 0x10000, "cpu3", 0 ) + ROM_LOAD( "82s147.p8", 0x0000, 0x0200, CRC(2747ca77) SHA1(abc0ca05925974c4b852827605ee2f1caefb8524) ) + + ROM_REGION( 0x8000, "gfx1", 0 ) + ROM_LOAD( "4.e6", 0x0000, 0x4000, CRC(a57c7a11) SHA1(9faebad0050da05101811427f350e163a7811396) ) + + ROM_REGION( 0x20000, "gfx2", 0 ) + ROM_LOAD( "8.p3", 0x00000, 0x8000, CRC(b42a6f4a) SHA1(ddce4438b3649610bd3703cbd7592aaa9a3eda0e) ) + ROM_LOAD( "7.n3", 0x08000, 0x8000, CRC(fa2b1c77) SHA1(0d8e9db065c76621deb58575f01c6ec5ee6cf6b0) ) + ROM_LOAD( "6.l3", 0x10000, 0x8000, CRC(2663405c) SHA1(16c054c5c16ace80941523a64654afa3a77d7611) ) + ROM_LOAD( "5.k3", 0x18000, 0x8000, CRC(a2a69223) SHA1(6bd9b76e0119643450c9f64c80b52e9056da82d6) ) + + ROM_REGION( 0x10000, "adpcm", 0 ) + ROM_LOAD( "10_sub-1.ic1", 0x0000, 0x4000, CRC(3bb65dc7) SHA1(499151903b3da9fa2455b3d2c04863b3e33e853d) ) + // ic2 empty + ROM_LOAD( "11_sub-1.ic3", 0x8000, 0x4000, CRC(27bebba3) SHA1(cf752b22603c1e2a0b33958481c652d6d56ebf68) ) + ROM_LOAD( "12_sub-1.ic4", 0xc000, 0x4000, CRC(3bb65dc7) SHA1(499151903b3da9fa2455b3d2c04863b3e33e853d) ) // same as ic1, verified. Really strange. Manufacturing error? + + ROM_REGION( 0x0200, "proms", 0 ) + ROM_LOAD( "4_82s147.d3", 0x0000, 0x0200, CRC(d9b2550c) SHA1(074253b1ede42a743f1a8858756640693126209f) ) +ROM_END + /* American Soccer @@ -1104,5 +1124,6 @@ GAME( 1984, jjack, 0, dorunrun, jjack, docastle_state, empty_init, ROT270, "Universal", "Jumping Jack", MACHINE_SUPPORTS_SAVE ) GAME( 1984, kickridr, 0, dorunrun, kickridr, docastle_state, empty_init, ROT0, "Universal", "Kick Rider", MACHINE_SUPPORTS_SAVE ) GAME( 1985, idsoccer, 0, idsoccer, idsoccer, docastle_state, empty_init, ROT0, "Universal", "Indoor Soccer (set 1)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL ) -GAME( 1985, idsoccera, idsoccer, idsoccer, idsoccer, docastle_state, empty_init, ROT0, "Universal", "Indoor Soccer (set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) -GAME( 1987, asoccer, idsoccer, idsoccer, idsoccer, docastle_state, empty_init, ROT0, "Universal", "American Soccer", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) +GAME( 1985, idsoccera, idsoccer, idsoccer, idsoccer, docastle_state, empty_init, ROT0, "Universal", "Indoor Soccer (set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) // see MT05419 +GAME( 1985, idsoccert, idsoccer, idsoccer, idsoccer, docastle_state, empty_init, ROT0, "Universal (Tecfri license)", "Indoor Soccer (Tecfri license PCB)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) // see MT05419 +GAME( 1987, asoccer, idsoccer, idsoccer, idsoccer, docastle_state, empty_init, ROT0, "Universal", "American Soccer", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) // see MT05419 diff -Nru mame-0.242+dfsg.1/src/mame/drivers/dominob.cpp mame-0.243+dfsg.1/src/mame/drivers/dominob.cpp --- mame-0.242+dfsg.1/src/mame/drivers/dominob.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/dominob.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -269,17 +269,6 @@ INPUT_PORTS_END -static const gfx_layout charlayout = -{ - 8,8, - RGN_FRAC(1,3), - 3, - { RGN_FRAC(2,3), RGN_FRAC(1,3), RGN_FRAC(0,3)}, - { 0, 1, 2, 3, 4, 5, 6, 7 }, - { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, - 8*8 -}; - static const gfx_layout bglayout = { 32,32, @@ -297,8 +286,8 @@ }; static GFXDECODE_START( gfx_dominob ) - GFXDECODE_ENTRY("gfx1", 0, charlayout, 0, 0x20) - GFXDECODE_ENTRY("gfx2", 0, bglayout, 0x100, 0x10) + GFXDECODE_ENTRY("gfx1", 0, gfx_8x8x3_planar, 0, 0x20) + GFXDECODE_ENTRY("gfx2", 0, bglayout, 0x100, 0x10) GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/dooyong.cpp mame-0.243+dfsg.1/src/mame/drivers/dooyong.cpp --- mame-0.242+dfsg.1/src/mame/drivers/dooyong.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/dooyong.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1340,17 +1340,6 @@ 8*8*2 }; -const gfx_layout bluehawk_charlayout = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { STEP4(0,1) }, - { STEP8(0,4) }, - { STEP8(0,4*8) }, - 8*8*4 -}; - const gfx_layout tilelayout = { 32,32, @@ -1404,18 +1393,18 @@ GFXDECODE_END GFXDECODE_START( gfx_bluehawk ) - GFXDECODE_ENTRY( "tx", 0, bluehawk_charlayout, 0, 16 ) - GFXDECODE_ENTRY( "sprite", 0, spritelayout, 256, 16 ) - GFXDECODE_ENTRY( "bg0", 0, tilelayout, 768, 16 ) - GFXDECODE_ENTRY( "fg0", 0, tilelayout, 512, 16 ) - GFXDECODE_ENTRY( "fg1", 0, tilelayout, 0, 16 ) + GFXDECODE_ENTRY( "tx", 0, gfx_8x8x4_packed_msb, 0, 16 ) + GFXDECODE_ENTRY( "sprite", 0, spritelayout, 256, 16 ) + GFXDECODE_ENTRY( "bg0", 0, tilelayout, 768, 16 ) + GFXDECODE_ENTRY( "fg0", 0, tilelayout, 512, 16 ) + GFXDECODE_ENTRY( "fg1", 0, tilelayout, 0, 16 ) GFXDECODE_END GFXDECODE_START( gfx_primella ) - GFXDECODE_ENTRY( "tx", 0, bluehawk_charlayout, 0, 16 ) + GFXDECODE_ENTRY( "tx", 0, gfx_8x8x4_packed_msb, 0, 16 ) /* no sprites */ - GFXDECODE_ENTRY( "bg0", 0, tilelayout, 768, 16 ) - GFXDECODE_ENTRY( "fg0", 0, tilelayout, 512, 16 ) + GFXDECODE_ENTRY( "bg0", 0, tilelayout, 768, 16 ) + GFXDECODE_ENTRY( "fg0", 0, tilelayout, 512, 16 ) GFXDECODE_END GFXDECODE_START( gfx_rshark ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/dreamwld.cpp mame-0.243+dfsg.1/src/mame/drivers/dreamwld.cpp --- mame-0.242+dfsg.1/src/mame/drivers/dreamwld.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/dreamwld.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -693,20 +693,9 @@ PORT_SERVICE_DIPLOC( 0x8000, IP_ACTIVE_LOW, "SW1:8" ) INPUT_PORTS_END -static const gfx_layout layout_16x16x4 = -{ - 16,16, - RGN_FRAC(1,1), - 4, - {STEP4(0,1)}, - {STEP16(0,4)}, - {STEP16(0,4*16)}, - 16*16*4 -}; - static GFXDECODE_START( gfx_dreamwld ) - GFXDECODE_ENTRY( "gfx1", 0, layout_16x16x4, 0x000, 0x40 ) // [0] Sprites - GFXDECODE_ENTRY( "gfx2", 0, layout_16x16x4, 0x800, 0x48 ) // [1] Layer 0 + 1 + GFXDECODE_ENTRY( "gfx1", 0, gfx_16x16x4_packed_msb, 0x000, 0x40 ) // [0] Sprites + GFXDECODE_ENTRY( "gfx2", 0, gfx_16x16x4_packed_msb, 0x800, 0x48 ) // [1] Layer 0 + 1 GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/dunhuang.cpp mame-0.243+dfsg.1/src/mame/drivers/dunhuang.cpp --- mame-0.242+dfsg.1/src/mame/drivers/dunhuang.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/dunhuang.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -856,7 +856,7 @@ ROM_LOAD( "rom3.u4", 0x00000, 0x80000, CRC(1ff5d35e) SHA1(b808eb4f81be8fc77a58dadd661a9cc2b376a509) ) ROM_LOAD( "rom2.u5", 0x80000, 0x40000, CRC(384fa1d3) SHA1(f329db17aacacf1768ebd6ca2cc612503db93fac) ) - ROM_REGION( 0xc0000, "gfx2", 0 ) // do not dispose + ROM_REGION( 0xc0000, "gfx2", 0 ) ROM_LOAD( "rom4.u3", 0x00000, 0x40000, CRC(7db45227) SHA1(2a12a2b8a1e58946ce3e7c770b3ca4803c3c3ccd) ) ROM_LOAD( "rom5.u2", 0x40000, 0x80000, CRC(d609880e) SHA1(3d69800e959e8f24ef950fea4312610c4407f6ba) ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/dvk_ksm.cpp mame-0.243+dfsg.1/src/mame/drivers/dvk_ksm.cpp --- mame-0.242+dfsg.1/src/mame/drivers/dvk_ksm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/dvk_ksm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -136,8 +136,8 @@ struct { - uint8_t line; - uint16_t ptr; + uint8_t line = 0; + uint16_t ptr = 0; } m_video; enum @@ -145,8 +145,8 @@ TIMER_ID_BRG = 0 }; - bool brg_state; - int brga, brgb, brgc; + bool brg_state = false; + int brga = 0, brgb = 0, brgc = 0; emu_timer *m_brg = nullptr; void update_brg(bool a, bool b, int c); diff -Nru mame-0.242+dfsg.1/src/mame/drivers/dynadice.cpp mame-0.243+dfsg.1/src/mame/drivers/dynadice.cpp --- mame-0.242+dfsg.1/src/mame/drivers/dynadice.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/dynadice.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -200,17 +200,6 @@ PORT_DIPSETTING( 0x00, DEF_STR( On ) ) INPUT_PORTS_END -static const gfx_layout charlayout = -{ - 8,8, - RGN_FRAC(1,1), - 1, - { 0 }, - { 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 const gfx_layout charlayout2 = { 8,8, @@ -224,7 +213,7 @@ static GFXDECODE_START( gfx_dynadice ) - GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 1 ) /* 1bpp */ + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x1, 0, 1 ) /* 1bpp */ GFXDECODE_ENTRY( "gfx2", 0, charlayout2, 0, 1 ) /* 3bpp */ GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/ecoinfr.cpp mame-0.243+dfsg.1/src/mame/drivers/ecoinfr.cpp --- mame-0.242+dfsg.1/src/mame/drivers/ecoinfr.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/ecoinfr.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -116,8 +116,8 @@ virtual void machine_start() override { m_digits.resolve(); } TIMER_DEVICE_CALLBACK_MEMBER(ecoinfr_irq_timer); - uint8_t m_banksel; - uint8_t m_credsel; + uint8_t m_banksel = 0; + uint8_t m_credsel = 0; required_device m_maincpu; required_device_array m_reel; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/efdt.cpp mame-0.243+dfsg.1/src/mame/drivers/efdt.cpp --- mame-0.242+dfsg.1/src/mame/drivers/efdt.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/efdt.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -517,17 +517,6 @@ 8 * 8 }; -static const gfx_layout tilelayout1bpp = -{ - 8,8, - RGN_FRAC(1,1), - 1, - { 0 }, - { STEP8(0,1) }, - { STEP8(0,8) }, - 8 * 8 -}; - /************************************************** * Graphics Decode Information * @@ -535,7 +524,7 @@ static GFXDECODE_START( gfx_efdt ) GFXDECODE_ENTRY( "gfx1", 0, tilelayout3bpp, 0, 256*6 ) - GFXDECODE_ENTRY( "gfx2", 0, tilelayout1bpp, 0, 256 ) + GFXDECODE_ENTRY( "gfx2", 0, gfx_8x8x1, 0, 256 ) GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/elan_eu3a14.cpp mame-0.243+dfsg.1/src/mame/drivers/elan_eu3a14.cpp --- mame-0.242+dfsg.1/src/mame/drivers/elan_eu3a14.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/elan_eu3a14.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -726,24 +726,12 @@ 8 * 8 * 8 }; -static const gfx_layout helper8x8x4_layout = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { STEP4(0,1) }, - { STEP8(0,4) }, - { STEP8(0,8*4) }, - 8 * 8 * 4 -}; - - static GFXDECODE_START( gfx_helper ) // dummy standard decodes to see background tiles, not used for drawing GFXDECODE_ENTRY( "maincpu", 0, helper16x16x8_layout, 0x0, 2 ) GFXDECODE_ENTRY( "maincpu", 0, helper16x16x4_layout, 0x0, 32 ) GFXDECODE_ENTRY( "maincpu", 0, helper8x8x8_layout, 0x0, 2 ) - GFXDECODE_ENTRY( "maincpu", 0, helper8x8x4_layout, 0x0, 32 ) + GFXDECODE_ENTRY( "maincpu", 0, gfx_8x8x4_packed_msb, 0x0, 32 ) GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/electra.cpp mame-0.243+dfsg.1/src/mame/drivers/electra.cpp --- mame-0.242+dfsg.1/src/mame/drivers/electra.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/electra.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -10,7 +10,7 @@ Avenger (1975) EG-1020 YES Combo 3 (Tennis, Soccer, Hockey) (1975) UNKNOWN Eliminator IV (1976) UNKNOWN -Flying Fortress (1976) (Taito same name?) EG-1060 YES +Flying Fortress (1976) (Taito same name?) EG-1060A + EG1060B YES Knockout (1975) UNKNOWN Pace Car Pro (1975) EG-1000 NO Pace Race (1975) EG-1000 NO @@ -120,12 +120,24 @@ ROM_START( avenger ) ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 ) - ROM_REGION( 0x0200, "roms", ROMREGION_ERASE00 ) - ROM_LOAD( "106069-a.l10", 0x0000, 0x0200, CRC(12052a01) SHA1(0674254f73be14b871870c52d7f731209411bcea) ) - ROM_LOAD( "106072-1.d10", 0x0000, 0x0020, CRC(3c10773b) SHA1(84b6d10d372978e80f358e66713571a26e129eed) ) - ROM_LOAD( "106072-2.g10", 0x0000, 0x0020, CRC(b2dba75e) SHA1(dc4e205aeb62ebd5617e571d9e7b467da377fff5) ) - ROM_LOAD( "106072-3.h10", 0x0000, 0x0020, CRC(816a8136) SHA1(2eca1ce7b53dd314ad0b2fdf71b843aaca774721) ) + ROM_REGION( 0x0260, "roms", ROMREGION_ERASE00 ) + ROM_LOAD( "106069-a.l10", 0x0000, 0x0200, CRC(12052a01) SHA1(0674254f73be14b871870c52d7f731209411bcea) ) + ROM_LOAD( "106072-1.d10", 0x0200, 0x0020, CRC(3c10773b) SHA1(84b6d10d372978e80f358e66713571a26e129eed) ) + ROM_LOAD( "106072-2.g10", 0x0220, 0x0020, CRC(b2dba75e) SHA1(dc4e205aeb62ebd5617e571d9e7b467da377fff5) ) + ROM_LOAD( "106072-3.h10", 0x0240, 0x0020, CRC(816a8136) SHA1(2eca1ce7b53dd314ad0b2fdf71b843aaca774721) ) ROM_END -GAME( 1975, avenger, 0, electra, 0, electra_state, empty_init, ROT0, "Electra", "Avenger [TTL]", MACHINE_IS_SKELETON ) +ROM_START( flyingf ) + ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 ) + + ROM_REGION( 0x0320, "roms", ROMREGION_ERASE00 ) + ROM_LOAD( "b-1.2b", 0x0000, 0x0100, CRC(c88a3dff) SHA1(9b5e568206263087f8f1dd7b94b7ae82aa3bdbaf) ) + ROM_LOAD( "b-2.1a", 0x0100, 0x0100, CRC(7f6e4af5) SHA1(1a436713ae1639b75e4567de040109714b4ff52b) ) + ROM_LOAD( "b-3.1i", 0x0200, 0x0100, CRC(5687270b) SHA1(481055801f0ba3c036e42e2254962028c5855bbe) ) + ROM_LOAD( "prom.1d", 0x0300, 0x0020, CRC(4fabe931) SHA1(ac3c2a59dce080460b4a9230f5d36d2b2627f729) ) +ROM_END + + +GAME( 1975, avenger, 0, electra, 0, electra_state, empty_init, ROT0, "Electra", "Avenger [TTL]", MACHINE_IS_SKELETON ) +GAME( 1976, flyingf, 0, electra, 0, electra_state, empty_init, ROT0, "Electra", "Flying Fortress [TTL]", MACHINE_IS_SKELETON ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/epos.cpp mame-0.243+dfsg.1/src/mame/drivers/epos.cpp --- mame-0.242+dfsg.1/src/mame/drivers/epos.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/epos.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -72,18 +72,210 @@ ***************************************************************************/ #include "emu.h" -#include "includes/epos.h" #include "cpu/z80/z80.h" #include "machine/i8255.h" -#include "machine/watchdog.h" #include "machine/nvram.h" +#include "machine/watchdog.h" #include "sound/ay8910.h" + +#include "emupal.h" #include "screen.h" #include "speaker.h" -void epos_state::dealer_decrypt_rom(offs_t offset, uint8_t data) +namespace { + +class epos_base_state : public driver_device +{ +public: + epos_base_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_videoram(*this, "videoram"), + m_maincpu(*this, "maincpu"), + m_palette(*this, "palette") + { } + +protected: + virtual void video_start() override; + virtual void video_reset() override; + + static void set_pal_color(palette_device &palette, uint8_t offset, uint8_t data); // TODO: convert to an RGB converter and set_format + + // memory pointers + required_shared_ptr m_videoram; + + // devices + required_device m_maincpu; + required_device m_palette; + + // video-related + uint8_t m_palette_bank = 0U; + + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); +}; + +class tristar8000_state : public epos_base_state +{ +public: + tristar8000_state(const machine_config &mconfig, device_type type, const char *tag) : + epos_base_state(mconfig, type, tag), + m_leds(*this, "led%u", 0U) + { } + + void tristar8000(machine_config &config); + +protected: + virtual void machine_start() override { m_leds.resolve(); } + +private: + // I/O + output_finder<2> m_leds; + + void port_1_w(uint8_t data); + void palette(palette_device &palette) const; + + void io_map(address_map &map); + void prg_map(address_map &map); +}; + +class tristar9000_state : public epos_base_state +{ +public: + tristar9000_state(const machine_config &mconfig, device_type type, const char *tag) : + epos_base_state(mconfig, type, tag), + m_mainbank(*this, "mainbank%u", 1U), + m_inputs(*this, { "INPUTS", "INPUTS2" }), + m_dsw(*this, "DSW") + { } + + void tristar9000(machine_config &config); + + void init_tristar9000(); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + +private: + required_memory_bank_array<2> m_mainbank; + + required_ioport_array<2> m_inputs; + required_ioport m_dsw; + + // misc + uint8_t m_counter = 0; + uint8_t m_input_multiplex = 0; + bool m_ay_porta_multiplex = false; + + void decrypt_rom(offs_t offset, uint8_t data); + uint8_t i8255_porta_r(); + void i8255_portc_w(uint8_t data); + uint8_t ay_porta_mpx_r(); + void flip_screen_w(uint8_t data); + void pal_w(offs_t offset, uint8_t data); + void io_map(address_map &map); + void prg_map(address_map &map); +}; + + +// video + +/*************************************************************************** + + These games has one 32 byte palette PROM, connected to the RGB output this way: + + bit 7 -- 240 ohm resistor -- RED + -- 510 ohm resistor -- RED + -- 1 kohm resistor -- RED + -- 240 ohm resistor -- GREEN + -- 510 ohm resistor -- GREEN + -- 1 kohm resistor -- GREEN + -- 240 ohm resistor -- BLUE + bit 0 -- 510 ohm resistor -- BLUE + +***************************************************************************/ + +void tristar8000_state::palette(palette_device &palette) const +{ + uint8_t const *const color_prom = memregion("proms")->base(); + int const len = memregion("proms")->bytes(); + + for (offs_t i = 0; i < len; i++) + set_pal_color(palette, i, color_prom[i]); +} + +void epos_base_state::set_pal_color(palette_device &palette, uint8_t offset, uint8_t data) +{ + int bit0 = BIT(data, 7); + int bit1 = BIT(data, 6); + int bit2 = BIT(data, 5); + int const r = 0x92 * bit0 + 0x4a * bit1 + 0x23 * bit2; + + bit0 = BIT(data, 4); + bit1 = BIT(data, 3); + bit2 = BIT(data, 2); + int const g = 0x92 * bit0 + 0x4a * bit1 + 0x23 * bit2; + + bit0 = BIT(data, 1); + bit1 = BIT(data, 0); + int const b = 0xad * bit0 + 0x52 * bit1; + + palette.set_pen_color(offset, rgb_t(r, g, b)); +} + +// later (tristar 9000) games uses a dynamic palette instead of prom +void tristar9000_state::pal_w(offs_t offset, uint8_t data) +{ + set_pal_color(*m_palette, offset, data); +} + +void tristar8000_state::port_1_w(uint8_t data) +{ + /* D0 - start light #1 + D1 - start light #2 + D2 - coin counter + D3 - palette select + D4-D7 - unused + */ + + m_leds[0] = BIT(data, 0); + m_leds[1] = BIT(data, 1); + + machine().bookkeeping().coin_counter_w(0, (data >> 2) & 0x01); + + m_palette_bank = (data >> 3) & 0x01; +} + + +uint32_t epos_base_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ + for (offs_t offs = 0; offs < m_videoram.bytes(); offs++) + { + uint8_t const data = m_videoram[offs]; + + int x = (offs % 136) * 2; + int y = (offs / 136); + + if (flip_screen()) + { + bitmap.pix(240 - y, 270 - x + 1) = m_palette->pen((m_palette_bank << 4) | (data & 0x0f)); + bitmap.pix(240 - y, 270 - x + 0) = m_palette->pen((m_palette_bank << 4) | (data >> 4)); + } + else + { + bitmap.pix(y, x + 0) = m_palette->pen((m_palette_bank << 4) | (data & 0x0f)); + bitmap.pix(y, x + 1) = m_palette->pen((m_palette_bank << 4) | (data >> 4)); + } + } + + return 0; +} + + +// machine + +void tristar9000_state::decrypt_rom(offs_t offset, uint8_t data) { if (offset & 0x04) m_counter = (m_counter + 1) & 0x03; @@ -92,7 +284,7 @@ //logerror("PC %08x: ctr=%04x\n",m_maincpu->pc(), m_counter); - membank("bank1")->set_entry(m_counter); + m_mainbank[0]->set_entry(m_counter); // is the 2nd bank changed by the counter or it always uses the 1st key? } @@ -104,19 +296,19 @@ * *************************************/ -void epos_state::epos_map(address_map &map) +void tristar8000_state::prg_map(address_map &map) { map(0x0000, 0x77ff).rom(); map(0x7800, 0x7fff).ram(); - map(0x8000, 0xffff).ram().share("videoram"); + map(0x8000, 0xffff).ram().share(m_videoram); } -void epos_state::dealer_map(address_map &map) +void tristar9000_state::prg_map(address_map &map) { - map(0x0000, 0x5fff).bankr("bank1"); - map(0x6000, 0x6fff).bankr("bank2"); + map(0x0000, 0x5fff).bankr(m_mainbank[0]); + map(0x6000, 0x6fff).bankr(m_mainbank[1]); map(0x7000, 0x7fff).ram().share("nvram"); - map(0x8000, 0xffff).ram().share("videoram"); + map(0x8000, 0xffff).ram().share(m_videoram); } @@ -126,29 +318,29 @@ * *************************************/ -void epos_state::epos_io_map(address_map &map) +void tristar8000_state::io_map(address_map &map) { map.global_mask(0xff); map(0x00, 0x00).portr("DSW").w("watchdog", FUNC(watchdog_timer_device::reset_w)); - map(0x01, 0x01).portr("SYSTEM").w(FUNC(epos_state::port_1_w)); + map(0x01, 0x01).portr("SYSTEM").w(FUNC(tristar8000_state::port_1_w)); map(0x02, 0x02).portr("INPUTS").w("aysnd", FUNC(ay8910_device::data_w)); map(0x03, 0x03).portr("UNK"); map(0x06, 0x06).w("aysnd", FUNC(ay8910_device::address_w)); } -void epos_state::dealer_io_map(address_map &map) +void tristar9000_state::io_map(address_map &map) { map.global_mask(0xff); - map(0x00, 0x0f).w(FUNC(epos_state::dealer_pal_w)); + map(0x00, 0x0f).w(FUNC(tristar9000_state::pal_w)); map(0x10, 0x13).rw("ppi8255", FUNC(i8255_device::read), FUNC(i8255_device::write)); - map(0x20, 0x24).w(FUNC(epos_state::dealer_decrypt_rom)); + map(0x20, 0x24).w(FUNC(tristar9000_state::decrypt_rom)); map(0x34, 0x34).w("aysnd", FUNC(ay8910_device::data_w)); map(0x38, 0x38).r("aysnd", FUNC(ay8910_device::data_r)); map(0x3c, 0x3c).w("aysnd", FUNC(ay8910_device::address_w)); map(0x40, 0x40).w("watchdog", FUNC(watchdog_timer_device::reset_w)); } -uint8_t epos_state::i8255_porta_r() +uint8_t tristar9000_state::i8255_porta_r() { uint8_t data = 0xff; @@ -166,18 +358,18 @@ There's a separate ROM check for banked U04 at 30F3. It looks like dealer/revenger uses ppi8255 to control bankswitching. */ -void epos_state::i8255_portc_w(uint8_t data) +void tristar9000_state::i8255_portc_w(uint8_t data) { - membank("bank2")->set_entry(data & 0x01); + m_mainbank[1]->set_entry(data & 0x01); m_input_multiplex = (data >> 5) & 3; } -uint8_t epos_state::ay_porta_mpx_r() +uint8_t tristar9000_state::ay_porta_mpx_r() { - return (m_ay_porta_multiplex ? 0xFF : ioport("DSW")->read()); + return (m_ay_porta_multiplex ? 0xff : m_dsw->read()); } -void epos_state::flip_screen_w(uint8_t data) +void tristar9000_state::flip_screen_w(uint8_t data) { flip_screen_set(BIT(data, 7)); // bit 6: ay8910 port A/B multiplexer read @@ -230,8 +422,8 @@ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 ) PORT_SERVICE_NO_TOGGLE(0x10, IP_ACTIVE_LOW) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_CUSTOM ) /* this has to be HI */ - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) /* this has to be HI */ + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_CUSTOM ) // this has to be HI + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) // this has to be HI PORT_START("INPUTS") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) @@ -280,8 +472,8 @@ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 ) PORT_SERVICE_NO_TOGGLE(0x10, IP_ACTIVE_LOW) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) /* this has to be LO */ - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) /* this has to be HI */ + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) // this has to be LO + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) // this has to be HI PORT_START("INPUTS") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) @@ -332,8 +524,8 @@ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 ) PORT_SERVICE_NO_TOGGLE(0x10, IP_ACTIVE_LOW) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_CUSTOM ) /* this has to be HI */ - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) /* this has to be HI */ + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_CUSTOM ) // this has to be HI + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) // this has to be HI PORT_START("INPUTS") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) @@ -414,8 +606,8 @@ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 ) PORT_SERVICE_NO_TOGGLE(0x10, IP_ACTIVE_LOW) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) /* this has to be LO */ - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) /* this has to be LO */ + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) // this has to be LO + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) // this has to be LO PORT_START("INPUTS") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) @@ -511,97 +703,97 @@ * *************************************/ -MACHINE_START_MEMBER(epos_state,epos) +void epos_base_state::video_start() { save_item(NAME(m_palette_bank)); +} + +void tristar9000_state::machine_start() +{ + uint8_t *rom = memregion("maincpu")->base(); + m_mainbank[0]->configure_entries(0, 4, &rom[0x0000], 0x10000); + m_mainbank[1]->configure_entries(0, 2, &rom[0x6000], 0x1000); + + m_mainbank[0]->set_entry(0); + m_mainbank[1]->set_entry(0); + save_item(NAME(m_counter)); save_item(NAME(m_input_multiplex)); save_item(NAME(m_ay_porta_multiplex)); } -void epos_state::machine_reset() +void epos_base_state::video_reset() { m_palette_bank = 0; - m_counter = 0; - m_input_multiplex = 3; - m_ay_porta_multiplex = 0; } - -MACHINE_START_MEMBER(epos_state,dealer) +void tristar9000_state::machine_reset() { - uint8_t *ROM = memregion("maincpu")->base(); - membank("bank1")->configure_entries(0, 4, &ROM[0x0000], 0x10000); - membank("bank2")->configure_entries(0, 2, &ROM[0x6000], 0x1000); - - membank("bank1")->set_entry(0); - membank("bank2")->set_entry(0); - - MACHINE_START_CALL_MEMBER(epos); + m_counter = 0; + m_input_multiplex = 3; + m_ay_porta_multiplex = 0; } -void epos_state::epos(machine_config &config) /* EPOS TRISTAR 8000 PCB */ +void tristar8000_state::tristar8000(machine_config &config) // EPOS TRISTAR 8000 PCB { - /* basic machine hardware */ - Z80(config, m_maincpu, XTAL(11'000'000)/4); /* 2.75 MHz schematics confirm 11MHz XTAL (see notes) */ - m_maincpu->set_addrmap(AS_PROGRAM, &epos_state::epos_map); - m_maincpu->set_addrmap(AS_IO, &epos_state::epos_io_map); - m_maincpu->set_vblank_int("screen", FUNC(epos_state::irq0_line_hold)); + // basic machine hardware + Z80(config, m_maincpu, XTAL(11'000'000) / 4); // 2.75 MHz schematics confirm 11MHz XTAL (see notes) + m_maincpu->set_addrmap(AS_PROGRAM, &tristar8000_state::prg_map); + m_maincpu->set_addrmap(AS_IO, &tristar8000_state::io_map); + m_maincpu->set_vblank_int("screen", FUNC(tristar8000_state::irq0_line_hold)); WATCHDOG_TIMER(config, "watchdog"); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(60); - screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500) /* not accurate */); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); // not accurate screen.set_size(272, 241); screen.set_visarea(0, 271, 0, 235); - screen.set_screen_update(FUNC(epos_state::screen_update)); + screen.set_screen_update(FUNC(tristar8000_state::screen_update)); - PALETTE(config, m_palette, FUNC(epos_state::epos_palette), 32); + PALETTE(config, m_palette, FUNC(tristar8000_state::palette), 32); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); - AY8912(config, "aysnd", XTAL(11'000'000)/16).add_route(ALL_OUTPUTS, "mono", 1.0); /* 0.6875 MHz, confirmed from schematics */ + AY8912(config, "aysnd", XTAL(11'000'000) / 16).add_route(ALL_OUTPUTS, "mono", 1.0); // 0.6875 MHz, confirmed from schematics } -void epos_state::dealer(machine_config &config) /* EPOS TRISTAR 9000 PCB */ +void tristar9000_state::tristar9000(machine_config &config) // EPOS TRISTAR 9000 PCB { - /* basic machine hardware */ - Z80(config, m_maincpu, XTAL(22'118'400)/8); /* 2.7648 MHz (measured) */ - m_maincpu->set_addrmap(AS_PROGRAM, &epos_state::dealer_map); - m_maincpu->set_addrmap(AS_IO, &epos_state::dealer_io_map); - m_maincpu->set_vblank_int("screen", FUNC(epos_state::irq0_line_hold)); + // basic machine hardware + Z80(config, m_maincpu, XTAL(22'118'400) / 8); // 2.7648 MHz (measured) + m_maincpu->set_addrmap(AS_PROGRAM, &tristar9000_state::prg_map); + m_maincpu->set_addrmap(AS_IO, &tristar9000_state::io_map); + m_maincpu->set_vblank_int("screen", FUNC(tristar9000_state::irq0_line_hold)); i8255_device &ppi(I8255A(config, "ppi8255")); - ppi.in_pa_callback().set(FUNC(epos_state::i8255_porta_r)); - ppi.out_pc_callback().set(FUNC(epos_state::i8255_portc_w)); + ppi.in_pa_callback().set(FUNC(tristar9000_state::i8255_porta_r)); + ppi.out_pc_callback().set(FUNC(tristar9000_state::i8255_portc_w)); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - MCFG_MACHINE_START_OVERRIDE(epos_state,dealer) - // RAM-based palette instead of prom PALETTE(config, m_palette, palette_device::BLACK, 32); WATCHDOG_TIMER(config, "watchdog"); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(60); - screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500) /* not accurate */); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); // not accurate screen.set_size(272, 241); screen.set_visarea(0, 271, 0, 235); - screen.set_screen_update(FUNC(epos_state::screen_update)); + screen.set_screen_update(FUNC(tristar9000_state::screen_update)); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); - ay8910_device &aysnd(AY8910(config, "aysnd", XTAL(22'118'400)/32)); /* 0.6912 MHz (measured) */ + ay8910_device &aysnd(AY8910(config, "aysnd", XTAL(22'118'400) / 32)); // 0.6912 MHz (measured) aysnd.add_route(ALL_OUTPUTS, "mono", 1.0); - aysnd.port_a_read_callback().set(FUNC(epos_state::ay_porta_mpx_r)); + aysnd.port_a_read_callback().set(FUNC(tristar9000_state::ay_porta_mpx_r)); // port a writes? - aysnd.port_b_write_callback().set(FUNC(epos_state::flip_screen_w)); // flipscreen and ay port a multiplex control + aysnd.port_b_write_callback().set(FUNC(tristar9000_state::flip_screen_w)); // flipscreen and ay port a multiplex control } @@ -632,7 +824,7 @@ ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "co3223.u10", 0x0000, 0x1000, CRC(50abcfd2) SHA1(13ce04addc7bcaa1ec6659da26b1c13ed9dc28f9) ) ROM_LOAD( "co3223.u09", 0x1000, 0x1000, CRC(fd5a9a1c) SHA1(512374e8450459537ba2cc41e7d0178052445316) ) - ROM_LOAD( "co3223.u08", 0x2000, 0x1000, BAD_DUMP CRC(4bfc36f3) SHA1(b916805eed40cfeff0c1b0cb3cdcbcc6e362a236) ) /* BADADDR xxxx-xxxxxxx */ + ROM_LOAD( "co3223.u08", 0x2000, 0x1000, BAD_DUMP CRC(4bfc36f3) SHA1(b916805eed40cfeff0c1b0cb3cdcbcc6e362a236) ) // BADADDR xxxx-xxxxxxx ROM_LOAD( "co3223.u07", 0x3000, 0x1000, CRC(4113bb99) SHA1(3cebb874dae211d75082209e913d4afa4f621de1) ) ROM_LOAD( "co3223.u06", 0x4000, 0x1000, CRC(966bb9f5) SHA1(1a217c6f7a88c58e0deae0290bc5ddd2789d18eb) ) ROM_LOAD( "co3223.u05", 0x5000, 0x1000, CRC(65f9fb9a) SHA1(63b616a736d9e39a8f2f76889fd7c5fe4128a966) ) @@ -795,10 +987,10 @@ ROM_START( revngr84 ) ROM_REGION( 0x40000, "maincpu", 0 ) - ROM_LOAD( "u_1__revenger__r06254__=c=_epos_corp.m5l2764k.u1", 0x0000, 0x2000, CRC(308f231f) SHA1(cf06695601bd0387e4fcb64d9b34143323e98b07) ) /* labeled as "U 1 // REVENGER // R06254 // (C) EPOS CORP" (hand written R06254 over R06124) */ - ROM_LOAD( "u_2__revenger__r06254__=c=_epos_corp.m5l2764k.u2", 0x2000, 0x2000, CRC(e80bbfb4) SHA1(9302beaef8bbb7376b6a20e9ee5adbcf60d66dd8) ) /* labeled as "U 2 // REVENGER // R06254 // (C) EPOS CORP" (hand written R06254 over R06124) */ - ROM_LOAD( "u_3__revenger__r06254__=c=_epos_corp.m5l2764k.u3", 0x4000, 0x2000, CRC(d9270929) SHA1(a95034b5387a40e02f04bdfa79e1d8e65dad30fe) ) /* labeled as "U 3 // REVENGER // R06254 // (C) EPOS CORP" (hand written R06254 over R06124) */ - ROM_LOAD( "u_4__revenger__r06254__=c=_epos_corp.m5l2764k.u4", 0x6000, 0x2000, CRC(d6e6cfa8) SHA1(f10131bb2e9d088c7b6d6a5d5520073d78ad69cc) ) /* labeled as "U 4 // REVENGER // R06254 // (C) EPOS CORP" (hand written R06254 over R06124) */ + ROM_LOAD( "u_1__revenger__r06254__=c=_epos_corp.m5l2764k.u1", 0x0000, 0x2000, CRC(308f231f) SHA1(cf06695601bd0387e4fcb64d9b34143323e98b07) ) // labeled as "U 1 // REVENGER // R06254 // (C) EPOS CORP" (hand written R06254 over R06124) + ROM_LOAD( "u_2__revenger__r06254__=c=_epos_corp.m5l2764k.u2", 0x2000, 0x2000, CRC(e80bbfb4) SHA1(9302beaef8bbb7376b6a20e9ee5adbcf60d66dd8) ) // labeled as "U 2 // REVENGER // R06254 // (C) EPOS CORP" (hand written R06254 over R06124) + ROM_LOAD( "u_3__revenger__r06254__=c=_epos_corp.m5l2764k.u3", 0x4000, 0x2000, CRC(d9270929) SHA1(a95034b5387a40e02f04bdfa79e1d8e65dad30fe) ) // labeled as "U 3 // REVENGER // R06254 // (C) EPOS CORP" (hand written R06254 over R06124) + ROM_LOAD( "u_4__revenger__r06254__=c=_epos_corp.m5l2764k.u4", 0x6000, 0x2000, CRC(d6e6cfa8) SHA1(f10131bb2e9d088c7b6d6a5d5520073d78ad69cc) ) // labeled as "U 4 // REVENGER // R06254 // (C) EPOS CORP" (hand written R06254 over R06124) ROM_REGION( 0x0020, "proms", 0 ) ROM_LOAD( "dm74s288n.u60", 0x0000, 0x0020, CRC(be2b0641) SHA1(26982903b6d942af8e0a526412d8e01978d76420) ) // unknown purpose @@ -809,13 +1001,13 @@ ROM_START( revenger ) ROM_REGION( 0x40000, "maincpu", 0 ) - // these roms probably had the same "U x // REVENGER // R06124 // (C) EPOS CORP" printed labels as the newer set above, but without the hand-penned "25" in r06254 written over the printed "12" of r06124 as above + // these ROMs probably had the same "U x // REVENGER // R06124 // (C) EPOS CORP" printed labels as the newer set above, but without the hand-penned "25" in r06254 written over the printed "12" of r06124 as above ROM_LOAD( "r06124.u1", 0x0000, 0x2000, BAD_DUMP CRC(fad1a2a5) SHA1(a31052c91fe67e2e90441abc40b6483f921ecfe3) ) ROM_LOAD( "r06124.u2", 0x2000, 0x2000, BAD_DUMP CRC(a8e0ee7b) SHA1(f6f78e8ce40eab07de461b364876c1eb4a78d96e) ) ROM_LOAD( "r06124.u3", 0x4000, 0x2000, BAD_DUMP CRC(cca414a5) SHA1(1c9dd3ff63d57e9452e63083cdbd7f5d693bb686) ) ROM_LOAD( "r06124.u4", 0x6000, 0x2000, BAD_DUMP CRC(0b81c303) SHA1(9022d18dec11312eb4bb471c22b563f5f897b4f7) ) - ROM_REGION( 0x0020, "proms", 0 ) /* this PROM not included in this dump, but assumed to be the same as above set */ + ROM_REGION( 0x0020, "proms", 0 ) // this PROM not included in this dump, but assumed to be the same as above set ROM_LOAD( "dm74s288n.u60", 0x0000, 0x0020, CRC(be2b0641) SHA1(26982903b6d942af8e0a526412d8e01978d76420) ) // unknown purpose ROM_REGION( 0x1000, "nvram", 0) @@ -824,32 +1016,32 @@ ROM_START( beastf ) ROM_REGION( 0x40000, "maincpu", 0 ) - ROM_LOAD( "u_1__beastie__feastie__b09084.m5l2764k.u1", 0x0000, 0x2000, CRC(820d4019) SHA1(e953aaeeb626776dd86c521066b553d054ae4422) ) /* labeled as "U 1 // BEASTIE // FEASTIE // B09084" */ - ROM_LOAD( "u_2__beastie__feastie__b09084.m5l2764k.u2", 0x2000, 0x2000, CRC(967405d8) SHA1(dd763be909e6966521b01ee878df9cef865c3b30) ) /* labeled as "U 2 // BEASTIE // FEASTIE // B09084" */ - ROM_LOAD( "u_3__beastie__feastie__b09084.m5l2764k.u3", 0x4000, 0x2000, CRC(3edb5381) SHA1(14c236045e6df7a475c32222652860689d4f68ce) ) /* labeled as "U 3 // BEASTIE // FEASTIE // B09084" */ - ROM_LOAD( "u_4__beastie__feastie__b09084.m5l2764k.u4", 0x6000, 0x2000, CRC(c8cd9640) SHA1(72da881b903ead873cc3f4df27646d1ffdd63c1c) ) /* labeled as "U 4 // BEASTIE // FEASTIE // B09084" */ + ROM_LOAD( "u_1__beastie__feastie__b09084.m5l2764k.u1", 0x0000, 0x2000, CRC(820d4019) SHA1(e953aaeeb626776dd86c521066b553d054ae4422) ) // labeled as "U 1 // BEASTIE // FEASTIE // B09084" + ROM_LOAD( "u_2__beastie__feastie__b09084.m5l2764k.u2", 0x2000, 0x2000, CRC(967405d8) SHA1(dd763be909e6966521b01ee878df9cef865c3b30) ) // labeled as "U 2 // BEASTIE // FEASTIE // B09084" + ROM_LOAD( "u_3__beastie__feastie__b09084.m5l2764k.u3", 0x4000, 0x2000, CRC(3edb5381) SHA1(14c236045e6df7a475c32222652860689d4f68ce) ) // labeled as "U 3 // BEASTIE // FEASTIE // B09084" + ROM_LOAD( "u_4__beastie__feastie__b09084.m5l2764k.u4", 0x6000, 0x2000, CRC(c8cd9640) SHA1(72da881b903ead873cc3f4df27646d1ffdd63c1c) ) // labeled as "U 4 // BEASTIE // FEASTIE // B09084" ROM_REGION( 0x1000, "nvram", 0) ROM_LOAD( "beastf.nv", 0, 0x1000, CRC(98017b09) SHA1(0e2b2071bb47fc179d5bc36ef9431a9d2727d36a) ) ROM_END -void epos_state::init_dealer() +void tristar9000_state::init_tristar9000() { uint8_t *rom = memregion("maincpu")->base(); - /* Key 0 */ + // Key 0 for (int A = 0; A < 0x8000; A++) rom[A] = bitswap<8>(rom[A] ^ 0xbd, 2,6,4,0,5,7,1,3 ); - /* Key 1 */ + // Key 1 for (int A = 0; A < 0x8000; A++) rom[A + 0x10000] = bitswap<8>(rom[A], 7,5,4,6,3,2,1,0 ); - /* Key 2 */ + // Key 2 for (int A = 0; A < 0x8000; A++) rom[A + 0x20000] = bitswap<8>(rom[A] ^ 1, 7,6,5,4,3,0,2,1 ); - /* Key 3 */ + // Key 3 for (int A = 0; A < 0x8000; A++) rom[A + 0x30000] = bitswap<8>(rom[A] ^ 1, 7,5,4,6,3,0,2,1 ); @@ -872,6 +1064,8 @@ */ } +} // anonymous namespace + /************************************* * @@ -879,18 +1073,18 @@ * *************************************/ -/* EPOS TRISTAR 8000 PCB based */ -GAME( 1982, megadon, 0, epos, megadon, epos_state, empty_init, ROT270, "Epos Corporation (Photar Industries license)", "Megadon", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, catapult, 0, epos, catapult, epos_state, empty_init, ROT270, "Epos Corporation", "Catapult", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) /* bad rom, hold f2 for test mode */ -GAME( 1983, suprglob, 0, epos, suprglob, epos_state, empty_init, ROT270, "Epos Corporation", "Super Glob", MACHINE_SUPPORTS_SAVE ) -GAME( 1983, theglob, suprglob, epos, suprglob, epos_state, empty_init, ROT270, "Epos Corporation", "The Glob", MACHINE_SUPPORTS_SAVE ) -GAME( 1983, theglob2, suprglob, epos, suprglob, epos_state, empty_init, ROT270, "Epos Corporation", "The Glob (earlier)", MACHINE_SUPPORTS_SAVE ) -GAME( 1983, theglob3, suprglob, epos, suprglob, epos_state, empty_init, ROT270, "Epos Corporation", "The Glob (set 3)", MACHINE_SUPPORTS_SAVE ) -GAME( 1984, igmo, 0, epos, igmo, epos_state, empty_init, ROT270, "Epos Corporation", "IGMO", MACHINE_SUPPORTS_SAVE ) -GAME( 1983, eeekk, 0, epos, eeekk, epos_state, empty_init, ROT270, "Epos Corporation", "Eeekk!", MACHINE_SUPPORTS_SAVE ) - -/* EPOS TRISTAR 9000 PCB based */ -GAME( 1984, dealer, 0, dealer, dealer, epos_state, init_dealer, ROT270, "Epos Corporation", "The Dealer", MACHINE_SUPPORTS_SAVE ) -GAME( 1984, revngr84, 0, dealer, beastf, epos_state, init_dealer, ROT270, "Epos Corporation", "Revenger '84 (newer)", MACHINE_SUPPORTS_SAVE ) -GAME( 1984, revenger, revngr84, dealer, beastf, epos_state, init_dealer, ROT270, "Epos Corporation", "Revenger '84 (older)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) -GAME( 1984, beastf, suprglob, dealer, beastf, epos_state, init_dealer, ROT270, "Epos Corporation", "Beastie Feastie", MACHINE_SUPPORTS_SAVE ) +// EPOS TRISTAR 8000 PCB based +GAME( 1982, megadon, 0, tristar8000, megadon, tristar8000_state, empty_init, ROT270, "Epos Corporation (Photar Industries license)", "Megadon", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, catapult, 0, tristar8000, catapult, tristar8000_state, empty_init, ROT270, "Epos Corporation", "Catapult", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // bad ROM, hold f2 for test mode +GAME( 1983, suprglob, 0, tristar8000, suprglob, tristar8000_state, empty_init, ROT270, "Epos Corporation", "Super Glob", MACHINE_SUPPORTS_SAVE ) +GAME( 1983, theglob, suprglob, tristar8000, suprglob, tristar8000_state, empty_init, ROT270, "Epos Corporation", "The Glob", MACHINE_SUPPORTS_SAVE ) +GAME( 1983, theglob2, suprglob, tristar8000, suprglob, tristar8000_state, empty_init, ROT270, "Epos Corporation", "The Glob (earlier)", MACHINE_SUPPORTS_SAVE ) +GAME( 1983, theglob3, suprglob, tristar8000, suprglob, tristar8000_state, empty_init, ROT270, "Epos Corporation", "The Glob (set 3)", MACHINE_SUPPORTS_SAVE ) +GAME( 1984, igmo, 0, tristar8000, igmo, tristar8000_state, empty_init, ROT270, "Epos Corporation", "IGMO", MACHINE_SUPPORTS_SAVE ) +GAME( 1983, eeekk, 0, tristar8000, eeekk, tristar8000_state, empty_init, ROT270, "Epos Corporation", "Eeekk!", MACHINE_SUPPORTS_SAVE ) + +// EPOS TRISTAR 9000 PCB based +GAME( 1984, dealer, 0, tristar9000, dealer, tristar9000_state, init_tristar9000, ROT270, "Epos Corporation", "The Dealer", MACHINE_SUPPORTS_SAVE ) +GAME( 1984, revngr84, 0, tristar9000, beastf, tristar9000_state, init_tristar9000, ROT270, "Epos Corporation", "Revenger '84 (newer)", MACHINE_SUPPORTS_SAVE ) +GAME( 1984, revenger, revngr84, tristar9000, beastf, tristar9000_state, init_tristar9000, ROT270, "Epos Corporation", "Revenger '84 (older)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // bad dump +GAME( 1984, beastf, suprglob, tristar9000, beastf, tristar9000_state, init_tristar9000, ROT270, "Epos Corporation", "Beastie Feastie", MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/esh.cpp mame-0.243+dfsg.1/src/mame/drivers/esh.cpp --- mame-0.242+dfsg.1/src/mame/drivers/esh.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/esh.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -318,20 +318,9 @@ } } -static const gfx_layout esh_gfx_layout = -{ - 8,8, - RGN_FRAC(1,3), - 3, - { RGN_FRAC(2,3), RGN_FRAC(1,3), RGN_FRAC(0,3) }, - { 0,1,2,3,4,5,6,7 }, - { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, - 8*8 -}; - static GFXDECODE_START( gfx_esh ) - GFXDECODE_ENTRY("gfx1", 0, esh_gfx_layout, 0x0, 0x20) - GFXDECODE_ENTRY("gfx2", 0, esh_gfx_layout, 0x0, 0x20) + GFXDECODE_ENTRY("gfx1", 0, gfx_8x8x3_planar, 0x0, 0x20) + GFXDECODE_ENTRY("gfx2", 0, gfx_8x8x3_planar, 0x0, 0x20) GFXDECODE_END INTERRUPT_GEN_MEMBER(esh_state::vblank_callback_esh) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/exelv.cpp mame-0.243+dfsg.1/src/mame/drivers/exelv.cpp --- mame-0.242+dfsg.1/src/mame/drivers/exelv.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/exelv.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1,5 +1,5 @@ // license:GPL-2.0+ -// copyright-holders:Raphael Nabet +// copyright-holders:Raphael Nabet,Robbbert /* Experimental exelvision driver @@ -41,24 +41,68 @@ to use a keyboard and two joysticks * mass storage: tape interface controlled by the main CPU +More info about the keyboard: +- The EXL100 has an infrared keyboard and 2 infrared joysticks. Each uses a MC14497 chip, which scans the + inputs and drives the infrared transmitter. We only emulate the keyboard, and it only works in Exel Basic. +- The receiver uses a TEA1009 amplifier feeding a pair of NE567 PLL lock detectors. The first one detects + 28437Hz and is for the keyboard and one joystick. When lock achieved, it causes INT1 on the subcpu. The + other NE567 detects 20000Hz, is for the other joystick, and causes INT3 on the subcpu. +- Although a range of 8 metres was claimed, users found it was very critical in regard to correct positioning. +- You don't hold a modifier key; you hit and release, then hit the key being modified. This also breaks + the natural keyboard emulation. Exel Basic will indicate if a modifier key is active. + STATUS: - * EXL 100 cannot be emulated because the ROMs are not dumped - * EXELTEL stops early in the boot process and displays a red error screen, - presumably because the I/O processor is not emulated +* EXL 100 + - Most games do something, see table below +* EXELTEL can get to the inbuilt "cart" but stops with a black screen, + presumably because the I/O processor is not emulated + +STATUS OF SOFTWARE: + +SWList name Status +--------------------------------------------------------------------------- +exelbas works +exelbasp Cyan screen, hangs at start +exelmax options 1-4 work, 5-7 do nothing +exeldrum can get to the menu, which seems useless +exelogo can type into it but the usual commands get error +exeltext works but weird +exlpaint works +exlmodem it might work, need instructions +capmenkr works, video corruptions +guppy works +imagix video corruptions, can't proceed +pindo video corruptions, can select a game, how to play? +quizzy works, video corruptions +tennis the demo works, didn't try playing +virus works, 2nd screen is corrupt, press 1 there. +wizord works + + +Using the cassette: +- You must be in Exel Basic. There's no motor control. +- To save: SAVE"1" hit enter, put player in Record, hit Esc, it saves. +- To load: LOAD"1" hit enter, hit esc, put player in Play, it loads. +- The cassette output is connected to the audio section, so games could use it as a 1-bit dac. TODO: * dump exeltel tms7042 I/O CPU ROM - * everything + * exeltel: everything + * The joysticks. No schematics of them have been found. + * Keyboard layout is preliminary. + * Keyboard response is terrible, but this might be normal. + * Add support for cassette k7 format - there's heaps of software for it. */ #include "emu.h" #include "cpu/tms7000/tms7000.h" -//#include "imagedev/cassette.h" +#include "imagedev/cassette.h" #include "machine/spchrom.h" #include "machine/timer.h" #include "sound/tms5220.h" +#include "sound/spkrdev.h" #include "video/tms3556.h" #include "bus/generic/slot.h" @@ -77,11 +121,16 @@ { public: exelv_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_tms3556(*this, "tms3556"), - m_tms5220c(*this, "tms5220c"), - m_cart(*this, "cartslot") + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_subcpu(*this, "subcpu") + , m_tms3556(*this, "tms3556") + , m_tms5220c(*this, "tms5220c") + , m_cart(*this, "cartslot") + , m_cass(*this, "cassette") + , m_speaker(*this, "speaker") + , m_io_keyboard(*this, "X%d", 0U) + , m_timer_k(*this, "timer_k") { } void exeltel(machine_config &config); @@ -89,9 +138,14 @@ private: required_device m_maincpu; + optional_device m_subcpu; required_device m_tms3556; required_device m_tms5220c; optional_device m_cart; + optional_device m_cass; + optional_device m_speaker; + required_ioport_array<8> m_io_keyboard; + optional_device m_timer_k; uint8_t mailbox_wx319_r(); void mailbox_wx318_w(uint8_t data); @@ -107,6 +161,9 @@ DECLARE_MACHINE_START(exl100); DECLARE_MACHINE_START(exeltel); + TIMER_DEVICE_CALLBACK_MEMBER(timer_k); + void machine_reset() override; + void machine_common(); /* tms7020 i/o ports */ uint8_t m_tms7020_portb = 0; @@ -115,6 +172,7 @@ uint8_t m_tms7041_portb = 0; uint8_t m_tms7041_portc = 0; uint8_t m_tms7041_portd = 0; + uint32_t m_rom_size = 0; /* mailbox data */ uint8_t m_wx318 = 0; /* data of 74ls374 labeled wx318 */ @@ -125,6 +183,14 @@ DECLARE_DEVICE_IMAGE_LOAD_MEMBER( exelvision_cartridge ); void tms7020_mem(address_map &map); void tms7040_mem(address_map &map); + + // variables for the keyboard + u8 k_channels[3] = { 0xff, 0xff, 0x3e }; // [0] = key down, [1] = key being sent; [2] = ch62 + u8 k_ch_byte = 0; // 'k_channels' index; 0 = idly scanning the keyboard; 1 = sending a key; 2 = sending ch62 + u8 k_ch_bit = 0; // bit# in the byte being sent; 0 = AGC, 1 = start bit, 2-7 = bits 0-5 of data, 8 = end of byte + bool k_bit_bit = 0; // the value of the bit of data being processed + bool k_bit_num = 0; // each bit gets 2 transmissions, this variable shows which half we are working on; + // if k_bit_bit is high then do interrupt then none; low has none then interrupt }; @@ -229,7 +295,7 @@ A1 - A2 - A3 - - A4 - + A4 - R - cass in A5 - A6 - A7 - @@ -237,7 +303,14 @@ uint8_t exelv_state::tms7020_porta_r() { LOG("tms7020_porta_r\n"); - return ( m_tms7041_portb & 0x80 ) ? 0x01 : 0x00; + u8 data = ( m_tms7041_portb & 0x80 ) ? 0x01 : 0x00; + if (m_cass) + { + double level = (m_cass->input()); + if (level < 0.02) + data |= 0x10; + } + return data; } @@ -246,7 +319,7 @@ B0 - W - TMS7041 port A bit 2 (REV2) B1 - W - TMS7041 port A bit 4 (REV4) B2 - - B3 - + B3 - W - cass out B4 - B5 - B6 - @@ -256,6 +329,11 @@ { LOG("tms7020_portb_w: data = 0x%02x\n", data); m_tms7020_portb = data; + if (m_cass) + { + m_cass->output(BIT(data, 3) ? -1.0 : +1.0); + m_speaker->level_w(BIT(data, 3) ? -1.0 : +1.0); + } } @@ -309,14 +387,18 @@ { LOG("tms7041_portb_w: data = 0x%02x\n", data); - m_tms5220c->wsq_w((data & 0x01) ? 1 : 0); - m_tms5220c->rsq_w((data & 0x02) ? 1 : 0); + // optional code; tms5220 device works in different ways depending on if this exists or not + m_tms5220c->combined_rsq_wsq_w(data & 3); LOG("TMS7020 %s int1\n",((data & 0x04) ? "clear" : "assert")); - m_maincpu->set_input_line(TMS7000_INT1_LINE, (data & 0x04) ? CLEAR_LINE : ASSERT_LINE); + + /* Check for high->low transition on B2 */ + // Using hold_line because the pulse is too short and can be missed by the other cpu + if ((BIT(m_tms7041_portb, 2)) && !BIT(data, 2)) + m_maincpu->set_input_line(TMS7000_INT1_LINE, HOLD_LINE); /* Check for low->high transition on B6 */ - if (!(m_tms7041_portb & 0x40) && (data & 0x40)) + if ((!BIT(m_tms7041_portb, 6)) && BIT(data, 6)) { LOG("wx319 write 0x%02x\n", m_tms7041_portc); m_wx319 = m_tms7041_portc; @@ -382,12 +464,158 @@ */ uint8_t exelv_state::rom_r(offs_t offset) { - if (m_cart && m_cart->exists()) - return m_cart->read_rom(offset + 0x200); + if (m_rom_size && m_cart && m_cart->exists()) + { + if (m_rom_size == 0x7e00) + return m_cart->read_rom(offset); + else + return m_cart->read_rom(offset + 0x200); + } return 0; } +// INFRARED KEYBOARD +// Note: usec times are from the datasheet and should not be altered, but msec times are just guesswork. +TIMER_DEVICE_CALLBACK_MEMBER(exelv_state::timer_k) +{ + // when a key pressed, a channel 0-61 is sent and repeated every 90ms. When released, send channel 62, then silence. + + if (k_ch_byte < 2) + { + k_channels[0] = 0xff; + for (u8 row = 0; row < 8; row++) + { + u8 colin = m_io_keyboard[row]->read(); + if (colin) + { + for (u8 j = 0; j < 8; j++) + { + if (BIT(colin, j)) + { + k_channels[0] = row*8+j; // key pressed + if (k_ch_byte == 0) + { + // can accept it for processing + if (k_channels[1] == 0xff) + k_channels[1] = k_channels[0]; + // init pointers + k_ch_bit = 0; + k_bit_num = 0; + k_ch_byte = 1; + } + } + } + } + } + } + + // Idling; nothing pressed, nothing to do + if (k_ch_byte == 0) + { + m_timer_k->adjust(attotime::from_msec(25)); + return; + } + + // AGC bit - a single 540us pulse followed by a large gap + if (k_ch_bit == 0) + { + if (!k_bit_num) + { + m_subcpu->set_input_line(TMS7000_INT1_LINE, ASSERT_LINE); + k_bit_num = 1; + m_timer_k->adjust(attotime::from_usec(540)); + } + else + { + m_subcpu->set_input_line(TMS7000_INT1_LINE, CLEAR_LINE); + k_bit_num = 0; + k_ch_bit = 1; + m_timer_k->adjust(attotime::from_usec(2840)); + } + return; + } + + // start bit - a hardcoded '1' - so send a 540us pulse followed by 590us of silence + if (k_ch_bit == 1) + { + if (!k_bit_num) + { + m_subcpu->set_input_line(TMS7000_INT1_LINE, ASSERT_LINE); + k_bit_num = 1; + m_timer_k->adjust(attotime::from_usec(540)); + } + else + { + m_subcpu->set_input_line(TMS7000_INT1_LINE, CLEAR_LINE); + k_bit_num = 0; + k_ch_bit = 2; + m_timer_k->adjust(attotime::from_usec(590)); + } + return; + } + + // stop bit - not really a 'bit' - need to turn off any interrupt, + // and prepare for either 90msec inter-byte gap, or ch62 terminating byte. + // If we are already finishing up the terminating byte, then set to idle. + if (k_ch_bit == 8) + { + m_subcpu->set_input_line(TMS7000_INT1_LINE, CLEAR_LINE); + k_ch_bit = 0; + // just finished sending key + if (k_ch_byte == 1) + { + // key still down, send again in 90ms + if (k_channels[0] < 0xff) + { + m_timer_k->adjust(attotime::from_usec(90000)); + } + else + // key was released, send ch62 + { + k_ch_byte = 2; + m_timer_k->adjust(attotime::from_msec(3)); // signal end channel + } + } + else + // just finished sending ch62 + if (k_ch_byte == 2) + { + // clean up and go back to looking at kbd + k_channels[1] = 0xff; + k_ch_byte = 0; + m_timer_k->adjust(attotime::from_msec(20)); + } + return; + } + + // data bits, LSB first + // 1st half of a bit + if (!k_bit_num) + { + k_bit_bit = BIT(k_channels[k_ch_byte], k_ch_bit-2); + + if (k_bit_bit) + m_subcpu->set_input_line(TMS7000_INT1_LINE, ASSERT_LINE); + else + m_subcpu->set_input_line(TMS7000_INT1_LINE, CLEAR_LINE); + + k_bit_num = 1; + m_timer_k->adjust(attotime::from_usec(590)); + return; + } + + // 2nd half of a bit + if (!k_bit_bit) + m_subcpu->set_input_line(TMS7000_INT1_LINE, ASSERT_LINE); + else + m_subcpu->set_input_line(TMS7000_INT1_LINE, CLEAR_LINE); + + k_bit_num = 0; + k_ch_bit++; // next bit + m_timer_k->adjust(attotime::from_usec(540)); +} + /* Main CPU memory map summary: @@ -446,18 +674,92 @@ map(0xc800, 0xefff).noprw(); } - -/* keyboard: ??? */ static INPUT_PORTS_START(exelv) - - PORT_START("exelv") - + PORT_START("X0") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_UP) PORT_NAME(UTF8_UP) PORT_CHAR(UCHAR_MAMEKEY(UP)) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_RIGHT) PORT_NAME(UTF8_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_DOWN) PORT_NAME(UTF8_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN)) + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_LEFT) PORT_NAME(UTF8_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT)) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_CHAR('E') + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_EQUALS) PORT_NAME("_ -") PORT_CHAR('_') + + PORT_START("X1") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_LCONTROL) PORT_NAME("CTL") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CAPSLOCK) PORT_NAME("LOCK") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_CHAR('X') + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH) PORT_NAME("/ :") PORT_CHAR('/') + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ESC) PORT_CHAR(27) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_CHAR('R') + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA) PORT_NAME("? ,") PORT_CHAR('?') + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_LALT) PORT_NAME("FCT") // function key + + PORT_START("X2") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_TAB) PORT_CHAR(9) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_HOME) PORT_NAME("\xe2\x86\x96") PORT_CHAR(UCHAR_MAMEKEY(HOME)) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V) PORT_CHAR('V') + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_QUOTE) PORT_NAME("+ =") PORT_CHAR('+') + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_NAME("1 &") PORT_CHAR('1') + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_NAME("6 $") PORT_CHAR('6') + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_NAME("8 !") PORT_CHAR('8') + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_NAME("0 \xc3\xa0") PORT_CHAR('0') + + PORT_START("X3") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_CHAR('A') + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSPACE) PORT_NAME("\xe2\x8c\xab") PORT_CHAR(127) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_CHAR('C') + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP) PORT_NAME(". ;") PORT_CHAR('.') + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_NAME("2 " e_ACUTE) PORT_CHAR('2') + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_NAME("3 \"") PORT_CHAR('3') + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_NAME("9 \xc3\xa7") PORT_CHAR('9') + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_NAME("# )") PORT_CHAR('#') + + PORT_START("X4") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_LSHIFT) PORT_NAME("SHIFT") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O) PORT_CHAR('O') + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) PORT_CHAR('H') + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_NAME("< [") PORT_CHAR('<') + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T) PORT_CHAR('T') + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M) PORT_CHAR('M') + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_CHAR('N') + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_CHAR('G') + + PORT_START("X5") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_CHAR('S') + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U) PORT_CHAR('U') + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K) PORT_CHAR('K') + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH) PORT_NAME("> ]") PORT_CHAR('>') + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) PORT_CHAR('B') + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_CHAR('D') + + PORT_START("X6") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W) PORT_CHAR('W') + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_CHAR('P') + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_CHAR('J') + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE) PORT_NAME("~ ^") PORT_CHAR('~') + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_NAME("4 '") PORT_CHAR('4') + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_NAME("7 \xc3\xa8") PORT_CHAR('7') + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_RALT) PORT_NAME("* \\") PORT_CHAR('*') + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) PORT_CHAR('F') + + PORT_START("X7") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) PORT_CHAR('I') + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L) PORT_CHAR('L') + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_NAME("5 (") PORT_CHAR('5') + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON) PORT_NAME("% @") PORT_CHAR('%') + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) INPUT_PORTS_END /* Machine Initialization */ -MACHINE_START_MEMBER( exelv_state, exl100) +void exelv_state::machine_common() { /* register for state saving */ save_item(NAME(m_tms7020_portb)); @@ -466,21 +768,49 @@ save_item(NAME(m_tms7041_portd)); save_item(NAME(m_wx318)); save_item(NAME(m_wx319)); + save_item(NAME(k_channels)); + save_item(NAME(k_ch_byte)); + save_item(NAME(k_ch_bit)); + save_item(NAME(k_bit_bit)); + save_item(NAME(k_bit_num)); +} + +MACHINE_START_MEMBER( exelv_state, exl100) +{ + machine_common(); + save_item(NAME(m_rom_size)); + + m_rom_size = 0; + if (m_cart && m_cart->exists()) + m_rom_size = m_cart->get_rom_size(); } MACHINE_START_MEMBER( exelv_state, exeltel) { + machine_common(); + uint8_t *rom = memregion("user1")->base() + 0x0200; membank("bank1")->configure_entry(0, rom); membank("bank1")->set_entry(0); +} - /* register for state saving */ - save_item(NAME(m_tms7020_portb)); - save_item(NAME(m_tms7041_portb)); - save_item(NAME(m_tms7041_portc)); - save_item(NAME(m_tms7041_portd)); - save_item(NAME(m_wx318)); - save_item(NAME(m_wx319)); +void exelv_state::machine_reset() +{ + k_channels[0] = 0xff; + k_channels[1] = 0xff; + k_ch_byte = 0; + k_ch_bit = 0; + k_bit_bit = 0; + k_bit_num = 0; + + if (m_timer_k) + m_timer_k->adjust(attotime::from_seconds(2)); + + if (m_subcpu) + { + m_subcpu->set_input_line(TMS7000_INT1_LINE, CLEAR_LINE); + m_subcpu->set_input_line(TMS7000_INT3_LINE, CLEAR_LINE); + } } @@ -495,13 +825,13 @@ TIMER(config, "scantimer").configure_scanline(FUNC(exelv_state::exelv_hblank_interrupt), "screen", 0, 1); MCFG_MACHINE_START_OVERRIDE(exelv_state, exl100) - tms7041_device &subcpu(TMS7041(config, "tms7041", 4.9152_MHz_XTAL)); - subcpu.in_porta().set(FUNC(exelv_state::tms7041_porta_r)); - subcpu.out_portb().set(FUNC(exelv_state::tms7041_portb_w)); - subcpu.in_portc().set(FUNC(exelv_state::tms7041_portc_r)); - subcpu.out_portc().set(FUNC(exelv_state::tms7041_portc_w)); - subcpu.in_portd().set(FUNC(exelv_state::tms7041_portd_r)); - subcpu.out_portd().set(FUNC(exelv_state::tms7041_portd_w)); + TMS7041(config, m_subcpu, 4.9152_MHz_XTAL); + m_subcpu->in_porta().set(FUNC(exelv_state::tms7041_porta_r)); + m_subcpu->out_portb().set(FUNC(exelv_state::tms7041_portb_w)); + m_subcpu->in_portc().set(FUNC(exelv_state::tms7041_portc_r)); + m_subcpu->out_portc().set(FUNC(exelv_state::tms7041_portc_w)); + m_subcpu->in_portd().set(FUNC(exelv_state::tms7041_portd_r)); + m_subcpu->out_portd().set(FUNC(exelv_state::tms7041_portd_w)); config.set_perfect_quantum(m_maincpu); @@ -524,10 +854,15 @@ PALETTE(config, "palette", palette_device::RGB_3BIT); + TIMER(config, m_timer_k).configure_generic(FUNC(exelv_state::timer_k)); + //SPEECHROM(config, "vsm", 0); /* sound */ SPEAKER(config, "mono").front_center(); + // The cassette output is connected into the audio circuit + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.30); + TMS5220C(config, m_tms5220c, 640000); // m_tms5220c->set_speechrom_tag("vsm"); m_tms5220c->add_route(ALL_OUTPUTS, "mono", 1.00); @@ -535,6 +870,10 @@ /* cartridge */ GENERIC_CARTSLOT(config, "cartslot", generic_linear_slot, "exelvision_cart", "bin,rom"); + CASSETTE(config, m_cass, 0); + m_cass->set_default_state(CASSETTE_STOPPED | CASSETTE_SPEAKER_ENABLED | CASSETTE_MOTOR_ENABLED); + m_cass->add_route(ALL_OUTPUTS, "mono", 0.05); + SOFTWARE_LIST(config, "cart_list").set_original("exl100"); } @@ -597,7 +936,7 @@ ROM_REGION(0x800, "maincpu", 0) ROM_LOAD("exl100in.bin", 0x000, 0x800, CRC(049109a3) SHA1(98a07297dcdacef41c793c197b6496dac1e8e744)) /* TMS7020 ROM, correct */ - ROM_REGION(0x1000, "tms7041", 0) + ROM_REGION(0x1000, "subcpu", 0) ROM_LOAD("exl100_7041.bin", 0x0000, 0x1000, CRC(38f6fc7a) SHA1(b71d545664a974d8ad39bdf600c5b9884c3efab6)) /* TMS7041 internal ROM, correct */ // ROM_REGION(0x8000, "vsm", 0) ROM_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/exzisus.cpp mame-0.243+dfsg.1/src/mame/drivers/exzisus.cpp --- mame-0.242+dfsg.1/src/mame/drivers/exzisus.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/exzisus.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -29,66 +29,203 @@ * The second, later PCB has a single video output and is JAMMA compliant. TODO: -- There must be a way for cpu a to stop cpu c, otherwise the RAM check in test +- There must be a way for CPU a to stop CPU c, otherwise the RAM check in test mode cannot work. However, the only way I found to do that is making writes to F404 pulse the reset line, which isn't a common way to handle these things. ****************************************************************************/ #include "emu.h" -#include "includes/exzisus.h" -#include "includes/taitoipt.h" + #include "audio/taitosnd.h" +#include "includes/taitoipt.h" #include "cpu/z80/z80.h" #include "sound/ymopm.h" + +#include "emupal.h" #include "screen.h" #include "speaker.h" +namespace { + +class exzisus_state : public driver_device +{ +public: + exzisus_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_cpuc(*this, "cpuc"), + m_gfxdecode(*this, "gfxdecode"), + m_palette(*this, "palette"), + m_objectram(*this, "objectram%u", 0U), + m_videoram(*this, "videoram%u", 0U), + m_sharedram_ac(*this, "sharedram_ac"), + m_sharedram_ab(*this, "sharedram_ab"), + m_cpubank(*this, "cpubank%u", 0U) + { } + + void exzisus(machine_config &config); + +protected: + virtual void machine_start() override; + +private: + required_device m_cpuc; + required_device m_gfxdecode; + required_device m_palette; + + required_shared_ptr_array m_objectram; + required_shared_ptr_array m_videoram; + required_shared_ptr m_sharedram_ac; + required_shared_ptr m_sharedram_ab; + required_memory_bank_array<2> m_cpubank; + + template void cpu_bankswitch_w(uint8_t data); + void coincounter_w(uint8_t data); + void cpuc_reset_w(uint8_t data); + + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void cpua_map(address_map &map); + void cpub_map(address_map &map); + void cpuc_map(address_map &map); + void sound_map(address_map &map); +}; + + +// video + /*************************************************************************** - Memory Handler(s) + Video hardware of this hardware is almost similar with "mexico86". So, + most routines are derived from mexico86 driver. ***************************************************************************/ -void exzisus_state::cpua_bankswitch_w(uint8_t data) + +/*************************************************************************** + Screen refresh +***************************************************************************/ + +uint32_t exzisus_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - membank("cpuabank")->set_entry(data & 0x0f); - flip_screen_set(data & 0x40); + // Is this correct ? + bitmap.fill(1023, cliprect); + + // 2 TC0010VCU. TODO: devicify if more drivers use this chip + for (int j = 0; j < 2; j++) + { + int sx = 0; + + for (int offs = 0 ; offs < m_objectram[j].bytes() ; offs += 4) + { + int height; + + // Skip empty sprites. + if ( !(*(uint32_t *)(&m_objectram[j][offs])) ) + { + continue; + } + + int gfx_num = m_objectram[j][offs + 1]; + int gfx_attr = m_objectram[j][offs + 3]; + + int gfx_offs; + if ((gfx_num & 0x80) == 0) // 16x16 sprites + { + gfx_offs = ((gfx_num & 0x7f) << 3); + height = 2; + + sx = m_objectram[j][offs + 2]; + sx |= (gfx_attr & 0x40) << 2; + } + else // tilemaps (each sprite is a 16x256 column) + { + gfx_offs = ((gfx_num & 0x3f) << 7) + 0x0400; + height = 32; + + if (gfx_num & 0x40) // Next column + { + sx += 16; + } + else + { + sx = m_objectram[j][offs + 2]; + sx |= (gfx_attr & 0x40) << 2; + } + } + + int sy = 256 - (height << 3) - (m_objectram[j][offs]); + + for (int xc = 0 ; xc < 2 ; xc++) + { + int goffs = gfx_offs; + for (int yc = 0 ; yc < height ; yc++) + { + int code = (m_videoram[j][goffs + 1] << 8) | m_videoram[j][goffs]; + int color = (m_videoram[j][goffs + 1] >> 6) | (gfx_attr & 0x0f); + int x = (sx + (xc << 3)) & 0xff; + int y = (sy + (yc << 3)) & 0xff; + + if (flip_screen()) + { + x = 248 - x; + y = 248 - y; + } + + m_gfxdecode->gfx(j)->transpen(bitmap, cliprect, + code & 0x3fff, + color, + flip_screen(), flip_screen(), + x, y, 15); + goffs += 2; + } + gfx_offs += height << 1; + } + } + } + return 0; } -void exzisus_state::cpub_bankswitch_w(uint8_t data) + +// machine + +/*************************************************************************** + + Memory Handler(s) + +***************************************************************************/ + +template +void exzisus_state::cpu_bankswitch_w(uint8_t data) { - membank("cpubbank")->set_entry(data & 0x0f); + m_cpubank[Which]->set_entry(data & 0x0f); flip_screen_set(data & 0x40); } void exzisus_state::coincounter_w(uint8_t data) { - machine().bookkeeping().coin_lockout_w(0,~data & 0x01); - machine().bookkeeping().coin_lockout_w(1,~data & 0x02); - machine().bookkeeping().coin_counter_w(0,data & 0x04); - machine().bookkeeping().coin_counter_w(1,data & 0x08); + machine().bookkeeping().coin_lockout_w(0, ~data & 0x01); + machine().bookkeeping().coin_lockout_w(1, ~data & 0x02); + machine().bookkeeping().coin_counter_w(0, data & 0x04); + machine().bookkeeping().coin_counter_w(1, data & 0x08); } -// is it ok that cpub_reset refers to cpuc? -void exzisus_state::cpub_reset_w(uint8_t data) +void exzisus_state::cpuc_reset_w(uint8_t data) { m_cpuc->pulse_input_line(INPUT_LINE_RESET, attotime::zero); } #if 0 -// without cpub_reset_w, the following patch would be needed for -// the RAM check to work +// without cpuc_reset_w, the following patch would be needed for the RAM check to work void exzisus_state::init_exzisus() { uint8_t *RAM = memregion("cpua")->base(); - /* Fix WORK RAM error */ + // Fix WORK RAM error RAM[0x67fd] = 0x18; - /* Fix ROM 1 error */ + // Fix ROM 1 error RAM[0x6829] = 0x18; } #endif @@ -103,41 +240,41 @@ void exzisus_state::cpua_map(address_map &map) { map(0x0000, 0x7fff).rom(); - map(0x8000, 0xbfff).bankr("cpuabank"); - map(0xc000, 0xc5ff).ram().share("objectram1"); - map(0xc600, 0xdfff).ram().share("videoram1"); - map(0xe000, 0xefff).ram().share("sharedram_ac"); - map(0xf400, 0xf400).w(FUNC(exzisus_state::cpua_bankswitch_w)); - map(0xf404, 0xf404).w(FUNC(exzisus_state::cpub_reset_w)); // ?? - map(0xf800, 0xffff).ram().share("sharedram_ab"); + map(0x8000, 0xbfff).bankr(m_cpubank[0]); + map(0xc000, 0xc5ff).ram().share(m_objectram[1]); + map(0xc600, 0xdfff).ram().share(m_videoram[1]); + map(0xe000, 0xefff).ram().share(m_sharedram_ac); + map(0xf400, 0xf400).w(FUNC(exzisus_state::cpu_bankswitch_w<0>)); + map(0xf404, 0xf404).w(FUNC(exzisus_state::cpuc_reset_w)); // ?? + map(0xf800, 0xffff).ram().share(m_sharedram_ab); } void exzisus_state::cpub_map(address_map &map) { map(0x0000, 0x7fff).rom(); - map(0x8000, 0xbfff).bankr("cpubbank"); - map(0xc000, 0xc5ff).ram().share("objectram0"); - map(0xc600, 0xdfff).ram().share("videoram0"); + map(0x8000, 0xbfff).bankr(m_cpubank[1]); + map(0xc000, 0xc5ff).ram().share(m_objectram[0]); + map(0xc600, 0xdfff).ram().share(m_videoram[0]); map(0xe000, 0xefff).ram(); map(0xf000, 0xf000).nopr().w("ciu", FUNC(pc060ha_device::master_port_w)); map(0xf001, 0xf001).rw("ciu", FUNC(pc060ha_device::master_comm_r), FUNC(pc060ha_device::master_comm_w)); map(0xf400, 0xf400).portr("P1"); - map(0xf400, 0xf400).w(FUNC(exzisus_state::cpub_bankswitch_w)); + map(0xf400, 0xf400).w(FUNC(exzisus_state::cpu_bankswitch_w<1>)); map(0xf401, 0xf401).portr("P2"); map(0xf402, 0xf402).portr("SYSTEM"); map(0xf402, 0xf402).w(FUNC(exzisus_state::coincounter_w)); map(0xf404, 0xf404).portr("DSWA"); map(0xf404, 0xf404).nopw(); // ?? map(0xf405, 0xf405).portr("DSWB"); - map(0xf800, 0xffff).ram().share("sharedram_ab"); + map(0xf800, 0xffff).ram().share(m_sharedram_ab); } void exzisus_state::cpuc_map(address_map &map) { map(0x0000, 0x7fff).rom(); - map(0x8000, 0x85ff).ram().share("objectram1"); - map(0x8600, 0x9fff).ram().share("videoram1"); - map(0xa000, 0xafff).ram().share("sharedram_ac"); + map(0x8000, 0x85ff).ram().share(m_objectram[1]); + map(0x8600, 0x9fff).ram().share(m_videoram[1]); + map(0xa000, 0xafff).ram().share(m_sharedram_ac); map(0xb000, 0xbfff).ram(); } @@ -206,8 +343,8 @@ void exzisus_state::machine_start() { - membank("cpuabank")->configure_entries(0, 16, memregion("cpua")->base(), 0x4000); - membank("cpubbank")->configure_entries(0, 16, memregion("cpub")->base(), 0x4000); + m_cpubank[0]->configure_entries(0, 16, memregion("cpua")->base(), 0x4000); + m_cpubank[1]->configure_entries(0, 16, memregion("cpub")->base(), 0x4000); } static const gfx_layout charlayout = @@ -228,10 +365,10 @@ -/* All clocks are unconfirmed */ +// All clocks are unconfirmed void exzisus_state::exzisus(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware z80_device &cpua(Z80(config, "cpua", 6000000)); cpua.set_addrmap(AS_PROGRAM, &exzisus_state::cpua_map); cpua.set_vblank_int("screen", FUNC(exzisus_state::irq0_line_hold)); @@ -247,9 +384,9 @@ z80_device &audiocpu(Z80(config, "audiocpu", 4000000)); audiocpu.set_addrmap(AS_PROGRAM, &exzisus_state::sound_map); - config.set_maximum_quantum(attotime::from_hz(600)); /* 10 CPU slices per frame - enough for the sound CPU to read all commands */ + config.set_maximum_quantum(attotime::from_hz(600)); // 10 CPU slices per frame - enough for the sound CPU to read all commands - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(60); screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); @@ -261,7 +398,7 @@ GFXDECODE(config, m_gfxdecode, m_palette, gfx_exzisus); PALETTE(config, m_palette, palette_device::RGB_444_PROMS, "proms", 1024); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); ym2151_device &ymsnd(YM2151(config, "ymsnd", 4000000)); @@ -351,9 +488,9 @@ ROM_LOAD( "b23-09.3d", 0x50000, 0x10000, CRC(6651617f) SHA1(6351a0b01589cb181b896285ade70e9dfcd799ec) ) ROM_REGION( 0x00c00, "proms", 0 ) - /* These appear to be twice the correct size */ + // These appear to be twice the correct size ROM_LOAD( "b23-04.15l", 0x00000, 0x00400, CRC(5042cffa) SHA1(c969748866a12681cf2dbf25a46da2c4e4f92313) ) - ROM_LOAD( "b23-03.14l", 0x00400, 0x00400, BAD_DUMP CRC(9458fd45) SHA1(7f7cdacf37bb6f15de1109fa73ba3c5fc88893d0) ) /* D0 is fixed */ + ROM_LOAD( "b23-03.14l", 0x00400, 0x00400, BAD_DUMP CRC(9458fd45) SHA1(7f7cdacf37bb6f15de1109fa73ba3c5fc88893d0) ) // D0 is fixed ROM_LOAD( "b23-05.16l", 0x00800, 0x00400, CRC(87f0f69a) SHA1(37df6fd56245fab9beaabfd86fd8f95d7c42c2a5) ) ROM_END @@ -388,12 +525,15 @@ ROM_LOAD( "b23-09.3d", 0x50000, 0x10000, CRC(6651617f) SHA1(6351a0b01589cb181b896285ade70e9dfcd799ec) ) ROM_REGION( 0x00c00, "proms", 0 ) - /* These appear to be twice the correct size */ + // These appear to be twice the correct size ROM_LOAD( "b23-04.15l", 0x00000, 0x00400, CRC(5042cffa) SHA1(c969748866a12681cf2dbf25a46da2c4e4f92313) ) - ROM_LOAD( "b23-03.14l", 0x00400, 0x00400, BAD_DUMP CRC(9458fd45) SHA1(7f7cdacf37bb6f15de1109fa73ba3c5fc88893d0) ) /* D0 is fixed */ + ROM_LOAD( "b23-03.14l", 0x00400, 0x00400, BAD_DUMP CRC(9458fd45) SHA1(7f7cdacf37bb6f15de1109fa73ba3c5fc88893d0) ) // D0 is fixed ROM_LOAD( "b23-05.16l", 0x00800, 0x00400, CRC(87f0f69a) SHA1(37df6fd56245fab9beaabfd86fd8f95d7c42c2a5) ) ROM_END +} // anonymous namespace + + GAME( 1987, exzisus, 0, exzisus, exzisus, exzisus_state, empty_init, ROT0, "Taito Corporation", "Exzisus (Japan, dedicated)", MACHINE_SUPPORTS_SAVE ) GAME( 1987, exzisusa, exzisus, exzisus, exzisus, exzisus_state, empty_init, ROT0, "Taito Corporation", "Exzisus (Japan, conversion)", MACHINE_SUPPORTS_SAVE ) GAME( 1987, exzisust, exzisus, exzisus, exzisus, exzisus_state, empty_init, ROT0, "Taito Corporation (TAD license)", "Exzisus (TAD license)", MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/fastfred.cpp mame-0.243+dfsg.1/src/mame/drivers/fastfred.cpp --- mame-0.242+dfsg.1/src/mame/drivers/fastfred.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/fastfred.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -555,17 +555,6 @@ PORT_DIPSETTING( 0x00, DEF_STR( On ) ) INPUT_PORTS_END -static const gfx_layout charlayout = -{ - 8,8, - RGN_FRAC(1,3), - 3, - { RGN_FRAC(2,3), RGN_FRAC(1,3), RGN_FRAC(0,3) }, - { 0, 1, 2, 3, 4, 5, 6, 7 }, - { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, - 8*8 -}; - static const gfx_layout spritelayout = { 16,16, @@ -592,32 +581,21 @@ 32*8 }; -static const gfx_layout imago_char_1bpp = -{ - 8,8, - RGN_FRAC(1,1), - 1, - { 0 }, - { 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_fastfred ) - GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 32 ) - GFXDECODE_ENTRY( "gfx2", 0, spritelayout, 0, 32 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x3_planar, 0, 32 ) + GFXDECODE_ENTRY( "gfx2", 0, spritelayout, 0, 32 ) GFXDECODE_END static GFXDECODE_START( gfx_jumpcoas ) - GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 32 ) - GFXDECODE_ENTRY( "gfx1", 0, spritelayout, 0, 32 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x3_planar, 0, 32 ) + GFXDECODE_ENTRY( "gfx1", 0, spritelayout, 0, 32 ) GFXDECODE_END static GFXDECODE_START( gfx_imago ) - GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 32 ) - GFXDECODE_ENTRY( nullptr, 0xb800, imago_spritelayout, 0, 32 ) - GFXDECODE_ENTRY( "gfx3", 0, charlayout, 0, 32 ) - GFXDECODE_ENTRY( "gfx4", 0, imago_char_1bpp, 0x140, 1 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x3_planar, 0, 32 ) + GFXDECODE_ENTRY( nullptr, 0xb800, imago_spritelayout, 0, 32 ) + GFXDECODE_ENTRY( "gfx3", 0, gfx_8x8x3_planar, 0, 32 ) + GFXDECODE_ENTRY( "gfx4", 0, gfx_8x8x1, 0x140, 1 ) GFXDECODE_END WRITE_LINE_MEMBER(fastfred_state::vblank_irq) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/ffantasy_ms.cpp mame-0.243+dfsg.1/src/mame/drivers/ffantasy_ms.cpp --- mame-0.242+dfsg.1/src/mame/drivers/ffantasy_ms.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/ffantasy_ms.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -3,11 +3,12 @@ /* Fighting Fantasy (Modular System) + Dragon Ninja (Modular System) As with most of the 'Modular System' setups, the hardware is heavily modified from the original and consists of a multi-board stack in a cage, hence different driver. - For this game the Modular System cage contains 8 main boards and 1 sub board. + For Fighting Fantasy the Modular System cage contains 8 main boards and 1 sub board. MOD-6/1 - TSC68000CP12, 4 ROMs, RAMs, 20 MHz XTAL. MOD 21/1(?) - 20 MHz XTAL. @@ -19,20 +20,34 @@ MOD 4/3 - Tilemap board, has logic + 4 tilemap ROMs, long thin sub-board (C0469 SOLD) with no chips, just routing along one edge. PCBs pictures and dip listing are available at: http://www.recreativas.org/modular-system-fighting-fantasy-5694-gaelco-sa + + For Dragon Ninja the Modular System cage contains 7 main boards and 1 sub board. + + MOD-6/1 - MC68000P10, 2 ROMs, RAMs, 20 MHz XTAL. + MOD 21/1(?) - 20 MHz XTAL. + MOD 1/B 4 - Sound board (Z0840006PSC, 2 x YM2203C). 2 8-dips banks + small sub board with OKI M5205. + MOD 51/3 - Sprite board, has logic + 4 ROM, short thin sub-board (C0528) with no chips, just routing along one edge. + MOD 4/3 - Tilemap board, has logic + 4 tilemap ROMs, long thin sub-board (C0462) with no chips, just routing along one edge. + MOD 4/3 - Tilemap board, has logic + 4 tilemap ROMs, long thin sub-board (C0463) with no chips, just routing along one edge. + MOD 4/2 - Tilemap board, has logic + 4 tilemap ROMs, long thin sub-board (C0464) with no chips, just routing along one edge. */ #include "emu.h" + #include "cpu/m68000/m68000.h" #include "cpu/z80/z80.h" #include "machine/gen_latch.h" #include "sound/msm5205.h" #include "sound/ymopn.h" + #include "emupal.h" #include "screen.h" #include "speaker.h" +namespace { + class ffantasy_ms_state : public driver_device { public: @@ -60,6 +75,7 @@ void ffantasy_ms_state::ffantasym_map(address_map &map) { map(0x000000, 0x03ffff).rom(); + map(0xff8000, 0xffbfff).ram(); } @@ -74,6 +90,23 @@ } static INPUT_PORTS_START( ffantasym ) + PORT_START("DSW") + PORT_DIPUNKNOWN_DIPLOC(0x0001, 0x0001, "SW1:1") + PORT_DIPUNKNOWN_DIPLOC(0x0002, 0x0002, "SW1:2") + PORT_DIPUNKNOWN_DIPLOC(0x0004, 0x0004, "SW1:3") + PORT_DIPUNKNOWN_DIPLOC(0x0008, 0x0008, "SW1:4") + PORT_DIPUNKNOWN_DIPLOC(0x0010, 0x0010, "SW1:5") + PORT_DIPUNKNOWN_DIPLOC(0x0020, 0x0020, "SW1:6") + PORT_DIPUNKNOWN_DIPLOC(0x0040, 0x0040, "SW1:7") + PORT_DIPUNKNOWN_DIPLOC(0x0080, 0x0080, "SW1:8") + PORT_DIPUNKNOWN_DIPLOC(0x0100, 0x0100, "SW2:1") + PORT_DIPUNKNOWN_DIPLOC(0x0200, 0x0200, "SW2:2") + PORT_DIPUNKNOWN_DIPLOC(0x0400, 0x0400, "SW2:3") + PORT_DIPUNKNOWN_DIPLOC(0x0800, 0x0800, "SW2:4") + PORT_DIPUNKNOWN_DIPLOC(0x1000, 0x1000, "SW2:5") + PORT_DIPUNKNOWN_DIPLOC(0x2000, 0x2000, "SW2:6") + PORT_DIPUNKNOWN_DIPLOC(0x4000, 0x4000, "SW2:7") + PORT_DIPUNKNOWN_DIPLOC(0x8000, 0x8000, "SW2:8") INPUT_PORTS_END static GFXDECODE_START( gfx_ffantasy_ms ) @@ -150,7 +183,7 @@ ROM_LOAD( "ff_5-1_5fa_523.ic26", 0xe0000, 0x10000, CRC(a541c879) SHA1(53133cb2ad5378f101025fc758d08a54e23f3c87) ) ROM_LOAD( "ff_5-1_5fa_524.ic27", 0xf0000, 0x10000, CRC(1e7351c5) SHA1(88d83b45f25fe58726e5158b97395443cf065564) ) - ROM_REGION( 0x0400, "proms", 0 ) /* PROMs (function unknown) */ + ROM_REGION( 0x0400, "proms", 0 ) // PROMs (function unknown) ROM_LOAD( "ff_1-5_110_82s123.ic20", 0x000, 0x020, CRC(e26e680a) SHA1(9bbe30e98e952a6113c64e1171330153ddf22ce7) ) ROM_LOAD( "ff_21-1_201_82s129.ic4", 0x100, 0x100, CRC(2697da58) SHA1(e62516b886ff6e204b718e5f0c6ce2712e4b7fc5) ) ROM_LOAD( "ff_21-1_205_82s129.ic12", 0x200, 0x100, CRC(204a7aee) SHA1(322164134aa65c37a9389024f921364a81d13e88) ) @@ -167,4 +200,57 @@ ROM_LOAD( "ff_5-1_5235_gal16v8.ic8", 0x000, 0x117, NO_DUMP ) ROM_END +ROM_START( drgninjam ) + ROM_REGION( 0x100000, "maincpu", 0 ) // on MOD 6/1 board, extremely similar to drgninjab in dec0.cpp. TODO: ROM loading may be wrong (check 0x20000 - 0x3ffff being empty in drgninjab) + ROM_LOAD16_BYTE( "6-1_cpu_dn_603.ic17", 0x00000, 0x20000, CRC(1c3670df) SHA1(0e287a0b4494e702080e80a911c4762bbc6a5815) ) + ROM_LOAD16_BYTE( "6-1_cpu_dn_606.ic8", 0x00001, 0x20000, CRC(07669458) SHA1(c5dcf72eba5e345228ee3f9e0228cba526e1156a) ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) // on MOD 1/2 board + ROM_LOAD( "1-4_snd_dn_101.ic12", 0x00000, 0x10000, CRC(0b82c205) SHA1(0be243b19693c54914eccefbf6a8b8b513eec299) ) + + ROM_REGION( 0x80000, "gfx1", 0 ) // on one of the MOD 4/3 boards + ROM_LOAD( "4-3_dn_401.ic17", 0x0000, 0x4000, CRC(45ab2822) SHA1(0cf0f74ad5325a66f74fc20cabd6a9d3d8c42f2a) ) + ROM_LOAD( "4-3_dn_402.ic16", 0x4000, 0x4000, CRC(26f0095b) SHA1(9e568a23df2b0ca05d8b87fea445f5f98e55fac5) ) + ROM_LOAD( "4-3_dn_403.ic15", 0x8000, 0x4000, CRC(c2061c37) SHA1(b06737ecece7da4785c2e98977f6dc35986a445e) ) // 1ST AND 2ND HALF IDENTICAL + ROM_IGNORE( 0x4000 ) + ROM_LOAD( "4-3_dn_404.ic14", 0xc000, 0x4000, CRC(1da44e82) SHA1(ccb9464b711025a5c2c18ecb765f7f0e15f7d4a5) ) // 1ST AND 2ND HALF IDENTICAL + ROM_IGNORE( 0x4000 ) + + ROM_REGION( 0x80000, "gfx2", 0 ) // on a second MOD 4/3 board + ROM_LOAD( "4-3-a_dn_4a01.ic17", 0x00000, 0x8000, CRC(c89982ac) SHA1(7509322bf4dcaceefdbaf6e9f4087a576133fe39) ) + ROM_LOAD( "4-3-a_dn_4a02.ic16", 0x08000, 0x8000, CRC(144b0359) SHA1(46565c5694f0cfcf06c1ee7c131ab3c88c804d35) ) + ROM_LOAD( "4-3-a_dn_4a03.ic15", 0x10000, 0x8000, CRC(ae98a684) SHA1(d6fe7237b82125a21b9804500ba2166906475a0e) ) + ROM_LOAD( "4-3-a_dn_4a04.ic14", 0x18000, 0x8000, CRC(8292c4ad) SHA1(f83acf64b101022927b678749d754374a20f5444) ) + + ROM_REGION( 0x80000, "gfx3", 0 ) // on a MOD 4/2 board + ROM_LOAD( "4-2-b_dn_4b01.ic17", 0x00000, 0x10000, CRC(65002e5c) SHA1(e1fa0a0395d3fbcf31e15b63b7eaf478063aa971) ) + ROM_LOAD( "4-2-b_dn_4b02.ic16", 0x10000, 0x10000, CRC(dd6acd2d) SHA1(e2a0ccf49dce421b10ad0ed54d02ba1ca6525404) ) + ROM_LOAD( "4-2-b_dn_4b03.ic15", 0x20000, 0x10000, CRC(63e337c1) SHA1(ca347d6a46ee643edfdc8614760dc9b0994e1745) ) + ROM_LOAD( "4-2-b_dn_4b04.ic14", 0x30000, 0x10000, CRC(5cc7ec8c) SHA1(3f17e13af7152c51ce025ca06ece70b4a6f65f94) ) + + ROM_REGION( 0x100000, "gfx4", 0 ) // on MOD 51/1 board + ROM_LOAD( "51-3_dn_501.ic43", 0x00000, 0x20000, CRC(0fccce1f) SHA1(e2e5625b62ddd73a4363596a4b1b2d72c2fe1c38) ) + ROM_LOAD( "51-3_dn_502.ic42", 0x20000, 0x20000, CRC(361f4616) SHA1(40279c76d027bcf698b8ff694afc2afb15279381) ) + ROM_LOAD( "51-3_dn_503.ic41", 0x40000, 0x20000, CRC(b3c97ad1) SHA1(f77426e1ee347b8cae9c5aef1e31058344c019c2) ) + ROM_LOAD( "51-3_dn_504.ic40", 0x60000, 0x20000, CRC(1445dccb) SHA1(fddbb9d136ea6dbb2704ac93e5536ed0e6bfb19c) ) + + ROM_REGION( 0x0400, "proms", 0 ) // PROMs (function unknown) + ROM_LOAD( "1-4_snd_110_82s123.ic20", 0x000, 0x020, CRC(e26e680a) SHA1(9bbe30e98e952a6113c64e1171330153ddf22ce7) ) + ROM_LOAD( "21-1_p0201_tbp24s10n.ic4", 0x100, 0x100, CRC(2697da58) SHA1(e62516b886ff6e204b718e5f0c6ce2712e4b7fc5) ) + ROM_LOAD( "21-1_p0205_82s129n.ic12", 0x200, 0x100, CRC(204a7aee) SHA1(322164134aa65c37a9389024f921364a81d13e88) ) + ROM_LOAD( "51-3_502_82s129.ic10", 0x300, 0x100, CRC(15085e44) SHA1(646e7100fcb112594023cf02be036bd3d42cc13c) ) + + ROM_REGION( 0xc00, "plds", ROMREGION_ERASEFF ) + ROM_LOAD( "6-1_cpu_604_gal16v8.ic13", 0x000, 0x117, NO_DUMP ) + ROM_LOAD( "6-1_cpu_630_gal16v8.ic7", 0x200, 0x117, NO_DUMP ) + ROM_LOAD( "4-3_p0403_pal16r8a.ic29", 0x400, 0x104, CRC(506156cc) SHA1(5560671fc2c9872ed28620491af5dc486909fc6e) ) + ROM_LOAD( "4-3-a_p0403.ic29", 0x600, 0x104, CRC(506156cc) SHA1(5560671fc2c9872ed28620491af5dc486909fc6e) ) + ROM_LOAD( "4-2-b_403_gal16v8.ic29", 0x800, 0x104, NO_DUMP ) + ROM_LOAD( "51-3_503_gal16v8.ic46", 0xa00, 0x117, CRC(11470ea1) SHA1(cfcafbcc7e55be717348f895df61e144fdd0cc9b) ) +ROM_END + +} // anonymous namespace + + GAME( 199?, ffantasym, hippodrm, ffantasym, ffantasym, ffantasy_ms_state, empty_init, ROT0, "bootleg (Gaelco / Ervisa)", "Fighting Fantasy (Modular System)", MACHINE_IS_SKELETON ) +GAME( 199?, drgninjam, baddudes, ffantasym, ffantasym, ffantasy_ms_state, empty_init, ROT0, "bootleg (Gaelco / Ervisa)", "Dragon Ninja (Modular System)", MACHINE_IS_SKELETON ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/fidel_checkc2.cpp mame-0.243+dfsg.1/src/mame/drivers/fidel_checkc2.cpp --- mame-0.242+dfsg.1/src/mame/drivers/fidel_checkc2.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/fidel_checkc2.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -64,7 +64,7 @@ void rama1_w(u8 data); u8 input_r(); - u8 m_ram[0x100]; + u8 m_ram[0x100] = { }; u8 m_ram_address = 0; u8 m_ram_data = 0; u8 m_ram_control = 0; @@ -76,8 +76,6 @@ void cr_state::machine_start() { - memset(m_ram, 0, sizeof(m_ram)); - // register for savestates save_item(NAME(m_ram)); save_item(NAME(m_ram_address)); diff -Nru mame-0.242+dfsg.1/src/mame/drivers/fidel_dames.cpp mame-0.243+dfsg.1/src/mame/drivers/fidel_dames.cpp --- mame-0.242+dfsg.1/src/mame/drivers/fidel_dames.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/fidel_dames.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -82,10 +82,6 @@ void dsc_state::machine_start() { - // zerofill - m_inp_mux = 0; - m_led_select = 0; - // register for savestates save_item(NAME(m_inp_mux)); save_item(NAME(m_led_select)); diff -Nru mame-0.242+dfsg.1/src/mame/drivers/finalizr.cpp mame-0.243+dfsg.1/src/mame/drivers/finalizr.cpp --- mame-0.242+dfsg.1/src/mame/drivers/finalizr.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/finalizr.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -192,17 +192,6 @@ -static const gfx_layout charlayout = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { 0, 1, 2, 3 }, - { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4 }, - { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 }, - 32*8 -}; - static const gfx_layout spritelayout = { 16,16, @@ -217,9 +206,9 @@ }; static GFXDECODE_START( gfx_finalizr ) - GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 16 ) - GFXDECODE_ENTRY( "gfx1", 0, spritelayout, 16*16, 16 ) - GFXDECODE_ENTRY( "gfx1", 0, charlayout, 16*16, 16 ) // to handle 8x8 sprites + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x4_packed_msb, 0, 16 ) + GFXDECODE_ENTRY( "gfx1", 0, spritelayout, 16*16, 16 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x4_packed_msb, 16*16, 16 ) // to handle 8x8 sprites GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/firefox.cpp mame-0.243+dfsg.1/src/mame/drivers/firefox.cpp --- mame-0.242+dfsg.1/src/mame/drivers/firefox.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/firefox.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -598,17 +598,6 @@ * *************************************/ -static const gfx_layout tilelayout = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { STEP4(0,1) }, - { STEP8(0,4) }, - { STEP8(0,32) }, - 32*8 -}; - static const gfx_layout spritelayout = { 16,16, @@ -621,8 +610,8 @@ }; static GFXDECODE_START( gfx_firefox ) - GFXDECODE_ENTRY("tiles", 0, tilelayout, 0, 1) - GFXDECODE_ENTRY("sprites", 0, spritelayout, 256, 4) + GFXDECODE_ENTRY("tiles", 0, gfx_8x8x4_packed_msb, 0, 1) + GFXDECODE_ENTRY("sprites", 0, spritelayout, 256, 4) GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/flicker.cpp mame-0.243+dfsg.1/src/mame/drivers/flicker.cpp --- mame-0.242+dfsg.1/src/mame/drivers/flicker.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/flicker.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -434,4 +434,4 @@ } // Anonymous namespace // YEAR GAME PARENT MACHINE INPUT CLASS INIT ORIENTATION COMPANY DESCRIPTION FLAGS -GAME( 1974, flicker, 0, flicker, flicker, flicker_state, empty_init, ROT0, "Dave Nutting Associates / Bally", "Flicker (prototype)", MACHINE_IS_INCOMPLETE | MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1974, flicker, 0, flicker, flicker, flicker_state, empty_init, ROT0, "Dave Nutting Associates / Bally", "Flicker (prototype)", MACHINE_IS_INCOMPLETE | MACHINE_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/fm7.cpp mame-0.243+dfsg.1/src/mame/drivers/fm7.cpp --- mame-0.242+dfsg.1/src/mame/drivers/fm7.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/fm7.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1908,7 +1908,8 @@ m_cassette->add_route(ALL_OUTPUTS, "mono", 0.05); m_cassette->set_interface("fm7_cass"); - SOFTWARE_LIST(config, "cass_list").set_original("fm7_cass"); + SOFTWARE_LIST(config, "fm7_cass_list").set_original("fm7_cass"); + SOFTWARE_LIST(config, "fm8_cass_list").set_compatible("fm8_cass"); MB8877(config, m_fdc, 8_MHz_XTAL / 8); m_fdc->intrq_wr_callback().set(FUNC(fm7_state::fdc_intrq_w)); @@ -1960,6 +1961,8 @@ m_cassette->add_route(ALL_OUTPUTS, "mono", 0.05); m_cassette->set_interface("fm7_cass"); + SOFTWARE_LIST(config, "fm8_cass_list").set_original("fm8_cass"); + MB8877(config, m_fdc, 8_MHz_XTAL / 8); m_fdc->intrq_wr_callback().set(FUNC(fm7_state::fdc_intrq_w)); m_fdc->drq_wr_callback().set(FUNC(fm7_state::fdc_drq_w)); @@ -2018,7 +2021,8 @@ m_cassette->add_route(ALL_OUTPUTS, "mono", 0.05); m_cassette->set_interface("fm7_cass"); - SOFTWARE_LIST(config, "cass_list").set_compatible("fm7_cass"); + SOFTWARE_LIST(config, "fm7_cass_list").set_compatible("fm7_cass"); + SOFTWARE_LIST(config, "fm8_cass_list").set_compatible("fm8_cass"); MB8877(config, m_fdc, 8_MHz_XTAL / 8); m_fdc->intrq_wr_callback().set(FUNC(fm77_state::fdc_intrq_w)); diff -Nru mame-0.242+dfsg.1/src/mame/drivers/fmtowns.cpp mame-0.243+dfsg.1/src/mame/drivers/fmtowns.cpp --- mame-0.242+dfsg.1/src/mame/drivers/fmtowns.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/fmtowns.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1447,7 +1447,7 @@ for(track=1;track<99;track++) { - if(cdrom_get_track_start(cdrom->get_cdrom_file(),track) > lba) + if(cdrom->get_cdrom_file()->get_track_start(track) > lba) break; } return track; @@ -1495,7 +1495,7 @@ m_towns_cd.extra_status = 0; towns_cd_set_status(0x22,0x00,0x00,0x00); towns_cdrom_set_irq(TOWNS_CD_IRQ_DMA,1); - cdrom_read_data(m_cdrom->get_cdrom_file(),++m_towns_cd.lba_current,m_towns_cd.buffer,CD_TRACK_MODE1); + m_cdrom->get_cdrom_file()->read_data(++m_towns_cd.lba_current,m_towns_cd.buffer,cdrom_file::CD_TRACK_MODE1); m_towns_cd.read_timer->adjust(attotime::from_hz(300000),1); m_towns_cd.buffer_ptr = -1; } @@ -1526,7 +1526,7 @@ } else { - cdrom_read_data(m_cdrom->get_cdrom_file(),++m_towns_cd.lba_current,m_towns_cd.buffer,CD_TRACK_MODE1); + m_cdrom->get_cdrom_file()->read_data(++m_towns_cd.lba_current,m_towns_cd.buffer,cdrom_file::CD_TRACK_MODE1); m_towns_cd.extra_status = 0; towns_cd_set_status(0x21,0x00,0x00,0x00); towns_cdrom_set_irq(TOWNS_CD_IRQ_DMA,1); @@ -1558,7 +1558,7 @@ m_towns_cd.lba_current = msf_to_lbafm(lba1); m_towns_cd.lba_last = msf_to_lbafm(lba2); - track = cdrom_get_track(device->get_cdrom_file(),m_towns_cd.lba_current); + track = device->get_cdrom_file()->get_track(m_towns_cd.lba_current); // parameter 7 = sector count? // lemmings 2 sets this to 4 but hates 4 extra sectors being read @@ -1574,7 +1574,7 @@ } else { - cdrom_read_data(device->get_cdrom_file(),m_towns_cd.lba_current,m_towns_cd.buffer,CD_TRACK_MODE1); + device->get_cdrom_file()->read_data(m_towns_cd.lba_current,m_towns_cd.buffer,cdrom_file::CD_TRACK_MODE1); if(m_towns_cd.software_tx) { m_towns_cd.status &= ~0x10; // not a DMA transfer @@ -1816,7 +1816,7 @@ break; case 4: // st1 = last track number (BCD) towns_cd_set_status(0x17, - byte_to_bcd(cdrom_get_last_track(m_cdrom->get_cdrom_file())), + byte_to_bcd(m_cdrom->get_cdrom_file()->get_last_track()), 0x00,0x00); m_towns_cd.extra_status++; break; @@ -1825,8 +1825,8 @@ m_towns_cd.extra_status++; break; case 6: // st1/2/3 = address of track 0xaa? (BCD) - addr = cdrom_get_track_start(m_cdrom->get_cdrom_file(),0xaa); - addr = lba_to_msf(addr + 150); + addr = m_cdrom->get_cdrom_file()->get_track_start(0xaa); + addr = cdrom_file::lba_to_msf(addr + 150); towns_cd_set_status(0x17, (addr & 0xff0000) >> 16,(addr & 0x00ff00) >> 8,addr & 0x0000ff); m_towns_cd.extra_status++; @@ -1835,19 +1835,19 @@ if(m_towns_cd.extra_status & 0x01) { towns_cd_set_status(0x16, - ((cdrom_get_adr_control(m_cdrom->get_cdrom_file(),(m_towns_cd.extra_status/2)-3) & 0x0f) << 4) - | ((cdrom_get_adr_control(m_cdrom->get_cdrom_file(),(m_towns_cd.extra_status/2)-3) & 0xf0) >> 4), + ((m_cdrom->get_cdrom_file()->get_adr_control((m_towns_cd.extra_status/2)-3) & 0x0f) << 4) + | ((m_cdrom->get_cdrom_file()->get_adr_control((m_towns_cd.extra_status/2)-3) & 0xf0) >> 4), byte_to_bcd((m_towns_cd.extra_status/2)-2),0x00); m_towns_cd.extra_status++; } else { int track = (m_towns_cd.extra_status/2)-4; - addr = cdrom_get_track_start(m_cdrom->get_cdrom_file(),track); - addr = lba_to_msf(addr + 150); + addr = m_cdrom->get_cdrom_file()->get_track_start(track); + addr = cdrom_file::lba_to_msf(addr + 150); towns_cd_set_status(0x17, (addr & 0xff0000) >> 16,(addr & 0x00ff00) >> 8,addr & 0x0000ff); - if(track >= cdrom_get_last_track(m_cdrom->get_cdrom_file())) + if(track >= m_cdrom->get_cdrom_file()->get_last_track()) { m_towns_cd.extra_status = 0; } @@ -1867,21 +1867,21 @@ break; case 2: // st0/1/2 = MSF from beginning of current track addr = m_cdda->get_audio_lba(); - addr = lba_to_msf(addr - m_towns_cd.cdda_current); + addr = cdrom_file::lba_to_msf(addr - m_towns_cd.cdda_current); towns_cd_set_status(0x19, (addr & 0xff0000) >> 16,(addr & 0x00ff00) >> 8,addr & 0x0000ff); m_towns_cd.extra_status++; break; case 3: // st1/2 = current MSF addr = m_cdda->get_audio_lba(); - addr = lba_to_msf(addr); // this data is incorrect, but will do until exact meaning is found + addr = cdrom_file::lba_to_msf(addr); // this data is incorrect, but will do until exact meaning is found towns_cd_set_status(0x19, 0x00,(addr & 0xff0000) >> 16,(addr & 0x00ff00) >> 8); m_towns_cd.extra_status++; break; case 4: addr = m_cdda->get_audio_lba(); - addr = lba_to_msf(addr); // this data is incorrect, but will do until exact meaning is found + addr = cdrom_file::lba_to_msf(addr); // this data is incorrect, but will do until exact meaning is found towns_cd_set_status(0x20, addr & 0x0000ff,0x00,0x00); m_towns_cd.extra_status = 0; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/freekick.cpp mame-0.243+dfsg.1/src/mame/drivers/freekick.cpp --- mame-0.242+dfsg.1/src/mame/drivers/freekick.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/freekick.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -731,17 +731,6 @@ * *************************************/ -static const gfx_layout charlayout = -{ - 8,8, - RGN_FRAC(1,3), - 3, - { RGN_FRAC(2,3), RGN_FRAC(1,3), RGN_FRAC(0,3) }, - { 0,1,2,3, 4,5,6,7 }, - { 0*8,1*8,2*8,3*8,4*8,5*8,6*8,7*8 }, - 8*8 -}; - static const gfx_layout spritelayout = { 16,16, @@ -758,8 +747,8 @@ }; static GFXDECODE_START( gfx_freekick ) - GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0x000, 32 ) - GFXDECODE_ENTRY( "gfx2", 0, spritelayout, 0x100, 32 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x3_planar, 0x000, 32 ) + GFXDECODE_ENTRY( "gfx2", 0, spritelayout, 0x100, 32 ) GFXDECODE_END /************************************* diff -Nru mame-0.242+dfsg.1/src/mame/drivers/freeway.cpp mame-0.243+dfsg.1/src/mame/drivers/freeway.cpp --- mame-0.242+dfsg.1/src/mame/drivers/freeway.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/freeway.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -108,19 +108,8 @@ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_MEMORY_RESET) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, freeway_state, nmi_w) INPUT_PORTS_END -static const gfx_layout char_layout = -{ - 8,8, - RGN_FRAC(1,3), - 3, - { RGN_FRAC(2,3), RGN_FRAC(1,3), RGN_FRAC(0,3) }, - { 0, 1, 2, 3, 4, 5, 6, 7 }, - { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, - 8*8, -}; - static GFXDECODE_START(gfx_freeway) - GFXDECODE_ENTRY("gfx", 0, char_layout, 0x0, 1) + GFXDECODE_ENTRY("gfx", 0, gfx_8x8x3_planar, 0x0, 1) GFXDECODE_END void freeway_state::freeway(machine_config &config) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/fruitpc.cpp mame-0.243+dfsg.1/src/mame/drivers/fruitpc.cpp --- mame-0.242+dfsg.1/src/mame/drivers/fruitpc.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/fruitpc.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -7,6 +7,12 @@ preliminary driver by R. Belmont and Carl + TODO: + - Can't find CF card, throws "No boot device available", culprit may be lack of + PCI shadow RAM handling (which causes BIOS to boot in legacy mode); + - Handle STPCD0166BTC3 SoC properly, including PCI devices connected and SVGA + mods (wrongly draws only top screen with 640x200 with at486 -isa1 svga_s3); + Hardware: - ST STPCD0166BTC3 486/66 + PC + VGA all on one chip - 4x AS4LC1M16E5-60TC 1M x 16 EDO DRAM @@ -15,7 +21,7 @@ #include "emu.h" #include "cpu/i386/i386.h" -#include "machine/lpci.h" +#include "machine/pci.h" #include "machine/pckeybrd.h" #include "machine/idectrl.h" #include "video/pc_vga.h" @@ -28,6 +34,7 @@ public: fruitpc_state(const machine_config &mconfig, device_type type, const char *tag) : pcat_base_state(mconfig, type, tag) + , m_pciroot(*this, "pci") , m_isabus(*this, "isa") , m_inp(*this, "INP%u", 1U) { } @@ -35,6 +42,7 @@ void fruitpc(machine_config &config); private: + required_device m_pciroot; required_device m_isabus; required_ioport_array<4> m_inp; @@ -70,6 +78,7 @@ map(0x03c0, 0x03cf).rw("vga", FUNC(vga_device::port_03c0_r), FUNC(vga_device::port_03c0_w)); map(0x03d0, 0x03df).rw("vga", FUNC(vga_device::port_03d0_r), FUNC(vga_device::port_03d0_w)); map(0x03f0, 0x03f7).rw("ide", FUNC(ide_controller_device::cs1_r), FUNC(ide_controller_device::cs1_w)); +// map(0x0cf8, 0x0cff).rw(m_pcibus, FUNC(pci_bus_device::read), FUNC(pci_bus_device::write)); } static INPUT_PORTS_START( fruitpc ) @@ -131,6 +140,9 @@ m_dma8237_1->out_iow_callback<1>().set(FUNC(fruitpc_state::dma8237_1_dack_w)); + PCI_ROOT(config, m_pciroot, 0); + // TODO: STPCD0166BTC3 host PCI + ISA8(config, m_isabus, 0); m_isabus->set_memspace("maincpu", AS_PROGRAM); m_isabus->set_iospace("maincpu", AS_IO); @@ -159,15 +171,3 @@ ROM_END GAME( 2006, fruitpc, 0, fruitpc, fruitpc, fruitpc_state, empty_init, ROT0, "", "Fruit Land", MACHINE_IMPERFECT_GRAPHICS ) - -// this doesn't really belong here, but is some kind of x86 pc-like hardware, exact CPU type etc. unknown -// hardware ia by Paokai, motherboard has logos, large chip with logo too, http://www.paokai.com.tw/ -ROM_START( gogostrk ) - ROM_REGION32_LE( 0x40000, "bios", 0 ) - ROM_LOAD( "39sf020a.rom1", 0x000000, 0x040000, CRC(236d4d95) SHA1(50579acddc93c05d5f8e17ad3669a29d2dc49965) ) - - DISK_REGION( "ide:0:hdd:image" ) // 128 MB CF Card - DISK_IMAGE( "ggs-5-2-07", 0,SHA1(f214fd39ec8ac02f008823f4b179ea6c6835e1b8) ) -ROM_END - -GAME( 2007, gogostrk, 0, fruitpc, fruitpc, fruitpc_state, empty_init, ROT0, "American Alpha / Paokai", "Go Go Strike", MACHINE_NOT_WORKING ) // motherboard is dated 2006, if the CF card string is a date it's 2007 diff -Nru mame-0.242+dfsg.1/src/mame/drivers/funtech.cpp mame-0.243+dfsg.1/src/mame/drivers/funtech.cpp --- mame-0.242+dfsg.1/src/mame/drivers/funtech.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/funtech.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -424,20 +424,8 @@ }; -static const gfx_layout tiles8x8_layout = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { 0, 1, 2, 3 }, - { 4, 0, 12, 8, 20, 16, 28, 24 }, - { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 }, - 32*8 -}; - - static GFXDECODE_START( gfx_funtech ) - GFXDECODE_ENTRY( "gfx1", 0, tiles8x8_layout, 0, 16 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x4_packed_lsb, 0, 16 ) GFXDECODE_ENTRY( "gfx2", 0, tiles8x32_layout, 0x100, 1 ) GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/funworld.cpp mame-0.243+dfsg.1/src/mame/drivers/funworld.cpp --- mame-0.242+dfsg.1/src/mame/drivers/funworld.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/funworld.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -96,6 +96,8 @@ * Jolly Joker (original program, interleaved GFX, no logo), Impera, 199?. * Jolly Joker (Solid State module in suicide board). Impera, 199?. * Multi Win (Ver.0167, encrypted), Fun World, 1992. + * Multi Win (Ver.0091, encrypted), Fun World, 1991. + * Multi Win (EPM7032, encrypted), Amatic, 2001. * Power Card (Ver 0263, encrypted), Fun World, 1993. * Mega Card (Ver.0210, encrypted), Fun World, 1993. * Joker Card 300 (Ver.A267BC, encrypted), Amatic Trading, 1993. @@ -6791,7 +6793,165 @@ /* + Multi Win + Version 0091 + 1991-09-20 + + Different encryption scheme. + Looks like more close to megacrd. + ++--------------------------------------------------------------------------------------+ +| +------+ +------+ | +| +------+ +--------+ | | | | | +| | | |74LS157N| |GOLDST| | | +--+ | +| | | +--------+ |AR | |SOUND | | | +--+ +---+ +| | | +--------+ | | | | | | | | --| +| |GOLDST| |74LS157N| |GM76C2| |AY-3-8| |K | |L | --| +| |AR | +--------+ |8A-10 | |91C | | | | | --| +| | | +--------+ | | +-------------------+ | | | | | | --| +| |GM68B4| |74LS157N| | | | ::::::::::::::::: | | | +--+ +--+ --| +| |5S | +--------+ +------+ +-------------------+ | | --| +| | | +--------+ | | +--+ --| +| |9141 | |74LS157N| | | | | --| +| | | +--------+ +----------+ +----------+ | | |M | +---+ +| | | |PAL16L8ACN| | EMPTY | | | | | | +| | | +----+ +----------+ +----------+ | | | | | +| +------+ +--------------+ |XTAL| | | +--+ | +| | KM6264BL-10 | | | +--------------------+ +------+ | +| +----------+ | 214Y KOREA | |16.0| | | +------+ | +| | 74LS245N | | | |00 | | FUN WORLD | | | | +| +----------+ +--------------+ +----+ | ELEKTRONIK | | | +---+ +| | | | | --| +| +----------+ +----------+ +--------------------+ |S22LD | --| +| | 74LS374N | | 74LS374N | | | --| +| +----------+ +----------+ +--+ +--+ +--------------+ | 9248 | --| +| | | | | | EMPTY | | | --| +|+--------------+ +--------+ | | | | | SOCKET | |EF6821| +--+ --| +||Multi Win | |74LS194A| |A | |B | | IC25| |P | | | --| +||ZG 1 | +--------+ | | | | +--------------+ | | |D | --| +|| IC10| +--------+ | | | | | | |I | --| +|+--------------+ |74LS194A| +--+ | | +--------------+ | | |P | --| +| +--------+ +--+ |Multi Win | | | |1 | --| +|+--------------+ +--------+ |91/F/1 | | | | | --| +||Multi Win | |74LS194A| +--+ +--+ +--+ | IC37| | | +--+ --| +||ZG 2 | +--------+ | | | | | | +--------------+ +------+ --| +|| IC11| +--------+ |C | | | | | +------+ --| +|+--------------+ |74LS194A| | | |D | |E | +--------------+ | | --| +| +--------+ | | | | | | |Multi Win | | | --| +|+--------+ +-------+ +--+ | | | | |91/F/2 | | | --| +||74LS174N| |74LS02N| | | +--+ | IC41| | | --| +|+--------+ +-------+ +--+ +--------------+ |MC68B2| --| +| |1P | --| +|+--+ +--+ +--+ +--+ | | --| +|| | | | | | +--+ - | | |0K2P | --| +||F | | | | | |I | |J | | | --| +|| | |G | |H | | | BATTERY | | |LLFT92| --| +|| | | | | | +--+ | | |24 | +---+ +|+--+ | | | | + +--+ | | | +| | | | | | | | +| +--+ +--+ +------+ | ++--------------------------------------------------------------------------------------+ + +A: 74LS368AN H: 74LS374N +B: 74LS245N I: MAX690CPA +C: GD74LS393 J: DM74LS02N +D: MN74HC241 K: ULN2003AN +E: 74LS139N L: SN74LS04N +F: 74LS174N M: ULN2003A +G: DM74S472BN + + +DIP 1: ++-------------------------------+ +|O N | +|+-+ +-+ +-+ +-+ +-+ +-+ +-+ +-+| +|| | |#| |#| |#| | | | | | | | || +|+-+ +-+ +-+ +-+ +-+ +-+ +-+ +-+| +||#| | | | | | | |#| |#| |#| |#|| +|+-+ +-+ +-+ +-+ +-+ +-+ +-+ +-+| +| 1 2 3 4 5 6 7 8 | ++-------------------------------+ + + + +FUNWORLD CUSTOM CPU-MODULE: + + +---------------------+ + A10 ==|01 40|== + ==| |== + ==| [] TI74F245A |== + ==| |== + ==| |== + ==| +--+ |== + ==| | | 65SC02 |== + VCC ==| +--+ |== A00 + A08 ==| |== A01 + A09 ==| |== A02 + ==| [] 7400 |== A03 + ==| |== A04 + ==| +-----------+ |== A05 + ==| | CY7C291A | |== A06 + ==| | | |== A07 + ==| | | |== + ==| | | |== + ==| | 1 | |== + ==| +-----------+ |== + ==|20 21|== GND + +---------------------+ + +*/ +ROM_START( multiwina ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "multiwin_91-f-1.ic37", 0x8000, 0x8000, CRC(88f122e0) SHA1(6b218e614ac86089321ad2ecb35b956de10031f3) ) // code in the 2nd half + ROM_LOAD( "multiwin_91-f-2.ic41", 0x0000, 0x8000, CRC(a09eda44) SHA1(b8bb6a2aa1b703b56e5fb0887d7e5dca28c388ea) ) // code in the 2nd half + + ROM_REGION( 0x0800, "decode", 0 ) // from the CY7C291A inside of the custom CPU. + ROM_LOAD( "multiwin_cy7c291a.cpu", 0x0000, 0x0800, CRC(874abdaa) SHA1(b6457d5d501cdf0d38b01e3dadb48b8b97193db3) ) + ROM_REGION( 0x10000, "gfx1", 0 ) + ROM_LOAD( "multiwin_zg2.ic11", 0x0000, 0x8000, CRC(2502778a) SHA1(04990c454ca55f1b3e6fdafebce3f2e9e6782329) ) + ROM_LOAD( "multiwin_zg1.ic10", 0x8000, 0x8000, CRC(38547f3e) SHA1(1322a35ebc358ebc193c029500dc0abd6fd0c113) ) + + ROM_REGION( 0x0200, "proms", 0 ) + ROM_LOAD( "dm74s472.ic13", 0x0000, 0x0200, CRC(3bf9870c) SHA1(2bd99102a1f80ec07dbe3d41bdbcff11b237d680) ) + + ROM_REGION( 0x0200, "plds", 0 ) + ROM_LOAD( "multiwin_pal16l8acn.bin", 0x0000, 0x0104, NO_DUMP ) +ROM_END + + +/* + Multi Win + Amatic, 2001. + + Unknown version. + Game encrypted, using a daughterboard + with a Mexican R65C02 + Altera EPM7032. + +*/ +ROM_START( multiwinb ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "win3.bin", 0x8000, 0x8000, CRC(5f01d620) SHA1(ddd86cba383f1e40e3821a58fc0ff7c1ac24de10) ) + + ROM_REGION( 0x0800, "altera", 0 ) // Altera EPM7032 object file + ROM_LOAD( "multiw1_epm7032.pof", 0x0000, 0x07ae, CRC(922d8d72) SHA1(2ad01fd0b4ddaa1098f3ffc203b6c502d1afd73a) ) + + ROM_REGION( 0x10000, "gfx1", 0 ) + ROM_LOAD( "win2.bin", 0x0000, 0x8000, CRC(bf031e5e) SHA1(1c971be5eb3e8c1a1b69ec9d00e46aa1fe26b8ee) ) + ROM_LOAD( "win1.bin", 0x8000, 0x8000, CRC(8ea33d92) SHA1(5aa439181f0751040229ce75101dbdf8b3d68b6c) ) + + ROM_REGION( 0x0800, "proms", 0 ) + ROM_LOAD( "291_n147.bin", 0x0000, 0x0800, CRC(e09e3a77) SHA1(2842875cff63650e15bf7eda3a730446c671c3ea) ) + + ROM_REGION( 0x0a00, "plds", 0 ) + ROM_LOAD( "m1-20v8.bin", 0x0000, 0x0157, CRC(b05b51da) SHA1(5e43cc12cd8bcd820cb89d3008a02ea857daba6f) ) + ROM_LOAD( "m2-20v8.bin", 0x0200, 0x0157, CRC(11852de6) SHA1(33fcf6f752a116e4df0492d17e0d5e53b31ce77d) ) + ROM_LOAD( "16v8-3.bin", 0x0400, 0x0117, NO_DUMP ) + ROM_LOAD( "jo393-4.bin", 0x0800, 0x0117, CRC(6eef3e7d) SHA1(2e1bb576f431743b133833c7c2f91a41a4fcbc37) ) +ROM_END + + +/* Power Card (Fun World) Version 0263 / 1993-10-22 @@ -7382,16 +7542,17 @@ // 03 - Geographie ROM_LOAD( "geo_1.bin", 0x38000, 0x8000, CRC(504da831) SHA1(4bef7bed4d300400c094cb30e9af55d3c6f47c29) ) ROM_LOAD( "geo_2.bin", 0x40000, 0x8000, CRC(7c563119) SHA1(9f3ae3ba3e4f60d9ea4b5c95aa5aaada8bb446a3) ) + ROM_LOAD( "geo_3.bin", 0x48000, 0x8000, CRC(537ac6d2) SHA1(ed3eff9f7c71a6fe7ec59af2376a0b2ba17cc1c3) ) // 04 - Technik - ROM_LOAD( "tech_1.bin", 0x48000, 0x8000, CRC(cf5b9edc) SHA1(f1085c9915d21c4da581d06c9568d2bb47d467ed) ) + ROM_LOAD( "tech_1.bin", 0x50000, 0x8000, CRC(cf5b9edc) SHA1(f1085c9915d21c4da581d06c9568d2bb47d467ed) ) // 05 - Sport - ROM_LOAD( "sport_2.bin", 0x50000, 0x8000, CRC(7accde63) SHA1(75ec3a02368d3a07d48ef9a9ff4ca7f8cf7798e2) ) + ROM_LOAD( "sport_2.bin", 0x58000, 0x8000, CRC(7accde63) SHA1(75ec3a02368d3a07d48ef9a9ff4ca7f8cf7798e2) ) // 07 - Pop - ROM_LOAD( "pop_1.bin", 0x58000, 0x8000, CRC(5c74781e) SHA1(0a50a706fd397bb220e31f1a7adaa4204b242888) ) - ROM_LOAD( "pop_2.bin", 0x60000, 0x8000, CRC(10103648) SHA1(6fdc1aa4dcc8919e46def1c19adc2b9686c0f72d) ) + ROM_LOAD( "pop_1.bin", 0x60000, 0x8000, CRC(5c74781e) SHA1(0a50a706fd397bb220e31f1a7adaa4204b242888) ) + ROM_LOAD( "pop_2.bin", 0x68000, 0x8000, CRC(10103648) SHA1(6fdc1aa4dcc8919e46def1c19adc2b9686c0f72d) ) ROM_REGION( 0x0200, "proms", 0 ) @@ -7438,11 +7599,11 @@ // 05 - Geographie ROM_LOAD( "geo1.bin", 0x48000, 0x8000, CRC(504da831) SHA1(4bef7bed4d300400c094cb30e9af55d3c6f47c29) ) ROM_LOAD( "geo2.bin", 0x50000, 0x8000, CRC(7c563119) SHA1(9f3ae3ba3e4f60d9ea4b5c95aa5aaada8bb446a3) ) - ROM_LOAD( "geo3.bin", 0x58000, 0x8000, CRC(7c563119) SHA1(9f3ae3ba3e4f60d9ea4b5c95aa5aaada8bb446a3) ) + ROM_LOAD( "geo3.bin", 0x58000, 0x8000, CRC(537ac6d2) SHA1(ed3eff9f7c71a6fe7ec59af2376a0b2ba17cc1c3) ) // 06 - Pop - ROM_LOAD( "pop_1.bin", 0x60000, 0x8000, CRC(5c74781e) SHA1(0a50a706fd397bb220e31f1a7adaa4204b242888) ) - ROM_LOAD( "pop_2.bin", 0x68000, 0x8000, CRC(10103648) SHA1(6fdc1aa4dcc8919e46def1c19adc2b9686c0f72d) ) + ROM_LOAD( "pop1.bin", 0x60000, 0x8000, CRC(5c74781e) SHA1(0a50a706fd397bb220e31f1a7adaa4204b242888) ) + ROM_LOAD( "pop2.bin", 0x68000, 0x8000, CRC(10103648) SHA1(6fdc1aa4dcc8919e46def1c19adc2b9686c0f72d) ) ROM_REGION( 0x0200, "proms", 0 ) @@ -7486,7 +7647,7 @@ // 05 - Geographie ROM_LOAD( "geo1.bin", 0x48000, 0x8000, CRC(504da831) SHA1(4bef7bed4d300400c094cb30e9af55d3c6f47c29) ) ROM_LOAD( "geo2.bin", 0x50000, 0x8000, CRC(7c563119) SHA1(9f3ae3ba3e4f60d9ea4b5c95aa5aaada8bb446a3) ) - ROM_LOAD( "geo3.bin", 0x58000, 0x8000, CRC(7c563119) SHA1(9f3ae3ba3e4f60d9ea4b5c95aa5aaada8bb446a3) ) + ROM_LOAD( "geo3.bin", 0x58000, 0x8000, CRC(537ac6d2) SHA1(ed3eff9f7c71a6fe7ec59af2376a0b2ba17cc1c3) ) // 06 - Pop ROM_LOAD( "pop1.bin", 0x60000, 0x8000, CRC(5c74781e) SHA1(0a50a706fd397bb220e31f1a7adaa4204b242888) ) @@ -8791,7 +8952,9 @@ GAMEL( 199?, jolyjokrm, jolyjokr, fw1stpal, funworld, funworld_state, empty_init, ROT0, "Impera", "Jolly Joker (Solid State module in suicide board)", 0, layout_jollycrd ) // Encrypted games... -GAME( 1992, multiwin, 0, multiwin, funworld, multiwin_state, driver_init, ROT0, "Fun World", "Multi Win (Ver.0167, encrypted)", 0 ) +GAME( 1992, multiwin, 0, multiwin, funworld, multiwin_state, driver_init, ROT0, "Fun World", "Multi Win (Ver.0167, encrypted)", 0 ) // original funworld, encrypted. +GAME( 1991, multiwina, multiwin, megacard, funworld, megacard_state, empty_init, ROT0, "Fun World", "Multi Win (Ver.0091, encrypted)", MACHINE_NOT_WORKING ) // different encryption scheme. +GAME( 2001, multiwinb, multiwin, fw2ndpal, funworld, funworld_state, empty_init, ROT0, "Amatic", "Multi Win (EPM7032, encrypted)", MACHINE_NOT_WORKING ) // daughterboard with R65C02 + Altera EPM7032. GAME( 1993, powercrd, 0, powercrd, funworld, powercrd_state, empty_init, ROT0, "Fun World", "Power Card (Ver 0263, encrypted)", 0 ) // clone of Bonus Card. GAME( 1993, megacard, 0, megacard, funworld, megacard_state, empty_init, ROT0, "Fun World", "Mega Card (Ver.0210, encrypted)", 0 ) GAME( 1993, jokercrd, 0, jokercrd, funworld, jokercrd_state, empty_init, ROT0, "Amatic Trading", "Joker Card 300 (Ver.A267BC, encrypted)", 0 ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/fuukifg2.cpp mame-0.243+dfsg.1/src/mame/drivers/fuukifg2.cpp --- mame-0.242+dfsg.1/src/mame/drivers/fuukifg2.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/fuukifg2.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -353,18 +353,6 @@ ***************************************************************************/ -/* 8x8x4 */ -static const gfx_layout layout_8x8x4 = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { STEP4(0,1) }, - { STEP8(0,4) }, - { STEP8(0,8*4) }, - 8*8*4 -}; - /* 16x16x4 */ static const gfx_layout layout_16x16x4 = { @@ -390,9 +378,9 @@ }; static GFXDECODE_START( gfx_fuuki16 ) - GFXDECODE_ENTRY( "gfx2", 0, layout_16x16x4, 0x400*0, 0x40 ) // [0] Layer 0 - GFXDECODE_ENTRY( "gfx3", 0, layout_16x16x8, 0x400*1, 0x40 ) // [1] Layer 1 - GFXDECODE_ENTRY( "gfx4", 0, layout_8x8x4, 0x400*3, 0x40 ) // [2] Layer 2 + GFXDECODE_ENTRY( "gfx2", 0, layout_16x16x4, 0x400*0, 0x40 ) // [0] Layer 0 + GFXDECODE_ENTRY( "gfx3", 0, layout_16x16x8, 0x400*1, 0x40 ) // [1] Layer 1 + GFXDECODE_ENTRY( "gfx4", 0, gfx_8x8x4_packed_msb, 0x400*3, 0x40 ) // [2] Layer 2 GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/fuukifg3.cpp mame-0.243+dfsg.1/src/mame/drivers/fuukifg3.cpp --- mame-0.242+dfsg.1/src/mame/drivers/fuukifg3.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/fuukifg3.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -442,18 +442,6 @@ ***************************************************************************/ -/* 8x8x4 */ -static const gfx_layout layout_8x8x4 = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { STEP4(0,1) }, - { STEP8(0,4) }, - { STEP8(0,8*4) }, - 8*8*4 -}; - /* 16x16x8 */ static const gfx_layout layout_16x16x8 = { @@ -467,9 +455,9 @@ }; static GFXDECODE_START( gfx_fuuki32 ) - GFXDECODE_ENTRY( "gfx2", 0, layout_16x16x8, 0x400*0, 0x40 ) // [0] Layer 1 - GFXDECODE_ENTRY( "gfx3", 0, layout_16x16x8, 0x400*1, 0x40 ) // [1] Layer 2 - GFXDECODE_ENTRY( "gfx4", 0, layout_8x8x4, 0x400*3, 0x40 ) // [2] BG Layer + GFXDECODE_ENTRY( "gfx2", 0, layout_16x16x8, 0x400*0, 0x40 ) // [0] Layer 1 + GFXDECODE_ENTRY( "gfx3", 0, layout_16x16x8, 0x400*1, 0x40 ) // [1] Layer 2 + GFXDECODE_ENTRY( "gfx4", 0, gfx_8x8x4_packed_msb, 0x400*3, 0x40 ) // [2] BG Layer GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/g627.cpp mame-0.243+dfsg.1/src/mame/drivers/g627.cpp --- mame-0.242+dfsg.1/src/mame/drivers/g627.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/g627.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -80,7 +80,7 @@ u8 m_portc = 0U; u8 m_motor = 0U; u8 m_last_solenoid = 0U; - bool m_type = 0; + bool m_type = false; virtual void machine_start() override; virtual void machine_reset() override; required_device m_maincpu; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/gaelco.cpp mame-0.243+dfsg.1/src/mame/drivers/gaelco.cpp --- mame-0.242+dfsg.1/src/mame/drivers/gaelco.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/gaelco.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -699,11 +699,11 @@ void gaelco_state::bigkarnk(machine_config &config) { // Basic machine hardware - M68000(config, m_maincpu, XTAL(24'000'000)/2); // MC68000P10, 12 MHz? + M68000(config, m_maincpu, XTAL(24'000'000)/2); // MC68000P10, 12 MHz (verified) m_maincpu->set_addrmap(AS_PROGRAM, &gaelco_state::bigkarnk_map); m_maincpu->set_vblank_int("screen", FUNC(gaelco_state::irq6_line_assert)); - MC6809E(config, m_audiocpu, XTAL(8'000'000)/4); // 68B09EP, 2 MHz? + MC6809E(config, m_audiocpu, XTAL(8'000'000)/4); // 68B09EP, 2 MHz (verified) m_audiocpu->set_addrmap(AS_PROGRAM, &gaelco_state::bigkarnk_snd_map); config.set_maximum_quantum(attotime::from_hz(600)); diff -Nru mame-0.242+dfsg.1/src/mame/drivers/galaga.cpp mame-0.243+dfsg.1/src/mame/drivers/galaga.cpp --- mame-0.242+dfsg.1/src/mame/drivers/galaga.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/galaga.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1442,17 +1442,6 @@ 16*8 }; -static const gfx_layout charlayout_xevious = -{ - 8,8, - RGN_FRAC(1,1), - 1, - { 0 }, - { STEP8(0,1) }, - { STEP8(0,8) }, - 8*8 -}; - static const gfx_layout charlayout_digdug = { 8,8, @@ -1531,7 +1520,7 @@ GFXDECODE_END static GFXDECODE_START( gfx_xevious ) - GFXDECODE_ENTRY( "gfx1", 0, charlayout_xevious, 128*4+64*8, 64 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x1, 128*4+64*8, 64 ) GFXDECODE_ENTRY( "gfx2", 0, bgcharlayout, 0, 128 ) GFXDECODE_ENTRY( "gfx3", 0, spritelayout_xevious, 128*4, 64 ) GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/galaxia.cpp mame-0.243+dfsg.1/src/mame/drivers/galaxia.cpp --- mame-0.242+dfsg.1/src/mame/drivers/galaxia.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/galaxia.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -269,17 +269,6 @@ ***************************************************************************/ -static const gfx_layout tiles8x8x1_layout = -{ - 8,8, - RGN_FRAC(1,1), - 1, - { RGN_FRAC(0,1) }, - { 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 const gfx_layout tiles8x8x2_layout = { 8,8, @@ -296,7 +285,7 @@ GFXDECODE_END static GFXDECODE_START( gfx_astrowar ) - GFXDECODE_ENTRY( "gfx1", 0, tiles8x8x1_layout, 0, 8 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x1, 0, 8 ) GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/galaxian.cpp mame-0.243+dfsg.1/src/mame/drivers/galaxian.cpp --- mame-0.242+dfsg.1/src/mame/drivers/galaxian.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/galaxian.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1753,6 +1753,13 @@ galaxian_map_discrete(map); } +void galaxian_state::galartic_map(address_map &map) +{ + galaxian_map(map); + + map(0x6002, 0x6002).unmapw(); // no coin lockout +} + void pisces_state::pisces_map(address_map &map) { galaxian_map(map); @@ -3065,6 +3072,27 @@ PORT_DIPSETTING( 0x04, "5" ) INPUT_PORTS_END +static INPUT_PORTS_START( galartic ) // TODO: any other differences? + PORT_INCLUDE(galaxian) + + PORT_MODIFY("IN1") + PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coinage ) ) + PORT_DIPSETTING( 0x80, "A 2C/1C B 1C/3C" ) + PORT_DIPSETTING( 0x00, "A 2C/1C B 1C/5C" ) + PORT_DIPSETTING( 0xc0, "A 1C/1C B 1C/3C" ) + PORT_DIPSETTING( 0x40, "A 1C/1C B 1C/5C" ) + + PORT_MODIFY("IN2") + PORT_DIPNAME( 0x01, 0x01, DEF_STR( Bonus_Life ) ) + PORT_DIPSETTING( 0x01, DEF_STR( None ) ) + PORT_DIPSETTING( 0x00, "7000" ) + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) ) + PORT_DIPSETTING( 0x00, "3" ) + PORT_DIPSETTING( 0x04, "5" ) +INPUT_PORTS_END static INPUT_PORTS_START( swarm ) PORT_INCLUDE(galaxian) @@ -5079,38 +5107,26 @@ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_COCKTAIL PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL - PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) // turning both of these on boots with 9 credits? - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x40, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x80, DEF_STR( On ) ) + PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coinage ) ) + PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x80, DEF_STR( 3C_2C ) ) + PORT_DIPSETTING( 0x40, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0xc0, DEF_STR( Free_Play ) ) PORT_START("IN2") - PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x01, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x02, DEF_STR( On ) ) + PORT_DIPNAME( 0x01, 0x00, "Game Speed" ) + PORT_DIPSETTING( 0x00, "Slow" ) + PORT_DIPSETTING( 0x01, "Fast" ) + PORT_DIPNAME( 0x02, 0x00, "Time Limit" ) + PORT_DIPSETTING( 0x00, "Long" ) + PORT_DIPSETTING( 0x02, "Short" ) PORT_DIPNAME( 0x04, 0x00, DEF_STR( Flip_Screen ) ) PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x04, DEF_STR( On ) ) PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) ) PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) PORT_DIPSETTING( 0x08, DEF_STR( Cocktail ) ) - PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x10, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x20, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x40, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x80, DEF_STR( On ) ) + PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED ) INPUT_PORTS_END @@ -5886,6 +5902,33 @@ INPUT_PORTS_END +static INPUT_PORTS_START( takeoff ) + PORT_INCLUDE( explorer ) + + PORT_MODIFY("IN3") + PORT_DIPNAME( 0x07, 0x01, DEF_STR( Lives ) ) + PORT_DIPSETTING( 0x00, "2" ) + PORT_DIPSETTING( 0x01, "3" ) + PORT_DIPSETTING( 0x02, "4" ) + PORT_DIPSETTING( 0x03, "5" ) + PORT_DIPSETTING( 0x04, "6" ) + PORT_DIPSETTING( 0x05, "7" ) + PORT_DIPSETTING( 0x06, "8" ) + PORT_DIPSETTING( 0x07, "9" ) + PORT_DIPNAME( 0x38, 0x20, DEF_STR( Bonus_Life ) ) + PORT_DIPSETTING( 0x00, "15000" ) + PORT_DIPSETTING( 0x08, "20000" ) + PORT_DIPSETTING( 0x10, "25000" ) + PORT_DIPSETTING( 0x18, "30000" ) + PORT_DIPSETTING( 0x20, "30000" ) + PORT_DIPSETTING( 0x28, "50000" ) + PORT_DIPSETTING( 0x30, "70000" ) + PORT_DIPSETTING( 0x38, "90000" ) + PORT_DIPUNKNOWN( 0x40, 0x00 ) + PORT_DIPUNKNOWN( 0x80, 0x00 ) +INPUT_PORTS_END + + static INPUT_PORTS_START( atlantis ) PORT_START("IN0") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL @@ -7490,6 +7533,13 @@ GALAXIAN_SOUND(config, "cust", 0); } +void galaxian_state::galartic(machine_config &config) +{ + galaxian(config); + + m_maincpu->set_addrmap(AS_PROGRAM, &galaxian_state::galartic_map); +} + void pisces_state::pisces(machine_config &config) { galaxian(config); @@ -9772,6 +9822,22 @@ ROM_LOAD( "6l.bpr", 0x0000, 0x0020, CRC(c3ac9467) SHA1(f382ad5a34d282056c78a5ec00c30ec43772bae2) ) ROM_END +ROM_START( galartic ) + ROM_REGION( 0x4000, "maincpu", 0 ) + ROM_LOAD( "piii.1", 0x0000, 0x0800, CRC(78dd272d) SHA1(0a4f43a6f40ca65f73adcaac02469fb57f40041d) ) + ROM_LOAD( "piii.2", 0x0800, 0x0800, CRC(465a9b45) SHA1(9eea6d30b856d959521cb935715006ba9deac53e) ) + ROM_LOAD( "piii.3", 0x1000, 0x0800, CRC(03e36737) SHA1(3118d684d747dfd607617b0869fb25e4ac147eb1) ) + ROM_LOAD( "piii.4", 0x1800, 0x0800, CRC(ce012b3f) SHA1(e6f976ae4a224d96376c287212ec50d03ccc6daa) ) + ROM_LOAD( "piii.5", 0x2000, 0x0800, CRC(9ace06cf) SHA1(ab50baca0507fabcd78650fcf66a3b734ca95b84) ) + + ROM_REGION( 0x1000, "gfx1", 0 ) + ROM_LOAD( "piii.6", 0x0000, 0x0800, CRC(977e37cf) SHA1(88ff1e4edadf5cfc83413a1fe999aecf4ba72232) ) + ROM_LOAD( "piii.7", 0x0800, 0x0800, CRC(d0ba22c9) SHA1(678b22d10e1ae7dcea068da838bf6bd648e9ee28) ) + + ROM_REGION( 0x0020, "proms", 0 ) + ROM_LOAD( "mmi6331.6l", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) ) +ROM_END + ROM_START( swarm ) ROM_REGION( 0x4000, "maincpu", 0 ) ROM_LOAD( "swarm1.bin", 0x0000, 0x0800, CRC(21eba3d0) SHA1(d07f141d785c86faca8c40af034c26f2789e9346) ) @@ -15656,6 +15722,7 @@ GAME( 1980, galaxrcgg, galaxian, galaxian, galaxrf, galaxian_state, init_galaxian, ROT90, "bootleg (Recreativos Covadonga)", "Galaxian Growing Galaxip / Galaxian Nave Creciente (Recreativos Covadonga Spanish bootleg)", MACHINE_SUPPORTS_SAVE ) GAME( 1979, galaxianrp, galaxian, galaxian, superg, galaxian_state, init_galaxian, ROT90, "bootleg (Valadon Automation / Rene Pierre)", "Galaxian (Rene Pierre bootleg)", MACHINE_SUPPORTS_SAVE ) GAME( 1979, galaxyx, galaxian, galaxian, superg, galaxian_state, init_galaxian, ROT90, "bootleg", "Galaxy X (bootleg of Galaxian)", MACHINE_SUPPORTS_SAVE ) +GAME( 1979, galartic, galaxian, galartic, galartic, galaxian_state, init_galaxian, ROT270, "bootleg (Artic System)", "Galaxian (Artic System bootleg)", MACHINE_SUPPORTS_SAVE ) // These have the extra 'linescroll effect' title screens, like Moon Alien 2 but made out of a random tile, they lack an energy bar. GAME( 1979, moonaln, galaxian, galaxian, superg, galaxian_state, init_galaxian, ROT90, "Namco / Nichibutsu (Karateco license?)", "Moon Alien", MACHINE_SUPPORTS_SAVE ) // or bootleg? @@ -15914,7 +15981,7 @@ GAME( 1980, theend, 0, theend, theend, galaxian_state, init_theend, ROT90, "Konami", "The End", MACHINE_SUPPORTS_SAVE ) GAME( 1980, theends, theend, theend, theend, galaxian_state, init_theend, ROT90, "Konami (Stern Electronics license)", "The End (Stern Electronics)", MACHINE_SUPPORTS_SAVE ) GAME( 1981, theendss, theend, theend, theend, galaxian_state, init_theend, ROT90, "bootleg (Sonic)", "The End (SegaSA / Sonic)", MACHINE_SUPPORTS_SAVE ) -GAME( 1981, takeoff, theend, takeoff, explorer, galaxian_state, init_explorer, ROT90, "bootleg (Sidam)", "Take Off (bootleg of The End)", MACHINE_WRONG_COLORS | MACHINE_SUPPORTS_SAVE ) // colors likely need bitswap<8> somewhere; needs different sound timer. reference: https://www.youtube.com/watch?v=iPYX3yJORTE +GAME( 1981, takeoff, theend, takeoff, takeoff, galaxian_state, init_explorer, ROT90, "bootleg (Sidam)", "Take Off (bootleg of The End)", MACHINE_WRONG_COLORS | MACHINE_SUPPORTS_SAVE ) // colors likely need bitswap<8> somewhere; needs different sound timer. reference: https://www.youtube.com/watch?v=iPYX3yJORTE GAME( 1981, scramble, 0, scramble, scramble, galaxian_state, init_scramble, ROT90, "Konami", "Scramble", MACHINE_SUPPORTS_SAVE ) GAME( 1981, scrambles, scramble, scramble, scramble, galaxian_state, init_scramble, ROT90, "Konami (Stern Electronics license)", "Scramble (Stern Electronics set 1)", MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/galaxold.cpp mame-0.243+dfsg.1/src/mame/drivers/galaxold.cpp --- mame-0.242+dfsg.1/src/mame/drivers/galaxold.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/galaxold.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1400,9 +1400,9 @@ PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x04, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x08, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x00, "Attract Mode" ) + PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x10, DEF_STR( On ) ) @@ -1417,12 +1417,12 @@ PORT_DIPSETTING( 0x80, DEF_STR( On ) ) PORT_START("DSW0") - PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x01, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x02, DEF_STR( On ) ) + PORT_DIPNAME( 0x01, 0x00, DEF_STR( Coin_A ) ) + PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x01, DEF_STR( 2C_1C ) ) + PORT_DIPNAME( 0x02, 0x00, DEF_STR( Coin_B ) ) + PORT_DIPSETTING( 0x00, DEF_STR( 1C_3C ) ) + PORT_DIPSETTING( 0x02, DEF_STR( 1C_5C ) ) PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x04, DEF_STR( On ) ) @@ -1432,9 +1432,9 @@ PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x10, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x20, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x00, "True or False Bonus" ) + PORT_DIPSETTING( 0x00, "200k" ) + PORT_DIPSETTING( 0x20, "300k" ) PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x40, DEF_STR( On ) ) @@ -1444,6 +1444,24 @@ INPUT_PORTS_END +static INPUT_PORTS_START( bullsdrtg ) + PORT_INCLUDE( racknrol ) + + PORT_MODIFY("IN1") + PORT_CONFNAME(0x40, 0x00, DEF_STR( Cabinet ) ) // Sense line on wiring harness + PORT_CONFSETTING( 0x00, DEF_STR( Upright ) ) + PORT_CONFSETTING( 0x40, DEF_STR( Cocktail ) ) + + PORT_MODIFY("DSW0") + PORT_DIPNAME( 0x01, 0x00, DEF_STR( Coinage ) ) + PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x01, DEF_STR( 2C_1C ) ) + PORT_DIPNAME( 0x02, 0x00, "Award Free Game" ) + PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) +INPUT_PORTS_END + + static const gfx_layout galaxold_charlayout = @@ -2513,4 +2531,4 @@ GAME( 1986, hexpool, racknrol, racknrol, racknrol, galaxold_state, empty_init, ROT90, "Senko Industries (Shinkai Inc. license)", "Hex Pool (Shinkai)", MACHINE_SUPPORTS_SAVE ) // still has Senko logo in gfx rom GAME( 1985, hexpoola, racknrol, hexpoola, racknrol, galaxold_state, empty_init, ROT90, "Senko Industries", "Hex Pool (Senko)", MACHINE_SUPPORTS_SAVE ) GAME( 1985, trvchlng, 0, racknrol, trvchlng, galaxold_state, empty_init, ROT90, "Joyland (Senko license)", "Trivia Challenge", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) -GAME( 1985, bullsdrtg, bullsdrt, bullsdrtg, racknrol, galaxold_state, init_bullsdrtg, ROT90, "Senko Industries", "Bulls Eye Darts (Galaxian conversion)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS | MACHINE_WRONG_COLORS ) +GAME( 1985, bullsdrtg, bullsdrt, bullsdrtg, bullsdrtg, galaxold_state, init_bullsdrtg, ROT90, "Senko Industries", "Bulls Eye Darts (Galaxian conversion)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS | MACHINE_WRONG_COLORS ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/galpanic.cpp mame-0.243+dfsg.1/src/mame/drivers/galpanic.cpp --- mame-0.242+dfsg.1/src/mame/drivers/galpanic.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/galpanic.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -46,7 +46,7 @@ - I added the 'galpanica' romset which is in fact the same as 'galpanic', but with the PRG ROMS which aren't overwritten and simulated the CALC1 - MCU functions + ULA functions Here are a few notes about what I found : * This version is also a World version (0x03ffff.b = 03). * In this version, there is a "Coin Mode" Dip Switch, but no @@ -66,20 +66,133 @@ ***************************************************************************/ #include "emu.h" -#include "includes/galpanic.h" + #include "includes/galpnipt.h" +#include "machine/kaneko_hit.h" +#include "video/kan_pand.h" #include "cpu/m68000/m68000.h" +#include "machine/timer.h" #include "machine/watchdog.h" #include "sound/okim6295.h" -#include "video/kan_pand.h" -#include "machine/kaneko_hit.h" + +#include "emupal.h" +#include "screen.h" #include "speaker.h" +namespace { + +class galpanic_state : public driver_device +{ +public: + galpanic_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_screen(*this, "screen") + , m_palette(*this, "palette") + , m_pandora(*this, "pandora") + , m_bgvideoram(*this, "bgvideoram") + , m_fgvideoram(*this, "fgvideoram") + , m_okibank(*this, "okibank") + { } + + void galpanica(machine_config &config); + void galpanic(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void video_start() override; + +private: + required_device m_maincpu; + required_device m_gfxdecode; + required_device m_screen; + required_device m_palette; + required_device m_pandora; + + required_shared_ptr m_bgvideoram; + required_shared_ptr m_fgvideoram; + required_memory_bank m_okibank; + + bitmap_ind16 m_bitmap; + + void m6295_bankswitch_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + void coin_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 palette(palette_device &palette) const; + + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + DECLARE_WRITE_LINE_MEMBER(screen_vblank); + TIMER_DEVICE_CALLBACK_MEMBER(scanline); + void draw_fgbitmap(bitmap_ind16 &bitmap, const rectangle &cliprect); + + void galpanic_map(address_map &map); + void oki_map(address_map &map); + void galpanica_map(address_map &map); +}; + + +// video + +void galpanic_state::video_start() +{ + m_screen->register_screen_bitmap(m_bitmap); + + save_item(NAME(m_bitmap)); +} + +void galpanic_state::palette(palette_device &palette) const +{ + // first 1024 colors are dynamic + + // initialize 555 GRB lookup + for (int i = 0; i < 32768; i++) + palette.set_pen_color(i + 1024, pal5bit(i >> 5), pal5bit(i >> 10), pal5bit(i >> 0)); +} + +void galpanic_state::bgvideoram_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + data = COMBINE_DATA(&m_bgvideoram[offset]); + + int sy = offset / 256; + int sx = offset % 256; + + m_bitmap.pix(sy, sx) = 1024 + (data >> 1); +} + +void galpanic_state::draw_fgbitmap(bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + for (int offs = 0; offs < m_fgvideoram.bytes() / 2; offs++) + { + int const sx = offs % 256; + int const sy = offs / 256; + int const color = m_fgvideoram[offs]; + if (color) + bitmap.pix(sy, sx) = color; + } +} + +uint32_t galpanic_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + // copy the temporary bitmap to the screen + copybitmap(bitmap, m_bitmap, 0, 0, 0, 0, cliprect); + + draw_fgbitmap(bitmap, cliprect); + + m_pandora->update(bitmap, cliprect); + + return 0; +} + + +// machine + void galpanic_state::machine_start() { - membank("okibank")->configure_entries(0, 16, memregion("oki")->base(), 0x10000); + m_okibank->configure_entries(0, 16, memregion("oki")->base(), 0x10000); } WRITE_LINE_MEMBER(galpanic_state::screen_vblank) @@ -98,7 +211,7 @@ if(scanline == 224) // vblank-out irq m_maincpu->set_input_line(3, HOLD_LINE); - /* Pandora "sprite end dma" irq? */ + // Pandora "sprite end dma" irq? if(scanline == 32) m_maincpu->set_input_line(5, HOLD_LINE); } @@ -110,10 +223,10 @@ { if (ACCESSING_BITS_8_15) { - membank("okibank")->set_entry((data >> 8) & 0x0f); + m_okibank->set_entry((data >> 8) & 0x0f); // used before title screen - m_pandora->set_clear_bitmap((data & 0x8000)>>15); + m_pandora->set_clear_bitmap((data & 0x8000) >> 15); } } @@ -137,44 +250,44 @@ { map(0x000000, 0x3fffff).rom(); map(0x400001, 0x400001).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - map(0x500000, 0x51ffff).ram().share("fgvideoram"); - map(0x520000, 0x53ffff).ram().w(FUNC(galpanic_state::bgvideoram_w)).share("bgvideoram"); /* + work RAM */ - map(0x600000, 0x6007ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); /* 1024 colors, but only 512 seem to be used */ + map(0x500000, 0x51ffff).ram().share(m_fgvideoram); + map(0x520000, 0x53ffff).ram().w(FUNC(galpanic_state::bgvideoram_w)).share(m_bgvideoram); // + work RAM + map(0x600000, 0x6007ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // 1024 colors, but only 512 seem to be used map(0x700000, 0x701fff).rw(m_pandora, FUNC(kaneko_pandora_device::spriteram_LSB_r), FUNC(kaneko_pandora_device::spriteram_LSB_w)); map(0x702000, 0x704fff).ram(); map(0x800000, 0x800001).portr("DSW1"); map(0x800002, 0x800003).portr("DSW2"); map(0x800004, 0x800005).portr("SYSTEM"); map(0x900000, 0x900001).w(FUNC(galpanic_state::m6295_bankswitch_w)); - map(0xa00000, 0xa00001).w(FUNC(galpanic_state::coin_w)); /* coin counters */ - map(0xb00000, 0xb00001).nopw(); /* ??? */ - map(0xc00000, 0xc00001).nopw(); /* ??? */ - map(0xd00000, 0xd00001).nopw(); /* ??? */ + map(0xa00000, 0xa00001).w(FUNC(galpanic_state::coin_w)); // coin counters + map(0xb00000, 0xb00001).nopw(); // ??? + map(0xc00000, 0xc00001).nopw(); // ??? + map(0xd00000, 0xd00001).nopw(); // ??? } void galpanic_state::galpanica_map(address_map &map) { galpanic_map(map); - map(0xe00000, 0xe00015).rw("calc1_mcu", FUNC(kaneko_hit_device::kaneko_hit_r), FUNC(kaneko_hit_device::kaneko_hit_w)); + map(0xe00000, 0xe00015).rw("calc1", FUNC(kaneko_hit_device::kaneko_hit_r), FUNC(kaneko_hit_device::kaneko_hit_w)); } -void galpanic_state::galpanic_oki_map(address_map &map) +void galpanic_state::oki_map(address_map &map) { map(0x00000, 0x2ffff).rom(); - map(0x30000, 0x3ffff).bankr("okibank"); + map(0x30000, 0x3ffff).bankr(m_okibank); } static INPUT_PORTS_START( galpanic ) PORT_START("DSW1") PORT_DIPUNUSED_DIPLOC( 0x0001, 0x0001, "SW1:1" ) - PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:2") /* flip screen? - code at 0x000522 */ + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:2") // flip screen? - code at 0x000522 PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_SERVICE_DIPLOC( 0x0004, IP_ACTIVE_LOW, "SW1:3" ) PORT_DIPUNUSED_DIPLOC( 0x0008, 0x0008, "SW1:4" ) COINAGE_WORLD - GALS_PANIC_JOYSTICK_4WAY(1) /* "Shot2" is shown in "test mode" but not used by the game */ + GALS_PANIC_JOYSTICK_4WAY(1) // "Shot2" is shown in "test mode" but not used by the game PORT_START("DSW2") PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2") @@ -189,20 +302,20 @@ PORT_DIPSETTING( 0x0030, "3" ) PORT_DIPSETTING( 0x0020, "4" ) PORT_DIPSETTING( 0x0000, "5" ) - PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:7") /* demo sounds? - see notes */ + PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:7") // demo sounds? - see notes PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0080, 0x0080, "Character Test" ) PORT_DIPLOCATION("SW2:8") PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - GALS_PANIC_JOYSTICK_4WAY(2) /* "Shot2" is shown in "test mode" but not used by the game */ + GALS_PANIC_JOYSTICK_4WAY(2) // "Shot2" is shown in "test mode" but not used by the game SYSTEM_SERVICE INPUT_PORTS_END static INPUT_PORTS_START( galpanica ) PORT_START("DSW1") - COINAGE_TEST_LOC /* Unknown DSW switch 2 is flip screen? - code at 0x00060a */ + COINAGE_TEST_LOC // Unknown DSW switch 2 is flip screen? - code at 0x00060a GALS_PANIC_JOYSTICK_4WAY(1) PORT_START("DSW2") @@ -214,23 +327,23 @@ static GFXDECODE_START( gfx_galpanic ) - GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x4_row_2x2_group_packed_msb, 256, 16 ) + GFXDECODE_ENTRY( "sprites", 0, gfx_8x8x4_row_2x2_group_packed_msb, 256, 16 ) GFXDECODE_END void galpanic_state::galpanic(machine_config &config) { - /* basic machine hardware */ - M68000(config, m_maincpu, XTAL(12'000'000)); /* verified on pcb */ + // basic machine hardware + M68000(config, m_maincpu, XTAL(12'000'000)); // verified on PCB m_maincpu->set_addrmap(AS_PROGRAM, &galpanic_state::galpanic_map); TIMER(config, "scantimer").configure_scanline(FUNC(galpanic_state::scanline), "screen", 0, 1); WATCHDOG_TIMER(config, "watchdog"); - /* video hardware */ + // video hardware SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_refresh_hz(60); - m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0) /* frames per second, vblank duration */); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0)); // frames per second, vblank duration m_screen->set_size(256, 256); m_screen->set_visarea(0, 256-1, 0, 224-1); m_screen->set_screen_update(FUNC(galpanic_state::screen_update)); @@ -239,17 +352,17 @@ GFXDECODE(config, m_gfxdecode, m_palette, gfx_galpanic); // fg palette RAM, bit 0 seems to be a transparency flag for the front bitmap - PALETTE(config, m_palette, FUNC(galpanic_state::galpanic_palette)).set_format(palette_device::GRBx_555, 1024 + 32768); + PALETTE(config, m_palette, FUNC(galpanic_state::palette)).set_format(palette_device::GRBx_555, 1024 + 32768); KANEKO_PANDORA(config, m_pandora, 0); m_pandora->set_offsets(0, -16); m_pandora->set_gfxdecode_tag(m_gfxdecode); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); - okim6295_device &oki(OKIM6295(config, "oki", XTAL(12'000'000)/6, okim6295_device::PIN7_LOW)); /* verified on pcb */ - oki.set_addrmap(0, &galpanic_state::galpanic_oki_map); + okim6295_device &oki(OKIM6295(config, "oki", XTAL(12'000'000) / 6, okim6295_device::PIN7_LOW)); // verified on PCB + oki.set_addrmap(0, &galpanic_state::oki_map); oki.add_route(ALL_OUTPUTS, "mono", 1.0); } @@ -259,11 +372,11 @@ galpanic(config); m_maincpu->set_addrmap(AS_PROGRAM, &galpanic_state::galpanica_map); - /* basic machine hardware */ - KANEKO_HIT(config, "calc1_mcu").set_type(0); + // basic machine hardware + KANEKO_HIT(config, "calc1").set_type(0); - /* arm watchdog */ - subdevice("watchdog")->set_time(attotime::from_seconds(3)); /* a guess, and certainly wrong */ + // arm watchdog + subdevice("watchdog")->set_time(attotime::from_seconds(3)); // a guess, and certainly wrong } @@ -273,12 +386,12 @@ ***************************************************************************/ -ROM_START( galpanic ) /* PAMERA-04 PCB with the PAMERA-SUB daughter card and unpopulated CALC1 MCU socket */ - ROM_REGION( 0x400000, "maincpu", 0 ) /* 68000 code */ +ROM_START( galpanic ) // PAMERA-04 PCB with the PAMERA-SUB daughter card and unpopulated CALC1 ULA socket + ROM_REGION( 0x400000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "pm110.4m2", 0x000000, 0x80000, CRC(ae6b17a8) SHA1(f3a625eef45cc85cdf9760f77ea7ce93387911f9) ) ROM_LOAD16_BYTE( "pm109.4m1", 0x000001, 0x80000, CRC(b85d792d) SHA1(0ed78e15f6e58285ce6944200b023ada1e673b0e) ) - ROM_LOAD16_BYTE( "pm112.subic6", 0x000000, 0x20000, CRC(7b972b58) SHA1(a7f619fca665b15f4f004ae739f5776ee2d4d432) ) /* Located on the PAMERA-SUB daughter card */ - ROM_LOAD16_BYTE( "pm111.subic5", 0x000001, 0x20000, CRC(4eb7298d) SHA1(8858a40ffefbe4ecea7d5b70311c3775b7d987eb) ) /* Located on the PAMERA-SUB daughter card */ + ROM_LOAD16_BYTE( "pm112.subic6", 0x000000, 0x20000, CRC(7b972b58) SHA1(a7f619fca665b15f4f004ae739f5776ee2d4d432) ) // Located on the PAMERA-SUB daughter card + ROM_LOAD16_BYTE( "pm111.subic5", 0x000001, 0x20000, CRC(4eb7298d) SHA1(8858a40ffefbe4ecea7d5b70311c3775b7d987eb) ) // Located on the PAMERA-SUB daughter card ROM_LOAD16_BYTE( "pm004e.8", 0x100001, 0x80000, CRC(d3af52bc) SHA1(46be057106388578defecab1cdd1793ec76ebe92) ) ROM_LOAD16_BYTE( "pm005e.7", 0x100000, 0x80000, CRC(d7ec650c) SHA1(6c2250c74381497154bf516e0cf1db6bb56bb446) ) ROM_LOAD16_BYTE( "pm000e.15", 0x200001, 0x80000, CRC(5d220f3f) SHA1(7ff373e01027c8832712f7a2d732f8e49b875878) ) @@ -286,17 +399,17 @@ ROM_LOAD16_BYTE( "pm002e.17", 0x300001, 0x80000, CRC(713ee898) SHA1(c9f608a57fb90e5ee15eb76a74a7afcc406d5b4e) ) ROM_LOAD16_BYTE( "pm003e.16", 0x300000, 0x80000, CRC(6bb060fd) SHA1(4fc3946866c5a55e8340b62b5ad9beae723ce0da) ) - ROM_REGION( 0x100000, "gfx1", 0 ) /* sprites */ + ROM_REGION( 0x100000, "sprites", 0 ) ROM_LOAD( "pm006e.67", 0x000000, 0x100000, CRC(57aec037) SHA1(e6ba095b6892d4dcd76ba3343a97dd98ae29dc24) ) - ROM_REGION( 0x100000, "oki", 0 ) /* OKIM6295 samples */ - /* 00000-2ffff is fixed, 30000-3ffff is bank switched from all the ROMs */ + ROM_REGION( 0x100000, "oki", 0 ) + // 00000-2ffff is fixed, 30000-3ffff is bank switched from all the ROMs ROM_LOAD( "pm008e.l", 0x00000, 0x80000, CRC(d9379ba8) SHA1(5ae7c743319b1a12f2b101a9f0f8fe0728ed1476) ) ROM_LOAD( "pm007e.u", 0x80000, 0x80000, CRC(c7ed7950) SHA1(133258b058d3c562208d0d00b9fac71202647c32) ) ROM_END -ROM_START( galpanica ) /* PAMERA-04 PCB with the CALC1 MCU used */ - ROM_REGION( 0x400000, "maincpu", 0 ) /* 68000 code */ +ROM_START( galpanica ) // PAMERA-04 PCB with the CALC1 ULA used + ROM_REGION( 0x400000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "pm110.4m2", 0x000000, 0x80000, CRC(ae6b17a8) SHA1(f3a625eef45cc85cdf9760f77ea7ce93387911f9) ) ROM_LOAD16_BYTE( "pm109.4m1", 0x000001, 0x80000, CRC(b85d792d) SHA1(0ed78e15f6e58285ce6944200b023ada1e673b0e) ) ROM_LOAD16_BYTE( "pm004e.8", 0x100001, 0x80000, CRC(d3af52bc) SHA1(46be057106388578defecab1cdd1793ec76ebe92) ) @@ -306,17 +419,17 @@ ROM_LOAD16_BYTE( "pm002e.17", 0x300001, 0x80000, CRC(713ee898) SHA1(c9f608a57fb90e5ee15eb76a74a7afcc406d5b4e) ) ROM_LOAD16_BYTE( "pm003e.16", 0x300000, 0x80000, CRC(6bb060fd) SHA1(4fc3946866c5a55e8340b62b5ad9beae723ce0da) ) - ROM_REGION( 0x100000, "gfx1", 0 ) /* sprites */ + ROM_REGION( 0x100000, "sprites", 0 ) ROM_LOAD( "pm006e.67", 0x000000, 0x100000, CRC(57aec037) SHA1(e6ba095b6892d4dcd76ba3343a97dd98ae29dc24) ) - ROM_REGION( 0x100000, "oki", 0 ) /* OKIM6295 samples */ - /* 00000-2ffff is fixed, 30000-3ffff is bank switched from all the ROMs */ + ROM_REGION( 0x100000, "oki", 0 ) + // 00000-2ffff is fixed, 30000-3ffff is bank switched from all the ROMs ROM_LOAD( "pm008e.l", 0x00000, 0x80000, CRC(d9379ba8) SHA1(5ae7c743319b1a12f2b101a9f0f8fe0728ed1476) ) ROM_LOAD( "pm007e.u", 0x80000, 0x80000, CRC(c7ed7950) SHA1(133258b058d3c562208d0d00b9fac71202647c32) ) ROM_END -ROM_START( galpanicb ) /* PAMERA-04 PCB with the CALC1 MCU used */ - ROM_REGION( 0x400000, "maincpu", 0 ) /* 68000 code */ +ROM_START( galpanicb ) // PAMERA-04 PCB with the CALC1 ULA used + ROM_REGION( 0x400000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "pm109p.u88-01.ic6", 0x000000, 0x20000, CRC(a6d60dba) SHA1(2a63642709051c27b9a366c433127426bb579c35) ) // read as 27C010 ROM_LOAD16_BYTE( "pm110p.u87-01.ic5", 0x000001, 0x20000, CRC(3214fd48) SHA1(d8d77cb6b74caea2545f4e62eb9223aaf770785a) ) // read as 27C010 ROM_LOAD16_BYTE( "pm004e.8", 0x100001, 0x80000, CRC(d3af52bc) SHA1(46be057106388578defecab1cdd1793ec76ebe92) ) @@ -326,15 +439,18 @@ ROM_LOAD16_BYTE( "pm002e.17", 0x300001, 0x80000, CRC(713ee898) SHA1(c9f608a57fb90e5ee15eb76a74a7afcc406d5b4e) ) ROM_LOAD16_BYTE( "pm003e.16", 0x300000, 0x80000, CRC(6bb060fd) SHA1(4fc3946866c5a55e8340b62b5ad9beae723ce0da) ) - ROM_REGION( 0x100000, "gfx1", 0 ) /* sprites */ + ROM_REGION( 0x100000, "sprites", 0 ) ROM_LOAD( "pm006e.67", 0x000000, 0x100000, CRC(57aec037) SHA1(e6ba095b6892d4dcd76ba3343a97dd98ae29dc24) ) - ROM_REGION( 0x100000, "oki", 0 ) /* OKIM6295 samples */ - /* 00000-2ffff is fixed, 30000-3ffff is bank switched from all the ROMs */ + ROM_REGION( 0x100000, "oki", 0 ) + // 00000-2ffff is fixed, 30000-3ffff is bank switched from all the ROMs ROM_LOAD( "pm008e.l", 0x00000, 0x80000, CRC(d9379ba8) SHA1(5ae7c743319b1a12f2b101a9f0f8fe0728ed1476) ) ROM_LOAD( "pm007e.u", 0x80000, 0x80000, CRC(c7ed7950) SHA1(133258b058d3c562208d0d00b9fac71202647c32) ) ROM_END -GAME( 1990, galpanic, 0, galpanic, galpanic, galpanic_state, empty_init, ROT90, "Kaneko", "Gals Panic (Unprotected)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) -GAME( 1990, galpanica, galpanic, galpanica, galpanica, galpanic_state, empty_init, ROT90, "Kaneko", "Gals Panic (MCU Protected, set 1)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) -GAME( 1990, galpanicb, galpanic, galpanica, galpanica, galpanic_state, empty_init, ROT90, "Kaneko", "Gals Panic (MCU Protected, set 2)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) +} // anonymous namespace + + +GAME( 1990, galpanic, 0, galpanic, galpanic, galpanic_state, empty_init, ROT90, "Kaneko", "Gals Panic (unprotected)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) +GAME( 1990, galpanica, galpanic, galpanica, galpanica, galpanic_state, empty_init, ROT90, "Kaneko", "Gals Panic (ULA protected, set 1)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) +GAME( 1990, galpanicb, galpanic, galpanica, galpanica, galpanic_state, empty_init, ROT90, "Kaneko", "Gals Panic (ULA protected, set 2)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/gamecstl.cpp mame-0.243+dfsg.1/src/mame/drivers/gamecstl.cpp --- mame-0.242+dfsg.1/src/mame/drivers/gamecstl.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/gamecstl.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1,30 +1,57 @@ // license:BSD-3-Clause // copyright-holders:R. Belmont +// thanks-to: Diego Nappino /* Cristaltec "Game Cristal" (MAME bootleg) - Skeleton driver by R. Belmont, based on taitowlf.c by Ville Linde + Skeleton driver by R. Belmont, based on taitowlf.cpp by Ville Linde - Note: - - bp 000F16B5 do bx=0x16bb (can't skip this check?) - - Specs: P3-866, SiS 630 graphics card, SiS 7018 sound, Windows 98, DirectX 8.1. - - Input is via a custom COM1 port JAMMA adaptor. - - The custom emulator is a heavily modified version of MAME32. If you extract the - disk image, it's in C:\GH4\GH4.EXE. It's UPX compressed, so unpack it before doing - any forensics. The emulator does run on Windows as new as XP Pro SP2 but you can't - control it due to the lack of the custom input. + Notes: + - Specs: P3-866, SiS 630 motherboard + integrated graphics card, + SiS 7018 sound, Windows 98SE, DirectX 8.1. + - Windows image can be booted with m55hipl driver. + It will try to install an "unnamed card" (svga_et4k?) then uses its own shell + "ialoader.exe" to boot the frontend, located in C:\WINDOWS. + It will eventually hang after throwing a "DirectX missing" error, trying to install + the ET4K drivers won't work (will BSoD at start of boot sequence). + - In order to bypass the shell launcher, you should: + 1. edit C:\WINDOWS\system.ini and change shell property to explorer.exe + 2. remove the autoexec.bat contents, it will otherwise copy a bunch of .ini + files from C:\dat to C:\WINDOWS, and replacing the system.ini shell launcher. + - (gamecstl) Device Manager installed devices: + - two Samsung SyncMaster 900SL monitors (?); + - SiS 630 display adapter; + - Samsung CD-ROM SC-152L; + - SiS 5513 Dual PCI IDE Controller; + - COM1, COM2, LPT1 enabled; + - a QDI USBDisk USB Mass Storage SCSI driver; + - a SiS 7001 PCI to USB Open Host Controller + USB root hub x 2; + - C:\drvs contains a collection of drivers, mostly the ones described above. + - Other parts of Windows are otherwise more or less stock, except for a footprint + inside C:\WINDOWS\temp: + 1. has a Portuguese version of the Intel Processor Identification Utility, + most likely used for binding the emulator to the CPU serial via CPUID; + 2. has u3spwd.exe (USB Flash Disk), likely used to copy the necessary files for + making the frontend to work; + - Input is via a custom COM1 port JAMMA adaptor. + - The custom emulator is a heavily modified version of MAME32. If you extract the + disk image, it's in C:\GH4\GH4.EXE. It's UPX compressed, so unpack it before doing + any forensics. The emulator does run on Windows as new as XP Pro SP2 but you can't + control it due to the lack of the custom input. + - C:\GH4\mvs contains movie clips of the emulated games. + These are MS-CRAM encoded, 288x208 at 20 fps, stereo MS ADPCM with 11025 Hz sample rate, + 36 seconds length. + Mentioning this because SiS 630 has several HW registers dedicated to video playback, + which will be most likely used once we get there. Updates 27/11/2007 (Diego Nappino): - The COM1 port is opened at 19200 bps, No parity, 8 bit data,1 stop bit. + The COM1 port is opened at 19200 bps, No parity, 8 bit data, 1 stop bit. The protocol is based on a 6 bytes frame with a leading byte valued 0x05 and a trailing one at 0x02 The four middle bytes are used, in negative logic (0xFF = No button pressed), to implement the inputs. - Each bit meaning as follows : + Each bit meaning as follows: - Byte 1 Byte 2 Byte 3 Byte 4 - Bit 0 P1-Credit P1-Button C P2-Left UNUSED + Byte 1 Byte 2 Byte 3 Byte 4 + Bit 0 P1-Credit P1-Button C P2-Left UNUSED Bit 1 P1-Start P1-Button D P2-Right UNUSED Bit 2 P1-Down P1-Button E P2-Button A SERVICE Bit 3 P1-Up TEST P2-Button B UNUSED @@ -33,7 +60,8 @@ Bit 6 P1-Button A P2-Down P2-Button E UNUSED Bit 7 P1-Button B P2-Up VIDEO-MODE UNUSED - The JAMMA adaptor sends a byte frame each time an input changes. So, in example, if the P1-Button A and P1-Button B are both pressed, it will send : + The JAMMA adaptor sends a byte frame each time an input changes. + So for example, if the P1-Button A and P1-Button B are both pressed, it will send: 0x05 0xFC 0xFF 0xFF 0xFF 0x02 @@ -42,8 +70,8 @@ 0x05 0xFF 0xFF 0xFF 0xFF 0x02 CPUID info: - Original set: + Original set: CPUID Level: EAX: EBX: ECX: EDX: 00000000 00000003 756E6547 6C65746E 49656E69 00000001 0000068A 00000002 00000000 0387F9FF @@ -52,7 +80,6 @@ 80000000 00000000 00000000 CA976D2E 000082F6 C0000000 00000000 00000000 CA976D2E 000082F6 - Version 2: CPUID Level: EAX: EBX: ECX: EDX: 00000000 00000003 756E6547 6C65746E 49656E69 @@ -78,10 +105,11 @@ { public: gamecstl_state(const machine_config &mconfig, device_type type, const char *tag) - : pcat_base_state(mconfig, type, tag), - m_cga_ram(*this, "cga_ram"), - m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") { } + : pcat_base_state(mconfig, type, tag) + , m_cga_ram(*this, "cga_ram") + , m_gfxdecode(*this, "gfxdecode") + , m_palette(*this, "palette") + { } void gamecstl(machine_config &config); @@ -412,7 +440,6 @@ void gamecstl_state::gamecstl(machine_config &config) { - /* basic machine hardware */ PENTIUM3(config, m_maincpu, 200000000); m_maincpu->set_addrmap(AS_PROGRAM, &gamecstl_state::gamecstl_map); m_maincpu->set_addrmap(AS_IO, &gamecstl_state::gamecstl_io); @@ -420,6 +447,7 @@ pcat_common(config); + // TODO: wrong, needs SiS 630 instead pci_bus_legacy_device &pcibus(PCI_BUS_LEGACY(config, "pcibus", 0, 0)); pcibus.set_device(0, FUNC(gamecstl_state::intel82439tx_pci_r), FUNC(gamecstl_state::intel82439tx_pci_w)); pcibus.set_device(7, FUNC(gamecstl_state::intel82371ab_pci_r), FUNC(gamecstl_state::intel82371ab_pci_w)); @@ -427,7 +455,6 @@ ide_controller_device &ide(IDE_CONTROLLER(config, "ide").options(ata_devices, "hdd", nullptr, true)); ide.irq_handler().set("pic8259_2", FUNC(pic8259_device::ir6_w)); - /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(60); screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); @@ -455,9 +482,10 @@ ROM_LOAD( "bios.bin", 0x000000, 0x040000, BAD_DUMP CRC(27834ce9) SHA1(134c546dd75138c6f4bc5729b40e20e118454df9) ) ROM_REGION(0x08100, "gfx1", 0) - ROM_LOAD("cga.chr", 0x00000, 0x01000, BAD_DUMP CRC(42009069) SHA1(ed08559ce2d7f97f68b9f540bddad5b6295294dd)) + ROM_LOAD( "cga.chr", 0x00000, 0x01000, BAD_DUMP CRC(42009069) SHA1(ed08559ce2d7f97f68b9f540bddad5b6295294dd)) DISK_REGION( "ide:0:hdd:image" ) + // Note: has filled NVRAM directory DISK_IMAGE( "gamecstl", 0, SHA1(b431af3c42c48ba07972d77a3d24e60ee1e4359e) ) ROM_END @@ -466,7 +494,7 @@ ROM_LOAD( "bios.bin", 0x000000, 0x040000, BAD_DUMP CRC(27834ce9) SHA1(134c546dd75138c6f4bc5729b40e20e118454df9) ) ROM_REGION(0x08100, "gfx1", 0) - ROM_LOAD("cga.chr", 0x00000, 0x01000, BAD_DUMP CRC(42009069) SHA1(ed08559ce2d7f97f68b9f540bddad5b6295294dd)) + ROM_LOAD( "cga.chr", 0x00000, 0x01000, BAD_DUMP CRC(42009069) SHA1(ed08559ce2d7f97f68b9f540bddad5b6295294dd)) DISK_REGION( "ide:0:hdd:image" ) DISK_IMAGE( "gamecst2", 0, SHA1(14e1b311cb474801c7bdda3164a0c220fb102159) ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/gamemachine.cpp mame-0.243+dfsg.1/src/mame/drivers/gamemachine.cpp --- mame-0.242+dfsg.1/src/mame/drivers/gamemachine.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/gamemachine.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -95,10 +95,10 @@ #include "emu.h" #include "cpu/f8/f8.h" -#include "video/pwm.h" #include "machine/f3853.h" #include "machine/netlist.h" #include "sound/spkrdev.h" +#include "video/pwm.h" #include "speaker.h" diff -Nru mame-0.242+dfsg.1/src/mame/drivers/gammagic.cpp mame-0.243+dfsg.1/src/mame/drivers/gammagic.cpp --- mame-0.242+dfsg.1/src/mame/drivers/gammagic.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/gammagic.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1,11 +1,26 @@ // license:BSD-3-Clause // copyright-holders:Grull Osgo -/************************************************************************************ +/************************************************************************************************** Game Magic (c) 1997 Bally Gaming Co. Preliminary driver by Grull Osgo +TODO: +- skeleton driver, needs devices hooked up + (several of these unemulated at the time of this writing) +- Identify and hookup proper motherboard BIOS + Should be a m55hipl with CD-ROM as bootable option, m55-04ns and m55-04s doesn't cope with + this requirement, dump mentions using El Torito specs at offset 0x8801. +- CD-ROM dumps are unreadable by DOS ("not High Sierra or ISO9660"), + .cue sports a single data track with 2 seconds pregap, extracting the CD and editing + the .cue to remove the pregap makes it mountable, is it a chd issue or dump mistake? +- Missing 68k dump portion. + Very unlikely it transfers code from serial, and CD-ROM dump doesn't have any clear file that + would indicate a code transfer or an handshake between main and sub CPUs; + +=================================================================================================== + Game Magic Is a Multigame machine build on a Bally's V8000 platform. @@ -16,10 +31,13 @@ 1 Motherboard MICRONICS M55Hi-Plus PCI/ISA, Chipset INTEL i430HX (TRITON II), 64 MB Ram (4 SIMM M x 16 MB SIMM) On board Sound Blaster Vibra 16C chipset. + [has optional ESS references in dump -AS] 1 TOSHIBA CD-ROM or DVD-ROM Drive w/Bootable CD-ROM with Game. 1 OAK SVGA PCI Video Board. 1 Voodoo Graphics PCI Video Board, connected to the monitor. + [Voodoo 1 or 2 according to strings in dump -AS] 1 21" SVGA Color Monitor, 16x9 Aspect, Vertical mount, with touchscreen. + [running at 50Hz with option for 60Hz declared in config file -AS] 1 Bally's IO-Board, Based on 68000 procesor as interface to all gaming devices (Buttons, Lamps, Switches, Coin acceptor, Bill Validator, Hopper, Touchscreen, etc...) @@ -27,13 +45,11 @@ Additional CD-ROM games: "99 Bottles of Beer" -*************************************************************************************/ +**************************************************************************************************/ #include "emu.h" #include "cpu/i386/i386.h" -//#include "machine/i82371sb.h" -//#include "machine/i82439tx.h" -#include "machine/lpci.h" +#include "machine/pci.h" #include "machine/pcshare.h" #include "machine/pckeybrd.h" #include "video/pc_vga.h" @@ -42,11 +58,15 @@ { public: gammagic_state(const machine_config &mconfig, device_type type, const char *tag) - : pcat_base_state(mconfig, type, tag) { } + : pcat_base_state(mconfig, type, tag) + , m_pciroot(*this, "pci") + { } void gammagic(machine_config &config); private: + required_device m_pciroot; + virtual void machine_start() override; void gammagic_io(address_map &map); void gammagic_map(address_map &map); @@ -57,24 +77,24 @@ { map(0x00000000, 0x0009ffff).ram(); map(0x000a0000, 0x000bffff).rw("vga", FUNC(vga_device::mem_r), FUNC(vga_device::mem_w)); - map(0x000e0000, 0x000fffff).rom().region("user", 0x20000);/* System BIOS */ + map(0x000e0000, 0x000fffff).rom().region("isa", 0x20000);/* System BIOS */ map(0x00100000, 0x07ffffff).ram(); map(0x08000000, 0xfffdffff).noprw(); - map(0xfffe0000, 0xffffffff).rom().region("user", 0x20000);/* System BIOS */ + map(0xfffe0000, 0xffffffff).rom().region("isa", 0x20000);/* System BIOS */ } void gammagic_state::gammagic_io(address_map &map) { pcat32_io_common(map); map(0x00e8, 0x00ef).noprw(); - map(0x00f0, 0x01ef).noprw(); - map(0x01f8, 0x03af).noprw(); +// map(0x00f0, 0x01ef).noprw(); +// map(0x01f8, 0x03af).noprw(); map(0x03b0, 0x03bf).rw("vga", FUNC(vga_device::port_03b0_r), FUNC(vga_device::port_03b0_w)); map(0x03c0, 0x03cf).rw("vga", FUNC(vga_device::port_03c0_r), FUNC(vga_device::port_03c0_w)); map(0x03d0, 0x03df).rw("vga", FUNC(vga_device::port_03d0_r), FUNC(vga_device::port_03d0_w)); - map(0x03e0, 0x03ef).noprw(); - map(0x0cf8, 0x0cff).rw("pcibus", FUNC(pci_bus_legacy_device::read), FUNC(pci_bus_legacy_device::write)); - map(0x0400, 0xffff).noprw(); +// map(0x03e0, 0x03ef).noprw(); +// map(0x0cf8, 0x0cff).rw("pcibus", FUNC(pci_bus_device::read), FUNC(pci_bus_device::write)); +// map(0x0400, 0xffff).noprw(); } static INPUT_PORTS_START( gammagic ) @@ -86,6 +106,7 @@ void gammagic_state::gammagic(machine_config &config) { + // TODO: convert to a m55hipl state machine derivative PENTIUM(config, m_maincpu, 133000000); // Intel Pentium 133 m_maincpu->set_addrmap(AS_PROGRAM, &gammagic_state::gammagic_map); m_maincpu->set_addrmap(AS_IO, &gammagic_state::gammagic_io); @@ -93,11 +114,8 @@ pcat_common(config); - PCI_BUS_LEGACY(config, "pcibus", 0, 0); -// pcibus.set_device_read (0, FUNC(gammagic_state::intel82439tx_pci_r), this); -// pcibus.set_device_write(0, FUNC(gammagic_state::intel82439tx_pci_w), this); -// pcibus.set_device_read (7, FUNC(gammagic_state::intel82371ab_pci_r), this); -// pcibus.set_device_write(7, FUNC(gammagic_state::intel82371ab_pci_w), this); + PCI_ROOT(config, "pci", 0); + // ... /* video hardware */ pcvideo_vga(config); @@ -105,33 +123,43 @@ ROM_START( gammagic ) - ROM_REGION32_LE(0x40000, "user", 0) + ROM_REGION32_LE(0x40000, "isa", 0) //Original Memory Set //ROM_LOAD("m7s04.rom", 0, 0x40000, CRC(3689f5a9) SHA1(8daacdb0dc6783d2161680564ffe83ac2515f7ef)) //ROM_LOAD("otivga_tx2953526.rom", 0x0000, 0x8000, CRC(916491af) SHA1(d64e3a43a035d70ace7a2d0603fc078f22d237e1)) - //Temp. Memory Set (Only for initial driver development stage) - ROM_LOAD16_BYTE( "trident_tgui9680_bios.bin", 0x0000, 0x4000, CRC(1eebde64) SHA1(67896a854d43a575037613b3506aea6dae5d6a19) ) + // TODO: remove this (needs "OAK SVGA" PCI BIOS hooked up) + ROM_LOAD16_BYTE( "trident_tgui9680_bios.bin", 0x0000, 0x4000, BAD_DUMP CRC(1eebde64) SHA1(67896a854d43a575037613b3506aea6dae5d6a19) ) ROM_CONTINUE( 0x0001, 0x4000 ) - ROM_LOAD("5hx29.bin", 0x20000, 0x20000, CRC(07719a55) SHA1(b63993fd5186cdb4f28c117428a507cd069e1f68)) + // TODO: specs mentions a m55hipl compatible BIOS, this is 5HX29 + ROM_LOAD("5hx29.bin", 0x20000, 0x20000, BAD_DUMP CRC(07719a55) SHA1(b63993fd5186cdb4f28c117428a507cd069e1f68)) + + ROM_REGION(0x20000, "v8000", 0) + // 68k code, unknown size/number of roms + ROM_LOAD("v8000.bin", 0x0000, 0x20000, NO_DUMP) DISK_REGION( "cdrom" ) - DISK_IMAGE_READONLY( "gammagic", 0,SHA1(caa8fc885d84dbc07fb0604c76cd23c873a65ce6) ) + DISK_IMAGE_READONLY( "gammagic", 0, BAD_DUMP SHA1(caa8fc885d84dbc07fb0604c76cd23c873a65ce6) ) ROM_END ROM_START( 99bottles ) - ROM_REGION32_LE(0x40000, "user", 0) + ROM_REGION32_LE(0x40000, "isa", 0) //Original BIOS/VGA-BIOS Rom Set //ROM_LOAD("m7s04.rom", 0, 0x40000, CRC(3689f5a9) SHA1(8daacdb0dc6783d2161680564ffe83ac2515f7ef)) //ROM_LOAD("otivga_tx2953526.rom", 0x0000, 0x8000, CRC(916491af) SHA1(d64e3a43a035d70ace7a2d0603fc078f22d237e1)) - //Temporary (Chipset compatible Rom Set, only for driver development stage) - ROM_LOAD16_BYTE( "trident_tgui9680_bios.bin", 0x0000, 0x4000, CRC(1eebde64) SHA1(67896a854d43a575037613b3506aea6dae5d6a19) ) + // TODO: remove this (needs "OAK SVGA" PCI BIOS hooked up) + ROM_LOAD16_BYTE( "trident_tgui9680_bios.bin", 0x0000, 0x4000, BAD_DUMP CRC(1eebde64) SHA1(67896a854d43a575037613b3506aea6dae5d6a19) ) ROM_CONTINUE( 0x0001, 0x4000 ) - ROM_LOAD("5hx29.bin", 0x20000, 0x20000, CRC(07719a55) SHA1(b63993fd5186cdb4f28c117428a507cd069e1f68)) + // TODO: specs mentions a m55hipl compatible BIOS, this is 5HX29 + ROM_LOAD("5hx29.bin", 0x20000, 0x20000, BAD_DUMP CRC(07719a55) SHA1(b63993fd5186cdb4f28c117428a507cd069e1f68)) + + ROM_REGION(0x20000, "v8000", 0) + // 68k code, unknown size/number of roms + ROM_LOAD("v8000.bin", 0x0000, 0x20000, NO_DUMP) DISK_REGION( "cdrom" ) - DISK_IMAGE_READONLY( "99bottles", 0, SHA1(0b874178c8dd3cfc451deb53dc7936dc4ad5a04f)) + DISK_IMAGE_READONLY( "99bottles", 0, BAD_DUMP SHA1(0b874178c8dd3cfc451deb53dc7936dc4ad5a04f)) ROM_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/gauntlet.cpp mame-0.243+dfsg.1/src/mame/drivers/gauntlet.cpp --- mame-0.242+dfsg.1/src/mame/drivers/gauntlet.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/gauntlet.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -446,21 +446,9 @@ }; -static const gfx_layout pfmolayout = -{ - 8,8, - RGN_FRAC(1,4), - 4, - { RGN_FRAC(3,4), RGN_FRAC(2,4), RGN_FRAC(1,4), RGN_FRAC(0,4) }, - { 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_gauntlet ) - GFXDECODE_ENTRY( "gfx2", 0, pfmolayout, 256, 32 ) - GFXDECODE_ENTRY( "gfx1", 0, anlayout, 0, 64 ) + GFXDECODE_ENTRY( "gfx2", 0, gfx_8x8x4_planar, 256, 32 ) + GFXDECODE_ENTRY( "gfx1", 0, anlayout, 0, 64 ) GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/generalplus_gpl16250_nand.cpp mame-0.243+dfsg.1/src/mame/drivers/generalplus_gpl16250_nand.cpp --- mame-0.242+dfsg.1/src/mame/drivers/generalplus_gpl16250_nand.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/generalplus_gpl16250_nand.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -915,7 +915,7 @@ CONS(200?, vbaby, 0, 0, generalplus_gpac800_vbaby, jak_car2, generalplus_gpac800_vbaby_game_state, nand_vbaby, "VTech", "V.Baby", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) CONS(200?, kiugames, 0, 0, generalplus_gpac800, jak_car2, generalplus_gpac800_game_state, nand_kiugames, "VideoJet", "Kiu Games", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) // probably has other names in English too? menus don't appear to be in German -CONS(200?, jak_gtg, 0, 0, generalplus_gpac800, jak_gtg, generalplus_gpac800_game_state, nand_init210, "JAKKS Pacific Inc / HotGen Ltd", "Golden Tee Golf (JAKKS Pacific TV Game)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) +CONS(2011, jak_gtg, 0, 0, generalplus_gpac800, jak_gtg, generalplus_gpac800_game_state, nand_init210, "JAKKS Pacific Inc / HotGen Ltd", "Golden Tee Golf (JAKKS Pacific TV Game)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) CONS(200?, jak_car2, 0, 0, generalplus_gpac800, jak_car2, generalplus_gpac800_game_state, nand_init210, "JAKKS Pacific Inc / HotGen Ltd", "Cars 2 (JAKKS Pacific TV Game)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) CONS(2010, jak_tsm, 0, 0, generalplus_gpac800, jak_car2, generalplus_gpac800_game_state, nand_tsm, "JAKKS Pacific Inc / Schell Games", "Toy Story Mania (JAKKS Pacific TV Game)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) CONS(2009, jak_sspop, 0, 0, generalplus_gpac800, jak_hsm, generalplus_gpac800_game_state, nand_init210_32mb, "JAKKS Pacific Inc / HotGen Ltd", "Sing Scene Pop (JAKKS Pacific TV Game)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/geneve.cpp mame-0.243+dfsg.1/src/mame/drivers/geneve.cpp --- mame-0.242+dfsg.1/src/mame/drivers/geneve.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/geneve.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -496,6 +496,10 @@ // See V9938 specs m_pal->csw_in(m_gatearray->csw_out()); m_pal->csr_in(m_gatearray->csr_out()); + + // Trigger the 9901 clock when A10=1 + if ((address & 0x0020) != 0) + m_tms9901->update_clock(); } // Going to the box diff -Nru mame-0.242+dfsg.1/src/mame/drivers/ghosteo.cpp mame-0.243+dfsg.1/src/mame/drivers/ghosteo.cpp --- mame-0.242+dfsg.1/src/mame/drivers/ghosteo.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/ghosteo.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -81,10 +81,10 @@ struct nand_t { - nand_mode_t mode; - int page_addr; - int byte_addr; - int addr_load_ptr; + nand_mode_t mode{}; + int page_addr = 0; + int byte_addr = 0; + int addr_load_ptr = 0; }; @@ -135,7 +135,7 @@ void qs1000_p2_w(uint8_t data); void qs1000_p3_w(uint8_t data); - int m_rom_pagesize; + int m_rom_pagesize = 0; uint32_t s3c2410_gpio_port_r(offs_t offset); void s3c2410_gpio_port_w(offs_t offset, uint32_t data); uint32_t s3c2410_core_pin_r(offs_t offset); diff -Nru mame-0.242+dfsg.1/src/mame/drivers/ginganin.cpp mame-0.243+dfsg.1/src/mame/drivers/ginganin.cpp --- mame-0.242+dfsg.1/src/mame/drivers/ginganin.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/ginganin.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -205,22 +205,11 @@ 16*16*4 }; -static const gfx_layout layout8x8 = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { STEP4(0,1) }, - { STEP8(0,4) }, - { STEP8(0,4*8) }, - 8*8*4 -}; - static GFXDECODE_START( gfx_ginganin ) - GFXDECODE_ENTRY( "gfx1", 0, layout16x16, 256*3, 16 ) /* [0] bg */ - GFXDECODE_ENTRY( "gfx2", 0, layout16x16, 256*2, 16 ) /* [1] fg */ - GFXDECODE_ENTRY( "gfx3", 0, layout8x8, 256*0, 16 ) /* [2] txt */ - GFXDECODE_ENTRY( "gfx4", 0, layout16x16, 256*1, 16 ) /* [3] sprites */ + GFXDECODE_ENTRY( "gfx1", 0, layout16x16, 256*3, 16 ) /* [0] bg */ + GFXDECODE_ENTRY( "gfx2", 0, layout16x16, 256*2, 16 ) /* [1] fg */ + GFXDECODE_ENTRY( "gfx3", 0, gfx_8x8x4_packed_msb, 256*0, 16 ) /* [2] txt */ + GFXDECODE_ENTRY( "gfx4", 0, layout16x16, 256*1, 16 ) /* [3] sprites */ GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/gladiatr.cpp mame-0.243+dfsg.1/src/mame/drivers/gladiatr.cpp --- mame-0.242+dfsg.1/src/mame/drivers/gladiatr.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/gladiatr.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -890,17 +890,6 @@ /*******************************************************************/ -static const gfx_layout charlayout = -{ - 8,8, - RGN_FRAC(1,1), - 1, - { 0 }, - { 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 const gfx_layout tilelayout = { 8,8, @@ -926,13 +915,13 @@ }; static GFXDECODE_START( gfx_ppking ) - GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 1 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x1, 0, 1 ) GFXDECODE_ENTRY( "gfx2", 0, tilelayout, 0, 32 ) GFXDECODE_ENTRY( "gfx3", 0, spritelayout, 0x100, 32 ) GFXDECODE_END static GFXDECODE_START( gfx_gladiatr ) - GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0x200, 1 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x1, 0x200, 1 ) GFXDECODE_ENTRY( "gfx2", 0, tilelayout, 0x000, 32 ) GFXDECODE_ENTRY( "gfx3", 0, spritelayout, 0x100, 32 ) GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/gng.cpp mame-0.243+dfsg.1/src/mame/drivers/gng.cpp --- mame-0.242+dfsg.1/src/mame/drivers/gng.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/gng.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -17,13 +17,13 @@ The 0x6000-0x7fff ROM space doesn't seem to be used: instead the game writes to 6048 and reads from 6000. Silly copy protection? -- Increased "gfx3" to address 0x400 sprites, to avoid Ghosts'n Goblins - from drawing a bad sprite. (18/08/2005 Pierpaolo Prazzoli) +- Increased "sprites" to address 0x400 sprites, to avoid Ghosts'n Goblins + drawing a bad sprite. (18/08/2005 Pierpaolo Prazzoli) Notes by Jose Tejada (jotego) There is no watchdog in GnG, as previously stated in the MAME driver. -Instead, there is a DMA circuit that copies object data from the CPU RAM to a buffer +Instead, there is a DMA circuit that copies object data from the CPU RAM to a buffer, this also slows down the CPU as it is halted during that time. The DMA is triggered when a certain memory location is addressed. That location was thought to be a watchdog before. @@ -31,22 +31,225 @@ ***************************************************************************/ #include "emu.h" -#include "includes/gng.h" -#include "cpu/z80/z80.h" #include "cpu/m6809/m6809.h" +#include "cpu/z80/z80.h" #include "machine/74259.h" #include "machine/gen_latch.h" +#include "sound/ymopn.h" +#include "video/bufsprite.h" + +#include "emupal.h" #include "screen.h" #include "speaker.h" +#include "tilemap.h" + + +namespace { + +class gng_state : public driver_device +{ +public: + gng_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_spriteram(*this, "spriteram"), + m_fgvideoram(*this, "fgvideoram"), + m_bgvideoram(*this, "bgvideoram"), + m_mainbank(*this, "mainbank"), + m_maincpu(*this, "maincpu"), + m_ym(*this, "ym%u", 1), + m_gfxdecode(*this, "gfxdecode"), + m_palette(*this, "palette") + { } + + void gng(machine_config &config); + void diamond(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; + +private: + // memory pointers + required_device m_spriteram; + required_shared_ptr m_fgvideoram; + required_shared_ptr m_bgvideoram; + required_memory_bank m_mainbank; + + // video-related + tilemap_t *m_bg_tilemap = nullptr; + tilemap_t *m_fg_tilemap = nullptr; + uint8_t m_scrollx[2]{}; + uint8_t m_scrolly[2]{}; + + required_device m_maincpu; + required_device_array m_ym; + required_device m_gfxdecode; + required_device m_palette; + + void bankswitch_w(uint8_t data); + DECLARE_WRITE_LINE_MEMBER(ym_reset_w); + uint8_t diamond_hack_r(); + void fgvideoram_w(offs_t offset, uint8_t data); + void bgvideoram_w(offs_t offset, uint8_t data); + void bgscrollx_w(offs_t offset, uint8_t data); + void bgscrolly_w(offs_t offset, uint8_t data); + DECLARE_WRITE_LINE_MEMBER(flipscreen_w); + TILE_GET_INFO_MEMBER(get_fg_tile_info); + TILE_GET_INFO_MEMBER(get_bg_tile_info); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); + + void diamond_main_map(address_map &map); + void gng_main_map(address_map &map); + void sound_map(address_map &map); +}; + + +// video + +/*************************************************************************** + + Callbacks for the TileMap code + +***************************************************************************/ + +TILE_GET_INFO_MEMBER(gng_state::get_fg_tile_info) +{ + uint8_t attr = m_fgvideoram[tile_index + 0x400]; + tileinfo.set(0, + m_fgvideoram[tile_index] + ((attr & 0xc0) << 2), + attr & 0x0f, + TILE_FLIPYX((attr & 0x30) >> 4)); +} + +TILE_GET_INFO_MEMBER(gng_state::get_bg_tile_info) +{ + uint8_t attr = m_bgvideoram[tile_index + 0x400]; + tileinfo.set(1, + m_bgvideoram[tile_index] + ((attr & 0xc0) << 2), + attr & 0x07, + TILE_FLIPYX((attr & 0x30) >> 4)); + tileinfo.group = (attr & 0x08) >> 3; +} + + + +/*************************************************************************** + + Start the video hardware emulation. + +***************************************************************************/ + +void gng_state::video_start() +{ + m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(gng_state::get_fg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); + m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(gng_state::get_bg_tile_info)), TILEMAP_SCAN_COLS, 16, 16, 32, 32); + + m_fg_tilemap->set_transparent_pen(3); + m_bg_tilemap->set_transmask(0, 0xff, 0x00); // split type 0 is totally transparent in front half + m_bg_tilemap->set_transmask(1, 0x41, 0xbe); // split type 1 has pens 0 and 6 transparent in front half + + m_bg_tilemap->set_scrolldx(128, 128); + m_bg_tilemap->set_scrolldy( 6, 6); + m_fg_tilemap->set_scrolldx(128, 128); + m_fg_tilemap->set_scrolldy( 6, 6); +} + + +/*************************************************************************** + + Memory handlers + +***************************************************************************/ + +void gng_state::fgvideoram_w(offs_t offset, uint8_t data) +{ + m_fgvideoram[offset] = data; + m_fg_tilemap->mark_tile_dirty(offset & 0x3ff); +} + +void gng_state::bgvideoram_w(offs_t offset, uint8_t data) +{ + m_bgvideoram[offset] = data; + m_bg_tilemap->mark_tile_dirty(offset & 0x3ff); +} + + +void gng_state::bgscrollx_w(offs_t offset, uint8_t data) +{ + m_scrollx[offset] = data; + m_bg_tilemap->set_scrollx(0, m_scrollx[0] + 256 * m_scrollx[1]); +} + +void gng_state::bgscrolly_w(offs_t offset, uint8_t data) +{ + m_scrolly[offset] = data; + m_bg_tilemap->set_scrolly(0, m_scrolly[0] + 256 * m_scrolly[1]); +} -void gng_state::gng_bankswitch_w(uint8_t data) +WRITE_LINE_MEMBER(gng_state::flipscreen_w) +{ + flip_screen_set(!state); +} + + + +/*************************************************************************** + + Display refresh + +***************************************************************************/ + +void gng_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + uint8_t *buffered_spriteram = m_spriteram->buffer(); + gfx_element *gfx = m_gfxdecode->gfx(2); + + for (int offs = m_spriteram->bytes() - 4; offs >= 0; offs -= 4) + { + uint8_t attributes = buffered_spriteram[offs + 1]; + int sx = buffered_spriteram[offs + 3] - 0x100 * (attributes & 0x01); + int sy = buffered_spriteram[offs + 2]; + int flipx = attributes & 0x04; + int flipy = attributes & 0x08; + + if (flip_screen()) + { + sx = 240 - sx; + sy = 240 - sy; + flipx = !flipx; + flipy = !flipy; + } + + gfx->transpen(bitmap,cliprect, + buffered_spriteram[offs] + ((attributes << 2) & 0x300), + (attributes >> 4) & 3, + flipx, flipy, + sx + 128, sy + 6, 15); + } +} + +uint32_t gng_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + m_bg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER1, 0); + draw_sprites(bitmap, cliprect); + m_bg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER0, 0); + m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); + return 0; +} + + +// machine + +void gng_state::bankswitch_w(uint8_t data) { if (data == 4) - membank("bank1")->set_entry(4); + m_mainbank->set_entry(4); else - membank("bank1")->set_entry((data & 0x03)); + m_mainbank->set_entry(data & 0x03); } WRITE_LINE_MEMBER(gng_state::ym_reset_w) @@ -63,12 +266,12 @@ return 0; } -void gng_state::gng_map(address_map &map) +void gng_state::gng_main_map(address_map &map) { map(0x0000, 0x1dff).ram(); map(0x1e00, 0x1fff).ram().share("spriteram"); - map(0x2000, 0x27ff).ram().w(FUNC(gng_state::gng_fgvideoram_w)).share("fgvideoram"); - map(0x2800, 0x2fff).ram().w(FUNC(gng_state::gng_bgvideoram_w)).share("bgvideoram"); + map(0x2000, 0x27ff).ram().w(FUNC(gng_state::fgvideoram_w)).share(m_fgvideoram); + map(0x2800, 0x2fff).ram().w(FUNC(gng_state::bgvideoram_w)).share(m_bgvideoram); map(0x3000, 0x3000).portr("SYSTEM"); map(0x3001, 0x3001).portr("P1"); map(0x3002, 0x3002).portr("P2"); @@ -77,21 +280,21 @@ map(0x3800, 0x38ff).w(m_palette, FUNC(palette_device::write8_ext)).share("palette_ext"); map(0x3900, 0x39ff).w(m_palette, FUNC(palette_device::write8)).share("palette"); map(0x3a00, 0x3a00).w("soundlatch", FUNC(generic_latch_8_device::write)); - map(0x3b08, 0x3b09).w(FUNC(gng_state::gng_bgscrollx_w)); - map(0x3b0a, 0x3b0b).w(FUNC(gng_state::gng_bgscrolly_w)); + map(0x3b08, 0x3b09).w(FUNC(gng_state::bgscrollx_w)); + map(0x3b0a, 0x3b0b).w(FUNC(gng_state::bgscrolly_w)); // 0x3c00 is the DMA trigger. Not emulated. map(0x3d00, 0x3d07).w("mainlatch", FUNC(ls259_device::write_d0)); - map(0x3e00, 0x3e00).w(FUNC(gng_state::gng_bankswitch_w)); - map(0x4000, 0x5fff).bankr("bank1"); + map(0x3e00, 0x3e00).w(FUNC(gng_state::bankswitch_w)); + map(0x4000, 0x5fff).bankr(m_mainbank); map(0x6000, 0xffff).rom(); } -void gng_state::diamond_map(address_map &map) +void gng_state::diamond_main_map(address_map &map) { map(0x0000, 0x1dff).ram(); map(0x1e00, 0x1fff).ram().share("spriteram"); - map(0x2000, 0x27ff).ram().w(FUNC(gng_state::gng_fgvideoram_w)).share("fgvideoram"); - map(0x2800, 0x2fff).ram().w(FUNC(gng_state::gng_bgvideoram_w)).share("bgvideoram"); + map(0x2000, 0x27ff).ram().w(FUNC(gng_state::fgvideoram_w)).share(m_fgvideoram); + map(0x2800, 0x2fff).ram().w(FUNC(gng_state::bgvideoram_w)).share(m_bgvideoram); map(0x3000, 0x33ff).noprw(); // faulty POST? map(0x3000, 0x3000).portr("SYSTEM"); map(0x3001, 0x3001).portr("P1"); @@ -101,13 +304,13 @@ map(0x3800, 0x38ff).w(m_palette, FUNC(palette_device::write8_ext)).share("palette_ext"); map(0x3900, 0x39ff).w(m_palette, FUNC(palette_device::write8)).share("palette"); map(0x3a00, 0x3a00).w("soundlatch", FUNC(generic_latch_8_device::write)); - map(0x3b08, 0x3b09).w(FUNC(gng_state::gng_bgscrollx_w)); - map(0x3b0a, 0x3b0b).w(FUNC(gng_state::gng_bgscrolly_w)); - map(0x3c00, 0x3c00).noprw(); /* watchdog? */ + map(0x3b08, 0x3b09).w(FUNC(gng_state::bgscrollx_w)); + map(0x3b0a, 0x3b0b).w(FUNC(gng_state::bgscrolly_w)); + map(0x3c00, 0x3c00).noprw(); // watchdog? map(0x3d00, 0x3d00).nopw(); // ? (writes $01 and $0F) map(0x3d01, 0x3d01).nopw(); // ? - map(0x3e00, 0x3e00).w(FUNC(gng_state::gng_bankswitch_w)); - map(0x4000, 0x5fff).bankr("bank1"); + map(0x3e00, 0x3e00).w(FUNC(gng_state::bankswitch_w)); + map(0x4000, 0x5fff).bankr(m_mainbank); map(0x6000, 0xffff).rom(); map(0x6000, 0x6000).r(FUNC(gng_state::diamond_hack_r)); map(0x6048, 0x6048).nopw(); // ? @@ -204,10 +407,10 @@ PORT_DIPSETTING( 0x60, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x20, DEF_STR( Difficult ) ) PORT_DIPSETTING( 0x00, DEF_STR( Very_Difficult ) ) - PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW2:1" ) /* Listed as "Unused" */ + PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW2:1" ) // Listed as "Unused" INPUT_PORTS_END -/* identical to gng, but the "unknown" dip switch is Invulnerability */ +// identical to gng, but the "unknown" dip switch is Invulnerability static INPUT_PORTS_START( makaimur ) PORT_INCLUDE( gng ) @@ -342,9 +545,9 @@ static GFXDECODE_START( gfx_gng ) - GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0x80, 16 ) /* colors 0x80-0xbf */ - GFXDECODE_ENTRY( "gfx2", 0, tilelayout, 0x00, 8 ) /* colors 0x00-0x3f */ - GFXDECODE_ENTRY( "gfx3", 0, spritelayout, 0x40, 4 ) /* colors 0x40-0x7f */ + GFXDECODE_ENTRY( "chars", 0, charlayout, 0x80, 16 ) // colors 0x80-0xbf + GFXDECODE_ENTRY( "tiles", 0, tilelayout, 0x00, 8 ) // colors 0x00-0x3f + GFXDECODE_ENTRY( "sprites", 0, spritelayout, 0x40, 4 ) // colors 0x40-0x7f GFXDECODE_END @@ -353,8 +556,8 @@ void gng_state::machine_start() { uint8_t *rombase = memregion("maincpu")->base(); - membank("bank1")->configure_entries(0, 4, &rombase[0x10000], 0x2000); - membank("bank1")->configure_entry(4, &rombase[0x4000]); + m_mainbank->configure_entries(0, 4, &rombase[0x10000], 0x2000); + m_mainbank->configure_entry(4, &rombase[0x4000]); save_item(NAME(m_scrollx)); save_item(NAME(m_scrolly)); @@ -368,34 +571,32 @@ m_scrolly[1] = 0; { - int i; - /* TODO: PCB reference clearly shows that the POST has random/filled data on the paletteram. For now let's fill everything with white colors until we have better info about it */ - for(i=0;i<0x100;i+=4) + for(int i = 0 ; i < 0x100; i += 4) { m_palette->basemem().write8(i, 0x00); m_palette->extmem().write8(i, 0x00); - m_palette->basemem().write8(i+1, 0x55); m_palette->extmem().write8(i+1, 0x55); - m_palette->basemem().write8(i+2, 0xaa); m_palette->extmem().write8(i+2, 0xaa); - m_palette->basemem().write8(i+3, 0xff); m_palette->extmem().write8(i+3, 0xff); - m_palette->set_pen_color(i+0,0x00,0x00,0x00); - m_palette->set_pen_color(i+1,0x55,0x55,0x55); - m_palette->set_pen_color(i+2,0xaa,0xaa,0xaa); - m_palette->set_pen_color(i+3,0xff,0xff,0xff); + m_palette->basemem().write8(i + 1, 0x55); m_palette->extmem().write8(i + 1, 0x55); + m_palette->basemem().write8(i + 2, 0xaa); m_palette->extmem().write8(i + 2, 0xaa); + m_palette->basemem().write8(i + 3, 0xff); m_palette->extmem().write8(i + 3, 0xff); + m_palette->set_pen_color(i + 0, 0x00, 0x00, 0x00); + m_palette->set_pen_color(i + 1, 0x55, 0x55, 0x55); + m_palette->set_pen_color(i + 2, 0xaa, 0xaa, 0xaa); + m_palette->set_pen_color(i + 3, 0xff, 0xff, 0xff); } } } void gng_state::gng(machine_config &config) { - /* basic machine hardware */ - MC6809(config, m_maincpu, XTAL(12'000'000)/2); /* verified on pcb */ - m_maincpu->set_addrmap(AS_PROGRAM, &gng_state::gng_map); + // basic machine hardware + MC6809(config, m_maincpu, XTAL(12'000'000) / 2); // verified on PCB + m_maincpu->set_addrmap(AS_PROGRAM, &gng_state::gng_main_map); m_maincpu->set_vblank_int("screen", FUNC(gng_state::irq0_line_hold)); - z80_device &audiocpu(Z80(config, "audiocpu", XTAL(12'000'000)/4)); /* verified on pcb */ + z80_device &audiocpu(Z80(config, "audiocpu", XTAL(12'000'000) / 4)); // verified on PCB audiocpu.set_addrmap(AS_PROGRAM, &gng_state::sound_map); - audiocpu.set_periodic_int(FUNC(gng_state::irq0_line_hold), attotime::from_hz(4*60)); + audiocpu.set_periodic_int(FUNC(gng_state::irq0_line_hold), attotime::from_hz(4 * 60)); ls259_device &mainlatch(LS259(config, "mainlatch")); // 9B on A board mainlatch.q_out_cb<0>().set(FUNC(gng_state::flipscreen_w)); @@ -404,12 +605,12 @@ mainlatch.q_out_cb<2>().set([this] (int state) { machine().bookkeeping().coin_counter_w(0, state); }); mainlatch.q_out_cb<3>().set([this] (int state) { machine().bookkeeping().coin_counter_w(1, state); }); - /* video hardware */ + // video hardware BUFFERED_SPRITERAM8(config, m_spriteram); screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); - screen.set_raw(XTAL(12'000'000)/2, 384, 128, 0, 262, 22, 246); // hsync is 50..77, vsync is 257..259 - screen.set_screen_update(FUNC(gng_state::screen_update_gng)); + screen.set_raw(XTAL(12'000'000) / 2, 384, 128, 0, 262, 22, 246); // hsync is 50..77, vsync is 257..259 + screen.set_screen_update(FUNC(gng_state::screen_update)); screen.screen_vblank().set(m_spriteram, FUNC(buffered_spriteram8_device::vblank_copy_rising)); screen.set_palette(m_palette); @@ -417,18 +618,18 @@ PALETTE(config, m_palette).set_format(palette_device::RGBx_444, 256); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); GENERIC_LATCH_8(config, "soundlatch"); - YM2203(config, m_ym[0], XTAL(12'000'000)/8); /* verified on pcb */ + YM2203(config, m_ym[0], XTAL(12'000'000) / 8); // verified on PCB m_ym[0]->add_route(0, "mono", 0.40); m_ym[0]->add_route(1, "mono", 0.40); m_ym[0]->add_route(2, "mono", 0.40); m_ym[0]->add_route(3, "mono", 0.20); - YM2203(config, m_ym[1], XTAL(12'000'000)/8); /* verified on pcb */ + YM2203(config, m_ym[1], XTAL(12'000'000) / 8); // verified on PCB m_ym[1]->add_route(0, "mono", 0.40); m_ym[1]->add_route(1, "mono", 0.40); m_ym[1]->add_route(2, "mono", 0.40); @@ -438,7 +639,7 @@ void gng_state::diamond(machine_config &config) { gng(config); - m_maincpu->set_addrmap(AS_PROGRAM, &gng_state::diamond_map); + m_maincpu->set_addrmap(AS_PROGRAM, &gng_state::diamond_main_map); config.device_remove("mainlatch"); } @@ -453,35 +654,35 @@ ROM_START( gng ) ROM_REGION( 0x18000, "maincpu", 0 ) - ROM_LOAD( "gg4.bin", 0x04000, 0x4000, CRC(66606beb) SHA1(4c640f49be93c7d2b12d4d4c56c56e74099b6c2f) ) /* 4000-5fff is page 4 */ + ROM_LOAD( "gg4.bin", 0x04000, 0x4000, CRC(66606beb) SHA1(4c640f49be93c7d2b12d4d4c56c56e74099b6c2f) ) // 4000-5fff is page 4 ROM_LOAD( "gg3.bin", 0x08000, 0x8000, CRC(9e01c65e) SHA1(a87880d87c64a6d61313c3bc69c8d49511e0f9c3) ) - ROM_LOAD( "gg5.bin", 0x10000, 0x8000, CRC(d6397b2b) SHA1(39aa3cb8c229e60ac0ac410ff61e0c09dba78501) ) /* page 0, 1, 2, 3 */ + ROM_LOAD( "gg5.bin", 0x10000, 0x8000, CRC(d6397b2b) SHA1(39aa3cb8c229e60ac0ac410ff61e0c09dba78501) ) // page 0, 1, 2, 3 ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "gg2.bin", 0x0000, 0x8000, CRC(615f5b6f) SHA1(7ef9ec5c2072e21c787a6bbf700033f50c759c1d) ) - ROM_REGION( 0x04000, "gfx1", 0 ) - ROM_LOAD( "gg1.bin", 0x00000, 0x4000, CRC(ecfccf07) SHA1(0a1518e19a2e0a4cc3dde4b9568202ea911b5ece) ) /* characters */ + ROM_REGION( 0x04000, "chars", 0 ) + ROM_LOAD( "gg1.bin", 0x00000, 0x4000, CRC(ecfccf07) SHA1(0a1518e19a2e0a4cc3dde4b9568202ea911b5ece) ) - ROM_REGION( 0x18000, "gfx2", 0 ) - ROM_LOAD( "gg11.bin", 0x00000, 0x4000, CRC(ddd56fa9) SHA1(f9d77eee5e2738b7e83ba02fcc55dd480391479f) ) /* tiles 0-1 Plane 1*/ - ROM_LOAD( "gg10.bin", 0x04000, 0x4000, CRC(7302529d) SHA1(8434c994cc55d2586641f3b90b6b15fd65dfb67c) ) /* tiles 2-3 Plane 1*/ - ROM_LOAD( "gg9.bin", 0x08000, 0x4000, CRC(20035bda) SHA1(bbb1fba0eb19471f66d29526fa8423ccb047bd63) ) /* tiles 0-1 Plane 2*/ - ROM_LOAD( "gg8.bin", 0x0c000, 0x4000, CRC(f12ba271) SHA1(1c42fa02cb27b35d10c3f7f036005e747f9f6b79) ) /* tiles 2-3 Plane 2*/ - ROM_LOAD( "gg7.bin", 0x10000, 0x4000, CRC(e525207d) SHA1(1947f159189b3a53f1251d8653b6e7c65c91fc3c) ) /* tiles 0-1 Plane 3*/ - ROM_LOAD( "gg6.bin", 0x14000, 0x4000, CRC(2d77e9b2) SHA1(944da1ce29a18bf0fc8deff78bceacba0bf23a07) ) /* tiles 2-3 Plane 3*/ - - ROM_REGION( 0x20000, "gfx3", ROMREGION_ERASEFF ) - ROM_LOAD( "gg17.bin", 0x00000, 0x4000, CRC(93e50a8f) SHA1(42d367f57bb2fdf60a0445ac1533da99cfeaa617) ) /* sprites 0 Plane 1-2 */ - ROM_LOAD( "gg16.bin", 0x04000, 0x4000, CRC(06d7e5ca) SHA1(9e06012bcd82f98fad43de666ef9a75979d940ab) ) /* sprites 1 Plane 1-2 */ - ROM_LOAD( "gg15.bin", 0x08000, 0x4000, CRC(bc1fe02d) SHA1(e3a1421d465b87148ffa94f5673b2307f0246afe) ) /* sprites 2 Plane 1-2 */ - ROM_LOAD( "gg14.bin", 0x10000, 0x4000, CRC(6aaf12f9) SHA1(207a7407288182a4f3eddaea634c6a6452131182) ) /* sprites 0 Plane 3-4 */ - ROM_LOAD( "gg13.bin", 0x14000, 0x4000, CRC(e80c3fca) SHA1(cb641c25bb04b970b2cbeca41adb792bbe142fb5) ) /* sprites 1 Plane 3-4 */ - ROM_LOAD( "gg12.bin", 0x18000, 0x4000, CRC(7780a925) SHA1(3f129ca6d695548b659955fe538584bd9ac2ff17) ) /* sprites 2 Plane 3-4 */ + ROM_REGION( 0x18000, "tiles", 0 ) + ROM_LOAD( "gg11.bin", 0x00000, 0x4000, CRC(ddd56fa9) SHA1(f9d77eee5e2738b7e83ba02fcc55dd480391479f) ) // 0-1 Plane 1 + ROM_LOAD( "gg10.bin", 0x04000, 0x4000, CRC(7302529d) SHA1(8434c994cc55d2586641f3b90b6b15fd65dfb67c) ) // 2-3 Plane 1 + ROM_LOAD( "gg9.bin", 0x08000, 0x4000, CRC(20035bda) SHA1(bbb1fba0eb19471f66d29526fa8423ccb047bd63) ) // 0-1 Plane 2 + ROM_LOAD( "gg8.bin", 0x0c000, 0x4000, CRC(f12ba271) SHA1(1c42fa02cb27b35d10c3f7f036005e747f9f6b79) ) // 2-3 Plane 2 + ROM_LOAD( "gg7.bin", 0x10000, 0x4000, CRC(e525207d) SHA1(1947f159189b3a53f1251d8653b6e7c65c91fc3c) ) // 0-1 Plane 3 + ROM_LOAD( "gg6.bin", 0x14000, 0x4000, CRC(2d77e9b2) SHA1(944da1ce29a18bf0fc8deff78bceacba0bf23a07) ) // 2-3 Plane 3 + + ROM_REGION( 0x20000, "sprites", ROMREGION_ERASEFF ) + ROM_LOAD( "gg17.bin", 0x00000, 0x4000, CRC(93e50a8f) SHA1(42d367f57bb2fdf60a0445ac1533da99cfeaa617) ) // sprites 0 Plane 1-2 + ROM_LOAD( "gg16.bin", 0x04000, 0x4000, CRC(06d7e5ca) SHA1(9e06012bcd82f98fad43de666ef9a75979d940ab) ) // sprites 1 Plane 1-2 + ROM_LOAD( "gg15.bin", 0x08000, 0x4000, CRC(bc1fe02d) SHA1(e3a1421d465b87148ffa94f5673b2307f0246afe) ) // sprites 2 Plane 1-2 + ROM_LOAD( "gg14.bin", 0x10000, 0x4000, CRC(6aaf12f9) SHA1(207a7407288182a4f3eddaea634c6a6452131182) ) // sprites 0 Plane 3-4 + ROM_LOAD( "gg13.bin", 0x14000, 0x4000, CRC(e80c3fca) SHA1(cb641c25bb04b970b2cbeca41adb792bbe142fb5) ) // sprites 1 Plane 3-4 + ROM_LOAD( "gg12.bin", 0x18000, 0x4000, CRC(7780a925) SHA1(3f129ca6d695548b659955fe538584bd9ac2ff17) ) // sprites 2 Plane 3-4 ROM_REGION( 0x0200, "proms", 0 ) - ROM_LOAD( "tbp24s10.14k", 0x0000, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) /* video timing (not used) */ - ROM_LOAD( "63s141.2e", 0x0100, 0x0100, CRC(4a1285a4) SHA1(5018c3950b675af58db499e2883ecbc55419b491) ) /* priority (not used) */ + ROM_LOAD( "tbp24s10.14k", 0x0000, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) // video timing (not used) + ROM_LOAD( "63s141.2e", 0x0100, 0x0100, CRC(4a1285a4) SHA1(5018c3950b675af58db499e2883ecbc55419b491) ) // priority (not used) ROM_REGION( 0x0100, "plds", 0 ) ROM_LOAD( "gg-pal10l8.bin", 0x0000, 0x002c, CRC(87f1b7e0) SHA1(b719c3be7bd4a02660bb0887f752e9769cbd37d2) ) @@ -498,28 +699,28 @@ ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "gg2.bin", 0x0000, 0x8000, CRC(615f5b6f) SHA1(7ef9ec5c2072e21c787a6bbf700033f50c759c1d) ) - ROM_REGION( 0x04000, "gfx1", 0 ) - ROM_LOAD( "gg1.bin", 0x00000, 0x4000, CRC(ecfccf07) SHA1(0a1518e19a2e0a4cc3dde4b9568202ea911b5ece) ) /* characters */ + ROM_REGION( 0x04000, "chars", 0 ) + ROM_LOAD( "gg1.bin", 0x00000, 0x4000, CRC(ecfccf07) SHA1(0a1518e19a2e0a4cc3dde4b9568202ea911b5ece) ) - ROM_REGION( 0x18000, "gfx2", 0 ) - ROM_LOAD( "gg11.bin", 0x00000, 0x4000, CRC(ddd56fa9) SHA1(f9d77eee5e2738b7e83ba02fcc55dd480391479f) ) /* tiles 0-1 Plane 1*/ - ROM_LOAD( "gg10.bin", 0x04000, 0x4000, CRC(7302529d) SHA1(8434c994cc55d2586641f3b90b6b15fd65dfb67c) ) /* tiles 2-3 Plane 1*/ - ROM_LOAD( "gg9.bin", 0x08000, 0x4000, CRC(20035bda) SHA1(bbb1fba0eb19471f66d29526fa8423ccb047bd63) ) /* tiles 0-1 Plane 2*/ - ROM_LOAD( "gg8.bin", 0x0c000, 0x4000, CRC(f12ba271) SHA1(1c42fa02cb27b35d10c3f7f036005e747f9f6b79) ) /* tiles 2-3 Plane 2*/ - ROM_LOAD( "gg7.bin", 0x10000, 0x4000, CRC(e525207d) SHA1(1947f159189b3a53f1251d8653b6e7c65c91fc3c) ) /* tiles 0-1 Plane 3*/ - ROM_LOAD( "gg6.bin", 0x14000, 0x4000, CRC(2d77e9b2) SHA1(944da1ce29a18bf0fc8deff78bceacba0bf23a07) ) /* tiles 2-3 Plane 3*/ - - ROM_REGION( 0x20000, "gfx3", ROMREGION_ERASEFF ) - ROM_LOAD( "gg17.bin", 0x00000, 0x4000, CRC(93e50a8f) SHA1(42d367f57bb2fdf60a0445ac1533da99cfeaa617) ) /* sprites 0 Plane 1-2 */ - ROM_LOAD( "gg16.bin", 0x04000, 0x4000, CRC(06d7e5ca) SHA1(9e06012bcd82f98fad43de666ef9a75979d940ab) ) /* sprites 1 Plane 1-2 */ - ROM_LOAD( "gg15.bin", 0x08000, 0x4000, CRC(bc1fe02d) SHA1(e3a1421d465b87148ffa94f5673b2307f0246afe) ) /* sprites 2 Plane 1-2 */ - ROM_LOAD( "gg14.bin", 0x10000, 0x4000, CRC(6aaf12f9) SHA1(207a7407288182a4f3eddaea634c6a6452131182) ) /* sprites 0 Plane 3-4 */ - ROM_LOAD( "gg13.bin", 0x14000, 0x4000, CRC(e80c3fca) SHA1(cb641c25bb04b970b2cbeca41adb792bbe142fb5) ) /* sprites 1 Plane 3-4 */ - ROM_LOAD( "gg12.bin", 0x18000, 0x4000, CRC(7780a925) SHA1(3f129ca6d695548b659955fe538584bd9ac2ff17) ) /* sprites 2 Plane 3-4 */ + ROM_REGION( 0x18000, "tiles", 0 ) + ROM_LOAD( "gg11.bin", 0x00000, 0x4000, CRC(ddd56fa9) SHA1(f9d77eee5e2738b7e83ba02fcc55dd480391479f) ) // 0-1 Plane 1 + ROM_LOAD( "gg10.bin", 0x04000, 0x4000, CRC(7302529d) SHA1(8434c994cc55d2586641f3b90b6b15fd65dfb67c) ) // 2-3 Plane 1 + ROM_LOAD( "gg9.bin", 0x08000, 0x4000, CRC(20035bda) SHA1(bbb1fba0eb19471f66d29526fa8423ccb047bd63) ) // 0-1 Plane 2 + ROM_LOAD( "gg8.bin", 0x0c000, 0x4000, CRC(f12ba271) SHA1(1c42fa02cb27b35d10c3f7f036005e747f9f6b79) ) // 2-3 Plane 2 + ROM_LOAD( "gg7.bin", 0x10000, 0x4000, CRC(e525207d) SHA1(1947f159189b3a53f1251d8653b6e7c65c91fc3c) ) // 0-1 Plane 3 + ROM_LOAD( "gg6.bin", 0x14000, 0x4000, CRC(2d77e9b2) SHA1(944da1ce29a18bf0fc8deff78bceacba0bf23a07) ) // 2-3 Plane 3 + + ROM_REGION( 0x20000, "sprites", ROMREGION_ERASEFF ) + ROM_LOAD( "gg17.bin", 0x00000, 0x4000, CRC(93e50a8f) SHA1(42d367f57bb2fdf60a0445ac1533da99cfeaa617) ) // sprites 0 Plane 1-2 + ROM_LOAD( "gg16.bin", 0x04000, 0x4000, CRC(06d7e5ca) SHA1(9e06012bcd82f98fad43de666ef9a75979d940ab) ) // sprites 1 Plane 1-2 + ROM_LOAD( "gg15.bin", 0x08000, 0x4000, CRC(bc1fe02d) SHA1(e3a1421d465b87148ffa94f5673b2307f0246afe) ) // sprites 2 Plane 1-2 + ROM_LOAD( "gg14.bin", 0x10000, 0x4000, CRC(6aaf12f9) SHA1(207a7407288182a4f3eddaea634c6a6452131182) ) // sprites 0 Plane 3-4 + ROM_LOAD( "gg13.bin", 0x14000, 0x4000, CRC(e80c3fca) SHA1(cb641c25bb04b970b2cbeca41adb792bbe142fb5) ) // sprites 1 Plane 3-4 + ROM_LOAD( "gg12.bin", 0x18000, 0x4000, CRC(7780a925) SHA1(3f129ca6d695548b659955fe538584bd9ac2ff17) ) // sprites 2 Plane 3-4 ROM_REGION( 0x0200, "proms", 0 ) - ROM_LOAD( "tbp24s10.14k", 0x0000, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) /* video timing (not used) */ - ROM_LOAD( "63s141.2e", 0x0100, 0x0100, CRC(4a1285a4) SHA1(5018c3950b675af58db499e2883ecbc55419b491) ) /* priority (not used) */ + ROM_LOAD( "tbp24s10.14k", 0x0000, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) // video timing (not used) + ROM_LOAD( "63s141.2e", 0x0100, 0x0100, CRC(4a1285a4) SHA1(5018c3950b675af58db499e2883ecbc55419b491) ) // priority (not used) ROM_END ROM_START( gngbl ) @@ -533,24 +734,24 @@ ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "2.8529.13h", 0x0000, 0x8000, CRC(55cfb196) SHA1(df9cdbb24c26bca226d7274225725d62ea854c7a) ) - ROM_REGION( 0x04000, "gfx1", 0 ) - ROM_LOAD( "1.84490.11e", 0x00000, 0x4000, CRC(ecfccf07) SHA1(0a1518e19a2e0a4cc3dde4b9568202ea911b5ece) ) /* characters */ + ROM_REGION( 0x04000, "chars", 0 ) + ROM_LOAD( "1.84490.11e", 0x00000, 0x4000, CRC(ecfccf07) SHA1(0a1518e19a2e0a4cc3dde4b9568202ea911b5ece) ) - ROM_REGION( 0x18000, "gfx2", 0 ) - ROM_LOAD( "13.84490.3e", 0x00000, 0x4000, CRC(ddd56fa9) SHA1(f9d77eee5e2738b7e83ba02fcc55dd480391479f) ) /* tiles 0-1 Plane 1*/ - ROM_LOAD( "12.84490.1e", 0x04000, 0x4000, CRC(7302529d) SHA1(8434c994cc55d2586641f3b90b6b15fd65dfb67c) ) /* tiles 2-3 Plane 1*/ - ROM_LOAD( "11.84490.3c", 0x08000, 0x4000, CRC(20035bda) SHA1(bbb1fba0eb19471f66d29526fa8423ccb047bd63) ) /* tiles 0-1 Plane 2*/ - ROM_LOAD( "10.84490.1c", 0x0c000, 0x4000, CRC(f12ba271) SHA1(1c42fa02cb27b35d10c3f7f036005e747f9f6b79) ) /* tiles 2-3 Plane 2*/ - ROM_LOAD( "9.84490.3b", 0x10000, 0x4000, CRC(e525207d) SHA1(1947f159189b3a53f1251d8653b6e7c65c91fc3c) ) /* tiles 0-1 Plane 3*/ - ROM_LOAD( "8.84490.1b", 0x14000, 0x4000, CRC(2d77e9b2) SHA1(944da1ce29a18bf0fc8deff78bceacba0bf23a07) ) /* tiles 2-3 Plane 3*/ - - ROM_REGION( 0x20000, "gfx3", ROMREGION_ERASEFF ) - ROM_LOAD( "19.84472.4n", 0x00000, 0x4000, CRC(4613afdc) SHA1(13e5a38a134bd7cfa16c63a18fa332c6d66b9345) ) /* sprites 0 Plane 1-2 */ - ROM_LOAD( "18.84472.3n", 0x04000, 0x4000, CRC(06d7e5ca) SHA1(9e06012bcd82f98fad43de666ef9a75979d940ab) ) /* sprites 1 Plane 1-2 */ - ROM_LOAD( "17.84472.1n", 0x08000, 0x4000, CRC(bc1fe02d) SHA1(e3a1421d465b87148ffa94f5673b2307f0246afe) ) /* sprites 2 Plane 1-2 */ - ROM_LOAD( "16.84472.4l", 0x10000, 0x4000, CRC(608d68d5) SHA1(af207f9ee2f93a0cf9cf25cfe72b0fdfe55481b8) ) /* sprites 0 Plane 3-4 */ - ROM_LOAD( "15.84490.3l", 0x14000, 0x4000, CRC(e80c3fca) SHA1(cb641c25bb04b970b2cbeca41adb792bbe142fb5) ) /* sprites 1 Plane 3-4 */ - ROM_LOAD( "14.84490.1l", 0x18000, 0x4000, CRC(7780a925) SHA1(3f129ca6d695548b659955fe538584bd9ac2ff17) ) /* sprites 2 Plane 3-4 */ + ROM_REGION( 0x18000, "tiles", 0 ) + ROM_LOAD( "13.84490.3e", 0x00000, 0x4000, CRC(ddd56fa9) SHA1(f9d77eee5e2738b7e83ba02fcc55dd480391479f) ) // 0-1 Plane 1 + ROM_LOAD( "12.84490.1e", 0x04000, 0x4000, CRC(7302529d) SHA1(8434c994cc55d2586641f3b90b6b15fd65dfb67c) ) // 2-3 Plane 1 + ROM_LOAD( "11.84490.3c", 0x08000, 0x4000, CRC(20035bda) SHA1(bbb1fba0eb19471f66d29526fa8423ccb047bd63) ) // 0-1 Plane 2 + ROM_LOAD( "10.84490.1c", 0x0c000, 0x4000, CRC(f12ba271) SHA1(1c42fa02cb27b35d10c3f7f036005e747f9f6b79) ) // 2-3 Plane 2 + ROM_LOAD( "9.84490.3b", 0x10000, 0x4000, CRC(e525207d) SHA1(1947f159189b3a53f1251d8653b6e7c65c91fc3c) ) // 0-1 Plane 3 + ROM_LOAD( "8.84490.1b", 0x14000, 0x4000, CRC(2d77e9b2) SHA1(944da1ce29a18bf0fc8deff78bceacba0bf23a07) ) // 2-3 Plane 3 + + ROM_REGION( 0x20000, "sprites", ROMREGION_ERASEFF ) + ROM_LOAD( "19.84472.4n", 0x00000, 0x4000, CRC(4613afdc) SHA1(13e5a38a134bd7cfa16c63a18fa332c6d66b9345) ) // sprites 0 Plane 1-2 + ROM_LOAD( "18.84472.3n", 0x04000, 0x4000, CRC(06d7e5ca) SHA1(9e06012bcd82f98fad43de666ef9a75979d940ab) ) // sprites 1 Plane 1-2 + ROM_LOAD( "17.84472.1n", 0x08000, 0x4000, CRC(bc1fe02d) SHA1(e3a1421d465b87148ffa94f5673b2307f0246afe) ) // sprites 2 Plane 1-2 + ROM_LOAD( "16.84472.4l", 0x10000, 0x4000, CRC(608d68d5) SHA1(af207f9ee2f93a0cf9cf25cfe72b0fdfe55481b8) ) // sprites 0 Plane 3-4 + ROM_LOAD( "15.84490.3l", 0x14000, 0x4000, CRC(e80c3fca) SHA1(cb641c25bb04b970b2cbeca41adb792bbe142fb5) ) // sprites 1 Plane 3-4 + ROM_LOAD( "14.84490.1l", 0x18000, 0x4000, CRC(7780a925) SHA1(3f129ca6d695548b659955fe538584bd9ac2ff17) ) // sprites 2 Plane 3-4 ROM_END ROM_START( gngprot ) @@ -564,24 +765,24 @@ ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "gg14h.bin", 0x0000, 0x8000, CRC(55cfb196) SHA1(df9cdbb24c26bca226d7274225725d62ea854c7a) ) - ROM_REGION( 0x04000, "gfx1", 0 ) - ROM_LOAD( "gg11e.bin", 0x00000, 0x4000, CRC(ccea9365) SHA1(bb567529fa376afc0a5afd331dcecef4f61cc8a3) ) /* characters */ + ROM_REGION( 0x04000, "chars", 0 ) + ROM_LOAD( "gg11e.bin", 0x00000, 0x4000, CRC(ccea9365) SHA1(bb567529fa376afc0a5afd331dcecef4f61cc8a3) ) - ROM_REGION( 0x18000, "gfx2", 0 ) - ROM_LOAD( "gg3e.bin", 0x00000, 0x4000, CRC(68db22c8) SHA1(ada859bfa60d9563a8a86b1b6526f626b932981c) ) /* tiles 0-1 Plane 1*/ - ROM_LOAD( "gg1e.bin", 0x04000, 0x4000, CRC(dad8dd2f) SHA1(30a6dd2f6b26acaab0a003f5099a2fcb46644d45) ) /* tiles 2-3 Plane 1*/ - ROM_LOAD( "gg3c.bin", 0x08000, 0x4000, CRC(7a158323) SHA1(183f33f214b4c04e9130cbe2c24e08b5303bb2de) ) /* tiles 0-1 Plane 2*/ - ROM_LOAD( "gg1c.bin", 0x0c000, 0x4000, CRC(7314d095) SHA1(1288eaf0d82ac65a1bb94e68114b4b2f84910901) ) /* tiles 2-3 Plane 2*/ - ROM_LOAD( "gg3b.bin", 0x10000, 0x4000, CRC(03a96d9b) SHA1(5d74e156b0cd1b54d7bd61e1664834f768d5b9f8) ) /* tiles 0-1 Plane 3*/ - ROM_LOAD( "gg1b.bin", 0x14000, 0x4000, CRC(7b9899bc) SHA1(be9b7b18542f38c8fb8b075760995acecace79ad) ) /* tiles 2-3 Plane 3*/ - - ROM_REGION( 0x20000, "gfx3", ROMREGION_ERASEFF ) - ROM_LOAD( "gg4l.bin", 0x00000, 0x4000, CRC(49cf81b4) SHA1(b87aba71446884f9926ced28716876ad701b183f) ) /* sprites 0 Plane 1-2 */ - ROM_LOAD( "gg3l.bin", 0x04000, 0x4000, CRC(e61437b1) SHA1(7043ac80ee40057839bf7ee7af62961d9ff3d50b) ) /* sprites 1 Plane 1-2 */ - ROM_LOAD( "gg1l.bin", 0x08000, 0x4000, CRC(bc1fe02d) SHA1(e3a1421d465b87148ffa94f5673b2307f0246afe) ) /* sprites 2 Plane 1-2 */ - ROM_LOAD( "gg4n.bin", 0x10000, 0x4000, CRC(d5aff5a7) SHA1(b75b271c7d38ed9689bff7a3bc9a67a0aae9ed8b) ) /* sprites 0 Plane 3-4 */ - ROM_LOAD( "gg3n.bin", 0x14000, 0x4000, CRC(d589caeb) SHA1(f787557dc083f765aec3d64896ef6cdf5e8d54cc) ) /* sprites 1 Plane 3-4 */ - ROM_LOAD( "gg1n.bin", 0x18000, 0x4000, CRC(7780a925) SHA1(3f129ca6d695548b659955fe538584bd9ac2ff17) ) /* sprites 2 Plane 3-4 */ + ROM_REGION( 0x18000, "tiles", 0 ) + ROM_LOAD( "gg3e.bin", 0x00000, 0x4000, CRC(68db22c8) SHA1(ada859bfa60d9563a8a86b1b6526f626b932981c) ) // 0-1 Plane 1 + ROM_LOAD( "gg1e.bin", 0x04000, 0x4000, CRC(dad8dd2f) SHA1(30a6dd2f6b26acaab0a003f5099a2fcb46644d45) ) // 2-3 Plane 1 + ROM_LOAD( "gg3c.bin", 0x08000, 0x4000, CRC(7a158323) SHA1(183f33f214b4c04e9130cbe2c24e08b5303bb2de) ) // 0-1 Plane 2 + ROM_LOAD( "gg1c.bin", 0x0c000, 0x4000, CRC(7314d095) SHA1(1288eaf0d82ac65a1bb94e68114b4b2f84910901) ) // 2-3 Plane 2 + ROM_LOAD( "gg3b.bin", 0x10000, 0x4000, CRC(03a96d9b) SHA1(5d74e156b0cd1b54d7bd61e1664834f768d5b9f8) ) // 0-1 Plane 3 + ROM_LOAD( "gg1b.bin", 0x14000, 0x4000, CRC(7b9899bc) SHA1(be9b7b18542f38c8fb8b075760995acecace79ad) ) // 2-3 Plane 3 + + ROM_REGION( 0x20000, "sprites", ROMREGION_ERASEFF ) + ROM_LOAD( "gg4l.bin", 0x00000, 0x4000, CRC(49cf81b4) SHA1(b87aba71446884f9926ced28716876ad701b183f) ) // sprites 0 Plane 1-2 + ROM_LOAD( "gg3l.bin", 0x04000, 0x4000, CRC(e61437b1) SHA1(7043ac80ee40057839bf7ee7af62961d9ff3d50b) ) // sprites 1 Plane 1-2 + ROM_LOAD( "gg1l.bin", 0x08000, 0x4000, CRC(bc1fe02d) SHA1(e3a1421d465b87148ffa94f5673b2307f0246afe) ) // sprites 2 Plane 1-2 + ROM_LOAD( "gg4n.bin", 0x10000, 0x4000, CRC(d5aff5a7) SHA1(b75b271c7d38ed9689bff7a3bc9a67a0aae9ed8b) ) // sprites 0 Plane 3-4 + ROM_LOAD( "gg3n.bin", 0x14000, 0x4000, CRC(d589caeb) SHA1(f787557dc083f765aec3d64896ef6cdf5e8d54cc) ) // sprites 1 Plane 3-4 + ROM_LOAD( "gg1n.bin", 0x18000, 0x4000, CRC(7780a925) SHA1(3f129ca6d695548b659955fe538584bd9ac2ff17) ) // sprites 2 Plane 3-4 ROM_END @@ -594,28 +795,28 @@ ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "gg2.bin", 0x0000, 0x8000, CRC(615f5b6f) SHA1(7ef9ec5c2072e21c787a6bbf700033f50c759c1d) ) - ROM_REGION( 0x04000, "gfx1", 0 ) - ROM_LOAD( "gg1.bin", 0x00000, 0x4000, CRC(ecfccf07) SHA1(0a1518e19a2e0a4cc3dde4b9568202ea911b5ece) ) /* characters */ + ROM_REGION( 0x04000, "chars", 0 ) + ROM_LOAD( "gg1.bin", 0x00000, 0x4000, CRC(ecfccf07) SHA1(0a1518e19a2e0a4cc3dde4b9568202ea911b5ece) ) - ROM_REGION( 0x18000, "gfx2", 0 ) - ROM_LOAD( "gg11.bin", 0x00000, 0x4000, CRC(ddd56fa9) SHA1(f9d77eee5e2738b7e83ba02fcc55dd480391479f) ) /* tiles 0-1 Plane 1*/ - ROM_LOAD( "gg10.bin", 0x04000, 0x4000, CRC(7302529d) SHA1(8434c994cc55d2586641f3b90b6b15fd65dfb67c) ) /* tiles 2-3 Plane 1*/ - ROM_LOAD( "gg9.bin", 0x08000, 0x4000, CRC(20035bda) SHA1(bbb1fba0eb19471f66d29526fa8423ccb047bd63) ) /* tiles 0-1 Plane 2*/ - ROM_LOAD( "gg8.bin", 0x0c000, 0x4000, CRC(f12ba271) SHA1(1c42fa02cb27b35d10c3f7f036005e747f9f6b79) ) /* tiles 2-3 Plane 2*/ - ROM_LOAD( "gg7.bin", 0x10000, 0x4000, CRC(e525207d) SHA1(1947f159189b3a53f1251d8653b6e7c65c91fc3c) ) /* tiles 0-1 Plane 3*/ - ROM_LOAD( "gg6.bin", 0x14000, 0x4000, CRC(2d77e9b2) SHA1(944da1ce29a18bf0fc8deff78bceacba0bf23a07) ) /* tiles 2-3 Plane 3*/ - - ROM_REGION( 0x20000, "gfx3", ROMREGION_ERASEFF ) - ROM_LOAD( "gg17.bin", 0x00000, 0x4000, CRC(93e50a8f) SHA1(42d367f57bb2fdf60a0445ac1533da99cfeaa617) ) /* sprites 0 Plane 1-2 */ - ROM_LOAD( "gg16.bin", 0x04000, 0x4000, CRC(06d7e5ca) SHA1(9e06012bcd82f98fad43de666ef9a75979d940ab) ) /* sprites 1 Plane 1-2 */ - ROM_LOAD( "gg15.bin", 0x08000, 0x4000, CRC(bc1fe02d) SHA1(e3a1421d465b87148ffa94f5673b2307f0246afe) ) /* sprites 2 Plane 1-2 */ - ROM_LOAD( "gg14.bin", 0x10000, 0x4000, CRC(6aaf12f9) SHA1(207a7407288182a4f3eddaea634c6a6452131182) ) /* sprites 0 Plane 3-4 */ - ROM_LOAD( "gg13.bin", 0x14000, 0x4000, CRC(e80c3fca) SHA1(cb641c25bb04b970b2cbeca41adb792bbe142fb5) ) /* sprites 1 Plane 3-4 */ - ROM_LOAD( "gg12.bin", 0x18000, 0x4000, CRC(7780a925) SHA1(3f129ca6d695548b659955fe538584bd9ac2ff17) ) /* sprites 2 Plane 3-4 */ + ROM_REGION( 0x18000, "tiles", 0 ) + ROM_LOAD( "gg11.bin", 0x00000, 0x4000, CRC(ddd56fa9) SHA1(f9d77eee5e2738b7e83ba02fcc55dd480391479f) ) // 0-1 Plane 1 + ROM_LOAD( "gg10.bin", 0x04000, 0x4000, CRC(7302529d) SHA1(8434c994cc55d2586641f3b90b6b15fd65dfb67c) ) // 2-3 Plane 1 + ROM_LOAD( "gg9.bin", 0x08000, 0x4000, CRC(20035bda) SHA1(bbb1fba0eb19471f66d29526fa8423ccb047bd63) ) // 0-1 Plane 2 + ROM_LOAD( "gg8.bin", 0x0c000, 0x4000, CRC(f12ba271) SHA1(1c42fa02cb27b35d10c3f7f036005e747f9f6b79) ) // 2-3 Plane 2 + ROM_LOAD( "gg7.bin", 0x10000, 0x4000, CRC(e525207d) SHA1(1947f159189b3a53f1251d8653b6e7c65c91fc3c) ) // 0-1 Plane 3 + ROM_LOAD( "gg6.bin", 0x14000, 0x4000, CRC(2d77e9b2) SHA1(944da1ce29a18bf0fc8deff78bceacba0bf23a07) ) // 2-3 Plane 3 + + ROM_REGION( 0x20000, "sprites", ROMREGION_ERASEFF ) + ROM_LOAD( "gg17.bin", 0x00000, 0x4000, CRC(93e50a8f) SHA1(42d367f57bb2fdf60a0445ac1533da99cfeaa617) ) // sprites 0 Plane 1-2 + ROM_LOAD( "gg16.bin", 0x04000, 0x4000, CRC(06d7e5ca) SHA1(9e06012bcd82f98fad43de666ef9a75979d940ab) ) // sprites 1 Plane 1-2 + ROM_LOAD( "gg15.bin", 0x08000, 0x4000, CRC(bc1fe02d) SHA1(e3a1421d465b87148ffa94f5673b2307f0246afe) ) // sprites 2 Plane 1-2 + ROM_LOAD( "gg14.bin", 0x10000, 0x4000, CRC(6aaf12f9) SHA1(207a7407288182a4f3eddaea634c6a6452131182) ) // sprites 0 Plane 3-4 + ROM_LOAD( "gg13.bin", 0x14000, 0x4000, CRC(e80c3fca) SHA1(cb641c25bb04b970b2cbeca41adb792bbe142fb5) ) // sprites 1 Plane 3-4 + ROM_LOAD( "gg12.bin", 0x18000, 0x4000, CRC(7780a925) SHA1(3f129ca6d695548b659955fe538584bd9ac2ff17) ) // sprites 2 Plane 3-4 ROM_REGION( 0x0200, "proms", 0 ) - ROM_LOAD( "tbp24s10.14k", 0x0000, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) /* video timing (not used) */ - ROM_LOAD( "63s141.2e", 0x0100, 0x0100, CRC(4a1285a4) SHA1(5018c3950b675af58db499e2883ecbc55419b491) ) /* priority (not used) */ + ROM_LOAD( "tbp24s10.14k", 0x0000, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) // video timing (not used) + ROM_LOAD( "63s141.2e", 0x0100, 0x0100, CRC(4a1285a4) SHA1(5018c3950b675af58db499e2883ecbc55419b491) ) // priority (not used) ROM_REGION( 0x0100, "plds", 0 ) ROM_LOAD( "gg-pal10l8.bin", 0x0000, 0x002c, CRC(87f1b7e0) SHA1(b719c3be7bd4a02660bb0887f752e9769cbd37d2) ) @@ -630,28 +831,28 @@ ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "gg2.bin", 0x0000, 0x8000, CRC(615f5b6f) SHA1(7ef9ec5c2072e21c787a6bbf700033f50c759c1d) ) - ROM_REGION( 0x04000, "gfx1", 0 ) - ROM_LOAD( "gg1.bin", 0x00000, 0x4000, CRC(ecfccf07) SHA1(0a1518e19a2e0a4cc3dde4b9568202ea911b5ece) ) /* characters */ + ROM_REGION( 0x04000, "chars", 0 ) + ROM_LOAD( "gg1.bin", 0x00000, 0x4000, CRC(ecfccf07) SHA1(0a1518e19a2e0a4cc3dde4b9568202ea911b5ece) ) - ROM_REGION( 0x18000, "gfx2", 0 ) - ROM_LOAD( "gg11.bin", 0x00000, 0x4000, CRC(ddd56fa9) SHA1(f9d77eee5e2738b7e83ba02fcc55dd480391479f) ) /* tiles 0-1 Plane 1*/ - ROM_LOAD( "gg10.bin", 0x04000, 0x4000, CRC(7302529d) SHA1(8434c994cc55d2586641f3b90b6b15fd65dfb67c) ) /* tiles 2-3 Plane 1*/ - ROM_LOAD( "gg9.bin", 0x08000, 0x4000, CRC(20035bda) SHA1(bbb1fba0eb19471f66d29526fa8423ccb047bd63) ) /* tiles 0-1 Plane 2*/ - ROM_LOAD( "gg8.bin", 0x0c000, 0x4000, CRC(f12ba271) SHA1(1c42fa02cb27b35d10c3f7f036005e747f9f6b79) ) /* tiles 2-3 Plane 2*/ - ROM_LOAD( "gg7.bin", 0x10000, 0x4000, CRC(e525207d) SHA1(1947f159189b3a53f1251d8653b6e7c65c91fc3c) ) /* tiles 0-1 Plane 3*/ - ROM_LOAD( "gg6.bin", 0x14000, 0x4000, CRC(2d77e9b2) SHA1(944da1ce29a18bf0fc8deff78bceacba0bf23a07) ) /* tiles 2-3 Plane 3*/ - - ROM_REGION( 0x20000, "gfx3", ROMREGION_ERASEFF ) - ROM_LOAD( "gg17.bin", 0x00000, 0x4000, CRC(93e50a8f) SHA1(42d367f57bb2fdf60a0445ac1533da99cfeaa617) ) /* sprites 0 Plane 1-2 */ - ROM_LOAD( "gg16.bin", 0x04000, 0x4000, CRC(06d7e5ca) SHA1(9e06012bcd82f98fad43de666ef9a75979d940ab) ) /* sprites 1 Plane 1-2 */ - ROM_LOAD( "gg15.bin", 0x08000, 0x4000, CRC(bc1fe02d) SHA1(e3a1421d465b87148ffa94f5673b2307f0246afe) ) /* sprites 2 Plane 1-2 */ - ROM_LOAD( "gg14.bin", 0x10000, 0x4000, CRC(6aaf12f9) SHA1(207a7407288182a4f3eddaea634c6a6452131182) ) /* sprites 0 Plane 3-4 */ - ROM_LOAD( "gg13.bin", 0x14000, 0x4000, CRC(e80c3fca) SHA1(cb641c25bb04b970b2cbeca41adb792bbe142fb5) ) /* sprites 1 Plane 3-4 */ - ROM_LOAD( "gg12.bin", 0x18000, 0x4000, CRC(7780a925) SHA1(3f129ca6d695548b659955fe538584bd9ac2ff17) ) /* sprites 2 Plane 3-4 */ + ROM_REGION( 0x18000, "tiles", 0 ) + ROM_LOAD( "gg11.bin", 0x00000, 0x4000, CRC(ddd56fa9) SHA1(f9d77eee5e2738b7e83ba02fcc55dd480391479f) ) // 0-1 Plane 1 + ROM_LOAD( "gg10.bin", 0x04000, 0x4000, CRC(7302529d) SHA1(8434c994cc55d2586641f3b90b6b15fd65dfb67c) ) // 2-3 Plane 1 + ROM_LOAD( "gg9.bin", 0x08000, 0x4000, CRC(20035bda) SHA1(bbb1fba0eb19471f66d29526fa8423ccb047bd63) ) // 0-1 Plane 2 + ROM_LOAD( "gg8.bin", 0x0c000, 0x4000, CRC(f12ba271) SHA1(1c42fa02cb27b35d10c3f7f036005e747f9f6b79) ) // 2-3 Plane 2 + ROM_LOAD( "gg7.bin", 0x10000, 0x4000, CRC(e525207d) SHA1(1947f159189b3a53f1251d8653b6e7c65c91fc3c) ) // 0-1 Plane 3 + ROM_LOAD( "gg6.bin", 0x14000, 0x4000, CRC(2d77e9b2) SHA1(944da1ce29a18bf0fc8deff78bceacba0bf23a07) ) // 2-3 Plane 3 + + ROM_REGION( 0x20000, "sprites", ROMREGION_ERASEFF ) + ROM_LOAD( "gg17.bin", 0x00000, 0x4000, CRC(93e50a8f) SHA1(42d367f57bb2fdf60a0445ac1533da99cfeaa617) ) // sprites 0 Plane 1-2 + ROM_LOAD( "gg16.bin", 0x04000, 0x4000, CRC(06d7e5ca) SHA1(9e06012bcd82f98fad43de666ef9a75979d940ab) ) // sprites 1 Plane 1-2 + ROM_LOAD( "gg15.bin", 0x08000, 0x4000, CRC(bc1fe02d) SHA1(e3a1421d465b87148ffa94f5673b2307f0246afe) ) // sprites 2 Plane 1-2 + ROM_LOAD( "gg14.bin", 0x10000, 0x4000, CRC(6aaf12f9) SHA1(207a7407288182a4f3eddaea634c6a6452131182) ) // sprites 0 Plane 3-4 + ROM_LOAD( "gg13.bin", 0x14000, 0x4000, CRC(e80c3fca) SHA1(cb641c25bb04b970b2cbeca41adb792bbe142fb5) ) // sprites 1 Plane 3-4 + ROM_LOAD( "gg12.bin", 0x18000, 0x4000, CRC(7780a925) SHA1(3f129ca6d695548b659955fe538584bd9ac2ff17) ) // sprites 2 Plane 3-4 ROM_REGION( 0x0200, "proms", 0 ) - ROM_LOAD( "tbp24s10.14k", 0x0000, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) /* video timing (not used) */ - ROM_LOAD( "63s141.2e", 0x0100, 0x0100, CRC(4a1285a4) SHA1(5018c3950b675af58db499e2883ecbc55419b491) ) /* priority (not used) */ + ROM_LOAD( "tbp24s10.14k", 0x0000, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) // video timing (not used) + ROM_LOAD( "63s141.2e", 0x0100, 0x0100, CRC(4a1285a4) SHA1(5018c3950b675af58db499e2883ecbc55419b491) ) // priority (not used) ROM_END @@ -664,166 +865,167 @@ ROM_START( gngt ) ROM_REGION( 0x18000, "maincpu", 0 ) - ROM_LOAD( "mmt04d.10n", 0x04000, 0x4000, CRC(652406f6) SHA1(3b2bafd31f670ea26c568c48f3bd00597e5a2ed6) ) /* 4000-5fff is page 4 */ + ROM_LOAD( "mmt04d.10n", 0x04000, 0x4000, CRC(652406f6) SHA1(3b2bafd31f670ea26c568c48f3bd00597e5a2ed6) ) // 4000-5fff is page 4 ROM_LOAD( "mmt03d.8n", 0x08000, 0x8000, CRC(fb040b42) SHA1(c1c58943bd20c6a2520b39fae90067769ec97ed6) ) - ROM_LOAD( "mmt05d.13n", 0x10000, 0x8000, CRC(8f7cff61) SHA1(1875f254a7737e1fbf6770ee4a322d675d043a44) ) /* page 0, 1, 2, 3 */ + ROM_LOAD( "mmt05d.13n", 0x10000, 0x8000, CRC(8f7cff61) SHA1(1875f254a7737e1fbf6770ee4a322d675d043a44) ) // page 0, 1, 2, 3 ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "mm02.14h", 0x0000, 0x8000, CRC(615f5b6f) SHA1(7ef9ec5c2072e21c787a6bbf700033f50c759c1d) ) - ROM_REGION( 0x04000, "gfx1", 0 ) - ROM_LOAD( "mm01.11e", 0x00000, 0x4000, CRC(ecfccf07) SHA1(0a1518e19a2e0a4cc3dde4b9568202ea911b5ece) ) /* characters */ + ROM_REGION( 0x04000, "chars", 0 ) + ROM_LOAD( "mm01.11e", 0x00000, 0x4000, CRC(ecfccf07) SHA1(0a1518e19a2e0a4cc3dde4b9568202ea911b5ece) ) - ROM_REGION( 0x18000, "gfx2", 0 ) - ROM_LOAD( "mm11.3e", 0x00000, 0x4000, CRC(ddd56fa9) SHA1(f9d77eee5e2738b7e83ba02fcc55dd480391479f) ) /* tiles 0-1 Plane 1*/ - ROM_LOAD( "mm10.1e", 0x04000, 0x4000, CRC(7302529d) SHA1(8434c994cc55d2586641f3b90b6b15fd65dfb67c) ) /* tiles 2-3 Plane 1*/ - ROM_LOAD( "mm09.3c", 0x08000, 0x4000, CRC(20035bda) SHA1(bbb1fba0eb19471f66d29526fa8423ccb047bd63) ) /* tiles 0-1 Plane 2*/ - ROM_LOAD( "mm08.1c", 0x0c000, 0x4000, CRC(f12ba271) SHA1(1c42fa02cb27b35d10c3f7f036005e747f9f6b79) ) /* tiles 2-3 Plane 2*/ - ROM_LOAD( "mm07.3b", 0x10000, 0x4000, CRC(e525207d) SHA1(1947f159189b3a53f1251d8653b6e7c65c91fc3c) ) /* tiles 0-1 Plane 3*/ - ROM_LOAD( "mm06.1b", 0x14000, 0x4000, CRC(2d77e9b2) SHA1(944da1ce29a18bf0fc8deff78bceacba0bf23a07) ) /* tiles 2-3 Plane 3*/ - - ROM_REGION( 0x20000, "gfx3", ROMREGION_ERASEFF ) - ROM_LOAD( "mm17.4n", 0x00000, 0x4000, CRC(93e50a8f) SHA1(42d367f57bb2fdf60a0445ac1533da99cfeaa617) ) /* sprites 0 Plane 1-2 */ - ROM_LOAD( "mm16.3n", 0x04000, 0x4000, CRC(06d7e5ca) SHA1(9e06012bcd82f98fad43de666ef9a75979d940ab) ) /* sprites 1 Plane 1-2 */ - ROM_LOAD( "mm15.1n", 0x08000, 0x4000, CRC(bc1fe02d) SHA1(e3a1421d465b87148ffa94f5673b2307f0246afe) ) /* sprites 2 Plane 1-2 */ - ROM_LOAD( "mm14.4l", 0x10000, 0x4000, CRC(6aaf12f9) SHA1(207a7407288182a4f3eddaea634c6a6452131182) ) /* sprites 0 Plane 3-4 */ - ROM_LOAD( "mm13.3l", 0x14000, 0x4000, CRC(e80c3fca) SHA1(cb641c25bb04b970b2cbeca41adb792bbe142fb5) ) /* sprites 1 Plane 3-4 */ - ROM_LOAD( "mm12.1l", 0x18000, 0x4000, CRC(7780a925) SHA1(3f129ca6d695548b659955fe538584bd9ac2ff17) ) /* sprites 2 Plane 3-4 */ + ROM_REGION( 0x18000, "tiles", 0 ) + ROM_LOAD( "mm11.3e", 0x00000, 0x4000, CRC(ddd56fa9) SHA1(f9d77eee5e2738b7e83ba02fcc55dd480391479f) ) // 0-1 Plane 1 + ROM_LOAD( "mm10.1e", 0x04000, 0x4000, CRC(7302529d) SHA1(8434c994cc55d2586641f3b90b6b15fd65dfb67c) ) // 2-3 Plane 1 + ROM_LOAD( "mm09.3c", 0x08000, 0x4000, CRC(20035bda) SHA1(bbb1fba0eb19471f66d29526fa8423ccb047bd63) ) // 0-1 Plane 2 + ROM_LOAD( "mm08.1c", 0x0c000, 0x4000, CRC(f12ba271) SHA1(1c42fa02cb27b35d10c3f7f036005e747f9f6b79) ) // 2-3 Plane 2 + ROM_LOAD( "mm07.3b", 0x10000, 0x4000, CRC(e525207d) SHA1(1947f159189b3a53f1251d8653b6e7c65c91fc3c) ) // 0-1 Plane 3 + ROM_LOAD( "mm06.1b", 0x14000, 0x4000, CRC(2d77e9b2) SHA1(944da1ce29a18bf0fc8deff78bceacba0bf23a07) ) // 2-3 Plane 3 + + ROM_REGION( 0x20000, "sprites", ROMREGION_ERASEFF ) + ROM_LOAD( "mm17.4n", 0x00000, 0x4000, CRC(93e50a8f) SHA1(42d367f57bb2fdf60a0445ac1533da99cfeaa617) ) // sprites 0 Plane 1-2 + ROM_LOAD( "mm16.3n", 0x04000, 0x4000, CRC(06d7e5ca) SHA1(9e06012bcd82f98fad43de666ef9a75979d940ab) ) // sprites 1 Plane 1-2 + ROM_LOAD( "mm15.1n", 0x08000, 0x4000, CRC(bc1fe02d) SHA1(e3a1421d465b87148ffa94f5673b2307f0246afe) ) // sprites 2 Plane 1-2 + ROM_LOAD( "mm14.4l", 0x10000, 0x4000, CRC(6aaf12f9) SHA1(207a7407288182a4f3eddaea634c6a6452131182) ) // sprites 0 Plane 3-4 + ROM_LOAD( "mm13.3l", 0x14000, 0x4000, CRC(e80c3fca) SHA1(cb641c25bb04b970b2cbeca41adb792bbe142fb5) ) // sprites 1 Plane 3-4 + ROM_LOAD( "mm12.1l", 0x18000, 0x4000, CRC(7780a925) SHA1(3f129ca6d695548b659955fe538584bd9ac2ff17) ) // sprites 2 Plane 3-4 ROM_REGION( 0x0200, "proms", 0 ) - ROM_LOAD( "m-02.14k", 0x0000, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) /* 63s141, video timing (not used) */ - ROM_LOAD( "m-01.2e", 0x0100, 0x0100, CRC(4a1285a4) SHA1(5018c3950b675af58db499e2883ecbc55419b491) ) /* 63s141, priority (not used) */ + ROM_LOAD( "m-02.14k", 0x0000, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) // 63s141, video timing (not used) + ROM_LOAD( "m-01.2e", 0x0100, 0x0100, CRC(4a1285a4) SHA1(5018c3950b675af58db499e2883ecbc55419b491) ) // 63s141, priority (not used) ROM_END ROM_START( makaimur ) ROM_REGION( 0x18000, "maincpu", 0 ) - ROM_LOAD( "10n.rom", 0x04000, 0x4000, CRC(81e567e0) SHA1(2a917e562686e782ea7d034a54e9728695a19258) ) /* 4000-5fff is page 4 */ + ROM_LOAD( "10n.rom", 0x04000, 0x4000, CRC(81e567e0) SHA1(2a917e562686e782ea7d034a54e9728695a19258) ) // 4000-5fff is page 4 ROM_LOAD( "8n.rom", 0x08000, 0x8000, CRC(9612d66c) SHA1(64c458d6d87b9c339488c9f0c89da2c796fcb759) ) - ROM_LOAD( "12n.rom", 0x10000, 0x8000, CRC(65a6a97b) SHA1(79de931ae183d8044cb6d9024b475196c679c86c) ) /* page 0, 1, 2, 3 */ + ROM_LOAD( "12n.rom", 0x10000, 0x8000, CRC(65a6a97b) SHA1(79de931ae183d8044cb6d9024b475196c679c86c) ) // page 0, 1, 2, 3 ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "gg2.bin", 0x0000, 0x8000, CRC(615f5b6f) SHA1(7ef9ec5c2072e21c787a6bbf700033f50c759c1d) ) - ROM_REGION( 0x04000, "gfx1", 0 ) - ROM_LOAD( "gg1.bin", 0x00000, 0x4000, CRC(ecfccf07) SHA1(0a1518e19a2e0a4cc3dde4b9568202ea911b5ece) ) /* characters */ + ROM_REGION( 0x04000, "chars", 0 ) + ROM_LOAD( "gg1.bin", 0x00000, 0x4000, CRC(ecfccf07) SHA1(0a1518e19a2e0a4cc3dde4b9568202ea911b5ece) ) - ROM_REGION( 0x18000, "gfx2", 0 ) - ROM_LOAD( "gg11.bin", 0x00000, 0x4000, CRC(ddd56fa9) SHA1(f9d77eee5e2738b7e83ba02fcc55dd480391479f) ) /* tiles 0-1 Plane 1*/ - ROM_LOAD( "gg10.bin", 0x04000, 0x4000, CRC(7302529d) SHA1(8434c994cc55d2586641f3b90b6b15fd65dfb67c) ) /* tiles 2-3 Plane 1*/ - ROM_LOAD( "gg9.bin", 0x08000, 0x4000, CRC(20035bda) SHA1(bbb1fba0eb19471f66d29526fa8423ccb047bd63) ) /* tiles 0-1 Plane 2*/ - ROM_LOAD( "gg8.bin", 0x0c000, 0x4000, CRC(f12ba271) SHA1(1c42fa02cb27b35d10c3f7f036005e747f9f6b79) ) /* tiles 2-3 Plane 2*/ - ROM_LOAD( "gg7.bin", 0x10000, 0x4000, CRC(e525207d) SHA1(1947f159189b3a53f1251d8653b6e7c65c91fc3c) ) /* tiles 0-1 Plane 3*/ - ROM_LOAD( "gg6.bin", 0x14000, 0x4000, CRC(2d77e9b2) SHA1(944da1ce29a18bf0fc8deff78bceacba0bf23a07) ) /* tiles 2-3 Plane 3*/ - - ROM_REGION( 0x20000, "gfx3", ROMREGION_ERASEFF ) - ROM_LOAD( "gng13.n4", 0x00000, 0x4000, CRC(4613afdc) SHA1(13e5a38a134bd7cfa16c63a18fa332c6d66b9345) ) /* sprites 0 Plane 1-2 */ - ROM_LOAD( "gg16.bin", 0x04000, 0x4000, CRC(06d7e5ca) SHA1(9e06012bcd82f98fad43de666ef9a75979d940ab) ) /* sprites 1 Plane 1-2 */ - ROM_LOAD( "gg15.bin", 0x08000, 0x4000, CRC(bc1fe02d) SHA1(e3a1421d465b87148ffa94f5673b2307f0246afe) ) /* sprites 2 Plane 1-2 */ - ROM_LOAD( "gng16.l4", 0x10000, 0x4000, CRC(608d68d5) SHA1(af207f9ee2f93a0cf9cf25cfe72b0fdfe55481b8) ) /* sprites 0 Plane 3-4 */ - ROM_LOAD( "gg13.bin", 0x14000, 0x4000, CRC(e80c3fca) SHA1(cb641c25bb04b970b2cbeca41adb792bbe142fb5) ) /* sprites 1 Plane 3-4 */ - ROM_LOAD( "gg12.bin", 0x18000, 0x4000, CRC(7780a925) SHA1(3f129ca6d695548b659955fe538584bd9ac2ff17) ) /* sprites 2 Plane 3-4 */ + ROM_REGION( 0x18000, "tiles", 0 ) + ROM_LOAD( "gg11.bin", 0x00000, 0x4000, CRC(ddd56fa9) SHA1(f9d77eee5e2738b7e83ba02fcc55dd480391479f) ) // 0-1 Plane 1 + ROM_LOAD( "gg10.bin", 0x04000, 0x4000, CRC(7302529d) SHA1(8434c994cc55d2586641f3b90b6b15fd65dfb67c) ) // 2-3 Plane 1 + ROM_LOAD( "gg9.bin", 0x08000, 0x4000, CRC(20035bda) SHA1(bbb1fba0eb19471f66d29526fa8423ccb047bd63) ) // 0-1 Plane 2 + ROM_LOAD( "gg8.bin", 0x0c000, 0x4000, CRC(f12ba271) SHA1(1c42fa02cb27b35d10c3f7f036005e747f9f6b79) ) // 2-3 Plane 2 + ROM_LOAD( "gg7.bin", 0x10000, 0x4000, CRC(e525207d) SHA1(1947f159189b3a53f1251d8653b6e7c65c91fc3c) ) // 0-1 Plane 3 + ROM_LOAD( "gg6.bin", 0x14000, 0x4000, CRC(2d77e9b2) SHA1(944da1ce29a18bf0fc8deff78bceacba0bf23a07) ) // 2-3 Plane 3 + + ROM_REGION( 0x20000, "sprites", ROMREGION_ERASEFF ) + ROM_LOAD( "gng13.n4", 0x00000, 0x4000, CRC(4613afdc) SHA1(13e5a38a134bd7cfa16c63a18fa332c6d66b9345) ) // sprites 0 Plane 1-2 + ROM_LOAD( "gg16.bin", 0x04000, 0x4000, CRC(06d7e5ca) SHA1(9e06012bcd82f98fad43de666ef9a75979d940ab) ) // sprites 1 Plane 1-2 + ROM_LOAD( "gg15.bin", 0x08000, 0x4000, CRC(bc1fe02d) SHA1(e3a1421d465b87148ffa94f5673b2307f0246afe) ) // sprites 2 Plane 1-2 + ROM_LOAD( "gng16.l4", 0x10000, 0x4000, CRC(608d68d5) SHA1(af207f9ee2f93a0cf9cf25cfe72b0fdfe55481b8) ) // sprites 0 Plane 3-4 + ROM_LOAD( "gg13.bin", 0x14000, 0x4000, CRC(e80c3fca) SHA1(cb641c25bb04b970b2cbeca41adb792bbe142fb5) ) // sprites 1 Plane 3-4 + ROM_LOAD( "gg12.bin", 0x18000, 0x4000, CRC(7780a925) SHA1(3f129ca6d695548b659955fe538584bd9ac2ff17) ) // sprites 2 Plane 3-4 ROM_REGION( 0x0200, "proms", 0 ) - ROM_LOAD( "tbp24s10.14k", 0x0000, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) /* video timing (not used) */ - ROM_LOAD( "63s141.2e", 0x0100, 0x0100, CRC(4a1285a4) SHA1(5018c3950b675af58db499e2883ecbc55419b491) ) /* priority (not used) */ + ROM_LOAD( "tbp24s10.14k", 0x0000, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) // video timing (not used) + ROM_LOAD( "63s141.2e", 0x0100, 0x0100, CRC(4a1285a4) SHA1(5018c3950b675af58db499e2883ecbc55419b491) ) // priority (not used) ROM_END ROM_START( makaimurc ) ROM_REGION( 0x18000, "maincpu", 0 ) - ROM_LOAD( "mj04c.bin", 0x04000, 0x4000, CRC(1294edb1) SHA1(35d3b3ce4ee25d3cfa27097de0c9a2ab5e4892aa) ) /* 4000-5fff is page 4 */ + ROM_LOAD( "mj04c.bin", 0x04000, 0x4000, CRC(1294edb1) SHA1(35d3b3ce4ee25d3cfa27097de0c9a2ab5e4892aa) ) // 4000-5fff is page 4 ROM_LOAD( "mj03c.bin", 0x08000, 0x8000, CRC(d343332d) SHA1(3edf47ff2bd49b4451b737b6d3eb54256b489c81) ) - ROM_LOAD( "mj05c.bin", 0x10000, 0x8000, CRC(535342c2) SHA1(5f05a4965476f2db6fddec557d93d12ec1f9750c) ) /* page 0, 1, 2, 3 */ + ROM_LOAD( "mj05c.bin", 0x10000, 0x8000, CRC(535342c2) SHA1(5f05a4965476f2db6fddec557d93d12ec1f9750c) ) // page 0, 1, 2, 3 ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "gg2.bin", 0x0000, 0x8000, CRC(615f5b6f) SHA1(7ef9ec5c2072e21c787a6bbf700033f50c759c1d) ) - ROM_REGION( 0x04000, "gfx1", 0 ) - ROM_LOAD( "gg1.bin", 0x00000, 0x4000, CRC(ecfccf07) SHA1(0a1518e19a2e0a4cc3dde4b9568202ea911b5ece) ) /* characters */ + ROM_REGION( 0x04000, "chars", 0 ) + ROM_LOAD( "gg1.bin", 0x00000, 0x4000, CRC(ecfccf07) SHA1(0a1518e19a2e0a4cc3dde4b9568202ea911b5ece) ) - ROM_REGION( 0x18000, "gfx2", 0 ) - ROM_LOAD( "gg11.bin", 0x00000, 0x4000, CRC(ddd56fa9) SHA1(f9d77eee5e2738b7e83ba02fcc55dd480391479f) ) /* tiles 0-1 Plane 1*/ - ROM_LOAD( "gg10.bin", 0x04000, 0x4000, CRC(7302529d) SHA1(8434c994cc55d2586641f3b90b6b15fd65dfb67c) ) /* tiles 2-3 Plane 1*/ - ROM_LOAD( "gg9.bin", 0x08000, 0x4000, CRC(20035bda) SHA1(bbb1fba0eb19471f66d29526fa8423ccb047bd63) ) /* tiles 0-1 Plane 2*/ - ROM_LOAD( "gg8.bin", 0x0c000, 0x4000, CRC(f12ba271) SHA1(1c42fa02cb27b35d10c3f7f036005e747f9f6b79) ) /* tiles 2-3 Plane 2*/ - ROM_LOAD( "gg7.bin", 0x10000, 0x4000, CRC(e525207d) SHA1(1947f159189b3a53f1251d8653b6e7c65c91fc3c) ) /* tiles 0-1 Plane 3*/ - ROM_LOAD( "gg6.bin", 0x14000, 0x4000, CRC(2d77e9b2) SHA1(944da1ce29a18bf0fc8deff78bceacba0bf23a07) ) /* tiles 2-3 Plane 3*/ - - ROM_REGION( 0x20000, "gfx3", ROMREGION_ERASEFF ) - ROM_LOAD( "gng13.n4", 0x00000, 0x4000, CRC(4613afdc) SHA1(13e5a38a134bd7cfa16c63a18fa332c6d66b9345) ) /* sprites 0 Plane 1-2 */ - ROM_LOAD( "gg16.bin", 0x04000, 0x4000, CRC(06d7e5ca) SHA1(9e06012bcd82f98fad43de666ef9a75979d940ab) ) /* sprites 1 Plane 1-2 */ - ROM_LOAD( "gg15.bin", 0x08000, 0x4000, CRC(bc1fe02d) SHA1(e3a1421d465b87148ffa94f5673b2307f0246afe) ) /* sprites 2 Plane 1-2 */ - ROM_LOAD( "gng16.l4", 0x10000, 0x4000, CRC(608d68d5) SHA1(af207f9ee2f93a0cf9cf25cfe72b0fdfe55481b8) ) /* sprites 0 Plane 3-4 */ - ROM_LOAD( "gg13.bin", 0x14000, 0x4000, CRC(e80c3fca) SHA1(cb641c25bb04b970b2cbeca41adb792bbe142fb5) ) /* sprites 1 Plane 3-4 */ - ROM_LOAD( "gg12.bin", 0x18000, 0x4000, CRC(7780a925) SHA1(3f129ca6d695548b659955fe538584bd9ac2ff17) ) /* sprites 2 Plane 3-4 */ + ROM_REGION( 0x18000, "tiles", 0 ) + ROM_LOAD( "gg11.bin", 0x00000, 0x4000, CRC(ddd56fa9) SHA1(f9d77eee5e2738b7e83ba02fcc55dd480391479f) ) // 0-1 Plane 1 + ROM_LOAD( "gg10.bin", 0x04000, 0x4000, CRC(7302529d) SHA1(8434c994cc55d2586641f3b90b6b15fd65dfb67c) ) // 2-3 Plane 1 + ROM_LOAD( "gg9.bin", 0x08000, 0x4000, CRC(20035bda) SHA1(bbb1fba0eb19471f66d29526fa8423ccb047bd63) ) // 0-1 Plane 2 + ROM_LOAD( "gg8.bin", 0x0c000, 0x4000, CRC(f12ba271) SHA1(1c42fa02cb27b35d10c3f7f036005e747f9f6b79) ) // 2-3 Plane 2 + ROM_LOAD( "gg7.bin", 0x10000, 0x4000, CRC(e525207d) SHA1(1947f159189b3a53f1251d8653b6e7c65c91fc3c) ) // 0-1 Plane 3 + ROM_LOAD( "gg6.bin", 0x14000, 0x4000, CRC(2d77e9b2) SHA1(944da1ce29a18bf0fc8deff78bceacba0bf23a07) ) // 2-3 Plane 3 + + ROM_REGION( 0x20000, "sprites", ROMREGION_ERASEFF ) + ROM_LOAD( "gng13.n4", 0x00000, 0x4000, CRC(4613afdc) SHA1(13e5a38a134bd7cfa16c63a18fa332c6d66b9345) ) // sprites 0 Plane 1-2 + ROM_LOAD( "gg16.bin", 0x04000, 0x4000, CRC(06d7e5ca) SHA1(9e06012bcd82f98fad43de666ef9a75979d940ab) ) // sprites 1 Plane 1-2 + ROM_LOAD( "gg15.bin", 0x08000, 0x4000, CRC(bc1fe02d) SHA1(e3a1421d465b87148ffa94f5673b2307f0246afe) ) // sprites 2 Plane 1-2 + ROM_LOAD( "gng16.l4", 0x10000, 0x4000, CRC(608d68d5) SHA1(af207f9ee2f93a0cf9cf25cfe72b0fdfe55481b8) ) // sprites 0 Plane 3-4 + ROM_LOAD( "gg13.bin", 0x14000, 0x4000, CRC(e80c3fca) SHA1(cb641c25bb04b970b2cbeca41adb792bbe142fb5) ) // sprites 1 Plane 3-4 + ROM_LOAD( "gg12.bin", 0x18000, 0x4000, CRC(7780a925) SHA1(3f129ca6d695548b659955fe538584bd9ac2ff17) ) // sprites 2 Plane 3-4 ROM_REGION( 0x0200, "proms", 0 ) - ROM_LOAD( "tbp24s10.14k", 0x0000, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) /* video timing (not used) */ - ROM_LOAD( "63s141.2e", 0x0100, 0x0100, CRC(4a1285a4) SHA1(5018c3950b675af58db499e2883ecbc55419b491) ) /* priority (not used) */ + ROM_LOAD( "tbp24s10.14k", 0x0000, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) // video timing (not used) + ROM_LOAD( "63s141.2e", 0x0100, 0x0100, CRC(4a1285a4) SHA1(5018c3950b675af58db499e2883ecbc55419b491) ) // priority (not used) ROM_END ROM_START( makaimurg ) ROM_REGION( 0x18000, "maincpu", 0 ) - ROM_LOAD( "mj04g.bin", 0x04000, 0x4000, CRC(757c94d3) SHA1(07f7cf788810a1425016e016ce3579adb3253ac7) ) /* 4000-5fff is page 4 */ + ROM_LOAD( "mj04g.bin", 0x04000, 0x4000, CRC(757c94d3) SHA1(07f7cf788810a1425016e016ce3579adb3253ac7) ) // 4000-5fff is page 4 ROM_LOAD( "mj03g.bin", 0x08000, 0x8000, CRC(61b043bb) SHA1(23a0a17d0abc4b084ffeba90266ef455361771cc) ) - ROM_LOAD( "mj05g.bin", 0x10000, 0x8000, CRC(f2fdccf5) SHA1(7694a981a6196d77fd2279fc34042b4cfb40c054) ) /* page 0, 1, 2, 3 */ + ROM_LOAD( "mj05g.bin", 0x10000, 0x8000, CRC(f2fdccf5) SHA1(7694a981a6196d77fd2279fc34042b4cfb40c054) ) // page 0, 1, 2, 3 ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "gg2.bin", 0x0000, 0x8000, CRC(615f5b6f) SHA1(7ef9ec5c2072e21c787a6bbf700033f50c759c1d) ) - ROM_REGION( 0x04000, "gfx1", 0 ) - ROM_LOAD( "gg1.bin", 0x00000, 0x4000, CRC(ecfccf07) SHA1(0a1518e19a2e0a4cc3dde4b9568202ea911b5ece) ) /* characters */ + ROM_REGION( 0x04000, "chars", 0 ) + ROM_LOAD( "gg1.bin", 0x00000, 0x4000, CRC(ecfccf07) SHA1(0a1518e19a2e0a4cc3dde4b9568202ea911b5ece) ) - ROM_REGION( 0x18000, "gfx2", 0 ) - ROM_LOAD( "gg11.bin", 0x00000, 0x4000, CRC(ddd56fa9) SHA1(f9d77eee5e2738b7e83ba02fcc55dd480391479f) ) /* tiles 0-1 Plane 1*/ - ROM_LOAD( "gg10.bin", 0x04000, 0x4000, CRC(7302529d) SHA1(8434c994cc55d2586641f3b90b6b15fd65dfb67c) ) /* tiles 2-3 Plane 1*/ - ROM_LOAD( "gg9.bin", 0x08000, 0x4000, CRC(20035bda) SHA1(bbb1fba0eb19471f66d29526fa8423ccb047bd63) ) /* tiles 0-1 Plane 2*/ - ROM_LOAD( "gg8.bin", 0x0c000, 0x4000, CRC(f12ba271) SHA1(1c42fa02cb27b35d10c3f7f036005e747f9f6b79) ) /* tiles 2-3 Plane 2*/ - ROM_LOAD( "gg7.bin", 0x10000, 0x4000, CRC(e525207d) SHA1(1947f159189b3a53f1251d8653b6e7c65c91fc3c) ) /* tiles 0-1 Plane 3*/ - ROM_LOAD( "gg6.bin", 0x14000, 0x4000, CRC(2d77e9b2) SHA1(944da1ce29a18bf0fc8deff78bceacba0bf23a07) ) /* tiles 2-3 Plane 3*/ - - ROM_REGION( 0x20000, "gfx3", ROMREGION_ERASEFF ) - ROM_LOAD( "gng13.n4", 0x00000, 0x4000, CRC(4613afdc) SHA1(13e5a38a134bd7cfa16c63a18fa332c6d66b9345) ) /* sprites 0 Plane 1-2 */ - ROM_LOAD( "gg16.bin", 0x04000, 0x4000, CRC(06d7e5ca) SHA1(9e06012bcd82f98fad43de666ef9a75979d940ab) ) /* sprites 1 Plane 1-2 */ - ROM_LOAD( "gg15.bin", 0x08000, 0x4000, CRC(bc1fe02d) SHA1(e3a1421d465b87148ffa94f5673b2307f0246afe) ) /* sprites 2 Plane 1-2 */ - ROM_LOAD( "gng16.l4", 0x10000, 0x4000, CRC(608d68d5) SHA1(af207f9ee2f93a0cf9cf25cfe72b0fdfe55481b8) ) /* sprites 0 Plane 3-4 */ - ROM_LOAD( "gg13.bin", 0x14000, 0x4000, CRC(e80c3fca) SHA1(cb641c25bb04b970b2cbeca41adb792bbe142fb5) ) /* sprites 1 Plane 3-4 */ - ROM_LOAD( "gg12.bin", 0x18000, 0x4000, CRC(7780a925) SHA1(3f129ca6d695548b659955fe538584bd9ac2ff17) ) /* sprites 2 Plane 3-4 */ + ROM_REGION( 0x18000, "tiles", 0 ) + ROM_LOAD( "gg11.bin", 0x00000, 0x4000, CRC(ddd56fa9) SHA1(f9d77eee5e2738b7e83ba02fcc55dd480391479f) ) // 0-1 Plane 1 + ROM_LOAD( "gg10.bin", 0x04000, 0x4000, CRC(7302529d) SHA1(8434c994cc55d2586641f3b90b6b15fd65dfb67c) ) // 2-3 Plane 1 + ROM_LOAD( "gg9.bin", 0x08000, 0x4000, CRC(20035bda) SHA1(bbb1fba0eb19471f66d29526fa8423ccb047bd63) ) // 0-1 Plane 2 + ROM_LOAD( "gg8.bin", 0x0c000, 0x4000, CRC(f12ba271) SHA1(1c42fa02cb27b35d10c3f7f036005e747f9f6b79) ) // 2-3 Plane 2 + ROM_LOAD( "gg7.bin", 0x10000, 0x4000, CRC(e525207d) SHA1(1947f159189b3a53f1251d8653b6e7c65c91fc3c) ) // 0-1 Plane 3 + ROM_LOAD( "gg6.bin", 0x14000, 0x4000, CRC(2d77e9b2) SHA1(944da1ce29a18bf0fc8deff78bceacba0bf23a07) ) // 2-3 Plane 3 + + ROM_REGION( 0x20000, "sprites", ROMREGION_ERASEFF ) + ROM_LOAD( "gng13.n4", 0x00000, 0x4000, CRC(4613afdc) SHA1(13e5a38a134bd7cfa16c63a18fa332c6d66b9345) ) // sprites 0 Plane 1-2 + ROM_LOAD( "gg16.bin", 0x04000, 0x4000, CRC(06d7e5ca) SHA1(9e06012bcd82f98fad43de666ef9a75979d940ab) ) // sprites 1 Plane 1-2 + ROM_LOAD( "gg15.bin", 0x08000, 0x4000, CRC(bc1fe02d) SHA1(e3a1421d465b87148ffa94f5673b2307f0246afe) ) // sprites 2 Plane 1-2 + ROM_LOAD( "gng16.l4", 0x10000, 0x4000, CRC(608d68d5) SHA1(af207f9ee2f93a0cf9cf25cfe72b0fdfe55481b8) ) // sprites 0 Plane 3-4 + ROM_LOAD( "gg13.bin", 0x14000, 0x4000, CRC(e80c3fca) SHA1(cb641c25bb04b970b2cbeca41adb792bbe142fb5) ) // sprites 1 Plane 3-4 + ROM_LOAD( "gg12.bin", 0x18000, 0x4000, CRC(7780a925) SHA1(3f129ca6d695548b659955fe538584bd9ac2ff17) ) // sprites 2 Plane 3-4 ROM_REGION( 0x0200, "proms", 0 ) - ROM_LOAD( "tbp24s10.14k", 0x0000, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) /* video timing (not used) */ - ROM_LOAD( "63s141.2e", 0x0100, 0x0100, CRC(4a1285a4) SHA1(5018c3950b675af58db499e2883ecbc55419b491) ) /* priority (not used) */ + ROM_LOAD( "tbp24s10.14k", 0x0000, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) // video timing (not used) + ROM_LOAD( "63s141.2e", 0x0100, 0x0100, CRC(4a1285a4) SHA1(5018c3950b675af58db499e2883ecbc55419b491) ) // priority (not used) ROM_END ROM_START( diamond ) ROM_REGION( 0x20000, "maincpu", 0 ) - ROM_LOAD( "d3o", 0x04000, 0x4000, CRC(ba4bf9f1) SHA1(460e01f5ba9cd0c76d1a2ea1e66e9ad49ef1e13b) ) /* 4000-5fff is page 4 */ + ROM_LOAD( "d3o", 0x04000, 0x4000, CRC(ba4bf9f1) SHA1(460e01f5ba9cd0c76d1a2ea1e66e9ad49ef1e13b) ) // 4000-5fff is page 4 ROM_LOAD( "d3", 0x08000, 0x8000, CRC(f436d6fa) SHA1(18287ac51e717ea2ba9b307a738f76735120f21b) ) - ROM_LOAD( "d5o", 0x10000, 0x8000, CRC(ae58bd3a) SHA1(674611c7107cae53150fc249ffc616df891698fe) ) /* page 0, 1, 2, 3 */ - ROM_LOAD( "d5", 0x18000, 0x8000, CRC(453f3f9e) SHA1(b4dcf2eb0e6d4eca8ccde6e1a60f5e002e49a57b) ) /* is this supposed to be used? */ + ROM_LOAD( "d5o", 0x10000, 0x8000, CRC(ae58bd3a) SHA1(674611c7107cae53150fc249ffc616df891698fe) ) // page 0, 1, 2, 3 + ROM_LOAD( "d5", 0x18000, 0x8000, CRC(453f3f9e) SHA1(b4dcf2eb0e6d4eca8ccde6e1a60f5e002e49a57b) ) // is this supposed to be used? ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "d2", 0x0000, 0x8000, CRC(615f5b6f) SHA1(7ef9ec5c2072e21c787a6bbf700033f50c759c1d) ) - ROM_REGION( 0x04000, "gfx1", 0 ) - ROM_LOAD( "d1", 0x00000, 0x4000, CRC(3a24e504) SHA1(56bc38413b8a0dc2829e9c8f7bcfabafe26fd257) ) /* characters */ + ROM_REGION( 0x04000, "chars", 0 ) + ROM_LOAD( "d1", 0x00000, 0x4000, CRC(3a24e504) SHA1(56bc38413b8a0dc2829e9c8f7bcfabafe26fd257) ) - ROM_REGION( 0x18000, "gfx2", 0 ) - ROM_LOAD( "d11", 0x00000, 0x4000, CRC(754357d7) SHA1(eb6e07a5f2d02687306711845001205bf0efa61b) ) /* tiles 0-1 Plane 1*/ - ROM_LOAD( "d10", 0x04000, 0x4000, CRC(7531edcd) SHA1(dc3eabf7e7503f0588f65620d26c1bc5eebde211) ) /* tiles 2-3 Plane 1*/ - ROM_LOAD( "d9", 0x08000, 0x4000, CRC(22eeca08) SHA1(6454b6c0a7a0991744386b79d4988a2517ad0636) ) /* tiles 0-1 Plane 2*/ - ROM_LOAD( "d8", 0x0c000, 0x4000, CRC(6b61be60) SHA1(a92ff6e922da523caec1919f53bea48dab4ca564) ) /* tiles 2-3 Plane 2*/ - ROM_LOAD( "d7", 0x10000, 0x4000, CRC(fd595274) SHA1(8d22f89a7251ecc8b56ee3f8cfaab2fd5a716b3f) ) /* tiles 0-1 Plane 3*/ - ROM_LOAD( "d6", 0x14000, 0x4000, CRC(7f51dcd2) SHA1(ff4a68a7a6a5caa558898b03ba4a4dc3ab43ce30) ) /* tiles 2-3 Plane 3*/ - - ROM_REGION( 0x20000, "gfx3", ROMREGION_ERASEFF ) - ROM_LOAD( "d17", 0x00000, 0x4000, CRC(8164b005) SHA1(d03bf62734b03c90a8393a23f8ce0a3769c43bf7) ) /* sprites 0 Plane 1-2 */ - ROM_LOAD( "d14", 0x10000, 0x4000, CRC(6f132163) SHA1(cd1ebf9671bcce58896dadbf20f036eaadbe8bd5) ) /* sprites 0 Plane 3-4 */ + ROM_REGION( 0x18000, "tiles", 0 ) + ROM_LOAD( "d11", 0x00000, 0x4000, CRC(754357d7) SHA1(eb6e07a5f2d02687306711845001205bf0efa61b) ) // 0-1 Plane 1 + ROM_LOAD( "d10", 0x04000, 0x4000, CRC(7531edcd) SHA1(dc3eabf7e7503f0588f65620d26c1bc5eebde211) ) // 2-3 Plane 1 + ROM_LOAD( "d9", 0x08000, 0x4000, CRC(22eeca08) SHA1(6454b6c0a7a0991744386b79d4988a2517ad0636) ) // 0-1 Plane 2 + ROM_LOAD( "d8", 0x0c000, 0x4000, CRC(6b61be60) SHA1(a92ff6e922da523caec1919f53bea48dab4ca564) ) // 2-3 Plane 2 + ROM_LOAD( "d7", 0x10000, 0x4000, CRC(fd595274) SHA1(8d22f89a7251ecc8b56ee3f8cfaab2fd5a716b3f) ) // 0-1 Plane 3 + ROM_LOAD( "d6", 0x14000, 0x4000, CRC(7f51dcd2) SHA1(ff4a68a7a6a5caa558898b03ba4a4dc3ab43ce30) ) // 2-3 Plane 3 + + ROM_REGION( 0x20000, "sprites", ROMREGION_ERASEFF ) + ROM_LOAD( "d17", 0x00000, 0x4000, CRC(8164b005) SHA1(d03bf62734b03c90a8393a23f8ce0a3769c43bf7) ) // sprites 0 Plane 1-2 + ROM_LOAD( "d14", 0x10000, 0x4000, CRC(6f132163) SHA1(cd1ebf9671bcce58896dadbf20f036eaadbe8bd5) ) // sprites 0 Plane 3-4 ROM_REGION( 0x0200, "proms", 0 ) - ROM_LOAD( "prom1", 0x0000, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) /* video timing (not used) */ - ROM_LOAD( "prom2", 0x0100, 0x0100, CRC(4a1285a4) SHA1(5018c3950b675af58db499e2883ecbc55419b491) ) /* priority (not used) */ + ROM_LOAD( "prom1", 0x0000, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) // video timing (not used) + ROM_LOAD( "prom2", 0x0100, 0x0100, CRC(4a1285a4) SHA1(5018c3950b675af58db499e2883ecbc55419b491) ) // priority (not used) ROM_END +} // anonymous namespace GAME( 1985, gng, 0, gng, gng, gng_state, empty_init, ROT0, "Capcom", "Ghosts'n Goblins (World? set 1)", MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/goal92.cpp mame-0.243+dfsg.1/src/mame/drivers/goal92.cpp --- mame-0.242+dfsg.1/src/mame/drivers/goal92.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/goal92.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -10,72 +10,316 @@ ***************************************************************************/ #include "emu.h" -#include "includes/goal92.h" -#include "cpu/z80/z80.h" #include "cpu/m68000/m68000.h" +#include "cpu/z80/z80.h" +#include "machine/gen_latch.h" +#include "sound/msm5205.h" #include "sound/okim6295.h" #include "sound/ymopn.h" +#include "video/bufsprite.h" + +#include "emupal.h" #include "screen.h" #include "speaker.h" +#include "tilemap.h" + + +namespace { + +class goal92_state : public driver_device +{ +public: + goal92_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_bg_data(*this, "bg_data"), + m_fg_data(*this, "fg_data"), + m_tx_data(*this, "tx_data"), + m_scrollram(*this, "scrollram"), + m_soundbank(*this, "soundbank"), + m_in(*this, "IN%u", 1U), + m_dsw(*this, "DSW%u", 1U), + m_maincpu(*this, "maincpu"), + m_audiocpu(*this, "audiocpu"), + m_msm(*this, "msm"), + m_gfxdecode(*this, "gfxdecode"), + m_palette(*this, "palette"), + m_buffered_spriteram(*this, "buffered_spriteram") + { } + + void goal92(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; + +private: + // memory pointers + required_shared_ptr m_bg_data; + required_shared_ptr m_fg_data; + required_shared_ptr m_tx_data; + required_shared_ptr m_scrollram; + required_memory_bank m_soundbank; + + // video-related + tilemap_t *m_bg_layer = nullptr; + tilemap_t *m_fg_layer = nullptr; + tilemap_t *m_tx_layer = nullptr; + uint16_t m_fg_bank = 0U; + + // misc + uint8_t m_msm5205next = 0; + uint8_t m_adpcm_toggle = 0; + required_ioport_array<3> m_in; + required_ioport_array<2> m_dsw; + + // devices + required_device m_maincpu; + required_device m_audiocpu; + required_device m_msm; + required_device m_gfxdecode; + required_device m_palette; + required_device m_buffered_spriteram; + + uint16_t inputs_r(offs_t offset, uint16_t mem_mask = ~0); + void adpcm_data_w(uint8_t data); + uint16_t fg_bank_r(); + void fg_bank_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + void text_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + void background_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + void foreground_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + void adpcm_control_w(uint8_t data); + TILE_GET_INFO_MEMBER(get_text_tile_info); + TILE_GET_INFO_MEMBER(get_back_tile_info); + TILE_GET_INFO_MEMBER(get_fore_tile_info); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int pri); + DECLARE_WRITE_LINE_MEMBER(irqhandler); + DECLARE_WRITE_LINE_MEMBER(adpcm_int); + void main_map(address_map &map); + void sound_map(address_map &map); +}; + + +// video + +uint16_t goal92_state::fg_bank_r() +{ + return m_fg_bank; +} + +void goal92_state::fg_bank_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + COMBINE_DATA(&m_fg_bank); + + if (ACCESSING_BITS_0_7) + { + m_fg_layer->mark_all_dirty(); + } +} + +void goal92_state::text_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + COMBINE_DATA(&m_tx_data[offset]); + m_tx_layer->mark_tile_dirty(offset); +} + +void goal92_state::background_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + COMBINE_DATA(&m_bg_data[offset]); + m_bg_layer->mark_tile_dirty(offset); +} + +void goal92_state::foreground_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + COMBINE_DATA(&m_fg_data[offset]); + m_fg_layer->mark_tile_dirty(offset); +} + +TILE_GET_INFO_MEMBER(goal92_state::get_text_tile_info) +{ + int tile = m_tx_data[tile_index]; + int color = (tile >> 12) & 0xf; + + tile &= 0xfff; + + tile |= 0xc000; + + tileinfo.set(1, tile, color, 0); +} + +TILE_GET_INFO_MEMBER(goal92_state::get_back_tile_info) +{ + int tile = m_bg_data[tile_index]; + int color = (tile >> 12) & 0xf; + + tile &= 0xfff; + + tileinfo.set(2, tile, color, 0); +} + +TILE_GET_INFO_MEMBER(goal92_state::get_fore_tile_info) +{ + int tile = m_fg_data[tile_index]; + int color = (tile >> 12) & 0xf; + int region; + + tile &= 0xfff; + + if(m_fg_bank & 0xff) + { + region = 3; + tile |= 0x1000; + } + else + { + region = 4; + tile |= 0x2000; + } + + tileinfo.set(region, tile, color, 0); +} + +void goal92_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int pri) +{ + uint16_t *buffered_spriteram = m_buffered_spriteram->buffer(); + + for (int offs = 3; offs <= 0x400 - 5; offs += 4) + { + uint16_t data = buffered_spriteram[offs + 2]; + + int y = buffered_spriteram[offs + 0]; + + if (y & 0x8000) + break; + + if (!(data & 0x8000)) + continue; + + int sprite = buffered_spriteram[offs + 1]; + + if ((sprite >> 14) != pri) + continue; + + int x = buffered_spriteram[offs + 3]; + + sprite &= 0x1fff; + x &= 0x1ff; + y &= 0x1ff; -void goal92_state::goal92_sound_command_w(offs_t offset, uint16_t data, uint16_t mem_mask) + int color = (data & 0x3f) + 0x40; + int fx = (data & 0x4000) >> 14; + int fy = 0; + + x -= 320 / 4 - 16 - 1; + + y = 256 - (y + 7); + + m_gfxdecode->gfx(0)->transpen(bitmap, cliprect, + sprite, + color, fx, fy, x, y, 15); + } +} + + +void goal92_state::video_start() +{ + m_bg_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(goal92_state::get_back_tile_info)), TILEMAP_SCAN_ROWS, 16, 16, 32, 32); + m_fg_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(goal92_state::get_fore_tile_info)), TILEMAP_SCAN_ROWS, 16, 16, 32, 32); + m_tx_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(goal92_state::get_text_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + + m_bg_layer->set_transparent_pen(15); + m_fg_layer->set_transparent_pen(15); + m_tx_layer->set_transparent_pen(15); +} + +uint32_t goal92_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - if (ACCESSING_BITS_8_15) + m_bg_layer->set_scrollx(0, m_scrollram[0] + 60); + m_bg_layer->set_scrolly(0, m_scrollram[1] + 8); + + if (m_fg_bank & 0xff) { - m_soundlatch->write((data >> 8) & 0xff); - m_audiocpu->set_input_line(0, HOLD_LINE); + m_fg_layer->set_scrollx(0, m_scrollram[0] + 60); + m_fg_layer->set_scrolly(0, m_scrollram[1] + 8); } + else + { + m_fg_layer->set_scrollx(0, m_scrollram[2] + 60); + m_fg_layer->set_scrolly(0, m_scrollram[3] + 8); + } + + bitmap.fill(m_palette->black_pen(), cliprect); + + m_bg_layer->draw(screen, bitmap, cliprect, 0, 0); + draw_sprites(bitmap, cliprect, 2); + + if (!(m_fg_bank & 0xff)) + draw_sprites(bitmap, cliprect, 1); + + m_fg_layer->draw(screen, bitmap, cliprect, 0, 0); + + if(m_fg_bank & 0xff) + draw_sprites(bitmap, cliprect, 1); + + draw_sprites(bitmap, cliprect, 0); + draw_sprites(bitmap, cliprect, 3); + m_tx_layer->draw(screen, bitmap, cliprect, 0, 0); + return 0; } -uint16_t goal92_state::goal92_inputs_r(offs_t offset, uint16_t mem_mask) + +// machine + +uint16_t goal92_state::inputs_r(offs_t offset, uint16_t mem_mask) { switch(offset) { case 0: - return ioport("DSW1")->read(); + return m_dsw[0]->read(); case 1: - return ioport("IN1")->read(); + return m_in[0]->read(); case 2: - return ioport("IN2")->read(); + return m_in[1]->read(); case 3: - return ioport("IN3")->read(); + return m_in[2]->read(); case 7: - return ioport("DSW2")->read(); + return m_dsw[1]->read(); default: - logerror("reading unhandled goal92 inputs %04X %04X @ PC = %04X\n", offset, mem_mask,m_maincpu->pc()); + logerror("reading unhandled goal92 inputs %04X %04X @ PC = %04X\n", offset, mem_mask, m_maincpu->pc()); } return 0; } -void goal92_state::goal92_map(address_map &map) +void goal92_state::main_map(address_map &map) { map(0x000000, 0x0fffff).rom(); map(0x100000, 0x1007ff).ram(); - map(0x100800, 0x100fff).ram().w(FUNC(goal92_state::goal92_background_w)).share("bg_data"); - map(0x101000, 0x1017ff).ram().w(FUNC(goal92_state::goal92_foreground_w)).share("fg_data"); + map(0x100800, 0x100fff).ram().w(FUNC(goal92_state::background_w)).share(m_bg_data); + map(0x101000, 0x1017ff).ram().w(FUNC(goal92_state::foreground_w)).share(m_fg_data); map(0x101800, 0x101fff).ram(); // it has tiles for clouds, but they aren't used - map(0x102000, 0x102fff).ram().w(FUNC(goal92_state::goal92_text_w)).share("tx_data"); + map(0x102000, 0x102fff).ram().w(FUNC(goal92_state::text_w)).share(m_tx_data); map(0x103000, 0x103fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); map(0x104000, 0x13ffff).ram(); - map(0x140000, 0x1407ff).ram().share("spriteram"); + map(0x140000, 0x1407ff).ram().share("buffered_spriteram"); map(0x140800, 0x140801).nopw(); map(0x140802, 0x140803).nopw(); - map(0x180000, 0x18000f).r(FUNC(goal92_state::goal92_inputs_r)); - map(0x180008, 0x180009).w(FUNC(goal92_state::goal92_sound_command_w)); + map(0x180000, 0x18000f).r(FUNC(goal92_state::inputs_r)); + map(0x180008, 0x180008).w("soundlatch", FUNC(generic_latch_8_device::write)); map(0x18000a, 0x18000b).nopw(); - map(0x180010, 0x180017).writeonly().share("scrollram"); - map(0x18001c, 0x18001d).rw(FUNC(goal92_state::goal92_fg_bank_r), FUNC(goal92_state::goal92_fg_bank_w)); + map(0x180010, 0x180017).writeonly().share(m_scrollram); + map(0x18001c, 0x18001d).rw(FUNC(goal92_state::fg_bank_r), FUNC(goal92_state::fg_bank_w)); } -/* Sound CPU */ +// Sound CPU void goal92_state::adpcm_control_w(uint8_t data) { - membank("bank1")->set_entry(data & 0x01); + m_soundbank->set_entry(data & 0x01); m_msm->reset_w(data & 0x08); } @@ -85,16 +329,16 @@ m_msm5205next = data; } -void goal92_state::sound_cpu(address_map &map) +void goal92_state::sound_map(address_map &map) { map(0x0000, 0x7fff).rom(); - map(0x8000, 0xbfff).bankr("bank1"); + map(0x8000, 0xbfff).bankr(m_soundbank); map(0xe000, 0xe000).w(FUNC(goal92_state::adpcm_control_w)); map(0xe400, 0xe400).w(FUNC(goal92_state::adpcm_data_w)); map(0xe800, 0xe801).rw("ym1", FUNC(ym2203_device::read), FUNC(ym2203_device::write)); map(0xec00, 0xec01).rw("ym2", FUNC(ym2203_device::read), FUNC(ym2203_device::write)); map(0xf000, 0xf7ff).ram(); - map(0xf800, 0xf800).r(m_soundlatch, FUNC(generic_latch_8_device::read)); + map(0xf800, 0xf800).r("soundlatch", FUNC(generic_latch_8_device::read)); } static INPUT_PORTS_START( goal92 ) @@ -214,34 +458,23 @@ PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) INPUT_PORTS_END -/* handler called by the 2203 emulator when the internal timers cause an IRQ */ +// handler called by the 2203 emulator when the internal timers cause an IRQ WRITE_LINE_MEMBER(goal92_state::irqhandler) { - /* NMI writes to MSM ports *only*! -AS */ + // NMI writes to MSM ports *only*! -AS //m_audiocpu->set_input_line(INPUT_LINE_NMI, state ? ASSERT_LINE : CLEAR_LINE); } -WRITE_LINE_MEMBER(goal92_state::goal92_adpcm_int) +WRITE_LINE_MEMBER(goal92_state::adpcm_int) { m_msm->data_w(m_msm5205next); m_msm5205next >>= 4; - m_adpcm_toggle^= 1; + m_adpcm_toggle ^= 1; if (m_adpcm_toggle) m_audiocpu->pulse_input_line(INPUT_LINE_NMI, attotime::zero); } -static const gfx_layout layout_8x8x4 = -{ - 8,8, - RGN_FRAC(1,4), - 4, - { RGN_FRAC(3,4),RGN_FRAC(2,4),RGN_FRAC(1,4),RGN_FRAC(0,4) }, - { STEP8(0,1) }, - { STEP8(0,8) }, - 8*8 -}; - static const gfx_layout layout_16x16x4 = { 16,16, @@ -253,36 +486,20 @@ 16*16 }; -#ifdef UNUSED_FUNCTION -static const gfx_layout layout_16x16x4_2 = -{ - 16,16, - RGN_FRAC(1,1), - 4, - { 0,1,2,3 }, - { 4,0,12,8,20,16,28,24, - 512+4,512+0,512+12,512+8,512+20,512+16,512+28,512+24 }, - { 0*32,1*32,2*32,3*32,4*32,5*32,6*32,7*32, - 256+0*32,256+1*32,256+2*32,256+3*32,256+4*32,256+5*32,256+6*32,256+7*32 }, - 1024 -}; -#endif - static GFXDECODE_START( gfx_goal92 ) - GFXDECODE_ENTRY( "gfx1", 0, layout_16x16x4, 0*16, 8*16 ) // Sprites - GFXDECODE_ENTRY( "gfx2", 0, layout_8x8x4, 48*16, 16 ) // Text Layer - GFXDECODE_ENTRY( "gfx2", 0, layout_16x16x4, 0*16, 16 ) // BG Layer - GFXDECODE_ENTRY( "gfx2", 0, layout_16x16x4, 16*16, 16 ) // Mid Layer - GFXDECODE_ENTRY( "gfx2", 0, layout_16x16x4, 32*16, 16 ) // FG Layer + GFXDECODE_ENTRY( "sprites", 0, layout_16x16x4, 0*16, 8*16 ) + GFXDECODE_ENTRY( "tiles", 0, gfx_8x8x4_planar, 48*16, 16 ) // Text Layer + GFXDECODE_ENTRY( "tiles", 0, layout_16x16x4, 0*16, 16 ) // BG Layer + GFXDECODE_ENTRY( "tiles", 0, layout_16x16x4, 16*16, 16 ) // Mid Layer + GFXDECODE_ENTRY( "tiles", 0 , layout_16x16x4, 32*16, 16 ) // FG Layer GFXDECODE_END void goal92_state::machine_start() { - uint8_t *ROM = memregion("audiocpu")->base(); - - membank("bank1")->configure_entries(0, 2, &ROM[0x10000], 0x4000); + uint8_t *rom = memregion("audiocpu")->base(); + m_soundbank->configure_entries(0, 2, &rom[0x8000], 0x4000); save_item(NAME(m_fg_bank)); save_item(NAME(m_msm5205next)); @@ -298,42 +515,44 @@ void goal92_state::goal92(machine_config &config) { - /* basic machine hardware */ - M68000(config, m_maincpu, 12000000); - m_maincpu->set_addrmap(AS_PROGRAM, &goal92_state::goal92_map); - m_maincpu->set_vblank_int("screen", FUNC(goal92_state::irq6_line_hold)); /* VBL */ + // basic machine hardware + M68000(config, m_maincpu, 24_MHz_XTAL / 2); + m_maincpu->set_addrmap(AS_PROGRAM, &goal92_state::main_map); + m_maincpu->set_vblank_int("screen", FUNC(goal92_state::irq6_line_hold)); // VBL + + Z80(config, m_audiocpu, 10_MHz_XTAL / 4); + m_audiocpu->set_addrmap(AS_PROGRAM, &goal92_state::sound_map); // IRQs are triggered by the main CPU - Z80(config, m_audiocpu, 2500000); - m_audiocpu->set_addrmap(AS_PROGRAM, &goal92_state::sound_cpu); /* IRQs are triggered by the main CPU */ + // video hardware + BUFFERED_SPRITERAM16(config, m_buffered_spriteram); - /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(60); screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); screen.set_size(40*8, 32*8); screen.set_visarea(0*8, 40*8-1, 1*8, 31*8-1); // black border at bottom is a game bug... - screen.set_screen_update(FUNC(goal92_state::screen_update_goal92)); - screen.screen_vblank().set(FUNC(goal92_state::screen_vblank_goal92)); + screen.set_screen_update(FUNC(goal92_state::screen_update)); + screen.screen_vblank().set(m_buffered_spriteram, FUNC(buffered_spriteram16_device::vblank_copy_rising)); screen.set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_goal92); PALETTE(config, m_palette).set_format(palette_device::xBGR_555, 128*16); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); - GENERIC_LATCH_8(config, m_soundlatch); + GENERIC_LATCH_8(config, "soundlatch").data_pending_callback().set_inputline(m_audiocpu, 0); - ym2203_device &ym1(YM2203(config, "ym1", 2500000/2)); + ym2203_device &ym1(YM2203(config, "ym1", 10_MHz_XTAL / 8)); ym1.irq_handler().set(FUNC(goal92_state::irqhandler)); ym1.add_route(ALL_OUTPUTS, "mono", 0.25); - ym2203_device &ym2(YM2203(config, "ym2", 2500000/2)); + ym2203_device &ym2(YM2203(config, "ym2", 10_MHz_XTAL / 8)); ym2.add_route(ALL_OUTPUTS, "mono", 0.25); - MSM5205(config, m_msm, 384000); - m_msm->vck_legacy_callback().set(FUNC(goal92_state::goal92_adpcm_int)); /* interrupt function */ - m_msm->set_prescaler_selector(msm5205_device::S96_4B); /* 4KHz 4-bit */ + MSM5205(config, m_msm, 400_kHz_XTAL); + m_msm->vck_legacy_callback().set(FUNC(goal92_state::adpcm_int)); // interrupt function + m_msm->set_prescaler_selector(msm5205_device::S96_4B); // 4KHz 4-bit m_msm->add_route(ALL_OUTPUTS, "mono", 0.60); } @@ -377,27 +596,27 @@ */ ROM_START( goal92 ) - ROM_REGION( 0x100000, "maincpu", 0 ) /* 68000 Code - first 0x20000 bytes are a heavily patched copy of olysoc92a */ + ROM_REGION( 0x100000, "maincpu", 0 ) // 68000 Code - first 0x20000 bytes are a heavily patched copy of olysoc92a ROM_LOAD16_BYTE( "2.bin", 0x00000, 0x80000, CRC(db0a6c7c) SHA1(b609db7806b99bc921806d8b3e5e515b4651c375) ) ROM_LOAD16_BYTE( "3.bin", 0x00001, 0x80000, CRC(e4c45dee) SHA1(542749bd1ff51220a151fe66acdadac83df8f0ee) ) - ROM_REGION( 0x18000, "audiocpu", 0 ) /* Z80 code */ - ROM_LOAD( "1.bin", 0x00000, 0x8000, CRC(3d317622) SHA1(ae4e8c5247bc215a2769786cb8639bce2f80db22) ) - ROM_CONTINUE( 0x10000, 0x8000 ) /* banked at 8000-bfff */ + ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 code + ROM_LOAD( "1.bin", 0x00000, 0x10000, CRC(3d317622) SHA1(ae4e8c5247bc215a2769786cb8639bce2f80db22) )// second half banked at 8000-bfff - ROM_REGION( 0x100000, "gfx1", 0 ) + ROM_REGION( 0x100000, "sprites", 0 ) ROM_LOAD( "6.bin", 0x000000, 0x040000, CRC(83cadc8f) SHA1(1d3309750347c5d6d661f5cf452235e5a83a7483) ) ROM_LOAD( "7.bin", 0x040000, 0x040000, CRC(067e10fc) SHA1(9831b8dc9b8efa6f7797b2946ee5be03fb36de7b) ) ROM_LOAD( "5.bin", 0x080000, 0x040000, CRC(9a390af2) SHA1(8bc46f8cc7823b8caf381866bea016ebfad9d5d3) ) ROM_LOAD( "4.bin", 0x0c0000, 0x040000, CRC(69b118d5) SHA1(80ab6f03e1254ba47c27299ce11559b244a024ad) ) // sldh - ROM_REGION( 0x200000, "gfx2", 0 ) + ROM_REGION( 0x200000, "tiles", 0 ) ROM_LOAD( "11.bin", 0x000000, 0x080000, CRC(5701e626) SHA1(e6915714e9ca90be8fa8ab1bf7fd1f23a83fb82c) ) ROM_LOAD( "10.bin", 0x080000, 0x080000, CRC(ebb359cc) SHA1(b2f724ef7a91fca0ff0b7d7abe1c37816464b37d) ) ROM_LOAD( "9.bin", 0x100000, 0x080000, CRC(c9f0dd07) SHA1(d70cdb24b7df521255b5841f01dd9e8344ab7bdb) ) ROM_LOAD( "8.bin", 0x180000, 0x080000, CRC(aeab3534) SHA1(af91238f412bfcff3a52232278d81276584614a7) ) ROM_END +} // anonymous namespace GAME( 1992, goal92, cupsoc, goal92, goal92, goal92_state, empty_init, ROT0, "bootleg", "Goal! '92", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/goldnpkr.cpp mame-0.243+dfsg.1/src/mame/drivers/goldnpkr.cpp --- mame-0.242+dfsg.1/src/mame/drivers/goldnpkr.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/goldnpkr.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -12,7 +12,10 @@ * Golden Poker Double Up (Big Boy), 1981, Bonanza Enterprises, Ltd. * Golden Poker Double Up (Mini Boy), 1981, Bonanza Enterprises, Ltd. - * Golden Poker Double Up (bootleg), 198?, Bootleg. + * Golden Poker Double Up (bootleg, set 1), 198?, Bootleg. + * Golden Poker Double Up (bootleg, set 2), 198?, Bootleg. + * Golden Poker Double Up (bootleg, set 3), 1983, Intercoast (bootleg). + * Golden Poker Double Up (bootleg, set 4), 1983, Intercoast (bootleg). * Videotron Poker (cards selector, set 1), 198?, Unknown. * Videotron Poker (cards selector, set 2), 198?, Unknown. * Videotron Poker (normal controls), 198?, Unknown. @@ -146,8 +149,11 @@ * Mundial/Mondial (Italian/French), 1987, Unknown. * Super 98 (3-hands, ICP-1), 199?, Unknown. * unknown rocket/animal-themed poker, 199?, Unknown. + * Le Super Pendu (V1, words set #1), 198?, Voyageur de L'Espace Inc.. + * Le Super Pendu (V1, words set #2), 198?, Voyageur de L'Espace Inc.. * Mega Double Poker (conversion kit, set 1), 1990, Blitz System Inc. * Mega Double Poker (conversion kit, set 2), 1990, Blitz System Inc. + * Maxi Double Poker (version 1.8), 1990, Blitz System Inc. ************************************************************************************ @@ -990,6 +996,7 @@ #include "pmpoker.lh" #include "goldnpkr.lh" #include "upndown.lh" +#include "lespendu.lh" namespace { @@ -1031,6 +1038,7 @@ void caspoker(machine_config &config); void icp_ext(machine_config &config); void gldnirq0(machine_config &config); + void lespendu(machine_config &config); void init_vkdlswwh(); void init_icp1db(); @@ -1055,11 +1063,15 @@ void init_bonuspkr(); void init_super98(); void init_pokersis(); + void init_lespendu(); + void init_lespenduj(); uint8_t pottnpkr_mux_port_r(); void lamps_a_w(uint8_t data); + void lespendu_lamps_a_w(uint8_t data); void sound_w(uint8_t data); void mux_w(uint8_t data); + void lespendu_mux_w(uint8_t data); uint32_t screen_update_goldnpkr(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); @@ -1098,7 +1110,9 @@ DECLARE_VIDEO_START(super21p); void wcrdxtnd_palette(palette_device &palette) const; DECLARE_MACHINE_START(mondial); + DECLARE_MACHINE_START(lespendu); DECLARE_MACHINE_RESET(mondial); + DECLARE_MACHINE_RESET(lespendu); void genie_map(address_map &map); void goldnpkr_map(address_map &map); @@ -1114,6 +1128,7 @@ void witchcrd_map(address_map &map); void super21p_map(address_map &map); void icp_ext_map(address_map &map); + void lespendu_map(address_map &map); required_shared_ptr m_videoram; required_shared_ptr m_colorram; @@ -1127,6 +1142,7 @@ uint8_t m_ay8910_control = 0; }; + class blitz_state : public goldnpkr_state { public: @@ -1475,10 +1491,20 @@ void goldnpkr_state::mux_w(uint8_t data) { - //logerror("mux_w: %2x\n",data); m_mux_data = data ^ 0xff; // inverted } +void goldnpkr_state::lespendu_mux_w(uint8_t data) +{ + m_mux_data = data ^ 0xff; // inverted + + if(data == 0x00) + data = 0xff; + + membank("bank0")->set_entry(data & 0x07); // for both sets +} + + void goldnpkr_state::mux_port_w(uint8_t data) { m_pia0_PA_data = data; @@ -1486,7 +1512,6 @@ // demuxing ay8910 data/address from Falcon board, PIA portA out - uint8_t goldnpkr_state::ay8910_data_r() { return (m_ay8910_control & 0xc0) == 0x40 ? m_ay8910->data_r() : 0xff; @@ -1583,11 +1608,35 @@ machine().bookkeeping().coin_counter_w(2, data & 0x20); // counter 3 } +void goldnpkr_state::lespendu_lamps_a_w(uint8_t data) +{ +/* Le Super Pendu lamps and counters wiring * + + 7654 3210 + ---- ---x Lamp 1. + ---- --x- Lamp 2. + ---- -x-- Lamp 3. + ---- x--- Lamp 4. + ---x ---- Lamp 5. + --x- ---- Coin In counter. + xx-- ---- Unused. +*/ + data = data ^ 0xff; + + m_lamps[0] = BIT(data, 0); // lamp 0 + m_lamps[1] = BIT(data, 1); // lamp 1 + m_lamps[2] = BIT(data, 2); // lamp 2 + m_lamps[3] = BIT(data, 3); // lamp 3 + m_lamps[4] = BIT(data, 4); // lamp 4 + + // counter 0, adding extra coin when boot for difference of polarisation. + machine().bookkeeping().coin_counter_w(0, BIT(data, 5)); +} + + void goldnpkr_state::sound_w(uint8_t data) { // 555 voltage controlled - logerror("Sound Data: %2x\n",data & 0x0f); - // discrete sound is connected to PIA1, portA: bits 0-3 m_discrete->write(NODE_01, data >> 3 & 0x01); m_discrete->write(NODE_10, data & 0x07); @@ -1646,7 +1695,6 @@ map(0x2800, 0x2fff).ram(); map(0x4000, 0x7fff).rom(); } - /* Witch Card (Video klein) @@ -1804,6 +1852,21 @@ map(0x6000, 0x7fff).rom(); } +void goldnpkr_state::lespendu_map(address_map &map) +{ + map.global_mask(0x7fff); + map(0x0000, 0x07ff).ram().share("nvram"); // battery backed RAM + map(0x0800, 0x0800).w("crtc", FUNC(mc6845_device::address_w)); + map(0x0801, 0x0801).rw("crtc", FUNC(mc6845_device::register_r), FUNC(mc6845_device::register_w)); + map(0x0844, 0x0847).rw("pia0", FUNC(pia6821_device::read), FUNC(pia6821_device::write)); + map(0x0848, 0x084b).rw("pia1", FUNC(pia6821_device::read), FUNC(pia6821_device::write)); + map(0x1000, 0x13ff).ram().w(FUNC(goldnpkr_state::goldnpkr_videoram_w)).share("videoram"); + map(0x1800, 0x1bff).ram().w(FUNC(goldnpkr_state::goldnpkr_colorram_w)).share("colorram"); + + map(0x5000, 0x5fff).bankr("bank0"); + map(0x6000, 0x7fff).rom(); +} + /********************************************* * Input Ports * @@ -4044,6 +4107,95 @@ INPUT_PORTS_END +static INPUT_PORTS_START(lespendu) + // Multiplexed - 4x5bits + PORT_START("IN0-0") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Stats / Meters") PORT_CODE(KEYCODE_0) // stats + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Button 4 / Stats Input Test") PORT_CODE(KEYCODE_V) // button 4 / stats test mode + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Button 1") PORT_CODE(KEYCODE_Z) // button 1 + 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("IN0-1") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Button 5 / Stats Exit") PORT_CODE(KEYCODE_B) // button 5 + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Button 2") PORT_CODE(KEYCODE_X) // button 2 + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Button 3") PORT_CODE(KEYCODE_C) // button 3 + 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("IN0-2") + PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("IN0-3") + 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_COIN1 ) // 25¢ coin, 50¢ to play. + 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("SW1") + PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + + PORT_START("SW2") + PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) +INPUT_PORTS_END + + /********************************************* * Graphics Layouts * *********************************************/ @@ -4111,6 +4263,11 @@ GFXDECODE_ENTRY( "gfx2", 0, tilelayout, 128, 16 ) GFXDECODE_END +static GFXDECODE_START( gfx_lespendu ) + GFXDECODE_ENTRY( "gfx1", 0, fixedtilelayout, 0, 16 ) + GFXDECODE_ENTRY( "gfx2", 0, fixedtilelayout, 0, 16 ) +GFXDECODE_END + /********************************************************** * Discrete Sound Routines * @@ -4264,6 +4421,20 @@ membank("bank1")->set_entry(seldsw); } +MACHINE_START_MEMBER(goldnpkr_state, lespendu) +{ + m_lamps.resolve(); + + uint8_t *ROM = memregion("data")->base(); + membank("bank0")->configure_entries(0, 8, &ROM[0], 0x1000); +} + +MACHINE_RESET_MEMBER(goldnpkr_state, lespendu) +{ + membank("bank0")->set_entry(7); +} + + /********************************************* * Machine Drivers * *********************************************/ @@ -4549,6 +4720,7 @@ { goldnpkr(config); + // basic machine hardware mc6845_device &crtc(MC6845(config.replace(), "crtc", CPU_CLOCK)); // 68B45 or 6845s @ CPU clock crtc.set_screen("screen"); crtc.set_show_border_area(false); @@ -4557,6 +4729,33 @@ } +void goldnpkr_state::lespendu(machine_config &config) +{ + goldnpkr(config); + + // basic machine hardware + m_maincpu->set_addrmap(AS_PROGRAM, &goldnpkr_state::lespendu_map); + + m_pia[0]->writepb_handler().set(FUNC(goldnpkr_state::lespendu_lamps_a_w)); + + m_pia[1]->readpa_handler().set_ioport("SW1"); + m_pia[1]->readpb_handler().set_ioport("SW2"); + m_pia[1]->writepb_handler().set(FUNC(goldnpkr_state::lespendu_mux_w)); // ++ bankswitch + + MCFG_MACHINE_START_OVERRIDE(goldnpkr_state, lespendu) + MCFG_MACHINE_RESET_OVERRIDE(goldnpkr_state, lespendu) + + // video hardware + m_gfxdecode->set_info(gfx_lespendu); + + mc6845_device &crtc(HD6845S(config.replace(), "crtc", CPU_CLOCK)); // Hitachi HD46505SP + crtc.set_screen("screen"); + crtc.set_show_border_area(false); + crtc.set_char_width(8); + crtc.out_vsync_callback().set_inputline(m_maincpu, INPUT_LINE_NMI); +} + + /********************************************* * Blitz System * *********************************************/ @@ -4804,6 +5003,142 @@ ROM_LOAD( "82s129n.bin", 0x0000, 0x0100, BAD_DUMP CRC(7f31066b) SHA1(15420780ec6b2870fc4539ec3afe4f0c58eedf12) ) ROM_END +/* + Unknown Golden Poker. + Bio5 set. + + Maybe bootleg + Running in original Bonanza board. + + Program mapped at 0x5000-0x7fff + GFX ROMs are missing. + + Always get a winning Flush hand. + (Seems protection. Need to analyze the code) + +*/ +ROM_START( goldnpkd ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "bio5_1-20_1.bin", 0x5000, 0x1000, CRC(d6612e28) SHA1(ec0e05035283642966f416d3361b94a74076a452) ) + ROM_LOAD( "bio5_1-20_2.bin", 0x6000, 0x1000, CRC(6b2ade97) SHA1(66adbe69f132f849c0a2a32d5a9575b0740c7a4c) ) + ROM_LOAD( "bio5_1-20_3.bin", 0x7000, 0x1000, CRC(d1ee95e2) SHA1(95ad7f86f83fda94476508954bda1270fb5f17ad) ) + + ROM_REGION( 0x1800, "gfx1", 0 ) + ROM_FILL( 0x0000, 0x1000, 0x00 ) // filling the R-G bitplanes. + ROM_LOAD( "u38.5a", 0x1000, 0x0800, CRC(52fd35d2) SHA1(ad8bf8c222ceb2e9b3b6d9033866867f1977c65f) ) // chars rom + cards deck gfx, bitplane 3. + ROM_IGNORE( 0x0800) // discarding 2nd half (cards deck gfx). + + ROM_REGION( 0x1800, "gfx2", 0 ) + ROM_LOAD( "n43.2a", 0x0000, 0x0800, CRC(1419298b) SHA1(9e07c94c858f055d1c4987efd03c76cce936f4da) ) // cards deck gfx, bitplane 1. + ROM_IGNORE( 0x0800) + ROM_LOAD( "n40.4a", 0x0800, 0x0800, CRC(e0b96dcf) SHA1(b06af94361dd951573f187df575b31a9ada0c3e9) ) // cards deck gfx, bitplane 2. + ROM_IGNORE( 0x0800) + ROM_LOAD( "u38.5a", 0x1000, 0x0800, CRC(52fd35d2) SHA1(ad8bf8c222ceb2e9b3b6d9033866867f1977c65f) ) // chars rom + cards deck gfx, bitplane 3. + ROM_CONTINUE( 0x1000, 0x0800) // discarding 1nd half (chars). + + ROM_REGION( 0x0100, "proms", 0 ) + ROM_LOAD( "82s129.7d", 0x0000, 0x0100, CRC(7f31066b) SHA1(15420780ec6b2870fc4539ec3afe4f0c58eedf12) ) +ROM_END + +/* + Unknown Golden Poker. + G set. Alternate HI-LO game, french text in copyright. + + Bootleg from Intercoast + Running in original Bonanza board. + + Program mapped at 0x5000-0x7fff + GFX ROMs are missing. + + The main difference is the way to play the HI-LO game: + + 1- When the player wins a hand, game will automatically switch to HI-LO + for double-up (no need to press the "double" button) + + 2- A card is shown to the player, then the game is to guess the drawn card + (BIG to guess bigger than actual card, LO to guess a lower card) + + 3- The player can still collect without playing double-up by pressing the "TAKE" button + + Also,the "WIN" message looks to be misplaced on the screen (too low) + Will show correctly if the system runs in 50hz. + + This set has the following sequence of coin2/credits in setup: + 1-6-4-5-8-10-20-50-100. This is odd... + +*/ +ROM_START( goldnpke ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "g_1.bin", 0x5000, 0x1000, CRC(d475cd13) SHA1(7c12b44ab938f26701587e57784f08e248e3afd2) ) + ROM_LOAD( "g_2.bin", 0x6000, 0x1000, CRC(ce080d66) SHA1(c5e11f7dc52a4d1661661a06d39316ba6a944adc) ) + ROM_LOAD( "g_3.bin", 0x7000, 0x1000, CRC(9d02b6f4) SHA1(bd01477268543d0edb2cec2a26bab0627a6d3414) ) + + ROM_REGION( 0x1800, "gfx1", 0 ) + ROM_FILL( 0x0000, 0x1000, 0x00 ) // filling the R-G bitplanes. + ROM_LOAD( "u38.5a", 0x1000, 0x0800, CRC(52fd35d2) SHA1(ad8bf8c222ceb2e9b3b6d9033866867f1977c65f) ) // chars rom + cards deck gfx, bitplane 3. + ROM_IGNORE( 0x0800) // discarding 2nd half (cards deck gfx). + + ROM_REGION( 0x1800, "gfx2", 0 ) + ROM_LOAD( "n43.2a", 0x0000, 0x0800, CRC(1419298b) SHA1(9e07c94c858f055d1c4987efd03c76cce936f4da) ) // cards deck gfx, bitplane 1. + ROM_IGNORE( 0x0800) + ROM_LOAD( "n40.4a", 0x0800, 0x0800, CRC(e0b96dcf) SHA1(b06af94361dd951573f187df575b31a9ada0c3e9) ) // cards deck gfx, bitplane 2. + ROM_IGNORE( 0x0800) + ROM_LOAD( "u38.5a", 0x1000, 0x0800, CRC(52fd35d2) SHA1(ad8bf8c222ceb2e9b3b6d9033866867f1977c65f) ) // chars rom + cards deck gfx, bitplane 3. + ROM_CONTINUE( 0x1000, 0x0800) // discarding 1nd half (chars). + + ROM_REGION( 0x0100, "proms", 0 ) + ROM_LOAD( "82s129.7d", 0x0000, 0x0100, CRC(7f31066b) SHA1(15420780ec6b2870fc4539ec3afe4f0c58eedf12) ) +ROM_END + +/* + Unknown Golden Poker. + HL Alternate HI-LO game, french text in copyright + + Bootleg from Intercoast + Running in original Bonanza board. + + Program mapped at 0x5000-0x7fff + GFX ROMs are missing. + + The main difference is the way to play the HI-LO game: + + 1- When the player wins a hand, game will automatically switch to HI-LO + for double-up (no need to press the "double" button) + + 2- A card is shown to the player, then the game is to guess the drawn card + (BIG to guess bigger than actual card, LO to guess a lower card) + + 3- The player can still collect without playing double-up by pressing the "TAKE" button + + Also,the "WIN" message looks to be misplaced on the screen (too low) + Will show correctly if the system runs in 50hz. + + Coin2 and Coupon/Note are fixed in 1 credit and cannot be changed. + +*/ +ROM_START( goldnpkf ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "hl_1.bin", 0x5000, 0x1000, CRC(d475cd13) SHA1(7c12b44ab938f26701587e57784f08e248e3afd2) ) + ROM_LOAD( "hl_2.bin", 0x6000, 0x1000, CRC(304eb644) SHA1(c876e0d6121dee594c4f5d75273c74982c5bd524) ) + ROM_LOAD( "hl_3.bin", 0x7000, 0x1000, CRC(47c15f44) SHA1(da7af46a8d17abffd30fffe6eb091d15f9f8f92c) ) + + ROM_REGION( 0x1800, "gfx1", 0 ) + ROM_FILL( 0x0000, 0x1000, 0x00 ) // filling the R-G bitplanes. + ROM_LOAD( "u38.5a", 0x1000, 0x0800, CRC(52fd35d2) SHA1(ad8bf8c222ceb2e9b3b6d9033866867f1977c65f) ) // chars rom + cards deck gfx, bitplane 3. + ROM_IGNORE( 0x0800) // discarding 2nd half (cards deck gfx). + + ROM_REGION( 0x1800, "gfx2", 0 ) + ROM_LOAD( "n43.2a", 0x0000, 0x0800, CRC(1419298b) SHA1(9e07c94c858f055d1c4987efd03c76cce936f4da) ) // cards deck gfx, bitplane 1. + ROM_IGNORE( 0x0800) + ROM_LOAD( "n40.4a", 0x0800, 0x0800, CRC(e0b96dcf) SHA1(b06af94361dd951573f187df575b31a9ada0c3e9) ) // cards deck gfx, bitplane 2. + ROM_IGNORE( 0x0800) + ROM_LOAD( "u38.5a", 0x1000, 0x0800, CRC(52fd35d2) SHA1(ad8bf8c222ceb2e9b3b6d9033866867f1977c65f) ) // chars rom + cards deck gfx, bitplane 3. + ROM_CONTINUE( 0x1000, 0x0800) // discarding 1nd half (chars). + + ROM_REGION( 0x0100, "proms", 0 ) + ROM_LOAD( "82s129.7d", 0x0000, 0x0100, CRC(7f31066b) SHA1(15420780ec6b2870fc4539ec3afe4f0c58eedf12) ) +ROM_END + /* Videotron Poker. Alternative controls set, with cards selector... @@ -11310,6 +11645,36 @@ ROM_LOAD( "m3-7611-5.7d", 0x0000, 0x0100, CRC(7f31066b) SHA1(15420780ec6b2870fc4539ec3afe4f0c58eedf12) ) ROM_END +/* + Maxi Draw Poker + Blitz System Inc. + + Ver 1.8 + +*/ +ROM_START( maxidpkr ) + ROM_REGION( 0x10000, "maincpu", 0 ) // program ROM + ROM_LOAD( "maxi-2_1.8.u4", 0x8000, 0x8000, CRC(98981016) SHA1(a655cd9528d5e3bf40034b4e65f50b91f7c4c59c) ) + + ROM_REGION( 0x8000, "cpubank", 0 ) // banked through MCU + ROM_LOAD( "maxi-3_1.8.u3", 0x0000, 0x8000, CRC(3fc6eae7) SHA1(81709db8c744406846d279be2b5cbb7c3ec60896) ) + + ROM_REGION( 0x0800, "mcu", 0 ) // 68705P5 microcontroller, borrowed from parent + ROM_LOAD( "mega-1.u11", 0x0000, 0x0800, BAD_DUMP CRC(621a7971) SHA1(49121f7b0d428a825ccd219622dcc4abe3572968) ) + + ROM_REGION( 0x3000, "gfx1", 0 ) + ROM_FILL( 0x0000, 0x2000, 0x000000 ) // filling the R-G bitplanes + ROM_LOAD( "car-1.a5", 0x2000, 0x1000, CRC(e2b97357) SHA1(606c2d0abfd235866fa5f3e9178f72ab91422103) ) // chars / cards deck gfx, bitplane 3 + + ROM_REGION( 0x3000, "gfx2", 0 ) + ROM_LOAD( "car-3.a2", 0x0000, 0x1000, CRC(819c06c4) SHA1(45b874554fb487173acf12daa4ff99e49e335362) ) // cards deck gfx, bitplane1 + ROM_LOAD( "car-2.a4", 0x1000, 0x1000, CRC(41eec680) SHA1(3723f66e1def3908f2e6ba2989def229d9846b02) ) // cards deck gfx, bitplane2 + ROM_COPY( "gfx1", 0x2800, 0x2000, 0x0800 ) // cards deck gfx, bitplane3. found in the 2nd quarter of the chars rom + + ROM_REGION( 0x0100, "proms", 0 ) + ROM_LOAD( "m3-7611-5.7d", 0x0000, 0x0100, CRC(7f31066b) SHA1(15420780ec6b2870fc4539ec3afe4f0c58eedf12) ) +ROM_END + /* Super 21. @@ -11375,6 +11740,64 @@ ROM_END +/******************************************************** + + Le Super Pendu. + Voyageur de L'Espace Inc. + + French language hangman style game manufactured in Canada. + Conversion kit for modified Bonanza Enterprises hardware. + + Prequel of "Le Pendu" game. + + For more details, see the lependu.cpp driver. + + +********************************************************/ + +ROM_START( lespendu ) // board #1 + ROM_REGION( 0x10000, "maincpu", 0 ) // program ROMs + ROM_LOAD( "pendu_2.12a", 0x6000, 0x1000, CRC(bd1c4763) SHA1(7f33b9866afcc456e3623e478abee77e1610d99b) ) + ROM_LOAD( "pendu_3.14a", 0x7000, 0x1000, CRC(4c973c2d) SHA1(edaf488019fc1b72b9344488b898a27ef886c1f9) ) + + ROM_REGION( 0x08000, "data", 0 ) // banked data + ROM_LOAD( "pendu_1.11a", 0x0000, 0x8000, CRC(acaecf36) SHA1(290867f18c5376189d389e6e508b34637c726352) ) + + ROM_REGION( 0x3000, "gfx1", 0 ) + ROM_FILL( 0x0000, 0x2000, 0x0000 ) // filling the R-G bitplanes + ROM_LOAD( "pendu_c.5a", 0x2000, 0x1000, CRC(c7cfc375) SHA1(d46b633ef007d0928fbd49b9703ab5248de8d545) ) // chars / other gfx, bitplane 3 + + ROM_REGION( 0x1800, "gfx2", 0 ) + ROM_LOAD( "pendu_a.2a", 0x0000, 0x0800, CRC(43770310) SHA1(e6c0d1d1b07a4c14fa26cfb4aedf1f94017bc9c3) ) // other gfx, bitplane2 + ROM_LOAD( "pendu_b.3a", 0x0800, 0x0800, CRC(19471258) SHA1(d4e2cf05e00945e034f968dcc314cc8e5832b840) ) // other gfx, bitplane1 + ROM_COPY( "gfx1", 0x2800, 0x1000, 0x0800 ) // other gfx, bitplane3. found in the 2nd half of the chars rom + + ROM_REGION( 0x0100, "proms", 0 ) + ROM_LOAD( "tbp24s10n.7d", 0x0000, 0x0100, CRC(7f31066b) SHA1(15420780ec6b2870fc4539ec3afe4f0c58eedf12) ) +ROM_END + +ROM_START( lespenduj ) // board #2 + ROM_REGION( 0x10000, "maincpu", 0 ) // program ROMs + ROM_LOAD( "pendu_jeje.12a", 0x6000, 0x1000, CRC(71d0430b) SHA1(6b6e5e3a3f5c51809953189e53191a175b03cfb3) ) + ROM_LOAD( "pendu_jeje_3.14a", 0x7000, 0x1000, CRC(8e1863a1) SHA1(0cfdd961fbc83219ee8f0e62432320a90c8296bf) ) + + ROM_REGION( 0x08000, "data", 0 ) // banked data + ROM_LOAD( "nosticker.11a", 0x0000, 0x8000, CRC(0a9853a3) SHA1(b9dabfd5b13b6ddddc2d8b266adc6e55f094e981) ) + + ROM_REGION( 0x3000, "gfx1", 0 ) + ROM_FILL( 0x0000, 0x2000, 0x0000 ) // filling the R-G bitplanes + ROM_LOAD( "1a_pendu_jeje.5a", 0x2000, 0x1000, CRC(c7cfc375) SHA1(d46b633ef007d0928fbd49b9703ab5248de8d545) ) // chars / other gfx + + ROM_REGION( 0x1800, "gfx2", 0 ) + ROM_LOAD( "2a_pendu_jeje.4a", 0x0000, 0x0800, CRC(19471258) SHA1(d4e2cf05e00945e034f968dcc314cc8e5832b840) ) // other gfx + ROM_LOAD( "3a_pendu_jeje.2a", 0x0800, 0x0800, CRC(2aefe346) SHA1(6540f126777c942737aeffd7f6f356ef2a71e146) ) // other gfx + ROM_COPY( "gfx1", 0x2800, 0x1000, 0x0800 ) // other gfx + + ROM_REGION( 0x0100, "proms", 0 ) + ROM_LOAD( "pk.7d", 0x0000, 0x0100, CRC(7f31066b) SHA1(15420780ec6b2870fc4539ec3afe4f0c58eedf12) ) +ROM_END + + /********************************************* * Driver Init * *********************************************/ @@ -11854,6 +12277,40 @@ ROM[0x7ffd] = 0x5f; } + +void goldnpkr_state::init_lespendu() +{ + uint8_t *ROM0 = memregion("maincpu")->base(); + uint8_t *ROM1 = memregion("data")->base(); + + ROM0[0x643d] = 0xff; // skip checksum + ROM0[0x643f] = 0xff; // skip checksum + ROM0[0x6461] = 0xff; // changing value to store at $01c1 (RAM security patch) + + ROM1[0x7aa3] = 0x20; // restore to original call, before RAM security patch + ROM1[0x7aa4] = 0xc3; + ROM1[0x7aa5] = 0x78; + + ROM0[0x75de] = 0x1f; // fix lamps bug +} + +void goldnpkr_state::init_lespenduj() +{ + uint8_t *ROM0 = memregion("maincpu")->base(); + uint8_t *ROM1 = memregion("data")->base(); + + ROM0[0x643d] = 0xff; // skip checksum + ROM0[0x643f] = 0xff; // skip checksum + ROM0[0x6461] = 0xff; // changing value to store at $01c1 (RAM security patch) + + ROM1[0x7aa3] = 0x20; // restore to original call, before RAM security patch + ROM1[0x7aa4] = 0xc8; + ROM1[0x7aa5] = 0x78; + + ROM0[0x766c] = 0x17; // fix lamps bug + ROM0[0x7749] = 0x17; // fix lamps bug +} + } // anonymous namespace @@ -11864,7 +12321,10 @@ // YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS LAYOUT GAMEL( 1981, goldnpkr, 0, goldnpkr, goldnpkr, goldnpkr_state, empty_init, ROT0, "Bonanza Enterprises, Ltd", "Golden Poker Double Up (Big Boy)", 0, layout_goldnpkr ) GAMEL( 1981, goldnpkb, goldnpkr, goldnpkr, goldnpkr, goldnpkr_state, empty_init, ROT0, "Bonanza Enterprises, Ltd", "Golden Poker Double Up (Mini Boy)", 0, layout_goldnpkr ) -GAMEL( 198?, goldnpkc, goldnpkr, goldnpkr, goldnpkr, goldnpkr_state, empty_init, ROT0, "bootleg", "Golden Poker Double Up (bootleg)", 0, layout_goldnpkr ) +GAMEL( 198?, goldnpkc, goldnpkr, goldnpkr, goldnpkr, goldnpkr_state, empty_init, ROT0, "bootleg", "Golden Poker Double Up (bootleg, set 1)", 0, layout_goldnpkr ) +GAMEL( 198?, goldnpkd, goldnpkr, goldnpkr, goldnpkr, goldnpkr_state, empty_init, ROT0, "bootleg", "Golden Poker Double Up (bootleg, set 2)", MACHINE_NOT_WORKING, layout_goldnpkr ) // always get a winning flush +GAMEL( 1983, goldnpke, goldnpkr, goldnpkr, goldnpkr, goldnpkr_state, empty_init, ROT0, "Intercoast (bootleg)", "Golden Poker Double Up (bootleg, set 3)", 0, layout_goldnpkr ) +GAMEL( 1983, goldnpkf, goldnpkr, goldnpkr, goldnpkr, goldnpkr_state, empty_init, ROT0, "Intercoast (bootleg)", "Golden Poker Double Up (bootleg, set 4)", 0, layout_goldnpkr ) GAMEL( 198?, videtron, 0, goldnpkr, videtron, goldnpkr_state, empty_init, ROT0, "", "Videotron Poker (cards selector, set 1)", 0, layout_goldnpkr ) GAMEL( 198?, videtron2, videtron, goldnpkr, videtron, goldnpkr_state, empty_init, ROT0, "", "Videotron Poker (cards selector, set 2)", 0, layout_goldnpkr ) @@ -12017,6 +12477,9 @@ GAME( 198?, animpkr, 0, icp_ext, animpkr, goldnpkr_state, empty_init, ROT0, "", "unknown rocket/animal-themed poker", MACHINE_IMPERFECT_COLORS ) // banked program. how to switch gfx? +GAMEL( 198?, lespendu, 0, lespendu, lespendu, goldnpkr_state, init_lespendu, ROT0, "Voyageur de L'Espace Inc.", "Le Super Pendu (V1, words set #1)", 0, layout_lespendu ) +GAMEL( 198?, lespenduj, 0, lespendu, lespendu, goldnpkr_state, init_lespenduj,ROT0, "Voyageur de L'Espace Inc.", "Le Super Pendu (V1, words set #2)", 0, layout_lespendu ) + /*************************************** SETS W/IRQ0 ***************************************/ @@ -12031,3 +12494,4 @@ // YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS GAME( 1990, megadpkr, 0, megadpkr, megadpkr, blitz_state, empty_init, ROT0, "Blitz System", "Mega Double Poker (conversion kit, version 2.3 MD)", 0 ) GAME( 1990, megadpkrb, megadpkr, megadpkr, megadpkr, blitz_state, empty_init, ROT0, "Blitz System", "Mega Double Poker (conversion kit, version 2.1 MD)", 0 ) +GAME( 1990, maxidpkr, 0, megadpkr, megadpkr, blitz_state, empty_init, ROT0, "Blitz System", "Maxi Double Poker (version 1.8)", MACHINE_NOT_WORKING ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/goldstar.cpp mame-0.243+dfsg.1/src/mame/drivers/goldstar.cpp --- mame-0.242+dfsg.1/src/mame/drivers/goldstar.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/goldstar.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -8237,17 +8237,6 @@ }; #endif -static const gfx_layout cb3c_tiles8x8_layout = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { 0, 1, 2, 3 }, - { 4, 0, 12, 8, 20, 16, 28, 24 }, - { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 }, - 8*32 -}; - static const gfx_layout cb3c_tiles8x32_layout = { @@ -8401,7 +8390,7 @@ GFXDECODE_END static GFXDECODE_START( gfx_cb3c ) - GFXDECODE_ENTRY( "gfx1", 0, cb3c_tiles8x8_layout, 0, 16 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x4_packed_lsb, 0, 16 ) GFXDECODE_ENTRY( "gfx2", 0, cb3c_tiles8x32_layout, 128, 8 ) GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/gottlieb.cpp mame-0.243+dfsg.1/src/mame/drivers/gottlieb.cpp --- mame-0.242+dfsg.1/src/mame/drivers/gottlieb.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/gottlieb.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -230,6 +230,10 @@ /* register for save states */ save_item(NAME(m_joystick_select)); save_item(NAME(m_track)); + save_item(NAME(m_knocker_prev)); + save_item(NAME(m_gfxcharlo)); + save_item(NAME(m_gfxcharhi)); + save_item(NAME(m_weights)); /* see if we have a laserdisc */ if (m_laserdisc != nullptr) @@ -1746,16 +1750,6 @@ /* the games can store char gfx data in either a 4k RAM area (128 chars), or */ /* a 8k ROM area (256 chars). */ -static const gfx_layout bg_layout = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { STEP4(0,1) }, - { STEP8(0,4) }, - { STEP8(0,32) }, - 32*8 -}; static const gfx_layout fg_layout = { @@ -1769,9 +1763,9 @@ }; static GFXDECODE_START( gfxdecode ) - GFXDECODE_RAM( "charram", 0, bg_layout, 0, 1 ) /* the game dynamically modifies this */ - GFXDECODE_ENTRY( "bgtiles", 0, bg_layout, 0, 1 ) - GFXDECODE_ENTRY( "sprites", 0, fg_layout, 0, 1 ) + GFXDECODE_RAM( "charram", 0, gfx_8x8x4_packed_msb, 0, 1 ) /* the game dynamically modifies this */ + GFXDECODE_ENTRY( "bgtiles", 0, gfx_8x8x4_packed_msb, 0, 1 ) + GFXDECODE_ENTRY( "sprites", 0, fg_layout, 0, 1 ) GFXDECODE_END @@ -2677,33 +2671,33 @@ *************************************/ /* games using rev 1 sound board */ -GAME( 1982, reactor, 0, reactor, reactor, gottlieb_state, init_ramtiles, ROT0, "Gottlieb", "Reactor", MACHINE_IMPERFECT_SOUND ) -GAME( 1982, qbert, 0, qbert, qbert, gottlieb_state, init_qbert, ROT270, "Gottlieb", "Q*bert (US set 1)", MACHINE_IMPERFECT_SOUND ) -GAME( 1982, qberta, qbert, qbert, qbert, gottlieb_state, init_qbert, ROT270, "Gottlieb", "Q*bert (US set 2)", MACHINE_IMPERFECT_SOUND ) -GAME( 1982, qbertj, qbert, qbert, qbert, gottlieb_state, init_qbert, ROT270, "Gottlieb (Konami license)", "Q*bert (Japan)", MACHINE_IMPERFECT_SOUND ) -GAME( 1982, myqbert, qbert, qbert, qbert, gottlieb_state, init_qbert, ROT270, "Gottlieb", "Mello Yello Q*bert", MACHINE_IMPERFECT_SOUND ) -GAME( 1982, qberttst, qbert, qbert, qbert, gottlieb_state, init_qbert, ROT270, "Gottlieb", "Q*bert (early test version)", MACHINE_IMPERFECT_SOUND ) -GAME( 1982, qbtrktst, qbert, qbert, qbert, gottlieb_state, init_qbert, ROT270, "Gottlieb", "Q*bert Board Input Test Rom", MACHINE_IMPERFECT_SOUND ) -GAME( 1982, insector, 0, gottlieb1, insector, gottlieb_state, init_romtiles, ROT0, "Gottlieb", "Insector (prototype)", 0 ) -GAME( 1982, tylz, 0, tylz, tylz, gottlieb_state, init_romtiles, ROT0, "Mylstar", "Tylz (prototype)", MACHINE_IMPERFECT_SOUND ) // modified sound hw? -GAME( 1984, argusg, 0, gottlieb1_rom, argusg, gottlieb_state, init_ramtiles, ROT0, "Gottlieb", "Argus (Gottlieb, prototype)" , 0) // aka Guardian / Protector? -GAME( 1983, mplanets, 0, gottlieb1, mplanets, gottlieb_state, init_romtiles, ROT270, "Gottlieb", "Mad Planets", 0 ) -GAME( 1983, mplanetsuk, mplanets, gottlieb1, mplanets, gottlieb_state, init_romtiles, ROT270, "Gottlieb (Taitel license)", "Mad Planets (UK)", 0 ) -GAME( 1983, krull, 0, gottlieb1_rom, krull, gottlieb_state, init_ramtiles, ROT270, "Gottlieb", "Krull", 0 ) -GAME( 1983, kngtmare, 0, gottlieb1, kngtmare, gottlieb_state, init_romtiles, ROT0, "Gottlieb", "Knightmare (prototype)", MACHINE_NO_SOUND ) // Missing sound ROMs -GAME( 1983, sqbert, 0, qbert, qbert, gottlieb_state, init_qbert, ROT270, "Mylstar", "Faster, Harder, More Challenging Q*bert (prototype)", MACHINE_IMPERFECT_SOUND ) -GAME( 1983, qbertqub, 0, qbert, qbertqub, gottlieb_state, init_qbertqub, ROT270, "Mylstar", "Q*bert's Qubes", MACHINE_IMPERFECT_SOUND ) -GAME( 1984, curvebal, 0, gottlieb1, curvebal, gottlieb_state, init_romtiles, ROT270, "Mylstar", "Curve Ball", 0 ) +GAME( 1982, reactor, 0, reactor, reactor, gottlieb_state, init_ramtiles, ROT0, "Gottlieb", "Reactor", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1982, qbert, 0, qbert, qbert, gottlieb_state, init_qbert, ROT270, "Gottlieb", "Q*bert (US set 1)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1982, qberta, qbert, qbert, qbert, gottlieb_state, init_qbert, ROT270, "Gottlieb", "Q*bert (US set 2)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1982, qbertj, qbert, qbert, qbert, gottlieb_state, init_qbert, ROT270, "Gottlieb (Konami license)", "Q*bert (Japan)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1982, myqbert, qbert, qbert, qbert, gottlieb_state, init_qbert, ROT270, "Gottlieb", "Mello Yello Q*bert", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1982, qberttst, qbert, qbert, qbert, gottlieb_state, init_qbert, ROT270, "Gottlieb", "Q*bert (early test version)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1982, qbtrktst, qbert, qbert, qbert, gottlieb_state, init_qbert, ROT270, "Gottlieb", "Q*bert Board Input Test Rom", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1982, insector, 0, gottlieb1, insector, gottlieb_state, init_romtiles, ROT0, "Gottlieb", "Insector (prototype)", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, tylz, 0, tylz, tylz, gottlieb_state, init_romtiles, ROT0, "Mylstar", "Tylz (prototype)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) // modified sound hw? +GAME( 1984, argusg, 0, gottlieb1_rom, argusg, gottlieb_state, init_ramtiles, ROT0, "Gottlieb", "Argus (Gottlieb, prototype)" , MACHINE_SUPPORTS_SAVE ) // aka Guardian / Protector? +GAME( 1983, mplanets, 0, gottlieb1, mplanets, gottlieb_state, init_romtiles, ROT270, "Gottlieb", "Mad Planets", MACHINE_SUPPORTS_SAVE ) +GAME( 1983, mplanetsuk, mplanets, gottlieb1, mplanets, gottlieb_state, init_romtiles, ROT270, "Gottlieb (Taitel license)", "Mad Planets (UK)", MACHINE_SUPPORTS_SAVE ) +GAME( 1983, krull, 0, gottlieb1_rom, krull, gottlieb_state, init_ramtiles, ROT270, "Gottlieb", "Krull", MACHINE_SUPPORTS_SAVE ) +GAME( 1983, kngtmare, 0, gottlieb1, kngtmare, gottlieb_state, init_romtiles, ROT0, "Gottlieb", "Knightmare (prototype)", MACHINE_NO_SOUND | MACHINE_SUPPORTS_SAVE ) // Missing sound ROMs +GAME( 1983, sqbert, 0, qbert, qbert, gottlieb_state, init_qbert, ROT270, "Mylstar", "Faster, Harder, More Challenging Q*bert (prototype)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1983, qbertqub, 0, qbert, qbertqub, gottlieb_state, init_qbertqub, ROT270, "Mylstar", "Q*bert's Qubes", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1984, curvebal, 0, gottlieb1, curvebal, gottlieb_state, init_romtiles, ROT270, "Mylstar", "Curve Ball", MACHINE_SUPPORTS_SAVE ) /* games using rev 2 sound board */ -GAME( 1983, screwloo, 0, screwloo, screwloo, gottlieb_state, init_screwloo, ROT0, "Mylstar", "Screw Loose (prototype)", 0 ) +GAME( 1983, screwloo, 0, screwloo, screwloo, gottlieb_state, init_screwloo, ROT0, "Mylstar", "Screw Loose (prototype)", MACHINE_SUPPORTS_SAVE ) GAME( 1983, mach3, 0, g2laser, mach3, gottlieb_state, init_romtiles, ROT0, "Mylstar", "M.A.C.H. 3 (set 1)", 0 ) GAME( 1983, mach3a, mach3, g2laser, mach3, gottlieb_state, init_romtiles, ROT0, "Mylstar", "M.A.C.H. 3 (set 2)", 0 ) GAME( 1983, mach3b, mach3, g2laser, mach3, gottlieb_state, init_romtiles, ROT0, "Mylstar", "M.A.C.H. 3 (set 3)", 0 ) GAME( 1984, cobram3, cobra, cobram3, cobram3, gottlieb_state, init_romtiles, ROT0, "Data East", "Cobra Command (M.A.C.H. 3 hardware, set 1)", 0 ) GAME( 1984, cobram3a, cobra, cobram3, cobram3, gottlieb_state, init_romtiles, ROT0, "Data East", "Cobra Command (M.A.C.H. 3 hardware, set 2)", 0 ) GAME( 1984, usvsthem, 0, g2laser, usvsthem, gottlieb_state, init_romtiles, ROT0, "Mylstar", "Us vs. Them", 0 ) -GAME( 1984, 3stooges, 0, gottlieb2_ram_rom, 3stooges, gottlieb_state, init_stooges, ROT0, "Mylstar", "The Three Stooges In Brides Is Brides (set 1)", 0 ) -GAME( 1984, 3stoogesa, 3stooges, gottlieb2_ram_rom, 3stooges, gottlieb_state, init_stooges, ROT0, "Mylstar", "The Three Stooges In Brides Is Brides (set 2)", 0 ) -GAME( 1984, vidvince, 0, gottlieb2_ram_rom, vidvince, gottlieb_state, init_vidvince, ROT0, "Mylstar", "Video Vince and the Game Factory (prototype)", MACHINE_IMPERFECT_GRAPHICS ) // sprite wrapping issues -GAME( 1984, wizwarz, 0, gottlieb2, wizwarz, gottlieb_state, init_romtiles, ROT0, "Mylstar", "Wiz Warz (prototype)", 0 ) +GAME( 1984, 3stooges, 0, gottlieb2_ram_rom, 3stooges, gottlieb_state, init_stooges, ROT0, "Mylstar", "The Three Stooges In Brides Is Brides (set 1)", MACHINE_SUPPORTS_SAVE ) +GAME( 1984, 3stoogesa, 3stooges, gottlieb2_ram_rom, 3stooges, gottlieb_state, init_stooges, ROT0, "Mylstar", "The Three Stooges In Brides Is Brides (set 2)", MACHINE_SUPPORTS_SAVE ) +GAME( 1984, vidvince, 0, gottlieb2_ram_rom, vidvince, gottlieb_state, init_vidvince, ROT0, "Mylstar", "Video Vince and the Game Factory (prototype)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) // sprite wrapping issues +GAME( 1984, wizwarz, 0, gottlieb2, wizwarz, gottlieb_state, init_romtiles, ROT0, "Mylstar", "Wiz Warz (prototype)", MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/gp_1.cpp mame-0.243+dfsg.1/src/mame/drivers/gp_1.cpp --- mame-0.242+dfsg.1/src/mame/drivers/gp_1.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/gp_1.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -577,14 +577,14 @@ GAME(1978, gp_110, 0, gp_1, gp_1, gp_1_state, empty_init, ROT0, "Game Plan", "Model 110", MACHINE_IS_BIOS_ROOT | MACHINE_NOT_WORKING) // Chimes -GAME(1978, blvelvet, gp_110, gp_1, gp_1, gp_1_state, empty_init, ROT0, "Game Plan", "Black Velvet", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1978, camlight, gp_110, gp_1, gp_1, gp_1_state, empty_init, ROT0, "Game Plan", "Camel Lights", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1978, foxylady, gp_110, gp_1, gp_1, gp_1_state, empty_init, ROT0, "Game Plan", "Foxy Lady", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1978, real, gp_110, gp_1, gp_1, gp_1_state, empty_init, ROT0, "Game Plan", "Real", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1978, rio, gp_110, gp_1, gp_1, gp_1_state, empty_init, ROT0, "Game Plan", "Rio", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1978, chucklck, gp_110, gp_1, gp_1, gp_1_state, empty_init, ROT0, "Game Plan", "Chuck-A-Luck", MACHINE_IS_SKELETON_MECHANICAL ) +GAME(1978, blvelvet, gp_110, gp_1, gp_1, gp_1_state, empty_init, ROT0, "Game Plan", "Black Velvet", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1978, camlight, gp_110, gp_1, gp_1, gp_1_state, empty_init, ROT0, "Game Plan", "Camel Lights", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1978, foxylady, gp_110, gp_1, gp_1, gp_1_state, empty_init, ROT0, "Game Plan", "Foxy Lady", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1978, real, gp_110, gp_1, gp_1, gp_1_state, empty_init, ROT0, "Game Plan", "Real", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1978, rio, gp_110, gp_1, gp_1, gp_1_state, empty_init, ROT0, "Game Plan", "Rio", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1978, chucklck, gp_110, gp_1, gp_1, gp_1_state, empty_init, ROT0, "Game Plan", "Chuck-A-Luck", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // SN76477 sound -GAME(1979, famlyfun, 0, gp_1s, gp_1, gp_1_state, empty_init, ROT0, "Game Plan", "Family Fun!", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1979, startrip, 0, gp_1s, gp_1, gp_1_state, empty_init, ROT0, "Game Plan", "Star Trip", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1979, vegasgp, 0, gp_1s, gp_1, gp_1_state, empty_init, ROT0, "Game Plan", "Vegas (Game Plan)", MACHINE_IS_SKELETON_MECHANICAL ) +GAME(1979, famlyfun, 0, gp_1s, gp_1, gp_1_state, empty_init, ROT0, "Game Plan", "Family Fun!", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1979, startrip, 0, gp_1s, gp_1, gp_1_state, empty_init, ROT0, "Game Plan", "Star Trip", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1979, vegasgp, 0, gp_1s, gp_1, gp_1_state, empty_init, ROT0, "Game Plan", "Vegas (Game Plan)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/gp_2.cpp mame-0.243+dfsg.1/src/mame/drivers/gp_2.cpp --- mame-0.242+dfsg.1/src/mame/drivers/gp_2.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/gp_2.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -836,23 +836,23 @@ } // anonymous namespace // GP1 dips -GAME( 1979, sshootep, 0, gp_2, gp_1, gp_2_state, empty_init, ROT0, "Game Plan", "Sharpshooter (Game Plan)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1979, coneyis, 0, gp_2, gp_1, gp_2_state, empty_init, ROT0, "Game Plan", "Old Coney Island!", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1980, lizard, 0, gp_2, gp_1, gp_2_state, empty_init, ROT0, "Game Plan", "Pinball Lizard", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1982, suprnova, 0, gp_2, gp_1, gp_2_state, empty_init, ROT0, "Game Plan", "Super Nova (Game Plan)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1983, sshootr2, 0, gp_2, gp_1, gp_2_state, empty_init, ROT0, "Game Plan", "Sharp Shooter II", MACHINE_IS_SKELETON_MECHANICAL ) +GAME( 1979, sshootep, 0, gp_2, gp_1, gp_2_state, empty_init, ROT0, "Game Plan", "Sharpshooter (Game Plan)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1979, coneyis, 0, gp_2, gp_1, gp_2_state, empty_init, ROT0, "Game Plan", "Old Coney Island!", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1980, lizard, 0, gp_2, gp_1, gp_2_state, empty_init, ROT0, "Game Plan", "Pinball Lizard", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1982, suprnova, 0, gp_2, gp_1, gp_2_state, empty_init, ROT0, "Game Plan", "Super Nova (Game Plan)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1983, sshootr2, 0, gp_2, gp_1, gp_2_state, empty_init, ROT0, "Game Plan", "Sharp Shooter II", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // GP2 dips -GAME( 1981, gwarfare, 0, gp_2, gp_2, gp_2_state, empty_init, ROT0, "Game Plan", "Global Warfare", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1982, mbossy, 0, gp_2, gp_2, gp_2_state, empty_init, ROT0, "Game Plan", "Mike Bossy", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1984, attila, 0, gp_2, gp_2, gp_2_state, empty_init, ROT0, "Game Plan", "Attila The Hun", MACHINE_IS_SKELETON_MECHANICAL ) +GAME( 1981, gwarfare, 0, gp_2, gp_2, gp_2_state, empty_init, ROT0, "Game Plan", "Global Warfare", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1982, mbossy, 0, gp_2, gp_2, gp_2_state, empty_init, ROT0, "Game Plan", "Mike Bossy", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1984, attila, 0, gp_2, gp_2, gp_2_state, empty_init, ROT0, "Game Plan", "Attila The Hun", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // revolving match -GAME( 1984, agent777, 0, gp_2, gp_2, gp_2_state, empty_init, ROT0, "Game Plan", "Agents 777", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1985, cpthook, 0, gp_2, gp_2, gp_2_state, empty_init, ROT0, "Game Plan", "Captain Hook", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1985, ladyshot, 0, gp_2, gp_2, gp_2_state, empty_init, ROT0, "Game Plan", "Lady Sharpshooter (set 1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1985, ladyshota, ladyshot, gp_2, gp_2, gp_2_state, empty_init, ROT0, "Game Plan", "Lady Sharpshooter (set 2)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1985, andromep, 0, gp_2, gp_2, gp_2_state, empty_init, ROT0, "Game Plan", "Andromeda (set 1)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1985, andromepa, andromep, gp_2, gp_2, gp_2_state, empty_init, ROT0, "Game Plan", "Andromeda (set 2)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1985, cyclopes, 0, gp_2, gp_2, gp_2_state, empty_init, ROT0, "Game Plan", "Cyclopes (12/85)", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1985, cyclopes1, cyclopes, gp_2, gp_2, gp_2_state, empty_init, ROT0, "Game Plan", "Cyclopes (11/85)", MACHINE_IS_SKELETON_MECHANICAL) +GAME( 1984, agent777, 0, gp_2, gp_2, gp_2_state, empty_init, ROT0, "Game Plan", "Agents 777", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1985, cpthook, 0, gp_2, gp_2, gp_2_state, empty_init, ROT0, "Game Plan", "Captain Hook", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1985, ladyshot, 0, gp_2, gp_2, gp_2_state, empty_init, ROT0, "Game Plan", "Lady Sharpshooter (set 1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1985, ladyshota, ladyshot, gp_2, gp_2, gp_2_state, empty_init, ROT0, "Game Plan", "Lady Sharpshooter (set 2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1985, andromep, 0, gp_2, gp_2, gp_2_state, empty_init, ROT0, "Game Plan", "Andromeda (set 1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1985, andromepa, andromep, gp_2, gp_2, gp_2_state, empty_init, ROT0, "Game Plan", "Andromeda (set 2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1985, cyclopes, 0, gp_2, gp_2, gp_2_state, empty_init, ROT0, "Game Plan", "Cyclopes (12/85)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1985, cyclopes1, cyclopes, gp_2, gp_2, gp_2_state, empty_init, ROT0, "Game Plan", "Cyclopes (11/85)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/gstriker.cpp mame-0.243+dfsg.1/src/mame/drivers/gstriker.cpp --- mame-0.242+dfsg.1/src/mame/drivers/gstriker.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/gstriker.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -207,18 +207,6 @@ /*** GFX DECODE **************************************************************/ -static const gfx_layout gs_8x8x4_layout = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { 0,1,2,3 }, - { 4, 0, 12, 8, 20, 16, 28, 24 }, - { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 }, - 8*32 -}; - - static const gfx_layout gs_16x16x4_layout = { 16,16, @@ -236,9 +224,9 @@ }; static GFXDECODE_START( gfx_gstriker ) - GFXDECODE_ENTRY( "gfx1", 0, gs_8x8x4_layout, 0, 256 ) - GFXDECODE_ENTRY( "gfx2", 0, gs_16x16x4_layout, 0, 256 ) - GFXDECODE_ENTRY( "gfx3", 0, gs_16x16x4_layout, 0, 256 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x4_packed_lsb, 0, 256 ) + GFXDECODE_ENTRY( "gfx2", 0, gs_16x16x4_layout, 0, 256 ) + GFXDECODE_ENTRY( "gfx3", 0, gs_16x16x4_layout, 0, 256 ) GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/gticlub.cpp mame-0.243+dfsg.1/src/mame/drivers/gticlub.cpp --- mame-0.242+dfsg.1/src/mame/drivers/gticlub.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/gticlub.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -43,7 +43,7 @@ Game (C) Year ----------------------------------------- -GTI Club Konami 1996 +GTI Club: Rally Cote D'Azur Konami 1996 Jet Wave / Wave Shark Konami 1996 (video board only) Operation Thunder Hurricane Konami 1997 Solar Assault Konami 1997 @@ -112,7 +112,7 @@ |--------------------------------------- ROM Locations --------------------------------------| Game 13K 2S 5S 7S 9S 12U 14U 19R 19U 21R 21U -------------------------------------------------------------------------------------------------------------------------- -GTI Club 688A07 688A12 688A11 688A10 688A09 688A06 688A05 688AAA04 688AAA02 688AAA03 688AAA01 +GTI Club: Rally Cote D'Azur 688A07 688A12 688A11 688A10 688A09 688A06 688A05 688AAA04 688AAA02 688AAA03 688AAA01 Jet Wave - see note - Hang Pilot 685A07 - - 685A10 685A09 685A06 685A05 685JAB04 685JAB02 685JAB03 685JAB01 Operation Thunder Hurricane 680A07 680A12 680A11 680A10 680A09 680A06 680A05 680UAA04 680UAA02 680UAA03 680UAA01 @@ -213,7 +213,7 @@ |---------------------- ROM Locations -----------------------| Game 2D 4D 6D 9D 11D 13D 16D 18D ------------------------------------------------------------------------------------------ -GTI Club - 688A16 - 688A15 - 688A14 - 688A13 +GTI Club: Rally Cote D'Azur - 688A16 - 688A15 - 688A14 - 688A13 Jet Wave - 678A16 - 678A15 - 678A14 - 678A13 Operation Thunder Hurricane - 680A16 - 680A15 - 680A14 - 680A13 Solar Assault - 792A16 - 792A15 - 792A14 - 792A13 @@ -1372,10 +1372,10 @@ /*************************************************************************/ -GAME( 1996, gticlub, 0, gticlub, gticlub, gticlub_state, init_gticlub, ROT0, "Konami", "GTI Club (ver EAA)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_NODEVICE_LAN ) -GAME( 1996, gticlubu, gticlub, gticlub, gticlub, gticlub_state, init_gticlub, ROT0, "Konami", "GTI Club (ver UAA)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_NODEVICE_LAN ) -GAME( 1996, gticluba, gticlub, gticlub, gticlub, gticlub_state, init_gticlub, ROT0, "Konami", "GTI Club (ver AAA)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_NODEVICE_LAN ) -GAME( 1996, gticlubj, gticlub, gticlub, gticlub, gticlub_state, init_gticlub, ROT0, "Konami", "GTI Club (ver JAA)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_NODEVICE_LAN ) +GAME( 1996, gticlub, 0, gticlub, gticlub, gticlub_state, init_gticlub, ROT0, "Konami", "GTI Club: Rally Cote D'Azur (ver EAA)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_NODEVICE_LAN ) +GAME( 1996, gticlubu, gticlub, gticlub, gticlub, gticlub_state, init_gticlub, ROT0, "Konami", "GTI Club: Rally Cote D'Azur (ver UAA)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_NODEVICE_LAN ) +GAME( 1996, gticluba, gticlub, gticlub, gticlub, gticlub_state, init_gticlub, ROT0, "Konami", "GTI Club: Rally Cote D'Azur (ver AAA)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_NODEVICE_LAN ) +GAME( 1996, gticlubj, gticlub, gticlub, gticlub, gticlub_state, init_gticlub, ROT0, "Konami", "GTI Club: Rally Cote D'Azur (ver JAA)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_NODEVICE_LAN ) GAME( 1997, thunderh, 0, thunderh, thunderh, gticlub_state, init_gticlub, ROT0, "Konami", "Operation Thunder Hurricane (ver EAA)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_NODEVICE_LAN ) GAME( 1997, thunderhu, thunderh, thunderh, thunderh, gticlub_state, init_gticlub, ROT0, "Konami", "Operation Thunder Hurricane (ver UAA)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_NODEVICE_LAN ) GAME( 1997, slrasslt, 0, slrasslt, slrasslt, gticlub_state, init_gticlub, ROT0, "Konami", "Solar Assault (ver UAA)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) // Based on Revised code diff -Nru mame-0.242+dfsg.1/src/mame/drivers/gts1.cpp mame-0.243+dfsg.1/src/mame/drivers/gts1.cpp --- mame-0.242+dfsg.1/src/mame/drivers/gts1.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/gts1.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -159,8 +159,8 @@ u8 m_strobe = 0U; //!< switches strobe lines (5 lower bits used) u8 m_nvram_addr = 0xffU; //!< NVRAM address u8 m_nvram_data = 0U; - bool m_nvram_e2 = 0; //!< NVRWAM enable (E2 line) - bool m_nvram_wr = 0; //!< NVRWAM write (W/R line) + bool m_nvram_e2 = false; //!< NVRWAM enable (E2 line) + bool m_nvram_wr = false; //!< NVRWAM write (W/R line) u16 m_6351_addr = 0U; //!< ROM MM6351 address (12 bits) u8 m_z30_out = 0U; //!< 4-to-16 decoder outputs u8 m_lamp_data = 0U; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/gts3.cpp mame-0.243+dfsg.1/src/mame/drivers/gts3.cpp --- mame-0.242+dfsg.1/src/mame/drivers/gts3.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/gts3.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -101,8 +101,8 @@ void u5a_w(u8 data); DECLARE_WRITE_LINE_MEMBER(nmi_w); void mem_map(address_map &map); - bool m_dispclk = 0; - bool m_lampclk = 0; + bool m_dispclk = false; + bool m_lampclk = false; u8 m_digit = 0U; u8 m_row = 0U; // for lamps and switches u8 m_segment[4]{}; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/gundealr.cpp mame-0.243+dfsg.1/src/mame/drivers/gundealr.cpp --- mame-0.242+dfsg.1/src/mame/drivers/gundealr.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/gundealr.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -383,17 +383,6 @@ -static const gfx_layout layout8x8x4 = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { STEP4(0,1) }, - { STEP8(0,4) }, - { STEP8(0,4*8) }, - 8*8*4 -}; - static const gfx_layout layout16x16x4 = { 16,16, @@ -406,8 +395,8 @@ }; static GFXDECODE_START( gfx_gundealr ) - GFXDECODE_ENTRY( "gfx1", 0, layout8x8x4, 0, 16 ) /* colors 0-255 */ - GFXDECODE_ENTRY( "gfx2", 0, layout16x16x4, 256, 16 ) /* colors 256-511 */ + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x4_packed_msb, 0, 16 ) /* colors 0-255 */ + GFXDECODE_ENTRY( "gfx2", 0, layout16x16x4, 256, 16 ) /* colors 256-511 */ GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/hankin.cpp mame-0.243+dfsg.1/src/mame/drivers/hankin.cpp --- mame-0.242+dfsg.1/src/mame/drivers/hankin.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/hankin.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -79,7 +79,7 @@ void main_map(address_map &map); void audio_map(address_map &map); - bool m_timer_sb = 0; + bool m_timer_sb = false; u8 m_timer_s[3]{}; u8 m_vol = 0U; u8 m_ic2a = 0U; @@ -87,11 +87,11 @@ u8 m_ic10a = 0U; u8 m_ic10b = 0U; u8 m_ic11a = 0U; - bool m_ic11_ca2 = 0; - bool m_ic11_cb2 = 0; - bool m_ic10_cb2 = 0; - bool m_ic2_ca2 = 0; - bool m_ic2_cb2 = 0; + bool m_ic11_ca2 = false; + bool m_ic11_cb2 = false; + bool m_ic10_cb2 = false; + bool m_ic2_ca2 = false; + bool m_ic2_cb2 = false; u8 m_counter = 0U; u8 m_digit = 0U; u8 m_segment[5]{}; @@ -654,8 +654,8 @@ } // Anonymous namespace -GAME(1978, fjholden, 0, hankin, hankin, hankin_state, empty_init, ROT0, "Hankin", "FJ Holden", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1978, orbit1, 0, hankin, hankin, hankin_state, empty_init, ROT0, "Hankin", "Orbit 1", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1980, shark, 0, hankin, hankin, hankin_state, empty_init, ROT0, "Hankin", "Shark", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1980, howzat, 0, hankin, hankin, hankin_state, empty_init, ROT0, "Hankin", "Howzat!", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1981, empsback, 0, hankin, hankin, hankin_state, empty_init, ROT0, "Hankin", "The Empire Strikes Back (Hankin Pinball)", MACHINE_IS_SKELETON_MECHANICAL ) +GAME(1978, fjholden, 0, hankin, hankin, hankin_state, empty_init, ROT0, "Hankin", "FJ Holden", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1978, orbit1, 0, hankin, hankin, hankin_state, empty_init, ROT0, "Hankin", "Orbit 1", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1980, shark, 0, hankin, hankin, hankin_state, empty_init, ROT0, "Hankin", "Shark", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1980, howzat, 0, hankin, hankin, hankin_state, empty_init, ROT0, "Hankin", "Howzat!", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1981, empsback, 0, hankin, hankin, hankin_state, empty_init, ROT0, "Hankin", "The Empire Strikes Back (Hankin Pinball)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/hapyfish.cpp mame-0.243+dfsg.1/src/mame/drivers/hapyfish.cpp --- mame-0.242+dfsg.1/src/mame/drivers/hapyfish.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/hapyfish.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -114,7 +114,7 @@ bool m_i2c_scl = false; bool m_i2c_scl_pulse_started = false; bool m_i2c_started = false; - i2c_mode m_i2c_mode; + i2c_mode m_i2c_mode{}; uint8_t m_i2c_addr = 0; uint8_t m_i2c_addr_bits = 0; uint8_t m_i2c_data = 0; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/harddriv.cpp mame-0.243+dfsg.1/src/mame/drivers/harddriv.cpp --- mame-0.242+dfsg.1/src/mame/drivers/harddriv.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/harddriv.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -2648,6 +2648,41 @@ ROM_END +ROM_START( harddrivcbl ) // 3 board set based on harddrivc. Only slight changes to the first 4 main CPU ROMs (copyright removal and not much more) + ROM_REGION( 0x100000, "mainpcb:maincpu", 0 ) + ROM_LOAD16_BYTE( "08mainic.83", 0x000000, 0x010000, CRC(04ee5e48) SHA1(09632110c6e3bf935cc0046df50431b5e362ca46) ) + ROM_LOAD16_BYTE( "04mainic.85", 0x000001, 0x010000, CRC(2a37dc5e) SHA1(6e36696a1e67d5756d9b4bc81c52885f2a4223b0) ) + ROM_LOAD16_BYTE( "07mainic.82", 0x020000, 0x010000, CRC(c8d19312) SHA1(a5c9f133fcd88bebf77219f6ebc598db30c0f649) ) + ROM_LOAD16_BYTE( "03mainic.66", 0x020001, 0x010000, CRC(7392b8c8) SHA1(3af1fcf10b62ee2fce3adced5863e2816a63e6df) ) + ROM_LOAD16_BYTE( "06mainic.32", 0x0a0000, 0x010000, CRC(e5ea74e4) SHA1(58a8c0f16573fcc2c8739e6f72e485271e45af88) ) + ROM_LOAD16_BYTE( "02mainic.34", 0x0a0001, 0x010000, CRC(4d759891) SHA1(b82087d9549ccc2a7eef22591dd8b869f2768075) ) + ROM_LOAD16_BYTE( "05mainic.13", 0x0c0000, 0x010000, CRC(293c153b) SHA1(6300a50766b19ad203b5c7da28d51bf22054b39e) ) + ROM_LOAD16_BYTE( "01mainic.15", 0x0c0001, 0x010000, CRC(5630390d) SHA1(cd1932cee70cddd1fb2110d1aeebb573a13f1339) ) + + ROM_REGION( 0x20000, "mainpcb:harddriv_sound:soundcpu", 0 ) + ROM_LOAD16_BYTE( "14snd.h16", 0x000000, 0x008000, CRC(3f20a396) SHA1(f34819796087c543083f6baac6c778e0cdb7340a) ) + ROM_LOAD16_BYTE( "13snd.h18", 0x000001, 0x008000, CRC(6346bca3) SHA1(707dc86305142722a4757ba431cf6c7e9cf116b3) ) + + ROM_REGION16_BE( 0x60000, "mainpcb:user1", 0 ) + ROM_LOAD16_BYTE( "10dspic.17", 0x000000, 0x010000, BAD_DUMP CRC(1b77f171) SHA1(10434e492e4e9de5cd8543271914d5ba37c52b50) ) // was missing from the romset, but given the rest of the ROMs is identical it's reasonable to assume this is, too + ROM_LOAD16_BYTE( "12dspic.16", 0x000001, 0x010000, CRC(e50bec32) SHA1(30c504c730e8e568e78e06c756a23b8923e85b4b) ) + ROM_LOAD16_BYTE( "09dspic.7", 0x020000, 0x010000, CRC(998d3da2) SHA1(6ed560c2132e33858c91b1f4ab0247399665b5fd) ) + ROM_LOAD16_BYTE( "11dspic.8", 0x020001, 0x010000, CRC(bc59a2b7) SHA1(7dfde5bbaa0cf349b1ef5d6b076baded7330376a) ) + + ROM_REGION( 0x40000, "mainpcb:harddriv_sound:serialroms", 0 ) + ROM_LOAD( "15snd.a20", 0x000000, 0x010000, CRC(a88411dc) SHA1(1fd53c7eadffa163d5423df2f8338757e58d5f2e) ) + ROM_LOAD( "16snd.a19", 0x010000, 0x010000, CRC(071a4309) SHA1(c623bd51d6a4a56503fbf138138854d6a30b11d6) ) + ROM_LOAD( "17snd.a18", 0x020000, 0x010000, CRC(856548ff) SHA1(e8a17b274185c5e4ecf5f9f1c211e18b3ef2456d) ) + ROM_LOAD( "18snd.a17", 0x030000, 0x010000, CRC(f46ef09c) SHA1(ba62f73ee3b33d8f26b430ffa468f8792dca23de) ) + + ROM_REGION( 0x800, "mainpcb:200e", 0 ) + ROM_LOAD( "harddrivc.200e", 0x000000, 0x000800, BAD_DUMP CRC(560a0106) SHA1(7295a4f1255869c43c3cf146ddebaea62c30b850) ) // not dumped for this set + + ROM_REGION( 0x800, "mainpcb:210e", 0 ) + ROM_LOAD( "harddrivc.210e", 0x000000, 0x000800, BAD_DUMP CRC(208bba53) SHA1(c9a36015a66917df528b84d20d255b6b96a90e76) ) // not dumped for this set +ROM_END + + ROM_START( stunrun ) ROM_REGION( 0x100000, "mainpcb:maincpu", 0 ) /* 1MB for 68000 code */ ROM_LOAD16_BYTE( "136070-2102.200r", 0x000000, 0x010000, CRC(e0ed54d8) SHA1(15850568d8308b6499cbe55b5d8308041d906a29) ) @@ -5325,6 +5360,7 @@ GAME( 1990, harddrivcg, harddriv, harddrivc_machine, racedrivc, harddriv_new_state, empty_init, ROT0, "Atari Games", "Hard Drivin' (compact, German, rev 2)", 0 ) GAME( 1990, harddrivcb, harddriv, harddrivc_machine, racedrivc, harddriv_new_state, empty_init, ROT0, "Atari Games", "Hard Drivin' (compact, British, rev 2)", 0 ) GAME( 1990, harddrivc1, harddriv, harddrivc_machine, racedrivc, harddriv_new_state, empty_init, ROT0, "Atari Games", "Hard Drivin' (compact, rev 1)", 0 ) +GAME( 1990, harddrivcbl, harddriv, harddrivc_machine, racedrivc, harddriv_new_state, empty_init, ROT0, "bootleg", "Hard Drivin' (compact, rev 2 bootleg)", 0 ) GAME( 1989, stunrun, 0, stunrun_machine, stunrun, harddriv_new_state, empty_init, ROT0, "Atari Games", "S.T.U.N. Runner (rev 6)", 0 ) GAME( 1989, stunrunj, stunrun, stunrun_machine, stunrun, harddriv_new_state, empty_init, ROT0, "Atari Games", "S.T.U.N. Runner (rev 7, Japan)", 0 ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/hcastle.cpp mame-0.243+dfsg.1/src/mame/drivers/hcastle.cpp --- mame-0.242+dfsg.1/src/mame/drivers/hcastle.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/hcastle.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -9,31 +9,292 @@ ***************************************************************************/ #include "emu.h" -#include "includes/hcastle.h" + #include "includes/konamipt.h" +#include "video/k007121.h" #include "cpu/m6809/konami.h" #include "cpu/z80/z80.h" #include "machine/gen_latch.h" #include "machine/watchdog.h" +#include "sound/k007232.h" #include "sound/k051649.h" #include "sound/ymopl.h" +#include "video/bufsprite.h" +#include "emupal.h" #include "screen.h" #include "speaker.h" +#include "tilemap.h" + + +namespace { + +class hcastle_state : public driver_device +{ +public: + hcastle_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_audiocpu(*this, "audiocpu"), + m_k007121(*this, "k007121_%u", 1U), + m_k007232(*this, "k007232"), + m_spriteram(*this, "spriteram%u", 1U), + m_pf_videoram(*this, "pf_videoram%u", 1U), + m_mainbank(*this, "mainbank") + { } + + void hcastle(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; + +private: + // devices + required_device m_maincpu; + required_device m_gfxdecode; + required_device m_palette; + required_device m_audiocpu; + required_device_array m_k007121; + required_device m_k007232; + required_device_array m_spriteram; + + // memory pointers + required_shared_ptr_array m_pf_videoram; + required_memory_bank m_mainbank; + + // video-related + tilemap_t *m_tilemap[2]{}; + uint16_t m_pf_bankbase[2]{}; + int32_t m_old_pf[2]{}; + uint8_t m_gfx_bank = 0; + + void bankswitch_w(uint8_t data); + void soundirq_w(uint8_t data); + void coin_w(uint8_t data); + void gfxbank_w(uint8_t data); + uint8_t gfxbank_r(); + void sound_bank_w(uint8_t data); + template void pf_video_w(offs_t offset, uint8_t data); + template void pf_control_w(offs_t offset, uint8_t data); + template TILE_GET_INFO_MEMBER(get_tile_info); + TILEMAP_MAPPER_MEMBER(tilemap_scan); + void palette(palette_device &palette) const; + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + template void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, uint8_t *sbank); + void volume_callback(uint8_t data); + + void main_map(address_map &map); + void sound_map(address_map &map); +}; + + +// video + +void hcastle_state::palette(palette_device &palette) const +{ + uint8_t const *const color_prom = memregion("proms")->base(); + for (int chip = 0; chip < 2; chip++) + { + for (int pal = 0; pal < 8; pal++) + { + int const clut = (chip << 1) | (pal & 1); + + for (int i = 0; i < 0x100; i++) + { + uint8_t ctabentry; + + if (((pal & 0x01) == 0) && (color_prom[(clut << 8) | i] == 0)) + ctabentry = 0; + else + ctabentry = (pal << 4) | (color_prom[(clut << 8) | i] & 0x0f); + + palette.set_pen_indirect((chip << 11) | (pal << 8) | i, ctabentry); + } + } + } +} + + + +/*************************************************************************** + + Callbacks for the TileMap code + +***************************************************************************/ + +TILEMAP_MAPPER_MEMBER(hcastle_state::tilemap_scan) +{ + // logical (col,row) -> memory offset + return (col & 0x1f) + ((row & 0x1f) << 5) + ((col & 0x20) << 6); // skip 0x400 +} + +template // 0 = FG, 1 = BG +TILE_GET_INFO_MEMBER(hcastle_state::get_tile_info) +{ + uint8_t ctrl_5 = m_k007121[Which]->ctrlram_r(5); + uint8_t ctrl_6 = m_k007121[Which]->ctrlram_r(6); + int bit0 = (ctrl_5 >> 0) & 0x03; + int bit1 = (ctrl_5 >> 2) & 0x03; + int bit2 = (ctrl_5 >> 4) & 0x03; + int bit3 = (ctrl_5 >> 6) & 0x03; + int attr = m_pf_videoram[Which][tile_index]; + int tile = m_pf_videoram[Which][tile_index + 0x400]; + int color = attr & 0x7; + int bank = ((attr & 0x80) >> 7) | + ((attr >> (bit0 + 2)) & 0x02) | + ((attr >> (bit1 + 1)) & 0x04) | + ((attr >> (bit2 )) & 0x08) | + ((attr >> (bit3 - 1)) & 0x10); + + tileinfo.set(Which, + tile + bank * 0x100 + m_pf_bankbase[Which], + ((ctrl_6 & 0x30) * 2 + 16) + color, + 0); +} + + + +/*************************************************************************** + + Start the video hardware emulation. + +***************************************************************************/ + +void hcastle_state::video_start() +{ + // 0 = FG, 1 = BG + m_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(hcastle_state::get_tile_info<0>)), tilemap_mapper_delegate(*this, FUNC(hcastle_state::tilemap_scan)), 8, 8, 64, 32); + m_tilemap[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(hcastle_state::get_tile_info<1>)), tilemap_mapper_delegate(*this, FUNC(hcastle_state::tilemap_scan)), 8, 8, 64, 32); + + m_tilemap[0]->set_transparent_pen(0); +} + + + +/*************************************************************************** + + Memory handlers + +***************************************************************************/ + +template // 0 = FG, 1 = BG +void hcastle_state::pf_video_w(offs_t offset, uint8_t data) +{ + m_pf_videoram[Which][offset] = data; + m_tilemap[Which]->mark_tile_dirty(offset & 0xbff); +} + +void hcastle_state::gfxbank_w(uint8_t data) +{ + m_gfx_bank = data; +} + +uint8_t hcastle_state::gfxbank_r() +{ + return m_gfx_bank; +} + +template // 0 = FG, 1 = BG +void hcastle_state::pf_control_w(offs_t offset, uint8_t data) +{ + if (offset == 3) + { + if ((data & 0x8) == 0) + m_spriteram[Which]->copy(0x800, 0x800); + else + m_spriteram[Which]->copy(0x000, 0x800); + } + else if (offset == 7) + { + m_tilemap[Which]->set_flip((data & 0x08) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); + } + m_k007121[Which]->ctrl_w(offset, data); +} + +/*****************************************************************************/ + +template // 0 = FG, 1 = BG +void hcastle_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, uint8_t *sbank) +{ + int base_color = (m_k007121[Which]->ctrlram_r(6) & 0x30) * 2; + int bank_base = (Which == 0) ? 0x4000 * (m_gfx_bank & 1) : 0; + + m_k007121[Which]->sprites_draw(bitmap, cliprect, m_gfxdecode->gfx(Which), *m_palette, sbank, base_color, 0, bank_base, priority_bitmap, (uint32_t)-1); +} + +/*****************************************************************************/ + +uint32_t hcastle_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + uint8_t ctrl_1_0 = m_k007121[0]->ctrlram_r(0); + uint8_t ctrl_1_1 = m_k007121[0]->ctrlram_r(1); + uint8_t ctrl_1_2 = m_k007121[0]->ctrlram_r(2); + uint8_t ctrl_1_3 = m_k007121[0]->ctrlram_r(3); + uint8_t ctrl_2_0 = m_k007121[1]->ctrlram_r(0); + uint8_t ctrl_2_1 = m_k007121[1]->ctrlram_r(1); + uint8_t ctrl_2_2 = m_k007121[1]->ctrlram_r(2); + uint8_t ctrl_2_3 = m_k007121[1]->ctrlram_r(3); + + m_pf_bankbase[0] = 0x0000; + m_pf_bankbase[1] = 0x4000 * ((m_gfx_bank & 2) >> 1); + + if (ctrl_1_3 & 0x01) + m_pf_bankbase[0] += 0x2000; + if (ctrl_2_3 & 0x01) + m_pf_bankbase[1] += 0x2000; + + if (m_pf_bankbase[0] != m_old_pf[0]) + m_tilemap[0]->mark_all_dirty(); + + if (m_pf_bankbase[1] != m_old_pf[1]) + m_tilemap[1]->mark_all_dirty(); + + m_old_pf[0] = m_pf_bankbase[0]; + m_old_pf[1] = m_pf_bankbase[1]; + + m_tilemap[1]->set_scrolly(0, ctrl_2_2); + m_tilemap[1]->set_scrollx(0, ((ctrl_2_1 << 8) + ctrl_2_0)); + 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) + if ((m_gfx_bank & 0x04) == 0) + { + m_tilemap[1]->draw(screen, bitmap, cliprect, 0, 0); + draw_sprites<0>(bitmap, cliprect, screen.priority(), m_spriteram[0]->buffer()); + draw_sprites<1>(bitmap, cliprect, screen.priority(), m_spriteram[1]->buffer()); + m_tilemap[0]->draw(screen, bitmap, cliprect, 0, 0); + } + else + { + m_tilemap[1]->draw(screen, bitmap, cliprect, 0, 0); + m_tilemap[0]->draw(screen, bitmap, cliprect, 0, 0); + draw_sprites<0>(bitmap, cliprect, screen.priority(), m_spriteram[0]->buffer()); + draw_sprites<1>(bitmap, cliprect, screen.priority(), m_spriteram[1]->buffer()); + } + return 0; +} + +// machine -void hcastle_state::hcastle_bankswitch_w(uint8_t data) +void hcastle_state::bankswitch_w(uint8_t data) { - membank("bank1")->set_entry(data & 0x1f); + m_mainbank->set_entry(data & 0x1f); } -void hcastle_state::hcastle_soundirq_w(uint8_t data) +void hcastle_state::soundirq_w(uint8_t data) { m_audiocpu->set_input_line(0, HOLD_LINE); } -void hcastle_state::hcastle_coin_w(uint8_t data) +void hcastle_state::coin_w(uint8_t data) { machine().bookkeeping().coin_counter_w(0, data & 0x40); machine().bookkeeping().coin_counter_w(1, data & 0x80); @@ -41,30 +302,30 @@ -void hcastle_state::hcastle_map(address_map &map) +void hcastle_state::main_map(address_map &map) { - map(0x0000, 0x0007).w(FUNC(hcastle_state::hcastle_pf1_control_w)); - map(0x0020, 0x003f).ram(); /* rowscroll? */ - map(0x0200, 0x0207).w(FUNC(hcastle_state::hcastle_pf2_control_w)); - map(0x0220, 0x023f).ram(); /* rowscroll? */ - map(0x0400, 0x0400).w(FUNC(hcastle_state::hcastle_bankswitch_w)); + map(0x0000, 0x0007).w(FUNC(hcastle_state::pf_control_w<0>)); + map(0x0020, 0x003f).ram(); // rowscroll? + map(0x0200, 0x0207).w(FUNC(hcastle_state::pf_control_w<1>)); + map(0x0220, 0x023f).ram(); // rowscroll? + map(0x0400, 0x0400).w(FUNC(hcastle_state::bankswitch_w)); map(0x0404, 0x0404).w("soundlatch", FUNC(generic_latch_8_device::write)); - map(0x0408, 0x0408).w(FUNC(hcastle_state::hcastle_soundirq_w)); + map(0x0408, 0x0408).w(FUNC(hcastle_state::soundirq_w)); map(0x040c, 0x040c).w("watchdog", FUNC(watchdog_timer_device::reset_w)); - map(0x0410, 0x0410).portr("SYSTEM").w(FUNC(hcastle_state::hcastle_coin_w)); + map(0x0410, 0x0410).portr("SYSTEM").w(FUNC(hcastle_state::coin_w)); map(0x0411, 0x0411).portr("P1"); map(0x0412, 0x0412).portr("P2"); map(0x0413, 0x0413).portr("DSW3"); map(0x0414, 0x0414).portr("DSW1"); map(0x0415, 0x0415).portr("DSW2"); - map(0x0418, 0x0418).rw(FUNC(hcastle_state::hcastle_gfxbank_r), FUNC(hcastle_state::hcastle_gfxbank_w)); + map(0x0418, 0x0418).rw(FUNC(hcastle_state::gfxbank_r), FUNC(hcastle_state::gfxbank_w)); map(0x0600, 0x06ff).ram().w(m_palette, FUNC(palette_device::write_indirect)).share("palette"); map(0x0700, 0x1fff).ram(); - map(0x2000, 0x2fff).ram().w(FUNC(hcastle_state::hcastle_pf1_video_w)).share("pf1_videoram"); - map(0x3000, 0x3fff).ram().share("spriteram"); - map(0x4000, 0x4fff).ram().w(FUNC(hcastle_state::hcastle_pf2_video_w)).share("pf2_videoram"); + map(0x2000, 0x2fff).ram().w(FUNC(hcastle_state::pf_video_w<0>)).share(m_pf_videoram[0]); + map(0x3000, 0x3fff).ram().share("spriteram1"); + map(0x4000, 0x4fff).ram().w(FUNC(hcastle_state::pf_video_w<1>)).share(m_pf_videoram[1]); map(0x5000, 0x5fff).ram().share("spriteram2"); - map(0x6000, 0x7fff).bankr("bank1"); + map(0x6000, 0x7fff).bankr(m_mainbank); map(0x8000, 0xffff).rom(); } @@ -72,9 +333,9 @@ void hcastle_state::sound_bank_w(uint8_t data) { - int bank_A=(data&0x3); - int bank_B=((data>>2)&0x3); - m_k007232->set_bank(bank_A, bank_B ); + int bank_a = data & 0x3; + int bank_b = (data >> 2) & 0x3; + m_k007232->set_bank(bank_a, bank_b); } void hcastle_state::sound_map(address_map &map) @@ -84,7 +345,7 @@ map(0x9800, 0x98ff).m("k051649", FUNC(k051649_device::scc_map)); map(0xa000, 0xa001).rw("ymsnd", FUNC(ym3812_device::read), FUNC(ym3812_device::write)); map(0xb000, 0xb00d).rw(m_k007232, FUNC(k007232_device::read), FUNC(k007232_device::write)); - map(0xc000, 0xc000).w(FUNC(hcastle_state::sound_bank_w)); /* 7232 bankswitch */ + map(0xc000, 0xc000).w(FUNC(hcastle_state::sound_bank_w)); // 7232 bankswitch map(0xd000, 0xd000).r("soundlatch", FUNC(generic_latch_8_device::read)); } @@ -102,24 +363,24 @@ PORT_START("DSW1") KONAMI_COINAGE_LOC(DEF_STR( Free_Play ), "Invalid", SW1) - /* "Invalid" = both coin slots disabled */ + // "Invalid" = both coin slots disabled PORT_START("DSW2") - PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW2:1" ) /* Listed as "Unused" */ - PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, "SW2:2" ) /* Listed as "Unused" */ + PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW2:1" ) // Listed as "Unused" + PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, "SW2:2" ) // Listed as "Unused" PORT_DIPNAME( 0x04, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:3") PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) PORT_DIPSETTING( 0x04, DEF_STR( Cocktail ) ) - PORT_DIPNAME( 0x18, 0x10, "Difficulty 1 (Game)" ) PORT_DIPLOCATION("SW2:4,5") /* Overall difficulty of game */ + PORT_DIPNAME( 0x18, 0x10, "Difficulty 1 (Game)" ) PORT_DIPLOCATION("SW2:4,5") // Overall difficulty of game PORT_DIPSETTING( 0x18, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x10, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x08, DEF_STR( Difficult ) ) PORT_DIPSETTING( 0x00, DEF_STR( Very_Difficult ) ) - PORT_DIPNAME( 0x60, 0x40, "Difficulty 2 (Strength)" ) PORT_DIPLOCATION("SW2:6,7") /* Listed in manual as "Strength of Player" */ - PORT_DIPSETTING( 0x00, "Very Weak" ) /* Takes most damage per hit */ - PORT_DIPSETTING( 0x20, "Weak" ) /* Takes more damage per hit */ - PORT_DIPSETTING( 0x40, DEF_STR( Normal ) ) /* Takes average damage per hit */ - PORT_DIPSETTING( 0x60, "Strong" ) /* Takes least damage per hit */ + PORT_DIPNAME( 0x60, 0x40, "Difficulty 2 (Strength)" ) PORT_DIPLOCATION("SW2:6,7") // Listed in manual as "Strength of Player" + PORT_DIPSETTING( 0x00, "Very Weak" ) // Takes most damage per hit + PORT_DIPSETTING( 0x20, "Weak" ) // Takes more damage per hit + PORT_DIPSETTING( 0x40, DEF_STR( Normal ) ) // Takes average damage per hit + PORT_DIPSETTING( 0x60, "Strong" ) // Takes least damage per hit PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:8") PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) @@ -152,8 +413,8 @@ }; static GFXDECODE_START( gfx_hcastle ) - GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 8*16 ) /* 007121 #0 */ - GFXDECODE_ENTRY( "gfx2", 0, charlayout, 8*16*16, 8*16 ) /* 007121 #1 */ + GFXDECODE_ENTRY( "k007121_1", 0, charlayout, 0, 8*16 ) + GFXDECODE_ENTRY( "k007121_2", 0, charlayout, 8*16*16, 8*16 ) GFXDECODE_END /*****************************************************************************/ @@ -166,31 +427,29 @@ void hcastle_state::machine_start() { - uint8_t *ROM = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); - membank("bank1")->configure_entries(0, 16, &ROM[0x10000], 0x2000); + m_mainbank->configure_entries(0, 16, &rom[0x10000], 0x2000); - save_item(NAME(m_pf2_bankbase)); - save_item(NAME(m_pf1_bankbase)); + save_item(NAME(m_pf_bankbase)); save_item(NAME(m_gfx_bank)); - save_item(NAME(m_old_pf1)); - save_item(NAME(m_old_pf2)); + save_item(NAME(m_old_pf)); } void hcastle_state::machine_reset() { - m_pf2_bankbase = 0; - m_pf1_bankbase = 0; + m_pf_bankbase[1] = 0; + m_pf_bankbase[0] = 0; m_gfx_bank = 0; - m_old_pf1 = -1; - m_old_pf2 = -1; + m_old_pf[0] = -1; + m_old_pf[1] = -1; } void hcastle_state::hcastle(machine_config &config) { - /* basic machine hardware */ - KONAMI(config, m_maincpu, 3000000); /* Derived from 24 MHz clock */ - m_maincpu->set_addrmap(AS_PROGRAM, &hcastle_state::hcastle_map); + // basic machine hardware + KONAMI(config, m_maincpu, 3000000); // Derived from 24 MHz clock + m_maincpu->set_addrmap(AS_PROGRAM, &hcastle_state::main_map); m_maincpu->set_vblank_int("screen", FUNC(hcastle_state::irq0_line_hold)); Z80(config, m_audiocpu, 3579545); @@ -198,27 +457,27 @@ WATCHDOG_TIMER(config, "watchdog"); - /* video hardware */ - BUFFERED_SPRITERAM8(config, m_spriteram); - BUFFERED_SPRITERAM8(config, m_spriteram2); + // video hardware + BUFFERED_SPRITERAM8(config, m_spriteram[0]); + BUFFERED_SPRITERAM8(config, m_spriteram[1]); screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(59); - screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); /* frames per second verified by comparison with real board */ + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); // frames per second verified by comparison with real board screen.set_size(32*8, 32*8); screen.set_visarea(0*8, 32*8-1, 2*8, 30*8-1); - screen.set_screen_update(FUNC(hcastle_state::screen_update_hcastle)); + screen.set_screen_update(FUNC(hcastle_state::screen_update)); screen.set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_hcastle); - PALETTE(config, m_palette, FUNC(hcastle_state::hcastle_palette)).set_format(palette_device::xBGR_555, 2*8*16*16, 128); + PALETTE(config, m_palette, FUNC(hcastle_state::palette)).set_format(palette_device::xBGR_555, 2*8*16*16, 128); - K007121(config, m_k007121_1, 0); - m_k007121_1->set_palette_tag(m_palette); - K007121(config, m_k007121_2, 0); - m_k007121_2->set_palette_tag(m_palette); + K007121(config, m_k007121[0], 0); + m_k007121[0]->set_palette_tag(m_palette); + K007121(config, m_k007121[1], 0); + m_k007121[1]->set_palette_tag(m_palette); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); GENERIC_LATCH_8(config, "soundlatch"); @@ -229,7 +488,7 @@ m_k007232->add_route(1, "mono", 0.50); ym3812_device &ymsnd(YM3812(config, "ymsnd", 3579545)); - ymsnd.irq_handler().set_inputline("audiocpu", INPUT_LINE_NMI); /* from schematic; NMI handler is just a retn */ + ymsnd.irq_handler().set_inputline("audiocpu", INPUT_LINE_NMI); // from schematic; NMI handler is just a retn ymsnd.add_route(ALL_OUTPUTS, "mono", 0.70); K051649(config, "k051649", 3579545).add_route(ALL_OUTPUTS, "mono", 0.45); @@ -245,22 +504,22 @@ ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "768e01.e4", 0x00000, 0x08000, CRC(b9fff184) SHA1(c55f468c0da6afdaa2af65a111583c0c42868bd1) ) - ROM_REGION( 0x100000, "gfx1", 0 ) + ROM_REGION( 0x100000, "k007121_1", 0 ) // chars and sprites ROM_LOAD( "768c09.g21", 0x000000, 0x80000, CRC(e3be3fdd) SHA1(01a686af33a0a700066b1a5334d8552454ff186f) ) ROM_LOAD( "768c08.g19", 0x080000, 0x80000, CRC(9633db8b) SHA1(fe1b117c2566288b88f000106c649c2fa5648ddc) ) - ROM_REGION( 0x100000, "gfx2", 0 ) + ROM_REGION( 0x100000, "k007121_2", 0 ) // chars and sprites ROM_LOAD( "768c04.j5", 0x000000, 0x80000, CRC(2960680e) SHA1(72e1f025496c907de8516e3b5f1781e73d5b2c6c) ) ROM_LOAD( "768c05.j6", 0x080000, 0x80000, CRC(65a2f227) SHA1(43f368e533d6a164dc68d54130b81883e0d1bafe) ) ROM_REGION( 0x0500, "proms", 0 ) - ROM_LOAD( "768c13.j21", 0x0000, 0x0100, CRC(f5de80cb) SHA1(e8cc3e14a5d23b25fb7bf790e64786c6aa2df8b7) ) /* 007121 #0 sprite lookup table */ - ROM_LOAD( "768c14.j22", 0x0100, 0x0100, CRC(b32071b7) SHA1(09a699a3f20c155eae1e63429f03ed91abc54784) ) /* 007121 #0 char lookup table */ - ROM_LOAD( "768c11.i4", 0x0200, 0x0100, CRC(f5de80cb) SHA1(e8cc3e14a5d23b25fb7bf790e64786c6aa2df8b7) ) /* 007121 #1 sprite lookup table (same) */ - ROM_LOAD( "768c10.i3", 0x0300, 0x0100, CRC(b32071b7) SHA1(09a699a3f20c155eae1e63429f03ed91abc54784) ) /* 007121 #1 char lookup table (same) */ - ROM_LOAD( "768b12.d20", 0x0400, 0x0100, CRC(362544b8) SHA1(744c8d2ccfa980fc9a7354b4d241c569b3c1fffe) ) /* priority encoder (not used) */ + ROM_LOAD( "768c13.j21", 0x0000, 0x0100, CRC(f5de80cb) SHA1(e8cc3e14a5d23b25fb7bf790e64786c6aa2df8b7) ) // 007121 #0 sprite lookup table + ROM_LOAD( "768c14.j22", 0x0100, 0x0100, CRC(b32071b7) SHA1(09a699a3f20c155eae1e63429f03ed91abc54784) ) // 007121 #0 char lookup table + ROM_LOAD( "768c11.i4", 0x0200, 0x0100, CRC(f5de80cb) SHA1(e8cc3e14a5d23b25fb7bf790e64786c6aa2df8b7) ) // 007121 #1 sprite lookup table (same) + ROM_LOAD( "768c10.i3", 0x0300, 0x0100, CRC(b32071b7) SHA1(09a699a3f20c155eae1e63429f03ed91abc54784) ) // 007121 #1 char lookup table (same) + ROM_LOAD( "768b12.d20", 0x0400, 0x0100, CRC(362544b8) SHA1(744c8d2ccfa980fc9a7354b4d241c569b3c1fffe) ) // priority encoder (not used) - ROM_REGION( 0x80000, "k007232", 0 ) /* 512k for the samples */ + ROM_REGION( 0x80000, "k007232", 0 ) // samples ROM_LOAD( "768c07.e17", 0x00000, 0x80000, CRC(01f9889c) SHA1(01252d2ce7b14cfbe39ac8d7a5bd7417f1c2fc22) ) ROM_END @@ -272,22 +531,22 @@ ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "768e01.e4", 0x00000, 0x08000, CRC(b9fff184) SHA1(c55f468c0da6afdaa2af65a111583c0c42868bd1) ) - ROM_REGION( 0x100000, "gfx1", 0 ) + ROM_REGION( 0x100000, "k007121_1", 0 ) // chars and sprites ROM_LOAD( "768c09.g21", 0x000000, 0x80000, CRC(e3be3fdd) SHA1(01a686af33a0a700066b1a5334d8552454ff186f) ) ROM_LOAD( "768c08.g19", 0x080000, 0x80000, CRC(9633db8b) SHA1(fe1b117c2566288b88f000106c649c2fa5648ddc) ) - ROM_REGION( 0x100000, "gfx2", 0 ) + ROM_REGION( 0x100000, "k007121_2", 0 ) // chars and sprites ROM_LOAD( "768c04.j5", 0x000000, 0x80000, CRC(2960680e) SHA1(72e1f025496c907de8516e3b5f1781e73d5b2c6c) ) ROM_LOAD( "768c05.j6", 0x080000, 0x80000, CRC(65a2f227) SHA1(43f368e533d6a164dc68d54130b81883e0d1bafe) ) ROM_REGION( 0x0500, "proms", 0 ) - ROM_LOAD( "768c13.j21", 0x0000, 0x0100, CRC(f5de80cb) SHA1(e8cc3e14a5d23b25fb7bf790e64786c6aa2df8b7) ) /* 007121 #0 sprite lookup table */ - ROM_LOAD( "768c14.j22", 0x0100, 0x0100, CRC(b32071b7) SHA1(09a699a3f20c155eae1e63429f03ed91abc54784) ) /* 007121 #0 char lookup table */ - ROM_LOAD( "768c11.i4", 0x0200, 0x0100, CRC(f5de80cb) SHA1(e8cc3e14a5d23b25fb7bf790e64786c6aa2df8b7) ) /* 007121 #1 sprite lookup table (same) */ - ROM_LOAD( "768c10.i3", 0x0300, 0x0100, CRC(b32071b7) SHA1(09a699a3f20c155eae1e63429f03ed91abc54784) ) /* 007121 #1 char lookup table (same) */ - ROM_LOAD( "768b12.d20", 0x0400, 0x0100, CRC(362544b8) SHA1(744c8d2ccfa980fc9a7354b4d241c569b3c1fffe) ) /* priority encoder (not used) */ + ROM_LOAD( "768c13.j21", 0x0000, 0x0100, CRC(f5de80cb) SHA1(e8cc3e14a5d23b25fb7bf790e64786c6aa2df8b7) ) // 007121 #0 sprite lookup table + ROM_LOAD( "768c14.j22", 0x0100, 0x0100, CRC(b32071b7) SHA1(09a699a3f20c155eae1e63429f03ed91abc54784) ) // 007121 #0 char lookup table + ROM_LOAD( "768c11.i4", 0x0200, 0x0100, CRC(f5de80cb) SHA1(e8cc3e14a5d23b25fb7bf790e64786c6aa2df8b7) ) // 007121 #1 sprite lookup table (same) + ROM_LOAD( "768c10.i3", 0x0300, 0x0100, CRC(b32071b7) SHA1(09a699a3f20c155eae1e63429f03ed91abc54784) ) // 007121 #1 char lookup table (same) + ROM_LOAD( "768b12.d20", 0x0400, 0x0100, CRC(362544b8) SHA1(744c8d2ccfa980fc9a7354b4d241c569b3c1fffe) ) // priority encoder (not used) - ROM_REGION( 0x80000, "k007232", 0 ) /* 512k for the samples */ + ROM_REGION( 0x80000, "k007232", 0 ) // samples ROM_LOAD( "768c07.e17", 0x00000, 0x80000, CRC(01f9889c) SHA1(01252d2ce7b14cfbe39ac8d7a5bd7417f1c2fc22) ) ROM_END @@ -299,22 +558,22 @@ ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "768e01.e4", 0x00000, 0x08000, CRC(b9fff184) SHA1(c55f468c0da6afdaa2af65a111583c0c42868bd1) ) - ROM_REGION( 0x100000, "gfx1", 0 ) + ROM_REGION( 0x100000, "k007121_1", 0 ) // chars and sprites ROM_LOAD( "768c09.g21", 0x000000, 0x80000, CRC(e3be3fdd) SHA1(01a686af33a0a700066b1a5334d8552454ff186f) ) ROM_LOAD( "768c08.g19", 0x080000, 0x80000, CRC(9633db8b) SHA1(fe1b117c2566288b88f000106c649c2fa5648ddc) ) - ROM_REGION( 0x100000, "gfx2", 0 ) + ROM_REGION( 0x100000, "k007121_2", 0 ) // chars and sprites ROM_LOAD( "768c04.j5", 0x000000, 0x80000, CRC(2960680e) SHA1(72e1f025496c907de8516e3b5f1781e73d5b2c6c) ) ROM_LOAD( "768c05.j6", 0x080000, 0x80000, CRC(65a2f227) SHA1(43f368e533d6a164dc68d54130b81883e0d1bafe) ) ROM_REGION( 0x0500, "proms", 0 ) - ROM_LOAD( "768c13.j21", 0x0000, 0x0100, CRC(f5de80cb) SHA1(e8cc3e14a5d23b25fb7bf790e64786c6aa2df8b7) ) /* 007121 #0 sprite lookup table */ - ROM_LOAD( "768c14.j22", 0x0100, 0x0100, CRC(b32071b7) SHA1(09a699a3f20c155eae1e63429f03ed91abc54784) ) /* 007121 #0 char lookup table */ - ROM_LOAD( "768c11.i4", 0x0200, 0x0100, CRC(f5de80cb) SHA1(e8cc3e14a5d23b25fb7bf790e64786c6aa2df8b7) ) /* 007121 #1 sprite lookup table (same) */ - ROM_LOAD( "768c10.i3", 0x0300, 0x0100, CRC(b32071b7) SHA1(09a699a3f20c155eae1e63429f03ed91abc54784) ) /* 007121 #1 char lookup table (same) */ - ROM_LOAD( "768b12.d20", 0x0400, 0x0100, CRC(362544b8) SHA1(744c8d2ccfa980fc9a7354b4d241c569b3c1fffe) ) /* priority encoder (not used) */ + ROM_LOAD( "768c13.j21", 0x0000, 0x0100, CRC(f5de80cb) SHA1(e8cc3e14a5d23b25fb7bf790e64786c6aa2df8b7) ) // 007121 #0 sprite lookup table + ROM_LOAD( "768c14.j22", 0x0100, 0x0100, CRC(b32071b7) SHA1(09a699a3f20c155eae1e63429f03ed91abc54784) ) // 007121 #0 char lookup table + ROM_LOAD( "768c11.i4", 0x0200, 0x0100, CRC(f5de80cb) SHA1(e8cc3e14a5d23b25fb7bf790e64786c6aa2df8b7) ) // 007121 #1 sprite lookup table (same) + ROM_LOAD( "768c10.i3", 0x0300, 0x0100, CRC(b32071b7) SHA1(09a699a3f20c155eae1e63429f03ed91abc54784) ) // 007121 #1 char lookup table (same) + ROM_LOAD( "768b12.d20", 0x0400, 0x0100, CRC(362544b8) SHA1(744c8d2ccfa980fc9a7354b4d241c569b3c1fffe) ) // priority encoder (not used) - ROM_REGION( 0x80000, "k007232", 0 ) /* 512k for the samples */ + ROM_REGION( 0x80000, "k007232", 0 ) // samples ROM_LOAD( "768c07.e17", 0x00000, 0x80000, CRC(01f9889c) SHA1(01252d2ce7b14cfbe39ac8d7a5bd7417f1c2fc22) ) ROM_END @@ -326,22 +585,22 @@ ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "768e01.e4", 0x00000, 0x08000, CRC(b9fff184) SHA1(c55f468c0da6afdaa2af65a111583c0c42868bd1) ) - ROM_REGION( 0x100000, "gfx1", 0 ) + ROM_REGION( 0x100000, "k007121_1", 0 ) // chars and sprites ROM_LOAD( "768c09.g21", 0x000000, 0x80000, CRC(e3be3fdd) SHA1(01a686af33a0a700066b1a5334d8552454ff186f) ) ROM_LOAD( "768c08.g19", 0x080000, 0x80000, CRC(9633db8b) SHA1(fe1b117c2566288b88f000106c649c2fa5648ddc) ) - ROM_REGION( 0x100000, "gfx2", 0 ) + ROM_REGION( 0x100000, "k007121_2", 0 ) // chars and sprites ROM_LOAD( "768c04.j5", 0x000000, 0x80000, CRC(2960680e) SHA1(72e1f025496c907de8516e3b5f1781e73d5b2c6c) ) ROM_LOAD( "768c05.j6", 0x080000, 0x80000, CRC(65a2f227) SHA1(43f368e533d6a164dc68d54130b81883e0d1bafe) ) ROM_REGION( 0x0500, "proms", 0 ) - ROM_LOAD( "768c13.j21", 0x0000, 0x0100, CRC(f5de80cb) SHA1(e8cc3e14a5d23b25fb7bf790e64786c6aa2df8b7) ) /* 007121 #0 sprite lookup table */ - ROM_LOAD( "768c14.j22", 0x0100, 0x0100, CRC(b32071b7) SHA1(09a699a3f20c155eae1e63429f03ed91abc54784) ) /* 007121 #0 char lookup table */ - ROM_LOAD( "768c11.i4", 0x0200, 0x0100, CRC(f5de80cb) SHA1(e8cc3e14a5d23b25fb7bf790e64786c6aa2df8b7) ) /* 007121 #1 sprite lookup table (same) */ - ROM_LOAD( "768c10.i3", 0x0300, 0x0100, CRC(b32071b7) SHA1(09a699a3f20c155eae1e63429f03ed91abc54784) ) /* 007121 #1 char lookup table (same) */ - ROM_LOAD( "768b12.d20", 0x0400, 0x0100, CRC(362544b8) SHA1(744c8d2ccfa980fc9a7354b4d241c569b3c1fffe) ) /* priority encoder (not used) */ + ROM_LOAD( "768c13.j21", 0x0000, 0x0100, CRC(f5de80cb) SHA1(e8cc3e14a5d23b25fb7bf790e64786c6aa2df8b7) ) // 007121 #0 sprite lookup table + ROM_LOAD( "768c14.j22", 0x0100, 0x0100, CRC(b32071b7) SHA1(09a699a3f20c155eae1e63429f03ed91abc54784) ) // 007121 #0 char lookup table + ROM_LOAD( "768c11.i4", 0x0200, 0x0100, CRC(f5de80cb) SHA1(e8cc3e14a5d23b25fb7bf790e64786c6aa2df8b7) ) // 007121 #1 sprite lookup table (same) + ROM_LOAD( "768c10.i3", 0x0300, 0x0100, CRC(b32071b7) SHA1(09a699a3f20c155eae1e63429f03ed91abc54784) ) // 007121 #1 char lookup table (same) + ROM_LOAD( "768b12.d20", 0x0400, 0x0100, CRC(362544b8) SHA1(744c8d2ccfa980fc9a7354b4d241c569b3c1fffe) ) // priority encoder (not used) - ROM_REGION( 0x80000, "k007232", 0 ) /* 512k for the samples */ + ROM_REGION( 0x80000, "k007232", 0 ) // samples ROM_LOAD( "768c07.e17", 0x00000, 0x80000, CRC(01f9889c) SHA1(01252d2ce7b14cfbe39ac8d7a5bd7417f1c2fc22) ) ROM_END @@ -353,25 +612,26 @@ ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "768e01.e4", 0x00000, 0x08000, CRC(b9fff184) SHA1(c55f468c0da6afdaa2af65a111583c0c42868bd1) ) - ROM_REGION( 0x100000, "gfx1", 0 ) + ROM_REGION( 0x100000, "k007121_1", 0 ) // chars and sprites ROM_LOAD( "768c09.g21", 0x000000, 0x80000, CRC(e3be3fdd) SHA1(01a686af33a0a700066b1a5334d8552454ff186f) ) ROM_LOAD( "768c08.g19", 0x080000, 0x80000, CRC(9633db8b) SHA1(fe1b117c2566288b88f000106c649c2fa5648ddc) ) - ROM_REGION( 0x100000, "gfx2", 0 ) + ROM_REGION( 0x100000, "k007121_2", 0 ) // chars and sprites ROM_LOAD( "768c04.j5", 0x000000, 0x80000, CRC(2960680e) SHA1(72e1f025496c907de8516e3b5f1781e73d5b2c6c) ) ROM_LOAD( "768c05.j6", 0x080000, 0x80000, CRC(65a2f227) SHA1(43f368e533d6a164dc68d54130b81883e0d1bafe) ) ROM_REGION( 0x0500, "proms", 0 ) - ROM_LOAD( "768c13.j21", 0x0000, 0x0100, CRC(f5de80cb) SHA1(e8cc3e14a5d23b25fb7bf790e64786c6aa2df8b7) ) /* 007121 #0 sprite lookup table */ - ROM_LOAD( "768c14.j22", 0x0100, 0x0100, CRC(b32071b7) SHA1(09a699a3f20c155eae1e63429f03ed91abc54784) ) /* 007121 #0 char lookup table */ - ROM_LOAD( "768c11.i4", 0x0200, 0x0100, CRC(f5de80cb) SHA1(e8cc3e14a5d23b25fb7bf790e64786c6aa2df8b7) ) /* 007121 #1 sprite lookup table (same) */ - ROM_LOAD( "768c10.i3", 0x0300, 0x0100, CRC(b32071b7) SHA1(09a699a3f20c155eae1e63429f03ed91abc54784) ) /* 007121 #1 char lookup table (same) */ - ROM_LOAD( "768b12.d20", 0x0400, 0x0100, CRC(362544b8) SHA1(744c8d2ccfa980fc9a7354b4d241c569b3c1fffe) ) /* priority encoder (not used) */ + ROM_LOAD( "768c13.j21", 0x0000, 0x0100, CRC(f5de80cb) SHA1(e8cc3e14a5d23b25fb7bf790e64786c6aa2df8b7) ) // 007121 #0 sprite lookup table + ROM_LOAD( "768c14.j22", 0x0100, 0x0100, CRC(b32071b7) SHA1(09a699a3f20c155eae1e63429f03ed91abc54784) ) // 007121 #0 char lookup table + ROM_LOAD( "768c11.i4", 0x0200, 0x0100, CRC(f5de80cb) SHA1(e8cc3e14a5d23b25fb7bf790e64786c6aa2df8b7) ) // 007121 #1 sprite lookup table (same) + ROM_LOAD( "768c10.i3", 0x0300, 0x0100, CRC(b32071b7) SHA1(09a699a3f20c155eae1e63429f03ed91abc54784) ) // 007121 #1 char lookup table (same) + ROM_LOAD( "768b12.d20", 0x0400, 0x0100, CRC(362544b8) SHA1(744c8d2ccfa980fc9a7354b4d241c569b3c1fffe) ) // priority encoder (not used) - ROM_REGION( 0x80000, "k007232", 0 ) /* 512k for the samples */ + ROM_REGION( 0x80000, "k007232", 0 ) // samples ROM_LOAD( "768c07.e17", 0x00000, 0x80000, CRC(01f9889c) SHA1(01252d2ce7b14cfbe39ac8d7a5bd7417f1c2fc22) ) ROM_END +} // anonymous namespace GAME( 1988, hcastle, 0, hcastle, hcastle, hcastle_state, empty_init, ROT0, "Konami", "Haunted Castle (version M)", MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/headonb.cpp mame-0.243+dfsg.1/src/mame/drivers/headonb.cpp --- mame-0.242+dfsg.1/src/mame/drivers/headonb.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/headonb.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -216,17 +216,6 @@ GFX Layouts ******************************************************************************/ -static const gfx_layout charlayout_1bpp = -{ - 8,8, - RGN_FRAC(1,1), - 1, - { 0 }, - { STEP8(0,1) }, - { STEP8(0,8) }, - 8*8 -}; - static const gfx_layout charlayout_3bpp = { 8,8, @@ -239,7 +228,7 @@ }; static GFXDECODE_START( gfx_foolrace ) - GFXDECODE_ENTRY( "gfx1", 0, charlayout_1bpp, 0, 1 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x1, 0, 1 ) GFXDECODE_END static GFXDECODE_START( gfx_blackhol ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/hexion.cpp mame-0.243+dfsg.1/src/mame/drivers/hexion.cpp --- mame-0.242+dfsg.1/src/mame/drivers/hexion.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/hexion.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -79,30 +79,267 @@ ***************************************************************************/ #include "emu.h" -#include "includes/hexion.h" + #include "includes/konamipt.h" #include "cpu/z80/z80.h" +#include "machine/k053252.h" +#include "machine/timer.h" #include "machine/watchdog.h" -#include "sound/okim6295.h" #include "sound/k051649.h" +#include "sound/okim6295.h" +#include "emupal.h" #include "speaker.h" +#include "tilemap.h" -void hexion_state::coincntr_w(uint8_t data) +// configurable logging +#define LOG_UNKWRITE (1U << 1) +#define LOG_BANKEDRAM (1U << 2) +#define LOG_CCU (1U << 3) + +//#define VERBOSE (LOG_GENERAL | LOG_UNKWRITE | LOG_BANKEDRAM | LOG_CCU) + +#include "logmacro.h" + +#define LOGUNKWRITE(...) LOGMASKED(LOG_UNKWRITE, __VA_ARGS__) +#define LOGBANKEDRAM(...) LOGMASKED(LOG_BANKEDRAM, __VA_ARGS__) +#define LOGCCU(...) LOGMASKED(LOG_CCU, __VA_ARGS__) + + +namespace { + +class hexion_state : public driver_device +{ +public: + hexion_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_k053252(*this, "k053252"), + m_gfxdecode(*this, "gfxdecode"), + m_palette(*this, "palette"), + m_vram(*this, "vram%u", 0U, 0x2000U, ENDIANNESS_LITTLE), + m_unkram(*this, "unkram", 0x800, ENDIANNESS_LITTLE), + m_rombank(*this, "rombank"), + m_tilesrom(*this, "tiles") + { } + + void hexion(machine_config &config); + void hexionb(machine_config &config); + +protected: + virtual void video_start() override; + +private: + required_device m_maincpu; + required_device m_k053252; + required_device m_gfxdecode; + required_device m_palette; + + memory_share_array_creator m_vram; + memory_share_creator m_unkram; + required_memory_bank m_rombank; + required_region_ptr m_tilesrom; + + uint8_t m_bankctrl = 0; + uint8_t m_rambank = 0; + uint8_t m_pmcbank = 0; + uint8_t m_gfxrom_select = 0; + uint8_t m_ccu_int_time = 0; + int16_t m_ccu_int_time_count = 0; + tilemap_t *m_bg_tilemap[2]{}; + + void coincntr_w(uint8_t data); + void bankswitch_w(uint8_t data); + uint8_t bankedram_r(offs_t offset); + void bankedram_w(offs_t offset, uint8_t data); + void bankctrl_w(uint8_t data); + void gfxrom_select_w(uint8_t data); + DECLARE_WRITE_LINE_MEMBER(irq_ack_w); + DECLARE_WRITE_LINE_MEMBER(nmi_ack_w); + void ccu_int_time_w(uint8_t data); + + template TILE_GET_INFO_MEMBER(get_tile_info); + + TIMER_DEVICE_CALLBACK_MEMBER(scanline); + + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void base_map(address_map &map); + void hexion_map(address_map &map); + void hexionb_map(address_map &map); +}; + + +// video + + +/*************************************************************************** + + Callbacks for the TileMap code + +***************************************************************************/ + +template +TILE_GET_INFO_MEMBER(hexion_state::get_tile_info) +{ + tile_index *= 4; + tileinfo.set(0, + m_vram[Which][tile_index] + ((m_vram[Which][tile_index + 1] & 0x3f) << 8), + m_vram[Which][tile_index + 2] & 0x0f, + 0); +} + + +/*************************************************************************** + + Start the video hardware emulation. + +***************************************************************************/ + +void hexion_state::video_start() { -//logerror("%04x: coincntr_w %02x\n",m_maincpu->pc(),data); + m_bg_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(hexion_state::get_tile_info<0>)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + m_bg_tilemap[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(hexion_state::get_tile_info<1>)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + + m_bg_tilemap[0]->set_transparent_pen(0); + m_bg_tilemap[1]->set_scrollx(0, -4); + m_bg_tilemap[1]->set_scrolly(0, 4); + + m_rombank->configure_entries(0, 16, memregion("maincpu")->base(), 0x2000); + + m_gfxrom_select = 0; + + save_item(NAME(m_bankctrl)); + save_item(NAME(m_rambank)); + save_item(NAME(m_pmcbank)); + save_item(NAME(m_gfxrom_select)); + save_item(NAME(m_ccu_int_time)); + save_item(NAME(m_ccu_int_time_count)); +} + - /* bits 0/1 = coin counters */ - machine().bookkeeping().coin_counter_w(0,data & 0x01); - machine().bookkeeping().coin_counter_w(1,data & 0x02); - /* bit 5 = flip screen */ +/*************************************************************************** + + Memory handlers + +***************************************************************************/ + +void hexion_state::bankswitch_w(uint8_t data) +{ + // bits 0-3 select ROM bank + m_rombank->set_entry(data & 0x0f); + + // does bit 6 trigger the 052591? + if (data & 0x40) + { + int bank = m_unkram[0] & 1; + memset(m_vram[bank], m_unkram[1], 0x2000); + m_bg_tilemap[bank]->mark_all_dirty(); + } + // bit 7 = PMC-BK + m_pmcbank = (data & 0x80) >> 7; + + // other bits unknown + if (data & 0x30) + LOGUNKWRITE("bankswitch %02x", data & 0xf0); +} + +uint8_t hexion_state::bankedram_r(offs_t offset) +{ + if (m_gfxrom_select && offset < 0x1000) + { + return m_tilesrom[((m_gfxrom_select & 0x7f) << 12) + offset]; + } + else if (m_bankctrl == 0) + { + return m_vram[m_rambank][offset]; + } + else if (m_bankctrl == 2 && offset < 0x800) + { + return m_unkram[offset]; + } + else + { + LOGBANKEDRAM("%s: bankedram_r offset %04x, bankctrl = %02x\n", m_maincpu->pc(), offset, m_bankctrl); + return 0; + } +} + +void hexion_state::bankedram_w(offs_t offset, uint8_t data) +{ + if (m_bankctrl == 3 && offset == 0 && (data & 0xfe) == 0) + { + LOGBANKEDRAM("%s: bankedram_w offset %04x, data %02x, bankctrl = %02x\n", m_maincpu->pc(), offset, data, m_bankctrl); + m_rambank = data & 1; + } + else if (m_bankctrl == 0) + { + if (m_pmcbank) + { + LOGBANKEDRAM("%s: bankedram_w offset %04x, data %02x, bankctrl = %02x\n", m_maincpu->pc(), offset, data, m_bankctrl); + m_vram[m_rambank][offset] = data; + m_bg_tilemap[m_rambank]->mark_tile_dirty(offset/4); + } + else + LOGBANKEDRAM("%04x pmc internal ram %04x = %02x\n", m_maincpu->pc(), offset, data); + } + else if (m_bankctrl == 2 && offset < 0x800) + { + if (m_pmcbank) + { + LOGBANKEDRAM("%s: unkram_w offset %04x, data %02x, bankctrl = %02x\n", m_maincpu->pc(), offset, data, m_bankctrl); + m_unkram[offset] = data; + } + else + LOGBANKEDRAM("%04x pmc internal ram %04x = %02x\n", m_maincpu->pc(), offset, data); + } + else + LOGBANKEDRAM("%s: bankedram_w offset %04x, data %02x, bankctrl = %02x\n", m_maincpu->pc(), offset, data, m_bankctrl); +} + +void hexion_state::bankctrl_w(uint8_t data) +{ + LOGBANKEDRAM("%s: bankctrl_w %02x\n", m_maincpu->pc(), data); + m_bankctrl = data; +} + +void hexion_state::gfxrom_select_w(uint8_t data) +{ + LOGBANKEDRAM("%s: gfxrom_select_w %02x\n", m_maincpu->pc(), data); + m_gfxrom_select = data; +} + + + +/*************************************************************************** + + Display refresh + +***************************************************************************/ + +uint32_t hexion_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + m_bg_tilemap[1]->draw(screen, bitmap, cliprect, 0, 0); + m_bg_tilemap[0]->draw(screen, bitmap, cliprect, 0, 0); + return 0; +} + +// machine + + +void hexion_state::coincntr_w(uint8_t data) +{ + // bits 0/1 = coin counters + machine().bookkeeping().coin_counter_w(0, data & 0x01); + machine().bookkeeping().coin_counter_w(1, data & 0x02); + + // bit 5 = flip screen flip_screen_set(data & 0x20); - /* other bit unknown */ -if ((data & 0xdc) != 0x10) popmessage("coincntr %02x",data); + // other bits unknown + if ((data & 0xdc) != 0x10) LOGUNKWRITE("coincntr %02x", data); } WRITE_LINE_MEMBER(hexion_state::irq_ack_w) @@ -117,19 +354,18 @@ void hexion_state::ccu_int_time_w(uint8_t data) { - logerror("ccu_int_time rewritten with value of %02x\n", data); + LOGCCU("ccu_int_time rewritten with value of %02x\n", data); m_ccu_int_time = data; } -void hexion_state::hexion_map(address_map &map) +void hexion_state::base_map(address_map &map) { map(0x0000, 0x7fff).rom(); - map(0x8000, 0x9fff).bankr("bank1"); + map(0x8000, 0x9fff).bankr(m_rombank); map(0xa000, 0xbfff).ram(); map(0xc000, 0xdffe).rw(FUNC(hexion_state::bankedram_r), FUNC(hexion_state::bankedram_w)); map(0xdfff, 0xdfff).w(FUNC(hexion_state::bankctrl_w)); map(0xe000, 0xe000).noprw(); - map(0xe800, 0xe8ff).m("k051649", FUNC(k051649_device::scc_map)); map(0xf000, 0xf00f).rw(m_k053252, FUNC(k053252_device::read), FUNC(k053252_device::write)); map(0xf200, 0xf200).w("oki", FUNC(okim6295_device::write)); map(0xf400, 0xf400).portr("DSW1"); @@ -144,31 +380,22 @@ map(0xf540, 0xf540).r("watchdog", FUNC(watchdog_timer_device::reset_r)); } +void hexion_state::hexion_map(address_map &map) +{ + base_map(map); + + map(0xe800, 0xe8ff).m("k051649", FUNC(k051649_device::scc_map)); +} + void hexion_state::hexionb_map(address_map &map) { - map(0x0000, 0x7fff).rom(); - map(0x8000, 0x9fff).bankr("bank1"); - map(0xa000, 0xbfff).ram(); - map(0xc000, 0xdffe).rw(FUNC(hexion_state::bankedram_r), FUNC(hexion_state::bankedram_w)); - map(0xdfff, 0xdfff).w(FUNC(hexion_state::bankctrl_w)); - map(0xe000, 0xe000).noprw(); + base_map(map); + map(0xe800, 0xe87f).noprw(); // all the code to use the k051649 is still present map(0xe880, 0xe889).noprw(); // but the bootleg has an additional M6295 @ 0xf5c0 instead map(0xe88a, 0xe88e).noprw(); map(0xe88f, 0xe88f).noprw(); map(0xe8e0, 0xe8ff).noprw(); - map(0xf000, 0xf00f).rw(m_k053252, FUNC(k053252_device::read), FUNC(k053252_device::write)); - map(0xf200, 0xf200).w("oki", FUNC(okim6295_device::write)); - map(0xf400, 0xf400).portr("DSW1"); - map(0xf401, 0xf401).portr("DSW2"); - map(0xf402, 0xf402).portr("P1"); - map(0xf403, 0xf403).portr("P2"); - map(0xf440, 0xf440).portr("DSW3"); - map(0xf441, 0xf441).portr("SYSTEM"); - map(0xf480, 0xf480).w(FUNC(hexion_state::bankswitch_w)); - map(0xf4c0, 0xf4c0).w(FUNC(hexion_state::coincntr_w)); - map(0xf500, 0xf500).w(FUNC(hexion_state::gfxrom_select_w)); - map(0xf540, 0xf540).r("watchdog", FUNC(watchdog_timer_device::reset_r)); map(0xf5c0, 0xf5c0).w("oki2", FUNC(okim6295_device::write)); } @@ -208,7 +435,7 @@ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) /* 052591? game waits for it to be 0 */ + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) // 052591? game waits for it to be 0 PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) @@ -229,7 +456,7 @@ }; static GFXDECODE_START( gfx_hexion ) - GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 16 ) + GFXDECODE_ENTRY( "tiles", 0, charlayout, 0, 16 ) GFXDECODE_END TIMER_DEVICE_CALLBACK_MEMBER(hexion_state::scanline) @@ -253,18 +480,18 @@ void hexion_state::hexion(machine_config &config) { - /* basic machine hardware */ - Z80(config, m_maincpu, XTAL(24'000'000)/4); /* Z80B 6 MHz @ 17F, xtal verified, divider not verified */ + // basic machine hardware + Z80(config, m_maincpu, XTAL(24'000'000) / 4); // Z80B 6 MHz @ 17F, xtal verified, divider not verified m_maincpu->set_addrmap(AS_PROGRAM, &hexion_state::hexion_map); TIMER(config, "scantimer").configure_scanline(FUNC(hexion_state::scanline), "screen", 0, 1); WATCHDOG_TIMER(config, "watchdog"); - K053252(config, m_k053252, XTAL(24'000'000)/2); /* K053252, X0-010(?) @8D, xtal verified, divider not verified */ + K053252(config, m_k053252, XTAL(24'000'000 )/ 2); // K053252, X0-010(?) @8D, xtal verified, divider not verified m_k053252->int1_ack().set(FUNC(hexion_state::irq_ack_w)); m_k053252->int2_ack().set(FUNC(hexion_state::nmi_ack_w)); m_k053252->int_time().set(FUNC(hexion_state::ccu_int_time_w)); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(60); screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); @@ -276,14 +503,14 @@ GFXDECODE(config, m_gfxdecode, m_palette, gfx_hexion); PALETTE(config, "palette", palette_device::RGB_444_PROMS, "proms", 256); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); - /* MSM6295GS @ 5E, clock frequency & pin 7 not verified */ + // MSM6295GS @ 5E, clock frequency & pin 7 not verified OKIM6295(config, "oki", 1056000, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 0.5); - /* KONAMI 051649 // 2212P003 // JAPAN 8910EAJ @ 1D, xtal verified, divider not verified */ - K051649(config, "k051649", XTAL(24'000'000)/8).add_route(ALL_OUTPUTS, "mono", 0.5); + // KONAMI 051649 // 2212P003 // JAPAN 8910EAJ @ 1D, xtal verified, divider not verified + K051649(config, "k051649", XTAL(24'000'000) / 8).add_route(ALL_OUTPUTS, "mono", 0.5); } void hexion_state::hexionb(machine_config &config) @@ -305,40 +532,38 @@ ***************************************************************************/ ROM_START( hexion ) - ROM_REGION( 0x34800, "maincpu", 0 ) /* ROMs + space for additional RAM */ - ROM_LOAD( "122__j_a__b01.16f", 0x00000, 0x20000, CRC(eabc6dd1) SHA1(e74c1f1f2fcf8973f0741a2d544f25c8639448bf) ) /* "122 // J A // B01" @16F (27c010?) */ - ROM_RELOAD( 0x10000, 0x20000 ) /* banked at 8000-9fff */ - - ROM_REGION( 0x80000, "gfx1", 0 ) /* addressable by the main CPU */ - ROM_LOAD( "122a07.1h", 0x00000, 0x40000, CRC(22ae55e3) SHA1(41bdc990f69416b639542e2186a3610c16389063) ) /* Later pcbs have mask roms labeled: "KONAMI // 055066 // 122A07 // 233505" @1H (maybe mismarked 2H on pcb?) */ - ROM_LOAD( "122a06.1g", 0x40000, 0x40000, CRC(438f4388) SHA1(9e23805c9642a237daeaf106187d1e1e0692434d) ) /* Later pcbs have mask roms labeled: "KONAMI // 055065 // 122A06 // 233506" @1G */ + ROM_REGION( 0x20000, "maincpu", 0 ) + ROM_LOAD( "122__j_a__b01.16f", 0x00000, 0x20000, CRC(eabc6dd1) SHA1(e74c1f1f2fcf8973f0741a2d544f25c8639448bf) ) // "122 // J A // B01" @16F (27c010?) - ROM_REGION( 0x40000, "oki", 0 ) /* OKIM6295 samples */ - ROM_LOAD( "122a05.2f", 0x0000, 0x40000, CRC(bcc831bf) SHA1(c3382065dd0069a4dc0bde2d9931ec85b0bffc73) ) /* Later pcbs have mask roms labeled: "KONAMI // 055064 // 122A05 // 233507" @2F (maybe 2G? marking isn't visible in the picture I have) */ + ROM_REGION( 0x80000, "tiles", 0 ) // addressable by the main CPU + ROM_LOAD( "122a07.1h", 0x00000, 0x40000, CRC(22ae55e3) SHA1(41bdc990f69416b639542e2186a3610c16389063) ) // Later PCBs have mask ROMs labeled: "KONAMI // 055066 // 122A07 // 233505" @1H (maybe mismarked 2H on PCB?) + ROM_LOAD( "122a06.1g", 0x40000, 0x40000, CRC(438f4388) SHA1(9e23805c9642a237daeaf106187d1e1e0692434d) ) // Later PCBs have mask ROMs labeled: "KONAMI // 055065 // 122A06 // 233506" @1G + + ROM_REGION( 0x40000, "oki", 0 ) + ROM_LOAD( "122a05.2f", 0x0000, 0x40000, CRC(bcc831bf) SHA1(c3382065dd0069a4dc0bde2d9931ec85b0bffc73) ) // Later PCBs have mask ROMs labeled: "KONAMI // 055064 // 122A05 // 233507" @2F (maybe 2G? marking isn't visible in the picture I have) ROM_REGION( 0x0300, "proms", 0 ) ROM_LOAD( "122a04.10b", 0x0000, 0x0100, CRC(506eb8c6) SHA1(3bff7cf286942d8bdbc3998245c3de20981fbecb) ) // AMD27S21 == 82S129 ROM_LOAD( "122a03.11b", 0x0100, 0x0100, CRC(590c4f64) SHA1(db4b34f8c5fdfea034a94d65873f6fb842f123e9) ) // AMD27S21 == 82S129 ROM_LOAD( "122a02.13b", 0x0200, 0x0100, CRC(5734305c) SHA1(c72e59acf79a4db1a5a9d827eef899c0675336f2) ) // AMD27S21 == 82S129 - // there are also two PALs of unknown type on the pcb: + // there are also two PALs of unknown type on the PCB: //054843 @12F //054844 @12H(12I?) ROM_END ROM_START( hexionb ) - ROM_REGION( 0x34800, "maincpu", 0 ) /* ROMs + space for additional RAM */ + ROM_REGION( 0x20000, "maincpu", 0 ) ROM_LOAD( "hexionb.u2", 0x00000, 0x20000, CRC(93edc5d4) SHA1(d14c5be85a67eebddda9103bdf19de8c3c05d3af) ) - ROM_RELOAD( 0x10000, 0x20000 ) /* banked at 8000-9fff */ - ROM_REGION( 0x80000, "gfx1", 0 ) /* addressable by the main CPU */ + ROM_REGION( 0x80000, "tiles", 0 ) // addressable by the main CPU ROM_LOAD( "hexionb.u30", 0x00000, 0x40000, CRC(22ae55e3) SHA1(41bdc990f69416b639542e2186a3610c16389063) ) // == 122a07.1h ROM_LOAD( "hexionb.u29", 0x40000, 0x40000, CRC(438f4388) SHA1(9e23805c9642a237daeaf106187d1e1e0692434d) ) // == 122a06.1g - ROM_REGION( 0x40000, "oki", 0 ) /* OKIM6295 samples */ + ROM_REGION( 0x40000, "oki", 0 ) ROM_LOAD( "hexionb.u16", 0x0000, 0x40000, CRC(bcc831bf) SHA1(c3382065dd0069a4dc0bde2d9931ec85b0bffc73) ) // == 122a05.2f - ROM_REGION( 0x40000, "oki2", 0 ) /* OKIM6295 samples */ + ROM_REGION( 0x40000, "oki2", 0 ) ROM_LOAD( "hexionb.u18", 0x0000, 0x40000, CRC(c179d315) SHA1(b39d5ec8a90b7ae06763191b8324f32fe1d0ca9b) ) ROM_REGION( 0x0300, "proms", 0 ) @@ -351,5 +576,8 @@ //PAL20L10 @U31 ROM_END -GAME( 1992, hexion, 0, hexion, hexion, hexion_state, empty_init, ROT0, "Konami", "Hexion (Japan ver JAB)", 0 ) -GAME( 1992, hexionb, hexion, hexionb, hexion, hexion_state, empty_init, ROT0, "bootleg (Impeuropex Corp.)", "Hexion (Asia ver AAA, bootleg)", 0 ) // we're missing an original Asia AAA +} // anonymous namespace + + +GAME( 1992, hexion, 0, hexion, hexion, hexion_state, empty_init, ROT0, "Konami", "Hexion (Japan ver JAB)", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, hexionb, hexion, hexionb, hexion, hexion_state, empty_init, ROT0, "bootleg (Impeuropex Corp.)", "Hexion (Asia ver AAA, bootleg)", MACHINE_SUPPORTS_SAVE ) // we're missing an original Asia AAA diff -Nru mame-0.242+dfsg.1/src/mame/drivers/hh_b5000.cpp mame-0.243+dfsg.1/src/mame/drivers/hh_b5000.cpp --- mame-0.242+dfsg.1/src/mame/drivers/hh_b5000.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/hh_b5000.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,725 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:hap -// thanks-to:Sean Riddle -/*************************************************************************** - -Rockwell B5000 MCU series handhelds (before PPS-4/1) -Mostly calculators on these MCUs, but also Mattel's first couple of handhelds. - -ROM source notes when dumped from another model, but confident it's the same: -- rw18r: Rockwell 8R -- misatk: Mattel Space Alert - -***************************************************************************/ - -#include "emu.h" - -#include "cpu/b5000/b5000.h" -#include "cpu/b5000/b6000.h" -#include "cpu/b5000/b6100.h" -#include "video/pwm.h" -#include "sound/spkrdev.h" - -#include "speaker.h" - -// internal artwork -#include "autorace.lh" -#include "gravity.lh" -#include "mbaseb.lh" -#include "mfootb.lh" -#include "misatk.lh" -#include "rw18r.lh" - -//#include "hh_b5000_test.lh" // common test-layout - use external artwork - - -class hh_b5000_state : public driver_device -{ -public: - hh_b5000_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_display(*this, "display"), - m_speaker(*this, "speaker"), - m_inputs(*this, "IN.%u", 0) - { } - - DECLARE_INPUT_CHANGED_MEMBER(power_button); - template DECLARE_INPUT_CHANGED_MEMBER(switch_next) { if (newval) switch_change(Sel, param, true); } - template DECLARE_INPUT_CHANGED_MEMBER(switch_prev) { if (newval) switch_change(Sel, param, false); } - -protected: - virtual void machine_start() override; - virtual void machine_reset() override; - - // devices - required_device m_maincpu; - optional_device m_display; - optional_device m_speaker; - optional_ioport_array<5> m_inputs; // max 5 - - u16 m_inp_mux = 0; - - // MCU output pin state - u16 m_str = 0; - u16 m_seg = 0; - - u8 read_inputs(int columns); - void switch_change(int sel, u32 mask, bool next); -}; - - -// machine start/reset - -void hh_b5000_state::machine_start() -{ - // register for savestates - save_item(NAME(m_inp_mux)); - save_item(NAME(m_str)); - save_item(NAME(m_seg)); -} - -void hh_b5000_state::machine_reset() -{ -} - - - -/*************************************************************************** - - Helper Functions - -***************************************************************************/ - -// generic input handlers - -u8 hh_b5000_state::read_inputs(int columns) -{ - u8 ret = 0; - - // read selected input rows - for (int i = 0; i < columns; i++) - if (m_inp_mux >> i & 1) - ret |= m_inputs[i]->read(); - - return ret; -} - -void hh_b5000_state::switch_change(int sel, u32 mask, bool next) -{ - // config switches (for direct control) - ioport_field *inp = m_inputs[sel]->field(mask); - - if (next && inp->has_next_setting()) - inp->select_next_setting(); - else if (!next && inp->has_previous_setting()) - inp->select_previous_setting(); -} - -INPUT_CHANGED_MEMBER(hh_b5000_state::power_button) -{ - // power button or switch - bool power = (param) ? (bool(param - 1)) : !newval; - - if (!power && m_display != nullptr) - m_display->clear(); - m_maincpu->set_input_line(INPUT_LINE_RESET, power ? CLEAR_LINE : ASSERT_LINE); -} - - - -/*************************************************************************** - - Minidrivers (subclass, I/O, Inputs, Machine Config, ROM Defs) - -***************************************************************************/ - -namespace { - -/*************************************************************************** - - Mattel Auto Race (model 9879) - * B6000 MCU (label B6000CA, die label B6000-B) - * 2-digit 7seg display, 21 other leds, 1-bit sound - - This is Mattel's first electronic handheld game, also the first CPU-based - handheld game overall. Hardware design (even the MCU) and programming - was done at Rockwell. - - A European version was released as "Ski Slalom", except it's upside-down. - -***************************************************************************/ - -class autorace_state : public hh_b5000_state -{ -public: - autorace_state(const machine_config &mconfig, device_type type, const char *tag) : - hh_b5000_state(mconfig, type, tag) - { } - - void autorace(machine_config &config); - -private: - void write_str(u16 data); - void write_seg(u16 data); -}; - -// handlers - -void autorace_state::write_str(u16 data) -{ - m_display->write_my(data); -} - -void autorace_state::write_seg(u16 data) -{ - m_display->write_mx(data); -} - -// config - -static INPUT_PORTS_START( autorace ) - PORT_START("IN.0") // KB - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) // does not auto-center on real device - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) // " - PORT_CONFNAME( 0x0c, 0x0c, "Gear" ) - PORT_CONFSETTING( 0x0c, "1" ) - PORT_CONFSETTING( 0x04, "2" ) - PORT_CONFSETTING( 0x00, "3" ) - PORT_CONFSETTING( 0x08, "4" ) - - PORT_START("IN.1") // DIN - PORT_CONFNAME( 0x01, 0x00, "Factory Test" ) - PORT_CONFSETTING( 0x00, DEF_STR( Off ) ) - PORT_CONFSETTING( 0x01, DEF_STR( On ) ) - - PORT_START("POWER") // power switch - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_b5000_state, power_button, 0) PORT_NAME("Start / Reset") - - PORT_START("SWITCH") // fake - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_b5000_state, switch_prev<0>, 0x0c) PORT_NAME("Gear Switch Down") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_b5000_state, switch_next<0>, 0x0c) PORT_NAME("Gear Switch Up") -INPUT_PORTS_END - -void autorace_state::autorace(machine_config &config) -{ - // basic machine hardware - B6000(config, m_maincpu, 160000); // approximation - m_maincpu->write_str().set(FUNC(autorace_state::write_str)); - m_maincpu->write_seg().set(FUNC(autorace_state::write_seg)); - m_maincpu->read_kb().set_ioport("IN.0"); - m_maincpu->read_din().set_ioport("IN.1"); - m_maincpu->write_spk().set(m_speaker, FUNC(speaker_sound_device::level_w)); - - // video hardware - PWM_DISPLAY(config, m_display).set_size(9, 8); - m_display->set_segmask(0x180, 0x7f); - m_display->set_bri_levels(0.02, 0.2); // player led is brighter - config.set_default_layout(layout_autorace); - - // sound hardware - SPEAKER(config, "mono").front_center(); - SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); -} - -// roms - -ROM_START( autorace ) - ROM_REGION( 0x200, "maincpu", 0 ) - ROM_LOAD( "b6000ca", 0x000, 0x200, CRC(a112c928) SHA1(aa5d0b46a08e2460081d4148cf254dc5ec53817e) ) -ROM_END - - - - - -/*************************************************************************** - - Mattel Missile Attack (model 2048) / Space Alert (model 2448) - * B6000 MCU (label B6001CA/EA, die label B6001) - * 2-digit 7seg display, 21 other leds, 1-bit sound - - The initial release was called Missile Attack, it didn't sell well (Mattel - blamed it on NBC for refusing to air their commercial). They changed the - title/setting and rereleased it as "Space Alert" (aka "Battlestar Galactica: - Space Alert"). In 1980, they advertised another rerelease, this time as - "Flash Gordon", but that didn't come out. - -***************************************************************************/ - -class misatk_state : public hh_b5000_state -{ -public: - misatk_state(const machine_config &mconfig, device_type type, const char *tag) : - hh_b5000_state(mconfig, type, tag) - { } - - void misatk(machine_config &config); - -private: - void write_str(u16 data); - void write_seg(u16 data); -}; - -// handlers - -void misatk_state::write_str(u16 data) -{ - m_display->write_my(data); -} - -void misatk_state::write_seg(u16 data) -{ - m_display->write_mx(data); -} - -// config - -static INPUT_PORTS_START( misatk ) - PORT_START("IN.0") // KB - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) // does not auto-center on real device - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) // " - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 ) - - PORT_START("IN.1") // DIN - PORT_CONFNAME( 0x01, 0x00, "Factory Test" ) - PORT_CONFSETTING( 0x00, DEF_STR( Off ) ) - PORT_CONFSETTING( 0x01, DEF_STR( On ) ) - - PORT_START("POWER") // power switch - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_b5000_state, power_button, 0) PORT_NAME("Arm / Off") -INPUT_PORTS_END - -void misatk_state::misatk(machine_config &config) -{ - // basic machine hardware - B6000(config, m_maincpu, 250000); // approximation - m_maincpu->write_str().set(FUNC(misatk_state::write_str)); - m_maincpu->write_seg().set(FUNC(misatk_state::write_seg)); - m_maincpu->read_kb().set_ioport("IN.0"); - m_maincpu->read_din().set_ioport("IN.1"); - m_maincpu->write_spk().set(m_speaker, FUNC(speaker_sound_device::level_w)); - - // video hardware - PWM_DISPLAY(config, m_display).set_size(9, 8); - m_display->set_segmask(0x180, 0x7f); - m_display->set_bri_levels(0.015, 0.15); // player led is brighter - config.set_default_layout(layout_misatk); - - // sound hardware - SPEAKER(config, "mono").front_center(); - SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); -} - -// roms - -ROM_START( misatk ) - ROM_REGION( 0x200, "maincpu", 0 ) - ROM_LOAD( "b6001ea", 0x000, 0x200, CRC(56564b79) SHA1(6f33f57ea312cb2018fb59f72eaff3a9642e74a2) ) -ROM_END - - - - - -/*************************************************************************** - - Mattel Football (model 2024) - * B6100 MCU (label B6100EB/-15, die label B6100 A) - * 7-digit 7seg display, 27 other leds, 1-bit sound - - When Football II came out, they renamed this one to Football I. - -***************************************************************************/ - -class mfootb_state : public hh_b5000_state -{ -public: - mfootb_state(const machine_config &mconfig, device_type type, const char *tag) : - hh_b5000_state(mconfig, type, tag) - { } - - void mfootb(machine_config &config); - - DECLARE_INPUT_CHANGED_MEMBER(score_button) { update_display(); } - -private: - void update_display(); - void write_str(u16 data); - void write_seg(u16 data); -}; - -// handlers - -void mfootb_state::update_display() -{ - // 4th digit DP is from the SCORE button - u8 dp = (m_inputs[1]->read() & 2) ? 0x80 : 0; - m_display->matrix(m_str, (m_seg << 1 & 0x700) | dp | (m_seg & 0x7f)); -} - -void mfootb_state::write_str(u16 data) -{ - m_str = data; - update_display(); -} - -void mfootb_state::write_seg(u16 data) -{ - m_seg = data; - update_display(); -} - -// config - -static INPUT_PORTS_START( mfootb ) - PORT_START("IN.0") // KB - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_16WAY - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Forward") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_16WAY - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Kick") - - PORT_START("IN.1") // DIN - PORT_CONFNAME( 0x01, 0x01, DEF_STR( Difficulty ) ) - PORT_CONFSETTING( 0x01, "1" ) // PRO 1 - PORT_CONFSETTING( 0x00, "2" ) // PRO 2 - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 ) PORT_NAME("Score") PORT_CHANGED_MEMBER(DEVICE_SELF, mfootb_state, score_button, 0) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 ) PORT_NAME("Status") - PORT_CONFNAME( 0x08, 0x00, "Factory Test" ) - PORT_CONFSETTING( 0x00, DEF_STR( Off ) ) - PORT_CONFSETTING( 0x08, DEF_STR( On ) ) -INPUT_PORTS_END - -void mfootb_state::mfootb(machine_config &config) -{ - // basic machine hardware - B6100(config, m_maincpu, 280000); // approximation - m_maincpu->write_str().set(FUNC(mfootb_state::write_str)); - m_maincpu->write_seg().set(FUNC(mfootb_state::write_seg)); - m_maincpu->read_kb().set_ioport("IN.0"); - m_maincpu->read_din().set_ioport("IN.1"); - m_maincpu->write_spk().set(m_speaker, FUNC(speaker_sound_device::level_w)); - - // video hardware - PWM_DISPLAY(config, m_display).set_size(9, 11); - m_display->set_segmask(0x7f, 0x7f); - m_display->set_segmask(0x08, 0xff); // only one digit has DP - m_display->set_bri_levels(0.02, 0.2); // player led is brighter - config.set_default_layout(layout_mfootb); - - // sound hardware - SPEAKER(config, "mono").front_center(); - SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); -} - -// roms - -ROM_START( mfootb ) - ROM_REGION( 0x400, "maincpu", ROMREGION_ERASE00 ) - ROM_LOAD( "b6100eb", 0x000, 0x300, CRC(5b27620f) SHA1(667ff6cabced89ef4ad848b73d66a06526edc5e6) ) - ROM_CONTINUE( 0x380, 0x080 ) -ROM_END - - - - - -/*************************************************************************** - - Mattel Baseball (model 2942) - * B6100 MCU (label B6101-12, die label B6101 A) - * 4-digit 7seg display, 28 other leds, 1-bit sound - -***************************************************************************/ - -class mbaseb_state : public hh_b5000_state -{ -public: - mbaseb_state(const machine_config &mconfig, device_type type, const char *tag) : - hh_b5000_state(mconfig, type, tag) - { } - - void mbaseb(machine_config &config); - -private: - void write_str(u16 data); - void write_seg(u16 data); -}; - -// handlers - -void mbaseb_state::write_str(u16 data) -{ - m_display->write_my(data); -} - -void mbaseb_state::write_seg(u16 data) -{ - m_display->write_mx(bitswap<10>(data,7,8,9,6,5,4,3,2,1,0)); -} - -// config - -static INPUT_PORTS_START( mbaseb ) - PORT_START("IN.0") // KB - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Pitch") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Hit") - - PORT_START("IN.1") // DIN - PORT_CONFNAME( 0x01, 0x01, DEF_STR( Difficulty ) ) - PORT_CONFSETTING( 0x01, "1" ) // PRO 1 - PORT_CONFSETTING( 0x00, "2" ) // PRO 2 - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START1 ) PORT_NAME("Score") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Run") - PORT_CONFNAME( 0x08, 0x00, "Factory Test" ) - PORT_CONFSETTING( 0x00, DEF_STR( Off ) ) - PORT_CONFSETTING( 0x08, DEF_STR( On ) ) -INPUT_PORTS_END - -void mbaseb_state::mbaseb(machine_config &config) -{ - // basic machine hardware - B6100(config, m_maincpu, 280000); // approximation - m_maincpu->write_str().set(FUNC(mbaseb_state::write_str)); - m_maincpu->write_seg().set(FUNC(mbaseb_state::write_seg)); - m_maincpu->read_kb().set_ioport("IN.0"); - m_maincpu->read_din().set_ioport("IN.1"); - m_maincpu->write_spk().set(m_speaker, FUNC(speaker_sound_device::level_w)); - - // video hardware - PWM_DISPLAY(config, m_display).set_size(9, 10); - m_display->set_segmask(0x170, 0x7f); - m_display->set_segmask(0x110, 0xff); // 2 digits have DP - config.set_default_layout(layout_mbaseb); - - // sound hardware - SPEAKER(config, "mono").front_center(); - SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); -} - -// roms - -ROM_START( mbaseb ) - ROM_REGION( 0x400, "maincpu", ROMREGION_ERASE00 ) - ROM_LOAD( "b6101-12", 0x000, 0x300, CRC(7720ddcc) SHA1(cd43126db7c6262f659f325aa58420e1a8a1a659) ) - ROM_CONTINUE( 0x380, 0x080 ) -ROM_END - - - - - -/*************************************************************************** - - Mattel Gravity (model 8291) - * B6100 MCU (label B6102-11, die label B6102 A) - * 3-digit 7seg display, 27 other leds, 1-bit sound - - It was advertised as "Catastrophe", but went unreleased. It got sold later - as "Gravity", with a less catastrophic setting. - - The game is basically 3 mini games in 1: - - Juggling (Rumbling Rocks in Catastrophe) - - Coin Drop (Quake Shock in Catastrophe) - - Docking (Meteorite Shower in Catstrophe) - -***************************************************************************/ - -class gravity_state : public hh_b5000_state -{ -public: - gravity_state(const machine_config &mconfig, device_type type, const char *tag) : - hh_b5000_state(mconfig, type, tag) - { } - - void gravity(machine_config &config); - -private: - void write_str(u16 data); - void write_seg(u16 data); -}; - -// handlers - -void gravity_state::write_str(u16 data) -{ - m_display->write_my(data); -} - -void gravity_state::write_seg(u16 data) -{ - m_display->write_mx(data); -} - -// config - -static INPUT_PORTS_START( gravity ) - PORT_START("IN.0") // KB - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON3 ) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 ) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) - - PORT_START("IN.1") // DIN - PORT_CONFNAME( 0x08, 0x00, "Factory Test" ) - PORT_CONFSETTING( 0x00, DEF_STR( Off ) ) - PORT_CONFSETTING( 0x08, DEF_STR( On ) ) -INPUT_PORTS_END - -void gravity_state::gravity(machine_config &config) -{ - // basic machine hardware - B6100(config, m_maincpu, 250000); // approximation - m_maincpu->write_str().set(FUNC(gravity_state::write_str)); - m_maincpu->write_seg().set(FUNC(gravity_state::write_seg)); - m_maincpu->read_kb().set_ioport("IN.0"); - m_maincpu->read_din().set_ioport("IN.1"); - m_maincpu->write_spk().set(m_speaker, FUNC(speaker_sound_device::level_w)); - - // video hardware - PWM_DISPLAY(config, m_display).set_size(9, 10); - m_display->set_segmask(0x1c0, 0x7f); - config.set_default_layout(layout_gravity); - - // sound hardware - SPEAKER(config, "mono").front_center(); - SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); -} - -// roms - -ROM_START( gravity ) - ROM_REGION( 0x400, "maincpu", ROMREGION_ERASE00 ) - ROM_LOAD( "b6102-11", 0x000, 0x300, CRC(532f332e) SHA1(593224d3a2a5b6022f0d73b6e6fb9093d2d54f68) ) - ROM_CONTINUE( 0x380, 0x080 ) -ROM_END - - - - - -/*************************************************************************** - - Rockwell 8R, Rockwell 18R - * B5000 MCU (label B5000CC, die label B5000) - * 8-digit 7seg display - - This MCU was used in Rockwell 8R, 18R, and 9TR. It was also sold by - Tandy (Radio Shack) as EC-220. - -***************************************************************************/ - -class rw18r_state : public hh_b5000_state -{ -public: - rw18r_state(const machine_config &mconfig, device_type type, const char *tag) : - hh_b5000_state(mconfig, type, tag) - { } - - void rw18r(machine_config &config); - -private: - void write_str(u16 data); - void write_seg(u16 data); - u8 read_kb(); -}; - -// handlers - -void rw18r_state::write_str(u16 data) -{ - // STR0-STR7: digit select - // STR4-STR8: input mux - m_display->write_my(data); - m_inp_mux = data >> 4; -} - -void rw18r_state::write_seg(u16 data) -{ - // SEG0-SEG7: digit segment data - m_display->write_mx(bitswap<8>(data,0,7,6,5,4,3,2,1)); -} - -u8 rw18r_state::read_kb() -{ - // KB: multiplexed inputs - return read_inputs(5); -} - -// config - -static INPUT_PORTS_START( rw18r ) - PORT_START("IN.0") // STR4 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_BACKSPACE) PORT_NAME("CE/C") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("0") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_STOP) PORT_CODE(KEYCODE_DEL_PAD) PORT_NAME(".") - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_PLUS_PAD) PORT_NAME("+") - - PORT_START("IN.1") // STR5 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("1") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("2") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("3") - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_MINUS_PAD) PORT_NAME("-") - - PORT_START("IN.2") // STR6 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("4") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("5") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("6") - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_ASTERISK) PORT_NAME(u8"×") - - PORT_START("IN.3") // STR7 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("7") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("8") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_NAME("9") - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_SLASH_PAD) PORT_NAME(u8"÷") - - PORT_START("IN.4") // STR8 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_S) PORT_NAME("STO") // unpopulated on 8R - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_R) PORT_NAME("RCL") // " - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_SLASH) PORT_NAME("%") - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("=") -INPUT_PORTS_END - -void rw18r_state::rw18r(machine_config &config) -{ - // basic machine hardware - B5000(config, m_maincpu, 250000); // approximation - m_maincpu->write_str().set(FUNC(rw18r_state::write_str)); - m_maincpu->write_seg().set(FUNC(rw18r_state::write_seg)); - m_maincpu->read_kb().set(FUNC(rw18r_state::read_kb)); - - // video hardware - PWM_DISPLAY(config, m_display).set_size(8, 8); - m_display->set_segmask(0xff, 0xff); - config.set_default_layout(layout_rw18r); -} - -// roms - -ROM_START( rw18r ) - ROM_REGION( 0x200, "maincpu", ROMREGION_ERASE00 ) - ROM_LOAD( "b5000cc", 0x000, 0x0c0, CRC(ace32614) SHA1(23cf11acf2e73ce2dfc165cb87f86fab15f69ff7) ) - ROM_CONTINUE( 0x100, 0x100 ) -ROM_END - - - -} // anonymous namespace - -/*************************************************************************** - - Game driver(s) - -***************************************************************************/ - -// YEAR NAME PARENT CMP MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS -CONS( 1976, autorace, 0, 0, autorace, autorace, autorace_state, empty_init, "Mattel Electronics", "Auto Race", MACHINE_SUPPORTS_SAVE ) -CONS( 1977, misatk, 0, 0, misatk, misatk, misatk_state, empty_init, "Mattel Electronics", "Missile Attack / Space Alert", MACHINE_SUPPORTS_SAVE ) -CONS( 1977, mfootb, 0, 0, mfootb, mfootb, mfootb_state, empty_init, "Mattel Electronics", "Football (Mattel)", MACHINE_SUPPORTS_SAVE ) -CONS( 1978, mbaseb, 0, 0, mbaseb, mbaseb, mbaseb_state, empty_init, "Mattel Electronics", "Baseball (Mattel)", MACHINE_SUPPORTS_SAVE ) -CONS( 1980, gravity, 0, 0, gravity, gravity, gravity_state, empty_init, "Mattel Electronics", "Gravity (Mattel)", MACHINE_SUPPORTS_SAVE ) - -COMP( 1975, rw18r, 0, 0, rw18r, rw18r, rw18r_state, empty_init, "Rockwell", "18R (Rockwell)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/hh_cops1.cpp mame-0.243+dfsg.1/src/mame/drivers/hh_cops1.cpp --- mame-0.242+dfsg.1/src/mame/drivers/hh_cops1.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/hh_cops1.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -766,7 +766,7 @@ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_CHAR('S') PORT_NAME("Up/Downshift") PORT_START("IN.1") // DS8874 OUT 4 port K - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_CHAR('1') PORT_NAME("1 / \xe2\x88\x9ax / go if neg") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_CHAR('1') PORT_NAME("1 / " UTF8_SQUAREROOT "x / go if neg") PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_CHAR('7') PORT_NAME("7 / sin / arcsin") PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS_PAD) PORT_CHAR('-') PORT_NAME("- / -x / F") PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR('C') PORT_NAME("C/CE / step") @@ -784,9 +784,9 @@ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_START("IN.4") // DS8874 OUT 7 port K - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_CHAR('4') PORT_NAME("4 / ln x / e\xcb\xa3") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_CHAR('4') PORT_NAME("4 / ln x / e" UTF8_POW_X) PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP) PORT_CODE(KEYCODE_DEL_PAD) PORT_CHAR('.') PORT_NAME("./EE/_ / Downshift / A") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ASTERISK) PORT_CHAR('*') PORT_NAME(u8"× / x\xc2\xb2 / .") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ASTERISK) PORT_CHAR('*') PORT_NAME("× / x" UTF8_POW_2 " / .") PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_START("IN.5") // DS8874 OUT 8 port K diff -Nru mame-0.242+dfsg.1/src/mame/drivers/hh_hmcs40.cpp mame-0.243+dfsg.1/src/mame/drivers/hh_hmcs40.cpp --- mame-0.242+dfsg.1/src/mame/drivers/hh_hmcs40.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/hh_hmcs40.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -16,7 +16,7 @@ *A56 HD38750 1981, Actronics(Hanzawa) Twinvader (small brown version) *A58 HD38750 1981, Actronics(Hanzawa) Challenge Racer/Ludotronic(Hanzawa) Grand Prix Turbo *A62 HD38750 1982, Actronics(Hanzawa) Pack'n Maze - *A67 HD38750 1982, Romtec Pucki & Monsters (ET-803) + @A67 HD38750 1982, Romtec Pucki & Monsters (ET-803) @A04 HD38800 1980, Gakken Heiankyo Alien A16 HD38800 1981, Entex Select-A-Game cartridge: Basketball 3 -> sag.cpp @@ -37,13 +37,13 @@ @B01 HD38800 1982, Gakken Crazy Kong @B19 HD38800 1982, Bandai Zaxxon @B23 HD38800 1982, Tomy Kingman (THF-01II) - *B24 HD38800 1982, Actronics(Hanzawa) Wanted G-Man - *B29 HD38800 1984, Tomy Portable 6000 Bombman + @B24 HD38800 1982, Actronics(Hanzawa) Wanted G-Man + @B29 HD38800 1984, Tomy Bombman *B31 HD38800 1983, Romtec Frog Prince (ET-806) *B35 HD38800 1983, Bandai Gundam vs Gelgoog Zaku - *B42 HD38800 1983, Bandai Kiteyo Parman + @B42 HD38800 1983, Bandai Kiteyo Parman @B43 HD38800 1983, Bandai Dokodemo Dorayaki Doraemon (PT-412) - *B48 HD38800 1983, Bandai Go Go Dynaman + @B48 HD38800 1983, Bandai Toukon Juohmaru @B52 HD38800 1983, Bandai Ultraman Monster Battle (PT-424) @A09 HD38820 1980, Mattel World Championship Baseball @@ -57,13 +57,14 @@ @A43 HD38820 1982, Entex Turtles @A45 HD38820 1982, Coleco Donkey Kong @A49 HD38820 1983, Bandai Zackman + @L53 HD38820 1983, Gakken Defender @A61 HD38820 1983, Coleco Ms. Pac-Man *A62 HD38820 1983, Coleco Zaxxon @A63 HD38820 1983, Bandai Pengo @A65 HD38820 1983, Bandai Burger Time (PT-389) @A69 HD38820 1983, Gakken Dig Dug @A70 HD38820 1983, Parker Brothers Q*Bert - *A75 HD38820 1983, Bandai Toukon Juohmaru + @A75 HD38820 1983, Bandai Go Go Dynaman @A85 HD38820 1984, Bandai Machine Man (PT-438) @A88 HD38820 1984, Bandai Pair Match (PT-460) (1/2) @A89 HD38820 1984, Bandai Pair Match (PT-460) (2/2) @@ -96,10 +97,12 @@ ============================================================================ -ROM source notes when dumped from another publisher, but confident it's the same: +ROM source notes when dumped from another model, but confident it's the same: - gckong: CGL Super Kong +- ggdman: Bandai Kampf der Monster - ghalien: CGL Earth Invaders - kingman: Tandy Kingman +- wantgman: Ludotronic Operation 'Z' - zackman: Tandy Zackman TODO: @@ -116,7 +119,8 @@ games may manipulate VFD plate brightness by strobing it longer/shorter, eg. cgalaxn when a ship explodes. - bzaxxon 3D effect is difficult to simulate -- improve/redo SVGs of: bzaxxon, bbtime +- improve/redo SVG for: bzaxxon, bbtime +- add SVG for: ggdman, ktparman, tkjmaru, gdefender, bombman, wantgman, puckimon - get rid of hardcoded color overlay from SVGs, use MAME internal artwork ***************************************************************************/ @@ -143,7 +147,7 @@ #include "msthawk.lh" #include "packmon.lh" -//#include "hh_hmcs40_test.lh" // common test-layout - no svg artwork(yet), use external artwork +#include "hh_hmcs40_test.lh" // common test-layout - no svg artwork(yet), use external artwork class hh_hmcs40_state : public driver_device @@ -263,6 +267,125 @@ /*************************************************************************** + Actronics / Hanzawa Wanted G-Man + * Hitachi HD38800B24 MCU + * cyan/red VFD display + + known releases: + - World: Wanted G-Man, published by Actronics + - France: Operation 'Z', published by Ludotronic + +***************************************************************************/ + +class wantgman_state : public hh_hmcs40_state +{ +public: + wantgman_state(const machine_config &mconfig, device_type type, const char *tag) : + hh_hmcs40_state(mconfig, type, tag) + { } + + void wantgman(machine_config &config); + +private: + void update_display(); + void plate_w(offs_t offset, u8 data); + void grid_w(u16 data); + u16 input_r(); +}; + +// handlers + +void wantgman_state::update_display() +{ + m_display->matrix(m_grid, m_plate); +} + +void wantgman_state::plate_w(offs_t offset, u8 data) +{ + // R0x-R3x: vfd plate + int shift = offset * 4; + m_plate = (m_plate & ~(0xf << shift)) | (data << shift); + update_display(); +} + +void wantgman_state::grid_w(u16 data) +{ + // D0: speaker out + m_speaker->level_w(data & 1); + + // D1-D6: input mux + m_inp_mux = data >> 1 & 0x3f; + + // D1-D9,D13,D14: vfd grid + m_grid = (data >> 1 & 0x1ff) | (data >> 4 & 0x600); + update_display(); +} + +u16 wantgman_state::input_r() +{ + // D15: multiplexed inputs + return read_inputs(6) & 0x8000; +} + +// config + +static INPUT_PORTS_START( wantgman ) + PORT_START("IN.0") // D1 line D15 + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) + + PORT_START("IN.1") // D2 line D15 + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) + + PORT_START("IN.2") // D3 line D15 + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) + + PORT_START("IN.3") // D4 line D15 + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) + + PORT_START("IN.4") // D5 line D15 + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Skill / Start / Jump") + + PORT_START("IN.5") // D6 line D15 + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Demo") +INPUT_PORTS_END + +void wantgman_state::wantgman(machine_config &config) +{ + // basic machine hardware + HD38800(config, m_maincpu, 400000); // approximation + m_maincpu->write_r<0>().set(FUNC(wantgman_state::plate_w)); + m_maincpu->write_r<1>().set(FUNC(wantgman_state::plate_w)); + m_maincpu->write_r<2>().set(FUNC(wantgman_state::plate_w)); + m_maincpu->write_r<3>().set(FUNC(wantgman_state::plate_w)); + m_maincpu->write_d().set(FUNC(wantgman_state::grid_w)); + m_maincpu->read_d().set(FUNC(wantgman_state::input_r)); + + // video hardware + PWM_DISPLAY(config, m_display).set_size(11, 16); + config.set_default_layout(layout_hh_hmcs40_test); + + // sound hardware + SPEAKER(config, "mono").front_center(); + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} + +// roms + +ROM_START( wantgman ) + ROM_REGION( 0x2000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD( "hd38800b24", 0x0000, 0x1000, CRC(ad1dfb26) SHA1(f2ef0ec98116a8a38e97299e3e3b2b0129d78c04) ) + ROM_CONTINUE( 0x1e80, 0x0100 ) + + ROM_REGION( 100000, "screen", 0) + ROM_LOAD( "wantgman.svg", 0, 100000, NO_DUMP ) +ROM_END + + + + + +/*************************************************************************** + Bambino Dribble Away Basketball (manufactured in Japan) * PCB label Emix Corp. ET-05 * Hitachi HD38750A08 MCU @@ -1317,6 +1440,100 @@ /*************************************************************************** + Bandai Kiteyo Parman + * Hitachi HD38800B42 MCU + * cyan/red/blue VFD display + +***************************************************************************/ + +class ktparman_state : public hh_hmcs40_state +{ +public: + ktparman_state(const machine_config &mconfig, device_type type, const char *tag) : + hh_hmcs40_state(mconfig, type, tag) + { } + + void ktparman(machine_config &config); + +private: + void plate_w(offs_t offset, u8 data); + void grid_w(u16 data); +}; + +// handlers + +void ktparman_state::plate_w(offs_t offset, u8 data) +{ + // R0x-R3x(,D0-D2): vfd plate + int shift = offset * 4; + m_plate = (m_plate & ~(0xf << shift)) | (data << shift); + + // update display + m_display->matrix(m_grid, m_plate); +} + +void ktparman_state::grid_w(u16 data) +{ + // D3: speaker out + m_speaker->level_w(data >> 3 & 1); + + // D8-D15: vfd grid + m_grid = data >> 8 & 0xff; + + // D0-D2: vfd plate (update display there) + plate_w(4, data & 7); +} + +// config + +static INPUT_PORTS_START( ktparman ) + PORT_START("IN.0") // port D + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) + + PORT_START("IN.1") // INT0 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_hmcs40_state, single_interrupt_line, 0) +INPUT_PORTS_END + +void ktparman_state::ktparman(machine_config &config) +{ + // basic machine hardware + HD38800(config, m_maincpu, 400000); // approximation + m_maincpu->write_r<0>().set(FUNC(ktparman_state::plate_w)); + m_maincpu->write_r<1>().set(FUNC(ktparman_state::plate_w)); + m_maincpu->write_r<2>().set(FUNC(ktparman_state::plate_w)); + m_maincpu->write_r<3>().set(FUNC(ktparman_state::plate_w)); + m_maincpu->write_d().set(FUNC(ktparman_state::grid_w)); + m_maincpu->read_d().set_ioport("IN.0"); + + // video hardware + PWM_DISPLAY(config, m_display).set_size(8, 19); + config.set_default_layout(layout_hh_hmcs40_test); + + // sound hardware + SPEAKER(config, "mono").front_center(); + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} + +// roms + +ROM_START( ktparman ) + ROM_REGION( 0x2000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD( "hd38800b42", 0x0000, 0x1000, CRC(ba1f7939) SHA1(1038d33923fcc87b5dd95954d5f964064a10ff9d) ) + ROM_CONTINUE( 0x1e80, 0x0100 ) + + ROM_REGION( 100000, "screen", 0) + ROM_LOAD( "ktparman.svg", 0, 100000, NO_DUMP ) +ROM_END + + + + + +/*************************************************************************** + Bandai Dokodemo Dorayaki Doraemon (FL LSI Game Push Up) (manufactured in Japan) * PCB label Kaken Corp PT-412 FL-Doreamon(in katakana) * Hitachi HD38800B43 MCU @@ -1428,6 +1645,119 @@ /*************************************************************************** + Bandai Toukon Juohmaru + * Hitachi HD38800B48 MCU + * cyan/red/blue VFD display + +***************************************************************************/ + +class tkjmaru_state : public hh_hmcs40_state +{ +public: + tkjmaru_state(const machine_config &mconfig, device_type type, const char *tag) : + hh_hmcs40_state(mconfig, type, tag) + { } + + void tkjmaru(machine_config &config); + +private: + void plate_w(offs_t offset, u8 data); + void grid_w(u16 data); + u16 input_r(); +}; + +// handlers + +void tkjmaru_state::plate_w(offs_t offset, u8 data) +{ + // R0x-R3x(,D0): vfd plate + int shift = offset * 4; + m_plate = (m_plate & ~(0xf << shift)) | (data << shift); + + // update display + m_display->matrix(m_grid, m_plate); +} + +void tkjmaru_state::grid_w(u16 data) +{ + // D4-D7: input mux + m_inp_mux = data >> 4 & 0xf; + + // D10: speaker out + m_speaker->level_w(data >> 10 & 1); + + // D11-D15: vfd grid + m_grid = data >> 11 & 0x1f; + + // D0: vfd plate (update display there) + plate_w(4, data & 1); +} + +u16 tkjmaru_state::input_r() +{ + // D3: multiplexed inputs, D8,D9: fixed inputs + return read_inputs(4) | m_inputs[4]->read(); +} + +// config + +static INPUT_PORTS_START( tkjmaru ) + PORT_START("IN.0") // D4 line D3 + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) + + PORT_START("IN.1") // D5 line D3 + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) + + PORT_START("IN.2") // D6 line D3 + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) + + PORT_START("IN.3") // D7 line D3 + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) + + PORT_START("IN.4") // D8,D9 + PORT_BIT( 0x100, IP_ACTIVE_HIGH, IPT_BUTTON1 ) + PORT_CONFNAME( 0x200, 0x000, "Factory Test" ) + PORT_CONFSETTING( 0x000, DEF_STR( Off ) ) + PORT_CONFSETTING( 0x200, DEF_STR( On ) ) +INPUT_PORTS_END + +void tkjmaru_state::tkjmaru(machine_config &config) +{ + // basic machine hardware + HD38800(config, m_maincpu, 400000); // approximation + m_maincpu->write_r<0>().set(FUNC(tkjmaru_state::plate_w)); + m_maincpu->write_r<1>().set(FUNC(tkjmaru_state::plate_w)); + m_maincpu->write_r<2>().set(FUNC(tkjmaru_state::plate_w)); + m_maincpu->write_r<3>().set(FUNC(tkjmaru_state::plate_w)); + m_maincpu->write_d().set(FUNC(tkjmaru_state::grid_w)); + m_maincpu->read_d().set(FUNC(tkjmaru_state::input_r)); + + // video hardware + PWM_DISPLAY(config, m_display).set_size(5, 17); + config.set_default_layout(layout_hh_hmcs40_test); + + // sound hardware + SPEAKER(config, "mono").front_center(); + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} + +// roms + +ROM_START( tkjmaru ) + ROM_REGION( 0x2000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD( "hd38800b48", 0x0000, 0x1000, CRC(249f357d) SHA1(0b5dad187a035db622790eb092b7be1ca7c57d97) ) + ROM_CONTINUE( 0x1e80, 0x0100 ) + + ROM_REGION( 100000, "screen", 0) + ROM_LOAD( "tkjmaru.svg", 0, 100000, NO_DUMP ) +ROM_END + + + + + +/*************************************************************************** + Bandai Ultraman Monster Battle (FL LSI Game Push Up) (manufactured in Japan) * PCB label Kaken Corp. PT-424 FL Ultra Man * Hitachi HD38800B52 MCU @@ -1507,7 +1837,131 @@ screen.set_size(1920, 673); screen.set_visarea_full(); - PWM_DISPLAY(config, m_display).set_size(8, 18); + PWM_DISPLAY(config, m_display).set_size(8, 18); + + // sound hardware + SPEAKER(config, "mono").front_center(); + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} + +// roms + +ROM_START( bultrman ) + ROM_REGION( 0x2000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD( "hd38800b52", 0x0000, 0x1000, CRC(88d372dc) SHA1(f2ac3b89be8afe6fb65914ccebe1a56316b9472a) ) + ROM_CONTINUE( 0x1e80, 0x0100 ) + + ROM_REGION( 405717, "screen", 0) + ROM_LOAD( "bultrman.svg", 0, 405717, CRC(13367971) SHA1(f294898712d1e146ff267bb1e3cfd059f972b248) ) +ROM_END + + + + + +/*************************************************************************** + + Bandai Go Go Dynaman + * Hitachi HD38820A75 MCU + * cyan/red/blue VFD display + + known releases: + - Japan: Go Go Dynaman, published by Bandai + - Germany: Kampf der Monster, published by Bandai + +***************************************************************************/ + +class ggdman_state : public hh_hmcs40_state +{ +public: + ggdman_state(const machine_config &mconfig, device_type type, const char *tag) : + hh_hmcs40_state(mconfig, type, tag) + { } + + void ggdman(machine_config &config); + + DECLARE_INPUT_CHANGED_MEMBER(input_changed) { update_int0(); } + +private: + void update_int0(); + void update_display(); + void plate_w(offs_t offset, u8 data); + void grid_w(u16 data); +}; + +// handlers + +void ggdman_state::update_display() +{ + m_display->matrix(m_grid, m_plate); +} + +void ggdman_state::plate_w(offs_t offset, u8 data) +{ + // R0x-R5x: vfd plate + int shift = offset * 4; + m_plate = (m_plate & ~(0xf << shift)) | (data << shift); + update_display(); +} + +void ggdman_state::grid_w(u16 data) +{ + // D0: speaker out + m_speaker->level_w(data & 1); + + // D6-D9: input mux + u8 inp_mux = data >> 6 & 0xf; + if (inp_mux != m_inp_mux) + { + m_inp_mux = inp_mux; + update_int0(); + } + + // D11-D15: vfd grid + m_grid = data >> 11 & 0x1f; + update_display(); +} + +void ggdman_state::update_int0() +{ + // INT0 on multiplexed inputs + set_interrupt(0, read_inputs(4)); +} + +// config + +static INPUT_PORTS_START( ggdman ) + PORT_START("IN.0") // D6 INT0 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_CHANGED_MEMBER(DEVICE_SELF, ggdman_state, input_changed, 0) + + PORT_START("IN.1") // D7 INT0 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_CHANGED_MEMBER(DEVICE_SELF, ggdman_state, input_changed, 0) + + PORT_START("IN.2") // D8 INT0 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_CHANGED_MEMBER(DEVICE_SELF, ggdman_state, input_changed, 0) + + PORT_START("IN.3") // D9 INT0 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_CHANGED_MEMBER(DEVICE_SELF, ggdman_state, input_changed, 0) + + PORT_START("IN.4") // INT1 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_hmcs40_state, single_interrupt_line, 1) +INPUT_PORTS_END + +void ggdman_state::ggdman(machine_config &config) +{ + // basic machine hardware + HD38820(config, m_maincpu, 400000); // approximation + m_maincpu->write_r<0>().set(FUNC(ggdman_state::plate_w)); + m_maincpu->write_r<1>().set(FUNC(ggdman_state::plate_w)); + m_maincpu->write_r<2>().set(FUNC(ggdman_state::plate_w)); + m_maincpu->write_r<3>().set(FUNC(ggdman_state::plate_w)); + m_maincpu->write_r<4>().set(FUNC(ggdman_state::plate_w)); + m_maincpu->write_r<5>().set(FUNC(ggdman_state::plate_w)); + m_maincpu->write_d().set(FUNC(ggdman_state::grid_w)); + + // video hardware + PWM_DISPLAY(config, m_display).set_size(5, 24); + config.set_default_layout(layout_hh_hmcs40_test); // sound hardware SPEAKER(config, "mono").front_center(); @@ -1516,13 +1970,13 @@ // roms -ROM_START( bultrman ) +ROM_START( ggdman ) ROM_REGION( 0x2000, "maincpu", ROMREGION_ERASE00 ) - ROM_LOAD( "hd38800b52", 0x0000, 0x1000, CRC(88d372dc) SHA1(f2ac3b89be8afe6fb65914ccebe1a56316b9472a) ) + ROM_LOAD( "hd38820a75", 0x0000, 0x1000, CRC(14a9c064) SHA1(253a5decbf4219c1b457280e301b82388694e49f) ) ROM_CONTINUE( 0x1e80, 0x0100 ) - ROM_REGION( 405717, "screen", 0) - ROM_LOAD( "bultrman.svg", 0, 405717, CRC(13367971) SHA1(f294898712d1e146ff267bb1e3cfd059f972b248) ) + ROM_REGION( 100000, "screen", 0) + ROM_LOAD( "ggdman.svg", 0, 100000, NO_DUMP ) ROM_END @@ -3579,6 +4033,136 @@ /*************************************************************************** + Gakken Defender + * Hitachi HD38820L53 MCU (SDIP) + * cyan/red/green VFD display + +***************************************************************************/ + +class gdefender_state : public hh_hmcs40_state +{ +public: + gdefender_state(const machine_config &mconfig, device_type type, const char *tag) : + hh_hmcs40_state(mconfig, type, tag) + { } + + void gdefender(machine_config &config); + + DECLARE_INPUT_CHANGED_MEMBER(input_changed) { update_int1(); } + +private: + void update_display(); + void update_int1(); + void plate_w(offs_t offset, u8 data); + void grid_w(u16 data); + u16 input_r(); +}; + +// handlers + +void gdefender_state::update_display() +{ + m_display->matrix(m_grid, m_plate); +} + +void gdefender_state::plate_w(offs_t offset, u8 data) +{ + // R0x-R6x: vfd plate + int shift = offset * 4; + m_plate = (m_plate & ~(0xf << shift)) | (data << shift); + update_display(); +} + +void gdefender_state::grid_w(u16 data) +{ + // D0: speaker out + m_speaker->level_w(data & 1); + + // D12-D15: input mux + u8 inp_mux = data >> 12 & 0xf; + if (inp_mux != m_inp_mux) + { + m_inp_mux = inp_mux; + update_int1(); + } + + // D3-D15: vfd grid + m_grid = data >> 3 & 0x1fff; + update_display(); +} + +u16 gdefender_state::input_r() +{ + // D1: multiplexed inputs + return read_inputs(4) & 2; +} + +void gdefender_state::update_int1() +{ + // INT1 on multiplexed inputs + set_interrupt(1, read_inputs(4) & 1); +} + +// config + +static INPUT_PORTS_START( gdefender ) + PORT_START("IN.0") // D11 INT1/D1 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_CHANGED_MEMBER(DEVICE_SELF, gdefender_state, input_changed, 0) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) + + PORT_START("IN.1") // D12 INT1/D1 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_CHANGED_MEMBER(DEVICE_SELF, gdefender_state, input_changed, 0) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Warp") + + PORT_START("IN.2") // D13 INT1/D1 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, gdefender_state, input_changed, 0) PORT_NAME("Missile / Game") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Bomb") + + PORT_START("IN.3") // D14 INT1/D1 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_CHANGED_MEMBER(DEVICE_SELF, gdefender_state, input_changed, 0) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) +INPUT_PORTS_END + +void gdefender_state::gdefender(machine_config &config) +{ + // basic machine hardware + HD38820(config, m_maincpu, 400000); // approximation + m_maincpu->write_r<0>().set(FUNC(gdefender_state::plate_w)); + m_maincpu->write_r<1>().set(FUNC(gdefender_state::plate_w)); + m_maincpu->write_r<2>().set(FUNC(gdefender_state::plate_w)); + m_maincpu->write_r<3>().set(FUNC(gdefender_state::plate_w)); + m_maincpu->write_r<4>().set(FUNC(gdefender_state::plate_w)); + m_maincpu->write_r<5>().set(FUNC(gdefender_state::plate_w)); + m_maincpu->write_r<6>().set(FUNC(gdefender_state::plate_w)); + m_maincpu->write_d().set(FUNC(gdefender_state::grid_w)); + m_maincpu->read_d().set(FUNC(gdefender_state::input_r)); + + // video hardware + PWM_DISPLAY(config, m_display).set_size(13, 28); + config.set_default_layout(layout_hh_hmcs40_test); + + // sound hardware + SPEAKER(config, "mono").front_center(); + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} + +// roms + +ROM_START( gdefender ) + ROM_REGION( 0x2000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD( "hd38820l53", 0x0000, 0x1000, CRC(fe52bbb4) SHA1(e0250954c3801af9841306c2e1fdf57f3b9edffa) ) + ROM_CONTINUE( 0x1e80, 0x0100 ) + + ROM_REGION( 100000, "screen", 0) + ROM_LOAD( "gdefender.svg", 0, 100000, NO_DUMP ) +ROM_END + + + + + +/*************************************************************************** + Gakken Dig Dug (manufactured in Japan) * PCB label Gakken DIG-DAG KS-004283(A/B) * Hitachi QFP HD38820A69 MCU @@ -4123,6 +4707,103 @@ /*************************************************************************** + Romtec Pucki & Monsters + * Hitachi HD38750A67 MCU + * cyan/red/green VFD display + +***************************************************************************/ + +class puckimon_state : public hh_hmcs40_state +{ +public: + puckimon_state(const machine_config &mconfig, device_type type, const char *tag) : + hh_hmcs40_state(mconfig, type, tag) + { } + + void puckimon(machine_config &config); + +private: + void update_display(); + void grid_w(offs_t offset, u8 data); + void plate_w(u16 data); +}; + +// handlers + +void puckimon_state::update_display() +{ + m_display->matrix(m_grid, m_plate); +} + +void puckimon_state::grid_w(offs_t offset, u8 data) +{ + // R1x-R3x: vfd grid + int shift = (offset - 1) * 4; + m_grid = (m_grid & ~(0xf << shift)) | (data << shift); + + // R13: vfd plate + if (offset == 1) + m_plate = (m_plate & 0x7fff) | (data << 12 & 0x8000); + update_display(); +} + +void puckimon_state::plate_w(u16 data) +{ + // D0: speaker out + m_speaker->level_w(data & 1); + + // D1-D15: vfd plate + m_plate = (m_plate & 0x8000) | (data >> 1 & 0x7fff); + update_display(); + +} + +// config + +static INPUT_PORTS_START( puckimon ) + PORT_START("IN.0") // port R0x + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) +INPUT_PORTS_END + +void puckimon_state::puckimon(machine_config &config) +{ + // basic machine hardware + HD38750(config, m_maincpu, 400000); // approximation + m_maincpu->read_r<0>().set_ioport("IN.0").invert(); + m_maincpu->write_r<1>().set(FUNC(puckimon_state::grid_w)); + m_maincpu->write_r<2>().set(FUNC(puckimon_state::grid_w)); + m_maincpu->write_r<3>().set(FUNC(puckimon_state::grid_w)); + m_maincpu->write_d().set(FUNC(puckimon_state::plate_w)); + + // video hardware + PWM_DISPLAY(config, m_display).set_size(12, 16); + config.set_default_layout(layout_hh_hmcs40_test); + + // sound hardware + SPEAKER(config, "mono").front_center(); + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} + +// roms + +ROM_START( puckimon ) + ROM_REGION( 0x1000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD( "hd38750a67", 0x0000, 0x0800, CRC(8b493783) SHA1(6c37e67de5d59889abf8a155654f130218cfc12e) ) + ROM_CONTINUE( 0x0f00, 0x0080 ) + + ROM_REGION( 100000, "screen", 0) + ROM_LOAD( "puckimon.svg", 0, 100000, NO_DUMP ) +ROM_END + + + + + +/*************************************************************************** + Tomy(tronic) Tron (manufactured in Japan) * PCB label THN-02 2E114E07 * Hitachi HD38800A88 MCU @@ -4383,6 +5064,127 @@ /*************************************************************************** + Tomy Bombman (Portable 6000 series) + * Hitachi HD38800B29 MCU + * cyan/red/blue VFD display + +***************************************************************************/ + +class bombman_state : public hh_hmcs40_state +{ +public: + bombman_state(const machine_config &mconfig, device_type type, const char *tag) : + hh_hmcs40_state(mconfig, type, tag) + { } + + void bombman(machine_config &config); + + DECLARE_INPUT_CHANGED_MEMBER(input_changed) { update_int0(); } + +private: + void update_int0(); + void update_display(); + void plate_w(offs_t offset, u8 data); + void grid_w(u16 data); +}; + +// handlers + +void bombman_state::update_display() +{ + m_display->matrix(m_grid, m_plate); +} + +void bombman_state::plate_w(offs_t offset, u8 data) +{ + // R0x-R3x: vfd plate + int shift = offset * 4; + m_plate = (m_plate & ~(0xf << shift)) | (data << shift); + update_display(); +} + +void bombman_state::grid_w(u16 data) +{ + // D7: speaker out + m_speaker->level_w(data >> 7 & 1); + + // D11-D15: input mux + u8 inp_mux = data >> 11 & 0x1f; + if (inp_mux != m_inp_mux) + { + m_inp_mux = inp_mux; + update_int0(); + } + + // D8-D15: vfd grid + m_grid = data >> 8 & 0xff; + + // D0-D4: more plates + m_plate = (m_plate & 0x00ffff) | (data << 16 & 0x1f0000); + update_display(); +} + +void bombman_state::update_int0() +{ + // INT0 on multiplexed inputs + set_interrupt(0, read_inputs(5)); +} + +// config + +static INPUT_PORTS_START( bombman ) + PORT_START("IN.0") // D11 INT0 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, bombman_state, input_changed, 0) + + PORT_START("IN.1") // D12 INT0 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_16WAY PORT_CHANGED_MEMBER(DEVICE_SELF, bombman_state, input_changed, 0) + + PORT_START("IN.2") // D13 INT0 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_16WAY PORT_CHANGED_MEMBER(DEVICE_SELF, bombman_state, input_changed, 0) + + PORT_START("IN.3") // D14 INT0 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_16WAY PORT_CHANGED_MEMBER(DEVICE_SELF, bombman_state, input_changed, 0) + + PORT_START("IN.4") // D15 INT0 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_16WAY PORT_CHANGED_MEMBER(DEVICE_SELF, bombman_state, input_changed, 0) +INPUT_PORTS_END + +void bombman_state::bombman(machine_config &config) +{ + // basic machine hardware + HD38800(config, m_maincpu, 400000); // approximation + m_maincpu->write_r<0>().set(FUNC(bombman_state::plate_w)); + m_maincpu->write_r<1>().set(FUNC(bombman_state::plate_w)); + m_maincpu->write_r<2>().set(FUNC(bombman_state::plate_w)); + m_maincpu->write_r<3>().set(FUNC(bombman_state::plate_w)); + m_maincpu->write_d().set(FUNC(bombman_state::grid_w)); + + // video hardware + PWM_DISPLAY(config, m_display).set_size(8, 21); + config.set_default_layout(layout_hh_hmcs40_test); + + // sound hardware + SPEAKER(config, "mono").front_center(); + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} + +// roms + +ROM_START( bombman ) + ROM_REGION( 0x2000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD( "hd38800b29", 0x0000, 0x1000, CRC(f99ebd3f) SHA1(5016d4e35efa1353d26e60f98d8a027773d571a0) ) + ROM_CONTINUE( 0x1e80, 0x0100 ) + + ROM_REGION( 100000, "screen", 0) + ROM_LOAD( "bombman.svg", 0, 100000, NO_DUMP ) +ROM_END + + + + + +/*************************************************************************** + VTech Invaders (manufactured in Taiwan) * Hitachi HD38750A45 MCU * cyan/red VFD display Futaba DM-26Z 1G, with bezel @@ -4494,46 +5296,55 @@ ***************************************************************************/ -// YEAR NAME PARENT CMP MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS -CONS( 1979, bambball, 0, 0, bambball, bambball, bambball_state, empty_init, "Bambino", "Dribble Away Basketball", MACHINE_SUPPORTS_SAVE ) -CONS( 1979, bmboxing, 0, 0, bmboxing, bmboxing, bmboxing_state, empty_init, "Bambino", "Knock-Em Out Boxing", MACHINE_SUPPORTS_SAVE ) - -CONS( 1982, bfriskyt, 0, 0, bfriskyt, bfriskyt, bfriskyt_state, empty_init, "Bandai", "Frisky Tom (Bandai)", MACHINE_SUPPORTS_SAVE ) -CONS( 1981, packmon, 0, 0, packmon, packmon, packmon_state, empty_init, "Bandai", "Packri Monster", MACHINE_SUPPORTS_SAVE ) -CONS( 1982, bzaxxon, 0, 0, bzaxxon, bzaxxon, bzaxxon_state, empty_init, "Bandai", "Zaxxon (Bandai)", MACHINE_SUPPORTS_SAVE ) -CONS( 1983, zackman, 0, 0, zackman, zackman, zackman_state, empty_init, "Bandai", "Zackman", MACHINE_SUPPORTS_SAVE ) -CONS( 1983, bpengo, 0, 0, bpengo, bpengo, bpengo_state, empty_init, "Bandai", "Pengo (Bandai)", MACHINE_SUPPORTS_SAVE ) -CONS( 1983, bbtime, 0, 0, bbtime, bbtime, bbtime_state, empty_init, "Bandai", "Burger Time (Bandai)", MACHINE_SUPPORTS_SAVE ) -CONS( 1983, bdoramon, 0, 0, bdoramon, bdoramon, bdoramon_state, empty_init, "Bandai", "Dokodemo Dorayaki Doraemon", MACHINE_SUPPORTS_SAVE ) -CONS( 1983, bultrman, 0, 0, bultrman, bultrman, bultrman_state, empty_init, "Bandai", "Ultraman Monster Battle", MACHINE_SUPPORTS_SAVE ) -CONS( 1984, machiman, 0, 0, machiman, machiman, machiman_state, empty_init, "Bandai", "Machine Man", MACHINE_SUPPORTS_SAVE ) -CONS( 1984, pairmtch, 0, 0, pairmtch, pairmtch, pairmtch_state, empty_init, "Bandai", "Pair Match", MACHINE_SUPPORTS_SAVE ) - -CONS( 1981, alnattck, 0, 0, alnattck, alnattck, alnattck_state, empty_init, "Coleco", "Alien Attack", MACHINE_SUPPORTS_SAVE ) -CONS( 1982, cdkong, 0, 0, cdkong, cdkong, cdkong_state, empty_init, "Coleco", "Donkey Kong (Coleco)", MACHINE_SUPPORTS_SAVE ) -CONS( 1982, cgalaxn, 0, 0, cgalaxn, cgalaxn, cgalaxn_state, empty_init, "Coleco", "Galaxian (Coleco)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND ) -CONS( 1981, cpacman, 0, 0, cpacman, cpacman, cpacman_state, empty_init, "Coleco", "Pac-Man (Coleco, Rev. 29)", MACHINE_SUPPORTS_SAVE ) -CONS( 1981, cpacmanr1, cpacman, 0, cpacman, cpacman, cpacman_state, empty_init, "Coleco", "Pac-Man (Coleco, Rev. 28)", MACHINE_SUPPORTS_SAVE ) -CONS( 1983, cmspacmn, 0, 0, cmspacmn, cmspacmn, cmspacmn_state, empty_init, "Coleco", "Ms. Pac-Man (Coleco)", MACHINE_SUPPORTS_SAVE ) - -CONS( 1981, egalaxn2, 0, 0, egalaxn2, egalaxn2, egalaxn2_state, empty_init, "Entex", "Galaxian 2 (Entex)", MACHINE_SUPPORTS_SAVE ) -CONS( 1981, epacman2, 0, 0, epacman2, epacman2, epacman2_state, empty_init, "Entex", "Pac Man 2 (Entex, cyan Pacman)", MACHINE_SUPPORTS_SAVE ) -CONS( 1981, epacman2r, epacman2, 0, epacman2, epacman2, epacman2_state, empty_init, "Entex", "Pac Man 2 (Entex, red Pacman)", MACHINE_SUPPORTS_SAVE ) -CONS( 1982, einvader2, 0, 0, einvader2,einvader2,einvader2_state,empty_init, "Entex", "Super Space Invader 2 (Entex, black version)", MACHINE_SUPPORTS_SAVE ) -CONS( 1982, eturtles, 0, 0, eturtles, eturtles, eturtles_state, empty_init, "Entex", "Turtles (Entex)", MACHINE_SUPPORTS_SAVE ) -CONS( 1982, estargte, 0, 0, estargte, estargte, estargte_state, empty_init, "Entex", "Stargate (Entex)", MACHINE_SUPPORTS_SAVE ) - -CONS( 1980, ghalien, 0, 0, ghalien, ghalien, ghalien_state, empty_init, "Gakken", "Heiankyo Alien (Gakken)", MACHINE_SUPPORTS_SAVE ) -CONS( 1982, gckong, 0, 0, gckong, gckong, gckong_state, empty_init, "Gakken", "Crazy Kong (Gakken)", MACHINE_SUPPORTS_SAVE ) -CONS( 1982, gscobra, 0, 0, gscobra, gscobra, gscobra_state, empty_init, "Gakken", "Super Cobra (Gakken, green version)", MACHINE_SUPPORTS_SAVE ) -CONS( 1983, gdigdug, 0, 0, gdigdug, gdigdug, gdigdug_state, empty_init, "Gakken", "Dig Dug (Gakken)", MACHINE_SUPPORTS_SAVE ) - -CONS( 1980, mwcbaseb, 0, 0, mwcbaseb, mwcbaseb, mwcbaseb_state, empty_init, "Mattel Electronics", "World Championship Baseball", MACHINE_SUPPORTS_SAVE ) -CONS( 1982, msthawk, 0, 0, msthawk, msthawk, msthawk_state, empty_init, "Mattel Electronics", "Star Hawk (Mattel)", MACHINE_SUPPORTS_SAVE ) +// YEAR NAME PARENT CMP MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS +CONS( 1982, wantgman, 0, 0, wantgman, wantgman, wantgman_state, empty_init, "Actronics / Hanzawa", "Wanted G-Man", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING ) -CONS( 1983, pbqbert, 0, 0, pbqbert, pbqbert, pbqbert_state, empty_init, "Parker Brothers", "Q*Bert (Parker Brothers)", MACHINE_SUPPORTS_SAVE ) +CONS( 1979, bambball, 0, 0, bambball, bambball, bambball_state, empty_init, "Bambino", "Dribble Away Basketball", MACHINE_SUPPORTS_SAVE ) +CONS( 1979, bmboxing, 0, 0, bmboxing, bmboxing, bmboxing_state, empty_init, "Bambino", "Knock-Em Out Boxing", MACHINE_SUPPORTS_SAVE ) -CONS( 1982, tmtron, 0, 0, tmtron, tmtron, tmtron_state, empty_init, "Tomy", "Tron (Tomy)", MACHINE_SUPPORTS_SAVE ) -CONS( 1982, kingman, 0, 0, kingman, kingman, kingman_state, empty_init, "Tomy", "Kingman", MACHINE_SUPPORTS_SAVE ) +CONS( 1982, bfriskyt, 0, 0, bfriskyt, bfriskyt, bfriskyt_state, empty_init, "Bandai", "Frisky Tom (Bandai)", MACHINE_SUPPORTS_SAVE ) +CONS( 1981, packmon, 0, 0, packmon, packmon, packmon_state, empty_init, "Bandai", "Packri Monster", MACHINE_SUPPORTS_SAVE ) +CONS( 1982, bzaxxon, 0, 0, bzaxxon, bzaxxon, bzaxxon_state, empty_init, "Bandai", "Zaxxon (Bandai)", MACHINE_SUPPORTS_SAVE ) +CONS( 1983, zackman, 0, 0, zackman, zackman, zackman_state, empty_init, "Bandai", "Zackman", MACHINE_SUPPORTS_SAVE ) +CONS( 1983, bpengo, 0, 0, bpengo, bpengo, bpengo_state, empty_init, "Bandai", "Pengo (Bandai)", MACHINE_SUPPORTS_SAVE ) +CONS( 1983, bbtime, 0, 0, bbtime, bbtime, bbtime_state, empty_init, "Bandai", "Burger Time (Bandai)", MACHINE_SUPPORTS_SAVE ) +CONS( 1983, ktparman, 0, 0, ktparman, ktparman, ktparman_state, empty_init, "Bandai", "Kiteyo Parman", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING ) +CONS( 1983, bdoramon, 0, 0, bdoramon, bdoramon, bdoramon_state, empty_init, "Bandai", "Dokodemo Dorayaki Doraemon", MACHINE_SUPPORTS_SAVE ) +CONS( 1983, tkjmaru, 0, 0, tkjmaru, tkjmaru, tkjmaru_state, empty_init, "Bandai", "Toukon Juohmaru", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING ) +CONS( 1983, bultrman, 0, 0, bultrman, bultrman, bultrman_state, empty_init, "Bandai", "Ultraman Monster Battle", MACHINE_SUPPORTS_SAVE ) +CONS( 1983, ggdman, 0, 0, ggdman, ggdman, ggdman_state, empty_init, "Bandai", "Go Go Dynaman", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING ) +CONS( 1984, machiman, 0, 0, machiman, machiman, machiman_state, empty_init, "Bandai", "Machine Man", MACHINE_SUPPORTS_SAVE ) +CONS( 1984, pairmtch, 0, 0, pairmtch, pairmtch, pairmtch_state, empty_init, "Bandai", "Pair Match", MACHINE_SUPPORTS_SAVE ) + +CONS( 1981, alnattck, 0, 0, alnattck, alnattck, alnattck_state, empty_init, "Coleco", "Alien Attack", MACHINE_SUPPORTS_SAVE ) +CONS( 1982, cdkong, 0, 0, cdkong, cdkong, cdkong_state, empty_init, "Coleco", "Donkey Kong (Coleco)", MACHINE_SUPPORTS_SAVE ) +CONS( 1982, cgalaxn, 0, 0, cgalaxn, cgalaxn, cgalaxn_state, empty_init, "Coleco", "Galaxian (Coleco)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND ) +CONS( 1981, cpacman, 0, 0, cpacman, cpacman, cpacman_state, empty_init, "Coleco", "Pac-Man (Coleco, Rev. 29)", MACHINE_SUPPORTS_SAVE ) +CONS( 1981, cpacmanr1, cpacman, 0, cpacman, cpacman, cpacman_state, empty_init, "Coleco", "Pac-Man (Coleco, Rev. 28)", MACHINE_SUPPORTS_SAVE ) +CONS( 1983, cmspacmn, 0, 0, cmspacmn, cmspacmn, cmspacmn_state, empty_init, "Coleco", "Ms. Pac-Man (Coleco)", MACHINE_SUPPORTS_SAVE ) + +CONS( 1981, egalaxn2, 0, 0, egalaxn2, egalaxn2, egalaxn2_state, empty_init, "Entex", "Galaxian 2 (Entex)", MACHINE_SUPPORTS_SAVE ) +CONS( 1981, epacman2, 0, 0, epacman2, epacman2, epacman2_state, empty_init, "Entex", "Pac Man 2 (Entex, cyan Pacman)", MACHINE_SUPPORTS_SAVE ) +CONS( 1981, epacman2r, epacman2, 0, epacman2, epacman2, epacman2_state, empty_init, "Entex", "Pac Man 2 (Entex, red Pacman)", MACHINE_SUPPORTS_SAVE ) +CONS( 1982, einvader2, 0, 0, einvader2, einvader2, einvader2_state, empty_init, "Entex", "Super Space Invader 2 (Entex, black version)", MACHINE_SUPPORTS_SAVE ) +CONS( 1982, eturtles, 0, 0, eturtles, eturtles, eturtles_state, empty_init, "Entex", "Turtles (Entex)", MACHINE_SUPPORTS_SAVE ) +CONS( 1982, estargte, 0, 0, estargte, estargte, estargte_state, empty_init, "Entex", "Stargate (Entex)", MACHINE_SUPPORTS_SAVE ) + +CONS( 1980, ghalien, 0, 0, ghalien, ghalien, ghalien_state, empty_init, "Gakken", "Heiankyo Alien (Gakken)", MACHINE_SUPPORTS_SAVE ) +CONS( 1982, gckong, 0, 0, gckong, gckong, gckong_state, empty_init, "Gakken", "Crazy Kong (Gakken)", MACHINE_SUPPORTS_SAVE ) +CONS( 1982, gscobra, 0, 0, gscobra, gscobra, gscobra_state, empty_init, "Gakken", "Super Cobra (Gakken, green version)", MACHINE_SUPPORTS_SAVE ) +CONS( 1983, gdefender, 0, 0, gdefender, gdefender, gdefender_state, empty_init, "Gakken", "Defender (Gakken)", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING ) +CONS( 1983, gdigdug, 0, 0, gdigdug, gdigdug, gdigdug_state, empty_init, "Gakken", "Dig Dug (Gakken)", MACHINE_SUPPORTS_SAVE ) + +CONS( 1980, mwcbaseb, 0, 0, mwcbaseb, mwcbaseb, mwcbaseb_state, empty_init, "Mattel Electronics", "World Championship Baseball", MACHINE_SUPPORTS_SAVE ) +CONS( 1982, msthawk, 0, 0, msthawk, msthawk, msthawk_state, empty_init, "Mattel Electronics", "Star Hawk (Mattel)", MACHINE_SUPPORTS_SAVE ) + +CONS( 1983, pbqbert, 0, 0, pbqbert, pbqbert, pbqbert_state, empty_init, "Parker Brothers", "Q*Bert (Parker Brothers)", MACHINE_SUPPORTS_SAVE ) + +CONS( 1982, puckimon, 0, 0, puckimon, puckimon, puckimon_state, empty_init, "Romtec", "Pucki & Monsters", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING ) + +CONS( 1982, tmtron, 0, 0, tmtron, tmtron, tmtron_state, empty_init, "Tomy", "Tron (Tomy)", MACHINE_SUPPORTS_SAVE ) +CONS( 1982, kingman, 0, 0, kingman, kingman, kingman_state, empty_init, "Tomy", "Kingman", MACHINE_SUPPORTS_SAVE ) +CONS( 1984, bombman, 0, 0, bombman, bombman, bombman_state, empty_init, "Tomy", "Bombman", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING ) -CONS( 1981, vinvader, 0, 0, vinvader, vinvader, vinvader_state, empty_init, "VTech", "Invaders (VTech)", MACHINE_SUPPORTS_SAVE ) +CONS( 1981, vinvader, 0, 0, vinvader, vinvader, vinvader_state, empty_init, "VTech", "Invaders (VTech)", MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/hh_rw5000.cpp mame-0.243+dfsg.1/src/mame/drivers/hh_rw5000.cpp --- mame-0.242+dfsg.1/src/mame/drivers/hh_rw5000.cpp 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/hh_rw5000.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,1109 @@ +// license:BSD-3-Clause +// copyright-holders:hap +// thanks-to:Sean Riddle +/*************************************************************************** + +Rockwell A/B5000 MCU series handhelds (before PPS-4/1) +Mostly calculators on these MCUs, but also Mattel's first couple of handhelds. + +ROM source notes when dumped from another model, but confident it's the same: +- rw18r: Rockwell 8R +- rw24k: Rockwell 14RD-II +- misatk: Mattel Space Alert + +***************************************************************************/ + +#include "emu.h" + +#include "cpu/rw5000/a5000.h" +#include "cpu/rw5000/a5500.h" +#include "cpu/rw5000/a5900.h" +#include "cpu/rw5000/b5000.h" +#include "cpu/rw5000/b5500.h" +#include "cpu/rw5000/b6000.h" +#include "cpu/rw5000/b6100.h" +#include "video/pwm.h" +#include "sound/spkrdev.h" + +#include "speaker.h" + +// internal artwork +#include "autorace.lh" +#include "gravity.lh" +#include "mbaseb.lh" +#include "mfootb.lh" +#include "misatk.lh" +#include "rw10r.lh" +#include "rw24k.lh" +#include "rw30r.lh" + +//#include "hh_rw5000_test.lh" // common test-layout - use external artwork + + +class hh_rw5000_state : public driver_device +{ +public: + hh_rw5000_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_display(*this, "display"), + m_speaker(*this, "speaker"), + m_inputs(*this, "IN.%u", 0) + { } + + DECLARE_INPUT_CHANGED_MEMBER(power_button); + template DECLARE_INPUT_CHANGED_MEMBER(switch_next) { if (newval) switch_change(Sel, param, true); } + template DECLARE_INPUT_CHANGED_MEMBER(switch_prev) { if (newval) switch_change(Sel, param, false); } + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + + // devices + required_device m_maincpu; + optional_device m_display; + optional_device m_speaker; + optional_ioport_array<9> m_inputs; // max 9 + + u16 m_inp_mux = 0; + + // MCU output pin state + u16 m_str = 0; + u16 m_seg = 0; + + u8 read_inputs(int columns); + void switch_change(int sel, u32 mask, bool next); +}; + + +// machine start/reset + +void hh_rw5000_state::machine_start() +{ + // register for savestates + save_item(NAME(m_inp_mux)); + save_item(NAME(m_str)); + save_item(NAME(m_seg)); +} + +void hh_rw5000_state::machine_reset() +{ +} + + + +/*************************************************************************** + + Helper Functions + +***************************************************************************/ + +// generic input handlers + +u8 hh_rw5000_state::read_inputs(int columns) +{ + u8 ret = 0; + + // read selected input rows + for (int i = 0; i < columns; i++) + if (m_inp_mux >> i & 1) + ret |= m_inputs[i]->read(); + + return ret; +} + +void hh_rw5000_state::switch_change(int sel, u32 mask, bool next) +{ + // config switches (for direct control) + ioport_field *inp = m_inputs[sel]->field(mask); + + if (next && inp->has_next_setting()) + inp->select_next_setting(); + else if (!next && inp->has_previous_setting()) + inp->select_previous_setting(); +} + +INPUT_CHANGED_MEMBER(hh_rw5000_state::power_button) +{ + // power button or switch + bool power = (param) ? (bool(param - 1)) : !newval; + + if (!power && m_display != nullptr) + m_display->clear(); + m_maincpu->set_input_line(INPUT_LINE_RESET, power ? CLEAR_LINE : ASSERT_LINE); +} + + + +/*************************************************************************** + + Minidrivers (subclass, I/O, Inputs, Machine Config, ROM Defs) + +***************************************************************************/ + +namespace { + +/*************************************************************************** + + Mattel Auto Race (model 9879) + * B6000 MCU (label B6000CA, die label B6000-B) + * 2-digit 7seg display, 21 other leds, 1-bit sound + + This is Mattel's first electronic handheld game, also the first CPU-based + handheld game overall. Hardware design (even the MCU) and programming + was done at Rockwell. + + A European version was released as "Ski Slalom", except it's upside-down. + +***************************************************************************/ + +class autorace_state : public hh_rw5000_state +{ +public: + autorace_state(const machine_config &mconfig, device_type type, const char *tag) : + hh_rw5000_state(mconfig, type, tag) + { } + + void autorace(machine_config &config); + +private: + void write_str(u16 data); + void write_seg(u16 data); +}; + +// handlers + +void autorace_state::write_str(u16 data) +{ + m_display->write_my(data); +} + +void autorace_state::write_seg(u16 data) +{ + m_display->write_mx(data); +} + +// config + +static INPUT_PORTS_START( autorace ) + PORT_START("IN.0") // KB + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) // does not auto-center on real device + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) // " + PORT_CONFNAME( 0x0c, 0x0c, "Gear" ) + PORT_CONFSETTING( 0x0c, "1" ) + PORT_CONFSETTING( 0x04, "2" ) + PORT_CONFSETTING( 0x00, "3" ) + PORT_CONFSETTING( 0x08, "4" ) + + PORT_START("IN.1") // DIN + PORT_CONFNAME( 0x01, 0x00, "Factory Test" ) + PORT_CONFSETTING( 0x00, DEF_STR( Off ) ) + PORT_CONFSETTING( 0x01, DEF_STR( On ) ) + + PORT_START("POWER") // power switch + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_rw5000_state, power_button, 0) PORT_NAME("Start / Reset") + + PORT_START("SWITCH") // fake + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_rw5000_state, switch_prev<0>, 0x0c) PORT_NAME("Gear Switch Down") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_rw5000_state, switch_next<0>, 0x0c) PORT_NAME("Gear Switch Up") +INPUT_PORTS_END + +void autorace_state::autorace(machine_config &config) +{ + // basic machine hardware + B6000(config, m_maincpu, 160000); // approximation + m_maincpu->write_str().set(FUNC(autorace_state::write_str)); + m_maincpu->write_seg().set(FUNC(autorace_state::write_seg)); + m_maincpu->read_kb().set_ioport("IN.0"); + m_maincpu->read_din().set_ioport("IN.1"); + m_maincpu->write_spk().set(m_speaker, FUNC(speaker_sound_device::level_w)); + + // video hardware + PWM_DISPLAY(config, m_display).set_size(9, 8); + m_display->set_segmask(0x180, 0x7f); + m_display->set_bri_levels(0.02, 0.2); // player led is brighter + config.set_default_layout(layout_autorace); + + // sound hardware + SPEAKER(config, "mono").front_center(); + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} + +// roms + +ROM_START( autorace ) + ROM_REGION( 0x200, "maincpu", 0 ) + ROM_LOAD( "b6000ca", 0x000, 0x200, CRC(a112c928) SHA1(aa5d0b46a08e2460081d4148cf254dc5ec53817e) ) +ROM_END + + + + + +/*************************************************************************** + + Mattel Missile Attack (model 2048) / Space Alert (model 2448) + * B6000 MCU (label B6001CA/EA, die label B6001) + * 2-digit 7seg display, 21 other leds, 1-bit sound + + The initial release was called Missile Attack, it didn't sell well (Mattel + blamed it on NBC for refusing to air their commercial). They changed the + title/setting and rereleased it as "Space Alert" (aka "Battlestar Galactica: + Space Alert"). In 1980, they advertised another rerelease, this time as + "Flash Gordon", but that didn't come out. + +***************************************************************************/ + +class misatk_state : public hh_rw5000_state +{ +public: + misatk_state(const machine_config &mconfig, device_type type, const char *tag) : + hh_rw5000_state(mconfig, type, tag) + { } + + void misatk(machine_config &config); + +private: + void write_str(u16 data); + void write_seg(u16 data); +}; + +// handlers + +void misatk_state::write_str(u16 data) +{ + m_display->write_my(data); +} + +void misatk_state::write_seg(u16 data) +{ + m_display->write_mx(data); +} + +// config + +static INPUT_PORTS_START( misatk ) + PORT_START("IN.0") // KB + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) // does not auto-center on real device + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) // " + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 ) + + PORT_START("IN.1") // DIN + PORT_CONFNAME( 0x01, 0x00, "Factory Test" ) + PORT_CONFSETTING( 0x00, DEF_STR( Off ) ) + PORT_CONFSETTING( 0x01, DEF_STR( On ) ) + + PORT_START("POWER") // power switch + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_rw5000_state, power_button, 0) PORT_NAME("Arm / Off") +INPUT_PORTS_END + +void misatk_state::misatk(machine_config &config) +{ + // basic machine hardware + B6000(config, m_maincpu, 250000); // approximation + m_maincpu->write_str().set(FUNC(misatk_state::write_str)); + m_maincpu->write_seg().set(FUNC(misatk_state::write_seg)); + m_maincpu->read_kb().set_ioport("IN.0"); + m_maincpu->read_din().set_ioport("IN.1"); + m_maincpu->write_spk().set(m_speaker, FUNC(speaker_sound_device::level_w)); + + // video hardware + PWM_DISPLAY(config, m_display).set_size(9, 8); + m_display->set_segmask(0x180, 0x7f); + m_display->set_bri_levels(0.015, 0.15); // player led is brighter + config.set_default_layout(layout_misatk); + + // sound hardware + SPEAKER(config, "mono").front_center(); + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} + +// roms + +ROM_START( misatk ) + ROM_REGION( 0x200, "maincpu", 0 ) + ROM_LOAD( "b6001ea", 0x000, 0x200, CRC(56564b79) SHA1(6f33f57ea312cb2018fb59f72eaff3a9642e74a2) ) +ROM_END + + + + + +/*************************************************************************** + + Mattel Football (model 2024) + * B6100 MCU (label B6100EB/-15, die label B6100 A) + * 7-digit 7seg display, 27 other leds, 1-bit sound + + When Football II came out, they renamed this one to Football I. + +***************************************************************************/ + +class mfootb_state : public hh_rw5000_state +{ +public: + mfootb_state(const machine_config &mconfig, device_type type, const char *tag) : + hh_rw5000_state(mconfig, type, tag) + { } + + void mfootb(machine_config &config); + + DECLARE_INPUT_CHANGED_MEMBER(score_button) { update_display(); } + +private: + void update_display(); + void write_str(u16 data); + void write_seg(u16 data); +}; + +// handlers + +void mfootb_state::update_display() +{ + // 4th digit DP is from the SCORE button + u8 dp = (m_inputs[1]->read() & 2) ? 0x80 : 0; + m_display->matrix(m_str, (m_seg << 1 & 0x700) | dp | (m_seg & 0x7f)); +} + +void mfootb_state::write_str(u16 data) +{ + m_str = data; + update_display(); +} + +void mfootb_state::write_seg(u16 data) +{ + m_seg = data; + update_display(); +} + +// config + +static INPUT_PORTS_START( mfootb ) + PORT_START("IN.0") // KB + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_16WAY + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Forward") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_16WAY + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Kick") + + PORT_START("IN.1") // DIN + PORT_CONFNAME( 0x01, 0x01, DEF_STR( Difficulty ) ) + PORT_CONFSETTING( 0x01, "1" ) // PRO 1 + PORT_CONFSETTING( 0x00, "2" ) // PRO 2 + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 ) PORT_NAME("Score") PORT_CHANGED_MEMBER(DEVICE_SELF, mfootb_state, score_button, 0) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 ) PORT_NAME("Status") + PORT_CONFNAME( 0x08, 0x00, "Factory Test" ) + PORT_CONFSETTING( 0x00, DEF_STR( Off ) ) + PORT_CONFSETTING( 0x08, DEF_STR( On ) ) +INPUT_PORTS_END + +void mfootb_state::mfootb(machine_config &config) +{ + // basic machine hardware + B6100(config, m_maincpu, 280000); // approximation + m_maincpu->write_str().set(FUNC(mfootb_state::write_str)); + m_maincpu->write_seg().set(FUNC(mfootb_state::write_seg)); + m_maincpu->read_kb().set_ioport("IN.0"); + m_maincpu->read_din().set_ioport("IN.1"); + m_maincpu->write_spk().set(m_speaker, FUNC(speaker_sound_device::level_w)); + + // video hardware + PWM_DISPLAY(config, m_display).set_size(9, 11); + m_display->set_segmask(0x7f, 0x7f); + m_display->set_segmask(0x08, 0xff); // only one digit has DP + m_display->set_bri_levels(0.02, 0.2); // player led is brighter + config.set_default_layout(layout_mfootb); + + // sound hardware + SPEAKER(config, "mono").front_center(); + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} + +// roms + +ROM_START( mfootb ) + ROM_REGION( 0x400, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD( "b6100eb", 0x000, 0x300, CRC(5b27620f) SHA1(667ff6cabced89ef4ad848b73d66a06526edc5e6) ) + ROM_CONTINUE( 0x380, 0x080 ) +ROM_END + + + + + +/*************************************************************************** + + Mattel Baseball (model 2942) + * B6100 MCU (label B6101-12, die label B6101 A) + * 4-digit 7seg display, 28 other leds, 1-bit sound + +***************************************************************************/ + +class mbaseb_state : public hh_rw5000_state +{ +public: + mbaseb_state(const machine_config &mconfig, device_type type, const char *tag) : + hh_rw5000_state(mconfig, type, tag) + { } + + void mbaseb(machine_config &config); + +private: + void write_str(u16 data); + void write_seg(u16 data); +}; + +// handlers + +void mbaseb_state::write_str(u16 data) +{ + m_display->write_my(data); +} + +void mbaseb_state::write_seg(u16 data) +{ + m_display->write_mx(bitswap<10>(data,7,8,9,6,5,4,3,2,1,0)); +} + +// config + +static INPUT_PORTS_START( mbaseb ) + PORT_START("IN.0") // KB + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Pitch") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Hit") + + PORT_START("IN.1") // DIN + PORT_CONFNAME( 0x01, 0x01, DEF_STR( Difficulty ) ) + PORT_CONFSETTING( 0x01, "1" ) // PRO 1 + PORT_CONFSETTING( 0x00, "2" ) // PRO 2 + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START1 ) PORT_NAME("Score") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Run") + PORT_CONFNAME( 0x08, 0x00, "Factory Test" ) + PORT_CONFSETTING( 0x00, DEF_STR( Off ) ) + PORT_CONFSETTING( 0x08, DEF_STR( On ) ) +INPUT_PORTS_END + +void mbaseb_state::mbaseb(machine_config &config) +{ + // basic machine hardware + B6100(config, m_maincpu, 280000); // approximation + m_maincpu->write_str().set(FUNC(mbaseb_state::write_str)); + m_maincpu->write_seg().set(FUNC(mbaseb_state::write_seg)); + m_maincpu->read_kb().set_ioport("IN.0"); + m_maincpu->read_din().set_ioport("IN.1"); + m_maincpu->write_spk().set(m_speaker, FUNC(speaker_sound_device::level_w)); + + // video hardware + PWM_DISPLAY(config, m_display).set_size(9, 10); + m_display->set_segmask(0x170, 0x7f); + m_display->set_segmask(0x110, 0xff); // 2 digits have DP + config.set_default_layout(layout_mbaseb); + + // sound hardware + SPEAKER(config, "mono").front_center(); + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} + +// roms + +ROM_START( mbaseb ) + ROM_REGION( 0x400, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD( "b6101-12", 0x000, 0x300, CRC(7720ddcc) SHA1(cd43126db7c6262f659f325aa58420e1a8a1a659) ) + ROM_CONTINUE( 0x380, 0x080 ) +ROM_END + + + + + +/*************************************************************************** + + Mattel Gravity (model 8291) + * B6100 MCU (label B6102-11, die label B6102 A) + * 3-digit 7seg display, 27 other leds, 1-bit sound + + It was advertised as "Catastrophe", but went unreleased. It got sold later + as "Gravity", with a less catastrophic setting. + + The game is basically 3 mini games in 1: + - Juggling (Rumbling Rocks in Catastrophe) + - Coin Drop (Quake Shock in Catastrophe) + - Docking (Meteorite Shower in Catstrophe) + +***************************************************************************/ + +class gravity_state : public hh_rw5000_state +{ +public: + gravity_state(const machine_config &mconfig, device_type type, const char *tag) : + hh_rw5000_state(mconfig, type, tag) + { } + + void gravity(machine_config &config); + +private: + void write_str(u16 data); + void write_seg(u16 data); +}; + +// handlers + +void gravity_state::write_str(u16 data) +{ + m_display->write_my(data); +} + +void gravity_state::write_seg(u16 data) +{ + m_display->write_mx(data); +} + +// config + +static INPUT_PORTS_START( gravity ) + PORT_START("IN.0") // KB + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON3 ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 ) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("IN.1") // DIN + PORT_CONFNAME( 0x08, 0x00, "Factory Test" ) + PORT_CONFSETTING( 0x00, DEF_STR( Off ) ) + PORT_CONFSETTING( 0x08, DEF_STR( On ) ) +INPUT_PORTS_END + +void gravity_state::gravity(machine_config &config) +{ + // basic machine hardware + B6100(config, m_maincpu, 250000); // approximation + m_maincpu->write_str().set(FUNC(gravity_state::write_str)); + m_maincpu->write_seg().set(FUNC(gravity_state::write_seg)); + m_maincpu->read_kb().set_ioport("IN.0"); + m_maincpu->read_din().set_ioport("IN.1"); + m_maincpu->write_spk().set(m_speaker, FUNC(speaker_sound_device::level_w)); + + // video hardware + PWM_DISPLAY(config, m_display).set_size(9, 10); + m_display->set_segmask(0x1c0, 0x7f); + config.set_default_layout(layout_gravity); + + // sound hardware + SPEAKER(config, "mono").front_center(); + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} + +// roms + +ROM_START( gravity ) + ROM_REGION( 0x400, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD( "b6102-11", 0x000, 0x300, CRC(532f332e) SHA1(593224d3a2a5b6022f0d73b6e6fb9093d2d54f68) ) + ROM_CONTINUE( 0x380, 0x080 ) +ROM_END + + + + + +/*************************************************************************** + + Rockwell 10R + * A5000 MCU (label A5000PA, die label A5000) + * 8-digit 7seg LED display + + Rockwell 12R "Square Root" + * A5000 MCU (label A5001, die label A5001) + * rest is same as 10R + + 12R supports square root by pressing × after ÷ (or the other way around). + +***************************************************************************/ + +class rw10r_state : public hh_rw5000_state +{ +public: + rw10r_state(const machine_config &mconfig, device_type type, const char *tag) : + hh_rw5000_state(mconfig, type, tag) + { } + + void rw10r(machine_config &config); + +private: + void write_str(u16 data); + void write_seg(u16 data); + u8 read_kb(); +}; + +// handlers + +void rw10r_state::write_str(u16 data) +{ + // STR0-STR7: digit select + // STR4-STR7: input mux + m_display->write_my(data); + m_inp_mux = data >> 4; +} + +void rw10r_state::write_seg(u16 data) +{ + // SEG0-SEG7: digit segment data + m_display->write_mx(bitswap<8>(data,0,7,6,5,4,3,2,1)); +} + +u8 rw10r_state::read_kb() +{ + // KB: multiplexed inputs + return read_inputs(4); +} + +// config + +static INPUT_PORTS_START( rw10r ) + PORT_START("IN.0") // STR4 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_BACKSPACE) PORT_NAME("CE/C") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("0") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_STOP) PORT_CODE(KEYCODE_DEL_PAD) PORT_NAME(".") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_PLUS_PAD) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("+=") + + PORT_START("IN.1") // STR5 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("1") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("2") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("3") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_MINUS_PAD) PORT_NAME("-") + + PORT_START("IN.2") // STR6 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("4") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("5") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("6") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_ASTERISK) PORT_NAME(u8"×") + + PORT_START("IN.3") // STR7 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("7") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("8") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_NAME("9") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_SLASH_PAD) PORT_NAME(u8"÷") +INPUT_PORTS_END + +void rw10r_state::rw10r(machine_config &config) +{ + // basic machine hardware + A5000(config, m_maincpu, 250000); // approximation + m_maincpu->write_str().set(FUNC(rw10r_state::write_str)); + m_maincpu->write_seg().set(FUNC(rw10r_state::write_seg)); + m_maincpu->read_kb().set(FUNC(rw10r_state::read_kb)); + + // video hardware + PWM_DISPLAY(config, m_display).set_size(8, 8); + m_display->set_segmask(0xff, 0xff); + config.set_default_layout(layout_rw10r); +} + +// roms + +ROM_START( rw10r ) + ROM_REGION( 0x200, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD( "a5000pa", 0x000, 0x0c0, CRC(db6cbbea) SHA1(3757f303a84e412e8763c4ec2170c9badc172454) ) + ROM_CONTINUE( 0x100, 0x100 ) +ROM_END + +ROM_START( rw12r ) + ROM_REGION( 0x200, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD( "a5001", 0x000, 0x0c0, CRC(4337a46b) SHA1(70f4683eac0afa31a6cd9dd44fdf1b6680575f67) ) + ROM_CONTINUE( 0x100, 0x100 ) +ROM_END + + + + + +/*************************************************************************** + + Rockwell 8R "Automatic Percent", Rockwell 18R "Memory" + * B5000 MCU (label B5000CC, die label B5000) + * 8-digit 7seg LED display + + This MCU was used in Rockwell 8R, 18R, and 9TR. It was also sold by + Tandy (Radio Shack) as EC-220. + + 8R/9TR doesn't have the memory store/recall buttons. + +***************************************************************************/ + +class rw18r_state : public hh_rw5000_state +{ +public: + rw18r_state(const machine_config &mconfig, device_type type, const char *tag) : + hh_rw5000_state(mconfig, type, tag) + { } + + void rw18r(machine_config &config); + +private: + void write_str(u16 data); + void write_seg(u16 data); + u8 read_kb(); +}; + +// handlers + +void rw18r_state::write_str(u16 data) +{ + // STR0-STR7: digit select + // STR4-STR8: input mux + m_display->write_my(data); + m_inp_mux = data >> 4; +} + +void rw18r_state::write_seg(u16 data) +{ + // SEG0-SEG7: digit segment data + m_display->write_mx(bitswap<8>(data,0,7,6,5,4,3,2,1)); +} + +u8 rw18r_state::read_kb() +{ + // KB: multiplexed inputs + return read_inputs(5); +} + +// config + +static INPUT_PORTS_START( rw18r ) + PORT_START("IN.0") // STR4 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_BACKSPACE) PORT_NAME("CE/C") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("0") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_STOP) PORT_CODE(KEYCODE_DEL_PAD) PORT_NAME(".") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_PLUS_PAD) PORT_NAME("+") + + PORT_START("IN.1") // STR5 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("1") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("2") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("3") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_MINUS_PAD) PORT_NAME("-") + + PORT_START("IN.2") // STR6 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("4") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("5") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("6") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_ASTERISK) PORT_NAME(u8"×") + + PORT_START("IN.3") // STR7 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("7") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("8") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_NAME("9") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_SLASH_PAD) PORT_NAME(u8"÷") + + PORT_START("IN.4") // STR8 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_S) PORT_NAME("STO") // unpopulated on 8R + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_R) PORT_NAME("RCL") // " + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_SLASH) PORT_NAME("%") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("=") +INPUT_PORTS_END + +void rw18r_state::rw18r(machine_config &config) +{ + // basic machine hardware + B5000(config, m_maincpu, 250000); // approximation + m_maincpu->write_str().set(FUNC(rw18r_state::write_str)); + m_maincpu->write_seg().set(FUNC(rw18r_state::write_seg)); + m_maincpu->read_kb().set(FUNC(rw18r_state::read_kb)); + + // video hardware + PWM_DISPLAY(config, m_display).set_size(8, 8); + m_display->set_segmask(0xff, 0xff); + config.set_default_layout(layout_rw10r); +} + +// roms + +ROM_START( rw18r ) + ROM_REGION( 0x200, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD( "b5000cc", 0x000, 0x0c0, CRC(ace32614) SHA1(23cf11acf2e73ce2dfc165cb87f86fab15f69ff7) ) + ROM_CONTINUE( 0x100, 0x100 ) +ROM_END + + + + + +/*************************************************************************** + + Rockwell 30R "Slide Rule Memory" + * B5500 MCU (label B5500PA, die label B5500) + * 9-digit 7seg LED display + + Rockwell 31R "Slide Rule Memory" + * A5500 MCU (label A5502PA, die label A5500) + * rest is same as 30R + + 30R and 31R have the exact same functionality, even though they are on + different MCUs. There's also a 30R version on an A4600 MCU. + +***************************************************************************/ + +class rw30r_state : public hh_rw5000_state +{ +public: + rw30r_state(const machine_config &mconfig, device_type type, const char *tag) : + hh_rw5000_state(mconfig, type, tag) + { } + + void rw30r(machine_config &config); + void rw31r(machine_config &config); + +private: + void write_str(u16 data); + void write_seg(u16 data); + u8 read_kb(); +}; + +// handlers + +void rw30r_state::write_str(u16 data) +{ + // STR0-STR8: digit select + // STR4-STR8: input mux + m_display->write_my(data); + m_inp_mux = data >> 4; +} + +void rw30r_state::write_seg(u16 data) +{ + // SEG0-SEG7: digit segment data + m_display->write_mx(bitswap<8>(data,0,7,6,5,4,3,2,1)); +} + +u8 rw30r_state::read_kb() +{ + // KB: multiplexed inputs + return read_inputs(5); +} + +// config + +static INPUT_PORTS_START( rw30r ) + PORT_START("IN.0") // STR4 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("0") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_STOP) PORT_CODE(KEYCODE_DEL_PAD) PORT_NAME(". / +/-") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_F) PORT_NAME("F / CF") // function + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_PLUS_PAD) PORT_NAME("+ / M+") + + PORT_START("IN.1") // STR5 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("1") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("2") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("3") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_MINUS_PAD) PORT_NAME("- / M-") + + PORT_START("IN.2") // STR6 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("4") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("5") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("6") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_ASTERISK) PORT_NAME(u8"× / x" UTF8_POW_2) + + PORT_START("IN.3") // STR7 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("7") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("8") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_NAME("9") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_SLASH_PAD) PORT_NAME(u8"÷ / 1/x") + + PORT_START("IN.4") // STR8 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_BACKSPACE) PORT_NAME("C / MC") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_X) PORT_NAME("X\xe2\x86\x94Y / X\xe2\x86\x94M") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_SLASH) PORT_NAME("% / " UTF8_SQUAREROOT "x") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("= / MR") +INPUT_PORTS_END + +void rw30r_state::rw30r(machine_config &config) +{ + // basic machine hardware + B5500(config, m_maincpu, 250000); // approximation + m_maincpu->write_str().set(FUNC(rw30r_state::write_str)); + m_maincpu->write_seg().set(FUNC(rw30r_state::write_seg)); + m_maincpu->read_kb().set(FUNC(rw30r_state::read_kb)); + + // video hardware + PWM_DISPLAY(config, m_display).set_size(9, 8); + m_display->set_segmask(0x1ff, 0xff); + config.set_default_layout(layout_rw30r); +} + +void rw30r_state::rw31r(machine_config &config) +{ + rw30r(config); + + // basic machine hardware + A5500(config.replace(), m_maincpu, 250000); // approximation + m_maincpu->write_str().set(FUNC(rw30r_state::write_str)); + m_maincpu->write_seg().set(FUNC(rw30r_state::write_seg)); + m_maincpu->read_kb().set(FUNC(rw30r_state::read_kb)); +} + +// roms + +ROM_START( rw30r ) + ROM_REGION( 0x400, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD( "b5500pa", 0x000, 0x280, CRC(937dd695) SHA1(bc286209943f49e9acccbf319b87c6ec24386894) ) + ROM_CONTINUE( 0x380, 0x080 ) +ROM_END + +ROM_START( rw31r ) + ROM_REGION( 0x400, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD( "a5502pa", 0x000, 0x280, CRC(6ee0b30a) SHA1(42e5d1e29bdef4b4faaafee3592cacc0e66b982f) ) + ROM_CONTINUE( 0x380, 0x080 ) +ROM_END + + + + + +/*************************************************************************** + + Rockwell 24K aka "the 24K" (see below for more) + * A5900 MCU (label A5901CA/A5903CB, die label A59__) + * 9-digit 7seg VFD + + This MCU was used in Rockwell 14RD-II, 24RD-II, 24K, 24K II, 24MS, and + probably also in 14RD, 24RD, 22K. + + 14RD has 6 less buttons than 24RD, the non-II versions have LED(s) instead + of a 9th digit for minus sign and memory status. 24K has an extra button + for register exchange. The difference between 24K and 24K II is unknown. + +***************************************************************************/ + +class rw24k_state : public hh_rw5000_state +{ +public: + rw24k_state(const machine_config &mconfig, device_type type, const char *tag) : + hh_rw5000_state(mconfig, type, tag) + { } + + void rw24k(machine_config &config); + +private: + void write_str(u16 data); + void write_seg(u16 data); + u8 read_kb(); +}; + +// handlers + +void rw24k_state::write_str(u16 data) +{ + // STR0-STR8: digit select, input mux + m_display->write_my(data); + m_inp_mux = data; +} + +void rw24k_state::write_seg(u16 data) +{ + // SEG0-SEG7: digit segment data + m_display->write_mx(bitswap<8>(data,0,7,6,5,4,3,2,1)); +} + +u8 rw24k_state::read_kb() +{ + // KB: multiplexed inputs + return read_inputs(9); +} + +// config + +static INPUT_PORTS_START( rw24k ) + PORT_START("IN.0") // STR0 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_MINUS) PORT_NAME("+/-") // unpopulated on 14RD + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_V) PORT_NAME("M+") // " + + PORT_START("IN.1") // STR1 + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_C) PORT_NAME("M-") // " + PORT_BIT( 0x0d, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("IN.2") // STR2 + PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("IN.3") // STR3 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_Z) PORT_NAME("MC") // " + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_R) PORT_NAME(UTF8_SQUAREROOT) // " + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_X) PORT_NAME("MR") // " + + PORT_START("IN.4") // STR4 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("0") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_STOP) PORT_CODE(KEYCODE_DEL_PAD) PORT_NAME(".") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_PLUS_PAD) PORT_NAME("+") + + PORT_START("IN.5") // STR5 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("1") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("2") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("3") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_MINUS_PAD) PORT_NAME("-") + + PORT_START("IN.6") // STR6 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("4") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("5") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("6") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_ASTERISK) PORT_NAME(u8"×") + + PORT_START("IN.7") // STR7 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("7") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("8") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_NAME("9") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_SLASH_PAD) PORT_NAME(u8"÷") + + PORT_START("IN.8") // STR8 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_BACKSPACE) PORT_NAME("CE/C") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_S) PORT_NAME("\xe2\x86\x94") // register exchange - unpopulated on 14RD/24RD + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_SLASH) PORT_NAME("%") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("=") +INPUT_PORTS_END + +void rw24k_state::rw24k(machine_config &config) +{ + // basic machine hardware + A5900(config, m_maincpu, 250000); // approximation + m_maincpu->write_str().set(FUNC(rw24k_state::write_str)); + m_maincpu->write_seg().set(FUNC(rw24k_state::write_seg)); + m_maincpu->read_kb().set(FUNC(rw24k_state::read_kb)); + + // video hardware + PWM_DISPLAY(config, m_display).set_size(9, 8); + m_display->set_segmask(0x1ff, 0xff); + config.set_default_layout(layout_rw24k); +} + +// roms + +ROM_START( rw24k ) + ROM_REGION( 0x200, "maincpu", 0 ) + ROM_LOAD( "a5901ca", 0x000, 0x200, CRC(00de7764) SHA1(0f24add4b6d2660aad63ddd4d0003d59a0e39df6) ) +ROM_END + + + +} // anonymous namespace + +/*************************************************************************** + + Game driver(s) + +***************************************************************************/ + +// YEAR NAME PARENT CMP MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS +CONS( 1976, autorace, 0, 0, autorace, autorace, autorace_state, empty_init, "Mattel Electronics", "Auto Race", MACHINE_SUPPORTS_SAVE ) +CONS( 1977, misatk, 0, 0, misatk, misatk, misatk_state, empty_init, "Mattel Electronics", "Missile Attack / Space Alert", MACHINE_SUPPORTS_SAVE ) +CONS( 1977, mfootb, 0, 0, mfootb, mfootb, mfootb_state, empty_init, "Mattel Electronics", "Football (Mattel)", MACHINE_SUPPORTS_SAVE ) +CONS( 1978, mbaseb, 0, 0, mbaseb, mbaseb, mbaseb_state, empty_init, "Mattel Electronics", "Baseball (Mattel)", MACHINE_SUPPORTS_SAVE ) +CONS( 1980, gravity, 0, 0, gravity, gravity, gravity_state, empty_init, "Mattel Electronics", "Gravity (Mattel)", MACHINE_SUPPORTS_SAVE ) + +COMP( 1974, rw10r, 0, 0, rw10r, rw10r, rw10r_state, empty_init, "Rockwell", "10R (Rockwell)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW ) +COMP( 1975, rw12r, 0, 0, rw10r, rw10r, rw10r_state, empty_init, "Rockwell", "12R: Square Root", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW ) +COMP( 1975, rw18r, 0, 0, rw18r, rw18r, rw18r_state, empty_init, "Rockwell", "18R: Memory", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW ) +COMP( 1974, rw30r, 0, 0, rw30r, rw30r, rw30r_state, empty_init, "Rockwell", "30R: Slide Rule Memory (B5500 version)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW ) +COMP( 1975, rw31r, rw30r, 0, rw31r, rw30r, rw30r_state, empty_init, "Rockwell", "31R: Slide Rule Memory", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW ) +COMP( 1976, rw24k, 0, 0, rw24k, rw24k, rw24k_state, empty_init, "Rockwell", "24K (Rockwell)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/hh_sm510.cpp mame-0.243+dfsg.1/src/mame/drivers/hh_sm510.cpp --- mame-0.242+dfsg.1/src/mame/drivers/hh_sm510.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/hh_sm510.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -174,17 +174,6 @@ m_display_decay_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(hh_sm510_state::display_decay_tick),this)); m_display_decay_timer->adjust(attotime::from_hz(1024), 0, attotime::from_hz(1024)); - // zerofill - m_inp_mux = 0; - m_speaker_data = 0; - m_s = 0; - m_r = 0; - m_display_x_len = 0; - m_display_y_len = 0; - m_display_z_len = 0; - memset(m_display_state, 0, sizeof(m_display_state)); - memset(m_display_decay, 0, sizeof(m_display_decay)); - // register for savestates save_item(NAME(m_inp_mux)); save_item(NAME(m_inp_lines)); @@ -5326,7 +5315,7 @@ /*************************************************************************** Nelsonic Game Watches on SM530*, wristwatch with an LCD game on it. - *: Older games are on different a MCU, several seen with OKI MSM5055. + *: Older games are on a different MCU, several seen with OKI MSM5055. Newer ones: to be investigated, maybe SM5x. Hardware notes: @@ -9518,8 +9507,8 @@ PORT_START("IN.3") // S4 PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_PLUS_PAD) PORT_CHANGED_CB(input_changed) PORT_NAME("+") PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_MINUS_PAD) PORT_CHANGED_CB(input_changed) PORT_NAME("-") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_ASTERISK) PORT_CHANGED_CB(input_changed) PORT_NAME(UTF8_MULTIPLY) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_SLASH_PAD) PORT_CHANGED_CB(input_changed) PORT_NAME(UTF8_DIVIDE) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_ASTERISK) PORT_CHANGED_CB(input_changed) PORT_NAME(u8"×") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_SLASH_PAD) PORT_CHANGED_CB(input_changed) PORT_NAME(u8"÷") PORT_START("IN.4") // S5 PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_X) PORT_CHANGED_CB(input_changed) PORT_NAME("ALM") @@ -9849,8 +9838,8 @@ PORT_START("IN.3") // S4 PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_A) PORT_CHANGED_CB(input_changed) PORT_NAME("Choose +") PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_S) PORT_CHANGED_CB(input_changed) PORT_NAME("Choose -") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_D) PORT_CHANGED_CB(input_changed) PORT_NAME("Choose " UTF8_MULTIPLY) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_F) PORT_CHANGED_CB(input_changed) PORT_NAME("Choose " UTF8_DIVIDE) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_D) PORT_CHANGED_CB(input_changed) PORT_NAME(u8"Choose ×") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_F) PORT_CHANGED_CB(input_changed) PORT_NAME(u8"Choose ÷") PORT_START("IN.4") // S5 PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_CHANGED_CB(input_changed) PORT_NAME("1") @@ -9873,8 +9862,8 @@ PORT_START("IN.7") // S8 PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_PLUS_PAD) PORT_CHANGED_CB(input_changed) PORT_NAME("+") PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_MINUS_PAD) PORT_CHANGED_CB(input_changed) PORT_NAME("-") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_ASTERISK) PORT_CHANGED_CB(input_changed) PORT_NAME(UTF8_MULTIPLY) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_SLASH_PAD) PORT_CHANGED_CB(input_changed) PORT_NAME(UTF8_DIVIDE) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_ASTERISK) PORT_CHANGED_CB(input_changed) PORT_NAME(u8"×") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_SLASH_PAD) PORT_CHANGED_CB(input_changed) PORT_NAME(u8"÷") PORT_START("ACL") PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_POWER_ON ) PORT_CHANGED_CB(acl_button) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/himesiki.cpp mame-0.243+dfsg.1/src/mame/drivers/himesiki.cpp --- mame-0.242+dfsg.1/src/mame/drivers/himesiki.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/himesiki.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -3,7 +3,7 @@ /***************************************************************************** Himeshikibu (C) 1989 Hi-Soft -Android (C) 198? Nasco +Android (C) 1987? Nasco Driver by Uki @@ -92,30 +92,210 @@ */ #include "emu.h" -#include "includes/himesiki.h" #include "cpu/z80/z80.h" +#include "machine/gen_latch.h" #include "machine/i8255.h" #include "sound/ymopn.h" + +#include "emupal.h" #include "screen.h" #include "speaker.h" +#include "tilemap.h" + + +namespace { + +class himesiki_state : public driver_device +{ +public: + himesiki_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_bg_ram(*this, "bg_ram"), + m_spriteram_p103a(*this, "sprram_p103a"), + m_spriteram(*this, "spriteram"), + m_mainbank(*this, "mainbank"), + m_maincpu(*this, "maincpu"), + m_subcpu(*this, "sub"), + m_gfxdecode(*this, "gfxdecode"), + m_palette(*this, "palette"), + m_soundlatch(*this, "soundlatch") + { } + + void himesiki(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; + +private: + // memory pointers + required_shared_ptr m_bg_ram; + required_shared_ptr m_spriteram_p103a; + required_shared_ptr m_spriteram; + required_memory_bank m_mainbank; + + // video-related + tilemap_t *m_bg_tilemap = nullptr; + uint8_t m_scrollx[2]{}; + uint8_t m_scrolly = 0; + uint8_t m_flipscreen = 0; + + // devices + required_device m_maincpu; + required_device m_subcpu; + required_device m_gfxdecode; + required_device m_palette; + required_device m_soundlatch; + + void rombank_w(uint8_t data); + void sound_w(uint8_t data); + void bg_ram_w(offs_t offset, uint8_t data); + void scrollx_w(offs_t offset, uint8_t data); + void scrolly_w(uint8_t data); + TILE_GET_INFO_MEMBER(get_bg_tile_info); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); + void main_io_map(address_map &map); + void sound_io_map(address_map &map); + void main_prg_map(address_map &map); + void sound_prg_map(address_map &map); +}; + + +// video + +TILE_GET_INFO_MEMBER(himesiki_state::get_bg_tile_info) +{ + int code = m_bg_ram[tile_index * 2] + m_bg_ram[tile_index * 2 + 1] * 0x100; + int col = code >> 12; + + code &= 0xfff; + + tileinfo.set(0, code, col, 0); +} + +void himesiki_state::video_start() +{ + m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(himesiki_state::get_bg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); +} + +void himesiki_state::bg_ram_w(offs_t offset, uint8_t data) +{ + m_bg_ram[offset] = data; + m_bg_tilemap->mark_tile_dirty(offset / 2); +} + +void himesiki_state::scrollx_w(offs_t offset, uint8_t data) +{ + m_scrollx[offset] = data; +} + +void himesiki_state::scrolly_w(uint8_t data) +{ + m_scrolly = data; +} + +void himesiki_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + // these sprites are from the ET-P103A board (himesiki only) + for (int offs = 0x00; offs < 0x60; offs += 4) + { + int attr = m_spriteram_p103a[offs + 1]; + int code = m_spriteram_p103a[offs + 0] | (attr & 3) << 8; + int x = m_spriteram_p103a[offs + 3] | (attr & 8) << 5; + int y = m_spriteram_p103a[offs + 2]; + + int col = (attr & 0xf0) >> 4; + int fx = attr & 4; + int fy = 0; + + if (x > 0x1e0) + x -= 0x200; + + if (m_flipscreen) + { + y = (y - 31) & 0xff; + x = 224 - x; + fx ^= 4; + fy = 1; + } + else + { + y = 257 - y; + if (y > 0xc0) + y -= 0x100; + } + + m_gfxdecode->gfx(2)->transpen(bitmap, cliprect, code, col, fx, fy, x, y, 15); + } + + // 0xc0 - 0xff unused + for (int offs = 0; offs < 0x100; offs += 4) + { + // not sure about this, but you sometimes get a garbage sprite in the corner otherwise. + if ((m_spriteram[offs + 0] == 0x00) && + (m_spriteram[offs + 1] == 0x00) && + (m_spriteram[offs + 2] == 0x00) && + (m_spriteram[offs + 3] == 0x00)) + continue; + + int attr = m_spriteram[offs + 1]; + int code = m_spriteram[offs + 0] | (attr & 7) << 8; + int x = m_spriteram[offs + 3] | (attr & 8) << 5; + int y = m_spriteram[offs + 2]; + + int col = (attr & 0xf0) >> 4; + int f = 0; + + if (x > 0x1e0) + x -= 0x200; + + if (m_flipscreen) + { + y = (y - 15) & 0xff; + x = 240 - x; + f = 1; + } + else + y = 257 - y; + + y &= 0xff; + if (y > 0xf0) + y -= 0x100; + + m_gfxdecode->gfx(1)->transpen(bitmap, cliprect, code, col, f, f, x, y, 15); + } +} + +uint32_t himesiki_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + int x = -(m_scrollx[0] << 8 | m_scrollx[1]) & 0x1ff; + m_bg_tilemap->set_scrolldx(x, x); + m_bg_tilemap->set_scrolldy(-m_scrolly, -m_scrolly - 64); + + m_bg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); + draw_sprites(bitmap, cliprect); + + return 0; +} -#define MCLK XTAL(12'000'000) // this is on the video board -#define CLK2 XTAL(8'000'000) // near the CPUs +// machine -void himesiki_state::himesiki_rombank_w(uint8_t data) +void himesiki_state::rombank_w(uint8_t data) { - membank("bank1")->set_entry(((data & 0x0c) >> 2)); + m_mainbank->set_entry(((data & 0x0c) >> 2)); - m_flipscreen = (data & 0x10)>>4; + m_flipscreen = (data & 0x10) >> 4; flip_screen_set(m_flipscreen); if (data & 0xe3) logerror("p06_w %02x\n", data); } -void himesiki_state::himesiki_sound_w(uint8_t data) +void himesiki_state::sound_w(uint8_t data) { m_soundlatch->write(data); m_subcpu->pulse_input_line(INPUT_LINE_NMI, attotime::zero); @@ -123,37 +303,37 @@ /****************************************************************************/ -void himesiki_state::himesiki_prm0(address_map &map) +void himesiki_state::main_prg_map(address_map &map) { map(0x0000, 0x7fff).rom(); map(0x8000, 0x9fff).ram(); - map(0xa000, 0xa0ff).ram().share("spriteram"); - map(0xa100, 0xa7ff).ram().share("sprram_p103a"); // not on Android + map(0xa000, 0xa0ff).ram().share(m_spriteram); + map(0xa100, 0xa7ff).ram().share(m_spriteram_p103a); // not on Android map(0xa800, 0xafff).ram().w(m_palette, FUNC(palette_device::write8)).share("palette"); - map(0xb000, 0xbfff).ram().w(FUNC(himesiki_state::himesiki_bg_ram_w)).share("bg_ram"); - map(0xc000, 0xffff).bankr("bank1"); + map(0xb000, 0xbfff).ram().w(FUNC(himesiki_state::bg_ram_w)).share(m_bg_ram); + map(0xc000, 0xffff).bankr(m_mainbank); } -void himesiki_state::himesiki_iom0(address_map &map) +void himesiki_state::main_io_map(address_map &map) { map.global_mask(0xff); map(0x00, 0x03).rw("ppi8255_0", FUNC(i8255_device::read), FUNC(i8255_device::write)); // inputs map(0x04, 0x07).rw("ppi8255_1", FUNC(i8255_device::read), FUNC(i8255_device::write)); // dips + rombank - map(0x08, 0x08).w(FUNC(himesiki_state::himesiki_scrolly_w)); - map(0x09, 0x0a).w(FUNC(himesiki_state::himesiki_scrollx_w)); - map(0x0b, 0x0b).w(FUNC(himesiki_state::himesiki_sound_w)); + map(0x08, 0x08).w(FUNC(himesiki_state::scrolly_w)); + map(0x09, 0x0a).w(FUNC(himesiki_state::scrollx_w)); + map(0x0b, 0x0b).w(FUNC(himesiki_state::sound_w)); } -void himesiki_state::himesiki_prm1(address_map &map) +void himesiki_state::sound_prg_map(address_map &map) { map(0x0000, 0x7fff).rom(); map(0xf800, 0xffff).ram(); } -void himesiki_state::himesiki_iom1(address_map &map) +void himesiki_state::sound_io_map(address_map &map) { map.global_mask(0xff); map(0x00, 0x01).rw("ym2203", FUNC(ym2203_device::read), FUNC(ym2203_device::write)); @@ -364,17 +544,6 @@ /****************************************************************************/ -static const gfx_layout layout_bg = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { 0,1,2,3 }, - { 4,0,12,8,20,16,28,24 }, - { STEP8(0,32) }, - 8*8*4 -}; - static const gfx_layout layout_p103a = { 32,32, @@ -386,29 +555,17 @@ 32*32*4 }; -static const gfx_layout layout_spr = -{ - 16,16, - RGN_FRAC(1,1), - 4, - { 0,1,2,3 }, - { 4,0,12,8,20,16,28,24,36,32,44,40,52,48,60,56 }, - { STEP16(0,64) }, - 16*16*4 -}; static GFXDECODE_START( gfx_himesiki ) - GFXDECODE_ENTRY( "bgtiles", 0, layout_bg, 0x000, 16 ) - GFXDECODE_ENTRY( "sprites", 0, layout_spr, 0x200, 16 ) - GFXDECODE_ENTRY( "spr_p103a", 0, layout_p103a, 0x200, 16 ) + GFXDECODE_ENTRY( "bgtiles", 0, gfx_8x8x4_packed_lsb, 0x000, 16 ) + GFXDECODE_ENTRY( "sprites", 0, gfx_16x16x4_packed_lsb, 0x200, 16 ) + GFXDECODE_ENTRY( "spr_p103a", 0, layout_p103a, 0x200, 16 ) GFXDECODE_END void himesiki_state::machine_start() { - uint8_t *ROM = memregion("banks")->base(); - - membank("bank1")->configure_entries(0, 4, ROM, 0x4000); + m_mainbank->configure_entries(0, 4, memregion("banks")->base(), 0x4000); save_item(NAME(m_scrollx)); @@ -428,15 +585,18 @@ void himesiki_state::himesiki(machine_config &config) { - /* basic machine hardware */ - Z80(config, m_maincpu, CLK2); /* it's a 6.000 MHz rated part, but near the 8 Mhz XTAL?? - Android skips lots of frames at 6, crashes at 4 */ - m_maincpu->set_addrmap(AS_PROGRAM, &himesiki_state::himesiki_prm0); - m_maincpu->set_addrmap(AS_IO, &himesiki_state::himesiki_iom0); + [[maybe_unused]] constexpr XTAL MCLK = XTAL(12'000'000); // this is on the video board + constexpr XTAL CLK2 = XTAL(8'000'000); // near the CPUs + + // basic machine hardware + Z80(config, m_maincpu, CLK2); // it's a 6.000 MHz rated part, but near the 8 Mhz XTAL?? - Android skips lots of frames at 6, crashes at 4 + m_maincpu->set_addrmap(AS_PROGRAM, &himesiki_state::main_prg_map); + m_maincpu->set_addrmap(AS_IO, &himesiki_state::main_io_map); m_maincpu->set_vblank_int("screen", FUNC(himesiki_state::irq0_line_hold)); - Z80(config, m_subcpu, CLK2/2); /* 4.000 MHz (4Mhz rated part, near the 8 Mhz XTAL) */ - m_subcpu->set_addrmap(AS_PROGRAM, &himesiki_state::himesiki_prm1); - m_subcpu->set_addrmap(AS_IO, &himesiki_state::himesiki_iom1); + Z80(config, m_subcpu, CLK2 / 2); // 4.000 MHz (4Mhz rated part, near the 8 Mhz XTAL) + m_subcpu->set_addrmap(AS_PROGRAM, &himesiki_state::sound_prg_map); + m_subcpu->set_addrmap(AS_IO, &himesiki_state::sound_io_map); i8255_device &ppi0(I8255A(config, "ppi8255_0")); ppi0.in_pa_callback().set_ioport("1P"); @@ -446,26 +606,26 @@ i8255_device &ppi1(I8255A(config, "ppi8255_1")); ppi1.in_pa_callback().set_ioport("DSW1"); ppi1.in_pb_callback().set_ioport("DSW2"); - ppi1.out_pc_callback().set(FUNC(himesiki_state::himesiki_rombank_w)); + ppi1.out_pc_callback().set(FUNC(himesiki_state::rombank_w)); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(60); screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); screen.set_size(32*8, 32*8); screen.set_visarea(0*8, 32*8-1, 0*8, 24*8-1); - screen.set_screen_update(FUNC(himesiki_state::screen_update_himesiki)); + screen.set_screen_update(FUNC(himesiki_state::screen_update)); screen.set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_himesiki); PALETTE(config, m_palette, palette_device::BLACK).set_format(palette_device::xRGB_555, 1024); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); GENERIC_LATCH_8(config, m_soundlatch); - ym2203_device &ym2203(YM2203(config, "ym2203", CLK2/4)); // ?? + ym2203_device &ym2203(YM2203(config, "ym2203", CLK2 / 4)); // ?? ym2203.irq_handler().set_inputline("sub", 0); ym2203.add_route(0, "mono", 0.10); ym2203.add_route(1, "mono", 0.10); @@ -477,7 +637,7 @@ /****************************************************************************/ ROM_START( himesiki ) - ROM_REGION( 0x08000, "maincpu", 0 ) /* z80 */ + ROM_REGION( 0x08000, "maincpu", 0 ) // z80 ROM_LOAD( "1.1k", 0x00000, 0x08000, CRC(fb4604b3) SHA1(e8155bbafb881125e1bf9a04808d6a6546887e90) ) ROM_REGION( 0x10000, "banks", 0 ) @@ -485,21 +645,21 @@ ROM_CONTINUE( 0x08000, 0x04000) // 1j is unpopulated on this game - ROM_REGION( 0x010000, "sub", 0 ) /* z80 */ + ROM_REGION( 0x08000, "sub", 0 ) // z80 ROM_LOAD( "5.6n", 0x00000, 0x08000, CRC(b1214ac7) SHA1(ee5459c28d9c3c2eb3467261716b1259ec486534) ) - ROM_REGION( 0x020000, "bgtiles", 0 ) /* bg */ + ROM_REGION( 0x020000, "bgtiles", 0 ) ROM_LOAD( "3.5f", 0x000000, 0x010000, CRC(73843e60) SHA1(0d8a397d8798e15f3fa7bf7a83e4c2ee44f6fa86) ) ROM_LOAD( "4.5d", 0x010000, 0x010000, CRC(443a3164) SHA1(08aa002214251a870581a01d775f497dd390957c) ) - ROM_REGION( 0x040000, "sprites", 0 ) /* sprites */ + ROM_REGION( 0x040000, "sprites", 0 ) ROM_LOAD16_BYTE( "13.9e", 0x000000, 0x010000, CRC(43102682) SHA1(0d4bde8bece0cbc6c06071aa8ad210a0636d862f) ) ROM_LOAD16_BYTE( "12.9c", 0x000001, 0x010000, CRC(19c8f9f4) SHA1(b14c8a6b94fd474be375e7a6a03d7f4517da2247) ) ROM_LOAD16_BYTE( "15.8e", 0x020000, 0x010000, CRC(2630d394) SHA1(b2e9e836b1f053fce3212912c53d3cdca3372439) ) ROM_LOAD16_BYTE( "14.8c", 0x020001, 0x010000, CRC(8103a207) SHA1(0dde8a0aaf2618d9c1589f35841db210439d0388) ) - ROM_REGION( 0x060000, "spr_p103a", 0 ) /* sprites */ + ROM_REGION( 0x060000, "spr_p103a", 0 ) ROM_LOAD16_BYTE( "6.1a", 0x000000, 0x010000, CRC(14989c22) SHA1(fe0c31df10237294ea8ef0ab8965ba5bb25113a2) ) ROM_LOAD16_BYTE( "7.1c", 0x000001, 0x010000, CRC(cec56e16) SHA1(836ff413301044313fdf7af5d304c145137b898a) ) ROM_LOAD16_BYTE( "8.2a", 0x020000, 0x010000, CRC(44ba127e) SHA1(d756b6c3075d75287f9c8be662c1eab02f4245a3) ) @@ -517,11 +677,11 @@ ROM_REGION( 0x10000, "banks", 0 ) ROM_LOAD( "mitsubishi__ad-3__m5l27256k.toppcb.g1", 0x00000, 0x04000, CRC(6cf5f48a) SHA1(b9b4e5e7bace0e8d98fbc9f4ad91bc56ef42099e) ) - ROM_CONTINUE( 0x08000, 0x04000) - ROM_LOAD( "mitsubishi__ad2__m5l27256k.toppcb.j1", 0x04000, 0x04000, CRC(e41426be) SHA1(e7e06ef3ff5160bb7d870e148ba2799da52cf24c) ) - ROM_CONTINUE( 0x0c000, 0x04000) + ROM_CONTINUE( 0x08000, 0x04000) + ROM_LOAD( "mitsubishi__ad2__m5l27256k.toppcb.j1", 0x04000, 0x04000, CRC(e41426be) SHA1(e7e06ef3ff5160bb7d870e148ba2799da52cf24c) ) + ROM_CONTINUE( 0x0c000, 0x04000) - ROM_REGION( 0x18000, "sub", 0 ) + ROM_REGION( 0x08000, "sub", 0 ) ROM_LOAD( "mitsubishi__ad-4__m5l27256k.toppcb.n6", 0x00000, 0x08000, CRC(13c38fe4) SHA1(34a35fa057159a5c83892a88b8c908faa39d5cb3) ) ROM_REGION( 0x10000, "bgtiles", 0 ) @@ -529,7 +689,7 @@ ROM_REGION( 0x20000, "sprites", 0 ) ROM_LOAD16_BYTE( "mitsubishi__ad-6__m5l27512k.botpcb.def9", 0x00000, 0x10000, CRC(5e42984e) SHA1(2a928960c740dfb94589e011cce093bed2fd7685) ) - ROM_LOAD16_BYTE( "mitsubishi__ad-7__m5l27512k.botpcb.bc9", 0x00001, 0x10000, CRC(611ff400) SHA1(1a9aed33d0e3f063811f92b9fee3ecbff0e965bf) ) + ROM_LOAD16_BYTE( "mitsubishi__ad-7__m5l27512k.botpcb.bc9", 0x00001, 0x10000, CRC(611ff400) SHA1(1a9aed33d0e3f063811f92b9fee3ecbff0e965bf) ) ROM_REGION( 0x2000, "plds", 0 ) ROM_LOAD( "ricoh_7a2_19__epl10p8bp_japan_i.f1.jed", 0x0000, 0x0473, CRC(c5e51ea2) SHA1(3e35a30935f562227f0afa32a6be6eb33f9a8372) ) @@ -545,9 +705,9 @@ ROM_REGION( 0x10000, "banks", 0 ) ROM_LOAD( "andr3.bin", 0x00000, 0x04000, CRC(112d5123) SHA1(653109eae7b58d9dcb8892ea9aca17427f14c145) ) - ROM_CONTINUE( 0x08000, 0x04000) + ROM_CONTINUE( 0x08000, 0x04000) - ROM_REGION( 0x18000, "sub", 0 ) + ROM_REGION( 0x08000, "sub", 0 ) ROM_LOAD( "andr4.bin", 0x00000, 0x08000, CRC(65f5e98b) SHA1(69f979d653695413a1c503c402d4bf5ffcfb6e5d) ) ROM_REGION( 0x10000, "bgtiles", 0 ) @@ -564,6 +724,8 @@ // + 2 undumped PLDs (?) ROM_END +} // anonymous namespace + GAME( 1989, himesiki, 0, himesiki, himesiki, himesiki_state, empty_init, ROT90, "Hi-Soft", "Himeshikibu (Japan)", MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/hitme.cpp mame-0.243+dfsg.1/src/mame/drivers/hitme.cpp --- mame-0.242+dfsg.1/src/mame/drivers/hitme.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/hitme.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -280,19 +280,8 @@ GFXDECODE_END -static const gfx_layout barricad_charlayout = -{ - 8,8, - RGN_FRAC(1,1), - 1, - { 0 }, - { 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_barricad ) - GFXDECODE_ENTRY( "gfx1", 0, barricad_charlayout, 0, 1 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x1, 0, 1 ) GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/homedata.cpp mame-0.243+dfsg.1/src/mame/drivers/homedata.cpp --- mame-0.242+dfsg.1/src/mame/drivers/homedata.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/homedata.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1101,20 +1101,9 @@ /**************************************************************************/ -static const gfx_layout char_layout = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { 0, 1, 2, 3 }, - { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4 }, - { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 }, - 32*8 -}; - static GFXDECODE_START( gfx_mrokumei ) - GFXDECODE_ENTRY( "gfx1", 0, char_layout, 0x6000, 0x100 ) - GFXDECODE_ENTRY( "gfx2", 0, char_layout, 0x7000, 0x100 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x4_packed_msb, 0x6000, 0x100 ) + GFXDECODE_ENTRY( "gfx2", 0, gfx_8x8x4_packed_msb, 0x7000, 0x100 ) GFXDECODE_END static const gfx_layout tile_layout = @@ -1491,20 +1480,9 @@ -static const gfx_layout mirderbychar_layout = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { 0, 1, 2, 3 }, - { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4 }, - { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 }, - 32*8 -}; - static GFXDECODE_START( gfx_mirderby ) - GFXDECODE_ENTRY( "gfx1", 0, mirderbychar_layout, 0x0000, 0x10 ) - GFXDECODE_ENTRY( "gfx2", 0, mirderbychar_layout, 0x0000, 0x10 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x4_packed_msb, 0x0000, 0x10 ) + GFXDECODE_ENTRY( "gfx2", 0, gfx_8x8x4_packed_msb, 0x0000, 0x10 ) GFXDECODE_END /* Miracle Derby - Ascot diff -Nru mame-0.242+dfsg.1/src/mame/drivers/homelab.cpp mame-0.243+dfsg.1/src/mame/drivers/homelab.cpp --- mame-0.242+dfsg.1/src/mame/drivers/homelab.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/homelab.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -684,15 +684,16 @@ u16 args[2]; image.fseek(0x100, SEEK_SET); - u8 ch = image.fgetc(); - if (ch != 0xA5) + u8 ch = 0; + u32 bytes = image.fread(&ch, 1); + if (bytes != 1 || ch != 0xA5) { image.seterror(image_error::INVALIDIMAGE, "Invalid header"); image.message(" Invalid header"); return image_init_result::FAIL; } - while((ch = image.fgetc())) + while ((bytes = image.fread(&ch, 1)) != 0 && ch != 0) { if (i >= (std::size(pgmname) - 1)) { diff -Nru mame-0.242+dfsg.1/src/mame/drivers/hp16500.cpp mame-0.243+dfsg.1/src/mame/drivers/hp16500.cpp --- mame-0.242+dfsg.1/src/mame/drivers/hp16500.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/hp16500.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -109,7 +109,7 @@ void hp1650_map(address_map &map); void hp1651_map(address_map &map); - uint32_t m_palette[256], m_colors[3], m_count, m_clutoffs; + uint32_t m_palette[256]{}, m_colors[3]{}, m_count = 0, m_clutoffs = 0; }; uint32_t hp16500_state::vbl_state_r() diff -Nru mame-0.242+dfsg.1/src/mame/drivers/hunter2.cpp mame-0.243+dfsg.1/src/mame/drivers/hunter2.cpp --- mame-0.242+dfsg.1/src/mame/drivers/hunter2.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/hunter2.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -92,8 +92,8 @@ void hunter2_io(address_map &map); void hunter2_mem(address_map &map); - uint8_t m_keydata; - uint8_t m_irq_mask; + uint8_t m_keydata = 0; + uint8_t m_irq_mask = 0; required_device m_maincpu; required_device m_speaker; required_ioport_array<7> m_kbd; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/ibm6580.cpp mame-0.243+dfsg.1/src/mame/drivers/ibm6580.cpp --- mame-0.242+dfsg.1/src/mame/drivers/ibm6580.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/ibm6580.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -871,17 +871,11 @@ ca |= (ra > 2) ? ra - 3 : 0; #endif - // underline - if (attr & 0x08 && ra == 13) - gfx = 0xff; - else - gfx = m_p_chargen[ca | ra]; + gfx = m_p_chargen[ca | ra]; - // cursor - if (attr & 0x04 && ra == 14) + // underline, cursor + if (((attr & 0x08) && (ra == 13)) || ((attr & 0x04) && (ra == 14))) gfx = 0xff; - else - gfx = m_p_chargen[ca | ra]; // reverse video if (attr & 0x10) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/idsa.cpp mame-0.243+dfsg.1/src/mame/drivers/idsa.cpp --- mame-0.242+dfsg.1/src/mame/drivers/idsa.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/idsa.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -26,6 +26,7 @@ - Various PROMs are undumped. - Speech is gibberish - Display +- Save states - Mechanical sounds - The usual: identify lamps, solenoids, contactors - Outputs diff -Nru mame-0.242+dfsg.1/src/mame/drivers/igs011.cpp mame-0.243+dfsg.1/src/mame/drivers/igs011.cpp --- mame-0.242+dfsg.1/src/mame/drivers/igs011.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/igs011.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -3994,16 +3994,6 @@ // for debugging #if 0 -static const gfx_layout layout_8x8x4 = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { STEP4(0,1) }, - { 4, 0, 12, 8, 20,16, 28,24 }, - { STEP8(0,8*4) }, - 8*8*4 -}; static const gfx_layout layout_16x16x4 = { 16,16, @@ -4047,17 +4037,17 @@ }; static GFXDECODE_START( gfx_igs011 ) - GFXDECODE_ENTRY( "blitter", 0, layout_8x8x4, 0, 0x80 ) - GFXDECODE_ENTRY( "blitter", 0, layout_16x16x4, 0, 0x80 ) - GFXDECODE_ENTRY( "blitter", 0, layout_8x8x8, 0, 0x08 ) - GFXDECODE_ENTRY( "blitter", 0, layout_16x16x8, 0, 0x08 ) + GFXDECODE_ENTRY( "blitter", 0, gfx_8x8x4_packed_lsb, 0, 0x80 ) + GFXDECODE_ENTRY( "blitter", 0, layout_16x16x4, 0, 0x80 ) + GFXDECODE_ENTRY( "blitter", 0, layout_8x8x8, 0, 0x08 ) + GFXDECODE_ENTRY( "blitter", 0, layout_16x16x8, 0, 0x08 ) GFXDECODE_END static GFXDECODE_START( gfx_igs011_hi ) - GFXDECODE_ENTRY( "blitter", 0, layout_8x8x4, 0, 0x80 ) - GFXDECODE_ENTRY( "blitter", 0, layout_16x16x4, 0, 0x80 ) - GFXDECODE_ENTRY( "blitter", 0, layout_8x8x8, 0, 0x08 ) - GFXDECODE_ENTRY( "blitter", 0, layout_16x16x8, 0, 0x08 ) - GFXDECODE_ENTRY( "blitter_hi", 0, layout_16x16x1, 0, 0x80 ) + GFXDECODE_ENTRY( "blitter", 0, gfx_8x8x4_packed_lsb, 0, 0x80 ) + GFXDECODE_ENTRY( "blitter", 0, layout_16x16x4, 0, 0x80 ) + GFXDECODE_ENTRY( "blitter", 0, layout_8x8x8, 0, 0x08 ) + GFXDECODE_ENTRY( "blitter", 0, layout_16x16x8, 0, 0x08 ) + GFXDECODE_ENTRY( "blitter_hi", 0, layout_16x16x1, 0, 0x80 ) GFXDECODE_END #endif diff -Nru mame-0.242+dfsg.1/src/mame/drivers/igs_m036.cpp mame-0.243+dfsg.1/src/mame/drivers/igs_m036.cpp --- mame-0.242+dfsg.1/src/mame/drivers/igs_m036.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/igs_m036.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -200,6 +200,25 @@ ROM_END +ROM_START( lhtb ) // PCB-0799-02-IU-1, every ROM label starts with 龍虎特別版 + ROM_REGION( 0x04000, "maincpu", 0 ) + // Internal ROM of IGS027A ARM based MCU + ROM_LOAD( "cn1012_igs036", 0x00000, 0x4000, NO_DUMP ) + + ROM_REGION32_LE( 0x200000, "user1", 0 ) // external ARM data / prg + ROM_LOAD( "s-101cn.u18", 0x000000, 0x200000, CRC(1020f4b5) SHA1(953bb776a804738c624a1dca336e42beb10238f7) ) + + ROM_REGION( 0x800100, "oki", 0 ) // TT5665 samples + ROM_LOAD( "s101cn_u27.u27", 0x000000, 0x800100, CRC(1b114177) SHA1(acd9969806a49fd6696782fd629b24bbc22f43af) ) // 1xxxxxxxxxxxxxxxxxxxxxxx = 0x00 + + ROM_REGION( 0x800100*2, "gfx", 0 ) + ROM_LOAD( "s101cn_u28.u28", 0x000000, 0x800100, CRC(d823ccba) SHA1(b1c69536baab36331dc5ed9ea12dad4f53b7422e) ) // 1xxxxxxxxxxxxxxxxxxxxxxx = 0x00 + // u29 not populated + ROM_LOAD( "s101cn_u30.u30", 0x800100, 0x800100, CRC(3077bca5) SHA1(3850cd108f8704be549de82af20b385ccc7f999e) ) // 1xxxxxxxxxxxxxxxxxxxxxxx = 0x00 + // u31 not populated, etched CG1-L on PCB +ROM_END + + ROM_START( lhzb3in1 ) ROM_REGION( 0x04000, "maincpu", 0 ) /* Internal rom of IGS036 ARM based MCU */ @@ -352,6 +371,8 @@ GAME( 200?, cjddzsp, 0, igs_m036_tt, igs_m036, igs_m036_state, init_cjddzsp, ROT0, "IGS", "Super Dou Di Zhu Special (V122CN)", MACHINE_IS_SKELETON ) +GAME( 200?, lhtb, 0, igs_m036_tt, igs_m036, igs_m036_state, init_cjddzsp, ROT0, "IGS", "Long Hu Tebie Ban (V101CN)", MACHINE_IS_SKELETON ) // 龍虎特別版 - Lónghǔ tèbié bǎn + GAME( 200?, lhzb3in1,0, igs_m036_tt, igs_m036, igs_m036_state, init_cjddzsp, ROT0, "IGS", "Long Hu Zhengba San He Yi (V100CN)", MACHINE_IS_SKELETON ) // 龙虎争霸三合一 GAME( 200?, igsm312, 0, igs_m036_tt, igs_m036, igs_m036_state, init_igsm312, ROT0, "IGS", "unknown 'IGS 6POKER2' game (V312CN)", MACHINE_IS_SKELETON ) // there's very little code and no gfx roms, might be a 'set/clear' chip for a gambling game. diff -Nru mame-0.242+dfsg.1/src/mame/drivers/inder.cpp mame-0.243+dfsg.1/src/mame/drivers/inder.cpp --- mame-0.242+dfsg.1/src/mame/drivers/inder.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/inder.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -118,7 +118,7 @@ void lapbylap_main_map(address_map &map); void lapbylap_audio_map(address_map &map); - bool m_pc0 = 0; + bool m_pc0 = false; u8 m_game = 0U; u8 m_portc = 0U; u8 m_row = 0U; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/inderp.cpp mame-0.243+dfsg.1/src/mame/drivers/inderp.cpp --- mame-0.242+dfsg.1/src/mame/drivers/inderp.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/inderp.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -392,7 +392,7 @@ } // Anonymous namespace -GAME( 1979, centauri, 0, inderp, inderp, inderp_state, init_1player, ROT0, "Inder", "Centaur (Inder)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1979, centauri2, centauri, inderp, inderp, inderp_state, init_1player, ROT0, "Inder", "Centaur (Inder, alternate set)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1979, topaz, 0, inderp, inderp, inderp_state, empty_init, ROT0, "Inder", "Topaz (Inder)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1980, skatebrd, 0, inderp, inderp, inderp_state, empty_init, ROT0, "Inder", "Skate Board (Inder)", MACHINE_IS_SKELETON_MECHANICAL ) +GAME( 1979, centauri, 0, inderp, inderp, inderp_state, init_1player, ROT0, "Inder", "Centaur (Inder) (set 1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1979, centauri2, centauri, inderp, inderp, inderp_state, init_1player, ROT0, "Inder", "Centaur (Inder) (set 2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1979, topaz, 0, inderp, inderp, inderp_state, empty_init, ROT0, "Inder", "Topaz (Inder)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1980, skatebrd, 0, inderp, inderp, inderp_state, empty_init, ROT0, "Inder", "Skate Board (Inder)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/ironhors.cpp mame-0.243+dfsg.1/src/mame/drivers/ironhors.cpp --- mame-0.242+dfsg.1/src/mame/drivers/ironhors.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/ironhors.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -218,17 +218,6 @@ * *************************************/ -static const gfx_layout ironhors_charlayout = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { 0, 1, 2, 3 }, - { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4 }, - { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 }, - 32*8 -}; - static const gfx_layout ironhors_spritelayout = { 16,16, @@ -243,9 +232,9 @@ }; static GFXDECODE_START( gfx_ironhors ) - GFXDECODE_ENTRY( "gfx1", 0, ironhors_charlayout, 0, 16*8 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x4_packed_msb, 0, 16*8 ) GFXDECODE_ENTRY( "gfx1", 0, ironhors_spritelayout, 16*8*16, 16*8 ) - GFXDECODE_ENTRY( "gfx1", 0, ironhors_charlayout, 16*8*16, 16*8 ) // to handle 8x8 sprites + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x4_packed_msb, 16*8*16, 16*8 ) // to handle 8x8 sprites GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/isbc660.cpp mame-0.243+dfsg.1/src/mame/drivers/isbc660.cpp --- mame-0.242+dfsg.1/src/mame/drivers/isbc660.cpp 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/isbc660.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,82 @@ +// license:BSD-3-Clause +// copyright-holders:Patrick Mackinlay + +/* + * Intel iSBC 660 System Chassis + * + * This is a bare system chassis with an 8-slot backplane into which a variety + * of Multibus boards may be installed. + * + * Sources: + * - http://www.nj7p.org/Manuals/PDFs/Intel/AFN-00285A.pdf + * + * TODO: + * - additional cards + */ + +#include "emu.h" + +#include "bus/multibus/multibus.h" +#include "bus/multibus/isbc8024.h" + +#define VERBOSE 0 +#include "logmacro.h" + +namespace { + +class isbc660_state : public driver_device +{ +public: + isbc660_state(machine_config const &mconfig, device_type type, char const *tag) + : driver_device(mconfig, type, tag) + , m_bus(*this, "slot") + { + } + +protected: + // driver_device overrides + virtual void machine_start() override; + virtual void machine_reset() override; + +public: + // machine config + void isbc660(machine_config &config); + +private: + required_device m_bus; +}; + +void isbc660_state::machine_start() +{ +} + +void isbc660_state::machine_reset() +{ +} + +static void isbc660_cards(device_slot_interface &device) +{ + device.option_add("isbc8024", ISBC8024); +} + +void isbc660_state::isbc660(machine_config &config) +{ + MULTIBUS(config, m_bus, 10_MHz_XTAL); // FIXME: clock driven by bus master + + MULTIBUS_SLOT(config, "slot:1", m_bus, isbc660_cards, nullptr, false); + MULTIBUS_SLOT(config, "slot:2", m_bus, isbc660_cards, nullptr, false); + MULTIBUS_SLOT(config, "slot:3", m_bus, isbc660_cards, nullptr, false); + MULTIBUS_SLOT(config, "slot:4", m_bus, isbc660_cards, nullptr, false); + MULTIBUS_SLOT(config, "slot:5", m_bus, isbc660_cards, nullptr, false); + MULTIBUS_SLOT(config, "slot:6", m_bus, isbc660_cards, nullptr, false); + MULTIBUS_SLOT(config, "slot:7", m_bus, isbc660_cards, nullptr, false); + MULTIBUS_SLOT(config, "slot:8", m_bus, isbc660_cards, nullptr, false); +} + +ROM_START(isbc660) +ROM_END + +} + +/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ +COMP(1985, isbc660, 0, 0, isbc660, 0, isbc660_state, empty_init, "Intel", "iSBC 660", MACHINE_NOT_WORKING | MACHINE_NO_SOUND_HW) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/itech32.cpp mame-0.243+dfsg.1/src/mame/drivers/itech32.cpp --- mame-0.242+dfsg.1/src/mame/drivers/itech32.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/itech32.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -2206,7 +2206,44 @@ ROM_LOAD16_BYTE( "bssrom2.bin", 0x300000, 0x40000, CRC(8aee1e77) SHA1(f949fa89ee7d59f457ce89c72d461cecd0cface3) ) ROM_END -ROM_START( bloodstm22 ) +ROM_START( bloodstm221 ) // this board had generic stickers + ROM_REGION16_BE( 0x80000, "user1", 0 ) + ROM_LOAD16_BYTE( "bld00_v21.u83", 0x00000, 0x40000, CRC(01907aec) SHA1(a954366f2374c0836140e3b75a55ff47e4cfa645) ) + ROM_LOAD16_BYTE( "bld01_v21.u88", 0x00001, 0x40000, CRC(eeae123e) SHA1(9fdd53d6651cac16402a9c3fe0ae15c9b1baa0db) ) + + ROM_REGION( 0x28000, "soundcpu", 0 ) + ROM_LOAD( "bldsnd_v10.u17", 0x10000, 0x18000, CRC(dddeedbb) SHA1(f8ea786836630fc44bba968845fd2cb42cd81592) ) + ROM_CONTINUE( 0x08000, 0x08000 ) + + ROM_REGION( 0x880000, "gfx1", 0 ) + ROM_LOAD32_BYTE( "bsgrom0.bin", 0x000000, 0x080000, CRC(4e10b8c1) SHA1(b80f7dbf32faa97829c735da6dc0ee424dc9ecec) ) + ROM_LOAD32_BYTE( "bsgrom5.bin", 0x000001, 0x080000, CRC(6333b6ce) SHA1(53b884e09d198f8f53449bd011ba743c28b2c934) ) + ROM_LOAD32_BYTE( "bsgrom10.bin", 0x000002, 0x080000, CRC(a972a65c) SHA1(7772c2e0aaa0b3183c6287125b95fd1cd0c3775a) ) + ROM_LOAD32_BYTE( "bsgrom15.bin", 0x000003, 0x080000, CRC(9a8f54aa) SHA1(3a2f99c28324ba1fcfb652bdc596d94c90637b72) ) + ROM_LOAD32_BYTE( "bsgrom1.bin", 0x200000, 0x080000, CRC(10abf660) SHA1(e5b28ee12972abbcd883d702f496feae62d19e07) ) + ROM_LOAD32_BYTE( "bsgrom6.bin", 0x200001, 0x080000, CRC(06a260d5) SHA1(f506b799bbb5d4465a4ab564cfd276877b8a52e9) ) + ROM_LOAD32_BYTE( "bsgrom11.bin", 0x200002, 0x080000, CRC(f2cab3c7) SHA1(eecb1f2f8a3f3b1663a51c343e28e1b2078da5f4) ) + ROM_LOAD32_BYTE( "bsgrom16.bin", 0x200003, 0x080000, CRC(403aef7b) SHA1(0a2a61480cddd020bfbad01c6c328dfa6760bddd) ) + ROM_LOAD32_BYTE( "bsgrom2.bin", 0x400000, 0x080000, CRC(488200b1) SHA1(ae25bb5e9a836ae362d88de4e392ff46ff93c636) ) + ROM_LOAD32_BYTE( "bsgrom7.bin", 0x400001, 0x080000, CRC(5bb19727) SHA1(fd8aa73ff0606ac86f054794f6abc42f99b4f856) ) + ROM_LOAD32_BYTE( "bsgrom12.bin", 0x400002, 0x080000, CRC(b10d674f) SHA1(f5c713480deac44b86173ca9ac3aeea8a4d2ac85) ) + ROM_LOAD32_BYTE( "bsgrom17.bin", 0x400003, 0x080000, CRC(7119df7e) SHA1(67acb0525f21d5cd174528fb0fa72c7101deb5eb) ) + ROM_LOAD32_BYTE( "bsgrom3.bin", 0x600000, 0x080000, CRC(2378792e) SHA1(8cf1040a86ce7b6be3f56d144d4a17b7a888a648) ) + ROM_LOAD32_BYTE( "bsgrom8.bin", 0x600001, 0x080000, CRC(3640ca2e) SHA1(1fbc8306c7310ab23d40887c16f80e2dc3d730f8) ) + ROM_LOAD32_BYTE( "bsgrom13.bin", 0x600002, 0x080000, CRC(bd4a071d) SHA1(f25483591659d7424a4c62d0093fa56e5d337bf3) ) + ROM_LOAD32_BYTE( "bsgrom18.bin", 0x600003, 0x080000, CRC(12959bb8) SHA1(f74d407004ccbf461f749672e4e57a5f0b6b549f) ) + ROM_FILL( 0x800000, 0x080000, 0xff ) + + ROM_REGION16_BE( 0x400000, "ensoniq.0", ROMREGION_ERASE00 ) + ROM_LOAD16_BYTE( "ensoniq.2m", 0x000000, 0x200000, CRC(9fdc4825) SHA1(71e5255c66d9010be7e6f27916b605441fc53839) ) + + ROM_REGION16_BE( 0x400000, "ensoniq.2", ROMREGION_ERASE00 ) + ROM_LOAD16_BYTE( "bssrom0.bin", 0x000000, 0x80000, CRC(ee4570c8) SHA1(73dd292224bf182770b3cc2d90eb52b7d7b24378) ) + ROM_LOAD16_BYTE( "bssrom1.bin", 0x100000, 0x80000, CRC(b0f32ec5) SHA1(666f904b31cdef12cbf1dbb43a7d3ff7c2903260) ) + ROM_LOAD16_BYTE( "bssrom2.bin", 0x300000, 0x40000, CRC(8aee1e77) SHA1(f949fa89ee7d59f457ce89c72d461cecd0cface3) ) +ROM_END + +ROM_START( bloodstm220 ) ROM_REGION16_BE( 0x80000, "user1", 0 ) ROM_LOAD16_BYTE( "bld00_v22.u83", 0x00000, 0x40000, CRC(904e9208) SHA1(12e96027724b905140250db969130d90b1afec83) ) /* Labeled BLD00 V2.2 (U83) */ ROM_LOAD16_BYTE( "bld01_v22.u88", 0x00001, 0x40000, CRC(78336a7b) SHA1(76002ce4a2d83ceae10d9c9c123013832a081150) ) /* Labeled BLD01 V2.2 (U88) */ @@ -2243,7 +2280,7 @@ ROM_LOAD16_BYTE( "bssrom2.bin", 0x300000, 0x40000, CRC(8aee1e77) SHA1(f949fa89ee7d59f457ce89c72d461cecd0cface3) ) ROM_END -ROM_START( bloodstm21 ) +ROM_START( bloodstm210 ) ROM_REGION16_BE( 0x80000, "user1", 0 ) ROM_LOAD16_BYTE( "bld00_v21.u83", 0x00000, 0x40000, CRC(71215c8e) SHA1(ee0f94c3a2619d7e3cc1ba5e1888a97b0c75a3ae) ) /* Labeled BLD00 V2.1 (U83) */ ROM_LOAD16_BYTE( "bld01_v21.u88", 0x00001, 0x40000, CRC(da403da6) SHA1(0f09f38ae932acb4ddbb6323bce58be7284cb24b) ) /* Labeled BLD01 V2.1 (U88) */ @@ -2280,7 +2317,7 @@ ROM_LOAD16_BYTE( "bssrom2.bin", 0x300000, 0x40000, CRC(8aee1e77) SHA1(f949fa89ee7d59f457ce89c72d461cecd0cface3) ) ROM_END -ROM_START( bloodstm11 ) +ROM_START( bloodstm110 ) ROM_REGION16_BE( 0x80000, "user1", 0 ) ROM_LOAD16_BYTE( "bld00_v11.u83", 0x00000, 0x40000, CRC(4fff8f9b) SHA1(90f450497935322b0082a70e10abf758fc441dd0) ) /* Labeled BLD00 V1.1 (U83) */ ROM_LOAD16_BYTE( "bld01_v11.u88", 0x00001, 0x40000, CRC(59ce23ea) SHA1(6aa02fff07f5ec6dff4f6db9ea7878a722079f81) ) /* Labeled BLD01 V1.1 (U88) */ @@ -2317,7 +2354,7 @@ ROM_LOAD16_BYTE( "bssrom2.bin", 0x300000, 0x40000, CRC(8aee1e77) SHA1(f949fa89ee7d59f457ce89c72d461cecd0cface3) ) ROM_END -ROM_START( bloodstm10 ) +ROM_START( bloodstm104 ) ROM_REGION16_BE( 0x80000, "user1", 0 ) ROM_LOAD16_BYTE( "bld00_v10.u83", 0x00000, 0x40000, CRC(a0982119) SHA1(7a55f662db062488714b42aedea56eea3b80aed5) ) /* Labeled BLD00 V1.0 (U83) */ ROM_LOAD16_BYTE( "bld01_v10.u88", 0x00001, 0x40000, CRC(65800339) SHA1(379e57bd2c31180fa077b9a6e9fcffacde95280c) ) /* Labeled BLD01 V1.0 (U88) */ @@ -5094,10 +5131,11 @@ GAME( 1993, hardyard10, hardyard, bloodstm, hardyard, itech32_state, init_hardyard, ROT0, "Strata/Incredible Technologies", "Hard Yardage (v1.00)", MACHINE_SUPPORTS_SAVE ) GAME( 1994, bloodstm, 0, bloodstm, bloodstm, itech32_state, init_bloodstm, ROT0, "Strata/Incredible Technologies", "Blood Storm (v2.22)", MACHINE_SUPPORTS_SAVE ) -GAME( 1994, bloodstm22, bloodstm, bloodstm, bloodstm, itech32_state, init_bloodstm, ROT0, "Strata/Incredible Technologies", "Blood Storm (v2.20)", MACHINE_SUPPORTS_SAVE ) -GAME( 1994, bloodstm21, bloodstm, bloodstm, bloodstm, itech32_state, init_bloodstm, ROT0, "Strata/Incredible Technologies", "Blood Storm (v2.10)", MACHINE_SUPPORTS_SAVE ) -GAME( 1994, bloodstm11, bloodstm, bloodstm, bloodstm, itech32_state, init_bloodstm, ROT0, "Strata/Incredible Technologies", "Blood Storm (v1.10)", MACHINE_SUPPORTS_SAVE ) -GAME( 1994, bloodstm10, bloodstm, bloodstm, bloodstm, itech32_state, init_bloodstm, ROT0, "Strata/Incredible Technologies", "Blood Storm (v1.04)", MACHINE_SUPPORTS_SAVE ) +GAME( 1994, bloodstm221, bloodstm, bloodstm, bloodstm, itech32_state, init_bloodstm, ROT0, "Strata/Incredible Technologies", "Blood Storm (v2.21)", MACHINE_SUPPORTS_SAVE ) +GAME( 1994, bloodstm220, bloodstm, bloodstm, bloodstm, itech32_state, init_bloodstm, ROT0, "Strata/Incredible Technologies", "Blood Storm (v2.20)", MACHINE_SUPPORTS_SAVE ) +GAME( 1994, bloodstm210, bloodstm, bloodstm, bloodstm, itech32_state, init_bloodstm, ROT0, "Strata/Incredible Technologies", "Blood Storm (v2.10)", MACHINE_SUPPORTS_SAVE ) +GAME( 1994, bloodstm110, bloodstm, bloodstm, bloodstm, itech32_state, init_bloodstm, ROT0, "Strata/Incredible Technologies", "Blood Storm (v1.10)", MACHINE_SUPPORTS_SAVE ) +GAME( 1994, bloodstm104, bloodstm, bloodstm, bloodstm, itech32_state, init_bloodstm, ROT0, "Strata/Incredible Technologies", "Blood Storm (v1.04)", MACHINE_SUPPORTS_SAVE ) GAME( 1994, pairs, 0, bloodstm, pairs, itech32_state, init_bloodstm, ROT0, "Strata/Incredible Technologies", "Pairs (V1.2, 09/30/94)", MACHINE_SUPPORTS_SAVE ) GAME( 1994, pairsa, pairs, bloodstm, pairs, itech32_state, init_bloodstm, ROT0, "Strata/Incredible Technologies", "Pairs (V1, 09/07/94)", MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/jaguar.cpp mame-0.243+dfsg.1/src/mame/drivers/jaguar.cpp --- mame-0.242+dfsg.1/src/mame/drivers/jaguar.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/jaguar.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1231,8 +1231,15 @@ switch((m_butch_regs[offset] & 0xff00) >> 8) { case 0x03: // Read TOC - uint32_t msf; - + { + if(!m_cd_file) // No disc + { + m_butch_cmd_response[0] = 0x400; + m_butch_regs[0] |= 0x2000; + m_butch_cmd_index = 0; + m_butch_cmd_size = 1; + return; + } if(m_butch_regs[offset] & 0xff) // Multi Session CD, TODO { m_butch_cmd_response[0] = 0x0029; // illegal value @@ -1242,12 +1249,12 @@ return; } - msf = cdrom_get_track_start(m_cd_file, 0) + 150; + uint32_t msf = m_cd_file->get_track_start(0) + 150; /* first track number */ m_butch_cmd_response[0] = 0x2000 | 1; /* last track number */ - m_butch_cmd_response[1] = 0x2100 | cdrom_get_last_track(m_cd_file); + m_butch_cmd_response[1] = 0x2100 | m_cd_file->get_last_track(); /* start of first track minutes */ m_butch_cmd_response[2] = 0x2200 | ((msf / 60) / 60); @@ -1259,45 +1266,57 @@ m_butch_cmd_index = 0; m_butch_cmd_size = 5; break; + } + case 0x14: // Read Long TOC + { + if(!m_cd_file) // No disc { - uint32_t msf; - int ntrks = cdrom_get_last_track(m_cd_file); - - for(int i=0;iget_last_track(); + + for(int i=0;iget_track_start(i) + 150; + + /* track number */ + m_butch_cmd_response[i*5+0] = 0x6000 | (i+1); + /* attributes (?) */ + m_butch_cmd_response[i*5+1] = 0x6100 | 0x00; + + /* start of track minutes */ + m_butch_cmd_response[i*5+2] = 0x6200 | ((msf / 60) / 60); + /* start of track seconds */ + m_butch_cmd_response[i*5+3] = 0x6300 | (msf / 60) % 60; + /* start of track frame */ + m_butch_cmd_response[i*5+4] = 0x6400 | (msf % 75); + } + m_butch_regs[0] |= 0x2000; + m_butch_cmd_index = 0; + m_butch_cmd_size = 5*ntrks; break; + } + case 0x15: // Set Mode m_butch_regs[0] |= 0x2000; m_butch_cmd_response[0] = 0x1700 | (m_butch_regs[offset] & 0xff); m_butch_cmd_index = 0; m_butch_cmd_size = 1; break; + case 0x70: // Set DAC Mode m_butch_regs[0] |= 0x2000; m_butch_cmd_response[0] = 0x7000 | (m_butch_regs[offset] & 0xff); m_butch_cmd_index = 0; m_butch_cmd_size = 1; break; + default: printf("%04x CMD\n",m_butch_regs[offset]); break; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/jeutel.cpp mame-0.243+dfsg.1/src/mame/drivers/jeutel.cpp --- mame-0.242+dfsg.1/src/mame/drivers/jeutel.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/jeutel.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -534,5 +534,5 @@ ROM_END -GAME( 1983, leking, 0, jeutel, jeutel, jeutel_state, empty_init, ROT0, "Jeutel", "Le King", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1984, olympic, 0, jeutel, jeutel, jeutel_state, empty_init, ROT0, "Jeutel", "Olympic Games", MACHINE_IS_SKELETON_MECHANICAL ) +GAME( 1983, leking, 0, jeutel, jeutel, jeutel_state, empty_init, ROT0, "Jeutel", "Le King", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1984, olympic, 0, jeutel, jeutel, jeutel_state, empty_init, ROT0, "Jeutel", "Olympic Games", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/joctronic.cpp mame-0.243+dfsg.1/src/mame/drivers/joctronic.cpp --- mame-0.242+dfsg.1/src/mame/drivers/joctronic.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/joctronic.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1,12 +1,19 @@ // license:BSD-3-Clause // copyright-holders:AJR -// PINBALL -// Skeleton driver for Joctronic pinballs. +/*********************************************************************************************************** +PINBALL +Skeleton driver for Joctronic pinballs. -/* - TODO: - Confirm "Pin Ball" exact hardware configuration, may be different from "Punky Willy" and "Walkyria". -*/ + +TODO: +- Confirm "Pin Ball" exact hardware configuration, may be different from "Punky Willy" and "Walkyria". +- Inputs +- Outputs +- Screen +- Sound +- Mechanical sounds + +************************************************************************************************************/ #include "emu.h" #include "cpu/z80/z80.h" @@ -86,8 +93,8 @@ optional_device m_adpcm_select; optional_device_array m_driver_latch; optional_memory_bank m_soundbank; - u8 m_soundlatch; - bool m_adpcm_toggle; + u8 m_soundlatch = 0; + bool m_adpcm_toggle = false; }; u8 joctronic_state::csin_r(offs_t offset) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/joystand.cpp mame-0.243+dfsg.1/src/mame/drivers/joystand.cpp --- mame-0.242+dfsg.1/src/mame/drivers/joystand.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/joystand.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -523,17 +523,6 @@ INPUT_PORTS_END -static const gfx_layout layout_8x8x4 = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { STEP4(0, 1) }, - { STEP8(0, 4) }, - { STEP8(0, 4*8) }, - 8*8*4 -}; - static const gfx_layout layout_16x16x8 = { 16,16, @@ -546,13 +535,13 @@ }; static GFXDECODE_START( gfx_joystand ) - GFXDECODE_ENTRY( "tiles", 0, layout_8x8x4, 0, 0x100 ) - GFXDECODE_ENTRY( "cart.u5", 0, layout_16x16x8, 0, 0x10 ) - GFXDECODE_ENTRY( "cart.u6", 0, layout_16x16x8, 0, 0x10 ) - GFXDECODE_ENTRY( "cart.u3", 0, layout_16x16x8, 0, 0x10 ) - GFXDECODE_ENTRY( "cart.u4", 0, layout_16x16x8, 0, 0x10 ) - GFXDECODE_ENTRY( "cart.u1", 0, layout_16x16x8, 0, 0x10 ) - GFXDECODE_ENTRY( "cart.u2", 0, layout_16x16x8, 0, 0x10 ) + GFXDECODE_ENTRY( "tiles", 0, gfx_8x8x4_packed_msb, 0, 0x100 ) + GFXDECODE_ENTRY( "cart.u5", 0, layout_16x16x8, 0, 0x10 ) + GFXDECODE_ENTRY( "cart.u6", 0, layout_16x16x8, 0, 0x10 ) + GFXDECODE_ENTRY( "cart.u3", 0, layout_16x16x8, 0, 0x10 ) + GFXDECODE_ENTRY( "cart.u4", 0, layout_16x16x8, 0, 0x10 ) + GFXDECODE_ENTRY( "cart.u1", 0, layout_16x16x8, 0, 0x10 ) + GFXDECODE_ENTRY( "cart.u2", 0, layout_16x16x8, 0, 0x10 ) GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/jp.cpp mame-0.243+dfsg.1/src/mame/drivers/jp.cpp --- mame-0.242+dfsg.1/src/mame/drivers/jp.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/jp.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -89,8 +89,8 @@ void update_display(); u32 m_disp_data = 0U; - bool m_adpcm_ff = 0; - bool m_game = 0; + bool m_adpcm_ff = false; + bool m_game = false; required_device m_maincpu; optional_device m_audiocpu; @@ -675,17 +675,17 @@ } // Anonymous namespace // 6-digit display -GAME(1985, petacon, 0, jp, jp, jp_state, init_6d, ROT0, "Juegos Populares", "Petaco (new hardware)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1985, petacona, 0, jp, jp, jp_state, init_6d, ROT0, "Juegos Populares", "Petaco (new hardware, alternate set)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1985, faeton6d, faeton, jp, jp, jp_state, init_6d, ROT0, "Juegos Populares", "Faeton (6 digits)", MACHINE_IS_SKELETON_MECHANICAL ) +GAME(1985, petacon, 0, jp, jp, jp_state, init_6d, ROT0, "Juegos Populares", "Petaco (new hardware)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1985, petacona, 0, jp, jp, jp_state, init_6d, ROT0, "Juegos Populares", "Petaco (new hardware, alternate set)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1985, faeton6d, faeton, jp, jp, jp_state, init_6d, ROT0, "Juegos Populares", "Faeton (6 digits)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // 7-digit display -GAME(1985, petaco2, 0, jps, jp, jp_state, empty_init, ROT0, "Juegos Populares", "Petaco 2", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1985, faeton, 0, jp, jp, jp_state, empty_init, ROT0, "Juegos Populares", "Faeton (7 digits)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1986, halley, 0, jps, jp, jp_state, empty_init, ROT0, "Juegos Populares", "Halley Comet", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1986, halleya, halley, jps, jp, jp_state, empty_init, ROT0, "Juegos Populares", "Halley Comet (alternate version)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1986, aqualand, 0, jps, jp, jp_state, empty_init, ROT0, "Juegos Populares", "Aqualand", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1986, america, 0, jps, jp, jp_state, empty_init, ROT0, "Juegos Populares", "America 1492", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1986, olympus, 0, jps, jp, jp_state, empty_init, ROT0, "Juegos Populares", "Olympus (Juegos Populares)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1987, lortium, 0, jp, jp, jp_state, empty_init, ROT0, "Juegos Populares", "Lortium", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(19??, pimbal, 0, jp, jp, jp_state, empty_init, ROT0, "Juegos Populares", "Pimbal (Pinball 3000)", MACHINE_IS_SKELETON_MECHANICAL ) +GAME(1985, petaco2, 0, jps, jp, jp_state, empty_init, ROT0, "Juegos Populares", "Petaco 2", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1985, faeton, 0, jp, jp, jp_state, empty_init, ROT0, "Juegos Populares", "Faeton (7 digits)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1986, halley, 0, jps, jp, jp_state, empty_init, ROT0, "Juegos Populares", "Halley Comet", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1986, halleya, halley, jps, jp, jp_state, empty_init, ROT0, "Juegos Populares", "Halley Comet (alternate version)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1986, aqualand, 0, jps, jp, jp_state, empty_init, ROT0, "Juegos Populares", "Aqualand", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1986, america, 0, jps, jp, jp_state, empty_init, ROT0, "Juegos Populares", "America 1492", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1986, olympus, 0, jps, jp, jp_state, empty_init, ROT0, "Juegos Populares", "Olympus (Juegos Populares)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1987, lortium, 0, jp, jp, jp_state, empty_init, ROT0, "Juegos Populares", "Lortium", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(19??, pimbal, 0, jp, jp, jp_state, empty_init, ROT0, "Juegos Populares", "Pimbal (Pinball 3000)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/jr100.cpp mame-0.243+dfsg.1/src/mame/drivers/jr100.cpp --- mame-0.242+dfsg.1/src/mame/drivers/jr100.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/jr100.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -93,8 +93,8 @@ private: uint8_t m_keyboard_line = 0U; - bool m_use_pcg = 0; - bool m_pb7 = 0; + bool m_use_pcg = false; + bool m_pb7 = false; uint32_t screen_update_jr100(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(sound_tick); uint8_t pb_r(); @@ -117,7 +117,7 @@ required_ioport_array<9> m_io_keyboard; required_device m_maincpu; - emu_timer *m_sound_timer; + emu_timer *m_sound_timer = nullptr; }; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/jr200.cpp mame-0.243+dfsg.1/src/mame/drivers/jr200.cpp --- mame-0.242+dfsg.1/src/mame/drivers/jr200.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/jr200.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -2,18 +2,57 @@ // copyright-holders:Angelo Salese, Roberto Zandona' /*************************************************************************** - JR-200 (c) 1982 National / Panasonic +JR-200 (c) 1982 National / Panasonic - driver by Roberto Zandona' and Angelo Salese - - http://www.armchairarcade.com/neo/node/1598 - - TODO: - - Timings are basically screwed, it takes too much to load the POST but - then the cursor blink is too fast - - keyboard MCU irq and data polling simulation should be inside a timer - callback - - MN1544 4-bit CPU core and ROM dump +BIOS will jump to D800 if it contains 7E. If not, it will jump to A000 + if it contains CE. Otherwise, the Monitor is entered. From the monitor, + GA000 for cold start Basic, or GE79D for warm start Basic. + +To get to the monitor from Basic type MON. Commands must be in UPPERcase. +Dnnnn : Display block of hex (D for next block) +Gnnnn : Go to address +Mnnnn : Modify memory at address + +Cassette (if it worked): +- POKE 43,0 for 2400 baud, or POKE 43,1 for 600 baud (affects SAVE only); +- SAVE "x" (1-16 chars) to save. LOAD to load (it autodetects the speed). +- 600 baud uses Kansas City format, each byte has a start bit, 8 data bits + (LSB first) and 3 stop bits. 1 = 2 cycles @1200Hz; 0 = 4 cycles @2400Hz +- 2400 baud has the same byte format, but each bit is represented in this + way: 1 = half cycle @1200Hz; 0 = 1 cycle @2400Hz. +- Since it is not working, programs can be entered via the Paste facility. + +TODO: +- Timings are basically screwed, it takes too much to load the POST but + then the cursor blink is too fast +- keyboard MCU irq and data polling simulation should be inside a timer + callback +- MN1544 4-bit CPU core and ROM dump +--- Character Generator ROM +--- Keyboard +--- Joysticks +--- Cassette baud switch +--- 128 bytes of RAM +- MN1271 device to be emulated +--- 4x 8-bit I/O ports +--- 3-bit port +--- timers +--- sound +--- cassette +--- serial / RS-232 +--- interface between the 2 CPUs +- JR200 keyboard includes Kana characters, Kana On, Kana off, GRAPH +- JR200U keyboard omits Kana, but has GRAPH ON and GRAPH OFF instead. +- Keyboard matrix and decoding incomplete. +- The BREAK key on the unit is actually a soft reset. +- The Chargen interfaces to the MN1271, so that the text character + definitions can be copied to D000-D7FF ram (via 0150-016F). The user can + modify these characters with pokes. Since we have no information, some + guesswork has been used to feed in the required info. +- Sound command never ends (SOUND 1000,50 should output 1000 Hz for 1 sec) +- Keyclick not working (POKE 0,64 should activate it) +- Cassette not implemented (needs MN1271 to work) +- Kana character 0xAC ('`) displays wrongly; chargen and manual conflict. ****************************************************************************/ @@ -28,47 +67,38 @@ class jr200_state : public driver_device { public: - jr200_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_vram(*this, "vram"), - m_cram(*this, "cram"), - m_mn1271_ram(*this, "mn1271_ram"), - m_maincpu(*this, "maincpu"), - m_beeper(*this, "beeper"), - m_pcg(*this, "pcg"), - m_gfx_rom(*this, "gfx_rom"), - m_gfx_ram(*this, "gfx_ram"), - m_row0(*this, "ROW0"), - m_row1(*this, "ROW1"), - m_row2(*this, "ROW2"), - m_row3(*this, "ROW3"), - m_row4(*this, "ROW4"), - m_row5(*this, "ROW5"), - m_row6(*this, "ROW6"), - m_row7(*this, "ROW7"), - m_row8(*this, "ROW8"), - m_row9(*this, "ROW9"), - m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") + jr200_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_vram(*this, "vram") + , m_cram(*this, "cram") + , m_mn1271_ram(*this, "mn1271_ram") + , m_maincpu(*this, "maincpu") + , m_beeper(*this, "beeper") + , m_pcg1(*this, "pcg1") + , m_pcg2(*this, "pcg2") + , m_gfx_rom(*this, "gfx_rom") + , m_gfx_ram(*this, "gfx_ram") + , m_io_keyboard(*this, "X%d", 0U) + , m_gfxdecode(*this, "gfxdecode") + , m_palette(*this, "palette") { } void jr200(machine_config &config); + DECLARE_INPUT_CHANGED_MEMBER(nmi_button); private: required_shared_ptr m_vram; required_shared_ptr m_cram; required_shared_ptr m_mn1271_ram; - uint8_t m_border_col; - uint8_t m_old_keydata; - uint8_t m_freq_reg[2]; - emu_timer *m_timer_d; - uint8_t jr200_pcg_1_r(offs_t offset); - uint8_t jr200_pcg_2_r(offs_t offset); - void jr200_pcg_1_w(offs_t offset, uint8_t data); - void jr200_pcg_2_w(offs_t offset, uint8_t data); - uint8_t jr200_bios_char_r(offs_t offset); - void jr200_bios_char_w(offs_t offset, uint8_t data); + uint8_t m_border_col = 0; + uint8_t m_old_keydata = 0; + uint8_t m_freq_reg[2]{}; + u16 m_autorepeat = 0; + u8 m_port_ctr = 0; + int m_port_cnt = 0; + emu_timer *m_timer_d = nullptr; uint8_t mcu_keyb_r(); + void unknown_port_w(u8); void jr200_beep_w(uint8_t data); void jr200_beep_freq_w(offs_t offset, uint8_t data); void jr200_border_col_w(uint8_t data); @@ -76,27 +106,18 @@ void mn1271_io_w(offs_t offset, uint8_t data); virtual void machine_start() override; virtual void machine_reset() override; - virtual void video_start() override; uint32_t screen_update_jr200(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(timer_d_callback); - void jr200_mem(address_map &map); + void mem_map(address_map &map); required_device m_maincpu; required_device m_beeper; - required_memory_region m_pcg; - required_memory_region m_gfx_rom; - required_memory_region m_gfx_ram; - required_ioport m_row0; - required_ioport m_row1; - required_ioport m_row2; - required_ioport m_row3; - required_ioport m_row4; - required_ioport m_row5; - required_ioport m_row6; - required_ioport m_row7; - required_ioport m_row8; - required_ioport m_row9; + required_shared_ptr m_pcg1; + required_shared_ptr m_pcg2; + required_region_ptr m_gfx_rom; + required_shared_ptr m_gfx_ram; + required_ioport_array<11> m_io_keyboard; required_device m_gfxdecode; required_device m_palette; }; @@ -104,66 +125,75 @@ /* TODO: double check this */ -static const uint8_t jr200_keycodes[4][9][8] = +static const uint8_t jr200_keycodes[6][7][8] = { /* unshifted */ { - { 0x00, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37 }, - { 0x38, 0x39, 0x30, 0x2d, 0x5e, 0x08, 0x7f, 0x2d }, - { 0x37, 0x38, 0x39, 0x09, 0x71, 0x77, 0x65, 0x72 }, - { 0x74, 0x79, 0x75, 0x69, 0x6f, 0x70, 0x40, 0x5b }, - { 0x1b, 0x2b, 0x34, 0x35, 0x36, 0x61, 0x73, 0x64 }, - { 0x66, 0x67, 0x68, 0x6a, 0x6b, 0x6c, 0x3b, 0x27 }, - { 0x0d, 0x0a, 0x1e, 0x31, 0x32, 0x33, 0x7a, 0x78 }, - { 0x63, 0x76, 0x62, 0x6e, 0x6d, 0x2c, 0x2e, 0x2f }, - { 0x1d, 0x1f, 0x1c, 0x30, 0x2e, 0x20, 0x03, 0x00 } + { 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38 }, + { 0x39, 0x30, 0x2d, 0x5e, 0x08, 0x7f, 0x13, 0x5c }, + { 0x71, 0x77, 0x65, 0x72, 0x74, 0x79, 0x75, 0x69 }, + { 0x6f, 0x70, 0x40, 0x5b, 0x0d, 0x61, 0x73, 0x64 }, + { 0x66, 0x67, 0x68, 0x6a, 0x6b, 0x6c, 0x3b, 0x3a }, + { 0x5d, 0x7a, 0x78, 0x63, 0x76, 0x62, 0x6e, 0x6d }, + { 0x2c, 0x2e, 0x2f, 0x20, 0x1e, 0x1d, 0x1f, 0x1c }, }, /* shifted */ { - { 0x00, 0x21, 0x40, 0x23, 0x24, 0x25, 0x5e, 0x26 }, - { 0x2a, 0x28, 0x29, 0x3d, 0x10, 0x08, 0x7f, 0x2d }, - { 0x37, 0x38, 0x39, 0x09, 0x51, 0x57, 0x45, 0x52 }, - { 0x54, 0x59, 0x55, 0x49, 0x4f, 0x50, 0x40, 0x7b }, - { 0x1b, 0x2b, 0x34, 0x35, 0x36, 0x41, 0x53, 0x44 }, - { 0x46, 0x47, 0x48, 0x4a, 0x4b, 0x4c, 0x3a, 0x22 }, - { 0x0d, 0x0a, 0x1e, 0x31, 0x32, 0x33, 0x5a, 0x58 }, - { 0x43, 0x56, 0x42, 0x4e, 0x4d, 0x3c, 0x3e, 0x3f }, - { 0x1d, 0x1f, 0x1c, 0x30, 0x2e, 0x20, 0x00, 0x00 } + { 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28 }, + { 0x29, 0x20, 0x3d, 0x5f, 0x08, 0x7f, 0x13, 0x7c }, + { 0x51, 0x57, 0x45, 0x52, 0x54, 0x59, 0x55, 0x49 }, + { 0x4f, 0x50, 0x60, 0x7b, 0x0d, 0x41, 0x53, 0x44 }, + { 0x46, 0x47, 0x48, 0x4a, 0x4b, 0x4c, 0x2b, 0x2a }, + { 0x7d, 0x5a, 0x58, 0x43, 0x56, 0x42, 0x4e, 0x4d }, + { 0x3c, 0x3e, 0x3f, 0x20, 0x1e, 0x1d, 0x1f, 0x1c }, }, /* graph on */ { - { 0x00, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97 }, - { 0x98, 0x99, 0x90, 0x1f, 0x9a, 0x88, 0xff, 0xad }, - { 0xb7, 0xb8, 0xb9, 0x89, 0x11, 0x17, 0x05, 0x12 }, - { 0x14, 0x19, 0x15, 0x09, 0x0f, 0x10, 0x1b, 0x1d }, - { 0x9b, 0xab, 0xb4, 0xb5, 0xb6, 0x01, 0x13, 0x04 }, - { 0x06, 0x07, 0x08, 0x0a, 0x0b, 0x0c, 0x7e, 0x60 }, - { 0x8d, 0x8a, 0x81, 0xb1, 0xb2, 0xb3, 0x1a, 0x18 }, - { 0x03, 0x16, 0x02, 0x0e, 0x0d, 0x1c, 0x7c, 0x5c }, - { 0x84, 0x82, 0x83, 0xb0, 0xae, 0x00, 0x00, 0x00 } + { 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88 }, + { 0x89, 0x30, 0xed, 0x8c, 0x08, 0x7f, 0x13, 0x8e }, + { 0x98, 0x9b, 0x99, 0xec, 0xeb, 0x9a, 0xe9, 0x90 }, + { 0x8d, 0xe0, 0xea, 0x5b, 0x0d, 0x91, 0x92, 0x93 }, + { 0x94, 0x95, 0x96, 0x97, 0xef, 0xf0, 0x3b, 0x3a }, + { 0x5d, 0xfa, 0xf8, 0xe3, 0xf6, 0xe2, 0xee, 0x8a }, + { 0x2c, 0x2e, 0x2f, 0x20, 0x1e, 0x1d, 0x1f, 0x1c }, }, /* graph on shifted*/ { - { 0x9e, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97 }, - { 0x98, 0x99, 0x90, 0x1f, 0x9a, 0x88, 0xff, 0xad }, - { 0xb7, 0xb8, 0xb9, 0x89, 0x11, 0x17, 0x05, 0x12 }, - { 0x14, 0x19, 0x15, 0x09, 0x0f, 0x10, 0x1b, 0x1d }, - { 0x9b, 0xab, 0xb4, 0xb5, 0xb6, 0x01, 0x13, 0x04 }, - { 0x06, 0x07, 0x08, 0x0a, 0x0b, 0x0c, 0x7e, 0x60 }, - { 0x8d, 0x8a, 0x81, 0xb1, 0xb2, 0xb3, 0x1a, 0x18 }, - { 0x03, 0x16, 0x02, 0x0e, 0x0d, 0x1c, 0x7c, 0x5c }, - { 0x84, 0x82, 0x83, 0xb0, 0xae, 0x00, 0x00, 0x00 } + { 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88 }, + { 0x89, 0x30, 0xed, 0x8c, 0x08, 0x7f, 0x13, 0x8e }, + { 0x9e, 0xff, 0x9f, 0x9c, 0x8f, 0x9a, 0xe9, 0xfe }, + { 0x9d, 0xfc, 0xea, 0x5b, 0x0d, 0xf1, 0xf7, 0xe5 }, + { 0xf2, 0xf4, 0xf9, 0xf5, 0xfb, 0xfd, 0x3b, 0x3a }, + { 0x5d, 0xe1, 0xf3, 0xe4, 0xe6, 0xe7, 0xe8, 0x8b }, + { 0x2c, 0x2e, 0x2f, 0x20, 0x1e, 0x1d, 0x1f, 0x1c }, + }, + /* kana on */ + { + { 0xc7, 0xcc, 0xb1, 0xb3, 0xaa, 0xab, 0xac, 0xad }, + { 0xae, 0xdc, 0xce, 0xcd, 0x08, 0x7f, 0x13, 0xb0 }, + { 0xc0, 0xc3, 0xb2, 0xbd, 0xb6, 0xdd, 0xc5, 0xc6 }, + { 0xd7, 0xbe, 0xde, 0xdf, 0x0d, 0xc1, 0xc4, 0xbc }, + { 0xca, 0xb7, 0xb8, 0xcf, 0xc9, 0xd8, 0xda, 0xb9 }, + { 0xd1, 0xaf, 0xbb, 0xbf, 0xcb, 0xba, 0xd0, 0xd3 }, + { 0xc8, 0xd9, 0xd2, 0x20, 0x1e, 0x1d, 0x1f, 0x1c }, + }, + + /* kana on shifted*/ + { + { 0xc7, 0xcc, 0xb1, 0xb3, 0xaa, 0xab, 0xac, 0xad }, + { 0xae, 0xa6, 0xce, 0xcd, 0x08, 0x7f, 0x13, 0xb0 }, + { 0xc0, 0xc3, 0xb2, 0xbd, 0xb6, 0xdd, 0xc5, 0xc6 }, + { 0xd7, 0xbe, 0xde, 0xa2, 0x0d, 0xc1, 0xc4, 0xbc }, + { 0xca, 0xb7, 0xb8, 0xcf, 0xc9, 0xd8, 0xda, 0xb9 }, + { 0xa3, 0xaf, 0xbb, 0xbf, 0xcb, 0xba, 0xd0, 0xd3 }, + { 0xa4, 0xa1, 0xa5, 0x20, 0x1e, 0x1d, 0x1f, 0x1c }, } }; -void jr200_state::video_start() -{ -} - uint32_t jr200_state::screen_update_jr200(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap.fill(m_border_col, cliprect); @@ -179,9 +209,7 @@ { for(int xi=0;xi<8;xi++) { - const uint8_t *gfx_data; - int pen; - + int pen = 0; if(attr & 0x80) //bitmap mode { /* @@ -194,18 +222,27 @@ 10xx x--- down-right 10-- -xxx down-left */ - int step; - - step = ((xi & 4) ? 3 : 0); - step+= ((yi & 4) ? 6 : 0); + u8 step = ((xi & 4) ? 3 : 0) + ((yi & 4) ? 6 : 0); pen = ((((attr & 0x3f) << 6) | (tile & 0x3f)) >> (step)) & 0x07; } else // tile mode { - gfx_data = (attr & 0x40) ? m_pcg->base() : m_gfx_ram->base(); - - pen = (gfx_data[(tile*8)+yi]>>(7-xi) & 1) ? (attr & 0x7) : ((attr & 0x38) >> 3); + pen = BIT(m_gfx_ram[(tile*8)+yi], 7-xi) ? (attr & 0x7) : BIT(attr, 3, 3); + if (BIT(attr, 6)) + { + if ((tile >= 0x20) && (tile < 0x40)) + { + tile &= 0x1f; + pen = BIT(m_pcg1[(tile*8)+yi], 7-xi) ? (attr & 0x7) : BIT(attr, 3, 3); + } + else + if ((tile >= 0x40) && (tile < 0x60)) + { + tile &= 0x1f; + pen = BIT(m_pcg2[(tile*8)+yi], 7-xi) ? (attr & 0x7) : BIT(attr, 3, 3); + } + } } bitmap.pix(y*8+yi+16, x*8+xi+16) = m_palette->pen(pen); @@ -217,40 +254,6 @@ return 0; } -uint8_t jr200_state::jr200_pcg_1_r(offs_t offset) -{ - return m_pcg->base()[offset+0x000]; -} - -uint8_t jr200_state::jr200_pcg_2_r(offs_t offset) -{ - return m_pcg->base()[offset+0x400]; -} - -void jr200_state::jr200_pcg_1_w(offs_t offset, uint8_t data) -{ - m_pcg->base()[offset+0x000] = data; - m_gfxdecode->gfx(1)->mark_dirty((offset+0x000) >> 3); -} - -void jr200_state::jr200_pcg_2_w(offs_t offset, uint8_t data) -{ - m_pcg->base()[offset+0x400] = data; - m_gfxdecode->gfx(1)->mark_dirty((offset+0x400) >> 3); -} - -uint8_t jr200_state::jr200_bios_char_r(offs_t offset) -{ - return m_gfx_ram->base()[offset]; -} - - -void jr200_state::jr200_bios_char_w(offs_t offset, uint8_t data) -{ - /* TODO: writing is presumably controlled by an I/O bit */ -// m_gfx_ram->base()[offset] = data; -// m_gfxdecode->gfx(0)->mark_dirty(offset >> 3); -} /* @@ -260,49 +263,68 @@ uint8_t jr200_state::mcu_keyb_r() { - int row, col, table = 0; - uint8_t keydata = 0; - - if (m_row9->read() & 0x07) - { - /* shift, upper case */ - table = 1; - } + if (m_port_ctr == 1) + return m_gfx_rom[m_port_cnt]; + if (m_port_ctr == 2) + return m_io_keyboard[10]->read(); + + u8 modifiers = m_io_keyboard[7]->read(); + u8 table = 0, keydata = 0; + u8 ret = 0; + // KANA + if (modifiers & 0x40) + table = 4; + // GRAPH + if (modifiers & 0x10) + table = 2; + // SHIFT + if (modifiers & 0x06) + table ++; /* scan keyboard */ - for (row = 0; row < 9; row++) + for (u8 row = 0; row < 7; row++) { - uint8_t data = 0xff; - - switch ( row ) - { - case 0: data = m_row0->read(); break; - case 1: data = m_row1->read(); break; - case 2: data = m_row2->read(); break; - case 3: data = m_row3->read(); break; - case 4: data = m_row4->read(); break; - case 5: data = m_row5->read(); break; - case 6: data = m_row6->read(); break; - case 7: data = m_row7->read(); break; - case 8: data = m_row8->read(); break; - } + uint8_t data = m_io_keyboard[row]->read(); - for (col = 0; col < 8; col++) + for (u8 col = 0; col < 8; col++) { if (!BIT(data, col)) { /* latch key data */ keydata = jr200_keycodes[table][row][col]; + // LOCK + if ((modifiers & 0x01) && ((keydata & 0xdf) > 0x40) && ((keydata & 0xdf) < 0x5b)) + keydata ^= 0x20; + // CTRL + if ((modifiers & 0x08) && (keydata > 0x40) && (keydata < 0x80)) + keydata &= 0x1f; } } } - if(m_old_keydata == keydata) - return 0x00; - - m_old_keydata = keydata; + // Autorepeat handler + // This might need to be done away with if games don't like it (should any be found) + if (keydata && (m_old_keydata == keydata)) + { + m_autorepeat++; + if (m_autorepeat == 2) // initial keypress + ret = keydata; + else + if (m_autorepeat == 0x330) // pause + { + ret = keydata; + m_autorepeat = 0x2e0; // repeat speed (pause - this) + } + } + else + if (m_old_keydata != keydata) + { + // new key or none + m_old_keydata = keydata; + m_autorepeat = 0; + } - return keydata; + return ret; } void jr200_state::jr200_beep_w(uint8_t data) @@ -313,13 +335,14 @@ void jr200_state::jr200_beep_freq_w(offs_t offset, uint8_t data) { - uint32_t beep_freq; - m_freq_reg[offset] = data; - beep_freq = ((m_freq_reg[0]<<8) | (m_freq_reg[1] & 0xff)) + 1; + u32 beep_freq = ((m_freq_reg[0]<<8) | (m_freq_reg[1] & 0xff)) + 1; - m_beeper->set_clock(84000 / beep_freq); + if (beep_freq) + m_beeper->set_clock(84000 / beep_freq); + else + m_beeper->set_clock(0); } void jr200_state::jr200_border_col_w(uint8_t data) @@ -333,11 +356,30 @@ m_maincpu->set_input_line(0, HOLD_LINE); } +// get data from chargen for bios to copy to D000-D7FF. +// After that, one more copy for the cassette dipswitch +void jr200_state::unknown_port_w(u8 data) +{ + if ((m_port_ctr == 0) && (data == 0x31)) + { + m_port_ctr++; + m_port_cnt = -1; + } + else + if ((m_port_ctr == 1) && (data == 0x73)) + { + m_port_cnt++; + if (m_port_cnt == 0x800) + m_port_ctr++; + } + else + if ((m_port_ctr == 2) && (data == 0x73)) + m_port_ctr++; +} + uint8_t jr200_state::mn1271_io_r(offs_t offset) { uint8_t retVal = m_mn1271_ram[offset]; - if((offset+0xc800) > 0xca00) - retVal= 0xff; switch(offset+0xc800) { @@ -350,7 +392,7 @@ case 0xc810: retVal= 0; break; case 0xc816: retVal= 0x4e; break; case 0xc81c: retVal= (m_mn1271_ram[0x1c] & 0xfe) | 1; break;//bit 0 needs to be high otherwise system refuses to boot - case 0xc81d: retVal= (m_mn1271_ram[0x1d] & 0xed); break; + case 0xc81d: retVal= (m_port_ctr == 3) ? (m_mn1271_ram[0x1d] & 0xed) : 1; break; } //logerror("mn1271_io_r [%04x] = %02x\n",offset+0xc800,retVal); return retVal; @@ -358,9 +400,10 @@ void jr200_state::mn1271_io_w(offs_t offset, uint8_t data) { - m_mn1271_ram[offset] = data; + m_mn1271_ram[offset] = data;//printf("%X=%X ",offset,data); switch(offset+0xc800) { + case 0xc803: unknown_port_w(data); break; case 0xc805: break; //LPT printer port W case 0xc816: if (data!=0) { m_timer_d->adjust(attotime::zero, 0, attotime::from_hz(XTAL(14'318'181)) * (m_mn1271_ram[0x17]*0x100 + m_mn1271_ram[0x18])); @@ -371,11 +414,10 @@ case 0xc819: jr200_beep_w(data); break; case 0xc81a: case 0xc81b: jr200_beep_freq_w(offset-0x1a,data); break; - case 0xca00: jr200_border_col_w(data); break; } } -void jr200_state::jr200_mem(address_map &map) +void jr200_state::mem_map(address_map &map) { /* 0000-3fff RAM @@ -383,20 +425,29 @@ 4000-7fff RAM (16k expansion) 4000-bfff RAM (32k expansion) */ + // 32K RAM map(0x0000, 0x7fff).ram(); - + // BASIC ROM map(0xa000, 0xbfff).rom(); - - map(0xc000, 0xc0ff).rw(FUNC(jr200_state::jr200_pcg_1_r), FUNC(jr200_state::jr200_pcg_1_w)); //PCG area (1) + // PCG 1 + map(0xc000, 0xc0ff).ram().share("pcg1"); + // Videoram map(0xc100, 0xc3ff).ram().share("vram"); - map(0xc400, 0xc4ff).rw(FUNC(jr200_state::jr200_pcg_2_r), FUNC(jr200_state::jr200_pcg_2_w)); //PCG area (2) + // PCG 2 + map(0xc400, 0xc4ff).ram().share("pcg2"); + // Attribute RAM map(0xc500, 0xc7ff).ram().share("cram"); - -// 0xc800 - 0xcfff I / O area - map(0xc800, 0xcfff).rw(FUNC(jr200_state::mn1271_io_r), FUNC(jr200_state::mn1271_io_w)).share("mn1271_ram"); - - map(0xd000, 0xd7ff).rw(FUNC(jr200_state::jr200_bios_char_r), FUNC(jr200_state::jr200_bios_char_w)); //BIOS PCG RAM area - map(0xd800, 0xdfff).rom(); // cart space (header 0x7e) + // MN1271 PIA/timer + map(0xc800, 0xc81f).mirror(0x01e0).rw(FUNC(jr200_state::mn1271_io_r), FUNC(jr200_state::mn1271_io_w)).share("mn1271_ram"); + // YLHSD61K201F (or HD61K201F) CRTC + map(0xca00, 0xcbff).w(FUNC(jr200_state::jr200_border_col_w)); + // External I/O area + map(0xcc00, 0xcfff); + // RAM-based normal characters + map(0xd000, 0xd7ff).ram().share("gfx_ram"); + // System extension (presumably via the External Bus Connector - there's no "cart" slot) + map(0xd800, 0xdfff).rom(); + // BIOS map(0xe000, 0xffff).rom(); } @@ -404,104 +455,107 @@ static INPUT_PORTS_START( jr200 ) // PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") - PORT_START("ROW0") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("HELP") PORT_CODE(KEYCODE_TILDE) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('@') - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('^') - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('&') - - PORT_START("ROW1") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('*') - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR('(') - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR(')') - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('_') - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('=') PORT_CHAR('+') - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("BACKSPACE") PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("DEL") PORT_CODE(KEYCODE_DEL) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad -") PORT_CODE(KEYCODE_MINUS_PAD) - - PORT_START("ROW2") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 7") PORT_CODE(KEYCODE_7_PAD) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 8") PORT_CODE(KEYCODE_8_PAD) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 9") PORT_CODE(KEYCODE_9_PAD) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("TAB") PORT_CODE(KEYCODE_TAB) PORT_CHAR('\t') - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q') - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W') - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E') - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R') - - PORT_START("ROW3") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T') - 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_U) PORT_CHAR('u') PORT_CHAR('U') - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I') - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O') - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P') - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CHAR('{') - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') PORT_CHAR('}') - - PORT_START("ROW4") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("ESC") PORT_CODE(KEYCODE_ESC) PORT_CHAR(UCHAR_MAMEKEY(ESC)) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad +") PORT_CODE(KEYCODE_PLUS_PAD) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 4") PORT_CODE(KEYCODE_4_PAD) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 5") PORT_CODE(KEYCODE_5_PAD) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 6") PORT_CODE(KEYCODE_6_PAD) + PORT_START("X0") + 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_2) PORT_CHAR('2') PORT_CHAR('"') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&') + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR(0x27) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(') + + PORT_START("X1") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')') + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CHAR('0') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('=') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('^') PORT_CHAR('_') + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("RUBOUT") PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("DEL") PORT_CODE(KEYCODE_DEL) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("INS") PORT_CODE(KEYCODE_INSERT) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("YEN") PORT_CODE(KEYCODE_HOME) PORT_CHAR(0x5c) PORT_CHAR(0x7c) + + PORT_START("X2") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q') + 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_E) PORT_CHAR('e') PORT_CHAR('E') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R') + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T') + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y') + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U') + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I') + + PORT_START("X3") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O') + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('@') PORT_CHAR(0x60) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR('[') PORT_CHAR('{') + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("RETURN") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A') PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S') PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D') - PORT_START("ROW5") + PORT_START("X4") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F') PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_CHAR('g') PORT_CHAR('G') 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_J) PORT_CHAR('j') PORT_CHAR('J') PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K') PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L') - 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_QUOTE) 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_QUOTE) PORT_CHAR(':') PORT_CHAR('*') - PORT_START("ROW6") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("RETURN") PORT_CODE(KEYCODE_ENTER) PORT_CHAR('\r') - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LINE FEED") PORT_CODE(KEYCODE_ENTER_PAD) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(UTF8_UP) PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP)) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 1") PORT_CODE(KEYCODE_1_PAD) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 2") PORT_CODE(KEYCODE_2_PAD) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 3") PORT_CODE(KEYCODE_3_PAD) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z') - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X') - - PORT_START("ROW7") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_CHAR('c') PORT_CHAR('C') - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V') - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) PORT_CHAR('b') PORT_CHAR('B') - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N') - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M') - 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_STOP) PORT_CHAR('.') PORT_CHAR('>') - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') - - PORT_START("ROW8") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(UTF8_LEFT) PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT)) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(UTF8_DOWN) PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN)) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(UTF8_RIGHT) PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 0") PORT_CODE(KEYCODE_0_PAD) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad .") PORT_CODE(KEYCODE_ASTERISK) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("SPACE") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_START("X5") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR(']') PORT_CHAR('}') + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X') + 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_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V') + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) PORT_CHAR('b') PORT_CHAR('B') + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N') + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M') + + PORT_START("X6") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("SPACE") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(UTF8_UP) PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP)) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(UTF8_LEFT) PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT)) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(UTF8_DOWN) PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN)) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(UTF8_RIGHT) PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) - PORT_START("ROW9") + PORT_START("X7") + // This key does not exist, it's for our convenience only PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("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_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("LEFT CTRL") PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_MAMEKEY(LCONTROL)) - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("RIGHT CTRL") PORT_CODE(KEYCODE_RCONTROL) PORT_CHAR(UCHAR_MAMEKEY(RCONTROL)) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("CTRL") PORT_CODE(KEYCODE_LCONTROL) + // on JR200U there's GRAPH ON and GRAPH OFF keys + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("GRAPH") PORT_CODE(KEYCODE_RCONTROL) + // Kana is on JR200 only + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("KANA OFF") PORT_CODE(KEYCODE_LALT) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("KANA ON") PORT_CODE(KEYCODE_RALT) + // This key does a soft reset, so needs a proper NMI handler + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("BREAK") PORT_CODE(KEYCODE_PGDN) PORT_CHANGED_MEMBER(DEVICE_SELF, jr200_state, nmi_button, 0) + + PORT_START("X8") + PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) // reserved for Joystick 1 + + PORT_START("X9") + PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) // reserved for Joystick 2 + + PORT_START("X10") + PORT_DIPNAME( 0x01, 0x00, "Cassette Baud") // mounted on the underside of the unit + PORT_DIPSETTING( 0x00, "2400") + PORT_DIPSETTING( 0x01, "600") INPUT_PORTS_END +INPUT_CHANGED_MEMBER(jr200_state::nmi_button) +{ + m_maincpu->set_input_line(INPUT_LINE_NMI, newval ? ASSERT_LINE : CLEAR_LINE); +} + static const gfx_layout tiles8x8_layout = { 8,8, @@ -514,27 +568,29 @@ }; static GFXDECODE_START( gfx_jr200 ) - GFXDECODE_ENTRY( "gfx_ram", 0, tiles8x8_layout, 0, 1 ) - GFXDECODE_ENTRY( "pcg", 0, tiles8x8_layout, 0, 1 ) + GFXDECODE_RAM( "gfx_ram", 0, tiles8x8_layout, 0, 1 ) + GFXDECODE_RAM( "pcg1", 0, tiles8x8_layout, 0, 1 ) + GFXDECODE_RAM( "pcg2", 0, tiles8x8_layout, 0, 1 ) GFXDECODE_END void jr200_state::machine_start() { m_timer_d = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(jr200_state::timer_d_callback),this)); + save_item(NAME(m_border_col)); + save_item(NAME(m_old_keydata)); + save_item(NAME(m_freq_reg)); + save_item(NAME(m_autorepeat)); + save_item(NAME(m_port_ctr)); + save_item(NAME(m_port_cnt)); } void jr200_state::machine_reset() { - uint8_t *gfx_rom = m_gfx_rom->base(); - uint8_t *gfx_ram = m_gfx_ram->base(); - int i; - memset(m_mn1271_ram,0,0x800); - - for(i=0;i<0x800;i++) - gfx_ram[i] = gfx_rom[i]; - - for(i=0;i<0x800;i+=8) - m_gfxdecode->gfx(0)->mark_dirty(i >> 3); + m_autorepeat = 0; + m_old_keydata = 0; + m_port_ctr = 0; + m_port_cnt = 0; + memset(m_mn1271_ram,0,0x20); } @@ -542,7 +598,7 @@ { /* basic machine hardware */ M6808(config, m_maincpu, XTAL(14'318'181) / 4); /* MN1800A, ? MHz assumption that it is same as JR-100*/ - m_maincpu->set_addrmap(AS_PROGRAM, &jr200_state::jr200_mem); + m_maincpu->set_addrmap(AS_PROGRAM, &jr200_state::mem_map); // MN1544(config, "mn1544", ?); @@ -560,7 +616,7 @@ SPEAKER(config, "mono").front_center(); - // AY-8910 ? + // All sounds are produced by the MN1271 BEEP(config, m_beeper, 0).add_route(ALL_OUTPUTS,"mono",0.50); } @@ -578,10 +634,6 @@ ROM_REGION( 0x0800, "gfx_rom", ROMREGION_ERASEFF ) ROM_LOAD( "char.rom", 0x0000, 0x0800, CRC(cb641624) SHA1(6fe890757ebc65bbde67227f9c7c490d8edd84f2) ) - - ROM_REGION( 0x0800, "gfx_ram", ROMREGION_ERASEFF ) - - ROM_REGION( 0x0800, "pcg", ROMREGION_ERASEFF ) ROM_END ROM_START( jr200u ) @@ -594,10 +646,6 @@ ROM_REGION( 0x0800, "gfx_rom", ROMREGION_ERASEFF ) ROM_LOAD( "char.rom", 0x0000, 0x0800, CRC(cb641624) SHA1(6fe890757ebc65bbde67227f9c7c490d8edd84f2) ) - - ROM_REGION( 0x0800, "gfx_ram", ROMREGION_ERASEFF ) - - ROM_REGION( 0x0800, "pcg", ROMREGION_ERASEFF ) ROM_END /* Driver */ diff -Nru mame-0.242+dfsg.1/src/mame/drivers/jupiter.cpp mame-0.243+dfsg.1/src/mame/drivers/jupiter.cpp --- mame-0.242+dfsg.1/src/mame/drivers/jupiter.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/jupiter.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Wilbert Pol, Robbbert +// copyright-holders:Wilbert Pol /************************************************************************** Wave Mate Jupiter diff -Nru mame-0.242+dfsg.1/src/mame/drivers/jvh.cpp mame-0.243+dfsg.1/src/mame/drivers/jvh.cpp --- mame-0.242+dfsg.1/src/mame/drivers/jvh.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/jvh.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -247,7 +247,7 @@ } // Anonymous namespace -GAME( 1986, icemania, 0, jvh, jvh, jvh_state, empty_init, ROT0, "Jac Van Ham (Royal)", "Ice Mania", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1987, escape, 0, jvh, jvh, jvh_state, empty_init, ROT0, "Jac Van Ham (Royal)", "Escape", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 19??, movmastr, 0, jvh2, jvh, jvh_state, empty_init, ROT0, "Jac Van Ham (Royal)", "Movie Masters", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1988, formula1, 0, jvh3, jvh, jvh_state, empty_init, ROT0, "Jac Van Ham (Royal)", "Formula 1", MACHINE_IS_SKELETON_MECHANICAL ) +GAME( 1986, icemania, 0, jvh, jvh, jvh_state, empty_init, ROT0, "Jac Van Ham (Royal)", "Ice Mania", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1987, escape, 0, jvh, jvh, jvh_state, empty_init, ROT0, "Jac Van Ham (Royal)", "Escape", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 19??, movmastr, 0, jvh2, jvh, jvh_state, empty_init, ROT0, "Jac Van Ham (Royal)", "Movie Masters", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1988, formula1, 0, jvh3, jvh, jvh_state, empty_init, ROT0, "Jac Van Ham (Royal)", "Formula 1", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/kangaroo.cpp mame-0.243+dfsg.1/src/mame/drivers/kangaroo.cpp --- mame-0.242+dfsg.1/src/mame/drivers/kangaroo.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/kangaroo.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -156,59 +156,292 @@ ***************************************************************************/ #include "emu.h" -#include "includes/kangaroo.h" #include "cpu/mb88xx/mb88xx.h" #include "cpu/z80/z80.h" #include "machine/gen_latch.h" #include "sound/ay8910.h" + +#include "emupal.h" #include "screen.h" #include "speaker.h" -#define MASTER_CLOCK (10_MHz_XTAL) +namespace { + +class kangaroo_state : public driver_device +{ +public: + kangaroo_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag), + m_video_control(*this, "video_control"), + m_videoram(*this, "videoram", 256 * 64 * 4, ENDIANNESS_LITTLE), // video RAM is accessed 32 bits at a time (two planes, 4bpp each, 4 pixels) + m_blitbank(*this, "blitbank"), + m_blitrom(*this, "blitter"), + m_maincpu(*this, "maincpu"), + m_palette(*this, "palette") { } + + void nomcu(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + + void main_map(address_map &map); + +private: + // memory pointers + required_shared_ptr m_video_control; + memory_share_creator m_videoram; + required_memory_bank m_blitbank; + required_region_ptr m_blitrom; + + // devices + required_device m_maincpu; + required_device m_palette; + + // misc + void coin_counter_w(uint8_t data); + void videoram_w(offs_t offset, uint8_t data); + void video_control_w(offs_t offset, uint8_t data); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + void videoram_write(uint16_t offset, uint8_t data, uint8_t mask); + void blitter_execute(); + + void sound_map(address_map &map); + void sound_portmap(address_map &map); +}; + + +class kangaroo_mcu_state : public kangaroo_state +{ +public: + kangaroo_mcu_state(const machine_config &mconfig, device_type type, const char *tag) + : kangaroo_state(mconfig, type, tag) { } + + void mcu(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + +private: + // MCU simulation (for now) + uint8_t m_mcu_clock = 0U; + + uint8_t mcu_sim_r(); + void mcu_sim_w(uint8_t data); + + void main_map(address_map &map); +}; + + +// video + +/************************************* + * + * Video RAM accesses + * + *************************************/ + +void kangaroo_state::videoram_write(uint16_t offset, uint8_t data, uint8_t mask) +{ + // data contains 4 2-bit values packed as DCBADCBA; expand these into 4 8-bit values + uint32_t expdata = 0; + if (data & 0x01) expdata |= 0x00000055; + if (data & 0x10) expdata |= 0x000000aa; + if (data & 0x02) expdata |= 0x00005500; + if (data & 0x20) expdata |= 0x0000aa00; + if (data & 0x04) expdata |= 0x00550000; + if (data & 0x40) expdata |= 0x00aa0000; + if (data & 0x08) expdata |= 0x55000000; + if (data & 0x80) expdata |= 0xaa000000; + + // determine which layers are enabled + uint32_t layermask = 0; + if (mask & 0x08) layermask |= 0x30303030; + if (mask & 0x04) layermask |= 0xc0c0c0c0; + if (mask & 0x02) layermask |= 0x03030303; + if (mask & 0x01) layermask |= 0x0c0c0c0c; + + // update layers + m_videoram[offset] = (m_videoram[offset] & ~layermask) | (expdata & layermask); +} + + +void kangaroo_state::videoram_w(offs_t offset, uint8_t data) +{ + videoram_write(offset, data, m_video_control[8]); +} /************************************* * + * Video control writes + * + *************************************/ + +void kangaroo_state::video_control_w(offs_t offset, uint8_t data) +{ + m_video_control[offset] = data; + + switch (offset) + { + case 5: // blitter start + blitter_execute(); + break; + + case 8: // bank select + m_blitbank->set_entry((data & 0x05) ? 0 : 1); + break; + } +} + + + +/************************************* + * + * DMA blitter + * + *************************************/ + +void kangaroo_state::blitter_execute() +{ + uint32_t gfxhalfsize = m_blitrom.bytes() / 2; + uint16_t src = m_video_control[0] + 256 * m_video_control[1]; + uint16_t dst = m_video_control[2] + 256 * m_video_control[3]; + uint8_t height = m_video_control[5]; + uint8_t width = m_video_control[4]; + uint8_t mask = m_video_control[8]; + + // during DMA operations, the top 2 bits are ORed together, as well as the bottom 2 bits + // adjust the mask to account for this + if (mask & 0x0c) mask |= 0x0c; + if (mask & 0x03) mask |= 0x03; + + // loop over height, then width + for (int y = 0; y <= height; y++, dst += 256) + for (int x = 0; x <= width; x++) + { + uint16_t effdst = (dst + x) & 0x3fff; + uint16_t effsrc = src++ & (gfxhalfsize - 1); + videoram_write(effdst, m_blitrom[0 * gfxhalfsize + effsrc], mask & 0x05); + videoram_write(effdst, m_blitrom[1 * gfxhalfsize + effsrc], mask & 0x0a); + } +} + + + +/************************************* + * + * Video updater + * + *************************************/ + +uint32_t kangaroo_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ + uint8_t scrolly = m_video_control[6]; + uint8_t scrollx = m_video_control[7]; + uint8_t maska = (m_video_control[10] & 0x28) >> 3; + uint8_t maskb = (m_video_control[10] & 0x07) >> 0; + uint8_t xora = (m_video_control[9] & 0x20) ? 0xff : 0x00; + uint8_t xorb = (m_video_control[9] & 0x10) ? 0xff : 0x00; + uint8_t enaa = (m_video_control[9] & 0x08); + uint8_t enab = (m_video_control[9] & 0x04); + uint8_t pria = (~m_video_control[9] & 0x02); + uint8_t prib = (~m_video_control[9] & 0x01); + + // iterate over pixels + for (int y = cliprect.min_y; y <= cliprect.max_y; y++) + { + uint32_t *const dest = &bitmap.pix(y); + + for (int x = cliprect.min_x; x <= cliprect.max_x; x += 2) + { + uint8_t effxa = scrollx + ((x / 2) ^ xora); + uint8_t effya = scrolly + (y ^ xora); + uint8_t effxb = (x / 2) ^ xorb; + uint8_t effyb = y ^ xorb; + uint8_t pixa = (m_videoram[effya + 256 * (effxa / 4)] >> (8 * (effxa % 4) + 0)) & 0x0f; + uint8_t pixb = (m_videoram[effyb + 256 * (effxb / 4)] >> (8 * (effxb % 4) + 4)) & 0x0f; + + // for each layer, contribute bits if (a) enabled, and (b) either has priority or the opposite plane is 0 + uint8_t finalpens = 0; + if (enaa && (pria || pixb == 0)) + finalpens |= pixa; + if (enab && (prib || pixa == 0)) + finalpens |= pixb; + + // store the first of two pixels, which is always full brightness + dest[x + 0] = m_palette->pen_color(finalpens & 7); + + // KOS1 alternates at 5MHz, offset from the pixel clock by 1/2 clock + // when 0, it enables the color mask for pixels with Z = 0 + finalpens = 0; + if (enaa && (pria || pixb == 0)) + { + if (!(pixa & 0x08)) pixa &= maska; + finalpens |= pixa; + } + if (enab && (prib || pixa == 0)) + { + if (!(pixb & 0x08)) pixb &= maskb; + finalpens |= pixb; + } + + // store the second of two pixels, which is affected by KOS1 and the A/B masks + dest[x + 1] = m_palette->pen_color(finalpens & 7); + } + } + + return 0; +} + +// machine + +/************************************* + * * Machine init * *************************************/ void kangaroo_state::machine_start() { - membank("bank1")->configure_entries(0, 2, memregion("gfx1")->base(), 0x2000); + m_blitbank->configure_entries(0, 2, memregion("blitter")->base(), 0x2000); } -MACHINE_START_MEMBER(kangaroo_state,kangaroo_mcu) +void kangaroo_mcu_state::machine_start() { kangaroo_state::machine_start(); - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xef00, 0xefff, read8smo_delegate(*this, FUNC(kangaroo_state::mcu_sim_r)), write8smo_delegate(*this, FUNC(kangaroo_state::mcu_sim_w))); + save_item(NAME(m_mcu_clock)); } void kangaroo_state::machine_reset() { - /* I think there is a bug in the startup checks of the game. At the very */ - /* beginning, during the RAM check, it goes one byte too far, and ends up */ - /* trying to write, and re-read, location dfff. To the best of my knowledge, */ - /* that is a ROM address, so the test fails and the code keeps jumping back */ - /* at 0000. */ - /* However, a NMI causes a successful reset. Maybe the hardware generates a */ - /* NMI short after power on, therefore masking the bug? The NMI is generated */ - /* by the MB8841 custom microcontroller, so this could be a way to disguise */ - /* the copy protection. */ - /* Anyway, what I do here is just immediately generate the NMI, so the game */ - /* properly starts. */ + /* I think there is a bug in the startup checks of the game. At the very + beginning, during the RAM check, it goes one byte too far, and ends up + trying to write, and re-read, location dfff. To the best of my knowledge, + that is a ROM address, so the test fails and the code keeps jumping back + at 0000. + However, a NMI causes a successful reset. Maybe the hardware generates a + NMI short after power on, therefore masking the bug? The NMI is generated + by the MB8841 custom microcontroller, so this could be a way to disguise + the copy protection. + Anyway, what I do here is just immediately generate the NMI, so the game + properly starts. */ m_maincpu->pulse_input_line(INPUT_LINE_NMI, attotime::zero); - - m_mcu_clock = 0; } +void kangaroo_mcu_state::machine_reset() +{ + kangaroo_state::machine_reset(); + m_mcu_clock = 0; +} /************************************* * @@ -216,16 +449,14 @@ * *************************************/ -/* The security chip is a MB8841 with 2K internal rom. Currently it's unknown what it really does, - this just seems to do the trick -V- -*/ +// The security chip is a MB8841 with 2K internal ROM. Currently it's unknown what it really does, this just seems to do the trick -V- -uint8_t kangaroo_state::mcu_sim_r() +uint8_t kangaroo_mcu_state::mcu_sim_r() { return ++m_mcu_clock & 0x0f; } -void kangaroo_state::mcu_sim_w(uint8_t data) +void kangaroo_mcu_state::mcu_sim_w(uint8_t data) { } @@ -237,7 +468,7 @@ * *************************************/ -void kangaroo_state::kangaroo_coin_counter_w(uint8_t data) +void kangaroo_state::coin_counter_w(uint8_t data) { machine().bookkeeping().coin_counter_w(0, data & 1); machine().bookkeeping().coin_counter_w(1, data & 2); @@ -254,16 +485,22 @@ void kangaroo_state::main_map(address_map &map) { map(0x0000, 0x5fff).rom(); - map(0x8000, 0xbfff).w(FUNC(kangaroo_state::kangaroo_videoram_w)); - map(0xc000, 0xdfff).bankr("bank1"); + map(0x8000, 0xbfff).w(FUNC(kangaroo_state::videoram_w)); + map(0xc000, 0xdfff).bankr(m_blitbank); map(0xe000, 0xe3ff).ram(); map(0xe400, 0xe400).mirror(0x03ff).portr("DSW0"); - map(0xe800, 0xe80a).mirror(0x03f0).w(FUNC(kangaroo_state::kangaroo_video_control_w)).share("video_control"); + map(0xe800, 0xe80a).mirror(0x03f0).w(FUNC(kangaroo_state::video_control_w)).share(m_video_control); map(0xec00, 0xec00).mirror(0x00ff).portr("IN0").w("soundlatch", FUNC(generic_latch_8_device::write)); - map(0xed00, 0xed00).mirror(0x00ff).portr("IN1").w(FUNC(kangaroo_state::kangaroo_coin_counter_w)); + map(0xed00, 0xed00).mirror(0x00ff).portr("IN1").w(FUNC(kangaroo_state::coin_counter_w)); map(0xee00, 0xee00).mirror(0x00ff).portr("IN2"); } +void kangaroo_mcu_state::main_map(address_map &map) +{ + kangaroo_state::main_map(map); + + map(0xef00, 0xefff).rw(FUNC(kangaroo_mcu_state::mcu_sim_r), FUNC(kangaroo_mcu_state::mcu_sim_w)); +} /************************************* @@ -406,7 +643,7 @@ PORT_DIPSETTING( 0xb0, "A 1C/2C B 1C/10C" ) PORT_DIPSETTING( 0xc0, "A 1C/2C B 1C/11C" ) PORT_DIPSETTING( 0xd0, "A 1C/2C B 1C/12C" ) - /* 0xe0 gives A 1/2 B 1/6 */ + // 0xe0 gives A 1/2 B 1/6 PORT_DIPSETTING( 0xf0, DEF_STR( Free_Play ) ) INPUT_PORTS_END @@ -418,43 +655,45 @@ * *************************************/ +static constexpr XTAL MASTER_CLOCK = 10_MHz_XTAL; + void kangaroo_state::nomcu(machine_config &config) { - /* basic machine hardware */ - Z80(config, m_maincpu, MASTER_CLOCK/4); + // basic machine hardware + Z80(config, m_maincpu, MASTER_CLOCK / 4); m_maincpu->set_addrmap(AS_PROGRAM, &kangaroo_state::main_map); m_maincpu->set_vblank_int("screen", FUNC(kangaroo_state::irq0_line_hold)); - z80_device &audiocpu(Z80(config, "audiocpu", MASTER_CLOCK/8)); + z80_device &audiocpu(Z80(config, "audiocpu", MASTER_CLOCK / 8)); audiocpu.set_addrmap(AS_PROGRAM, &kangaroo_state::sound_map); audiocpu.set_addrmap(AS_IO, &kangaroo_state::sound_map); // yes, this is identical audiocpu.set_vblank_int("screen", FUNC(kangaroo_state::irq0_line_hold)); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_video_attributes(VIDEO_UPDATE_SCANLINE); screen.set_raw(MASTER_CLOCK, 320*2, 0*2, 256*2, 260, 8, 248); - screen.set_screen_update(FUNC(kangaroo_state::screen_update_kangaroo)); + screen.set_screen_update(FUNC(kangaroo_state::screen_update)); PALETTE(config, m_palette, palette_device::BGR_3BIT); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); GENERIC_LATCH_8(config, "soundlatch"); - AY8910(config, "aysnd", MASTER_CLOCK/8).add_route(ALL_OUTPUTS, "mono", 0.50); + AY8910(config, "aysnd", MASTER_CLOCK / 8).add_route(ALL_OUTPUTS, "mono", 0.50); } -void kangaroo_state::mcu(machine_config &config) +void kangaroo_mcu_state::mcu(machine_config &config) { nomcu(config); - MCFG_MACHINE_START_OVERRIDE(kangaroo_state,kangaroo_mcu) + subdevice("maincpu")->set_addrmap(AS_PROGRAM, &kangaroo_mcu_state::main_map); - MB8841(config, "mcu", MASTER_CLOCK/4/2).set_disable(); + MB8841(config, "mcu", MASTER_CLOCK / 4 / 2).set_disable(); // not dumped } @@ -466,17 +705,17 @@ *************************************/ ROM_START( fnkyfish ) - ROM_REGION( 0x14000, "maincpu", 0 ) + ROM_REGION( 0x6000, "maincpu", 0 ) ROM_LOAD( "tvg_64.0", 0x0000, 0x1000, CRC(af728803) SHA1(1cbbf863f0eb4c759d6037ef9d9d0f4586b7b570) ) ROM_LOAD( "tvg_65.1", 0x1000, 0x1000, CRC(71959e6b) SHA1(7336cbf3eefd081cd657a56fb6a8fbdac1b51c2c) ) ROM_LOAD( "tvg_66.2", 0x2000, 0x1000, CRC(5ccf68d4) SHA1(c885df8b2b1bcb578ceab6615caf633dac02a5b2) ) ROM_LOAD( "tvg_67.3", 0x3000, 0x1000, CRC(938ff36f) SHA1(bf660217ff82d5850ab97238ed2e32199d04f8c9) ) - ROM_REGION( 0x10000, "audiocpu", 0 ) + ROM_REGION( 0x1000, "audiocpu", 0 ) ROM_LOAD( "tvg_68.8", 0x0000, 0x1000, CRC(d36bb2be) SHA1(330160161857407fda62f16e7f43b8833744fd34) ) - ROM_REGION( 0x4000, "gfx1", 0 ) - ROM_LOAD( "tvg_69.v0", 0x0000, 0x1000, CRC(cd532d0b) SHA1(7a64f8bab1a0feafd53a4b81ac3b624a7c1bd26a) ) /* graphics ROMs */ + ROM_REGION( 0x4000, "blitter", 0 ) + ROM_LOAD( "tvg_69.v0", 0x0000, 0x1000, CRC(cd532d0b) SHA1(7a64f8bab1a0feafd53a4b81ac3b624a7c1bd26a) ) ROM_LOAD( "tvg_71.v2", 0x1000, 0x1000, CRC(a59c9713) SHA1(60dafa3d5a70b7e727b7c4688f8f3125735c31ec) ) ROM_LOAD( "tvg_70.v1", 0x2000, 0x1000, CRC(fd308ef1) SHA1(d07f964cab875b0e47f3469fa5211684a5725dfe) ) ROM_LOAD( "tvg_72.v3", 0x3000, 0x1000, CRC(6ae9b584) SHA1(408d26f4cdcd2abf0667fdc9c6eae58c9052981d) ) @@ -484,33 +723,33 @@ ROM_START( kangaroo ) - ROM_REGION( 0x14000, "maincpu", 0 ) /* On TVG-1-CPU-B board */ - ROM_LOAD( "tvg_75.0", 0x0000, 0x1000, CRC(0d18c581) SHA1(0e0f89d644b79e887c53e5294783843ca7e875ba) ) /* IC7 */ - ROM_LOAD( "tvg_76.1", 0x1000, 0x1000, CRC(5978d37a) SHA1(684c1092de4a0927a03752903c86c3bbe99e868a) ) /* IC8 */ - ROM_LOAD( "tvg_77.2", 0x2000, 0x1000, CRC(522d1097) SHA1(09fe627a46d32df2e098d9fad7757f9d61bef41f) ) /* IC9 */ - ROM_LOAD( "tvg_78.3", 0x3000, 0x1000, CRC(063da970) SHA1(582ff21dd46c651f07a4846e0f8a7544a5891988) ) /* IC10 */ - ROM_LOAD( "tvg_79.4", 0x4000, 0x1000, CRC(9e5cf8ca) SHA1(015387f038c5670f88c9b22453d074bd9b2a129d) ) /* IC16 */ - ROM_LOAD( "tvg_80.5", 0x5000, 0x1000, CRC(2fc18049) SHA1(31fcac8eb660739a1672346136a1581a5ef20325) ) /* IC17 */ + ROM_REGION( 0x6000, "maincpu", 0 ) // On TVG-1-CPU-B board + ROM_LOAD( "tvg_75.0", 0x0000, 0x1000, CRC(0d18c581) SHA1(0e0f89d644b79e887c53e5294783843ca7e875ba) ) // IC7 + ROM_LOAD( "tvg_76.1", 0x1000, 0x1000, CRC(5978d37a) SHA1(684c1092de4a0927a03752903c86c3bbe99e868a) ) // IC8 + ROM_LOAD( "tvg_77.2", 0x2000, 0x1000, CRC(522d1097) SHA1(09fe627a46d32df2e098d9fad7757f9d61bef41f) ) // IC9 + ROM_LOAD( "tvg_78.3", 0x3000, 0x1000, CRC(063da970) SHA1(582ff21dd46c651f07a4846e0f8a7544a5891988) ) // IC10 + ROM_LOAD( "tvg_79.4", 0x4000, 0x1000, CRC(9e5cf8ca) SHA1(015387f038c5670f88c9b22453d074bd9b2a129d) ) // IC16 + ROM_LOAD( "tvg_80.5", 0x5000, 0x1000, CRC(2fc18049) SHA1(31fcac8eb660739a1672346136a1581a5ef20325) ) // IC17 - ROM_REGION( 0x10000, "audiocpu", 0 ) /* On TVG-1-CPU-B board */ - ROM_LOAD( "tvg_81.8", 0x0000, 0x1000, CRC(fb449bfd) SHA1(f593a0339f47e121736a927587132aeb52704557) ) /* IC24 */ + ROM_REGION( 0x1000, "audiocpu", 0 ) // On TVG-1-CPU-B board + ROM_LOAD( "tvg_81.8", 0x0000, 0x1000, CRC(fb449bfd) SHA1(f593a0339f47e121736a927587132aeb52704557) ) // IC24 - ROM_REGION( 0x0800, "mcu", 0 ) /* internal ROM from the 8841 custom MCU */ + ROM_REGION( 0x0800, "mcu", 0 ) // internal ROM from the 8841 custom MCU ROM_LOAD( "mb8841.ic29", 0x0000, 0x0800, NO_DUMP ) - ROM_REGION( 0x0800, "user1", 0 ) /* data for the 8841 custom MCU */ - ROM_LOAD( "tvg_82.12", 0x0000, 0x0800, CRC(57766f69) SHA1(94a7a557d8325799523d5e1a88653a9a3fbe34f9) ) /* IC28 */ + ROM_REGION( 0x0800, "user1", 0 ) // data for the 8841 custom MCU + ROM_LOAD( "tvg_82.12", 0x0000, 0x0800, CRC(57766f69) SHA1(94a7a557d8325799523d5e1a88653a9a3fbe34f9) ) // IC28 - ROM_REGION( 0x4000, "gfx1", 0 ) /* On TVG-1-VIDEO-B board */ - ROM_LOAD( "tvg_83.v0", 0x0000, 0x1000, CRC(c0446ca6) SHA1(fca6ba565051337c0198c93b7b8477632e0dd0b6) ) /* IC76 */ - ROM_LOAD( "tvg_85.v2", 0x1000, 0x1000, CRC(72c52695) SHA1(87f4715fbb7d509bd9cc4e71e2afb0d475bbac13) ) /* IC77 */ - ROM_LOAD( "tvg_84.v1", 0x2000, 0x1000, CRC(e4cb26c2) SHA1(5016db9d48fdcfb757618659d063b90862eb0e90) ) /* IC52 */ - ROM_LOAD( "tvg_86.v3", 0x3000, 0x1000, CRC(9e6a599f) SHA1(76b4eddb4efcd8189d8cc5962d8497e82885f212) ) /* IC53 */ + ROM_REGION( 0x4000, "blitter", 0 ) // On TVG-1-VIDEO-B board + ROM_LOAD( "tvg_83.v0", 0x0000, 0x1000, CRC(c0446ca6) SHA1(fca6ba565051337c0198c93b7b8477632e0dd0b6) ) // IC76 + ROM_LOAD( "tvg_85.v2", 0x1000, 0x1000, CRC(72c52695) SHA1(87f4715fbb7d509bd9cc4e71e2afb0d475bbac13) ) // IC77 + ROM_LOAD( "tvg_84.v1", 0x2000, 0x1000, CRC(e4cb26c2) SHA1(5016db9d48fdcfb757618659d063b90862eb0e90) ) // IC52 + ROM_LOAD( "tvg_86.v3", 0x3000, 0x1000, CRC(9e6a599f) SHA1(76b4eddb4efcd8189d8cc5962d8497e82885f212) ) // IC53 ROM_END ROM_START( kangarooa ) - ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_REGION( 0x6000, "maincpu", 0 ) ROM_LOAD( "136008-101.ic7", 0x0000, 0x1000, CRC(0d18c581) SHA1(0e0f89d644b79e887c53e5294783843ca7e875ba) ) ROM_LOAD( "136008-102.ic8", 0x1000, 0x1000, CRC(5978d37a) SHA1(684c1092de4a0927a03752903c86c3bbe99e868a) ) ROM_LOAD( "136008-103.ic9", 0x2000, 0x1000, CRC(522d1097) SHA1(09fe627a46d32df2e098d9fad7757f9d61bef41f) ) @@ -518,16 +757,16 @@ ROM_LOAD( "136008-105.ic16", 0x4000, 0x1000, CRC(82a26c7d) SHA1(09087552dbe4d27df79396072c0f9b916f78f89b) ) ROM_LOAD( "136008-106.ic17", 0x5000, 0x1000, CRC(3dead542) SHA1(0b5d329b1ebbacc650d06289b4e080304e728ea7) ) - ROM_REGION( 0x10000, "audiocpu", 0 ) + ROM_REGION( 0x1000, "audiocpu", 0 ) ROM_LOAD( "136008-107.ic24", 0x0000, 0x1000, CRC(fb449bfd) SHA1(f593a0339f47e121736a927587132aeb52704557) ) - ROM_REGION( 0x0800, "mcu", 0 ) /* internal ROM from the 8841 custom MCU */ + ROM_REGION( 0x0800, "mcu", 0 ) // internal ROM from the 8841 custom MCU ROM_LOAD( "mb8841.ic29", 0x0000, 0x0800, NO_DUMP ) - ROM_REGION( 0x0800, "user1", 0 ) /* data for the 8841 custom MCU */ + ROM_REGION( 0x0800, "user1", 0 ) // data for the 8841 custom MCU ROM_LOAD( "136008-112.ic28", 0x0000, 0x0800, CRC(57766f69) SHA1(94a7a557d8325799523d5e1a88653a9a3fbe34f9) ) - ROM_REGION( 0x4000, "gfx1", 0 ) + ROM_REGION( 0x4000, "blitter", 0 ) ROM_LOAD( "136008-108.ic76", 0x0000, 0x1000, CRC(c0446ca6) SHA1(fca6ba565051337c0198c93b7b8477632e0dd0b6) ) ROM_LOAD( "136008-110.ic77", 0x1000, 0x1000, CRC(72c52695) SHA1(87f4715fbb7d509bd9cc4e71e2afb0d475bbac13) ) ROM_LOAD( "136008-109.ic52", 0x2000, 0x1000, CRC(e4cb26c2) SHA1(5016db9d48fdcfb757618659d063b90862eb0e90) ) @@ -536,7 +775,7 @@ ROM_START( kangaroob ) - ROM_REGION( 0x14000, "maincpu", 0 ) + ROM_REGION( 0x6000, "maincpu", 0 ) ROM_LOAD( "k1.ic7", 0x0000, 0x1000, CRC(0d18c581) SHA1(0e0f89d644b79e887c53e5294783843ca7e875ba) ) ROM_LOAD( "k2.ic8", 0x1000, 0x1000, CRC(5978d37a) SHA1(684c1092de4a0927a03752903c86c3bbe99e868a) ) ROM_LOAD( "k3.ic9", 0x2000, 0x1000, CRC(522d1097) SHA1(09fe627a46d32df2e098d9fad7757f9d61bef41f) ) @@ -549,7 +788,7 @@ // MB8841 at IC29 and 2716 at IC28 not populated - ROM_REGION( 0x4000, "gfx1", 0 ) + ROM_REGION( 0x4000, "blitter", 0 ) ROM_LOAD( "k10.ic76", 0x0000, 0x1000, CRC(c0446ca6) SHA1(fca6ba565051337c0198c93b7b8477632e0dd0b6) ) ROM_LOAD( "k11.ic77", 0x1000, 0x1000, CRC(72c52695) SHA1(87f4715fbb7d509bd9cc4e71e2afb0d475bbac13) ) ROM_LOAD( "k8.ic52", 0x2000, 0x1000, CRC(e4cb26c2) SHA1(5016db9d48fdcfb757618659d063b90862eb0e90) ) @@ -558,7 +797,7 @@ ROM_START( kangarool ) // runs on earlier revision TVG-1-CPU-A + TVG-1-VIDEO-A PCBs - ROM_REGION( 0x14000, "maincpu", 0 ) // only ic17 differs from the parent + ROM_REGION( 0x6000, "maincpu", 0 ) // only ic17 differs from the parent ROM_LOAD( "tvg_75.ic7", 0x0000, 0x1000, CRC(0d18c581) SHA1(0e0f89d644b79e887c53e5294783843ca7e875ba) ) ROM_LOAD( "tvg_76.ic8", 0x1000, 0x1000, CRC(5978d37a) SHA1(684c1092de4a0927a03752903c86c3bbe99e868a) ) ROM_LOAD( "tvg_77.ic9", 0x2000, 0x1000, CRC(522d1097) SHA1(09fe627a46d32df2e098d9fad7757f9d61bef41f) ) @@ -566,7 +805,7 @@ ROM_LOAD( "tvg_79.ic16", 0x4000, 0x1000, CRC(9e5cf8ca) SHA1(015387f038c5670f88c9b22453d074bd9b2a129d) ) ROM_LOAD( "tvg_80.ic17", 0x5000, 0x1000, CRC(62df0271) SHA1(4043d90d33ff04729077be7956d30bf82add103c) ) - ROM_REGION( 0x10000, "audiocpu", 0 ) + ROM_REGION( 0x1000, "audiocpu", 0 ) ROM_LOAD( "tvg_81.ic24", 0x0000, 0x1000, CRC(fb449bfd) SHA1(f593a0339f47e121736a927587132aeb52704557) ) ROM_REGION( 0x0800, "mcu", 0 ) // internal ROM from the 8841 custom MCU @@ -575,13 +814,15 @@ ROM_REGION( 0x0800, "user1", 0 ) // data for the 8841 custom MCU ROM_LOAD( "tvg_82.ic28", 0x0000, 0x0800, CRC(57766f69) SHA1(94a7a557d8325799523d5e1a88653a9a3fbe34f9) ) - ROM_REGION( 0x4000, "gfx1", 0 ) + ROM_REGION( 0x4000, "blitter", 0 ) ROM_LOAD( "tvg_83.ic76", 0x0000, 0x1000, CRC(c0446ca6) SHA1(fca6ba565051337c0198c93b7b8477632e0dd0b6) ) ROM_LOAD( "tvg_85.ic77", 0x1000, 0x1000, CRC(72c52695) SHA1(87f4715fbb7d509bd9cc4e71e2afb0d475bbac13) ) ROM_LOAD( "tvg_84.ic52", 0x2000, 0x1000, CRC(e4cb26c2) SHA1(5016db9d48fdcfb757618659d063b90862eb0e90) ) ROM_LOAD( "tvg_86.ic53", 0x3000, 0x1000, CRC(9e6a599f) SHA1(76b4eddb4efcd8189d8cc5962d8497e82885f212) ) ROM_END +} // anonymous namespace + /************************************* * @@ -589,8 +830,8 @@ * *************************************/ -GAME( 1981, fnkyfish, 0, nomcu, fnkyfish, kangaroo_state, empty_init, ROT90, "Sun Electronics", "Funky Fish", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, kangaroo, 0, mcu, kangaroo, kangaroo_state, empty_init, ROT90, "Sun Electronics", "Kangaroo", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, kangarooa, kangaroo, mcu, kangaroo, kangaroo_state, empty_init, ROT90, "Sun Electronics (Atari license)", "Kangaroo (Atari)", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, kangaroob, kangaroo, nomcu, kangaroo, kangaroo_state, empty_init, ROT90, "bootleg", "Kangaroo (bootleg)", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, kangarool, kangaroo, mcu, kangaroo, kangaroo_state, empty_init, ROT90, "Sun Electronics (Loewen-Automaten license)", "Kangaroo (Loewen-Automaten)", MACHINE_SUPPORTS_SAVE ) +GAME( 1981, fnkyfish, 0, nomcu, fnkyfish, kangaroo_state, empty_init, ROT90, "Sun Electronics", "Funky Fish", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, kangaroo, 0, mcu, kangaroo, kangaroo_mcu_state, empty_init, ROT90, "Sun Electronics", "Kangaroo", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, kangarooa, kangaroo, mcu, kangaroo, kangaroo_mcu_state, empty_init, ROT90, "Sun Electronics (Atari license)", "Kangaroo (Atari)", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, kangaroob, kangaroo, nomcu, kangaroo, kangaroo_state, empty_init, ROT90, "bootleg", "Kangaroo (bootleg)", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, kangarool, kangaroo, mcu, kangaroo, kangaroo_mcu_state, empty_init, ROT90, "Sun Electronics (Loewen-Automaten license)", "Kangaroo (Loewen-Automaten)", MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/karnov.cpp mame-0.243+dfsg.1/src/mame/drivers/karnov.cpp --- mame-0.242+dfsg.1/src/mame/drivers/karnov.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/karnov.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -181,12 +181,12 @@ void mcu_data_h_w(uint8_t data); void mcubl_p1_w(uint8_t data); - uint8_t m_mcu_p0; - uint8_t m_mcu_p1; - uint8_t m_mcu_p2; - uint16_t m_mcu_to_maincpu; - uint16_t m_maincpu_to_mcu; - bool m_coin_state; + uint8_t m_mcu_p0 = 0; + uint8_t m_mcu_p1 = 0; + uint8_t m_mcu_p2 = 0; + uint16_t m_mcu_to_maincpu = 0; + uint16_t m_maincpu_to_mcu = 0; + bool m_coin_state = false; }; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/kickgoal.cpp mame-0.243+dfsg.1/src/mame/drivers/kickgoal.cpp --- mame-0.242+dfsg.1/src/mame/drivers/kickgoal.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/kickgoal.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -269,30 +269,6 @@ }; -static const gfx_layout layout_8x8_alt = -{ - 8,8, - RGN_FRAC(1,4), - 4, - { RGN_FRAC(3,4), RGN_FRAC(2,4), RGN_FRAC(1,4), RGN_FRAC(0,4) }, - { STEP8(0,1) }, - { STEP8(0,8) }, - 8*8 -}; - - -static const gfx_layout layout_16x16 = -{ - 16,16, - RGN_FRAC(1,4), - 4, - { RGN_FRAC(3,4), RGN_FRAC(2,4), RGN_FRAC(1,4), RGN_FRAC(0,4) }, - { STEP16(0,1) }, - { STEP16(0,16) }, - 16*16 -}; - - static const gfx_layout layout_32x32 = { 32,32, @@ -305,15 +281,15 @@ }; static GFXDECODE_START( gfx_kickgoal ) - GFXDECODE_ENTRY( "gfx1", 0, layout_8x8, 0x000, 0x40 ) // FG GFX for even column like CPS1 - GFXDECODE_ENTRY( "gfx1", 0, layout_16x16, 0x000, 0x40 ) - GFXDECODE_ENTRY( "gfx1", 0, layout_32x32, 0x000, 0x40 ) - GFXDECODE_ENTRY( "gfx1", 1, layout_8x8, 0x000, 0x40 ) // FG GFX for odd column like CPS1 + GFXDECODE_ENTRY( "gfx1", 0, layout_8x8, 0x000, 0x40 ) // FG GFX for even column like CPS1 + GFXDECODE_ENTRY( "gfx1", 0, gfx_16x16x4_planar, 0x000, 0x40 ) + GFXDECODE_ENTRY( "gfx1", 0, layout_32x32, 0x000, 0x40 ) + GFXDECODE_ENTRY( "gfx1", 1, layout_8x8, 0x000, 0x40 ) // FG GFX for odd column like CPS1 GFXDECODE_END static GFXDECODE_START( gfx_actionhw ) - GFXDECODE_ENTRY( "gfx1", 0, layout_8x8_alt, 0x000, 0x40 ) - GFXDECODE_ENTRY( "gfx1", 0, layout_16x16, 0x000, 0x40 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x4_planar, 0x000, 0x40 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_16x16x4_planar, 0x000, 0x40 ) GFXDECODE_END /* MACHINE drivers ***********************************************************/ diff -Nru mame-0.242+dfsg.1/src/mame/drivers/klax.cpp mame-0.243+dfsg.1/src/mame/drivers/klax.cpp --- mame-0.242+dfsg.1/src/mame/drivers/klax.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/klax.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -171,21 +171,9 @@ * *************************************/ -static const gfx_layout pfmolayout = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { STEP4(0,1) }, - { STEP8(0,4) }, - { STEP8(0,4*8) }, - 8*8*4 -}; - - -static GFXDECODE_START( gfx_klax ) - GFXDECODE_ENTRY( "gfx1", 0, pfmolayout, 256, 16 ) /* playfield */ - GFXDECODE_ENTRY( "gfx2", 0, pfmolayout, 0, 16 ) /* sprites */ + static GFXDECODE_START( gfx_klax ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x4_packed_msb, 256, 16 ) /* playfield */ + GFXDECODE_ENTRY( "gfx2", 0, gfx_8x8x4_packed_msb, 0, 16 ) /* sprites */ GFXDECODE_END static const gfx_layout bootleg_layout = @@ -200,8 +188,8 @@ }; static GFXDECODE_START( gfx_klax5bl ) - GFXDECODE_ENTRY( "gfx1", 0, bootleg_layout, 256, 16 ) /* playfield */ - GFXDECODE_ENTRY( "gfx2", 0, pfmolayout, 0, 16 ) /* sprites */ + GFXDECODE_ENTRY( "gfx1", 0, bootleg_layout, 256, 16 ) /* playfield */ + GFXDECODE_ENTRY( "gfx2", 0, gfx_8x8x4_packed_msb, 0, 16 ) /* sprites */ GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/kncljoe.cpp mame-0.243+dfsg.1/src/mame/drivers/kncljoe.cpp --- mame-0.242+dfsg.1/src/mame/drivers/kncljoe.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/kncljoe.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -193,17 +193,6 @@ INPUT_PORTS_END -static const gfx_layout charlayout = -{ - 8,8, - RGN_FRAC(1,3), - 3, - { RGN_FRAC(2,3), RGN_FRAC(1,3), RGN_FRAC(0,3) }, - { 0, 1, 2, 3, 4, 5, 6, 7 }, - { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, - 8*8 -}; - static const gfx_layout spritelayout = { 16,16, @@ -218,9 +207,9 @@ }; static GFXDECODE_START( gfx_kncljoe ) - GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0x00, 16 ) /* colors 0x00-0x7f direct mapped */ - GFXDECODE_ENTRY( "gfx2", 0, spritelayout, 0x80, 16 ) /* colors 0x80-0x8f with lookup table */ - GFXDECODE_ENTRY( "gfx3", 0, spritelayout, 0x80, 16 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x3_planar, 0x00, 16 ) /* colors 0x00-0x7f direct mapped */ + GFXDECODE_ENTRY( "gfx2", 0, spritelayout, 0x80, 16 ) /* colors 0x80-0x8f with lookup table */ + GFXDECODE_ENTRY( "gfx3", 0, spritelayout, 0x80, 16 ) GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/konamim2.cpp mame-0.243+dfsg.1/src/mame/drivers/konamim2.cpp --- mame-0.242+dfsg.1/src/mame/drivers/konamim2.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/konamim2.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -696,7 +696,8 @@ m_ppc1->ppcdrc_add_fastram(m_bda->ram_start(), m_bda->ram_end(), false, m_bda->ram_ptr()); m_ppc2->ppcdrc_add_fastram(m_bda->ram_start(), m_bda->ram_end(), false, m_bda->ram_ptr()); - m_available_cdroms = cdrom_open(machine().rom_load().get_disk_handle(":cdrom")); + chd_file *chd = machine().rom_load().get_disk_handle(":cdrom"); + m_available_cdroms = chd ? new cdrom_file(chd) : nullptr; // TODO: REMOVE m_atapi_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(konamim2_state::atapi_delay), this)); diff -Nru mame-0.242+dfsg.1/src/mame/drivers/konblands.cpp mame-0.243+dfsg.1/src/mame/drivers/konblands.cpp --- mame-0.242+dfsg.1/src/mame/drivers/konblands.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/konblands.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -224,19 +224,9 @@ PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNKNOWN ) INPUT_PORTS_END -static const gfx_layout charlayout = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { STEP4(0,1) }, - { STEP8(0,4) }, - { STEP8(0,4*8) }, - 8*8*4 -}; static GFXDECODE_START( gfx_konblands ) - GFXDECODE_ENTRY( "gfx", 0, charlayout, 0, 1 ) + GFXDECODE_ENTRY( "gfx", 0, gfx_8x8x4_packed_msb, 0, 1 ) GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/krz2000.cpp mame-0.243+dfsg.1/src/mame/drivers/krz2000.cpp --- mame-0.242+dfsg.1/src/mame/drivers/krz2000.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/krz2000.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -5,41 +5,58 @@ krz2000.cpp - Kurzweil K2000 series Skeleton driver by R. Belmont + Additional improvements by Peter Sobot Hardware in brief: - TMP68301 CPU @ 16 MHz + TMP68301 CPU @ 16 MHz (with debug port on RXD2/TXD2) uPD72064 FDC - 85C30 SCSI - M37450 on I/O board to handle panel/display/keyboard scanning + 85C30 SCSI (53C80 on schematic?) + M37450 @ 10 MHz on I/O board to handle panel/display/keyboard scanning, LED control, LCD contrast, and the audio switching matrix + (16K of ROM stored on U69, 384 bytes of RAM, 8 A/D inputs, 2 D/A outputs, 6 ports of I/O, and a 31.25Kbaud serial link to the maincpu) HD6303 on I/O board to manage reverb DSP program loading - VLSI ASIC "Calvin" - Unknown purpose (speculation: handles maincpu and PCM ROM/RAM addressing and DRAM refresh?) + VLSI ASIC "Calvin" - Handles maincpu and PCM ROM/RAM addressing, as well as resampling (and possibly DRAM refresh) (on later K2000 and all later K-series units this is replaced by a more advanced VLSI ASIC "Janis") - 2x VLSI ASIC "Hobbes" - Unknown purpose (speculation: 'reverb' DSP, interpolation, accumulation, and shifting and dithering down a wider accumulator to a 16 bit output sample?) + (service manual says "sample fetching tasks") + 2x VLSI ASIC "Hobbes" - specialized DSP processors for sound synthesis (oscillators, filters, etc) + (service manual says "wave form generation and DSP functions") + (each Hobbes chip handles a subset of available voices, and seems independently programmable) + Digitech DSP256 Multi Effects VLSI Chip (reverb, chorus, delay, etc) + (EPROM seems avaialble on eBay, but the chip itself is quite custom) ***************************************************************************/ #include "emu.h" + +#include "bus/midi/midi.h" +#include "bus/nscsi/cd.h" +#include "bus/nscsi/hd.h" +#include "cpu/m6502/m3745x.h" #include "cpu/m68000/m68000.h" -#include "machine/tmp68301.h" +#include "imagedev/floppy.h" #include "machine/bankdev.h" -#include "machine/upd765.h" #include "machine/ncr5380.h" -#include "bus/nscsi/cd.h" -#include "bus/nscsi/hd.h" +#include "machine/tmp68301.h" +#include "machine/upd765.h" #include "video/t6963c.h" -#include "screen.h" + #include "emupal.h" +#include "screen.h" #include "softlist.h" #include "speaker.h" +namespace { + class k2000_state : public driver_device { public: k2000_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") + // , m_scanner(*this, "scanner") , m_1m_bank(*this, "bank1m") , m_mainram(*this, "mainram") + // , m_midi(*this, "midi") + // , m_fdc(*this, "fdc") { } void k2000(machine_config &config); @@ -52,24 +69,105 @@ void bank_map_1m(address_map &map); required_device m_maincpu; + // required_device m_scanner; required_device m_1m_bank; required_shared_ptr m_mainram; + // optional_device m_midi; + // required_device m_fdc; + + void swap_bit_ctrl_w(uint16_t data); + uint16_t battery_voltage_and_keyscanner_version(offs_t offset); - void ctrl_w(uint16_t data); + uint16_t calvin_read(offs_t offset); + void calvin_write(offs_t offset, uint16_t data); + + uint16_t hobbes0_read(offs_t offset); + void hobbes0_write(offs_t offset, uint16_t data); + + uint16_t hobbes1_read(offs_t offset); + void hobbes1_write(offs_t offset, uint16_t data); void k2000_palette(palette_device &palette) const; + + TIMER_CALLBACK_MEMBER(boot_hack_timer); + emu_timer *m_boot_hack_timer; }; -void k2000_state::ctrl_w(uint16_t data) +/** + * From the K2000/K2000R service manual: + * + * The 68301 processor's 16 megabits (sic) of address space are divided into 16 equal memory blocks, + * numbered 0-15. The first time the K2000 is powered up, Block 0 processes data for the boot + * EPROM and setup EPROM, while Block 1 processes data for the PSRAM. Many of the K2000's basic + * functions utilize the PSRAM, which accesses the higher address space of Block 1 in the CPU. + * This slows down the access time somewhat, since the address space of the CPU is accessed in + * sequence, beginning with Block 0. + * + * To optimize the processing speed, the K2000 performs a one-time software operation when + * powered up for the first time. The memory management unit (MMU) in the gate array logic chip + * (GAL) located at U35 on the engine board executes a "swap bit" function which makes Block 0 + * of the CPU responsible for the PSRAM, and Block 1 responsible for the Boot EPROM and Setup + * EPROM. Consequently the PSRAM functions are processed as early as possible. + * + * Note this "16 equal memory blocks" idea is really just the top hex digit of the address - + * i.e.: 0x?FFFFF + */ +void k2000_state::swap_bit_ctrl_w(uint16_t data) { data &= 0xff; - logerror("%02x to ctrl_w\n", data); - // bit 4: 0=program ROM at 0, work RAM at 100000, 1=work RAM at 0, program ROM at 100000. + logerror("%02x written to swap_bit_ctrl_w\n", data); + // bit 4: + // 0 = program ROM at 0x000000, work RAM at 0x100000 + // 1 = work RAM at 0x000000, program ROM at 0x100000 m_1m_bank->set_bank((data >> 4) & 1); } +uint16_t k2000_state::battery_voltage_and_keyscanner_version(offs_t offset) +{ + logerror("reading battery voltage and keyscanner version at %02x\n", offset); + uint8_t battery_voltage = 0x36; + uint8_t keyscanner_version = 0x12; + return (((uint16_t) battery_voltage) << 8) | ((uint16_t) keyscanner_version); +} + +uint16_t k2000_state::calvin_read(offs_t offset) +{ + logerror("Read from Calvin at %06x\n", offset); + return 0; +} + +void k2000_state::calvin_write(offs_t offset, uint16_t data) +{ + logerror("Write to Calvin at %06x = %04x\n", offset, data); +} + +uint16_t k2000_state::hobbes0_read(offs_t offset) +{ + logerror("Read from Hobbes[0] at %06x\n", offset); + return 0; +} + +void k2000_state::hobbes0_write(offs_t offset, uint16_t data) +{ + logerror("Write to Hobbes[0] at %06x = %04x\n", offset, data); +} + + +uint16_t k2000_state::hobbes1_read(offs_t offset) +{ + logerror("Read from Hobbes[1] at %06x\n", offset); + return 0; +} + +void k2000_state::hobbes1_write(offs_t offset, uint16_t data) +{ + logerror("Write to Hobbes[1] at %06x = %04x\n", offset, data); +} + void k2000_state::machine_start() { + m_boot_hack_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(k2000_state::boot_hack_timer), this)); + m_boot_hack_timer->adjust(attotime::from_seconds(2), 0, attotime::never); } void k2000_state::machine_reset() @@ -77,23 +175,161 @@ m_1m_bank->set_bank(0); } +TIMER_CALLBACK_MEMBER(k2000_state::boot_hack_timer) +{ + logerror("Jumping to interrupt vector to continue boot sequence"); + m_maincpu->set_pc(m_1m_bank->read32(0x80)); +} + void k2000_state::k2000_map(address_map &map) { // word writes to 000000 region - unknown // word writes to 000090 region - unknown // word writes to 000180 region - unknown // word writes to 000240 region - unknown + + // The engine ROMs are mapped onto 0x0 when ENGROMCSb is low, which is IO3 of GODOT (pin 18) + // The setup ROMs are mapped onto 0x100000 when SUROMCSb is low, which is the IO2 output (pin 17) of GODOT + // This implies that IO3 of GODOT is low iff CA{20,23} are also low, and IO2 of GODOT is low iff CA{20,23} = 0x01 + + // Block 0, Block 1: ROM and RAM (depending on bank switch) map(0x000000, 0x1fffff).m(m_1m_bank, FUNC(address_map_bank_device::amap16)); + + // Lots of writes to 0x372B68 -> 0x372C8C + + // Block 4: PRAM? + // "The K2000 comes standard with 116KB, and with the PRAM upgrade, totals 760KB." + // Another source says: + // For the K2000 Series, the total memory allocated to all of these objects is + // 120K expandable to 760K with the PRAM option. For the K2500 Series, it is 256k, + // expandable to 1280k with the PRAM option. For the K2600 Series, it is 486k, + // expandable to 1506k with the PRAM option. + // These are pretty odd numbers - but it sounds like ~8KB of the RAM space is used + // for OS functions, meaning the built-in RAM might only be 128KB in total. + // The K2000 schematic shows 2x 1M "NVRAM" chips, one for the low byte, and one for + // the high byte, which means we should (?) actually have 2 * 1024 * 1024 / 8 = 262,144 bytes? + // + // The boot routines seem to write to 0x400000 and compare the value saved there, so + // this is probably the optional PRAM expansion. + map(0x400000, 0x400000 + ((2 * 1024 * 1024) / 8) - 1).ram(); + + // Init routine sets 0x4BAB44 -> 0x4BFFFA to 0x0000 + // Reads from 0x4BFFFC and 0x4BFFFE seem to happen on startup. + // HOBBES0CSb = NAND(CS1', CA19) = high unless CS1 is high and CA19 is high + // HOBBES1CSb = NAND(CS1', !CA19) = high unless CS1 is high and CA19 is low + // 0xFFFC00 is the Address Decoder area that controls which part of memory causes CS1 to be "enabled" (low) + // At runtime, + // 0xFFFC00 = 0x50 = + // 0xFFFC01 = 0x3F + // 0xFFFC02 = 0x00 + // 0xFFFC03 = 0x30 + // For CS1: + // 0xFFFC04 = 0x60 = 0b0110 0000 = Start address of the memory area for CS1 = A21 + A22 + // 0xFFFC05 = 0x3F = 0b0011 1111 = Size of memory area = M19 + M18 + M17 + M16 + M15-M9 + M8 = 1MB + // 0xFFFC06 = 0x00 + // 0xFFFC07 = 0x30 = 0b0011 0000 = Area enabled, use external DTACK + // By this logic, Hobbes chips are mapped to 0x100000, 0x200000, 0x400000, 0x600000 + // And their address mask is 0x000FFF00, which means the effective ranges are: + // 0x100???00 + + // Hobbes chip selection seems to look at CA19 and CS1 + + // Internal sample ROM is switched on SBA20,SBA21, which corresponds to CA21,CA22 (one bit off) + // meaning the internal address space for accessing the sample ROM is 0x200000 through 0x6fffff (?) + // Blocks 2, 3, 4, 5, 6 + // map(0x200000, 0x2fffff).rom().region("pcm", 0); // Block 2: Sample ROM + // map(0x300000, 0x3fffff).rom().region("pcm", 0x100000); // Block 3: Sample ROM + // map(0x400000, 0x4fffff).rom().region("pcm", 0x200000); // Block 4: Sample ROM + // Writes to 0x4FFD82, 0x4FFD88, 0x4FFE24 + + // Hypothesis: Calvin (or Janis) is mapped at 0x500000 + // Writes to 0x500402, 0x500418, 0x50041A early in the boot process + // Initialization then writes zeros in a descending ladder: + // 0x500400, 0x500402 + // 0x5003FC, 0x5003FE, ... + // down to 0x500004 (then 0x500006) + + // Calvin memory? + map(0x500000, 0x5003ff).rw(FUNC(k2000_state::calvin_read), FUNC(k2000_state::calvin_write)); + // Calvin control registers? + map(0x500400, 0x5004ff).rw(FUNC(k2000_state::calvin_read), FUNC(k2000_state::calvin_write)); + // Reads and writes to 0x580000 + + // Hobbes (it seems) is connected in the 0x600000 range + // The second Hobbes chip (?) seems connected at 0x680000 + // Initialization seems to: + // - write to 0x600300, followed by 0x600xxx where xxx is in 0x400 through 0x5FF + // - write to 0x6?0002, 0x6?0006, 0x6?0004, through 0x6?000F4 + // - write to 0x600004, 0x600014, 0x600024... through 0x6002F4 + // (with a repeating pattern of [0x02, 0x00, 0x26, 0x24, 0x4A, 0x48]) + // - write to 0x680004, 0x680014, 0x680024... through 0x6802F4 + // (with a repeating pattern of [0x80, 0x02, 0xA4, 0x26, 0xC6, 0x4A]) + // Each Hobbes chip seems to have two control registers, mapped at 0x600300/0x680300 and 0x600400/0x680400 + + // Hobbes memory? + map(0x600000, 0x6002ff).rw(FUNC(k2000_state::hobbes0_read), FUNC(k2000_state::hobbes0_write)); + // Hobbes control registers? + map(0x600300, 0x6005ff).rw(FUNC(k2000_state::hobbes0_read), FUNC(k2000_state::hobbes0_write)); + + // Hobbes memory? + map(0x680000, 0x6802FF).rw(FUNC(k2000_state::hobbes1_read), FUNC(k2000_state::hobbes1_write)); + // Hobbes control registers? + map(0x680300, 0x6805FF).rw(FUNC(k2000_state::hobbes1_read), FUNC(k2000_state::hobbes1_write)); + + // SROM - Setup ROM? + uint32 srom_base = 0x280000; + map(srom_base, srom_base + 0x40000 - 1).rom().region("maincpu", 0x100000); + + // Calvin chip has a 20-bit address bus with A0 tied low and A12-15 tied high, giving it access to 0x?0??[0-E] + // Later models' Janis chips use 24-bit address buses (or at least they're all connected in the schematic) + // Hobbes has a 10-bit address bus with A0 tied low, giving access to 0x0 through 0x3FF + + // Block 7: LCD control and bank switching map(0x700000, 0x700003).rw("lcd", FUNC(lm24014h_device::read), FUNC(lm24014h_device::write)).umask16(0x00ff); - map(0x7e0000, 0x7e0001).w(FUNC(k2000_state::ctrl_w)); + + // Reads from 0x740000 (floppy?) + // Writes to 0x760000 + // Writes to 0x7C0000 + + // Single byte reads seem to happen at 0x740000, which seems to be FDCCTLCSb? + // map(0x740000, 0x74000f). + map(0x7e0000, 0x7e0001).w(FUNC(k2000_state::swap_bit_ctrl_w)); + + // Some sort of hardware mapping - initial firmware boot expects a 4 at $78000B + map(0x780000, 0x78ffff).ram(); + + // When (CPUASb + GODOT I6) and (GODOT I/O0 + IOCSb) are low, + // Address bits 17, 18, 19 get demultiplexed onto: + // 0, 0, 0 => LCDCSb + // 0, 0, 1 => FDCCSb + // 0, 1, 0 => FDCCTLCSb + // 0, 1, 1 => FDCOUTCSb + // 1, 0, 0 => SCSICSb + // 1, 0, 1 => SCSIDMACSb + // 1, 1, 0 => CPUEXPCSb + // 1, 1, 1 => MCTLREGCSb (OR'ed with WRITELOb to provide input into the Memory Management Control Register) + + // map(0x800000, 0x8fffff); // Block 8: ??? + // map(0x900000, 0x9fffff); // Block 9: ??? + // map(0xa00000, 0xffffff); // Blocks 10, 11, 12, 13, 14: Orchestral ROM + // map(0x1000000, 0x18fffff); // Blocks 15, 16, 17, 18, 19: Contemporary ROM } void k2000_state::bank_map_1m(address_map &map) { map(0x000000, 0x0fffff).rom().region("maincpu", 0); map(0x100000, 0x1fffff).ram().share("mainram"); + + // The "stride" of this bank map is 0x200000, so this is the second "view" of the same data map(0x200000, 0x2fffff).ram().share("mainram"); map(0x300000, 0x3fffff).rom().region("maincpu", 0); + + // Unsure if the battery voltage and keyscanner data is memory-mapped at these ranges (unlikely) + // or if this data is written to some time during the boot process. If it's the latter, + // this will have to change when loading different versions of the ROM (or someone has to figure + // out where the battery voltage is actually read from). + map(0x100000 + 0x1052, 0x100000 + 0x1053).r(FUNC(k2000_state::battery_voltage_and_keyscanner_version)); + map(0x200000 + 0x1052, 0x200000 + 0x1053).r(FUNC(k2000_state::battery_voltage_and_keyscanner_version)); } void k2000_state::k2000(machine_config &config) @@ -101,14 +337,47 @@ TMP68301(config, m_maincpu, XTAL(12'000'000)); m_maincpu->set_addrmap(AS_PROGRAM, &k2000_state::k2000_map); + // MIDI_PORT(config, m_midi, midiin_slot, "midiin"); + // TODO: Uncomment when the TMP68301 has serial/MIDI support, to wire up MIDI I/O and scanner. + // MIDI_PORT(config, m_midi, midiout_slot, "midiout"); + + // M37450(config, m_scanner, XTAL(10'000'000)); + // The "Scanner" sub-CPU is connected to main CPU via: + // - MIDI_FM_ENG, going to P34/RxD, which comes from SERTxD, which is INTMIDITxD == TxD1 + // - 37450_TXD, coming from P35/TxD, which is NAND'd together with 6303_TXD + // and inverted to provide SERRxD to the engine (maincpu), which goes to INTMIDIRxD + // eventually ending up at RxD1 + // Essentially, the 68k's second built-in serial port runs at 31250Hz, which is MIDI baud rate, + // which is how it talks to the scanner to tell it to operate the LEDs on the front of the case. + // The external MIDI port(s) are connected directly to the 68K's first serial port, RxD0 and TxD0. + // (RxD2 and TxD2 are hooked up to a "debug port" which the manual says requires additional + // hardware - this is untested.) + // The scanner's ROM comes from an NTE2764 (U69, 28-pin DIP) EPROM of which 16Kb are used. + // (Note that on the K2500 and above, the scanner is an M37451M8-FP the ROM is 16KB, but stored on an M27256.) + // The scanner ROM from the K2500 may be compatible with the K2000, and can be pulled from "U2" + // on the K2500 Audio Scanner Board (Rev D) + ADDRESS_MAP_BANK(config, "bank1m").set_map(&k2000_state::bank_map_1m).set_options(ENDIANNESS_BIG, 16, 24, 0x200000); + // uPD765AC; clocked through SED9420C + // UPD765A(config, m_fdc, 16_MHz_XTAL / 4, true, true); + // m_fdc->intrq_wr_callback().set_inputline(m_maincpu, I6); + // FLOPPY_CONNECTOR(config, "fdc:0", dss1_floppies, "35dd", floppy_image_device::default_floppy_formats).enable_sound(true); + // FLOPPY_CONNECTOR(config, "fdc:1", dss1_floppies, nullptr, floppy_image_device::default_floppy_formats).enable_sound(true); + + PALETTE(config, "palette", FUNC(k2000_state::k2000_palette), 2); + LM24014H(config, "lcd"); SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); } +void k2000_state::k2000_palette(palette_device &palette) const +{ + palette.set_pen_color(0, rgb_t(131, 136, 139)); + palette.set_pen_color(1, rgb_t( 92, 83, 88)); +} static INPUT_PORTS_START( k2000 ) @@ -199,8 +468,14 @@ ROM_REGION(0x3000, "pals", 0) ROM_LOAD( "pseudo_v4d.u11.gal16v8b.jed", 0x000000, 0x000bd0, CRC(43561132) SHA1(a0c567c81022bc7fb83023d89556ccd5aa1ab36d) ) ROM_LOAD( "sndram_v1.u50.gal16v8b.jed", 0x001000, 0x000bd0, CRC(cabc9335) SHA1(968fa5baa43c7589c901f09b12085437834aeb37) ) + // GODOT seems to take in the top 4 maincpu address lines (A20-A24) and multiplex/decode onto 11 (?) I/O lines + // Effectively takes care of the "memory block" logic (MMU/bank switching) that the service manual describes ROM_LOAD( "godot_v5.u10.gal20v8a.jed", 0x002000, 0x00066f, CRC(c6517456) SHA1(b82530d46afdca5f6460e77ac11710cad55a6b89) ) + // There's an additional GAL20V8 for the MMU - exact logic unknown, but the MCTL[0-3] lines are used, which seem + // like the "address space select" lines - so at least one or more of those address space areas map directly to SBA[22-25], which + // seem to be the Sample Bank address lines. ROM_END -CONS( 1990, k2000, 0, 0, k2000, k2000, k2000_state, empty_init, "Kurzweil Music Systems", "K2000", MACHINE_NOT_WORKING|MACHINE_NO_SOUND ) +} // anonymous namespace +SYST( 1990, k2000, 0, 0, k2000, k2000, k2000_state, empty_init, "Kurzweil Music Systems", "K2000", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/ksayakyu.cpp mame-0.243+dfsg.1/src/mame/drivers/ksayakyu.cpp --- mame-0.242+dfsg.1/src/mame/drivers/ksayakyu.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/ksayakyu.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -8,7 +8,7 @@ TODO: - sprite glitches (sometimes) .. missing vertical flip flag? <- (*) -- sound cpu int freq (timer ? $a010 writes ?) +- sound CPU int freq (timer ? $a010 writes ?) (*) this was caused by flip Y being hooked up as bit 6 in text videoram attribute. -AS @@ -65,17 +65,215 @@ */ #include "emu.h" -#include "includes/ksayakyu.h" #include "cpu/z80/z80.h" +#include "machine/gen_latch.h" #include "sound/ay8910.h" #include "sound/dac.h" + +#include "emupal.h" #include "screen.h" #include "speaker.h" +#include "tilemap.h" + + +namespace { + +class ksayakyu_state : public driver_device +{ +public: + ksayakyu_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_videoram(*this, "videoram"), + m_spriteram(*this, "spriteram"), + m_mainbank(*this, "mainbank"), + m_maincpu(*this, "maincpu"), + m_gfxdecode(*this, "gfxdecode"), + m_palette(*this, "palette"), + m_soundlatch(*this, "soundlatch") + { } + + void ksayakyu(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; + +private: + // memory pointers + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; + required_memory_bank m_mainbank; + + // devices + required_device m_maincpu; + required_device m_gfxdecode; + required_device m_palette; + required_device m_soundlatch; + + // video-related + tilemap_t *m_tilemap = nullptr; + tilemap_t *m_textmap = nullptr; + uint8_t m_video_ctrl = 0; + uint8_t m_flipscreen = 0; + + // misc + uint8_t m_sound_status = 0; + + void bank_select_w(uint8_t data); + void latch_w(uint8_t data); + uint8_t sound_status_r(); + void tomaincpu_w(uint8_t data); + uint8_t int_ack_r(); + void videoram_w(offs_t offset, uint8_t data); + void videoctrl_w(uint8_t data); + void dummy1_w(uint8_t data); + void dummy2_w(uint8_t data); + void dummy3_w(uint8_t data); + TILE_GET_INFO_MEMBER(get_tile_info); + TILE_GET_INFO_MEMBER(get_text_tile_info); + void palette(palette_device &palette) const; + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); + + void maincpu_map(address_map &map); + void soundcpu_map(address_map &map); +}; -#define MAIN_CLOCK XTAL(18'432'000) +// video +void ksayakyu_state::videoram_w(offs_t offset, uint8_t data) +{ + m_videoram[offset]=data; + m_textmap->mark_tile_dirty(offset >> 1); +} + +void ksayakyu_state::videoctrl_w(uint8_t data) +{ + /* + bits: + 76543210 + xx - ?? layers enable ? + x - screen flip + xx - ?? + xxx - scroll offset + + */ + m_video_ctrl = data; + + m_flipscreen = data & 4; + flip_screen_set(m_flipscreen); + m_tilemap->set_scrolly(0, (data & 0xe0) << 3); + if (m_flipscreen) + m_tilemap->set_flip((data & 2) ? TILEMAP_FLIPY : TILEMAP_FLIPX | TILEMAP_FLIPY); + else + m_tilemap->set_flip((data & 2) ? TILEMAP_FLIPX : 0); +} + +void ksayakyu_state::palette(palette_device &palette) const +{ + uint8_t const *const prom = memregion("proms")->base(); + + for (int i = 0; i < 0x100; i++) + { + int const r = (prom[i] >> 0) & 0x07; + int const g = (prom[i] >> 3) & 0x07; + int const b = (prom[i] >> 6) & 0x03; + + palette.set_pen_color(i, pal3bit(r), pal3bit(g), pal2bit(b)); + } +} + +TILE_GET_INFO_MEMBER(ksayakyu_state::get_tile_info) +{ + int code = memregion("user1")->base()[tile_index]; + int attr = memregion("user1")->base()[tile_index + 0x2000]; + code += (attr & 3) << 8; + tileinfo.set(1, code, ((attr >> 2) & 0x0f) * 2, (attr & 0x80) ? TILE_FLIPX : 0); +} + +/* +x--- ---- flip bits +-y-- ---- unknown, used when runner slides (NOT flip Y!) +--cc cc-- color +---- --bb bank select +*/ +TILE_GET_INFO_MEMBER(ksayakyu_state::get_text_tile_info) +{ + int code = m_videoram[tile_index * 2 + 1]; + int attr = m_videoram[tile_index * 2]; + int flags = ((attr & 0x80) ? TILE_FLIPX : 0);// | ((attr & 0x40) ? TILE_FLIPY : 0); + int color = (attr & 0x3c) >> 2; + + code |= (attr & 3) << 8; + + tileinfo.set(0, code, color, flags); +} + +/* +[0] X--- ---- flip x + -ttt tttt tile number +[1] yyyy yyyy Y offset +[2] xxxx xxxx X offset +[3] +*/ + +void ksayakyu_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + const uint8_t *source = m_spriteram + m_spriteram.bytes() - 4; + const uint8_t *finish = m_spriteram; + + while (source >= finish) // is order correct ? + { + int sx = source[2]; + int sy = 240 - source[1]; + int attributes = source[3]; + int tile = source[0]; + int flipx = (tile & 0x80) ? 1 : 0; + int flipy = 0; + + gfx_element *gfx = m_gfxdecode->gfx(2); + + if (m_flipscreen) + { + sx = 240 - sx; + sy = 240 - sy; + flipx ^= 1; + flipy ^= 1; + } + + gfx->transpen(bitmap, cliprect, + tile & 0x7f, + (attributes & 0x78) >> 3, + flipx, flipy, + sx, sy, 0); + + source -= 4; + } +} + +void ksayakyu_state::video_start() +{ + m_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(ksayakyu_state::get_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32 * 8); + m_textmap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(ksayakyu_state::get_text_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); + m_textmap->set_transparent_pen(0); +} + +uint32_t ksayakyu_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + bitmap.fill(0, cliprect); + + if (m_video_ctrl & 1) + m_tilemap->draw(screen, bitmap, cliprect, 0, 0); + + m_textmap->draw(screen, bitmap, cliprect, 0, 0); + draw_sprites(bitmap, cliprect); + return 0; +} + +// machine void ksayakyu_state::bank_select_w(uint8_t data) { @@ -86,7 +284,7 @@ xxxxxxx - unused ? */ - membank("bank1")->set_entry(data & 0x01); + m_mainbank->set_entry(data & 0x01); } void ksayakyu_state::latch_w(uint8_t data) @@ -115,20 +313,20 @@ void ksayakyu_state::maincpu_map(address_map &map) { map(0x0000, 0x3fff).rom(); - map(0x4000, 0x7fff).bankr("bank1"); + map(0x4000, 0x7fff).bankr(m_mainbank); map(0x8000, 0x9fff).rom(); map(0xa000, 0xa7ff).ram(); map(0xa800, 0xa800).portr("P1"); map(0xa801, 0xa801).portr("P2"); map(0xa802, 0xa802).portr("DSW"); - map(0xa803, 0xa803).nopr(); /* watchdog ? */ - map(0xa804, 0xa804).w(FUNC(ksayakyu_state::ksayakyu_videoctrl_w)); + map(0xa803, 0xa803).nopr(); // watchdog ? + map(0xa804, 0xa804).w(FUNC(ksayakyu_state::videoctrl_w)); map(0xa805, 0xa805).w(FUNC(ksayakyu_state::latch_w)); map(0xa806, 0xa806).r(FUNC(ksayakyu_state::sound_status_r)); map(0xa807, 0xa807).r(FUNC(ksayakyu_state::int_ack_r)); map(0xa808, 0xa808).w(FUNC(ksayakyu_state::bank_select_w)); - map(0xb000, 0xb7ff).ram().w(FUNC(ksayakyu_state::ksayakyu_videoram_w)).share("videoram"); - map(0xb800, 0xbfff).ram().share("spriteram"); + map(0xb000, 0xb7ff).ram().w(FUNC(ksayakyu_state::videoram_w)).share(m_videoram); + map(0xb800, 0xbfff).ram().share(m_spriteram); } void ksayakyu_state::soundcpu_map(address_map &map) @@ -233,17 +431,17 @@ }; static GFXDECODE_START( gfx_ksayakyu ) - GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 16 ) - GFXDECODE_ENTRY( "gfx3", 0, charlayout2, 0x80, 32 ) - GFXDECODE_ENTRY( "gfx2", 0, spritelayout, 0, 16 ) + GFXDECODE_ENTRY( "chars", 0, charlayout, 0, 16 ) + GFXDECODE_ENTRY( "tiles", 0, charlayout2, 0x80, 32 ) + GFXDECODE_ENTRY( "sprites", 0, spritelayout, 0, 16 ) GFXDECODE_END void ksayakyu_state::machine_start() { - uint8_t *ROM = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); - membank("bank1")->configure_entries(0, 2, &ROM[0x10000], 0x4000); + m_mainbank->configure_entries(0, 2, &rom[0x10000], 0x4000); save_item(NAME(m_sound_status)); save_item(NAME(m_video_ctrl)); @@ -259,41 +457,43 @@ void ksayakyu_state::ksayakyu(machine_config &config) { - /* basic machine hardware */ - Z80(config, m_maincpu, MAIN_CLOCK/8); //divider is guessed + constexpr XTAL MAIN_CLOCK = XTAL(18'432'000); + + // basic machine hardware + Z80(config, m_maincpu, MAIN_CLOCK / 8); //divider is guessed m_maincpu->set_addrmap(AS_PROGRAM, &ksayakyu_state::maincpu_map); - z80_device &audiocpu(Z80(config, "audiocpu", MAIN_CLOCK/8)); //divider is guessed, controls DAC tempo + z80_device &audiocpu(Z80(config, "audiocpu", MAIN_CLOCK / 8)); //divider is guessed, controls DAC tempo audiocpu.set_addrmap(AS_PROGRAM, &ksayakyu_state::soundcpu_map); audiocpu.set_periodic_int(FUNC(ksayakyu_state::irq0_line_hold), attotime::from_hz(60)); //guess, controls music tempo config.set_maximum_quantum(attotime::from_hz(60000)); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(60); screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); screen.set_size(256, 256); screen.set_visarea(0*8, 32*8-1, 2*8, 30*8-1); - screen.set_screen_update(FUNC(ksayakyu_state::screen_update_ksayakyu)); + screen.set_screen_update(FUNC(ksayakyu_state::screen_update)); screen.set_palette(m_palette); screen.screen_vblank().set_inputline(m_maincpu, 0, ASSERT_LINE); GFXDECODE(config, m_gfxdecode, m_palette, gfx_ksayakyu); - PALETTE(config, m_palette, FUNC(ksayakyu_state::ksayakyu_palette), 256); + PALETTE(config, m_palette, FUNC(ksayakyu_state::palette), 256); - /* sound hardware */ + // sound hardware SPEAKER(config, "speaker").front_center(); GENERIC_LATCH_8(config, m_soundlatch); - ay8910_device &ay1(AY8910(config, "ay1", MAIN_CLOCK/16)); //unknown clock + ay8910_device &ay1(AY8910(config, "ay1", MAIN_CLOCK / 16)); //unknown clock ay1.port_a_read_callback().set(m_soundlatch, FUNC(generic_latch_8_device::read)); ay1.port_b_write_callback().set(FUNC(ksayakyu_state::dummy1_w)); ay1.add_route(ALL_OUTPUTS, "speaker", 0.25); - ay8910_device &ay2(AY8910(config, "ay2", MAIN_CLOCK/16)); //unknown clock + ay8910_device &ay2(AY8910(config, "ay2", MAIN_CLOCK / 16)); //unknown clock ay2.port_a_write_callback().set(FUNC(ksayakyu_state::dummy2_w)); ay2.port_b_write_callback().set(FUNC(ksayakyu_state::dummy3_w)); ay2.add_route(ALL_OUTPUTS, "speaker", 0.25); @@ -315,17 +515,17 @@ ROM_LOAD( "6.5h", 0x4000, 0x2000, CRC(17986662) SHA1(81b65e381b923c5544f4708efef09f0894c716b2) ) ROM_LOAD( "5.5f", 0x6000, 0x2000, CRC(b0b21817) SHA1(da2a1a6865dbc335775fa2e0ad0fb899be95af03) ) - ROM_REGION( 0x6000, "gfx1", 0 ) + ROM_REGION( 0x6000, "chars", 0 ) ROM_LOAD( "9.3j", 0x0000, 0x2000, CRC(ef8411dd) SHA1(1dbc959d3aec9face19b2a5ae873ca34bfeff5cd) ) ROM_LOAD( "10.3k", 0x2000, 0x2000, CRC(1bdee573) SHA1(7b92a8133cb83404505d21f462e3ca6c85647dca) ) ROM_LOAD( "11.3l", 0x4000, 0x2000, CRC(c5859887) SHA1(41685fb8f8e7c44acd5e0e3ccc629e5f64a59fbd) ) - ROM_REGION( 0x6000, "gfx2", 0 ) + ROM_REGION( 0x6000, "sprites", 0 ) ROM_LOAD( "14.9j", 0x0000, 0x2000, CRC(982d06f0) SHA1(e107c56ee4f2695a790b8cec6d52337ba9d8b2ad) ) ROM_LOAD( "15.9k", 0x2000, 0x2000, CRC(dc126df9) SHA1(368efb36bf197e3eac23ef543e25e9f4efba785e) ) ROM_LOAD( "16.9m", 0x4000, 0x2000, CRC(574a172d) SHA1(7dee073b5c8ff5825062e30cff29343dc767daaa) ) - ROM_REGION( 0x4000, "gfx3", 0 ) + ROM_REGION( 0x4000, "tiles", 0 ) ROM_LOAD( "17.9n", 0x0000, 0x2000, CRC(a4c4e4ce) SHA1(f8b0a8dfab972e23f268c69fd9ef30fc80f62533) ) ROM_LOAD( "18.9r", 0x2000, 0x2000, CRC(9d75b104) SHA1(062884fdca9f705f555b828aff136d8f52fbf6eb) ) @@ -337,4 +537,7 @@ ROM_LOAD( "9f.bin", 0x0000, 0x0100, CRC(ff71b27f) SHA1(6aad2bd2be997595a05ddb81d24df8fe1435910b) ) ROM_END +} // anonymous namespace + + GAME( 1985, ksayakyu, 0, ksayakyu, ksayakyu, ksayakyu_state, empty_init, ORIENTATION_FLIP_Y, "Taito Corporation", "Kusayakyuu", MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/ksys573.cpp mame-0.243+dfsg.1/src/mame/drivers/ksys573.cpp --- mame-0.242+dfsg.1/src/mame/drivers/ksys573.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/ksys573.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -27,15 +27,15 @@ Konami, 1998-2001 This system uses Konami PSX-based hardware with an ATAPI CDROM drive. - Gun Mania (and probably Gun Mania Zone Plus) has no CDROM drive. + GunMania (and probably GunMania Zone Plus) has no CDROM drive. There is a slot for a security cart (cart is installed in CN14) and also a PCMCIA card slot. - The main board and CDROM drive are housed in a black metal box. Gun Mania doesn't have that box. + The main board and CDROM drive are housed in a black metal box. GunMania doesn't have that box. The games can be swapped by exchanging the CDROM disc and the security cart, whereby the main-board FlashROMs are re-programmed after a small wait. On subsequent power-ups, there is a check to test if the contents of the FlashROMs matches the CDROM, then the game boots up immediately. PCMCIA card slot is used by Dance Dance Revolution (2ndMIX link ver. and later), - GUITARFREAKS (2ndMIX link ver. and later), drummania (7thMIX and later), and Gun Mania. + GUITARFREAKS (2ndMIX link ver. and later), drummania (7thMIX and later), and GunMania. DDR and GF: 32M flash card is used to store edit data (players can edit data by PlayStation console, and send data to arcade machine via PS memory card). DM and GF: network PCB unit (for e-AMUSEMENT) is connected via PCMCIA slot. @@ -69,7 +69,7 @@ D Dance Dance Revolution EXTREME 2002.12 GCC36 JA C36 JA A02 D Dance Maniax 2000.06 GE874 JA 874 JA A(needs redump) D Dance Maniax 2ndMIX 2000.12 GCA39 JA A39 JA A02 -D *Dance Maniax 2ndMIX APPEND J PARADISE 2001.04 +D Dance Maniax 2ndMIX APPEND J PARADISE 2001.04 A Dancing Stage 1999.08 GN845 EA 845 EA(needs redump) D Dancing Stage Euro Mix 2000 GE936 EA 936 EA A(needs redump) D Dancing Stage Euro Mix 2 2000 G*C23 EA C23 EA A02 @@ -87,8 +87,8 @@ N drummania 7thMIX power-up ver. 2002.08 GEC07 JB C07 JC A02 N drummania 8thMIX 2003.04 GCC38 JA C38 JA A02 N drummania 9thMIX 2003.10 GCD09 JA D09 JA A02 -N *drummania 10thMIX 2004.04 -? *Fighting Mania 2000 +N drummania 10thMIX 2004.04 +? Fighting Mania 2000 P Fisherman's Bait 1998.06 GE765 UA 765 UA B02 P Fisherman's Bait 2 1998 GC865 UA 865 UA B02 P Fisherman's Bait Marlin Challenge 1999 GX889 889 AA/EA/JA/UA(needs redump) @@ -106,23 +106,23 @@ N GUITARFREAKS 8thMIX power-up ver. 2002.11 GEC08 JB C08 JB A02 N GUITARFREAKS 9thMIX 2003.04 GCC39 JA C39 JA A02 N GUITARFREAKS 10thMIX 2003.10 GCD10 JA D10 JA A02 -N *GUITARFREAKS 11thMIX 2004.04 -G *Gun Mania 2000.07 G?906 JA (no CD) -? *Gun Mania Zone Plus 2000.10 +N GUITARFREAKS 11thMIX 2004.04 +G GunMania 2000.07 G?906 JA (no CD) +? *GunMania Zone Plus 2000.10 P Handle Champ 1997.12 GQ710 JA (no CD) P Hyper Bishi Bashi Champ 1998.07 GC876 EA (no CD) P Hyper Bishi Bashi Champ - 2 Player 1999.08 GC908 JA 908 A02 P Jikkyou Powerful Pro Yakyuu EX 1998.04 GX802 JA 802 JA B02 -P *Jikkyou Powerful Pro Yakyuu EX 98 1998.08 -K *Kick & Kick 2001 GNA36 EA (no CD) +P Jikkyou Powerful Pro Yakyuu EX 98 1998.08 +K Kick & Kick 2001 GNA36 EA (no CD) P Konami 80's Arcade Gallery 1998.11 GC826 JA 826 JA A01 P Konami 80's AC Special 1998 GC826 UA 826 UA A01 -D *Mambo a GoGo 2001.06 +D Mambo a GoGo 2001.06 D Punchmania Hokuto no Ken 2000.03 918 JA B02 D Punchmania Hokuto no Ken 2 2000.12 A09 JA A02 P Salary Man Champ P Salary Man Champ - 2 Player 2001.02 GCA18 JA A18 JA(needs redump) -P *Step Champ 1999.12 +P Step Champ 1999.12 P: plain System573 A: uses ext. analog I/O board GX700-PWB(F) @@ -1107,8 +1107,11 @@ m_atapi_timer = machine().scheduler().timer_alloc( timer_expired_delegate( FUNC( ksys573_state::atapi_xfer_end ),this ) ); m_atapi_timer->adjust( attotime::never ); - m_available_cdroms[ 0 ] = cdrom_open(machine().rom_load().get_disk_handle(":cdrom0")); - m_available_cdroms[ 1 ] = cdrom_open(machine().rom_load().get_disk_handle(":cdrom1")); + for (int i = 0; i < 2; i++) + { + chd_file *chd = machine().rom_load().get_disk_handle(util::string_format(":cdrom%d", i)); + m_available_cdroms[ i ] = chd ? new cdrom_file(chd) : nullptr; + } save_item( NAME( m_n_security_control ) ); save_item( NAME( m_control ) ); diff -Nru mame-0.242+dfsg.1/src/mame/drivers/ktm3.cpp mame-0.243+dfsg.1/src/mame/drivers/ktm3.cpp --- mame-0.242+dfsg.1/src/mame/drivers/ktm3.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/ktm3.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -65,7 +65,7 @@ required_region_ptr m_chargen; required_shared_ptr_array m_ram; - bool m_signal; + bool m_signal = false; }; void ktm3_state::machine_start() diff -Nru mame-0.242+dfsg.1/src/mame/drivers/labyrunr.cpp mame-0.243+dfsg.1/src/mame/drivers/labyrunr.cpp --- mame-0.242+dfsg.1/src/mame/drivers/labyrunr.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/labyrunr.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -11,15 +11,299 @@ ***************************************************************************/ #include "emu.h" -#include "includes/labyrunr.h" + #include "includes/konamipt.h" +#include "video/k007121.h" +#include "video/k051733.h" #include "cpu/m6809/hd6309.h" #include "machine/watchdog.h" #include "sound/ymopn.h" +#include "emupal.h" +#include "screen.h" #include "speaker.h" +#include "tilemap.h" + + +namespace { + +class labyrunr_state : public driver_device +{ +public: + labyrunr_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this,"maincpu"), + m_k007121(*this, "k007121"), + m_gfxdecode(*this, "gfxdecode"), + m_screen(*this, "screen"), + m_palette(*this, "palette"), + m_scrollram(*this, "scrollram"), + m_spriteram(*this, "spriteram"), + m_videoram(*this, "videoram%u", 1U), + m_mainbank(*this, "mainbank") + { } + + void labyrunr(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void video_start() override; + +private: + // devices + required_device m_maincpu; + required_device m_k007121; + required_device m_gfxdecode; + required_device m_screen; + required_device m_palette; + + // memory pointers + required_shared_ptr m_scrollram; + required_shared_ptr m_spriteram; + required_shared_ptr_array m_videoram; + required_memory_bank m_mainbank; + + // video-related + tilemap_t *m_layer[2]{}; + rectangle m_clip[2]{}; + + void bankswitch_w(uint8_t data); + template void vram_w(offs_t offset, uint8_t data); + template 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); + DECLARE_WRITE_LINE_MEMBER(vblank_irq); + INTERRUPT_GEN_MEMBER(timer_interrupt); + void prg_map(address_map &map); +}; + + +// video + +void labyrunr_state::palette(palette_device &palette) const +{ + const uint8_t *color_prom = memregion("proms")->base(); + + for (int pal = 0; pal < 8; pal++) + { + if (pal & 1) + { + // chars, no lookup table + for (int i = 0; i < 0x100; i++) + palette.set_pen_indirect((pal << 8) | i, (pal << 4) | (i & 0x0f)); + } + else + { + // sprites + for (int i = 0; i < 0x100; i++) + { + uint8_t const ctabentry = !color_prom[i] ? 0 : ((pal << 4) | (color_prom[i] & 0x0f)); + + palette.set_pen_indirect((pal << 8) | i, ctabentry); + } + } + } +} + + + +/*************************************************************************** + + Callbacks for the TileMap code + +***************************************************************************/ + +template +TILE_GET_INFO_MEMBER(labyrunr_state::get_tile_info) +{ + uint8_t ctrl_3 = m_k007121->ctrlram_r(3); + uint8_t ctrl_4 = m_k007121->ctrlram_r(4); + uint8_t ctrl_5 = m_k007121->ctrlram_r(5); + uint8_t ctrl_6 = m_k007121->ctrlram_r(6); + int attr = m_videoram[Which][tile_index]; + int code = m_videoram[Which][tile_index + 0x400]; + int bit0 = (ctrl_5 >> 0) & 0x03; + int bit1 = (ctrl_5 >> 2) & 0x03; + int bit2 = (ctrl_5 >> 4) & 0x03; + int bit3 = (ctrl_5 >> 6) & 0x03; + int bank = ((attr & 0x80) >> 7) | + ((attr >> (bit0 + 2)) & 0x02) | + ((attr >> (bit1 + 1)) & 0x04) | + ((attr >> (bit2 )) & 0x08) | + ((attr >> (bit3 - 1)) & 0x10) | + ((ctrl_3 & 0x01) << 5); + int mask = (ctrl_4 & 0xf0) >> 4; + + bank = (bank & ~(mask << 1)) | ((ctrl_4 & mask) << 1); + + tileinfo.set(0, + code + bank * 256, + ((ctrl_6 & 0x30) * 2 + 16) + (attr & 7), + 0); + tileinfo.category = Which ? (attr & 0x40) >> 6 : 0; +} + + +/*************************************************************************** + + Start the video hardware emulation. + +***************************************************************************/ + +void labyrunr_state::video_start() +{ + m_layer[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(labyrunr_state::get_tile_info<0>)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); + m_layer[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(labyrunr_state::get_tile_info<1>)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); + m_layer[0]->set_transparent_pen(0); + m_layer[1]->set_transparent_pen(0); + + m_clip[0] = m_screen->visible_area(); + m_clip[0].min_x += 40; + + m_clip[1] = m_screen->visible_area(); + m_clip[1].max_x = 39; + m_clip[1].min_x = 0; + + m_layer[0]->set_scroll_cols(32); +} + + + +/*************************************************************************** + + Memory Handlers + +***************************************************************************/ + +template +void labyrunr_state::vram_w(offs_t offset, uint8_t data) +{ + m_videoram[Which][offset] = data; + m_layer[Which]->mark_tile_dirty(offset & 0x3ff); +} + + + +/*************************************************************************** + + Screen Refresh + +***************************************************************************/ + +uint32_t labyrunr_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + uint8_t ctrl_0 = m_k007121->ctrlram_r(0); + rectangle finalclip0, finalclip1; + + screen.priority().fill(0, cliprect); + bitmap.fill(m_palette->black_pen(), cliprect); + + if (~m_k007121->ctrlram_r(3) & 0x20) + { + finalclip0 = m_clip[0]; + finalclip1 = m_clip[1]; + + finalclip0 &= cliprect; + finalclip1 &= cliprect; + + m_layer[0]->set_scrollx(0, ctrl_0 - 40); + m_layer[1]->set_scrollx(0, 0); + + for (int i = 0; i < 32; i++) + { + // enable colscroll + if ((m_k007121->ctrlram_r(1) & 6) == 6) // it's probably just one bit, but it's only used once in the game so I don't know which it's + m_layer[0]->set_scrolly((i + 2) & 0x1f, m_k007121->ctrlram_r(2) + m_scrollram[i]); + else + m_layer[0]->set_scrolly((i + 2) & 0x1f, m_k007121->ctrlram_r(2)); + } + + m_layer[0]->draw(screen, bitmap, finalclip0, TILEMAP_DRAW_OPAQUE | TILEMAP_DRAW_CATEGORY(0), 0); + m_k007121->sprites_draw(bitmap, cliprect, m_gfxdecode->gfx(0), *m_palette, m_spriteram, (m_k007121->ctrlram_r(6) & 0x30) * 2, 40, 0, screen.priority(), (m_k007121->ctrlram_r(3) & 0x40) >> 5); + 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); + } + else + { + int use_clip3[2] = { 0, 0 }; + rectangle finalclip3; + + // custom cliprects needed for the weird effect used in the ending sequence to hide and show the needed part of text + finalclip0.min_y = finalclip1.min_y = cliprect.min_y; + finalclip0.max_y = finalclip1.max_y = cliprect.max_y; + + if (m_k007121->ctrlram_r(1) & 1) + { + finalclip0.min_x = cliprect.max_x - ctrl_0 + 8; + finalclip0.max_x = cliprect.max_x; + + if (ctrl_0 >= 40) + { + finalclip1.min_x = cliprect.min_x; + } + else + { + use_clip3[0] = 1; + + finalclip1.min_x = 40 - ctrl_0; + } + + finalclip1.max_x = cliprect.max_x - ctrl_0 + 8; + + } + else + { + if (ctrl_0 >= 40) + { + finalclip0.min_x = cliprect.min_x; + } + else + { + use_clip3[1] = 1; + + finalclip0.min_x = 40 - ctrl_0; + } + + finalclip0.max_x = cliprect.max_x - ctrl_0 + 8; + + finalclip1.min_x = cliprect.max_x - ctrl_0 + 8; + finalclip1.max_x = cliprect.max_x; + } + + if (use_clip3[0] || use_clip3[1]) + { + finalclip3.min_y = cliprect.min_y; + finalclip3.max_y = cliprect.max_y; + finalclip3.min_x = cliprect.min_x; + finalclip3.max_x = 40 - ctrl_0 - 8; + } + + m_layer[0]->set_scrollx(0, ctrl_0 - 40); + m_layer[1]->set_scrollx(0, ctrl_0 - 40); + + m_layer[0]->draw(screen, bitmap, finalclip0, TILEMAP_DRAW_CATEGORY(0), 0); + if (use_clip3[0]) + m_layer[0]->draw(screen, bitmap, finalclip3, TILEMAP_DRAW_CATEGORY(0), 0); + + m_k007121->sprites_draw(bitmap, cliprect, m_gfxdecode->gfx(0), *m_palette, m_spriteram, (m_k007121->ctrlram_r(6) & 0x30) * 2,40,0,screen.priority(),(m_k007121->ctrlram_r(3) & 0x40) >> 5); + + m_layer[0]->draw(screen, bitmap, finalclip0, TILEMAP_DRAW_CATEGORY(1), 0); + if (use_clip3[0]) + m_layer[0]->draw(screen, bitmap, finalclip3, TILEMAP_DRAW_CATEGORY(1), 0); + + m_layer[1]->draw(screen, bitmap, finalclip1, 0, 0); + if (use_clip3[1]) + m_layer[1]->draw(screen, bitmap, finalclip3, 0, 0); + + } + return 0; +} + + +// machine WRITE_LINE_MEMBER(labyrunr_state::vblank_irq) { @@ -27,29 +311,29 @@ m_maincpu->set_input_line(HD6309_IRQ_LINE, HOLD_LINE); } -INTERRUPT_GEN_MEMBER(labyrunr_state::labyrunr_timer_interrupt) +INTERRUPT_GEN_MEMBER(labyrunr_state::timer_interrupt) { if (m_k007121->ctrlram_r(7) & 0x01) device.execute().pulse_input_line(INPUT_LINE_NMI, attotime::zero); } -void labyrunr_state::labyrunr_bankswitch_w(uint8_t data) +void labyrunr_state::bankswitch_w(uint8_t data) { - if (data & 0xe0) popmessage("bankswitch %02x", data); + if (data & 0xe0) logerror("bankswitch %02x", data); - /* bits 0-2 = bank number */ - membank("bank1")->set_entry(data & 0x07); // shall we check if data&7 > #banks? + // bits 0-2 = bank number + m_mainbank->set_entry(data & 0x07); // shall we check if data & 7 > #banks? - /* bits 3 and 4 are coin counters */ + // bits 3 and 4 are coin counters machine().bookkeeping().coin_counter_w(0, data & 0x08); machine().bookkeeping().coin_counter_w(1, data & 0x10); } -void labyrunr_state::labyrunr_map(address_map &map) +void labyrunr_state::prg_map(address_map &map) { map(0x0000, 0x0007).w(m_k007121, FUNC(k007121_device::ctrl_w)); - map(0x0020, 0x005f).ram().share("scrollram"); + map(0x0020, 0x005f).ram().share(m_scrollram); map(0x0800, 0x0800).rw("ym1", FUNC(ym2203_device::data_r), FUNC(ym2203_device::data_w)); map(0x0801, 0x0801).rw("ym1", FUNC(ym2203_device::status_r), FUNC(ym2203_device::address_w)); map(0x0900, 0x0900).rw("ym2", FUNC(ym2203_device::data_r), FUNC(ym2203_device::data_w)); @@ -57,15 +341,15 @@ map(0x0a00, 0x0a00).portr("P2"); map(0x0a01, 0x0a01).portr("P1"); map(0x0b00, 0x0b00).portr("SYSTEM"); - map(0x0c00, 0x0c00).w(FUNC(labyrunr_state::labyrunr_bankswitch_w)); + map(0x0c00, 0x0c00).w(FUNC(labyrunr_state::bankswitch_w)); map(0x0d00, 0x0d1f).rw("k051733", FUNC(k051733_device::read), FUNC(k051733_device::write)); map(0x0e00, 0x0e00).w("watchdog", FUNC(watchdog_timer_device::reset_w)); map(0x1000, 0x10ff).ram().w(m_palette, FUNC(palette_device::write_indirect)).share("palette"); map(0x1800, 0x1fff).ram(); - map(0x2000, 0x2fff).ram().share("spriteram"); - map(0x3000, 0x37ff).ram().w(FUNC(labyrunr_state::labyrunr_vram1_w)).share("videoram1"); - map(0x3800, 0x3fff).ram().w(FUNC(labyrunr_state::labyrunr_vram2_w)).share("videoram2"); - map(0x4000, 0x7fff).bankr("bank1"); + map(0x2000, 0x2fff).ram().share(m_spriteram); + map(0x3000, 0x37ff).ram().w(FUNC(labyrunr_state::vram_w<0>)).share(m_videoram[0]); + map(0x3800, 0x3fff).ram().w(FUNC(labyrunr_state::vram_w<1>)).share(m_videoram[1]); + map(0x4000, 0x7fff).bankr(m_mainbank); map(0x8000, 0xffff).rom(); } @@ -95,7 +379,7 @@ PORT_START("DSW1") KONAMI_COINAGE_LOC(DEF_STR( Free_Play ), DEF_STR( None ), SW1) - /* "None" = coin slot B disabled */ + // "None" = coin slot B disabled PORT_START("DSW2") PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:1,2") @@ -148,7 +432,7 @@ }; static GFXDECODE_START( gfx_labyrunr ) - GFXDECODE_ENTRY( "gfx1", 0, gfxlayout, 0, 8*16 ) + GFXDECODE_ENTRY( "gfx", 0, gfxlayout, 0, 8*16 ) GFXDECODE_END /*************************************************************************** @@ -161,30 +445,30 @@ { uint8_t *ROM = memregion("maincpu")->base(); - membank("bank1")->configure_entries(0, 6, &ROM[0x10000], 0x4000); + m_mainbank->configure_entries(0, 6, &ROM[0x10000], 0x4000); } void labyrunr_state::labyrunr(machine_config &config) { - /* basic machine hardware */ - HD6309(config, m_maincpu, 3000000*4); /* 24MHz/8? */ - m_maincpu->set_addrmap(AS_PROGRAM, &labyrunr_state::labyrunr_map); - m_maincpu->set_periodic_int(FUNC(labyrunr_state::labyrunr_timer_interrupt), attotime::from_hz(4*60)); + // basic machine hardware + HD6309(config, m_maincpu, 3000000 * 4); // 24MHz / 8? + m_maincpu->set_addrmap(AS_PROGRAM, &labyrunr_state::prg_map); + m_maincpu->set_periodic_int(FUNC(labyrunr_state::timer_interrupt), attotime::from_hz(4 * 60)); WATCHDOG_TIMER(config, "watchdog"); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(60); screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); screen.set_size(37*8, 32*8); screen.set_visarea(0*8, 35*8-1, 2*8, 30*8-1); - screen.set_screen_update(FUNC(labyrunr_state::screen_update_labyrunr)); + screen.set_screen_update(FUNC(labyrunr_state::screen_update)); screen.set_palette(m_palette); screen.screen_vblank().set(FUNC(labyrunr_state::vblank_irq)); GFXDECODE(config, m_gfxdecode, m_palette, gfx_labyrunr); - PALETTE(config, m_palette, FUNC(labyrunr_state::labyrunr_palette)); + PALETTE(config, m_palette, FUNC(labyrunr_state::palette)); m_palette->set_format(palette_device::xBGR_555, 2*8*16*16, 128); K007121(config, m_k007121, 0); @@ -192,7 +476,7 @@ K051733(config, "k051733", 0); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); ym2203_device &ym1(YM2203(config, "ym1", 3000000)); @@ -219,53 +503,55 @@ ***************************************************************************/ ROM_START( tricktrp ) - ROM_REGION( 0x28000, "maincpu", 0 ) /* code + banked roms */ + ROM_REGION( 0x28000, "maincpu", 0 ) // code + banked ROMs ROM_LOAD( "771e04", 0x10000, 0x08000, CRC(ba2c7e20) SHA1(713dcc0e65bf9431f2c0df9db1210346a9476a52) ) ROM_CONTINUE( 0x08000, 0x08000 ) ROM_LOAD( "771e03", 0x18000, 0x10000, CRC(d0d68036) SHA1(8589ee07e229259341a4cc22bc64de8f06536472) ) - ROM_REGION( 0x40000, "gfx1", 0 ) - ROM_LOAD16_BYTE( "771e01a", 0x00000, 0x10000, CRC(103ffa0d) SHA1(1949c49ca3b243e4cfb5fb19ecd3a1e1492cfddd) ) /* tiles + sprites */ + ROM_REGION( 0x40000, "gfx", 0 ) + ROM_LOAD16_BYTE( "771e01a", 0x00000, 0x10000, CRC(103ffa0d) SHA1(1949c49ca3b243e4cfb5fb19ecd3a1e1492cfddd) ) // tiles + sprites ROM_LOAD16_BYTE( "771e01c", 0x00001, 0x10000, CRC(cfec5be9) SHA1(2b6a32e2608a70c47d1ec9b4de38b5c3a0898cde) ) ROM_LOAD16_BYTE( "771d01b", 0x20000, 0x10000, CRC(07f2a71c) SHA1(63c79e75e71539e69d4d9d35e629a6021124f6d0) ) ROM_LOAD16_BYTE( "771d01d", 0x20001, 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 ) - ROM_REGION( 0x28000, "maincpu", 0 ) /* code + banked roms */ + ROM_REGION( 0x28000, "maincpu", 0 ) // code + banked ROMs ROM_LOAD( "771j04.10f", 0x10000, 0x08000, CRC(354a41d0) SHA1(302e8f5c469ad3f615aeca8005ebde6b6051aaae) ) ROM_CONTINUE( 0x08000, 0x08000 ) ROM_LOAD( "771j03.08f", 0x18000, 0x10000, CRC(12b49044) SHA1(e9b22fb093cfb746a9767e94ef5deef98bed5b7a) ) - ROM_REGION( 0x40000, "gfx1", 0 ) - ROM_LOAD( "771d01.14a", 0x00000, 0x40000, CRC(15c8f5f9) SHA1(e4235e1315d0331f3ce5047834a68764ed43aa4b) ) /* tiles + sprites */ + ROM_REGION( 0x40000, "gfx", 0 ) + ROM_LOAD( "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 ) - ROM_REGION( 0x28000, "maincpu", 0 ) /* code + banked roms */ + ROM_REGION( 0x28000, "maincpu", 0 ) // code + banked ROMs ROM_LOAD( "771k04.10f", 0x10000, 0x08000, CRC(9816ab35) SHA1(6efb0332f4a62f20889f212682ee7225e4a182a9) ) ROM_CONTINUE( 0x08000, 0x08000 ) ROM_LOAD( "771k03.8f", 0x18000, 0x10000, CRC(48d732ae) SHA1(8bc7917397f32cf5f995b3763ae921725e27de05) ) - ROM_REGION( 0x40000, "gfx1", 0 ) - ROM_LOAD16_BYTE( "771d01a.13a", 0x00000, 0x10000, CRC(0cd1ed1a) SHA1(eac6c106de28acc54535ae1fb99f778c1ed4013e) ) /* tiles + sprites */ + ROM_REGION( 0x40000, "gfx", 0 ) + ROM_LOAD16_BYTE( "771d01a.13a", 0x00000, 0x10000, CRC(0cd1ed1a) SHA1(eac6c106de28acc54535ae1fb99f778c1ed4013e) ) // tiles + sprites ROM_LOAD16_BYTE( "771d01c.13a", 0x00001, 0x10000, CRC(d75521fe) SHA1(72f0c4d9511bc70d77415f50be93293026305bd5) ) ROM_LOAD16_BYTE( "771d01b", 0x20000, 0x10000, CRC(07f2a71c) SHA1(63c79e75e71539e69d4d9d35e629a6021124f6d0) ) ROM_LOAD16_BYTE( "771d01d", 0x20001, 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 + GAME( 1987, tricktrp, 0, labyrunr, labyrunr, labyrunr_state, empty_init, ROT90, "Konami", "Trick Trap (World?)", MACHINE_SUPPORTS_SAVE ) GAME( 1987, labyrunr, tricktrp, labyrunr, labyrunr, labyrunr_state, empty_init, ROT90, "Konami", "Labyrinth Runner (Japan)", MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/lependu.cpp mame-0.243+dfsg.1/src/mame/drivers/lependu.cpp --- mame-0.242+dfsg.1/src/mame/drivers/lependu.cpp 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/lependu.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,636 @@ +// license:BSD-3-Clause +// copyright-holders: Roberto Fresca, Grull Osgo +/********************************************************************************** + + Le Pendu. + Avenir Amusement Inc. + + Very rare French/English bilingual hangman style game. + Sequel of "Le Super Pendu", with better graphics among other things... + Runs in a heavily modified Bonanza Enterprises hardware. + + Driver by Roberto Fresca & Grull Osgo. + + +*********************************************************************************** + + The "mini-boy" poker games made by Bonanza Enterprises were very popular + in Quebec back in the early '80s. They were everywhere in small restaurants, + bars and convenience stores. + + Popularity faded away when the slot machines (lucky 7's) were introduced. + Many "miniboy" machines were converted to play lucky 7 slots. (A kit was + available from a local company). + + All independent gambling devices were made illegal in 1993, when the government + lottery company (lotto-Quebec) took over the video-lottery business. Thousands + of machines were stored, destroyed or seized by the police. + + To keep them alive, some of these machines were converted to Le Pendu / Hangman. + A conversion kit was proposed by a local company, developed in Quebec. + The kit includes a in-house modification of the "Bonanza" poker board, plus a new + 5 buttons plate to replace the traditional 15 poker buttons, since the game has + nothing to do with gambling (Hangman game, you need to guess a word before the + character man is hanged). + + It was not a great success, so the game is very rare. On top of that, the designer + added copy protection to his work, and the game cannot start when the battery + drains. (part of the modification was to remove the battery memory on/off switch) + + There are some critical registers and rerouted subroutines in the battery backed + RAM, hence the game dies once the battery drains. + + Here, you can see a video of the game working for refference: + https://youtu.be/e3d8KyUVL_g + + +*********************************************************************************** + + Le Pendu Bilingue (Version 04) + ------------------------------ + + Bonanza Enterpises PCB + BB-03 + + 1x Rockwell R6502AP (R6502-15) CPU. + + 2x Rockwell R6520P (R6520-11) PIAs. + 1x Hitachi HD46505SP CRTC. + + 2x 2764 program ROMs + + 1x 2764 GFX ROM. + 2x 2732 GFX ROMs. + + 2x 27C256 French words / data ROMs. + + 1x 8 DIP switches bank. + 1x 10 MHz Xtal. + + Discrete circuitry for sound. + + +**********************************************************************************/ + + +#include "emu.h" + +#include "cpu/m6502/m6502.h" +#include "machine/6821pia.h" +#include "machine/bankdev.h" +#include "machine/nvram.h" +#include "sound/discrete.h" +#include "video/mc6845.h" + +#include "emupal.h" +#include "screen.h" +#include "speaker.h" +#include "tilemap.h" + +#include "lependu.lh" + +#define MASTER_CLOCK XTAL(10'000'000) +#define CPU_CLOCK (MASTER_CLOCK/16) +#define PIXEL_CLOCK (MASTER_CLOCK/2) + + +class lependu_state : public driver_device +{ +public: + lependu_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_pia(*this, "pia%u", 0U), + m_screen(*this, "screen"), + m_gfxdecode(*this, "gfxdecode"), + m_palette(*this, "palette"), + m_discrete(*this, "discrete"), + m_videoram(*this, "videoram"), + m_colorram(*this, "colorram"), + m_bank(*this, "bank%u", 0U), + m_input(*this, "IN.%u", 0U), + m_lamps(*this, "lamp%u", 0U) + { } + + void lependu(machine_config &config); + + void init_lependu(); + + void lamps_w(uint8_t data); + void sound_w(uint8_t data); + void mux_w(uint8_t data); + + uint32_t screen_update_lependu(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + + virtual void video_start() override; + + void lependu_videoram_w(offs_t offset, uint8_t data); + void lependu_colorram_w(offs_t offset, uint8_t data); + + required_device m_maincpu; + required_device_array m_pia; + required_device m_screen; + required_device m_gfxdecode; + required_device m_palette; + required_device m_discrete; + +private: + TILE_GET_INFO_MEMBER(get_bg_tile_info); + void lependu_palette(palette_device &palette) const; + void lependu_map(address_map &map); + + uint8_t lependu_mux_port_r(); + + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + required_memory_bank_array<2> m_bank; + required_ioport_array<4> m_input; + output_finder<5> m_lamps; + + tilemap_t *m_bg_tilemap = nullptr; + uint8_t m_mux_data = 0xff; +}; + + +/********************************************* +* Video Hardware * +*********************************************/ + +void lependu_state::lependu_videoram_w(offs_t offset, uint8_t data) +{ + m_videoram[offset] = data; + m_bg_tilemap->mark_tile_dirty(offset); +} + +void lependu_state::lependu_colorram_w(offs_t offset, uint8_t data) +{ + m_colorram[offset] = data; + m_bg_tilemap->mark_tile_dirty(offset); +} + + +TILE_GET_INFO_MEMBER(lependu_state::get_bg_tile_info) +{ +/* - bits - + 7654 3210 + ---x xxx- Color + -xx- ---- Bank + x--- ---x Unknown/Unused +*/ + int attr = m_colorram[tile_index]; + int code = m_videoram[tile_index]; + int bank = (attr & 0x60) >> 5; // bits 5-6 switch the gfx banks + int color; + + if (bank == 3) + color = ((attr & 0x1e) >> 1 ); + else + color = ((attr & 0x1e) >> 2 ); + + tileinfo.set(bank, code, color, 0); +} + + +void lependu_state::video_start() +{ + m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(lependu_state::get_bg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); +} + +uint32_t lependu_state::screen_update_lependu(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ + m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); + return 0; +} + + +void lependu_state::lependu_palette(palette_device &palette) const +{ +/* prom bits + 7654 3210 + ---- ---x red component. + ---- --x- green component. + ---- -x-- blue component. + ---- x--- intensity. + xxxx ---- unused. +*/ + + // 0000IBGR + uint8_t const *const color_prom = memregion("proms")->base(); + if (!color_prom) + return; + + for (int i = 0; i < palette.entries(); i++) + { + constexpr int intenmin = 0xe0; + constexpr int intenmax = 0xff; // 3.3 Volts (the whole range) + + // intensity component + int const inten = BIT(color_prom[i], 3); + + // red component + int const r = BIT(color_prom[i], 0) * (inten ? intenmax : intenmin); + + // green component + int const g = BIT(color_prom[i], 1) * (inten ? intenmax : intenmin); + + // blue component + int const b = BIT(color_prom[i], 2) * (inten ? intenmax : intenmin); + + palette.set_pen_color(i, rgb_t(r, g, b)); + } +} + + +/******************************************* +* R/W Handlers * +*******************************************/ + +void lependu_state::mux_w(uint8_t data) +{ + m_bank[0]->set_entry(data & 0x03); + m_bank[1]->set_entry(data & 0x03); + m_mux_data = data; +} + +uint8_t lependu_state::lependu_mux_port_r() +{ + uint8_t data = 0xff; + + for (int i = 0; i < 4 ; i++) + if (BIT(~m_mux_data, i + 4)) + data &= m_input[i]->read(); + + return data; +} + + +/******************************************* +* Lamps and Outputs * +*******************************************/ + +void lependu_state::lamps_w(uint8_t data) +{ +/********** General Lamps wiring *********** + + 7654 3210 + ---- ---x Unused. + ---- --x- Unused. + ---- -x-- Unused. + ---- x--- Button 5. + ---x ---- Button 2. + --x- ---- Button 3. + -x-- ---- Button 1. + x--- ---- Button 4. + +*/ + for (int i = 0; i < 5 ; i++) + m_lamps[i] = BIT(~data, i + 3); +} + + +void lependu_state::sound_w(uint8_t data) +{ + // 555 voltage controlled + logerror("Sound Data: %2x\n",data & 0x0f); + + // discrete sound is connected to PIA1, portA: bits 0-3 + m_discrete->write(NODE_01, data >> 3 & 0x01); + m_discrete->write(NODE_10, data & 0x07); +} + + +/********************************************* +* Memory Map Information * +*********************************************/ + +void lependu_state::lependu_map(address_map &map) +{ + map(0x0000, 0x07ff).ram().share("nvram"); + map(0x10b0, 0x10b0).w("crtc", FUNC(mc6845_device::address_w)); + map(0x10b1, 0x10b1).rw("crtc", FUNC(mc6845_device::register_r), FUNC(mc6845_device::register_w)); + map(0x10f4, 0x10f7).rw("pia0", FUNC(pia6821_device::read), FUNC(pia6821_device::write)); + map(0x10f8, 0x10fb).rw("pia1", FUNC(pia6821_device::read), FUNC(pia6821_device::write)); + map(0x0800, 0x0bff).ram().w(FUNC(lependu_state::lependu_videoram_w)).share("videoram"); + map(0x0c00, 0x0fff).ram().w(FUNC(lependu_state::lependu_colorram_w)).share("colorram"); + map(0x8000, 0x9fff).bankr("bank0"); + map(0xa000, 0xbfff).bankr("bank1"); + map(0xc000, 0xffff).rom(); +} + + +/********************************************* +* Input Ports * +*********************************************/ + +static INPUT_PORTS_START(lependu) + // Multiplexed - 4x5bits + PORT_START("IN.0") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Stats / Meters") + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_POKER_HOLD4 ) PORT_NAME("Button 4 / Stats Input Test") + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_POKER_HOLD1 ) PORT_NAME("Button 1") + 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("IN.1") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_POKER_HOLD5 ) PORT_NAME("Button 5 / Stats Exit") + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_POKER_HOLD2 ) PORT_NAME("Button 2") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_POKER_HOLD3 ) PORT_NAME("Button 3") + 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("IN.2") + PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("IN.3") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Audit") // audit? (inside the game) to check... + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) // 25c coin + 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("SW1") + PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + + PORT_START("SW2") + PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) +INPUT_PORTS_END + + +/********************************************* +* Graphics Layouts * +*********************************************/ + +static const gfx_layout tilelayout = +{ + 8, 8, + 0x100, + 3, + { 0, RGN_FRAC(1,3), RGN_FRAC(2,3) }, + { 0, 1, 2, 3, 4, 5, 6, 7 }, + { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, + 8*8 +}; + +/************************************************** +* Graphics Decode Information * +**************************************************/ + +static GFXDECODE_START( gfx_lependu ) + GFXDECODE_ENTRY( "gfx1", 0, tilelayout, 0, 16 ) + GFXDECODE_ENTRY( "gfx1", 0x0800, tilelayout, 0, 16 ) + GFXDECODE_ENTRY( "gfx1", 0x1000, tilelayout, 0, 16 ) + GFXDECODE_ENTRY( "gfx2", 0, tilelayout, 0, 16 ) +GFXDECODE_END + + +/********************************************************** +* Discrete Sound Routines * +*********************************************************** + + Pendu discrete sound circuitry. + ------------------------------- + + +12V .--------+---------------. +5V + | | | | | + .--+ | Z +-------+ + | | 8| Z 1K | PC617 | + Z Z +----+----+ Z +-------+ + 330K Z Z 47K | VCC |3 | 20K 1uF | | + Z Z 1.7uF | Q|---|--ZZZZZ--||---+ Z 1uF 6|\ + | | .-||-- GND | |7 | | 1K Z<--||--+--------| \ + | | 30K | 4| DIS|---+ Z Z | LM380| \ 220uF + PA0 ---|--|--ZZZZZ--. | .-----|R | | 2.2K Z | Z | 8>--||----> Audio Out. + | | | | | | 555 | Z Z -+- 10K Z 7+-| / + | | 15K | | | 5| | Z 10K | GND Z 3+-| /-.1 .---> Audio Out. + PA1 ---+--|--ZZZZZ--+--+------|-----|CV | Z | | 2+-|/ | | + | | | 2| |6 | | | | | | + | 7.5K | | .--|TR THR|---+---||---------+-------------+ +-||--' | + PA2 ------+--ZZZZZ--' |\ | | | GND | | | | | + | \ | | +----+----+ | .1uF | | 10uF | + 9| \ | | 1| | -+- | | + PA3 -------------------| 8>--' | -+- | GND +----------' + 4069 | / | GND | | + | / | | -+- + |/ '----------------' GND +*/ + +static const discrete_555_desc lependu_555_vco_desc = + {DISC_555_OUT_DC | DISC_555_OUT_ENERGY, 5, DEFAULT_555_VALUES}; + +static const discrete_dac_r1_ladder dac_lependu_ladder = +{ + 3, // size of ladder + {RES_K(30), RES_K(15), RES_K(7.5)}, // elements + +/* external vBias doesn't seems to be accurate. + using the 555 internal values sound better. +*/ + 5, // voltage Bias resistor is tied to + RES_K(5), // additional resistor tied to vBias + RES_K(10), // resistor tied to ground + + CAP_U(4.7) // filtering cap tied to ground +}; + +static DISCRETE_SOUND_START( lependu_discrete ) +/* + - bits - + 76543210 + -------- + .....xxx --> sound data. + ....x... --> enable/disable. + +*/ + DISCRETE_INPUT_NOT (NODE_01) // bit 3: enable/disable + DISCRETE_INPUT_DATA (NODE_10) // bits 0-2: sound data + + DISCRETE_DAC_R1(NODE_20, NODE_10, 5, &dac_lependu_ladder) + + DISCRETE_555_ASTABLE_CV(NODE_30, NODE_01, RES_K(1), RES_K(10), CAP_U(.1), NODE_20, &lependu_555_vco_desc) + DISCRETE_OUTPUT(NODE_30, 3000) + +DISCRETE_SOUND_END + + +/****************************************** +* Machine Start & Reset * +******************************************/ + +void lependu_state::machine_start() +{ + m_lamps.resolve(); + + uint8_t *ROM1 = memregion("data1")->base(); + uint8_t *ROM2 = memregion("data2")->base(); + m_bank[0]->configure_entries(0, 4, &ROM1[0], 0x2000); + m_bank[1]->configure_entries(0, 4, &ROM2[0], 0x2000); +} + +void lependu_state::machine_reset() +{ + m_bank[0]->set_entry(0); + m_bank[1]->set_entry(0); +} + + +/********************************************* +* Machine Drivers * +*********************************************/ + +void lependu_state::lependu(machine_config &config) +{ + // basic machine hardware + M6502(config, m_maincpu, CPU_CLOCK); + m_maincpu->set_addrmap(AS_PROGRAM, &lependu_state::lependu_map); + + NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); + + PIA6821(config, m_pia[0], 0); + m_pia[0]->readpa_handler().set(FUNC(lependu_state::lependu_mux_port_r)); + m_pia[0]->writepb_handler().set(FUNC(lependu_state::lamps_w)); + + PIA6821(config, m_pia[1], 0); + m_pia[1]->readpa_handler().set_ioport("SW1"); + m_pia[1]->readpb_handler().set_ioport("SW2"); + m_pia[1]->writepa_handler().set(FUNC(lependu_state::sound_w)); + m_pia[1]->writepb_handler().set(FUNC(lependu_state::mux_w)); // mux + bankswitch + + // video hardware + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_raw(PIXEL_CLOCK, (39 + 1) * 8, 0, 32 * 8, ((31 + 1) * 8) + 4, 0, 29 * 8); // from MC6845 parameters + m_screen->set_screen_update(FUNC(lependu_state::screen_update_lependu)); + + mc6845_device &crtc(HD6845S(config, "crtc", CPU_CLOCK)); // Hitachi HD46505SP + crtc.set_screen("screen"); + crtc.set_show_border_area(false); + crtc.set_char_width(8); + crtc.out_vsync_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0); + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_lependu); + PALETTE(config, m_palette, FUNC(lependu_state::lependu_palette), 256); + + // sound hardware + SPEAKER(config, "mono").front_center(); + DISCRETE(config, m_discrete, lependu_discrete).add_route(ALL_OUTPUTS, "mono", 1.0); +} + + +/********************************************* +* Rom Load * +*********************************************/ + +ROM_START( lependu ) + ROM_REGION( 0x10000, "maincpu", 0 ) // program ROMs + ROM_LOAD( "000401.11a", 0xc000, 0x2000, CRC(8f6a5d0c) SHA1(a139796dce307bb50994edc20ea4ea3534fe79ff) ) + ROM_LOAD( "000402.10a", 0xe000, 0x2000, CRC(79fb6a44) SHA1(1d95c77c4169925530c4313cf37c3b6633911737) ) + + ROM_REGION( 0x08000, "data1", 0 ) // banked data + ROM_LOAD( "fra_04.12a", 0x0000, 0x8000, CRC(60b9a387) SHA1(b455f7e955869308dcc5709db34a478f08dc69bb) ) + ROM_REGION( 0x08000, "data2", 0 ) // banked data + ROM_LOAD( "fra_05.14a", 0x0000, 0x8000, CRC(5834b8e3) SHA1(f4377b54761ae934ff2c09c2808424e2b4a44898) ) + + ROM_REGION( 0x6000, "gfx1", 0 ) + ROM_FILL( 0x0000, 0x4000, 0x0000 ) // filling the R-G bitplanes + ROM_LOAD( "1y.3a", 0x4000, 0x2000, CRC(ae0e37f8) SHA1(2e3404c55b92a7f9ec72d7b96bbea95ee028026c) ) // chars / multicolor tiles, bitplane 3 + + ROM_REGION( 0x1800, "gfx2", 0 ) + ROM_LOAD( "3y.1a", 0x0000, 0x0800, CRC(ea868221) SHA1(fcf9a840537feb28c9fb65b58b9a41b2412aa4ef) ) // multicolor tiles, bitplane2 + ROM_CONTINUE( 0x0000, 0x0800) // discarding 1st half + ROM_LOAD( "2y.2a", 0x0800, 0x0800, CRC(6d1da4bb) SHA1(dc8c70faa301e2f7e9089d38e0ef618e8352e569) ) // multicolor tiles, bitplane1 + ROM_CONTINUE( 0x0800, 0x0800) // discarding 1st half + ROM_COPY( "gfx1", 0x5800, 0x1000, 0x0800 ) // multicolor tiles, bitplane3. found in the 3rd quarter of the chars rom + + ROM_REGION( 0x0100, "proms", 0 ) + ROM_LOAD( "mini.5d", 0x0000, 0x0100, CRC(7f31066b) SHA1(15420780ec6b2870fc4539ec3afe4f0c58eedf12) ) +ROM_END + + +/********************************************* +* Driver Init * +*********************************************/ + +void lependu_state::init_lependu() +{ + uint8_t *ROM = memregion("maincpu")->base(); + +/* break the loop at $cc53 that prevents to start a game + + $cc53 lda $01c4 + $cc56 bne $cc53 +*/ + ROM[0xcc56] = 0xea; + ROM[0xcc57] = 0xea; + + // patch to allow a second game... + ROM[0xcc18] = 0x00; + + // fix checksum to avoid RAM clear + ROM[0xdd79] = 0xb7; +} + + +/********************************************* +* Game Drivers * +*********************************************/ + +// YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS LAYOUT +GAMEL( 198?, lependu, 0, lependu, lependu, lependu_state, init_lependu, ROT0, "Avenir Amusement Inc.", "Le Pendu (Bilingue, Version 04)", 0, layout_lependu ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/liberate.cpp mame-0.243+dfsg.1/src/mame/drivers/liberate.cpp --- mame-0.242+dfsg.1/src/mame/drivers/liberate.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/liberate.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -574,17 +574,6 @@ * *************************************/ -static const gfx_layout charlayout = -{ - 8,8, - RGN_FRAC(1,3), - 3, - { RGN_FRAC(2,3), RGN_FRAC(1,3), RGN_FRAC(0,3) }, - { 0,1,2,3,4,5,6,7 }, - { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, - 8*8 -}; - static const gfx_layout sprites = { 16,16, @@ -657,28 +646,28 @@ static GFXDECODE_START( gfx_liberate ) - GFXDECODE_ENTRY( "gfx1", 0x00000, charlayout, 0, 4 ) - GFXDECODE_ENTRY( "gfx1", 0x00000, sprites, 0, 4 ) - GFXDECODE_ENTRY( "gfx2", 0x00000, tiles1, 0, 4 ) - GFXDECODE_ENTRY( "gfx2", 0x00000, tiles2, 0, 4 ) + GFXDECODE_ENTRY( "gfx1", 0x00000, gfx_8x8x3_planar, 0, 4 ) + GFXDECODE_ENTRY( "gfx1", 0x00000, sprites, 0, 4 ) + GFXDECODE_ENTRY( "gfx2", 0x00000, tiles1, 0, 4 ) + GFXDECODE_ENTRY( "gfx2", 0x00000, tiles2, 0, 4 ) GFXDECODE_END static GFXDECODE_START( gfx_prosport ) - GFXDECODE_ENTRY( "prosport_fg_gfx", 0x00000, charlayout, 0, 4 ) - GFXDECODE_ENTRY( "protenns_fg_gfx", 0x00000, charlayout, 0, 4 ) - GFXDECODE_ENTRY( "probowl_fg_gfx", 0x00000, charlayout, 0, 4 ) - GFXDECODE_ENTRY( "progolf_fg_gfx", 0x00000, charlayout, 0, 4 ) - GFXDECODE_ENTRY( "prosport_fg_gfx", 0x00000, sprites, 0, 4 ) - GFXDECODE_ENTRY( "protenns_fg_gfx", 0x00000, sprites, 0, 4 ) - GFXDECODE_ENTRY( "probowl_fg_gfx", 0x00000, sprites, 0, 4 ) - GFXDECODE_ENTRY( "progolf_fg_gfx", 0x00000, sprites, 0, 4 ) - GFXDECODE_ENTRY( "gfx2", 0x00000, pro_tiles, 0, 4 ) //backgrounds + GFXDECODE_ENTRY( "prosport_fg_gfx", 0x00000, gfx_8x8x3_planar, 0, 4 ) + GFXDECODE_ENTRY( "protenns_fg_gfx", 0x00000, gfx_8x8x3_planar, 0, 4 ) + GFXDECODE_ENTRY( "probowl_fg_gfx", 0x00000, gfx_8x8x3_planar, 0, 4 ) + GFXDECODE_ENTRY( "progolf_fg_gfx", 0x00000, gfx_8x8x3_planar, 0, 4 ) + GFXDECODE_ENTRY( "prosport_fg_gfx", 0x00000, sprites, 0, 4 ) + GFXDECODE_ENTRY( "protenns_fg_gfx", 0x00000, sprites, 0, 4 ) + GFXDECODE_ENTRY( "probowl_fg_gfx", 0x00000, sprites, 0, 4 ) + GFXDECODE_ENTRY( "progolf_fg_gfx", 0x00000, sprites, 0, 4 ) + GFXDECODE_ENTRY( "gfx2", 0x00000, pro_tiles, 0, 4 ) //backgrounds GFXDECODE_END static GFXDECODE_START( gfx_prosoccr ) - GFXDECODE_ENTRY( "fg_gfx", 0x00000, charlayout, 0, 4 ) - GFXDECODE_ENTRY( "sp_gfx", 0x00000, sprites, 0, 4 ) - GFXDECODE_ENTRY( "bg_gfx", 0x00000, prosoccr_bg_gfx, 8, 2 ) + GFXDECODE_ENTRY( "fg_gfx", 0x00000, gfx_8x8x3_planar, 0, 4 ) + GFXDECODE_ENTRY( "sp_gfx", 0x00000, sprites, 0, 4 ) + GFXDECODE_ENTRY( "bg_gfx", 0x00000, prosoccr_bg_gfx, 8, 2 ) GFXDECODE_END /************************************* diff -Nru mame-0.242+dfsg.1/src/mame/drivers/lk3000.cpp mame-0.243+dfsg.1/src/mame/drivers/lk3000.cpp --- mame-0.242+dfsg.1/src/mame/drivers/lk3000.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/lk3000.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -21,7 +21,6 @@ - CPU + 1KB battery-backed RAM (2*NEC D444) TODO: -- external rom access doesn't work ("german" locks up) - external ram should be battery-backed ******************************************************************************/ @@ -33,6 +32,7 @@ #include "cpu/f8/f8.h" #include "machine/f3853.h" #include "video/dl1416.h" + #include "softlist_dev.h" // internal artwork @@ -155,11 +155,11 @@ data |= m_inputs[~m_p4 & 7]->read(); // read rom data - if (~m_p5 & 0x20) + if (m_p0 & 0x80) { - // P00-P06: A0-A6, P50-P54: A7-A11, P07 selects chip - u16 offset = (~m_p0 & 0x7f) | (~m_p5 << 7 & 0xf80) | (~m_p0 << 5 & 0x1000); - data |= m_cart->read_rom(offset + 0x800); + // P00-P06: A0-A6, P50-P54: A7-A11, P55 selects chip + u16 offset = (~m_p0 & 0x7f) | (~m_p5 << 7 & 0x1f80); + data |= ~m_cart->read_rom(offset + 0x800); } // read ram data @@ -352,4 +352,4 @@ ******************************************************************************/ // YEAR NAME PARENT COMP MACHINE INPUT STATE INIT COMPANY, FULLNAME, FLAGS -CONS( 1979, lk3000, 0, 0, lk3000, lk3000, lk3000_state, empty_init, "Lexicon", "LK-3000", MACHINE_NOT_WORKING | MACHINE_NO_SOUND_HW | MACHINE_SUPPORTS_SAVE ) +COMP( 1979, lk3000, 0, 0, lk3000, lk3000, lk3000_state, empty_init, "Lexicon", "LK-3000", MACHINE_NO_SOUND_HW | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/looping.cpp mame-0.243+dfsg.1/src/mame/drivers/looping.cpp --- mame-0.242+dfsg.1/src/mame/drivers/looping.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/looping.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -99,6 +99,7 @@ m_aysnd(*this, "aysnd"), m_tms(*this, "tms"), m_dac(*this, "dac"), + m_soundlatch(*this, "soundlatch"), m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette"), m_watchdog(*this, "watchdog") @@ -132,7 +133,8 @@ DECLARE_READ_LINE_MEMBER(cop_serial_r); void cop_l_w(uint8_t data); uint8_t protection_r(); - DECLARE_WRITE_LINE_MEMBER(spcint); + [[maybe_unused]] DECLARE_WRITE_LINE_MEMBER(spcint); + DECLARE_WRITE_LINE_MEMBER(int_update); void sound_sw(uint8_t data); DECLARE_WRITE_LINE_MEMBER(ay_enable_w); DECLARE_WRITE_LINE_MEMBER(speech_enable_w); @@ -161,6 +163,7 @@ required_device m_aysnd; required_device m_tms; required_device m_dac; + required_device m_soundlatch; required_device m_gfxdecode; required_device m_palette; required_device m_watchdog; @@ -382,7 +385,7 @@ { logerror("Soundint clr = %d\n", state); if (state == 0) - m_audiocpu->set_input_line(0, CLEAR_LINE); + m_soundlatch->acknowledge_w(); } @@ -393,6 +396,18 @@ } +WRITE_LINE_MEMBER(looping_state::int_update) +{ + // hack necessitated by flawed input logic in TMS9980A core + if (m_soundlatch->pending_r()) + m_audiocpu->set_input_line(INT_9980A_LEVEL2, ASSERT_LINE); + else if (!m_tms->intq_r()) + m_audiocpu->set_input_line(INT_9980A_LEVEL4, ASSERT_LINE); + else + m_audiocpu->set_input_line(INT_9980A_CLEAR, CLEAR_LINE); +} + + /************************************* * * Custom DAC handling @@ -482,7 +497,7 @@ void looping_state::cop_l_w(uint8_t data) { m_cop_port_l = data; - logerror("%02x ",data); + //logerror("%02x ",data); } uint8_t looping_state::protection_r() @@ -644,14 +659,18 @@ // sound hardware SPEAKER(config, "speaker").front_center(); - GENERIC_LATCH_8(config, "soundlatch").data_pending_callback().set_inputline(m_audiocpu, INT_9980A_LEVEL2); + GENERIC_LATCH_8(config, m_soundlatch); + //m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INT_9980A_LEVEL2); + m_soundlatch->data_pending_callback().set(FUNC(looping_state::int_update)); + m_soundlatch->set_separate_acknowledge(true); AY8910(config, m_aysnd, 8_MHz_XTAL / 4); m_aysnd->port_a_read_callback().set("soundlatch", FUNC(generic_latch_8_device::read)); m_aysnd->add_route(ALL_OUTPUTS, "speaker", 0.2); TMS5220(config, m_tms, 640'000); - m_tms->irq_cb().set(FUNC(looping_state::spcint)); + //m_tms->irq_cb().set(FUNC(looping_state::spcint)); + m_tms->irq_cb().set(FUNC(looping_state::int_update)); m_tms->add_route(ALL_OUTPUTS, "speaker", 0.5); DAC_2BIT_R2R(config, m_dac, 0).add_route(ALL_OUTPUTS, "speaker", 0.15); // unknown DAC diff -Nru mame-0.242+dfsg.1/src/mame/drivers/ltd.cpp mame-0.243+dfsg.1/src/mame/drivers/ltd.cpp --- mame-0.242+dfsg.1/src/mame/drivers/ltd.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/ltd.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -809,31 +809,31 @@ } // Anonymous namespace // system 3, 2-player, with beep sounds, playable -GAME(1981, arizona, 0, ltd3, ltd3, ltd3_state, init_0, ROT0, "LTD", "Arizona", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1981, atla_ltd, 0, ltd3, ltd3, ltd3_state, init_0, ROT0, "LTD", "Atlantis (LTD)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1981, discodan, 0, ltd3, ltd3, ltd3_state, init_0, ROT0, "LTD", "Disco Dancing", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1981, hustlerp, 0, ltd3, ltd3, ltd3_state, init_0, ROT0, "LTD", "Hustler", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1981, marqueen, 0, ltd3, ltd3, ltd3_state, init_0, ROT0, "LTD", "Martian Queen", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1981, kkongltd, 0, ltd3, ltd3, ltd3_state, init_0, ROT0, "LTD", "King Kong", MACHINE_IS_SKELETON_MECHANICAL) -GAME(198?, vikngkng, 0, ltd3, ltd3, ltd3_state, init_0, ROT0, "LTD", "Viking King", MACHINE_IS_SKELETON_MECHANICAL) +GAME(1981, arizona, 0, ltd3, ltd3, ltd3_state, init_0, ROT0, "LTD", "Arizona", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1981, atla_ltd, 0, ltd3, ltd3, ltd3_state, init_0, ROT0, "LTD", "Atlantis (LTD)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1981, discodan, 0, ltd3, ltd3, ltd3_state, init_0, ROT0, "LTD", "Disco Dancing", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1981, hustlerp, 0, ltd3, ltd3, ltd3_state, init_0, ROT0, "LTD", "Hustler", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1981, marqueen, 0, ltd3, ltd3, ltd3_state, init_0, ROT0, "LTD", "Martian Queen", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1981, kkongltd, 0, ltd3, ltd3, ltd3_state, init_0, ROT0, "LTD", "King Kong", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(198?, vikngkng, 0, ltd3, ltd3, ltd3_state, init_0, ROT0, "LTD", "Viking King", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // system 3, 2-player, unknown sound system, playable -GAME(1981, force, 0, ltd3, ltd3, ltd3_state, init_1, ROT0, "LTD", "Force", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1981, bhol_ltd, 0, ltd3, ltd3, ltd3_state, init_2, ROT0, "LTD", "Black Hole (LTD)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1981, spcpoker, 0, ltd3, ltd3, ltd3_state, init_2, ROT0, "LTD", "Space Poker", MACHINE_IS_SKELETON_MECHANICAL) +GAME(1981, force, 0, ltd3, ltd3, ltd3_state, init_1, ROT0, "LTD", "Force", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1981, bhol_ltd, 0, ltd3, ltd3, ltd3_state, init_2, ROT0, "LTD", "Black Hole (LTD)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1981, spcpoker, 0, ltd3, ltd3, ltd3_state, init_2, ROT0, "LTD", "Space Poker", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // system 3, 3-player, ay sounds, unplayable -GAME(1981, cowboy, 0, ltd3, ltd3, ltd3_state, init_3, ROT0, "LTD", "Cowboy Eight Ball (set 1)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1981, cowboya, cowboy, ltd3, ltd3, ltd3_state, init_3, ROT0, "LTD", "Cowboy Eight Ball (set 2)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1981, zephy, 0, ltd3, ltd3, ltd3_state, init_3, ROT0, "LTD", "Zephy (set 1)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1981, zephya, zephy, ltd3, ltd3, ltd3_state, init_3, ROT0, "LTD", "Zephy (set 2)", MACHINE_IS_SKELETON_MECHANICAL) +GAME(1981, cowboy, 0, ltd3, ltd3, ltd3_state, init_3, ROT0, "LTD", "Cowboy Eight Ball (set 1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1981, cowboya, cowboy, ltd3, ltd3, ltd3_state, init_3, ROT0, "LTD", "Cowboy Eight Ball (set 2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1981, zephy, 0, ltd3, ltd3, ltd3_state, init_3, ROT0, "LTD", "Zephy (set 1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1981, zephya, zephy, ltd3, ltd3, ltd3_state, init_3, ROT0, "LTD", "Zephy (set 2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // system 4, mostly 4-player, ay sounds, unplayable -GAME(1982, cowboy2, 0, ltd4, ltd4, ltd4_state, empty_init, ROT0, "LTD", "Cowboy Eight Ball 2", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1981, hhotel, 0, ltd4, ltd4, ltd4_state, empty_init, ROT0, "LTD", "Haunted Hotel", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1981, pecmen, 0, ltd4, ltd4, ltd4_state, empty_init, ROT0, "LTD", "Mr. & Mrs. Pec-Men", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1981, alcapone, 0, ltd4, ltd4, ltd4_state, empty_init, ROT0, "LTD", "Al Capone", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1982, columbia, 0, ltd4, ltd4, ltd4_state, empty_init, ROT0, "LTD", "Columbia", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1981, tmacltd4, 0, ltd4, ltd4, ltd4_state, empty_init, ROT0, "LTD", "Time Machine (LTD, 4 players)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1981, tmacltd2, tmacltd4, ltd4, ltd4, ltd4_state, empty_init, ROT0, "LTD", "Time Machine (LTD, 2 players)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1982, tricksht, 0, ltd4, ltd4, ltd4_state, empty_init, ROT0, "LTD", "Trick Shooter", MACHINE_IS_SKELETON_MECHANICAL) +GAME(1982, cowboy2, 0, ltd4, ltd4, ltd4_state, empty_init, ROT0, "LTD", "Cowboy Eight Ball 2", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1981, hhotel, 0, ltd4, ltd4, ltd4_state, empty_init, ROT0, "LTD", "Haunted Hotel", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1981, pecmen, 0, ltd4, ltd4, ltd4_state, empty_init, ROT0, "LTD", "Mr. & Mrs. Pec-Men", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1981, alcapone, 0, ltd4, ltd4, ltd4_state, empty_init, ROT0, "LTD", "Al Capone", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1982, columbia, 0, ltd4, ltd4, ltd4_state, empty_init, ROT0, "LTD", "Columbia", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1981, tmacltd4, 0, ltd4, ltd4, ltd4_state, empty_init, ROT0, "LTD", "Time Machine (LTD, 4 players)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1981, tmacltd2, tmacltd4, ltd4, ltd4, ltd4_state, empty_init, ROT0, "LTD", "Time Machine (LTD, 2 players)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1982, tricksht, 0, ltd4, ltd4, ltd4_state, empty_init, ROT0, "LTD", "Trick Shooter", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/m14.cpp mame-0.243+dfsg.1/src/mame/drivers/m14.cpp --- mame-0.242+dfsg.1/src/mame/drivers/m14.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/m14.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -394,19 +394,8 @@ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, m14_state,right_coin_inserted, 0) //coin x 1 INPUT_PORTS_END -static const gfx_layout charlayout = -{ - 8,8, - RGN_FRAC(1,1), - 1, - { RGN_FRAC(0,1) }, - { 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_m14 ) - GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 0x10 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x1, 0, 0x10 ) GFXDECODE_END INTERRUPT_GEN_MEMBER(m14_state::m14_irq) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/m62.cpp mame-0.243+dfsg.1/src/mame/drivers/m62.cpp --- mame-0.242+dfsg.1/src/mame/drivers/m62.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/m62.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -771,19 +771,6 @@ - -static const gfx_layout tile_charlayout = -{ - 8,8, - RGN_FRAC(1,3), - 3, - { RGN_FRAC(2,3), RGN_FRAC(1,3), 0 }, - { 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 const gfx_layout battroad_charlayout = { 8,8, /* 8*8 characters */ @@ -864,7 +851,7 @@ GFXDECODE_END static GFXDECODE_START( gfx_m62_tiles ) - GFXDECODE_ENTRY( "gfx1", 0, tile_charlayout, 0, 32 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x3_planar, 0, 32 ) GFXDECODE_END /* per game modified decodes */ @@ -874,7 +861,7 @@ GFXDECODE_END static GFXDECODE_START( gfx_m62_tiles_spelunk2 ) - GFXDECODE_ENTRY( "gfx1", 0, tile_charlayout, 0, 64 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x3_planar, 0, 64 ) GFXDECODE_END static GFXDECODE_START( gfx_m62_tiles_youjyudn ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/m63.cpp mame-0.243+dfsg.1/src/mame/drivers/m63.cpp --- mame-0.242+dfsg.1/src/mame/drivers/m63.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/m63.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -664,28 +664,6 @@ INPUT_PORTS_END -static const gfx_layout charlayout = -{ - 8,8, - RGN_FRAC(1,2), - 2, - { RGN_FRAC(1,2), RGN_FRAC(0,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 const gfx_layout tilelayout = -{ - 8,8, - RGN_FRAC(1,3), - 3, - { RGN_FRAC(2,3), RGN_FRAC(1,3), RGN_FRAC(0,3) }, - { 0, 1, 2, 3, 4, 5, 6, 7 }, - { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, - 8*8 -}; - static const gfx_layout spritelayout = { 16,16, @@ -701,15 +679,15 @@ }; static GFXDECODE_START( gfx_m63 ) - GFXDECODE_ENTRY( "gfx1", 0, charlayout, 256, 1 ) - GFXDECODE_ENTRY( "gfx2", 0, tilelayout, 0, 32 ) - GFXDECODE_ENTRY( "gfx3", 0, spritelayout, 0, 32 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x2_planar, 256, 1 ) + GFXDECODE_ENTRY( "gfx2", 0, gfx_8x8x3_planar, 0, 32 ) + GFXDECODE_ENTRY( "gfx3", 0, spritelayout, 0, 32 ) GFXDECODE_END static GFXDECODE_START( gfx_fghtbskt ) - GFXDECODE_ENTRY( "gfx1", 0, charlayout, 16, 1 ) - GFXDECODE_ENTRY( "gfx2", 0, tilelayout, 0, 32 ) - GFXDECODE_ENTRY( "gfx3", 0, spritelayout, 0, 32 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x2_planar, 16, 1 ) + GFXDECODE_ENTRY( "gfx2", 0, gfx_8x8x3_planar, 0, 32 ) + GFXDECODE_ENTRY( "gfx3", 0, spritelayout, 0, 32 ) GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/m90.cpp mame-0.243+dfsg.1/src/mame/drivers/m90.cpp --- mame-0.242+dfsg.1/src/mame/drivers/m90.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/m90.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -711,17 +711,6 @@ /*****************************************************************************/ -static const gfx_layout charlayout = -{ - 8,8, - RGN_FRAC(1,4), - 4, - { RGN_FRAC(3,4), RGN_FRAC(2,4), RGN_FRAC(1,4), RGN_FRAC(0,4) }, - { STEP8(0,1) }, - { STEP8(0,8) }, - 8*8 -}; - static const gfx_layout spritelayout = { 16,16, @@ -734,8 +723,8 @@ }; static GFXDECODE_START( gfx_m90 ) - GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 16 ) - GFXDECODE_ENTRY( "gfx1", 0, spritelayout, 256, 16 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x4_planar, 0, 16 ) + GFXDECODE_ENTRY( "gfx1", 0, spritelayout, 256, 16 ) GFXDECODE_END /*****************************************************************************/ diff -Nru mame-0.242+dfsg.1/src/mame/drivers/m92.cpp mame-0.243+dfsg.1/src/mame/drivers/m92.cpp --- mame-0.242+dfsg.1/src/mame/drivers/m92.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/m92.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -935,7 +935,8 @@ m_screen->set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_m92); - PALETTE(config, m_palette).set_format(palette_device::xBGR_555, 2048); + + PALETTE(config, m_palette).set_format(palette_device::xBGR_555, 1024); MCFG_VIDEO_START_OVERRIDE(m92_state,m92) @@ -962,6 +963,9 @@ m92(config); m_maincpu->set_addrmap(AS_PROGRAM, &m92_state::m92_banked_map); m_maincpu->set_addrmap(AS_IO, &m92_state::m92_banked_portmap); + + // the 'banked' ROM setup also has a larger, banked palette + m_palette->set_format(palette_device::xBGR_555, 2048); } void m92_state::gunforce(machine_config &config) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/mac128.cpp mame-0.243+dfsg.1/src/mame/drivers/mac128.cpp --- mame-0.242+dfsg.1/src/mame/drivers/mac128.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/mac128.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -240,8 +240,8 @@ floppy_image_device *m_cur_floppy; int m_hdsel, m_devsel; - int m_pwm_count_total, m_pwm_count_1; - float m_pwm_current_rpm[2]; + int m_pwm_count_total = 0, m_pwm_count_1 = 0; + float m_pwm_current_rpm[2]{}; void phases_w(uint8_t phases); void devsel_w(uint8_t devsel); @@ -249,30 +249,30 @@ void snd_push(uint8_t data); void pwm_push(uint8_t data); - uint32_t m_overlay; + uint32_t m_overlay = 0; - int m_irq_count, m_ca2_data; - uint8_t m_mouse_bit[2], m_mouse_last[2]; - int16_t m_mouse_last_m[2], m_mouse_count[2]; - int m_screen_buffer; - emu_timer *m_scan_timer; - emu_timer *m_hblank_timer; + int m_irq_count = 0, m_ca2_data = 0; + uint8_t m_mouse_bit[2]{}, m_mouse_last[2]{}; + int16_t m_mouse_last_m[2]{}, m_mouse_count[2]{}; + int m_screen_buffer = 0; + emu_timer *m_scan_timer = nullptr; + emu_timer *m_hblank_timer = nullptr; // interrupts - int m_scc_interrupt, m_via_interrupt, m_scsi_interrupt, m_last_taken_interrupt; + int m_scc_interrupt = 0, m_via_interrupt = 0, m_scsi_interrupt = 0, m_last_taken_interrupt = 0; // DRQ - int m_scsi_drq; + int m_scsi_drq = 0; // wait states for accessing the VIA - bool m_snd_enable; - bool m_main_buffer; - int m_snd_vol; - int m_adb_irq_pending; - int m_drive_select; - int m_scsiirq_enable; - u16 *m_ram_ptr, *m_rom_ptr; - u32 m_ram_mask, m_ram_size; + bool m_snd_enable = false; + bool m_main_buffer = false; + int m_snd_vol = 0; + int m_adb_irq_pending = 0; + int m_drive_select = 0; + int m_scsiirq_enable = 0; + u16 *m_ram_ptr = nullptr, *m_rom_ptr = nullptr; + u32 m_ram_mask = 0, m_ram_size = 0; }; void mac128_state::machine_start() diff -Nru mame-0.242+dfsg.1/src/mame/drivers/macp.cpp mame-0.243+dfsg.1/src/mame/drivers/macp.cpp --- mame-0.242+dfsg.1/src/mame/drivers/macp.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/macp.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -469,17 +469,17 @@ } // Anonymous namespace // MAC S.A. pinballs -GAME( 1986, macgalxy, 0, mac16k, macp, macp_state, empty_init, ROT0, "MAC S.A.", "MAC's Galaxy (yellow version, M.6)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1986, macgalxyb, macgalxy, mac16k, macp, macp_state, empty_init, ROT0, "MAC S.A.", "MAC's Galaxy (blue version, M.042)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1987, macjungl, 0, mac16k, macp, macp_state, empty_init, ROT0, "MAC S.A.", "MAC Jungle", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1987, spctrain, 0, mac32k, macp, macp_state, empty_init, ROT0, "MAC S.A.", "Space Train (Pinball)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1987, spctraino, spctrain, mac16k, macp, macp_state, empty_init, ROT0, "MAC S.A.", "Space Train (Pinball, old hardware)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1988, spcpnthr, 0, mac32k, macp, macp_state, empty_init, ROT0, "MAC S.A.", "Space Panther", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 19??, mac_1808, 0, mac32k, macp, macp_state, empty_init, ROT0, "MAC S.A.", "unknown game (MAC #1808)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1995, macjungn, 0, mac32k, macp, macp_state, empty_init, ROT0, "MAC S.A.", "MAC Jungle (New version)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1996, nbamac, 0, mac32k, macp, macp_state, empty_init, ROT0, "MAC S.A.", "NBA MAC", MACHINE_IS_SKELETON_MECHANICAL ) +GAME( 1986, macgalxy, 0, mac16k, macp, macp_state, empty_init, ROT0, "MAC S.A.", "MAC's Galaxy (yellow version, M.6)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1986, macgalxyb, macgalxy, mac16k, macp, macp_state, empty_init, ROT0, "MAC S.A.", "MAC's Galaxy (blue version, M.042)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1987, macjungl, 0, mac16k, macp, macp_state, empty_init, ROT0, "MAC S.A.", "MAC Jungle", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1987, spctrain, 0, mac32k, macp, macp_state, empty_init, ROT0, "MAC S.A.", "Space Train (Pinball)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1987, spctraino, spctrain, mac16k, macp, macp_state, empty_init, ROT0, "MAC S.A.", "Space Train (Pinball, old hardware)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1988, spcpnthr, 0, mac32k, macp, macp_state, empty_init, ROT0, "MAC S.A.", "Space Panther", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 19??, mac_1808, 0, mac32k, macp, macp_state, empty_init, ROT0, "MAC S.A.", "unknown game (MAC #1808)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1995, macjungn, 0, mac32k, macp, macp_state, empty_init, ROT0, "MAC S.A.", "MAC Jungle (New version)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1996, nbamac, 0, mac32k, macp, macp_state, empty_init, ROT0, "MAC S.A.", "NBA MAC", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // CICPlay pinballs -GAME( 1985, glxplay, 0, mac16k, cicplay, macp_state, empty_init, ROT0, "CICPlay", "Galaxy Play", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1986, kidnap, 0, mac16k, cicplay, macp_state, empty_init, ROT0, "CICPlay", "Kidnap", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1987, glxplay2, 0, mac16k, cicplay, macp_state, empty_init, ROT0, "CICPlay", "Galaxy Play 2", MACHINE_IS_SKELETON_MECHANICAL ) +GAME( 1985, glxplay, 0, mac16k, cicplay, macp_state, empty_init, ROT0, "CICPlay", "Galaxy Play", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1986, kidnap, 0, mac16k, cicplay, macp_state, empty_init, ROT0, "CICPlay", "Kidnap", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1987, glxplay2, 0, mac16k, cicplay, macp_state, empty_init, ROT0, "CICPlay", "Galaxy Play 2", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/macpdm.cpp mame-0.243+dfsg.1/src/mame/drivers/macpdm.cpp --- mame-0.242+dfsg.1/src/mame/drivers/macpdm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/macpdm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -47,13 +47,13 @@ required_device_array m_floppy; required_device m_video; - floppy_image_device *m_cur_floppy; + floppy_image_device *m_cur_floppy = nullptr; - uint32_t m_model_id; - uint64_t m_hmc_reg, m_hmc_buffer; - uint8_t m_hmc_bit; + uint32_t m_model_id = 0; + uint64_t m_hmc_reg = 0, m_hmc_buffer = 0; + uint8_t m_hmc_bit = 0; - uint8_t m_irq_control; + uint8_t m_irq_control = 0; uint8_t m_via2_ier = 0, m_via2_ifr = 0, m_via2_sier = 0, m_via2_sifr = 0; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/macrossp.cpp mame-0.243+dfsg.1/src/mame/drivers/macrossp.cpp --- mame-0.242+dfsg.1/src/mame/drivers/macrossp.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/macrossp.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1075,18 +1075,6 @@ /*** GFX DECODE **************************************************************/ -static const gfx_layout macrossp_char16x16x4layout = -{ - 16,16, - RGN_FRAC(1,1), - 4, - { 0,1,2,3 }, - { 0, 4, 8, 12, 16, 20, 24, 28, 32+0,32+4,32+8,32+12,32+16,32+20,32+24,32+28 }, - { 0*64, 1*64, 2*64, 3*64, 4*64, 5*64, 6*64, 7*64, - 8*64, 9*64, 10*64,11*64,12*64,13*64,14*64,15*64}, - 16*64 -}; - static const gfx_layout macrossp_char16x16x8layout = { 16,16, @@ -1104,7 +1092,7 @@ GFXDECODE_ENTRY( "gfx2", 0, macrossp_char16x16x8layout, 0x800, 0x20 ) /* 8bpp but 6bpp granularity */ GFXDECODE_ENTRY( "gfx3", 0, macrossp_char16x16x8layout, 0x800, 0x20 ) /* 8bpp but 6bpp granularity */ GFXDECODE_ENTRY( "gfx4", 0, macrossp_char16x16x8layout, 0x800, 0x20 ) /* 8bpp but 6bpp granularity */ - GFXDECODE_ENTRY( "gfx5", 0, macrossp_char16x16x4layout, 0x800, 0x80 ) + GFXDECODE_ENTRY( "gfx5", 0, gfx_16x16x4_packed_msb, 0x800, 0x80 ) GFXDECODE_END /*** MACHINE DRIVER **********************************************************/ diff -Nru mame-0.242+dfsg.1/src/mame/drivers/magic10.cpp mame-0.243+dfsg.1/src/mame/drivers/magic10.cpp --- mame-0.242+dfsg.1/src/mame/drivers/magic10.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/magic10.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -162,9 +162,9 @@ TILE_GET_INFO_MEMBER(get_layer2_tile_info); uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - tilemap_t *m_tilemap[3]; + tilemap_t *m_tilemap[3]{}; required_shared_ptr_array m_videoram; - int8_t m_layer2_offset[2]; + int8_t m_layer2_offset[2]{}; required_shared_ptr m_vregs; required_device m_maincpu; @@ -222,7 +222,7 @@ private: uint16_t r(); - uint16_t m_ret; + uint16_t m_ret = 0; void map(address_map &map); }; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/magicfly.cpp mame-0.243+dfsg.1/src/mame/drivers/magicfly.cpp --- mame-0.242+dfsg.1/src/mame/drivers/magicfly.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/magicfly.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -476,8 +476,8 @@ private: required_shared_ptr m_videoram; required_shared_ptr m_colorram; - tilemap_t *m_bg_tilemap; - int m_input_selector; + tilemap_t *m_bg_tilemap = nullptr; + int m_input_selector = 0; required_device m_maincpu; required_device m_dac; required_device m_gfxdecode; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/magictg.cpp mame-0.243+dfsg.1/src/mame/drivers/magictg.cpp --- mame-0.242+dfsg.1/src/mame/drivers/magictg.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/magictg.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -174,10 +174,10 @@ /* ASIC */ struct { - uint32_t src_addr; - uint32_t dst_addr; - uint32_t ctrl; - uint32_t count; + uint32_t src_addr = 0; + uint32_t dst_addr = 0; + uint32_t ctrl = 0; + uint32_t count = 0; } m_dma_ch[3]; @@ -186,10 +186,10 @@ struct { - uint16_t bdma_internal_addr; - uint16_t bdma_external_addr; - uint16_t bdma_control; - uint16_t bdma_word_count; + uint16_t bdma_internal_addr = 0; + uint16_t bdma_external_addr = 0; + uint16_t bdma_control = 0; + uint16_t bdma_word_count = 0; } m_adsp_regs; @@ -199,21 +199,21 @@ struct { /* PCI */ - uint32_t command; - uint32_t base_addr; + uint32_t command = 0; + uint32_t base_addr = 0; - uint32_t init_enable; + uint32_t init_enable = 0; } m_voodoo_pci_regs[2]; struct { /* PCI */ - uint32_t command; - uint32_t base_addr; + uint32_t command = 0; + uint32_t base_addr = 0; /* Memory-mapped */ - uint32_t as_regs[0x200]; // was 19, increased to 0x200 for coverity 315123, needed for zr36120_r/w, to stop crash at start. + uint32_t as_regs[0x200]{}; // was 19, increased to 0x200 for coverity 315123, needed for zr36120_r/w, to stop crash at start. } m_zr36120; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/mainsnk.cpp mame-0.243+dfsg.1/src/mame/drivers/mainsnk.cpp --- mame-0.242+dfsg.1/src/mame/drivers/mainsnk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/mainsnk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -343,18 +343,6 @@ INPUT_PORTS_END -static const gfx_layout tile_layout = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { 0, 1, 2, 3 }, - { 4, 0, 12, 8, 20, 16, 28, 24}, - { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 }, - 256 -}; - - static const gfx_layout sprite_layout = { 16,16, @@ -369,8 +357,8 @@ static GFXDECODE_START( gfx_mainsnk ) - GFXDECODE_ENTRY( "gfx1", 0, tile_layout, 0x100, 0x080>>4 ) - GFXDECODE_ENTRY( "gfx2", 0, sprite_layout, 0x000, 0x080>>3 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x4_packed_lsb, 0x100, 0x080>>4 ) + GFXDECODE_ENTRY( "gfx2", 0, sprite_layout, 0x000, 0x080>>3 ) GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/marinedt.cpp mame-0.243+dfsg.1/src/mame/drivers/marinedt.cpp --- mame-0.242+dfsg.1/src/mame/drivers/marinedt.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/marinedt.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -157,20 +157,20 @@ required_device m_gfxdecode; required_ioport_array<4> m_in_track; - tilemap_t *m_tilemap; + tilemap_t *m_tilemap = nullptr; std::unique_ptr m_seabitmap[2]; struct { - uint8_t offs; - uint8_t x; - uint8_t y; + uint8_t offs = 0; + uint8_t x = 0; + uint8_t y = 0; bitmap_ind16 bitmap; }m_obj[2]; - uint8_t m_layer_en; - uint8_t m_in_select; - bool m_screen_flip; - uint8_t m_sea_bank; + uint8_t m_layer_en = 0; + uint8_t m_in_select = 0; + bool m_screen_flip = false; + uint8_t m_sea_bank = 0; void init_seabitmap(); void obj_reg_w(uint8_t which,uint8_t reg, uint8_t data); diff -Nru mame-0.242+dfsg.1/src/mame/drivers/mastboy.cpp mame-0.243+dfsg.1/src/mame/drivers/mastboy.cpp --- mame-0.242+dfsg.1/src/mame/drivers/mastboy.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/mastboy.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -768,21 +768,9 @@ }; -static const gfx_layout tiles8x8_layout_2 = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { 0, 1, 2, 3 }, - { 0,4,8,12,16,20,24,28 }, - { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 }, - 32*8 -}; - - static GFXDECODE_START( gfx_mastboy ) - GFXDECODE_RAM( "vram", 0, tiles8x8_layout, 0, 16 ) - GFXDECODE_ENTRY( "vrom", 0, tiles8x8_layout_2, 0, 16 ) + GFXDECODE_RAM( "vram", 0, tiles8x8_layout, 0, 16 ) + GFXDECODE_ENTRY( "vrom", 0, gfx_8x8x4_packed_msb, 0, 16 ) GFXDECODE_END /* Machine Functions / Driver */ diff -Nru mame-0.242+dfsg.1/src/mame/drivers/mccpm.cpp mame-0.243+dfsg.1/src/mame/drivers/mccpm.cpp --- mame-0.242+dfsg.1/src/mame/drivers/mccpm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/mccpm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Miodrag Milanovic, Robbbert +// copyright-holders:Miodrag Milanovic /*************************************************************************** mc-CP/M-Computer diff -Nru mame-0.242+dfsg.1/src/mame/drivers/mechatt.cpp mame-0.243+dfsg.1/src/mame/drivers/mechatt.cpp --- mame-0.242+dfsg.1/src/mame/drivers/mechatt.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/mechatt.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -475,17 +475,6 @@ /******************************************************************************/ -static const gfx_layout charlayout = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { STEP4(0,1) }, - { STEP8(0,4) }, - { STEP8(0,4*8) }, - 32*8 -}; - static const gfx_layout tilelayout = { 16,16, /* 16*16 sprites */ @@ -498,7 +487,7 @@ }; static GFXDECODE_START( gfx_mechatt ) - GFXDECODE_ENTRY( "tx_tiles", 0, charlayout, 0, 16 ) + GFXDECODE_ENTRY( "tx_tiles", 0, gfx_8x8x4_packed_msb, 0, 16 ) GFXDECODE_ENTRY( "gfx3", 0, tilelayout, 512, 16 ) GFXDECODE_ENTRY( "gfx4", 0, tilelayout, 768, 16 ) GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/mephistp.cpp mame-0.243+dfsg.1/src/mame/drivers/mephistp.cpp --- mame-0.242+dfsg.1/src/mame/drivers/mephistp.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/mephistp.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -70,8 +70,8 @@ void sport2k_8051_io(address_map &map); u8 m_ay8910_data = 0U; - bool m_ay8910_bdir = 0; - bool m_ay8910_bc1 = 0; + bool m_ay8910_bdir = false; + bool m_ay8910_bc1 = false; void ay8910_update(); virtual void machine_start() override; virtual void machine_reset() override; @@ -335,7 +335,7 @@ } // Anonymous namespace -GAME(1987, mephistp, 0, mephisto, mephisto, mephisto_state, empty_init, ROT0, "Stargame", "Mephisto (Stargame) (rev. 1.2)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1987, mephistp1, mephistp, mephisto, mephisto, mephisto_state, empty_init, ROT0, "Stargame", "Mephisto (Stargame) (rev. 1.1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1987, mephistpn, mephistp, mephisto, mephisto, mephisto_state, empty_init, ROT0, "Stargame", "Mephisto (Stargame) (newer?)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1988, sport2k, 0, sport2k, mephisto, mephisto_state, empty_init, ROT0, "Cirsa", "Sport 2000", MACHINE_IS_SKELETON_MECHANICAL ) +GAME(1987, mephistp, 0, mephisto, mephisto, mephisto_state, empty_init, ROT0, "Stargame", "Mephisto (Stargame) (rev. 1.2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1987, mephistp1, mephistp, mephisto, mephisto, mephisto_state, empty_init, ROT0, "Stargame", "Mephisto (Stargame) (rev. 1.1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1987, mephistpn, mephistp, mephisto, mephisto, mephisto_state, empty_init, ROT0, "Stargame", "Mephisto (Stargame) (newer?)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1988, sport2k, 0, sport2k, mephisto, mephisto_state, empty_init, ROT0, "Cirsa", "Sport 2000", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/metalmx.cpp mame-0.243+dfsg.1/src/mame/drivers/metalmx.cpp --- mame-0.242+dfsg.1/src/mame/drivers/metalmx.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/metalmx.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -690,9 +690,21 @@ PALETTE(config, "palette", palette_device::RGB_565); + // TODO: copied from atarigt.cpp; Same configurations as T-Mek? + // 5 Channel output (4 Channel input connected to Quad Amp PCB) + SPEAKER(config, "flspeaker").front_left(); + SPEAKER(config, "frspeaker").front_right(); + SPEAKER(config, "rlspeaker").headrest_left(); + SPEAKER(config, "rrspeaker").headrest_right(); + //SPEAKER(config, "subwoofer").seat(); Not implemented, Quad Amp PCB output; + ATARI_CAGE(config, m_cage, 0); m_cage->set_speedup(0); // TODO: speedup address m_cage->irq_handler().set(FUNC(metalmx_state::cage_irq_callback)); + m_cage->add_route(0, "frspeaker", 1.0); // Foward Right + m_cage->add_route(1, "rlspeaker", 1.0); // Back Left + m_cage->add_route(2, "flspeaker", 1.0); // Foward Left + m_cage->add_route(3, "rrspeaker", 1.0); // Back Right } diff -Nru mame-0.242+dfsg.1/src/mame/drivers/metro.cpp mame-0.243+dfsg.1/src/mame/drivers/metro.cpp --- mame-0.242+dfsg.1/src/mame/drivers/metro.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/metro.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -71,13 +71,16 @@ - For video related issues @see devices/video/imagetek_i4100.cpp - Most games in service mode, seem to require that you press start1&2 *exactly at once* in order to advance to the next screen (e.g. holding 1 then pressing 2 doesn't work). -- Coin lockout - Interrupt timing needs figuring out properly, having it incorrect causes scrolling glitches in some games. Test cases Mouse Go Go title screen, GunMaster title screen. Changing it can cause excessive slowdown in said games however. +- karatour, ladykill, 3kokushi: understand what the irq source 5 is really tied to. + All these games also have a vblank delay check outside irq routine, + cfr. PC=1322 in karatour; - vmetal: ES8712 actually controls a M6585 and an unknown logic selector chip. - split these games into different files, check PCB markings. +- Coin lockout; Notes: @@ -132,11 +135,6 @@ { switch (id) { - case TIMER_KARATOUR_IRQ: - if (m_vdp) m_vdp->clear_irq(5); - if (m_vdp2) m_vdp2->clear_irq(5); - if (m_vdp3) m_vdp3->clear_irq(5); - break; case TIMER_MOUJA_IRQ: if (m_vdp) m_vdp->set_irq(0); if (m_vdp2) m_vdp2->set_irq(0); @@ -184,18 +182,32 @@ /* lev 2-7 (lev 1 seems sound related) */ WRITE_LINE_MEMBER(metro_state::karatour_vblank_irq) { +// printf("%d %d %lld\n", state, m_screen->vpos(), m_screen->frame_number()); + if (state) { - /* write to scroll registers, the duration is a guess */ - m_karatour_irq_timer->adjust(attotime::from_usec(2500)); - if (m_vdp) m_vdp->set_irq(5); - if (m_vdp2) m_vdp2->set_irq(5); - if (m_vdp3) m_vdp3->set_irq(5); - if (m_vdp) m_vdp->screen_eof(state); if (m_vdp2) m_vdp2->screen_eof(state); if (m_vdp3) m_vdp3->screen_eof(state); + + if (m_ext_irq_enable) + { + if (m_vdp) m_vdp->set_irq(5); + if (m_vdp2) m_vdp2->set_irq(5); + if (m_vdp3) m_vdp3->set_irq(5); + } } + else + { + if (m_vdp) m_vdp->clear_irq(5); + if (m_vdp2) m_vdp2->clear_irq(5); + if (m_vdp3) m_vdp3->clear_irq(5); + } +} + +WRITE_LINE_MEMBER(metro_state::ext_irq5_enable_w) +{ + m_ext_irq_enable = state; } void metro_state::mouja_irq_timer_ctrl_w(uint16_t data) @@ -2139,30 +2151,30 @@ static INPUT_PORTS_START( mouja ) PORT_START("IN0") //$478880 - PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) - PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) - PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) - PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) - PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) - PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) - PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) - PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) - PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) - PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) - PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) - PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) - PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) - PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) + PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) + PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) + PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_START("IN1") //$478882 PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_START2 ) - PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2) - PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2) + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2) + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2) PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_SERVICE_NO_TOGGLE(0x0080, IP_ACTIVE_LOW) @@ -2796,8 +2808,8 @@ SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_refresh_hz(58.2328); // VSync 58.2328Hz, HSync 15.32kHz - m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0)); - m_screen->set_size(320, 240); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(1500)); + m_screen->set_size(392, 263); m_screen->set_visarea(0, 320-1, 0, 240-1); m_screen->set_screen_update("vdp", FUNC(imagetek_i4100_device::screen_update)); } @@ -2810,8 +2822,8 @@ SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_refresh_hz(58.2328); // VSync 58.2328Hz, HSync 15.32kHz - m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0)); - m_screen->set_size(320, 240); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(1500)); + m_screen->set_size(392, 263); m_screen->set_visarea(0, 320-1, 0, 224-1); m_screen->set_screen_update("vdp2", FUNC(imagetek_i4100_device::screen_update)); } @@ -2824,8 +2836,8 @@ SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_refresh_hz(58.2328); // VSync 58.2328Hz, HSync 15.32kHz - m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0)); - m_screen->set_size(320, 240); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(1500)); + m_screen->set_size(392, 263); m_screen->set_visarea(0, 320-1, 0, 224-1); m_screen->set_screen_update("vdp3", FUNC(imagetek_i4100_device::screen_update)); } @@ -2835,7 +2847,7 @@ { i4100_config(config); - m_screen->set_size(360, 224); +// m_screen->set_size(392, 263); m_screen->set_visarea(0, 360-1, 0, 224-1); } @@ -2843,7 +2855,7 @@ { i4220_config(config); - m_screen->set_size(320, 240); +// m_screen->set_size(320, 240); m_screen->set_visarea(0, 320-1, 0, 240-1); } @@ -2851,7 +2863,6 @@ { i4220_config(config); - m_screen->set_size(320, 240); m_screen->set_visarea(0, 304-1, 0, 224-1); } @@ -2860,7 +2871,7 @@ i4300_config(config); m_vdp3->set_clock(32_MHz_XTAL); - m_screen->set_size(384, 240); +// m_screen->set_size(384, 240); m_screen->set_visarea(0, 384-1, 0, 224-1); } @@ -2868,7 +2879,7 @@ { i4300_config(config); - m_screen->set_size(384, 240); +// m_screen->set_size(384, 240); m_screen->set_visarea(0, 320-1, 0, 240-1); } @@ -3042,7 +3053,7 @@ /* video hardware */ i4100_config(config); m_vdp->irq_cb().set_inputline(m_maincpu, M68K_IRQ_2); - + m_vdp->ext_ctrl_0_cb().set(FUNC(metro_state::ext_irq5_enable_w)); m_screen->screen_vblank().set(FUNC(metro_state::karatour_vblank_irq)); /* sound hardware */ @@ -3067,6 +3078,7 @@ /* video hardware */ i4220_config_320x240(config); m_vdp2->irq_cb().set_inputline(m_maincpu, M68K_IRQ_2); + m_vdp2->ext_ctrl_0_cb().set(FUNC(metro_state::ext_irq5_enable_w)); m_screen->screen_vblank().set(FUNC(metro_state::karatour_vblank_irq)); @@ -3117,7 +3129,7 @@ i4100_config_360x224(config); m_vdp->irq_cb().set_inputline(m_maincpu, M68K_IRQ_2); - + m_vdp->ext_ctrl_0_cb().set(FUNC(metro_state::ext_irq5_enable_w)); m_screen->screen_vblank().set(FUNC(metro_state::karatour_vblank_irq)); /* sound hardware */ @@ -3385,8 +3397,12 @@ m_vdp2->set_tmap_xoffsets(0,0,0); m_vdp2->set_tmap_yoffsets(0,0,0); - m_vdp2->set_tmap_flip_xoffsets(16,16,16); - m_vdp2->set_tmap_flip_yoffsets(16,16,16); + // TODO: very fussy on screen geometry changes + // CRTC is set as 320x224, bottom 16 pixels are actually aligned properly when flip screen is on. + // Easiest alignment test is during story lore in attract, specifically at bomb explosion screen + // (latter being a sprite needs to be 1:1 aligned with underlying background layer) + m_vdp2->set_tmap_flip_xoffsets(88,88,88); + m_vdp2->set_tmap_flip_yoffsets(39,39,39); /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -3421,11 +3437,12 @@ m_vdp2->set_vblank_irq_level(0); m_vdp2->set_blit_irq_level(3); m_vdp2->set_spriteram_buffered(true); // sprites are 1 frame delayed + m_vdp2->ext_ctrl_0_cb().set(FUNC(metro_state::ext_irq5_enable_w)); SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_refresh_hz(58.2328); // VSync 58.2328Hz, HSync 15.32kHz - m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0)); - m_screen->set_size(320, 240); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(1500)); + m_screen->set_size(392, 263); m_screen->set_visarea(0, 304-1, 0, 224-1); m_screen->set_screen_update(FUNC(metro_state::screen_update_psac_vdp2_mix)); m_screen->screen_vblank().set(FUNC(metro_state::karatour_vblank_irq)); @@ -5356,8 +5373,7 @@ void metro_state::init_karatour() { - m_karatour_irq_timer = timer_alloc(TIMER_KARATOUR_IRQ); - + save_item(NAME(m_ext_irq_enable)); init_metro(); } @@ -5395,7 +5411,7 @@ void metro_state::init_blzntrnd() { m_audiobank->configure_entries(0, 8, memregion("audiocpu")->base(), 0x4000); - m_karatour_irq_timer = timer_alloc(TIMER_KARATOUR_IRQ); + save_item(NAME(m_ext_irq_enable)); } void metro_state::init_vmetal() @@ -5413,7 +5429,7 @@ void metro_state::init_lastfortg() { init_metro(); - m_karatour_irq_timer = timer_alloc(TIMER_KARATOUR_IRQ); + save_item(NAME(m_ext_irq_enable)); } /*************************************************************************** diff -Nru mame-0.242+dfsg.1/src/mame/drivers/mfabfz.cpp mame-0.243+dfsg.1/src/mame/drivers/mfabfz.cpp --- mame-0.242+dfsg.1/src/mame/drivers/mfabfz.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/mfabfz.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:rfka01, Robbbert +// copyright-holders:rfka01 /*************************************************************************** Mikrocomputer fuer Ausbildung diff -Nru mame-0.242+dfsg.1/src/mame/drivers/mgavegas.cpp mame-0.243+dfsg.1/src/mame/drivers/mgavegas.cpp --- mame-0.242+dfsg.1/src/mame/drivers/mgavegas.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/mgavegas.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -69,41 +69,41 @@ void init_mgavegas133(); private: - uint8_t m_int; + uint8_t m_int = 0; //OUT1 - uint8_t m_ckmod; - uint8_t m_dmod; - uint8_t m_emod; - uint8_t m_inh; - uint8_t m_hop; - uint8_t m_seg; - uint8_t m_printer; - uint8_t m_auxp; + uint8_t m_ckmod = 0; + uint8_t m_dmod = 0; + uint8_t m_emod = 0; + uint8_t m_inh = 0; + uint8_t m_hop = 0; + uint8_t m_seg = 0; + uint8_t m_printer = 0; + uint8_t m_auxp = 0; //helper... - uint8_t m_old_ckmod; - uint8_t m_old_emod; + uint8_t m_old_ckmod = 0; + uint8_t m_old_emod = 0; //OUT2 - uint8_t m_bobina_ctrl; - uint8_t m_timbre; - uint8_t m_coil_1; - uint8_t m_coil_2; - uint8_t m_coil_3; - uint8_t m_cont_ent; - uint8_t m_cont_sal; - uint8_t m_cont_caj; + uint8_t m_bobina_ctrl = 0; + uint8_t m_timbre = 0; + uint8_t m_coil_1 = 0; + uint8_t m_coil_2 = 0; + uint8_t m_coil_3 = 0; + uint8_t m_cont_ent = 0; + uint8_t m_cont_sal = 0; + uint8_t m_cont_caj = 0; //lamps out - uint64_t m_custom_data; - uint8_t m_auxs; - uint8_t m_anal; - uint8_t m_anacl; - uint8_t m_anacr; - uint8_t m_anar; - uint8_t m_pl; - uint8_t m_pc; + uint64_t m_custom_data = 0L; + uint8_t m_auxs = 0; + uint8_t m_anal = 0; + uint8_t m_anacl = 0; + uint8_t m_anacr = 0; + uint8_t m_anar = 0; + uint8_t m_pl = 0; + uint8_t m_pc = 0; uint8_t m_pr = 0; uint8_t m_luz_250_rul = 0; uint8_t m_luz_100_rul = 0; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/micropin.cpp mame-0.243+dfsg.1/src/mame/drivers/micropin.cpp --- mame-0.242+dfsg.1/src/mame/drivers/micropin.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/micropin.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -550,5 +550,5 @@ } // Anonymous namespace -GAME(1978, pentacup, 0, pent6800, pent6800, pent6800_state, empty_init, ROT0, "Micropin", "Pentacup (rev. 1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1980, pentacup2, pentacup, pent8085, pent8085, pent8085_state, empty_init, ROT0, "Micropin", "Pentacup (rev. 2)", MACHINE_IS_SKELETON_MECHANICAL ) +GAME(1978, pentacup, 0, pent6800, pent6800, pent6800_state, empty_init, ROT0, "Micropin", "Pentacup (rev. 1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1980, pentacup2, pentacup, pent8085, pent8085, pent8085_state, empty_init, ROT0, "Micropin", "Pentacup (rev. 2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/microterm_f8.cpp mame-0.243+dfsg.1/src/mame/drivers/microterm_f8.cpp --- mame-0.242+dfsg.1/src/mame/drivers/microterm_f8.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/microterm_f8.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -78,13 +78,13 @@ required_ioport_array<3> m_dsw; required_ioport m_jumpers; - u8 m_port00; - u8 m_keylatch; - u8 m_attrlatch; - u8 m_scroll; + u8 m_port00 = 0; + u8 m_keylatch = 0; + u8 m_attrlatch = 0; + u8 m_scroll = 0; std::unique_ptr m_vram; - emu_timer *m_baud_clock; + emu_timer *m_baud_clock = nullptr; }; void microterm_f8_state::machine_start() diff -Nru mame-0.242+dfsg.1/src/mame/drivers/mini2440.cpp mame-0.243+dfsg.1/src/mame/drivers/mini2440.cpp --- mame-0.242+dfsg.1/src/mame/drivers/mini2440.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/mini2440.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -45,7 +45,7 @@ required_ioport m_penx; required_ioport m_peny; - uint32_t m_port[9]; + uint32_t m_port[9] = { }; virtual void machine_start() override; virtual void machine_reset() override; inline void verboselog(int n_level, const char *s_fmt, ...) ATTR_PRINTF(3,4); diff -Nru mame-0.242+dfsg.1/src/mame/drivers/mirax.cpp mame-0.243+dfsg.1/src/mame/drivers/mirax.cpp --- mame-0.242+dfsg.1/src/mame/drivers/mirax.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/mirax.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -459,20 +459,9 @@ 16*16 }; -static const gfx_layout layout8 = -{ - 8,8, - RGN_FRAC(1,3), - 3, - { RGN_FRAC(2,3),RGN_FRAC(1,3),RGN_FRAC(0,3)}, - { 0, 1, 2, 3, 4, 5, 6, 7}, - { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8}, - 8*8 -}; - static GFXDECODE_START( gfx_mirax ) - GFXDECODE_ENTRY( "gfx1", 0, layout8, 0, 8 ) - GFXDECODE_ENTRY( "gfx2", 0, layout16, 0, 8 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x3_planar, 0, 8 ) + GFXDECODE_ENTRY( "gfx2", 0, layout16, 0, 8 ) GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/mkit09.cpp mame-0.243+dfsg.1/src/mame/drivers/mkit09.cpp --- mame-0.242+dfsg.1/src/mame/drivers/mkit09.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/mkit09.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -328,7 +328,7 @@ m_pia->readpb_handler().set(FUNC(mkit09a_state::pb_r)); m_pia->writepa_handler().set(FUNC(mkit09a_state::pa_w)); m_pia->writepb_handler().set(FUNC(mkit09a_state::pb_w)); - m_pia->cb2_handler().set([] (bool state) { }); // stop errorlog filling up - is it a keyclick? + m_pia->cb2_handler().set_nop(); // stop errorlog filling up - is it a keyclick? m_pia->irqa_handler().set_inputline("maincpu", M6809_IRQ_LINE); m_pia->irqb_handler().set_inputline("maincpu", M6809_IRQ_LINE); diff -Nru mame-0.242+dfsg.1/src/mame/drivers/model3.cpp mame-0.243+dfsg.1/src/mame/drivers/model3.cpp --- mame-0.242+dfsg.1/src/mame/drivers/model3.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/model3.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -131,10 +131,10 @@ Virtua Fighter 3 Virtua Fighter 3 Team Battle Le Mans 24 -Scud Race / Super GT +Scud Race / Sega Super GT Scud Race Plus -The Lost World -The Lost World Special +The Lost World: Jurassic Park +The Lost World: Jurassic Park Special Virtua Striker 2 Virtua Striker 2 Version '98 @@ -6789,8 +6789,8 @@ GAME( 1996, scudau, scud, scud, scud, model3_state, init_scud, ROT0, "Sega", "Scud Race Twin/DX (Australia)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) GAME( 1997, scudplus, scud, scud, scud, model3_state, init_scudplus, ROT0, "Sega", "Scud Race Plus Twin/DX (Revision A)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) // Japan, USA, Export GAME( 1997, scudplusa, scud, scud, scud, model3_state,init_scudplusa, ROT0, "Sega", "Scud Race Plus Twin/DX", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) // Japan, USA, Export -GAME( 1997, lostwsga, 0, lostwsga, lostwsga, model3_state, init_lostwsga, ROT0, "Sega", "The Lost World (Japan, Revision A)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) -GAME( 1997, lostwsgp, lostwsga, lostwsga, lostwsga, model3_state, init_lostwsga, ROT0, "Sega", "The Lost World (location test)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) // Japan, USA, Export, Koala +GAME( 1997, lostwsga, 0, lostwsga, lostwsga, model3_state, init_lostwsga, ROT0, "Sega", "The Lost World: Jurassic Park (Japan, Revision A)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) +GAME( 1997, lostwsgp, lostwsga, lostwsga, lostwsga, model3_state, init_lostwsga, ROT0, "Sega", "The Lost World: Jurassic Park (location test)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) // Japan, USA, Export, Koala GAME( 1997, vs215, vs2, model3_15, model3, model3_state, init_vs215, ROT0, "Sega", "Virtua Striker 2 (Step 1.5, Export, USA)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) GAME( 1997, vs215o, vs2, model3_15, model3, model3_state, init_vs215, ROT0, "Sega", "Virtua Striker 2 (Step 1.5, Japan)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) GAME( 1997, lemans24, 0, model3_15, scud, model3_state, init_lemans24, ROT0, "Sega", "Le Mans 24 (Japan, Revision B)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/mrgame.cpp mame-0.243+dfsg.1/src/mame/drivers/mrgame.cpp --- mame-0.242+dfsg.1/src/mame/drivers/mrgame.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/mrgame.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -153,11 +153,11 @@ required_ioport_array<7> m_io_keyboard; output_finder<128> m_io_outputs; // 24 solenoids + 104 lamps - bool m_ack1 = 0; - bool m_ack2 = 0; - bool m_ackv = 0; - bool m_flip = 0; - bool m_intst = 0; + bool m_ack1 = false; + bool m_ack2 = false; + bool m_ackv = false; + bool m_flip = false; + bool m_intst = false; u8 m_data = 0U; u8 m_sxx = 0U; u8 m_irq_state = 0U; @@ -167,7 +167,7 @@ u8 m_video_data = 0U; u8 m_video_status = 0U; - tilemap_t *m_tilemap; + tilemap_t *m_tilemap = nullptr; }; @@ -974,10 +974,10 @@ } // anonymous namespace -GAME(1988, dakar, 0, mrgame, mrgame, mrgame_state, empty_init, ROT0, "Mr Game", "Dakar", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1989, fasttrack, motrshow, mrgame, mrgame, mrgame_state, empty_init, ROT0, "Mr Game", "Fast Track", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1989, motrshow, 0, mrgame, mrgame, mrgame_state, empty_init, ROT0, "Mr Game", "Motor Show (set 1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1989, motrshowa, motrshow, mrgame, mrgame, mrgame_state, empty_init, ROT0, "Mr Game", "Motor Show (set 2)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1989, motrshowb, motrshow, mrgame, mrgame, mrgame_state, empty_init, ROT0, "Mr Game", "Motor Show (set 3)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1990, macattck, 0, macattck, mrgame, mrgame_state, empty_init, ROT0, "Mr Game", "Mac Attack", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1990, wcup90, 0, wcup90, mrgame, mrgame_state, empty_init, ROT0, "Mr Game", "World Cup 90", MACHINE_IS_SKELETON_MECHANICAL ) +GAME(1988, dakar, 0, mrgame, mrgame, mrgame_state, empty_init, ROT0, "Mr Game", "Dakar", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1989, fasttrack, motrshow, mrgame, mrgame, mrgame_state, empty_init, ROT0, "Mr Game", "Fast Track", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1989, motrshow, 0, mrgame, mrgame, mrgame_state, empty_init, ROT0, "Mr Game", "Motor Show (set 1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1989, motrshowa, motrshow, mrgame, mrgame, mrgame_state, empty_init, ROT0, "Mr Game", "Motor Show (set 2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1989, motrshowb, motrshow, mrgame, mrgame, mrgame_state, empty_init, ROT0, "Mr Game", "Motor Show (set 3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1990, macattck, 0, macattck, mrgame, mrgame_state, empty_init, ROT0, "Mr Game", "Mac Attack", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1990, wcup90, 0, wcup90, mrgame, mrgame_state, empty_init, ROT0, "Mr Game", "World Cup 90", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/mw4pole.cpp mame-0.243+dfsg.1/src/mame/drivers/mw4pole.cpp --- mame-0.242+dfsg.1/src/mame/drivers/mw4pole.cpp 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/mw4pole.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,53 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/**************************************************************************** + + Skeleton driver for Waldorf MiniWorks 4-Pole analog filter module. + +****************************************************************************/ + +#include "emu.h" +#include "cpu/mc68hc11/mc68hc11.h" + +namespace { + +class mw4pole_state : public driver_device +{ +public: + mw4pole_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + { + } + + void mw4pole(machine_config &config); + +private: + void mem_map(address_map &map); + + required_device m_maincpu; +}; + + +void mw4pole_state::mem_map(address_map &map) +{ + map(0x8000, 0xffff).rom().region("eprom", 0); +} + +static INPUT_PORTS_START(mw4pole) +INPUT_PORTS_END + +void mw4pole_state::mw4pole(machine_config &config) +{ + MC68HC11E1(config, m_maincpu, 8_MHz_XTAL); + m_maincpu->set_addrmap(AS_PROGRAM, &mw4pole_state::mem_map); +} + +ROM_START(mw4pole) + ROM_REGION(0x8000, "eprom", 0) + ROM_LOAD("4-pole v1.48 001eaf32.bin", 0x0000, 0x8000, CRC(51be6962) SHA1(20e793573a49002c854b012280aed13058ba0b63)) // TMS27C256 +ROM_END + +} // anonymous namespace + +SYST(1995, mw4pole, 0, 0, mw4pole, mw4pole, mw4pole_state, empty_init, "Waldorf Electronics", "MiniWorks 4-Pole", MACHINE_IS_SKELETON) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/mw8080bw.cpp mame-0.243+dfsg.1/src/mame/drivers/mw8080bw.cpp --- mame-0.242+dfsg.1/src/mame/drivers/mw8080bw.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/mw8080bw.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -2553,11 +2553,7 @@ PORT_DIPSETTING( 0x00, DEF_STR( On ) ) /* fake port for cabinet type */ - PORT_START(INVADERS_CAB_TYPE_PORT_TAG) - PORT_CONFNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) - PORT_CONFSETTING( 0x00, DEF_STR( Upright ) ) - PORT_CONFSETTING( 0x01, DEF_STR( Cocktail ) ) - PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNUSED ) + INVADERS_CAB_TYPE_PORT /* fake ports for handling the various input ports based on cabinet type */ PORT_START(INVADERS_SW6_SW7_PORT_TAG) @@ -2575,17 +2571,9 @@ PORT_DIPSETTING( 0x01, DEF_STR( On ) ) PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_START(INVADERS_P1_CONTROL_PORT_TAG) - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(1) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(1) - PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED ) - - PORT_START(INVADERS_P2_CONTROL_PORT_TAG) - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2) - PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED ) + INVADERS_CONTROL_PORT_P1 + + INVADERS_CONTROL_PORT_P2 INPUT_PORTS_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/mystwarr.cpp mame-0.243+dfsg.1/src/mame/drivers/mystwarr.cpp --- mame-0.242+dfsg.1/src/mame/drivers/mystwarr.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/mystwarr.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -849,17 +849,6 @@ /**********************************************************************************/ -static const gfx_layout bglayout_4bpp = -{ - 16,16, - RGN_FRAC(1,1), - 4, - { 0, 1, 2, 3 }, - { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4, 8*4, 9*4, 10*4, 11*4, 12*4, 13*4, 14*4, 15*4 }, - { 0*64, 1*64, 2*64, 3*64, 4*64, 5*64, 6*64, 7*64, 8*64, 9*64, 10*64, 11*64, 12*64, 13*64, 14*64, 15*64 }, - 16*64 -}; - static const gfx_layout bglayout_8bpp = { 16,16, @@ -872,7 +861,7 @@ }; static GFXDECODE_START( gfx_gaiapols ) - GFXDECODE_ENTRY( "gfx3", 0, bglayout_4bpp, 0x0000, 128 ) + GFXDECODE_ENTRY( "gfx3", 0, gfx_16x16x4_packed_msb, 0x0000, 128 ) GFXDECODE_END static GFXDECODE_START( gfx_dadandrn ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/namcos11.cpp mame-0.243+dfsg.1/src/mame/drivers/namcos11.cpp --- mame-0.242+dfsg.1/src/mame/drivers/namcos11.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/namcos11.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -11,8 +11,14 @@ Issues: - Random draw list corruption in soul edge v2 & dunkmania. - - soul edge, dunk mania & prime goal ex try to access joypads/memory cards. It is unknown what they would do if they found one. - - pocketrc locks up if you try to exit testmode (note: it is not related to unimplemented C76 internal watchdog timer or software reset) + - soul edge, dunk mania & prime goal ex try to access joypads/memory cards. + It is unknown what they would do if they found one. + - pocketrc locks up if you try to exit testmode (note: it is not related to + unimplemented C76 internal watchdog timer or software reset) + Update: now it always locks up in test mode, regression? + - pocketrc long samples and drum loops go out of sync, it sounds better when + the C352 is underclocked to match the one in namcos22. It's possibly a BTANB, + since current C352 frequency is the same as Tekken/Tekken 2 real PCB. Known Dumps ----------- @@ -1033,10 +1039,10 @@ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_MODIFY( "ADC0" ) - PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX( 0x00, 0xff ) PORT_SENSITIVITY( 100 ) PORT_KEYDELTA( 10 ) PORT_CENTERDELTA( 15 ) PORT_REVERSE + PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX( 0x38, 0xc8 ) PORT_SENSITIVITY( 100 ) PORT_KEYDELTA( 10 ) PORT_CENTERDELTA( 10 ) PORT_REVERSE PORT_MODIFY( "ADC1" ) - PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_MINMAX( 0x00, 0xff ) PORT_SENSITIVITY( 100 ) PORT_KEYDELTA( 15 ) PORT_REVERSE + PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_MINMAX( 0x00, 0x7f ) PORT_SENSITIVITY( 100 ) PORT_KEYDELTA( 10 ) PORT_REVERSE PORT_MODIFY( "ADC2" ) PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/namcos22.cpp mame-0.243+dfsg.1/src/mame/drivers/namcos22.cpp --- mame-0.242+dfsg.1/src/mame/drivers/namcos22.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/namcos22.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -3641,13 +3641,7 @@ m_cpuled_out.resolve(); m_portbits[0] = 0xffff; m_portbits[1] = 0xffff; - - m_cpuled_data = 0; - m_keycus_rng = 0; - m_su_82 = 0; - m_irq_state = 0; - m_old_coin_state = 0; - m_credits1 = m_credits2 = 0; + m_dsp_upload_state = NAMCOS22_DSP_UPLOAD_READY; // register for savestates, stuff that isn't done in video_start() // note: namcos22_renderer class doesn't need saving, it is refreshed every frame diff -Nru mame-0.242+dfsg.1/src/mame/drivers/namcos86.cpp mame-0.243+dfsg.1/src/mame/drivers/namcos86.cpp --- mame-0.242+dfsg.1/src/mame/drivers/namcos86.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/namcos86.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1010,17 +1010,6 @@ /*******************************************************************/ -static const gfx_layout tilelayout = -{ - 8,8, - RGN_FRAC(1,3), - 3, - { RGN_FRAC(2,3), RGN_FRAC(1,3), RGN_FRAC(0,3) }, - { 0, 1, 2, 3, 4, 5, 6, 7 }, - { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, - 8*8 -}; - static const gfx_layout spritelayout = { 32,32, @@ -1039,9 +1028,9 @@ }; static GFXDECODE_START( gfx_namcos86 ) - GFXDECODE_ENTRY( "gfx1", 0, tilelayout, 2048*0, 256 ) - GFXDECODE_ENTRY( "gfx2", 0, tilelayout, 2048*0, 256 ) - GFXDECODE_ENTRY( "gfx3", 0, spritelayout, 2048*1, 128 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x3_planar, 2048*0, 256 ) + GFXDECODE_ENTRY( "gfx2", 0, gfx_8x8x3_planar, 2048*0, 256 ) + GFXDECODE_ENTRY( "gfx3", 0, spritelayout, 2048*1, 128 ) GFXDECODE_END /*******************************************************************/ diff -Nru mame-0.242+dfsg.1/src/mame/drivers/nc.cpp mame-0.243+dfsg.1/src/mame/drivers/nc.cpp --- mame-0.242+dfsg.1/src/mame/drivers/nc.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/nc.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -556,28 +556,16 @@ void nc_state::nc_sound_update(int channel) { - int on; - int frequency; - int period; - beep_device *beeper_device = nullptr; + channel &= 1; + beep_device *beeper_device = channel ? m_beeper2 : m_beeper1; - switch(channel) - { - case 0: - beeper_device = m_beeper1; - break; - case 1: - beeper_device = m_beeper2; - break; - } - - period = m_sound_channel_periods[channel]; + int period = m_sound_channel_periods[channel]; /* if top bit is 0, sound is on */ - on = ((period & (1<<15))==0); + int on = ((period & (1<<15))==0); /* calculate frequency from period */ - frequency = (int)(1000000.0f/((float)((period & 0x07fff)<<1) * 1.6276f)); + int frequency = (int)(1000000.0f/((float)((period & 0x07fff)<<1) * 1.6276f)); /* set state */ beeper_device->set_state(on); @@ -1513,4 +1501,4 @@ COMP( 1992, nc100, 0, 0, nc100, nc100, nc100_state, init_nc, "Amstrad plc", "NC100", 0 ) COMP( 1992, dw225, nc100, 0, nc100, nc100, nc100_state, init_nc, "NTS Computer Systems", "DreamWriter 225", 0 ) COMP( 1992, nc150, nc100, 0, nc100, nc100, nc100_state, init_nc, "Amstrad plc", "NC150", 0 ) -COMP( 1993, nc200, 0, 0, nc200, nc200, nc200_state, init_nc, "Amstrad plc", "NC200", MACHINE_NOT_WORKING ) // boot hangs while checking the MC146818 UIP (update in progress) bit +COMP( 1993, nc200, 0, 0, nc200, nc200, nc200_state, init_nc, "Amstrad plc", "NC200", 0 ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/neogeo.cpp mame-0.243+dfsg.1/src/mame/drivers/neogeo.cpp --- mame-0.242+dfsg.1/src/mame/drivers/neogeo.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/neogeo.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -12163,8 +12163,8 @@ GAME( 2002, rotdh, rotd, rotd, neogeo, mvs_led_state, empty_init, ROT0, "Evoga / Playmore", "Rage of the Dragons (NGH-2640?)", MACHINE_SUPPORTS_SAVE ) // Atlus -GAME( 2002, matrim, neogeo, matrim, neogeo, mvs_led_state, empty_init, ROT0, "Noise Factory / Atlus", "Matrimelee / Shin Gouketsuji Ichizoku Toukon (NGM-2660 ~ NGH-2660)", MACHINE_SUPPORTS_SAVE ) -GAME( 2002, matrimbl, matrim, matrimbl, neogeo, mvs_led_state, empty_init, ROT0, "bootleg", "Matrimelee / Shin Gouketsuji Ichizoku Toukon (bootleg)", MACHINE_SUPPORTS_SAVE ) +GAME( 2003, matrim, neogeo, matrim, neogeo, mvs_led_state, empty_init, ROT0, "Noise Factory / Atlus", "Matrimelee / Shin Gouketsuji Ichizoku Toukon (NGM-2660 ~ NGH-2660)", MACHINE_SUPPORTS_SAVE ) +GAME( 2003, matrimbl, matrim, matrimbl, neogeo, mvs_led_state, empty_init, ROT0, "bootleg", "Matrimelee / Shin Gouketsuji Ichizoku Toukon (bootleg)", MACHINE_SUPPORTS_SAVE ) /***** Unlicensed commercial releases *****/ diff -Nru mame-0.242+dfsg.1/src/mame/drivers/news.cpp mame-0.243+dfsg.1/src/mame/drivers/news.cpp --- mame-0.242+dfsg.1/src/mame/drivers/news.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/news.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -103,19 +103,8 @@ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) INPUT_PORTS_END -static const gfx_layout tiles8x8_layout = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { 0, 1, 2, 3 }, - { 0, 4, 8, 12, 16, 20, 24, 28 }, - { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 }, - 32*8 -}; - static GFXDECODE_START( gfx_news ) - GFXDECODE_ENTRY( "gfx1", 0, tiles8x8_layout, 0, 16 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x4_packed_msb, 0, 16 ) GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/nmk16.cpp mame-0.243+dfsg.1/src/mame/drivers/nmk16.cpp --- mame-0.242+dfsg.1/src/mame/drivers/nmk16.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/nmk16.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -581,6 +581,15 @@ map(0x0f0000, 0x0fffff).ram().w(FUNC(nmk16_state::mainram_strange_w)).share("mainram"); } +void nmk16_state::mustangb3_sound_map(address_map &map) +{ + tharrier_sound_map(map); + + // remove some leftover banking calls, not needed since this bootleg uses smaller ROMs + map(0xf600, 0xf600).unmapw(); + map(0xf700, 0xf700).unmapw(); +} + void nmk16_state::twinactn_map(address_map &map) { map(0x000000, 0x03ffff).rom(); @@ -4349,7 +4358,7 @@ set_hacky_interrupt_timing(config); Z80(config, m_audiocpu, 14318180/4); - m_audiocpu->set_addrmap(AS_PROGRAM, &nmk16_state::tharrier_sound_map); + m_audiocpu->set_addrmap(AS_PROGRAM, &nmk16_state::mustangb3_sound_map); m_audiocpu->set_addrmap(AS_IO, &nmk16_state::tharrier_sound_io_map); // video hardware diff -Nru mame-0.242+dfsg.1/src/mame/drivers/notetaker.cpp mame-0.243+dfsg.1/src/mame/drivers/notetaker.cpp --- mame-0.242+dfsg.1/src/mame/drivers/notetaker.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/notetaker.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -185,18 +185,18 @@ void ep_mainram_w(offs_t offset, uint16_t data, uint16_t mem_mask); //variables // IPConReg - uint8_t m_BootSeqDone; - uint8_t m_ProcLock; - uint8_t m_CharCtr; - uint8_t m_DisableROM; - uint8_t m_CorrOn_q; - uint8_t m_LedInd6; - uint8_t m_LedInd7; - uint8_t m_LedInd8; + uint8_t m_BootSeqDone = 0; + uint8_t m_ProcLock = 0; + uint8_t m_CharCtr = 0; + uint8_t m_DisableROM = 0; + uint8_t m_CorrOn_q = 0; + uint8_t m_LedInd6 = 0; + uint8_t m_LedInd7 = 0; + uint8_t m_LedInd8 = 0; // FIFOReg - uint8_t m_TabletYOn; - uint8_t m_TabletXOn; - uint8_t m_FrSel2; + uint8_t m_TabletYOn = 0; + uint8_t m_TabletXOn = 0; + uint8_t m_FrSel2 = 0; uint8_t m_FrSel1 = 0; uint8_t m_FrSel0 = 0; uint8_t m_SHConB = 0; @@ -228,7 +228,7 @@ emu_timer *m_FIFO_timer = nullptr; TIMER_CALLBACK_MEMBER(timer_fifoclk); // framebuffer display starting address - uint16_t m_DispAddr; + uint16_t m_DispAddr = 0; // separate cpu resets void iop_reset(); diff -Nru mame-0.242+dfsg.1/src/mame/drivers/nova2001.cpp mame-0.243+dfsg.1/src/mame/drivers/nova2001.cpp --- mame-0.242+dfsg.1/src/mame/drivers/nova2001.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/nova2001.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -586,17 +586,6 @@ * *************************************/ -static const gfx_layout layout8x8 = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { STEP4(0,1) }, - { STEP8(0,4) }, - { STEP8(0,32) }, - 32*8 -}; - static const gfx_layout layout8x8_part = { 8,8, @@ -626,20 +615,20 @@ GFXDECODE_END static GFXDECODE_START( gfx_ninjakun ) - GFXDECODE_ENTRY( "gfx1", 0, layout16x16, 0x200, 16 ) // sprites - GFXDECODE_ENTRY( "gfx1", 0, layout8x8, 0x000, 16 ) // fg tiles - GFXDECODE_ENTRY( "gfx2", 0, layout8x8, 0x100, 16 ) // bg tiles + GFXDECODE_ENTRY( "gfx1", 0, layout16x16, 0x200, 16 ) // sprites + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x4_packed_msb, 0x000, 16 ) // fg tiles + GFXDECODE_ENTRY( "gfx2", 0, gfx_8x8x4_packed_msb, 0x100, 16 ) // bg tiles GFXDECODE_END static GFXDECODE_START( gfx_pkunwar ) - GFXDECODE_ENTRY( "gfx1", 0, layout16x16, 0x000, 16 ) // sprites - GFXDECODE_ENTRY( "gfx1", 0, layout8x8, 0x100, 16 ) // bg tiles + GFXDECODE_ENTRY( "gfx1", 0, layout16x16, 0x000, 16 ) // sprites + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x4_packed_msb, 0x100, 16 ) // bg tiles GFXDECODE_END static GFXDECODE_START( gfx_raiders5 ) - GFXDECODE_ENTRY( "gfx1", 0, layout16x16, 0x200, 16 ) // sprites - GFXDECODE_ENTRY( "gfx1", 0, layout8x8_part, 0x000, 16 ) // fg tiles (using only 1/4th of the ROM space) - GFXDECODE_ENTRY( "gfx2", 0, layout8x8, 0x100, 16 ) // bg tiles + GFXDECODE_ENTRY( "gfx1", 0, layout16x16, 0x200, 16 ) // sprites + GFXDECODE_ENTRY( "gfx1", 0, layout8x8_part, 0x000, 16 ) // fg tiles (using only 1/4th of the ROM space) + GFXDECODE_ENTRY( "gfx2", 0, gfx_8x8x4_packed_msb, 0x100, 16 ) // bg tiles GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/novag_cexpert.cpp mame-0.243+dfsg.1/src/mame/drivers/novag_cexpert.cpp --- mame-0.242+dfsg.1/src/mame/drivers/novag_cexpert.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/novag_cexpert.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -16,6 +16,9 @@ I/O is again similar to supercon +The first version was on a modified Super Constellation PCB. 4MHz CPU speed, +and 4 TMM27128 with identical ROM contents as the newer version. + ******************************************************************************/ #include "emu.h" @@ -50,8 +53,11 @@ // machine configs void cexpert(machine_config &config); + DECLARE_INPUT_CHANGED_MEMBER(switch_cpu_freq) { set_cpu_freq(); } + protected: virtual void machine_start() override; + virtual void machine_reset() override { set_cpu_freq(); } private: // devices/pointers @@ -61,6 +67,8 @@ required_device m_beeper; required_ioport_array<8> m_inputs; + void set_cpu_freq(); + // address maps void main_map(address_map &map); @@ -82,6 +90,12 @@ save_item(NAME(m_led_select)); } +void cexpert_state::set_cpu_freq() +{ + // old version had a 4MHz CPU + m_maincpu->set_unscaled_clock((ioport("FAKE")->read() & 1) ? (10_MHz_XTAL/2) : (8_MHz_XTAL/2)); +} + /****************************************************************************** @@ -192,6 +206,11 @@ PORT_START("IN.7") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Q) PORT_NAME("Go") PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1) PORT_NAME("Take Back / Restore") + + PORT_START("FAKE") + PORT_CONFNAME( 0x01, 0x01, "CPU Frequency" ) PORT_CHANGED_MEMBER(DEVICE_SELF, cexpert_state, switch_cpu_freq, 0) // factory set + PORT_CONFSETTING( 0x00, "4MHz" ) + PORT_CONFSETTING( 0x01, "5MHz" ) INPUT_PORTS_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/novag_sexpert.cpp mame-0.243+dfsg.1/src/mame/drivers/novag_sexpert.cpp --- mame-0.242+dfsg.1/src/mame/drivers/novag_sexpert.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/novag_sexpert.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -542,6 +542,13 @@ ROM_LOAD("se_c22_h0.u2", 0x10000, 0x8000, CRC(2d085064) SHA1(76162322aa7d23a5c07e8356d0bbbb33816419af) ) ROM_END +ROM_START( sexpertc2 ) // ID = E1.2 + ROM_REGION( 0x18000, "maincpu", 0 ) + ROM_LOAD("se_l_corfix.u3", 0x0000, 0x8000, CRC(d0f65341) SHA1(e8ebbfdbcf8ad613cc68acdb0db011eed855cb9f) ) // NEC D27C256AD-12 + ROM_LOAD("se_h_corfix.u1", 0x8000, 0x8000, CRC(59dc112b) SHA1(e1031648da8fc9479d1134d3fd205af254610c1d) ) // Toshiba TC57256AD-12 + ROM_LOAD("sef_h0_corfix.u2", 0x10000, 0x8000, CRC(c6a1419a) SHA1(017a0ffa9aa59438c879624a7ddea2071d1524b8) ) // Toshiba TC57256AD-15 +ROM_END + ROM_START( sfortea ) ROM_REGION( 0x18000, "maincpu", 0 ) @@ -600,6 +607,7 @@ CONS( 1988, sexpertb, sexperta, 0, sexpertb, sexpertb, sexpert_state, init_sexpert, "Novag", "Super Expert (version B)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) // 887 CONS( 1990, sexpertc, sexperta, 0, sexpertb, sexpertb, sexpert_state, init_sexpert, "Novag", "Super Expert (version C, v3.6)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) CONS( 1990, sexpertc1, sexperta, 0, sexpertb, sexpertb, sexpert_state, init_sexpert, "Novag", "Super Expert (version C, v3.0)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) // 902 +CONS( 1990, sexpertc2, sexperta, 0, sexpertb, sexpertb, sexpert_state, init_sexpert, "Novag", "Super Expert (version C, v1.2)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) CONS( 1987, sfortea, 0, 0, sforte, sexpert, sforte_state, init_sexpert, "Novag", "Super Forte (version A, set 1)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) CONS( 1987, sfortea1, sfortea, 0, sforte, sexpert, sforte_state, init_sexpert, "Novag", "Super Forte (version A, set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/nsm.cpp mame-0.243+dfsg.1/src/mame/drivers/nsm.cpp --- mame-0.242+dfsg.1/src/mame/drivers/nsm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/nsm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -475,6 +475,6 @@ ROM_LOAD("151597.ic604", 0x4000, 0x2000, CRC(5c8a3547) SHA1(843a56012227a61ff068bc1e14baf090d4a95fe1)) ROM_END -GAME(1985, cosflnsm, 0, nsm, nsm, nsm_state, empty_init, ROT0, "NSM", "Cosmic Flash (NSM)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1985, firebird, 0, nsm, nsm, nsm_state, empty_init, ROT0, "NSM", "Hot Fire Birds", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1985, gamesnsm, 0, nsm, nsm, nsm_state, empty_init, ROT0, "NSM", "The Games (NSM)", MACHINE_IS_SKELETON_MECHANICAL ) +GAME(1985, cosflnsm, 0, nsm, nsm, nsm_state, empty_init, ROT0, "NSM", "Cosmic Flash (NSM)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1985, firebird, 0, nsm, nsm, nsm_state, empty_init, ROT0, "NSM", "Hot Fire Birds", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1985, gamesnsm, 0, nsm, nsm, nsm_state, empty_init, ROT0, "NSM", "The Games (NSM)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/nwk-tr.cpp mame-0.243+dfsg.1/src/mame/drivers/nwk-tr.cpp --- mame-0.242+dfsg.1/src/mame/drivers/nwk-tr.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/nwk-tr.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -291,8 +291,8 @@ class nwktr_state : public driver_device { public: - nwktr_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + nwktr_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_work_ram(*this, "work_ram"), m_maincpu(*this, "maincpu"), m_audiocpu(*this, "audiocpu"), @@ -345,6 +345,8 @@ memory_view m_cg_view; emu_timer *m_sound_irq_timer; + bool m_exrgb; + void paletteram32_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0); uint8_t sysreg_r(offs_t offset); void sysreg_w(offs_t offset, uint8_t data); @@ -352,8 +354,6 @@ void soundtimer_count_w(uint16_t data); double adc12138_input_callback(uint8_t input); - bool m_exrgb; - TIMER_CALLBACK_MEMBER(sound_irq); uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); @@ -508,6 +508,10 @@ m_maincpu->ppcdrc_add_fastram(0x00000000, 0x003fffff, false, m_work_ram); m_sound_irq_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(nwktr_state::sound_irq), this)); + + m_exrgb = false; + + save_item(NAME(m_exrgb)); } void nwktr_state::ppc_map(address_map &map) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/okean240.cpp mame-0.243+dfsg.1/src/mame/drivers/okean240.cpp --- mame-0.242+dfsg.1/src/mame/drivers/okean240.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/okean240.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -68,7 +68,7 @@ - 80 column mode (used in Turbo Monitor) Keyboard: -- okean240 - external ascii keyboard +- okean240 - external ascii keyboard - okean240a - internal keyboard - okean240t - serial keyboard & screen @@ -131,7 +131,7 @@ u8 m_j = 0U; u8 m_scroll = 0U; u8 m_tog = 0U; - bool m_key_pressed = 0; + bool m_key_pressed = false; u8 m_kbd_row = 0U; required_shared_ptr m_p_videoram; optional_ioport_array<11> m_io_keyboard; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/osborne1.cpp mame-0.243+dfsg.1/src/mame/drivers/osborne1.cpp --- mame-0.242+dfsg.1/src/mame/drivers/osborne1.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/osborne1.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -258,7 +258,7 @@ static void osborne1_floppies(device_slot_interface &device) { device.option_add("525sssd", FLOPPY_525_SSSD); // Siemens FDD 100-5, custom Osborne electronics - device.option_add("525ssdd", FLOPPY_525_QD); // SSDD) // MPI 52(?), custom Osborne electronics + device.option_add("525ssdd", FLOPPY_525_SSDD); // MPI 52(?), custom Osborne electronics } diff -Nru mame-0.242+dfsg.1/src/mame/drivers/p112.cpp mame-0.243+dfsg.1/src/mame/drivers/p112.cpp --- mame-0.242+dfsg.1/src/mame/drivers/p112.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/p112.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -2,9 +2,9 @@ // copyright-holders:Robbbert /*************************************************************************** - P112 Single Board Computer +P112 Single Board Computer - 30/08/2010 Skeleton driver +2010-08-30 Skeleton driver The P112 is a stand-alone 8-bit CPU board. Typically running CP/M (tm) or a similar operating system, it provides a Z80182 (Z-80 upgrade) CPU with up to diff -Nru mame-0.242+dfsg.1/src/mame/drivers/pandoras.cpp mame-0.243+dfsg.1/src/mame/drivers/pandoras.cpp --- mame-0.242+dfsg.1/src/mame/drivers/pandoras.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/pandoras.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -243,17 +243,6 @@ -static const gfx_layout charlayout = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { 0, 1, 2, 3 }, - { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4 }, - { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 }, - 32*8 -}; - static const gfx_layout spritelayout = { 16,16, @@ -268,8 +257,8 @@ }; static GFXDECODE_START( gfx_pandoras ) - GFXDECODE_ENTRY( "gfx1", 0, spritelayout, 0, 16 ) - GFXDECODE_ENTRY( "gfx2", 0, charlayout, 16*16, 16 ) + GFXDECODE_ENTRY( "gfx1", 0, spritelayout, 0, 16 ) + GFXDECODE_ENTRY( "gfx2", 0, gfx_8x8x4_packed_msb, 16*16, 16 ) GFXDECODE_END /*************************************************************************** diff -Nru mame-0.242+dfsg.1/src/mame/drivers/paokaipc.cpp mame-0.243+dfsg.1/src/mame/drivers/paokaipc.cpp --- mame-0.242+dfsg.1/src/mame/drivers/paokaipc.cpp 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/paokaipc.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,124 @@ +// license:BSD-3-Clause +// copyright-holders: +/************************************************************************************************** + + Go Go Strike (c) 2007? Paokai + + Originally in fruitpc.cpp, split because definitely doesn't belong + + Some kind of x86 pc-like hardware, exact CPU type etc. unknown hardware is by Paokai, + motherboard has logos, large chip with logo too, http://www.paokai.com.tw/ + + CF card has a Linux partition, partially bootable with m55hipl driver. + - starts with a "LILO boot", fails with a recoverable "undefined video mode" + (press RETURN or SPACE); + - Shows being a "gcc 3.2.2 (Red Hat Linux 3.2.2-5)" distro. + Notice that latter seems mislabeled, and RedHat is actually version 9 + http://rpm.pbone.net/info_idpl_19558085_distro_redhat9_com_gcc-3.2.2-5.i386.rpm.html + - Has pretty verbose terminal log, checks PnP, USB, Pentium f0 0f bug, + assumes "33 MHz system bus" for IDE PIO mode, returns PIIX only during PCI scan + (that's what m55hipl has as default); + - Eventually hangs at a "Setting the clock:" prompt; + +**************************************************************************************************/ + +#include "emu.h" +#include "cpu/i386/i386.h" +#include "machine/pci.h" +#include "machine/pckeybrd.h" +#include "machine/idectrl.h" +#include "video/pc_vga.h" +#include "machine/pcshare.h" +#include "bus/isa/isa.h" +#include "bus/isa/sblaster.h" + +class paokaipc_state : public pcat_base_state +{ +public: + paokaipc_state(const machine_config &mconfig, device_type type, const char *tag) + : pcat_base_state(mconfig, type, tag) + , m_pciroot(*this, "pci") + , m_isabus(*this, "isa") + { } + + void paokaipc(machine_config &config); + +private: + required_device m_pciroot; + required_device m_isabus; + + void main_io(address_map &map); + void main_map(address_map &map); +}; + +void paokaipc_state::main_map(address_map &map) +{ + map(0x00000000, 0x0009ffff).ram(); + map(0x000a0000, 0x000bffff).rw("vga", FUNC(vga_device::mem_r), FUNC(vga_device::mem_w)); // VGA VRAM + map(0x000e0000, 0x000fffff).rom().region("bios", 0x20000); + map(0x00100000, 0x008fffff).ram(); + map(0x02000000, 0x28ffffff).noprw(); + map(0xfffc0000, 0xffffffff).rom().region("bios", 0x00000); /* System BIOS */ +} + +void paokaipc_state::main_io(address_map &map) +{ + pcat32_io_common(map); + map(0x01f0, 0x01f7).rw("ide", FUNC(ide_controller_device::cs0_r), FUNC(ide_controller_device::cs0_w)); + map(0x03b0, 0x03bf).rw("vga", FUNC(vga_device::port_03b0_r), FUNC(vga_device::port_03b0_w)); + map(0x03c0, 0x03cf).rw("vga", FUNC(vga_device::port_03c0_r), FUNC(vga_device::port_03c0_w)); + map(0x03d0, 0x03df).rw("vga", FUNC(vga_device::port_03d0_r), FUNC(vga_device::port_03d0_w)); + map(0x03f0, 0x03f7).rw("ide", FUNC(ide_controller_device::cs1_r), FUNC(ide_controller_device::cs1_w)); +// map(0x0880, 0x0880) extensively accessed at POST, hangs if returns wrong values +// map(0x0cf8, 0x0cff).rw(m_pcibus, FUNC(pci_bus_device::read), FUNC(pci_bus_device::write)); +} + +static INPUT_PORTS_START( gogostrk ) +INPUT_PORTS_END + +void paokaipc_state::paokaipc(machine_config &config) +{ + // TODO: everything inherited from fruitpc.cpp, needs proper identification of motherboard. + PENTIUM(config, m_maincpu, 66000000); // unknown CPU, at least Pentium according to logs + m_maincpu->set_addrmap(AS_PROGRAM, &paokaipc_state::main_map); + m_maincpu->set_addrmap(AS_IO, &paokaipc_state::main_io); + m_maincpu->set_irq_acknowledge_callback("pic8259_1", FUNC(pic8259_device::inta_cb)); + + pcat_common(config); + + ide_controller_device &ide(IDE_CONTROLLER(config, "ide").options(ata_devices, "hdd", nullptr, true)); + ide.irq_handler().set("pic8259_2", FUNC(pic8259_device::ir6_w)); + + pcvideo_vga(config); + + PCI_ROOT(config, m_pciroot, 0); + // ... + + ISA8(config, m_isabus, 0); + m_isabus->set_memspace("maincpu", AS_PROGRAM); + m_isabus->set_iospace("maincpu", AS_IO); + m_isabus->irq2_callback().set("pic8259_2", FUNC(pic8259_device::ir2_w)); + m_isabus->irq3_callback().set("pic8259_1", FUNC(pic8259_device::ir3_w)); + m_isabus->irq4_callback().set("pic8259_1", FUNC(pic8259_device::ir4_w)); + m_isabus->irq5_callback().set("pic8259_1", FUNC(pic8259_device::ir5_w)); + m_isabus->irq6_callback().set("pic8259_1", FUNC(pic8259_device::ir6_w)); + m_isabus->irq7_callback().set("pic8259_1", FUNC(pic8259_device::ir7_w)); + m_isabus->drq1_callback().set("dma8237_1", FUNC(am9517a_device::dreq1_w)); + m_isabus->drq2_callback().set("dma8237_1", FUNC(am9517a_device::dreq2_w)); + m_isabus->drq3_callback().set("dma8237_1", FUNC(am9517a_device::dreq3_w)); + + // FIXME: determine ISA bus clock +// isa8_slot_device &isa1(ISA8_SLOT(config, "isa1", 0, "isa", fruitpc_isa8_cards, "sb15", true)); +// isa1.set_option_device_input_defaults("sb15", DEVICE_INPUT_DEFAULTS_NAME(fruitpc_sb_def)); +// isa1.set_option_machine_config("sb15", fruitpc_sb_conf); +} + +ROM_START( gogostrk ) + ROM_REGION32_LE( 0x40000, "bios", 0 ) + ROM_LOAD( "39sf020a.rom1", 0x000000, 0x040000, CRC(236d4d95) SHA1(50579acddc93c05d5f8e17ad3669a29d2dc49965) ) + + DISK_REGION( "ide:0:hdd:image" ) // 128 MB CF Card + DISK_IMAGE( "ggs-5-2-07", 0,SHA1(f214fd39ec8ac02f008823f4b179ea6c6835e1b8) ) +ROM_END + +GAME( 2007?, gogostrk, 0, paokaipc, gogostrk, paokaipc_state, empty_init, ROT0, "American Alpha / Paokai", "Go Go Strike", MACHINE_IS_SKELETON ) // motherboard is dated 2006, if the CF card string is a date it's 2007 diff -Nru mame-0.242+dfsg.1/src/mame/drivers/paradise.cpp mame-0.243+dfsg.1/src/mame/drivers/paradise.cpp --- mame-0.242+dfsg.1/src/mame/drivers/paradise.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/paradise.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -634,17 +634,6 @@ ***************************************************************************/ -static const gfx_layout layout_8x8x4 = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { STEP4(0,1) }, - { STEP8(0,4) }, - { STEP8(0,4*8) }, - 8*8*4 -}; - static const gfx_layout layout_8x8x8 = { 8,8, @@ -679,24 +668,24 @@ }; static GFXDECODE_START( gfx_paradise ) - GFXDECODE_ENTRY( "gfx1", 0, layout_16x16x8, 0x100, 1 ) // [0] Sprites - GFXDECODE_ENTRY( "gfx2", 0, layout_8x8x4, 0x400, 16 ) // [1] Background - GFXDECODE_ENTRY( "gfx3", 0, layout_8x8x8, 0x300, 1 ) // [2] Midground - GFXDECODE_ENTRY( "gfx4", 0, layout_8x8x8, 0x000, 1 ) // [3] Foreground + GFXDECODE_ENTRY( "gfx1", 0, layout_16x16x8, 0x100, 1 ) // [0] Sprites + GFXDECODE_ENTRY( "gfx2", 0, gfx_8x8x4_packed_msb, 0x400, 16 ) // [1] Background + GFXDECODE_ENTRY( "gfx3", 0, layout_8x8x8, 0x300, 1 ) // [2] Midground + GFXDECODE_ENTRY( "gfx4", 0, layout_8x8x8, 0x000, 1 ) // [3] Foreground GFXDECODE_END static GFXDECODE_START( gfx_torus ) - GFXDECODE_ENTRY( "gfx1", 0, torus_layout_16x16x8, 0x100, 1 ) // [0] Sprites - GFXDECODE_ENTRY( "gfx2", 0, layout_8x8x4, 0x400, 16 ) // [1] Background - GFXDECODE_ENTRY( "gfx3", 0, layout_8x8x8, 0x300, 1 ) // [2] Midground - GFXDECODE_ENTRY( "gfx4", 0, layout_8x8x8, 0x000, 1 ) // [3] Foreground + GFXDECODE_ENTRY( "gfx1", 0, torus_layout_16x16x8, 0x100, 1 ) // [0] Sprites + GFXDECODE_ENTRY( "gfx2", 0, gfx_8x8x4_packed_msb, 0x400, 16 ) // [1] Background + GFXDECODE_ENTRY( "gfx3", 0, layout_8x8x8, 0x300, 1 ) // [2] Midground + GFXDECODE_ENTRY( "gfx4", 0, layout_8x8x8, 0x000, 1 ) // [3] Foreground GFXDECODE_END static GFXDECODE_START( gfx_madball ) GFXDECODE_ENTRY( "gfx1", 0, torus_layout_16x16x8, 0x500, 1 ) // [0] Sprites - GFXDECODE_ENTRY( "gfx2", 0, layout_8x8x4, 0x400, 16 ) // [1] Background - GFXDECODE_ENTRY( "gfx3", 0, layout_8x8x8, 0x300, 1 ) // [2] Midground - GFXDECODE_ENTRY( "gfx4", 0, layout_8x8x8, 0x000, 1 ) // [3] Foreground + GFXDECODE_ENTRY( "gfx2", 0, gfx_8x8x4_packed_msb, 0x400, 16 ) // [1] Background + GFXDECODE_ENTRY( "gfx3", 0, layout_8x8x8, 0x300, 1 ) // [2] Midground + GFXDECODE_ENTRY( "gfx4", 0, layout_8x8x8, 0x000, 1 ) // [3] Foreground GFXDECODE_END /*************************************************************************** diff -Nru mame-0.242+dfsg.1/src/mame/drivers/parodius.cpp mame-0.243+dfsg.1/src/mame/drivers/parodius.cpp --- mame-0.242+dfsg.1/src/mame/drivers/parodius.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/parodius.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -9,89 +9,218 @@ ***************************************************************************/ #include "emu.h" -#include "includes/parodius.h" + #include "includes/konamipt.h" +#include "video/k052109.h" +#include "video/k053244_k053245.h" +#include "video/k053251.h" +#include "video/konami_helper.h" +#include "cpu/m6809/konami.h" // for the callback and the firq irq definition #include "cpu/z80/z80.h" +#include "machine/bankdev.h" #include "machine/watchdog.h" #include "sound/k053260.h" #include "sound/ymopm.h" + #include "emupal.h" +#include "screen.h" #include "speaker.h" -void parodius_state::parodius_videobank_w(uint8_t data) +namespace { + +class parodius_state : public driver_device +{ +public: + parodius_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_bank0000(*this, "bank0000"), + m_k052109(*this, "k052109"), + m_k053245(*this, "k053245"), + m_k053251(*this, "k053251"), + m_mainbank(*this, "mainbank"), + m_view_2000(*this, "view_2000") + { } + + void parodius(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + +private: + // devices + required_device m_maincpu; + required_device m_audiocpu; + required_device m_bank0000; + required_device m_k052109; + required_device m_k053245; + required_device m_k053251; + + required_memory_bank m_mainbank; + memory_view m_view_2000; + + // video-related + uint8_t m_layer_colorbase[3]{}; + uint8_t m_sprite_colorbase = 0; + int m_layerpri[3]{}; + + // misc + emu_timer *m_nmi_timer = nullptr; + + void videobank_w(uint8_t data); + void _3fc0_w(uint8_t data); + void sh_irqtrigger_w(uint8_t data); + void sound_arm_nmi_w(uint8_t data); + TIMER_CALLBACK_MEMBER(nmi_timer); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + K05324X_CB_MEMBER(sprite_callback); + K052109_CB_MEMBER(tile_callback); + void banking_callback(uint8_t data); + + void bank0000_map(address_map &map); + void main_map(address_map &map); + void sound_map(address_map &map); +}; + + +// video + +/*************************************************************************** + + Callbacks for the K052109 + +***************************************************************************/ + +K052109_CB_MEMBER(parodius_state::tile_callback) +{ + *code |= ((*color & 0x03) << 8) | ((*color & 0x10) << 6) | ((*color & 0x0c) << 9) | (bank << 13); + *color = m_layer_colorbase[layer] + ((*color & 0xe0) >> 5); +} + +/*************************************************************************** + + Callbacks for the K053245 + +***************************************************************************/ + +K05324X_CB_MEMBER(parodius_state::sprite_callback) +{ + int pri = 0x20 | ((*color & 0x60) >> 2); + if (pri <= m_layerpri[2]) + *priority = 0; + else if (pri > m_layerpri[2] && pri <= m_layerpri[1]) + *priority = 0xf0; + else if (pri > m_layerpri[1] && pri <= m_layerpri[0]) + *priority = 0xf0 | 0xcc; + else + *priority = 0xf0 | 0xcc | 0xaa; + + *color = m_sprite_colorbase + (*color & 0x1f); +} + + +/*************************************************************************** + + Start the video hardware emulation. + +***************************************************************************/ + +uint32_t parodius_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + int bg_colorbase = m_k053251->get_palette_index(k053251_device::CI0); + m_sprite_colorbase = m_k053251->get_palette_index(k053251_device::CI1); + m_layer_colorbase[0] = m_k053251->get_palette_index(k053251_device::CI2); + m_layer_colorbase[1] = m_k053251->get_palette_index(k053251_device::CI4); + m_layer_colorbase[2] = m_k053251->get_palette_index(k053251_device::CI3); + + m_k052109->tilemap_update(); + + int layer[3]; + + layer[0] = 0; + m_layerpri[0] = m_k053251->get_priority(k053251_device::CI2); + layer[1] = 1; + m_layerpri[1] = m_k053251->get_priority(k053251_device::CI4); + layer[2] = 2; + m_layerpri[2] = m_k053251->get_priority(k053251_device::CI3); + + konami_sortlayers3(layer, m_layerpri); + + screen.priority().fill(0, cliprect); + bitmap.fill(16 * bg_colorbase, cliprect); + m_k052109->tilemap_draw(screen, bitmap, cliprect, layer[0], 0, 1); + m_k052109->tilemap_draw(screen, bitmap, cliprect, layer[1], 0, 2); + m_k052109->tilemap_draw(screen, bitmap, cliprect, layer[2], 0, 4); + + m_k053245->sprites_draw(bitmap, cliprect, screen.priority()); + return 0; +} + + +// machine + +void parodius_state::videobank_w(uint8_t data) { if (data & 0xf8) - logerror("%04x: videobank = %02x\n",m_maincpu->pc(),data); + logerror("%04x: videobank = %02x\n", m_maincpu->pc(), data); - /* bit 0 = select palette or work RAM at 0000-07ff */ - /* bit 1 = select 052109 or 053245 at 2000-27ff */ - /* bit 2 = select palette bank 0 or 1 */ + // bit 0 = select palette or work RAM at 0000-07ff + // bit 1 = select 052109 or 053245 at 2000-27ff + // bit 2 = select palette bank 0 or 1 if (data & 1) m_bank0000->set_bank(2 + ((data & 4) >> 2)); else m_bank0000->set_bank(0); - m_bank2000->set_bank((data & 2) >> 1); + m_view_2000.select((data & 2) >> 1); } -void parodius_state::parodius_3fc0_w(uint8_t data) +void parodius_state::_3fc0_w(uint8_t data) { if ((data & 0xf4) != 0x10) - logerror("%04x: 3fc0 = %02x\n",m_maincpu->pc(),data); + logerror("%04x: 3fc0 = %02x\n", m_maincpu->pc(), data); - /* bit 0/1 = coin counters */ + // bit 0/1 = coin counters machine().bookkeeping().coin_counter_w(0, data & 0x01); machine().bookkeeping().coin_counter_w(1, data & 0x02); - /* bit 3 = enable char ROM reading through the video RAM */ + // bit 3 = enable char ROM reading through the video RAM m_k052109->set_rmrd_line((data & 0x08) ? ASSERT_LINE : CLEAR_LINE); - /* other bits unknown */ + // other bits unknown } -void parodius_state::parodius_sh_irqtrigger_w(uint8_t data) +void parodius_state::sh_irqtrigger_w(uint8_t data) { m_audiocpu->set_input_line_and_vector(0, HOLD_LINE, 0xff); // Z80 } -#if 0 -void parodius_state::sound_nmi_callback( int param ) +TIMER_CALLBACK_MEMBER(parodius_state::nmi_timer) { - m_audiocpu->set_input_line(INPUT_LINE_NMI, ( m_nmi_enabled ) ? CLEAR_LINE : ASSERT_LINE ); - - nmi_enabled = 0; -} -#endif - -void parodius_state::device_timer(emu_timer &timer, device_timer_id id, int param) -{ - switch (id) - { - case TIMER_NMI: - m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); - break; - default: - throw emu_fatalerror("Unknown id in parodius_state::device_timer"); - } + m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); } void parodius_state::sound_arm_nmi_w(uint8_t data) { m_audiocpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); - timer_set(attotime::from_usec(50), TIMER_NMI); /* kludge until the K053260 is emulated correctly */ + m_nmi_timer->adjust(attotime::from_usec(50)); // kludge until the K053260 is emulated correctly } /********************************************/ -void parodius_state::parodius_map(address_map &map) +void parodius_state::main_map(address_map &map) { map(0x0000, 0x07ff).m(m_bank0000, FUNC(address_map_bank_device::amap8)); map(0x0800, 0x1fff).ram(); map(0x2000, 0x5fff).rw(m_k052109, FUNC(k052109_device::read), FUNC(k052109_device::write)); - map(0x2000, 0x27ff).m(m_bank2000, FUNC(address_map_bank_device::amap8)); + map(0x2000, 0x27ff).view(m_view_2000); + m_view_2000[0](0x2000, 0x27ff).rw(m_k052109, FUNC(k052109_device::read), FUNC(k052109_device::write)); + m_view_2000[1](0x2000, 0x27ff).rw(m_k053245, FUNC(k05324x_device::k053245_r), FUNC(k05324x_device::k053245_w)); map(0x3f8c, 0x3f8c).portr("P1"); map(0x3f8d, 0x3f8d).portr("P2"); map(0x3f8e, 0x3f8e).portr("DSW3"); @@ -99,11 +228,11 @@ map(0x3f90, 0x3f90).portr("DSW2"); map(0x3fa0, 0x3faf).rw(m_k053245, FUNC(k05324x_device::k053244_r), FUNC(k05324x_device::k053244_w)); map(0x3fb0, 0x3fbf).w(m_k053251, FUNC(k053251_device::write)); - map(0x3fc0, 0x3fc0).r("watchdog", FUNC(watchdog_timer_device::reset_r)).w(FUNC(parodius_state::parodius_3fc0_w)); - map(0x3fc4, 0x3fc4).w(FUNC(parodius_state::parodius_videobank_w)); - map(0x3fc8, 0x3fc8).w(FUNC(parodius_state::parodius_sh_irqtrigger_w)); + map(0x3fc0, 0x3fc0).r("watchdog", FUNC(watchdog_timer_device::reset_r)).w(FUNC(parodius_state::_3fc0_w)); + map(0x3fc4, 0x3fc4).w(FUNC(parodius_state::videobank_w)); + map(0x3fc8, 0x3fc8).w(FUNC(parodius_state::sh_irqtrigger_w)); map(0x3fcc, 0x3fcd).rw("k053260", FUNC(k053260_device::main_read), FUNC(k053260_device::main_write)); - map(0x6000, 0x9fff).bankr("bank1"); /* banked ROM */ + map(0x6000, 0x9fff).bankr(m_mainbank); // banked ROM map(0xa000, 0xffff).rom().region("maincpu", 0x3a000); } @@ -113,13 +242,7 @@ map(0x1000, 0x1fff).ram().w("palette", FUNC(palette_device::write8)).share("palette"); } -void parodius_state::bank2000_map(address_map &map) -{ - map(0x0000, 0x07ff).rw(m_k052109, FUNC(k052109_device::read), FUNC(k052109_device::write)); - map(0x0800, 0x0fff).rw(m_k053245, FUNC(k05324x_device::k053245_r), FUNC(k05324x_device::k053245_w)); -} - -void parodius_state::parodius_sound_map(address_map &map) +void parodius_state::sound_map(address_map &map) { map(0x0000, 0xefff).rom(); map(0xf000, 0xf7ff).ram(); @@ -143,7 +266,7 @@ PORT_START("DSW1") KONAMI_COINAGE_LOC(DEF_STR( Free_Play ), "No Coin B", SW1) - /* "No Coin B" = coins produce sound, but no effect on coin counter */ + // "No Coin B" = coins produce sound, but no effect on coin counter PORT_START("DSW2") PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:1,2") @@ -193,8 +316,10 @@ void parodius_state::machine_start() { - membank("bank1")->configure_entries(0, 16, memregion("maincpu")->base(), 0x4000); - membank("bank1")->set_entry(0); + m_mainbank->configure_entries(0, 16, memregion("maincpu")->base(), 0x4000); + m_mainbank->set_entry(0); + + m_nmi_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(parodius_state::nmi_timer), this)); save_item(NAME(m_sprite_colorbase)); save_item(NAME(m_layer_colorbase)); @@ -211,7 +336,6 @@ m_sprite_colorbase = 0; m_bank0000->set_bank(0); - m_bank2000->set_bank(0); } void parodius_state::banking_callback(uint8_t data) @@ -219,31 +343,30 @@ if (data & 0xf0) logerror("%s: setlines %02x\n", machine().describe_context(), data); - membank("bank1")->set_entry((data & 0x0f) ^ 0x0f); + m_mainbank->set_entry((data & 0x0f) ^ 0x0f); } void parodius_state::parodius(machine_config &config) { - /* basic machine hardware */ - KONAMI(config, m_maincpu, 3000000); /* 053248 */ - m_maincpu->set_addrmap(AS_PROGRAM, &parodius_state::parodius_map); + // basic machine hardware + KONAMI(config, m_maincpu, 3000000); // 053248 + m_maincpu->set_addrmap(AS_PROGRAM, &parodius_state::main_map); m_maincpu->line().set(FUNC(parodius_state::banking_callback)); Z80(config, m_audiocpu, 3579545); - m_audiocpu->set_addrmap(AS_PROGRAM, &parodius_state::parodius_sound_map); /* NMIs are triggered by the 053260 */ + m_audiocpu->set_addrmap(AS_PROGRAM, &parodius_state::sound_map); // NMIs are triggered by the 053260 ADDRESS_MAP_BANK(config, "bank0000").set_map(&parodius_state::bank0000_map).set_options(ENDIANNESS_BIG, 8, 13, 0x800); - ADDRESS_MAP_BANK(config, "bank2000").set_map(&parodius_state::bank2000_map).set_options(ENDIANNESS_BIG, 8, 12, 0x800); WATCHDOG_TIMER(config, "watchdog"); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(60); screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); screen.set_size(64*8, 32*8); screen.set_visarea(14*8, (64-14)*8-1, 2*8, 30*8-1); - screen.set_screen_update(FUNC(parodius_state::screen_update_parodius)); + screen.set_screen_update(FUNC(parodius_state::screen_update)); screen.set_palette("palette"); PALETTE(config, "palette").set_format(palette_device::xBGR_555, 2048).enable_shadows(); @@ -260,7 +383,7 @@ K053251(config, m_k053251, 0); - /* sound hardware */ + // sound hardware SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); @@ -278,85 +401,88 @@ ***************************************************************************/ ROM_START( parodius ) - ROM_REGION( 0x40000, "maincpu", 0 ) /* code + banked roms */ + ROM_REGION( 0x40000, "maincpu", 0 ) // code + banked ROMs ROM_LOAD( "955l01.f5", 0x00000, 0x20000, CRC(49a658eb) SHA1(dd53060c4da99b8e1f896ebfec572296ef2b5665) ) ROM_LOAD( "955l02.h5", 0x20000, 0x20000, CRC(161d7322) SHA1(a752f28c19c58263680221ad1119f2fd57df4723) ) - ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the sound CPU */ + ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "955e03.d14", 0x0000, 0x10000, CRC(940aa356) SHA1(e7466f049be48861fd2d929eed786bd48782b5bb) ) - ROM_REGION( 0x100000, "k052109", 0 ) /* tiles */ + ROM_REGION( 0x100000, "k052109", 0 ) // tiles ROM_LOAD32_WORD( "955d07.k19", 0x000000, 0x080000, CRC(89473fec) SHA1(0da18c4b078c3a30233a6f5c2b90032168136f58) ) ROM_LOAD32_WORD( "955d08.k24", 0x000002, 0x080000, CRC(43d5cda1) SHA1(2c51bad4857d1d31456c6dc1e7d41326ea35468b) ) - ROM_REGION( 0x100000, "k053245", 0 ) /* graphics */ - ROM_LOAD32_WORD( "955d05.k13", 0x000000, 0x080000, CRC(7a1e55e0) SHA1(7a0e04ebde28d1e7b60aef3de926dc0e78662b1e) ) /* sprites */ - ROM_LOAD32_WORD( "955d06.k8", 0x000002, 0x080000, CRC(f4252875) SHA1(490f2e19b30cf8724e4b03b8d9f089c470ec13bd) ) /* sprites */ + ROM_REGION( 0x100000, "k053245", 0 ) // sprites + ROM_LOAD32_WORD( "955d05.k13", 0x000000, 0x080000, CRC(7a1e55e0) SHA1(7a0e04ebde28d1e7b60aef3de926dc0e78662b1e) ) + ROM_LOAD32_WORD( "955d06.k8", 0x000002, 0x080000, CRC(f4252875) SHA1(490f2e19b30cf8724e4b03b8d9f089c470ec13bd) ) - ROM_REGION( 0x80000, "k053260", 0 ) /* 053260 samples */ + ROM_REGION( 0x80000, "k053260", 0 ) // samples ROM_LOAD( "955d04.c5", 0x00000, 0x80000, CRC(e671491a) SHA1(79e71cb5212eb7d14d3479b0734ea0270473a66d) ) ROM_END -ROM_START( parodiuse ) /* Earlier version? */ - ROM_REGION( 0x40000, "maincpu", 0 ) /* code + banked roms */ +ROM_START( parodiuse ) // Earlier version? + ROM_REGION( 0x40000, "maincpu", 0 ) // code + banked ROMs ROM_LOAD( "2.f5", 0x00000, 0x20000, CRC(26a6410b) SHA1(06de782f593ab0da6d65376b66e273d6410c6c56) ) ROM_LOAD( "3.h5", 0x20000, 0x20000, CRC(9410dbf2) SHA1(1c4d9317f83c33bace929a841ff4093d7178c428) ) - ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the sound CPU */ + ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "955e03.d14", 0x0000, 0x10000, CRC(940aa356) SHA1(e7466f049be48861fd2d929eed786bd48782b5bb) ) - ROM_REGION( 0x100000, "k052109", 0 ) /* tiles */ + ROM_REGION( 0x100000, "k052109", 0 ) // tiles ROM_LOAD32_WORD( "955d07.k19", 0x000000, 0x080000, CRC(89473fec) SHA1(0da18c4b078c3a30233a6f5c2b90032168136f58) ) ROM_LOAD32_WORD( "955d08.k24", 0x000002, 0x080000, CRC(43d5cda1) SHA1(2c51bad4857d1d31456c6dc1e7d41326ea35468b) ) - ROM_REGION( 0x100000, "k053245", 0 ) /* graphics */ - ROM_LOAD32_WORD( "955d05.k13", 0x000000, 0x080000, CRC(7a1e55e0) SHA1(7a0e04ebde28d1e7b60aef3de926dc0e78662b1e) ) /* sprites */ - ROM_LOAD32_WORD( "955d06.k8", 0x000002, 0x080000, CRC(f4252875) SHA1(490f2e19b30cf8724e4b03b8d9f089c470ec13bd) ) /* sprites */ + ROM_REGION( 0x100000, "k053245", 0 ) // sprites + ROM_LOAD32_WORD( "955d05.k13", 0x000000, 0x080000, CRC(7a1e55e0) SHA1(7a0e04ebde28d1e7b60aef3de926dc0e78662b1e) ) + ROM_LOAD32_WORD( "955d06.k8", 0x000002, 0x080000, CRC(f4252875) SHA1(490f2e19b30cf8724e4b03b8d9f089c470ec13bd) ) - ROM_REGION( 0x80000, "k053260", 0 ) /* 053260 samples */ + ROM_REGION( 0x80000, "k053260", 0 ) // samples ROM_LOAD( "955d04.c5", 0x00000, 0x80000, CRC(e671491a) SHA1(79e71cb5212eb7d14d3479b0734ea0270473a66d) ) ROM_END ROM_START( parodiusj ) - ROM_REGION( 0x40000, "maincpu", 0 ) /* code + banked roms */ + ROM_REGION( 0x40000, "maincpu", 0 ) // code + banked ROMs ROM_LOAD( "955e01.f5", 0x00000, 0x20000, CRC(49baa334) SHA1(8902fbb2228111b15de6537bd168241933df134d) ) ROM_LOAD( "955e02.h5", 0x20000, 0x20000, CRC(14010d6f) SHA1(69fe162ea08c3bd4b3e78e9d10d278bd15444af4) ) - ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the sound CPU */ + ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "955e03.d14", 0x0000, 0x10000, CRC(940aa356) SHA1(e7466f049be48861fd2d929eed786bd48782b5bb) ) - ROM_REGION( 0x100000, "k052109", 0 ) /* tiles */ + ROM_REGION( 0x100000, "k052109", 0 ) // tiles ROM_LOAD32_WORD( "955d07.k19", 0x000000, 0x080000, CRC(89473fec) SHA1(0da18c4b078c3a30233a6f5c2b90032168136f58) ) ROM_LOAD32_WORD( "955d08.k24", 0x000002, 0x080000, CRC(43d5cda1) SHA1(2c51bad4857d1d31456c6dc1e7d41326ea35468b) ) - ROM_REGION( 0x100000, "k053245", 0 ) /* graphics */ - ROM_LOAD32_WORD( "955d05.k13", 0x000000, 0x080000, CRC(7a1e55e0) SHA1(7a0e04ebde28d1e7b60aef3de926dc0e78662b1e) ) /* sprites */ - ROM_LOAD32_WORD( "955d06.k8", 0x000002, 0x080000, CRC(f4252875) SHA1(490f2e19b30cf8724e4b03b8d9f089c470ec13bd) ) /* sprites */ + ROM_REGION( 0x100000, "k053245", 0 ) // sprites + ROM_LOAD32_WORD( "955d05.k13", 0x000000, 0x080000, CRC(7a1e55e0) SHA1(7a0e04ebde28d1e7b60aef3de926dc0e78662b1e) ) + ROM_LOAD32_WORD( "955d06.k8", 0x000002, 0x080000, CRC(f4252875) SHA1(490f2e19b30cf8724e4b03b8d9f089c470ec13bd) ) - ROM_REGION( 0x80000, "k053260", 0 ) /* 053260 samples */ + ROM_REGION( 0x80000, "k053260", 0 ) // samples ROM_LOAD( "955d04.c5", 0x00000, 0x80000, CRC(e671491a) SHA1(79e71cb5212eb7d14d3479b0734ea0270473a66d) ) ROM_END ROM_START( parodiusa ) - ROM_REGION( 0x40000, "maincpu", 0 ) /* code + banked roms */ + ROM_REGION( 0x40000, "maincpu", 0 ) // code + banked ROMs ROM_LOAD( "b-18.f5", 0x00000, 0x20000, CRC(006356cd) SHA1(795011233059472c841c30831442a71579dff2b9) ) ROM_LOAD( "b-19.h5", 0x20000, 0x20000, CRC(e5a16417) SHA1(a49567817fd4948e33913fab66106b8e16100b6a) ) - ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the sound CPU */ - ROM_LOAD( "955e03.d14", 0x0000, 0x10000, CRC(940aa356) SHA1(e7466f049be48861fd2d929eed786bd48782b5bb) ) /* Labeled as D-20 */ + ROM_REGION( 0x10000, "audiocpu", 0 ) + ROM_LOAD( "955e03.d14", 0x0000, 0x10000, CRC(940aa356) SHA1(e7466f049be48861fd2d929eed786bd48782b5bb) ) // Labeled as D-20 - ROM_REGION( 0x100000, "k052109", 0 ) /* tiles */ + ROM_REGION( 0x100000, "k052109", 0 ) // tiles ROM_LOAD32_WORD( "955d07.k19", 0x000000, 0x080000, CRC(89473fec) SHA1(0da18c4b078c3a30233a6f5c2b90032168136f58) ) ROM_LOAD32_WORD( "955d08.k24", 0x000002, 0x080000, CRC(43d5cda1) SHA1(2c51bad4857d1d31456c6dc1e7d41326ea35468b) ) - ROM_REGION( 0x100000, "k053245", 0 ) /* graphics */ - ROM_LOAD32_WORD( "955d05.k13", 0x000000, 0x080000, CRC(7a1e55e0) SHA1(7a0e04ebde28d1e7b60aef3de926dc0e78662b1e) ) /* sprites */ - ROM_LOAD32_WORD( "955d06.k8", 0x000002, 0x080000, CRC(f4252875) SHA1(490f2e19b30cf8724e4b03b8d9f089c470ec13bd) ) /* sprites */ + ROM_REGION( 0x100000, "k053245", 0 ) // sprites + ROM_LOAD32_WORD( "955d05.k13", 0x000000, 0x080000, CRC(7a1e55e0) SHA1(7a0e04ebde28d1e7b60aef3de926dc0e78662b1e) ) + ROM_LOAD32_WORD( "955d06.k8", 0x000002, 0x080000, CRC(f4252875) SHA1(490f2e19b30cf8724e4b03b8d9f089c470ec13bd) ) - ROM_REGION( 0x80000, "k053260", 0 ) /* 053260 samples */ + ROM_REGION( 0x80000, "k053260", 0 ) // samples ROM_LOAD( "955d04.c5", 0x00000, 0x80000, CRC(e671491a) SHA1(79e71cb5212eb7d14d3479b0734ea0270473a66d) ) ROM_END +} // anonymous namespace + + /*************************************************************************** Game driver(s) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/pasopia7.cpp mame-0.243+dfsg.1/src/mame/drivers/pasopia7.cpp --- mame-0.242+dfsg.1/src/mame/drivers/pasopia7.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/pasopia7.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -137,7 +137,7 @@ uint8_t m_nmi_reset = 0; uint8_t m_screen_type = 0; void pasopia_nmi_trap(); - uint8_t m_mux_data; + uint8_t m_mux_data = 0; u8 m_porta_2 = 0; bool m_spr_sw = false; emu_timer *m_pio_timer = nullptr; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/pc8001.cpp mame-0.243+dfsg.1/src/mame/drivers/pc8001.cpp --- mame-0.242+dfsg.1/src/mame/drivers/pc8001.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/pc8001.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -61,26 +61,31 @@ // further extend the attributes if we are in color mode if (is_color_mode) { - // TODO: defaults // flgworld (pc8001) gameplay sets up: // - 0x00 0x00 0x02 0x88 on playfield // \- (wanting the default from the first defined color) // - 0x00 0x00 0x00 0x48 0x12 0x88 for first row - // \- (Expecting "FLAG WORLD" wording to be red while the "P"s in green wtf) + // \- (Expecting "FLAG WORLD" wording to be red while the "P"s in green) // undermon (pc8001) instruction screen sets up: // - 0x00 0x00 0x06 0xb8 // \- (expecting blue fill up to 0x06) - u8 attr_color = 0xe8; - u8 attr_decoration = 0x00; + // xak2 & cancanb (pc8801) really expects that the color / decoration is implictly + // latched from previous line (uses semigfx black tiles for masking) + if (y == 0) + { + // TODO: default values for line 0 + m_attr_color = 0xe8; + m_attr_decoration = 0x00; + } for (int ex = 0; ex < row_size; ex++) { u16 cur_attr = attr_extend_info[ex]; if (BIT(cur_attr, 3)) - attr_color = cur_attr; + m_attr_color = cur_attr; else - attr_decoration = cur_attr; - attr_extend_info[ex] = (attr_color << 8) | attr_decoration; + m_attr_decoration = cur_attr; + attr_extend_info[ex] = (m_attr_color << 8) | m_attr_decoration; } } @@ -155,7 +160,7 @@ // if (m_width80) { - u8 pen; + u8 pen_dot; for (int xi = 0; xi < tile_width; xi += dot_width) { @@ -164,16 +169,19 @@ { u8 mask = (xi & (4 << (dot_width - 1))) ? 0x10 : 0x01; mask <<= (lc & (0x3 << y_double)) >> y_double; - pen = tile & mask; + pen_dot = tile & mask; } else { - pen = tile; - pen = (pen >> (7 - (xi >> (dot_width - 1)))) & 1; + pen_dot = tile; + pen_dot = (pen_dot >> (7 - (xi >> (dot_width - 1)))) & 1; } + if (!pen_dot) + continue; + for (int di = 0; di < dot_width; di++) - bitmap.pix(y, res_x + di) = m_crtc_palette->pen(pen ? color : 0); + bitmap.pix(y, res_x + di) = m_crtc_palette->pen(color); } } } @@ -216,27 +224,26 @@ m_cent_data_out->write(data); } +/* + * I/O Port $30 (w/o) "System Control Port (1)" + * N88-BASIC buffer port $e6c0 + * + * Virtually same between PC-8001 and PC-8801 + * + * --xx ---- BS2, BS1: USART channel control + * --00 ---- CMT 600 bps + * --01 ---- CMT 1200 bps + * --10 ---- RS-232C async mode + * --11 ---- RS-232C sync mode + * ---- x--- MTON: CMT motor control (active high) + * ---- -x-- CDS: CMT carrier control (1) mark (0) space + * ---- --x- /COLOR: CRT display mode control (0) color mode (1) monochrome + * ---- ---x /40: CRT display format control (1) 80 chars per line (0) 40 chars + * + */ void pc8001_base_state::port30_w(uint8_t data) { - /* - - bit description - - 0 characters per line (0=40, 1=80) - 1 color mode (0=color, 1=B&W) - 2 CMT CHIN - 3 CMT MOTOR (1=on) - 4 CMT BS1 - 5 CMT BS2 - 6 unused - 7 unused - - */ - - /* characters per line */ m_width80 = BIT(data, 0); - - /* color mode */ m_color = BIT(data, 1); m_cassette->change_state(BIT(data, 3) ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR); @@ -644,6 +651,8 @@ void pc8001_base_state::machine_start() { + m_screen_reverse = false; + save_item(NAME(m_width80)); save_item(NAME(m_color)); save_item(NAME(m_screen_reverse)); @@ -652,6 +661,8 @@ void pc8001_state::machine_start() { + pc8001_base_state::machine_start(); + address_space &program = m_maincpu->space(AS_PROGRAM); /* initialize RTC */ diff -Nru mame-0.242+dfsg.1/src/mame/drivers/pc8801.cpp mame-0.243+dfsg.1/src/mame/drivers/pc8801.cpp --- mame-0.242+dfsg.1/src/mame/drivers/pc8801.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/pc8801.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1,5 +1,6 @@ // license:BSD-3-Clause -// copyright-holders:Angelo Salese +// copyright-holders: Angelo Salese +// thanks-to: Alex Marshall /************************************************************************************************** PC-8801 (c) 1981 NEC @@ -12,164 +13,27 @@ - Add limits for extend work RAM; - waitstates; - clean-ups: - - better state machine isolation of features between various models (currently pretty cheaty); + - better state machine isolation of features between various models. + Vanilla PC-8801 doesn't have analog palette, PC80S31 device as default + (uses external minidisk), other misc banking bits. - refactor memory banking to use address maps; - - video; - double check dipswitches; - - move PC80S31K to device, needed by PC-6601SR, PC-88VA, (vanilla & optional) PC-9801. (in progress) + - Slotify PC80S31K, also needed by PC-6601SR, PC-88VA, (vanilla & optional) PC-9801. **partially done** Also notice that there are common points with SPC-1000 and TF-20 FDDs; - backport/merge what is portable to PC-8001; - - implement bus slot mechanism for NEC boards ("PC-8800-**"), HAL PCG-8100 & GSX8800, - probably others (does bus have an actual codename or just "PC-8801 bus"?); - - below notes states that plain PC-8801 doesn't have a disk CPU, but the BIOS clearly checks - the floppy ports. Wrong info or check for external board anyway? - - fix "jumps" in PC-8872 mouse pointer (noticeable in balpower); - - pc8801mc: implement proper CD-ROM i/f (subset of PC Engine and PCFX); - - per-game specific TODO (move to XML): - - Belloncho Shintai Kensa: hangs - - Bishoujo Baseball Gakuen: checks ym2608 after intro screen; - - The Black Onyx: writes a katakana msg: "sono kata ha koko ni orimasen" then doesn't show up anything. (Needs user disk?) - - Campaign Ban Daisenryaku 2: Hangs at title screen? - - Can Can Bunny: bitmap artifacts on intro, caused by a fancy usage of the attribute vram; - - Can Can Bunny: no sound (regression); - - Can Can Bunny Superior: black screen during the intro - - Chou Bishoujo Densetsu CROQUIS: accesses ports 0xa0-0xa3 and 0xc2-0xc3 - - Cranston Manor (actually N88-Basic demo): no sound - - Datenshi Kyouko: gfx garbage on the right edge? - - Final Crisis: sound stuck with OPNA? - - Fire Hawk: tries to r/w the opn ports (probably crashed due to floppy?) - - Game Music Library: "Disk I/O error on 3040", starting from Sorcerian item - - Gaudi - Barcelona no Kaze: fails PCM loading - - GeGeGe no Kitarou: title screen text/bitmap contrast is pretty ugly (BTANB?); - - Grobda: palette is ugly (parent pc8801 only); - - Music Collection Vol. 2 - Final Fantasy Tokushuu: sound irq dies pretty soon - - Star Cruiser: bad kanji data? - - Star Cruiser: reads at i/o 0x8e? - - Wanderers from Ys: user data disk looks screwed? It loads with everything as maximum as per now ... - - WerDragon: no BGMs - - Xevious: game is too fast (parent pc8801 only) - - list of games/apps that crashes due of floppy issues (* -> denotes games fixed with current floppy code, # -> regressed with current floppy code): - * Agni no Ishi - * Amazoness no Hihou (takes invalid data from floppy) - - American Truck / American Truck SR (polls read deleted data command) - * Ankokujou - * Ao No Sekizou (fdc CPU irq doesn't fire anymore) - * Arcus - * Attacker - - Autumn Park (BASIC error) - * Battle Gorilla - * Belloncho Shintai Kensa - - Bishoujo Noriko Part I (writes to FDC CPU ROM then expects some strict values, taken from floppy image) - * Blassty (attempts to read at 0x801b) - - Bokosuka Wars (polls read ID command) - * Boukenshatachi - * Can Can Bunny Superior - - Carmine - - Castle Excellent (sets sector 0xf4? Jumps to 0xa100 and it shouldn't) (REGRESSED with current floppy code) - - Card Game Pro 8.8k Plus Unit 1 (prints Disk i/o error 135 in vram, not visible for whatever reason) - - Championship Lode Runner (fdc CPU irq doesn't fire anymore) - - Change Vol. 1 (stops at PCM loading) - - Chikyuu Boueigun (disk i/o error during "ESDF SYSTEM LOADING") (REGRESSED with current floppy code) - * Chikyuu Senshi Rayieza (fdc CPU crashes) - - Choplifter - - Columns (code at 0x28c8, copy protection) - - Corridor ("THIS SYSTEM NOT KOEI SYSTEM" printed on screen) (REGRESSED with current floppy code) - # Craze (returns to basic after logo pops up, tries to self-modify program data via the window offset?) - * Crimson - * Crimson 3 - * Cuby Panic (copy protection routine at 0x911A) - - Daidasso (prints "BOOT dekimasen" on screen -> can't boot) - - Daikoukai Jidai (YSHELL.COM error) - - Databox (app) - - Day Dream ("Bad drive number at 570") - - Demons Ring - * Dennou Tsuushin - - Door Door MK-2 (sets up TC in the middle of execution phase read then wants status bit 6 to be low PC=0x7050 of fdc cpu) - * Dragon Slayer - The Legend of Heroes 2 - - Dungeon Buster - * El Dorado Denki - * Elevator Action - - Emerald Densetsu (dies after few seconds of intro) - - Emerald Dragon (it seems to miss a timer) - - Emmy - - Explosion (fails to load ADPCM data?) - * F15 Strike Eagle - - F2 Grand Prix ("Boot dekimasen") - # Fangs - The Saga of Wolf Blood (Crashes at the first random battle) - - Fantasian - * Final Zone - # Final Zone (demo) (REGRESSION: asserts at MAME boot) - - Fruit Panic - - FSD Sample Ongaku Shuu Vol. 1-7 - - Gaia no Kiba (Disk I/O error at 150) - - Gambler Jiko Chuushin ha Mahjong Puzzle Collection - - Gambler Jiko Chuushin ha Mahjong Puzzle Collection (demo) - * Game Music Library - * Gaudi - Barcelona no Kaze (bad Wolfteam logo then black screen) - - GC-clusterz Music Disk Vol. 1-7 - * Genji - * Gokuraku Tengoku - - Grodius 3 (might not be floppy) - - Gun Ship (at gameplay) - (Hacker) - - - Harakiri - - Kaseijin (app) (code snippet is empty at some point) - - Lamia: fails to create an user disk (after character creation) -> disk write error - * MakaiMura (attempts to r/w the sio ports, but it's clearly crashed) - * Mugen Senshi Valis (at Telenet logo, it also appears to have a nasty copy protection when taking a specific item (untested)) - - Mr. Pro Yakyuu - - PC-8034 (app) - - PC-8037SR (app) - - P1 (app) - - Pattern Editor 88 (app) - - Super Shunbo II (app) (Load error) - - Super TII (app) - - Tobira wo Akete (random crashes in parent pc8801 only) - - list of games that doesn't like i8214_irq_level == 5 in sound irq - - 100yen Disk 2 / Jumper 2: Sound BGM dies pretty soon; - - Alpha (demo): stuck note in title screen, doesn't seem to go further; - - Ayumi: black screen after new game / load game screen; - - Brunette: No sound, eventually hangs at gameplay; - - Digital Devil Story Megami Tensei: hangs at gameplay (sound irq issue) - - Double Face: hangs at logo (sound irq issue) - - games that needs to NOT have write-protect floppies (BTANBs): - - Balance of Power - - Blue Moon Story: moans with a kanji msg; - - Mahjong Clinic Zoukangou - - Tobira wo Akete (hangs at title screen) - - games that needs to HAVE write-protect floppies (BTANBs): - - 100 Yen Disk 7: (doesn't boot in V2 mode) - - other BTANBs - - Attack Hirokochan: returns to BASIC after an initial animation, needs BASIC V1: - - Jark (needs PC-8801MC) - - Kuronekosou Souzoku Satsujin Jiken: "Illegal function call in 105", needs BASIC V1; + - Kanji LV1/LV2 ROM hookups needs to be moved at slot level. + Needs identification effort about what's internal to machine models and what instead + can be optionally installed; + - implement proper joypad / mouse (PC-8872) DB9 port connector; + - Pinpoint number of EXPansion slots for each machine (currently hardwired to 1), + guessing from the back panels seems that each model can install between 1 to 3 cards. + Also note: most cards aren't compatible between each other; Notes: - - BIOS disk ROM defines what kind of floppies you could load: - * with 0x0800 ROM size you can load 2d floppies only; - * with 0x2000 ROM size you can load 2d and 2hd floppies; - - Later models have palette bugs with some games (Alphos, Tokyo Nampa Street). - This is because you have to set up the V1 / V2 DIP-SW to V1 for those games (it's the BIOS that sets up to analog and never changes back otherwise). - - Password for "AY-1: Fortress Solomon" is "123" then press enter, any other key pressed makes it to fail the check (you must soft reset the machine) - - Pressing Home in Dennou Gakuen during gameplay makes it to show a fake DASM screen. That's supposed to be a panic button and it's also in the - sequels (with different screens); - - Bankswitch Notes: - - 0x31 - graphic banking - - 0x32 - misc banking - - 0x5c / 0x5f - VRAM banking - - 0x70 - window offset (banking) - - 0x71 - extra ROM banking - - 0x78 - window offset (banking) increment (+ 0x100) - - 0xe2 / 0xe3 - extra RAM banking - - 0xf0 / 0xf1 = kanji banking + - Later models have washed out palette with some SWs, with no red component. + This is because you have to set up the V1 / V2 DIP-SW to V1 mode for those games + (BIOS sets up analog palette and never changes back otherwise). + cfr. SW list usage SW notes that specifically needs V1. ====================================================================================================================================== @@ -230,10 +94,11 @@ * CD-ROM BIOS: 0x0000 - 0x7fff * Dictionary: 0xc000 - 0xffff (32 Banks) - info from http://www.geocities.jp/retro_zzz/machines/nec/cmn_roms.html - also, refer to http://www.geocities.jp/retro_zzz/machines/nec/cmn_vers.html for - info about BASIC revisions in the various models (BASIC V2 is the BASIC - Expansion, if I unerstood correctly) + References: + - https://retrocomputerpeople.web.fc2.com/machines/nec/8801/ + - http://mydocuments.g2.xrea.com/html/p8/vraminfo.html + - http://www7b.biglobe.ne.jp/~crazyunit/pc88.html + - http://www.maroon.dti.ne.jp/youkan/pc88/index.html *************************************************************************************************************************************/ @@ -244,396 +109,181 @@ #include "softlist_dev.h" -#define IRQ_DEBUG (0) -#define IRQ_LOG(x) do { if (IRQ_DEBUG) printf x; } while (0) - #define PC8801FH_OSC1 XTAL(28'636'363) #define PC8801FH_OSC2 XTAL(42'105'200) #define PC8801FH_OSC3 XTAL(31'948'800) // called OSC1 on PC-8801FE board #define MASTER_CLOCK (PC8801FH_OSC3 / 8) -// TODO: exact clocks +// Crazy Unit page shows following measurements on N88 BASIC: +// 15kHz 25 lines 62.422 Hz, 20 lines 61.462 Hz #define PIXEL_CLOCK_15KHz (PC8801FH_OSC1 / 2) -#define PIXEL_CLOCK_24KHz XTAL(21'477'272) // should be (PC8801FH_OSC2 / 2)? - - -/* -CRTC command params: -0. CRTC reset - -[0] *--- ---- -[0] -xxx xxxx screen columns (+2) - -[1] xx-- ---- blink speed (in frame unit) (+1, << 3) -[1] --xx xxxx screen lines (+1) - -[2] x--- ---- "skip line" -[2] -x-- ---- cursor style (reverse on / underscore off) -[2] --x- ---- cursor blink on/off -[2] ---x xxxx lines per character (+1) - -[3] xxx- ---- Vertical Retrace (+1) -[3] ---x xxxx Horizontal Retrace (+2) - -[4] x--- ---- attribute not separate flag -[4] -x-- ---- attribute color flag -[4] --x- ---- attribute not special flag (invalidates next register) -[4] ---x xxxx attribute size (+1) -*/ - -#define screen_width ((m_crtc.param[0][0] & 0x7f) + 2) * 8 - -#define blink_speed ((((m_crtc.param[0][1] & 0xc0) >> 6) + 1) << 3) -#define screen_height ((m_crtc.param[0][1] & 0x3f) + 1) - -#define lines_per_char ((m_crtc.param[0][2] & 0x1f) + 1) - -#define vretrace (((m_crtc.param[0][3] & 0xe0) >> 5) + 1) -#define hretrace ((m_crtc.param[0][3] & 0x1f) + 2) * 8 - -#define text_color_flag ((m_crtc.param[0][4] & 0xe0) == 0x40) -//#define monitor_24KHz ((m_gfx_ctrl & 0x19) == 0x08) /* TODO: this is most likely to be WRONG */ +// 24kHz 25 lines 55.416 Hz, 20 lines 56.424 Hz +#define PIXEL_CLOCK_24KHz (PC8801FH_OSC2 / 2) +// Note: games may set these up differently, namely xak2 in 15 kHz going 68-ish Hz void pc8801_state::video_start() { -} - -void pc8801_state::draw_bitmap_3bpp(bitmap_ind16 &bitmap,const rectangle &cliprect) -{ - uint32_t count = 0; - - uint16_t y_double = (pc8801_pixel_clock()); - uint16_t y_size = (y_double+1) * 200; - - for(int y=0;y> (7-xi)) & 1) << 0; - pen |= ((m_gvram[count+0x4000] >> (7-xi)) & 1) << 1; - pen |= ((m_gvram[count+0x8000] >> (7-xi)) & 1) << 2; + m_screen->register_screen_bitmap(m_text_bitmap); - if(y_double) - { - if(cliprect.contains(x+xi, y+0)) - bitmap.pix(y+0, x+xi) = m_palette->pen(pen & 7); - - // TODO: real HW seems to actually just output to either even or odd line when in 3bpp mode - // investigate which is right - if(cliprect.contains(x+xi, y+1)) - bitmap.pix(y+1, x+xi) = m_palette->pen(pen & 7); - } - else - { - if(cliprect.contains(x+xi, y+0)) - bitmap.pix(y, x+xi) = m_palette->pen(pen & 7); - } - } - - count++; - } - } + save_item(NAME(m_attr_info)); } -void pc8801_state::draw_bitmap_1bpp(bitmap_ind16 &bitmap,const rectangle &cliprect) +void pc8801_state::palette_reset() { - // TODO: jettermi really masks the color attribute from 3301 - // (we currently draw it in b&w, should be colorized) - uint32_t count = 0; - uint8_t color = (m_gfx_ctrl & 1) ? 7 & ((m_layer_mask ^ 0xe) >> 1) : 7; - uint8_t is_cursor = 0; - - for(int y=0;y<200;y++) - { - for(int x=0;x<640;x+=8) - { - if(!(m_gfx_ctrl & 1)) - is_cursor = calc_cursor_pos(x/8,y/lines_per_char,y & (lines_per_char-1)); - - for(int xi=0;xi<8;xi++) - { - int pen = ((m_gvram[count+0x0000] >> (7-xi)) & 1); - if(is_cursor) - pen^=1; - - if((m_gfx_ctrl & 1)) - { - if(cliprect.contains(x+xi, y*2+0)) - bitmap.pix(y*2+0, x+xi) = m_palette->pen(pen ? color : 0); - - if(cliprect.contains(x+xi, y*2+1)) - bitmap.pix(y*2+1, x+xi) = m_palette->pen(pen ? color : 0); - } - else - { - if(cliprect.contains(x+xi, y)) - bitmap.pix(y, x+xi) = m_palette->pen(pen ? color : 0); - } - } - - count++; - } - } - - if(!(m_gfx_ctrl & 1)) // 400 lines - { - count = 0; - - for(int y=200;y<400;y++) - { - for(int x=0;x<640;x+=8) - { - if(!(m_gfx_ctrl & 1)) - is_cursor = calc_cursor_pos(x/8,y/lines_per_char,y & (lines_per_char-1)); - - for(int xi=0;xi<8;xi++) - { - int pen = ((m_gvram[count+0x4000] >> (7-xi)) & 1); - if(is_cursor) - pen^=1; - - if(cliprect.contains(x+xi, y)) - bitmap.pix(y, x+xi) = m_palette->pen(pen ? 7 : 0); - } - - count++; - } - } - } -} - -uint8_t pc8801_state::calc_cursor_pos(int x,int y,int yi) -{ - if(!(m_crtc.cursor_on)) // don't bother if cursor is off - return 0; + int i; - if(x == m_crtc.param[4][0] && y == m_crtc.param[4][1]) /* check if position matches */ + // bitmap init + for (i = 0; i < 8; i ++) { - /* don't pass through if we are using underscore */ - if((!(m_crtc.param[0][2] & 0x40)) && yi != 7) - return 0; - - /* finally check if blinking is currently active high */ - if(!(m_crtc.param[0][2] & 0x20)) - return 1; - - if(((m_screen->frame_number() / blink_speed) & 1) == 0) - return 1; - - return 0; + m_palram[i].b = i & 1 ? 7 : 0; + m_palram[i].r = i & 2 ? 7 : 0; + m_palram[i].g = i & 4 ? 7 : 0; + m_palette->set_pen_color(i, pal1bit(i >> 1), pal1bit(i >> 2), pal1bit(i >> 0)); } - - return 0; + m_palette->set_pen_color(BGPAL_PEN, 0, 0, 0); + m_palette->set_pen_color(BORDER_PEN, 0, 0, 0); } - - -uint8_t pc8801_state::extract_text_attribute(uint32_t address,int x, uint8_t width, uint8_t &non_special) +UPD3301_FETCH_ATTRIBUTE( pc8801_state::attr_fetch ) { - uint8_t *vram = m_work_ram.get(); - int i; - int fifo_size; - int offset; - - non_special = 0; - if(m_crtc.param[0][4] & 0x80) - { - popmessage("Using non-separate mode for text tilemap, contact MESSdev"); - return 0; - } - - fifo_size = (m_crtc.param[0][4] & 0x20) ? 0 : ((m_crtc.param[0][4] & 0x1f) + 1); - - if(fifo_size == 0) - { - non_special = 1; - return (text_color_flag) ? 0xe8 : 0; - } - - /* TODO: correct or hack-ish? Certainly having 0 as a attribute X is weird in any case. */ - offset = (vram[address] == 0) ? 2 : 0; - - for(i=0;i attr_extend_info = pc8001_base_state::attr_fetch(attr_row, gfx_mode, y, attr_fifo_size, row_size); + // In case we are in a b&w mode copy the attribute structure in an internal buffer for color processing. + // TBD if decoration attributes applies to bitmap as well (very likely) + if ((m_gfx_ctrl & 0x18) == 0x08 && gfx_mode == 2) { - if(x < vram[address+offset]) - { - return vram[address+1]; - } - else - address+=2; + for (int ey = y; ey < y + m_crtc->lines_per_char(); ey ++) + for (int ex = 0; ex < attr_max_size; ex ++) + m_attr_info[ey][ex] = attr_extend_info[ex]; } - - return vram[address-3+offset]; + return attr_extend_info; } -void pc8801_state::pc8801_draw_char(bitmap_ind16 &bitmap,int x,int y,int pal,uint8_t gfx_mode,uint8_t reverse,uint8_t secret,uint8_t blink,uint8_t upper,uint8_t lower,int y_size,int width, uint8_t non_special) +void pc8801_state::draw_bitmap(bitmap_rgb32 &bitmap, const rectangle &cliprect, palette_device *palette, std::function dot_func) { - uint8_t *vram = m_work_ram.get(); - - uint8_t y_height = lines_per_char; - uint8_t y_double = (pc8801_pixel_clock()); - uint8_t y_step = (non_special) ? 80 : 120; // trusted by Elthlead - uint8_t is_cursor = 0; + uint16_t y_double = get_screen_frequency(); + if ((m_gfx_ctrl & 0x11) == 0) + y_double = 0; + int32_t y_line_size = y_double + 1; - for(int yi=0;yivisible_area().contains(res_x, res_y)) - continue; - - int color; - if(gfx_mode) - { - uint8_t mask; - - mask = (xi & 4) ? 0x10 : 0x01; - mask <<= ((yi & (0x6 << y_double)) >> (1+y_double)); - color = (tile & mask) ? pal : -1; - } - else + u8 x_char = (x >> 3); + u32 bitmap_offset = (y >> y_double) * 80 + x_char; + for(int xi = 0; xi < 8; xi++) { - uint8_t blink_mask = 0; - if(blink && ((m_screen->frame_number() / blink_speed) & 3) == 1) - blink_mask = 1; - - uint8_t char_data; - if(yi >= (1 << (y_double+3)) || secret || blink_mask) - char_data = 0; - else - char_data = (m_cg_rom[tile*8+(yi >> y_double)] >> (7-xi)) & 1; + u8 pen_dot = dot_func(bitmap_offset, y, x_char, 7 - xi); - if(yi == 0 && upper) - char_data = 1; + if (pen_dot == 0) + continue; - if(yi == y_height && lower) - char_data = 1; - - if(is_cursor) - char_data^=1; - - if(reverse) - char_data^=1; - - color = char_data ? pal : -1; - } - - if(color != -1) - { - bitmap.pix(res_y, res_x) = m_palette->pen(color); - if(width) + // TODO: some real HW snaps implies that output is only even or odd line when in 3bpp mode, verify + // 3301 skip line? interlace artifact? other? + for (int yi = 0; yi < y_line_size; yi ++) { - if(!m_screen->visible_area().contains(res_x+1, res_y)) - continue; - - bitmap.pix(res_y, res_x+1) = m_palette->pen(color); + int res_x = x + xi; + int res_y = y + yi; + // still need to check against cliprect, + // in the rare case that 3301 CRTC is set to non-canon values (such as any width != 640). + if (cliprect.contains(res_x, res_y)) + bitmap.pix(res_y, res_x) = palette->pen(pen_dot); } } } } } -void pc8801_state::draw_text(bitmap_ind16 &bitmap,int y_size, uint8_t width) +uint32_t pc8801_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - int x,y; - uint8_t attr; - uint8_t reverse; - uint8_t gfx_mode; - uint8_t secret; - uint8_t upper; - uint8_t lower; - uint8_t blink; - int pal; - uint8_t non_special; - - for(y=0;ypen(bitmap_color_mode ? 0 : BGPAL_PEN), cliprect); + + if(bitmap_color_mode) + draw_bitmap(bitmap, cliprect, m_palette, [&](u32 bitmap_offset, int y, int x, int xi){ + u8 res = 0; + + // note: layer masking doesn't occur in 3bpp mode, bugattac relies on this + for (int plane = 0; plane < 3; plane ++) + res |= ((m_gvram[bitmap_offset + plane * 0x4000] >> xi) & 1) << plane; + + return res; + }); + else { - if(x & 1 && !width) - continue; + if (m_gfx_ctrl & 1) + { + // b&w 640x200x3 + draw_bitmap(bitmap, cliprect, m_palette, [&](u32 bitmap_offset, int y, int x, int xi){ + u8 res = 0; + + // in this mode all three planes can potentially form the output + // it's the only place where I/O $53 bits 1-3 have an actual effect + for (int plane = 0; plane < 3; plane ++) + { + u8 mask = (m_bitmap_layer_mask >> plane) & 1; + res |= ((m_gvram[bitmap_offset + plane * 0x4000] >> xi) & mask); + } - attr = extract_text_attribute((((y*120)+80+m_dma_address[2]) & 0xffff),(x),width,non_special); + if (!res) + return 0; - if(text_color_flag && (attr & 8)) // color mode - { - pal = ((attr & 0xe0) >> 5); - gfx_mode = (attr & 0x10) >> 4; - reverse = 0; - secret = 0; - upper = 0; - lower = 0; - blink = 0; - pal|=8; //text pal bank + return m_crtc->get_display_status() ? (m_attr_info[y][x] >> 13) & 7 : 7; + }); } - else // monochrome + else { - pal = 7; /* TODO: Bishoujo Baseball Gakuen Pasoket logo wants this to be black somehow ... */ - gfx_mode = (attr & 0x80) >> 7; - reverse = (attr & 4) >> 2; - secret = (attr & 1); - upper = (attr & 0x10) >> 4; - lower = (attr & 0x20) >> 5; - blink = (attr & 2) >> 1; - pal|=8; //text pal bank - reverse ^= m_crtc.inverse; - - if(attr & 0x80) - popmessage("Warning: mono gfx mode enabled, contact MESSdev"); + // true 400 line mode, 640x400x1 + // - p1demo2d expects to use CRTC palette on demonstration + // (white text that is set to black on previous title screen animation, + // that runs in 3bpp) + draw_bitmap(bitmap, cliprect, m_crtc_palette, [&](u32 bitmap_offset, int y, int x, int xi){ + u8 res = 0; + // HW pick ups just the first two planes (R and B), G is unused for drawing purposes. + // Plane switch happens at half screen, VRAM areas 0x3e80-0x3fff is unused again. + // TODO: confirm that a 15 kHz monitor cannot work with this + // - jettermi just uses the other b&w mode; + // - casablan doesn't bother in changing resolution so only the upper part is drawn; + int plane_offset = y >= 200 ? 384 : 0; + + res |= ((m_gvram[bitmap_offset + plane_offset] >> xi) & 1); + if (!res) + return 0; + return m_crtc->get_display_status() ? (m_attr_info[y][x] >> 13) & 7 : 7; + }); } - - pc8801_draw_char(bitmap,x,y,pal,gfx_mode,reverse,secret,blink,upper,lower,y_size,!width,non_special); } } -} - -uint32_t pc8801_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - bitmap.fill(m_palette->pen(0), cliprect); - -// popmessage("%04x %04x %02x",m_dma_address[2],m_dma_counter[2],m_dmac_mode); - - if(m_gfx_ctrl & 8) - { - if(m_gfx_ctrl & 0x10) - draw_bitmap_3bpp(bitmap,cliprect); - else - draw_bitmap_1bpp(bitmap,cliprect); - } - - //popmessage("%02x %02x %02x %02x %02x",state->m_layer_mask,state->m_dmac_mode,state->m_crtc.status,state->m_crtc.irq_mask,state->m_gfx_ctrl); + else + bitmap.fill(0, cliprect); - if(!(m_layer_mask & 1) && m_dmac_mode & 4 && m_crtc.status & 0x10 && m_crtc.irq_mask == 3) + if(!m_text_layer_mask) { - //popmessage("%02x %02x",m_crtc.param[0][0],m_crtc.param[0][4]); - - draw_text(bitmap,screen_height,m_txt_width); + m_text_bitmap.fill(0, cliprect); + m_crtc->screen_update(screen, m_text_bitmap, cliprect); + copybitmap_trans(bitmap, m_text_bitmap, 0, 0, 0, 0, cliprect, 0); } return 0; } -uint8_t pc8801_state::pc8801_alu_r(offs_t offset) +uint8_t pc8801_state::dma_mem_r(offs_t offset) { - int i; - uint8_t b,r,g; + // TODO: TVRAM readback + return m_work_ram[offset & 0xffff]; +} + +uint8_t pc8801_state::alu_r(offs_t offset) +{ + uint8_t b, r, g; /* store data to ALU regs */ - for(i=0;i<3;i++) + for(int i = 0; i < 3; i++) m_alu_reg[i] = m_gvram[i*0x4000 + offset]; b = m_gvram[offset + 0x0000]; @@ -646,17 +296,19 @@ return b & r & g; } -void pc8801_state::pc8801_alu_w(offs_t offset, uint8_t data) +void pc8801_state::alu_w(offs_t offset, uint8_t data) { int i; - switch(m_alu_ctrl2 & 0x30) // alu write mode + // ALU write mode + switch(m_alu_ctrl2 & 0x30) { - case 0x00: //logic operation + // logic operation + case 0x00: { uint8_t logic_op; - for(i=0;i<3;i++) + for(i = 0; i < 3; i++) { logic_op = (m_alu_ctrl1 & (0x11 << i)) >> i; @@ -671,35 +323,38 @@ } break; - case 0x10: // restore data from ALU regs + // restore data from ALU regs + case 0x10: { - for(i=0;i<3;i++) + for(i = 0; i < 3; i++) m_gvram[i*0x4000 + offset] = m_alu_reg[i]; } break; - case 0x20: // swap ALU reg 1 into R GVRAM + // swap ALU reg 1 into R GVRAM + case 0x20: m_gvram[0x0000 + offset] = m_alu_reg[1]; break; - case 0x30: // swap ALU reg 0 into B GVRAM + // swap ALU reg 0 into B GVRAM + case 0x30: m_gvram[0x4000 + offset] = m_alu_reg[0]; break; } } -uint8_t pc8801_state::pc8801_wram_r(offs_t offset) +uint8_t pc8801_state::wram_r(offs_t offset) { return m_work_ram[offset]; } -void pc8801_state::pc8801_wram_w(offs_t offset, uint8_t data) +void pc8801_state::wram_w(offs_t offset, uint8_t data) { m_work_ram[offset] = data; } -uint8_t pc8801_state::pc8801_ext_wram_r(offs_t offset) +uint8_t pc8801_state::ext_wram_r(offs_t offset) { if(offset < m_extram_size) return m_ext_work_ram[offset]; @@ -707,100 +362,111 @@ return 0xff; } -void pc8801_state::pc8801_ext_wram_w(offs_t offset, uint8_t data) +void pc8801_state::ext_wram_w(offs_t offset, uint8_t data) { if(offset < m_extram_size) m_ext_work_ram[offset] = data; } -uint8_t pc8801_state::pc8801_nbasic_rom_r(offs_t offset) +uint8_t pc8801_state::nbasic_rom_r(offs_t offset) { return m_n80rom[offset]; } -uint8_t pc8801_state::pc8801_n88basic_rom_r(offs_t offset) +uint8_t pc8801_state::n88basic_rom_r(offs_t offset) { return m_n88rom[offset]; } -uint8_t pc8801_state::pc8801_gvram_r(offs_t offset) +uint8_t pc8801_state::gvram_r(offs_t offset) { return m_gvram[offset]; } -void pc8801_state::pc8801_gvram_w(offs_t offset, uint8_t data) +void pc8801_state::gvram_w(offs_t offset, uint8_t data) { m_gvram[offset] = data; } -uint8_t pc8801_state::pc8801_high_wram_r(offs_t offset) +uint8_t pc8801_state::high_wram_r(offs_t offset) { return m_hi_work_ram[offset]; } -void pc8801_state::pc8801_high_wram_w(offs_t offset, uint8_t data) +void pc8801_state::high_wram_w(offs_t offset, uint8_t data) { m_hi_work_ram[offset] = data; } -uint8_t pc8801_state::pc8801ma_dic_r(offs_t offset) +// TODO: remove these virtual trampolines once we modernize memory map +// Needs confirmation about really not being there tho, given the design +// may be that both dictionary and CD-ROM are generic slots instead. +inline uint8_t pc8801_state::dictionary_rom_r(offs_t offset) { - uint8_t *dic_rom = memregion("dictionary")->base(); + return 0xff; +} - return dic_rom[offset]; +inline bool pc8801_state::dictionary_rom_enable() +{ + return false; } -uint8_t pc8801_state::pc8801_cdbios_rom_r(offs_t offset) +inline uint8_t pc8801_state::cdbios_rom_r(offs_t offset) { - uint8_t *cdrom_bios = memregion("cdrom")->base(); + return 0xff; +} - return cdrom_bios[offset]; +inline bool pc8801_state::cdbios_rom_enable() +{ + return false; } -uint8_t pc8801_state::pc8801_mem_r(offs_t offset) +uint8_t pc8801_state::mem_r(offs_t offset) { if(offset <= 0x7fff) { if(m_extram_mode & 1) - return pc8801_ext_wram_r(offset | (m_extram_bank * 0x8000)); + return ext_wram_r(offset | (m_extram_bank * 0x8000)); if(m_gfx_ctrl & 2) - return pc8801_wram_r(offset); + return wram_r(offset); - if(m_has_cdrom && m_cdrom_reg[9] & 0x10) - return pc8801_cdbios_rom_r((offset & 0x7fff) | ((m_gfx_ctrl & 4) ? 0x8000 : 0x0000)); + if(cdbios_rom_enable()) + return cdbios_rom_r(offset & 0x7fff); if(m_gfx_ctrl & 4) - return pc8801_nbasic_rom_r(offset); + return nbasic_rom_r(offset); if(offset >= 0x6000 && offset <= 0x7fff && ((m_ext_rom_bank & 1) == 0)) - return pc8801_n88basic_rom_r(0x8000 + (offset & 0x1fff) + (0x2000 * (m_misc_ctrl & 3))); + return n88basic_rom_r(0x8000 + (offset & 0x1fff) + (0x2000 * (m_misc_ctrl & 3))); - return pc8801_n88basic_rom_r(offset); + return n88basic_rom_r(offset); } else if(offset >= 0x8000 && offset <= 0x83ff) // work RAM window { uint32_t window_offset; - if(m_gfx_ctrl & 6) //wram read select or n basic select banks this as normal wram - return pc8801_wram_r(offset); + // work RAM read select or N-Basic select always banks this as normal work RAM + if(m_gfx_ctrl & 6) + return wram_r(offset); window_offset = (offset & 0x3ff) + (m_window_offset_bank << 8); // castlex and imenes accesses this + // TODO: high TVRAM even if(((window_offset & 0xf000) == 0xf000) && (m_misc_ctrl & 0x10)) - return pc8801_high_wram_r(window_offset & 0xfff); + return high_wram_r(window_offset & 0xfff); - return pc8801_wram_r(window_offset); + return wram_r(window_offset); } else if(offset >= 0x8400 && offset <= 0xbfff) { - return pc8801_wram_r(offset); + return wram_r(offset); } else if(offset >= 0xc000 && offset <= 0xffff) { - if(m_has_dictionary && m_dic_ctrl) - return pc8801ma_dic_r((offset & 0x3fff) + ((m_dic_bank & 0x1f) * 0x4000)); + if(dictionary_rom_enable()) + return dictionary_rom_r(offset & 0x3fff); if(m_misc_ctrl & 0x40) { @@ -808,38 +474,39 @@ m_vram_sel = 3; if(m_alu_ctrl2 & 0x80) - return pc8801_alu_r(offset & 0x3fff); + return alu_r(offset & 0x3fff); } if(m_vram_sel == 3) { if(offset >= 0xf000 && offset <= 0xffff && (m_misc_ctrl & 0x10)) - return pc8801_high_wram_r(offset & 0xfff); + return high_wram_r(offset & 0xfff); - return pc8801_wram_r(offset); + return wram_r(offset); } - return pc8801_gvram_r((offset & 0x3fff) + (0x4000 * m_vram_sel)); + return gvram_r((offset & 0x3fff) + (0x4000 * m_vram_sel)); } return 0xff; } -void pc8801_state::pc8801_mem_w(offs_t offset, uint8_t data) +void pc8801_state::mem_w(offs_t offset, uint8_t data) { if(offset <= 0x7fff) { if(m_extram_mode & 0x10) - pc8801_ext_wram_w(offset | (m_extram_bank * 0x8000),data); + ext_wram_w(offset | (m_extram_bank * 0x8000),data); else - pc8801_wram_w(offset,data); + wram_w(offset,data); return; } else if(offset >= 0x8000 && offset <= 0x83ff) { - if(m_gfx_ctrl & 6) //wram read select or n basic select banks this as normal wram - pc8801_wram_w(offset,data); + // work RAM read select or N-Basic select always banks this as normal work RAM + if(m_gfx_ctrl & 6) + wram_w(offset,data); else { uint32_t window_offset; @@ -848,18 +515,19 @@ // castlex and imenes accesses this // TODO: high TVRAM even - // (uPD3301 reads from this instead of the regular work RAM) + // μPD3301 DMAs from this instead of the regular work RAM in later models + // to resolve a bus bottleneck. if(((window_offset & 0xf000) == 0xf000) && (m_misc_ctrl & 0x10)) - pc8801_high_wram_w(window_offset & 0xfff,data); + high_wram_w(window_offset & 0xfff,data); else - pc8801_wram_w(window_offset,data); + wram_w(window_offset,data); } return; } else if(offset >= 0x8400 && offset <= 0xbfff) { - pc8801_wram_w(offset,data); + wram_w(offset,data); return; } else if(offset >= 0xc000 && offset <= 0xffff) @@ -871,7 +539,7 @@ if(m_alu_ctrl2 & 0x80) { - pc8801_alu_w(offset & 0x3fff,data); + alu_w(offset & 0x3fff,data); return; } } @@ -880,51 +548,122 @@ { if(offset >= 0xf000 && offset <= 0xffff && (m_misc_ctrl & 0x10)) { - pc8801_high_wram_w(offset & 0xfff,data); + high_wram_w(offset & 0xfff,data); return; } - pc8801_wram_w(offset,data); + wram_w(offset,data); return; } - pc8801_gvram_w((offset & 0x3fff) + (0x4000 * m_vram_sel),data); + gvram_w((offset & 0x3fff) + (0x4000 * m_vram_sel),data); return; } } -void pc8801_state::pc8801_mem(address_map &map) +void pc8801_state::main_map(address_map &map) { - map(0x0000, 0xffff).rw(FUNC(pc8801_state::pc8801_mem_r), FUNC(pc8801_state::pc8801_mem_w)); + map(0x0000, 0xffff).rw(FUNC(pc8801_state::mem_r), FUNC(pc8801_state::mem_w)); } -uint8_t pc8801_state::pc8801_ctrl_r() +uint8_t pc8801_state::ext_rom_bank_r() { - /* - 11-- ---- - --x- ---- vrtc - ---x ---- calendar CDO - ---- x--- fdc auto-boot DIP-SW - ---- -x-- (RS-232C related) - ---- --x- monitor refresh rate DIP-SW - ---- ---x (pbsy?) - */ - return ioport("CTRL")->read(); + return m_ext_rom_bank; } -void pc8801_state::pc8801_ctrl_w(uint8_t data) +void pc8801_state::ext_rom_bank_w(uint8_t data) { - /* - x--- ---- SING (buzzer mask?) - -x-- ---- mouse latch (JOP1, routes on OPN sound port A) - --x- ---- beeper - ---x ---- ghs mode - ---- x--- crtc i/f sync mode - ---- -x-- upd1990a clock bit - ---- --x- upd1990a strobe bit - ---- ---x printer strobe - */ + m_ext_rom_bank = data; +} + +// inherited from pc8001.cpp +#if 0 +void pc8801_state::port30_w(uint8_t data) +{ + m_txt_width = data & 1; + m_txt_color = data & 2; + + m_cassette->change_state(BIT(data, 3) ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR); +} +#endif + +/* + * I/O Port $31 (w/o) "System Control Port (2)" + * N88-BASIC buffer port $e6c2 + * + * --x- ---- 25LINE: line control in high speed CRT mode (1) 25 lines (0) 20 lines + * ---x ---- HCOLOR: color graphic display mode + * ---1 ---- color mode + * ---0 ---- monochrome mode + * ---- x--- GRPH: Graphic display mode yes (1) / no (0) + * ---- -x-- RMODE: ROM mode control N-BASIC (1, ROM 1 & 2) / N88-BASIC (0, ROM 3 & 4) + * ---- --x- MMODE: RAM mode control yes (1, full RAM) / no (0, ROM/RAM mixed) + * ---- ---x 200LINE: 200 lines (1) / 400 lines (0) in 1bpp mode + * + */ +void pc8801_state::port31_w(uint8_t data) +{ + m_gfx_ctrl = data; + +// set_screen_frequency((data & 0x11) != 0x11); +// dynamic_res_change(); +} + +/* + * I/O Port $40 reads "Strobe Port" + * + * 1--- ---- UOP2: SW1-8 + * -1-- ---- UOP1: + * --x- ---- VRTC: vblank signal (0) display (1) vblank + * ---x ---- CDI: upd1990a data read + * ---- x--- /EXTON: Minidisc unit connection signal (SW2-7) + * ---- -x-- DCD: SIO Data Carrier Detect signal (0) no carrier (1) with + * ---- --x- /SHG: monitor resolution mode (0) high res (1) normal res + * ---- ---x BUSY: printer (0) READY (1) BUSY + * + */ +uint8_t pc8801_state::port40_r() +{ + uint8_t data = 0x00; + + data |= ioport("CTRL")->read() & 0xcf; + data |= m_rtc->data_out_r() << 4; + data |= m_crtc->vrtc_r() << 5; + // TODO: enable line from pc80s31k (bit 3, active_low) + + return data; + +// return ioport("CTRL")->read(); +} +inline attotime pc8801_state::mouse_limit_hz() +{ + return attotime::from_hz(900); +} + +inline attotime pc8801fh_state::mouse_limit_hz() +{ + return attotime::from_hz(m_clock_setting ? 900 : 1800); +} + +/* + * I/O Port $40 writes "Strobe Port" + * N88-BASIC buffer port $e6c1 + * + * x--- ---- UOP2: general purpose output 2 / sound port + * SING (buzzer mask?) + * -x-- ---- UOP1: general purpose output 1 + * generally used for mouse latch (JOP1, routes on OPN sound port A) + * --x- ---- BEEP: beeper enable + * ---x ---- FLASH: flash mode control (active high) + * ---- x--- /CLDS: "CRT I/F sync control" (init CRT and controller sync pulses?) + * ---- -x-- CCK: upd1990a clock bit + * ---- --x- CSTB: upd1990a strobe bit + * ---- ---x /PSTB: printer strobe (active low) + * + */ +void pc8801_state::port40_w(uint8_t data) +{ m_rtc->stb_w((data & 2) >> 1); m_rtc->clk_w((data & 4) >> 2); @@ -934,173 +673,95 @@ if(((m_device_ctrl_data & 0x20) == 0x20) && ((data & 0x20) == 0x00)) m_beeper->set_state(0); + // TODO: send to joyport implementation if((m_device_ctrl_data & 0x40) != (data & 0x40)) { attotime new_time = machine().time(); - if(m_mouse.phase == 0) - { - m_mouse.x = ioport("MOUSEX")->read(); - m_mouse.y = ioport("MOUSEY")->read(); - } - - if(data & 0x40 && (new_time - m_mouse.time) > attotime::from_hz(900)) + if(data & 0x40 && (new_time - m_mouse.time) > mouse_limit_hz()) { m_mouse.phase = 0; } else { - m_mouse.phase++; + m_mouse.phase ++; m_mouse.phase &= 3; } + if(m_mouse.phase == 0) + { + const u8 mouse_x = ioport("MOUSEX")->read(); + const u8 mouse_y = ioport("MOUSEY")->read(); + + m_mouse.lx = (mouse_x - m_mouse.prev_dx) & 0xff; + m_mouse.ly = (mouse_y - m_mouse.prev_dy) & 0xff; + + m_mouse.prev_dx = mouse_x; + m_mouse.prev_dy = mouse_y; + } + m_mouse.time = machine().time(); } - /* TODO: is SING a buzzer mask? Bastard Special relies on this ... */ + // TODO: is SING a buzzer mask? bastard leaves beeper to ON state otherwise if(m_device_ctrl_data & 0x80) m_beeper->set_state(0); m_device_ctrl_data = data; } -uint8_t pc8801_state::pc8801_ext_rom_bank_r() -{ - return m_ext_rom_bank; -} - -void pc8801_state::pc8801_ext_rom_bank_w(uint8_t data) -{ - m_ext_rom_bank = data; -} - -uint8_t pc8801_state::pc8801_pixel_clock(void) -{ - int ysize = m_screen->height(); /* TODO: correct condition*/ - - return (ysize >= 400); -} - -void pc8801_state::pc8801_dynamic_res_change(void) -{ - rectangle visarea; - int xsize,ysize,xvis,yvis; - attoseconds_t refresh;; - - /* bail out if screen params aren't valid */ - if(!m_crtc.param[0][0] || !m_crtc.param[0][1] || !m_crtc.param[0][2] || !m_crtc.param[0][3]) - return; - - xvis = screen_width; - yvis = screen_height * lines_per_char; - xsize = screen_width + hretrace; - ysize = screen_height * lines_per_char + vretrace * lines_per_char; - -// popmessage("H %d V %d (%d x %d) HR %d VR %d (%d %d)\n",xvis,yvis,screen_height,lines_per_char,hretrace,vretrace, xsize,ysize); - - visarea.set(0, xvis - 1, 0, yvis - 1); - if(pc8801_pixel_clock()) - refresh = HZ_TO_ATTOSECONDS(PIXEL_CLOCK_24KHz) * (xsize) * ysize; - else - refresh = HZ_TO_ATTOSECONDS(PIXEL_CLOCK_15KHz) * (xsize) * ysize; - - m_screen->configure(xsize, ysize, visarea, refresh); -} - -void pc8801_state::pc8801_gfx_ctrl_w(uint8_t data) -{ - /* - --x- ---- ??? - ---x ---- graphic color yes (1) / no (0) - ---- x--- graphic display yes (1) / no (0) - ---- -x-- Basic N (1) / N88 (0) - ---- --x- RAM select yes (1) / no (0) - ---- ---x VRAM 200 lines (1) / 400 lines (0) in 1bpp mode - */ - - m_gfx_ctrl = data; - - pc8801_dynamic_res_change(); -} - -uint8_t pc8801_state::pc8801_vram_select_r() +uint8_t pc8801_state::vram_select_r() { return 0xf8 | ((m_vram_sel == 3) ? 0 : (1 << m_vram_sel)); } -void pc8801_state::pc8801_vram_select_w(offs_t offset, uint8_t data) +void pc8801_state::vram_select_w(offs_t offset, uint8_t data) { m_vram_sel = offset & 3; } -#if USE_PROPER_I8214 - -void pc8801_state::i8214_irq_level_w(uint8_t data) +void pc8801_state::irq_level_w(uint8_t data) { - if(data & 8) - m_pic->b_w(7); - else - m_pic->b_w(data & 0x07); + m_pic->b_sgs_w(~data); } -void pc8801_state::i8214_irq_mask_w(uint8_t data) -{ - m_timer_irq_mask = data & 1; - m_vblank_irq_mask = data & 2; -} - - -#else -void pc8801_state::pc8801_irq_level_w(uint8_t data) +/* + * ---- -x-- /RXMF RXRDY irq mask + * ---- --x- /VRMF VRTC irq mask + * ---- ---x /RTMF Real-time clock irq mask + * + */ +void pc8801_state::irq_mask_w(uint8_t data) { - if(data & 8) - m_i8214_irq_level = 7; - else - m_i8214_irq_level = data & 7; + m_irq_state.enable &= ~7; + // mapping reversed to the correlated irq levels + m_irq_state.enable |= bitswap<3>(data & 7, 0, 1, 2); -// IRQ_LOG(("%02x LV\n",m_i8214_irq_level)); + check_irq(RXRDY_IRQ_LEVEL); + check_irq(VRTC_IRQ_LEVEL); + check_irq(CLOCK_IRQ_LEVEL); } -void pc8801_state::pc8801_irq_mask_w(uint8_t data) -{ - m_timer_irq_mask = data & 1; - m_vrtc_irq_mask = data & 2; - - if(m_timer_irq_mask == 0) - m_timer_irq_latch = 0; - - if(m_vrtc_irq_mask == 0) - m_vrtc_irq_latch = 0; - - if(m_timer_irq_latch == 0 && m_vrtc_irq_latch == 0 && m_sound_irq_latch == 0) - m_maincpu->set_input_line(0,CLEAR_LINE); - -// IRQ_LOG(("%02x MASK (%02x %02x)\n",data,m_timer_irq_latch,m_vrtc_irq_latch)); - - //if(data & 4) - // printf("IRQ mask %02x\n",data); -} -#endif - -uint8_t pc8801_state::pc8801_window_bank_r() +uint8_t pc8801_state::window_bank_r() { return m_window_offset_bank; } -void pc8801_state::pc8801_window_bank_w(uint8_t data) +void pc8801_state::window_bank_w(uint8_t data) { m_window_offset_bank = data; } -void pc8801_state::pc8801_window_bank_inc_w(uint8_t data) +void pc8801_state::window_bank_inc_w(uint8_t data) { - m_window_offset_bank++; - m_window_offset_bank&=0xff; + m_window_offset_bank ++; + m_window_offset_bank &= 0xff; } /* * I/O Port $32 (R/W) + * Not on vanilla PC-8801 (mkII onward) * * x--- ---- sound irq mask (0) irq enabled (1) irq masked * -x-- ---- Graphic VRAM access mode (0) independent access mode (1) ALU mode @@ -1113,43 +774,43 @@ * ---- 11-- Optional mode * ---- --xx internal EROM selection */ -uint8_t pc8801_state::pc8801_misc_ctrl_r() +uint8_t pc8801_state::misc_ctrl_r() { return m_misc_ctrl; } -void pc8801_state::pc8801_misc_ctrl_w(uint8_t data) +void pc8801_state::misc_ctrl_w(uint8_t data) { m_misc_ctrl = data; - #if USE_PROPER_I8214 - m_sound_irq_mask = ((data & 0x80) == 0); - #else - m_sound_irq_mask = ((data & 0x80) == 0); - - if(m_sound_irq_mask == 0) - m_sound_irq_latch = 0; - - if(m_timer_irq_latch == 0 && m_vrtc_irq_latch == 0 && m_sound_irq_latch == 0) - m_maincpu->set_input_line(0,CLEAR_LINE); - - if(m_sound_irq_mask && m_sound_irq_pending) - { - m_maincpu->set_input_line(0,HOLD_LINE); - m_sound_irq_latch = 1; - m_sound_irq_pending = 0; - } + m_sound_irq_enable = ((data & 0x80) == 0); - #endif + // Note: this will map to no irq anyway if there isn't any device interested in INT4 + if (m_sound_irq_enable) + int4_irq_w(m_sound_irq_pending); } -void pc8801_state::pc8801_bgpal_w(uint8_t data) +/* + * I/O Port $52 "Border and background color control" + * + * -RGB ---- BGx: Background color, index for pen #0 + * ---- -RGB Rx: Border color + * + * NB: according to several sources a non-vanilla PC8801 hardwires border to black, + * leaving this portion unconnected. + * For debugging reasons we leave it in for every machine instead. + * + */ +void pc8801_state::bgpal_w(uint8_t data) { - if(data) - printf("BG Pal %02x\n",data); + // sorcerml uses BG Pal extensively: + // - On bootup message it sets register $54 to white and bgpal to 0, expecting the layer to be transparent; + // - On playlist sets BG Pal to 0x10 (blue background); + m_palette->set_pen_color(BGPAL_PEN, pal1bit(BIT(data, 6)), pal1bit(BIT(data, 5)), pal1bit(BIT(data, 4))); + m_palette->set_pen_color(BORDER_PEN, pal1bit(BIT(data, 2)), pal1bit(BIT(data, 1)), pal1bit(BIT(data, 0))); } -void pc8801_state::pc8801_palram_w(offs_t offset, uint8_t data) +void pc8801_state::palram_w(offs_t offset, uint8_t data) { if(m_misc_ctrl & 0x20) //analog palette { @@ -1173,349 +834,161 @@ // TODO: What happens to the palette contents when the analog/digital palette mode changes? // Preserve content? Translation? Undefined? m_palette->set_pen_color(offset, pal3bit(m_palram[offset].r), pal3bit(m_palram[offset].g), pal3bit(m_palram[offset].b)); - // TODO: at least analog mode can do rasters -} - -void pc8801_state::pc8801_layer_masking_w(uint8_t data) -{ - /* - ---- x--- green gvram masked flag - ---- -x-- red gvram masked flag - ---- --x- blue gvram masked flag - ---- ---x text vram masked - */ - - m_layer_mask = data; -} - -uint8_t pc8801_state::pc8801_crtc_param_r() -{ - printf("CRTC param reading\n"); - return 0xff; -} - -void pc8801_state::pc88_crtc_param_w(uint8_t data) -{ - if(m_crtc.param_count < 5) - { - m_crtc.param[m_crtc.cmd][m_crtc.param_count] = data; - if(m_crtc.cmd == 0) - pc8801_dynamic_res_change(); - - m_crtc.param_count++; - } + // TODO: at least analog mode can do rasters, unconfirmed for digital mode + // p8suite Analog RGB test cross bars (reportedly works in 24 kHz / 80 column only) + // NB: it uses a bunch of non-waitstate related opcodes to cycle time it right, + // implying a stress-test for Z80 opcode cycles. +// m_screen->update_partial(m_screen->vpos()); } -uint8_t pc8801_state::pc8801_crtc_status_r() -{ - /* - ---x ---- video enable - ---- x--- DMA is running - ---- -x-- special control character IRQ - ---- --x- indication end IRQ - ---- ---x light pen input - */ - return m_crtc.status; -} - -#if 0 -static const char *const crtc_command[] = -{ - "Reset / Stop Display", // 0 - "Start Display", // 1 - "Set IRQ MASK", // 2 - "Read Light Pen", // 3 - "Load Cursor Position", // 4 - "Reset IRQ", // 5 - "Reset Counters", // 6 - "Read Status" // 7 -}; -#endif - -void pc8801_state::pc88_crtc_cmd_w(uint8_t data) -{ - m_crtc.cmd = (data & 0xe0) >> 5; - m_crtc.param_count = 0; - - switch(m_crtc.cmd) - { - case 0: // reset CRTC - m_crtc.status &= (~0x16); - break; - case 1: // start display - m_crtc.status |= 0x10; - m_crtc.status &= (~0x08); - m_crtc.inverse = data & 1; - - if(data & 1) /* Ink Pot uses it, but I want another test case before removing this log */ - printf("CRTC inverse mode ON\n"); - break; - case 2: // set irq mask - m_crtc.irq_mask = data & 3; - break; - case 3: // read light pen - m_crtc.status &= (~0x01); - break; - case 4: // load cursor position ON/OFF - m_crtc.cursor_on = data & 1; - break; - case 5: // reset IRQ - case 6: // reset counters - m_crtc.status &= (~0x06); - break; - } - - //if((data >> 5) != 4) - // printf("CRTC cmd %s polled %02x\n",crtc_command[data >> 5],data & 0x1f); -} - -uint8_t pc8801_state::pc8801_dmac_r(offs_t offset) -{ - printf("DMAC R %08x\n",offset); - return 0xff; -} - -void pc8801_state::pc8801_dmac_w(offs_t offset, uint8_t data) -{ - if(offset & 1) - m_dma_counter[offset >> 1] = (m_dmac_ff) ? (m_dma_counter[offset >> 1]&0xff)|(data<<8) : (m_dma_counter[offset >> 1]&0xff00)|(data&0xff); - else - m_dma_address[offset >> 1] = (m_dmac_ff) ? (m_dma_address[offset >> 1]&0xff)|(data<<8) : (m_dma_address[offset >> 1]&0xff00)|(data&0xff); - - m_dmac_ff ^= 1; -} - -uint8_t pc8801_state::pc8801_dmac_status_r() -{ - //printf("DMAC R STATUS\n"); - return 0xff; -} - -void pc8801_state::pc8801_dmac_mode_w(uint8_t data) -{ - m_dmac_mode = data; - m_dmac_ff = 0; - - // Valis II sets 0x20 - //if(data != 0xe4 && data != 0xa0 && data != 0xc4 && data != 0x80 && data != 0x00) - // printf("%02x DMAC mode\n",data); -} - -uint8_t pc8801_state::pc8801_extram_mode_r() -{ - return (m_extram_mode ^ 0x11) | 0xee; -} - -void pc8801_state::pc8801_extram_mode_w(uint8_t data) -{ - /* - ---x ---- Write EXT RAM access at 0x0000 - 0x7fff - ---- ---x Read EXT RAM access at 0x0000 - 0x7fff - */ - - m_extram_mode = data & 0x11; -} - -uint8_t pc8801_state::pc8801_extram_bank_r() -{ - return m_extram_bank; -} - -void pc8801_state::pc8801_extram_bank_w(uint8_t data) -{ - m_extram_bank = data; -} - -void pc8801_state::pc8801_alu_ctrl1_w(uint8_t data) -{ - m_alu_ctrl1 = data; -} - -void pc8801_state::pc8801_alu_ctrl2_w(uint8_t data) -{ - m_alu_ctrl2 = data; -} - -// TODO: Implement PCG-8100 as a bus option -// It's an HAL Laboratory custom board with PCG (maps to chars $80-$ff), -// dual AY-3-891x & PIT, I/O $b0-$b2 is the I/O ID for it? -// Find a supported SW (only HAL seems to support it) & investigate -void pc8801_state::pc8801_pcg8100_w(offs_t offset, uint8_t data) -{ - logerror("%s: Possible write to PCG-8100 %02x %02x\n", machine().describe_context(), offset, data); -} - -void pc8801_state::pc8801_txt_cmt_ctrl_w(uint8_t data) -{ - /* bits 2 to 5 are cmt related */ - - m_txt_width = data & 1; - m_txt_color = data & 2; - - m_cassette->change_state(BIT(data,3) ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR); -} - - -uint8_t pc8801_state::pc8801_kanji_r(offs_t offset) -{ - if((offset & 2) == 0) - return m_kanji_rom[m_knj_addr[0]*2+((offset & 1) ^ 1)]; - - return 0xff; -} - -void pc8801_state::pc8801_kanji_w(offs_t offset, uint8_t data) -{ - if((offset & 2) == 0) - m_knj_addr[0] = ((offset & 1) == 0) ? ((m_knj_addr[0]&0xff00)|(data&0xff)) : ((m_knj_addr[0]&0x00ff)|(data<<8)); -} - -uint8_t pc8801_state::pc8801_kanji_lv2_r(offs_t offset) -{ - if((offset & 2) == 0) - return m_kanji_rom[m_knj_addr[1]*2+((offset & 1) ^ 1)]; - - return 0xff; +/* + * ---- x--- green gvram masked flag + * ---- -x-- red gvram masked flag + * ---- --x- blue gvram masked flag + * ---- ---x text vram masked + */ +void pc8801_state::layer_masking_w(uint8_t data) +{ + m_text_layer_mask = bool(BIT(data, 0)); + m_bitmap_layer_mask = ((data & 0xe) >> 1) ^ 7; } -void pc8801_state::pc8801_kanji_lv2_w(offs_t offset, uint8_t data) +uint8_t pc8801_state::extram_mode_r() { - if((offset & 2) == 0) - m_knj_addr[1] = ((offset & 1) == 0) ? ((m_knj_addr[1]&0xff00)|(data&0xff)) : ((m_knj_addr[1]&0x00ff)|(data<<8)); + return (m_extram_mode ^ 0x11) | 0xee; } -void pc8801_state::pc8801_dic_bank_w(uint8_t data) +void pc8801_state::extram_mode_w(uint8_t data) { - printf("JISHO BANK = %02x\n",data); - if(m_has_dictionary) - m_dic_bank = data & 0x1f; + /* + ---x ---- Write EXT RAM access at 0x0000 - 0x7fff + ---- ---x Read EXT RAM access at 0x0000 - 0x7fff + */ + + m_extram_mode = data & 0x11; } -void pc8801_state::pc8801_dic_ctrl_w(uint8_t data) +uint8_t pc8801_state::extram_bank_r() { - printf("JISHO CTRL = %02x\n",data); - if(m_has_dictionary) - m_dic_ctrl = (data ^ 1) & 1; + return m_extram_bank; } -/* - * [8] xxxx xxxx CD data - * ^ if bit 7 is held then system will bring to a - * "CD-System initialize\n[Space]->CD player" screen. -*/ -uint8_t pc8801_state::pc8801_cdrom_r(offs_t offset) +void pc8801_state::extram_bank_w(uint8_t data) { - if(m_has_cdrom) - return m_cdrom_reg[offset]; - - return 0xff; + m_extram_bank = data; } -/* - * [9] ---x ---- CD-ROM BIOS bank - * ---- ---x CD-ROM E-ROM bank (?) - */ -void pc8801_state::pc8801_cdrom_w(offs_t offset, uint8_t data) +void pc8801_state::alu_ctrl1_w(uint8_t data) { - - //printf("CD-ROM write %02x -> [%02x]\n",data,offset); - - if(m_has_cdrom) - m_cdrom_reg[offset] = data; + m_alu_ctrl1 = data; } -uint8_t pc8801_state::pc8801_cpuclock_r() +void pc8801_state::alu_ctrl2_w(uint8_t data) { - if(m_has_clock_speed) - return 0x10 | m_clock_setting; - - return 0xff; + m_alu_ctrl2 = data; } -uint8_t pc8801_state::pc8801_baudrate_r() +/* + * $e8-$eb kanji LV1 + * $ec-$ef kanji LV2 + * + */ +template uint8_t pc8801_state::kanji_r(offs_t offset) { - if(m_has_clock_speed) - return 0xf0 | m_baudrate_val; + if((offset & 2) == 0) + { + const u8 *kanji_rom = kanji_level ? m_kanji_lv2_rom : m_kanji_rom; + const u32 kanji_address = (m_knj_addr[kanji_level] * 2) + ((offset & 1) ^ 1); + return kanji_rom[kanji_address]; + } return 0xff; } -void pc8801_state::pc8801_baudrate_w(uint8_t data) +template void pc8801_state::kanji_w(offs_t offset, uint8_t data) { - if(m_has_clock_speed) - m_baudrate_val = data & 0xf; + if((offset & 2) == 0) + { + m_knj_addr[kanji_level] = ( + ((offset & 1) == 0) ? + ((m_knj_addr[kanji_level] & 0xff00) | (data & 0xff)) : + ((m_knj_addr[kanji_level] & 0x00ff) | (data << 8)) + ); + } + // TODO: document and implement what the upper two regs does + // read latches on write? "read start/end sign" according to + // https://retrocomputerpeople.web.fc2.com/machines/nec/8801/io_map88.html } -void pc8801_state::pc8801_rtc_w(uint8_t data) +void pc8801_state::rtc_w(uint8_t data) { m_rtc->c0_w((data & 1) >> 0); m_rtc->c1_w((data & 2) >> 1); m_rtc->c2_w((data & 4) >> 2); m_rtc->data_in_w((data & 8) >> 3); - /* TODO: remaining bits */ + // TODO: remaining bits } -uint8_t pc8801_state::pc8801_sound_board_r(offs_t offset) -{ - if(m_has_opna) - return m_opna->read(offset); +/* + * PC8801FH overrides (CPU clock switch) + */ - return (offset & 2) ? 0xff : m_opn->read(offset); +uint8_t pc8801fh_state::cpuclock_r() +{ + return 0x10 | m_clock_setting; } -void pc8801_state::pc8801_sound_board_w(offs_t offset, uint8_t data) +uint8_t pc8801fh_state::baudrate_r() { - if(m_has_opna) - m_opna->write(offset, data); - else if((offset & 2) == 0) - m_opn->write(offset, data); + return 0xf0 | m_baudrate_val; } -uint8_t pc8801_state::pc8801_opna_r(offs_t offset) +void pc8801fh_state::baudrate_w(uint8_t data) { - if(m_has_opna && (offset & 2) == 0) - return m_opna->read((offset & 1) | ((offset & 4) >> 1)); - - return 0xff; + m_baudrate_val = data & 0xf; } -void pc8801_state::pc8801_opna_w(offs_t offset, uint8_t data) +/* + * PC8801MA overrides (dictionary) + */ + +inline uint8_t pc8801ma_state::dictionary_rom_r(offs_t offset) { - if(m_has_opna && (offset & 2) == 0) - m_opna->write((offset & 1) | ((offset & 4) >> 1),data); - else if(m_has_opna && offset == 2) - { - m_sound_irq_mask = ((data & 0x80) == 0); + return m_dictionary_rom[offset + ((m_dic_bank & 0x1f) * 0x4000)]; +} - if(m_sound_irq_mask == 0) - m_sound_irq_latch = 0; +inline bool pc8801ma_state::dictionary_rom_enable() +{ + return m_dic_ctrl; +} - if(m_timer_irq_latch == 0 && m_vrtc_irq_latch == 0 && m_sound_irq_latch == 0) - m_maincpu->set_input_line(0,CLEAR_LINE); +void pc8801ma_state::dic_bank_w(uint8_t data) +{ + m_dic_bank = data & 0x1f; +} - if(m_sound_irq_mask && m_sound_irq_pending) - { - m_maincpu->set_input_line(0,HOLD_LINE); - m_sound_irq_latch = 1; - m_sound_irq_pending = 0; - } - } +void pc8801ma_state::dic_ctrl_w(uint8_t data) +{ + m_dic_ctrl = (data ^ 1) & 1; } -uint8_t pc8801_state::pc8801_unk_r() +/* + * PC8801MC overrides (CD-ROM) + */ + +inline uint8_t pc8801mc_state::cdbios_rom_r(offs_t offset) { - printf("Read port 0x33\n"); - return 0xff; + return m_cdrom_bios[offset | ((m_gfx_ctrl & 4) ? 0x8000 : 0x0000)]; } -void pc8801_state::pc8801_unk_w(uint8_t data) +inline bool pc8801mc_state::cdbios_rom_enable() { - printf("Write port 0x33\n"); + return m_cdrom_bank; } -void pc8801_state::pc8801_io(address_map &map) +void pc8801_state::main_io(address_map &map) { map.global_mask(0xff); map.unmap_value_high(); @@ -1535,61 +1008,96 @@ map(0x0d, 0x0d).portr("KEY13"); map(0x0e, 0x0e).portr("KEY14"); map(0x0f, 0x0f).portr("KEY15"); - map(0x00, 0x02).w(FUNC(pc8801_state::pc8801_pcg8100_w)); - map(0x10, 0x10).w(FUNC(pc8801_state::pc8801_rtc_w)); - map(0x20, 0x21).mirror(0x0e).rw(I8251_TAG, FUNC(i8251_device::read), FUNC(i8251_device::write)); /* RS-232C and CMT */ - map(0x30, 0x30).portr("DSW1").w(FUNC(pc8801_state::pc8801_txt_cmt_ctrl_w)); - map(0x31, 0x31).portr("DSW2").w(FUNC(pc8801_state::pc8801_gfx_ctrl_w)); - map(0x32, 0x32).rw(FUNC(pc8801_state::pc8801_misc_ctrl_r), FUNC(pc8801_state::pc8801_misc_ctrl_w)); - map(0x33, 0x33).rw(FUNC(pc8801_state::pc8801_unk_r), FUNC(pc8801_state::pc8801_unk_w)); - map(0x34, 0x34).w(FUNC(pc8801_state::pc8801_alu_ctrl1_w)); - map(0x35, 0x35).w(FUNC(pc8801_state::pc8801_alu_ctrl2_w)); - map(0x40, 0x40).rw(FUNC(pc8801_state::pc8801_ctrl_r), FUNC(pc8801_state::pc8801_ctrl_w)); - map(0x44, 0x47).rw(FUNC(pc8801_state::pc8801_sound_board_r), FUNC(pc8801_state::pc8801_sound_board_w)); /* OPN / OPNA ports */ - map(0x50, 0x50).rw(FUNC(pc8801_state::pc8801_crtc_param_r), FUNC(pc8801_state::pc88_crtc_param_w)); - map(0x51, 0x51).rw(FUNC(pc8801_state::pc8801_crtc_status_r), FUNC(pc8801_state::pc88_crtc_cmd_w)); - map(0x52, 0x52).w(FUNC(pc8801_state::pc8801_bgpal_w)); - map(0x53, 0x53).w(FUNC(pc8801_state::pc8801_layer_masking_w)); - map(0x54, 0x5b).w(FUNC(pc8801_state::pc8801_palram_w)); - map(0x5c, 0x5c).r(FUNC(pc8801_state::pc8801_vram_select_r)); - map(0x5c, 0x5f).w(FUNC(pc8801_state::pc8801_vram_select_w)); - map(0x60, 0x67).rw(FUNC(pc8801_state::pc8801_dmac_r), FUNC(pc8801_state::pc8801_dmac_w)); - map(0x68, 0x68).rw(FUNC(pc8801_state::pc8801_dmac_status_r), FUNC(pc8801_state::pc8801_dmac_mode_w)); - map(0x6e, 0x6e).r(FUNC(pc8801_state::pc8801_cpuclock_r)); - map(0x6f, 0x6f).rw(FUNC(pc8801_state::pc8801_baudrate_r), FUNC(pc8801_state::pc8801_baudrate_w)); - map(0x70, 0x70).rw(FUNC(pc8801_state::pc8801_window_bank_r), FUNC(pc8801_state::pc8801_window_bank_w)); - map(0x71, 0x71).rw(FUNC(pc8801_state::pc8801_ext_rom_bank_r), FUNC(pc8801_state::pc8801_ext_rom_bank_w)); - map(0x78, 0x78).w(FUNC(pc8801_state::pc8801_window_bank_inc_w)); - map(0x90, 0x9f).rw(FUNC(pc8801_state::pc8801_cdrom_r), FUNC(pc8801_state::pc8801_cdrom_w)); -// map(0xa0, 0xa3).noprw(); /* music & network */ - map(0xa8, 0xad).rw(FUNC(pc8801_state::pc8801_opna_r), FUNC(pc8801_state::pc8801_opna_w)); /* second sound board */ -// map(0xb4, 0xb5).noprw(); /* Video art board */ -// map(0xc1, 0xc1).noprw(); /* (unknown) */ -// map(0xc2, 0xcf).noprw(); /* music */ -// map(0xd0, 0xd7).noprw(); /* music & GP-IB */ -// map(0xd8, 0xd8).noprw(); /* GP-IB */ -// map(0xdc, 0xdf).noprw(); /* MODEM */ - map(0xe2, 0xe2).rw(FUNC(pc8801_state::pc8801_extram_mode_r), FUNC(pc8801_state::pc8801_extram_mode_w)); /* expand RAM mode */ - map(0xe3, 0xe3).rw(FUNC(pc8801_state::pc8801_extram_bank_r), FUNC(pc8801_state::pc8801_extram_bank_w)); /* expand RAM bank */ -#if USE_PROPER_I8214 - map(0xe4, 0xe4).w(FUNC(pc8801_state::i8214_irq_level_w)); - map(0xe6, 0xe6).w(FUNC(pc8801_state::i8214_irq_mask_w)); -#else - map(0xe4, 0xe4).w(FUNC(pc8801_state::pc8801_irq_level_w)); - map(0xe6, 0xe6).w(FUNC(pc8801_state::pc8801_irq_mask_w)); -#endif -// map(0xe7, 0xe7).noprw(); /* Arcus writes here, almost likely to be a mirror of above */ - map(0xe8, 0xeb).rw(FUNC(pc8801_state::pc8801_kanji_r), FUNC(pc8801_state::pc8801_kanji_w)); - map(0xec, 0xef).rw(FUNC(pc8801_state::pc8801_kanji_lv2_r), FUNC(pc8801_state::pc8801_kanji_lv2_w)); - map(0xf0, 0xf0).w(FUNC(pc8801_state::pc8801_dic_bank_w)); - map(0xf1, 0xf1).w(FUNC(pc8801_state::pc8801_dic_ctrl_w)); -// map(0xf3, 0xf3).noprw(); /* DMA floppy (unknown) */ -// map(0xf4, 0xf7).noprw(); /* DMA 5'floppy (may be not released) */ -// map(0xf8, 0xfb).noprw(); /* DMA 8'floppy (unknown) */ + map(0x10, 0x10).w(FUNC(pc8801_state::rtc_w)); + map(0x20, 0x21).mirror(0x0e).rw(m_usart, FUNC(i8251_device::read), FUNC(i8251_device::write)); // CMT / RS-232C ch. 0 + map(0x30, 0x30).portr("DSW1").w(FUNC(pc8801_state::port30_w)); + map(0x31, 0x31).portr("DSW2").w(FUNC(pc8801_state::port31_w)); + map(0x32, 0x32).rw(FUNC(pc8801_state::misc_ctrl_r), FUNC(pc8801_state::misc_ctrl_w)); +// map(0x33, 0x33) PC8001mkIISR port, mirror on PC8801? + // TODO: ALU not installed on pre-mkIISR machines + // NB: anything after 0x32 reads 0xff on a PC8801MA real HW test + map(0x34, 0x34).w(FUNC(pc8801_state::alu_ctrl1_w)); + map(0x35, 0x35).w(FUNC(pc8801_state::alu_ctrl2_w)); +// map(0x35, 0x35).r , accessed by cancanb during OP, mistake? Mirror for intended HW? + map(0x40, 0x40).rw(FUNC(pc8801_state::port40_r), FUNC(pc8801_state::port40_w)); +// map(0x44, 0x47).rw internal OPN/OPNA sound card for 8801mkIISR and beyond +// uPD3301 + map(0x50, 0x51).rw(m_crtc, FUNC(upd3301_device::read), FUNC(upd3301_device::write)); + + map(0x52, 0x52).w(FUNC(pc8801_state::bgpal_w)); + map(0x53, 0x53).w(FUNC(pc8801_state::layer_masking_w)); + map(0x54, 0x5b).w(FUNC(pc8801_state::palram_w)); + map(0x5c, 0x5c).r(FUNC(pc8801_state::vram_select_r)); + map(0x5c, 0x5f).w(FUNC(pc8801_state::vram_select_w)); +// i8257 + map(0x60, 0x68).rw(m_dma, FUNC(i8257_device::read), FUNC(i8257_device::write)); + +// map(0x6e, 0x6f) clock settings (8801FH and later) + map(0x70, 0x70).rw(FUNC(pc8801_state::window_bank_r), FUNC(pc8801_state::window_bank_w)); + map(0x71, 0x71).rw(FUNC(pc8801_state::ext_rom_bank_r), FUNC(pc8801_state::ext_rom_bank_w)); + map(0x78, 0x78).w(FUNC(pc8801_state::window_bank_inc_w)); +// map(0x8e, 0x8e).r , accessed by scruiser on boot (a board ID?) +// map(0x90, 0x9f) PC-8801-31 CD-ROM i/f (8801MC) +// map(0xa0, 0xa3) GSX-8800 or network board +// map(0xa8, 0xad).rw expansion OPN (Sound Board) or OPNA (Sound Board II) +// map(0xb0, 0xb3) General purpose parallel I/O (i8255?) +// map(0xb4, 0xb4) PC-8801-17 Video art board +// map(0xb5, 0xb5) PC-8801-18 Video digitizing unit +// map(0xbc, 0xbf) External mini floppy disk I/F (i8255), PC-8801-13 / -20 / -22 +// map(0xc0, 0xc3) USART RS-232C ch. 1 / ch. 2 +// map(0xc4, 0xc7) PC-8801-10 Music interface board (MIDI), GSX-8800 PIT? +// map(0xc8, 0xc8) RS-232C ch. 1 "prohibited gate" (?) +// map(0xca, 0xca) RS-232C ch. 2 "prohibited gate" (?) +// map(0xc8, 0xcd) JMB-X1 OPM / SSG chips +// map(0xd0, 0xdf) GP-IB +// map(0xd3, 0xd4) PC-8801-10 Music interface board (MIDI) +// map(0xdc, 0xdf) PC-8801-12 MODEM (built-in for mkIITR) + // $e2-$e3 are standard for mkIIMR, MH / MA / MA2 / MC + // also used by expansion boards -02 / -02N, -22, + // and -17 video art board (transfers from RAM?) + map(0xe2, 0xe2).rw(FUNC(pc8801_state::extram_mode_r), FUNC(pc8801_state::extram_mode_w)); + map(0xe3, 0xe3).rw(FUNC(pc8801_state::extram_bank_r), FUNC(pc8801_state::extram_bank_w)); + map(0xe4, 0xe4).w(FUNC(pc8801_state::irq_level_w)); + map(0xe6, 0xe6).w(FUNC(pc8801_state::irq_mask_w)); +// map(0xe7, 0xe7).noprw(); /* arcus writes here, mirror of above? */ + map(0xe8, 0xeb).rw(FUNC(pc8801_state::kanji_r<0>), FUNC(pc8801_state::kanji_w<0>)); + map(0xec, 0xef).rw(FUNC(pc8801_state::kanji_r<1>), FUNC(pc8801_state::kanji_w<1>)); +// map(0xf0, 0xf1) dictionary bank (8801MA and later) +// map(0xf3, 0xf3) DMA floppy (unknown) +// map(0xf4, 0xf7) DMA 5'25-inch floppy (?) +// map(0xf8, 0xfb) DMA 8-inch floppy (?) map(0xfc, 0xff).m(m_pc80s31, FUNC(pc80s31_device::host_map)); } -void pc8801_state::opna_map(address_map &map) +void pc8801mk2sr_state::main_io(address_map &map) +{ + pc8801_state::main_io(map); + map(0x44, 0x45).rw(m_opn, FUNC(ym2203_device::read), FUNC(ym2203_device::write)); +} + +void pc8801fh_state::main_io(address_map &map) +{ + pc8801_state::main_io(map); + map(0x44, 0x47).rw(m_opna, FUNC(ym2608_device::read), FUNC(ym2608_device::write)); + + map(0x6e, 0x6e).r(FUNC(pc8801fh_state::cpuclock_r)); + map(0x6f, 0x6f).rw(FUNC(pc8801fh_state::baudrate_r), FUNC(pc8801fh_state::baudrate_w)); +} + +void pc8801ma_state::main_io(address_map &map) +{ + pc8801fh_state::main_io(map); + map(0xf0, 0xf0).w(FUNC(pc8801ma_state::dic_bank_w)); + map(0xf1, 0xf1).w(FUNC(pc8801ma_state::dic_ctrl_w)); +} + +void pc8801mc_state::main_io(address_map &map) +{ + pc8801ma_state::main_io(map); + map(0x90, 0x9f).m(m_cdrom_if, FUNC(pc8801_31_device::amap)); +} + +void pc8801fh_state::opna_map(address_map &map) { // TODO: confirm it really is ROMless // TODO: confirm size @@ -1598,6 +1106,7 @@ /* Input Ports */ +// TODO: move to a pc8801_keyboard_device, merge with pc8001.cpp implementation /* 2008-05 FP: Small note about the strange default mapping of function keys: the top line of keys in PC8801 keyboard is as follows @@ -1618,7 +1127,7 @@ - "Help" is mapped to 'F8' */ -static INPUT_PORTS_START( pc8001 ) +static INPUT_PORTS_START( pc8801 ) PORT_START("KEY0") PORT_BIT (0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_0_PAD) PORT_CHAR(UCHAR_MAMEKEY(0_PAD)) PORT_BIT (0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_1_PAD) PORT_CHAR(UCHAR_MAMEKEY(1_PAD)) @@ -1747,24 +1256,25 @@ PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("DSW1") - PORT_DIPNAME( 0x01, 0x00, "BASIC" ) + PORT_DIPNAME( 0x01, 0x01, "BASIC" ) PORT_DIPLOCATION("SW4:1") PORT_DIPSETTING( 0x01, "N88-BASIC" ) PORT_DIPSETTING( 0x00, "N-BASIC" ) - PORT_DIPNAME( 0x02, 0x02, "Terminal mode" ) + PORT_DIPNAME( 0x02, 0x02, "Terminal mode" ) PORT_DIPLOCATION("SW1:1") PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x00, "Text width" ) + PORT_DIPNAME( 0x04, 0x00, "Text width" ) PORT_DIPLOCATION("SW1:2") PORT_DIPSETTING( 0x04, "40 chars/line" ) PORT_DIPSETTING( 0x00, "80 chars/line" ) - PORT_DIPNAME( 0x08, 0x00, "Text height" ) + PORT_DIPNAME( 0x08, 0x00, "Text height" ) PORT_DIPLOCATION("SW1:3") PORT_DIPSETTING( 0x08, "20 lines/screen" ) PORT_DIPSETTING( 0x00, "25 lines/screen" ) - PORT_DIPNAME( 0x10, 0x10, "Enable S parameter" ) + PORT_DIPNAME( 0x10, 0x10, "Enable S parameter" ) PORT_DIPLOCATION("SW1:4") PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x00, "Enable DEL code" ) + PORT_DIPNAME( 0x20, 0x00, "Enable DEL code" ) PORT_DIPLOCATION("SW1:5") PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + // TODO: these really maps to "general purpose inputs" UIP1 / UIP2 PORT_DIPNAME( 0x40, 0x40, "Memory wait" ) PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) @@ -1773,43 +1283,47 @@ PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_START("DSW2") - PORT_DIPNAME( 0x01, 0x01, "Parity generate" ) + PORT_DIPNAME( 0x01, 0x01, "Parity generate" ) PORT_DIPLOCATION("SW2:1") PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x00, "Parity type" ) + PORT_DIPNAME( 0x02, 0x00, "Parity type" ) PORT_DIPLOCATION("SW2:2") PORT_DIPSETTING( 0x00, "Even" ) PORT_DIPSETTING( 0x02, "Odd" ) - PORT_DIPNAME( 0x04, 0x00, "Serial character length" ) + PORT_DIPNAME( 0x04, 0x00, "Serial character length" ) PORT_DIPLOCATION("SW2:3") PORT_DIPSETTING( 0x04, "7 bits/char" ) PORT_DIPSETTING( 0x00, "8 bits/char" ) - PORT_DIPNAME( 0x08, 0x08, "Stop bit length" ) + PORT_DIPNAME( 0x08, 0x08, "Stop bit length" ) PORT_DIPLOCATION("SW2:4") PORT_DIPSETTING( 0x08, "1" ) PORT_DIPSETTING( 0x00, "2" ) - PORT_DIPNAME( 0x10, 0x10, "Enable X parameter" ) + PORT_DIPNAME( 0x10, 0x10, "Enable X parameter" ) PORT_DIPLOCATION("SW2:5") PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, "Duplex" ) + PORT_DIPNAME( 0x20, 0x20, "Duplex" ) PORT_DIPLOCATION("SW2:6") PORT_DIPSETTING( 0x20, "Half" ) PORT_DIPSETTING( 0x00, "Full" ) - PORT_DIPNAME( 0xc0, 0x40, "Basic mode" ) - PORT_DIPSETTING( 0x80, "N88-BASIC (V1L)" ) - PORT_DIPSETTING( 0xc0, "N88-BASIC (V1H)" ) - PORT_DIPSETTING( 0x40, "N88-BASIC (V2)" ) -// PORT_DIPSETTING( 0x00, "N88-BASIC (V2)" ) + // TODO: vanilla PC8801 and mkII doesn't have V2 + PORT_DIPNAME( 0x40, 0x40, "BASIC speed select" ) PORT_DIPLOCATION("SW3:1") // actually SW3:0! + PORT_DIPSETTING( 0x40, "High Speed Mode (V1H, V2)" ) + PORT_DIPSETTING( 0x00, "Standard Mode (V1S)" ) + PORT_DIPNAME( 0x80, 0x00, "BASIC Version select" ) PORT_DIPLOCATION("SW4:2") + PORT_DIPSETTING( 0x80, "V1 Mode" ) + PORT_DIPSETTING( 0x00, "V2 Mode" ) PORT_START("CTRL") PORT_DIPNAME( 0x02, 0x02, "Monitor Type" ) PORT_DIPSETTING( 0x02, "15 KHz" ) PORT_DIPSETTING( 0x00, "24 KHz" ) +// PORT_BIT 0x04 USART DCD signal carrier PORT_DIPNAME( 0x08, 0x00, "Auto-boot floppy at start-up" ) PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_BIT( 0x10, IP_ACTIVE_HIGH,IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("upd1990a", upd1990a_device, data_out_r) - PORT_BIT( 0x20, IP_ACTIVE_HIGH,IPT_CUSTOM ) PORT_VBLANK("screen") - PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START("CFG") /* EXSWITCH */ - #if 0 // reference only, afaik there isn't a thing like this ... +// PORT_BIT( 0x10, IP_ACTIVE_HIGH,IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("upd1990a", upd1990a_device, data_out_r) +// PORT_BIT( 0x20, IP_ACTIVE_HIGH,IPT_CUSTOM ) PORT_VBLANK("screen") + PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + // TODO: Coming from the old legacy driver as "EXSWITCH", where this maps? + PORT_START("CFG") + #if 0 PORT_DIPNAME( 0x0f, 0x08, "Serial speed" ) PORT_DIPSETTING( 0x01, "75bps" ) PORT_DIPSETTING( 0x02, "150bps" ) @@ -1821,12 +1335,10 @@ PORT_DIPSETTING( 0x08, "9600bps" ) PORT_DIPSETTING( 0x09, "19200bps" ) #endif + // TODO: unemulated waitstate weight PORT_DIPNAME( 0x40, 0x40, "Speed mode" ) PORT_DIPSETTING( 0x00, "Slow" ) PORT_DIPSETTING( 0x40, DEF_STR( High ) ) - PORT_DIPNAME( 0x80, 0x80, "Main CPU clock" ) - PORT_DIPSETTING( 0x80, "4MHz" ) - PORT_DIPSETTING( 0x00, "8MHz" ) PORT_START("OPN_PA") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("BOARD_CONFIG", 0x02, EQUALS, 0x00) @@ -1836,6 +1348,7 @@ PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("OPN_PB") + // TODO: yojukiko and grobda maps Joystick buttons in reverse than expected? PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("P1 Joystick Button 1") PORT_CONDITION("BOARD_CONFIG", 0x02, EQUALS, 0x00) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("P1 Joystick Button 2") PORT_CONDITION("BOARD_CONFIG", 0x02, EQUALS, 0x00) PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("P1 Mouse Button 1") PORT_CONDITION("BOARD_CONFIG", 0x02, EQUALS, 0x02) @@ -1843,10 +1356,10 @@ PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("MOUSEX") - PORT_BIT( 0xff, 0x00, IPT_MOUSE_X ) PORT_RESET PORT_REVERSE PORT_SENSITIVITY(20) PORT_KEYDELTA(20) PORT_PLAYER(1) PORT_CONDITION("BOARD_CONFIG", 0x02, EQUALS, 0x02) + PORT_BIT( 0xff, 0x00, IPT_MOUSE_X ) PORT_REVERSE PORT_SENSITIVITY(20) PORT_KEYDELTA(20) PORT_PLAYER(1) PORT_CONDITION("BOARD_CONFIG", 0x02, EQUALS, 0x02) PORT_START("MOUSEY") - PORT_BIT( 0xff, 0x00, IPT_MOUSE_Y ) PORT_RESET PORT_REVERSE PORT_SENSITIVITY(20) PORT_KEYDELTA(20) PORT_PLAYER(1) PORT_CONDITION("BOARD_CONFIG", 0x02, EQUALS, 0x02) + PORT_BIT( 0xff, 0x00, IPT_MOUSE_Y ) PORT_REVERSE PORT_SENSITIVITY(20) PORT_KEYDELTA(20) PORT_PLAYER(1) PORT_CONDITION("BOARD_CONFIG", 0x02, EQUALS, 0x02) PORT_START("MEM") PORT_CONFNAME( 0x0f, 0x0a, "Extension memory" ) @@ -1866,21 +1379,28 @@ PORT_CONFSETTING( 0x0d, "4.1M (PIO-8234H-2M x 2 + PC-8801-02N x 1)" ) PORT_START("BOARD_CONFIG") - PORT_CONFNAME( 0x01, 0x01, "Sound Board" ) /* TODO: is it possible to have BOTH sound chips in there? */ - PORT_CONFSETTING( 0x00, "OPN (YM2203)" ) - PORT_CONFSETTING( 0x01, "OPNA (YM2608)" ) + // TODO: extend both via slot options +// PORT_CONFNAME( 0x01, 0x01, "Sound Board" ) +// PORT_CONFSETTING( 0x00, "OPN (YM2203)" ) +// PORT_CONFSETTING( 0x01, "OPNA (YM2608)" ) PORT_CONFNAME( 0x02, 0x00, "Port 1 Connection" ) PORT_CONFSETTING( 0x00, "Joystick" ) PORT_CONFSETTING( 0x02, "Mouse" ) INPUT_PORTS_END -static INPUT_PORTS_START( pc88sr ) - PORT_INCLUDE( pc8001 ) +static INPUT_PORTS_START( pc8801fh ) + PORT_INCLUDE( pc8801 ) - PORT_MODIFY("DSW1") - PORT_DIPNAME( 0x01, 0x01, "BASIC" ) - PORT_DIPSETTING( 0x01, "N88-BASIC" ) - PORT_DIPSETTING( 0x00, "N-BASIC" ) + // TODO: KEY12, KEY13 and KEY14 have extended meaning + // "KEY12" F6 - F10, BS, INS, DEL + // "KEY13" kanji control (lower 4 bits) + // "KEY14" Normal & Numpad RETURN, Left Shift, Right Shift. + // bit 7 acts as extension identifier (0 for FH+ keyboards). + + PORT_MODIFY("CFG") + PORT_DIPNAME( 0x80, 0x80, "Main CPU clock" ) + PORT_DIPSETTING( 0x80, "4MHz" ) + PORT_DIPSETTING( 0x00, "8MHz" ) INPUT_PORTS_END /* Graphics Layouts */ @@ -1907,181 +1427,61 @@ 16*16 }; -/* debugging only */ +// debugging only static GFXDECODE_START( gfx_pc8801 ) - GFXDECODE_ENTRY( "cgrom", 0, char_layout, 0, 8 ) - GFXDECODE_ENTRY( "kanji", 0, kanji_layout, 0, 8 ) + GFXDECODE_ENTRY( "cgrom", 0, char_layout, 0, 1 ) + GFXDECODE_ENTRY( "kanji", 0, kanji_layout, 0, 1 ) + GFXDECODE_ENTRY( "kanji_lv2", 0, kanji_layout, 0, 1 ) GFXDECODE_END - -#if 0 -/* Cassette Configuration */ - -static const cassette_interface pc88_cassette_interface = -{ - cassette_default_formats, // we need T88 format support! - nullptr, - CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_MUTED, - "pc8801_cass" -}; -#endif - -#if USE_PROPER_I8214 -void pc8801_state::pc8801_raise_irq(uint8_t irq,uint8_t state) -{ - if(state) - { - drvm_int_state |= irq; - - drvm_pic->r_w(~irq); - - m_maincpu->set_input_line(0,ASSERT_LINE); - } - else - { - //drvm_int_state &= ~irq; - - //m_maincpu->set_input_line(0,CLEAR_LINE); - } -} - -WRITE_LINE_MEMBER(pc8801_state::pic_int_w) -{ - device_t *device = m_maincpu; -// if (state == ASSERT_LINE) -// { -// } -} - -WRITE_LINE_MEMBER(pc8801_state::pic_enlg_w) -{ - device_t *device = m_maincpu; - //if (state == CLEAR_LINE) - //{ - //} -} - -static I8214_INTERFACE( pic_intf ) -{ - DEVCB_DRIVER_LINE_MEMBER(pc8801_state,pic_int_w), - DEVCB_DRIVER_LINE_MEMBER(pc8801_state,pic_enlg_w) -}; - -IRQ_CALLBACK_MEMBER(pc8801_state::pc8801_irq_callback) -{ - uint8_t vector = (7 - m_pic->a_r()); - - m_int_state &= ~(1<set_input_line(0,CLEAR_LINE); - - return vector << 1; -} - -WRITE_LINE_MEMBER(pc8801_state::pc8801_sound_irq) -{ - if(m_sound_irq_mask && state) - pc8801_raise_irq(machine(),1<<(4),1); -} - -/* -TIMER_DEVICE_CALLBACK_MEMBER(pc8801_state::pc8801_rtc_irq) -{ - if(m_timer_irq_mask) - pc8801_raise_irq(machine(),1<<(2),1); -} -*/ - -INTERRUPT_GEN_MEMBER(pc8801_state::pc8801_vrtc_irq) -{ - if(m_vblank_irq_mask) - pc8801_raise_irq(machine(),1<<(1),1); -} - -#else - -#include "debugger.h" - -IRQ_CALLBACK_MEMBER(pc8801_state::pc8801_irq_callback) -{ - if(m_sound_irq_latch) - { - m_sound_irq_latch = 0; - return 4*2; - } - else if(m_vrtc_irq_latch) - { - m_vrtc_irq_latch = 0; - return 1*2; - } - else if(m_timer_irq_latch) - { - m_timer_irq_latch = 0; - return 2*2; - } - - printf("IRQ triggered but no vector on the bus! %02x %02x %02x %02x\n",m_i8214_irq_level,m_sound_irq_latch,m_vrtc_irq_latch,m_timer_irq_latch); - machine().debug_break(); - - return 4*2; //TODO: mustn't happen -} - -WRITE_LINE_MEMBER(pc8801_state::pc8801_sound_irq) -{ -// printf("%02x %02x %02x\n",m_sound_irq_mask,m_i8214_irq_level,state); - /* TODO: correct i8214 irq level? */ - if(state) - { - if(m_sound_irq_mask) - { - m_sound_irq_latch = 1; - m_sound_irq_pending = 0; - //IRQ_LOG(("sound\n")); - m_maincpu->set_input_line(0,HOLD_LINE); - } - else - m_sound_irq_pending = 1; - } -} - -TIMER_DEVICE_CALLBACK_MEMBER(pc8801_state::pc8801_rtc_irq) -{ - if(m_timer_irq_mask && m_i8214_irq_level >= 3) - { - m_timer_irq_latch = 1; - //IRQ_LOG(("timer\n")); - m_maincpu->set_input_line(0,HOLD_LINE); - } -} - -INTERRUPT_GEN_MEMBER(pc8801_state::pc8801_vrtc_irq) -{ - if(m_vrtc_irq_mask && m_i8214_irq_level >= 2) - { - m_vrtc_irq_latch = 1; - //IRQ_LOG(("vrtc\n")); - m_maincpu->set_input_line(0,HOLD_LINE); - } -} -#endif - void pc8801_state::machine_start() { + pc8001_base_state::machine_start(); + m_rtc->cs_w(1); m_rtc->oe_w(1); + // TODO: ready signal connected to FDRDY, presumably for the floppy ch.0 and 1 + m_dma->ready_w(1); + m_work_ram = make_unique_clear(0x10000); m_hi_work_ram = make_unique_clear(0x1000); m_ext_work_ram = make_unique_clear(0x8000*0x100); m_gvram = make_unique_clear(0xc000); - m_n80rom = memregion("n80rom")->base(); - m_n88rom = memregion("n88rom")->base(); - m_kanji_rom = memregion("kanji")->base(); - m_cg_rom = memregion("cgrom")->base(); save_pointer(NAME(m_work_ram), 0x10000); save_pointer(NAME(m_hi_work_ram), 0x1000); save_pointer(NAME(m_ext_work_ram), 0x8000*0x100); save_pointer(NAME(m_gvram), 0xc000); + save_item(STRUCT_MEMBER(m_mouse, phase)); + save_item(STRUCT_MEMBER(m_mouse, prev_dx)); + save_item(STRUCT_MEMBER(m_mouse, prev_dy)); + save_item(STRUCT_MEMBER(m_mouse, lx)); + save_item(STRUCT_MEMBER(m_mouse, ly)); +// save_item(STRUCT_MEMBER(m_mouse, time)); + save_item(NAME(m_mouse.time)); + save_item(NAME(m_gfx_ctrl)); + save_item(NAME(m_ext_rom_bank)); + save_item(NAME(m_vram_sel)); + save_item(NAME(m_misc_ctrl)); + save_item(NAME(m_device_ctrl_data)); + save_item(NAME(m_window_offset_bank)); + save_item(NAME(m_text_layer_mask)); + save_item(NAME(m_bitmap_layer_mask)); + save_pointer(NAME(m_alu_reg), 3); + save_item(NAME(m_alu_ctrl1)); + save_item(NAME(m_alu_ctrl2)); + save_item(NAME(m_extram_mode)); + save_item(NAME(m_extram_bank)); + save_item(NAME(m_extram_size)); + save_pointer(NAME(m_knj_addr), 2); + save_item(STRUCT_MEMBER(m_palram, r)); + save_item(STRUCT_MEMBER(m_palram, g)); + save_item(STRUCT_MEMBER(m_palram, b)); + save_item(STRUCT_MEMBER(m_irq_state, enable)); + save_item(STRUCT_MEMBER(m_irq_state, pending)); + save_item(NAME(m_sound_irq_enable)); + save_item(NAME(m_sound_irq_pending)); } void pc8801_state::machine_reset() @@ -2096,53 +1496,31 @@ m_gfx_ctrl = 0x31; m_window_offset_bank = 0x80; m_misc_ctrl = 0x80; - m_layer_mask = 0x00; + // N-BASIC never pings $53, definitely expects text layer to be enabled on default + m_text_layer_mask = false; + m_bitmap_layer_mask = 0; m_vram_sel = 3; -// pc8801_dynamic_res_change(machine()); - m_mouse.phase = 0; - { - m_txt_color = 2; - } - + // initialize ALU { int i; - for(i=0;i<3;i++) + for(i = 0; i < 3; i++) m_alu_reg[i] = 0x00; } - { - m_crtc.param_count = 0; - m_crtc.cmd = 0; - m_crtc.status = 0; - } - m_beeper->set_state(0); - #if USE_PROPER_I8214 + // initialize irq section { - /* initialize I8214 */ m_pic->etlg_w(1); m_pic->inte_w(1); - } - #else - { - m_vrtc_irq_mask = 0; - m_vrtc_irq_latch = 0; - m_timer_irq_mask = 0; - m_timer_irq_latch = 0; - m_sound_irq_mask = 0; - m_sound_irq_latch = 0; - m_i8214_irq_level = 0; - m_sound_irq_pending = 0; - } - #endif - - { - m_dma_address[2] = 0xf300; + m_irq_state.pending = 0; + m_irq_state.enable = 0; + m_sound_irq_enable = false; + m_sound_irq_pending = false; } { @@ -2150,25 +1528,28 @@ m_extram_mode = 0; } - { - int i; + palette_reset(); - for(i=0;i<0x10;i++) //text + bitmap - m_palette->set_pen_color(i, pal1bit(i >> 1), pal1bit(i >> 2), pal1bit(i >> 0)); - } + m_extram_size = extram_type[ioport("MEM")->read() & 0x0f]; +// m_has_opna = ioport("BOARD_CONFIG")->read() & 1; + + const bool pixel_clock_setting = bool(!BIT(ioport("CTRL")->read(), 1)); + set_screen_frequency(pixel_clock_setting); + m_crtc->set_unscaled_clock(pixel_clock_setting ? PIXEL_CLOCK_24KHz : PIXEL_CLOCK_15KHz); +} - m_has_clock_speed = 0; - m_has_dictionary = 0; - m_has_cdrom = 0; +void pc8801fh_state::machine_start() +{ + pc8801mk2sr_state::machine_start(); - m_extram_size = extram_type[ioport("MEM")->read() & 0x0f]; - m_has_opna = ioport("BOARD_CONFIG")->read() & 1; + save_item(NAME(m_clock_setting)); + save_item(NAME(m_baudrate_val)); } -MACHINE_RESET_MEMBER(pc8801_state,pc8801_clock_speed) +void pc8801fh_state::machine_reset() { pc8801_state::machine_reset(); - m_has_clock_speed = 1; + m_clock_setting = ioport("CFG")->read() & 0x80; m_maincpu->set_unscaled_clock(m_clock_setting ? (PC8801FH_OSC3 / 8) : (PC8801FH_OSC3 / 4)); @@ -2177,75 +1558,160 @@ m_baudrate_val = 0; } -MACHINE_RESET_MEMBER(pc8801_state,pc8801_dic) +void pc8801ma_state::machine_start() { - MACHINE_RESET_CALL_MEMBER( pc8801_clock_speed ); - m_has_dictionary = 1; - m_dic_bank = 0; - m_dic_ctrl = 0; + pc8801fh_state::machine_start(); + + save_item(NAME(m_dic_bank)); + save_item(NAME(m_dic_ctrl)); } -MACHINE_RESET_MEMBER(pc8801_state,pc8801_cdrom) +void pc8801ma_state::machine_reset() { - MACHINE_RESET_CALL_MEMBER( pc8801_dic ); - m_has_cdrom = 1; + pc8801fh_state::machine_reset(); - { - int i; + m_dic_bank = 0; + m_dic_ctrl = 0; +} - for(i=0;i<0x10;i++) - m_cdrom_reg[i] = 0; - } +void pc8801mc_state::machine_start() +{ + pc8801ma_state::machine_start(); - // Hold STOP during boot to bypass CDROM BIOS at POST (PC=0x10) - m_cdrom_reg[9] = 0x10; + save_item(NAME(m_cdrom_bank)); } -void pc8801_state::pc8801_palette(palette_device &palette) const +void pc8801mc_state::machine_reset() { - for(int i = 0; i< 0x10; i++) //text + bitmap - palette.set_pen_color(i, pal1bit(i >> 1), pal1bit(i >> 2), pal1bit(i >> 0)); -} + pc8801ma_state::machine_reset(); -/* YM2203 Interface */ + // Hold STOP during boot to bypass CDROM BIOS at POST (PC=0x10) + m_cdrom_bank = true; +} -uint8_t pc8801_state::opn_porta_r() +// TODO: to joyport DB9 option slot +uint8_t pc8801mk2sr_state::opn_porta_r() { if(ioport("BOARD_CONFIG")->read() & 2) { - uint8_t shift,res; + uint8_t shift, res; shift = (m_mouse.phase & 1) ? 0 : 4; - res = (m_mouse.phase & 2) ? m_mouse.y : m_mouse.x; + res = (m_mouse.phase & 2) ? m_mouse.ly : m_mouse.lx; -// printf("%d\n",m_mouse.phase); +// logerror("%d\n",m_mouse.phase); return ((res >> shift) & 0x0f) | 0xf0; } return ioport("OPN_PA")->read(); } -uint8_t pc8801_state::opn_portb_r(){ return ioport("OPN_PB")->read(); } /* Cassette Configuration */ WRITE_LINE_MEMBER( pc8801_state::txdata_callback ) { - //m_cass->output( (state) ? 0.8 : -0.8); + //m_cassette->output( (state) ? 1.0 : -1.0); } -WRITE_LINE_MEMBER( pc8801_state::rxrdy_w ) +WRITE_LINE_MEMBER( pc8801_state::rxrdy_irq_w ) { - // ... + if (state) + assert_irq(RXRDY_IRQ_LEVEL); +} + +/* + * 0 RXRDY + * 1 VRTC + * 2 CLOCK + * 3 INT3 (GSX-8800) + * 4 INT4 (any OPN, external boards included with different irq mask at $aa) + * 5 INT5 + * 6 FDCINT1 + * 7 FDCINT2 + * + */ +IRQ_CALLBACK_MEMBER(pc8801_state::int_ack_cb) +{ + // TODO: schematics sports a μPB8212 too, with DI2-DI4 connected to 8214 A0-A2 + // Seems just an intermediate bridge for translating raw levels to vectors + // with no access from outside world? + u8 level = m_pic->a_r(); + m_pic->r_w(level, 1); + + return (7 - level) * 2; +} + +WRITE_LINE_MEMBER(pc8801_state::int4_irq_w) +{ + bool irq_state = m_sound_irq_enable & state; + + // remember current setting so that an enable reg variation will pick up + // particularly needed by Telenet games (xzr2, valis2) + // TODO: understand how exactly the external irq source works out (Sound Board II) + // has a separate irq mask for secondary OPNA but still sends INT4s, + // we separate the logic from the others since this exact function needs templatized array for enable and pending anyway + // (and won't otherwise work for xzr2 anyway). + m_pic->r_w(7 ^ INT4_IRQ_LEVEL, !irq_state); + m_sound_irq_pending = state; +} + +// FIXME: convert to pure WRITE_LINE_MEMBER +// Works with 0 -> 1 F/F transitions +TIMER_DEVICE_CALLBACK_MEMBER(pc8801_state::clock_irq_w) +{ + // TODO: castlex sound notes in BGM loop are pretty erratic + // (uses clock irq instead of the dedicated INT4, started happening on last OPN rewrite, is it just missing some interpolation in the sound core? + assert_irq(CLOCK_IRQ_LEVEL); +} + +void pc8801_state::check_irq(u8 level) +{ + u8 mask = 1 << level; + + // megamit and babylon are particularly fussy if the VRTC irq isn't disabled when requested + // - megamit jumps to PC=0 + // - babylon has just a ret coded in the VRTC irq, so accepting that will wreck the program flow and hang at title screen with no sound (because it expects INT4s) + if (!(m_irq_state.enable & mask)) + m_pic->r_w(7 ^ level, 1); + else if (m_irq_state.enable & m_irq_state.pending & mask) + assert_irq(level); +} + +void pc8801_state::assert_irq(u8 level) +{ + u8 mask = 1 << level; + + if (mask & m_irq_state.enable) + { + m_irq_state.pending &= ~mask; + m_pic->r_w(7 ^ level, 0); + } + else + m_irq_state.pending |= mask; +} + +WRITE_LINE_MEMBER(pc8801_state::vrtc_irq_w) +{ +// bool irq_state = m_vrtc_irq_enable & state; + if (state) + { + assert_irq(VRTC_IRQ_LEVEL); + } +} + +WRITE_LINE_MEMBER(pc8801_state::irq_w) +{ + m_maincpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE); } + void pc8801_state::pc8801(machine_config &config) { - /* main CPU */ - Z80(config, m_maincpu, MASTER_CLOCK); /* 4 MHz */ - m_maincpu->set_addrmap(AS_PROGRAM, &pc8801_state::pc8801_mem); - m_maincpu->set_addrmap(AS_IO, &pc8801_state::pc8801_io); - m_maincpu->set_vblank_int("screen", FUNC(pc8801_state::pc8801_vrtc_irq)); - m_maincpu->set_irq_acknowledge_callback(FUNC(pc8801_state::pc8801_irq_callback)); + Z80(config, m_maincpu, MASTER_CLOCK); // ~4 MHz, selectable to ~8 MHz on late models + m_maincpu->set_addrmap(AS_PROGRAM, &pc8801_state::main_map); + m_maincpu->set_addrmap(AS_IO, &pc8801_state::main_io); +// m_maincpu->set_vblank_int("screen", FUNC(pc8801_state::vrtc_irq_w)); + m_maincpu->set_irq_acknowledge_callback(FUNC(pc8801_state::int_ack_cb)); PC80S31(config, m_pc80s31, MASTER_CLOCK); config.set_perfect_quantum(m_maincpu); @@ -2253,252 +1719,325 @@ // config.set_maximum_quantum(attotime::from_hz(MASTER_CLOCK/1024)); - #if USE_PROPER_I8214 - I8214(config, I8214_TAG, MASTER_CLOCK); - #endif + I8214(config, m_pic, MASTER_CLOCK); + m_pic->int_wr_callback().set(FUNC(pc8801_state::irq_w)); + UPD1990A(config, m_rtc); //CENTRONICS(config, "centronics", centronics_devices, "printer"); + + // TODO: needs T88 format support CASSETTE(config, m_cassette); m_cassette->set_default_state(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED); m_cassette->set_interface("pc8801_cass"); SOFTWARE_LIST(config, "tape_list").set_original("pc8801_cass"); - i8251_device &i8251(I8251(config, I8251_TAG, 0)); - i8251.txd_handler().set(FUNC(pc8801_state::txdata_callback)); - i8251.rts_handler().set(FUNC(pc8801_state::rxrdy_w)); + // TODO: clock, receiver handler, DCD? + I8251(config, m_usart, 0); + m_usart->txd_handler().set(FUNC(pc8801_state::txdata_callback)); + m_usart->rxrdy_handler().set(FUNC(pc8801_state::rxrdy_irq_w)); SOFTWARE_LIST(config, "disk_n88_list").set_original("pc8801_flop"); - SOFTWARE_LIST(config, "disk_n_list").set_original("pc8001_flop"); + SOFTWARE_LIST(config, "disk_n_list").set_compatible("pc8001_flop"); - /* video hardware */ SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_raw(PIXEL_CLOCK_24KHz,848,0,640,448,0,400); +// m_screen->set_raw(PIXEL_CLOCK_24KHz,848,0,640,448,0,400); + m_screen->set_raw(PIXEL_CLOCK_15KHz, 896, 0, 640, 260, 0, 200); m_screen->set_screen_update(FUNC(pc8801_state::screen_update)); - m_screen->set_palette(m_palette); +// m_screen->set_palette(m_palette); GFXDECODE(config, "gfxdecode", m_palette, gfx_pc8801); - PALETTE(config, m_palette, FUNC(pc8801_state::pc8801_palette), 0x10); + PALETTE(config, m_palette, palette_device::BLACK, 0x8 + 2); // +2 for BG Pal and border colors + PALETTE(config, m_crtc_palette, palette_device::BRG_3BIT); -// MCFG_VIDEO_START_OVERRIDE(pc8801_state,pc8801) + UPD3301(config, m_crtc, PIXEL_CLOCK_15KHz); + m_crtc->set_character_width(8); + m_crtc->set_display_callback(FUNC(pc8801_state::draw_text)); + m_crtc->set_attribute_fetch_callback(FUNC(pc8801_state::attr_fetch)); + m_crtc->drq_wr_callback().set(m_dma, FUNC(i8257_device::dreq2_w)); + m_crtc->rvv_wr_callback().set(FUNC(pc8801_state::crtc_reverse_w)); +// Note: 3301 isn't actually connected to INT so its internal irq mask doesn't have any effect in PC88 + m_crtc->vrtc_wr_callback().set(FUNC(pc8801_state::vrtc_irq_w)); + m_crtc->set_screen(m_screen); + + I8257(config, m_dma, MASTER_CLOCK); + m_dma->out_hrq_cb().set(FUNC(pc8801_state::hrq_w)); + m_dma->in_memr_cb().set(FUNC(pc8801_state::dma_mem_r)); + // CH0: 5-inch floppy DMA + // CH1: 8-inch floppy DMA, SCSI CD-ROM interface (on MA/MC) + m_dma->out_iow_cb<2>().set(m_crtc, FUNC(upd3301_device::dack_w)); + // CH3: + + TIMER(config, "rtc_timer").configure_periodic(FUNC(pc8801_state::clock_irq_w), attotime::from_hz(600)); + + // Note: original models up to OPNA variants really have an internal mono speaker, + // but user eventually can have a stereo mixing audio card mounted so for simplicity we MCM here. + SPEAKER(config, m_lspeaker).front_left(); + SPEAKER(config, m_rspeaker).front_right(); + + // TODO: DAC_1BIT + // 2400 Hz according to schematics, unaffected by clock speed setting (confirmed on real HW) + BEEP(config, m_beeper, MASTER_CLOCK / 16 / 13 / 8); + + for (auto &speaker : { m_lspeaker, m_rspeaker }) + { + m_cassette->add_route(ALL_OUTPUTS, speaker, 0.025); + m_beeper->add_route(ALL_OUTPUTS, speaker, 0.10); + } + + PC8801_EXP_SLOT(config, m_exp, pc8801_exp_devices, nullptr); + m_exp->set_iospace(m_maincpu, AS_IO); + m_exp->int3_callback().set([this] (bool state) { m_pic->r_w(7 ^ INT3_IRQ_LEVEL, !state); }); + m_exp->int4_callback().set([this] (bool state) { m_pic->r_w(7 ^ INT4_IRQ_LEVEL, !state); }); + m_exp->int5_callback().set([this] (bool state) { m_pic->r_w(7 ^ INT5_IRQ_LEVEL, !state); }); +} - /* sound hardware */ - SPEAKER(config, "mono").front_center(); - m_cassette->add_route(ALL_OUTPUTS, "mono", 0.05); +void pc8801mk2sr_state::pc8801mk2sr(machine_config &config) +{ + pc8801(config); - // TODO: sound irqs goes different routes when both boards are installed YM2203(config, m_opn, MASTER_CLOCK); - m_opn->irq_handler().set(FUNC(pc8801_state::pc8801_sound_irq)); - m_opn->port_a_read_callback().set(FUNC(pc8801_state::opn_porta_r)); - m_opn->port_b_read_callback().set(FUNC(pc8801_state::opn_portb_r)); - // TODO: handtune mixing - m_opn->add_route(0, "mono", 0.25); - m_opn->add_route(1, "mono", 0.25); - m_opn->add_route(2, "mono", 0.25); - m_opn->add_route(3, "mono", 0.25); - - YM2608(config, m_opna, MASTER_CLOCK*2); - m_opna->set_addrmap(0, &pc8801_state::opna_map); - m_opna->irq_handler().set(FUNC(pc8801_state::pc8801_sound_irq)); - m_opna->port_a_read_callback().set(FUNC(pc8801_state::opn_porta_r)); - m_opna->port_b_read_callback().set(FUNC(pc8801_state::opn_portb_r)); - // TODO: handtune mixing - m_opna->add_route(0, "mono", 0.25); - m_opna->add_route(1, "mono", 0.25); - m_opna->add_route(2, "mono", 0.25); - - BEEP(config, m_beeper, 2400).add_route(ALL_OUTPUTS, "mono", 0.10); + m_opn->irq_handler().set(FUNC(pc8801mk2sr_state::int4_irq_w)); + m_opn->port_a_read_callback().set(FUNC(pc8801mk2sr_state::opn_porta_r)); + m_opn->port_b_read_callback().set_ioport("OPN_PB"); - TIMER(config, "rtc_timer").configure_periodic(FUNC(pc8801_state::pc8801_rtc_irq), attotime::from_hz(600)); + for (auto &speaker : { m_lspeaker, m_rspeaker }) + { + // TODO: per-channel mixing is unconfirmed + m_opn->add_route(0, speaker, 0.125); + m_opn->add_route(1, speaker, 0.125); + m_opn->add_route(2, speaker, 0.125); + m_opn->add_route(3, speaker, 0.125); + } } -void pc8801_state::pc8801mk2mr(machine_config &config) +void pc8801mk2sr_state::pc8801mk2mr(machine_config &config) { - pc8801(config); + pc8801mk2sr(config); PC80S31K(config.replace(), m_pc80s31, MASTER_CLOCK); } -void pc8801_state::pc8801fh(machine_config &config) +void pc8801fh_state::pc8801fh(machine_config &config) { pc8801mk2mr(config); - MCFG_MACHINE_RESET_OVERRIDE(pc8801_state, pc8801_clock_speed ) + + config.device_remove("opn"); + + YM2608(config, m_opna, MASTER_CLOCK*2); + m_opna->set_addrmap(0, &pc8801fh_state::opna_map); + m_opna->irq_handler().set(FUNC(pc8801fh_state::int4_irq_w)); + m_opna->port_a_read_callback().set(FUNC(pc8801fh_state::opn_porta_r)); + m_opna->port_b_read_callback().set_ioport("OPN_PB"); + // TODO: per-channel mixing is unconfirmed + m_opna->add_route(0, m_lspeaker, 0.25); + m_opna->add_route(0, m_rspeaker, 0.25); + m_opna->add_route(1, m_lspeaker, 0.75); + m_opna->add_route(2, m_rspeaker, 0.75); + + // TODO: add possible configuration override for baudrate here + // ... } -void pc8801_state::pc8801ma(machine_config &config) +void pc8801ma_state::pc8801ma(machine_config &config) { pc8801fh(config); - MCFG_MACHINE_RESET_OVERRIDE(pc8801_state, pc8801_dic ) + // TODO: option slot for CD-ROM bus + // ... } -void pc8801_state::pc8801mc(machine_config &config) +void pc8801mc_state::pc8801mc(machine_config &config) { pc8801ma(config); - MCFG_MACHINE_RESET_OVERRIDE(pc8801_state, pc8801_cdrom ) + + PC8801_31(config, m_cdrom_if, 0); + m_cdrom_if->rom_bank_cb().set([this](bool state) { m_cdrom_bank = state; }); } ROM_START( pc8801 ) - ROM_REGION( 0x8000, "n80rom", ROMREGION_ERASEFF ) // 1.2 + ROM_REGION( 0x8000, "n80rom", ROMREGION_ERASEFF ) // 1.2 ROM_LOAD( "n80.rom", 0x0000, 0x8000, CRC(5cb8b584) SHA1(063609dd518c124a4fc9ba35d1bae35771666a34) ) - ROM_REGION( 0x10000, "n88rom", ROMREGION_ERASEFF ) // 1.0 + ROM_REGION( 0x10000, "n88rom", ROMREGION_ERASEFF ) // 1.0 V1 ROM_LOAD( "n88.rom", 0x0000, 0x8000, CRC(ffd68be0) SHA1(3518193b8207bdebf22c1380c2db8c554baff329) ) ROM_LOAD( "n88_0.rom", 0x8000, 0x2000, CRC(61984bab) SHA1(d1ae642aed4f0584eeb81ff50180db694e5101d4) ) - ROM_REGION( 0x40000, "kanji", ROMREGION_ERASEFF) + ROM_REGION( 0x20000, "kanji", ROMREGION_ERASEFF ) ROM_LOAD_OPTIONAL( "kanji1.rom", 0x00000, 0x20000, CRC(6178bd43) SHA1(82e11a177af6a5091dd67f50a2f4bafda84d6556) ) + ROM_REGION( 0x20000, "kanji_lv2", ROMREGION_ERASEFF ) + ROM_REGION( 0x800, "cgrom", 0) ROM_LOAD( "font.rom", 0x0000, 0x0800, CRC(56653188) SHA1(84b90f69671d4b72e8f219e1fe7cd667e976cf7f) ) ROM_END -/* The dump only included "maincpu". Other roms arbitrariely taken from PC-8801 & PC-8801 MkIISR (there should be -at least 1 Kanji ROM). */ +/* + * The dump only included "maincpu". + * Other roms arbitrariely taken from PC-8801 & PC-8801 MkIISR + * (there should be at least 1 Kanji ROM). + */ ROM_START( pc8801mk2 ) - ROM_REGION( 0x8000, "n80rom", ROMREGION_ERASEFF ) // 1.4 + ROM_REGION( 0x8000, "n80rom", ROMREGION_ERASEFF ) // 1.4 ROM_LOAD( "m2_n80.rom", 0x0000, 0x8000, CRC(91d84b1a) SHA1(d8a1abb0df75936b3fc9d226ccdb664a9070ffb1) ) - ROM_REGION( 0x10000, "n88rom", ROMREGION_ERASEFF ) //1.3 + ROM_REGION( 0x10000, "n88rom", ROMREGION_ERASEFF ) // 1.3 V1 ROM_LOAD( "m2_n88.rom", 0x0000, 0x8000, CRC(f35169eb) SHA1(ef1f067f819781d9fb2713836d195866f0f81501) ) ROM_LOAD( "m2_n88_0.rom", 0x8000, 0x2000, CRC(5eb7a8d0) SHA1(95a70af83b0637a5a0f05e31fb0452bb2cb68055) ) - ROM_REGION( 0x40000, "kanji", ROMREGION_ERASEFF) + ROM_REGION( 0x20000, "kanji", ROMREGION_ERASEFF ) ROM_LOAD_OPTIONAL( "kanji1.rom", 0x00000, 0x20000, CRC(6178bd43) SHA1(82e11a177af6a5091dd67f50a2f4bafda84d6556) ) + ROM_REGION( 0x20000, "kanji_lv2", ROMREGION_ERASEFF ) + ROM_REGION( 0x800, "cgrom", 0) ROM_COPY( "kanji", 0x1000, 0x0000, 0x800 ) ROM_END ROM_START( pc8801mk2sr ) - ROM_REGION( 0x8000, "n80rom", ROMREGION_ERASEFF ) // 1.5 + ROM_REGION( 0x8000, "n80rom", ROMREGION_ERASEFF ) // 1.5 ROM_LOAD( "mk2sr_n80.rom", 0x0000, 0x8000, CRC(27e1857d) SHA1(5b922ed9de07d2a729bdf1da7b57c50ddf08809a) ) - ROM_REGION( 0x10000, "n88rom", ROMREGION_ERASEFF ) // 2.0 + ROM_REGION( 0x10000, "n88rom", ROMREGION_ERASEFF ) // 2.0 V2 / 1.4 V1 ROM_LOAD( "mk2sr_n88.rom", 0x0000, 0x8000, CRC(a0fc0473) SHA1(3b31fc68fa7f47b21c1a1cb027b86b9e87afbfff) ) ROM_LOAD( "mk2sr_n88_0.rom", 0x8000, 0x2000, CRC(710a63ec) SHA1(d239c26ad7ac5efac6e947b0e9549b1534aa970d) ) ROM_LOAD( "n88_1.rom", 0xa000, 0x2000, CRC(c0bd2aa6) SHA1(8528eef7946edf6501a6ccb1f416b60c64efac7c) ) ROM_LOAD( "n88_2.rom", 0xc000, 0x2000, CRC(af2b6efa) SHA1(b7c8bcea219b77d9cc3ee0efafe343cc307425d1) ) ROM_LOAD( "n88_3.rom", 0xe000, 0x2000, CRC(7713c519) SHA1(efce0b51cab9f0da6cf68507757f1245a2867a72) ) - ROM_REGION( 0x40000, "kanji", 0) + ROM_REGION( 0x20000, "kanji", ROMREGION_ERASEFF ) ROM_LOAD( "kanji1.rom", 0x00000, 0x20000, CRC(6178bd43) SHA1(82e11a177af6a5091dd67f50a2f4bafda84d6556) ) - ROM_LOAD( "kanji2.rom", 0x20000, 0x20000, CRC(154803cc) SHA1(7e6591cd465cbb35d6d3446c5a83b46d30fafe95) ) // it should not be here + + ROM_REGION( 0x20000, "kanji_lv2", ROMREGION_ERASEFF ) + // not on stock mkIISR + ROM_LOAD_OPTIONAL( "kanji2.rom", 0x00000, 0x20000, CRC(154803cc) SHA1(7e6591cd465cbb35d6d3446c5a83b46d30fafe95) ) ROM_REGION( 0x800, "cgrom", 0) ROM_COPY( "kanji", 0x1000, 0x0000, 0x800 ) ROM_END ROM_START( pc8801mk2fr ) - ROM_REGION( 0x8000, "n80rom", ROMREGION_ERASEFF ) // 1.5 + ROM_REGION( 0x8000, "n80rom", ROMREGION_ERASEFF ) // 1.5 ROM_LOAD( "m2fr_n80.rom", 0x0000, 0x8000, CRC(27e1857d) SHA1(5b922ed9de07d2a729bdf1da7b57c50ddf08809a) ) - ROM_REGION( 0x10000, "n88rom", ROMREGION_ERASEFF ) // 2.1 + ROM_REGION( 0x10000, "n88rom", ROMREGION_ERASEFF ) // 2.1 V2 / 1.5 V1 ROM_LOAD( "m2fr_n88.rom", 0x0000, 0x8000, CRC(b9daf1aa) SHA1(696a480232bcf8c827c7aeea8329db5c44420d2a) ) ROM_LOAD( "m2fr_n88_0.rom", 0x8000, 0x2000, CRC(710a63ec) SHA1(d239c26ad7ac5efac6e947b0e9549b1534aa970d) ) ROM_LOAD( "m2fr_n88_1.rom", 0xa000, 0x2000, CRC(e3e78a37) SHA1(85ecd287fe72b56e54c8b01ea7492ca4a69a7470) ) ROM_LOAD( "m2fr_n88_2.rom", 0xc000, 0x2000, CRC(98c3a7b2) SHA1(fc4980762d3caa56964d0ae583424756f511d186) ) ROM_LOAD( "m2fr_n88_3.rom", 0xe000, 0x2000, CRC(0ca08abd) SHA1(a5a42d0b7caa84c3bc6e337c9f37874d82f9c14b) ) - ROM_REGION( 0x40000, "kanji", 0) + ROM_REGION( 0x20000, "kanji", ROMREGION_ERASEFF ) ROM_LOAD( "kanji1.rom", 0x00000, 0x20000, CRC(6178bd43) SHA1(82e11a177af6a5091dd67f50a2f4bafda84d6556) ) + ROM_REGION( 0x20000, "kanji_lv2", ROMREGION_ERASEFF ) + ROM_REGION( 0x800, "cgrom", 0) ROM_COPY( "kanji", 0x1000, 0x0000, 0x800 ) ROM_END ROM_START( pc8801mk2mr ) - ROM_REGION( 0x8000, "n80rom", ROMREGION_ERASEFF ) // 1.8 + ROM_REGION( 0x8000, "n80rom", ROMREGION_ERASEFF ) // 1.8 ROM_LOAD( "m2mr_n80.rom", 0x0000, 0x8000, CRC(f074b515) SHA1(ebe9cf4cf57f1602c887f609a728267f8d953dce) ) - ROM_REGION( 0x10000, "n88rom", ROMREGION_ERASEFF ) // 2.2 + ROM_REGION( 0x10000, "n88rom", ROMREGION_ERASEFF ) // 2.2 V2 / 1.7 V1 ROM_LOAD( "m2mr_n88.rom", 0x0000, 0x8000, CRC(69caa38e) SHA1(3c64090237152ee77c76e04d6f36bad7297bea93) ) ROM_LOAD( "m2mr_n88_0.rom", 0x8000, 0x2000, CRC(710a63ec) SHA1(d239c26ad7ac5efac6e947b0e9549b1534aa970d) ) ROM_LOAD( "m2mr_n88_1.rom", 0xa000, 0x2000, CRC(e3e78a37) SHA1(85ecd287fe72b56e54c8b01ea7492ca4a69a7470) ) ROM_LOAD( "m2mr_n88_2.rom", 0xc000, 0x2000, CRC(11176e0b) SHA1(f13f14f3d62df61498a23f7eb624e1a646caea45) ) ROM_LOAD( "m2mr_n88_3.rom", 0xe000, 0x2000, CRC(0ca08abd) SHA1(a5a42d0b7caa84c3bc6e337c9f37874d82f9c14b) ) - ROM_REGION( 0x40000, "kanji", 0) + ROM_REGION( 0x20000, "kanji", ROMREGION_ERASEFF ) ROM_LOAD( "kanji1.rom", 0x00000, 0x20000, CRC(6178bd43) SHA1(82e11a177af6a5091dd67f50a2f4bafda84d6556) ) - ROM_LOAD( "m2mr_kanji2.rom", 0x20000, 0x20000, CRC(376eb677) SHA1(bcf96584e2ba362218b813be51ea21573d1a2a78) ) + + ROM_REGION( 0x20000, "kanji_lv2", ROMREGION_ERASEFF ) + ROM_LOAD( "m2mr_kanji2.rom", 0x00000, 0x20000, CRC(376eb677) SHA1(bcf96584e2ba362218b813be51ea21573d1a2a78) ) ROM_REGION( 0x800, "cgrom", 0) ROM_COPY( "kanji", 0x1000, 0x0000, 0x800 ) ROM_END ROM_START( pc8801mh ) - ROM_REGION( 0x8000, "n80rom", ROMREGION_ERASEFF ) // 1.8, but different BIOS code? + ROM_REGION( 0x8000, "n80rom", ROMREGION_ERASEFF ) // 1.8, but different BIOS code? ROM_LOAD( "mh_n80.rom", 0x0000, 0x8000, CRC(8a2a1e17) SHA1(06dae1db384aa29d81c5b6ed587877e7128fcb35) ) - ROM_REGION( 0x10000, "n88rom", ROMREGION_ERASEFF ) // 2.3 + ROM_REGION( 0x10000, "n88rom", ROMREGION_ERASEFF ) // 2.3 V2 / 1.8 V1 ROM_LOAD( "mh_n88.rom", 0x0000, 0x8000, CRC(64c5d162) SHA1(3e0aac76fb5d7edc99df26fa9f365fd991742a5d) ) ROM_LOAD( "mh_n88_0.rom", 0x8000, 0x2000, CRC(deb384fb) SHA1(5f38cafa8aab16338038c82267800446fd082e79) ) ROM_LOAD( "mh_n88_1.rom", 0xa000, 0x2000, CRC(7ad5d943) SHA1(4ae4d37409ff99411a623da9f6a44192170a854e) ) ROM_LOAD( "mh_n88_2.rom", 0xc000, 0x2000, CRC(6aa6b6d8) SHA1(2a077ab444a4fd1470cafb06fd3a0f45420c39cc) ) ROM_LOAD( "mh_n88_3.rom", 0xe000, 0x2000, CRC(692cbcd8) SHA1(af452aed79b072c4d17985830b7c5dca64d4b412) ) - ROM_REGION( 0x40000, "kanji", 0) + ROM_REGION( 0x20000, "kanji", ROMREGION_ERASEFF ) ROM_LOAD( "kanji1.rom", 0x00000, 0x20000, CRC(6178bd43) SHA1(82e11a177af6a5091dd67f50a2f4bafda84d6556) ) - ROM_LOAD( "mh_kanji2.rom", 0x20000, 0x20000, CRC(376eb677) SHA1(bcf96584e2ba362218b813be51ea21573d1a2a78) ) + + ROM_REGION( 0x20000, "kanji_lv2", ROMREGION_ERASEFF ) + ROM_LOAD( "mh_kanji2.rom", 0x00000, 0x20000, CRC(376eb677) SHA1(bcf96584e2ba362218b813be51ea21573d1a2a78) ) ROM_REGION( 0x800, "cgrom", 0) ROM_COPY( "kanji", 0x1000, 0x0000, 0x0800 ) ROM_END ROM_START( pc8801fa ) - ROM_REGION( 0x8000, "n80rom", ROMREGION_ERASEFF ) // 1.8, but different BIOS code? + ROM_REGION( 0x8000, "n80rom", ROMREGION_ERASEFF ) // 1.8 ROM_LOAD( "fa_n80.rom", 0x0000, 0x8000, CRC(8a2a1e17) SHA1(06dae1db384aa29d81c5b6ed587877e7128fcb35) ) - ROM_REGION( 0x10000, "n88rom", ROMREGION_ERASEFF ) // 2.3 but different BIOS code? + ROM_REGION( 0x10000, "n88rom", ROMREGION_ERASEFF ) // 2.3 V2 / 1.9 V1 ROM_LOAD( "fa_n88.rom", 0x0000, 0x8000, CRC(73573432) SHA1(9b1346d44044eeea921c4cce69b5dc49dbc0b7e9) ) ROM_LOAD( "fa_n88_0.rom", 0x8000, 0x2000, CRC(a72697d7) SHA1(5aedbc5916d67ef28767a2b942864765eea81bb8) ) ROM_LOAD( "fa_n88_1.rom", 0xa000, 0x2000, CRC(7ad5d943) SHA1(4ae4d37409ff99411a623da9f6a44192170a854e) ) ROM_LOAD( "fa_n88_2.rom", 0xc000, 0x2000, CRC(6aee9a4e) SHA1(e94278682ef9e9bbb82201f72c50382748dcea2a) ) ROM_LOAD( "fa_n88_3.rom", 0xe000, 0x2000, CRC(692cbcd8) SHA1(af452aed79b072c4d17985830b7c5dca64d4b412) ) - ROM_REGION( 0x40000, "kanji", 0 ) + ROM_REGION( 0x20000, "kanji", ROMREGION_ERASEFF ) ROM_LOAD( "kanji1.rom", 0x00000, 0x20000, CRC(6178bd43) SHA1(82e11a177af6a5091dd67f50a2f4bafda84d6556) ) - ROM_LOAD( "fa_kanji2.rom", 0x20000, 0x20000, CRC(376eb677) SHA1(bcf96584e2ba362218b813be51ea21573d1a2a78) ) + + ROM_REGION( 0x20000, "kanji_lv2", ROMREGION_ERASEFF ) + ROM_LOAD( "fa_kanji2.rom", 0x00000, 0x20000, CRC(376eb677) SHA1(bcf96584e2ba362218b813be51ea21573d1a2a78) ) ROM_REGION( 0x800, "cgrom", 0) ROM_COPY( "kanji", 0x1000, 0x0000, 0x0800 ) ROM_END -ROM_START( pc8801ma ) // newer floppy BIOS and Jisyo (dictionary) ROM - ROM_REGION( 0x8000, "n80rom", ROMREGION_ERASEFF ) // 1.8, but different BIOS code? +// newer floppy BIOS and Jisyo (dictionary) ROM, otherwise same as FA +ROM_START( pc8801ma ) + ROM_REGION( 0x8000, "n80rom", ROMREGION_ERASEFF ) // 1.8 ROM_LOAD( "ma_n80.rom", 0x0000, 0x8000, CRC(8a2a1e17) SHA1(06dae1db384aa29d81c5b6ed587877e7128fcb35) ) - ROM_REGION( 0x10000, "n88rom", ROMREGION_ERASEFF ) // 2.3 but different BIOS code? + ROM_REGION( 0x10000, "n88rom", ROMREGION_ERASEFF ) // 2.3 V2 / 1.9 V1 ROM_LOAD( "ma_n88.rom", 0x0000, 0x8000, CRC(73573432) SHA1(9b1346d44044eeea921c4cce69b5dc49dbc0b7e9) ) ROM_LOAD( "ma_n88_0.rom", 0x8000, 0x2000, CRC(a72697d7) SHA1(5aedbc5916d67ef28767a2b942864765eea81bb8) ) ROM_LOAD( "ma_n88_1.rom", 0xa000, 0x2000, CRC(7ad5d943) SHA1(4ae4d37409ff99411a623da9f6a44192170a854e) ) ROM_LOAD( "ma_n88_2.rom", 0xc000, 0x2000, CRC(6aee9a4e) SHA1(e94278682ef9e9bbb82201f72c50382748dcea2a) ) ROM_LOAD( "ma_n88_3.rom", 0xe000, 0x2000, CRC(692cbcd8) SHA1(af452aed79b072c4d17985830b7c5dca64d4b412) ) - ROM_REGION( 0x40000, "kanji", 0 ) + ROM_REGION( 0x20000, "kanji", ROMREGION_ERASEFF ) ROM_LOAD( "kanji1.rom", 0x00000, 0x20000, CRC(6178bd43) SHA1(82e11a177af6a5091dd67f50a2f4bafda84d6556) ) - ROM_LOAD( "ma_kanji2.rom", 0x20000, 0x20000, CRC(376eb677) SHA1(bcf96584e2ba362218b813be51ea21573d1a2a78) ) + + ROM_REGION( 0x20000, "kanji_lv2", ROMREGION_ERASEFF ) + ROM_LOAD( "ma_kanji2.rom", 0x00000, 0x20000, CRC(376eb677) SHA1(bcf96584e2ba362218b813be51ea21573d1a2a78) ) ROM_REGION( 0x800, "cgrom", 0) ROM_COPY( "kanji", 0x1000, 0x0000, 0x0800 ) - /* 32 banks, to be loaded at 0xc000 - 0xffff */ ROM_REGION( 0x80000, "dictionary", 0 ) ROM_LOAD( "ma_jisyo.rom", 0x00000, 0x80000, CRC(a6108f4d) SHA1(3665db538598abb45d9dfe636423e6728a812b12) ) ROM_END ROM_START( pc8801ma2 ) - ROM_REGION( 0x8000, "n80rom", ROMREGION_ERASEFF ) // 1.8 + ROM_REGION( 0x8000, "n80rom", ROMREGION_ERASEFF ) // 1.8 ROM_LOAD( "ma2_n80.rom", 0x0000, 0x8000, CRC(8a2a1e17) SHA1(06dae1db384aa29d81c5b6ed587877e7128fcb35) ) - ROM_REGION( 0x10000, "n88rom", ROMREGION_ERASEFF ) // 2.3 (2.31?) + ROM_REGION( 0x10000, "n88rom", ROMREGION_ERASEFF ) // 2.3 (2.31?) V2 / 1.91 V1 ROM_LOAD( "ma2_n88.rom", 0x0000, 0x8000, CRC(ae1a6ebc) SHA1(e53d628638f663099234e07837ffb1b0f86d480d) ) ROM_LOAD( "ma2_n88_0.rom", 0x8000, 0x2000, CRC(a72697d7) SHA1(5aedbc5916d67ef28767a2b942864765eea81bb8) ) ROM_LOAD( "ma2_n88_1.rom", 0xa000, 0x2000, CRC(7ad5d943) SHA1(4ae4d37409ff99411a623da9f6a44192170a854e) ) ROM_LOAD( "ma2_n88_2.rom", 0xc000, 0x2000, CRC(1d6277b6) SHA1(dd9c3e50169b75bb707ef648f20d352e6a8bcfe4) ) ROM_LOAD( "ma2_n88_3.rom", 0xe000, 0x2000, CRC(692cbcd8) SHA1(af452aed79b072c4d17985830b7c5dca64d4b412) ) - ROM_REGION( 0x40000, "kanji", 0) + ROM_REGION( 0x20000, "kanji", ROMREGION_ERASEFF ) ROM_LOAD( "kanji1.rom", 0x00000, 0x20000, CRC(6178bd43) SHA1(82e11a177af6a5091dd67f50a2f4bafda84d6556) ) - ROM_LOAD( "ma2_kanji2.rom", 0x20000, 0x20000, CRC(376eb677) SHA1(bcf96584e2ba362218b813be51ea21573d1a2a78) ) + + ROM_REGION( 0x20000, "kanji_lv2", ROMREGION_ERASEFF ) + ROM_LOAD( "ma2_kanji2.rom", 0x00000, 0x20000, CRC(376eb677) SHA1(bcf96584e2ba362218b813be51ea21573d1a2a78) ) ROM_REGION( 0x800, "cgrom", 0) ROM_COPY( "kanji", 0x1000, 0x0000, 0x0800 ) @@ -2511,19 +2050,21 @@ ROM_REGION( 0x08000, "n80rom", ROMREGION_ERASEFF ) // 1.8 ROM_LOAD( "mc_n80.rom", 0x0000, 0x8000, CRC(8a2a1e17) SHA1(06dae1db384aa29d81c5b6ed587877e7128fcb35) ) - ROM_REGION( 0x10000, "n88rom", ROMREGION_ERASEFF ) // 2.3 (2.33?) + ROM_REGION( 0x10000, "n88rom", ROMREGION_ERASEFF ) // 2.3 (2.33?) V2 / 1.93 V1 ROM_LOAD( "mc_n88.rom", 0x0000, 0x8000, CRC(356d5719) SHA1(5d9ba80d593a5119f52aae1ccd61a1457b4a89a1) ) ROM_LOAD( "mc_n88_0.rom", 0x8000, 0x2000, CRC(a72697d7) SHA1(5aedbc5916d67ef28767a2b942864765eea81bb8) ) ROM_LOAD( "mc_n88_1.rom", 0xa000, 0x2000, CRC(7ad5d943) SHA1(4ae4d37409ff99411a623da9f6a44192170a854e) ) ROM_LOAD( "mc_n88_2.rom", 0xc000, 0x2000, CRC(1d6277b6) SHA1(dd9c3e50169b75bb707ef648f20d352e6a8bcfe4) ) ROM_LOAD( "mc_n88_3.rom", 0xe000, 0x2000, CRC(692cbcd8) SHA1(af452aed79b072c4d17985830b7c5dca64d4b412) ) - ROM_REGION( 0x10000, "cdrom", 0 ) + ROM_REGION( 0x10000, "cdrom_bios", 0 ) ROM_LOAD( "cdbios.rom", 0x0000, 0x10000, CRC(5c230221) SHA1(6394a8a23f44ea35fcfc3e974cf940bc8f84d62a) ) - ROM_REGION( 0x40000, "kanji", 0 ) + ROM_REGION( 0x20000, "kanji", ROMREGION_ERASEFF ) ROM_LOAD( "kanji1.rom", 0x00000, 0x20000, CRC(6178bd43) SHA1(82e11a177af6a5091dd67f50a2f4bafda84d6556) ) - ROM_LOAD( "mc_kanji2.rom", 0x20000, 0x20000, CRC(376eb677) SHA1(bcf96584e2ba362218b813be51ea21573d1a2a78) ) + + ROM_REGION( 0x20000, "kanji_lv2", ROMREGION_ERASEFF ) + ROM_LOAD( "mc_kanji2.rom", 0x00000, 0x20000, CRC(376eb677) SHA1(bcf96584e2ba362218b813be51ea21573d1a2a78) ) ROM_REGION( 0x800, "cgrom", 0) ROM_COPY( "kanji", 0x1000, 0x0000, 0x0800 ) @@ -2536,21 +2077,25 @@ /* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME */ -COMP( 1981, pc8801, 0, 0, pc8801, pc88sr, pc8801_state, empty_init, "NEC", "PC-8801", MACHINE_NOT_WORKING ) -COMP( 1983, pc8801mk2, pc8801, 0, pc8801, pc88sr, pc8801_state, empty_init, "NEC", "PC-8801mkII", MACHINE_NOT_WORKING ) -COMP( 1985, pc8801mk2sr, pc8801, 0, pc8801, pc88sr, pc8801_state, empty_init, "NEC", "PC-8801mkIISR", MACHINE_NOT_WORKING ) -//COMP( 1985, pc8801mk2tr, pc8801, 0, pc8801, pc88sr, pc8801_state, empty_init, "NEC", "PC-8801mkIITR", MACHINE_NOT_WORKING ) -COMP( 1985, pc8801mk2fr, pc8801, 0, pc8801, pc88sr, pc8801_state, empty_init, "NEC", "PC-8801mkIIFR", MACHINE_NOT_WORKING ) -COMP( 1985, pc8801mk2mr, pc8801, 0, pc8801mk2mr, pc88sr, pc8801_state, empty_init, "NEC", "PC-8801mkIIMR", MACHINE_NOT_WORKING ) - -//COMP( 1986, pc8801fh, 0, 0, pc8801mk2fr, pc88sr, pc8801_state, empty_init, "NEC", "PC-8801FH", MACHINE_NOT_WORKING ) -COMP( 1986, pc8801mh, pc8801, 0, pc8801fh, pc88sr, pc8801_state, empty_init, "NEC", "PC-8801MH", MACHINE_NOT_WORKING ) -COMP( 1987, pc8801fa, pc8801, 0, pc8801fh, pc88sr, pc8801_state, empty_init, "NEC", "PC-8801FA", MACHINE_NOT_WORKING ) -COMP( 1987, pc8801ma, pc8801, 0, pc8801ma, pc88sr, pc8801_state, empty_init, "NEC", "PC-8801MA", MACHINE_NOT_WORKING ) -//COMP( 1988, pc8801fe, pc8801, 0, pc8801fa, pc88sr, pc8801_state, empty_init, "NEC", "PC-8801FE", MACHINE_NOT_WORKING ) -COMP( 1988, pc8801ma2, pc8801, 0, pc8801ma, pc88sr, pc8801_state, empty_init, "NEC", "PC-8801MA2", MACHINE_NOT_WORKING ) -//COMP( 1989, pc8801fe2, pc8801, 0, pc8801fa, pc88sr, pc8801_state, empty_init, "NEC", "PC-8801FE2", MACHINE_NOT_WORKING ) -COMP( 1989, pc8801mc, pc8801, 0, pc8801mc, pc88sr, pc8801_state, empty_init, "NEC", "PC-8801MC", MACHINE_NOT_WORKING ) +COMP( 1981, pc8801, 0, 0, pc8801, pc8801, pc8801_state, empty_init, "NEC", "PC-8801", MACHINE_NOT_WORKING ) +COMP( 1983, pc8801mk2, pc8801, 0, pc8801, pc8801, pc8801_state, empty_init, "NEC", "PC-8801mkII", MACHINE_NOT_WORKING ) -//COMP( 1989, pc98do, 0, 0, pc88va, pc88sr, pc8801_state, empty_init, "NEC", "PC-98DO", MACHINE_NOT_WORKING ) -//COMP( 1990, pc98dop, 0, 0, pc88va, pc88sr, pc8801_state, empty_init, "NEC", "PC-98DO+", MACHINE_NOT_WORKING ) +// internal OPN +COMP( 1985, pc8801mk2sr, 0, 0, pc8801mk2sr, pc8801, pc8801mk2sr_state, empty_init, "NEC", "PC-8801mkIISR", MACHINE_NOT_WORKING ) +//COMP( 1985, pc8801mk2tr, pc8801mk2sr, 0, pc8801mk2sr, pc8801, pc8801mk2sr_state, empty_init, "NEC", "PC-8801mkIITR", MACHINE_NOT_WORKING ) +COMP( 1985, pc8801mk2fr, pc8801mk2sr, 0, pc8801mk2sr, pc8801, pc8801mk2sr_state, empty_init, "NEC", "PC-8801mkIIFR", MACHINE_NOT_WORKING ) +COMP( 1985, pc8801mk2mr, pc8801mk2sr, 0, pc8801mk2mr, pc8801, pc8801mk2sr_state, empty_init, "NEC", "PC-8801mkIIMR", MACHINE_NOT_WORKING ) + +// internal OPNA +//COMP( 1986, pc8801fh, pc8801mh, 0, pc8801fh, pc8801fh, pc8801fh_state, empty_init, "NEC", "PC-8801FH", MACHINE_NOT_WORKING ) +COMP( 1986, pc8801mh, 0, 0, pc8801fh, pc8801fh, pc8801fh_state, empty_init, "NEC", "PC-8801MH", MACHINE_NOT_WORKING ) +COMP( 1987, pc8801fa, pc8801mh, 0, pc8801fh, pc8801fh, pc8801fh_state, empty_init, "NEC", "PC-8801FA", MACHINE_NOT_WORKING ) +COMP( 1987, pc8801ma, 0, 0, pc8801ma, pc8801fh, pc8801ma_state, empty_init, "NEC", "PC-8801MA", MACHINE_NOT_WORKING ) +//COMP( 1988, pc8801fe, pc8801ma, 0, pc8801fa, pc8801fh, pc8801ma_state, empty_init, "NEC", "PC-8801FE", MACHINE_NOT_WORKING ) +COMP( 1988, pc8801ma2, pc8801ma, 0, pc8801ma, pc8801fh, pc8801ma_state, empty_init, "NEC", "PC-8801MA2", MACHINE_NOT_WORKING ) +//COMP( 1989, pc8801fe2, pc8801ma, 0, pc8801fa, pc8801fh, pc8801ma_state, empty_init, "NEC", "PC-8801FE2", MACHINE_NOT_WORKING ) +COMP( 1989, pc8801mc, pc8801ma, 0, pc8801mc, pc8801fh, pc8801mc_state, empty_init, "NEC", "PC-8801MC", MACHINE_NOT_WORKING ) + +// PC98DO (PC88+PC98, V33 + μPD70008AC) +//COMP( 1989, pc98do, 0, 0, pc98do, pc98do, pc8801_state, empty_init, "NEC", "PC-98DO", MACHINE_NOT_WORKING ) +//COMP( 1990, pc98dop, 0, 0, pc98do, pc98do, pc8801_state, empty_init, "NEC", "PC-98DO+", MACHINE_NOT_WORKING ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/pcktgal.cpp mame-0.243+dfsg.1/src/mame/drivers/pcktgal.cpp --- mame-0.242+dfsg.1/src/mame/drivers/pcktgal.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/pcktgal.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -15,30 +15,172 @@ ***************************************************************************/ #include "emu.h" -#include "includes/pcktgal.h" + +#include "machine/deco222.h" +#include "video/decbac06.h" #include "cpu/m6502/m6502.h" -#include "sound/ymopn.h" +#include "machine/gen_latch.h" +#include "sound/msm5205.h" #include "sound/ymopl.h" -#include "machine/deco222.h" +#include "sound/ymopn.h" + +#include "emupal.h" #include "screen.h" #include "speaker.h" +namespace { + +class pcktgal_state : public driver_device +{ +public: + pcktgal_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_msm(*this, "msm"), + m_tilegen(*this, "tilegen"), + m_gfxdecode(*this, "gfxdecode"), + m_palette(*this, "palette"), + m_soundlatch(*this, "soundlatch"), + m_spriteram(*this, "spriteram"), + m_mainbank(*this, "mainbank%u", 0U), + m_soundbank(*this, "soundbank") + { } + + void init_original(); + + void bootleg(machine_config &config); + void pcktgal(machine_config &config); + void pcktgal2(machine_config &config); + +protected: + virtual void machine_start() override; + +private: + required_device m_maincpu; + required_device m_audiocpu; + required_device m_msm; + required_device m_tilegen; + required_device m_gfxdecode; + required_device m_palette; + required_device m_soundlatch; + + required_shared_ptr m_spriteram; + required_memory_bank_array<2> m_mainbank; + required_memory_bank m_soundbank; + + uint16_t m_msm5205next = 0; + uint8_t m_toggle = 0; + + void bank_w(uint8_t data); + void sound_bank_w(uint8_t data); + void sound_w(uint8_t data); + void adpcm_data_w(uint8_t data); + uint8_t sound_unk_r(); + DECLARE_WRITE_LINE_MEMBER(adpcm_int); + + void palette(palette_device &palette) const; + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_bootleg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, bool flip_screen); + + void main_map(address_map &map); + void sound_map(address_map &map); +}; + + +// video + + +void pcktgal_state::palette(palette_device &palette) const +{ + uint8_t const *const color_prom = memregion("proms")->base(); + + for (int i = 0; i < palette.entries(); i++) + { + int bit0 = BIT(color_prom[i], 0); + int bit1 = BIT(color_prom[i], 1); + int bit2 = BIT(color_prom[i], 2); + int bit3 = BIT(color_prom[i], 3); + int const r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; + bit0 = BIT(color_prom[i], 4); + bit1 = BIT(color_prom[i], 5); + bit2 = BIT(color_prom[i], 6); + bit3 = BIT(color_prom[i], 7); + int const g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; + bit0 = BIT(color_prom[i + palette.entries()], 0); + bit1 = BIT(color_prom[i + palette.entries()], 1); + bit2 = BIT(color_prom[i + palette.entries()], 2); + bit3 = BIT(color_prom[i + palette.entries()], 3); + int const b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; + + palette.set_pen_color(i, rgb_t(r, g, b)); + } +} + +void pcktgal_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, bool flip_screen) +{ + for (int offs = 0; offs < m_spriteram.bytes(); offs += 4) + { + if (m_spriteram[offs] != 0xf8) + { + int sx = 240 - m_spriteram[offs + 2]; + int sy = 240 - m_spriteram[offs]; + + int flipx = m_spriteram[offs + 1] & 0x04; + int flipy = m_spriteram[offs + 1] & 0x02; + if (flip_screen) { + sx = 240 - sx; + sy = 240 - sy; + if (flipx) flipx = 0; else flipx = 1; + if (flipy) flipy = 0; else flipy = 1; + } + + m_gfxdecode->gfx(1)->transpen(bitmap, cliprect, + m_spriteram[offs + 3] + ((m_spriteram[offs + 1] & 1) << 8), + (m_spriteram[offs + 1] & 0x70) >> 4, + flipx, flipy, + sx, sy, 0); + } + } +} + +uint32_t pcktgal_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + bool flip = m_tilegen->get_flip_state(); + m_tilegen->set_flip_screen(flip); + m_tilegen->deco_bac06_pf_draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); + draw_sprites(bitmap, cliprect, flip); + return 0; +} + +uint32_t pcktgal_state::screen_update_bootleg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + bool flip = m_tilegen->get_flip_state(); + m_tilegen->set_flip_screen(flip); + // the bootleg doesn't properly set the tilemap registers, because it's on non-original hardware, which probably doesn't have the flexible tilemaps. + m_tilegen->deco_bac06_pf_draw_bootleg(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0, 2, 0); + draw_sprites(bitmap, cliprect, flip); + return 0; +} + + +// machine + /***************************************************************************/ void pcktgal_state::bank_w(uint8_t data) { - if (data & 1) { membank("bank1")->set_entry(0); } - else { membank("bank1")->set_entry(1); } + m_mainbank[0]->set_entry(data & 1); - if (data & 2) { membank("bank2")->set_entry(0); } - else { membank("bank2")->set_entry(1); } + m_mainbank[1]->set_entry((data & 2) >> 1); } void pcktgal_state::sound_bank_w(uint8_t data) { - membank("bank3")->set_entry((data >> 2) & 1); + m_soundbank->set_entry((data >> 2) & 1); m_msm->reset_w((data & 2) >> 1); } @@ -73,35 +215,34 @@ /***************************************************************************/ -void pcktgal_state::pcktgal_map(address_map &map) +void pcktgal_state::main_map(address_map &map) { map(0x0000, 0x07ff).ram(); map(0x0800, 0x0fff).rw(m_tilegen, FUNC(deco_bac06_device::pf_data_8bit_r), FUNC(deco_bac06_device::pf_data_8bit_w)); - map(0x1000, 0x11ff).ram().share("spriteram"); + map(0x1000, 0x11ff).ram().share(m_spriteram); map(0x1800, 0x1800).portr("P1"); map(0x1800, 0x1807).w(m_tilegen, FUNC(deco_bac06_device::pf_control0_8bit_w)); map(0x1810, 0x181f).rw(m_tilegen, FUNC(deco_bac06_device::pf_control1_8bit_r), FUNC(deco_bac06_device::pf_control1_8bit_w)); - map(0x1a00, 0x1a00).portr("P2").w(FUNC(pcktgal_state::sound_w)); map(0x1c00, 0x1c00).portr("DSW").w(FUNC(pcktgal_state::bank_w)); - map(0x4000, 0x5fff).bankr("bank1"); - map(0x6000, 0x7fff).bankr("bank2"); + map(0x4000, 0x5fff).bankr(m_mainbank[0]); + map(0x6000, 0x7fff).bankr(m_mainbank[1]); map(0x8000, 0xffff).rom(); } /***************************************************************************/ -void pcktgal_state::pcktgal_sound_map(address_map &map) +void pcktgal_state::sound_map(address_map &map) { map(0x0000, 0x07ff).ram(); map(0x0800, 0x0801).w("ym1", FUNC(ym2203_device::write)); map(0x1000, 0x1001).w("ym2", FUNC(ym3812_device::write)); - map(0x1800, 0x1800).w(FUNC(pcktgal_state::adpcm_data_w)); /* ADPCM data for the MSM5205 chip */ + map(0x1800, 0x1800).w(FUNC(pcktgal_state::adpcm_data_w)); // ADPCM data for the MSM5205 chip map(0x2000, 0x2000).w(FUNC(pcktgal_state::sound_bank_w)); map(0x3000, 0x3000).r(m_soundlatch, FUNC(generic_latch_8_device::read)); map(0x3400, 0x3400).r(FUNC(pcktgal_state::sound_unk_r)); - map(0x4000, 0x7fff).bankr("bank3"); + map(0x4000, 0x7fff).bankr(m_soundbank); map(0x8000, 0xffff).rom(); } @@ -159,56 +300,56 @@ static const gfx_layout charlayout = { - 8,8, /* 8*8 characters */ + 8,8, // 8*8 characters 4096, 4, { 0x10000*8, 0, 0x18000*8, 0x8000*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 /* every char takes 8 consecutive bytes */ + 8*8 // every char takes 8 consecutive bytes }; static const gfx_layout bootleg_charlayout = { - 8,8, /* 8*8 characters */ + 8,8, // 8*8 characters 4096, 4, { 0x18000*8, 0x8000*8, 0x10000*8, 0 }, { 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 /* every char takes 8 consecutive bytes */ + 8*8 // every char takes 8 consecutive bytes }; static const gfx_layout spritelayout = { - 16,16, /* 16*16 sprites */ - 1024, /* 1024 sprites */ - 2, /* 2 bits per pixel */ + 16,16, // 16*16 sprites + 1024, // 1024 sprites + 2, // 2 bits per pixel { 0x8000*8, 0 }, { 128+0, 128+1, 128+2, 128+3, 128+4, 128+5, 128+6, 128+7, 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 }, - 32*8 /* every char takes 8 consecutive bytes */ + 32*8 // every char takes 8 consecutive bytes }; static const gfx_layout bootleg_spritelayout = { - 16,16, /* 16*16 sprites */ - 1024, /* 1024 sprites */ - 2, /* 2 bits per pixel */ + 16,16, // 16*16 sprites + 1024, // 1024 sprites + 2, // 2 bits per pixel { 0x8000*8, 0 }, { 128+7, 128+6, 128+5, 128+4, 128+3, 128+2, 128+1, 128+0, 7, 6, 5, 4, 3, 2, 1, 0 }, { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 }, - 32*8 /* every char takes 8 consecutive bytes */ + 32*8 // every char takes 8 consecutive bytes }; static GFXDECODE_START( gfx_pcktgal ) - GFXDECODE_ENTRY( "gfx1", 0x00000, charlayout, 256, 16 ) /* chars */ - GFXDECODE_ENTRY( "gfx2", 0x00000, spritelayout, 0, 8 ) /* sprites */ + GFXDECODE_ENTRY( "chars", 0x00000, charlayout, 256, 16 ) + GFXDECODE_ENTRY( "sprites", 0x00000, spritelayout, 0, 8 ) GFXDECODE_END static GFXDECODE_START( gfx_bootleg ) - GFXDECODE_ENTRY( "gfx1", 0x00000, bootleg_charlayout, 256, 16 ) /* chars */ - GFXDECODE_ENTRY( "gfx2", 0x00000, bootleg_spritelayout, 0, 8 ) /* sprites */ + GFXDECODE_ENTRY( "chars", 0x00000, bootleg_charlayout, 256, 16 ) + GFXDECODE_ENTRY( "sprites", 0x00000, bootleg_spritelayout, 0, 8 ) GFXDECODE_END @@ -217,9 +358,11 @@ void pcktgal_state::machine_start() { - membank("bank1")->configure_entries(0, 2, memregion("maincpu")->base() + 0x4000, 0xc000); - membank("bank2")->configure_entries(0, 2, memregion("maincpu")->base() + 0x6000, 0xc000); - membank("bank3")->configure_entries(0, 2, memregion("audiocpu")->base() + 0x10000, 0x4000); + m_mainbank[0]->configure_entry(0, memregion("maincpu")->base()); + m_mainbank[0]->configure_entry(1, memregion("maincpu")->base() + 0x4000); + m_mainbank[1]->configure_entry(0, memregion("maincpu")->base() + 0x2000); + m_mainbank[1]->configure_entry(1, memregion("maincpu")->base() + 0x6000); + m_soundbank->configure_entries(0, 2, memregion("audiocpu")->base(), 0x4000); save_item(NAME(m_msm5205next)); save_item(NAME(m_toggle)); @@ -227,33 +370,33 @@ void pcktgal_state::pcktgal(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware M6502(config, m_maincpu, 2000000); - m_maincpu->set_addrmap(AS_PROGRAM, &pcktgal_state::pcktgal_map); + m_maincpu->set_addrmap(AS_PROGRAM, &pcktgal_state::main_map); DECO_222(config, m_audiocpu, 1500000); - m_audiocpu->set_addrmap(AS_PROGRAM, &pcktgal_state::pcktgal_sound_map); - /* IRQs are caused by the ADPCM chip */ - /* NMIs are caused by the main CPU */ + m_audiocpu->set_addrmap(AS_PROGRAM, &pcktgal_state::sound_map); + // IRQs are caused by the ADPCM chip + // NMIs are caused by the main CPU - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(60); screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); screen.set_size(32*8, 32*8); screen.set_visarea(0*8, 32*8-1, 2*8, 30*8-1); - screen.set_screen_update(FUNC(pcktgal_state::screen_update_pcktgal)); + screen.set_screen_update(FUNC(pcktgal_state::screen_update)); screen.set_palette(m_palette); screen.screen_vblank().set_inputline(m_maincpu, INPUT_LINE_NMI); GFXDECODE(config, m_gfxdecode, "palette", gfx_pcktgal); - PALETTE(config, m_palette, FUNC(pcktgal_state::pcktgal_palette), 512); + PALETTE(config, m_palette, FUNC(pcktgal_state::palette), 512); DECO_BAC06(config, m_tilegen, 0); m_tilegen->set_gfx_region_wide(0, 0, 0); m_tilegen->set_gfxdecode_tag(m_gfxdecode); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); GENERIC_LATCH_8(config, m_soundlatch); @@ -271,190 +414,167 @@ { pcktgal(config); m_gfxdecode->set_info(gfx_bootleg); - subdevice("screen")->set_screen_update(FUNC(pcktgal_state::screen_update_pcktgalb)); + subdevice("screen")->set_screen_update(FUNC(pcktgal_state::screen_update_bootleg)); } void pcktgal_state::pcktgal2(machine_config &config) { pcktgal(config); - M6502(config.replace(), m_audiocpu, 1500000); /* doesn't use the encrypted 222 */ - m_audiocpu->set_addrmap(AS_PROGRAM, &pcktgal_state::pcktgal_sound_map); + M6502(config.replace(), m_audiocpu, 1500000); // doesn't use the encrypted 222 + m_audiocpu->set_addrmap(AS_PROGRAM, &pcktgal_state::sound_map); } /***************************************************************************/ ROM_START( pcktgal ) - ROM_REGION( 0x14000, "maincpu", 0 ) /* 64k for code + 16k for banks */ - ROM_LOAD( "eb04.j7", 0x10000, 0x4000, CRC(8215d60d) SHA1(ac26dfce7e215be21f2a17f864c5e966b8b8322e) ) - ROM_CONTINUE( 0x04000, 0xc000) - /* 4000-7fff is banked but code falls through from 7fff to 8000, so */ - /* I have to load the bank directly at 4000. */ - - ROM_REGION( 0x18000, "audiocpu", 0 ) /* 96k for code + 96k for decrypted opcodes */ - ROM_LOAD( "eb03.f2", 0x10000, 0x8000, CRC(cb029b02) SHA1(fbb3da08ed05ae73fbeeb13e0e2ff735aaf83db8) ) - ROM_CONTINUE( 0x08000, 0x8000 ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "eb04.j7", 0x00000, 0x10000, CRC(8215d60d) SHA1(ac26dfce7e215be21f2a17f864c5e966b8b8322e) ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) + ROM_LOAD( "eb03.f2", 0x00000, 0x10000, CRC(cb029b02) SHA1(fbb3da08ed05ae73fbeeb13e0e2ff735aaf83db8) ) - ROM_REGION( 0x20000, "gfx1", 0 ) + ROM_REGION( 0x20000, "chars", 0 ) ROM_LOAD( "eb01.d11", 0x00000, 0x10000, CRC(63542c3d) SHA1(4f42af99a6d9d4766afe0bebe10d6a97811a0082) ) ROM_LOAD( "eb02.d12", 0x10000, 0x10000, CRC(a9dcd339) SHA1(245824ab86cdfe4b842ce1be0af60f2ff4c6ae07) ) - ROM_REGION( 0x10000, "gfx2", 0 ) + ROM_REGION( 0x10000, "sprites", 0 ) ROM_LOAD( "eb00.a1", 0x00000, 0x10000, CRC(6c1a14a8) SHA1(03201197304c5f1d854b8c4f4a5c78336b51f872) ) ROM_REGION( 0x0400, "proms", 0 ) - ROM_LOAD( "eb05.k14", 0x0000, 0x0200, CRC(3b6198cb) SHA1(d32b364cfce99637998ca83ad21783f80364dd65) ) /* 82s147.084 */ - ROM_LOAD( "eb06.k15", 0x0200, 0x0200, CRC(1fbd4b59) SHA1(84e20329003cf09b849b49e1d83edc330d49f404) ) /* 82s131.101 */ + ROM_LOAD( "eb05.k14", 0x0000, 0x0200, CRC(3b6198cb) SHA1(d32b364cfce99637998ca83ad21783f80364dd65) ) // 82s147.084 + ROM_LOAD( "eb06.k15", 0x0200, 0x0200, CRC(1fbd4b59) SHA1(84e20329003cf09b849b49e1d83edc330d49f404) ) // 82s131.101 ROM_END -ROM_START( pcktgalb ) /* bootleg - "Yada East Corporation" */ - ROM_REGION( 0x14000, "maincpu", 0 ) /* 64k for code + 16k for banks */ - ROM_LOAD( "sexybill.001", 0x10000, 0x4000, CRC(4acb3e84) SHA1(c83d03969587c6be80fb8fc84afe250907674a44) ) - ROM_CONTINUE( 0x04000, 0xc000) - /* 4000-7fff is banked but code falls through from 7fff to 8000, so */ - /* I have to load the bank directly at 4000. */ - - ROM_REGION( 0x18000, "audiocpu", 0 ) /* 96k for code + 96k for decrypted opcodes */ - ROM_LOAD( "eb03.f2", 0x10000, 0x8000, CRC(cb029b02) SHA1(fbb3da08ed05ae73fbeeb13e0e2ff735aaf83db8) ) - ROM_CONTINUE( 0x08000, 0x8000 ) +ROM_START( pcktgalb ) // bootleg - "Yada East Corporation" + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "sexybill.001", 0x00000, 0x10000, CRC(4acb3e84) SHA1(c83d03969587c6be80fb8fc84afe250907674a44) ) - ROM_REGION( 0x20000, "gfx1", 0 ) + ROM_REGION( 0x10000, "audiocpu", 0 ) + ROM_LOAD( "eb03.f2", 0x00000, 0x10000, CRC(cb029b02) SHA1(fbb3da08ed05ae73fbeeb13e0e2ff735aaf83db8) ) + + ROM_REGION( 0x20000, "chars", 0 ) ROM_LOAD( "sexybill.005", 0x00000, 0x10000, CRC(3128dc7b) SHA1(d011181e544b8284ecdf54578da5469804e06c63) ) ROM_LOAD( "sexybill.006", 0x10000, 0x10000, CRC(0fc91eeb) SHA1(9d9a54c8dd41c10d07aabb6a2d8dbaf35c6e4533) ) - ROM_REGION( 0x10000, "gfx2", 0 ) + ROM_REGION( 0x10000, "sprites", 0 ) ROM_LOAD( "sexybill.003", 0x00000, 0x08000, CRC(58182daa) SHA1(55ce4b0ea2cb1c559c12815c9e453624e0d95515) ) ROM_LOAD( "sexybill.004", 0x08000, 0x08000, CRC(33a67af6) SHA1(6d9c04658ed75b970821a5c8b1f60c3c08fdda0a) ) ROM_REGION( 0x0400, "proms", 0 ) - ROM_LOAD( "eb05.k14", 0x0000, 0x0200, CRC(3b6198cb) SHA1(d32b364cfce99637998ca83ad21783f80364dd65) ) /* 82s147.084 */ - ROM_LOAD( "eb06.k15", 0x0200, 0x0200, CRC(1fbd4b59) SHA1(84e20329003cf09b849b49e1d83edc330d49f404) ) /* 82s131.101 */ + ROM_LOAD( "eb05.k14", 0x0000, 0x0200, CRC(3b6198cb) SHA1(d32b364cfce99637998ca83ad21783f80364dd65) ) // 82s147.084 + ROM_LOAD( "eb06.k15", 0x0200, 0x0200, CRC(1fbd4b59) SHA1(84e20329003cf09b849b49e1d83edc330d49f404) ) // 82s131.101 ROM_REGION( 0x0400, "plds", 0 ) // same as official sets? ROM_LOAD( "pal16l8", 0x0000, 0x0104, CRC(b8d4b318) SHA1(6dd68892501c9b61714aaa7a3cfe14cc8ad1a877) ) - ROM_LOAD( "pal16r6", 0x0200, 0x0104, CRC(43aad537) SHA1(892104f4315d7a739718ce32b910694ea9b13fae) ) /* also seen peel18CV8 used on other boards */ + ROM_LOAD( "pal16r6", 0x0200, 0x0104, CRC(43aad537) SHA1(892104f4315d7a739718ce32b910694ea9b13fae) ) // also seen peel18CV8 used on other boards ROM_END ROM_START( pcktgal2 ) - ROM_REGION( 0x14000, "maincpu", 0 ) /* 64k for code + 16k for banks */ - ROM_LOAD( "eb04-2.j7", 0x10000, 0x4000, CRC(0c7f2905) SHA1(882dbc1888a0149486c1fac5568dc3d297c2dadd) ) - ROM_CONTINUE( 0x04000, 0xc000) - /* 4000-7fff is banked but code falls through from 7fff to 8000, so */ - /* I have to load the bank directly at 4000. */ - - ROM_REGION( 0x18000, "audiocpu", 0 ) /* audio cpu */ - ROM_LOAD( "eb03-2.f2", 0x10000, 0x8000, CRC(9408ffb4) SHA1(ddcb67da4acf3d986d54ad10404f213528a8bb62) ) - ROM_CONTINUE( 0x08000, 0x8000) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "eb04-2.j7", 0x00000, 0x10000, CRC(0c7f2905) SHA1(882dbc1888a0149486c1fac5568dc3d297c2dadd) ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) + ROM_LOAD( "eb03-2.f2", 0x00000, 0x10000, CRC(9408ffb4) SHA1(ddcb67da4acf3d986d54ad10404f213528a8bb62) ) - ROM_REGION( 0x20000, "gfx1", 0 ) + ROM_REGION( 0x20000, "chars", 0 ) ROM_LOAD( "eb01-2.rom", 0x00000, 0x10000, CRC(e52b1f97) SHA1(4814fe3b2eb08ac173e09ffadc6e5daa9affa1a0) ) ROM_LOAD( "eb02-2.rom", 0x10000, 0x10000, CRC(f30d965d) SHA1(a787457b33ad39e78fcf8da0715fab7a63869bf9) ) - ROM_REGION( 0x10000, "gfx2", 0 ) + ROM_REGION( 0x10000, "sprites", 0 ) ROM_LOAD( "eb00.a1", 0x00000, 0x10000, CRC(6c1a14a8) SHA1(03201197304c5f1d854b8c4f4a5c78336b51f872) ) ROM_REGION( 0x0400, "proms", 0 ) - ROM_LOAD( "eb05.k14", 0x0000, 0x0200, CRC(3b6198cb) SHA1(d32b364cfce99637998ca83ad21783f80364dd65) ) /* 82s147.084 */ - ROM_LOAD( "eb06.k15", 0x0200, 0x0200, CRC(1fbd4b59) SHA1(84e20329003cf09b849b49e1d83edc330d49f404) ) /* 82s131.101 */ + ROM_LOAD( "eb05.k14", 0x0000, 0x0200, CRC(3b6198cb) SHA1(d32b364cfce99637998ca83ad21783f80364dd65) ) // 82s147.084 + ROM_LOAD( "eb06.k15", 0x0200, 0x0200, CRC(1fbd4b59) SHA1(84e20329003cf09b849b49e1d83edc330d49f404) ) // 82s131.101 ROM_END ROM_START( pcktgal2j ) - ROM_REGION( 0x14000, "maincpu", 0 ) /* 64k for code + 16k for banks */ - ROM_LOAD( "eb04-2.j7", 0x10000, 0x4000, CRC(0c7f2905) SHA1(882dbc1888a0149486c1fac5568dc3d297c2dadd) ) - ROM_CONTINUE( 0x04000, 0xc000) - /* 4000-7fff is banked but code falls through from 7fff to 8000, so */ - /* I have to load the bank directly at 4000. */ - - ROM_REGION( 0x18000, "audiocpu", 0 ) /* audio cpu */ - ROM_LOAD( "eb03-2.f2", 0x10000, 0x8000, CRC(9408ffb4) SHA1(ddcb67da4acf3d986d54ad10404f213528a8bb62) ) - ROM_CONTINUE( 0x08000, 0x8000) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "eb04-2.j7", 0x00000, 0x10000, CRC(0c7f2905) SHA1(882dbc1888a0149486c1fac5568dc3d297c2dadd) ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) + ROM_LOAD( "eb03-2.f2", 0x00000, 0x10000, CRC(9408ffb4) SHA1(ddcb67da4acf3d986d54ad10404f213528a8bb62) ) - ROM_REGION( 0x20000, "gfx1", 0 ) + ROM_REGION( 0x20000, "chars", 0 ) ROM_LOAD( "eb01-2.d11", 0x00000, 0x10000, CRC(8f42ab1a) SHA1(315fb26bbe004c08629a0a3a6e9d129768119e6b) ) ROM_LOAD( "eb02-2.d12", 0x10000, 0x10000, CRC(f394cb35) SHA1(f351b8b6fd8a6637ef9031f7a410a334da8ea5ae) ) - ROM_REGION( 0x10000, "gfx2", 0 ) + ROM_REGION( 0x10000, "sprites", 0 ) ROM_LOAD( "eb00.a1", 0x00000, 0x10000, CRC(6c1a14a8) SHA1(03201197304c5f1d854b8c4f4a5c78336b51f872) ) ROM_REGION( 0x0400, "proms", 0 ) - ROM_LOAD( "eb05.k14", 0x0000, 0x0200, CRC(3b6198cb) SHA1(d32b364cfce99637998ca83ad21783f80364dd65) ) /* 82s147.084 */ - ROM_LOAD( "eb06.k15", 0x0200, 0x0200, CRC(1fbd4b59) SHA1(84e20329003cf09b849b49e1d83edc330d49f404) ) /* 82s131.101 */ + ROM_LOAD( "eb05.k14", 0x0000, 0x0200, CRC(3b6198cb) SHA1(d32b364cfce99637998ca83ad21783f80364dd65) ) // 82s147.084 + ROM_LOAD( "eb06.k15", 0x0200, 0x0200, CRC(1fbd4b59) SHA1(84e20329003cf09b849b49e1d83edc330d49f404) ) // 82s131.101 ROM_END ROM_START( spool3 ) - ROM_REGION( 0x14000, "maincpu", 0 ) /* 64k for code + 16k for banks */ - ROM_LOAD( "eb04-2.j7", 0x10000, 0x4000, CRC(0c7f2905) SHA1(882dbc1888a0149486c1fac5568dc3d297c2dadd) ) - ROM_CONTINUE( 0x04000, 0xc000) - /* 4000-7fff is banked but code falls through from 7fff to 8000, so */ - /* I have to load the bank directly at 4000. */ - - ROM_REGION( 0x18000, "audiocpu", 0 ) /* audio cpu */ - ROM_LOAD( "eb03-2.f2", 0x10000, 0x8000, CRC(9408ffb4) SHA1(ddcb67da4acf3d986d54ad10404f213528a8bb62) ) - ROM_CONTINUE( 0x08000, 0x8000) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "eb04-2.j7", 0x00000, 0x10000, CRC(0c7f2905) SHA1(882dbc1888a0149486c1fac5568dc3d297c2dadd) ) - ROM_REGION( 0x20000, "gfx1", 0 ) + ROM_REGION( 0x10000, "audiocpu", 0 ) + ROM_LOAD( "eb03-2.f2", 0x00000, 0x10000, CRC(9408ffb4) SHA1(ddcb67da4acf3d986d54ad10404f213528a8bb62) ) + + ROM_REGION( 0x20000, "chars", 0 ) ROM_LOAD( "deco2.bin", 0x00000, 0x10000, CRC(0a23f0cf) SHA1(8554215001ffc9e6f141e57cc11b400a853f89f2) ) ROM_LOAD( "deco3.bin", 0x10000, 0x10000, CRC(55ea7c45) SHA1(a8a6ff0c8a5aaee3afbfc3e71a171fb1d2360b45) ) - ROM_REGION( 0x10000, "gfx2", 0 ) + ROM_REGION( 0x10000, "sprites", 0 ) ROM_LOAD( "eb00.a1", 0x00000, 0x10000, CRC(6c1a14a8) SHA1(03201197304c5f1d854b8c4f4a5c78336b51f872) ) ROM_REGION( 0x0400, "proms", 0 ) - ROM_LOAD( "eb05.k14", 0x0000, 0x0200, CRC(3b6198cb) SHA1(d32b364cfce99637998ca83ad21783f80364dd65) ) /* 82s147.084 */ - ROM_LOAD( "eb06.k15", 0x0200, 0x0200, CRC(1fbd4b59) SHA1(84e20329003cf09b849b49e1d83edc330d49f404) ) /* 82s131.101 */ + ROM_LOAD( "eb05.k14", 0x0000, 0x0200, CRC(3b6198cb) SHA1(d32b364cfce99637998ca83ad21783f80364dd65) ) // 82s147.084 + ROM_LOAD( "eb06.k15", 0x0200, 0x0200, CRC(1fbd4b59) SHA1(84e20329003cf09b849b49e1d83edc330d49f404) ) // 82s131.101 ROM_END ROM_START( spool3i ) - ROM_REGION( 0x14000, "maincpu", 0 ) /* 64k for code + 16k for banks */ - ROM_LOAD( "de1.bin", 0x10000, 0x4000, CRC(a59980fe) SHA1(64b55af4d0b314d14184784e9f817b56be0f24f2) ) - ROM_CONTINUE( 0x04000, 0xc000) - /* 4000-7fff is banked but code falls through from 7fff to 8000, so */ - /* I have to load the bank directly at 4000. */ - - ROM_REGION( 0x18000, "audiocpu", 0 ) /* audio cpu */ - ROM_LOAD( "eb03-2.f2", 0x10000, 0x8000, CRC(9408ffb4) SHA1(ddcb67da4acf3d986d54ad10404f213528a8bb62) ) - ROM_CONTINUE( 0x08000, 0x8000) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "de1.bin", 0x00000, 0x10000, CRC(a59980fe) SHA1(64b55af4d0b314d14184784e9f817b56be0f24f2) ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) + ROM_LOAD( "eb03-2.f2", 0x00000, 0x10000, CRC(9408ffb4) SHA1(ddcb67da4acf3d986d54ad10404f213528a8bb62) ) - ROM_REGION( 0x20000, "gfx1", 0 ) + ROM_REGION( 0x20000, "chars", 0 ) ROM_LOAD( "deco2.bin", 0x00000, 0x10000, CRC(0a23f0cf) SHA1(8554215001ffc9e6f141e57cc11b400a853f89f2) ) ROM_LOAD( "deco3.bin", 0x10000, 0x10000, CRC(55ea7c45) SHA1(a8a6ff0c8a5aaee3afbfc3e71a171fb1d2360b45) ) - ROM_REGION( 0x10000, "gfx2", 0 ) + ROM_REGION( 0x10000, "sprites", 0 ) ROM_LOAD( "eb00.a1", 0x00000, 0x10000, CRC(6c1a14a8) SHA1(03201197304c5f1d854b8c4f4a5c78336b51f872) ) ROM_REGION( 0x0400, "proms", 0 ) - ROM_LOAD( "eb05.k14", 0x0000, 0x0200, CRC(3b6198cb) SHA1(d32b364cfce99637998ca83ad21783f80364dd65) ) /* 82s147.084 */ - ROM_LOAD( "eb06.k15", 0x0200, 0x0200, CRC(1fbd4b59) SHA1(84e20329003cf09b849b49e1d83edc330d49f404) ) /* 82s131.101 */ + ROM_LOAD( "eb05.k14", 0x0000, 0x0200, CRC(3b6198cb) SHA1(d32b364cfce99637998ca83ad21783f80364dd65) ) // 82s147.084 + ROM_LOAD( "eb06.k15", 0x0200, 0x0200, CRC(1fbd4b59) SHA1(84e20329003cf09b849b49e1d83edc330d49f404) ) // 82s131.101 ROM_END /***************************************************************************/ -void pcktgal_state::init_pcktgal() +void pcktgal_state::init_original() { - uint8_t *rom = memregion("gfx1")->base(); - const int len = memregion("gfx1")->bytes(); + uint8_t *rom = memregion("chars")->base(); + const int len = memregion("chars")->bytes(); - /* Tile graphics roms have some swapped lines, original version only */ + // Tile graphics ROMs have some swapped lines, original version only for (int i = 0x00000; i < len; i += 32) { int temp[16]; for (int j = 0; j < 16; j++) { - temp[j] = rom[i+j+16]; - rom[i+j+16] = rom[i+j]; - rom[i+j] = temp[j]; + temp[j] = rom[i + j + 16]; + rom[i + j + 16] = rom[i + j]; + rom[i + j] = temp[j]; } } } +} // anonymous namespace /***************************************************************************/ -GAME( 1987, pcktgal, 0, pcktgal, pcktgal, pcktgal_state, init_pcktgal, ROT0, "Data East Corporation", "Pocket Gal (Japan)", MACHINE_SUPPORTS_SAVE ) -GAME( 1987, pcktgalb, pcktgal, bootleg, pcktgal, pcktgal_state, empty_init, ROT0, "bootleg", "Pocket Gal (Yada East bootleg)", MACHINE_SUPPORTS_SAVE ) -GAME( 1989, pcktgal2, pcktgal, pcktgal2,pcktgal, pcktgal_state, init_pcktgal, ROT0, "Data East Corporation", "Pocket Gal 2 (English)", MACHINE_SUPPORTS_SAVE ) -GAME( 1989, pcktgal2j,pcktgal, pcktgal2,pcktgal, pcktgal_state, init_pcktgal, ROT0, "Data East Corporation", "Pocket Gal 2 (Japanese)", MACHINE_SUPPORTS_SAVE ) -GAME( 1989, spool3, pcktgal, pcktgal2,pcktgal, pcktgal_state, init_pcktgal, ROT0, "Data East Corporation", "Super Pool III (English)", MACHINE_SUPPORTS_SAVE ) -GAME( 1990, spool3i, pcktgal, pcktgal2,pcktgal, pcktgal_state, init_pcktgal, ROT0, "Data East Corporation (I-Vics license)", "Super Pool III (I-Vics)", MACHINE_SUPPORTS_SAVE ) +GAME( 1987, pcktgal, 0, pcktgal, pcktgal, pcktgal_state, init_original, ROT0, "Data East Corporation", "Pocket Gal (Japan)", MACHINE_SUPPORTS_SAVE ) +GAME( 1987, pcktgalb, pcktgal, bootleg, pcktgal, pcktgal_state, empty_init, ROT0, "bootleg", "Pocket Gal (Yada East bootleg)", MACHINE_SUPPORTS_SAVE ) +GAME( 1989, pcktgal2, pcktgal, pcktgal2,pcktgal, pcktgal_state, init_original, ROT0, "Data East Corporation", "Pocket Gal 2 (English)", MACHINE_SUPPORTS_SAVE ) +GAME( 1989, pcktgal2j,pcktgal, pcktgal2,pcktgal, pcktgal_state, init_original, ROT0, "Data East Corporation", "Pocket Gal 2 (Japanese)", MACHINE_SUPPORTS_SAVE ) +GAME( 1989, spool3, pcktgal, pcktgal2,pcktgal, pcktgal_state, init_original, ROT0, "Data East Corporation", "Super Pool III (English)", MACHINE_SUPPORTS_SAVE ) +GAME( 1990, spool3i, pcktgal, pcktgal2,pcktgal, pcktgal_state, init_original, ROT0, "Data East Corporation (I-Vics license)", "Super Pool III (I-Vics)", MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/pegasus.cpp mame-0.243+dfsg.1/src/mame/drivers/pegasus.cpp --- mame-0.242+dfsg.1/src/mame/drivers/pegasus.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/pegasus.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -106,7 +106,7 @@ void pegasusm_mem(address_map &map); u8 m_kbd_row = 0U; - bool m_kbd_irq = 0; + bool m_kbd_irq = false; u8 m_control_bits = 0U; std::unique_ptr m_pcg; void pegasus_decrypt_rom(u8 *ROM); diff -Nru mame-0.242+dfsg.1/src/mame/drivers/pencil2.cpp mame-0.243+dfsg.1/src/mame/drivers/pencil2.cpp --- mame-0.242+dfsg.1/src/mame/drivers/pencil2.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/pencil2.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -128,7 +128,7 @@ virtual void machine_start() override; int m_centronics_busy = 0; int m_centronics_ack = 0; - bool m_cass_state = 0; + bool m_cass_state = false; required_device m_maincpu; required_device m_centronics; required_device m_cass; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/peyper.cpp mame-0.243+dfsg.1/src/mame/drivers/peyper.cpp --- mame-0.242+dfsg.1/src/mame/drivers/peyper.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/peyper.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -853,17 +853,17 @@ } // Anonymous namespace -GAME( 1984, petaco, 0, petaco, odin_dlx, peyper_state, init_1, ROT0, "Juegos Populares", "Petaco", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1985, odin, 0, peyper, odin_dlx, peyper_state, init_1, ROT0, "Peyper", "Odin", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1985, odin_dlx, 0, peyper, odin_dlx, peyper_state, init_1, ROT0, "Sonic", "Odin De Luxe", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1986, solarwap, 0, peyper, solarwap, peyper_state, init_0, ROT0, "Sonic", "Solar Wars (Sonic)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1986, gamatros, 0, peyper, solarwap, peyper_state, init_0, ROT0, "Sonic", "Gamatron (Sonic)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1987, poleposn, 0, peyper, poleposn, peyper_state, init_0, ROT0, "Sonic", "Pole Position (Sonic)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1987, sonstwar, 0, peyper, sonstwar, peyper_state, init_3, ROT0, "Sonic", "Star Wars (Sonic, set 1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1987, sonstwr2, sonstwar, peyper, sonstwar, peyper_state, init_3, ROT0, "Sonic", "Star Wars (Sonic, set 2)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1987, wolfman, 0, peyper, wolfman, peyper_state, init_2, ROT0, "Peyper", "Wolf Man", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1986, nemesisp, 0, peyper, wolfman, peyper_state, init_2, ROT0, "Peyper", "Nemesis", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1987, odisea, 0, peyper, odisea, peyper_state, init_2, ROT0, "Peyper", "Odisea Paris-Dakar", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1988, hangonp, 0, peyper, sonstwar, peyper_state, init_3, ROT0, "Sonic", "Hang-On (Sonic)", MACHINE_IS_SKELETON_MECHANICAL ) // inputs to be checked -GAME( 1985, ator, 0, peyper, sonstwar, peyper_state, init_1, ROT0, "Video Dens", "Ator (set 1, 2 bumpers)", MACHINE_IS_SKELETON_MECHANICAL ) // inputs to be checked -GAME( 1985, ator3bmp, ator, peyper, sonstwar, peyper_state, init_1, ROT0, "Video Dens", "Ator (set 2, 3 bumpers)", MACHINE_IS_SKELETON_MECHANICAL ) // initial program ROM missing; no manual found +GAME( 1984, petaco, 0, petaco, odin_dlx, peyper_state, init_1, ROT0, "Juegos Populares", "Petaco", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1985, odin, 0, peyper, odin_dlx, peyper_state, init_1, ROT0, "Peyper", "Odin", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1985, odin_dlx, 0, peyper, odin_dlx, peyper_state, init_1, ROT0, "Sonic", "Odin De Luxe", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1986, solarwap, 0, peyper, solarwap, peyper_state, init_0, ROT0, "Sonic", "Solar Wars (Sonic)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1986, gamatros, 0, peyper, solarwap, peyper_state, init_0, ROT0, "Sonic", "Gamatron (Sonic)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1987, poleposn, 0, peyper, poleposn, peyper_state, init_0, ROT0, "Sonic", "Pole Position (Sonic)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1987, sonstwar, 0, peyper, sonstwar, peyper_state, init_3, ROT0, "Sonic", "Star Wars (Sonic, set 1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1987, sonstwr2, sonstwar, peyper, sonstwar, peyper_state, init_3, ROT0, "Sonic", "Star Wars (Sonic, set 2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1987, wolfman, 0, peyper, wolfman, peyper_state, init_2, ROT0, "Peyper", "Wolf Man", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1986, nemesisp, 0, peyper, wolfman, peyper_state, init_2, ROT0, "Peyper", "Nemesis", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1987, odisea, 0, peyper, odisea, peyper_state, init_2, ROT0, "Peyper", "Odisea Paris-Dakar", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1988, hangonp, 0, peyper, sonstwar, peyper_state, init_3, ROT0, "Sonic", "Hang-On (Sonic)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // inputs to be checked +GAME( 1985, ator, 0, peyper, sonstwar, peyper_state, init_1, ROT0, "Video Dens", "Ator (set 1, 2 bumpers)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // inputs to be checked +GAME( 1985, ator3bmp, ator, peyper, sonstwar, peyper_state, init_1, ROT0, "Video Dens", "Ator (set 2, 3 bumpers)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // initial program ROM missing; no manual found diff -Nru mame-0.242+dfsg.1/src/mame/drivers/pgm2.cpp mame-0.243+dfsg.1/src/mame/drivers/pgm2.cpp --- mame-0.242+dfsg.1/src/mame/drivers/pgm2.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/pgm2.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -34,10 +34,10 @@ Dodonpachi Daioujou Tamashii Knights of Valour 3 - These were only released as single board PGM2 based hardware, seen for sale in Japan for around $250-$300 + These were only released in Japan, seen for sale for around $250-$300 Jigsaw World Arena - Puzzle of Ocha / Ochainu No Pazuru + Ochaken no Puzzle ToDo (emulation issues): @@ -1518,6 +1518,6 @@ // King of Fighters '98: Ultimate Match Hero GAME( 2009, kof98umh, 0, pgm2_lores, pgm2, pgm2_state, init_kof98umh, ROT0, "IGS / SNK Playmore / New Channel", "The King of Fighters '98: Ultimate Match HERO (China, V100, 09-08-23)", MACHINE_SUPPORTS_SAVE ) -// Jigsaw World Arena +// ジグソーワールドアリーナ/Jigsaw World Arena // お茶犬のパズル/Ochaken no Puzzle (V101JP exists but undumped, Puzzle game of Japanese お茶犬/Ochaken franchises) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/photoply.cpp mame-0.243+dfsg.1/src/mame/drivers/photoply.cpp --- mame-0.242+dfsg.1/src/mame/drivers/photoply.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/photoply.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -290,6 +290,7 @@ .erase_all_time(attotime::from_usec(10)); } +// We asume that every Photo Play from 1999 onwards use a DX4 100MHz instead of a 75MHz one (both were compatible, the latter were recommended) void photoply_state::photoply_dx4_100(machine_config &config) { photoply(config); @@ -301,7 +302,7 @@ ROM_LOAD("funworld_award_486e_w83787.bin", 0x000000, 0x20000, CRC(af7ff1d4) SHA1(72eeecf798a03817ce7ba4d65cd4128ed3ef7e68) ) // 486E 96/7/19 W83787 PLUG & PLAY BIOS, AT27C010, Funworld sticker: Sept 1998 ROM_REGION(0x8000, "ex_bios", ROMREGION_ERASE00 ) // Multifunction board with a ESS AudioDrive chip, Funworld sticker: Sept 1998 - ROM_LOAD("enhanced_bios_centos.bin", 0x000000, 0x8000, CRC(ee8ad003) SHA1(4814385117599a98da02155785d1e3fce4e485bd) ) // Centos CI-8000/PP2000 ROM BIOS Version 1.06, 27C256B + ROM_LOAD("enhanced_bios_centos.bin", 0x0000, 0x8000, CRC(ee8ad003) SHA1(4814385117599a98da02155785d1e3fce4e485bd) ) // Centos CI-8000/PP2000 ROM BIOS Version 1.06, 27C256B ROM_REGION(0x8000, "video_bios", 0 ) ROM_LOAD("cl-gd5446_pci_vga_bios_version_1.31.u2", 0x0000, 0x8000, CRC(61f8cac7) SHA1(6e54aadfe10dfa5c7e417a054e9a64499a99083c) ) // Cirrus Logic/Quadtel CL-GD5446 PCI VGA BIOS v1.31 , AT27C256R @@ -387,6 +388,21 @@ DISK_IMAGE( "photoplay99sp", 0, BAD_DUMP SHA1(887e5b8c931d6122a1c3a8eda5cb919eb162eced) ) // From an operated HDD. A clean one must be recreated from the CDs ROM_END +// BIOS not provided on this set +ROM_START(photoply99nl) + ROM_REGION(0x20000, "bios", 0) // Motherboard BIOS + ROM_LOAD("funworld_award_486e_w83787.bin", 0x000000, 0x20000, BAD_DUMP CRC(af7ff1d4) SHA1(72eeecf798a03817ce7ba4d65cd4128ed3ef7e68) ) // 486E 96/7/19 W83787 PLUG & PLAY BIOS, AT29C010A + + ROM_REGION(0x8000, "ex_bios", ROMREGION_ERASE00 ) + ROM_LOAD("enhanced_bios_1.06.u13", 0x0000, 0x8000, CRC(d05e9d20) SHA1(854501b7b3bf988b10516109d058f7ca2aa07d3e) ) // Centos Combo I/O ROM BIOS for CI-8000/PP2000 v1.06, W27E257 + + ROM_REGION(0x8000, "video_bios", 0 ) + ROM_LOAD("cl-gd5446_pci_vga_bios_version_1.31.u2", 0x0000, 0x8000, CRC(61f8cac7) SHA1(6e54aadfe10dfa5c7e417a054e9a64499a99083c) ) // Cirrus Logic/Quadtel CL-GD5446 PCI VGA BIOS v1.31 , AT27C256R + + DISK_REGION( "ide:0:hdd:image" ) + DISK_IMAGE( "photoplay99nl", 0, BAD_DUMP SHA1(e3ff2a64f51e0ba07d08cd49cd56cdc866401b4f) ) // Recreated from the CDs using a VM +ROM_END + ROM_START(photoply2k) ROM_REGION(0x20000, "bios", 0) // Motherboard BIOS ROM_LOAD("funworld_award_486e_w83787_alt.bin", 0x000000, 0x20000, CRC(e96d1bbc) SHA1(64d0726c4e9ecee8fddf4cc39d92aecaa8184d5c) ) // 486E 96/7/19 W83787 PLUG & PLAY BIOS (same string as 'photoply99sp' and 'photoply99sp' BIOSes, but different hash) @@ -409,12 +425,12 @@ ROM_LOAD("funworld_award_486e_w83787.bin", 0x000000, 0x20000, CRC(af7ff1d4) SHA1(72eeecf798a03817ce7ba4d65cd4128ed3ef7e68) ) // 486E 96/7/19 W83787 PLUG & PLAY BIOS, AT27C010 ROM_REGION(0x8000, "ex_bios", ROMREGION_ERASE00 ) // Multifunction board with a ESS AudioDrive chip - ROM_LOAD("enhanced_bios_centos.bin", 0x000000, 0x8000, CRC(ee8ad003) SHA1(4814385117599a98da02155785d1e3fce4e485bd) ) // Centos CI-8000/PP2000 ROM BIOS Version 1.06, 27C256B + ROM_LOAD("enhanced_bios_centos.bin", 0x0000, 0x8000, CRC(ee8ad003) SHA1(4814385117599a98da02155785d1e3fce4e485bd) ) // Centos CI-8000/PP2000 ROM BIOS Version 1.06, 27C256B ROM_REGION(0x8000, "video_bios", 0 ) ROM_LOAD("cl-gd5446_pci_vga_bios_version_1.31.u2", 0x0000, 0x8000, CRC(61f8cac7) SHA1(6e54aadfe10dfa5c7e417a054e9a64499a99083c) ) // Cirrus Logic/Quadtel CL-GD5446 PCI VGA BIOS v1.31 , AT27C256R - /* The PhotoPlay 2000 parallel port dongle contains, under resin: + /* The Photo Play 2000 parallel port dongle contains, under resin: Unknown MCU labeled "MARX(C)95,97 CBN/V/S" (UNDUMPED) 74HC00 */ ROM_REGION(0x800, "dongle", 0) @@ -427,6 +443,27 @@ ROM_END // BIOS not provided, might be different +ROM_START(photoply2knl) + ROM_REGION(0x20000, "bios", 0) // Motherboard BIOS + ROM_LOAD("funworld_award_486e_w83787.bin", 0x000000, 0x20000, BAD_DUMP CRC(af7ff1d4) SHA1(72eeecf798a03817ce7ba4d65cd4128ed3ef7e68) ) // 486E 96/7/19 W83787 PLUG & PLAY BIOS, AT27C010 + + ROM_REGION(0x8000, "ex_bios", ROMREGION_ERASE00 ) // Multifunction board with a ESS AudioDrive chip + ROM_LOAD("enhanced_bios_centos.bin", 0x0000, 0x8000, CRC(ee8ad003) SHA1(4814385117599a98da02155785d1e3fce4e485bd) ) // Centos CI-8000/PP2000 ROM BIOS Version 1.06, 27C256B + + ROM_REGION(0x8000, "video_bios", 0 ) + ROM_LOAD("cl-gd5446_pci_vga_bios_version_1.31.u2", 0x0000, 0x8000, CRC(61f8cac7) SHA1(6e54aadfe10dfa5c7e417a054e9a64499a99083c) ) // Cirrus Logic/Quadtel CL-GD5446 PCI VGA BIOS v1.31 , AT27C256R + + /* The Photo Play 2000 parallel port dongle contains, under resin: + Unknown MCU labeled "MARX(C)95,97 CBN/V/S" (UNDUMPED) + 74HC00 */ + ROM_REGION(0x800, "dongle", 0) + ROM_LOAD("marx_cbn-v-s.bin", 0x000, 0x800, NO_DUMP ) // Size unknown + + DISK_REGION( "ide:0:hdd:image" ) + DISK_IMAGE( "photoplay2knl", 0, BAD_DUMP SHA1(75aa190913e798d04db88325006c61965f5034ef) ) // Recreated from the CDs using a VM +ROM_END + +// BIOS not provided, might be different ROM_START(photoply2k1it) ROM_REGION(0x20000, "bios", 0) // Motherboard BIOS ROM_LOAD("funworld_award_486e_w83787.bin", 0x000000, 0x20000, BAD_DUMP CRC(af7ff1d4) SHA1(72eeecf798a03817ce7ba4d65cd4128ed3ef7e68) ) // 486E 96/7/19 W83787 PLUG & PLAY BIOS, AT27C010 @@ -473,6 +510,82 @@ ROM_END // BIOS not provided, might be different +ROM_START(photoply2k1nl) + ROM_REGION(0x20000, "bios", 0) // Motherboard BIOS + ROM_LOAD("funworld_award_486e_w83787.bin", 0x000000, 0x20000, BAD_DUMP CRC(af7ff1d4) SHA1(72eeecf798a03817ce7ba4d65cd4128ed3ef7e68) ) // 486E 96/7/19 W83787 PLUG & PLAY BIOS, AT27C010 + + ROM_REGION(0x8000, "ex_bios", ROMREGION_ERASE00 ) // Multifunction board with a ESS AudioDrive chip + ROM_LOAD("enhanced_bios_centos.bin", 0x0000, 0x8000, CRC(ee8ad003) SHA1(4814385117599a98da02155785d1e3fce4e485bd) ) // Centos CI-8000/PP2000 ROM BIOS Version 1.06, 27C256B + + ROM_REGION(0x8000, "video_bios", 0 ) + ROM_LOAD("cl-gd5446_pci_vga_bios_version_1.31.u2", 0x0000, 0x8000, CRC(61f8cac7) SHA1(6e54aadfe10dfa5c7e417a054e9a64499a99083c) ) // Cirrus Logic/Quadtel CL-GD5446 PCI VGA BIOS v1.31 , AT27C256R + + DISK_REGION( "ide:0:hdd:image" ) + DISK_IMAGE( "photoplay2k1nl", 0, BAD_DUMP SHA1(87c9417119e9566f65db0f1b0f2182db7712c634) ) // Recreated from the CDs using a VM + + // Recovery discs for Photo Play 2001 + + /* UPDATE 2001 - Disc 1 + Info on the CD ring: + A0100344917-0102 35 A1 + IFPI L555 + Sony DADC + Inner ring, laser engraved: IFPI 94Z5 + */ + DISK_REGION( "recover_upd2k1_d1" ) + DISK_IMAGE_READONLY( "update_2001_cd1", 0, SHA1(c271c03ba8118203b9790dd924aac77ad68c2b17) ) + + /* UPDATE 2001 - Disc 2 + Info on the CD ring: + A0100344917-0202 13 B1 + IFPI L553 + Sony DADC + Inner ring, laser engraved: IFPI 94W6 + */ + DISK_REGION( "recover_upd2k1_d2" ) + DISK_IMAGE_READONLY( "update_2001_cd2", 0, SHA1(c5797d6a342407136af49443401e83fe9578f5f2) ) + + /* SNAKE II Service Release Update 2001 + Info on the CD ring: + A0100360706-0101 15 A3 + IFPI L555 + Sony DADC + */ + DISK_REGION( "recover_snake2_upd2k1_d1" ) + DISK_IMAGE_READONLY( "nokia_snake_ii_service_release_update_2001", 0, SHA1(09286cb8b63d3cc771cbbf4b9b3de77e3d15bb7b) ) +ROM_END + +// BIOS not provided, might be different +ROM_START(photoply2k1mtnl) + ROM_REGION(0x20000, "bios", 0) // Motherboard BIOS + ROM_LOAD("funworld_award_486e_w83787.bin", 0x000000, 0x20000, BAD_DUMP CRC(af7ff1d4) SHA1(72eeecf798a03817ce7ba4d65cd4128ed3ef7e68) ) // 486E 96/7/19 W83787 PLUG & PLAY BIOS, AT27C010 + + ROM_REGION(0x8000, "ex_bios", ROMREGION_ERASE00 ) // Multifunction board with a ESS AudioDrive chip + ROM_LOAD("enhanced_bios_centos.bin", 0x0000, 0x8000, CRC(ee8ad003) SHA1(4814385117599a98da02155785d1e3fce4e485bd) ) // Centos CI-8000/PP2000 ROM BIOS Version 1.06, 27C256B + + ROM_REGION(0x8000, "video_bios", 0 ) + ROM_LOAD("cl-gd5446_pci_vga_bios_version_1.31.u2", 0x0000, 0x8000, CRC(61f8cac7) SHA1(6e54aadfe10dfa5c7e417a054e9a64499a99083c) ) // Cirrus Logic/Quadtel CL-GD5446 PCI VGA BIOS v1.31 , AT27C256R + + DISK_REGION( "ide:0:hdd:image" ) + DISK_IMAGE( "photoplay2k1mtnl", 0, BAD_DUMP SHA1(cfa25ce036be9c2379a104a3b50d2aefd851ceeb) ) // Recreated from the CDs using a VM +ROM_END + +// BIOS not provided, might be different +ROM_START(photoply2k2be) + ROM_REGION(0x20000, "bios", 0) // Motherboard BIOS + ROM_LOAD("funworld_award_486e_w83787.bin", 0x000000, 0x20000, BAD_DUMP CRC(af7ff1d4) SHA1(72eeecf798a03817ce7ba4d65cd4128ed3ef7e68) ) // 486E 96/7/19 W83787 PLUG & PLAY BIOS, AT27C010 + + ROM_REGION(0x8000, "ex_bios", ROMREGION_ERASE00 ) // Multifunction board with a ESS AudioDrive chip + ROM_LOAD("enhanced_bios_centos.bin", 0x0000, 0x8000, CRC(ee8ad003) SHA1(4814385117599a98da02155785d1e3fce4e485bd) ) // Centos CI-8000/PP2000 ROM BIOS Version 1.06, 27C256B + + ROM_REGION(0x8000, "video_bios", 0 ) + ROM_LOAD("cl-gd5446_pci_vga_bios_version_1.31.u2", 0x0000, 0x8000, CRC(61f8cac7) SHA1(6e54aadfe10dfa5c7e417a054e9a64499a99083c) ) // Cirrus Logic/Quadtel CL-GD5446 PCI VGA BIOS v1.31 , AT27C256R + + DISK_REGION( "ide:0:hdd:image" ) + DISK_IMAGE( "photoplay2k2be", 0, BAD_DUMP SHA1(29719b5db60f4cc3787a3a9f6a5937226e282d46) ) // Recreated from the CDs using a VM +ROM_END + +// BIOS not provided, might be different ROM_START(photoply2k4) ROM_REGION(0x20000, "bios", 0) // Motherboard BIOS ROM_LOAD("funworld_award_486e_w83787_alt.bin", 0x000000, 0x20000, BAD_DUMP CRC(e96d1bbc) SHA1(64d0726c4e9ecee8fddf4cc39d92aecaa8184d5c) ) // 486E 96/7/19 W83787 PLUG & PLAY BIOS (same string as 'photoply99sp' and 'photoply99sp' BIOSes, but different hash) @@ -491,9 +604,14 @@ DISK_IMAGE( "pp2004", 0, SHA1(a3f8861cf91cf7e7446ec931f812e774ada20802) ) ROM_END -GAME( 1998, photoply98sp, 0, photoply, photoply, photoply_state, empty_init, ROT0, "Funworld", "Photo Play 1998 (Spanish)", MACHINE_NOT_WORKING|MACHINE_NO_SOUND|MACHINE_UNEMULATED_PROTECTION ) -GAME( 1999, photoply99sp, 0, photoply_dx4_100, photoply, photoply_state, empty_init, ROT0, "Funworld", "Photo Play 1999 (Spanish)", MACHINE_NOT_WORKING|MACHINE_NO_SOUND|MACHINE_UNEMULATED_PROTECTION ) -GAME( 2000, photoply2k, 0, photoply, photoply, photoply_state, empty_init, ROT0, "Funworld", "Photo Play 2000 (v2.01)", MACHINE_NOT_WORKING|MACHINE_NO_SOUND|MACHINE_UNEMULATED_PROTECTION ) -GAME( 2000, photoply2ksp, photoply2k, photoply_dx4_100, photoply, photoply_state, empty_init, ROT0, "Funworld", "Photo Play 2000 (Spanish)", MACHINE_NOT_WORKING|MACHINE_NO_SOUND|MACHINE_UNEMULATED_PROTECTION ) -GAME( 2001, photoply2k1it, 0, photoply_dx4_100, photoply, photoply_state, empty_init, ROT0, "Funworld", "Photo Play 2001 (Italian)", MACHINE_NOT_WORKING|MACHINE_NO_SOUND|MACHINE_UNEMULATED_PROTECTION ) -GAME( 2004, photoply2k4, 0, photoply, photoply, photoply_state, empty_init, ROT0, "Funworld", "Photo Play 2004", MACHINE_NOT_WORKING|MACHINE_NO_SOUND|MACHINE_UNEMULATED_PROTECTION ) +GAME( 1998, photoply98sp, 0, photoply, photoply, photoply_state, empty_init, ROT0, "Funworld", "Photo Play 1998 (Spain)", MACHINE_NOT_WORKING|MACHINE_NO_SOUND|MACHINE_UNEMULATED_PROTECTION ) +GAME( 1999, photoply99sp, 0, photoply_dx4_100, photoply, photoply_state, empty_init, ROT0, "Funworld", "Photo Play 1999 (Spain)", MACHINE_NOT_WORKING|MACHINE_NO_SOUND|MACHINE_UNEMULATED_PROTECTION ) +GAME( 1999, photoply99nl, photoply99sp, photoply_dx4_100, photoply, photoply_state, empty_init, ROT0, "Funworld", "Photo Play 1999 (Netherlands)", MACHINE_NOT_WORKING|MACHINE_NO_SOUND|MACHINE_UNEMULATED_PROTECTION ) +GAME( 2000, photoply2k, 0, photoply_dx4_100, photoply, photoply_state, empty_init, ROT0, "Funworld", "Photo Play 2000 (v2.01)", MACHINE_NOT_WORKING|MACHINE_NO_SOUND|MACHINE_UNEMULATED_PROTECTION ) +GAME( 2000, photoply2ksp, photoply2k, photoply_dx4_100, photoply, photoply_state, empty_init, ROT0, "Funworld", "Photo Play 2000 (Spain)", MACHINE_NOT_WORKING|MACHINE_NO_SOUND|MACHINE_UNEMULATED_PROTECTION ) +GAME( 2000, photoply2knl, photoply2k, photoply_dx4_100, photoply, photoply_state, empty_init, ROT0, "Funworld", "Photo Play 2000 (Netherlands)", MACHINE_NOT_WORKING|MACHINE_NO_SOUND|MACHINE_UNEMULATED_PROTECTION ) +GAME( 2001, photoply2k1it, 0, photoply_dx4_100, photoply, photoply_state, empty_init, ROT0, "Funworld", "Photo Play 2001 (Italy)", MACHINE_NOT_WORKING|MACHINE_NO_SOUND|MACHINE_UNEMULATED_PROTECTION ) +GAME( 2001, photoply2k1nl, photoply2k1it, photoply_dx4_100, photoply, photoply_state, empty_init, ROT0, "Funworld", "Photo Play 2001 (Netherlands)", MACHINE_NOT_WORKING|MACHINE_NO_SOUND|MACHINE_UNEMULATED_PROTECTION ) +GAME( 2001, photoply2k1mtnl, photoply2k1it, photoply_dx4_100, photoply, photoply_state, empty_init, ROT0, "Funworld", "Photo Play Masters 2001 (Netherlands)", MACHINE_NOT_WORKING|MACHINE_NO_SOUND|MACHINE_UNEMULATED_PROTECTION ) +GAME( 2002, photoply2k2be, 0, photoply_dx4_100, photoply, photoply_state, empty_init, ROT0, "Funworld", "Photo Play 2002 (Belgium)", MACHINE_NOT_WORKING|MACHINE_NO_SOUND|MACHINE_UNEMULATED_PROTECTION ) +GAME( 2004, photoply2k4, 0, photoply_dx4_100, photoply, photoply_state, empty_init, ROT0, "Funworld", "Photo Play 2004", MACHINE_NOT_WORKING|MACHINE_NO_SOUND|MACHINE_UNEMULATED_PROTECTION ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/pinball2k.cpp mame-0.243+dfsg.1/src/mame/drivers/pinball2k.cpp --- mame-0.242+dfsg.1/src/mame/drivers/pinball2k.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/pinball2k.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -25,6 +25,7 @@ TODO: - Everything! +- Save states - MediaGX features should be moved out to machine/ and shared with mediagx.c once we know what these games need ****************************************************************************************************************/ diff -Nru mame-0.242+dfsg.1/src/mame/drivers/pipbug.cpp mame-0.243+dfsg.1/src/mame/drivers/pipbug.cpp --- mame-0.242+dfsg.1/src/mame/drivers/pipbug.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/pipbug.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -77,7 +77,7 @@ void data_map(address_map &map); void mem_map(address_map &map); u8 m_cass_data[4]{}; - bool m_cassold = 0, m_cassinbit = 0; + bool m_cassold = false, m_cassinbit = false; }; void pipbug_state::pipbug_ctrl_w(u8 data) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/plan80.cpp mame-0.243+dfsg.1/src/mame/drivers/plan80.cpp --- mame-0.242+dfsg.1/src/mame/drivers/plan80.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/plan80.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -58,7 +58,7 @@ void io_map(address_map &map); void mem_map(address_map &map); u8 m_kbd_row = 0U; - bool m_spk_pol = 0; + bool m_spk_pol = false; virtual void machine_reset() override; virtual void machine_start() override; memory_passthrough_handler m_rom_shadow_tap; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/play_1.cpp mame-0.243+dfsg.1/src/mame/drivers/play_1.cpp --- mame-0.242+dfsg.1/src/mame/drivers/play_1.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/play_1.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -675,10 +675,10 @@ /* Big Town, Last Lap, Night Fever, Party and Third World all reportedly share the same roms with different playfield/machine artworks */ -GAME(1978, bigtown, 0, play_1, play_1, play_1_state, empty_init, ROT0, "Playmatic", "Big Town", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1978, lastlap, bigtown, play_1, play_1, play_1_state, empty_init, ROT0, "Playmatic", "Last Lap", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1979, party, bigtown, play_1, play_1, play_1_state, empty_init, ROT0, "Playmatic", "Party", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1979, ngtfever, bigtown, play_1, play_1, play_1_state, empty_init, ROT0, "Sonic", "Night Fever", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1978, thrdwrld, bigtown, play_1, play_1, play_1_state, empty_init, ROT0, "Sonic", "Third World", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1978, spcgambl, 0, play_1, spcgambl, play_1_state, empty_init, ROT0, "Playmatic", "Space Gambler", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1978, chance, 0, chance, chance, play_1_state, empty_init, ROT0, "Playmatic", "Chance", MACHINE_IS_SKELETON_MECHANICAL ) +GAME(1978, bigtown, 0, play_1, play_1, play_1_state, empty_init, ROT0, "Playmatic", "Big Town", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1978, lastlap, bigtown, play_1, play_1, play_1_state, empty_init, ROT0, "Playmatic", "Last Lap", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1979, party, bigtown, play_1, play_1, play_1_state, empty_init, ROT0, "Playmatic", "Party", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1979, ngtfever, bigtown, play_1, play_1, play_1_state, empty_init, ROT0, "Sonic", "Night Fever", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1978, thrdwrld, bigtown, play_1, play_1, play_1_state, empty_init, ROT0, "Sonic", "Third World", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1978, spcgambl, 0, play_1, spcgambl, play_1_state, empty_init, ROT0, "Playmatic", "Space Gambler", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1978, chance, 0, chance, chance, play_1_state, empty_init, ROT0, "Playmatic", "Chance", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/play_2.cpp mame-0.243+dfsg.1/src/mame/drivers/play_2.cpp --- mame-0.242+dfsg.1/src/mame/drivers/play_2.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/play_2.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -96,7 +96,7 @@ u8 m_resetcnt = 0U; u8 m_kbdrow = 0U; u8 m_segment[5]{}; - bool m_disp_sw = 0; + bool m_disp_sw = false; u8 m_port06 = 0U; u8 m_old_solenoids[8]{}; u8 m_soundlatch = 0U; @@ -631,12 +631,12 @@ } // Anonymous namespace -GAME(1979, antar, 0, play_2, play_2, play_2_state, empty_init, ROT0, "Playmatic", "Antar (set 1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1979, antar2, antar, play_2, play_2, play_2_state, empty_init, ROT0, "Playmatic", "Antar (set 2)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1979, storm, 0, play_2, play_2, play_2_state, empty_init, ROT0, "SegaSA / Sonic", "Storm", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1980, evlfight, 0, play_2, play_2, play_2_state, empty_init, ROT0, "Playmatic", "Evil Fight", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1980, attack, 0, play_2, play_2, play_2_state, empty_init, ROT0, "Playmatic", "Attack", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1980, blkfever, 0, play_2, play_2, play_2_state, empty_init, ROT0, "Playmatic", "Black Fever", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1982, cerberup, 0, play_2, play_2, play_2_state, empty_init, ROT0, "Playmatic", "Cerberus (Pinball)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1985, madrace, 0, play_2, play_2, play_2_state, empty_init, ROT0, "Playmatic", "Mad Race", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1980, zira, 0, zira, play_2, zira_state, init_zira, ROT0, "Playmatic", "Zira", MACHINE_IS_SKELETON_MECHANICAL ) +GAME(1979, antar, 0, play_2, play_2, play_2_state, empty_init, ROT0, "Playmatic", "Antar (set 1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1979, antar2, antar, play_2, play_2, play_2_state, empty_init, ROT0, "Playmatic", "Antar (set 2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1979, storm, 0, play_2, play_2, play_2_state, empty_init, ROT0, "SegaSA / Sonic", "Storm", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1980, evlfight, 0, play_2, play_2, play_2_state, empty_init, ROT0, "Playmatic", "Evil Fight", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1980, attack, 0, play_2, play_2, play_2_state, empty_init, ROT0, "Playmatic", "Attack", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1980, blkfever, 0, play_2, play_2, play_2_state, empty_init, ROT0, "Playmatic", "Black Fever", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1982, cerberup, 0, play_2, play_2, play_2_state, empty_init, ROT0, "Playmatic", "Cerberus (Pinball)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1985, madrace, 0, play_2, play_2, play_2_state, empty_init, ROT0, "Playmatic", "Mad Race", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1980, zira, 0, zira, play_2, zira_state, init_zira, ROT0, "Playmatic", "Zira", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/play_3.cpp mame-0.243+dfsg.1/src/mame/drivers/play_3.cpp --- mame-0.242+dfsg.1/src/mame/drivers/play_3.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/play_3.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -135,7 +135,7 @@ u16 m_a_irqcnt = 0U; u8 m_kbdrow = 0U; u8 m_segment[5]{}; - bool m_disp_sw = 0; + bool m_disp_sw = false; virtual void machine_reset() override; virtual void machine_start() override; required_device m_maincpu; @@ -865,26 +865,26 @@ } // anonymous namespace -GAME(1982, spain82, 0, play_3, spain82, play_3_state, empty_init, ROT0, "Playmatic", "Spain '82", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1983, megaaton, 0, megaaton, megaaton, play_3_state, empty_init, ROT0, "Playmatic", "Meg-Aaton", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1983, megaatona, megaaton, megaaton, megaaton, play_3_state, empty_init, ROT0, "Playmatic", "Meg-Aaton (alternate set)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1984, nautilus, 0, play_3, play_3, play_3_state, empty_init, ROT0, "Playmatic", "Nautilus", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1984, theraid, 0, play_3, play_3, play_3_state, empty_init, ROT0, "Playmatic", "The Raid", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1984, theraida, theraid, play_3, play_3, play_3_state, empty_init, ROT0, "Playmatic", "The Raid (alternate set)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1984, ufo_x, 0, play_3, play_3, play_3_state, empty_init, ROT0, "Playmatic", "UFO-X", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1984, kz26, 0, play_3, play_3, play_3_state, empty_init, ROT0, "Playmatic", "KZ-26", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1985, rock2500, 0, play_3, play_3, play_3_state, empty_init, ROT0, "Playmatic", "Rock 2500", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1985, starfirp, 0, play_3, play_3, play_3_state, empty_init, ROT0, "Playmatic", "Star Fire", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1985, starfirpa, starfirp, play_3, play_3, play_3_state, empty_init, ROT0, "Playmatic", "Star Fire (alternate set)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1985, trailer, 0, play_3, play_3, play_3_state, empty_init, ROT0, "Playmatic", "Trailer", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1986, fldragon, 0, play_3, play_3, play_3_state, empty_init, ROT0, "Playmatic", "Flash Dragon", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1986, fldragona, fldragon, play_3, play_3, play_3_state, empty_init, ROT0, "Playmatic", "Flash Dragon (alternate set)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1987, phntmshp, 0, sklflite, play_3, play_3_state, empty_init, ROT0, "Playmatic", "Phantom Ship", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1987, sklflite, 0, sklflite, play_3, play_3_state, empty_init, ROT0, "Playmatic", "Skill Flight (Playmatic)", MACHINE_IS_SKELETON_MECHANICAL ) +GAME(1982, spain82, 0, play_3, spain82, play_3_state, empty_init, ROT0, "Playmatic", "Spain '82", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1983, megaaton, 0, megaaton, megaaton, play_3_state, empty_init, ROT0, "Playmatic", "Meg-Aaton", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1983, megaatona, megaaton, megaaton, megaaton, play_3_state, empty_init, ROT0, "Playmatic", "Meg-Aaton (alternate set)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1984, nautilus, 0, play_3, play_3, play_3_state, empty_init, ROT0, "Playmatic", "Nautilus", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1984, theraid, 0, play_3, play_3, play_3_state, empty_init, ROT0, "Playmatic", "The Raid", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1984, theraida, theraid, play_3, play_3, play_3_state, empty_init, ROT0, "Playmatic", "The Raid (alternate set)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1984, ufo_x, 0, play_3, play_3, play_3_state, empty_init, ROT0, "Playmatic", "UFO-X", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1984, kz26, 0, play_3, play_3, play_3_state, empty_init, ROT0, "Playmatic", "KZ-26", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1985, rock2500, 0, play_3, play_3, play_3_state, empty_init, ROT0, "Playmatic", "Rock 2500", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1985, starfirp, 0, play_3, play_3, play_3_state, empty_init, ROT0, "Playmatic", "Star Fire", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1985, starfirpa, starfirp, play_3, play_3, play_3_state, empty_init, ROT0, "Playmatic", "Star Fire (alternate set)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1985, trailer, 0, play_3, play_3, play_3_state, empty_init, ROT0, "Playmatic", "Trailer", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1986, fldragon, 0, play_3, play_3, play_3_state, empty_init, ROT0, "Playmatic", "Flash Dragon", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1986, fldragona, fldragon, play_3, play_3, play_3_state, empty_init, ROT0, "Playmatic", "Flash Dragon (alternate set)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1987, phntmshp, 0, sklflite, play_3, play_3_state, empty_init, ROT0, "Playmatic", "Phantom Ship", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1987, sklflite, 0, sklflite, play_3, play_3_state, empty_init, ROT0, "Playmatic", "Skill Flight (Playmatic)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // not by Playmatic, but same hardware -GAME(1984, flashman, 0, flashman, play_3, play_3_state, empty_init, ROT0, "Sport Matic", "Flashman", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1986, ridersrf, 0, play_3, play_3, play_3_state, empty_init, ROT0, "JocMatic", "Rider's Surf", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1987, ironball, 0, play_3, play_3, play_3_state, empty_init, ROT0, "Stargame", "Iron Balls", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1987, terrlake, 0, terrlake, play_3, play_3_state, empty_init, ROT0, "Sport Matic", "Terrific Lake", MACHINE_IS_SKELETON_MECHANICAL ) +GAME(1984, flashman, 0, flashman, play_3, play_3_state, empty_init, ROT0, "Sport Matic", "Flashman", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1986, ridersrf, 0, play_3, play_3, play_3_state, empty_init, ROT0, "JocMatic", "Rider's Surf", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1987, ironball, 0, play_3, play_3, play_3_state, empty_init, ROT0, "Stargame", "Iron Balls", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1987, terrlake, 0, terrlake, play_3, play_3_state, empty_init, ROT0, "Sport Matic", "Terrific Lake", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // bingo hardware, to be split (?) -GAME(1983, msdisco, 0, play_3, play_3, play_3_state, empty_init, ROT0, "Playmatic", "Miss Disco (Bingo)", MACHINE_IS_SKELETON_MECHANICAL ) +GAME(1983, msdisco, 0, play_3, play_3, play_3_state, empty_init, ROT0, "Playmatic", "Miss Disco (Bingo)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/pmi80.cpp mame-0.243+dfsg.1/src/mame/drivers/pmi80.cpp --- mame-0.242+dfsg.1/src/mame/drivers/pmi80.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/pmi80.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -67,8 +67,8 @@ void mem_map(address_map &map); uint8_t m_keyrow = 0U; - bool m_ledready = 0; - bool m_cassbit = 0,m_cassold = 0; + bool m_ledready = false; + bool m_cassbit = false, m_cassold = false; u16 m_cass_cnt = 0U; virtual void machine_reset() override; virtual void machine_start() override; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/pofo.cpp mame-0.243+dfsg.1/src/mame/drivers/pofo.cpp --- mame-0.242+dfsg.1/src/mame/drivers/pofo.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/pofo.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -159,10 +159,10 @@ required_region_ptr m_char_rom; required_ioport m_battery; - uint8_t m_ip; - uint8_t m_ie; - uint16_t m_counter; - int m_rom_b; + uint8_t m_ip = 0; + uint8_t m_ie = 0; + uint16_t m_counter = 0; + int m_rom_b = 0; }; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/poisk1.cpp mame-0.243+dfsg.1/src/mame/drivers/poisk1.cpp --- mame-0.242+dfsg.1/src/mame/drivers/poisk1.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/poisk1.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -122,7 +122,7 @@ struct { uint8_t trap[4]{}; - std::unique_ptr videoram_base{}; + std::unique_ptr videoram_base; uint8_t *videoram = nullptr; uint8_t mode_control_6a = 0; uint8_t color_select_68 = 0; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/pokemini.cpp mame-0.243+dfsg.1/src/mame/drivers/pokemini.cpp --- mame-0.242+dfsg.1/src/mame/drivers/pokemini.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/pokemini.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -59,34 +59,34 @@ private: struct PRC { - uint8_t colors_inverted; - uint8_t background_enabled; - uint8_t sprites_enabled; - uint8_t copy_enabled; - uint8_t map_size; - uint8_t map_size_x; - uint8_t frame_count; - uint8_t max_frame_count; - uint32_t bg_tiles; - uint32_t spr_tiles; - uint8_t count; - emu_timer *count_timer; + uint8_t colors_inverted = 0; + uint8_t background_enabled = 0; + uint8_t sprites_enabled = 0; + uint8_t copy_enabled = 0; + uint8_t map_size = 0; + uint8_t map_size_x = 0; + uint8_t frame_count = 0; + uint8_t max_frame_count = 0; + uint32_t bg_tiles = 0; + uint32_t spr_tiles = 0; + uint8_t count = 0; + emu_timer *count_timer = nullptr; }; struct TIMERS { - emu_timer *seconds_timer; - emu_timer *hz256_timer; - emu_timer *timer1; // Timer 1 low or 16bit - emu_timer *timer1_hi; // Timer 1 hi - emu_timer *timer2; // Timer 2 low or 16bit - emu_timer *timer2_hi; // Timer 2 high - emu_timer *timer3; // Timer 3 low or 16bit - emu_timer *timer3_hi; // Timer 3 high + emu_timer *seconds_timer = nullptr; + emu_timer *hz256_timer = nullptr; + emu_timer *timer1 = nullptr; // Timer 1 low or 16bit + emu_timer *timer1_hi = nullptr; // Timer 1 hi + emu_timer *timer2 = nullptr; // Timer 2 low or 16bit + emu_timer *timer2_hi = nullptr; // Timer 2 high + emu_timer *timer3 = nullptr; // Timer 3 low or 16bit + emu_timer *timer3_hi = nullptr; // Timer 3 high }; - uint8_t m_pm_reg[0x100]; + uint8_t m_pm_reg[0x100]{}; PRC m_prc; TIMERS m_timers; bitmap_ind16 m_bitmap; @@ -119,7 +119,6 @@ void timer3_callback(); void timer3_hi_callback(); void prc_counter_callback(); - }; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/positron.cpp mame-0.243+dfsg.1/src/mame/drivers/positron.cpp --- mame-0.242+dfsg.1/src/mame/drivers/positron.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/positron.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -113,7 +113,7 @@ memory_passthrough_handler m_mmu_shadow_tap; - uint8_t m_prev_opcode; + uint8_t m_prev_opcode = 0; }; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/powerbal.cpp mame-0.243+dfsg.1/src/mame/drivers/powerbal.cpp --- mame-0.242+dfsg.1/src/mame/drivers/powerbal.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/powerbal.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -618,17 +618,6 @@ return 0; } -static const gfx_layout magicstk_charlayout = -{ - 8,8, - RGN_FRAC(1,4), - 4, - { RGN_FRAC(3,4), RGN_FRAC(2,4), RGN_FRAC(1,4), RGN_FRAC(0,4) }, - { 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 const gfx_layout tilelayout = { 16,16, @@ -646,7 +635,7 @@ static GFXDECODE_START( gfx_powerbal ) GFXDECODE_ENTRY( "gfx2", 0, tilelayout, 0x100, 16 ) // colors 0x100-0x1ff - GFXDECODE_ENTRY( "gfx1", 0, magicstk_charlayout, 0x000, 16 ) // colors 0x000-0x0ff + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x4_planar, 0x000, 16 ) // colors 0x000-0x0ff GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/powerins.cpp mame-0.243+dfsg.1/src/mame/drivers/powerins.cpp --- mame-0.242+dfsg.1/src/mame/drivers/powerins.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/powerins.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -234,9 +234,9 @@ GFXDECODE_END static GFXDECODE_START( gfx_powerinsc ) - GFXDECODE_ENTRY( "bgtile", 0x280000, gfx_8x8x4_packed_msb, 0x200, 0x10 ) // [1] Tiles - GFXDECODE_ENTRY( "bgtile", 0, gfx_8x8x4_col_2x2_group_packed_msb, 0x000, 0x20 ) // [0] Tiles - GFXDECODE_ENTRY( "sprites", 0, gfx_8x8x4_col_2x2_group_packed_msb, 0x400, 0x40 ) // [2] Sprites + GFXDECODE_ENTRY( "bgtile", 0x280000, gfx_8x8x4_packed_lsb, 0x200, 0x10 ) // [1] Tiles + GFXDECODE_ENTRY( "bgtile", 0, gfx_8x8x4_col_2x2_group_packed_lsb, 0x000, 0x20 ) // [0] Tiles + GFXDECODE_ENTRY( "sprites", 0, gfx_8x8x4_col_2x2_group_packed_lsb, 0x400, 0x40 ) // [2] Sprites, TODO: wrong decode and ROM loading GFXDECODE_END /*************************************************************************** @@ -250,17 +250,6 @@ m_okibank[0]->configure_entries(0, 5, memregion("oki1")->base() + 0x30000, 0x10000); } -void powerins_state::init_powerinsc() -{ - u8 *bgtile = memregion("bgtile")->base(); - - for (int i = 0; i < 0x300000; i++) - { - u8 x = bgtile[i]; - bgtile[i] = bitswap(x, 3, 2, 1, 0, 7, 6, 5, 4); - } -} - void powerins_state::powerins(machine_config &config) { /* basic machine hardware */ @@ -788,7 +777,7 @@ ROM_LOAD16_BYTE( "15.040.u81", 0x400001, 0x80000, CRC(035316d3) SHA1(c1c6f243213f05a53f0fc4f3df530895c34355a9) ) ROM_LOAD16_BYTE( "25.040.u94", 0x500000, 0x80000, CRC(a250dea8) SHA1(6b4c5ad35f4f4cdab516118a21c58617044c3208) ) ROM_LOAD16_BYTE( "14.040.u96", 0x500001, 0x80000, CRC(dd976689) SHA1(ba7e80a94e6c6bb7a5b569fb5440e774cd89b79d) ) - ROM_LOAD16_BYTE( "24.040.u95", 0x600000, 0x80000, CRC(dd976689) SHA1(ba7e80a94e6c6bb7a5b569fb5440e774cd89b79d) ) + ROM_LOAD16_BYTE( "24.040.u95", 0x600000, 0x80000, CRC(851008f4) SHA1(cd6e5d8e6807fc3224022ca53f02f390e1232b06) ) ROM_LOAD16_BYTE( "13.040.u89", 0x600001, 0x80000, CRC(867262d6) SHA1(bf0b13a5bb818741150d09be44968779c55c5b96) ) ROM_LOAD16_BYTE( "23.040.u96", 0x700000, 0x80000, CRC(625c5b7b) SHA1(ddac164cd92459bdce5905b31eccded9b1c06086) ) ROM_LOAD16_BYTE( "12.040.u92", 0x700001, 0x80000, CRC(08c4e478) SHA1(172dd9532a9240014afb4817b61a3e8122be8f0c) ) @@ -813,4 +802,4 @@ GAME( 1993, powerinspj, powerins, powerins, powerinj, powerins_state, empty_init, ROT0, "Atlus", "Gouketsuji Ichizoku (Japan, prototype)", MACHINE_SUPPORTS_SAVE ) // boots as 93.10.20 just like the other sets, but code is different GAME( 1993, powerinsa, powerins, powerinsa, powerins, powerins_state, empty_init, ROT0, "bootleg", "Power Instinct (USA, bootleg set 1)", MACHINE_SUPPORTS_SAVE ) GAME( 1993, powerinsb, powerins, powerinsb, powerins, powerins_state, empty_init, ROT0, "bootleg", "Power Instinct (USA, bootleg set 2)", MACHINE_SUPPORTS_SAVE ) -GAME( 1993, powerinsc, powerins, powerinsc, powerins, powerins_state, init_powerinsc, ROT0, "bootleg", "Power Instinct (USA, bootleg set 3)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // different sprites' format not implemented +GAME( 1993, powerinsc, powerins, powerinsc, powerins, powerins_state, empty_init, ROT0, "bootleg", "Power Instinct (USA, bootleg set 3)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // different sprites' format not implemented diff -Nru mame-0.242+dfsg.1/src/mame/drivers/proteus3.cpp mame-0.243+dfsg.1/src/mame/drivers/proteus3.cpp --- mame-0.242+dfsg.1/src/mame/drivers/proteus3.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/proteus3.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -116,7 +116,7 @@ u8 m_flashcnt = 0U; u16 m_curs_pos = 0U; u8 m_cass_data[4]{}; - bool m_cassbit = 0, m_cassold = 0, m_cassinbit = 0; + bool m_cassbit = false, m_cassold = false, m_cassinbit = false; std::unique_ptr m_vram; required_device m_maincpu; required_region_ptr m_p_chargen; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/proteus.cpp mame-0.243+dfsg.1/src/mame/drivers/proteus.cpp --- mame-0.242+dfsg.1/src/mame/drivers/proteus.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/proteus.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -111,7 +111,7 @@ required_device m_fdc; required_device m_floppy0; required_device m_floppy1; - floppy_image_device *m_floppy; + floppy_image_device *m_floppy = nullptr; }; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/ptcsol.cpp mame-0.243+dfsg.1/src/mame/drivers/ptcsol.cpp --- mame-0.242+dfsg.1/src/mame/drivers/ptcsol.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/ptcsol.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -172,14 +172,14 @@ struct cass_data_t { struct { - int length; /* time cassette level is at input.level */ - int level; /* cassette level */ - int bit; /* bit being read */ + int length = 0; /* time cassette level is at input.level */ + int level = 0; /* cassette level */ + int bit = 0; /* bit being read */ } input; struct { - int length; /* time cassette level is at output.level */ - int level; /* cassette level */ - int bit; /* bit to output */ + int length = 0; /* time cassette level is at output.level */ + int level = 0; /* cassette level */ + int bit = 0; /* bit to output */ } output; }; @@ -206,7 +206,7 @@ u8 m_sol20_fe = 0U; u8 m_framecnt = 0U; cass_data_t m_cass_data; - emu_timer *m_cassette_timer; + emu_timer *m_cassette_timer = nullptr; cassette_image_device *cassette_device_image(); memory_passthrough_handler m_rom_shadow_tap; required_device m_maincpu; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/pyl601.cpp mame-0.243+dfsg.1/src/mame/drivers/pyl601.cpp --- mame-0.242+dfsg.1/src/mame/drivers/pyl601.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/pyl601.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -2,23 +2,23 @@ // copyright-holders:Miodrag Milanovic, Robbbert /*************************************************************************** - Pyldin-601 +Pyldin-601 - 12/05/2009 Skeleton driver. - 22/04/2012 Added sound, fixed keyboard, marked as working [Robbbert] +2009-05-12 Skeleton driver. +2012-04-22 Added sound, fixed keyboard, marked as working [Robbbert] - ToDo? - - PYL601 - command 'MODE80' does nothing +ToDo? +- PYL601 - command 'MODE80' does nothing - - PYL601a - most software looks odd (unplayable) because of the - different design of the screen. - - PYL601A - command 'MODE40' doesn't go to 40-columns, instead - there is a space between each letter. +- PYL601a - most software looks odd (unplayable) because of the + different design of the screen. +- PYL601A - command 'MODE40' doesn't go to 40-columns, instead + there is a space between each letter. - The BASIC - - to get back to dos, enter SYSTEM - - It has its own internal monitor: MON to enter, Q to exit. +The BASIC +- to get back to dos, enter SYSTEM +- It has its own internal monitor: MON to enter, Q to exit. diff -Nru mame-0.242+dfsg.1/src/mame/drivers/qtsbc.cpp mame-0.243+dfsg.1/src/mame/drivers/qtsbc.cpp --- mame-0.242+dfsg.1/src/mame/drivers/qtsbc.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/qtsbc.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -112,7 +112,7 @@ required_ioport m_cpu_speed; required_region_ptr m_eprom; required_shared_ptr m_p_ram; - bool m_power_on; + bool m_power_on = false; bool m_rts; bool m_dtr; }; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/queen.cpp mame-0.243+dfsg.1/src/mame/drivers/queen.cpp --- mame-0.242+dfsg.1/src/mame/drivers/queen.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/queen.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -48,8 +48,8 @@ private: std::unique_ptr m_bios_ram; std::unique_ptr m_bios_ext_ram; - uint8_t m_mtxc_config_reg[256]; - uint8_t m_piix4_config_reg[4][256]; + uint8_t m_mtxc_config_reg[256]{}; + uint8_t m_piix4_config_reg[4][256]{}; void bios_ext_ram_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0); @@ -165,19 +165,18 @@ uint8_t queen_state::piix4_config_r(int function, int reg) { - if ((function >= 4) && (function <= 7)) - { - return 0; // BIOS performs a brute-force scan for devices - } - // osd_printf_debug("PIIX4: read %d, %02X\n", function, reg); - return m_piix4_config_reg[function][reg]; + if ((function < 4) && (reg < 256)) + return m_piix4_config_reg[function][reg]; + else + return 0; // BIOS performs a brute-force scan for devices } void queen_state::piix4_config_w(int function, int reg, uint8_t data) { // osd_printf_debug("%s:PIIX4: write %d, %02X, %02X\n", machine().describe_context(), function, reg, data); - m_piix4_config_reg[function][reg] = data; + if ((function < 4) && (reg < 256)) + m_piix4_config_reg[function][reg] = data; } uint32_t queen_state::intel82371ab_pci_r(int function, int reg, uint32_t mem_mask) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/qx10.cpp mame-0.243+dfsg.1/src/mame/drivers/qx10.cpp --- mame-0.242+dfsg.1/src/mame/drivers/qx10.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/qx10.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -612,7 +612,8 @@ { cnt = (cnt + 1) & 0xfff; } - if (BIT(cnt, 11) && !BIT(m_counter, 11)) { + if (BIT(cnt, 11) && !BIT(m_counter, 11)) + { update_fdd_motor(1); } diff -Nru mame-0.242+dfsg.1/src/mame/drivers/r2dtank.cpp mame-0.243+dfsg.1/src/mame/drivers/r2dtank.cpp --- mame-0.242+dfsg.1/src/mame/drivers/r2dtank.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/r2dtank.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -391,9 +391,9 @@ PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x00, DEF_STR( Bonus_Life ) ) - PORT_DIPSETTING( 0x08, DEF_STR( None ) ) + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Bonus_Life ) ) PORT_DIPSETTING( 0x00, "5000" ) + PORT_DIPSETTING( 0x08, "10000" ) PORT_DIPNAME( 0x10, 0x00, DEF_STR( Lives ) ) PORT_DIPSETTING( 0x00, "3" ) PORT_DIPSETTING( 0x10, "4" ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/r9751.cpp mame-0.243+dfsg.1/src/mame/drivers/r9751.cpp --- mame-0.242+dfsg.1/src/mame/drivers/r9751.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/r9751.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -16,7 +16,7 @@ * * 9005 * * The basis of this driver was influenced by the zexall.c driver by -* Jonathan Gevaryahu and Robbbert. +* Jonathan Gevaryahu. * * * Special Thanks to: diff -Nru mame-0.242+dfsg.1/src/mame/drivers/rabbit.cpp mame-0.243+dfsg.1/src/mame/drivers/rabbit.cpp --- mame-0.242+dfsg.1/src/mame/drivers/rabbit.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/rabbit.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -818,17 +818,6 @@ 16*64 }; -static const gfx_layout _8x8x4_layout = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { 0,1,2,3 }, - { 4,0,12,8,20,16,28,24 }, - { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 }, - 8*32 -}; - static const gfx_layout _16x16x4_layout = { 16,16, @@ -872,10 +861,10 @@ GFXDECODE_ENTRY( "gfx1", 0, sprite_16x16x8_layout, 0x0, 0x1000 ) // wrong /* this seems to be backgrounds and tilemap gfx */ - GFXDECODE_ENTRY( "gfx2", 0, _8x8x4_layout, 0x0, 0x1000 ) - GFXDECODE_ENTRY( "gfx2", 0, _16x16x4_layout, 0x0, 0x1000 ) - GFXDECODE_ENTRY( "gfx2", 0, _8x8x8_layout, 0x0, 0x1000 ) - GFXDECODE_ENTRY( "gfx2", 0, _16x16x8_layout, 0x0, 0x1000 ) + GFXDECODE_ENTRY( "gfx2", 0, gfx_8x8x4_packed_lsb, 0x0, 0x1000 ) + GFXDECODE_ENTRY( "gfx2", 0, _16x16x4_layout, 0x0, 0x1000 ) + GFXDECODE_ENTRY( "gfx2", 0, _8x8x8_layout, 0x0, 0x1000 ) + GFXDECODE_ENTRY( "gfx2", 0, _16x16x8_layout, 0x0, 0x1000 ) GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/raiden_ms.cpp mame-0.243+dfsg.1/src/mame/drivers/raiden_ms.cpp --- mame-0.242+dfsg.1/src/mame/drivers/raiden_ms.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/raiden_ms.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -539,7 +539,7 @@ PORT_DIPNAME( 0x0001, 0x0001, "Coin Mode" ) PORT_DIPLOCATION("SW1:1") PORT_DIPSETTING( 0x0001, "A" ) PORT_DIPSETTING( 0x0000, "B" ) - /* Coin Mode A */ + // Coin Mode A PORT_DIPNAME( 0x001e, 0x001e, DEF_STR( Coinage ) ) PORT_CONDITION("P2", 0x0001, EQUALS, 0x0001) PORT_DIPLOCATION("SW1:2,3,4,5") PORT_DIPSETTING( 0x0014, DEF_STR( 6C_1C ) ) PORT_DIPSETTING( 0x0016, DEF_STR( 5C_1C ) ) @@ -557,7 +557,7 @@ PORT_DIPSETTING( 0x000c, DEF_STR( 1C_5C ) ) PORT_DIPSETTING( 0x000a, DEF_STR( 1C_6C ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) ) - /* Coin Mode B */ + // Coin Mode B PORT_DIPNAME( 0x0006, 0x0006, DEF_STR( Coin_A ) ) PORT_CONDITION("P2", 0x0001, NOTEQUALS, 0x0001) PORT_DIPLOCATION("SW1:2,3") PORT_DIPSETTING( 0x0000, "5C/1C or Free if Coin B too" ) PORT_DIPSETTING( 0x0002, DEF_STR( 3C_1C ) ) @@ -652,7 +652,7 @@ void raiden_ms_state::raidenm(machine_config &config) { - /* basic machine hardware */ + // Basic machine hardware V30(config, m_maincpu, 20_MHz_XTAL / 2); // divisor unknown m_maincpu->set_addrmap(AS_PROGRAM, &raiden_ms_state::raidenm_map); @@ -662,7 +662,7 @@ Z80(config, m_audiocpu, XTAL(4'000'000)); m_audiocpu->set_addrmap(AS_PROGRAM, &raiden_ms_state::audio_map); - /* video hardware */ + // Video hardware SCREEN(config, m_screen, SCREEN_TYPE_RASTER); // all wrong m_screen->set_refresh_hz(60); m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500) /* not accurate */); @@ -679,7 +679,7 @@ GENERIC_LATCH_8(config, m_soundlatch[0]); GENERIC_LATCH_8(config, m_soundlatch[1]); - /* sound hardware */ + // Sound hardware SPEAKER(config, "mono").front_center(); YM2203(config, m_ym1, XTAL(4'000'000)/4); // unknown clock m_ym1->add_route(0, "mono", 0.15); @@ -739,7 +739,7 @@ ROM_LOAD( "msraid_1-5_rd101.ic12", 0x00000, 0x10000, CRC(2b76e371) SHA1(4c9732950f576e498d02fde485ba92fb293d5594) ) // dumper's note: ROMs [rd4b1, rd4b2, rb4b3, rd4b4] and [rd4a1, rd4a2, rb4a3, rd4a4] have a strange setup - // with pins 32, 31 and 31 soldered together and pin 2 connected between all four chips, while the sockets are for 28 pin chips + // with pins 32, 31 and 30 soldered together and pin 2 connected between all four chips, while the sockets are for 28 pin chips // (with 27C512 silkscreened on the PCB behind the chips) ROM_REGION( 0x80000, "gfx1", ROMREGION_INVERT ) // on one of the MOD 4/3 boards ROM_LOAD32_BYTE( "msraid_4-3-1_rd4b1.ic17", 0x00003, 0x20000, CRC(ff35b830) SHA1(fb552b2aa50aed12c3adb6ef9032a438adf6f37f) ) @@ -765,7 +765,7 @@ ROM_LOAD32_BYTE( "msraid_51-3_rd503.ic41", 0x00001, 0x20000, CRC(ae4001e9) SHA1(5f21a042cad1807d2ef5e7f4f2cfd86cadc0503b) ) ROM_LOAD32_BYTE( "msraid_51-3_rd504.ic40", 0x00000, 0x20000, CRC(0452eb10) SHA1(3b998da404bd7133d12aadcadd57ee21a0cfc226) ) - ROM_REGION( 0x0700, "proms", 0 ) /* PROMs (function unknown) */ + ROM_REGION( 0x0700, "proms", 0 ) // PROMs (function unknown) ROM_LOAD( "msraid_1-5_110_82s123.ic20", 0x0000, 0x0020, CRC(e26e680a) SHA1(9bbe30e98e952a6113c64e1171330153ddf22ce7) ) ROM_LOAD( "msraid_21-1_211_82s129.ic4", 0x0100, 0x0100, CRC(4f8c3e63) SHA1(0aa68fa1de6ca945027366a06752e834bbbc8d09) ) ROM_LOAD( "msraid_21-1_p0202_82s129.ic12", 0x0200, 0x0100, CRC(e434128a) SHA1(ef0f6d8daef8b25211095577a182cdf120a272c1) ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/rainbow.cpp mame-0.243+dfsg.1/src/mame/drivers/rainbow.cpp --- mame-0.242+dfsg.1/src/mame/drivers/rainbow.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/rainbow.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1199,20 +1199,17 @@ if (local_hard_disk) { - hard_disk_info *info; - if ((info = hard_disk_get_info(local_hard_disk))) - { - m_leds[0] = 1; + const auto &info = local_hard_disk->get_info(); + m_leds[0] = 1; - uint32_t max_sector = (info->cylinders) * (info->heads) * (info->sectors); - popmessage("DEC %u (%3.2f) MB HARD DISK MOUNTED.\nGEOMETRY: %d HEADS (1..%d ARE OK).\n%d CYLINDERS (151 to %d ARE OK).\n%d SECTORS / TRACK (up to %d ARE OK). \n%d BYTES / SECTOR (128 to 1024 ARE OK).\n", - max_sector * info->sectorbytes / 1000000, - (float)max_sector * (float)info->sectorbytes / 1048576.0f, - info->heads, RD51_MAX_HEAD, - info->cylinders, RD51_MAX_CYLINDER, - info->sectors, RD51_SECTORS_PER_TRACK, - info->sectorbytes); - } + uint32_t max_sector = (info.cylinders) * (info.heads) * (info.sectors); + popmessage("DEC %u (%3.2f) MB HARD DISK MOUNTED.\nGEOMETRY: %d HEADS (1..%d ARE OK).\n%d CYLINDERS (151 to %d ARE OK).\n%d SECTORS / TRACK (up to %d ARE OK). \n%d BYTES / SECTOR (128 to 1024 ARE OK).\n", + max_sector * info.sectorbytes / 1000000, + (float)max_sector * (float)info.sectorbytes / 1048576.0f, + info.heads, RD51_MAX_HEAD, + info.cylinders, RD51_MAX_CYLINDER, + info.sectors, RD51_SECTORS_PER_TRACK, + info.sectorbytes); } } @@ -1693,42 +1690,39 @@ return nullptr; hard_disk_file *file = img->get_hard_disk_file(); - hard_disk_info *info = hard_disk_get_info(file); + const auto &info = file->get_info(); // MFM ALLOWS UP TO 17 SECTORS / TRACK. // CYLINDERS: 151 (~ 5 MB) to 1024 (max. cylinders on WD1010 controller) - if (((info->sectors <= RD51_SECTORS_PER_TRACK)) && - ((info->heads >= 1) && (info->heads <= RD51_MAX_HEAD)) && // HEADS WITHIN 1...8 - ((info->cylinders > 150) && (info->cylinders <= RD51_MAX_CYLINDER))) + if (((info.sectors <= RD51_SECTORS_PER_TRACK)) && + ((info.heads >= 1) && (info.heads <= RD51_MAX_HEAD)) && // HEADS WITHIN 1...8 + ((info.cylinders > 150) && (info.cylinders <= RD51_MAX_CYLINDER))) { m_hdc_drive_ready = true; return file; // HAS SANE GEOMETRY } else { - uint32_t max_sector = info->cylinders * info->heads * info->sectors; + uint32_t max_sector = info.cylinders * info.heads * info.sectors; popmessage("DEC %u (%3.2f) MB HARD DISK REJECTED.\nGEOMETRY: %d HEADS (1..%d ARE OK).\n%d CYLINDERS (151 to %d ARE OK).\n%d SECTORS / TRACK (up to %d ARE OK). \n%d BYTES / SECTOR (128 to 1024 ARE OK).\n", - max_sector * info->sectorbytes / 1000000, - (float)max_sector * (float)info->sectorbytes / 1048576.0f, - info->heads, RD51_MAX_HEAD, - info->cylinders, RD51_MAX_CYLINDER, - info->sectors, RD51_SECTORS_PER_TRACK, - info->sectorbytes); + max_sector * info.sectorbytes / 1000000, + (float)max_sector * (float)info.sectorbytes / 1048576.0f, + info.heads, RD51_MAX_HEAD, + info.cylinders, RD51_MAX_CYLINDER, + info.sectors, RD51_SECTORS_PER_TRACK, + info.sectorbytes); logerror("<<< === HARD DISK IMAGE REJECTED = (invalid geometry) === >>>\n"); return nullptr; } } // LBA sector from CHS -static uint32_t get_and_print_lbasector(device_t *device, hard_disk_info *info, uint16_t cylinder, uint8_t head, uint8_t sector_number) +static uint32_t get_and_print_lbasector(device_t *device, const hard_disk_file::info &info, uint16_t cylinder, uint8_t head, uint8_t sector_number) { - if (info == nullptr) - return 0; - // LBA_ADDRESS = (C * HEADS + H) * NUMBER_SECTORS + (S - 1) - uint32_t lbasector = (double)cylinder * info->heads; // LBA : ( x 4 ) + uint32_t lbasector = (double)cylinder * info.heads; // LBA : ( x 4 ) lbasector += head; - lbasector *= info->sectors; // LBA : ( x 16 ) + lbasector *= info.sectors; // LBA : ( x 16 ) lbasector += (sector_number - 1); // + (sector number - 1) // device->logerror(" CYLINDER %u - HEAD %u - SECTOR NUMBER %u (LBA-SECTOR %u) ", cylinder, head, sector_number, lbasector); @@ -1756,30 +1750,26 @@ uint16_t cylinder = (m_hdc->read(0x04)) | (hi << 8); uint8_t sector_number = m_hdc->read(0x03); - hard_disk_file *local_hard_disk; - local_hard_disk = rainbow_hdc_file(0); // one hard disk for now. + hard_disk_file *local_hard_disk = rainbow_hdc_file(0); // one hard disk for now. if (local_hard_disk) { read_status = 3; - hard_disk_info *info; - if ((info = hard_disk_get_info(local_hard_disk))) - { - read_status = 4; - m_leds[0] = 1; + const auto &info = local_hard_disk->get_info(); + read_status = 4; + m_leds[0] = 1; - // Pointer to info + C + H + S - uint32_t lbasector = get_and_print_lbasector(this, info, cylinder, sdh & 0x07, sector_number); + // Pointer to info + C + H + S + uint32_t lbasector = get_and_print_lbasector(this, info, cylinder, sdh & 0x07, sector_number); - if ((cylinder <= info->cylinders) && // filter invalid ranges - (SECTOR_SIZES[(sdh >> 5) & 0x03] == info->sectorbytes) // may not vary in image! - ) - { - read_status = 5; - if (hard_disk_read(local_hard_disk, lbasector, m_hdc_buffer)) // accepts LBA sector (uint32_t) ! - read_status = 0; // logerror("...success!\n"); - } + if ((cylinder <= info.cylinders) && // filter invalid ranges + (SECTOR_SIZES[(sdh >> 5) & 0x03] == info.sectorbytes) // may not vary in image! + ) + { + read_status = 5; + if (local_hard_disk->read(lbasector, m_hdc_buffer)) // accepts LBA sector (uint32_t) ! + read_status = 0; // logerror("...success!\n"); } m_hdc_buf_offset = 0; m_hdc->buffer_ready(true); @@ -1862,40 +1852,37 @@ if (local_hard_disk) { - hard_disk_info *info = hard_disk_get_info(local_hard_disk); - if (info) - { - feedback = 10; - m_leds[0] = 1; // OFF + const auto &info = local_hard_disk->get_info(); + feedback = 10; + m_leds[0] = 1; // OFF - uint8_t sdh = (m_hdc->read(0x06)); + uint8_t sdh = (m_hdc->read(0x06)); - int hi = (m_hdc->read(0x05)) & 0x07; - uint16_t cylinder = (m_hdc->read(0x04)) | (hi << 8); + int hi = (m_hdc->read(0x05)) & 0x07; + uint16_t cylinder = (m_hdc->read(0x04)) | (hi << 8); - int sector_number = m_hdc->read(0x03); - int sector_count = m_hdc->read(0x02); // (1 = single sector) + int sector_number = m_hdc->read(0x03); + int sector_count = m_hdc->read(0x02); // (1 = single sector) - if (!(cylinder <= info->cylinders && // filter invalid cylinders - SECTOR_SIZES[(sdh >> 5) & 0x03] == info->sectorbytes // 512, may not vary - )) - { - logerror("...*** SANITY CHECK FAILED (CYLINDER %u vs. info->cylinders %u - - SECTOR_SIZE %u vs. info->sectorbytes %u) ***\n", - cylinder, info->cylinders, SECTOR_SIZES[(sdh >> 5) & 0x03], info->sectorbytes); - return 50; - } - // Pointer to info + C + H + S - uint32_t lbasector = get_and_print_lbasector(this, info, cylinder, sdh & 0x07, sector_number); + if (!(cylinder <= info.cylinders && // filter invalid cylinders + SECTOR_SIZES[(sdh >> 5) & 0x03] == info.sectorbytes // 512, may not vary + )) + { + logerror("...*** SANITY CHECK FAILED (CYLINDER %u vs. info.cylinders %u - - SECTOR_SIZE %u vs. info.sectorbytes %u) ***\n", + cylinder, info.cylinders, SECTOR_SIZES[(sdh >> 5) & 0x03], info.sectorbytes); + return 50; + } + // Pointer to info + C + H + S + uint32_t lbasector = get_and_print_lbasector(this, info, cylinder, sdh & 0x07, sector_number); - if (sector_count != 1) // ignore all SECTOR_COUNTS != 1 - return 88; // logerror(" - ** IGNORED (SECTOR_COUNT !=1) **\n"); + if (sector_count != 1) // ignore all SECTOR_COUNTS != 1 + return 88; // logerror(" - ** IGNORED (SECTOR_COUNT !=1) **\n"); - if (hard_disk_write(local_hard_disk, lbasector, m_hdc_buffer)) // accepts LBA sector (uint32_t) ! - feedback = 99; // success - else - logerror("...FAILURE **** \n"); + if (local_hard_disk->write(lbasector, m_hdc_buffer)) // accepts LBA sector (uint32_t) ! + feedback = 99; // success + else + logerror("...FAILURE **** \n"); - } // IF 'info' not nullptr } // IF hard disk present return feedback; } diff -Nru mame-0.242+dfsg.1/src/mame/drivers/rastersp.cpp mame-0.243+dfsg.1/src/mame/drivers/rastersp.cpp --- mame-0.242+dfsg.1/src/mame/drivers/rastersp.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/rastersp.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -8,21 +8,26 @@ Games supported: * Rise of the Robots (prototype) + * Football Crazy ROMs wanted: * Zool (prototype) - * Football Crazy (need HDD/CD image) + * Wiggle ****************************************************************************/ #include "emu.h" +#include "bus/nscsi/cd.h" #include "bus/nscsi/hd.h" #include "cpu/i386/i386.h" #include "cpu/tms32031/tms32031.h" #include "machine/53c7xx.h" +#include "machine/bacta_datalogger.h" #include "machine/mc146818.h" #include "machine/nvram.h" #include "machine/timer.h" +#include "machine/watchdog.h" +#include "machine/z80scc.h" #include "sound/dac.h" #include "emupal.h" #include "screen.h" @@ -54,17 +59,49 @@ : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") , m_dsp(*this, "dsp") + , m_duart(*this, "duart") , m_dram(*this, "dram") , m_ldac(*this, "ldac") , m_rdac(*this, "rdac") , m_palette(*this, "palette") , m_nvram(*this, "nvram") + , m_watchdog(*this, "watchdog") , m_tms_timer1(nullptr) , m_tms_tx_timer(nullptr) { } void rastersp(machine_config &config); + void rs_config_base(machine_config &config); + +protected: + virtual void machine_reset() override; + virtual void machine_start() override; + virtual void video_start() override; + + uint8_t interrupt_ctrl_r(offs_t offset); + void interrupt_ctrl_w(offs_t offset, uint8_t data); + uint8_t nvram_r(offs_t offset); + void nvram_w(offs_t offset, uint8_t data); + + void cpu_map_base(address_map &map); + void io_map(address_map &map); + void dsp_map_base(address_map &map); + + required_device m_maincpu; + required_device m_dsp; + required_device m_duart; + + void update_irq(uint32_t which, uint32_t state); + + enum irq_status + { + IRQ_RTC = 1, + IRQ_UART = 2, + IRQ_SCSI = 3, + IRQ_DSP = 4, + IRQ_VBLANK = 5, + }; private: #define VIDEO_ADDR_MASK 0x3fffffff @@ -94,29 +131,17 @@ SPORT_DATA_RX = 0x4c }; - enum irq_status - { - IRQ_RTC = 1, - IRQ_UART = 2, - IRQ_DSP = 4, - IRQ_VBLANK = 5, - IRQ_SCSI = 7 - }; - - required_device m_maincpu; - required_device m_dsp; required_shared_ptr m_dram; required_device m_ldac; required_device m_rdac; required_device m_palette; required_device m_nvram; + required_device m_watchdog; emu_timer *m_tms_timer1; emu_timer *m_tms_tx_timer; void cyrix_cache_w(uint32_t data); - uint8_t nvram_r(offs_t offset); - void nvram_w(offs_t offset, uint8_t data); void port1_w(uint32_t data); void port2_w(uint32_t data); void port3_w(uint32_t data); @@ -135,31 +160,77 @@ TIMER_CALLBACK_MEMBER(tms_timer1); TIMER_CALLBACK_MEMBER(tms_tx_timer); DECLARE_WRITE_LINE_MEMBER(vblank_irq); - - std::unique_ptr m_nvram8; - uint8_t m_irq_status = 0; - uint32_t m_dpyaddr = 0; - std::unique_ptr m_paletteram; - uint32_t m_speedup_count = 0; - uint32_t m_tms_io_regs[0x80]{}; - bitmap_ind16 m_update_bitmap; + DECLARE_WRITE_LINE_MEMBER(duart_irq); uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void update_irq(uint32_t which, uint32_t state); void upload_palette(uint32_t word1, uint32_t word2); IRQ_CALLBACK_MEMBER(irq_callback); nscsi_connector &add_rastersp_scsi_slot(machine_config &config, const char *tag, const char *default_slot); static void ncr53c700_config(device_t *device); void cpu_map(address_map &map); void dsp_map(address_map &map); - void io_map(address_map &map); + uint8_t interrupt_status_r(offs_t offset); + + std::unique_ptr m_nvram8; + uint8_t m_irq_status = 0; + uint32_t m_dlba = 0; + std::unique_ptr m_paletteram; + uint8_t m_palette_number = 0; + uint32_t m_speedup_count = 0; + uint32_t m_tms_io_regs[0x80]{}; + bitmap_ind16 m_update_bitmap; + + uint8_t m_port2_data = 0; + uint32_t m_last_watchdog = 0; + int m_left_volume = 0; + int m_right_volume = 0; + uint8_t m_interrupt_mask = 0; + uint8_t m_dsp_ctrl_data = 0; +}; + +class fbcrazy_state : public rastersp_state +{ +public: + fbcrazy_state(const machine_config &mconfig, device_type type, const char *tag) + : rastersp_state(mconfig, type, tag) + , m_io_track_x(*this, "TRACK_X") + , m_io_track_y(*this, "TRACK_Y") + , m_trackball_timer(nullptr) + { + } - // driver_device overrides + void fbcrazy(machine_config &config); + + DECLARE_READ_LINE_MEMBER(meter_pulse_r); + +protected: virtual void machine_reset() override; virtual void machine_start() override; - virtual void video_start() override; -}; +private: + required_ioport m_io_track_x; + required_ioport m_io_track_y; + emu_timer *m_trackball_timer; + + void aux_port0_w(offs_t offset, uint8_t data); + void aux_port1_w(offs_t offset, uint8_t data); + void aux_port2_w(offs_t offset, uint8_t data); + void aux_port3_w(offs_t offset, uint8_t data); + void aux_port4_w(offs_t offset, uint8_t data); + + void cpu_map(address_map &map); + void dsp_map(address_map &map); + + TIMER_CALLBACK_MEMBER(trackball_timer); + DECLARE_WRITE_LINE_MEMBER(trackball_rts); + + uint8_t m_aux_port3_data; + uint8_t m_trackball_ctr; + uint8_t m_trackball_data[3]; + uint16_t m_oldxpos; + uint16_t m_oldypos; + uint8_t m_trackball_enabled; +}; /************************************* @@ -176,7 +247,7 @@ membank("bank1")->set_base(m_dram); membank("bank2")->set_base(&m_dram[0x10000/4]); - membank("bank3")->set_base(&m_dram[0x300000/4]); + //membank("bank3")->set_base(&m_dram[0x300000/4]); if (!m_tms_timer1) m_tms_timer1 = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(rastersp_state::tms_timer1), this)); @@ -188,13 +259,49 @@ m_dsp->space(AS_PROGRAM).install_read_handler(0x809923, 0x809923, read32smo_delegate(*this, FUNC(rastersp_state::dsp_speedup_r))); m_dsp->space(AS_PROGRAM).install_write_handler(0x809923, 0x809923, write32smo_delegate(*this, FUNC(rastersp_state::dsp_speedup_w))); #endif -} + save_item(NAME(m_irq_status)); + save_item(NAME(m_dlba)); + save_pointer(NAME(m_paletteram), 0x8000); + save_item(NAME(m_palette_number)); + save_item(NAME(m_speedup_count)); + save_item(NAME(m_tms_io_regs)); + save_item(NAME(m_port2_data)); + save_item(NAME(m_last_watchdog)); + save_item(NAME(m_left_volume)); + save_item(NAME(m_right_volume)); + save_item(NAME(m_interrupt_mask)); + save_item(NAME(m_dsp_ctrl_data)); +} + +void fbcrazy_state::machine_start() +{ + rastersp_state::machine_start(); + + m_trackball_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(fbcrazy_state::trackball_timer), this)); + + save_item(NAME(m_aux_port3_data)); + save_item(NAME(m_trackball_ctr)); + save_item(NAME(m_trackball_data)); + save_item(NAME(m_oldxpos)); + save_item(NAME(m_oldypos)); + save_item(NAME(m_trackball_enabled)); +} void rastersp_state::machine_reset() { m_irq_status = 0; - m_dpyaddr = 0; + m_dlba = 0; + m_palette_number = 0; + + m_last_watchdog = 0; + m_port2_data = 0; + m_left_volume = 0; + m_right_volume = 0; + m_interrupt_mask = 0; + + m_dsp_ctrl_data = 0; + // Halt the 486 on reset - the DSP will release it from reset m_maincpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); @@ -210,6 +317,23 @@ m_tms_tx_timer->adjust(attotime::never); } +void fbcrazy_state::machine_reset() +{ + attotime period; + + rastersp_state::machine_reset(); + + m_aux_port3_data = 0; + + m_trackball_ctr = 0; + m_trackball_data[0] = m_trackball_data[1] = m_trackball_data[2] = 0; + m_oldxpos = 0; + m_oldypos = 0; + m_trackball_enabled = 0; + + period = attotime::from_hz(1200); // 1200 baud + m_trackball_timer->adjust(period, 0, period); +} /************************************* @@ -226,50 +350,57 @@ void rastersp_state::dpylist_w(uint32_t data) { - m_dpyaddr = data; + uint32_t word1 = 0; + m_dlba = data; // Update the video now // TODO: This should probably be done in sync with the video scan - if (m_dpyaddr == 0) + if (!BIT(m_dlba, 7)) { m_update_bitmap.fill(m_palette->black_pen()); return; } - uint32_t dpladdr = (m_dpyaddr & ~0xff) >> 6; - - if ((m_dpyaddr & 0xff) != 0xb2 && (m_dpyaddr & 0xff) != 0xf2) - logerror("Unusual display list data: %x\n", m_dpyaddr); + uint32_t dpladdr = (m_dlba & ~0xff) >> 6; int y = 0; int x = 0; uint16_t *bmpptr = &m_update_bitmap.pix(0, 0); + // Note that you can have a control word (top bit setp) without an address if the control word doesn't need data + // You can also have a single address word which is used by multiple control words. while (y < 240) { - uint32_t word1 = m_dram[dpladdr/4]; + uint32_t word2 = m_dram[dpladdr/4]; + dpladdr += 4; - if (word1 & 0x80000000) + if (!(word2 & 0x80000000)) { - // TODO: What does this signify? - dpladdr += 4; + // Not a control word so it's the data address + word1 = word2; } else { - uint32_t word2 = m_dram[(dpladdr + 4)/4]; - - dpladdr += 8; - - if (word2 & 0x10000000) + // You're allowed to change the palette for 8 bit pixels even if the + // control word is for 16 bit pixels! + if (word2 & 0x40000000) + { + m_palette_number &= 0x0f; + m_palette_number |= ((word2 >> 8) & 0xf0); + } + else { - if ((word2 & 0xfe000000) != 0x94000000) - logerror("Unusual display list entry: %x %x\n", word1, word2); + m_palette_number &= 0xf0; + m_palette_number |= ((word2 >> 12) & 0x0f); + } + if ((word2 & 0xbe000000) == 0x94000000) + { + // 8 bit pixels using palette uint32_t srcaddr = word1 >> 8; uint32_t pixels = (word2 >> 16) & 0x1ff; - uint32_t palbase = (word2 >> 4) & 0xf00; - uint16_t* palptr = &m_paletteram[palbase]; + uint16_t* palptr = &m_paletteram[m_palette_number*256]; uint8_t* srcptr = reinterpret_cast(&m_dram[0]); uint32_t acc = srcaddr << 8; @@ -279,7 +410,6 @@ // Sign extend for our convenience incr |= ~((incr & 0x800) - 1) & ~0xff; - // TODO: Assumes 8-bit palettized mode - the hardware also supports 16-bit direct while (y < 240 && pixels) { while (x < 320 && pixels) @@ -299,13 +429,48 @@ } } } - else + else if ((word2 & 0xbe000000) == 0x84000000) { - if ((word2 & 0x0c000000) != 0x0c000000) - logerror("Unknown palette upload: %.8x %.8x\n", word1, word2); + // 16-bit pixels + uint32_t srcaddr = word1 >> 8; + uint32_t pixels = (word2 >> 16) & 0x1ff; + uint16_t* srcptr = reinterpret_cast(&m_dram[0]); + + uint32_t acc = srcaddr << 8; + + int32_t incr = word2 & 0xfff; + + // Sign extend for our convenience + incr |= ~((incr & 0x800) - 1) & ~0xff; + + while (y < 240 && pixels) + { + while (x < 320 && pixels) + { + *bmpptr++ = srcptr[WORD_XOR_LE(acc >> 9)]; + acc = (acc + incr) & VIDEO_ADDR_MASK; + + --pixels; + ++x; + } + + // Advance to the next scanline + if (x >= 320) + { + x = 0; + ++y; + } + } + } + else if ((word2 & 0xbe000000) == 0x8c000000) + { upload_palette(word1, word2); } + else + { + fatalerror("Unknown control words! (%x, %x)\n", word1, word2); + } } } } @@ -313,19 +478,24 @@ void rastersp_state::upload_palette(uint32_t word1, uint32_t word2) { + /* + Palette entry format: + ........ ........ ........ ...xxxxx - Blue + ........ ........ .....xxx xxx..... - Green + ........ ........ xxxxx... ........ - Red + .......x xxxxxxxx ........ ........ - Entry number + */ if (word1 & 3) fatalerror("Unalligned palette address! (%x, %x)\n", word1, word2); uint32_t addr = word1 >> 8; uint32_t entries = (word2 >> 16) & 0x1ff; - uint32_t index = ((word2 >> 12) & 0x1f) * 256; + uint32_t index = m_palette_number * 256; - // The third byte of each entry in RAM appears to contain an index - // but appears to be discared when written to palette RAM while (entries--) { uint32_t data = m_dram[addr / 4]; - m_paletteram[index++] = data & 0xffff; + m_paletteram[index + ((data >> 16) & 0xff)] = data & 0xffff; addr += 4; } } @@ -333,40 +503,44 @@ /******************************************************************************* - Display list register: + Display pointer word: - ..xxxxxx xxxxxxxx xxxxxxxx ........ Display list base (DWORD granularity) - ........ ........ ........ xxxxxxxx ? (number of entries? Only seems to be valid for basic stuff) - - Display list format: - -[0] ..xxxxxx xxxxxxxx xxxxxxxx ........ Source address (4MB mask?) - -Palette update: (8d000400) -[1] 1....... ........ ........ ........ ? - ...0.... ........ ........ ........ 0 for palette upload? - ....11.. ........ ........ ........ ? + xxxxxxxx xxxxxxxx xxxxxxxx ........ DLBA pointer (DWORD aligned) + ........ ........ ........ x....... Display enable + ........ ........ ........ ......xx Mode: + 00: 384x288 50Hz overscan + 01: 320x240 64Hz overscan + 02: 320x240 50Hz underscan + 03: invalid + + Control words: + + Set address + 0.xxxxxx xxxxxxxx xxxxxxxx xxxxxxxx Address + + Palette update: + 1P0..... ........ ........ ........ P specifies whether palette entry is the bottom (when 0) or top (when 1) 4 bits of palette number + ...01... ........ ........ ........ Palette upload + .....10. ........ ........ ........ X address only .......x xxxxxxxx ........ ........ Entry count - ........ ........ .....1.. ........ ? (Usually 1) + ........ ........ xxxx.... ........ Palette (top 4 bits if 'P' is 1 or bottom 4 bits if 'P' is 0 + ........ ........ ....xxxx xxxxxxxx Scale (4.8 signed fixed point) -Pixel data: (94040100) -[2] 1....... ........ ........ ........ ? - ...1.... ........ ........ ........ 1 for video update? - .....1.. ........ ........ ........ ? + Pixel data, 8-bit palettized: + 1P0..... ........ ........ ........ P specifies whether palette entry is the bottom (when 0) or top (when 1) 4 bits of palette number + ...10... ........ ........ ........ 8 bit pixels with palette + .....10. ........ ........ ........ X address only .......x xxxxxxxx ........ ........ Pixel count - ........ ........ xxxx.... ........ Palette + ........ ........ xxxx.... ........ Palette (top 4 bits if 'P' is 1 or bottom 4 bits if 'P' is 0) ........ ........ ....xxxx xxxxxxxx Scale (4.8 signed fixed point) -Unknown: (D4000100) - Present at start of a list -[3] 1....... ........ ........ ......... - .1...... ........ ........ ......... ? - ..1..... ........ ........ ......... - .....1.. ........ ........ ......... ? - ........ ........ .......1 ......... ? - - - TODO: I'm not sure about bit 28. When creating the display list if it's 0, - 0x1000 is added to the source address. + Pixel data, 16-bit: + 1P0..... ........ ........ ........ P specifies whether palette entry is the bottom (when 0) or top (when 1) 4 bits of palette number + ...00... ........ ........ ........ 8 bit pixels with palette + .....10. ........ ........ ........ X address only + .......x xxxxxxxx ........ ........ Pixel count + ........ ........ xxxx.... ........ Unused + ........ ........ ....xxxx xxxxxxxx Scale (4.8 signed fixed point) *******************************************************************************/ @@ -388,7 +562,11 @@ { uint8_t vector = 0; - if (m_irq_status & (1 << IRQ_SCSI)) + if (m_irq_status & (1 << IRQ_UART)) + { + vector = 10; + } + else if (m_irq_status & (1 << IRQ_SCSI)) { vector = 11; } @@ -427,6 +605,12 @@ WRITE_LINE_MEMBER( rastersp_state::scsi_irq ) { update_irq(IRQ_SCSI, state); + + if (state && BIT(m_dsp_ctrl_data, 5)) + { + m_dsp->set_input_line(TMS3203X_IRQ0, ASSERT_LINE); + m_dsp->set_input_line(TMS3203X_IRQ0, CLEAR_LINE); + } } @@ -436,7 +620,121 @@ update_irq(IRQ_VBLANK, ASSERT_LINE); } +WRITE_LINE_MEMBER( rastersp_state::duart_irq ) +{ + update_irq(IRQ_UART, state); +} + + +WRITE_LINE_MEMBER( fbcrazy_state::trackball_rts ) +{ + m_trackball_enabled = state; +} +/* + Mimic trackball unit. This uses a small PIC based interface board + which converts the trackball movement into RS232 data. + The data format is as follows: + Byte 0 : 0100abAB bits 7 & 6 = 01 signifies 1st byte + Byte 1 : 00CDEFGH bits 7 & 6 = 00 signifies 2 or 3rd byte (not identified) + Byte 2 : 00cdefgh + + The trackball X movement is ABCDEFGH and Y movement abcdefgh + We do not have a PCB nor a dump of the PIC :( +*/ +TIMER_CALLBACK_MEMBER(fbcrazy_state::trackball_timer) +{ + if (m_trackball_enabled) + { + if (m_trackball_ctr == 0) + { + uint16_t newxpos, newypos; + + newxpos = m_io_track_x->read(); + newypos = m_io_track_y->read(); + + int diffx, diffy; + diffx = newxpos - m_oldxpos; + diffy = newypos - m_oldypos; + + if (diffx<-3900) + { + diffx += 4096; + } + else if (diffx>3900) + { + diffx -= 4096; + } + if (diffx>127) + { + diffx = 127; + } + else if (diffx <-127) + { + diffx = -127; + } + + if (diffy<-3900) + { + diffy += 4096; + } + else if (diffy>3900) + { + diffy -= 4096; + } + if (diffy>127) + { + diffy = 127; + } + else if (diffy <-127) + { + diffy = -127; + } + + m_oldxpos = newxpos; + m_oldypos = newypos; + + //Format movement into 3 bytes as described above for tx + m_trackball_data[0] = 0x40 | ((diffy>>4)&0x0c) | ((diffx>>6)&0x03); + m_trackball_data[1] = diffx & 0x3f; + m_trackball_data[2] = diffy & 0x3f; + } + + if (m_trackball_ctr < 36) + { + //Transmitting data + uint8_t bitnum = m_trackball_ctr % 12 ; + if (bitnum == 0) + { + //start bit + m_duart->rxb_w(0); + } + else if (bitnum < 9) + { + //Data bits + m_duart->rxb_w(BIT(m_trackball_data[m_trackball_ctr / 12], bitnum - 1)); + } + else + { + //Stop bit and small gap + m_duart->rxb_w(1); + } + m_trackball_ctr++; + } + else + { + m_trackball_ctr = 0; + } + } + else + { + m_trackball_ctr = 0; + m_trackball_data[0] = 0; + m_trackball_data[1] = 0; + m_trackball_data[2] = 0; + m_duart->rxb_w(1); + } +} /************************************* * @@ -446,24 +744,65 @@ void rastersp_state::port1_w(uint32_t data) { - // x... .... - LED? - // ..x. .... - DSP IRQ2 line - // .... ..xx - LEDs? - - if (data & 0x20) + /* + x... .... - Watchdog kick + ..x. .... - DSP IRQ2 line + .... x... - Coin lockout A on ROTR and payout on Football Crazy + .... .x.. - Coin lockout B + .... ..x. - Coin meter A + .... ...x - Coin meter B + */ + if (BIT(data, 5) && BIT(m_dsp_ctrl_data, 5)) { m_dsp->set_input_line(TMS3203X_IRQ2, ASSERT_LINE); m_dsp->set_input_line(TMS3203X_IRQ2, CLEAR_LINE); } + + if (BIT(data, 7) != m_last_watchdog) + { + m_last_watchdog = BIT(data, 7); + + if (BIT(data, 7)) + m_watchdog->watchdog_reset(); + } } void rastersp_state::port2_w(uint32_t data) { - // .x.. .... - X9313WP /INC - // ..x. .... - X9313WP U/#D -} + /* + .x.. .... - X9313WP /INC + ..x. .... - X9313WP U/#D + ...x .... - Left audio volume CS (X9313) + .... x... - Right audio volume CS (X9313) + .... .xxx - Audio bitrate select + */ + uint8_t changed = m_port2_data ^ data; + + m_port2_data = data; + + if (changed & 0x40) + { + // Digital volume clock line changed + if (!(data & 0x40)) + { + if (data & 0x20) + { + if (!(data & 0x10) && (m_left_volume < 31)) m_left_volume++; + if (!(data & 0x08) && (m_right_volume < 31)) m_right_volume++; + } + else + { + if (!(data & 0x10) && (m_left_volume > 0)) m_left_volume--; + if (!(data & 0x08) && (m_right_volume > 0)) m_right_volume--; + } + + m_ldac->set_output_gain(ALL_OUTPUTS, m_left_volume / 32.0f); + m_rdac->set_output_gain(ALL_OUTPUTS, m_right_volume / 32.0f); + } + } +} void rastersp_state:: port3_w(uint32_t data) { @@ -511,12 +850,81 @@ return m_nvram8[addr]; } +void fbcrazy_state::aux_port0_w(offs_t offset, uint8_t data) +{ + // Lamps 1-8 on bits 0-7 + // Bit 6, lamp 6, is Start lamp +} + +void fbcrazy_state::aux_port1_w(offs_t offset, uint8_t data) +{ + // Lamps 9-16 on bits 0-7 + // Bit 3, lamp 12, is SELECT button lamp +} + +void fbcrazy_state::aux_port2_w(offs_t offset, uint8_t data) +{ + // Lamps 17-22 on bits 0-5 + // Bit 6 Coin Validator lamp ? + // Bit 7 unused +} + +void fbcrazy_state::aux_port3_w(offs_t offset, uint8_t data) +{ + m_aux_port3_data = data; + // Bit 0 - unused + // Bit 1 - unused + // Bit 2 - Meter 3 + // Bit 3 - Meter 1 + // Bit 4 - Meter 2 + // Bit 5 - unused + // Bit 6 - unused + // Bit 7 - unused +} + +void fbcrazy_state::aux_port4_w(offs_t offset, uint8_t data) +{ + // Bit 0 - unused + // Bit 1 - unused + // Bit 2 - unused + // Bit 3 - 10p lockout + // Bit 4 - 20p lockout + // Bit 5 - 50p lockout + // Bit 6 - £1 lockout + // Bit 7 - 5p lockout +} + +READ_LINE_MEMBER(fbcrazy_state::meter_pulse_r) +{ + return m_aux_port3_data & 0xbc ? 1 : 0; +} + + void rastersp_state::cyrix_cache_w(uint32_t data) { // TODO? } +uint8_t rastersp_state::interrupt_ctrl_r(offs_t offset) +{ + return m_interrupt_mask; +} + +void rastersp_state::interrupt_ctrl_w(offs_t offset, uint8_t data) +{ + m_interrupt_mask = data;; +} + +uint8_t rastersp_state::interrupt_status_r(offs_t offset) +{ + // TODO: This returns something to do with interrupts + // Is it a bit pattern of the current interupt or a + // bit pattern of all interrupts pending? + // Either way, 0 works anyway! + return 0; +} + /************************************* @@ -654,10 +1062,13 @@ void rastersp_state::dsp_ctrl_w(uint32_t data) { - // x... .... LED? - // .xx. .... 486 reset control? + // x... .... - Something to do with 486 bus access? + // .x.. .... - 486 reset control + // ..x. .... - Enable SCSI, UART, and 486 int to DSP + + m_maincpu->set_input_line(INPUT_LINE_RESET, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE); - m_maincpu->set_input_line(INPUT_LINE_RESET, (data & 0x60) == 0x60 ? CLEAR_LINE : ASSERT_LINE); + m_dsp_ctrl_data = data; } @@ -685,22 +1096,43 @@ * * Memory maps * + * The FPGA limits access to the 1st 1MB of DRAM + * when A25 and A24 are both high + * *************************************/ -void rastersp_state::cpu_map(address_map &map) +void rastersp_state::cpu_map_base(address_map &map) { - map(0x00000000, 0x003fffff).ram().share("dram"); - map(0x01000000, 0x010bffff).noprw(); // External ROM - map(0x010c0000, 0x010cffff).rom().region("bios", 0); map(0x02200000, 0x022fffff).rw(FUNC(rastersp_state::nvram_r), FUNC(rastersp_state::nvram_w)).umask32(0x000000ff); - map(0x02200800, 0x02200803).nopw(); // ? + map(0x02200800, 0x02200803).rw(FUNC(rastersp_state::interrupt_ctrl_r),FUNC(rastersp_state::interrupt_ctrl_w)); map(0x02208000, 0x02208fff).rw("scsibus:7:ncr53c700", FUNC(ncr53c7xx_device::read), FUNC(ncr53c7xx_device::write)); map(0x0220e000, 0x0220e003).w(FUNC(rastersp_state::dpylist_w)); - map(0xfff00000, 0xffffffff).bankrw("bank3"); + map(0xfff00000, 0xffffffff).bankrw("bank1");//was 3 +} + +void rastersp_state::cpu_map(address_map &map) +{ + cpu_map_base(map); + map(0x00000000, 0x003fffff).ram().share("dram"); // 4MB DRAM on original board + map(0x01000000, 0x010bffff).noprw(); // External ROM +} + +void fbcrazy_state::cpu_map(address_map &map) +{ + cpu_map_base(map); + map(0x00000000, 0x007fffff).ram().share("dram"); // 8MB DRAM on Football Crazy board + map(0x01000000, 0x01000003).w( FUNC(fbcrazy_state::aux_port0_w)).umask32(0x000000ff); + map(0x01000000, 0x01000003).portr("AUX_PORT0"); + map(0x01000004, 0x01000007).w( FUNC(fbcrazy_state::aux_port1_w)).umask32(0x000000ff); + map(0x01000004, 0x01000007).portr("AUX_PORT1"); + map(0x01000008, 0x0100000b).w( FUNC(fbcrazy_state::aux_port2_w)).umask32(0x000000ff); + map(0x0100000c, 0x0100000f).w( FUNC(fbcrazy_state::aux_port3_w)).umask32(0x000000ff); + map(0x01000010, 0x01000013).w( FUNC(fbcrazy_state::aux_port4_w)).umask32(0x000000ff); } void rastersp_state::io_map(address_map &map) { + map(0x0000, 0x0000).r(FUNC(rastersp_state::interrupt_status_r)); map(0x0020, 0x0023).w(FUNC(rastersp_state::cyrix_cache_w)); map(0x1000, 0x1003).portr("P1").w(FUNC(rastersp_state::port1_w)); map(0x1004, 0x1007).portr("P2").w(FUNC(rastersp_state::port2_w)); @@ -709,22 +1141,34 @@ map(0x1010, 0x1013).portr("DSW1"); map(0x1014, 0x1017).portr("EXTRA"); map(0x4000, 0x4007).rw("rtc", FUNC(mc146818_device::read), FUNC(mc146818_device::write)).umask32(0x000000ff); - map(0x6008, 0x600b).nopr().nopw(); // RS232 + map(0x6000, 0x6000).rw( m_duart, FUNC(z80scc_device::cb_r), FUNC(z80scc_device::cb_w)); + map(0x6004, 0x6004).rw( m_duart, FUNC(z80scc_device::db_r), FUNC(z80scc_device::db_w)); + map(0x6008, 0x6008).rw( m_duart, FUNC(z80scc_device::ca_r), FUNC(z80scc_device::ca_w)); + map(0x600c, 0x600c).rw( m_duart, FUNC(z80scc_device::da_r), FUNC(z80scc_device::da_w)); } - -void rastersp_state::dsp_map(address_map &map) +void rastersp_state::dsp_map_base(address_map &map) { - map(0x000000, 0x0fffff).bankrw("bank1"); map(0x400000, 0x40ffff).rom().region("dspboot", 0); map(0x808000, 0x80807f).rw(FUNC(rastersp_state::tms32031_control_r), FUNC(rastersp_state::tms32031_control_w)); map(0x880402, 0x880402).w(FUNC(rastersp_state::dsp_unk_w)); map(0x883c00, 0x883c00).w(FUNC(rastersp_state::dsp_486_int_w)); map(0xc00000, 0xc03fff).bankrw("bank2"); map(0xc80000, 0xc80000).w(FUNC(rastersp_state::dsp_ctrl_w)); - map(0xfc0000, 0xffffff).bankrw("bank3"); + map(0xfc0000, 0xffffff).bankrw("bank1");//was3 +} + +void rastersp_state::dsp_map(address_map &map) +{ + dsp_map_base(map); + map(0x000000, 0x0fffff).bankrw("bank1");//4 meg } +void fbcrazy_state::dsp_map(address_map &map) +{ + rastersp_state::dsp_map_base(map); + map(0x000000, 0x1fffff).bankrw("bank1");//8 meg +} /************************************* @@ -833,6 +1277,139 @@ PORT_DIPSETTING( 0x80, DEF_STR( No ) ) INPUT_PORTS_END +static INPUT_PORTS_START( fbcrazy ) + PORT_START("P1") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("P2") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("COMMON") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Select") PORT_CODE(KEYCODE_S) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("EXTRA") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Refill Key") PORT_CODE(KEYCODE_R) PORT_TOGGLE + PORT_DIPNAME( 0x20, 0x00, "4 6 Cashbox Door" ) + PORT_DIPSETTING( 0x00, "CLOSED" ) + PORT_DIPSETTING( 0x20, "OPEN" ) + PORT_DIPNAME( 0x40, 0x00, "4 7 Back Door" ) + PORT_DIPSETTING( 0x00, "CLOSED" ) + PORT_DIPSETTING( 0x40, "OPEN" ) + PORT_DIPNAME( 0x80, 0x00, "4 8 Front Door" ) + PORT_DIPSETTING( 0x00, "CLOSED" ) + PORT_DIPSETTING( 0x80, "OPEN" ) + + PORT_START("DSW1") + PORT_DIPNAME( 0x01, 0x01, "Setup Disk" ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x01, DEF_STR( On ) ) + + PORT_DIPNAME( 0x02, 0x00, DEF_STR( Service_Mode ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x02, DEF_STR( On ) ) + + PORT_DIPNAME( 0x3c, 0x00, "Load PROG" ) + PORT_DIPSETTING( 0x00, "0" ) + PORT_DIPSETTING( 0x04, "1" ) + PORT_DIPSETTING( 0x08, "2" ) + PORT_DIPSETTING( 0x0c, "3" ) + PORT_DIPSETTING( 0x10, "4" ) + PORT_DIPSETTING( 0x14, "5" ) + PORT_DIPSETTING( 0x18, "6" ) + PORT_DIPSETTING( 0x1c, "7" ) + PORT_DIPSETTING( 0x20, "8" ) + PORT_DIPSETTING( 0x24, "9" ) + PORT_DIPSETTING( 0x28, "A" ) + PORT_DIPSETTING( 0x2c, "B" ) + PORT_DIPSETTING( 0x30, "C" ) + PORT_DIPSETTING( 0x34, "D" ) + PORT_DIPSETTING( 0x38, "E" ) + PORT_DIPSETTING( 0x3c, "F" ) + + PORT_DIPNAME( 0x40, 0x00, "Reserved" ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x40, DEF_STR( On ) ) + + PORT_DIPNAME( 0x80, 0x00, "Enable Cache" ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x80, DEF_STR( On ) ) + + PORT_START("DSW2") + PORT_DIPNAME( 0x01, 0x00, "Debug Screen" ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x01, DEF_STR( On ) ) + + PORT_DIPNAME( 0x0e, 0x00, "FPGA File Source" ) + PORT_DIPSETTING( 0x00, "Serial PROMs" ) + PORT_DIPSETTING( 0x0e, "Cable" ) + + PORT_DIPNAME( 0x70, 0x50, "Clock speed" ) + PORT_DIPSETTING( 0x00, "4" ) + PORT_DIPSETTING( 0x10, "8" ) + PORT_DIPSETTING( 0x20, "16" ) + PORT_DIPSETTING( 0x30, "20" ) + PORT_DIPSETTING( 0x40, "25" ) + PORT_DIPSETTING( 0x50, "33" ) + PORT_DIPSETTING( 0x60, "40" ) + PORT_DIPSETTING( 0x70, "50" ) + + PORT_DIPNAME( 0x80, 0x00, "SCSI bus terminated" ) + PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) + PORT_DIPSETTING( 0x80, DEF_STR( No ) ) + + PORT_START("AUX_PORT0") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(3) PORT_NAME("10p") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(3) PORT_NAME("20p") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN3 ) PORT_IMPULSE(3) PORT_NAME("50p") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN4 ) PORT_IMPULSE(3) PORT_NAME("1 Pound") + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN5 ) PORT_IMPULSE(3) PORT_NAME("5P") + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Pay tube level") PORT_CODE(KEYCODE_T) PORT_TOGGLE + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("AUX_PORT1") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_DIPNAME( 0x08, 0x00, "Pay unit fitted" ) + PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) + PORT_DIPSETTING( 0x08, DEF_STR( No ) ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(fbcrazy_state, meter_pulse_r) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("TRACK_X") // Fake trackball input port + PORT_BIT( 0xfff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(70) PORT_KEYDELTA(10) + + PORT_START("TRACK_Y") // Fake trackball input port + PORT_BIT( 0xfff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(70) PORT_KEYDELTA(10) +INPUT_PORTS_END /************************************* @@ -855,27 +1432,19 @@ { auto *state = device->subdevice(":"); ncr53c7xx_device &scsictrl = downcast(*device); - scsictrl.set_clock(66000000); + scsictrl.set_clock(66'000'000); scsictrl.irq_handler().set(*state, FUNC(rastersp_state::scsi_irq)); scsictrl.host_read().set(*state, FUNC(rastersp_state::ncr53c700_read)); scsictrl.host_write().set(*state, FUNC(rastersp_state::ncr53c700_write)); } -/************************************* - * - * Machine driver - * - *************************************/ - -void rastersp_state::rastersp(machine_config &config) +void rastersp_state::rs_config_base(machine_config &config) { - I486(config, m_maincpu, 33330000); - m_maincpu->set_addrmap(AS_PROGRAM, &rastersp_state::cpu_map); - m_maincpu->set_addrmap(AS_IO, &rastersp_state::io_map); + I486(config, m_maincpu, 33'330'000); m_maincpu->set_irq_acknowledge_callback(FUNC(rastersp_state::irq_callback)); + m_maincpu->set_addrmap(AS_IO, &rastersp_state::io_map); - TMS32031(config, m_dsp, 33330000); - m_dsp->set_addrmap(AS_PROGRAM, &rastersp_state::dsp_map); + TMS32031(config, m_dsp, 33'330'000); m_dsp->set_mcbl_mode(true); // Boot-loader mode MC146818(config, "rtc", 32.768_kHz_XTAL); @@ -884,11 +1453,7 @@ NSCSI_BUS(config, "scsibus", 0); - nscsi_connector &connector0(NSCSI_CONNECTOR(config, "scsibus:0", 0)); - connector0.option_add("harddisk", NSCSI_HARDDISK); - connector0.option_add_internal("ncr53c700", NCR53C7XX); - connector0.set_default_option("harddisk"); - connector0.set_fixed(true); + WATCHDOG_TIMER(config, m_watchdog).set_time(attotime::from_seconds(1)); nscsi_connector &connector7(NSCSI_CONNECTOR(config, "scsibus:7", 0)); connector7.option_add("harddisk", NSCSI_HARDDISK); @@ -917,9 +1482,53 @@ DAC_16BIT_R2R_TWOS_COMPLEMENT(config, m_rdac, 0); m_ldac->add_route(ALL_OUTPUTS, "lspeaker", 0.5); // unknown DAC m_rdac->add_route(ALL_OUTPUTS, "rspeaker", 0.5); // unknown DAC + + SCC85C30(config, m_duart, 8'000'000); + m_duart->configure_channels(1'843'200, 0, 1'843'200, 0); + m_duart->out_int_callback().set(FUNC(rastersp_state::duart_irq)); } +/************************************* + * + * Machine driver + * + *************************************/ +void rastersp_state::rastersp(machine_config &config) +{ + rs_config_base(config); + m_maincpu->set_addrmap(AS_PROGRAM, &rastersp_state::cpu_map); + + m_dsp->set_addrmap(AS_PROGRAM, &rastersp_state::dsp_map); + + nscsi_connector &connector0(NSCSI_CONNECTOR(config, "scsibus:0", 0)); + connector0.option_add("harddisk", NSCSI_HARDDISK); + connector0.option_add_internal("ncr53c700", NCR53C7XX); + connector0.set_default_option("harddisk"); + connector0.set_fixed(true); +} + + +void fbcrazy_state::fbcrazy(machine_config &config) +{ + rs_config_base(config); + m_maincpu->set_addrmap(AS_PROGRAM, &fbcrazy_state::cpu_map); + + m_dsp->set_addrmap(AS_PROGRAM, &fbcrazy_state::dsp_map); + + nscsi_connector &connector3(NSCSI_CONNECTOR(config, "scsibus:3", 0)); + connector3.option_add("cdrom", NSCSI_CDROM); + connector3.option_add_internal("ncr53c700", NCR53C7XX); + connector3.set_default_option("cdrom"); + connector3.set_fixed(true); + + bacta_datalogger_device &bacta(BACTA_DATALOGGER(config, "bacta", 0)); + + m_duart->out_txda_callback().set("bacta", FUNC(bacta_datalogger_device::write_txd)); + bacta.rxd_handler().set(m_duart, FUNC(z80scc_device::rxa_w)); + m_duart->out_rtsa_callback().set(FUNC(fbcrazy_state::trackball_rts)); + +} /************************************* * @@ -928,9 +1537,6 @@ *************************************/ ROM_START( rotr ) - ROM_REGION32_LE(0x100000, "bios", 0) - ROM_LOAD( "rasterspeed2.1_bootrom4.u10", 0x00000, 0x10000, CRC(6da142d1) SHA1(e2dbd479034677726fc26fd1ba85c4458d89286c) ) - ROM_REGION32_LE(0x1000000, "dspboot", 0) ROM_LOAD32_BYTE( "rasterspeed2.1_bootrom4.u10", 0x00000, 0x10000, CRC(6da142d1) SHA1(e2dbd479034677726fc26fd1ba85c4458d89286c) ) @@ -947,9 +1553,6 @@ ROM_START( rotra ) - ROM_REGION32_LE(0x100000, "bios", 0) - ROM_LOAD( "rasterspeed2.1_bootrom4.u10", 0x00000, 0x10000, CRC(6da142d1) SHA1(e2dbd479034677726fc26fd1ba85c4458d89286c) ) - ROM_REGION32_LE(0x1000000, "dspboot", 0) ROM_LOAD32_BYTE( "rasterspeed2.1_bootrom4.u10", 0x00000, 0x10000, CRC(6da142d1) SHA1(e2dbd479034677726fc26fd1ba85c4458d89286c) ) @@ -966,33 +1569,36 @@ /* Football Crazy runs on the (c)1997 "RASTERSPEED 2.1 31-599-001 ISS 4" PCB, which seems to be a more modern production version. - a PCB photo with the rom sticker showing the text below has also been seen + a PCB photo with the ROM sticker showing the text below has also been seen Football Crazy Cashflow 95 750 956 STANDARD UK 64K VER. FOOT 3.2 BFM - + Bell Fruit issue roms in pairs. + Roms with the 5th digit 0 do not require a Bacta Dataport unit to operate although they still send out the data + Roms with the 5th digit 1 do required a Dataport unit and the machine will lock if one isn't fitted when the doors are closed. + Football Crazy is wrong in that 95751937 still requires the Dataport unit even when the doors are open :( + 95751937 shows RS Mk 2.16 P Uk Boot ROM on power up while 95750937 shows RS Mk 2.16 N Uk Boot ROM + The 'N' and 'P' referring to non-protocol and protocol. */ // the rom also exists in some odd hex format like this // ROM_LOAD( "95751937.hex", 0x0000, 0x025f91, CRC(8f412e97) SHA1(a5ff924fbc327114e59d75de644ed0d5cd7fa6b3) ) ROM_START( fbcrazy ) - ROM_REGION32_LE(0x100000, "bios", 0) - ROM_LOAD( "95751937.bin", 0x0000, 0x010000, CRC(4a99ee11) SHA1(335398ebc64bbfe86e2652ac080a5943dd413928) ) - ROM_REGION32_LE(0x1000000, "dspboot", 0) ROM_LOAD32_BYTE( "95751937.bin", 0x0000, 0x010000, CRC(4a99ee11) SHA1(335398ebc64bbfe86e2652ac080a5943dd413928) ) + //ROM_LOAD32_BYTE( "95750937.bin", 0x0000, 0x010000, CRC(15364c8b) SHA1(c36903fd18ff8abfccca5dbbad8acda25d78e8f6) ) ROM_REGION(0x8000, "proms", ROMREGION_ERASEFF ) - /* not on this PCB type? */ + // Not on this PCB type? ROM_REGION(0x8000, "nvram", ROMREGION_ERASEFF ) - DISK_REGION( "scsibus:0:harddisk:image" ) - DISK_IMAGE( "fbcrazy_hdd", 0, NO_DUMP ) + DISK_REGION( "scsibus:3:cdrom" ) + DISK_IMAGE_READONLY( "95100303", 0, SHA1(9ba47c96de27ec2bea9c6624d78d309b67705406) ) ROM_END /************************************* @@ -1001,6 +1607,6 @@ * *************************************/ -GAME( 1994, rotr, 0, rastersp, rotr, rastersp_state, empty_init, ROT0, "BFM/Mirage", "Rise of the Robots (prototype)", 0 ) -GAME( 1994, rotra, rotr, rastersp, rotr, rastersp_state, empty_init, ROT0, "BFM/Mirage", "Rise of the Robots (prototype, older)", 0 ) -GAME( 1997, fbcrazy, 0, rastersp, rotr, rastersp_state, empty_init, ROT0, "BFM", "Football Crazy (Video Quiz)", MACHINE_NOT_WORKING ) +GAME( 1994, rotr, 0, rastersp, rotr, rastersp_state, empty_init, ROT0, "BFM/Mirage", "Rise of the Robots (prototype)", MACHINE_SUPPORTS_SAVE ) +GAME( 1994, rotra, rotr, rastersp, rotr, rastersp_state, empty_init, ROT0, "BFM/Mirage", "Rise of the Robots (prototype, older)", MACHINE_SUPPORTS_SAVE ) +GAME( 1997, fbcrazy, 0, fbcrazy, fbcrazy, fbcrazy_state, empty_init, ROT0, "BFM", "Football Crazy (Video Quiz)", MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/ravens.cpp mame-0.243+dfsg.1/src/mame/drivers/ravens.cpp --- mame-0.242+dfsg.1/src/mame/drivers/ravens.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/ravens.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -9,8 +9,8 @@ https://web.archive.org/web/20160321001634/http://petersieg.bplaced.com/?2650_Computer:2650_Selbstbaucomputer - 2013-04-23 Skeleton driver. +2013-04-23 Skeleton driver. No instructions, no schematics - it's all guesswork. diff -Nru mame-0.242+dfsg.1/src/mame/drivers/rbmk.cpp mame-0.243+dfsg.1/src/mame/drivers/rbmk.cpp --- mame-0.242+dfsg.1/src/mame/drivers/rbmk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/rbmk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -777,17 +777,6 @@ 32*32 }; -static const gfx_layout rbmk8_layout = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { 0,1,2,3 }, - { 4,0,12,8,20,16,28,24 }, - { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 }, - 8*32 -}; - static const gfx_layout magslot16_layout = // TODO: not correct { 16,16, @@ -803,14 +792,14 @@ static GFXDECODE_START( gfx_rbmk ) - GFXDECODE_ENTRY( "gfx1", 0, rbmk32_layout, 0x0, 16 ) - GFXDECODE_ENTRY( "gfx2", 0, rbmk8_layout, 0x100, 16 ) + GFXDECODE_ENTRY( "gfx1", 0, rbmk32_layout, 0x0, 16 ) + GFXDECODE_ENTRY( "gfx2", 0, gfx_8x8x4_packed_lsb, 0x100, 16 ) GFXDECODE_END static GFXDECODE_START( gfx_magslot ) - GFXDECODE_ENTRY( "gfx1", 0, magslot16_layout, 0x000, 16 ) - GFXDECODE_ENTRY( "gfx2", 0, rbmk8_layout, 0x100, 16 ) - GFXDECODE_ENTRY( "gfx3", 0, rbmk8_layout, 0x100, 16 ) // wrong colors + GFXDECODE_ENTRY( "gfx1", 0, magslot16_layout, 0x000, 16 ) + GFXDECODE_ENTRY( "gfx2", 0, gfx_8x8x4_packed_lsb, 0x100, 16 ) + GFXDECODE_ENTRY( "gfx3", 0, gfx_8x8x4_packed_lsb, 0x100, 16 ) // wrong colors GFXDECODE_END void rbmk_state::video_start() diff -Nru mame-0.242+dfsg.1/src/mame/drivers/rc702.cpp mame-0.243+dfsg.1/src/mame/drivers/rc702.cpp --- mame-0.242+dfsg.1/src/mame/drivers/rc702.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/rc702.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -89,12 +89,12 @@ void io_map(address_map &map); void mem_map(address_map &map); - bool m_q_state = 0; - bool m_qbar_state = 0; - bool m_drq_state = 0; + bool m_q_state = false; + bool m_qbar_state = false; + bool m_drq_state = false; uint16_t m_beepcnt = 0U; - bool m_eop = 0; - bool m_dack1 = 0; + bool m_eop = false; + bool m_dack1 = false; required_device m_palette; required_device m_maincpu; required_region_ptr m_rom; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/realbrk.cpp mame-0.243+dfsg.1/src/mame/drivers/realbrk.cpp --- mame-0.242+dfsg.1/src/mame/drivers/realbrk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/realbrk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -713,17 +713,6 @@ 8*8*4 }; -static const gfx_layout layout_16x16x4 = -{ - 16,16, - RGN_FRAC(1,1), - 4, - { STEP4(0,1) }, - { 1*4,0*4,3*4,2*4,5*4,4*4,7*4,6*4,9*4,8*4,11*4,10*4,13*4,12*4,15*4,14*4 }, - { STEP16(0,16*4) }, - 16*16*4 -}; - static const gfx_layout layout_16x16x8 = { 16,16, @@ -736,10 +725,10 @@ }; static GFXDECODE_START( gfx_realbrk ) - GFXDECODE_ENTRY( "gfx1", 0, layout_16x16x8, 0, 0x80 ) // [0] Backgrounds - GFXDECODE_ENTRY( "gfx2", 0, layout_8x8x4, 0, 0x800 ) // [1] Text - GFXDECODE_ENTRY( "gfx3", 0, layout_16x16x8, 0, 0x80 ) // [2] Sprites (256 colors) - GFXDECODE_ENTRY( "gfx4", 0, layout_16x16x4, 0, 0x800 ) // [3] Sprites (16 colors) + GFXDECODE_ENTRY( "gfx1", 0, layout_16x16x8, 0, 0x80 ) // [0] Backgrounds + GFXDECODE_ENTRY( "gfx2", 0, layout_8x8x4, 0, 0x800 ) // [1] Text + GFXDECODE_ENTRY( "gfx3", 0, layout_16x16x8, 0, 0x80 ) // [2] Sprites (256 colors) + GFXDECODE_ENTRY( "gfx4", 0, gfx_16x16x4_packed_lsb, 0, 0x800 ) // [3] Sprites (16 colors) GFXDECODE_END static GFXDECODE_START( gfx_dai2kaku ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/recel.cpp mame-0.243+dfsg.1/src/mame/drivers/recel.cpp --- mame-0.242+dfsg.1/src/mame/drivers/recel.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/recel.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -95,7 +95,7 @@ u8 m_strobe = 0U; u16 m_nvram_addr = 0U; u8 m_nvram_data = 0U; - bool m_nvram_prev_clk = 0; + bool m_nvram_prev_clk = false; u8 m_prom_addr = 0U; }; @@ -507,17 +507,17 @@ GAME(1977, recel, 0, recel, recel, recel_state, empty_init, ROT0, "Recel", "Recel Bios", MACHINE_IS_BIOS_ROOT | MACHINE_NOT_WORKING) -GAME(1978, r_alaska, recel, recel, recel, recel_state, empty_init, ROT0, "Interflip", "Alaska", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1978, r_hotcold, recel, recel, recel, recel_state, empty_init, ROT0, "Inder", "Hot & Cold", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1978, r_screech, recel, recel, recel, recel_state, empty_init, ROT0, "Inder", "Screech", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1978, r_mrevil, recel, recel, recel, recel_state, empty_init, ROT0, "Recel", "Mr Evil", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1978, r_torneo, recel, recel, recel, recel_state, empty_init, ROT0, "Recel", "Torneo", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1978, r_crzyrace, recel, recel, recel, recel_state, empty_init, ROT0, "Recel", "Crazy Race", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1978, r_fairfght, recel, recel, recel, recel_state, empty_init, ROT0, "Recel", "Fair Fight", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1978, r_pokrplus, recel, recel, recel, recel_state, empty_init, ROT0, "Recel", "Poker Plus", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1979, r_mrdoom, recel, recel, recel, recel_state, empty_init, ROT0, "Recel", "Mr Doom", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1979, r_cavalier, recel, recel, recel, recel_state, empty_init, ROT0, "Recel", "Cavalier", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1979, r_swash, recel, recel, recel, recel_state, empty_init, ROT0, "Recel", "Swashbuckler", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1979, r_quijote, recel, recel, recel, recel_state, empty_init, ROT0, "Recel", "Don Quijote", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1980, r_flipper, recel, recel, recel, recel_state, empty_init, ROT0, "Recel", "The Flipper Game", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1980, r_blackm4, recel, recel, recel, recel_state, empty_init, ROT0, "Recel", "Black Magic 4", MACHINE_IS_SKELETON_MECHANICAL) +GAME(1978, r_alaska, recel, recel, recel, recel_state, empty_init, ROT0, "Interflip", "Alaska", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1978, r_hotcold, recel, recel, recel, recel_state, empty_init, ROT0, "Inder", "Hot & Cold", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1978, r_screech, recel, recel, recel, recel_state, empty_init, ROT0, "Inder", "Screech", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1978, r_mrevil, recel, recel, recel, recel_state, empty_init, ROT0, "Recel", "Mr Evil", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1978, r_torneo, recel, recel, recel, recel_state, empty_init, ROT0, "Recel", "Torneo", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1978, r_crzyrace, recel, recel, recel, recel_state, empty_init, ROT0, "Recel", "Crazy Race", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1978, r_fairfght, recel, recel, recel, recel_state, empty_init, ROT0, "Recel", "Fair Fight", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1978, r_pokrplus, recel, recel, recel, recel_state, empty_init, ROT0, "Recel", "Poker Plus", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1979, r_mrdoom, recel, recel, recel, recel_state, empty_init, ROT0, "Recel", "Mr Doom", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1979, r_cavalier, recel, recel, recel, recel_state, empty_init, ROT0, "Recel", "Cavalier", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1979, r_swash, recel, recel, recel, recel_state, empty_init, ROT0, "Recel", "Swashbuckler", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1979, r_quijote, recel, recel, recel, recel_state, empty_init, ROT0, "Recel", "Don Quijote", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1980, r_flipper, recel, recel, recel, recel_state, empty_init, ROT0, "Recel", "The Flipper Game", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1980, r_blackm4, recel, recel, recel, recel_state, empty_init, ROT0, "Recel", "Black Magic 4", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/ron.cpp mame-0.243+dfsg.1/src/mame/drivers/ron.cpp --- mame-0.242+dfsg.1/src/mame/drivers/ron.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/ron.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -378,17 +378,6 @@ PORT_BIT( 0x12, IP_ACTIVE_LOW, IPT_UNKNOWN ) INPUT_PORTS_END -static const gfx_layout charlayout_1bpp = -{ - 8,8, - RGN_FRAC(1,1), - 1, - { RGN_FRAC(0,1) }, - { STEP8(0,1) }, - { STEP8(0,8) }, - 8*8 -}; - static const gfx_layout charlayout_2bpp = { 8,8, @@ -401,7 +390,7 @@ }; static GFXDECODE_START( gfx_ron ) - GFXDECODE_ENTRY( "gfx1", 0, charlayout_1bpp, 0, 1 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x1, 0, 1 ) GFXDECODE_ENTRY( "gfx2", 0, charlayout_2bpp, 4, 1 ) GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/rowamet.cpp mame-0.243+dfsg.1/src/mame/drivers/rowamet.cpp --- mame-0.242+dfsg.1/src/mame/drivers/rowamet.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/rowamet.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -326,4 +326,4 @@ } // Anonymous namespace -GAME(198?, heavymtl, 0, rowamet, rowamet, rowamet_state, empty_init, ROT0, "Rowamet", "Heavy Metal", MACHINE_IS_SKELETON_MECHANICAL ) +GAME(198?, heavymtl, 0, rowamet, rowamet, rowamet_state, empty_init, ROT0, "Rowamet", "Heavy Metal", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/royalmah.cpp mame-0.243+dfsg.1/src/mame/drivers/royalmah.cpp --- mame-0.242+dfsg.1/src/mame/drivers/royalmah.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/royalmah.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -370,7 +370,6 @@ { save_item(NAME(m_input_port_select)); save_item(NAME(m_dsw_select)); - save_item(NAME(m_rombank)); save_item(NAME(m_palette_base)); save_item(NAME(m_flip_screen)); @@ -1403,8 +1402,8 @@ return m_rtc->read(offset & 0xf); - logerror("mjvegasa_rom_io_r: %04X: unmapped IO read at %04X\n", m_maincpu->pc(), offset); - return 0xff; + //logerror("mjvegasa_rom_io_r: %04X: unmapped IO read at %04X\n", m_maincpu->pc(), offset); + //return 0xff; } void royalmah_state::mjvegasa_rom_io_w(offs_t offset, uint8_t data) @@ -5586,16 +5585,25 @@ void royalmah_state::init_mjtensin() { m_mainbank->configure_entries(0, 80, memregion("maincpu")->base() + 0x10000, 0x8000); + + save_item(NAME(m_rombank)); + m_rombank = 0; } void royalmah_state::init_cafetime() { m_mainbank->configure_entries(0, 64, memregion("maincpu")->base() + 0x10000, 0x8000); + + save_item(NAME(m_rombank)); + m_rombank = 0; } void royalmah_state::init_mjvegasa() { m_mainbank->configure_entries(0, 128, memregion("maincpu")->base() + 0x10000, 0x8000); + + save_item(NAME(m_rombank)); + m_rombank = 0; } void royalmah_state::init_jongshin() @@ -5606,6 +5614,9 @@ void royalmah_state::init_mjifb() { m_mainbank->configure_entries(0, 256, memregion("maincpu")->base() + 0x10000, 0x4000); + + save_item(NAME(m_rombank)); + m_rombank = 0; } void royalmah_state::init_tontonb() diff -Nru mame-0.242+dfsg.1/src/mame/drivers/rungun.cpp mame-0.243+dfsg.1/src/mame/drivers/rungun.cpp --- mame-0.242+dfsg.1/src/mame/drivers/rungun.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/rungun.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -343,21 +343,8 @@ /**********************************************************************************/ -static const gfx_layout bglayout = -{ - 16,16, - RGN_FRAC(1,1), - 4, - { 0, 1, 2, 3 }, - { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4, 8*4, - 9*4, 10*4, 11*4, 12*4, 13*4, 14*4, 15*4 }, - { 0*64, 1*64, 2*64, 3*64, 4*64, 5*64, 6*64, 7*64, - 8*64, 9*64, 10*64, 11*64, 12*64, 13*64, 14*64, 15*64 }, - 128*8 -}; - static GFXDECODE_START( gfx_rungun ) - GFXDECODE_ENTRY( "gfx1", 0, bglayout, 0x0000, 64 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_16x16x4_packed_msb, 0x0000, 64 ) GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/rx78.cpp mame-0.243+dfsg.1/src/mame/drivers/rx78.cpp --- mame-0.242+dfsg.1/src/mame/drivers/rx78.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/rx78.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -121,7 +121,7 @@ u8 m_pri_mask = 0U; u8 m_key_mux = 0U; u8 m_background = 0U; - bool m_irq_en = 1; + bool m_irq_en = true; u8 m_irq_slow = 0U; u8 m_irq_count = 0U; std::unique_ptr m_vram; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/s11a.cpp mame-0.243+dfsg.1/src/mame/drivers/s11a.cpp --- mame-0.242+dfsg.1/src/mame/drivers/s11a.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/s11a.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -535,15 +535,15 @@ ROM_RELOAD(0x38000,0x8000) ROM_END -GAME(1987, f14_l1, 0, s11a, s11a, s11a_state, init_s11a, ROT0, "Williams", "F-14 Tomcat (L-1)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1987, f14_p3, f14_l1, s11a, s11a, s11a_state, init_s11a, ROT0, "Williams", "F-14 Tomcat (P-3)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1987, f14_p4, f14_l1, s11a, s11a, s11a_state, init_s11a, ROT0, "Williams", "F-14 Tomcat (P-4)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1987, f14_p5, f14_l1, s11a, s11a, s11a_state, init_s11a, ROT0, "Williams", "F-14 Tomcat (P-5)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1987, fire_l3, 0, s11a, s11a, s11a_state, init_s11a, ROT0, "Williams", "Fire! (L-3)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1987, fire_l2, fire_l3, s11a, s11a, s11a_state, init_s11a, ROT0, "Williams", "Fire! (L-2)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1987, milln_l3, 0, s11a_obg, s11a, s11a_state, init_s11a, ROT0, "Williams", "Millionaire (L-3)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1986, pb_l5, 0, s11a_obg, s11a, s11a_state, init_s11a, ROT0, "Williams", "Pin-Bot (L-5)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1986, pb_l1, pb_l5, s11a_obg, s11a, s11a_state, init_s11a, ROT0, "Williams", "Pin-Bot (L-1)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1986, pb_l2, pb_l5, s11a_obg, s11a, s11a_state, init_s11a, ROT0, "Williams", "Pin-Bot (L-2)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1986, pb_l3, pb_l5, s11a_obg, s11a, s11a_state, init_s11a, ROT0, "Williams", "Pin-Bot (L-3)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1986, pb_p4, pb_l5, s11a_obg, s11a, s11a_state, init_s11a, ROT0, "Williams", "Pin-Bot (P-4)", MACHINE_IS_SKELETON_MECHANICAL) +GAME(1987, f14_l1, 0, s11a, s11a, s11a_state, init_s11a, ROT0, "Williams", "F-14 Tomcat (L-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1987, f14_p3, f14_l1, s11a, s11a, s11a_state, init_s11a, ROT0, "Williams", "F-14 Tomcat (P-3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1987, f14_p4, f14_l1, s11a, s11a, s11a_state, init_s11a, ROT0, "Williams", "F-14 Tomcat (P-4)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1987, f14_p5, f14_l1, s11a, s11a, s11a_state, init_s11a, ROT0, "Williams", "F-14 Tomcat (P-5)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1987, fire_l3, 0, s11a, s11a, s11a_state, init_s11a, ROT0, "Williams", "Fire! (L-3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1987, fire_l2, fire_l3, s11a, s11a, s11a_state, init_s11a, ROT0, "Williams", "Fire! (L-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1987, milln_l3, 0, s11a_obg, s11a, s11a_state, init_s11a, ROT0, "Williams", "Millionaire (L-3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1986, pb_l5, 0, s11a_obg, s11a, s11a_state, init_s11a, ROT0, "Williams", "Pin-Bot (L-5)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1986, pb_l1, pb_l5, s11a_obg, s11a, s11a_state, init_s11a, ROT0, "Williams", "Pin-Bot (L-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1986, pb_l2, pb_l5, s11a_obg, s11a, s11a_state, init_s11a, ROT0, "Williams", "Pin-Bot (L-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1986, pb_l3, pb_l5, s11a_obg, s11a, s11a_state, init_s11a, ROT0, "Williams", "Pin-Bot (L-3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1986, pb_p4, pb_l5, s11a_obg, s11a, s11a_state, init_s11a, ROT0, "Williams", "Pin-Bot (P-4)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/s11b.cpp mame-0.243+dfsg.1/src/mame/drivers/s11b.cpp --- mame-0.242+dfsg.1/src/mame/drivers/s11b.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/s11b.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1592,63 +1592,63 @@ ROM_RELOAD(0x58000,0x8000) ROM_END -GAME(1989, bcats_l5, 0, s11b, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Bad Cats (L-5)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1989, bcats_l2, bcats_l5, s11b, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Bad Cats (LA-2)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1989, bcats_g4, bcats_l5, s11b, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Bad Cats (LG-4)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1988, bnzai_l3, 0, s11b, s11b, s11b_state, init_s11bn7, ROT0, "Williams", "Banzai Run (L-3)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1988, bnzai_g3, bnzai_l3, s11b, s11b, s11b_state, init_s11bn7, ROT0, "Williams", "Banzai Run (L-3) Germany", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1988, bnzai_l1, bnzai_l3, s11b, s11b, s11b_state, init_s11bn7, ROT0, "Williams", "Banzai Run (L-1)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1988, bnzai_pa, bnzai_l3, s11b, s11b, s11b_state, init_s11bn7, ROT0, "Williams", "Banzai Run (P-A)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1987, bguns_l8, 0, s11b, s11b, s11b_state, init_s11bnn, ROT0, "Williams", "Big Guns (L-8)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1987, bguns_l7, bguns_l8, s11b, s11b, s11b_state, init_s11bnn, ROT0, "Williams", "Big Guns (L-7)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1987, bguns_la, bguns_l8, s11b, s11b, s11b_state, init_s11bnn, ROT0, "Williams", "Big Guns (L-A)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1987, bguns_p1, bguns_l8, s11b, s11b, s11b_state, init_s11bnn, ROT0, "Williams", "Big Guns (P-1)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1989, bk2k_l4, 0, s11b, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Black Knight 2000 (L-4)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1989, bk2k_lg1, bk2k_l4, s11b, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Black Knight 2000 (LG-1)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1989, bk2k_lg3, bk2k_l4, s11b, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Black Knight 2000 (LG-3)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1989, bk2k_pu1, bk2k_l4, s11b, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Black Knight 2000 (PU-1)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1989, bk2k_pf1, bk2k_l4, s11b, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Black Knight 2000 (PF-1)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1989, bk2k_la2, bk2k_l4, s11b, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Black Knight 2000 (LA-2)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1989, bk2k_pa7, bk2k_l4, s11b, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Black Knight 2000 (PA-7)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1989, bk2k_pa5, bk2k_l4, s11b, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Black Knight 2000 (PA-5)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1988, cycln_l5, 0, s11b, s11b, s11b_state, init_s11bnn, ROT0, "Williams", "Cyclone (L-5)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1988, cycln_l4, cycln_l5, s11b, s11b, s11b_state, init_s11bnn, ROT0, "Williams", "Cyclone (L-4)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1988, cycln_l1, cycln_l5, s11b, s11b, s11b_state, init_s11bnn, ROT0, "Williams", "Cyclone (L-1)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1988, esha_la3, 0, s11b, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Earthshaker (LA-3)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1989, esha_ma3, esha_la3, s11b, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Earthshaker (Metallica) (LA-3)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1989, esha_pr4, esha_la3, s11b, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Earthshaker (Family version) (PR-4)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1988, esha_lg1, esha_la3, s11b, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Earthshaker (German) (LG-1)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1988, esha_lg2, esha_la3, s11b, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Earthshaker (German) (LG-2)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1988, esha_la1, esha_la3, s11b, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Earthshaker (LA-1)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1988, esha_pa1, esha_la3, s11b, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Earthshaker (Prototype) (PA-1)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1988, esha_pa4, esha_la3, s11b, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Earthshaker (Prototype) (PA-4)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1989, eatpm_l4, 0, s11b, s11b, s11b_state, init_s11bin, ROT0, "Bally", "Elvira and the Party Monsters (LA-4)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1989, eatpm_l1, eatpm_l4, s11b, s11b, s11b_state, init_s11bin, ROT0, "Bally", "Elvira and the Party Monsters (LA-1)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1989, eatpm_l2, eatpm_l4, s11b, s11b, s11b_state, init_s11bin, ROT0, "Bally", "Elvira and the Party Monsters (LA-2)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1989, eatpm_4g, eatpm_l4, s11b, s11b, s11b_state, init_s11bin, ROT0, "Bally", "Elvira and the Party Monsters (LG-4)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1989, eatpm_4u, eatpm_l4, s11b, s11b, s11b_state, init_s11bin, ROT0, "Bally", "Elvira and the Party Monsters (LU-4)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1989, eatpm_f1, eatpm_l4, s11b, s11b, s11b_state, init_s11bin, ROT0, "Bally", "Elvira and the Party Monsters (LF-1) French", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1989, eatpm_p7, eatpm_l4, s11b, s11b, s11b_state, init_s11bin, ROT0, "Bally", "Elvira and the Party Monsters (PA-7)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1989, jokrz_l6, 0, s11b_jokerz, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Jokerz! (L-6)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1989, jokrz_l3, jokrz_l6, s11b_jokerz, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Jokerz! (L-3)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1989, jokrz_g4, jokrz_l6, s11b_jokerz, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Jokerz! (G-4)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1989, mousn_l4, 0, s11b, s11b, s11b_state, init_s11bin, ROT0, "Bally", "Mousin' Around! (LA-4)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1989, mousn_l1, mousn_l4, s11b, s11b, s11b_state, init_s11bin, ROT0, "Bally", "Mousin' Around! (LA-1)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1989, mousn_lu, mousn_l4, s11b, s11b, s11b_state, init_s11bin, ROT0, "Bally", "Mousin' Around! (LU-1)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1989, mousn_lx, mousn_l4, s11b, s11b, s11b_state, init_s11bin, ROT0, "Bally", "Mousin' Around! (LX-1)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1989, polic_l4, 0, s11b, s11b, s11b_state, init_s11bi7, ROT0, "Williams", "Police Force (LA-4)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1989, polic_l3, polic_l4, s11b, s11b, s11b_state, init_s11bi7, ROT0, "Williams", "Police Force (LA-3)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1989, polic_l2, polic_l4, s11b, s11b, s11b_state, init_s11bi7, ROT0, "Williams", "Police Force (LA-2)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1989, polic_g4, polic_l4, s11b, s11b, s11b_state, init_s11bi7, ROT0, "Williams", "Police Force (LG-4) Germany", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1988, spstn_l5, 0, s11b, s11b, s11b_state, init_s11bnn, ROT0, "Williams", "Space Station (L-5)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1988, swrds_l2, 0, s11b, s11b, s11b_state, init_s11bn7, ROT0, "Williams", "Swords of Fury (L-2)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1988, swrds_l1, swrds_l2, s11b, s11b, s11b_state, init_s11bn7, ROT0, "Williams", "Swords of Fury (L-1)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1988, taxi_l4, 0, s11b, s11b, s11b_state, init_s11bi7, ROT0, "Williams", "Taxi (Lola) (L-4)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1988, taxi_l3, taxi_l4, s11b, s11b, s11b_state, init_s11bi7, ROT0, "Williams", "Taxi (Marilyn) (L-3)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1988, taxi_lu1, taxi_l4, s11b, s11b, s11b_state, init_s11bi7, ROT0, "Williams", "Taxi (Marilyn) (LU-1)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1988, taxi_lg1, taxi_l4, s11b, s11b, s11b_state, init_s11bi7, ROT0, "Williams", "Taxi (Marilyn) (L-1) Germany", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1988, taxi_p5, taxi_l4, s11b, s11b, s11b_state, init_s11bi7, ROT0, "Williams", "Taxi (P-5)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1989, tsptr_l3, 0, s11b, s11b, s11b_state, init_s11bin, ROT0, "Bally", "Transporter the Rescue (L-3)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1990, whirl_l3, 0, s11b, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Whirlwind (L-3)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1990, whirl_l2, whirl_l3, s11b, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Whirlwind (L-2)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1990, whirl_lg3, whirl_l3, s11b, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Whirlwind (LG-3)", MACHINE_IS_SKELETON_MECHANICAL) +GAME(1989, bcats_l5, 0, s11b, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Bad Cats (L-5)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1989, bcats_l2, bcats_l5, s11b, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Bad Cats (LA-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1989, bcats_g4, bcats_l5, s11b, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Bad Cats (LG-4)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1988, bnzai_l3, 0, s11b, s11b, s11b_state, init_s11bn7, ROT0, "Williams", "Banzai Run (L-3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1988, bnzai_g3, bnzai_l3, s11b, s11b, s11b_state, init_s11bn7, ROT0, "Williams", "Banzai Run (L-3) Germany", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1988, bnzai_l1, bnzai_l3, s11b, s11b, s11b_state, init_s11bn7, ROT0, "Williams", "Banzai Run (L-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1988, bnzai_pa, bnzai_l3, s11b, s11b, s11b_state, init_s11bn7, ROT0, "Williams", "Banzai Run (P-A)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1987, bguns_l8, 0, s11b, s11b, s11b_state, init_s11bnn, ROT0, "Williams", "Big Guns (L-8)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1987, bguns_l7, bguns_l8, s11b, s11b, s11b_state, init_s11bnn, ROT0, "Williams", "Big Guns (L-7)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1987, bguns_la, bguns_l8, s11b, s11b, s11b_state, init_s11bnn, ROT0, "Williams", "Big Guns (L-A)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1987, bguns_p1, bguns_l8, s11b, s11b, s11b_state, init_s11bnn, ROT0, "Williams", "Big Guns (P-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1989, bk2k_l4, 0, s11b, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Black Knight 2000 (L-4)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1989, bk2k_lg1, bk2k_l4, s11b, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Black Knight 2000 (LG-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1989, bk2k_lg3, bk2k_l4, s11b, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Black Knight 2000 (LG-3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1989, bk2k_pu1, bk2k_l4, s11b, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Black Knight 2000 (PU-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1989, bk2k_pf1, bk2k_l4, s11b, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Black Knight 2000 (PF-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1989, bk2k_la2, bk2k_l4, s11b, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Black Knight 2000 (LA-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1989, bk2k_pa7, bk2k_l4, s11b, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Black Knight 2000 (PA-7)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1989, bk2k_pa5, bk2k_l4, s11b, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Black Knight 2000 (PA-5)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1988, cycln_l5, 0, s11b, s11b, s11b_state, init_s11bnn, ROT0, "Williams", "Cyclone (L-5)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1988, cycln_l4, cycln_l5, s11b, s11b, s11b_state, init_s11bnn, ROT0, "Williams", "Cyclone (L-4)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1988, cycln_l1, cycln_l5, s11b, s11b, s11b_state, init_s11bnn, ROT0, "Williams", "Cyclone (L-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1988, esha_la3, 0, s11b, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Earthshaker (LA-3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1989, esha_ma3, esha_la3, s11b, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Earthshaker (Metallica) (LA-3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1989, esha_pr4, esha_la3, s11b, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Earthshaker (Family version) (PR-4)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1988, esha_lg1, esha_la3, s11b, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Earthshaker (German) (LG-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1988, esha_lg2, esha_la3, s11b, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Earthshaker (German) (LG-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1988, esha_la1, esha_la3, s11b, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Earthshaker (LA-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1988, esha_pa1, esha_la3, s11b, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Earthshaker (Prototype) (PA-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1988, esha_pa4, esha_la3, s11b, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Earthshaker (Prototype) (PA-4)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1989, eatpm_l4, 0, s11b, s11b, s11b_state, init_s11bin, ROT0, "Bally", "Elvira and the Party Monsters (LA-4)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1989, eatpm_l1, eatpm_l4, s11b, s11b, s11b_state, init_s11bin, ROT0, "Bally", "Elvira and the Party Monsters (LA-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1989, eatpm_l2, eatpm_l4, s11b, s11b, s11b_state, init_s11bin, ROT0, "Bally", "Elvira and the Party Monsters (LA-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1989, eatpm_4g, eatpm_l4, s11b, s11b, s11b_state, init_s11bin, ROT0, "Bally", "Elvira and the Party Monsters (LG-4)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1989, eatpm_4u, eatpm_l4, s11b, s11b, s11b_state, init_s11bin, ROT0, "Bally", "Elvira and the Party Monsters (LU-4)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1989, eatpm_f1, eatpm_l4, s11b, s11b, s11b_state, init_s11bin, ROT0, "Bally", "Elvira and the Party Monsters (LF-1) French", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1989, eatpm_p7, eatpm_l4, s11b, s11b, s11b_state, init_s11bin, ROT0, "Bally", "Elvira and the Party Monsters (PA-7)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1989, jokrz_l6, 0, s11b_jokerz, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Jokerz! (L-6)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1989, jokrz_l3, jokrz_l6, s11b_jokerz, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Jokerz! (L-3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1989, jokrz_g4, jokrz_l6, s11b_jokerz, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Jokerz! (G-4)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1989, mousn_l4, 0, s11b, s11b, s11b_state, init_s11bin, ROT0, "Bally", "Mousin' Around! (LA-4)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1989, mousn_l1, mousn_l4, s11b, s11b, s11b_state, init_s11bin, ROT0, "Bally", "Mousin' Around! (LA-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1989, mousn_lu, mousn_l4, s11b, s11b, s11b_state, init_s11bin, ROT0, "Bally", "Mousin' Around! (LU-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1989, mousn_lx, mousn_l4, s11b, s11b, s11b_state, init_s11bin, ROT0, "Bally", "Mousin' Around! (LX-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1989, polic_l4, 0, s11b, s11b, s11b_state, init_s11bi7, ROT0, "Williams", "Police Force (LA-4)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1989, polic_l3, polic_l4, s11b, s11b, s11b_state, init_s11bi7, ROT0, "Williams", "Police Force (LA-3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1989, polic_l2, polic_l4, s11b, s11b, s11b_state, init_s11bi7, ROT0, "Williams", "Police Force (LA-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1989, polic_g4, polic_l4, s11b, s11b, s11b_state, init_s11bi7, ROT0, "Williams", "Police Force (LG-4) Germany", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1988, spstn_l5, 0, s11b, s11b, s11b_state, init_s11bnn, ROT0, "Williams", "Space Station (L-5)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1988, swrds_l2, 0, s11b, s11b, s11b_state, init_s11bn7, ROT0, "Williams", "Swords of Fury (L-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1988, swrds_l1, swrds_l2, s11b, s11b, s11b_state, init_s11bn7, ROT0, "Williams", "Swords of Fury (L-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1988, taxi_l4, 0, s11b, s11b, s11b_state, init_s11bi7, ROT0, "Williams", "Taxi (Lola) (L-4)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1988, taxi_l3, taxi_l4, s11b, s11b, s11b_state, init_s11bi7, ROT0, "Williams", "Taxi (Marilyn) (L-3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1988, taxi_lu1, taxi_l4, s11b, s11b, s11b_state, init_s11bi7, ROT0, "Williams", "Taxi (Marilyn) (LU-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1988, taxi_lg1, taxi_l4, s11b, s11b, s11b_state, init_s11bi7, ROT0, "Williams", "Taxi (Marilyn) (L-1) Germany", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1988, taxi_p5, taxi_l4, s11b, s11b, s11b_state, init_s11bi7, ROT0, "Williams", "Taxi (P-5)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1989, tsptr_l3, 0, s11b, s11b, s11b_state, init_s11bin, ROT0, "Bally", "Transporter the Rescue (L-3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1990, whirl_l3, 0, s11b, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Whirlwind (L-3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1990, whirl_l2, whirl_l3, s11b, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Whirlwind (L-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1990, whirl_lg3, whirl_l3, s11b, s11b, s11b_state, init_s11bin, ROT0, "Williams", "Whirlwind (LG-3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/s11c.cpp mame-0.243+dfsg.1/src/mame/drivers/s11c.cpp --- mame-0.242+dfsg.1/src/mame/drivers/s11c.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/s11c.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -23,11 +23,12 @@ **** Williams (WPC) **** Riverboat Gambler 50007 Hold CDE hit 1 CDE **** Krell Development **** -Star Trax --- unknown unknown +Star Trax --- X unknown Status: - All pinball machines are playable -- Star Trax has no pinball, but instead has many ball bearings (800 was mentioned), so will not be able to run +- Star Trax has no pinball, but instead has many ball bearings (800 was mentioned). Although it + can be started, and a score attained, it will eventually say PUMP ERROR and stop responding. ToDo: @@ -736,38 +737,38 @@ ROM_END -GAME(1990, bbnny_l2, 0, s11c, s11c, s11c_state, init_s11c, ROT0, "Bally", "Bugs Bunny Birthday Ball (L-2)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1990, bbnny_lu, bbnny_l2, s11c, s11c, s11c_state, init_s11c, ROT0, "Bally", "Bugs Bunny Birthday Ball (LU-2) European", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1990, diner_l4, 0, s11c, s11c, s11c_state, init_s11c, ROT0, "Williams", "Diner (LA-4)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1990, diner_l3, diner_l4, s11c, s11c, s11c_state, init_s11c, ROT0, "Williams", "Diner (LA-3)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1990, diner_l2, diner_l4, s11c, s11c, s11c_state, init_s11c, ROT0, "Williams", "Diner (LU-2) Europe", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1990, diner_f2, diner_l4, s11c, s11c, s11c_state, init_s11c, ROT0, "Williams", "Diner (LF-2) French", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1990, diner_l1, diner_l4, s11c, s11c, s11c_state, init_s11c, ROT0, "Williams", "Diner (LU-1) Europe", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1990, diner_p0, diner_l4, s11c, s11c, s11c_state, init_s11c, ROT0, "Williams", "Diner (PA-0 prototype)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1990, dd_l2, 0, s11c, s11c, s11c_state, init_s11c, ROT0, "Bally", "Dr. Dude (LA-2)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1990, dd_lu1, dd_l2, s11c, s11c, s11c_state, init_s11c, ROT0, "Bally", "Dr. Dude (LU-1) Europe", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1990, dd_p6, dd_l2, s11c, s11c, s11c_state, init_s11c, ROT0, "Bally", "Dr. Dude (PA-6)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1990, pool_l7, 0, s11c, s11c, s11c_state, init_s11c, ROT0, "Bally", "Pool Sharks (LA-7)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1990, pool_l6, pool_l7, s11c, s11c, s11c_state, init_s11c, ROT0, "Bally", "Pool Sharks (LA-6)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1990, pool_l5, pool_l7, s11c, s11c, s11c_state, init_s11c, ROT0, "Bally", "Pool Sharks (LA-5)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1990, pool_le2, pool_l7, s11c, s11c, s11c_state, init_s11c, ROT0, "Bally", "Pool Sharks (LE-2)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1989, pool_p7, pool_l7, s11c, s11c, s11c_state, init_s11c, ROT0, "Bally", "Pool Sharks (PA-7)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1990, radcl_l1, 0, s11c, s11c, s11c_state, init_s11c, ROT0, "Bally", "Radical! (L-1)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1990, radcl_g1, radcl_l1, s11c, s11c, s11c_state, init_s11c, ROT0, "Bally", "Radical! (G-1)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1990, radcl_p3, radcl_l1, s11c, s11c, s11c_state, init_s11c, ROT0, "Bally", "Radical! (P-3)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1990, rvrbt_l3, 0, s11c, s11c, s11c_state, init_s11c7, ROT0, "Williams", "Riverboat Gambler (L-3)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1990, rvrbt_p7, rvrbt_l3, s11c, s11c, s11c_state, init_s11c7, ROT0, "Williams", "Riverboat Gambler (PA-7)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1990, rollr_l2, 0, s11c, s11c, s11c_state, init_s11c, ROT0, "Williams", "Rollergames (L-2)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1991, rollr_ex, rollr_l2, s11c, s11c, s11c_state, init_s11c, ROT0, "Williams", "Rollergames (EXPERIMENTAL)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1991, rollr_e1, rollr_l2, s11c, s11c, s11c_state, init_s11c, ROT0, "Williams", "Rollergames (PU-1)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1991, rollr_p2, rollr_l2, s11c, s11c, s11c_state, init_s11c, ROT0, "Williams", "Rollergames (PA-2 / PA-1 Sound)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1990, rollr_l3, rollr_l2, s11c, s11c, s11c_state, init_s11c, ROT0, "Williams", "Rollergames (LU-3) Europe", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1990, rollr_g3, rollr_l2, s11c, s11c, s11c_state, init_s11c, ROT0, "Williams", "Rollergames (LG-3) Germany", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1991, rollr_f2, rollr_l2, s11c, s11c, s11c_state, init_s11c, ROT0, "Williams", "Rollergames (LF-2) French", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1990, rollr_f3, rollr_l2, s11c, s11c, s11c_state, init_s11c, ROT0, "Williams", "Rollergames (LF-3) French", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1990, rollr_d2, rollr_l2, s11c, s11c, s11c_state, init_s11c, ROT0, "Williams", "Rollergames (AD-2) Prototype", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1990, gs_lu4, 0, s11c, s11c, s11c_state, init_s11c, ROT0, "Bally", "The Bally Game Show (LU-4) Europe", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1990, gs_lu3, gs_lu4, s11c, s11c, s11c_state, init_s11c, ROT0, "Bally", "The Bally Game Show (LU-3) Europe", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1990, gs_la3, gs_lu4, s11c, s11c, s11c_state, init_s11c, ROT0, "Bally", "The Bally Game Show (LA-3)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1990, gs_lg6, gs_lu4, s11c, s11c, s11c_state, init_s11c, ROT0, "Bally", "The Bally Game Show (LG-6) Germany", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1990, strax_p7, 0, s11c, s11c, s11c_state, init_s11c, ROT0, "Krell Development", "Star Trax (domestic prototype)", MACHINE_IS_SKELETON_MECHANICAL) +GAME(1990, bbnny_l2, 0, s11c, s11c, s11c_state, init_s11c, ROT0, "Bally", "Bugs Bunny Birthday Ball (L-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1990, bbnny_lu, bbnny_l2, s11c, s11c, s11c_state, init_s11c, ROT0, "Bally", "Bugs Bunny Birthday Ball (LU-2) European", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1990, diner_l4, 0, s11c, s11c, s11c_state, init_s11c, ROT0, "Williams", "Diner (LA-4)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1990, diner_l3, diner_l4, s11c, s11c, s11c_state, init_s11c, ROT0, "Williams", "Diner (LA-3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1990, diner_l2, diner_l4, s11c, s11c, s11c_state, init_s11c, ROT0, "Williams", "Diner (LU-2) Europe", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1990, diner_f2, diner_l4, s11c, s11c, s11c_state, init_s11c, ROT0, "Williams", "Diner (LF-2) French", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1990, diner_l1, diner_l4, s11c, s11c, s11c_state, init_s11c, ROT0, "Williams", "Diner (LU-1) Europe", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1990, diner_p0, diner_l4, s11c, s11c, s11c_state, init_s11c, ROT0, "Williams", "Diner (PA-0 prototype)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1990, dd_l2, 0, s11c, s11c, s11c_state, init_s11c, ROT0, "Bally", "Dr. Dude (LA-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1990, dd_lu1, dd_l2, s11c, s11c, s11c_state, init_s11c, ROT0, "Bally", "Dr. Dude (LU-1) Europe", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1990, dd_p6, dd_l2, s11c, s11c, s11c_state, init_s11c, ROT0, "Bally", "Dr. Dude (PA-6)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1990, pool_l7, 0, s11c, s11c, s11c_state, init_s11c, ROT0, "Bally", "Pool Sharks (LA-7)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1990, pool_l6, pool_l7, s11c, s11c, s11c_state, init_s11c, ROT0, "Bally", "Pool Sharks (LA-6)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1990, pool_l5, pool_l7, s11c, s11c, s11c_state, init_s11c, ROT0, "Bally", "Pool Sharks (LA-5)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1990, pool_le2, pool_l7, s11c, s11c, s11c_state, init_s11c, ROT0, "Bally", "Pool Sharks (LE-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1989, pool_p7, pool_l7, s11c, s11c, s11c_state, init_s11c, ROT0, "Bally", "Pool Sharks (PA-7)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1990, radcl_l1, 0, s11c, s11c, s11c_state, init_s11c, ROT0, "Bally", "Radical! (L-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1990, radcl_g1, radcl_l1, s11c, s11c, s11c_state, init_s11c, ROT0, "Bally", "Radical! (G-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1990, radcl_p3, radcl_l1, s11c, s11c, s11c_state, init_s11c, ROT0, "Bally", "Radical! (P-3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1990, rvrbt_l3, 0, s11c, s11c, s11c_state, init_s11c7, ROT0, "Williams", "Riverboat Gambler (L-3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1990, rvrbt_p7, rvrbt_l3, s11c, s11c, s11c_state, init_s11c7, ROT0, "Williams", "Riverboat Gambler (PA-7)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1990, rollr_l2, 0, s11c, s11c, s11c_state, init_s11c, ROT0, "Williams", "Rollergames (L-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1991, rollr_ex, rollr_l2, s11c, s11c, s11c_state, init_s11c, ROT0, "Williams", "Rollergames (EXPERIMENTAL)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1991, rollr_e1, rollr_l2, s11c, s11c, s11c_state, init_s11c, ROT0, "Williams", "Rollergames (PU-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1991, rollr_p2, rollr_l2, s11c, s11c, s11c_state, init_s11c, ROT0, "Williams", "Rollergames (PA-2 / PA-1 Sound)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1990, rollr_l3, rollr_l2, s11c, s11c, s11c_state, init_s11c, ROT0, "Williams", "Rollergames (LU-3) Europe", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1990, rollr_g3, rollr_l2, s11c, s11c, s11c_state, init_s11c, ROT0, "Williams", "Rollergames (LG-3) Germany", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1991, rollr_f2, rollr_l2, s11c, s11c, s11c_state, init_s11c, ROT0, "Williams", "Rollergames (LF-2) French", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1990, rollr_f3, rollr_l2, s11c, s11c, s11c_state, init_s11c, ROT0, "Williams", "Rollergames (LF-3) French", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1990, rollr_d2, rollr_l2, s11c, s11c, s11c_state, init_s11c, ROT0, "Williams", "Rollergames (AD-2) Prototype", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1990, gs_lu4, 0, s11c, s11c, s11c_state, init_s11c, ROT0, "Bally", "The Bally Game Show (LU-4) Europe", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1990, gs_lu3, gs_lu4, s11c, s11c, s11c_state, init_s11c, ROT0, "Bally", "The Bally Game Show (LU-3) Europe", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1990, gs_la3, gs_lu4, s11c, s11c, s11c_state, init_s11c, ROT0, "Bally", "The Bally Game Show (LA-3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1990, gs_lg6, gs_lu4, s11c, s11c, s11c_state, init_s11c, ROT0, "Bally", "The Bally Game Show (LG-6) Germany", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1990, strax_p7, 0, s11c, s11c, s11c_state, init_s11c, ROT0, "Krell Development", "Star Trax (domestic prototype)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/s11.cpp mame-0.243+dfsg.1/src/mame/drivers/s11.cpp --- mame-0.242+dfsg.1/src/mame/drivers/s11.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/s11.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -698,11 +698,11 @@ // Pinball -GAME( 1986, grand_l4, 0, s11_bgs, s11, s11_state, init_s11, ROT0, "Williams", "Grand Lizard (L-4)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1986, grand_l3, grand_l4, s11_bgs, s11, s11_state, init_s11, ROT0, "Williams", "Grand Lizard (L-3)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1986, hs_l4, 0, s11_bgs, s11, s11_state, init_s11, ROT0, "Williams", "High Speed (L-4)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1986, hs_l3, hs_l4, s11_bgs, s11, s11_state, init_s11, ROT0, "Williams", "High Speed (L-3)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1986, rdkng_l4, 0, s11_bgm, s11, s11_state, init_s11, ROT0, "Williams", "Road Kings (L-4)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1986, rdkng_l1, rdkng_l4, s11_bgm, s11, s11_state, init_s11, ROT0, "Williams", "Road Kings (L-1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1986, rdkng_l2, rdkng_l4, s11_bgm, s11, s11_state, init_s11, ROT0, "Williams", "Road Kings (L-2)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1986, rdkng_l3, rdkng_l4, s11_bgm, s11, s11_state, init_s11, ROT0, "Williams", "Road Kings (L-3)", MACHINE_IS_SKELETON_MECHANICAL ) +GAME( 1986, grand_l4, 0, s11_bgs, s11, s11_state, init_s11, ROT0, "Williams", "Grand Lizard (L-4)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1986, grand_l3, grand_l4, s11_bgs, s11, s11_state, init_s11, ROT0, "Williams", "Grand Lizard (L-3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1986, hs_l4, 0, s11_bgs, s11, s11_state, init_s11, ROT0, "Williams", "High Speed (L-4)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1986, hs_l3, hs_l4, s11_bgs, s11, s11_state, init_s11, ROT0, "Williams", "High Speed (L-3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1986, rdkng_l4, 0, s11_bgm, s11, s11_state, init_s11, ROT0, "Williams", "Road Kings (L-4)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1986, rdkng_l1, rdkng_l4, s11_bgm, s11, s11_state, init_s11, ROT0, "Williams", "Road Kings (L-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1986, rdkng_l2, rdkng_l4, s11_bgm, s11, s11_state, init_s11, ROT0, "Williams", "Road Kings (L-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1986, rdkng_l3, rdkng_l4, s11_bgm, s11, s11_state, init_s11, ROT0, "Williams", "Road Kings (L-3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/s3.cpp mame-0.243+dfsg.1/src/mame/drivers/s3.cpp --- mame-0.242+dfsg.1/src/mame/drivers/s3.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/s3.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -717,10 +717,10 @@ } // Anonymous namespace -GAME( 1977, httip_l1, 0, s3, httip, s3_state, empty_init, ROT0, "Williams", "Hot Tip (L-1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1977, lucky_l1, 0, s3, lucky, s3_state, init_4, ROT0, "Williams", "Lucky Seven (L-1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1978, wldcp_l1, 0, s3a, wldcp, s3a_state, init_1, ROT0, "Williams", "World Cup (L-1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1978, disco_l1, 0, s3a, disco, s3a_state, init_3, ROT0, "Williams", "Disco Fever (L-1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1978, cntct_l1, 0, s3a, cntct, s3a_state, init_2, ROT0, "Williams", "Contact (L-1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1978, phnix_l1, 0, s3a, phnix, s3a_state, init_2, ROT0, "Williams", "Phoenix (L-1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1978, pkrno_l1, 0, s3a, pkrno, s3a_state, empty_init, ROT0, "Williams", "Pokerino (L-1)", MACHINE_IS_SKELETON_MECHANICAL ) +GAME( 1977, httip_l1, 0, s3, httip, s3_state, empty_init, ROT0, "Williams", "Hot Tip (L-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1977, lucky_l1, 0, s3, lucky, s3_state, init_4, ROT0, "Williams", "Lucky Seven (L-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1978, wldcp_l1, 0, s3a, wldcp, s3a_state, init_1, ROT0, "Williams", "World Cup (L-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1978, disco_l1, 0, s3a, disco, s3a_state, init_3, ROT0, "Williams", "Disco Fever (L-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1978, cntct_l1, 0, s3a, cntct, s3a_state, init_2, ROT0, "Williams", "Contact (L-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1978, phnix_l1, 0, s3a, phnix, s3a_state, init_2, ROT0, "Williams", "Phoenix (L-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1978, pkrno_l1, 0, s3a, pkrno, s3a_state, empty_init, ROT0, "Williams", "Pokerino (L-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/s4.cpp mame-0.243+dfsg.1/src/mame/drivers/s4.cpp --- mame-0.242+dfsg.1/src/mame/drivers/s4.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/s4.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -595,12 +595,12 @@ } // Anonymous namespace // Pinball -GAME( 1979, flash_l2, 0, s4, flash, s4_state, empty_init, ROT0, "Williams", "Flash (Williams, L-2)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1979, flash_l1, flash_l2, s4, flash, s4_state, empty_init, ROT0, "Williams", "Flash (Williams, L-1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1979, flash_t1, flash_l2, s4, flash, s4_state, empty_init, ROT0, "Williams", "Flash (Williams, T-1) Ted Estes", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1978, trizn_l1, 0, s4, trizn, s4_state, empty_init, ROT0, "Williams", "Tri Zone (L-1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1978, trizn_t1, trizn_l1, s4, trizn, s4_state, empty_init, ROT0, "Williams", "Tri Zone (T-1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1979, tmwrp_l3, 0, s4, tmwrp, s4_state, empty_init, ROT0, "Williams", "Time Warp (Williams, L-3)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1979, tmwrp_l2, tmwrp_l3, s4, tmwrp, s4_state, empty_init, ROT0, "Williams", "Time Warp (Williams, L-2)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1979, tmwrp_t2, tmwrp_l3, s4, tmwrp, s4_state, empty_init, ROT0, "Williams", "Time Warp (Williams, T-2)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1979, stlwr_l2, 0, s4, stlwr, s4_state, empty_init, ROT0, "Williams", "Stellar Wars (L-2)", MACHINE_IS_SKELETON_MECHANICAL ) +GAME( 1979, flash_l2, 0, s4, flash, s4_state, empty_init, ROT0, "Williams", "Flash (Williams, L-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1979, flash_l1, flash_l2, s4, flash, s4_state, empty_init, ROT0, "Williams", "Flash (Williams, L-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1979, flash_t1, flash_l2, s4, flash, s4_state, empty_init, ROT0, "Williams", "Flash (Williams, T-1) Ted Estes", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1978, trizn_l1, 0, s4, trizn, s4_state, empty_init, ROT0, "Williams", "Tri Zone (L-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1978, trizn_t1, trizn_l1, s4, trizn, s4_state, empty_init, ROT0, "Williams", "Tri Zone (T-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1979, tmwrp_l3, 0, s4, tmwrp, s4_state, empty_init, ROT0, "Williams", "Time Warp (Williams, L-3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1979, tmwrp_l2, tmwrp_l3, s4, tmwrp, s4_state, empty_init, ROT0, "Williams", "Time Warp (Williams, L-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1979, tmwrp_t2, tmwrp_l3, s4, tmwrp, s4_state, empty_init, ROT0, "Williams", "Time Warp (Williams, T-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1979, stlwr_l2, 0, s4, stlwr, s4_state, empty_init, ROT0, "Williams", "Stellar Wars (L-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/s6.cpp mame-0.243+dfsg.1/src/mame/drivers/s6.cpp --- mame-0.242+dfsg.1/src/mame/drivers/s6.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/s6.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -775,20 +775,20 @@ } // anonymous namespace -GAME( 1979, lzbal_l2, 0, s6, lzbal, s6_state, empty_init, ROT0, "Williams", "Laser Ball (L-2)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1979, lzbal_l2sp, lzbal_l2, s6, lzbal, s6_state, empty_init, ROT0, "Williams", "Laser Ball (L-2, PROM sound)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1980, lzbal_t2, lzbal_l2, s6, lzbal, s6_state, empty_init, ROT0, "Williams", "Laser Ball (T-2)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1980, scrpn_l1, 0, s6, scrpn, s6_state, empty_init, ROT0, "Williams", "Scorpion (L-1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1980, scrpn_t1, scrpn_l1, s6, scrpn, s6_state, empty_init, ROT0, "Williams", "Scorpion (T-1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1979, blkou_l1, 0, s6, blkou, s6_state, empty_init, ROT0, "Williams", "Blackout (L-1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1979, blkou_t1, blkou_l1, s6, blkou, s6_state, empty_init, ROT0, "Williams", "Blackout (T-1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1979, blkou_f1, blkou_l1, s6, blkou, s6_state, empty_init, ROT0, "Williams", "Blackout (L-1, French Speech)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1979, grgar_l1, 0, s6, grgar, s6_state, empty_init, ROT0, "Williams", "Gorgar (L-1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1979, grgar_t1, grgar_l1, s6, grgar, s6_state, empty_init, ROT0, "Williams", "Gorgar (T-1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1980, frpwr_l6, 0, s6, frpwr, s6_state, empty_init, ROT0, "Williams", "Firepower (L-6)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1980, frpwr_t6, frpwr_l6, s6, frpwr, s6_state, empty_init, ROT0, "Williams", "Firepower (T-6)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1980, frpwr_l2, frpwr_l6, s6, frpwr, s6_state, empty_init, ROT0, "Williams", "Firepower (L-2)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1980, algar_l1, 0, s6a, algar, s6_state, empty_init, ROT0, "Williams", "Algar (L-1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1980, alpok_l6, 0, s6a, alpok, s6_state, empty_init, ROT0, "Williams", "Alien Poker (L-6)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1980, alpok_l2, alpok_l6, s6a, alpok, s6_state, empty_init, ROT0, "Williams", "Alien Poker (L-2)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1980, alpok_f6, alpok_l6, s6a, alpok, s6_state, empty_init, ROT0, "Williams", "Alien Poker (L-6 French speech)", MACHINE_IS_SKELETON_MECHANICAL ) +GAME( 1979, lzbal_l2, 0, s6, lzbal, s6_state, empty_init, ROT0, "Williams", "Laser Ball (L-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1979, lzbal_l2sp, lzbal_l2, s6, lzbal, s6_state, empty_init, ROT0, "Williams", "Laser Ball (L-2, PROM sound)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1980, lzbal_t2, lzbal_l2, s6, lzbal, s6_state, empty_init, ROT0, "Williams", "Laser Ball (T-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1980, scrpn_l1, 0, s6, scrpn, s6_state, empty_init, ROT0, "Williams", "Scorpion (L-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1980, scrpn_t1, scrpn_l1, s6, scrpn, s6_state, empty_init, ROT0, "Williams", "Scorpion (T-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1979, blkou_l1, 0, s6, blkou, s6_state, empty_init, ROT0, "Williams", "Blackout (L-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1979, blkou_t1, blkou_l1, s6, blkou, s6_state, empty_init, ROT0, "Williams", "Blackout (T-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1979, blkou_f1, blkou_l1, s6, blkou, s6_state, empty_init, ROT0, "Williams", "Blackout (L-1, French Speech)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1979, grgar_l1, 0, s6, grgar, s6_state, empty_init, ROT0, "Williams", "Gorgar (L-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1979, grgar_t1, grgar_l1, s6, grgar, s6_state, empty_init, ROT0, "Williams", "Gorgar (T-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1980, frpwr_l6, 0, s6, frpwr, s6_state, empty_init, ROT0, "Williams", "Firepower (L-6)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1980, frpwr_t6, frpwr_l6, s6, frpwr, s6_state, empty_init, ROT0, "Williams", "Firepower (T-6)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1980, frpwr_l2, frpwr_l6, s6, frpwr, s6_state, empty_init, ROT0, "Williams", "Firepower (L-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1980, algar_l1, 0, s6a, algar, s6_state, empty_init, ROT0, "Williams", "Algar (L-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1980, alpok_l6, 0, s6a, alpok, s6_state, empty_init, ROT0, "Williams", "Alien Poker (L-6)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1980, alpok_l2, alpok_l6, s6a, alpok, s6_state, empty_init, ROT0, "Williams", "Alien Poker (L-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1980, alpok_f6, alpok_l6, s6a, alpok, s6_state, empty_init, ROT0, "Williams", "Alien Poker (L-6 French speech)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/s7.cpp mame-0.243+dfsg.1/src/mame/drivers/s7.cpp --- mame-0.242+dfsg.1/src/mame/drivers/s7.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/s7.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -48,6 +48,7 @@ HyperBall 509 1 unknown Barracora 510 ASD hit 1 ASD Varkon 512 AX hit 1 AX +Spellbinder (unreleased) 513 Reflex (unreleased) 514 Time Fantasy 515 1 X Warlok 516 1 X @@ -58,7 +59,6 @@ Wild Texas *(521) AS hit 1 AS Guardian (unreleased) 523 Star Fighter (unreleased) 524 -Rat Race 527 (10 produced, see s9.cpp) Light Speed (unreleased) 528 Starlight 530 AS hit 1 AS @@ -1102,29 +1102,29 @@ } // Anonymous namespace -GAME( 1980, bk_l4, 0, s7, bk, s7_state, empty_init, ROT0, "Williams", "Black Knight (L-4)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1980, bk_f4, bk_l4, s7, bk, s7_state, empty_init, ROT0, "Williams", "Black Knight (L-4, French speech)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1980, bk_l3, bk_l4, s7, bk, s7_state, empty_init, ROT0, "Williams", "Black Knight (L-3)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1980, csmic_l1, 0, s7, csmic, s7_state, empty_init, ROT0, "Williams", "Cosmic Gunfight (L-1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1981, jngld_l2, 0, s7, jngld, s7_state, empty_init, ROT0, "Williams", "Jungle Lord (L-2)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1981, jngld_l1, jngld_l2, s7, jngld, s7_state, empty_init, ROT0, "Williams", "Jungle Lord (L-1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1981, pharo_l2, 0, s7, pharo, s7_state, empty_init, ROT0, "Williams", "Pharaoh (L-2)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1981, solar_l2, 0, s7, solar, s7_state, empty_init, ROT0, "Williams", "Solar Fire (L-2)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1982, thund_p1, 0, s7, thund, s7_state, init_1, ROT0, "Williams", "Thunderball (P-1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1982, thund_p2, thund_p1, s7, thund, s7_state, init_1, ROT0, "Williams", "Thunderball (P-2)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1982, thund_p3, thund_p1, s7, thund, s7_state, init_1, ROT0, "Williams", "Thunderball (P-3)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1981, hypbl_l4, 0, s7, hypbl, s7_state, empty_init, ROT0, "Williams", "HyperBall (L-4)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1981, hypbl_l3, hypbl_l4, s7, hypbl, s7_state, empty_init, ROT0, "Williams", "HyperBall (L-3)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1981, hypbl_l2, hypbl_l4, s7, hypbl, s7_state, empty_init, ROT0, "Williams", "HyperBall (L-2)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1981, barra_l1, 0, s7, barra, s7_state, empty_init, ROT0, "Williams", "Barracora (L-1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1982, vrkon_l1, 0, s7, vrkon, s7_state, empty_init, ROT0, "Williams", "Varkon (L-1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1982, tmfnt_l5, 0, s7, tmfnt, s7_state, empty_init, ROT0, "Williams", "Time Fantasy (L-5)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1982, wrlok_l3, 0, s7, wrlok, s7_state, empty_init, ROT0, "Williams", "Warlok (L-3)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1982, dfndr_l4, 0, s7, dfndr, s7_state, empty_init, ROT0, "Williams", "Defender (L-4)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1983, jst_l2, 0, s7, jst, s7_state, empty_init, ROT0, "Williams", "Joust (L-2)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1983, jst_l1, jst_l2, s7, jst, s7_state, empty_init, ROT0, "Williams", "Joust (L-1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1983, lsrcu_l2, 0, s7, lsrcu, s7_state, empty_init, ROT0, "Williams", "Laser Cue (L-2)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1983, fpwr2_l2, 0, s7, fpwr2, s7_state, empty_init, ROT0, "Williams", "Firepower II (L-2)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1984, strlt_l1, 0, s7, strlt, s7_state, empty_init, ROT0, "Williams", "Star Light (L-1)", MACHINE_IS_SKELETON_MECHANICAL ) +GAME( 1980, bk_l4, 0, s7, bk, s7_state, empty_init, ROT0, "Williams", "Black Knight (L-4)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1980, bk_f4, bk_l4, s7, bk, s7_state, empty_init, ROT0, "Williams", "Black Knight (L-4, French speech)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1980, bk_l3, bk_l4, s7, bk, s7_state, empty_init, ROT0, "Williams", "Black Knight (L-3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1980, csmic_l1, 0, s7, csmic, s7_state, empty_init, ROT0, "Williams", "Cosmic Gunfight (L-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1981, jngld_l2, 0, s7, jngld, s7_state, empty_init, ROT0, "Williams", "Jungle Lord (L-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1981, jngld_l1, jngld_l2, s7, jngld, s7_state, empty_init, ROT0, "Williams", "Jungle Lord (L-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1981, pharo_l2, 0, s7, pharo, s7_state, empty_init, ROT0, "Williams", "Pharaoh (L-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1981, solar_l2, 0, s7, solar, s7_state, empty_init, ROT0, "Williams", "Solar Fire (L-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1982, thund_p1, 0, s7, thund, s7_state, init_1, ROT0, "Williams", "Thunderball (P-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1982, thund_p2, thund_p1, s7, thund, s7_state, init_1, ROT0, "Williams", "Thunderball (P-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1982, thund_p3, thund_p1, s7, thund, s7_state, init_1, ROT0, "Williams", "Thunderball (P-3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1981, hypbl_l4, 0, s7, hypbl, s7_state, empty_init, ROT0, "Williams", "HyperBall (L-4)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1981, hypbl_l3, hypbl_l4, s7, hypbl, s7_state, empty_init, ROT0, "Williams", "HyperBall (L-3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1981, hypbl_l2, hypbl_l4, s7, hypbl, s7_state, empty_init, ROT0, "Williams", "HyperBall (L-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1981, barra_l1, 0, s7, barra, s7_state, empty_init, ROT0, "Williams", "Barracora (L-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1982, vrkon_l1, 0, s7, vrkon, s7_state, empty_init, ROT0, "Williams", "Varkon (L-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1982, tmfnt_l5, 0, s7, tmfnt, s7_state, empty_init, ROT0, "Williams", "Time Fantasy (L-5)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1982, wrlok_l3, 0, s7, wrlok, s7_state, empty_init, ROT0, "Williams", "Warlok (L-3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1982, dfndr_l4, 0, s7, dfndr, s7_state, empty_init, ROT0, "Williams", "Defender (L-4)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1983, jst_l2, 0, s7, jst, s7_state, empty_init, ROT0, "Williams", "Joust (L-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1983, jst_l1, jst_l2, s7, jst, s7_state, empty_init, ROT0, "Williams", "Joust (L-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1983, lsrcu_l2, 0, s7, lsrcu, s7_state, empty_init, ROT0, "Williams", "Laser Cue (L-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1983, fpwr2_l2, 0, s7, fpwr2, s7_state, empty_init, ROT0, "Williams", "Firepower II (L-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1984, strlt_l1, 0, s7, strlt, s7_state, empty_init, ROT0, "Williams", "Star Light (L-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // same hardware, unknown manufacturer, clone of fpwr2 -GAME( 1983, wldtexas, fpwr2_l2, s7, fpwr2, s7_state, empty_init, ROT0, "", "Wild Texas", MACHINE_IS_SKELETON_MECHANICAL ) +GAME( 1983, wldtexas, fpwr2_l2, s7, fpwr2, s7_state, empty_init, ROT0, "", "Wild Texas", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/s8a.cpp mame-0.243+dfsg.1/src/mame/drivers/s8a.cpp --- mame-0.242+dfsg.1/src/mame/drivers/s8a.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/s8a.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,353 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Robbbert -/*********************************************************************************** - -PINBALL -Williams System 8: Still Crazy (#543) - -The first time run, the display will show the model number. Press F3 to clear this. - -IMDB shows the number as 534, however both the game and the manual say 543. The -undumped System 10 game 4-in-1 (Pigskin/Poker/Willy at the Bat/Willy's Cup) also -was assigned number 543. - -A novelty game where the playfield is completely vertical. It has 4 flippers and the - idea is to get the ball up to the alcohol 'still' before the 'revenuers' do. The - idea didn't catch on, and the game was not officially released. 1 player. - The display shows Score and Batch. There is no credit display. - If the number of batches exceeds 9, the 'hidden digit' will show the tens. - You cannot get more than 99 batches. - The score only has 5 digits, but the game stores the 100,000 digit internally. - -How to play: Press 5, press 1, press Z. Add points by pressing F,G,H,J. Press J - a number of times to increment the batches. To end the game, hit X until the siren - is heard. If you scored > 99999 points, the high score will show 99999. - -Status: -- Playable - -ToDo: -- Nothing - -************************************************************************************/ - -#include "emu.h" -#include "machine/genpin.h" - -#include "cpu/m6800/m6800.h" -#include "audio/williams.h" -#include "machine/6821pia.h" -#include "speaker.h" - -#include "s8a.lh" - - -namespace { - -class s8a_state : public genpin_class -{ -public: - s8a_state(const machine_config &mconfig, device_type type, const char *tag) - : genpin_class(mconfig, type, tag) - , m_maincpu(*this, "maincpu") - , m_s9sound(*this, "s9sound") - , m_pia21(*this, "pia21") - , m_pia24(*this, "pia24") - , m_pia28(*this, "pia28") - , m_pia30(*this, "pia30") - , m_io_keyboard(*this, "X%d", 0U) - , m_digits(*this, "digit%d", 0U) - , m_io_outputs(*this, "out%d", 0U) - { } - - void s8a(machine_config &config); - - DECLARE_INPUT_CHANGED_MEMBER(main_nmi); - -protected: - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void device_timer(emu_timer &timer, device_timer_id id, int param) override; - -private: - void dig0_w(u8 data); - void dig1_w(u8 data); - void lamp0_w(u8 data); - void lamp1_w(u8 data); - void sol2_w(u8 data) { for (u8 i = 0; i < 8; i++) m_io_outputs[8U+i] = BIT(data, i); }; // solenoids 8-15 - void sol3_w(u8 data); // solenoids 0-7 - u8 switch_r(); - void switch_w(u8 data); - DECLARE_READ_LINE_MEMBER(pia21_ca1_r); - DECLARE_WRITE_LINE_MEMBER(pia21_cb2_w) { } // enable solenoids - DECLARE_WRITE_LINE_MEMBER(pia24_cb2_w) { m_io_outputs[16] = state; } // not used - DECLARE_WRITE_LINE_MEMBER(pia28_ca2_w) { } // comma3&4 (not used) - DECLARE_WRITE_LINE_MEMBER(pia28_cb2_w) { } // comma1&2 (not used) - DECLARE_WRITE_LINE_MEMBER(pia_irq); - - void main_map(address_map &map); - - u8 m_strobe = 0; - u8 m_row = 0; - bool m_data_ok = false; - u8 m_lamp_data = 0; - emu_timer* m_irq_timer = nullptr; - static const device_timer_id TIMER_IRQ = 0; - required_device m_maincpu; - required_device m_s9sound; - required_device m_pia21; - required_device m_pia24; - required_device m_pia28; - required_device m_pia30; - required_ioport_array<8> m_io_keyboard; - output_finder<61> m_digits; - output_finder<86> m_io_outputs; // 22 solenoids + 64 lamps -}; - -void s8a_state::main_map(address_map &map) -{ - map.global_mask(0x7fff); - map(0x0000, 0x07ff).ram().share("nvram"); - map(0x2100, 0x2103).rw(m_pia21, FUNC(pia6821_device::read), FUNC(pia6821_device::write)); // sound+solenoids - map(0x2200, 0x2200).w(FUNC(s8a_state::sol3_w)); // solenoids - map(0x2400, 0x2403).rw(m_pia24, FUNC(pia6821_device::read), FUNC(pia6821_device::write)); // lamps - map(0x2800, 0x2803).rw(m_pia28, FUNC(pia6821_device::read), FUNC(pia6821_device::write)); // display - map(0x3000, 0x3003).rw(m_pia30, FUNC(pia6821_device::read), FUNC(pia6821_device::write)); // inputs - map(0x6000, 0x7fff).rom().region("maincpu", 0); -} - -static INPUT_PORTS_START( s8a ) - PORT_START("X0") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_9) PORT_NAME("Tilt") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN1 ) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START ) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_V) PORT_NAME("Top L Flip") // INP04 - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_B) PORT_NAME("Bot L Flip") // INP05 - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_N) PORT_NAME("Top R Flip") // INP06 - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_M) PORT_NAME("Bot R Flip") // INP07 - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_U) PORT_NAME("Low L Drain") // INP08 - - PORT_START("X1") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_Z) PORT_NAME("Lower Ramp Limit") // INP09 game mechanics are ready to start - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_O) PORT_NAME("Top Drain") // INP10 - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_I) PORT_NAME("Middle R Drain") //INP11 - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_F) PORT_NAME("Level 1") // INP12 - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_G) PORT_NAME("Level 2") // INP13 - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_H) PORT_NAME("Level 3") // INP14 - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_J) PORT_NAME("Level 4") // INP15 - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_X) PORT_NAME("Upper Ramp Limit") // INP16 revenuers have reached the still - - PORT_START("X2") - PORT_START("X3") - PORT_START("X4") - PORT_START("X5") - PORT_START("X6") - PORT_START("X7") - - PORT_START("DIAGS") - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Main Diag") PORT_CODE(KEYCODE_0_PAD) PORT_CHANGED_MEMBER(DEVICE_SELF, s8a_state, main_nmi, 1) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Advance") PORT_CODE(KEYCODE_1_PAD) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Up/Down") PORT_CODE(KEYCODE_2_PAD) PORT_TOGGLE -INPUT_PORTS_END - -INPUT_CHANGED_MEMBER( s8a_state::main_nmi ) -{ - // Diagnostic button sends a pulse to NMI pin - if (newval==CLEAR_LINE) - m_maincpu->pulse_input_line(INPUT_LINE_NMI, attotime::zero); -} - -void s8a_state::sol3_w(u8 data) -{ - if (data==0x0a) - m_samples->start(0, 7); // mechanical drum when you have 2 or more batches - - for (u8 i = 0; i < 8; i++) - m_io_outputs[i] = BIT(data, i); -} - -READ_LINE_MEMBER( s8a_state::pia21_ca1_r ) -{ -// sound busy - return 1; -} - -void s8a_state::lamp0_w(u8 data) -{ - m_lamp_data = data ^ 0xff; -} - -void s8a_state::lamp1_w(u8 data) -{ - // find out which row is active - for (u8 i = 0; i < 8; i++) - if (BIT(data, i)) - for (u8 j = 0; j < 8; j++) - m_io_outputs[22U+i*8U+j] = BIT(m_lamp_data, j); -} - -void s8a_state::dig0_w(u8 data) -{ - static const u8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0x58, 0x4c, 0x62, 0x69, 0x78, 0 }; // 7447 - data &= 0x7f; - m_strobe = data & 15; - m_data_ok = true; - m_digits[60] = patterns[data>>4]; // diag digit -} - -void s8a_state::dig1_w(u8 data) -{ - static const u8 patterns[16] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0,0,0,0,0,0 }; // MC14543 - if (m_data_ok) - { - m_digits[m_strobe+16] = patterns[data&15]; - m_digits[m_strobe] = patterns[data>>4]; - } - m_data_ok = false; -} - -u8 s8a_state::switch_r() -{ - u8 data = 0; - // there's hardware for 8 rows, but machine uses 2 - for (u8 i = 0; i < 2; i++) - if (BIT(m_row, i)) - data |= m_io_keyboard[i]->read(); - - return data; -} - -void s8a_state::switch_w(u8 data) -{ - m_row = data; -} - -WRITE_LINE_MEMBER( s8a_state::pia_irq ) -{ - if(state == CLEAR_LINE) - { - // restart IRQ timer - m_irq_timer->adjust(attotime::from_ticks(980,1e6),1); - } - else - { - // disable IRQ timer while other IRQs are being handled - // (counter is reset every 32 cycles while a PIA IRQ is handled) - m_irq_timer->adjust(attotime::zero); - } -} - -void s8a_state::device_timer(emu_timer &timer, device_timer_id id, int param) -{ - switch(id) - { - case TIMER_IRQ: - if(param == 1) - { - m_maincpu->set_input_line(M6802_IRQ_LINE, ASSERT_LINE); - m_irq_timer->adjust(attotime::from_ticks(32,1e6),0); - m_pia28->ca1_w(BIT(ioport("DIAGS")->read(), 2)); // Advance - m_pia28->cb1_w(BIT(ioport("DIAGS")->read(), 3)); // Up/Down - } - else - { - m_maincpu->set_input_line(M6802_IRQ_LINE, CLEAR_LINE); - m_irq_timer->adjust(attotime::from_ticks(980,1e6),1); - m_pia28->ca1_w(1); - m_pia28->cb1_w(1); - } - break; - } -} - -void s8a_state::machine_start() -{ - genpin_class::machine_start(); - m_io_outputs.resolve(); - m_digits.resolve(); - - save_item(NAME(m_strobe)); - save_item(NAME(m_row)); - save_item(NAME(m_data_ok)); - save_item(NAME(m_lamp_data)); - - m_irq_timer = timer_alloc(TIMER_IRQ); - m_irq_timer->adjust(attotime::from_ticks(980,1e6),1); -} - -void s8a_state::machine_reset() -{ - genpin_class::machine_reset(); - for (u8 i = 0; i < m_io_outputs.size(); i++) - m_io_outputs[i] = 0; -} - -void s8a_state::s8a(machine_config &config) -{ - /* basic machine hardware */ - M6802(config, m_maincpu, XTAL(4'000'000)); - m_maincpu->set_ram_enable(false); - m_maincpu->set_addrmap(AS_PROGRAM, &s8a_state::main_map); - - /* Video */ - config.set_default_layout(layout_s8a); - - /* Sound */ - genpin_audio(config); - - /* Devices */ - PIA6821(config, m_pia21, 0); - m_pia21->set_port_a_input_overrides_output_mask(0xff); - m_pia21->readca1_handler().set(FUNC(s8a_state::pia21_ca1_r)); - m_pia21->writepa_handler().set("s9sound", FUNC(williams_s9_sound_device::write)); - m_pia21->writepb_handler().set(FUNC(s8a_state::sol2_w)); - m_pia21->ca2_handler().set("s9sound", FUNC(williams_s9_sound_device::strobe)); - m_pia21->cb2_handler().set(FUNC(s8a_state::pia21_cb2_w)); - m_pia21->irqa_handler().set(FUNC(s8a_state::pia_irq)); - m_pia21->irqb_handler().set(FUNC(s8a_state::pia_irq)); - - PIA6821(config, m_pia24, 0); - m_pia24->writepa_handler().set(FUNC(s8a_state::lamp0_w)); - m_pia24->writepb_handler().set(FUNC(s8a_state::lamp1_w)); - m_pia24->cb2_handler().set(FUNC(s8a_state::pia24_cb2_w)); - m_pia24->irqa_handler().set(FUNC(s8a_state::pia_irq)); - m_pia24->irqb_handler().set(FUNC(s8a_state::pia_irq)); - - PIA6821(config, m_pia28, 0); - m_pia28->writepa_handler().set(FUNC(s8a_state::dig0_w)); - m_pia28->writepb_handler().set(FUNC(s8a_state::dig1_w)); - m_pia28->ca2_handler().set(FUNC(s8a_state::pia28_ca2_w)); - m_pia28->cb2_handler().set(FUNC(s8a_state::pia28_cb2_w)); - m_pia28->irqa_handler().set(FUNC(s8a_state::pia_irq)); - m_pia28->irqb_handler().set(FUNC(s8a_state::pia_irq)); - - PIA6821(config, m_pia30, 0); - m_pia30->readpa_handler().set(FUNC(s8a_state::switch_r)); - m_pia30->set_port_a_input_overrides_output_mask(0xff); - m_pia30->writepb_handler().set(FUNC(s8a_state::switch_w)); - m_pia30->irqa_handler().set(FUNC(s8a_state::pia_irq)); - m_pia30->irqb_handler().set(FUNC(s8a_state::pia_irq)); - - NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - - /* Add the soundcard */ - SPEAKER(config, "mono").front_center(); - WILLIAMS_S9_SOUND(config, m_s9sound, 0).add_route(ALL_OUTPUTS, "mono", 1.0); -} - - -/*---------------------------- -/ Still Crazy (#543) 06/1984 -/-----------------------------*/ -ROM_START(scrzy_l1) - ROM_REGION(0x2000, "maincpu", ROMREGION_ERASEFF) - ROM_LOAD("ic20.bin", 0x0000, 0x2000, CRC(b0df42e6) SHA1(bb10268d7b820d1de0c20e1b79aba558badd072b) ) - - ROM_REGION(0x8000, "s9sound:audiocpu", ROMREGION_ERASEFF) - // 1st and 2nd halves are identical - ROM_LOAD("ic49.bin", 0x4000, 0x4000, CRC(bcc8ccc4) SHA1(2312f9cc4f5a2dadfbfa61d13c31bb5838adf152) ) -ROM_END - -} // Anonymous namespace - -GAME( 1984, scrzy_l1, 0, s8a, s8a, s8a_state, empty_init, ROT0, "Williams", "Still Crazy", MACHINE_IS_SKELETON_MECHANICAL ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/s8.cpp mame-0.243+dfsg.1/src/mame/drivers/s8.cpp --- mame-0.242+dfsg.1/src/mame/drivers/s8.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/s8.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -4,9 +4,8 @@ PINBALL Williams System 8 -These are not true pinballs in the normal sense, but are unusual novelty - machines. Unfortunately they were mostly cancelled before production could - begin. +These are not true pinballs in the normal sense, but are unusual novelty machines. + Unfortunately they were mostly cancelled before production could begin. Differences to system 7: - PIA at 0x2200 removed @@ -16,6 +15,8 @@ Games: - Pennant Fever (#526) +- Rat Race (#527) (10 produced) +- Rat Race II (#533) - Gridiron (#538) - Still Crazy (#543) - Break Street @@ -23,9 +24,12 @@ The first time run, the display will show the model number. Press F3 to clear this. -Pennant Fever is a baseball game where you aim for targets at the top of the - playfield, and the players advance towards a home run. There are no bumpers - or other 'usual' pinball items. 1 or 2 players. + +PENNANT FEVER +============= +This is a baseball game where you aim for targets at the top of the playfield, and the + players advance towards a home run. There are no bumpers or other 'usual' pinball + items. 1 or 2 players. Buttons: Pitch (Fast, Curve, Change Up), Bat. How to play: - Insert coin (credits shows in innings) @@ -42,21 +46,66 @@ - After 3 Innings, it's game over. - Match digit appears in Outs digit. -Gridiron, a conversion kit for Pennant Fever. Didn't get past the prototype stage. - The display shows Player 1 and 2 (3 digits each), Possessions and Downs (2 digits each). - -Still Crazy, also only a prototype. See s8a.cpp for more. -Break Street, another failed novelty, not much is known about it. Seems it - features a break-dancing toy and a spinning disk. - -Arena, a one-off prototype table model, similar idea to the system-7 Defender. +GRIDIRON +======== +A conversion kit for Pennant Fever. Didn't get past the prototype stage. The display shows + Player 1 and 2 (3 digits each), Possessions and Downs (2 digits each). + + +STILL CRAZY +=========== +IMDB shows the number as 534, however both the game and the manual say 543. The + undumped System 10 game 4-in-1 (Pigskin/Poker/Willy at the Bat/Willy's Cup) also + was assigned number 543. + +A novelty game where the playfield is completely vertical. It has 4 flippers and the + idea is to get the ball up to the alcohol 'still' before the 'revenuers' do. The + idea didn't catch on, and the game was not officially released. 1 player. + The display shows Score and Batch. There is no credit display. + If the number of batches exceeds 9, the 'hidden digit' will show the tens. + You cannot get more than 99 batches. + The score only has 5 digits, but the game stores the 100,000 digit internally. + +How to play: Press 5, press 1, press Z. Add points by pressing F,G,H,J. Press J + a number of times to increment the batches. To end the game, hit X until the siren + is heard. If you scored > 99999 points, the high score will show 99999. + + +BREAK STREET +============ +Another failed novelty, not much is known about it. Seems it features a break-dancing + toy and a spinning disk. + + +ARENA +===== +A one-off prototype table model, similar idea to the system-7 Defender. + + +RAT RACE +======== +Rat Race is played in a cocktail cabinet, the player uses a joystick to tilt the + board, to coax the ball into following lit passages in a maze. After a successful + navigation, the maze changes to something else faster and harder. It's almost an + arcade game done mechanically. Obviously there is no way to emulate it in its intended + form. Probably would have been a nice game, but it never passed the prototype stage. + Bad byte at "maincpu" D7FF, although it doesn't seem to cause an issue. + +How to play: Press 5, press 1. If you want 2 players, also press 2. The display flashes + the ball number. Press Z to get the ball into play. The display alternates between the + score and the seconds remaining to accomplish the task. After the series of passages + has been followed, a bonus flashes for a few seconds, which you must also run over. + While one player is playing, the other player's score shows what seem to be random + numbers (but probably are not). The real machine does this too. + If time runs out, the ball is over. After 3 balls, it's game over. Status: - Playable ToDo: - Nothing +- Rat Race: need a manual, playboard switches are unknown. ************************************************************************************/ @@ -64,11 +113,14 @@ #include "machine/genpin.h" #include "cpu/m6800/m6800.h" +#include "audio/williams.h" #include "machine/6821pia.h" #include "sound/dac.h" #include "speaker.h" -#include "s8.lh" +#include "s8pfevr.lh" +#include "s8ratrc.lh" +#include "s8scrzy.lh" namespace { @@ -85,12 +137,17 @@ , m_pia24(*this, "pia24") , m_pia28(*this, "pia28") , m_pia30(*this, "pia30") + , m_s9sound(*this, "s9sound") , m_io_keyboard(*this, "X%d", 0U) , m_digits(*this, "digit%d", 0U) , m_io_outputs(*this, "out%d", 0U) { } void s8(machine_config &config); + void pfevr(machine_config &config); + void ratrc(machine_config &config); + void scrzy(machine_config &config); + void psound(machine_config &config); DECLARE_INPUT_CHANGED_MEMBER(main_nmi); DECLARE_INPUT_CHANGED_MEMBER(audio_nmi); @@ -104,10 +161,12 @@ u8 sound_r(); void dig0_w(u8 data); void dig1_w(u8 data); + void ratrc_dig1_w(u8 data); void lamp0_w(u8 data); void lamp1_w(u8 data); - void sol2_w(u8 data) { for (u8 i = 0; i < 8; i++) m_io_outputs[8U+i] = BIT(data, i); }; // solenoids 8-15 + void sol2_w(u8 data); void sol3_w(u8 data); // solenoids 0-7 + void scrzy_sol3_w(u8 data); // solenoids 0-7 void sound_w(u8 data); u8 switch_r(); void switch_w(u8 data); @@ -115,27 +174,31 @@ DECLARE_WRITE_LINE_MEMBER(pia21_ca2_w); DECLARE_WRITE_LINE_MEMBER(pia21_cb2_w) { } // enable solenoids DECLARE_WRITE_LINE_MEMBER(pia24_cb2_w) { m_io_outputs[16] = state; } // dummy to stop error log filling up - DECLARE_WRITE_LINE_MEMBER(pia28_ca2_w) { } // comma3&4 - DECLARE_WRITE_LINE_MEMBER(pia28_cb2_w) { } // comma1&2 + DECLARE_WRITE_LINE_MEMBER(pia28_ca2_w) { m_comma34 = state; } // comma3&4 + DECLARE_WRITE_LINE_MEMBER(pia28_cb2_w) { m_comma12 = state; } // comma1&2 DECLARE_WRITE_LINE_MEMBER(pia_irq); void audio_map(address_map &map); void main_map(address_map &map); + void scrzy_map(address_map &map); u8 m_sound_data = 0U; u8 m_strobe = 0U; u8 m_row = 0U; + bool m_comma12 = false; + bool m_comma34 = false; bool m_data_ok = false; u8 m_lamp_data = 0U; emu_timer* m_irq_timer = nullptr; static const device_timer_id TIMER_IRQ = 0; required_device m_maincpu; - required_device m_audiocpu; - required_device m_pias; + optional_device m_audiocpu; + optional_device m_pias; required_device m_pia21; required_device m_pia24; required_device m_pia28; required_device m_pia30; + optional_device m_s9sound; required_ioport_array<8> m_io_keyboard; output_finder<61> m_digits; output_finder<86> m_io_outputs; // 22 solenoids + 64 lamps @@ -150,7 +213,14 @@ map(0x2400, 0x2403).rw(m_pia24, FUNC(pia6821_device::read), FUNC(pia6821_device::write)); // lamps map(0x2800, 0x2803).rw(m_pia28, FUNC(pia6821_device::read), FUNC(pia6821_device::write)); // display map(0x3000, 0x3003).rw(m_pia30, FUNC(pia6821_device::read), FUNC(pia6821_device::write)); // inputs - map(0x5000, 0x7fff).rom().region("maincpu", 0); + map(0x4000, 0x7fff).rom().region("maincpu", 0); +} + +void s8_state::scrzy_map(address_map &map) +{ + main_map(map); + map.global_mask(0x7fff); + map(0x2200, 0x2200).w(FUNC(s8_state::scrzy_sol3_w)); // solenoids } void s8_state::audio_map(address_map &map) @@ -160,7 +230,7 @@ map(0xc000, 0xffff).rom().region("audiocpu", 0); } -static INPUT_PORTS_START( s8 ) +static INPUT_PORTS_START( pfevr ) PORT_START("X0") PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_8) PORT_NAME("Plumb Tilt") // 3 touches before it tilts PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_9) PORT_NAME("Tilt") @@ -207,6 +277,116 @@ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Up/Down") PORT_CODE(KEYCODE_2_PAD) PORT_TOGGLE INPUT_PORTS_END +static INPUT_PORTS_START( scrzy ) + PORT_START("X0") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_9) PORT_NAME("Tilt") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN1 ) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START ) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_V) PORT_NAME("Top L Flip") // INP04 + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_B) PORT_NAME("Bot L Flip") // INP05 + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_N) PORT_NAME("Top R Flip") // INP06 + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_M) PORT_NAME("Bot R Flip") // INP07 + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_U) PORT_NAME("Low L Drain") // INP08 + + PORT_START("X1") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_Z) PORT_NAME("Lower Ramp Limit") // INP09 game mechanics are ready to start + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_O) PORT_NAME("Top Drain") // INP10 + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_I) PORT_NAME("Middle R Drain") //INP11 + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_F) PORT_NAME("Level 1") // INP12 + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_G) PORT_NAME("Level 2") // INP13 + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_H) PORT_NAME("Level 3") // INP14 + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_J) PORT_NAME("Level 4") // INP15 + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_X) PORT_NAME("Upper Ramp Limit") // INP16 revenuers have reached the still + + PORT_START("X2") + PORT_START("X3") + PORT_START("X4") + PORT_START("X5") + PORT_START("X6") + PORT_START("X7") + + PORT_START("DIAGS") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Main Diag") PORT_CODE(KEYCODE_0_PAD) PORT_CHANGED_MEMBER(DEVICE_SELF, s8_state, main_nmi, 1) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Advance") PORT_CODE(KEYCODE_1_PAD) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Up/Down") PORT_CODE(KEYCODE_2_PAD) PORT_TOGGLE +INPUT_PORTS_END + +static INPUT_PORTS_START( ratrc ) + PORT_START("X0") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 ) // 2nd player start + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START ) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN2 ) + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 ) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_0) PORT_NAME("Slam Tilt") + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("High Score Reset") + + PORT_START("X1") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_A) PORT_NAME("INP09") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_B) PORT_NAME("INP10") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_C) PORT_NAME("INP11") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_D) PORT_NAME("INP12") + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_E) PORT_NAME("INP13") + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_F) PORT_NAME("INP14") + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_G) PORT_NAME("INP15") + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_H) PORT_NAME("INP16") + + PORT_START("X2") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_I) PORT_NAME("INP17") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_J) PORT_NAME("INP18") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_K) PORT_NAME("INP19") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_L) PORT_NAME("INP20") + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_M) PORT_NAME("INP21") + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_N) PORT_NAME("INP22") + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_O) PORT_NAME("INP23") + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_P) PORT_NAME("INP24") + + PORT_START("X3") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_Q) PORT_NAME("INP25") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_R) PORT_NAME("INP26") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_S) PORT_NAME("INP27") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_T) PORT_NAME("INP28") + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_U) PORT_NAME("INP29") + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_V) PORT_NAME("INP30") + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_W) PORT_NAME("INP31") + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_X) PORT_NAME("INP32") + + PORT_START("X4") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_Y) PORT_NAME("INP33") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_COMMA) PORT_NAME("INP34") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_STOP) PORT_NAME("INP35") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_SLASH) PORT_NAME("INP36") + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_COLON) PORT_NAME("INP37") + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_QUOTE) PORT_NAME("INP38") + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_ENTER) PORT_NAME("INP39") + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_OPENBRACE) PORT_NAME("INP40") + + PORT_START("X5") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_NAME("INP41") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_BACKSLASH) PORT_NAME("INP42") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_MINUS) PORT_NAME("INP43") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_EQUALS) PORT_NAME("INP44") + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_BACKSPACE) PORT_NAME("INP45") + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_UP) PORT_NAME("INP46") + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_LEFT) PORT_NAME("INP47") + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_RIGHT) PORT_NAME("INP48") + + PORT_START("X6") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_DOWN) PORT_NAME("INP49") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_DEL) PORT_NAME("INP50") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_HOME) PORT_NAME("INP51") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_END) PORT_NAME("INP52") + + PORT_START("X7") + PORT_BIT( 0x11, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_Z) PORT_NAME("INP57") // Ball entering play (bit 0 = P1, bit 4 = P2) + + PORT_START("DIAGS") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Main Diag") PORT_CODE(KEYCODE_0_PAD) PORT_CHANGED_MEMBER(DEVICE_SELF, s8_state, main_nmi, 1) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Advance") PORT_CODE(KEYCODE_1_PAD) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Up/Down") PORT_CODE(KEYCODE_2_PAD) PORT_TOGGLE +INPUT_PORTS_END + INPUT_CHANGED_MEMBER( s8_state::main_nmi ) { // Diagnostic button sends a pulse to NMI pin @@ -230,6 +410,15 @@ m_io_outputs[i] = BIT(data, i); } +void s8_state::scrzy_sol3_w(u8 data) +{ + if (data==0x0a) + m_samples->start(0, 7); // mechanical drum when you have 2 or more batches + + for (u8 i = 0; i < 8; i++) + m_io_outputs[i] = BIT(data, i); +} + void s8_state::sound_w(u8 data) { m_sound_data = data; @@ -244,7 +433,17 @@ WRITE_LINE_MEMBER( s8_state::pia21_ca2_w ) { // sound ns - m_pias->ca1_w(state); + if (m_pias) + m_pias->ca1_w(state); +} + +void s8_state::sol2_w(u8 data) +{ + m_comma12 = BIT(data, 7); + m_comma34 = BIT(data, 6); + + for (u8 i = 0; i < 8; i++) + m_io_outputs[8U+i] = BIT(data, i); } void s8_state::lamp0_w(u8 data) @@ -281,11 +480,21 @@ m_data_ok = false; } +void s8_state::ratrc_dig1_w(u8 data) +{ + static const u8 patterns[16] = { 0x3f,0x06,0xdb,0xcf,0xe6,0xed,0xfd,0x07,0xff,0xef,0,0,0,0,0,0 }; // MC14543 + if (m_data_ok) + { + m_digits[m_strobe+16] = patterns[data & 15] | (m_comma34 ? 0xc000 : 0); + m_digits[m_strobe] = patterns[data >> 4] | (m_comma12 ? 0xc000 : 0); + } + m_data_ok = false; +} + u8 s8_state::switch_r() { u8 data = 0; - // there's hardware for 8 rows, but machine uses 4 - for (u8 i = 0; i < 4; i++) + for (u8 i = 0; i < 8; i++) if (BIT(m_row, i)) data |= m_io_keyboard[i]->read(); @@ -342,7 +551,6 @@ void s8_state::machine_start() { - genpin_class::machine_start(); m_io_outputs.resolve(); m_digits.resolve(); @@ -350,7 +558,12 @@ save_item(NAME(m_row)); save_item(NAME(m_data_ok)); save_item(NAME(m_lamp_data)); - save_item(NAME(m_sound_data)); + + if (m_pias) + save_item(NAME(m_sound_data)); + + save_item(NAME(m_comma12)); + save_item(NAME(m_comma34)); m_irq_timer = timer_alloc(TIMER_IRQ); m_irq_timer->adjust(attotime::from_ticks(980,1e6),1); @@ -358,11 +571,27 @@ void s8_state::machine_reset() { - genpin_class::machine_reset(); for (u8 i = 0; i < m_io_outputs.size(); i++) m_io_outputs[i] = 0; } +// Pennant Fever sound card has PIA at a custom address +void s8_state::psound(machine_config &config) +{ + M6808(config, m_audiocpu, XTAL(4'000'000)); + m_audiocpu->set_addrmap(AS_PROGRAM, &s8_state::audio_map); + + SPEAKER(config, "speaker").front_center(); + MC1408(config, "dac", 0).add_route(ALL_OUTPUTS, "speaker", 0.5); + + PIA6821(config, m_pias, 0); + m_pias->readpa_handler().set(FUNC(s8_state::sound_r)); + m_pias->set_port_a_input_overrides_output_mask(0xff); + m_pias->writepb_handler().set("dac", FUNC(dac_byte_interface::data_w)); + m_pias->irqa_handler().set_inputline("audiocpu", M6808_IRQ_LINE); + m_pias->irqb_handler().set_inputline("audiocpu", M6808_IRQ_LINE); +} + void s8_state::s8(machine_config &config) { /* basic machine hardware */ @@ -370,9 +599,6 @@ m_maincpu->set_ram_enable(false); m_maincpu->set_addrmap(AS_PROGRAM, &s8_state::main_map); - /* Video */ - config.set_default_layout(layout_s8); - /* Sound */ genpin_audio(config); @@ -411,45 +637,100 @@ m_pia30->irqb_handler().set(FUNC(s8_state::pia_irq)); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); +} + +void s8_state::pfevr(machine_config &config) +{ + s8(config); + + /* Video */ + config.set_default_layout(layout_s8pfevr); /* Add the soundcard */ - M6808(config, m_audiocpu, XTAL(4'000'000)); - m_audiocpu->set_addrmap(AS_PROGRAM, &s8_state::audio_map); + psound(config); +} - SPEAKER(config, "speaker").front_center(); - MC1408(config, "dac", 0).add_route(ALL_OUTPUTS, "speaker", 0.5); +void s8_state::scrzy(machine_config &config) +{ + s8(config); + m_maincpu->set_addrmap(AS_PROGRAM, &s8_state::scrzy_map); - PIA6821(config, m_pias, 0); - m_pias->readpa_handler().set(FUNC(s8_state::sound_r)); - m_pias->set_port_a_input_overrides_output_mask(0xff); - m_pias->writepb_handler().set("dac", FUNC(dac_byte_interface::data_w)); - m_pias->irqa_handler().set_inputline("audiocpu", M6808_IRQ_LINE); - m_pias->irqb_handler().set_inputline("audiocpu", M6808_IRQ_LINE); + /* Video */ + config.set_default_layout(layout_s8scrzy); + + m_pia21->writepa_handler().set("s9sound", FUNC(williams_s9_sound_device::write)); + m_pia21->ca2_handler().set("s9sound", FUNC(williams_s9_sound_device::strobe)); + + /* Add the soundcard */ + SPEAKER(config, "mono").front_center(); + WILLIAMS_S9_SOUND(config, m_s9sound, 0).add_route(ALL_OUTPUTS, "mono", 1.0); } +void s8_state::ratrc(machine_config &config) +{ + scrzy(config); + m_pia28->writepb_handler().set(FUNC(s8_state::ratrc_dig1_w)); + + /* Video */ + config.set_default_layout(layout_s8ratrc); +} + + /*------------------------------ / Pennant Fever (#526) 05/1984 /-------------------------------*/ ROM_START(pfevr_l2) - ROM_REGION(0x3000, "maincpu", ROMREGION_ERASEFF) - ROM_LOAD("pf-rom1.u19", 0x0000, 0x1000, CRC(00be42bd) SHA1(72ca21c96e3ffa3c43499165f3339b669c8e94a5)) - ROM_LOAD("pf-rom2.u20", 0x1000, 0x2000, CRC(7b101534) SHA1(21e886d5872104d71bb528b9affb12230268597a)) + ROM_REGION(0x4000, "maincpu", ROMREGION_ERASEFF) + ROM_LOAD("pf-rom1.u19", 0x1000, 0x1000, CRC(00be42bd) SHA1(72ca21c96e3ffa3c43499165f3339b669c8e94a5)) + ROM_LOAD("pf-rom2.u20", 0x2000, 0x2000, CRC(7b101534) SHA1(21e886d5872104d71bb528b9affb12230268597a)) ROM_REGION(0x4000, "audiocpu", ROMREGION_ERASEFF) ROM_LOAD("cpu_u49.128", 0x0000, 0x4000, CRC(b0161712) SHA1(5850f1f1f11e3ac9b9629cff2b26c4ad32436b55)) ROM_END ROM_START(pfevr_p3) - ROM_REGION(0x3000, "maincpu", ROMREGION_ERASEFF) - ROM_LOAD("cpu_u19.732", 0x0000, 0x1000, CRC(03796c6d) SHA1(38c95fcce9d0f357a74f041f0df006b9c6f6efc7)) - ROM_LOAD("cpu_u20.764", 0x1000, 0x2000, CRC(3a3acb39) SHA1(7844cc30a9486f718a556850fc9cef3be82f26b7)) + ROM_REGION(0x4000, "maincpu", ROMREGION_ERASEFF) + ROM_LOAD("cpu_u19.732", 0x1000, 0x1000, CRC(03796c6d) SHA1(38c95fcce9d0f357a74f041f0df006b9c6f6efc7)) + ROM_LOAD("cpu_u20.764", 0x2000, 0x2000, CRC(3a3acb39) SHA1(7844cc30a9486f718a556850fc9cef3be82f26b7)) ROM_REGION(0x4000, "audiocpu", ROMREGION_ERASEFF) ROM_LOAD("cpu_u49.128", 0x0000, 0x4000, CRC(b0161712) SHA1(5850f1f1f11e3ac9b9629cff2b26c4ad32436b55)) ROM_END +/*----------------------------------------------------------------------------- +/ Rat Race : (Game #527)- Prototype (displays as #500L1) +/-----------------------------------------------------------------------------*/ +ROM_START(ratrc_l1) + ROM_REGION(0x4000, "maincpu", ROMREGION_ERASEFF) + ROM_LOAD("ic20.532", 0x1000, 0x1000, CRC(0c5c7c09) SHA1(c93b39ba1460feee5850fcd3ca7cacb72c4c8ff3)) + ROM_LOAD("ic14.532", 0x2000, 0x1000, CRC(c6f4bcf4) SHA1(d71c86299139abe3dd376a324315a039be82875c)) + ROM_LOAD("ic17.532", 0x3000, 0x1000, CRC(0800c214) SHA1(3343c07fd550bb0759032628e01bb750135dab15)) + + ROM_REGION(0x8000, "s9sound:audiocpu", ROMREGION_ERASEFF) + ROM_LOAD("b486.bin", 0x6000, 0x2000, CRC(c54b9402) SHA1(c56fc5f105fc2c1166e3b22bb09b72af79e0aec1)) +ROM_END + +/*----------------------------- +/ Rat Race II (Game #533) +/ - never produced +/-----------------------------*/ + +/*---------------------------- +/ Still Crazy (#543) 06/1984 +/-----------------------------*/ +ROM_START(scrzy_l1) + ROM_REGION(0x4000, "maincpu", ROMREGION_ERASEFF) + ROM_LOAD("ic20.bin", 0x2000, 0x2000, CRC(b0df42e6) SHA1(bb10268d7b820d1de0c20e1b79aba558badd072b) ) + + ROM_REGION(0x8000, "s9sound:audiocpu", ROMREGION_ERASEFF) + // 1st and 2nd halves are identical + ROM_LOAD("ic49.bin", 0x4000, 0x4000, CRC(bcc8ccc4) SHA1(2312f9cc4f5a2dadfbfa61d13c31bb5838adf152) ) +ROM_END + } // Anonymous namespace -GAME(1984, pfevr_l2, 0, s8, s8, s8_state, empty_init, ROT0, "Williams", "Pennant Fever (L-2)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1984, pfevr_p3, pfevr_l2, s8, s8, s8_state, empty_init, ROT0, "Williams", "Pennant Fever (P-3)", MACHINE_IS_SKELETON_MECHANICAL ) +GAME(1984, pfevr_l2, 0, pfevr, pfevr, s8_state, empty_init, ROT0, "Williams", "Pennant Fever (L-2)", MACHINE_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1984, pfevr_p3, pfevr_l2, pfevr, pfevr, s8_state, empty_init, ROT0, "Williams", "Pennant Fever (P-3)", MACHINE_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1983, ratrc_l1, 0, ratrc, ratrc, s8_state, empty_init, ROT0, "Williams", "Rat Race (L-1)", MACHINE_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1984, scrzy_l1, 0, scrzy, scrzy, s8_state, empty_init, ROT0, "Williams", "Still Crazy", MACHINE_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/s9.cpp mame-0.243+dfsg.1/src/mame/drivers/s9.cpp --- mame-0.242+dfsg.1/src/mame/drivers/s9.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/s9.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -15,20 +15,9 @@ - Sorcerer (#532) - Space Shuttle (#535) - Comet (#540) -- Rat Race (#527) -- Rat Race II (#533) The first time run, the display will show the model number. Press F3 to clear this. -Rat Race is played in a cocktail cabinet, the player uses a joystick to tilt the - board, to coax the ball into following lit arrows in a maze. After a successful - navigation, the maze changes to something else faster and harder. It's almost an - arcade game done mechanically. Obviously there is no way to emulate it in its intended - form. Probably would have been a nice game, but it never passed the prototype stage. - Currently it runs but the player display flashes randoms ones while a sound is produced - every couple of seconds. Bad byte at "maincpu" D7FF. Technically the machine is a - mixture of sys7 and sys9, so it will require more work. - Here are the key codes to enable play: @@ -39,10 +28,9 @@ Comet 540 1 X Status: -- Pinballs (Sorcerer, Space Shuttle, Comet) are playable. +- All machines are playable. ToDo: -- Rat Race: need a manual, playboard contacts are unknown/don't respond. - Mechanical sounds *****************************************************************************************/ @@ -258,7 +246,7 @@ m_comma34 = BIT(data, 6); } for (u8 i = 0; i < 8; i++) - m_io_outputs[16U+i] = BIT(data, i); + m_io_outputs[8U+i] = BIT(data, i); } void s9_state::lamp0_w(u8 data) @@ -425,21 +413,9 @@ WILLIAMS_S9_SOUND(config, m_s9sound, 0).add_route(ALL_OUTPUTS, "mono", 1.0); } -/*----------------------------------------------------------------------------- -/ Rat Race - Sys.9 (Game #527)- Prototype (displays as #500L1) -/-----------------------------------------------------------------------------*/ -ROM_START(ratrc_l1) - ROM_REGION(0x4000, "maincpu", ROMREGION_ERASEFF) - ROM_LOAD("ic20.532", 0x1000, 0x1000, CRC(0c5c7c09) SHA1(c93b39ba1460feee5850fcd3ca7cacb72c4c8ff3)) - ROM_LOAD("ic14.532", 0x2000, 0x1000, CRC(c6f4bcf4) SHA1(d71c86299139abe3dd376a324315a039be82875c)) - ROM_LOAD("ic17.532", 0x3000, 0x1000, CRC(0800c214) SHA1(3343c07fd550bb0759032628e01bb750135dab15)) - - ROM_REGION(0x8000, "s9sound:audiocpu", ROMREGION_ERASEFF) - ROM_LOAD("b486.bin", 0x6000, 0x2000, CRC(c54b9402) SHA1(c56fc5f105fc2c1166e3b22bb09b72af79e0aec1)) -ROM_END /*----------------------------- -/ Sorcerer (S9) 03/85 (#532) +/ Sorcerer : 03/85 (#532) /------------------------------*/ ROM_START(sorcr_l1) ROM_REGION(0x4000, "maincpu", ROMREGION_ERASEFF) @@ -467,13 +443,8 @@ ROM_LOAD("cpu_u49.128", 0x4000, 0x4000, CRC(a0bae1e4) SHA1(dc5172aa1d59191d4119da20757cb2c2469f8fe3)) ROM_END -/*----------------------------- -/ Rat Race II (Game #533) -/ - never produced -/-----------------------------*/ - /*--------------------------------- -/ Space Shuttle (S9) 12/84 (#535) +/ Space Shuttle : 12/84 (#535) /----------------------------------*/ ROM_START(sshtl_l7) // Spanish licensed version by Stargame is identical to this set @@ -499,7 +470,7 @@ ROM_END /*------------------------- -/ Comet (S9) 06/85 (#540) +/ Comet : 06/85 (#540) /--------------------------*/ ROM_START(comet_l4) ROM_REGION(0x4000, "maincpu", ROMREGION_ERASEFF) @@ -527,13 +498,9 @@ } // Anonymous namespace -// Novelty -GAME( 1983, ratrc_l1, 0, s9, s9, s9_state, init_rr, ROT0, "Williams", "Rat Race (L-1)", MACHINE_IS_SKELETON_MECHANICAL ) - -// Pinball -GAME( 1985, sorcr_l1, sorcr_l2, s9, sorcr, s9_state, empty_init, ROT0, "Williams", "Sorcerer (L-1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1985, sorcr_l2, 0, s9, sorcr, s9_state, empty_init, ROT0, "Williams", "Sorcerer (L-2)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1984, sshtl_l7, 0, s9, sshtl, s9_state, empty_init, ROT0, "Williams", "Space Shuttle (L-7)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1984, sshtl_l3, sshtl_l7, s9, sshtl, s9_state, empty_init, ROT0, "Williams", "Space Shuttle (L-3)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1985, comet_l4, comet_l5, s9, s9, s9_state, empty_init, ROT0, "Williams", "Comet (L-4)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1985, comet_l5, 0, s9, s9, s9_state, empty_init, ROT0, "Williams", "Comet (L-5)", MACHINE_IS_SKELETON_MECHANICAL ) +GAME( 1985, sorcr_l1, sorcr_l2, s9, sorcr, s9_state, empty_init, ROT0, "Williams", "Sorcerer (L-1)", MACHINE_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1985, sorcr_l2, 0, s9, sorcr, s9_state, empty_init, ROT0, "Williams", "Sorcerer (L-2)", MACHINE_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1984, sshtl_l7, 0, s9, sshtl, s9_state, empty_init, ROT0, "Williams", "Space Shuttle (L-7)", MACHINE_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1984, sshtl_l3, sshtl_l7, s9, sshtl, s9_state, empty_init, ROT0, "Williams", "Space Shuttle (L-3)", MACHINE_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1985, comet_l4, comet_l5, s9, s9, s9_state, empty_init, ROT0, "Williams", "Comet (L-4)", MACHINE_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1985, comet_l5, 0, s9, s9, s9_state, empty_init, ROT0, "Williams", "Comet (L-5)", MACHINE_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/sacstate.cpp mame-0.243+dfsg.1/src/mame/drivers/sacstate.cpp --- mame-0.242+dfsg.1/src/mame/drivers/sacstate.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/sacstate.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -2,9 +2,9 @@ // copyright-holders:Robbbert /*************************************************************************** - SacState 8008 +SacState 8008 - 23/02/2009 Skeleton driver. +2009-02-23 Skeleton driver. http://www.digibarn.com/stories/bill-pentz-story/index.html diff -Nru mame-0.242+dfsg.1/src/mame/drivers/savia84.cpp mame-0.243+dfsg.1/src/mame/drivers/savia84.cpp --- mame-0.242+dfsg.1/src/mame/drivers/savia84.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/savia84.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -2,26 +2,26 @@ // copyright-holders:Robbbert /*************************************************************************** - Savia 84 +Savia 84 - More data at : +More data at : http://www.nostalcomp.cz/pdfka/savia84.pdf http://www.nostalcomp.cz/savia.php (use archive.org) - 05/02/2011 Skeleton driver. - 11/10/2011 Found a new rom. Working [Robbbert] +2011-02-05 Skeleton driver. +2011-10-11 Found a new rom. Working [Robbbert] - I assume all the LEDs are red ones. The LEDs down the - left side I assume to be bit 0 through 7 in that order. +I assume all the LEDs are red ones. The LEDs down the + left side I assume to be bit 0 through 7 in that order. - Pasting: +Pasting: 0-F : as is DA : ^ AD : - GO : X - Here is a test program. Copy the text and Paste into the emulator. +Here is a test program. Copy the text and Paste into the emulator. -1800^3E^55^D3^F9^76^XX1800^ ****************************************************************************/ diff -Nru mame-0.242+dfsg.1/src/mame/drivers/savquest.cpp mame-0.243+dfsg.1/src/mame/drivers/savquest.cpp --- mame-0.242+dfsg.1/src/mame/drivers/savquest.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/savquest.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -8,7 +8,27 @@ Skeleton by R. Belmont TODO: - - currently asserts by selecting a s3 video bank above 1M (register 0x6a)z + - Needs proper AWE64 emulation defined as a slot option default, with + fallbacks to AWE32 and SB16; + + - ISA bus needs IRQ and DMA hookups. + \- Will otherwise hang indefinitely after booting, waiting for sound card irqs. + There's a C:\sb16\diagnose.exe tool if you want to test this. + + - Convert driver to the newest PCI model; + + - Currently fails because it doesn't find the Voodoo card in the PCI model; + + - When switching gfx mode during boot routine it still sets a terminal debug mode (with cut down screen portions) + instead of normal Voodoo drawing. Culprit may be an I/O port reading or a Voodoo bug; + + - Aforementioned debug mode shows that it can't find several assets on loading; + + - When game boots it does extensive CPUID checks, more copy protection tied to the CPU serial it has been installed on? + + - Convert HASP dongle to a pc_lpt_device friendly device; + + - currently asserts by selecting a s3 video bank above 1M (register 0x6a) Update: fixed? - The version is labeled "SQ05" in the filesystem but has the 1999 release year. Other components are labeled "v0.5", but the game doesn't boot far enough to see if @@ -24,7 +44,7 @@ - First two are PIIX4/4E/4M IDE Controller / PIIX4/4E/4M USB Interface Third is S3 trio64uv+ Fourth is Voodoo 2 3D Accelerator - Sound Blaster is ISA/PNP + Sound Blaster is ISA/PnP ============================================================================ H/W is a white-box PC consisting of: diff -Nru mame-0.242+dfsg.1/src/mame/drivers/sbrain.cpp mame-0.243+dfsg.1/src/mame/drivers/sbrain.cpp --- mame-0.242+dfsg.1/src/mame/drivers/sbrain.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/sbrain.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -118,7 +118,7 @@ void sub_io_map(address_map &map); void sub_mem_map(address_map &map); - bool m_busak = 0; + bool m_busak = false; u8 m_keydown = 0U; u8 m_porta = 0U; u8 m_portb = 0U; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/seabattl.cpp mame-0.243+dfsg.1/src/mame/drivers/seabattl.cpp --- mame-0.242+dfsg.1/src/mame/drivers/seabattl.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/seabattl.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -462,21 +462,10 @@ }; -static const gfx_layout tiles8x8_layout = -{ - 8,8, - RGN_FRAC(1,1), - 1, - { 0 }, - { 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_seabattl ) GFXDECODE_ENTRY( "gfx1", 0, tiles32x16x3_layout, 0, 1 ) - GFXDECODE_ENTRY( "gfx2", 0, tiles8x8_layout, 8, 8 ) - GFXDECODE_ENTRY( "gfx3", 0, tiles8x8_layout, 24, 1 ) + GFXDECODE_ENTRY( "gfx2", 0, gfx_8x8x1, 8, 8 ) + GFXDECODE_ENTRY( "gfx3", 0, gfx_8x8x1, 24, 1 ) GFXDECODE_END void seabattl_state::seabattl(machine_config &config) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/seattle.cpp mame-0.243+dfsg.1/src/mame/drivers/seattle.cpp --- mame-0.242+dfsg.1/src/mame/drivers/seattle.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/seattle.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -185,20 +185,23 @@ **************************************************************************/ #include "emu.h" + #include "audio/cage.h" #include "audio/dcs.h" +#include "machine/midwayic.h" +#include "bus/ata/idehd.h" #include "cpu/adsp2100/adsp2100.h" #include "cpu/mips/mips3.h" -#include "machine/midwayic.h" -#include "machine/nvram.h" -#include "machine/smc91c9x.h" - -#include "machine/pci.h" #include "machine/gt64xxx.h" +#include "machine/nvram.h" #include "machine/pci-ide.h" +#include "machine/pci.h" +#include "machine/smc91c9x.h" #include "video/voodoo_pci.h" + #include "screen.h" +#include "speaker.h" #include "calspeed.lh" #include "vaportrx.lh" @@ -443,6 +446,8 @@ void widget_cs3_map(address_map &map); void carnevil_cs3_map(address_map &map); void flagstaff_cs3_map(address_map &map); + + static void hdd_config(device_t *device); }; /************************************* @@ -454,7 +459,7 @@ void seattle_state::machine_start() { // set the fastest DRC options, but strict verification - m_maincpu->mips3drc_set_options(MIPS3DRC_FASTEST_OPTIONS + MIPS3DRC_STRICT_VERIFY); + m_maincpu->mips3drc_set_options(MIPS3DRC_FASTEST_OPTIONS | MIPS3DRC_STRICT_VERIFY); // configure fast RAM regions // m_maincpu->add_fastram(0x00000000, 0x007fffff, FALSE, m_rambase); @@ -722,7 +727,7 @@ // Declare calibration finished as soon as a SYSTEM button is hit if (!m_wheel_calibrated && ((~m_io_system->read()) & 0xffff)) { m_wheel_calibrated = true; - //osd_printf_info("wheel calibration complete wheel: %02x\n", currValue); + //osd_printf_info("wheel calibration complete system: %04x wheel: %02x\n", m_io_system->read(), currValue); } } @@ -905,7 +910,7 @@ void seattle_state::carnevil_gun_w(offs_t offset, uint32_t data) { - logerror("carnevil_gun_w(%d) = %02X\n", offset, data); + //logerror("carnevil_gun_w(%d) = %02X\n", offset, data); } /************************************* @@ -1013,7 +1018,7 @@ } else if (!BIT(data, 9) || !BIT(data, 8)) { - logerror("%08X:output_w = %04X\n", m_maincpu->pc(), data); + //logerror("%08X:output_w = %04X\n", m_maincpu->pc(), data); } } @@ -1400,7 +1405,7 @@ PORT_MODIFY("SYSTEM") PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Start Button") - PORT_BIT( 0x0620, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0620, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_MODIFY("IN2") PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNKNOWN ) @@ -1488,8 +1493,7 @@ PORT_MODIFY("SYSTEM") PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Abort") PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON11 ) PORT_NAME("Reverse") - PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x1e00, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_MODIFY("IN1") PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("View 1") @@ -2024,6 +2028,7 @@ ide_pci_device &ide(IDE_PCI(config, PCI_ID_IDE, 0, 0x100b0002, 0x01, 0x0)); ide.irq_handler().set_inputline(m_maincpu, IDE_IRQ_NUM); ide.set_legacy_top(0x0a0); + ide.subdevice("ide")->slot(0).set_option_machine_config("hdd", hdd_config); // video hardware VOODOO_1_PCI(config, m_voodoo, 0, m_maincpu, m_screen); @@ -2045,6 +2050,11 @@ m_screen->set_screen_update(PCI_ID_VIDEO, FUNC(voodoo_1_pci_device::screen_update)); } +void seattle_state::hdd_config(device_t *device) +{ + // Set the disk dma transfer speed + dynamic_cast(device)->set_dma_transfer_time(attotime::from_usec(15)); +} void seattle_state::phoenix(machine_config &config) { @@ -2144,9 +2154,21 @@ void seattle_state::sfrush(machine_config &config) { flagstaff(config); + // 5 Channel output (4 Channel input connected to Quad Amp PCB) + SPEAKER(config, "flspeaker").front_left(); + SPEAKER(config, "frspeaker").front_right(); + SPEAKER(config, "rlspeaker").headrest_left(); + SPEAKER(config, "rrspeaker").headrest_right(); + //SPEAKER(config, "subwoofer").seat(); Not implemented, Quad Amp PCB output; + atari_cage_seattle_device &cage(ATARI_CAGE_SEATTLE(config, "cage", 0)); cage.set_speedup(0x5236); cage.irq_handler().set(m_ioasic, FUNC(midway_ioasic_device::cage_irq_handler)); + // TODO: copied from atarigt.cpp; Same configurations as T-Mek? + cage.add_route(0, "frspeaker", 1.0); // Foward Right + cage.add_route(1, "rlspeaker", 1.0); // Back Left + cage.add_route(2, "flspeaker", 1.0); // Foward Left + cage.add_route(3, "rrspeaker", 1.0); // Back Right MIDWAY_IOASIC(config, m_ioasic, 0); m_ioasic->set_shuffle(MIDWAY_IOASIC_STANDARD); @@ -2159,9 +2181,22 @@ void seattle_state::sfrushrk(machine_config &config) { flagstaff(config); + // 5 Channel output (4 Channel input connected to Quad Amp PCB) + SPEAKER(config, "flspeaker").front_left(); + SPEAKER(config, "frspeaker").front_right(); + SPEAKER(config, "rlspeaker").headrest_left(); + SPEAKER(config, "rrspeaker").headrest_right(); + //SPEAKER(config, "subwoofer").seat(); Not implemented, Quad Amp PCB output; + atari_cage_seattle_device &cage(ATARI_CAGE_SEATTLE(config, "cage", 0)); cage.set_speedup(0x5329); cage.irq_handler().set(m_ioasic, FUNC(midway_ioasic_device::cage_irq_handler)); + // TODO: copied from atarigt.cpp; Same configurations as T-Mek? + cage.add_route(0, "frspeaker", 1.0); // Foward Right + cage.add_route(1, "rlspeaker", 1.0); // Back Left + cage.add_route(2, "flspeaker", 1.0); // Foward Left + cage.add_route(3, "rrspeaker", 1.0); // Back Right + MIDWAY_IOASIC(config, m_ioasic, 0); m_ioasic->set_shuffle(MIDWAY_IOASIC_SFRUSHRK); diff -Nru mame-0.242+dfsg.1/src/mame/drivers/seicupbl.cpp mame-0.243+dfsg.1/src/mame/drivers/seicupbl.cpp --- mame-0.242+dfsg.1/src/mame/drivers/seicupbl.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/seicupbl.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -518,17 +518,6 @@ { } -static const gfx_layout cupsocsb_spritelayout = -{ - 16,16, - RGN_FRAC(1,1), - 4, - { 0,1,2,3 }, - { 4,0,12,8,20,16,28,24, 512+4, 512+0, 512+12, 512+8, 512+20, 512+16, 512+28, 512+24 }, - { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32, 8*32, 9*32, 10*32, 11*32, 12*32, 13*32, 14*32, 15*32 }, - 32*32 -}; - static const gfx_layout cupsocsb_8x8_tilelayout = { 8,8, @@ -557,7 +546,7 @@ GFXDECODE_ENTRY( "char", 0, cupsocsb_8x8_tilelayout, 48*16, 16 ) GFXDECODE_ENTRY( "gfx3", 0, cupsocsb_tilelayout, 0*16, 32 ) GFXDECODE_ENTRY( "gfx4", 0, cupsocsb_tilelayout, 32*16, 16 ) /* unused */ - GFXDECODE_ENTRY( "sprite", 0, cupsocsb_spritelayout, 0*16, 8*16 ) + GFXDECODE_ENTRY( "sprite", 0, gfx_8x8x4_col_2x2_group_packed_lsb, 0*16, 8*16 ) GFXDECODE_ENTRY( "gfx5", 0, cupsocsb_tilelayout, 32*16, 16 ) GFXDECODE_ENTRY( "gfx6", 0, cupsocsb_tilelayout, 16*16, 16 ) GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/selz80.cpp mame-0.243+dfsg.1/src/mame/drivers/selz80.cpp --- mame-0.242+dfsg.1/src/mame/drivers/selz80.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/selz80.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -2,10 +2,10 @@ // copyright-holders:Robbbert /*************************************************************************** - SEL Z80 Trainer (LEHRSYSTEME) +SEL Z80 Trainer (LEHRSYSTEME) - 31/08/2010 Skeleton driver. - 23/06/2011 Working [Robbbert] +2010-08-31 Skeleton driver. +2011-06-23 Working [Robbbert] No diagram has been found. The following is guesswork. diff -Nru mame-0.242+dfsg.1/src/mame/drivers/seta.cpp mame-0.243+dfsg.1/src/mame/drivers/seta.cpp --- mame-0.242+dfsg.1/src/mame/drivers/seta.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/seta.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -4309,6 +4309,20 @@ PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) INPUT_PORTS_END +/*************************************************************************** + Daioh (prototype, earlier) +***************************************************************************/ + +static INPUT_PORTS_START( daiohp2 ) + PORT_INCLUDE(daiohp) + + PORT_MODIFY("DSW") + PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:7,8") + PORT_DIPSETTING( 0x8000, "300k and every 800k" ) + PORT_DIPSETTING( 0xc000, "500k and every 1000k" ) + PORT_DIPSETTING( 0x4000, "800k and 2000k only" ) + PORT_DIPSETTING( 0x0000, "1000k Only" ) +INPUT_PORTS_END /*************************************************************************** Dragon Unit @@ -10931,7 +10945,7 @@ ROM_REGION( 0x200000, "gfx3", 0 ) /* Layer 2 */ ROM_LOAD16_BYTE( "bg2_0.u164", 0x000001, 0x080000, CRC(7e46a10e) SHA1(a8576f7a140b065b88a0dab648f7b31c75fec006) ) ROM_LOAD16_BYTE( "bg2_1.u166", 0x000000, 0x080000, CRC(9274123b) SHA1(b58e107a5bd222e454fd435d515e57cab52e6593) ) - ROM_LOAD16_BYTE( "bg2_2.u165", 0x100001, 0x080000, CRC(3119189b) SHA1(3a45ec8db30659d7fd47090cb137df05bbdc1c86) ) + ROM_LOAD16_BYTE( "bg2_2.u165", 0x100001, 0x080000, CRC(dc8ecfb7) SHA1(a202ff32c74601d5cd0aebdf84a481d36f540403) ) ROM_LOAD16_BYTE( "bg2_3.u167", 0x100000, 0x080000, CRC(533ba782) SHA1(b5f62323be95b2def8d1383b400b4ef0d3b3d6cd) ) ROM_REGION( 0x100000, "x1snd", 0 ) /* Samples */ @@ -12462,7 +12476,7 @@ GAME( 1993, daioh, 0, daioh, daioh, seta_state, empty_init, ROT270, "Athena", "Daioh", 0 ) GAME( 1993, daioha, daioh, daioh, daioh, seta_state, empty_init, ROT270, "Athena", "Daioh (earlier)", 0 ) GAME( 1993, daiohp, daioh, daiohp, daiohp, seta_state, empty_init, ROT270, "Athena", "Daioh (prototype)", 0 ) -GAME( 1993, daiohp2, daioh, daiohp, daiohp, seta_state, empty_init, ROT270, "Athena", "Daioh (prototype, earlier)", 0 ) +GAME( 1993, daiohp2, daioh, daiohp, daiohp2, seta_state, empty_init, ROT270, "Athena", "Daioh (prototype, earlier)", 0 ) GAME( 1993, daiohc, daioh, wrofaero, daioh, seta_state, empty_init, ROT270, "Athena", "Daioh (93111A PCB conversion)", 0 ) GAME( 1993, jjsquawk, 0, jjsquawk, jjsquawk, seta_state, empty_init, ROT0, "Athena / Able", "J. J. Squawkers", MACHINE_IMPERFECT_SOUND ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/shangha3.cpp mame-0.243+dfsg.1/src/mame/drivers/shangha3.cpp --- mame-0.242+dfsg.1/src/mame/drivers/shangha3.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/shangha3.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -441,20 +441,8 @@ -static const gfx_layout charlayout = -{ - 16,16, - RGN_FRAC(1,1), - 4, - { 0, 1, 2, 3 }, - { 1*4, 0*4, 3*4, 2*4, 5*4, 4*4, 7*4, 6*4, - 9*4, 8*4, 11*4, 10*4, 13*4, 12*4, 15*4, 14*4 }, - { STEP16(0,4*16) }, - 128*8 -}; - static GFXDECODE_START( gfx_shangha3 ) - GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 128 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_16x16x4_packed_lsb, 0, 128 ) GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/shisen.cpp mame-0.243+dfsg.1/src/mame/drivers/shisen.cpp --- mame-0.242+dfsg.1/src/mame/drivers/shisen.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/shisen.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -9,22 +9,147 @@ ***************************************************************************/ #include "emu.h" -#include "includes/shisen.h" + +#include "audio/m72.h" #include "cpu/z80/z80.h" #include "machine/gen_latch.h" #include "machine/rstbuf.h" #include "sound/ymopm.h" + +#include "emupal.h" #include "screen.h" #include "speaker.h" +#include "tilemap.h" + +namespace { + +class shisen_state : public driver_device +{ +public: + shisen_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_audio(*this, "m72"), + m_gfxdecode(*this, "gfxdecode"), + m_palette(*this, "palette"), + m_paletteram(*this, "paletteram"), + m_videoram(*this, "videoram"), + m_mainbank(*this, "mainbank"), + m_dsw2(*this, "DSW2") + { } + + void shisen(machine_config &config); + +protected: + virtual void video_start() override; + +private: + required_device m_maincpu; + required_device m_audio; + required_device m_gfxdecode; + required_device m_palette; + + required_shared_ptr m_paletteram; + required_shared_ptr m_videoram; + required_memory_bank m_mainbank; + + required_ioport m_dsw2; + + uint8_t m_gfxbank = 0; + tilemap_t *m_bg_tilemap = nullptr; + + void coin_w(uint8_t data); + void videoram_w(offs_t offset, uint8_t data); + void bankswitch_w(uint8_t data); + void paletteram_w(offs_t offset, uint8_t data); + + TILE_GET_INFO_MEMBER(get_bg_tile_info); + + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + void main_io_map(address_map &map); + void main_prg_map(address_map &map); + void sound_io_map(address_map &map); + void sound_prg_map(address_map &map); +}; + + +// video + +void shisen_state::videoram_w(offs_t offset, uint8_t data) +{ + m_videoram[offset] = data; + m_bg_tilemap->mark_tile_dirty(offset / 2); +} -void shisen_state::shisen_map(address_map &map) +void shisen_state::bankswitch_w(uint8_t data) +{ + if (data & 0xc0) logerror("bank switch %02x\n", data); + + // bits 0-2 select ROM bank + m_mainbank->set_entry(data & 0x07); + + // bits 3-5 select gfx bank + int bank = (data & 0x38) >> 3; + + if (m_gfxbank != bank) + { + m_gfxbank = bank; + machine().tilemap().mark_all_dirty(); + } + + // bits 6-7 unknown +} + +void shisen_state::paletteram_w(offs_t offset, uint8_t data) +{ + m_paletteram[offset] = data; + + offset &= 0xff; + + m_palette->set_pen_color(offset, pal5bit(m_paletteram[offset + 0x000]), pal5bit(m_paletteram[offset + 0x100]), pal5bit(m_paletteram[offset + 0x200])); +} + +TILE_GET_INFO_MEMBER(shisen_state::get_bg_tile_info) +{ + int offs = tile_index * 2; + int code = m_videoram[offs] + ((m_videoram[offs + 1] & 0x0f) << 8) + (m_gfxbank << 12); + int color = (m_videoram[offs + 1] & 0xf0) >> 4; + + tileinfo.set(0, code, color, 0); +} + +void shisen_state::video_start() +{ + m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(shisen_state::get_bg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + + m_mainbank->configure_entries(0, 8, memregion("maincpu")->base(), 0x4000); + + save_item(NAME(m_gfxbank)); +} + +uint32_t shisen_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + // on Irem boards, screen flip is handled in both hardware and software. + // this game doesn't have cocktail mode so if there's software control we don't know where it is mapped. + flip_screen_set(~m_dsw2->read() & 1); + + + m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); + return 0; +} + + +// machine + +void shisen_state::main_prg_map(address_map &map) { map(0x0000, 0x7fff).rom(); - map(0x8000, 0xbfff).bankr("bank1"); - map(0xc800, 0xcaff).ram().w(FUNC(shisen_state::paletteram_w)).share("paletteram"); - map(0xd000, 0xdfff).ram().w(FUNC(shisen_state::videoram_w)).share("videoram"); + map(0x8000, 0xbfff).bankr(m_mainbank); + map(0xc800, 0xcaff).ram().w(FUNC(shisen_state::paletteram_w)).share(m_paletteram); + map(0xd000, 0xdfff).ram().w(FUNC(shisen_state::videoram_w)).share(m_videoram); map(0xe000, 0xffff).ram(); } @@ -37,7 +162,7 @@ machine().bookkeeping().coin_counter_w(1, data & 0x04); } -void shisen_state::shisen_io_map(address_map &map) +void shisen_state::main_io_map(address_map &map) { map.global_mask(0xff); map(0x00, 0x00).portr("DSW1").w(FUNC(shisen_state::coin_w)); @@ -48,13 +173,13 @@ } -void shisen_state::shisen_sound_map(address_map &map) +void shisen_state::sound_prg_map(address_map &map) { map(0x0000, 0x3fff).rom(); map(0xfd00, 0xffff).ram(); } -void shisen_state::shisen_sound_io_map(address_map &map) +void shisen_state::sound_io_map(address_map &map) { map.global_mask(0xff); map(0x00, 0x01).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)); @@ -152,7 +277,7 @@ PORT_DIPNAME( 0x10, 0x10, "Women Select" ) PORT_DIPLOCATION("SW2:5") PORT_DIPSETTING( 0x00, DEF_STR( No ) ) PORT_DIPSETTING( 0x10, DEF_STR( Yes ) ) - /* In stop mode, press 2 to stop and 1 to restart */ + // In stop mode, press 2 to stop and 1 to restart PORT_DIPNAME( 0x20, 0x20, "Stop Mode (Cheat)") PORT_DIPLOCATION("SW2:6") PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) @@ -188,27 +313,27 @@ static GFXDECODE_START( gfx_shisen ) - GFXDECODE_ENTRY( "gfx1", 0x00000, charlayout, 0, 16 ) + GFXDECODE_ENTRY( "tiles", 0x00000, charlayout, 0, 16 ) GFXDECODE_END void shisen_state::shisen(machine_config &config) { - /* basic machine hardware */ - Z80(config, m_maincpu, 3.579545_MHz_XTAL ); /* Verified on PCB */ - m_maincpu->set_addrmap(AS_PROGRAM, &shisen_state::shisen_map); - m_maincpu->set_addrmap(AS_IO, &shisen_state::shisen_io_map); + // basic machine hardware + Z80(config, m_maincpu, 3.579545_MHz_XTAL ); // Verified on PCB + m_maincpu->set_addrmap(AS_PROGRAM, &shisen_state::main_prg_map); + m_maincpu->set_addrmap(AS_IO, &shisen_state::main_io_map); m_maincpu->set_vblank_int("screen", FUNC(shisen_state::irq0_line_hold)); - z80_device &soundcpu(Z80(config, "soundcpu", 3.579545_MHz_XTAL )); /* Verified on PCB */ - soundcpu.set_addrmap(AS_PROGRAM, &shisen_state::shisen_sound_map); - soundcpu.set_addrmap(AS_IO, &shisen_state::shisen_sound_io_map); - soundcpu.set_periodic_int(FUNC(shisen_state::nmi_line_pulse), attotime::from_hz(128*55)); /* clocked by V1? (Vigilante) */ - /* IRQs are generated by main Z80 and YM2151 */ + z80_device &soundcpu(Z80(config, "soundcpu", 3.579545_MHz_XTAL )); // Verified on PCB + soundcpu.set_addrmap(AS_PROGRAM, &shisen_state::sound_prg_map); + soundcpu.set_addrmap(AS_IO, &shisen_state::sound_io_map); + soundcpu.set_periodic_int(FUNC(shisen_state::nmi_line_pulse), attotime::from_hz(128*55)); // clocked by V1? (Vigilante) + // IRQs are generated by main Z80 and YM2151 soundcpu.set_irq_acknowledge_callback("soundirq", FUNC(rst_neg_buffer_device::inta_cb)); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(55); screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); @@ -220,7 +345,7 @@ GFXDECODE(config, m_gfxdecode, m_palette, gfx_shisen); PALETTE(config, m_palette).set_entries(256); - /* sound hardware */ + // sound hardware SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); @@ -233,7 +358,7 @@ IREM_M72_AUDIO(config, m_audio); m_audio->set_dac_tag("dac"); - ym2151_device &ymsnd(YM2151(config, "ymsnd", 3.579545_MHz_XTAL )); /* Verified on PCB */ + ym2151_device &ymsnd(YM2151(config, "ymsnd", 3.579545_MHz_XTAL )); // Verified on PCB ymsnd.irq_handler().set("soundirq", FUNC(rst_neg_buffer_device::rst28_w)); ymsnd.add_route(0, "lspeaker", 0.5); ymsnd.add_route(1, "rspeaker", 0.5); @@ -250,15 +375,14 @@ ***************************************************************************/ ROM_START( sichuan2 ) - ROM_REGION( 0x30000, "maincpu", 0 ) /* 64k+128k for main CPU */ + ROM_REGION( 0x20000, "maincpu", 0 ) ROM_LOAD( "6.11d", 0x00000, 0x10000, CRC(98a2459b) SHA1(42102cf2921f80be7600b11aba63538e3b3858ec) ) - ROM_RELOAD( 0x10000, 0x10000 ) - ROM_LOAD( "7.11c", 0x20000, 0x10000, CRC(0350f6e2) SHA1(c683571969c0e4c66eb316a1bc580759db02bbfc) ) + ROM_LOAD( "7.11c", 0x10000, 0x10000, CRC(0350f6e2) SHA1(c683571969c0e4c66eb316a1bc580759db02bbfc) ) ROM_REGION( 0x10000, "soundcpu", 0 ) ROM_LOAD( "1.2c", 0x00000, 0x10000, CRC(51b0a26c) SHA1(af2482cfe8d395848c8e1bf07bf1049ffc6ee69b) ) - ROM_REGION( 0x100000, "gfx1", 0 ) + ROM_REGION( 0x100000, "tiles", 0 ) ROM_LOAD( "8.3j", 0x00000, 0x10000, CRC(1c0e221c) SHA1(87561f7dabf25309be784e797ac237aa3956ea1c) ) ROM_LOAD( "9.4j", 0x10000, 0x10000, CRC(8a7d8284) SHA1(56b5d352b506c5bfab24102b11c877dd28c8ad36) ) ROM_LOAD( "12.1l", 0x20000, 0x10000, CRC(48e1d043) SHA1(4fbd409aff593c0b27fc58c218a470adf48ee0b7) ) @@ -276,7 +400,7 @@ ROM_LOAD( "11.6j", 0xe0000, 0x10000, CRC(473b349a) SHA1(9f5d08e07c8175bc7ec3854499177af2c398bd76) ) ROM_LOAD( "10.5j", 0xf0000, 0x10000, CRC(d9a60285) SHA1(f8ef211e022e9c8ea25f6d8fb16266867656a591) ) - ROM_REGION( 0x40000, "m72", 0 ) /* samples */ + ROM_REGION( 0x40000, "m72", 0 ) // samples ROM_LOAD( "2.7b", 0x00000, 0x10000, CRC(92f0093d) SHA1(530b924aa991283045577d03524dfc7eacf1be49) ) ROM_LOAD( "3.6c", 0x10000, 0x10000, CRC(116a049c) SHA1(656c0d1d7f945c5f5637892721a58421b682fd01) ) ROM_LOAD( "4.7c", 0x20000, 0x10000, CRC(6840692b) SHA1(f6f7b063ecf7206e172843515be38376f8845b42) ) @@ -289,15 +413,14 @@ ROM_END ROM_START( sichuan2a ) - ROM_REGION( 0x30000, "maincpu", 0 ) /* 64k+128k for main CPU */ + ROM_REGION( 0x20000, "maincpu", 0 ) ROM_LOAD( "sichuan.a6", 0x00000, 0x10000, CRC(f8ac05ef) SHA1(cd20e5239d73264f1323ba6b1e35934685852ba1) ) - ROM_RELOAD( 0x10000, 0x10000 ) - ROM_LOAD( "ic07.03", 0x20000, 0x10000, CRC(0350f6e2) SHA1(c683571969c0e4c66eb316a1bc580759db02bbfc) ) + ROM_LOAD( "ic07.03", 0x10000, 0x10000, CRC(0350f6e2) SHA1(c683571969c0e4c66eb316a1bc580759db02bbfc) ) ROM_REGION( 0x10000, "soundcpu", 0 ) ROM_LOAD( "ic01.01", 0x00000, 0x10000, CRC(51b0a26c) SHA1(af2482cfe8d395848c8e1bf07bf1049ffc6ee69b) ) - ROM_REGION( 0x100000, "gfx1", 0 ) + ROM_REGION( 0x100000, "tiles", 0 ) ROM_LOAD( "ic08.04", 0x00000, 0x10000, CRC(1c0e221c) SHA1(87561f7dabf25309be784e797ac237aa3956ea1c) ) ROM_LOAD( "ic09.05", 0x10000, 0x10000, CRC(8a7d8284) SHA1(56b5d352b506c5bfab24102b11c877dd28c8ad36) ) ROM_LOAD( "ic12.08", 0x20000, 0x10000, CRC(48e1d043) SHA1(4fbd409aff593c0b27fc58c218a470adf48ee0b7) ) @@ -315,7 +438,7 @@ ROM_LOAD( "ic10.06", 0xe0000, 0x10000, CRC(473b349a) SHA1(9f5d08e07c8175bc7ec3854499177af2c398bd76) ) ROM_LOAD( "ic11.07", 0xf0000, 0x10000, CRC(d9a60285) SHA1(f8ef211e022e9c8ea25f6d8fb16266867656a591) ) - ROM_REGION( 0x40000, "m72", 0 ) /* samples */ + ROM_REGION( 0x40000, "m72", 0 ) // samples ROM_LOAD( "ic02.02", 0x00000, 0x10000, CRC(92f0093d) SHA1(530b924aa991283045577d03524dfc7eacf1be49) ) ROM_LOAD( "ic03.03", 0x10000, 0x10000, CRC(116a049c) SHA1(656c0d1d7f945c5f5637892721a58421b682fd01) ) ROM_LOAD( "ic04.04", 0x20000, 0x10000, CRC(6840692b) SHA1(f6f7b063ecf7206e172843515be38376f8845b42) ) @@ -323,14 +446,13 @@ ROM_END ROM_START( shisen ) - ROM_REGION( 0x30000, "maincpu", 0 ) /* 64k+128k for main CPU */ + ROM_REGION( 0x20000, "maincpu", 0 ) ROM_LOAD( "a-27-a.rom", 0x00000, 0x20000, CRC(de2ecf05) SHA1(7256c5587f92db10a52c43001e3236f3be3df5df) ) - ROM_RELOAD( 0x10000, 0x20000 ) ROM_REGION( 0x10000, "soundcpu", 0 ) ROM_LOAD( "ic01.01", 0x00000, 0x10000, CRC(51b0a26c) SHA1(af2482cfe8d395848c8e1bf07bf1049ffc6ee69b) ) - ROM_REGION( 0x100000, "gfx1", 0 ) + ROM_REGION( 0x100000, "tiles", 0 ) ROM_LOAD( "ic08.04", 0x00000, 0x10000, CRC(1c0e221c) SHA1(87561f7dabf25309be784e797ac237aa3956ea1c) ) ROM_LOAD( "ic09.05", 0x10000, 0x10000, CRC(8a7d8284) SHA1(56b5d352b506c5bfab24102b11c877dd28c8ad36) ) ROM_LOAD( "ic12.08", 0x20000, 0x10000, CRC(48e1d043) SHA1(4fbd409aff593c0b27fc58c218a470adf48ee0b7) ) @@ -348,7 +470,7 @@ ROM_LOAD( "ic10.06", 0xe0000, 0x10000, CRC(473b349a) SHA1(9f5d08e07c8175bc7ec3854499177af2c398bd76) ) ROM_LOAD( "ic11.07", 0xf0000, 0x10000, CRC(d9a60285) SHA1(f8ef211e022e9c8ea25f6d8fb16266867656a591) ) - ROM_REGION( 0x40000, "m72", 0 ) /* samples */ + ROM_REGION( 0x40000, "m72", 0 ) // samples ROM_LOAD( "ic02.02", 0x00000, 0x10000, CRC(92f0093d) SHA1(530b924aa991283045577d03524dfc7eacf1be49) ) ROM_LOAD( "ic03.03", 0x10000, 0x10000, CRC(116a049c) SHA1(656c0d1d7f945c5f5637892721a58421b682fd01) ) ROM_LOAD( "ic04.04", 0x20000, 0x10000, CRC(6840692b) SHA1(f6f7b063ecf7206e172843515be38376f8845b42) ) @@ -395,15 +517,14 @@ */ ROM_START( matchit ) - ROM_REGION( 0x30000, "maincpu", 0 ) /* 64k+128k for main CPU */ - ROM_LOAD( "2.11d", 0x00000, 0x10000, CRC(299815f7) SHA1(dd25f69d3c825e12e5c2e24b5bbfda9c39400345) ) - ROM_RELOAD( 0x10000, 0x10000 ) - ROM_LOAD( "ic07.03", 0x20000, 0x10000, CRC(0350f6e2) SHA1(c683571969c0e4c66eb316a1bc580759db02bbfc) ) + ROM_REGION( 0x20000, "maincpu", 0 ) + ROM_LOAD( "2.11d", 0x00000, 0x10000, CRC(299815f7) SHA1(dd25f69d3c825e12e5c2e24b5bbfda9c39400345) ) + ROM_LOAD( "ic07.03", 0x10000, 0x10000, CRC(0350f6e2) SHA1(c683571969c0e4c66eb316a1bc580759db02bbfc) ) ROM_REGION( 0x10000, "soundcpu", 0 ) ROM_LOAD( "ic01.01", 0x00000, 0x10000, CRC(51b0a26c) SHA1(af2482cfe8d395848c8e1bf07bf1049ffc6ee69b) ) - ROM_REGION( 0x100000, "gfx1", 0 ) + ROM_REGION( 0x100000, "tiles", 0 ) ROM_LOAD( "ic08.04", 0x00000, 0x10000, CRC(1c0e221c) SHA1(87561f7dabf25309be784e797ac237aa3956ea1c) ) ROM_LOAD( "ic09.05", 0x10000, 0x10000, CRC(8a7d8284) SHA1(56b5d352b506c5bfab24102b11c877dd28c8ad36) ) ROM_LOAD( "ic12.08", 0x20000, 0x10000, CRC(48e1d043) SHA1(4fbd409aff593c0b27fc58c218a470adf48ee0b7) ) @@ -421,10 +542,13 @@ ROM_LOAD( "ic10.06", 0xe0000, 0x10000, CRC(473b349a) SHA1(9f5d08e07c8175bc7ec3854499177af2c398bd76) ) ROM_LOAD( "ic11.07", 0xf0000, 0x10000, CRC(d9a60285) SHA1(f8ef211e022e9c8ea25f6d8fb16266867656a591) ) - ROM_REGION( 0x40000, "m72", ROMREGION_ERASE00 ) /* samples */ - /* no samples on this board */ + ROM_REGION( 0x40000, "m72", ROMREGION_ERASE00 ) // samples + // no samples on this board ROM_END +} // anonymous namespace + + GAME( 1989, matchit, 0, shisen, matchit, shisen_state, empty_init, ROT0, "Tamtex", "Match It", MACHINE_SUPPORTS_SAVE ) GAME( 1989, shisen, matchit, shisen, shisen, shisen_state, empty_init, ROT0, "Tamtex", "Shisensho - Joshiryo-Hen (Japan)", MACHINE_SUPPORTS_SAVE ) GAME( 1989, sichuan2, matchit, shisen, shisen, shisen_state, empty_init, ROT0, "hack", "Sichuan II (hack, set 1)", MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/sigmab31.cpp mame-0.243+dfsg.1/src/mame/drivers/sigmab31.cpp --- mame-0.242+dfsg.1/src/mame/drivers/sigmab31.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/sigmab31.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -196,4 +196,4 @@ ROM_END -GAME( 199?, cptlucky, 0, sigmab31, cptlucky, sigmab31_state, empty_init, ROT0, "Sigma", "Captain Lucky", MACHINE_IS_SKELETON_MECHANICAL ) // a 1992 copyright can be found online, but could be for a later version +GAME( 1988, cptlucky, 0, sigmab31, cptlucky, sigmab31_state, empty_init, ROT0, "Sigma", "Captain Lucky", MACHINE_IS_SKELETON_MECHANICAL ) // 1988 copyright in main CPU ROM diff -Nru mame-0.242+dfsg.1/src/mame/drivers/sigmab98.cpp mame-0.243+dfsg.1/src/mame/drivers/sigmab98.cpp --- mame-0.242+dfsg.1/src/mame/drivers/sigmab98.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/sigmab98.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1161,17 +1161,6 @@ ***************************************************************************/ -static const gfx_layout sigmab98_16x16x4_layout = -{ - 16,16, - RGN_FRAC(1,1), - 4, - { STEP4(0,1) }, - { 4*1,4*0, 4*3,4*2, 4*5,4*4, 4*7,4*6, 4*9,4*8, 4*11,4*10, 4*13,4*12, 4*15,4*14 }, - { STEP16(0,16*4) }, - 16*16*4 -}; - static const gfx_layout sigmab98_16x16x8_layout = { 16,16, @@ -1184,13 +1173,13 @@ }; static GFXDECODE_START( gfx_sigmab98 ) - GFXDECODE_ENTRY( "sprites", 0, sigmab98_16x16x4_layout, 0, 0x100/16 ) + GFXDECODE_ENTRY( "sprites", 0, gfx_16x16x4_packed_lsb, 0, 0x100/16 ) GFXDECODE_ENTRY( "sprites", 0, sigmab98_16x16x8_layout, 0, 0x100/256 ) GFXDECODE_END // Larger palette static GFXDECODE_START( gfx_lufykzku ) - GFXDECODE_ENTRY( "sprites", 0, sigmab98_16x16x4_layout, 0, 0x1000/16 ) + GFXDECODE_ENTRY( "sprites", 0, gfx_16x16x4_packed_lsb, 0, 0x1000/16 ) GFXDECODE_ENTRY( "sprites", 0, sigmab98_16x16x8_layout, 0, 0x1000/16 ) GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/skyfox.cpp mame-0.243+dfsg.1/src/mame/drivers/skyfox.cpp --- mame-0.242+dfsg.1/src/mame/drivers/skyfox.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/skyfox.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -334,7 +334,7 @@ ROM_LOAD( "skyfox7.bin", 0x40000, 0x10000, CRC(fa2ab5b4) SHA1(c0878b25dae28f7d49e14376ff885d1d4e3d5dfe) ) ROM_LOAD( "skyfox8.bin", 0x50000, 0x10000, CRC(0e3edc49) SHA1(3d1c59ecaabe1c9517203b7e814db41d5cff0cd4) ) - ROM_REGION( 0x08000, "gfx2", 0 ) /* Background - do not dispose */ + ROM_REGION( 0x08000, "gfx2", 0 ) /* Background */ ROM_LOAD( "skyfox10.bin", 0x0000, 0x8000, CRC(19f58f9c) SHA1(6887216243b47152129448cbb4c7d52309feed03) ) ROM_REGION( 0x300, "proms", 0 ) /* Color Proms */ @@ -359,7 +359,7 @@ ROM_LOAD( "7.7p", 0x40000, 0x10000, CRC(c9bbfe5c) SHA1(ce3f7d32baa8bb0bfc110877b5b5f4648ee959ac) ) ROM_LOAD( "8.7n", 0x50000, 0x10000, CRC(0e3edc49) SHA1(3d1c59ecaabe1c9517203b7e814db41d5cff0cd4) ) // 1-h - ROM_REGION( 0x08000, "gfx2", 0 ) /* Background - do not dispose */ + ROM_REGION( 0x08000, "gfx2", 0 ) /* Background */ ROM_LOAD( "10.5e", 0x0000, 0x8000, CRC(19f58f9c) SHA1(6887216243b47152129448cbb4c7d52309feed03) ) // 1-j ROM_REGION( 0x300, "proms", 0 ) /* Color Proms */ @@ -384,7 +384,7 @@ ROM_LOAD( "1-g", 0x40000, 0x10000, CRC(c9bbfe5c) SHA1(ce3f7d32baa8bb0bfc110877b5b5f4648ee959ac) ) ROM_LOAD( "skyfox8.bin", 0x50000, 0x10000, CRC(0e3edc49) SHA1(3d1c59ecaabe1c9517203b7e814db41d5cff0cd4) ) // 1-h - ROM_REGION( 0x08000, "gfx2", 0 ) /* Background - do not dispose */ + ROM_REGION( 0x08000, "gfx2", 0 ) /* Background */ ROM_LOAD( "skyfox10.bin", 0x0000, 0x8000, CRC(19f58f9c) SHA1(6887216243b47152129448cbb4c7d52309feed03) ) // 1-j ROM_REGION( 0x300, "proms", 0 ) /* Color Proms */ diff -Nru mame-0.242+dfsg.1/src/mame/drivers/skykid.cpp mame-0.243+dfsg.1/src/mame/drivers/skykid.cpp --- mame-0.242+dfsg.1/src/mame/drivers/skykid.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/skykid.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -10,20 +10,358 @@ Notes: ----- - Sky Kid sets: - There are 2 basic versions, one with CUS63 and rom prefix "SK2" and - the other which uses CUS60 and has the rom prefix "SK1" + There are 2 basic versions, one with CUS63 and ROM prefix "SK2" and + the other which uses CUS60 and has the ROM prefix "SK1" ***************************************************************************/ #include "emu.h" -#include "includes/skykid.h" +#include "cpu/m6800/m6801.h" #include "cpu/m6809/m6809.h" #include "machine/watchdog.h" #include "sound/namco.h" + +#include "emupal.h" #include "screen.h" #include "speaker.h" +#include "tilemap.h" + + +namespace { + +class skykid_state : public driver_device +{ +public: + skykid_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_videoram(*this, "videoram") + , m_textram(*this, "textram") + , m_spriteram(*this, "spriteram") + , m_rombank(*this, "rombank") + , m_maincpu(*this, "maincpu") + , m_mcu(*this, "mcu") + , m_cus30(*this, "namco") + , m_gfxdecode(*this, "gfxdecode") + , m_palette(*this, "palette") + , m_dsw(*this, { "DSWA", "DSWB" }) + , m_pl(*this, "P%u", 1U) + , m_button2(*this, "BUTTON2") + , m_system(*this, "SYSTEM") + , m_leds(*this, "led%u", 0U) + { } + + void skykid(machine_config &config); + + void init_skykid(); + +protected: + virtual void machine_start() override; + virtual void video_start() override; + +private: + required_shared_ptr m_videoram; + required_shared_ptr m_textram; + required_shared_ptr m_spriteram; + required_memory_bank m_rombank; + + required_device m_maincpu; + required_device m_mcu; + required_device m_cus30; + required_device m_gfxdecode; + required_device m_palette; + + required_ioport_array<2> m_dsw; + required_ioport_array<2> m_pl; + required_ioport m_button2; + required_ioport m_system; + + output_finder<2> m_leds; + + tilemap_t *m_bg_tilemap = nullptr; + tilemap_t *m_tx_tilemap = nullptr; + uint8_t m_priority = 0; + uint16_t m_scroll_x = 0; + uint16_t m_scroll_y = 0; + uint8_t m_main_irq_mask = 0; + uint8_t m_mcu_irq_mask = 0; + uint8_t m_inputport_selected = 0; + + void inputport_select_w(uint8_t data); + uint8_t inputport_r(); + void led_w(uint8_t data); + void subreset_w(offs_t offset, uint8_t data); + void bankswitch_w(offs_t offset, uint8_t data); + void irq_1_ctrl_w(offs_t offset, uint8_t data); + void irq_2_ctrl_w(offs_t offset, uint8_t data); + void videoram_w(offs_t offset, uint8_t data); + void textram_w(offs_t offset, uint8_t data); + void scroll_x_w(offs_t offset, uint8_t data); + void scroll_y_w(offs_t offset, uint8_t data); + void flipscreen_priority_w(offs_t offset, uint8_t data); + TILEMAP_MAPPER_MEMBER(tx_tilemap_scan); + TILE_GET_INFO_MEMBER(tx_get_tile_info); + TILE_GET_INFO_MEMBER(bg_get_tile_info); + void palette(palette_device &palette) const; + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + DECLARE_WRITE_LINE_MEMBER(vblank_irq); + void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect); + void mcu_map(address_map &map); + void main_map(address_map &map); +}; + + +// video + + +/*************************************************************************** + + Convert the color PROMs. + + The palette PROMs are connected to the RGB output this way: + + bit 3 -- 220 ohm resistor -- RED/GREEN/BLUE + -- 470 ohm resistor -- RED/GREEN/BLUE + -- 1 kohm resistor -- RED/GREEN/BLUE + bit 0 -- 2.2kohm resistor -- RED/GREEN/BLUE + +***************************************************************************/ + +void skykid_state::palette(palette_device &palette) const +{ + const uint8_t *color_prom = memregion("proms")->base(); + + // create a lookup table for the palette + for (int i = 0; i < 0x100; i++) + { + int const r = pal4bit(color_prom[i + 0x000]); + int const g = pal4bit(color_prom[i + 0x100]); + int const b = pal4bit(color_prom[i + 0x200]); + + palette.set_indirect_color(i, rgb_t(r, g, b)); + } + + // color_prom now points to the beginning of the lookup table + color_prom += 0x300; + + // text palette + for (int i = 0; i < 0x100; i++) + palette.set_pen_indirect(i, i); + + // tiles/sprites + for (int i = 0x100; i < 0x500; i++) + { + uint8_t const ctabentry = color_prom[i - 0x100]; + palette.set_pen_indirect(i, ctabentry); + } +} + + + +/*************************************************************************** + + Callbacks for the TileMap code + +***************************************************************************/ + +// convert from 32x32 to 36x28 +TILEMAP_MAPPER_MEMBER(skykid_state::tx_tilemap_scan) +{ + int offs; + + row += 2; + col -= 2; + if (col & 0x20) + offs = row + ((col & 0x1f) << 5); + else + offs = col + (row << 5); + + return offs; +} + +TILE_GET_INFO_MEMBER(skykid_state::tx_get_tile_info) +{ + int code = m_textram[tile_index]; + int attr = m_textram[tile_index + 0x400]; + tileinfo.category = code >> 4 & 0xf; + + /* the hardware has two character sets, one normal and one flipped. When + screen is flipped, character flip is done by selecting the 2nd character set. + We reproduce this here, but since the tilemap system automatically flips + characters when screen is flipped, we have to flip them back. */ + tileinfo.set(0, + code | (flip_screen() ? 0x100 : 0), + attr & 0x3f, + flip_screen() ? (TILE_FLIPY | TILE_FLIPX) : 0); +} + +TILE_GET_INFO_MEMBER(skykid_state::bg_get_tile_info) +{ + int code = m_videoram[tile_index]; + int attr = m_videoram[tile_index + 0x800]; + + tileinfo.set(1, + code + ((attr & 0x01) << 8), + ((attr & 0x7e) >> 1) | ((attr & 0x01) << 6), + 0); +} + + + +/*************************************************************************** + + Start the video hardware emulation. + +***************************************************************************/ + +void skykid_state::video_start() +{ + m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(skykid_state::tx_get_tile_info)), tilemap_mapper_delegate(*this, FUNC(skykid_state::tx_tilemap_scan)), 8,8, 36,28); + m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(skykid_state::bg_get_tile_info)), TILEMAP_SCAN_ROWS, 8,8, 64,32); + + m_tx_tilemap->set_transparent_pen(0); + + save_item(NAME(m_priority)); + save_item(NAME(m_scroll_x)); + save_item(NAME(m_scroll_y)); +} + + + +/*************************************************************************** + + Memory handlers + +***************************************************************************/ + +void skykid_state::videoram_w(offs_t offset, uint8_t data) +{ + m_videoram[offset] = data; + m_bg_tilemap->mark_tile_dirty(offset & 0x7ff); +} + +void skykid_state::textram_w(offs_t offset, uint8_t data) +{ + m_textram[offset] = data; + m_tx_tilemap->mark_tile_dirty(offset & 0x3ff); +} + +void skykid_state::scroll_x_w(offs_t offset, uint8_t data) +{ + m_scroll_x = offset; +} + +void skykid_state::scroll_y_w(offs_t offset, uint8_t data) +{ + m_scroll_y = offset; +} + +void skykid_state::flipscreen_priority_w(offs_t offset, uint8_t data) +{ + m_priority = data; + flip_screen_set(offset & 1); +} + + + +/*************************************************************************** + + Display Refresh + +***************************************************************************/ + +// the sprite generator IC is the same as Mappy +void skykid_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect) +{ + uint8_t *spriteram = m_spriteram + 0x780; + uint8_t *spriteram_2 = spriteram + 0x0800; + uint8_t *spriteram_3 = spriteram_2 + 0x0800; + + for (int offs = 0; offs < 0x80; offs += 2) + { + static const int gfx_offs[2][2] = + { + { 0, 1 }, + { 2, 3 } + }; + int sprite = spriteram[offs] + ((spriteram_3[offs] & 0x80) << 1); + int color = (spriteram[offs + 1] & 0x3f); + int sx = (spriteram_2[offs + 1]) + 0x100 * (spriteram_3[offs + 1] & 1) - 71; + int sy = 256 - spriteram_2[offs] - 7; + int flipx = (spriteram_3[offs] & 0x01); + int flipy = (spriteram_3[offs] & 0x02) >> 1; + int sizex = (spriteram_3[offs] & 0x04) >> 2; + int sizey = (spriteram_3[offs] & 0x08) >> 3; + + sprite &= ~sizex; + sprite &= ~(sizey << 1); + + if (flip_screen()) + { + flipx ^= 1; + flipy ^= 1; + } + + sy -= 16 * sizey; + sy = (sy & 0xff) - 32; // fix wraparound + + for (int y = 0; y <= sizey; y++) + { + for (int x = 0; x <= sizex; x++) + { + m_gfxdecode->gfx(2)->transmask(bitmap, cliprect, + sprite + gfx_offs[y ^ (sizey * flipy)][x ^ (sizex * flipx)], + color, + flipx, flipy, + sx + 16 * x, sy + 16 * y, + m_palette->transpen_mask(*m_gfxdecode->gfx(2), color, 0xff)); + } + } + } +} + + +uint32_t skykid_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + if (flip_screen()) + { + m_bg_tilemap->set_scrollx(0, 189 - (m_scroll_x ^ 1)); + m_bg_tilemap->set_scrolly(0, 7 - m_scroll_y); + } + else + { + m_bg_tilemap->set_scrollx(0, m_scroll_x + 35); + m_bg_tilemap->set_scrolly(0, m_scroll_y + 25); + } + + m_bg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); + + if (m_priority & 0x04) + { + // textlayer priority enabled? + int pri = m_priority >> 4; + + // draw low priority tiles + m_tx_tilemap->draw(screen, bitmap, cliprect, pri, 0); + + draw_sprites(bitmap, cliprect); + + // draw the other tiles + for (int cat = 0; cat < 0x10; cat++) + if (cat != pri) m_tx_tilemap->draw(screen, bitmap, cliprect, cat, 0); + } + else + { + draw_sprites(bitmap, cliprect); + m_tx_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_ALL_CATEGORIES, 0); + } + + return 0; +} + + +// machine void skykid_state::inputport_select_w(uint8_t data) { @@ -32,8 +370,8 @@ else if ((data & 0xe0) == 0xc0) { machine().bookkeeping().coin_lockout_global_w(~data & 1); - machine().bookkeeping().coin_counter_w(0,data & 2); - machine().bookkeeping().coin_counter_w(1,data & 4); + machine().bookkeeping().coin_counter_w(0, data & 2); + machine().bookkeeping().coin_counter_w(1, data & 4); } } @@ -41,53 +379,53 @@ { switch (m_inputport_selected) { - case 0x00: /* DSW B (bits 0-4) */ - return (ioport("DSWB")->read() & 0xf8) >> 3; - case 0x01: /* DSW B (bits 5-7), DSW A (bits 0-1) */ - return ((ioport("DSWB")->read() & 0x07) << 2) | ((ioport("DSWA")->read() & 0xc0) >> 6); - case 0x02: /* DSW A (bits 2-6) */ - return (ioport("DSWA")->read() & 0x3e) >> 1; - case 0x03: /* DSW A (bit 7), DSW C (bits 0-3) */ - return ((ioport("DSWA")->read() & 0x01) << 4) | (ioport("BUTTON2")->read() & 0x0f); - case 0x04: /* coins, start */ - return ioport("SYSTEM")->read(); - case 0x05: /* 2P controls */ - return ioport("P2")->read(); - case 0x06: /* 1P controls */ - return ioport("P1")->read(); + case 0x00: // DSW B (bits 0-4) + return (m_dsw[1]->read() & 0xf8) >> 3; + case 0x01: // DSW B (bits 5-7), DSW A (bits 0-1) + return ((m_dsw[1]->read() & 0x07) << 2) | ((m_dsw[0]->read() & 0xc0) >> 6); + case 0x02: // DSW A (bits 2-6) + return (m_dsw[0]->read() & 0x3e) >> 1; + case 0x03: // DSW A (bit 7), DSW C (bits 0-3) + return ((m_dsw[0]->read() & 0x01) << 4) | (m_button2->read() & 0x0f); + case 0x04: // coins, start + return m_system->read(); + case 0x05: // 2P controls + return m_pl[1]->read(); + case 0x06: // 1P controls + return m_pl[0]->read(); default: return 0xff; } } -void skykid_state::skykid_led_w(uint8_t data) +void skykid_state::led_w(uint8_t data) { m_leds[0] = BIT(data, 3); m_leds[1] = BIT(data, 4); } -void skykid_state::skykid_subreset_w(offs_t offset, uint8_t data) +void skykid_state::subreset_w(offs_t offset, uint8_t data) { - int bit = !BIT(offset,11); + int bit = !BIT(offset, 11); m_mcu->set_input_line(INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE); } -void skykid_state::skykid_bankswitch_w(offs_t offset, uint8_t data) +void skykid_state::bankswitch_w(offs_t offset, uint8_t data) { - membank("bank1")->set_entry(!BIT(offset,11)); + m_rombank->set_entry(!BIT(offset, 11)); } -void skykid_state::skykid_irq_1_ctrl_w(offs_t offset, uint8_t data) +void skykid_state::irq_1_ctrl_w(offs_t offset, uint8_t data) { - int bit = !BIT(offset,11); + int bit = !BIT(offset, 11); m_main_irq_mask = bit; if (!bit) m_maincpu->set_input_line(0, CLEAR_LINE); } -void skykid_state::skykid_irq_2_ctrl_w(offs_t offset, uint8_t data) +void skykid_state::irq_2_ctrl_w(offs_t offset, uint8_t data) { - int bit = !BIT(offset,13); + int bit = !BIT(offset, 13); m_mcu_irq_mask = bit; if (!bit) m_mcu->set_input_line(0, CLEAR_LINE); @@ -97,38 +435,38 @@ { m_leds.resolve(); - /* configure the banks */ - membank("bank1")->configure_entries(0, 2, memregion("maincpu")->base() + 0x10000, 0x2000); + // configure the banks + m_rombank->configure_entries(0, 2, memregion("maincpu")->base() + 0x10000, 0x2000); save_item(NAME(m_inputport_selected)); } -void skykid_state::skykid_map(address_map &map) +void skykid_state::main_map(address_map &map) { - map(0x0000, 0x1fff).bankr("bank1"); /* banked ROM */ - map(0x2000, 0x2fff).rw(FUNC(skykid_state::skykid_videoram_r), FUNC(skykid_state::skykid_videoram_w)).share("videoram");/* Video RAM (background) */ - map(0x4000, 0x47ff).rw(FUNC(skykid_state::skykid_textram_r), FUNC(skykid_state::skykid_textram_w)).share("textram"); /* video RAM (text layer) */ - map(0x4800, 0x5fff).ram().share("spriteram"); /* RAM + Sprite RAM */ - map(0x6000, 0x60ff).w(FUNC(skykid_state::skykid_scroll_y_w)); /* Y scroll register map */ - map(0x6200, 0x63ff).w(FUNC(skykid_state::skykid_scroll_x_w)); /* X scroll register map */ - map(0x6800, 0x6bff).rw(m_cus30, FUNC(namco_cus30_device::namcos1_cus30_r), FUNC(namco_cus30_device::namcos1_cus30_w)); /* PSG device, shared RAM */ - map(0x7000, 0x7fff).w(FUNC(skykid_state::skykid_irq_1_ctrl_w)); /* IRQ control */ + map(0x0000, 0x1fff).bankr(m_rombank); + map(0x2000, 0x2fff).ram().w(FUNC(skykid_state::videoram_w)).share(m_videoram); // background + map(0x4000, 0x47ff).ram().w(FUNC(skykid_state::textram_w)).share(m_textram); + map(0x4800, 0x5fff).ram().share(m_spriteram); + map(0x6000, 0x60ff).w(FUNC(skykid_state::scroll_y_w)); + map(0x6200, 0x63ff).w(FUNC(skykid_state::scroll_x_w)); + map(0x6800, 0x6bff).rw(m_cus30, FUNC(namco_cus30_device::namcos1_cus30_r), FUNC(namco_cus30_device::namcos1_cus30_w)); // PSG device, shared RAM + map(0x7000, 0x7fff).w(FUNC(skykid_state::irq_1_ctrl_w)); map(0x7800, 0x7fff).r("watchdog", FUNC(watchdog_timer_device::reset_r)); - map(0x8000, 0xffff).rom(); /* ROM */ - map(0x8000, 0x8fff).w(FUNC(skykid_state::skykid_subreset_w)); /* MCU control */ - map(0x9000, 0x9fff).w(FUNC(skykid_state::skykid_bankswitch_w)); /* Bankswitch control */ - map(0xa000, 0xa001).w(FUNC(skykid_state::skykid_flipscreen_priority_w)); /* flip screen & priority */ + map(0x8000, 0xffff).rom(); + map(0x8000, 0x8fff).w(FUNC(skykid_state::subreset_w)); + map(0x9000, 0x9fff).w(FUNC(skykid_state::bankswitch_w)); + map(0xa000, 0xa001).w(FUNC(skykid_state::flipscreen_priority_w)); } void skykid_state::mcu_map(address_map &map) { map(0x0000, 0x001f).m(m_mcu, FUNC(hd63701v0_cpu_device::m6801_io)); map(0x0080, 0x00ff).ram(); - map(0x1000, 0x13ff).rw(m_cus30, FUNC(namco_cus30_device::namcos1_cus30_r), FUNC(namco_cus30_device::namcos1_cus30_w)); /* PSG device, shared RAM */ - map(0x2000, 0x3fff).w("watchdog", FUNC(watchdog_timer_device::reset_w)); /* watchdog? */ - map(0x4000, 0x7fff).w(FUNC(skykid_state::skykid_irq_2_ctrl_w)); + map(0x1000, 0x13ff).rw(m_cus30, FUNC(namco_cus30_device::namcos1_cus30_r), FUNC(namco_cus30_device::namcos1_cus30_w)); // PSG device, shared RAM/ + map(0x2000, 0x3fff).w("watchdog", FUNC(watchdog_timer_device::reset_w)); // ? + map(0x4000, 0x7fff).w(FUNC(skykid_state::irq_2_ctrl_w)); map(0x8000, 0xbfff).rom(); map(0xc000, 0xc7ff).ram(); map(0xf000, 0xffff).rom(); @@ -137,7 +475,7 @@ static INPUT_PORTS_START( skykid ) - PORT_START("DSWA") /* DSW A */ + PORT_START("DSWA") // DSW A PORT_SERVICE_DIPLOC( 0x80, IP_ACTIVE_LOW, "SWA:1" ) PORT_DIPNAME( 0x60, 0x60, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SWA:3,2") PORT_DIPSETTING( 0x00, DEF_STR( 3C_1C ) ) @@ -159,7 +497,7 @@ PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) ) - PORT_START("DSWB") /* DSW B */ + PORT_START("DSWB") // DSW B PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) ) PORT_DIPLOCATION("SWB:2,1") PORT_DIPSETTING( 0x80, "1" ) PORT_DIPSETTING( 0x40, "2" ) @@ -186,7 +524,7 @@ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("SYSTEM") /* IN 0 */ + PORT_START("SYSTEM") // IN 0 PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 ) @@ -194,7 +532,7 @@ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("P1") /* IN 1 */ + PORT_START("P1") // IN 1 PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) @@ -202,7 +540,7 @@ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("P2") /* IN 2 */ + PORT_START("P2") // IN 2 PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) @@ -212,82 +550,23 @@ INPUT_PORTS_END static INPUT_PORTS_START( skykids ) - PORT_START("DSWA") /* DSW A */ - PORT_SERVICE_DIPLOC( 0x80, IP_ACTIVE_LOW, "SWA:1" ) - PORT_DIPNAME( 0x60, 0x60, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SWA:3,2") - PORT_DIPSETTING( 0x00, DEF_STR( 3C_1C ) ) - PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) - PORT_DIPSETTING( 0x60, DEF_STR( 1C_1C ) ) - PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWA:4") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x10, DEF_STR( On ) ) + PORT_INCLUDE( skykid ) + + PORT_MODIFY("DSWA") // DSW A PORT_DIPNAME( 0x08, 0x08, "Round Select" ) PORT_DIPLOCATION("SWA:5") PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x08, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, "Freeze" ) PORT_DIPLOCATION("SWA:6") - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SWA:8,7") - PORT_DIPSETTING( 0x00, DEF_STR( 3C_1C ) ) - PORT_DIPSETTING( 0x01, DEF_STR( 2C_1C ) ) - PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) ) - PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) ) - PORT_START("DSWB") /* DSW B */ - PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) ) PORT_DIPLOCATION("SWB:2,1") - PORT_DIPSETTING( 0x80, "1" ) - PORT_DIPSETTING( 0x40, "2" ) - PORT_DIPSETTING( 0xc0, "3" ) - PORT_DIPSETTING( 0x00, "5" ) + PORT_MODIFY("DSWB") // DSW B PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SWB:4,3") PORT_DIPSETTING( 0x00, "30k every 80k" ) PORT_DIPSETTING( 0x10, "30k and 80k" ) PORT_DIPSETTING( 0x20, "40k every 90k" ) PORT_DIPSETTING( 0x30, "40k and 90k" ) - PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SWB:5" ) - PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SWB:6" ) - PORT_DIPNAME( 0x02, 0x02, "Allow Buy In" ) PORT_DIPLOCATION("SWB:7") - PORT_DIPSETTING( 0x00, DEF_STR( No ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Yes ) ) - PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SWB:8") - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - - PORT_START("BUTTON2") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) - PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START("SYSTEM") /* IN 0 */ - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) - PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START("P1") /* IN 1 */ - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) - PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START("P2") /* IN 2 */ - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) - PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED ) INPUT_PORTS_END static INPUT_PORTS_START( drgnbstr ) - PORT_START("DSWA") /* DSW A */ + PORT_START("DSWA") // DSW A PORT_SERVICE_DIPLOC( 0x80, IP_ACTIVE_LOW, "SWA:1" ) PORT_DIPNAME( 0x60, 0x60, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SWA:3,2") PORT_DIPSETTING( 0x00, DEF_STR( 3C_1C ) ) @@ -309,7 +588,7 @@ PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) ) - PORT_START("DSWB") /* DSW B */ + PORT_START("DSWB") // DSW B PORT_DIPNAME( 0x80, 0x80, "Spurt Time" ) PORT_DIPLOCATION("SWB:1") PORT_DIPSETTING( 0x80, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x00, DEF_STR( Difficult ) ) @@ -342,7 +621,7 @@ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("SYSTEM") /* IN 0 */ + PORT_START("SYSTEM") // IN 0 PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 ) @@ -350,7 +629,7 @@ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("P1") /* IN 1 */ + PORT_START("P1") // IN 1 PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY @@ -358,7 +637,7 @@ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("P2") /* IN 2 */ + PORT_START("P2") // IN 2 PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL @@ -405,9 +684,9 @@ }; static GFXDECODE_START( gfx_skykid ) - GFXDECODE_ENTRY( "gfx1", 0, text_layout, 0, 64 ) - GFXDECODE_ENTRY( "gfx2", 0, tile_layout, 64*4, 128 ) - GFXDECODE_ENTRY( "gfx3", 0, sprite_layout, 64*4+128*4, 64 ) + GFXDECODE_ENTRY( "chars", 0, text_layout, 0, 64 ) + GFXDECODE_ENTRY( "tiles", 0, tile_layout, 64*4, 128 ) + GFXDECODE_ENTRY( "sprites", 0, sprite_layout, 64*4+128*4, 64 ) GFXDECODE_END @@ -423,200 +702,200 @@ void skykid_state::skykid(machine_config &config) { - /* basic machine hardware */ - MC6809E(config, m_maincpu, XTAL(49'152'000)/32); - m_maincpu->set_addrmap(AS_PROGRAM, &skykid_state::skykid_map); + // basic machine hardware + MC6809E(config, m_maincpu, XTAL(49'152'000) / 32); + m_maincpu->set_addrmap(AS_PROGRAM, &skykid_state::main_map); - HD63701V0(config, m_mcu, XTAL(49'152'000)/8); /* or compatible 6808 with extra instructions */ + HD63701V0(config, m_mcu, XTAL(49'152'000) / 8); // or compatible 6808 with extra instructions m_mcu->set_addrmap(AS_PROGRAM, &skykid_state::mcu_map); - m_mcu->in_p1_cb().set(FUNC(skykid_state::inputport_r)); /* input ports read */ - m_mcu->out_p1_cb().set(FUNC(skykid_state::inputport_select_w)); /* input port select */ - m_mcu->in_p2_cb().set_constant(0xff); /* leds won't work otherwise */ - m_mcu->out_p2_cb().set(FUNC(skykid_state::skykid_led_w)); /* lamps */ + m_mcu->in_p1_cb().set(FUNC(skykid_state::inputport_r)); + m_mcu->out_p1_cb().set(FUNC(skykid_state::inputport_select_w)); + m_mcu->in_p2_cb().set_constant(0xff); // leds won't work otherwise + m_mcu->out_p2_cb().set(FUNC(skykid_state::led_w)); - config.set_maximum_quantum(attotime::from_hz(6000)); /* we need heavy synch */ + config.set_maximum_quantum(attotime::from_hz(6000)); // we need heavy synch WATCHDOG_TIMER(config, "watchdog"); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(60.606060); screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); screen.set_size(36*8, 28*8); screen.set_visarea(0*8, 36*8-1, 0*8, 28*8-1); - screen.set_screen_update(FUNC(skykid_state::screen_update_skykid)); + screen.set_screen_update(FUNC(skykid_state::screen_update)); screen.set_palette(m_palette); screen.screen_vblank().set(FUNC(skykid_state::vblank_irq)); GFXDECODE(config, m_gfxdecode, m_palette, gfx_skykid); - PALETTE(config, m_palette, FUNC(skykid_state::skykid_palette), 64*4 + 128*4 + 64*8, 256); + PALETTE(config, m_palette, FUNC(skykid_state::palette), 64*4 + 128*4 + 64*8, 256); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); - NAMCO_CUS30(config, m_cus30, 49152000/2048); + NAMCO_CUS30(config, m_cus30, 49152000 / 2048); m_cus30->set_voices(8); m_cus30->add_route(ALL_OUTPUTS, "mono", 1.0); } ROM_START( skykid ) // a PCB was found with ROM 4 and 6 labeled sk1, but hashes match the sk2 listed here and in other sets, while they differ from the sk1 ROMs in set skykidd? - ROM_REGION( 0x14000, "maincpu", 0 ) /* 6809 code */ + ROM_REGION( 0x14000, "maincpu", 0 ) // 6809 code ROM_LOAD( "sk2_2.6c", 0x08000, 0x4000, CRC(ea8a5822) SHA1(5b13133410bcb7d647e662b476dbfd2edab8aac0) ) ROM_LOAD( "sk1-1c.6b", 0x0c000, 0x4000, CRC(7abe6c6c) SHA1(7d2631cc6149fa3e02b1355cb899de5474ff5d0a) ) - ROM_LOAD( "sk1_3.6d", 0x10000, 0x4000, CRC(314b8765) SHA1(d90a8a853ce672fe5ee190f07bcb33262c73df3b) ) /* banked ROM */ + ROM_LOAD( "sk1_3.6d", 0x10000, 0x4000, CRC(314b8765) SHA1(d90a8a853ce672fe5ee190f07bcb33262c73df3b) ) // banked ROM - ROM_REGION( 0x10000, "mcu", 0 ) /* MCU code */ - ROM_LOAD( "sk2_4.3c", 0x8000, 0x2000, CRC(a460d0e0) SHA1(7124ffeb3b84b282940dcbf9421ae4934bcce1c8) ) /* subprogram for the MCU */ - ROM_LOAD( "cus63-63a1.mcu", 0xf000, 0x1000, CRC(6ef08fb3) SHA1(4842590d60035a0059b0899eb2d5f58ae72c2529) ) /* MCU internal code */ + ROM_REGION( 0x10000, "mcu", 0 ) + ROM_LOAD( "sk2_4.3c", 0x8000, 0x2000, CRC(a460d0e0) SHA1(7124ffeb3b84b282940dcbf9421ae4934bcce1c8) ) // subprogram for the MCU + ROM_LOAD( "cus63-63a1.mcu", 0xf000, 0x1000, CRC(6ef08fb3) SHA1(4842590d60035a0059b0899eb2d5f58ae72c2529) ) // MCU internal code - ROM_REGION( 0x02000, "gfx1", 0 ) - ROM_LOAD( "sk1_6.6l", 0x0000, 0x2000, CRC(58b731b9) SHA1(40f7be85914833ce02a734c20d68c0db8b77911d) ) /* chars */ + ROM_REGION( 0x02000, "chars", 0 ) + ROM_LOAD( "sk1_6.6l", 0x0000, 0x2000, CRC(58b731b9) SHA1(40f7be85914833ce02a734c20d68c0db8b77911d) ) - ROM_REGION( 0x02000, "gfx2", 0 ) + ROM_REGION( 0x02000, "tiles", 0 ) ROM_LOAD( "sk1_5.7e", 0x0000, 0x2000, CRC(c33a498e) SHA1(9f89a514888418a9bebbca341a8cc66e41b58acb) ) - ROM_REGION( 0x10000, "gfx3", 0 ) - ROM_LOAD( "sk1_8.10n", 0x0000, 0x4000, CRC(44bb7375) SHA1(5b2fa6782671150bab5f3c3ac46b47bc23f3d7e0) ) /* sprites */ + ROM_REGION( 0x10000, "sprites", 0 ) + ROM_LOAD( "sk1_8.10n", 0x0000, 0x4000, CRC(44bb7375) SHA1(5b2fa6782671150bab5f3c3ac46b47bc23f3d7e0) ) ROM_LOAD( "sk1_7.10m", 0x4000, 0x4000, CRC(3454671d) SHA1(723b26a0f208addc2a22736457cb4be6ab6c69cc) ) - /* 0x8000-0xbfff will be unpacked from 0x4000-0x5fff */ + // 0x8000-0xbfff will be unpacked from 0x4000-0x5fff ROM_FILL( 0xc000, 0x4000, 0x00 ) // part of the gfx is 2bpp decoded as 3bpp ROM_REGION( 0x0700, "proms", 0 ) - ROM_LOAD( "sk1-1.2n", 0x0000, 0x0100, CRC(0218e726) SHA1(8b766162a4783c058d9a1ecf8741673d7ef955fb) ) /* red component */ - ROM_LOAD( "sk1-2.2p", 0x0100, 0x0100, CRC(fc0d5b85) SHA1(d1b13e42e735b24594cf0b840dee8110de23369e) ) /* green component */ - ROM_LOAD( "sk1-3.2r", 0x0200, 0x0100, CRC(d06b620b) SHA1(968a2d62c65e201d521e9efa8fcf6ad15898e4b3) ) /* blue component */ - ROM_LOAD( "sk1-4.5n", 0x0300, 0x0200, CRC(c697ac72) SHA1(3b79755e6cbb22c14fc4affdbd3f4521da1d90e8) ) /* tiles lookup table */ - ROM_LOAD( "sk1-5.6n", 0x0500, 0x0200, CRC(161514a4) SHA1(4488ce60d12be6586e4a1ddbbfd06bf4e7dfaceb) ) /* sprites lookup table */ + ROM_LOAD( "sk1-1.2n", 0x0000, 0x0100, CRC(0218e726) SHA1(8b766162a4783c058d9a1ecf8741673d7ef955fb) ) // red component + ROM_LOAD( "sk1-2.2p", 0x0100, 0x0100, CRC(fc0d5b85) SHA1(d1b13e42e735b24594cf0b840dee8110de23369e) ) // green component + ROM_LOAD( "sk1-3.2r", 0x0200, 0x0100, CRC(d06b620b) SHA1(968a2d62c65e201d521e9efa8fcf6ad15898e4b3) ) // blue component + ROM_LOAD( "sk1-4.5n", 0x0300, 0x0200, CRC(c697ac72) SHA1(3b79755e6cbb22c14fc4affdbd3f4521da1d90e8) ) // tiles lookup table + ROM_LOAD( "sk1-5.6n", 0x0500, 0x0200, CRC(161514a4) SHA1(4488ce60d12be6586e4a1ddbbfd06bf4e7dfaceb) ) // sprites lookup table ROM_END ROM_START( skykido ) - ROM_REGION( 0x14000, "maincpu", 0 ) /* 6809 code */ + ROM_REGION( 0x14000, "maincpu", 0 ) // 6809 code ROM_LOAD( "sk2_2.6c", 0x08000, 0x4000, CRC(ea8a5822) SHA1(5b13133410bcb7d647e662b476dbfd2edab8aac0) ) ROM_LOAD( "sk1_1.6b", 0x0c000, 0x4000, CRC(070a49d4) SHA1(4b994bde3e34b574bd927843804d2fb1a08d1bdf) ) - ROM_LOAD( "sk1_3.6d", 0x10000, 0x4000, CRC(314b8765) SHA1(d90a8a853ce672fe5ee190f07bcb33262c73df3b) ) /* banked ROM */ + ROM_LOAD( "sk1_3.6d", 0x10000, 0x4000, CRC(314b8765) SHA1(d90a8a853ce672fe5ee190f07bcb33262c73df3b) ) // banked ROM - ROM_REGION( 0x10000, "mcu", 0 ) /* MCU code */ - ROM_LOAD( "sk2_4.3c", 0x8000, 0x2000, CRC(a460d0e0) SHA1(7124ffeb3b84b282940dcbf9421ae4934bcce1c8) ) /* subprogram for the MCU */ - ROM_LOAD( "cus63-63a1.mcu", 0xf000, 0x1000, CRC(6ef08fb3) SHA1(4842590d60035a0059b0899eb2d5f58ae72c2529) ) /* MCU internal code */ + ROM_REGION( 0x10000, "mcu", 0 ) + ROM_LOAD( "sk2_4.3c", 0x8000, 0x2000, CRC(a460d0e0) SHA1(7124ffeb3b84b282940dcbf9421ae4934bcce1c8) ) // subprogram for the MCU + ROM_LOAD( "cus63-63a1.mcu", 0xf000, 0x1000, CRC(6ef08fb3) SHA1(4842590d60035a0059b0899eb2d5f58ae72c2529) ) // MCU internal code - ROM_REGION( 0x02000, "gfx1", 0 ) - ROM_LOAD( "sk1_6.6l", 0x0000, 0x2000, CRC(58b731b9) SHA1(40f7be85914833ce02a734c20d68c0db8b77911d) ) /* chars */ + ROM_REGION( 0x02000, "chars", 0 ) + ROM_LOAD( "sk1_6.6l", 0x0000, 0x2000, CRC(58b731b9) SHA1(40f7be85914833ce02a734c20d68c0db8b77911d) ) - ROM_REGION( 0x02000, "gfx2", 0 ) + ROM_REGION( 0x02000, "tiles", 0 ) ROM_LOAD( "sk1_5.7e", 0x0000, 0x2000, CRC(c33a498e) SHA1(9f89a514888418a9bebbca341a8cc66e41b58acb) ) - ROM_REGION( 0x10000, "gfx3", 0 ) - ROM_LOAD( "sk1_8.10n", 0x0000, 0x4000, CRC(44bb7375) SHA1(5b2fa6782671150bab5f3c3ac46b47bc23f3d7e0) ) /* sprites */ + ROM_REGION( 0x10000, "sprites", 0 ) + ROM_LOAD( "sk1_8.10n", 0x0000, 0x4000, CRC(44bb7375) SHA1(5b2fa6782671150bab5f3c3ac46b47bc23f3d7e0) ) ROM_LOAD( "sk1_7.10m", 0x4000, 0x4000, CRC(3454671d) SHA1(723b26a0f208addc2a22736457cb4be6ab6c69cc) ) - /* 0x8000-0xbfff will be unpacked from 0x4000-0x5fff */ + // 0x8000-0xbfff will be unpacked from 0x4000-0x5fff ROM_FILL( 0xc000, 0x4000, 0x00 ) // part of the gfx is 2bpp decoded as 3bpp ROM_REGION( 0x0700, "proms", 0 ) - ROM_LOAD( "sk1-1.2n", 0x0000, 0x0100, CRC(0218e726) SHA1(8b766162a4783c058d9a1ecf8741673d7ef955fb) ) /* red component */ - ROM_LOAD( "sk1-2.2p", 0x0100, 0x0100, CRC(fc0d5b85) SHA1(d1b13e42e735b24594cf0b840dee8110de23369e) ) /* green component */ - ROM_LOAD( "sk1-3.2r", 0x0200, 0x0100, CRC(d06b620b) SHA1(968a2d62c65e201d521e9efa8fcf6ad15898e4b3) ) /* blue component */ - ROM_LOAD( "sk1-4.5n", 0x0300, 0x0200, CRC(c697ac72) SHA1(3b79755e6cbb22c14fc4affdbd3f4521da1d90e8) ) /* tiles lookup table */ - ROM_LOAD( "sk1-5.6n", 0x0500, 0x0200, CRC(161514a4) SHA1(4488ce60d12be6586e4a1ddbbfd06bf4e7dfaceb) ) /* sprites lookup table */ + ROM_LOAD( "sk1-1.2n", 0x0000, 0x0100, CRC(0218e726) SHA1(8b766162a4783c058d9a1ecf8741673d7ef955fb) ) // red component + ROM_LOAD( "sk1-2.2p", 0x0100, 0x0100, CRC(fc0d5b85) SHA1(d1b13e42e735b24594cf0b840dee8110de23369e) ) // green component + ROM_LOAD( "sk1-3.2r", 0x0200, 0x0100, CRC(d06b620b) SHA1(968a2d62c65e201d521e9efa8fcf6ad15898e4b3) ) // blue component + ROM_LOAD( "sk1-4.5n", 0x0300, 0x0200, CRC(c697ac72) SHA1(3b79755e6cbb22c14fc4affdbd3f4521da1d90e8) ) // tiles lookup table + ROM_LOAD( "sk1-5.6n", 0x0500, 0x0200, CRC(161514a4) SHA1(4488ce60d12be6586e4a1ddbbfd06bf4e7dfaceb) ) // sprites lookup table ROM_END ROM_START( skykidd ) - ROM_REGION( 0x14000, "maincpu", 0 ) /* 6809 code */ + ROM_REGION( 0x14000, "maincpu", 0 ) // 6809 code ROM_LOAD( "sk1_2.6c", 0x08000, 0x4000, CRC(8370671a) SHA1(7038f952ebfc4482440b73ee4027fa908561d122) ) ROM_LOAD( "sk1_1.6b", 0x0c000, 0x4000, CRC(070a49d4) SHA1(4b994bde3e34b574bd927843804d2fb1a08d1bdf) ) - ROM_LOAD( "sk1_3.6d", 0x10000, 0x4000, CRC(314b8765) SHA1(d90a8a853ce672fe5ee190f07bcb33262c73df3b) ) /* banked ROM */ + ROM_LOAD( "sk1_3.6d", 0x10000, 0x4000, CRC(314b8765) SHA1(d90a8a853ce672fe5ee190f07bcb33262c73df3b) ) // banked ROM - ROM_REGION( 0x10000, "mcu", 0 ) /* MCU code */ - ROM_LOAD( "sk1_4.3c", 0x8000, 0x2000, CRC(887137cc) SHA1(dd0f66afb78833c4da73539b692854346f448c0d) ) /* subprogram for the MCU */ - ROM_LOAD( "cus60-60a1.mcu", 0xf000, 0x1000, CRC(076ea82a) SHA1(22b5e62e26390d7d5cacc0503c7aa5ed524204df) ) /* MCU internal code */ + ROM_REGION( 0x10000, "mcu", 0 ) + ROM_LOAD( "sk1_4.3c", 0x8000, 0x2000, CRC(887137cc) SHA1(dd0f66afb78833c4da73539b692854346f448c0d) ) // subprogram for the MCU + ROM_LOAD( "cus60-60a1.mcu", 0xf000, 0x1000, CRC(076ea82a) SHA1(22b5e62e26390d7d5cacc0503c7aa5ed524204df) ) // MCU internal code - ROM_REGION( 0x02000, "gfx1", 0 ) - ROM_LOAD( "sk1_6.6l", 0x0000, 0x2000, CRC(58b731b9) SHA1(40f7be85914833ce02a734c20d68c0db8b77911d) ) /* chars */ + ROM_REGION( 0x02000, "chars", 0 ) + ROM_LOAD( "sk1_6.6l", 0x0000, 0x2000, CRC(58b731b9) SHA1(40f7be85914833ce02a734c20d68c0db8b77911d) ) - ROM_REGION( 0x02000, "gfx2", 0 ) + ROM_REGION( 0x02000, "tiles", 0 ) ROM_LOAD( "sk1_5.7e", 0x0000, 0x2000, CRC(c33a498e) SHA1(9f89a514888418a9bebbca341a8cc66e41b58acb) ) - ROM_REGION( 0x10000, "gfx3", 0 ) - ROM_LOAD( "sk1_8.10n", 0x0000, 0x4000, CRC(44bb7375) SHA1(5b2fa6782671150bab5f3c3ac46b47bc23f3d7e0) ) /* sprites */ + ROM_REGION( 0x10000, "sprites", 0 ) + ROM_LOAD( "sk1_8.10n", 0x0000, 0x4000, CRC(44bb7375) SHA1(5b2fa6782671150bab5f3c3ac46b47bc23f3d7e0) ) ROM_LOAD( "sk1_7.10m", 0x4000, 0x4000, CRC(3454671d) SHA1(723b26a0f208addc2a22736457cb4be6ab6c69cc) ) - /* 0x8000-0xbfff will be unpacked from 0x4000-0x5fff */ + // 0x8000-0xbfff will be unpacked from 0x4000-0x5fff ROM_FILL( 0xc000, 0x4000, 0x00 ) // part of the gfx is 2bpp decoded as 3bpp ROM_REGION( 0x0700, "proms", 0 ) - ROM_LOAD( "sk1-1.2n", 0x0000, 0x0100, CRC(0218e726) SHA1(8b766162a4783c058d9a1ecf8741673d7ef955fb) ) /* red component */ - ROM_LOAD( "sk1-2.2p", 0x0100, 0x0100, CRC(fc0d5b85) SHA1(d1b13e42e735b24594cf0b840dee8110de23369e) ) /* green component */ - ROM_LOAD( "sk1-3.2r", 0x0200, 0x0100, CRC(d06b620b) SHA1(968a2d62c65e201d521e9efa8fcf6ad15898e4b3) ) /* blue component */ - ROM_LOAD( "sk1-4.5n", 0x0300, 0x0200, CRC(c697ac72) SHA1(3b79755e6cbb22c14fc4affdbd3f4521da1d90e8) ) /* tiles lookup table */ - ROM_LOAD( "sk1-5.6n", 0x0500, 0x0200, CRC(161514a4) SHA1(4488ce60d12be6586e4a1ddbbfd06bf4e7dfaceb) ) /* sprites lookup table */ + ROM_LOAD( "sk1-1.2n", 0x0000, 0x0100, CRC(0218e726) SHA1(8b766162a4783c058d9a1ecf8741673d7ef955fb) ) // red component + ROM_LOAD( "sk1-2.2p", 0x0100, 0x0100, CRC(fc0d5b85) SHA1(d1b13e42e735b24594cf0b840dee8110de23369e) ) // green component + ROM_LOAD( "sk1-3.2r", 0x0200, 0x0100, CRC(d06b620b) SHA1(968a2d62c65e201d521e9efa8fcf6ad15898e4b3) ) // blue component + ROM_LOAD( "sk1-4.5n", 0x0300, 0x0200, CRC(c697ac72) SHA1(3b79755e6cbb22c14fc4affdbd3f4521da1d90e8) ) // tiles lookup table + ROM_LOAD( "sk1-5.6n", 0x0500, 0x0200, CRC(161514a4) SHA1(4488ce60d12be6586e4a1ddbbfd06bf4e7dfaceb) ) // sprites lookup table ROM_END ROM_START( skykids ) - ROM_REGION( 0x14000, "maincpu", 0 ) /* 6809 code */ + ROM_REGION( 0x14000, "maincpu", 0 ) // 6809 code ROM_LOAD( "sk2a.6c", 0x08000, 0x4000, CRC(68492672) SHA1(3dbe5ec930de5c526d3ef65513993c10f2153a36) ) ROM_LOAD( "sk1a.6b", 0x0c000, 0x4000, CRC(e16abe25) SHA1(78e0d30b15fb62c4399d847784ddc61f6819feba) ) - ROM_LOAD( "sk1_3.6d", 0x10000, 0x4000, CRC(314b8765) SHA1(d90a8a853ce672fe5ee190f07bcb33262c73df3b) ) /* banked ROM */ + ROM_LOAD( "sk1_3.6d", 0x10000, 0x4000, CRC(314b8765) SHA1(d90a8a853ce672fe5ee190f07bcb33262c73df3b) ) // banked ROM - ROM_REGION( 0x10000, "mcu", 0 ) /* MCU code */ - ROM_LOAD( "sk2_4.3c", 0x8000, 0x2000, CRC(a460d0e0) SHA1(7124ffeb3b84b282940dcbf9421ae4934bcce1c8) ) /* subprogram for the MCU */ - ROM_LOAD( "cus63-63a1.mcu", 0xf000, 0x1000, CRC(6ef08fb3) SHA1(4842590d60035a0059b0899eb2d5f58ae72c2529) ) /* MCU internal code */ + ROM_REGION( 0x10000, "mcu", 0 ) + ROM_LOAD( "sk2_4.3c", 0x8000, 0x2000, CRC(a460d0e0) SHA1(7124ffeb3b84b282940dcbf9421ae4934bcce1c8) ) // subprogram for the MCU + ROM_LOAD( "cus63-63a1.mcu", 0xf000, 0x1000, CRC(6ef08fb3) SHA1(4842590d60035a0059b0899eb2d5f58ae72c2529) ) // MCU internal code - ROM_REGION( 0x02000, "gfx1", 0 ) - ROM_LOAD( "sk1_6.6l", 0x0000, 0x2000, CRC(58b731b9) SHA1(40f7be85914833ce02a734c20d68c0db8b77911d) ) /* chars */ + ROM_REGION( 0x02000, "chars", 0 ) + ROM_LOAD( "sk1_6.6l", 0x0000, 0x2000, CRC(58b731b9) SHA1(40f7be85914833ce02a734c20d68c0db8b77911d) ) - ROM_REGION( 0x02000, "gfx2", 0 ) + ROM_REGION( 0x02000, "tiles", 0 ) ROM_LOAD( "sk1_5.7e", 0x0000, 0x2000, CRC(c33a498e) SHA1(9f89a514888418a9bebbca341a8cc66e41b58acb) ) - ROM_REGION( 0x10000, "gfx3", 0 ) - ROM_LOAD( "sk1_8.10n", 0x0000, 0x4000, CRC(44bb7375) SHA1(5b2fa6782671150bab5f3c3ac46b47bc23f3d7e0) ) /* sprites */ + ROM_REGION( 0x10000, "sprites", 0 ) + ROM_LOAD( "sk1_8.10n", 0x0000, 0x4000, CRC(44bb7375) SHA1(5b2fa6782671150bab5f3c3ac46b47bc23f3d7e0) ) ROM_LOAD( "sk1_7.10m", 0x4000, 0x4000, CRC(3454671d) SHA1(723b26a0f208addc2a22736457cb4be6ab6c69cc) ) - /* 0x8000-0xbfff will be unpacked from 0x4000-0x5fff */ + // 0x8000-0xbfff will be unpacked from 0x4000-0x5fff ROM_FILL( 0xc000, 0x4000, 0x00 ) // part of the gfx is 2bpp decoded as 3bpp ROM_REGION( 0x0700, "proms", 0 ) - ROM_LOAD( "sk1-1.2n", 0x0000, 0x0100, CRC(0218e726) SHA1(8b766162a4783c058d9a1ecf8741673d7ef955fb) ) /* red component */ - ROM_LOAD( "sk1-2.2p", 0x0100, 0x0100, CRC(fc0d5b85) SHA1(d1b13e42e735b24594cf0b840dee8110de23369e) ) /* green component */ - ROM_LOAD( "sk1-3.2r", 0x0200, 0x0100, CRC(d06b620b) SHA1(968a2d62c65e201d521e9efa8fcf6ad15898e4b3) ) /* blue component */ - ROM_LOAD( "sk1-4.5n", 0x0300, 0x0200, CRC(c697ac72) SHA1(3b79755e6cbb22c14fc4affdbd3f4521da1d90e8) ) /* tiles lookup table */ - ROM_LOAD( "sk1-5.6n", 0x0500, 0x0200, CRC(161514a4) SHA1(4488ce60d12be6586e4a1ddbbfd06bf4e7dfaceb) ) /* sprites lookup table */ + ROM_LOAD( "sk1-1.2n", 0x0000, 0x0100, CRC(0218e726) SHA1(8b766162a4783c058d9a1ecf8741673d7ef955fb) ) // red component + ROM_LOAD( "sk1-2.2p", 0x0100, 0x0100, CRC(fc0d5b85) SHA1(d1b13e42e735b24594cf0b840dee8110de23369e) ) // green component + ROM_LOAD( "sk1-3.2r", 0x0200, 0x0100, CRC(d06b620b) SHA1(968a2d62c65e201d521e9efa8fcf6ad15898e4b3) ) // blue component + ROM_LOAD( "sk1-4.5n", 0x0300, 0x0200, CRC(c697ac72) SHA1(3b79755e6cbb22c14fc4affdbd3f4521da1d90e8) ) // tiles lookup table + ROM_LOAD( "sk1-5.6n", 0x0500, 0x0200, CRC(161514a4) SHA1(4488ce60d12be6586e4a1ddbbfd06bf4e7dfaceb) ) // sprites lookup table ROM_END ROM_START( drgnbstr ) - ROM_REGION( 0x14000, "maincpu", 0 ) /* 6809 code */ + ROM_REGION( 0x14000, "maincpu", 0 ) // 6809 code ROM_LOAD( "db1_2b.6c", 0x08000, 0x04000, CRC(0f11cd17) SHA1(691d853f4f08898ecf4bccfb70a568de309329f1) ) ROM_LOAD( "db1_1.6b", 0x0c000, 0x04000, CRC(1c7c1821) SHA1(8b6111afc42e2996bdc2fc276be0c40556cd431e) ) - ROM_LOAD( "db1_3.6d", 0x10000, 0x04000, CRC(6da169ae) SHA1(235211c26562fef0660e3fde1e87f2e52626d119) ) /* banked ROM */ + ROM_LOAD( "db1_3.6d", 0x10000, 0x04000, CRC(6da169ae) SHA1(235211c26562fef0660e3fde1e87f2e52626d119) ) // banked ROM - ROM_REGION( 0x10000, "mcu", 0 ) /* MCU code */ - ROM_LOAD( "db1_4.3c", 0x8000, 0x02000, CRC(8a0b1fc1) SHA1(c2861d0da63e2d17f2d1ad46dccf753ecd902ce3) ) /* subprogram for the MCU */ - ROM_LOAD( "cus60-60a1.mcu", 0xf000, 0x01000, CRC(076ea82a) SHA1(22b5e62e26390d7d5cacc0503c7aa5ed524204df) ) /* MCU internal code */ + ROM_REGION( 0x10000, "mcu", 0 ) + ROM_LOAD( "db1_4.3c", 0x8000, 0x02000, CRC(8a0b1fc1) SHA1(c2861d0da63e2d17f2d1ad46dccf753ecd902ce3) ) // subprogram for the MCU + ROM_LOAD( "cus60-60a1.mcu", 0xf000, 0x01000, CRC(076ea82a) SHA1(22b5e62e26390d7d5cacc0503c7aa5ed524204df) ) // MCU internal code - ROM_REGION( 0x02000, "gfx1", 0 ) - ROM_LOAD( "db1_6.6l", 0x0000, 0x2000, CRC(c080b66c) SHA1(05dcd45274d0bd12ef8ae7fd10c8719e679b3e7b) ) /* tiles */ + ROM_REGION( 0x02000, "chars", 0 ) + ROM_LOAD( "db1_6.6l", 0x0000, 0x2000, CRC(c080b66c) SHA1(05dcd45274d0bd12ef8ae7fd10c8719e679b3e7b) ) - ROM_REGION( 0x02000, "gfx2", 0 ) + ROM_REGION( 0x02000, "tiles", 0 ) ROM_LOAD( "db1_5.7e", 0x0000, 0x2000, CRC(28129aed) SHA1(d7f52e871d97179ec88c142a1c70eb6ad09e534a) ) - ROM_REGION( 0x10000, "gfx3", 0 ) - ROM_LOAD( "db1_8.10n", 0x0000, 0x4000, CRC(11942c61) SHA1(0f065cb82cf83967e90b3c7326b36956f4fa9a52) ) /* sprites */ + ROM_REGION( 0x10000, "sprites", 0 ) + ROM_LOAD( "db1_8.10n", 0x0000, 0x4000, CRC(11942c61) SHA1(0f065cb82cf83967e90b3c7326b36956f4fa9a52) ) ROM_LOAD( "db1_7.10m", 0x4000, 0x4000, CRC(cc130fe2) SHA1(4f5d4f21152b3b4e523a6d17dd5ff5cef52447f2) ) - /* 0x8000-0xbfff will be unpacked from 0x4000-0x5fff */ + // 0x8000-0xbfff will be unpacked from 0x4000-0x5fff ROM_FILL( 0xc000, 0x4000, 0x00 ) // part of the gfx is 2bpp decoded as 3bpp ROM_REGION( 0x0700, "proms", 0 ) - ROM_LOAD( "db1-1.2n", 0x0000, 0x0100, CRC(3f8cce97) SHA1(027b3fb0f322a9d68b434b207a40b31799a8a8d6) ) /* red component */ - ROM_LOAD( "db1-2.2p", 0x0100, 0x0100, CRC(afe32436) SHA1(e405787f7f2aa992edd63078e3944334d8acddb1) ) /* green component */ - ROM_LOAD( "db1-3.2r", 0x0200, 0x0100, CRC(c95ff576) SHA1(861a7340d29e6a6a0d5ead93abd3f73cc3df0cc7) ) /* blue component */ - ROM_LOAD( "db1-4.5n", 0x0300, 0x0200, CRC(b2180c21) SHA1(a5d14c31d54f04494ea99c3d94bd1b5e072b612e) ) /* tiles lookup table */ - ROM_LOAD( "db1-5.6n", 0x0500, 0x0200, CRC(5e2b3f74) SHA1(ef58661fa12a52bc358e81179254d37de7551b38) ) /* sprites lookup table */ + ROM_LOAD( "db1-1.2n", 0x0000, 0x0100, CRC(3f8cce97) SHA1(027b3fb0f322a9d68b434b207a40b31799a8a8d6) ) // red component + ROM_LOAD( "db1-2.2p", 0x0100, 0x0100, CRC(afe32436) SHA1(e405787f7f2aa992edd63078e3944334d8acddb1) ) // green component + ROM_LOAD( "db1-3.2r", 0x0200, 0x0100, CRC(c95ff576) SHA1(861a7340d29e6a6a0d5ead93abd3f73cc3df0cc7) ) // blue component + ROM_LOAD( "db1-4.5n", 0x0300, 0x0200, CRC(b2180c21) SHA1(a5d14c31d54f04494ea99c3d94bd1b5e072b612e) ) // tiles lookup table + ROM_LOAD( "db1-5.6n", 0x0500, 0x0200, CRC(5e2b3f74) SHA1(ef58661fa12a52bc358e81179254d37de7551b38) ) // sprites lookup table ROM_END void skykid_state::init_skykid() { - /* unpack the third sprite ROM */ - uint8_t *rom = memregion("gfx3")->base() + 0x4000; - for (int i = 0;i < 0x2000;i++) + // unpack the third sprite ROM + uint8_t *rom = memregion("sprites")->base() + 0x4000; + for (int i = 0; i < 0x2000; i++) { rom[i + 0x4000] = rom[i]; // sprite set #1, plane 3 rom[i + 0x6000] = rom[i] >> 4; // sprite set #2, plane 3 @@ -625,11 +904,14 @@ } } +} // anonymous namespace + + GAME( 1984, drgnbstr, 0, skykid, drgnbstr, skykid_state, init_skykid, ROT0, "Namco", "Dragon Buster", MACHINE_SUPPORTS_SAVE ) -GAME( 1985, skykid, 0, skykid, skykid, skykid_state, init_skykid, ROT180, "Namco", "Sky Kid (new version)", MACHINE_SUPPORTS_SAVE ) /* Uses CUS63 aka 63a1 */ -GAME( 1985, skykido, skykid, skykid, skykid, skykid_state, init_skykid, ROT180, "Namco", "Sky Kid (old version)", MACHINE_SUPPORTS_SAVE ) /* Uses CUS63 aka 63a1 */ -GAME( 1985, skykidd, skykid, skykid, skykid, skykid_state, init_skykid, ROT180, "Namco", "Sky Kid (CUS60 version)", MACHINE_SUPPORTS_SAVE ) /* Uses CUS60 aka 60a1 */ +GAME( 1985, skykid, 0, skykid, skykid, skykid_state, init_skykid, ROT180, "Namco", "Sky Kid (new version)", MACHINE_SUPPORTS_SAVE ) // Uses CUS63 aka 63a1 +GAME( 1985, skykido, skykid, skykid, skykid, skykid_state, init_skykid, ROT180, "Namco", "Sky Kid (old version)", MACHINE_SUPPORTS_SAVE ) // Uses CUS63 aka 63a1 +GAME( 1985, skykidd, skykid, skykid, skykid, skykid_state, init_skykid, ROT180, "Namco", "Sky Kid (CUS60 version)", MACHINE_SUPPORTS_SAVE ) // Uses CUS60 aka 60a1 // no license text is displayed but the PCB was licensed by Namco for production by Sipem (formerly Sidam) with Namco supplying the Custom chips (MCU etc.) // the level select is handled in a much more user-friendly way in this set and the dip for it is inverted (although this is displayed incorrectly in the test mode) -GAME( 1985, skykids, skykid, skykid, skykids, skykid_state, init_skykid, ROT180, "Namco (Sipem license)", "Sky Kid (Sipem)", MACHINE_SUPPORTS_SAVE ) /* Uses CUS63 aka 63a1 */ +GAME( 1985, skykids, skykid, skykid, skykids, skykid_state, init_skykid, ROT180, "Namco (Sipem license)", "Sky Kid (Sipem)", MACHINE_SUPPORTS_SAVE ) // Uses CUS63 aka 63a1 diff -Nru mame-0.242+dfsg.1/src/mame/drivers/slapfght_ms.cpp mame-0.243+dfsg.1/src/mame/drivers/slapfght_ms.cpp --- mame-0.242+dfsg.1/src/mame/drivers/slapfght_ms.cpp 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/slapfght_ms.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,468 @@ +// license:BSD-3-Clause +// copyright-holders: + +/* + Slap Fight (Modular System) + + As with most of the 'Modular System' setups, the hardware is heavily modified from the original + and consists of a multi-board stack in a cage, hence different driver. + + For this game the Modular System cage contains 6 main boards and 1 sub board. + + MOD. 3 - Z80 board (3 ROMs + RAM + 24MHz XTAL) + small sub board with Z0840006PSC + PROM + logic (decryption?). + MOD 21/1 - 20 MHz XTAL + logic. + MOD 1 - Sound board (Z08400BPS, 2 x YM2203C). 2 8-dips banks. + MOD 51/1 - Sprite board, has logic + 4 ROMs. + MOD 4/2 - Tilemap board, has logic + 2 ROMs. + MOD 4/2 - Tilemap board, has logic + 4 ROMs, long thin sub-board (C0425) with no chips, just routing along one edge. + + TODO: + - stuck at RAM CHECK OK due to wrong main CPU IRQ handling, if prodded via debugger it passes ROM CHECK too, but then stops at SOUND OK again due to IRQs; + - colors (no color PROMs?); + - sound IRQs once testable; + - derive from slapfght_state (slapfght.cpp) once all the common points and differences are verified. +*/ + + +#include "emu.h" + +#include "cpu/z80/z80.h" +#include "machine/74259.h" +#include "machine/gen_latch.h" +#include "sound/ymopn.h" + +#include "emupal.h" +#include "screen.h" +#include "speaker.h" +#include "tilemap.h" + + +namespace { + +class slapfght_ms_state : public driver_device +{ +public: + slapfght_ms_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_screen(*this, "screen"), + m_gfxdecode(*this, "gfxdecode"), + m_videoram(*this, "videoram"), + m_colorram(*this, "colorram"), + m_spriteram(*this, "spriteram"), + m_fixvideoram(*this, "fixvideoram"), + m_fixcolorram(*this, "fixcolorram"), + m_mainbank(*this, "mainbank") + { } + + void slapfighm(machine_config &config); + + void init_decryption(); + +protected: + virtual void machine_start() override; + virtual void video_start() override; + +private: + required_device m_maincpu; + required_device m_audiocpu; + required_device m_screen; + required_device m_gfxdecode; + + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + required_shared_ptr m_spriteram; + required_shared_ptr m_fixvideoram; + required_shared_ptr m_fixcolorram; + required_memory_bank m_mainbank; + + bool m_main_irq_enabled = false; + bool m_sound_nmi_enabled = false; + + tilemap_t *m_pf1_tilemap = nullptr; + tilemap_t *m_fix_tilemap = nullptr; + + DECLARE_WRITE_LINE_MEMBER(vblank_irq); + DECLARE_WRITE_LINE_MEMBER(irq_enable_w); + DECLARE_WRITE_LINE_MEMBER(sound_reset_w); + + void videoram_w(offs_t offset, uint8_t data); + void colorram_w(offs_t offset, uint8_t data); + void fixram_w(offs_t offset, uint8_t data); + void fixcol_w(offs_t offset, uint8_t data); + TILE_GET_INFO_MEMBER(get_pf1_tile_info); + TILE_GET_INFO_MEMBER(get_fix_tile_info); + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + void main_io_map(address_map &map); + void main_prg_map(address_map &map); + void sound_prg_map(address_map &map); +}; + + +// video + +TILE_GET_INFO_MEMBER(slapfght_ms_state::get_pf1_tile_info) +{ + int tile = m_videoram[tile_index] | ((m_colorram[tile_index] & 0x0f) << 8); + int color = (m_colorram[tile_index] & 0xf0) >> 4; + + tileinfo.set(1, tile, color, 0); +} + +TILE_GET_INFO_MEMBER(slapfght_ms_state::get_fix_tile_info) +{ + int tile = m_fixvideoram[tile_index] | ((m_fixcolorram[tile_index] & 0x03) << 8); + int color = (m_fixcolorram[tile_index] & 0xfc) >> 2; + + tileinfo.set(0, tile, color, 0); +} + +void slapfght_ms_state::videoram_w(offs_t offset, uint8_t data) +{ + m_videoram[offset] = data; + m_pf1_tilemap->mark_tile_dirty(offset); +} + +void slapfght_ms_state::colorram_w(offs_t offset, uint8_t data) +{ + m_colorram[offset] = data; + m_pf1_tilemap->mark_tile_dirty(offset); +} + +void slapfght_ms_state::fixram_w(offs_t offset, uint8_t data) +{ + m_fixvideoram[offset] = data; + m_fix_tilemap->mark_tile_dirty(offset); +} + +void slapfght_ms_state::fixcol_w(offs_t offset, uint8_t data) +{ + m_fixcolorram[offset] = data; + m_fix_tilemap->mark_tile_dirty(offset); +} + +void slapfght_ms_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) // TODO: verify +{ + const uint8_t *src = m_spriteram; + + for (int offs = 0; offs < m_spriteram.bytes(); offs += 4) + { + /* + 0: xxxxxxxx - code low + 1: xxxxxxxx - x low + 2: xx...... - code high + ..x..... - no function? + ...xxxx. - color + .......x - x high + 3: xxxxxxxx - y + */ + + int code = src[offs + 0] | ((src[offs + 2] & 0xc0) << 2); + int sy = src[offs + 3] + 2; + int sx = (src[offs + 1] | (src[offs + 2] << 8 & 0x100)) - 17; + int color = src[offs + 2] >> 1 & 0xf; + int fx = 0, fy = 0; + + if (flip_screen()) + { + sy = (238 - sy) & 0xff; + sx = 284 - sx; + fx = fy = 1; + } + + if (sy > 256-8) + sy -= 256; + + m_gfxdecode->gfx(2)->transpen(bitmap, cliprect, code, color, fx, fy, sx, sy, 0); + } +} + +uint32_t slapfght_ms_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + //m_pf1_tilemap->set_scrollx(m_scrollx_hi << 8 | m_scrollx_lo); + //m_pf1_tilemap->set_scrolly(m_scrolly); + + m_pf1_tilemap->draw(screen, bitmap, cliprect, 0, 0); + draw_sprites(bitmap, cliprect); + m_fix_tilemap->draw(screen, bitmap, cliprect, 0, 0); + + return 0; +} + +void slapfght_ms_state::video_start() +{ + m_pf1_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(slapfght_ms_state::get_pf1_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + m_fix_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(slapfght_ms_state::get_fix_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + + m_fix_tilemap->set_scrolldy(0, 15); + m_pf1_tilemap->set_scrolldy(0, 14); + + m_fix_tilemap->set_transparent_pen(0); +} + + +// machine + +WRITE_LINE_MEMBER(slapfght_ms_state::vblank_irq) +{ + if (state && m_main_irq_enabled) + m_maincpu->set_input_line(0, ASSERT_LINE); +} + +WRITE_LINE_MEMBER(slapfght_ms_state::irq_enable_w) +{ + m_main_irq_enabled = state ? true : false; + + if (!m_main_irq_enabled) + m_maincpu->set_input_line(0, CLEAR_LINE); +} + +WRITE_LINE_MEMBER(slapfght_ms_state::sound_reset_w) +{ + m_audiocpu->set_input_line(INPUT_LINE_RESET, state ? CLEAR_LINE : ASSERT_LINE); + + if (state == 0) + m_sound_nmi_enabled = false; +} + +void slapfght_ms_state::machine_start() +{ + // 2 x 0x4000 banks, 0xc000 - 0xffff is 0xff filled but for the 0xea00 - 0xefff range which is mapped directly + m_mainbank->configure_entry(0, memregion("maincpu")->base() + 0x8000); + m_mainbank->configure_entry(1, memregion("maincpu")->base() + 0x10000); + + save_item(NAME(m_main_irq_enabled)); + save_item(NAME(m_sound_nmi_enabled)); +} + + +void slapfght_ms_state::main_prg_map(address_map &map) +{ + map(0x0000, 0x7fff).rom(); + map(0x8000, 0xbfff).bankr(m_mainbank); + map(0xc000, 0xc7ff).ram(); + map(0xc800, 0xc80f).ram().share("main_sound"); + map(0xc810, 0xcfff).ram(); + map(0xd000, 0xd7ff).ram().w(FUNC(slapfght_ms_state::videoram_w)).share(m_videoram); + map(0xd800, 0xdfff).ram().w(FUNC(slapfght_ms_state::colorram_w)).share(m_colorram); + map(0xe000, 0xe7ff).ram().share(m_spriteram); + map(0xe900, 0xe900).lw8(NAME([this] (uint8_t data) { m_mainbank->set_entry(data & 0x01); })); + map(0xea00, 0xefff).rom().region("maincpu", 0xea00); // title screen data gets loaded here like slapfighb2 + map(0xf000, 0xf7ff).ram().w(FUNC(slapfght_ms_state::fixram_w)).share(m_fixvideoram); + map(0xf800, 0xffff).ram().w(FUNC(slapfght_ms_state::fixcol_w)).share(m_fixcolorram); +} + +void slapfght_ms_state::main_io_map(address_map &map) +{ + map.global_mask(0xff); + map(0x00, 0x0f).w("mainlatch", FUNC(ls259_device::write_a0)); +} + +void slapfght_ms_state::sound_prg_map(address_map &map) +{ + map(0x0000, 0x3fff).rom(); + map(0xc800, 0xc9ff).ram(); + map(0xdff0, 0xdfff).ram().share("main_sound"); + map(0xe000, 0xe001).w("ym1", FUNC(ym2203_device::write)); + map(0xe002, 0xe003).w("ym2", FUNC(ym2203_device::write)); + map(0xe008, 0xe009).r("ym1", FUNC(ym2203_device::read)); + map(0xe00a, 0xe00b).r("ym2", FUNC(ym2203_device::read)); +} + + +static INPUT_PORTS_START( slapfighm ) + PORT_START("IN0") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL + + PORT_START("IN1") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) + + PORT_START("SW1") + PORT_DIPUNKNOWN_DIPLOC(0x01, 0x01, "SW1:1") + PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "SW1:2") + PORT_DIPUNKNOWN_DIPLOC(0x04, 0x04, "SW1:3") + PORT_DIPUNKNOWN_DIPLOC(0x08, 0x08, "SW1:4") + PORT_DIPUNKNOWN_DIPLOC(0x10, 0x10, "SW1:5") + PORT_DIPUNKNOWN_DIPLOC(0x20, 0x20, "SW1:6") + PORT_DIPUNKNOWN_DIPLOC(0x40, 0x40, "SW1:7") + PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "SW1:8") + + PORT_START("SW2") + PORT_DIPUNKNOWN_DIPLOC(0x01, 0x01, "SW2:1") + PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "SW2:2") + PORT_DIPUNKNOWN_DIPLOC(0x04, 0x04, "SW2:3") + PORT_DIPUNKNOWN_DIPLOC(0x08, 0x08, "SW2:4") + PORT_DIPUNKNOWN_DIPLOC(0x10, 0x10, "SW2:5") + PORT_DIPUNKNOWN_DIPLOC(0x20, 0x20, "SW2:6") + PORT_DIPUNKNOWN_DIPLOC(0x40, 0x40, "SW2:7") + PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "SW2:8") +INPUT_PORTS_END + + +static const gfx_layout charlayout = +{ + 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 const gfx_layout tilelayout = +{ + 8,8, + RGN_FRAC(1,4), + 4, + { RGN_FRAC(0,4), RGN_FRAC(1,4), RGN_FRAC(2,4), RGN_FRAC(3,4) }, + { 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 const gfx_layout spritelayout = +{ + 16,16, + RGN_FRAC(1,1), + 4, + { 0,8,16,24 }, + { 0,1,2,3,4,5,6,7, 512,513,514,515,516,517,518,519 }, + { STEP16(0,32) }, + 16 * 16 * 4 +}; + +static GFXDECODE_START( gfx_slapfighm) + GFXDECODE_ENTRY( "chars", 0, charlayout, 0, 64 ) + GFXDECODE_ENTRY( "tiles", 0, tilelayout, 0, 16 ) + GFXDECODE_ENTRY( "sprites", 0, spritelayout, 0, 16 ) +GFXDECODE_END + + +void slapfght_ms_state::slapfighm(machine_config &config) +{ + // basic machine hardware + Z80(config, m_maincpu, 24_MHz_XTAL / 4); // divisor unknown + m_maincpu->set_addrmap(AS_PROGRAM, &slapfght_ms_state::main_prg_map); + m_maincpu->set_addrmap(AS_IO, &slapfght_ms_state::main_io_map); + + Z80(config, m_audiocpu, 20_MHz_XTAL / 5); // divisor unknown + m_audiocpu->set_addrmap(AS_PROGRAM, &slapfght_ms_state::sound_prg_map); + + ls259_device &mainlatch(LS259(config, "mainlatch")); + mainlatch.q_out_cb<0>().set(FUNC(slapfght_ms_state::sound_reset_w)); + //mainlatch.q_out_cb<1>().set(FUNC(slapfght_ms_state::flipscreen_w)); + mainlatch.q_out_cb<3>().set(FUNC(slapfght_ms_state::irq_enable_w)); + + // video hardware + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); // all wrong + m_screen->set_refresh_hz(60); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); + m_screen->set_size(64*8, 32*8); + m_screen->set_visarea(0*8, 32*8-1, 2*8, 32*8-1); + m_screen->set_screen_update(FUNC(slapfght_ms_state::screen_update)); + m_screen->screen_vblank().set(FUNC(slapfght_ms_state::vblank_irq)); + m_screen->set_palette("palette"); + + PALETTE(config, "palette").set_format(palette_device::xRGB_444, 256); + + GFXDECODE(config, m_gfxdecode, "palette", gfx_slapfighm); + + // sound hardware + SPEAKER(config, "mono").front_center(); + + GENERIC_LATCH_8(config, "soundlatch"); + + ym2203_device &ym1(YM2203(config, "ym1", 20_MHz_XTAL / 5)); // divisor unknown + ym1.port_a_read_callback().set_ioport("IN0"); + ym1.port_b_read_callback().set_ioport("IN1"); + ym1.irq_handler().set_log("ym 1 IRQ"); + ym1.add_route(ALL_OUTPUTS, "mono", 0.15); + + ym2203_device &ym2(YM2203(config, "ym2", 20_MHz_XTAL / 5)); // divisor unknown + ym2.port_a_read_callback().set_ioport("SW1"); + ym2.port_b_read_callback().set_ioport("SW2"); + ym2.irq_handler().set_log("ym 2 IRQ"); + ym2.add_route(ALL_OUTPUTS, "mono", 0.15); +} + +ROM_START( slapfighm ) + ROM_REGION( 0x14000, "maincpu", 0 ) // on MOD. 3 board + ROM_LOAD( "3_cpu_fi_303.ic12-512", 0x0000, 0x8000, CRC(639b0817) SHA1(0999d447d1cc182c5d1fb1be91e47f1e64675a78) ) // 27256 + ROM_LOAD( "3_cpu_fi_302.ic13-512", 0x8000, 0x8000, CRC(97403de3) SHA1(b96acd3b4bbe6e6dc060255aaa1b237100c41847) ) // 27256 + ROM_LOAD( "3_cpu_fi_301.ic14-513", 0x10000, 0x4000, CRC(c63b02fe) SHA1(8d1991780b7aed718f60b6a8f5de7571682fb713) ) // 27128, identical to the original once decrypted + + ROM_REGION( 0x4000, "audiocpu", 0 ) // on MOD 1 board + ROM_LOAD( "1_snd_fi_0101.ic12", 0x0000, 0x4000, CRC(4e3ae13e) SHA1(4ab29064f3a4cb4fd70a9eb8ddbffb4f5ee74057) ) // 1xxxxxxxxxxxxx = 0xFF + + ROM_REGION( 0x4000, "chars", 0 ) // on one MOD 4/2 board, contains the same data as the original among the weirdness + ROM_LOAD( "4-2_fi_401.ic17", 0x0000, 0x4000, CRC(fbdc3ded) SHA1(5c1db5fe0ce32d996f40acf51b9ea09f7709a032) ) // BADADDR --xxxxxxxxxxxxx, 4-2_fi_401.ic17 [3/4] a77_03.6g IDENTICAL + ROM_CONTINUE( 0x0000, 0x4000 ) + ROM_LOAD( "4-2_fi_402.ic16", 0x2000, 0x2000, CRC(6e9ce9ea) SHA1(9b80360050022fb7b938a874d5c9adb344907bab) ) // BADADDR x-xxxxxxxxxxxxx, 4-2_fi_402.ic16 [3/4] a77_04.6f IDENTICAL + ROM_CONTINUE( 0x2000, 0x2000 ) + ROM_CONTINUE( 0x2000, 0x2000 ) + ROM_IGNORE( 0x2000 ) + + ROM_REGION( 0x20000, "tiles", 0 ) // on a second MOD 4/2 board, identical to the original + ROM_LOAD( "4-2-b_fi_4a01.ic17", 0x00000, 0x8000, CRC(974e2ea9) SHA1(3840550fc3a833828dad8f3e300d2ea583d69ce7) ) + ROM_LOAD( "4-2-b_fi_4a02.ic16", 0x08000, 0x8000, CRC(5faeeea3) SHA1(696fba24bcf1f3a7e914a4403854da5eededaf7f) ) + ROM_LOAD( "4-2-b_fi_4a03.ic15", 0x10000, 0x8000, CRC(e92d9d60) SHA1(2554617e0e6615ca8c85a49299a4a0e762478339) ) + ROM_LOAD( "4-2-b_fi_4a04.ic14", 0x18000, 0x8000, CRC(b6358305) SHA1(c7bb4236a75ec6b88f011bc30f8fb9a718e2ca3e) ) + + ROM_REGION( 0x20000, "sprites", ROMREGION_INVERT ) // on MOD 51/1 board, different format from the original + ROM_LOAD32_BYTE( "51-1_fi_501.ic43", 0x0003, 0x8000, CRC(fa901876) SHA1(e27a8f9014419343bf08a7536b4b37bded611ec0) ) + ROM_LOAD32_BYTE( "51-1_fi_502.ic42", 0x0002, 0x8000, CRC(9bf4f6a4) SHA1(a4b1287258d1635108b349805f15ae25224e2ab6) ) + ROM_LOAD32_BYTE( "51-1_fi_503.ic41", 0x0001, 0x8000, CRC(b03543cf) SHA1(2b8f0e8c60dbccc40e82f4af799d151efc259d52) ) + ROM_LOAD32_BYTE( "51-1_fi_504.ic40", 0x0000, 0x8000, CRC(b80afe0a) SHA1(02efc3cb0c968d24ae0da4d16515c244f59d1d93) ) + + ROM_REGION( 0x0600, "proms", 0 ) // PROMs (function unknown) + ROM_LOAD( "1_snd_p0102_82s123.ic20", 0x000, 0x020, CRC(6228a653) SHA1(a8cfceba0546875940e9124c5ca2a6c625232856) ) + ROM_LOAD( "21-1_p0201_82s129.ic5", 0x100, 0x100, CRC(2697da58) SHA1(e62516b886ff6e204b718e5f0c6ce2712e4b7fc5) ) + ROM_LOAD( "21-1_p0203_82s129.ic12", 0x200, 0x100, CRC(d56e29b4) SHA1(d94157a9cd75d1f6d305f3d48291d0ae4c41e006) ) + ROM_LOAD( "3-sub_cpu_p0312_82s147.bin", 0x300, 0x200, CRC(28d906a7) SHA1(da11a515aa798c0fb687d8617461b0372364b332) ) + ROM_LOAD( "51-1_p0502.ic10", 0x500, 0x100, CRC(15085e44) SHA1(646e7100fcb112594023cf02be036bd3d42cc13c) ) + + ROM_REGION( 0x1000, "plds", ROMREGION_ERASEFF ) + ROM_LOAD( "4-2_0400_pal16r6acn.ic29", 0x000, 0x104, NO_DUMP ) + ROM_LOAD( "4-2-b_pal16r6_p0400.ic29", 0x000, 0x104, CRC(19ac48ea) SHA1(bb79d2e1522f144609cdfe32a01defd19753668d) ) + ROM_LOAD( "51-1_p0503_pal16r6.ic46", 0x000, 0x104, CRC(07eb86d2) SHA1(482eb325df5bc60353bac85412cf45429cd03c6d) ) +ROM_END + +void slapfght_ms_state::init_decryption() // same as the one for blktiger_ms +{ + uint8_t *const src = memregion("maincpu")->base(); + auto const len = memregion("maincpu")->bytes(); + + // bitswap data + for (int i = 0; i < len; i++) + src[i] = bitswap<8>(src[i], 5, 3, 7, 2, 0, 1, 4, 6); + + // descramble address + std::vector buffer(len); + memcpy(&buffer[0], src, len); + + for (int i = 0; i < len; i++) + src[i] = buffer[bitswap<24>(i, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 10, 8, 6, 4, 0, 2, 7, 3, 1, 9, 11, 5)]; +} + +} // anonymous namespace + + +GAME( 199?, slapfighm, alcon, slapfighm, slapfighm, slapfght_ms_state, init_decryption, ROT270, "bootleg (Gaelco / Ervisa)", "Slap Fight (Modular System)", MACHINE_IS_SKELETON ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/sleic.cpp mame-0.243+dfsg.1/src/mame/drivers/sleic.cpp --- mame-0.242+dfsg.1/src/mame/drivers/sleic.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/sleic.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -243,7 +243,7 @@ m_io_outputs.resolve(); - //save_item(NAME(m_p1)); + save_item(NAME(m_row)); } void sleic_state::machine_reset() @@ -372,7 +372,7 @@ } // Anonymous namespace -GAME(1992, bikerace, 0, sleic, sleic, sleic_state, empty_init, ROT0, "Sleic", "Bike Race", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1992, bikerace2, bikerace, sleic, sleic, sleic_state, empty_init, ROT0, "Sleic", "Bike Race (2-ball play)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1993, sleicpin, 0, sleic, sleic, sleic_state, empty_init, ROT0, "Sleic", "Sleic Pin Ball", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1994, iomoon, 0, sleic, sleic, sleic_state, empty_init, ROT0, "Sleic", "Io Moon", MACHINE_IS_SKELETON_MECHANICAL ) +GAME(1992, bikerace, 0, sleic, sleic, sleic_state, empty_init, ROT0, "Sleic", "Bike Race", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1992, bikerace2, bikerace, sleic, sleic, sleic_state, empty_init, ROT0, "Sleic", "Bike Race (2-ball play)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1993, sleicpin, 0, sleic, sleic, sleic_state, empty_init, ROT0, "Sleic", "Sleic Pin Ball", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, iomoon, 0, sleic, sleic, sleic_state, empty_init, ROT0, "Sleic", "Io Moon", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/smc777.cpp mame-0.243+dfsg.1/src/mame/drivers/smc777.cpp --- mame-0.242+dfsg.1/src/mame/drivers/smc777.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/smc777.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -143,7 +143,7 @@ uint8_t m_fdc_drq_flag = 0; uint8_t m_system_data = 0; struct { uint8_t r = 0, g = 0, b = 0; } m_pal; - uint8_t m_raminh,m_raminh_pending_change = 0; //bankswitch + uint8_t m_raminh = 0, m_raminh_pending_change = 0; //bankswitch uint8_t m_raminh_prefetch = 0; uint8_t m_pal_mode = 0; uint8_t m_keyb_cmd = 0; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/snk.cpp mame-0.243+dfsg.1/src/mame/drivers/snk.cpp --- mame-0.242+dfsg.1/src/mame/drivers/snk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/snk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -3825,17 +3825,6 @@ /*********************************************************************/ -static const gfx_layout charlayout_4bpp = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { STEP4(0,1) }, - { 4*1, 4*0, 4*3, 4*2, 4*5, 4*4, 4*7, 4*6 }, - { STEP8(0,4*8) }, - 32*8 -}; - static const gfx_layout tilelayout_4bpp = { 16,16, @@ -3895,22 +3884,22 @@ /*********************************************************************/ static GFXDECODE_START( gfx_marvins ) - GFXDECODE_ENTRY( "tx_tiles", 0, charlayout_4bpp, 0x180, 0x080>>4 ) - GFXDECODE_ENTRY( "fg_tiles", 0, charlayout_4bpp, 0x080, 0x080>>4 ) - GFXDECODE_ENTRY( "bg_tiles", 0, charlayout_4bpp, 0x100, 0x080>>4 ) - GFXDECODE_ENTRY( "sp16_tiles", 0, spritelayout_3bpp, 0x000, 0x080>>3 ) + GFXDECODE_ENTRY( "tx_tiles", 0, gfx_8x8x4_packed_lsb, 0x180, 0x080>>4 ) + GFXDECODE_ENTRY( "fg_tiles", 0, gfx_8x8x4_packed_lsb, 0x080, 0x080>>4 ) + GFXDECODE_ENTRY( "bg_tiles", 0, gfx_8x8x4_packed_lsb, 0x100, 0x080>>4 ) + GFXDECODE_ENTRY( "sp16_tiles", 0, spritelayout_3bpp, 0x000, 0x080>>3 ) /* colors 0x200-0x3ff contain shadows */ GFXDECODE_END static GFXDECODE_START( gfx_tnk3 ) - GFXDECODE_ENTRY( "tx_tiles", 0, charlayout_4bpp, 0x180, 0x080>>4 ) - GFXDECODE_ENTRY( "bg_tiles", 0, charlayout_4bpp, 0x080, 0x100>>4 ) - GFXDECODE_ENTRY( "sp16_tiles", 0, spritelayout_3bpp, 0x000, 0x080>>3 ) + GFXDECODE_ENTRY( "tx_tiles", 0, gfx_8x8x4_packed_lsb, 0x180, 0x080>>4 ) + GFXDECODE_ENTRY( "bg_tiles", 0, gfx_8x8x4_packed_lsb, 0x080, 0x100>>4 ) + GFXDECODE_ENTRY( "sp16_tiles", 0, spritelayout_3bpp, 0x000, 0x080>>3 ) /* colors 0x200-0x3ff contain shadows */ GFXDECODE_END static GFXDECODE_START( gfx_ikari ) - GFXDECODE_ENTRY( "tx_tiles", 0, charlayout_4bpp, 0x180, 0x080>>4 ) + GFXDECODE_ENTRY( "tx_tiles", 0, gfx_8x8x4_packed_lsb, 0x180, 0x080>>4 ) GFXDECODE_ENTRY( "bg_tiles", 0, tilelayout_4bpp, 0x100, 0x080>>4 ) GFXDECODE_ENTRY( "sp16_tiles", 0, spritelayout_3bpp, 0x000, 0x080>>3 ) GFXDECODE_ENTRY( "sp32_tiles", 0, bigspritelayout_3bpp, 0x080, 0x080>>3 ) @@ -3918,14 +3907,14 @@ GFXDECODE_END static GFXDECODE_START( gfx_gwar ) - GFXDECODE_ENTRY( "tx_tiles", 0, charlayout_4bpp, 0x000, 0x100>>4 ) + GFXDECODE_ENTRY( "tx_tiles", 0, gfx_8x8x4_packed_lsb, 0x000, 0x100>>4 ) GFXDECODE_ENTRY( "bg_tiles", 0, tilelayout_4bpp, 0x300, 0x100>>4 ) GFXDECODE_ENTRY( "sp16_tiles", 0, spritelayout_4bpp, 0x100, 0x100>>4 ) GFXDECODE_ENTRY( "sp32_tiles", 0, bigspritelayout_4bpp, 0x200, 0x100>>4 ) GFXDECODE_END static GFXDECODE_START( gfx_tdfever ) - GFXDECODE_ENTRY( "tx_tiles", 0, charlayout_4bpp, 0x000, 0x100>>4 ) + GFXDECODE_ENTRY( "tx_tiles", 0, gfx_8x8x4_packed_lsb, 0x000, 0x100>>4 ) GFXDECODE_ENTRY( "bg_tiles", 0, tilelayout_4bpp, 0x200, 0x100>>4 ) GFXDECODE_ENTRY( "sp32_tiles", 0, bigspritelayout_4bpp, 0x100, 0x100>>4 ) /* colors 0x300-0x3ff contain shadows */ diff -Nru mame-0.242+dfsg.1/src/mame/drivers/sonson.cpp mame-0.243+dfsg.1/src/mame/drivers/sonson.cpp --- mame-0.242+dfsg.1/src/mame/drivers/sonson.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/sonson.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -192,18 +192,6 @@ INPUT_PORTS_END - -static const gfx_layout charlayout = -{ - 8,8, - RGN_FRAC(1,2), - 2, - { RGN_FRAC(1,2), RGN_FRAC(0,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 const gfx_layout spritelayout = { 16,16, @@ -218,8 +206,8 @@ }; static GFXDECODE_START( gfx_sonson ) - GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 64 ) - GFXDECODE_ENTRY( "gfx2", 0, spritelayout, 64*4, 32 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x2_planar, 0, 64 ) + GFXDECODE_ENTRY( "gfx2", 0, spritelayout, 64*4, 32 ) GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/spbactn.cpp mame-0.243+dfsg.1/src/mame/drivers/spbactn.cpp --- mame-0.242+dfsg.1/src/mame/drivers/spbactn.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/spbactn.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -381,24 +381,12 @@ -static const gfx_layout proto_spr_layout = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { 0, 1, 2, 3 }, - { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4 }, - { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 }, - 32*8 -}; - - static GFXDECODE_START( gfx_spbactnp ) GFXDECODE_ENTRY( "gfx1", 0, proto_fgtilelayout, 0x0200, 16 + 240 ) GFXDECODE_ENTRY( "gfx2", 0, proto_fgtilelayout, 0x0300, 16 + 128 ) // wrong - GFXDECODE_ENTRY( "gfx3", 0, proto_spr_layout, 0x0000, 16 + 384 ) + GFXDECODE_ENTRY( "gfx3", 0, gfx_8x8x4_packed_msb, 0x0000, 16 + 384 ) - GFXDECODE_ENTRY( "gfx4", 0, proto_spr_layout, 0x0000, 16 + 384 ) // more sprites maybe? + GFXDECODE_ENTRY( "gfx4", 0, gfx_8x8x4_packed_msb, 0x0000, 16 + 384 ) // more sprites maybe? GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/spc1000.cpp mame-0.243+dfsg.1/src/mame/drivers/spc1000.cpp --- mame-0.242+dfsg.1/src/mame/drivers/spc1000.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/spc1000.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -183,7 +183,7 @@ uint16_t m_page = 0U; std::unique_ptr m_work_ram; attotime m_time; - bool m_centronics_busy = 0; + bool m_centronics_busy = false; virtual void machine_start() override; virtual void machine_reset() override; required_device m_maincpu; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/spc1500.cpp mame-0.243+dfsg.1/src/mame/drivers/spc1500.cpp --- mame-0.242+dfsg.1/src/mame/drivers/spc1500.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/spc1500.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -262,7 +262,6 @@ , m_pio(*this, "ppi8255") , m_sound(*this, "ay8910") , m_palette(*this, "palette") - , m_timer(nullptr) { } void spc1500(machine_config &config); @@ -300,21 +299,21 @@ void spc1500_double_io(address_map &map); void spc1500_mem(address_map &map); - uint8_t *m_p_ram; - uint8_t m_ipl; - uint8_t m_palet[3]; - uint8_t m_paltbl[8]; - uint8_t m_pcg_char, m_pcg_attr, m_char_change; - uint16_t m_pcg_offset[3]; - int m_char_count; + uint8_t *m_p_ram = nullptr; + uint8_t m_ipl = 0; + uint8_t m_palet[3]{}; + uint8_t m_paltbl[8]{}; + uint8_t m_pcg_char = 0, m_pcg_attr = 0, m_char_change = 0; + uint16_t m_pcg_offset[3]{}; + int m_char_count = 0; attotime m_time; - bool m_romsel; - bool m_double_mode; - bool m_p5bit; - bool m_motor; - bool m_motor_toggle; - uint8_t m_crtc_vreg[0x100]; - bool m_centronics_busy; + bool m_romsel = false; + bool m_double_mode = false; + bool m_p5bit = false; + bool m_motor = false; + bool m_motor_toggle = false; + uint8_t m_crtc_vreg[0x100]{}; + bool m_centronics_busy = false; required_device m_maincpu; required_device m_vdg; required_device m_cass; @@ -328,9 +327,9 @@ required_device m_pio; required_device m_sound; required_device m_palette; - uint8_t *m_font; - uint8_t m_priority; - emu_timer *m_timer; + uint8_t *m_font = nullptr; + uint8_t m_priority = 0; + emu_timer *m_timer = nullptr; void get_pcg_addr(); }; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/spdamjes.cpp mame-0.243+dfsg.1/src/mame/drivers/spdamjes.cpp --- mame-0.242+dfsg.1/src/mame/drivers/spdamjes.cpp 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/spdamjes.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,154 @@ +// license:BSD-3-Clause +// copyright-holders: +/**************************************************************************************************************** + + Skeleton driver for "Sport Damjes 1" darts machine + + PCB labeled as "DARDO" ("Dart" in Spanish) on both sides + _______________________________________________________________________________________________________________ + | ................. ... ..... ........ ........ | + | __________ ___________ ___________ ___________ ___________ ___________ | + | |TC74HC367P |TC74HC367P |TC74HC367P |_ULN2803A_| |_ULN2803A_| |_ULN2803A_| ·| + | ________________________ ___________ ___________ ___________ ___________ ___________ ·| + | | Microchip AY-3-8910A | |__DIPSx8__| |__DIPSx8__| |T74LS259B1| |T74LS259B1| |_ULN2803A_| ·| + | |_______________________| ___________ ___________ ·| + | |T74LS259B1| |T74LS259B1| ·| + | ___________ ___________ ·| + | |T74LS259B1| |T74LS259B1| | + | ___________________ __________ | + | | UM6264-10L | |BATT 3.6V| ___________ | + | |__________________| | | |_ULN2803A_| ·| + | ___________________ |_________| ___________ ·| + | | EPROM | ___________ |T74LS259B1| ·| + | |__________________| |PAL16L8A-2CN ___________ ·| + | ________________________ |T74LS259B1| ·| + | | Zilog Z0840004PSC | | + | |_______________________| | + | | + | .. ___________ ___________ | + | .. |T74LS259B1| |T74LS259B1| ·| + | .. ·| + | .. Xtal ___________ ·| + | .. 8.000 |__CM3080__| DARDO ·| + | .. ___________ ·| + | .. |_ULN2803A_| | + | ........ :::::::::: ............. ........... | + |______________________________________________________________________________________________________________| + _______________________________________________________________________________________________________________ + | ______ ______ ______ | + | | __ || __ || __ | | + | | |_| || |_| || |_| | | + | | |_|.|| |_|.|| |_|.| | + | |_____||_____||_____| | + | | + | _ _ | + | _ (_) (_) _ | + | (_) ______ ______ ______ ______ ______ ______ (_) | + | | __ || __ || __ | | __ || __ || __ | | + | | |_| || |_| || |_| | | |_| || |_| || |_| | | + | | |_|.|| |_|.|| |_|.| | |_|.|| |_|.|| |_|.| | + | |_____||_____||_____| |_____||_____||_____| | + | ______ ______ ______ ______ ______ ______ | + | | __ || __ || __ | | __ || __ || __ | | + | | |_| || |_| || |_| | | |_| || |_| || |_| | | + | | |_|.|| |_|.|| |_|.| | |_|.|| |_|.|| |_|.| | + | |_____||_____||_____| |_____||_____||_____| | + | _ _ | + | (_) _ _ (_) | + | (_) (_) | + | | + | ______ ______ ______ ______ ______ | + | | __ || __ | | __ | | __ || __ | | + | | |_| || |_| | | |_| | | |_| || |_| | | + | | |_|.|| |_|.| DARDO | |_|.| | |_|.|| |_|.| | + | |_____||_____| |_____| |_____||_____| | + |______________________________________________________________________________________________________________| + +****************************************************************************************************************/ + +#include "emu.h" +#include "cpu/z80/z80.h" +#include "machine/nvram.h" +#include "sound/ay8910.h" +#include "speaker.h" + +namespace { + +class spdamjes_state : public driver_device +{ + +public: + spdamjes_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + { + } + + void spdamjes(machine_config &config); + +private: + void mem_map(address_map &map); + + required_device m_maincpu; +}; + +void spdamjes_state::mem_map(address_map &map) +{ + map(0x0000, 0x7fff).rom().region("maincpu", 0); + map(0x8000, 0x9fff).ram().share("nvram"); + map(0xa000, 0xa000).w("ay8910", FUNC(ay8910_device::address_w)); + map(0xa001, 0xa001).r("ay8910", FUNC(ay8910_device::data_r)); + map(0xa002, 0xa002).w("ay8910", FUNC(ay8910_device::data_w)); + map(0xc000, 0xc007).nopw(); // output latches + map(0xd000, 0xd007).nopw(); // more output latches +} + + +INPUT_PORTS_START(spdamjes) + PORT_START("DSW1") + PORT_DIPUNKNOWN_DIPLOC(0x01, 0x01, "SW1:1") + PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "SW1:2") + PORT_DIPUNKNOWN_DIPLOC(0x04, 0x04, "SW1:3") + PORT_DIPUNKNOWN_DIPLOC(0x08, 0x08, "SW1:4") + PORT_DIPUNKNOWN_DIPLOC(0x10, 0x10, "SW1:5") + PORT_DIPUNKNOWN_DIPLOC(0x20, 0x20, "SW1:6") + PORT_DIPUNKNOWN_DIPLOC(0x40, 0x40, "SW1:7") + PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "SW1:8") + + PORT_START("DSW2") + PORT_DIPUNKNOWN_DIPLOC(0x01, 0x01, "SW2:1") + PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "SW2:2") + PORT_DIPUNKNOWN_DIPLOC(0x04, 0x04, "SW2:3") + PORT_DIPUNKNOWN_DIPLOC(0x08, 0x08, "SW2:4") + PORT_DIPUNKNOWN_DIPLOC(0x10, 0x10, "SW2:5") + PORT_DIPUNKNOWN_DIPLOC(0x20, 0x20, "SW2:6") + PORT_DIPUNKNOWN_DIPLOC(0x40, 0x40, "SW2:7") + PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "SW2:8") +INPUT_PORTS_END + +void spdamjes_state::spdamjes(machine_config &config) +{ + Z80(config, m_maincpu, 8_MHz_XTAL); + m_maincpu->set_addrmap(AS_PROGRAM, &spdamjes_state::mem_map); + + NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); + + SPEAKER(config, "mono").front_center(); + + ay8910_device &ay8910(AY8910(config, "ay8910", 8_MHz_XTAL / 4)); // Divisor unknown + ay8910.port_a_read_callback().set_ioport("DSW1"); + ay8910.port_b_read_callback().set_ioport("DSW2"); + ay8910.add_route(ALL_OUTPUTS, "mono", 1.0); // Guess +} + +ROM_START(spdamjes) + ROM_REGION(0x8000, "maincpu", 0) + ROM_LOAD("sport_damjes.ic2", 0x0000, 0x8000, CRC(31ac5806) SHA1(cf4cb3636538687c1b72f902e77a5277996d06b2)) + + ROM_REGION(0x104, "plds", 0) + ROM_LOAD("pal16l8a.ic4", 0x000, 0x104, NO_DUMP) // Protected +ROM_END + +} // Anonymous namespace + +GAME(19??, spdamjes, 0, spdamjes, spdamjes, spdamjes_state, empty_init, ROT0, "T-90", "Sport Damjes 1", MACHINE_IS_SKELETON_MECHANICAL) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/spdodgeb.cpp mame-0.243+dfsg.1/src/mame/drivers/spdodgeb.cpp --- mame-0.242+dfsg.1/src/mame/drivers/spdodgeb.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/spdodgeb.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -10,7 +10,7 @@ - sprite lag (the real game has quite a bit of lag too) Notes: -- there's probably a 63701 on the board, used for protection. It is checked +- there's a 63701 on the board, used for protection. It is checked on startup and then just used to read the input ports. It doesn't return the ports verbatim, it adds further processing, setting flags when the player double-taps in one direction to run.(updated to edge-triggering) @@ -23,25 +23,321 @@ ***************************************************************************/ #include "emu.h" -#include "includes/spdodgeb.h" #include "cpu/m6502/m6502.h" #include "cpu/m6800/m6801.h" #include "cpu/m6809/m6809.h" +#include "machine/gen_latch.h" +#include "machine/timer.h" +#include "sound/msm5205.h" #include "sound/ymopl.h" + +#include "emupal.h" +#include "screen.h" #include "speaker.h" +#include "tilemap.h" + + +namespace { + +class spdodgeb_state : public driver_device +{ +public: + spdodgeb_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_mcu(*this, "mcu"), + m_msm(*this, "msm%u", 1U), + m_gfxdecode(*this, "gfxdecode"), + m_screen(*this, "screen"), + m_palette(*this, "palette"), + m_soundlatch(*this, "soundlatch"), + m_videoram(*this, "videoram"), + m_spriteram(*this, "spriteram"), + m_mainbank(*this, "mainbank"), + m_adpcm_rom(*this, "adpcm") + { } + + void spdodgeb(machine_config &config); + + DECLARE_READ_LINE_MEMBER(mcu_busy_r); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; + +private: + required_device m_maincpu; + required_device m_audiocpu; + required_device m_mcu; + required_device_array m_msm; + required_device m_gfxdecode; + required_device m_screen; + required_device m_palette; + required_device m_soundlatch; + + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; + required_memory_bank m_mainbank; + required_region_ptr m_adpcm_rom; + + uint32_t m_adpcm_pos[2]{}; + uint16_t m_adpcm_end[2]{}; + uint8_t m_adpcm_idle[2]{}; + int16_t m_adpcm_data[2]{}; + uint8_t m_mcu_status = 0; + uint8_t m_inputs[5]{}; + + uint8_t m_tile_palbank = 0; + uint8_t m_sprite_palbank = 0; + tilemap_t *m_bg_tilemap = nullptr; + uint16_t m_lastscroll = 0; + + template DECLARE_WRITE_LINE_MEMBER(adpcm_int); + void adpcm_w(offs_t offset, uint8_t data); + uint8_t mcu63701_r(offs_t offset); + void mcu_data_w(offs_t offset, uint8_t data); + void mcu_status_w(uint8_t data); + void mcu_nmi_w(uint8_t data); + + void scrollx_lo_w(uint8_t data); + void ctrl_w(uint8_t data); + void videoram_w(offs_t offset, uint8_t data); + + TILEMAP_MAPPER_MEMBER(background_scan); + TILE_GET_INFO_MEMBER(get_bg_tile_info); + + void palette(palette_device &palette) const; + + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); + + TIMER_DEVICE_CALLBACK_MEMBER(interrupt); + + void main_map(address_map &map); + void sound_map(address_map &map); + void mcu_map(address_map &map); +}; + + +// video + + +void spdodgeb_state::palette(palette_device &palette) const +{ + const uint8_t *color_prom = memregion("proms")->base(); + + for (int i = 0;i < palette.entries();i++) + { + // red component + int bit0 = BIT(color_prom[0], 0); + int bit1 = BIT(color_prom[0], 1); + int bit2 = BIT(color_prom[0], 2); + int bit3 = BIT(color_prom[0], 3); + int const r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; + + // green component + bit0 = BIT(color_prom[0], 4); + bit1 = BIT(color_prom[0], 5); + bit2 = BIT(color_prom[0], 6); + bit3 = BIT(color_prom[0], 7); + int const g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; + + // blue component + bit0 = BIT(color_prom[palette.entries()], 0); + bit1 = BIT(color_prom[palette.entries()], 1); + bit2 = BIT(color_prom[palette.entries()], 2); + bit3 = BIT(color_prom[palette.entries()], 3); + int const b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; + + palette.set_pen_color(i, rgb_t(r, g, b)); + color_prom++; + } +} + + +/*************************************************************************** + + Callbacks for the TileMap code + +***************************************************************************/ + +TILEMAP_MAPPER_MEMBER(spdodgeb_state::background_scan) +{ + // logical (col,row) -> memory offset + return (col & 0x1f) + ((row & 0x1f) << 5) + ((col & 0x20) << 5); +} + +TILE_GET_INFO_MEMBER(spdodgeb_state::get_bg_tile_info) +{ + uint8_t code = m_videoram[tile_index]; + uint8_t attr = m_videoram[tile_index + 0x800]; + tileinfo.set(0, + code + ((attr & 0x1f) << 8), + ((attr & 0xe0) >> 5) + 8 * m_tile_palbank, + 0); +} + + +/*************************************************************************** + + Start the video hardware emulation. + +***************************************************************************/ + +void spdodgeb_state::video_start() +{ + m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(spdodgeb_state::get_bg_tile_info)), tilemap_mapper_delegate(*this, FUNC(spdodgeb_state::background_scan)), 8,8, 64,32); + + m_mainbank->configure_entries(0, 2, memregion("maincpu")->base(), 0x4000); + + save_item(NAME(m_tile_palbank)); + save_item(NAME(m_sprite_palbank)); + save_item(NAME(m_lastscroll)); +} + + +/*************************************************************************** + + Memory handlers + +***************************************************************************/ + + +TIMER_DEVICE_CALLBACK_MEMBER(spdodgeb_state::interrupt) +{ + int scanline = param; + + if (scanline == 256) + { + m_maincpu->pulse_input_line(INPUT_LINE_NMI, attotime::zero); + m_screen->update_partial(256); + } + else if ((scanline % 8) == 0) + { + m_maincpu->set_input_line(M6502_IRQ_LINE, HOLD_LINE); + m_screen->update_partial(scanline + 16); // TODO: pretty off ... + } +} + +void spdodgeb_state::scrollx_lo_w(uint8_t data) +{ + m_lastscroll = (m_lastscroll & 0x100) | data; +} + +void spdodgeb_state::ctrl_w(uint8_t data) +{ + // bit 0 = flip screen + flip_screen_set(data & 0x01); + + // bit 1 = ROM bank switch + m_mainbank->set_entry((~data & 0x02) >> 1); + + // bit 2 = scroll high bit + m_lastscroll = (m_lastscroll & 0x0ff) | ((data & 0x04) << 6); + + // bit 3 = to mcu?? + // bits 4-7 = palette bank select + if (m_tile_palbank != ((data & 0x30) >> 4)) + { + m_tile_palbank = ((data & 0x30) >> 4); + m_bg_tilemap->mark_all_dirty(); + } + m_sprite_palbank = (data & 0xc0) >> 6; +} -void spdodgeb_state::spd_adpcm_w(offs_t offset, uint8_t data) +void spdodgeb_state::videoram_w(offs_t offset, uint8_t data) +{ + m_videoram[offset] = data; + m_bg_tilemap->mark_tile_dirty(offset & 0x7ff); +} + + + +/*************************************************************************** + + Display refresh + +***************************************************************************/ + +#define DRAW_SPRITE( order, sx, sy ) gfx->transpen(bitmap,\ + cliprect, \ + (which + order), color + 8 * m_sprite_palbank, flipx, flipy, sx, sy, 0); + +void spdodgeb_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + gfx_element *gfx = m_gfxdecode->gfx(1); + +/* 240-SY Z|F|CLR|WCH WHICH SX + xxxxxxxx x|x|xxx|xxx xxxxxxxx xxxxxxxx +*/ + for (int i = 0; i < m_spriteram.bytes(); i += 4) + { + int attr = m_spriteram[i + 1]; + int which = m_spriteram[i + 2] + ((attr & 0x07) << 8); + int sx = m_spriteram[i + 3]; + int sy = 240 - m_spriteram[i]; + int size = (attr & 0x80) >> 7; + int color = (attr & 0x38) >> 3; + int flipx = ~attr & 0x40; + int flipy = 0; + int dy = -16; + int cy; + + if (flip_screen()) + { + sx = 240 - sx; + sy = 240 - sy; + flipx = !flipx; + flipy = !flipy; + dy = -dy; + } + + if (sx < -8) sx += 256; else if (sx > 248) sx -= 256; + + switch (size) + { + case 0: // normal + if (sy < -8) sy += 256; else if (sy > 248) sy -= 256; + DRAW_SPRITE(0, sx, sy); + break; + + case 1: // double y + if (flip_screen()) { if (sy > 240) sy -= 256; } else { if (sy < 0) sy += 256; } + cy = sy + dy; + which &= ~1; + DRAW_SPRITE(0, sx, cy); + DRAW_SPRITE(1, sx, sy); + break; + } + } +} + +#undef DRAW_SPRITE + + +uint32_t spdodgeb_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + m_bg_tilemap->set_scrollx(0, m_lastscroll + 5); + m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); + draw_sprites(bitmap, cliprect); + return 0; +} + +// machine + +void spdodgeb_state::adpcm_w(offs_t offset, uint8_t data) { int chip = offset & 1; - msm5205_device *adpcm = chip ? m_msm2 : m_msm1; switch (offset/2) { case 3: m_adpcm_idle[chip] = 1; - adpcm->reset_w(1); + m_msm[chip]->reset_w(1); break; case 2: @@ -54,42 +350,33 @@ case 0: m_adpcm_idle[chip] = 0; - adpcm->reset_w(0); + m_msm[chip]->reset_w(0); break; } } -void spdodgeb_state::spd_adpcm_int( msm5205_device *device, int chip ) +template +WRITE_LINE_MEMBER(spdodgeb_state::adpcm_int) { - if (m_adpcm_pos[chip] >= m_adpcm_end[chip] || m_adpcm_pos[chip] >= 0x10000) + if (m_adpcm_pos[Which] >= m_adpcm_end[Which] || m_adpcm_pos[Which] >= 0x10000) { - m_adpcm_idle[chip] = 1; - device->reset_w(1); + m_adpcm_idle[Which] = 1; + m_msm[Which]->reset_w(1); } - else if (m_adpcm_data[chip] != -1) + else if (m_adpcm_data[Which] != -1) { - device->data_w(m_adpcm_data[chip] & 0x0f); - m_adpcm_data[chip] = -1; + m_msm[Which]->data_w(m_adpcm_data[Which] & 0x0f); + m_adpcm_data[Which] = -1; } else { - uint8_t *ROM = memregion("adpcm")->base() + 0x10000 * chip; + uint8_t *rom = &m_adpcm_rom[0x10000 * Which]; - m_adpcm_data[chip] = ROM[m_adpcm_pos[chip]++]; - device->data_w(m_adpcm_data[chip] >> 4); + m_adpcm_data[Which] = rom[m_adpcm_pos[Which]++]; + m_msm[Which]->data_w(m_adpcm_data[Which] >> 4); } } -WRITE_LINE_MEMBER(spdodgeb_state::spd_adpcm_int_1) -{ - spd_adpcm_int(m_msm1, 0); -} - -WRITE_LINE_MEMBER(spdodgeb_state::spd_adpcm_int_2) -{ - spd_adpcm_int(m_msm2, 1); -} - uint8_t spdodgeb_state::mcu63701_r(offs_t offset) { // logerror("CPU #0 PC %04x: read from port %02x of 63701 data address 3801\n",m_maincpu->pc(),offset); @@ -114,30 +401,30 @@ -void spdodgeb_state::spdodgeb_map(address_map &map) +void spdodgeb_state::main_map(address_map &map) { map(0x0000, 0x0fff).ram(); - map(0x1000, 0x10ff).writeonly().share("spriteram"); - map(0x2000, 0x2fff).ram().w(FUNC(spdodgeb_state::videoram_w)).share("videoram"); + map(0x1000, 0x10ff).writeonly().share(m_spriteram); + map(0x2000, 0x2fff).ram().w(FUNC(spdodgeb_state::videoram_w)).share(m_videoram); map(0x3000, 0x3000).portr("IN0"); //.nopw(); map(0x3001, 0x3001).portr("DSW"); //.nopw(); map(0x3002, 0x3002).w(m_soundlatch, FUNC(generic_latch_8_device::write)); // map(0x3003, 0x3003).nopw(); map(0x3004, 0x3004).w(FUNC(spdodgeb_state::scrollx_lo_w)); map(0x3005, 0x3005).w(FUNC(spdodgeb_state::mcu_nmi_w)); - map(0x3006, 0x3006).w(FUNC(spdodgeb_state::ctrl_w)); /* scroll hi, flip screen, bank switch, palette select */ + map(0x3006, 0x3006).w(FUNC(spdodgeb_state::ctrl_w)); // scroll hi, flip screen, bank switch, palette select map(0x3800, 0x3800).w("mculatch", FUNC(generic_latch_8_device::write)); map(0x3801, 0x3805).r(FUNC(spdodgeb_state::mcu63701_r)); - map(0x4000, 0x7fff).bankr("mainbank"); + map(0x4000, 0x7fff).bankr(m_mainbank); map(0x8000, 0xffff).rom(); } -void spdodgeb_state::spdodgeb_sound_map(address_map &map) +void spdodgeb_state::sound_map(address_map &map) { map(0x0000, 0x0fff).ram(); map(0x1000, 0x1000).r(m_soundlatch, FUNC(generic_latch_8_device::read)); map(0x2800, 0x2801).w("ymsnd", FUNC(ym3812_device::write)); - map(0x3800, 0x3807).w(FUNC(spdodgeb_state::spd_adpcm_w)); + map(0x3800, 0x3807).w(FUNC(spdodgeb_state::adpcm_w)); map(0x8000, 0xffff).rom().region("audiocpu", 0); } @@ -256,8 +543,8 @@ }; static GFXDECODE_START( gfx_spdodgeb ) - GFXDECODE_ENTRY( "text", 0, charlayout, 0x000, 32 ) /* colors 0x000-0x1ff */ - GFXDECODE_ENTRY( "sprites", 0, spritelayout, 0x200, 32 ) /* colors 0x200-0x3ff */ + GFXDECODE_ENTRY( "text", 0, charlayout, 0x000, 32 ) // colors 0x000-0x1ff + GFXDECODE_ENTRY( "sprites", 0, spritelayout, 0x200, 32 ) // colors 0x200-0x3ff GFXDECODE_END @@ -283,13 +570,13 @@ void spdodgeb_state::spdodgeb(machine_config &config) { - /* basic machine hardware */ - M6502(config, m_maincpu, XTAL(12'000'000)/6); /* 2MHz ? */ - m_maincpu->set_addrmap(AS_PROGRAM, &spdodgeb_state::spdodgeb_map); - TIMER(config, "scantimer").configure_scanline(FUNC(spdodgeb_state::interrupt), "screen", 0, 1); /* 1 IRQ every 8 visible scanlines, plus NMI for vblank */ + // basic machine hardware + M6502(config, m_maincpu, XTAL(12'000'000) / 6); // 2MHz ? + m_maincpu->set_addrmap(AS_PROGRAM, &spdodgeb_state::main_map); + TIMER(config, "scantimer").configure_scanline(FUNC(spdodgeb_state::interrupt), "screen", 0, 1); // 1 IRQ every 8 visible scanlines, plus NMI for vblank - MC6809(config, m_audiocpu, XTAL(12'000'000)/2); // HD68A09P (1.5MHz internally) - m_audiocpu->set_addrmap(AS_PROGRAM, &spdodgeb_state::spdodgeb_sound_map); + MC6809(config, m_audiocpu, XTAL(12'000'000) / 2); // HD68A09P (1.5MHz internally) + m_audiocpu->set_addrmap(AS_PROGRAM, &spdodgeb_state::sound_map); hd63701y0_cpu_device &mcu(HD63701Y0(config, m_mcu, 4'000'000)); // unknown clock mcu.set_addrmap(AS_PROGRAM, &spdodgeb_state::mcu_map); @@ -300,53 +587,53 @@ GENERIC_LATCH_8(config, "mculatch"); - /* video hardware */ + // video hardware SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_raw(XTAL(12'000'000)/2, 384, 0, 256, 272, 0, 240); + m_screen->set_raw(XTAL(12'000'000) / 2, 384, 0, 256, 272, 0, 240); m_screen->set_screen_update(FUNC(spdodgeb_state::screen_update)); m_screen->set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_spdodgeb); - PALETTE(config, m_palette, FUNC(spdodgeb_state::spdodgeb_palette), 1024); + PALETTE(config, m_palette, FUNC(spdodgeb_state::palette), 1024); - /* sound hardware */ + // sound hardware SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); GENERIC_LATCH_8(config, m_soundlatch); m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, M6809_IRQ_LINE); - ym3812_device &ymsnd(YM3812(config, "ymsnd", XTAL(12'000'000)/4)); + ym3812_device &ymsnd(YM3812(config, "ymsnd", XTAL(12'000'000) / 4)); ymsnd.irq_handler().set_inputline(m_audiocpu, M6809_FIRQ_LINE); ymsnd.add_route(ALL_OUTPUTS, "lspeaker", 1.0); ymsnd.add_route(ALL_OUTPUTS, "rspeaker", 1.0); - MSM5205(config, m_msm1, 384000); - m_msm1->vck_legacy_callback().set(FUNC(spdodgeb_state::spd_adpcm_int_1)); /* interrupt function */ - m_msm1->set_prescaler_selector(msm5205_device::S48_4B); /* 8kHz? */ - m_msm1->add_route(ALL_OUTPUTS, "lspeaker", 0.50); - m_msm1->add_route(ALL_OUTPUTS, "rspeaker", 0.50); - - MSM5205(config, m_msm2, 384000); - m_msm2->vck_legacy_callback().set(FUNC(spdodgeb_state::spd_adpcm_int_2)); /* interrupt function */ - m_msm2->set_prescaler_selector(msm5205_device::S48_4B); /* 8kHz? */ - m_msm2->add_route(ALL_OUTPUTS, "lspeaker", 0.50); - m_msm2->add_route(ALL_OUTPUTS, "rspeaker", 0.50); + MSM5205(config, m_msm[0], 384000); + m_msm[0]->vck_legacy_callback().set(FUNC(spdodgeb_state::adpcm_int<0>)); // interrupt function + m_msm[0]->set_prescaler_selector(msm5205_device::S48_4B); // 8kHz? + m_msm[0]->add_route(ALL_OUTPUTS, "lspeaker", 0.50); + m_msm[0]->add_route(ALL_OUTPUTS, "rspeaker", 0.50); + + MSM5205(config, m_msm[1], 384000); + m_msm[1]->vck_legacy_callback().set(FUNC(spdodgeb_state::adpcm_int<1>)); // interrupt function + m_msm[1]->set_prescaler_selector(msm5205_device::S48_4B); // 8kHz? + m_msm[1]->add_route(ALL_OUTPUTS, "lspeaker", 0.50); + m_msm[1]->add_route(ALL_OUTPUTS, "rspeaker", 0.50); } ROM_START( spdodgeb ) ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "22a-04.139", 0x00000, 0x10000, CRC(66071fda) SHA1(4a239295900e6234a2a693321ca821671747a58e) ) /* First 0x8000: Two banks, second 0x8000: Static */ + ROM_LOAD( "22a-04.139", 0x00000, 0x10000, CRC(66071fda) SHA1(4a239295900e6234a2a693321ca821671747a58e) ) // First 0x8000: Two banks, second 0x8000: Static - ROM_REGION( 0x08000, "audiocpu", 0 ) /* audio cpu */ + ROM_REGION( 0x08000, "audiocpu", 0 ) ROM_LOAD( "22j5-0.33", 0x00000, 0x08000, CRC(c31e264e) SHA1(0828a2094122e3934b784ec9ad7c2b89d91a83bb) ) - ROM_REGION( 0x04000, "mcu", 0 ) /* I/O mcu */ + ROM_REGION( 0x04000, "mcu", 0 ) // I/O ROM_LOAD( "22ja-0.162", 0x00000, 0x04000, CRC(7162a97b) SHA1(d6d4ee025e73a340428345f08711cd32f9169a8c) ) - ROM_REGION( 0x40000, "text", 0 ) /* text */ + ROM_REGION( 0x40000, "text", 0 ) ROM_LOAD( "22a-4.121", 0x00000, 0x20000, CRC(acc26051) SHA1(445224238cce420990894824d95447e3f63a9ef0) ) ROM_LOAD( "22a-3.107", 0x20000, 0x20000, CRC(10bb800d) SHA1(265a3d67669034d17713b505ef55cd1c90f8d205) ) @@ -354,11 +641,11 @@ ROM_LOAD( "22a-1.2", 0x00000, 0x20000, CRC(3bd1c3ec) SHA1(40f61552ea6f7a81915fe3e13f75dc1dc69da33e) ) ROM_LOAD( "22a-2.35", 0x20000, 0x20000, CRC(409e1be1) SHA1(35a77fc8fe6fc212734e2f452dbde9b8cf696f61) ) - ROM_REGION( 0x20000, "adpcm", 0 ) /* adpcm samples */ + ROM_REGION( 0x20000, "adpcm", 0 ) ROM_LOAD( "22j6-0.83", 0x00000, 0x10000, CRC(744a26e3) SHA1(519f22f1e5cc417cb8f9ced97e959d23c711283b) ) ROM_LOAD( "22j7-0.82", 0x10000, 0x10000, CRC(2fa1de21) SHA1(e8c7af6057b64ecadd3473b82abd8e9f873082fd) ) - ROM_REGION( 0x0800, "proms", 0 ) /* color PROMs */ + ROM_REGION( 0x0800, "proms", 0 ) // colors ROM_LOAD( "mb7132e.158", 0x0000, 0x0400, CRC(7e623722) SHA1(e1fe60533237bd0aba5c8de9775df620ed5227c0) ) ROM_LOAD( "mb7122e.159", 0x0400, 0x0400, CRC(69706e8d) SHA1(778ee88ff566aa38c80e0e61bb3fe8458f0e9450) ) ROM_END @@ -396,15 +683,15 @@ ROM_START( nkdodge ) ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "22j4-0.139", 0x00000, 0x10000, CRC(aa674fd8) SHA1(4e8d3e07b54d23b221cb39cf10389bc7a56c4021) ) /* First 0x8000: Two banks, second 0x8000: Static */ + ROM_LOAD( "22j4-0.139", 0x00000, 0x10000, CRC(aa674fd8) SHA1(4e8d3e07b54d23b221cb39cf10389bc7a56c4021) ) // First 0x8000: Two banks, second 0x8000: Static - ROM_REGION( 0x08000, "audiocpu", 0 ) /* audio cpu */ + ROM_REGION( 0x08000, "audiocpu", 0 ) ROM_LOAD( "22j5-0.33", 0x00000, 0x08000, CRC(c31e264e) SHA1(0828a2094122e3934b784ec9ad7c2b89d91a83bb) ) - ROM_REGION( 0x04000, "mcu", 0 ) /* I/O mcu */ + ROM_REGION( 0x04000, "mcu", 0 ) // I/O ROM_LOAD( "22ja-0.162", 0x00000, 0x04000, CRC(7162a97b) SHA1(d6d4ee025e73a340428345f08711cd32f9169a8c) ) - ROM_REGION( 0x40000, "text", 0 ) /* text */ + ROM_REGION( 0x40000, "text", 0 ) ROM_LOAD( "tj22j4-0.121", 0x00000, 0x20000, CRC(d2922b3f) SHA1(30ad37f8355c732b545017c2fc56879256b650be) ) ROM_LOAD( "tj22j3-0.107", 0x20000, 0x20000, CRC(79cd1315) SHA1(2d7a877e59f704b10b5f609e60fa565c68f5fdb0) ) @@ -412,28 +699,28 @@ ROM_LOAD( "tj22j1-0.2", 0x00000, 0x20000, CRC(9ed27a8d) SHA1(d80d275bbe91f3e1bd0495a2d7a3be0280a7cda1) ) ROM_LOAD( "tj22j2-0.35", 0x20000, 0x20000, CRC(768934f9) SHA1(922f3154dcfb29c2e5c1bebc53247136160f1229) ) - ROM_REGION( 0x20000, "adpcm", 0 ) /* adpcm samples */ + ROM_REGION( 0x20000, "adpcm", 0 ) ROM_LOAD( "22j6-0.83", 0x00000, 0x10000, CRC(744a26e3) SHA1(519f22f1e5cc417cb8f9ced97e959d23c711283b) ) ROM_LOAD( "22j7-0.82", 0x10000, 0x10000, CRC(2fa1de21) SHA1(e8c7af6057b64ecadd3473b82abd8e9f873082fd) ) - ROM_REGION( 0x0800, "proms", 0 ) /* color PROMs */ + ROM_REGION( 0x0800, "proms", 0 ) // colors ROM_LOAD( "22j8-0.158", 0x0000, 0x0400, CRC(c368440f) SHA1(39762d102a42211f24db16bc721b01230df1c4d6) ) ROM_LOAD( "22j9-0.159", 0x0400, 0x0400, CRC(6059f401) SHA1(280b1bda3a55f2d8c2fd4552c4dcec7100f0170f) ) ROM_END -/* the bootleg just seems to have the gfx roms in a different format, program is identical */ +// the bootleg just seems to have the gfx ROMs in a different format, program is identical ROM_START( nkdodgeb ) ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "12.bin", 0x00000, 0x10000, CRC(aa674fd8) SHA1(4e8d3e07b54d23b221cb39cf10389bc7a56c4021) ) /* First 0x8000: Two banks, second 0x8000: Static */ + ROM_LOAD( "12.bin", 0x00000, 0x10000, CRC(aa674fd8) SHA1(4e8d3e07b54d23b221cb39cf10389bc7a56c4021) ) // First 0x8000: Two banks, second 0x8000: Static - ROM_REGION( 0x08000, "audiocpu", 0 ) /* audio cpu */ + ROM_REGION( 0x08000, "audiocpu", 0 ) ROM_LOAD( "22j5-0.33", 0x00000, 0x08000, CRC(c31e264e) SHA1(0828a2094122e3934b784ec9ad7c2b89d91a83bb) ) - ROM_REGION( 0x04000, "mcu", 0 ) /* I/O mcu */ + ROM_REGION( 0x04000, "mcu", 0 ) // I/O ROM_LOAD( "hd63701y0p.n12", 0x0000, 0x4000, CRC(7162a97b) SHA1(d6d4ee025e73a340428345f08711cd32f9169a8c) BAD_DUMP ) // missing from dump, but probably also identical - ROM_REGION( 0x40000, "text", 0 ) /* text */ + ROM_REGION( 0x40000, "text", 0 ) ROM_LOAD( "10.bin", 0x00000, 0x10000, CRC(442326fd) SHA1(e0e9e1dfdca3edd6e2522f55c191b40b81b8eaff) ) ROM_LOAD( "11.bin", 0x10000, 0x10000, CRC(2140b070) SHA1(7a9d89eb6130b1dd21236fefaeb09a29c7f0d208) ) ROM_LOAD( "9.bin", 0x20000, 0x10000, CRC(18660ac1) SHA1(be6a47eea9649d7b9ff8b30a4de643522c9869e6) ) @@ -445,15 +732,16 @@ ROM_LOAD( "4.bin", 0x20000, 0x10000, CRC(f5022822) SHA1(fa67b1f70da80365f14776b712df6f656e603fb0) ) ROM_LOAD( "3.bin", 0x30000, 0x10000, CRC(05a71179) SHA1(7e5ed81b37ac458d7a40e89f83f1efb742e797a8) ) - ROM_REGION( 0x20000, "adpcm", 0 ) /* adpcm samples */ + ROM_REGION( 0x20000, "adpcm", 0 ) ROM_LOAD( "22j6-0.83", 0x00000, 0x10000, CRC(744a26e3) SHA1(519f22f1e5cc417cb8f9ced97e959d23c711283b) ) ROM_LOAD( "22j7-0.82", 0x10000, 0x10000, CRC(2fa1de21) SHA1(e8c7af6057b64ecadd3473b82abd8e9f873082fd) ) - ROM_REGION( 0x0800, "proms", 0 ) /* color PROMs */ + ROM_REGION( 0x0800, "proms", 0 ) // colors ROM_LOAD( "27s191.bin", 0x0000, 0x0800, CRC(317e42ea) SHA1(59caacc02fb7fb11604bd177f790fd68830ca7c1) ) ROM_LOAD( "82s137.bin", 0x0400, 0x0400, CRC(6059f401) SHA1(280b1bda3a55f2d8c2fd4552c4dcec7100f0170f) ) ROM_END +} // anonymous namespace GAME( 1987, spdodgeb, 0, spdodgeb, spdodgeb, spdodgeb_state, empty_init, ROT0, "Technos Japan", "Super Dodge Ball (US)", MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/spec128.cpp mame-0.243+dfsg.1/src/mame/drivers/spec128.cpp --- mame-0.242+dfsg.1/src/mame/drivers/spec128.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/spec128.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -323,7 +323,7 @@ config.set_maximum_quantum(attotime::from_hz(60)); /* video hardware */ - m_screen->set_raw(X1_128_SINCLAIR / 5, 456, 311, {get_screen_area().left() - 48, get_screen_area().right() + 48, get_screen_area().top() - 48, get_screen_area().bottom() + 48}); + m_screen->set_raw(X1_128_SINCLAIR / 5, 456, 311, {get_screen_area().left() - 48, get_screen_area().right() + 48, get_screen_area().top() - 48, get_screen_area().bottom() + 56}); subdevice("gfxdecode")->set_info(spec128); diff -Nru mame-0.242+dfsg.1/src/mame/drivers/spectrum.cpp mame-0.243+dfsg.1/src/mame/drivers/spectrum.cpp --- mame-0.242+dfsg.1/src/mame/drivers/spectrum.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/spectrum.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -795,7 +795,7 @@ /* video hardware */ SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_raw(X1 / 2, 448, 312, {get_screen_area().left() - 48, get_screen_area().right() + 48, get_screen_area().top() - 48, get_screen_area().bottom() + 48}); + m_screen->set_raw(X1 / 2, 448, 312, {get_screen_area().left() - 48, get_screen_area().right() + 48, get_screen_area().top() - 48, get_screen_area().bottom() + 56}); m_screen->set_screen_update(FUNC(spectrum_state::screen_update_spectrum)); m_screen->set_palette("palette"); diff -Nru mame-0.242+dfsg.1/src/mame/drivers/speedatk.cpp mame-0.243+dfsg.1/src/mame/drivers/speedatk.cpp --- mame-0.242+dfsg.1/src/mame/drivers/speedatk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/speedatk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -283,21 +283,9 @@ 8*8 }; -static const gfx_layout charlayout_3bpp = -{ - 8,8, - RGN_FRAC(1,3), - 3, - { RGN_FRAC(2,3), RGN_FRAC(1,3), RGN_FRAC(0,3) }, - { 0, 1, 2, 3, 4, 5, 6, 7 }, - { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, - 8*8 -}; - - static GFXDECODE_START( gfx_speedatk ) GFXDECODE_ENTRY( "gfx1", 0, charlayout_1bpp, 0, 32 ) - GFXDECODE_ENTRY( "gfx2", 0, charlayout_3bpp, 0, 32 ) + GFXDECODE_ENTRY( "gfx2", 0, gfx_8x8x3_planar, 0, 32 ) GFXDECODE_END void speedatk_state::output_w(uint8_t data) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/spinb.cpp mame-0.243+dfsg.1/src/mame/drivers/spinb.cpp --- mame-0.242+dfsg.1/src/mame/drivers/spinb.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/spinb.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -164,8 +164,8 @@ void music_map(address_map &map); void vrnwrld_map(address_map &map); - bool m_pc0a = 0; - bool m_pc0m = 0; + bool m_pc0a = false; + bool m_pc0m = false; u8 m_game = 0U; u8 m_row = 0U; u8 m_p3 = 0U; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/spirit76.cpp mame-0.243+dfsg.1/src/mame/drivers/spirit76.cpp --- mame-0.242+dfsg.1/src/mame/drivers/spirit76.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/spirit76.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -384,4 +384,4 @@ } // Anonymous namespace -GAME( 1975, spirit76, 0, spirit76, spirit76, spirit76_state, empty_init, ROT0, "Mirco", "Spirit of 76", MACHINE_IS_SKELETON_MECHANICAL ) +GAME( 1975, spirit76, 0, spirit76, spirit76, spirit76_state, empty_init, ROT0, "Mirco", "Spirit of 76", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/squale.cpp mame-0.243+dfsg.1/src/mame/drivers/squale.cpp --- mame-0.242+dfsg.1/src/mame/drivers/squale.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/squale.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -176,7 +176,7 @@ floppy_image_device *m_floppy; required_device m_cart; - memory_region *m_cart_rom = 0; + memory_region *m_cart_rom = nullptr; }; /***************************************** diff -Nru mame-0.242+dfsg.1/src/mame/drivers/srumbler.cpp mame-0.243+dfsg.1/src/mame/drivers/srumbler.cpp --- mame-0.242+dfsg.1/src/mame/drivers/srumbler.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/srumbler.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -8,8 +8,6 @@ M6809 for game, Z80 and YM-2203 for sound. -2009/06 - DIP Location and Defaults verified against Speed Rumbler manual. - ***************************************************************************/ #include "emu.h" @@ -254,7 +252,6 @@ z80_device &audiocpu(Z80(config, "audiocpu", 16_MHz_XTAL / 4)); audiocpu.set_addrmap(AS_PROGRAM, &srumbler_state::srumbler_sound_map); - audiocpu.set_periodic_int(FUNC(srumbler_state::irq0_line_hold), attotime::from_hz(4*60)); /* video hardware */ BUFFERED_SPRITERAM8(config, m_spriteram); @@ -278,6 +275,7 @@ GENERIC_LATCH_8(config, "soundlatch"); ym2203_device &ym1(YM2203(config, "ym1", 16_MHz_XTAL / 4)); + ym1.irq_handler().set_inputline("audiocpu", 0); ym1.add_route(0, "mono", 0.10); ym1.add_route(1, "mono", 0.10); ym1.add_route(2, "mono", 0.10); diff -Nru mame-0.242+dfsg.1/src/mame/drivers/ssem.cpp mame-0.243+dfsg.1/src/mame/drivers/ssem.cpp --- mame-0.242+dfsg.1/src/mame/drivers/ssem.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/ssem.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -12,6 +12,7 @@ #include "emupal.h" #include "screen.h" #include "softlist_dev.h" +#include class ssem_state : public driver_device @@ -35,7 +36,7 @@ uint32_t screen_update_ssem(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECLARE_QUICKLOAD_LOAD_MEMBER(quickload_cb); inline uint32_t reverse(uint32_t v); - std::string read_line(device_image_interface *image); + std::string read_line(device_image_interface &image); void ssem_map(address_map &map); @@ -516,25 +517,26 @@ * Image helper functions * \****************************************************/ -std::string ssem_state::read_line(device_image_interface *image) +std::string ssem_state::read_line(device_image_interface &image) { - std::string holder; + std::ostringstream stream; for (u8 i = 0; i < 100; i++) { - char c = image->fgetc(); + char c = 0; + if (image.fread(&c, 1) != 1) + break; // convert opcode to lower case if (c >= 'A' && c <= 'Z') c += 32; if (c >= 32) - holder.push_back(c); + stream << c; else { - c = image->fgetc(); // skip LF + image.fread(&c, 1); // skip LF break; } } - holder.push_back(0); - return holder; + return std::move(stream).str(); } @@ -548,7 +550,7 @@ std::string buffer; u32 num_lines = 0; - std::string image_line = read_line(&image); + std::string image_line = read_line(image); if (image_line.empty()) { image.message("No data in line 1"); @@ -566,10 +568,10 @@ for (u32 i = 0; i < num_lines; i++) { u32 line = 0, word = 0; - image_line = read_line(&image); + image_line = read_line(image); u32 length = image_line.length(); - if (length < 9) + if (length < 8) { image.message("Bad data (%s) in line %d",image_line.c_str(),i+2); return image_init_result::FAIL; @@ -581,7 +583,7 @@ if (image.is_filetype("snp")) { - if (length < 38) + if (length < 37) { image.message("Bad data (%s) in line %d",image_line.c_str(),i+2); return image_init_result::FAIL; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/ssfindo.cpp mame-0.243+dfsg.1/src/mame/drivers/ssfindo.cpp --- mame-0.242+dfsg.1/src/mame/drivers/ssfindo.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/ssfindo.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1,6 +1,6 @@ // license:BSD-3-Clause // copyright-holders:Tomasz Slanina -/************************************************************************ +/************************************************************************************************** 'RISC PC' hardware @@ -17,10 +17,10 @@ - timing - unknown reads/writes - improve sound hook up - - ppcar uses the VIDC internal DAC for SFX and the QS1000 for music. It's configured to use the undumped internal ROM. + - ppcar: uses the VIDC internal DAC for SFX and the QS1000 for music. + It's configured to use the undumped internal ROM. - -************************************************************************************************************* +=================================================================================================== See See Find Out Icarus, 1999 @@ -69,7 +69,7 @@ mounting pads for 4 more of these ROMs but they're not populated. -************************************************************************************************************** +=================================================================================================== Pong Pong Car Icarus, 1999 @@ -124,7 +124,7 @@ DU5, DU6 These ROMs are mounted on a small plug-in daughterboard. There are additional mounting pads for 4 more of these ROMs but they're not populated. -*/ +**************************************************************************************************/ #include "emu.h" #include "cpu/arm7/arm7.h" @@ -172,7 +172,7 @@ virtual void machine_reset() override; typedef void (ssfindo_state::*speedup_func)(); - speedup_func m_speedup; + speedup_func m_speedup{}; uint32_t m_flashType = 0; @@ -235,7 +235,7 @@ uint32_t tetfight_unk_r(); }; -//TODO: eeprom 24c01 & 24c02 +// TODO: eeprom 24c01 & 24c02 // TODO: untangle, kill hacks uint8_t ssfindo_state::iolines_r() { @@ -616,8 +616,8 @@ qs1000_device &qs1000(QS1000(config, "qs1000", 24_MHz_XTAL)); qs1000.set_external_rom(true); // qs1000.p1_out().set(FUNC()); // TODO: writes something here - qs1000.add_route(0, "lspeaker", 1.0); - qs1000.add_route(1, "rspeaker", 1.0); + qs1000.add_route(0, "lspeaker", 0.25); + qs1000.add_route(1, "rspeaker", 0.25); } void ssfindo_state::ppcar(machine_config &config) @@ -740,4 +740,4 @@ GAME( 1999, ssfindo, 0, ssfindo, ssfindo, ssfindo_state, init_ssfindo, ROT0, "Icarus", "See See Find Out", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) GAME( 1999, ppcar, 0, ppcar, ppcar, ssfindo_state, init_ppcar, ROT0, "Icarus", "Pang Pang Car", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 2001, tetfight,0, tetfight, tetfight, tetfight_state, init_tetfight, ROT0, "Sego", "Tetris Fighters", MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 2001, tetfight,0, tetfight, tetfight, tetfight_state, init_tetfight, ROT0, "Sego", "Tetris Fighters", MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // severe frame hiccups diff -Nru mame-0.242+dfsg.1/src/mame/drivers/sshot.cpp mame-0.243+dfsg.1/src/mame/drivers/sshot.cpp --- mame-0.242+dfsg.1/src/mame/drivers/sshot.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/sshot.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -330,19 +330,8 @@ * *************************************/ -static const gfx_layout supershot_charlayout = -{ - 8,8, - RGN_FRAC(1,1), - 1, - { 0 }, - { 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_supershot ) - GFXDECODE_ENTRY( "gfx", 0, supershot_charlayout, 0, 1 ) + GFXDECODE_ENTRY( "gfx", 0, gfx_8x8x1, 0, 1 ) GFXDECODE_END void supershot_state::supershot(machine_config &config) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/stargame.cpp mame-0.243+dfsg.1/src/mame/drivers/stargame.cpp --- mame-0.242+dfsg.1/src/mame/drivers/stargame.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/stargame.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -469,5 +469,5 @@ } // Anonymous namespace -GAME( 1986, spcship, 0, stargame, spcship, stargame_state, init_0, ROT0, "Stargame", "Space Ship (Pinball)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1987, whtforce, 0, stargame, whtforce, stargame_state, init_1, ROT0, "Stargame", "White Force", MACHINE_IS_SKELETON_MECHANICAL ) +GAME( 1986, spcship, 0, stargame, spcship, stargame_state, init_0, ROT0, "Stargame", "Space Ship (Pinball)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1987, whtforce, 0, stargame, whtforce, stargame_state, init_1, ROT0, "Stargame", "White Force", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/statriv2.cpp mame-0.243+dfsg.1/src/mame/drivers/statriv2.cpp --- mame-0.242+dfsg.1/src/mame/drivers/statriv2.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/statriv2.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -669,19 +669,8 @@ GFXDECODE_END -static const gfx_layout vertical_tiles_layout = -{ - 8,8, - RGN_FRAC(1,1), - 1, - { 0 }, - { STEP8(0,1) }, - { STEP8(0,8) }, - 8*8 -}; - static GFXDECODE_START( gfx_vertical ) - GFXDECODE_ENTRY( "tiles", 0, vertical_tiles_layout, 0, 64 ) + GFXDECODE_ENTRY( "tiles", 0, gfx_8x8x1, 0, 64 ) GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/st_mp100.cpp mame-0.243+dfsg.1/src/mame/drivers/st_mp100.cpp --- mame-0.242+dfsg.1/src/mame/drivers/st_mp100.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/st_mp100.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -79,9 +79,9 @@ u8 m_u10b = 0U; u8 m_u11a = 0U; u8 m_u11b = 0U; - bool m_u10_ca2 = 0; - bool m_u10_cb2 = 0; - bool m_u11_cb2 = 0; + bool m_u10_ca2 = false; + bool m_u10_cb2 = false; + bool m_u11_cb2 = false; u8 m_stored_lamp = 0xffU; u8 m_digit = 0U; u8 m_counter = 0U; @@ -977,21 +977,21 @@ // chimes -GAME( 1977, pinball, 0, st_mp100, mp100, st_mp100_state, empty_init, ROT0, "Stern", "Pinball", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1977, stingray, 0, st_mp100, mp100, st_mp100_state, empty_init, ROT0, "Stern", "Stingray", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1978, stars, 0, st_mp100, mp100, st_mp100_state, empty_init, ROT0, "Stern", "Stars", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1978, memlane, 0, st_mp100, mp100, st_mp100_state, empty_init, ROT0, "Stern", "Memory Lane", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1978, blkshpsq, 0, st_mp100, mp100, st_mp100_state, empty_init, ROT0, "Astro", "Black Sheep Squadron", MACHINE_IS_SKELETON_MECHANICAL) +GAME( 1977, pinball, 0, st_mp100, mp100, st_mp100_state, empty_init, ROT0, "Stern", "Pinball", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1977, stingray, 0, st_mp100, mp100, st_mp100_state, empty_init, ROT0, "Stern", "Stingray", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1978, stars, 0, st_mp100, mp100, st_mp100_state, empty_init, ROT0, "Stern", "Stars", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1978, memlane, 0, st_mp100, mp100, st_mp100_state, empty_init, ROT0, "Stern", "Memory Lane", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1978, blkshpsq, 0, st_mp100, mp100, st_mp100_state, empty_init, ROT0, "Astro", "Black Sheep Squadron", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // sound unit B-521 -GAME( 1978, lectrono, 0, st_mp100, mp100, st_mp100_state, empty_init, ROT0, "Stern", "Lectronamo", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1978, wildfyre, 0, st_mp100, mp100, st_mp100_state, empty_init, ROT0, "Stern", "Wildfyre", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1978, nugent, 0, st_mp100, mp100, st_mp100_state, empty_init, ROT0, "Stern", "Nugent", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1979, dracula, 0, st_mp100, mp100, st_mp100_state, empty_init, ROT0, "Stern", "Dracula (Pinball)", MACHINE_IS_SKELETON_MECHANICAL ) +GAME( 1978, lectrono, 0, st_mp100, mp100, st_mp100_state, empty_init, ROT0, "Stern", "Lectronamo", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1978, wildfyre, 0, st_mp100, mp100, st_mp100_state, empty_init, ROT0, "Stern", "Wildfyre", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1978, nugent, 0, st_mp100, mp100, st_mp100_state, empty_init, ROT0, "Stern", "Nugent", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1979, dracula, 0, st_mp100, mp100, st_mp100_state, empty_init, ROT0, "Stern", "Dracula (Pinball)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // different inputs -GAME( 1979, trident, 0, st_mp100, mp200, st_mp100_state, empty_init, ROT0, "Stern", "Trident", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1979, tridento, trident, st_mp100, mp200, st_mp100_state, empty_init, ROT0, "Stern", "Trident (Older set)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1979, hothand, 0, st_mp100, mp200, st_mp100_state, empty_init, ROT0, "Stern", "Hot Hand", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1979, princess, 0, st_mp100, mp200, st_mp100_state, empty_init, ROT0, "Stern", "Cosmic Princess", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1979, magic, 0, st_mp100, mp200, st_mp100_state, empty_init, ROT0, "Stern", "Magic", MACHINE_IS_SKELETON_MECHANICAL ) +GAME( 1979, trident, 0, st_mp100, mp200, st_mp100_state, empty_init, ROT0, "Stern", "Trident", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1979, tridento, trident, st_mp100, mp200, st_mp100_state, empty_init, ROT0, "Stern", "Trident (Older set)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1979, hothand, 0, st_mp100, mp200, st_mp100_state, empty_init, ROT0, "Stern", "Hot Hand", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1979, princess, 0, st_mp100, mp200, st_mp100_state, empty_init, ROT0, "Stern", "Cosmic Princess", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1979, magic, 0, st_mp100, mp200, st_mp100_state, empty_init, ROT0, "Stern", "Magic", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/st_mp200.cpp mame-0.243+dfsg.1/src/mame/drivers/st_mp200.cpp --- mame-0.242+dfsg.1/src/mame/drivers/st_mp200.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/st_mp200.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -129,10 +129,10 @@ u8 m_u10b = 0U; u8 m_u11a = 0U; u8 m_u11b = 0U; - bool m_u10_ca2 = 0; - bool m_u10_cb2 = 0; - bool m_u11_cb2 = 0; - bool m_7d = 0; // 7-digit display yes/no + bool m_u10_ca2 = false; + bool m_u10_cb2 = false; + bool m_u11_cb2 = false; + bool m_7d = false; // 7-digit display yes/no u8 m_stored_lamp = 0xffU; u8 m_digit = 0U; u8 m_counter = 0U; @@ -1143,34 +1143,34 @@ // 6-digit -GAME(1979, meteorp, 0, st_mp200, mp200, st_mp200_state, init_st_mp202, ROT0, "Stern", "Meteor (Bug fix release)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1979, meteorpo, meteorp, st_mp200, mp200, st_mp200_state, init_st_mp202, ROT0, "Stern", "Meteor (First release)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1980, galaxypi, 0, st_mp200, mp200, st_mp200_state, init_st_mp202, ROT0, "Stern", "Galaxy", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1980, ali, 0, st_mp200, mp200, st_mp200_state, init_st_mp202, ROT0, "Stern", "Ali", MACHINE_IS_SKELETON_MECHANICAL) +GAME(1979, meteorp, 0, st_mp200, mp200, st_mp200_state, init_st_mp202, ROT0, "Stern", "Meteor (Bug fix release)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1979, meteorpo, meteorp, st_mp200, mp200, st_mp200_state, init_st_mp202, ROT0, "Stern", "Meteor (First release)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1980, galaxypi, 0, st_mp200, mp200, st_mp200_state, init_st_mp202, ROT0, "Stern", "Galaxy", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1980, ali, 0, st_mp200, mp200, st_mp200_state, init_st_mp202, ROT0, "Stern", "Ali", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // 7-digit -GAME(1980, cheetah, 0, st_mp200, mp200, st_mp200_state, init_st_mp200, ROT0, "Stern", "Cheetah (Black Cabinet)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1980, cheetahb, cheetah, st_mp200, mp200, st_mp200_state, init_st_mp202, ROT0, "Stern", "Cheetah (Blue Cabinet)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1980, quicksil, 0, st_mp200, mp200, st_mp200_state, init_st_mp200, ROT0, "Stern", "Quicksilver", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1980, biggame, 0, st_mp200, mp200, st_mp200_state, init_st_mp200, ROT0, "Stern", "Big Game", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1980, seawitch, 0, st_mp200, mp200, st_mp200_state, init_st_mp200, ROT0, "Stern", "Seawitch", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1980, stargzr, 0, st_mp200, mp200, st_mp200_state, init_st_mp200, ROT0, "Stern", "Stargazer", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1982, dragfist, 0, st_mp200, mp200, st_mp200_state, init_st_mp200, ROT0, "Stern", "Dragonfist", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1982, cue, 0, st_mp200, mp200, st_mp200_state, init_st_mp200, ROT0, "Stern", "Cue (Prototype)", MACHINE_IS_SKELETON_MECHANICAL) +GAME(1980, cheetah, 0, st_mp200, mp200, st_mp200_state, init_st_mp200, ROT0, "Stern", "Cheetah (Black Cabinet)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1980, cheetahb, cheetah, st_mp200, mp200, st_mp200_state, init_st_mp202, ROT0, "Stern", "Cheetah (Blue Cabinet)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1980, quicksil, 0, st_mp200, mp200, st_mp200_state, init_st_mp200, ROT0, "Stern", "Quicksilver", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1980, biggame, 0, st_mp200, mp200, st_mp200_state, init_st_mp200, ROT0, "Stern", "Big Game", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1980, seawitch, 0, st_mp200, mp200, st_mp200_state, init_st_mp200, ROT0, "Stern", "Seawitch", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1980, stargzr, 0, st_mp200, mp200, st_mp200_state, init_st_mp200, ROT0, "Stern", "Stargazer", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1982, dragfist, 0, st_mp200, mp200, st_mp200_state, init_st_mp200, ROT0, "Stern", "Dragonfist", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1982, cue, 0, st_mp200, mp200, st_mp200_state, init_st_mp200, ROT0, "Stern", "Cue (Prototype)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // multiball -GAME(1980, nineball, 0, st_mp200, mp200, st_mp200_state, init_st_mp200, ROT0, "Stern", "Nine Ball", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1981, lightnin, 0, st_mp201, mp200, st_mp200_state, init_st_mp201, ROT0, "Stern", "Lightning", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1980, flight2k, 0, st_mp201, mp200, st_mp200_state, init_st_mp201, ROT0, "Stern", "Flight 2000", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1981, freefall, 0, st_mp201, mp200, st_mp200_state, init_st_mp201, ROT0, "Stern", "Freefall", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1981, spltsecp, 0, st_mp201, mp200, st_mp200_state, init_st_mp201, ROT0, "Stern", "Split Second (Pinball)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1981, catacomp, 0, st_mp201, mp200, st_mp200_state, init_st_mp201, ROT0, "Stern", "Catacomb (Pinball)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1981, viperp, 0, st_mp200, mp200, st_mp200_state, init_st_mp200, ROT0, "Stern", "Viper (Pinball)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1981, ironmaid, 0, st_mp200, mp200, st_mp200_state, init_st_mp200, ROT0, "Stern", "Iron Maiden", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1982, orbitor1, 0, st_mp201, mp200, st_mp200_state, init_st_mp201, ROT0, "Stern", "Orbitor 1", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1984, lazrlord, 0, st_mp200, mp200, st_mp200_state, init_st_mp200, ROT0, "Stern", "Lazer Lord", MACHINE_IS_SKELETON_MECHANICAL) +GAME(1980, nineball, 0, st_mp200, mp200, st_mp200_state, init_st_mp200, ROT0, "Stern", "Nine Ball", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1981, lightnin, 0, st_mp201, mp200, st_mp200_state, init_st_mp201, ROT0, "Stern", "Lightning", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1980, flight2k, 0, st_mp201, mp200, st_mp200_state, init_st_mp201, ROT0, "Stern", "Flight 2000", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1981, freefall, 0, st_mp201, mp200, st_mp200_state, init_st_mp201, ROT0, "Stern", "Freefall", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1981, spltsecp, 0, st_mp201, mp200, st_mp200_state, init_st_mp201, ROT0, "Stern", "Split Second (Pinball)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1981, catacomp, 0, st_mp201, mp200, st_mp200_state, init_st_mp201, ROT0, "Stern", "Catacomb (Pinball)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1981, viperp, 0, st_mp200, mp200, st_mp200_state, init_st_mp200, ROT0, "Stern", "Viper (Pinball)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1981, ironmaid, 0, st_mp200, mp200, st_mp200_state, init_st_mp200, ROT0, "Stern", "Iron Maiden", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1982, orbitor1, 0, st_mp201, mp200, st_mp200_state, init_st_mp201, ROT0, "Stern", "Orbitor 1", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1984, lazrlord, 0, st_mp200, mp200, st_mp200_state, init_st_mp200, ROT0, "Stern", "Lazer Lord", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // other manufacturer -GAME(1985, gamatron, flight2k, st_mp200, mp200, st_mp200_state, init_st_mp200, ROT0, "Pinstar", "Gamatron", MACHINE_IS_SKELETON_MECHANICAL) -GAME(198?, st_sam, 0, st_mp200, mp200, st_mp200_state, init_st_mp200, ROT0, "Stern", "SAM III Test Fixture", MACHINE_IS_SKELETON_MECHANICAL) -GAME(198?, st_sam4, st_sam, st_sam4, mp200, st_mp200_state, init_st_mp200, ROT0, "Stern", "SAM IV Test Fixture", MACHINE_IS_SKELETON_MECHANICAL) +GAME(1985, gamatron, flight2k, st_mp200, mp200, st_mp200_state, init_st_mp200, ROT0, "Pinstar", "Gamatron", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(198?, st_sam, 0, st_mp200, mp200, st_mp200_state, init_st_mp200, ROT0, "Stern", "SAM III Test Fixture", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(198?, st_sam4, st_sam, st_sam4, mp200, st_mp200_state, init_st_mp200, ROT0, "Stern", "SAM IV Test Fixture", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/studio2.cpp mame-0.243+dfsg.1/src/mame/drivers/studio2.cpp --- mame-0.242+dfsg.1/src/mame/drivers/studio2.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/studio2.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -277,7 +277,7 @@ DECLARE_DEVICE_IMAGE_LOAD_MEMBER( cart_load ); /* keyboard state */ - uint8_t m_keylatch; + uint8_t m_keylatch = 0; void studio2_io_map(address_map &map); void studio2_map(address_map &map); diff -Nru mame-0.242+dfsg.1/src/mame/drivers/stuntair.cpp mame-0.243+dfsg.1/src/mame/drivers/stuntair.cpp --- mame-0.242+dfsg.1/src/mame/drivers/stuntair.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/stuntair.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -435,17 +435,6 @@ ***************************************************************************/ -static const gfx_layout tiles8x8_layout = -{ - 8,8, - RGN_FRAC(1,1), - 1, - { 0 }, - { 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 const gfx_layout tiles8x8x2_layout = { 8,8, @@ -470,8 +459,8 @@ static GFXDECODE_START( gfx_stuntair ) - GFXDECODE_ENTRY( "gfx1", 0, tiles8x8_layout, 0x100, 1 ) - GFXDECODE_ENTRY( "gfx2", 0, tiles8x8x2_layout, 0xe0, 8 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x1, 0x100, 1 ) + GFXDECODE_ENTRY( "gfx2", 0, tiles8x8x2_layout, 0xe0, 8 ) GFXDECODE_ENTRY( "gfx3", 0, tiles16x8x2_layout, 0xe0, 8 ) GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/suna16.cpp mame-0.243+dfsg.1/src/mame/drivers/suna16.cpp --- mame-0.242+dfsg.1/src/mame/drivers/suna16.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/suna16.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -314,6 +314,13 @@ m_bank2->configure_entries(0, 8, memregion("pcm2")->base() + 0x1000, 0x10000); } +MACHINE_START_MEMBER(suna16_state, sunaq) +{ + m_leds.resolve(); + + m_bank1->configure_entries(0, 8, memregion("pcm1")->base() + 0x1000, 0x10000); +} + /* Bank Switching */ void suna16_state::bssoccer_pcm_1_bankswitch_w(uint8_t data) @@ -942,8 +949,7 @@ config.set_maximum_quantum(attotime::from_hz(6000)); - MCFG_MACHINE_START_OVERRIDE(suna16_state,uballoon) - MCFG_MACHINE_RESET_OVERRIDE(suna16_state,uballoon) + MCFG_MACHINE_START_OVERRIDE(suna16_state, sunaq) /* video hardware */ SCREEN(config, m_screen, SCREEN_TYPE_RASTER); diff -Nru mame-0.242+dfsg.1/src/mame/drivers/super6.cpp mame-0.243+dfsg.1/src/mame/drivers/super6.cpp --- mame-0.242+dfsg.1/src/mame/drivers/super6.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/super6.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -371,7 +371,7 @@ //------------------------------------------------- -// floppy_format_type floppy_formats +// floppy_formats //------------------------------------------------- static void super6_floppies(device_slot_interface &device) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/superqix.cpp mame-0.243+dfsg.1/src/mame/drivers/superqix.cpp --- mame-0.242+dfsg.1/src/mame/drivers/superqix.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/superqix.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1402,17 +1402,6 @@ 32*8 }; -static const gfx_layout sqix_charlayout = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { 0, 1, 2, 3 }, - { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4 }, - { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 }, - 32*8 -}; - static const gfx_layout spritelayout = { 16,16, @@ -1433,9 +1422,9 @@ GFXDECODE_END static GFXDECODE_START( gfx_sqix ) - GFXDECODE_ENTRY( "gfx1", 0x00000, sqix_charlayout, 0, 16 ) /* Chars */ - GFXDECODE_ENTRY( "gfx2", 0x00000, sqix_charlayout, 0, 16 ) /* Background tiles */ - GFXDECODE_ENTRY( "gfx3", 0x00000, spritelayout, 0, 16 ) /* Sprites */ + GFXDECODE_ENTRY( "gfx1", 0x00000, gfx_8x8x4_packed_msb, 0, 16 ) /* Chars */ + GFXDECODE_ENTRY( "gfx2", 0x00000, gfx_8x8x4_packed_msb, 0, 16 ) /* Background tiles */ + GFXDECODE_ENTRY( "gfx3", 0x00000, spritelayout, 0, 16 ) /* Sprites */ GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/suprgolf.cpp mame-0.243+dfsg.1/src/mame/drivers/suprgolf.cpp --- mame-0.242+dfsg.1/src/mame/drivers/suprgolf.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/suprgolf.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -473,19 +473,8 @@ } } -static const gfx_layout gfxlayout = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { 0, 1, 2, 3 }, - { 1*4, 0*4, 3*4, 2*4, 5*4, 4*4, 7*4, 6*4 }, - { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 }, - 8*8*4 -}; - static GFXDECODE_START( gfx_suprgolf ) - GFXDECODE_ENTRY( "gfx1", 0, gfxlayout, 0, 0x80 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x4_packed_lsb, 0, 0x80 ) GFXDECODE_END void suprgolf_state::machine_reset() diff -Nru mame-0.242+dfsg.1/src/mame/drivers/suprslam.cpp mame-0.243+dfsg.1/src/mame/drivers/suprslam.cpp --- mame-0.242+dfsg.1/src/mame/drivers/suprslam.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/suprslam.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -219,17 +219,6 @@ /*** GFX DECODE **************************************************************/ -static const gfx_layout suprslam_8x8x4_layout = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { 0,1,2,3 }, - { 4, 0, 12, 8, 20, 16, 28, 24 }, - { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 }, - 8*32 -}; - static const gfx_layout suprslam_16x16x4_layout = { 16,16, @@ -245,7 +234,7 @@ }; static GFXDECODE_START( gfx_suprslam ) - GFXDECODE_ENTRY( "gfx1", 0, suprslam_8x8x4_layout, 0x000, 16 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x4_packed_lsb, 0x000, 16 ) GFXDECODE_ENTRY( "gfx2", 0, suprslam_16x16x4_layout, 0x200, 16 ) GFXDECODE_ENTRY( "gfx3", 0, suprslam_16x16x4_layout, 0x100, 16 ) GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/supstarf.cpp mame-0.243+dfsg.1/src/mame/drivers/supstarf.cpp --- mame-0.242+dfsg.1/src/mame/drivers/supstarf.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/supstarf.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -67,7 +67,7 @@ u8 m_port1_data = 0; bool m_pcs[2]{}; - bool m_latch_select = 0; + bool m_latch_select = false; }; void supstarf_state::main_map(address_map &map) @@ -270,4 +270,4 @@ ROM_LOAD("2532.ic4", 0x0000, 0x1000, CRC(b6ef3c7a) SHA1(aabb6f8569685fc3a917a7bb5ebfcc4b20086b15) BAD_DUMP) // D6 stuck high and probably totally garbage ROM_END -GAME( 1986, supstarf, 0, supstarf, supstarf, supstarf_state, empty_init, ROT0, "Recreativos Franco", "Super Star (Recreativos Franco)", MACHINE_IS_SKELETON_MECHANICAL ) +GAME( 1986, supstarf, 0, supstarf, supstarf, supstarf_state, empty_init, ROT0, "Recreativos Franco", "Super Star (Recreativos Franco)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/surpratk.cpp mame-0.243+dfsg.1/src/mame/drivers/surpratk.cpp --- mame-0.242+dfsg.1/src/mame/drivers/surpratk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/surpratk.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -11,15 +11,151 @@ ***************************************************************************/ #include "emu.h" -#include "includes/surpratk.h" + #include "includes/konamipt.h" +#include "video/k052109.h" +#include "video/k053244_k053245.h" +#include "video/k053251.h" +#include "video/konami_helper.h" +#include "cpu/m6809/konami.h" // for the callback and the FIRQ IRQ definition +#include "machine/bankdev.h" #include "machine/watchdog.h" #include "sound/ymopm.h" + +#include "emupal.h" +#include "screen.h" #include "speaker.h" -void surpratk_state::surpratk_videobank_w(uint8_t data) +namespace { + +class surpratk_state : public driver_device +{ +public: + surpratk_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_bank0000(*this, "bank0000"), + m_k052109(*this, "k052109"), + m_k053244(*this, "k053244"), + m_k053251(*this, "k053251"), + m_palette(*this, "palette"), + m_mainbank(*this, "mainbank") + { } + + void surpratk(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + +private: + // video-related + uint8_t m_layer_colorbase[3]{}; + uint8_t m_sprite_colorbase = 0; + int m_layerpri[3]{}; + + // devices + required_device m_maincpu; + required_device m_bank0000; + required_device m_k052109; + required_device m_k053244; + required_device m_k053251; + required_device m_palette; + + required_memory_bank m_mainbank; + + void videobank_w(uint8_t data); + void _5fc0_w(uint8_t data); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + K05324X_CB_MEMBER(sprite_callback); + K052109_CB_MEMBER(tile_callback); + void banking_callback(uint8_t data); + void bank0000_map(address_map &map); + void main_map(address_map &map); +}; + + +// video + +/*************************************************************************** + + Callbacks for the K052109 + +***************************************************************************/ + +K052109_CB_MEMBER(surpratk_state::tile_callback) +{ + *flags = (*color & 0x80) ? TILE_FLIPX : 0; + *code |= ((*color & 0x03) << 8) | ((*color & 0x10) << 6) | ((*color & 0x0c) << 9) | (bank << 13); + *color = m_layer_colorbase[layer] + ((*color & 0x60) >> 5); +} + +/*************************************************************************** + + Callbacks for the K053245 + +***************************************************************************/ + +K05324X_CB_MEMBER(surpratk_state::sprite_callback) +{ + int pri = 0x20 | ((*color & 0x60) >> 2); + if (pri <= m_layerpri[2]) + *priority = 0; + else if (pri > m_layerpri[2] && pri <= m_layerpri[1]) + *priority = 0xf0; + else if (pri > m_layerpri[1] && pri <= m_layerpri[0]) + *priority = 0xf0 | 0xcc; + else + *priority = 0xf0 | 0xcc | 0xaa; + + *color = m_sprite_colorbase + (*color & 0x1f); +} + + +/*************************************************************************** + + Start the video hardware emulation. + +***************************************************************************/ + +uint32_t surpratk_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + int bg_colorbase = m_k053251->get_palette_index(k053251_device::CI0); + m_sprite_colorbase = m_k053251->get_palette_index(k053251_device::CI1); + m_layer_colorbase[0] = m_k053251->get_palette_index(k053251_device::CI2); + m_layer_colorbase[1] = m_k053251->get_palette_index(k053251_device::CI4); + m_layer_colorbase[2] = m_k053251->get_palette_index(k053251_device::CI3); + + m_k052109->tilemap_update(); + + int layer[3]; + + layer[0] = 0; + m_layerpri[0] = m_k053251->get_priority(k053251_device::CI2); + layer[1] = 1; + m_layerpri[1] = m_k053251->get_priority(k053251_device::CI4); + layer[2] = 2; + m_layerpri[2] = m_k053251->get_priority(k053251_device::CI3); + + konami_sortlayers3(layer, m_layerpri); + + screen.priority().fill(0, cliprect); + bitmap.fill(16 * bg_colorbase, cliprect); + m_k052109->tilemap_draw(screen, bitmap, cliprect, layer[0], 0, 1); + m_k052109->tilemap_draw(screen, bitmap, cliprect, layer[1], 0, 2); + m_k052109->tilemap_draw(screen, bitmap, cliprect, layer[2], 0, 4); + + m_k053244->sprites_draw(bitmap, cliprect, screen.priority()); + return 0; +} + + +// machine + +void surpratk_state::videobank_w(uint8_t data) { if (data & 0xf8) logerror("%s: videobank = %02x\n", machine().describe_context(), data); @@ -33,10 +169,10 @@ m_bank0000->set_bank(BIT(data, 0)); } -void surpratk_state::surpratk_5fc0_w(uint8_t data) +void surpratk_state::_5fc0_w(uint8_t data) { if ((data & 0xf4) != 0x10) - logerror("%04x: 3fc0 = %02x\n",m_maincpu->pc(),data); + logerror("%04x: 3fc0 = %02x\n", m_maincpu->pc(), data); // bit 0/1 = coin counters machine().bookkeeping().coin_counter_w(0, data & 0x01); @@ -51,11 +187,11 @@ /********************************************/ -void surpratk_state::surpratk_map(address_map &map) +void surpratk_state::main_map(address_map &map) { map(0x0000, 0x07ff).m(m_bank0000, FUNC(address_map_bank_device::amap8)); map(0x0800, 0x1fff).ram(); - map(0x2000, 0x3fff).bankr("bank1"); /* banked ROM */ + map(0x2000, 0x3fff).bankr(m_mainbank); map(0x4000, 0x7fff).rw(m_k052109, FUNC(k052109_device::read), FUNC(k052109_device::write)); map(0x5f8c, 0x5f8c).portr("P1"); map(0x5f8d, 0x5f8d).portr("P2"); @@ -64,9 +200,9 @@ map(0x5f90, 0x5f90).portr("DSW2"); map(0x5fa0, 0x5faf).rw(m_k053244, FUNC(k05324x_device::k053244_r), FUNC(k05324x_device::k053244_w)); map(0x5fb0, 0x5fbf).w(m_k053251, FUNC(k053251_device::write)); - map(0x5fc0, 0x5fc0).r("watchdog", FUNC(watchdog_timer_device::reset_r)).w(FUNC(surpratk_state::surpratk_5fc0_w)); + map(0x5fc0, 0x5fc0).r("watchdog", FUNC(watchdog_timer_device::reset_r)).w(FUNC(surpratk_state::_5fc0_w)); + map(0x5fc4, 0x5fc4).w(FUNC(surpratk_state::videobank_w)); map(0x5fd0, 0x5fd1).w("ymsnd", FUNC(ym2151_device::write)); - map(0x5fc4, 0x5fc4).w(FUNC(surpratk_state::surpratk_videobank_w)); map(0x8000, 0xffff).rom().region("maincpu", 0x38000); } @@ -134,8 +270,8 @@ void surpratk_state::machine_start() { - membank("bank1")->configure_entries(0, 32, memregion("maincpu")->base(), 0x2000); - membank("bank1")->set_entry(0); + m_mainbank->configure_entries(0, 32, memregion("maincpu")->base(), 0x2000); + m_mainbank->set_entry(0); save_item(NAME(m_sprite_colorbase)); save_item(NAME(m_layer_colorbase)); @@ -158,27 +294,27 @@ void surpratk_state::banking_callback(uint8_t data) { // logerror("%s: setlines %02x\n", machine().describe_context(), data); - membank("bank1")->set_entry(data & 0x1f); + m_mainbank->set_entry(data & 0x1f); } void surpratk_state::surpratk(machine_config &config) { - /* basic machine hardware */ - KONAMI(config, m_maincpu, XTAL(24'000'000)/2/4); /* 053248, the clock input is 12MHz, and internal CPU divider of 4 */ - m_maincpu->set_addrmap(AS_PROGRAM, &surpratk_state::surpratk_map); + // basic machine hardware + KONAMI(config, m_maincpu, XTAL(24'000'000) / 2 / 4); // 053248, the clock input is 12MHz, and internal CPU divider of 4 + m_maincpu->set_addrmap(AS_PROGRAM, &surpratk_state::main_map); m_maincpu->line().set(FUNC(surpratk_state::banking_callback)); ADDRESS_MAP_BANK(config, "bank0000").set_map(&surpratk_state::bank0000_map).set_options(ENDIANNESS_BIG, 8, 13, 0x800); WATCHDOG_TIMER(config, "watchdog"); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(60); screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); screen.set_size(64*8, 32*8); screen.set_visarea(12*8, (64-12)*8-1, 2*8, 30*8-1); - screen.set_screen_update(FUNC(surpratk_state::screen_update_surpratk)); + screen.set_screen_update(FUNC(surpratk_state::screen_update)); screen.set_palette(m_palette); PALETTE(config, m_palette).set_format(palette_device::xBGR_555, 2048); @@ -196,7 +332,7 @@ K053251(config, m_k053251, 0); - /* sound hardware */ + // sound hardware SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); @@ -216,47 +352,50 @@ ROM_START( suratk ) - ROM_REGION( 0x40000, "maincpu", 0 ) /* code + banked roms */ + ROM_REGION( 0x40000, "maincpu", 0 ) // code + banked roms ROM_LOAD( "911j01.f5", 0x00000, 0x20000, CRC(1e647881) SHA1(241e421d5599ebd9fcfb8be9c48dfd3b4c671958) ) ROM_LOAD( "911k02.h5", 0x20000, 0x20000, CRC(ef10e7b6) SHA1(0b41a929c0c579d688653a8d90dd6b40db12cfb3) ) - ROM_REGION( 0x080000, "k052109", 0 ) /* tiles */ + ROM_REGION( 0x080000, "k052109", 0 ) // tiles ROM_LOAD32_WORD( "911d05.bin", 0x000000, 0x040000, CRC(308d2319) SHA1(521d2a72fecb094e2c2f23b535f0b527886b4d3a) ) ROM_LOAD32_WORD( "911d06.bin", 0x000002, 0x040000, CRC(91cc9b32) SHA1(e05b7bbff30f24fe6f009560410f5e90bb118692) ) - ROM_REGION( 0x080000, "k053244", 0 ) /* graphics */ - ROM_LOAD32_WORD( "911d03.bin", 0x000000, 0x040000, CRC(e34ff182) SHA1(075ca7a91c843bdac7da21ddfcd43f7a043a09b6) ) /* sprites */ - ROM_LOAD32_WORD( "911d04.bin", 0x000002, 0x040000, CRC(20700bd2) SHA1(a2fa4a3ee28c1542cdd798907a9ece249aadff0a) ) /* sprites */ + ROM_REGION( 0x080000, "k053244", 0 ) // sprites + ROM_LOAD32_WORD( "911d03.bin", 0x000000, 0x040000, CRC(e34ff182) SHA1(075ca7a91c843bdac7da21ddfcd43f7a043a09b6) ) + ROM_LOAD32_WORD( "911d04.bin", 0x000002, 0x040000, CRC(20700bd2) SHA1(a2fa4a3ee28c1542cdd798907a9ece249aadff0a) ) ROM_END ROM_START( suratka ) - ROM_REGION( 0x48000, "maincpu", 0 ) /* code + banked roms */ + ROM_REGION( 0x48000, "maincpu", 0 ) // code + banked roms ROM_LOAD( "911j01.f5", 0x00000, 0x20000, CRC(1e647881) SHA1(241e421d5599ebd9fcfb8be9c48dfd3b4c671958) ) ROM_LOAD( "911l02.h5", 0x20000, 0x20000, CRC(11db8288) SHA1(09fe187855172ebf0c57f561cce7f41e47f53114) ) - ROM_REGION( 0x080000, "k052109", 0 ) /* tiles */ + ROM_REGION( 0x080000, "k052109", 0 ) // tiles ROM_LOAD32_WORD( "911d05.bin", 0x000000, 0x040000, CRC(308d2319) SHA1(521d2a72fecb094e2c2f23b535f0b527886b4d3a) ) ROM_LOAD32_WORD( "911d06.bin", 0x000002, 0x040000, CRC(91cc9b32) SHA1(e05b7bbff30f24fe6f009560410f5e90bb118692) ) - ROM_REGION( 0x080000, "k053244", 0 ) /* graphics */ - ROM_LOAD32_WORD( "911d03.bin", 0x000000, 0x040000, CRC(e34ff182) SHA1(075ca7a91c843bdac7da21ddfcd43f7a043a09b6) ) /* sprites */ - ROM_LOAD32_WORD( "911d04.bin", 0x000002, 0x040000, CRC(20700bd2) SHA1(a2fa4a3ee28c1542cdd798907a9ece249aadff0a) ) /* sprites */ + ROM_REGION( 0x080000, "k053244", 0 ) // sprites + ROM_LOAD32_WORD( "911d03.bin", 0x000000, 0x040000, CRC(e34ff182) SHA1(075ca7a91c843bdac7da21ddfcd43f7a043a09b6) ) + ROM_LOAD32_WORD( "911d04.bin", 0x000002, 0x040000, CRC(20700bd2) SHA1(a2fa4a3ee28c1542cdd798907a9ece249aadff0a) ) ROM_END ROM_START( suratkj ) - ROM_REGION( 0x40000, "maincpu", 0 ) /* code + banked roms + palette RAM */ + ROM_REGION( 0x40000, "maincpu", 0 ) // code + banked roms ROM_LOAD( "911m01.f5", 0x00000, 0x20000, CRC(ee5b2cc8) SHA1(4b05f7ba4e804a3bccb41fe9d3258cbcfe5324aa) ) ROM_LOAD( "911m02.h5", 0x20000, 0x20000, CRC(5d4148a8) SHA1(4fa5947db777b4c742775d588dea38758812a916) ) - ROM_REGION( 0x080000, "k052109", 0 ) /* tiles */ + ROM_REGION( 0x080000, "k052109", 0 ) // tiles ROM_LOAD32_WORD( "911d05.bin", 0x000000, 0x040000, CRC(308d2319) SHA1(521d2a72fecb094e2c2f23b535f0b527886b4d3a) ) ROM_LOAD32_WORD( "911d06.bin", 0x000002, 0x040000, CRC(91cc9b32) SHA1(e05b7bbff30f24fe6f009560410f5e90bb118692) ) - ROM_REGION( 0x080000, "k053244", 0 ) /* graphics */ - ROM_LOAD32_WORD( "911d03.bin", 0x000000, 0x040000, CRC(e34ff182) SHA1(075ca7a91c843bdac7da21ddfcd43f7a043a09b6) ) /* sprites */ - ROM_LOAD32_WORD( "911d04.bin", 0x000002, 0x040000, CRC(20700bd2) SHA1(a2fa4a3ee28c1542cdd798907a9ece249aadff0a) ) /* sprites */ + ROM_REGION( 0x080000, "k053244", 0 ) // sprites + ROM_LOAD32_WORD( "911d03.bin", 0x000000, 0x040000, CRC(e34ff182) SHA1(075ca7a91c843bdac7da21ddfcd43f7a043a09b6) ) + ROM_LOAD32_WORD( "911d04.bin", 0x000002, 0x040000, CRC(20700bd2) SHA1(a2fa4a3ee28c1542cdd798907a9ece249aadff0a) ) ROM_END +} // anonymous namespace + + /*************************************************************************** Game driver(s) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/sys1121.cpp mame-0.243+dfsg.1/src/mame/drivers/sys1121.cpp --- mame-0.242+dfsg.1/src/mame/drivers/sys1121.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/sys1121.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -10,6 +10,7 @@ #include "emu.h" #include "bus/vme/vme_mvme120.h" +#include "bus/vme/vme_smvme2000.h" #include "logmacro.h" namespace @@ -29,25 +30,26 @@ static INPUT_PORTS_START(sys1121) INPUT_PORTS_END - static void mvme120_vme_cards(device_slot_interface &device) + static void sys1121_vme_cards(device_slot_interface &device) { device.option_add("mvme120", VME_MVME120); device.option_add("mvme121", VME_MVME121); device.option_add("mvme122", VME_MVME122); device.option_add("mvme123", VME_MVME123); + device.option_add("smvme2000", VME_SMVME2000); } void sys1121_state::sys1121(machine_config &config) { VME(config, "vme", 0); - VME_SLOT(config, "slot1", mvme120_vme_cards, "mvme120", 1, "vme"); - VME_SLOT(config, "slot2", mvme120_vme_cards, nullptr, 2, "vme"); - VME_SLOT(config, "slot3", mvme120_vme_cards, nullptr, 3, "vme"); - VME_SLOT(config, "slot4", mvme120_vme_cards, nullptr, 4, "vme"); - VME_SLOT(config, "slot5", mvme120_vme_cards, nullptr, 5, "vme"); - VME_SLOT(config, "slot6", mvme120_vme_cards, nullptr, 6, "vme"); - VME_SLOT(config, "slot7", mvme120_vme_cards, nullptr, 7, "vme"); - VME_SLOT(config, "slot8", mvme120_vme_cards, nullptr, 8, "vme"); + VME_SLOT(config, "slot1", sys1121_vme_cards, "mvme120", 1, "vme"); + VME_SLOT(config, "slot2", sys1121_vme_cards, nullptr, 2, "vme"); + VME_SLOT(config, "slot3", sys1121_vme_cards, nullptr, 3, "vme"); + VME_SLOT(config, "slot4", sys1121_vme_cards, nullptr, 4, "vme"); + VME_SLOT(config, "slot5", sys1121_vme_cards, nullptr, 5, "vme"); + VME_SLOT(config, "slot6", sys1121_vme_cards, nullptr, 6, "vme"); + VME_SLOT(config, "slot7", sys1121_vme_cards, nullptr, 7, "vme"); + VME_SLOT(config, "slot8", sys1121_vme_cards, nullptr, 8, "vme"); } // This is a VME chassis so any ROMs are contained in the cards. diff -Nru mame-0.242+dfsg.1/src/mame/drivers/system16.cpp mame-0.243+dfsg.1/src/mame/drivers/system16.cpp --- mame-0.242+dfsg.1/src/mame/drivers/system16.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/system16.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -2038,19 +2038,8 @@ * *************************************/ -static const gfx_layout charlayout = -{ - 8,8, - RGN_FRAC(1,3), - 3, - { RGN_FRAC(2,3), RGN_FRAC(1,3), RGN_FRAC(0,3) }, - { 0, 1, 2, 3, 4, 5, 6, 7 }, - { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, - 8*8 -}; - GFXDECODE_START( gfx_sys16 ) - GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 1024 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x3_planar, 0, 1024 ) GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/taito.cpp mame-0.243+dfsg.1/src/mame/drivers/taito.cpp --- mame-0.242+dfsg.1/src/mame/drivers/taito.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/taito.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1200,49 +1200,49 @@ GAME(198?, taitest, 0, taito, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Taito Test Fixture", MACHINE_IS_SKELETON_MECHANICAL ) // dac (sintetizador) -GAME(1979, shock, 0, shock, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Shock", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1980, obaoba, 0, taito, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Oba-Oba (set 1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1980, obaoba1, obaoba, taito, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Oba-Oba (set 2)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1980, obaobao, obaoba, taito1, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Oba-Oba (old hardware)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1980, drakor, 0, taito, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Drakor", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1980, meteort, 0, taito, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Meteor (Taito)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1981, sureshop, 0, taito, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Sure Shot (Pinball)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1981, cosmic, 0, taito, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Cosmic", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1982, gemini2k, 0, taito, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Gemini 2000 (set 1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1982, gemini2k1, gemini2k, taito, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Gemini 2000 (set 2)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1982, vortexp, 0, taito, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Vortex (Pinball)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1982, zarza, 0, taito, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Zarza (set 1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1982, zarza1, zarza, taito, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Zarza (set 2)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1982, sharkt, 0, taito2, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Shark (Taito)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1982, stest, 0, taito, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Speed Test", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1982, lunelle, 0, taito2, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Lunelle", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1980, rally, 0, taito, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Rally", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1981, football, 0, shock, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Football", MACHINE_IS_SKELETON_MECHANICAL ) +GAME(1979, shock, 0, shock, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Shock", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1980, obaoba, 0, taito, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Oba-Oba (set 1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1980, obaoba1, obaoba, taito, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Oba-Oba (set 2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1980, obaobao, obaoba, taito1, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Oba-Oba (old hardware)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1980, drakor, 0, taito, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Drakor", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1980, meteort, 0, taito, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Meteor (Taito)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1981, sureshop, 0, taito, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Sure Shot (Pinball)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1981, cosmic, 0, taito, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Cosmic", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1982, gemini2k, 0, taito, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Gemini 2000 (set 1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1982, gemini2k1, gemini2k, taito, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Gemini 2000 (set 2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1982, vortexp, 0, taito, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Vortex (Pinball)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1982, zarza, 0, taito, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Zarza (set 1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1982, zarza1, zarza, taito, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Zarza (set 2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1982, sharkt, 0, taito2, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Shark (Taito)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1982, stest, 0, taito, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Speed Test", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1982, lunelle, 0, taito2, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Lunelle", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1980, rally, 0, taito, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Rally", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1981, football, 0, shock, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Football", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // dac and vox (sintevox) -GAME(1981, fireact, 0, taito4, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Fire Action", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1981, cavnegro, 0, taito4, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Cavaleiro Negro (set 1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1981, cavnegro1, cavnegro, taito4, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Cavaleiro Negro (set 2)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1981, cavnegro2, cavnegro, taito4, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Cavaleiro Negro (set 3)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1981, ladylukt, 0, taito4, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Lady Luck (Taito)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(198?, vegast, ladylukt, taito4, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Vegas (Taito)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1982, titan, 0, taito4, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Titan (set 1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1982, titan1, titan, taito4, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Titan (set 2)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1982, hawkman, 0, taito4, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Hawkman (set 1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1982, hawkman1, hawkman, taito4, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Hawkman (set 2)", MACHINE_IS_SKELETON_MECHANICAL ) +GAME(1981, fireact, 0, taito4, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Fire Action", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1981, cavnegro, 0, taito4, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Cavaleiro Negro (set 1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1981, cavnegro1, cavnegro, taito4, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Cavaleiro Negro (set 2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1981, cavnegro2, cavnegro, taito4, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Cavaleiro Negro (set 3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1981, ladylukt, 0, taito4, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Lady Luck (Taito)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(198?, vegast, ladylukt, taito4, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Vegas (Taito)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1982, titan, 0, taito4, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Titan (set 1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1982, titan1, titan, taito4, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Titan (set 2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1982, hawkman, 0, taito4, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Hawkman (set 1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1982, hawkman1, hawkman, taito4, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Hawkman (set 2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // dac and ay -GAME(1982, snake, 0, taito2, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Snake Machine", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(198?, voleybal, 0, taito2, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Volley", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1984, mrblack, 0, taito2, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Mr. Black (set 1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1985, mrblack1, mrblack, taito2, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Mr. Black (set 2)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1985, sshuttle, 0, taito2, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Space Shuttle (Taito) (set 1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1985, sshuttle1, sshuttle, taito2, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Space Shuttle (Taito) (set 2)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(198?, polar, 0, taito2, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Polar Explorer", MACHINE_IS_SKELETON_MECHANICAL ) +GAME(1982, snake, 0, taito2, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Snake Machine", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(198?, voleybal, 0, taito2, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Volley", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1984, mrblack, 0, taito2, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Mr. Black (set 1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1985, mrblack1, mrblack, taito2, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Mr. Black (set 2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1985, sshuttle, 0, taito2, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Space Shuttle (Taito) (set 1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1985, sshuttle1, sshuttle, taito2, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Space Shuttle (Taito) (set 2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(198?, polar, 0, taito2, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Polar Explorer", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // dac, vox and ay -GAME(1982, gork, 0, taito6, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Gork", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(198?, fireactd, 0, taito6, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Fire Action Deluxe", MACHINE_IS_SKELETON_MECHANICAL ) +GAME(1982, gork, 0, taito6, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Gork", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(198?, fireactd, 0, taito6, taito, taito_8080, empty_init, ROT0, "Taito do Brasil", "Fire Action Deluxe", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // different hardware -GAME(198?, mrblkz80, mrblack, taitoz, taito, mrblkz80_state, empty_init, ROT0, "Taito do Brasil", "Mr. Black (Z-80 CPU)", MACHINE_IS_SKELETON_MECHANICAL ) +GAME(198?, mrblkz80, mrblack, taitoz, taito, mrblkz80_state, empty_init, ROT0, "Taito do Brasil", "Mr. Black (Z-80 CPU)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/taitojc.cpp mame-0.243+dfsg.1/src/mame/drivers/taitojc.cpp --- mame-0.242+dfsg.1/src/mame/drivers/taitojc.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/taitojc.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1597,6 +1597,53 @@ ROM_START( dendego ) ROM_REGION( 0x200000, "maincpu", 0 ) /* 68040 code */ + ROM_LOAD32_BYTE( "e35-21-1.ic36", 0x000000, 0x80000, CRC(47037231) SHA1(e53b854a3f8cf2eed68500f83f3cdf08942a2578) ) + ROM_LOAD32_BYTE( "e35-22-1.ic37", 0x000001, 0x80000, CRC(559fdd43) SHA1(5f0b8b7ea092f15e492d1257f28e4137f495e9d2) ) + ROM_LOAD32_BYTE( "e35-23-1.ic38", 0x000002, 0x80000, CRC(e457f024) SHA1(9e0eb40c877580be5a09fed48bacf60c3b0ed0cd) ) + ROM_LOAD32_BYTE( "e35-24-1.ic39", 0x000003, 0x80000, CRC(880c3b16) SHA1(d18379702f1efc4d0889f76d2d715ada0ab7695e) ) + + ROM_REGION( 0x180000, "taito_en:audiocpu", 0 ) /* 68000 Code */ + ROM_LOAD16_BYTE( "e35-25.ic30", 0x100001, 0x40000, CRC(8104de13) SHA1(e518fbaf91704cf5cb8ffbb4833e3adba8c18658) ) + ROM_LOAD16_BYTE( "e35-26.ic31", 0x100000, 0x40000, CRC(61821cc9) SHA1(87cd5bd3bb22c9f4ca4b6d96f75434d48418321b) ) + + ROM_REGION( 0x4000, "dsp", ROMREGION_ERASE00 ) /* TMS320C51 internal rom */ + ROM_LOAD16_WORD( "e07-11.ic29", 0x0000, 0x4000, NO_DUMP ) + + ROM_REGION( 0x010000, "sub", 0 ) /* MC68HC11M0 code */ + ROM_LOAD( "e17-23.ic65", 0x000000, 0x010000, CRC(80ac1428) SHA1(5a2a1e60a11ecdb8743c20ddacfb61f9fd00f01c) ) + + ROM_REGION32_BE( 0x1800000, "maingfx", 0 ) + ROM_LOAD32_WORD_SWAP( "e35-05.ic9", 0x0800000, 0x200000, CRC(a94486c5) SHA1(c3f869aa0557411f747038a1e0ed6eedcf91fda5) ) + ROM_LOAD32_WORD_SWAP( "e35-13.ic22", 0x0800002, 0x200000, CRC(2dc9dff1) SHA1(bc7ad64bc359f18a065e36749cc29c75e52202e2) ) + ROM_LOAD32_WORD_SWAP( "e35-06.ic10", 0x0c00000, 0x200000, CRC(cf328021) SHA1(709ce80f9338637172dbf4e9adcacdb3e5b4ccdb) ) + ROM_LOAD32_WORD_SWAP( "e35-14.ic23", 0x0c00002, 0x200000, CRC(cab50364) SHA1(e3272f844ecadfd63a1e3c965526a851f8cde94d) ) + ROM_LOAD32_WORD_SWAP( "e35-07.ic11", 0x1000000, 0x200000, CRC(a88a5a86) SHA1(a4a393fe9df3654e41d32e015ca3977d13206dfe) ) + ROM_LOAD32_WORD_SWAP( "e35-15.ic24", 0x1000002, 0x200000, CRC(aea86b35) SHA1(092f34f844fc6a779a6f18c03d44a9d39a101373) ) + ROM_LOAD32_WORD_SWAP( "e35-08.ic12", 0x1400000, 0x200000, CRC(99425ff6) SHA1(3bd6fe7204dece55459392170b42d4c6a9d3ef5b) ) + ROM_LOAD32_WORD_SWAP( "e35-16.ic25", 0x1400002, 0x200000, CRC(161481b6) SHA1(cc3c2939ac8911c197e9930580d316066f345772) ) + + ROM_REGION16_LE( 0x1000000, "dspgfx", 0 ) /* only accessible to the TMS */ + ROM_LOAD( "e35-01.ic5", 0x0000000, 0x200000, CRC(bd1975cb) SHA1(a08c6f4a84f9d4c2a5aa67cc2045aedd4580b8dc) ) + ROM_LOAD( "e35-02.ic6", 0x0200000, 0x200000, CRC(e5caa459) SHA1(c38d795b96fff193223cd3df9f51ebdc2971b719) ) + ROM_LOAD( "e35-03.ic7", 0x0400000, 0x200000, CRC(86ea5bcf) SHA1(1cee7f677b786b2fa9f50e723decd08cd69fbdef) ) + ROM_LOAD( "e35-04.ic8", 0x0600000, 0x200000, CRC(afc07c36) SHA1(f3f7b04766a9a2c8b298e1692aea24abc7001432) ) + ROM_LOAD( "e35-09.ic18", 0x0800000, 0x200000, CRC(be18ddf1) SHA1(d4fe26e427244c5b421b6421ff3bf9af303673d5) ) + ROM_LOAD( "e35-10.ic19", 0x0a00000, 0x200000, CRC(44ea9474) SHA1(161ff94b31c3dc2fa4b1e556ed62624147687443) ) + ROM_LOAD( "e35-11.ic20", 0x0c00000, 0x200000, CRC(dc8f5e88) SHA1(e311252db8a7232a5325a3eff5c1890d20bd3f8f) ) + ROM_LOAD( "e35-12.ic21", 0x0e00000, 0x200000, CRC(039b604c) SHA1(7e394e7cddc6bf42f3834d5331203e8496597a90) ) + + ROM_REGION( 0x40000, "oki", 0 ) /* train board, OKI6295 sound samples */ + ROM_LOAD( "e35-28.trn", 0x000000, 0x040000, CRC(d1b571c1) SHA1(cac7d3f0285544fe36b8b744edfbac0190cdecab) ) + + ROM_REGION16_BE( 0x1000000, "taito_en:ensoniq", ROMREGION_ERASE00 ) + ROM_LOAD16_BYTE( "e35-17.ic32", 0x000000, 0x200000, CRC(3bc23aa1) SHA1(621e0f2f5f3dbd7d7ce05c9cd317958c361c1c26) ) + ROM_LOAD16_BYTE( "e35-18.ic33", 0x400000, 0x200000, CRC(a084d3aa) SHA1(18ea39366006e362e16d6732ce3e79cd3bfa041e) ) + ROM_LOAD16_BYTE( "e35-19.ic34", 0x800000, 0x200000, CRC(ebe2dcef) SHA1(16ae41e0f3bb242cbc2922f53cacbd99961a3f97) ) + ROM_LOAD16_BYTE( "e35-20.ic35", 0xc00000, 0x200000, CRC(a1d4b30d) SHA1(e02f613b93d3b3ee1eb23f5b7f62c5448ed3966d) ) +ROM_END + +ROM_START( dendegoa ) + ROM_REGION( 0x200000, "maincpu", 0 ) /* 68040 code */ ROM_LOAD32_BYTE( "e35-21.ic36", 0x000000, 0x80000, CRC(bc70ca97) SHA1(724a24da9d6f163c26e7528ee2c15bd06f2c4382) ) ROM_LOAD32_BYTE( "e35-22.ic37", 0x000001, 0x80000, CRC(83b17de8) SHA1(538ddc16727e08e9a2a8ff6b4f030dc044993aa0) ) ROM_LOAD32_BYTE( "e35-23.ic38", 0x000002, 0x80000, CRC(1da4acd6) SHA1(2ce11c5f37287526bb1d39185f793d79fc73d5b5) ) @@ -2124,7 +2171,8 @@ GAME( 1996, sidebs, 0, taitojc, sidebs, taitojc_state, init_taitojc, ROT0, "Taito", "Side by Side (Ver 2.7 J)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_TIMING | MACHINE_NODEVICE_LAN ) // SIDE BY SIDE VER 2.7 J 1996/10/11 14:54:10 GAME( 1996, sidebsja, sidebs, taitojc, sidebs, taitojc_state, init_taitojc, ROT0, "Taito", "Side by Side (Ver 2.6 J)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_TIMING | MACHINE_NODEVICE_LAN ) // SIDE BY SIDE VER 2.6 J 1996/ 7/ 1 18:41:51 GAME( 1996, sidebsjb, sidebs, taitojc, sidebs, taitojc_state, init_taitojc, ROT0, "Taito", "Side by Side (Ver 2.5 J)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_TIMING | MACHINE_NODEVICE_LAN ) // SIDE BY SIDE VER 2.5 J 1996/ 6/20 18:13:14 -GAMEL(1996, dendego, 0, dendego, dendego, taitojc_state, init_taitojc, ROT0, "Taito", "Densha de GO! (Ver 2.2 J)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_TIMING, layout_dendego ) // DENSYA DE GO VER 2.2 J 1997/ 2/ 4 12:00:28 +GAMEL(1996, dendego, 0, dendego, dendego, taitojc_state, init_taitojc, ROT0, "Taito", "Densha de GO! (Ver 2.3 J)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_TIMING, layout_dendego ) // DENSYA DE GO VER 2.3 J 1997/ 3/10 20:49:44 +GAMEL(1996, dendegoa, dendego, dendego, dendego, taitojc_state, init_taitojc, ROT0, "Taito", "Densha de GO! (Ver 2.2 J)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_TIMING, layout_dendego ) // DENSYA DE GO VER 2.2 J 1997/ 2/ 4 12:00:28 GAMEL(1996, dendegox, dendego, dendego, dendego, taitojc_state, init_taitojc, ROT0, "Taito", "Densha de GO! EX (Ver 2.4 J)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_TIMING, layout_dendego ) // DENSYA DE GO VER 2.4 J 1997/ 4/18 13:38:34 GAME( 1997, sidebs2, 0, taitojc, sidebs, taitojc_state, init_taitojc, ROT0, "Taito", "Side by Side 2 (Ver 2.6 OK)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_TIMING | MACHINE_NODEVICE_LAN ) // SIDE BY SIDE2 VER 2.6 OK 1997/ 6/ 4 17:27:37 GAME( 1997, sidebs2u, sidebs2, taitojc, sidebs, taitojc_state, init_taitojc, ROT0, "Taito", "Side by Side 2 (Ver 2.6 A)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_TIMING | MACHINE_NODEVICE_LAN ) // SIDE BY SIDE2 VER 2.6 A 1997/ 6/19 09:39:22 diff -Nru mame-0.242+dfsg.1/src/mame/drivers/taitopjc.cpp mame-0.243+dfsg.1/src/mame/drivers/taitopjc.cpp --- mame-0.242+dfsg.1/src/mame/drivers/taitopjc.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/taitopjc.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -160,21 +160,21 @@ TILEMAP_MAPPER_MEMBER(tile_scan_layer0); TILEMAP_MAPPER_MEMBER(tile_scan_layer1); - uint16_t m_dsp_ram[0x1000]; - uint16_t m_io_share_ram[0x2000]; + uint16_t m_dsp_ram[0x1000]{}; + uint16_t m_io_share_ram[0x2000]{}; std::unique_ptr m_screen_ram; std::unique_ptr m_pal_ram; - tilemap_t *m_tilemap[2]; + tilemap_t *m_tilemap[2]{}; - uint32_t m_video_address; + uint32_t m_video_address = 0; - uint32_t m_dsp_rom_address; - int m_scroll_x; - int m_scroll_y; + uint32_t m_dsp_rom_address = 0; + int m_scroll_x = 0; + int m_scroll_y = 0; - uint32_t m_tlcs_sound_ptr; + uint32_t m_tlcs_sound_ptr = 0; void mn10200_map(address_map &map); void ppc603e_mem(address_map &map); diff -Nru mame-0.242+dfsg.1/src/mame/drivers/taitowlf.cpp mame-0.243+dfsg.1/src/mame/drivers/taitowlf.cpp --- mame-0.242+dfsg.1/src/mame/drivers/taitowlf.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/taitowlf.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -6,6 +6,21 @@ Three board system consisting of a P5TX-LA PC motherboard, a Taito main board and a rom board. +TODO: +- program ROM is read via parallel port (for offset write, encrypted) and game port. + It's the first thing that the BIOS does at boot (cfr. accesses at $20x), + if these ports are fed with proper values then it sets up PnP then tries a DMA ch. 3 transfer, + otherwise it just boots the normal P5TX-LA bootstrap sequence. + cfr. PC=e850b, PC=e4fc8, PC=fd84a (reading I/O $0006). +- Above needs to be converted to a proper EISA device, program ROM board is connected on MB thru the only + available slot option; +- Convert North/South bridge to newest PCI model; +- Hookup Voodoo to PCI root; +- Convert P5TX-LA to a proper stand-alone driver; +- According to manual hold A+B+service button for 10 seconds for entering test mode during initial bootup + sequence. Board and input test menu doesn't seem to have a dedicated test mode switch. This statement needs + verification once we get there; + Hardware configuration: P5TX-LA Motherboard: @@ -41,11 +56,6 @@ -AMD M4-128N/64 CPLD stamped 'E58-05' -Program, Sound roms -TODO: -- program ROM is read via parallel port (for offset write, encrypted) and game port!? -- Emulation of the entire Taito Wolf main board which plugs into the PC motherboard's only PCI slot. -- PCI comms between both boards have yet to be understood. - */ #include "emu.h" @@ -404,11 +414,11 @@ ROM_CONTINUE( 0x0001, 0x4000 ) #endif - ROM_REGION(0x400000, "user3", 0) // Program ROM + ROM_REGION(0x400000, "user3", 0) // Program ROM (FAT12) ROM_LOAD("u1.bin", 0x000000, 0x200000, CRC(8f4c09cb) SHA1(0969a92fec819868881683c580f9e01cbedf4ad2)) ROM_LOAD("u2.bin", 0x200000, 0x200000, CRC(59881781) SHA1(85ff074ab2a922eac37cf96f0bf153a2dac55aa4)) - ROM_REGION(0x4000000, "user4", 0) // Data ROM + ROM_REGION(0x4000000, "user4", 0) // Data ROM (FAT12) ROM_LOAD("e59-01.u20", 0x0000000, 0x800000, CRC(701d3a9a) SHA1(34c9f34f4da34bb8eed85a4efd1d9eea47a21d77) ) ROM_LOAD("e59-02.u23", 0x0800000, 0x800000, CRC(626df682) SHA1(35bb4f91201734ce7ccdc640a75030aaca3d1151) ) ROM_LOAD("e59-03.u26", 0x1000000, 0x800000, CRC(74e4efde) SHA1(630235c2e4a11f615b5f3b8c93e1e645da09eefe) ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/taotaido.cpp mame-0.243+dfsg.1/src/mame/drivers/taotaido.cpp --- mame-0.242+dfsg.1/src/mame/drivers/taotaido.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/taotaido.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -328,22 +328,9 @@ INPUT_PORTS_END -static const gfx_layout layout = -{ - 16,16, - RGN_FRAC(1,1), - 4, - { 0, 1, 2, 3 }, - { 1*4, 0*4, 3*4, 2*4, 5*4, 4*4, 7*4, 6*4, - 9*4, 8*4, 11*4, 10*4, 13*4, 12*4, 15*4, 14*4 }, - { 0*64, 1*64, 2*64, 3*64, 4*64, 5*64, 6*64, 7*64, - 8*64, 9*64, 10*64, 11*64, 12*64, 13*64, 14*64, 15*64 }, - 128*8 -}; - static GFXDECODE_START( gfx_taotaido ) - GFXDECODE_ENTRY( "gfx1", 0, layout, 0x000, 256 ) /* sprites */ - GFXDECODE_ENTRY( "gfx2", 0, layout, 0x300, 256 ) /* bg tiles */ + GFXDECODE_ENTRY( "gfx1", 0, gfx_16x16x4_packed_lsb, 0x000, 256 ) /* sprites */ + GFXDECODE_ENTRY( "gfx2", 0, gfx_16x16x4_packed_lsb, 0x300, 256 ) /* bg tiles */ GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/tasman.cpp mame-0.243+dfsg.1/src/mame/drivers/tasman.cpp --- mame-0.242+dfsg.1/src/mame/drivers/tasman.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/tasman.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -820,6 +820,60 @@ ROM_END + +ROM_START( thequest ) // all SUMs on labels match but for ROM position 17 which has SUM 3949 on label but dump has 5dcb. However it passes the boot checks. + ROM_REGION( 0x100000, "maincpu", 0 ) + ROM_LOAD32_WORD_SWAP( "qstn2a20.l.2", 0x00002, 0x080000, CRC(2ae75e07) SHA1(5137ecde0fba3011854a34642b6f7dc8a2464612) ) // 1st and 2nd half identical, but SUM matches and passes boot check + ROM_LOAD32_WORD_SWAP( "qstn2a20.h.1", 0x00000, 0x080000, CRC(03121033) SHA1(fe8ad20a35eb604c8a4c280e66d8d77b3539c7a7) ) // 1st and 2nd half identical, but SUM matches and passes boot check + + ROM_REGION( 0x80000, "sndcpu", 0 ) // BADADDR --xxxxxxxxxxxxxxx, but SUM matches and passes boot check + ROM_LOAD16_WORD_SWAP( "n12prog.ifu.41", 0x0000, 0x020000, CRC(adac17b1) SHA1(8e92dfd112f15ee0dbca215e265f479fb19d4be4) ) // same as dragsphr, horses4c, ivorytsk, vikingt + + ROM_REGION( 0x100000, "k056832", 0 ) // 8x8x8 tiles + ROM_LOAD16_BYTE( "qst11_l1.vrm.21", 0x00000, 0x080000, CRC(bc336662) SHA1(145fc5725bbdce1f25f276221edf52324684876c) ) + ROM_LOAD16_BYTE( "qst11_h1.vrm.23", 0x00001, 0x080000, CRC(cca0bb57) SHA1(291fd4bb87ca3417da2dd5eb987f836420d75683) ) + + ROM_REGION( 0x200000, "k055673", 0 ) // 16x16x8 sprites + ROM_LOAD64_WORD( "qst11ll1.obj.17", 0x000000, 0x080000, CRC(bc2b43be) SHA1(dfa48d42d3d80849d6c3dad8e153fee650a32b1a) ) + ROM_LOAD64_WORD( "qst11lm1.obj.15", 0x000002, 0x080000, CRC(0e036d7b) SHA1(c39ae7180d7e5562cb0305ce551425dbabd42429) ) + ROM_LOAD64_WORD( "qst11hm1.obj.13", 0x000004, 0x080000, CRC(3e3a490c) SHA1(1f3c25bbca0d0ae1f7ce8c47d3f75e311fc68e22) ) + ROM_LOAD64_WORD( "qst11hh1.obj.11", 0x000006, 0x080000, CRC(d9fab8e3) SHA1(8912278c3fb38cdb7b9f3d1ee57cd890dca23d9a) ) + + ROM_REGION( 0x100000, "snd", 0 ) + ROM_LOAD( "snd11sd1.snd.31", 0x000000, 0x80000, CRC(cce53e79) SHA1(970507fcef309c6c81f7e1a8e90afa64f3f6e2ae) ) // same as dragsphr, horses4c, ivorytsk, moneybnk + ROM_LOAD( "qst11sd2.snd.32", 0x080000, 0x80000, CRC(f4dd8f52) SHA1(1bf3358fcbe2b30064be0d232d57dde19792199f) ) +ROM_END + + + +ROM_START( horses4c ) // no labels available + ROM_REGION( 0x100000, "maincpu", 0 ) + ROM_LOAD32_WORD_SWAP( "l.2", 0x00002, 0x080000, CRC(b0db53e7) SHA1(54b262fc963140325283b22ba35b7966ea8c3677) ) // 1st and 2nd half identical, but passes boot check + ROM_LOAD32_WORD_SWAP( "h.1", 0x00000, 0x080000, CRC(deade3a1) SHA1(bdf4a1259528f0afa70b543fea432975985bae6e) ) // 1st and 2nd half identical, but passes boot check + + ROM_REGION( 0x80000, "sndcpu", 0 ) // BADADDR --xxxxxxxxxxxxxxx, but passes boot check + ROM_LOAD16_WORD_SWAP( "n12prog.ifu.41", 0x0000, 0x020000, CRC(adac17b1) SHA1(8e92dfd112f15ee0dbca215e265f479fb19d4be4) ) // same as dragsphr, horses4c, ivorytsk, vikingt + + ROM_REGION( 0x100000, "k056832", 0 ) // 8x8x8 tiles + ROM_LOAD16_BYTE( "vrm.21", 0x00000, 0x080000, CRC(8e3acb65) SHA1(d7e90f1d4653a1590dc283f7012a7aa4d3e6e07f) ) + ROM_LOAD16_BYTE( "vrm.23", 0x00001, 0x080000, CRC(05c1845c) SHA1(1a3036e9cb961fdd771782c83c1ed5fab5857b6c) ) + + ROM_REGION( 0x400000, "k055673", 0 ) // 16x16x8 sprites + ROM_LOAD64_WORD( "obj.17", 0x000000, 0x080000, CRC(2c8a45e8) SHA1(dc6bb416da67abdc0d0b24ea548207fc53fb4d54) ) + ROM_LOAD64_WORD( "obj.15", 0x000002, 0x080000, CRC(a99c7a48) SHA1(298f67d5ceedf03152ebb92ae88d44792a9e7fcc) ) + ROM_LOAD64_WORD( "obj.13", 0x000004, 0x080000, CRC(ca11684d) SHA1(7c93118fcc7e44a7d927f12c0b04f6d169fe8f86) ) + ROM_LOAD64_WORD( "obj.11", 0x000006, 0x080000, CRC(97356ece) SHA1(ad45e6a8aae9683e06421e8a6bf076008abca86a) ) + ROM_LOAD64_WORD( "obj.18", 0x200000, 0x080000, CRC(b0717c2e) SHA1(5e49969b86e2a0784ac3e71d8bc62e5d9536f79b) ) // 1xxxxxxxxxxxxxxxxxx = 0xFF, but passes boot check + ROM_LOAD64_WORD( "obj.16", 0x200002, 0x080000, CRC(e3536f44) SHA1(da676c5d3753b49c5827dca05450b6e067081148) ) // 1xxxxxxxxxxxxxxxxxx = 0xFF, but passes boot check + ROM_LOAD64_WORD( "obj.14", 0x200004, 0x080000, CRC(993e09ed) SHA1(40d38444e5896814df2096ead9507bdfe9961ca6) ) // 1xxxxxxxxxxxxxxxxxx = 0xFF, but passes boot check + ROM_LOAD64_WORD( "obj.12", 0x200006, 0x080000, CRC(dbb7e613) SHA1(5ae0b0a756b997318c7fc60a161ce2c55ef04a4f) ) // 1xxxxxxxxxxxxxxxxxx = 0xFF, but passes boot check + + ROM_REGION( 0x100000, "snd", 0 ) + ROM_LOAD( "snd11sd1.snd.31", 0x000000, 0x80000, CRC(cce53e79) SHA1(970507fcef309c6c81f7e1a8e90afa64f3f6e2ae) ) // same as dragsphr, horses4c, ivorytsk, moneybnk + ROM_LOAD( "sd2.snd.32", 0x080000, 0x80000, CRC(bacb43cb) SHA1(04519a811d3d997bd126be6a5eba375c7b285df0) ) +ROM_END + + void kongambl_state::init_kingtut() { //uint32_t *rom = (uint32_t*)memregion("maincpu")->base(); @@ -838,3 +892,5 @@ GAME( 199?, dragsphr, 0, kongambl, kongambl, kongambl_state, empty_init, ROT0, "Konami", "Dragon Sphere", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) GAME( 199?, ivorytsk, 0, kongambl, kongambl, kongambl_state, empty_init, ROT0, "Konami", "Ivory Tusk", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) GAME( 199?, vikingt, 0, kongambl, kongambl, kongambl_state, empty_init, ROT0, "Konami", "Viking Treasure", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) +GAME( 1997, thequest, 0, kongambl, kongambl, kongambl_state, empty_init, ROT0, "Konami", "The Quest (NSW, Australia)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) +GAME( 2000, horses4c, 0, kongambl, kongambl, kongambl_state, empty_init, ROT0, "Konami", "Horses For Courses (NSW, Australia)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/tavernie.cpp mame-0.243+dfsg.1/src/mame/drivers/tavernie.cpp --- mame-0.242+dfsg.1/src/mame/drivers/tavernie.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/tavernie.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -2,25 +2,25 @@ // copyright-holders: Robbbert /********************************************************************************* - Tavernier CPU09 and IVG09 (Realisez votre ordinateur individuel) +Tavernier CPU09 and IVG09 (Realisez votre ordinateur individuel) - 2013-12-08 Skeleton driver. +2013-12-08 Skeleton driver. - This system was described in a French computer magazine "Micro-Informatique". +This system was described in a French computer magazine "Micro-Informatique". - CPU09 includes 6809, 6821, 6840, 6850, cassette, rs232 - IVG09 includes 6845, another 6821, beeper - IFD09 includes WD1795 +CPU09 includes 6809, 6821, 6840, 6850, cassette, rs232 +IVG09 includes 6845, another 6821, beeper +IFD09 includes WD1795 ToDo: - - Graphics - - Character rom is not dumped - - Graphics rom is not dumped +- Graphics +- Character rom is not dumped +- Graphics rom is not dumped (note 2020-05-29: added what are thought to be the correct roms, but the proper operation is uncertain). - - 3x 7611 proms not dumped - - Test FDC - - Need software (there are floppy images, but they are not yet in a supported format) +- 3x 7611 proms not dumped +- Test FDC +- Need software (there are floppy images, but they are not yet in a supported format) List of commands (must be in UPPERCASE): @@ -94,7 +94,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(kansas_r); void cpu09_mem(address_map &map); u8 m_pa = 0U; - bool m_cassold = 0; + bool m_cassold = false; required_device m_maincpu; required_device m_cass; required_device m_pia0; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/tbowl.cpp mame-0.243+dfsg.1/src/mame/drivers/tbowl.cpp --- mame-0.242+dfsg.1/src/mame/drivers/tbowl.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/tbowl.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -15,15 +15,219 @@ ***/ #include "emu.h" -#include "includes/tbowl.h" + +#include "video/tecmo_spr.h" #include "cpu/z80/z80.h" +#include "machine/gen_latch.h" +#include "sound/msm5205.h" #include "sound/ymopl.h" +#include "emupal.h" #include "layout/generic.h" #include "screen.h" #include "speaker.h" +#include "tilemap.h" + + +namespace { + +class tbowl_state : public driver_device +{ +public: + tbowl_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_msm(*this, "msm%u", 1U), + m_gfxdecode(*this, "gfxdecode"), + m_palette(*this, "palette"), + m_sprgen(*this, "spritegen"), + m_soundlatch(*this, "soundlatch"), + m_txvideoram(*this, "txvideoram"), + m_bgvideoram(*this, "bgvideoram%u", 1U), + m_spriteram(*this, "spriteram"), + m_mainbank(*this, "mainbank"), + m_subbank(*this, "subbank"), + m_adpcm_rom(*this, "adpcm") + { } + + void tbowl(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; + +private: + required_device m_maincpu; + required_device m_audiocpu; + required_device_array m_msm; + required_device m_gfxdecode; + required_device m_palette; + required_device m_sprgen; + required_device m_soundlatch; + + required_shared_ptr m_txvideoram; + required_shared_ptr_array m_bgvideoram; + required_shared_ptr m_spriteram; + required_memory_bank m_mainbank; + required_memory_bank m_subbank; + required_region_ptr m_adpcm_rom; + + tilemap_t *m_tx_tilemap = nullptr; + tilemap_t *m_bg_tilemap[2]{}; + uint16_t m_bgxscroll[2]{}; + uint16_t m_bgyscroll[2]{}; + uint16_t m_adpcm_pos[2]{}; + uint32_t m_adpcm_end[2]{}; + int16_t m_adpcm_data[2]{}; + + void coincounter_w(uint8_t data); + void boardb_bankswitch_w(uint8_t data); + void boardc_bankswitch_w(uint8_t data); + void trigger_nmi(uint8_t data); + template void adpcm_start_w(uint8_t data); + template void adpcm_end_w(uint8_t data); + template void adpcm_vol_w(uint8_t data); + void txvideoram_w(offs_t offset, uint8_t data); + template void bgvideoram_w(offs_t offset, uint8_t data); + template void bgxscroll_lo(uint8_t data); + template void bgxscroll_hi(uint8_t data); + template void bgyscroll_lo(uint8_t data); + template void bgyscroll_hi(uint8_t data); + + TILE_GET_INFO_MEMBER(get_tx_tile_info); + template TILE_GET_INFO_MEMBER(get_bg_tile_info); + + uint32_t screen_update_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + template DECLARE_WRITE_LINE_MEMBER(adpcm_int); + + void _6206A_map(address_map &map); + void _6206B_map(address_map &map); + void _6206C_map(address_map &map); +}; + + +// video + +// Foreground Layer (tx) Tilemap + +TILE_GET_INFO_MEMBER(tbowl_state::get_tx_tile_info) +{ + int tileno = m_txvideoram[tile_index] | ((m_txvideoram[tile_index + 0x800] & 0x07) << 8); + int col = (m_txvideoram[tile_index + 0x800] & 0xf0) >> 4; + + tileinfo.set(0, tileno, col, 0); +} + +void tbowl_state::txvideoram_w(offs_t offset, uint8_t data) +{ + m_txvideoram[offset] = data; + m_tx_tilemap->mark_tile_dirty(offset & 0x7ff); +} + +// Bottom BG Layer (0) and Middle BG Layer (1) Tilemaps + +template +TILE_GET_INFO_MEMBER(tbowl_state::get_bg_tile_info) +{ + int tileno = m_bgvideoram[Which][tile_index] | ((m_bgvideoram[Which][tile_index + 0x1000] & 0x0f) << 8); + int col = (m_bgvideoram[Which][tile_index + 0x1000] & 0xf0) >> 4; + + tileinfo.set(Which + 1, Which ? tileno ^= 0x400 : tileno, col, 0); +} + +template +void tbowl_state::bgvideoram_w(offs_t offset, uint8_t data) +{ + m_bgvideoram[Which][offset] = data; + m_bg_tilemap[Which]->mark_tile_dirty(offset & 0xfff); +} + +template +void tbowl_state::bgxscroll_lo(uint8_t data) +{ + m_bgxscroll[Which] = (m_bgxscroll[Which] & 0xff00) | data; +} + +template +void tbowl_state::bgxscroll_hi(uint8_t data) +{ + m_bgxscroll[Which] = (m_bgxscroll[Which] & 0x00ff) | (data << 8); +} + +template +void tbowl_state::bgyscroll_lo(uint8_t data) +{ + m_bgyscroll[Which] = (m_bgyscroll[Which] & 0xff00) | data; +} + +template +void tbowl_state::bgyscroll_hi(uint8_t data) +{ + m_bgyscroll[Which] = (m_bgyscroll[Which] & 0x00ff) | (data << 8); +} + +//*** Video Start / Update *** + +void tbowl_state::video_start() +{ + m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(tbowl_state::get_tx_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64,32); + m_bg_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(tbowl_state::get_bg_tile_info<0>)), TILEMAP_SCAN_ROWS, 16,16, 128,32); + m_bg_tilemap[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(tbowl_state::get_bg_tile_info<1>)), TILEMAP_SCAN_ROWS, 16,16, 128,32); + + m_tx_tilemap->set_transparent_pen(0); + m_bg_tilemap[0]->set_transparent_pen(0); + m_bg_tilemap[1]->set_transparent_pen(0); + + save_item(NAME(m_bgxscroll)); + save_item(NAME(m_bgyscroll)); +} + + + +uint32_t tbowl_state::screen_update_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + m_bg_tilemap[0]->set_scrollx(0, m_bgxscroll[0]); + m_bg_tilemap[0]->set_scrolly(0, m_bgyscroll[0]); + m_bg_tilemap[1]->set_scrollx(0, m_bgxscroll[1]); + m_bg_tilemap[1]->set_scrolly(0, m_bgyscroll[1]); + m_tx_tilemap->set_scrollx(0, 0); + m_tx_tilemap->set_scrolly(0, 0); + + bitmap.fill(0x100, cliprect); // is there a register controlling the colour? looks odd when screen is blank + m_bg_tilemap[0]->draw(screen, bitmap, cliprect, 0, 0); + m_sprgen->tbowl_draw_sprites(bitmap, cliprect, m_gfxdecode->gfx(3), 0, m_spriteram); + m_bg_tilemap[1]->draw(screen, bitmap, cliprect, 0, 0); + m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 0); + + return 0; +} + +uint32_t tbowl_state::screen_update_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + m_bg_tilemap[0]->set_scrollx(0, m_bgxscroll[0] + 32*8); + m_bg_tilemap[0]->set_scrolly(0, m_bgyscroll[0]); + m_bg_tilemap[1]->set_scrollx(0, m_bgxscroll[1] + 32*8); + m_bg_tilemap[1]->set_scrolly(0, m_bgyscroll[1]); + m_tx_tilemap->set_scrollx(0, 32*8); + m_tx_tilemap->set_scrolly(0, 0); + + bitmap.fill(0x100, cliprect); // is there a register controlling the colour? looks odd when screen is blank + m_bg_tilemap[0]->draw(screen, bitmap, cliprect, 0, 0); + m_sprgen->tbowl_draw_sprites(bitmap, cliprect, m_gfxdecode->gfx(3), 32*8, m_spriteram); + m_bg_tilemap[1]->draw(screen, bitmap, cliprect, 0, 0); + m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 0); + + return 0; +} + + +// machine void tbowl_state::coincounter_w(uint8_t data) { @@ -38,12 +242,12 @@ void tbowl_state::boardb_bankswitch_w(uint8_t data) { - membank("mainbank")->set_entry(data >> 3); + m_mainbank->set_entry(data >> 3); } void tbowl_state::boardc_bankswitch_w(uint8_t data) { - membank("subbank")->set_entry(data >> 3); + m_subbank->set_entry(data >> 3); } /*** Memory Structures @@ -55,47 +259,47 @@ ***/ -/* Board B */ +// Board B void tbowl_state::_6206B_map(address_map &map) { map(0x0000, 0x7fff).rom(); map(0x8000, 0x9fff).ram(); - map(0xa000, 0xbfff).ram().w(FUNC(tbowl_state::bg2videoram_w)).share("bg2videoram"); - map(0xc000, 0xdfff).ram().w(FUNC(tbowl_state::bgvideoram_w)).share("bgvideoram"); - map(0xe000, 0xefff).ram().w(FUNC(tbowl_state::txvideoram_w)).share("txvideoram"); -// map(0xf000, 0xf000).w(FUNC(tbowl_state::unknown_write)); * written during start-up, not again */ - map(0xf000, 0xf7ff).bankr("mainbank"); - map(0xf800, 0xfbff).ram().share("shared_ram"); /* check */ + map(0xa000, 0xbfff).ram().w(FUNC(tbowl_state::bgvideoram_w<1>)).share(m_bgvideoram[1]); + map(0xc000, 0xdfff).ram().w(FUNC(tbowl_state::bgvideoram_w<0>)).share(m_bgvideoram[0]); + map(0xe000, 0xefff).ram().w(FUNC(tbowl_state::txvideoram_w)).share(m_txvideoram); +// map(0xf000, 0xf000).w(FUNC(tbowl_state::unknown_write)); // written during start-up, not again + map(0xf000, 0xf7ff).bankr(m_mainbank); + map(0xf800, 0xfbff).ram().share("shared_ram"); // check map(0xfc00, 0xfc00).portr("P1").w(FUNC(tbowl_state::boardb_bankswitch_w)); map(0xfc01, 0xfc01).portr("P2"); -// map(0xfc01, 0xfc01).w(FUNC(tbowl_state::unknown_write)); /* written during start-up, not again */ +// map(0xfc01, 0xfc01).w(FUNC(tbowl_state::unknown_write)); // written during start-up, not again map(0xfc02, 0xfc02).portr("P3"); -// map(0xfc02, 0xfc02).w(FUNC(tbowl_state::unknown_write)); /* written during start-up, not again */ +// map(0xfc02, 0xfc02).w(FUNC(tbowl_state::unknown_write)); // written during start-up, not again map(0xfc03, 0xfc03).portr("P4").w(FUNC(tbowl_state::coincounter_w)); -// map(0xfc05, 0xfc05).w(FUNC(tbowl_state::unknown_write)); /* no idea */ -// map(0xfc06, 0xfc06).r(FUNC(tbowl_state::dummy_r)); /* Read During NMI */ +// map(0xfc05, 0xfc05).w(FUNC(tbowl_state::unknown_write)); // no idea +// map(0xfc06, 0xfc06).r(FUNC(tbowl_state::dummy_r)); // Read During NMI map(0xfc07, 0xfc07).portr("SYSTEM"); map(0xfc08, 0xfc08).portr("DSW1"); -// map(0xfc08, 0xfc08).w(FUNC(tbowl_state::unknown_write)); /* hardly used .. */ +// map(0xfc08, 0xfc08).w(FUNC(tbowl_state::unknown_write)); // hardly used .. map(0xfc09, 0xfc09).portr("DSW2"); map(0xfc0a, 0xfc0a).portr("DSW3"); -// map(0xfc0a, 0xfc0a).w(FUNC(tbowl_state::unknown_write)); /* hardly used .. */ +// map(0xfc0a, 0xfc0a).w(FUNC(tbowl_state::unknown_write)); // hardly used .. map(0xfc0d, 0xfc0d).w(m_soundlatch, FUNC(generic_latch_8_device::write)); - map(0xfc10, 0xfc10).w(FUNC(tbowl_state::bg2xscroll_lo)); - map(0xfc11, 0xfc11).w(FUNC(tbowl_state::bg2xscroll_hi)); - map(0xfc12, 0xfc12).w(FUNC(tbowl_state::bg2yscroll_lo)); - map(0xfc13, 0xfc13).w(FUNC(tbowl_state::bg2yscroll_hi)); - map(0xfc14, 0xfc14).w(FUNC(tbowl_state::bgxscroll_lo)); - map(0xfc15, 0xfc15).w(FUNC(tbowl_state::bgxscroll_hi)); - map(0xfc16, 0xfc16).w(FUNC(tbowl_state::bgyscroll_lo)); - map(0xfc17, 0xfc17).w(FUNC(tbowl_state::bgyscroll_hi)); + map(0xfc10, 0xfc10).w(FUNC(tbowl_state::bgxscroll_lo<1>)); + map(0xfc11, 0xfc11).w(FUNC(tbowl_state::bgxscroll_hi<1>)); + map(0xfc12, 0xfc12).w(FUNC(tbowl_state::bgyscroll_lo<1>)); + map(0xfc13, 0xfc13).w(FUNC(tbowl_state::bgyscroll_hi<1>)); + map(0xfc14, 0xfc14).w(FUNC(tbowl_state::bgxscroll_lo<0>)); + map(0xfc15, 0xfc15).w(FUNC(tbowl_state::bgxscroll_hi<0>)); + map(0xfc16, 0xfc16).w(FUNC(tbowl_state::bgyscroll_lo<0>)); + map(0xfc17, 0xfc17).w(FUNC(tbowl_state::bgyscroll_hi<0>)); } -/* Board C */ +// Board C void tbowl_state::trigger_nmi(uint8_t data) { - /* trigger NMI on 6206B's Cpu? (guess but seems to work..) */ + // trigger NMI on 6206B's Cpu? (guess but seems to work..) m_maincpu->pulse_input_line(INPUT_LINE_NMI, attotime::zero); } @@ -103,75 +307,70 @@ { map(0x0000, 0xbfff).rom(); map(0xc000, 0xd7ff).ram(); - map(0xd800, 0xdfff).ram().share("spriteram"); + map(0xd800, 0xdfff).ram().share(m_spriteram); map(0xe000, 0xefff).ram().w(m_palette, FUNC(palette_device::write8)).share("palette"); // 2x palettes, one for each monitor? - map(0xf000, 0xf7ff).bankr("subbank"); + map(0xf000, 0xf7ff).bankr(m_subbank); map(0xf800, 0xfbff).ram().share("shared_ram"); map(0xfc00, 0xfc00).w(FUNC(tbowl_state::boardc_bankswitch_w)); - map(0xfc01, 0xfc01).nopw(); /* ? */ - map(0xfc02, 0xfc02).w(FUNC(tbowl_state::trigger_nmi)); /* ? */ - map(0xfc03, 0xfc03).nopw(); /* ? */ - map(0xfc06, 0xfc06).nopw(); /* ? */ + map(0xfc01, 0xfc01).nopw(); // ? + map(0xfc02, 0xfc02).w(FUNC(tbowl_state::trigger_nmi)); // ? + map(0xfc03, 0xfc03).nopw(); // ? + map(0xfc06, 0xfc06).nopw(); // ? } -/* Board A */ +// Board A -void tbowl_state::adpcm_start_w(offs_t offset, uint8_t data) +template +void tbowl_state::adpcm_start_w(uint8_t data) { - msm5205_device *adpcm = (offset & 1) ? m_msm2 : m_msm1; - m_adpcm_pos[offset & 1] = data << 8; - adpcm->reset_w(0); + m_adpcm_pos[Which] = data << 8; + m_msm[Which]->reset_w(0); } -void tbowl_state::adpcm_end_w(offs_t offset, uint8_t data) +template +void tbowl_state::adpcm_end_w(uint8_t data) { - m_adpcm_end[offset & 1] = (data + 1) << 8; + m_adpcm_end[Which] = (data + 1) << 8; } -void tbowl_state::adpcm_vol_w(offs_t offset, uint8_t data) +template +void tbowl_state::adpcm_vol_w(uint8_t data) { - msm5205_device *adpcm = (offset & 1) ? m_msm2 : m_msm1; - adpcm->set_output_gain(ALL_OUTPUTS, (data & 127) / 127.0); + m_msm[Which]->set_output_gain(ALL_OUTPUTS, (data & 127) / 127.0); } -void tbowl_state::adpcm_int( msm5205_device *device, int num ) +template +WRITE_LINE_MEMBER(tbowl_state::adpcm_int) { - if (m_adpcm_pos[num] >= m_adpcm_end[num] || - m_adpcm_pos[num] >= memregion("adpcm")->bytes()/2) - device->reset_w(1); - else if (m_adpcm_data[num] != -1) + if (m_adpcm_pos[Which] >= m_adpcm_end[Which] || + m_adpcm_pos[Which] >= m_adpcm_rom.bytes() / 2) + m_msm[Which]->reset_w(1); + else if (m_adpcm_data[Which] != -1) { - device->data_w(m_adpcm_data[num] & 0x0f); - m_adpcm_data[num] = -1; + m_msm[Which]->data_w(m_adpcm_data[Which] & 0x0f); + m_adpcm_data[Which] = -1; } else { - uint8_t *ROM = memregion("adpcm")->base() + 0x10000 * num; + uint8_t *rom = &m_adpcm_rom[0x10000 * Which]; - m_adpcm_data[num] = ROM[m_adpcm_pos[num]++]; - device->data_w(m_adpcm_data[num] >> 4); + m_adpcm_data[Which] = rom[m_adpcm_pos[Which]++]; + m_msm[Which]->data_w(m_adpcm_data[Which] >> 4); } } -WRITE_LINE_MEMBER(tbowl_state::adpcm_int_1) -{ - adpcm_int(m_msm1, 0); -} - -WRITE_LINE_MEMBER(tbowl_state::adpcm_int_2) -{ - adpcm_int(m_msm2, 1); -} - void tbowl_state::_6206A_map(address_map &map) { map(0x0000, 0x7fff).rom(); map(0xc000, 0xc7ff).ram(); map(0xd000, 0xd001).w("ym1", FUNC(ym3812_device::write)); map(0xd800, 0xd801).w("ym2", FUNC(ym3812_device::write)); - map(0xe000, 0xe001).w(FUNC(tbowl_state::adpcm_end_w)); - map(0xe002, 0xe003).w(FUNC(tbowl_state::adpcm_start_w)); - map(0xe004, 0xe005).w(FUNC(tbowl_state::adpcm_vol_w)); + map(0xe000, 0xe000).w(FUNC(tbowl_state::adpcm_end_w<0>)); + map(0xe001, 0xe001).w(FUNC(tbowl_state::adpcm_end_w<1>)); + map(0xe002, 0xe002).w(FUNC(tbowl_state::adpcm_start_w<0>)); + map(0xe003, 0xe003).w(FUNC(tbowl_state::adpcm_start_w<1>)); + map(0xe004, 0xe004).w(FUNC(tbowl_state::adpcm_vol_w<0>)); + map(0xe005, 0xe005).w(FUNC(tbowl_state::adpcm_vol_w<1>)); map(0xe006, 0xe006).w(m_soundlatch, FUNC(generic_latch_8_device::acknowledge_w)); map(0xe007, 0xe007).nopw(); // sound watchdog map(0xe010, 0xe010).r(m_soundlatch, FUNC(generic_latch_8_device::read)); @@ -235,19 +434,19 @@ static INPUT_PORTS_START( tbowl ) - PORT_START("P1") /* 0xfc00 */ + PORT_START("P1") // 0xfc00 TBOWL_PLAYER_INPUT(1) - PORT_START("P2") /* 0xfc01 */ + PORT_START("P2") // 0xfc01 TBOWL_PLAYER_INPUT(2) - PORT_START("P3") /* 0xfc02 */ + PORT_START("P3") // 0xfc02 TBOWL_PLAYER_INPUT(3) - PORT_START("P4") /* 0xfc03 */ + PORT_START("P4") // 0xfc03 TBOWL_PLAYER_INPUT(4) - PORT_START("SYSTEM") /* 0xfc07 -> 0x80f9 */ + PORT_START("SYSTEM") // 0xfc07 -> 0x80f9 PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 ) @@ -257,7 +456,7 @@ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_START("DSW1") /* 0xfc08 -> 0xffb4 */ + PORT_START("DSW1") // 0xfc08 -> 0xffb4 PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1,2,3") PORT_DIPSETTING ( 0x00, DEF_STR( 8C_1C ) ) PORT_DIPSETTING ( 0x01, DEF_STR( 7C_1C ) ) @@ -292,6 +491,7 @@ PORT_DIPSETTING ( 0xa8, "1:10" ) PORT_DIPSETTING ( 0xb0, "1:05" ) PORT_DIPSETTING ( 0xb8, "1:00" ) + PORT_DIPSETTING ( 0xf8, "1:00" ) // duplicate PORT_DIPSETTING ( 0xc0, "0:55" ) PORT_DIPSETTING ( 0xc8, "0:50" ) PORT_DIPSETTING ( 0xd0, "0:45" ) @@ -299,24 +499,23 @@ PORT_DIPSETTING ( 0xe0, "0:35" ) PORT_DIPSETTING ( 0xe8, "0:30" ) PORT_DIPSETTING ( 0xf0, "0:25" ) -// PORT_DIPSETTING ( 0xf8, "1:00" ) - PORT_START("DSW2") /* 0xfc09 -> 0xffb5 */ + PORT_START("DSW2") // 0xfc09 -> 0xffb5 PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2") // To be checked again PORT_DIPSETTING ( 0x02, DEF_STR( Easy ) ) PORT_DIPSETTING ( 0x03, DEF_STR( Normal ) ) PORT_DIPSETTING ( 0x01, DEF_STR( Hard ) ) PORT_DIPSETTING ( 0x00, DEF_STR( Hardest ) ) PORT_DIPNAME( 0x0c, 0x0c, "Extra Time (Players)" ) PORT_DIPLOCATION("SW2:3,4") // For multiple "credits" - PORT_DIPSETTING ( 0x00, "0:30" ) /* manual shows 0:10 */ - PORT_DIPSETTING ( 0x04, "0:20" ) /* manual shows 0:05 */ - PORT_DIPSETTING ( 0x08, "0:10" ) /* manual shows 0:02 */ + PORT_DIPSETTING ( 0x00, "0:30" ) // manual shows 0:10 + PORT_DIPSETTING ( 0x04, "0:20" ) // manual shows 0:05 + PORT_DIPSETTING ( 0x08, "0:10" ) // manual shows 0:02 PORT_DIPSETTING ( 0x0c, DEF_STR( None ) ) PORT_DIPNAME( 0x30, 0x30, "Timer Speed" ) PORT_DIPLOCATION("SW2:5,6") - PORT_DIPSETTING ( 0x00, "Slowest" ) /* manual shows 1 Count = 60/60 Second - was 56/60 */ - PORT_DIPSETTING ( 0x10, "Slow" ) /* manual shows 1 Count = 54/60 Second - was 51/60 */ - PORT_DIPSETTING ( 0x30, DEF_STR( Normal ) ) /* manual shows 1 Count = 50/60 Second - was 47/60 */ - PORT_DIPSETTING ( 0x20, "Fast" ) /* manual shows 1 Count = 45/60 Second - was 42/60 */ + PORT_DIPSETTING ( 0x00, "Slowest" ) // manual shows 1 Count = 60/60 Second - was 56/60 + PORT_DIPSETTING ( 0x10, "Slow" ) // manual shows 1 Count = 54/60 Second - was 51/60 + PORT_DIPSETTING ( 0x30, DEF_STR( Normal ) ) // manual shows 1 Count = 50/60 Second - was 47/60 + PORT_DIPSETTING ( 0x20, "Fast" ) // manual shows 1 Count = 45/60 Second - was 42/60 PORT_DIPNAME( 0x40, 0x40, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:7") // Check code at 0x0393 PORT_DIPSETTING ( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING ( 0x40, DEF_STR( On ) ) @@ -324,22 +523,22 @@ PORT_DIPSETTING ( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING ( 0x80, DEF_STR( On ) ) - PORT_START("DSW3") /* 0xfc0a -> 0xffb6 */ + PORT_START("DSW3") // 0xfc0a -> 0xffb6 PORT_DIPNAME( 0x03, 0x03, "Time (Quarter)" ) PORT_DIPLOCATION("SW3:1,2") PORT_DIPSETTING ( 0x00, "8:00" ) PORT_DIPSETTING ( 0x01, "5:00" ) PORT_DIPSETTING ( 0x03, "4:00" ) PORT_DIPSETTING ( 0x02, "3:00" ) PORT_DIPNAME( 0x0c, 0x08, "Bonus Frequency" ) PORT_DIPLOCATION("SW3:3,4") // Check code at 0x6e16 (0x6e37 for tbowlj), each step is + 0x12 - PORT_DIPSETTING ( 0x00, "Most" ) /* Value in 0x8126.w = 0x54f3 (0x5414 for tbowlj) */ - PORT_DIPSETTING ( 0x04, "More" ) /* Value in 0x8126.w = 0x54e1 (0x5402 for tbowlj) */ - PORT_DIPSETTING ( 0x08, DEF_STR( Normal ) ) /* Value in 0x8126.w = 0x54cf (0x54f0 for tbowlj), manual shows this is Least, but values is > least */ - PORT_DIPSETTING ( 0x0c, "Least" ) /* Value in 0x8126.w = 0x54bd (0x54de for tbowlj), manual shows this is Normal, but value is least */ + PORT_DIPSETTING ( 0x00, "Most" ) // Value in 0x8126.w = 0x54f3 (0x5414 for tbowlj) + PORT_DIPSETTING ( 0x04, "More" ) // Value in 0x8126.w = 0x54e1 (0x5402 for tbowlj) + PORT_DIPSETTING ( 0x08, DEF_STR( Normal ) ) // Value in 0x8126.w = 0x54cf (0x54f0 for tbowlj), manual shows this is Least, but values is > least + PORT_DIPSETTING ( 0x0c, "Least" ) // Value in 0x8126.w = 0x54bd (0x54de for tbowlj), manual shows this is Normal, but value is least PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) INPUT_PORTS_END -static INPUT_PORTS_START( tbowlj ) /* "Quarter Time" Dip Switch for "3:00" and "4:00" are inverted */ +static INPUT_PORTS_START( tbowlj ) // "Quarter Time" Dip Switch for "3:00" and "4:00" are inverted PORT_INCLUDE( tbowl ) PORT_MODIFY("DSW3") @@ -355,17 +554,6 @@ ***/ -static const gfx_layout charlayout = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { 0, 1, 2, 3 }, - { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4 }, - { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 }, - 32*8 -}; - static const gfx_layout bgtilelayout = { 16,16, /* tile size */ @@ -378,33 +566,22 @@ 128*8 /* offset to next tile */ }; -static const gfx_layout sprite8layout = -{ - 8,8, /* tile size */ - RGN_FRAC(1,1), /* number of tiles */ - 4, /* 4 bits per pixel */ - { 0, 1, 2, 3 }, /* the bitplanes are packed in one nibble */ - { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4 }, - { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 }, - 8*32 /* offset to next tile */ -}; - static GFXDECODE_START( gfx_tbowl ) - GFXDECODE_ENTRY( "characters", 0, charlayout, 256, 16 ) - GFXDECODE_ENTRY( "bg_tiles", 0, bgtilelayout, 768, 16 ) - GFXDECODE_ENTRY( "bg_tiles", 0, bgtilelayout, 512, 16 ) - GFXDECODE_ENTRY( "sprites", 0, sprite8layout, 0, 16 ) + GFXDECODE_ENTRY( "characters", 0, gfx_8x8x4_packed_msb, 256, 16 ) + GFXDECODE_ENTRY( "bg_tiles", 0, bgtilelayout, 768, 16 ) + GFXDECODE_ENTRY( "bg_tiles", 0, bgtilelayout, 512, 16 ) + GFXDECODE_ENTRY( "sprites", 0, gfx_8x8x4_packed_msb, 0, 16 ) GFXDECODE_END /*** Machine Driver -there are 3 boards, each with a cpu, boards b and c contain -NEC D70008AC-8's which is just a Z80, board a (the sound board) +there are 3 boards, each with a CPU, boards b and c contain +NEC D70008AC-8s which is just a Z80, board a (the sound board) has an actual Z80 chip -Sound Hardware should be 2 YM3812's + 2 MSM5205's +Sound Hardware should be 2 YM3812s + 2 MSM5205s The game is displayed on 2 monitors @@ -412,8 +589,8 @@ void tbowl_state::machine_start() { - membank("mainbank")->configure_entries(0, 32, memregion("maincpu")->base() + 0x10000, 0x800); - membank("subbank")->configure_entries(0, 32, memregion("sub")->base() + 0x10000, 0x800); + m_mainbank->configure_entries(0, 32, memregion("maincpu")->base() + 0x10000, 0x800); + m_subbank->configure_entries(0, 32, memregion("sub")->base() + 0x10000, 0x800); save_item(NAME(m_adpcm_pos)); save_item(NAME(m_adpcm_end)); @@ -431,23 +608,23 @@ void tbowl_state::tbowl(machine_config &config) { - /* CPU on Board '6206B' */ - Z80(config, m_maincpu, 8000000); /* NEC D70008AC-8 (Z80 Clone) */ + // CPU on Board '6206B' + Z80(config, m_maincpu, 8000000); // NEC D70008AC-8 (Z80 Clone) m_maincpu->set_addrmap(AS_PROGRAM, &tbowl_state::_6206B_map); m_maincpu->set_vblank_int("lscreen", FUNC(tbowl_state::irq0_line_hold)); - /* CPU on Board '6206C' */ - z80_device &sub(Z80(config, "sub", 8000000)); /* NEC D70008AC-8 (Z80 Clone) */ + // CPU on Board '6206C' + z80_device &sub(Z80(config, "sub", 8000000)); // NEC D70008AC-8 (Z80 Clone) sub.set_addrmap(AS_PROGRAM, &tbowl_state::_6206C_map); sub.set_vblank_int("lscreen", FUNC(tbowl_state::irq0_line_hold)); - /* CPU on Board '6206A' */ - Z80(config, m_audiocpu, 4000000); /* Actual Z80 */ + // CPU on Board '6206A' + Z80(config, m_audiocpu, 4000000); // Actual Z80 m_audiocpu->set_addrmap(AS_PROGRAM, &tbowl_state::_6206A_map); config.set_maximum_quantum(attotime::from_hz(6000)); - /* video hardware */ + // video hardware GFXDECODE(config, m_gfxdecode, m_palette, gfx_tbowl); PALETTE(config, m_palette).set_format(palette_device::xBRG_444, 1024*2).set_endianness(ENDIANNESS_BIG); config.set_default_layout(layout_dualhsxs); @@ -470,7 +647,7 @@ rscreen.set_screen_update(FUNC(tbowl_state::screen_update_right)); rscreen.set_palette(m_palette); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); GENERIC_LATCH_8(config, m_soundlatch); @@ -484,16 +661,15 @@ ym3812_device &ym2(YM3812(config, "ym2", 4000000)); ym2.add_route(ALL_OUTPUTS, "mono", 0.80); - /* something for the samples? */ - MSM5205(config, m_msm1, 384000); - m_msm1->vck_legacy_callback().set(FUNC(tbowl_state::adpcm_int_1)); /* interrupt function */ - m_msm1->set_prescaler_selector(msm5205_device::S48_4B); /* 8KHz */ - m_msm1->add_route(ALL_OUTPUTS, "mono", 0.50); - - MSM5205(config, m_msm2, 384000); - m_msm2->vck_legacy_callback().set(FUNC(tbowl_state::adpcm_int_2)); /* interrupt function */ - m_msm2->set_prescaler_selector(msm5205_device::S48_4B); /* 8KHz */ - m_msm2->add_route(ALL_OUTPUTS, "mono", 0.50); + MSM5205(config, m_msm[0], 384000); + m_msm[0]->vck_legacy_callback().set(FUNC(tbowl_state::adpcm_int<0>)); // interrupt function + m_msm[0]->set_prescaler_selector(msm5205_device::S48_4B); // 8KHz + m_msm[0]->add_route(ALL_OUTPUTS, "mono", 0.50); + + MSM5205(config, m_msm[1], 384000); + m_msm[1]->vck_legacy_callback().set(FUNC(tbowl_state::adpcm_int<1>)); // interrupt function + m_msm[1]->set_prescaler_selector(msm5205_device::S48_4B); // 8KHz + m_msm[1]->add_route(ALL_OUTPUTS, "mono", 0.50); } @@ -551,10 +727,10 @@ /*** Rom Loading *** -we currently have two dumps, one appears to be a world/us version, the +we currently have two dumps, one appears to be a world/US version, the other is clearly a Japan version as it displays a regional warning -there is also a bad dump which for reference has the following roms +there is also a bad dump which for reference has the following ROMs different to the world dump "24.rom" 0x10000 0x39a2d923 (code) @@ -564,28 +740,28 @@ "22.rom" 0x10000 0xee7561d9 (gfx) "23.rom" 0x10000 0x46b3c186 (gfx) -this fails its rom check so I assume its corrupt +this fails its ROM check so I assume it's corrupt ***/ ROM_START( tbowl ) - ROM_REGION( 0x20000, "maincpu", 0 ) /* NEC D70008AC-8 (Z80 Clone) */ + ROM_REGION( 0x20000, "maincpu", 0 ) // NEC D70008AC-8 (Z80 Clone) ROM_LOAD( "4.b11", 0x00000, 0x08000, CRC(db8a4f5d) SHA1(730dee040c18ed8736c07a7de0b986f667b0f2f5) ) ROM_LOAD( "6206b-5.b13", 0x10000, 0x10000, CRC(133c5c11) SHA1(7d4e76db3505ccf033d0d9b8d21feaf09b76dcc4) ) - ROM_REGION( 0x20000, "sub", 0 ) /* NEC D70008AC-8 (Z80 Clone) */ + ROM_REGION( 0x20000, "sub", 0 ) // NEC D70008AC-8 (Z80 Clone) ROM_LOAD( "6206c-24.h5", 0x00000, 0x10000, CRC(040c8138) SHA1(f6fea192bf2ef0a3f0876133c761488184f54f50) ) ROM_LOAD( "6206c-25.h7", 0x10000, 0x10000, CRC(92c3cef5) SHA1(75883663b309bf46be544114c6e9086ab222300d) ) - ROM_REGION( 0x10000, "audiocpu", 0 ) /* Z80 */ + ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 ROM_LOAD( "6206a-1.f11", 0x00000, 0x08000, CRC(4370207b) SHA1(2c929b571c86d35e646870644751e86bd16b5e22) ) - ROM_REGION( 0x10000, "characters", 0 ) /* 8x8 Characters inc. Alphanumerics */ + ROM_REGION( 0x10000, "characters", 0 ) // 8x8 Characters inc. Alphanumerics ROM_LOAD16_BYTE( "14.13l", 0x00000, 0x08000, CRC(f9cf60b9) SHA1(0a79ed29f82ac7bd08062f922f79e439c194f30a) ) ROM_LOAD16_BYTE( "15.15l", 0x00001, 0x08000, CRC(a23f6c53) SHA1(0bb64894a27f41d74117ec492aafd52bc5b16ca4) ) - ROM_REGION( 0x80000, "bg_tiles", 0 ) /* BG GFX */ + ROM_REGION( 0x80000, "bg_tiles", 0 ) ROM_LOAD16_BYTE( "6206b-8.e1", 0x40001, 0x10000, CRC(b9615ffa) SHA1(813896387291f5325ed7e4058347fe35c0d7b839) ) ROM_LOAD16_BYTE( "6206b-8.e4", 0x40000, 0x10000, CRC(6389c719) SHA1(8043907d6f5b37228c09f05bbf12b4b9bb9bc130) ) ROM_LOAD16_BYTE( "6206b-7.e2", 0x00001, 0x10000, CRC(d139c397) SHA1(4093220e6bddb95d0af445944bead7a064b64c39) ) @@ -595,7 +771,7 @@ ROM_LOAD16_BYTE( "6206b-11.l2", 0x20001, 0x10000, CRC(06bf07bb) SHA1(9f12a39b8832bff2ffd84b7e6c1ddb2855ff924b) ) ROM_LOAD16_BYTE( "6206b-13.l6", 0x20000, 0x10000, CRC(4ad72c16) SHA1(554474987349b5b11e181ee8a2d1308777b030c1) ) - ROM_REGION( 0x80000, "sprites", 0 ) /* SPR GFX */ + ROM_REGION( 0x80000, "sprites", 0 ) ROM_LOAD16_BYTE( "6206c-16.b11", 0x60001, 0x10000, CRC(1a2fb925) SHA1(bc96ee87372826d5bee2b4d2aefde4c47b9ee80a) ) ROM_LOAD16_BYTE( "6206c-20.d11", 0x60000, 0x10000, CRC(70bb38a3) SHA1(5145b246f7720dd0359b97be35aa027af07cb6da) ) ROM_LOAD16_BYTE( "6206c-17.b13", 0x40001, 0x10000, CRC(de16bc10) SHA1(88e2452c7caf44cd541c27fc56c99703f3330bd7) ) @@ -612,22 +788,22 @@ ROM_START( tbowla ) - ROM_REGION( 0x20000, "maincpu", 0 ) /* NEC D70008AC-8 (Z80 Clone) */ + ROM_REGION( 0x20000, "maincpu", 0 ) // NEC D70008AC-8 (Z80 Clone) ROM_LOAD( "6206b-4.b11", 0x00000, 0x08000, CRC(8c4260b1) SHA1(1559849b00c6ba818a5dae4e96ccc3bf58e6243f) ) ROM_LOAD( "6206b-5.b13", 0x10000, 0x10000, CRC(133c5c11) SHA1(7d4e76db3505ccf033d0d9b8d21feaf09b76dcc4) ) - ROM_REGION( 0x20000, "sub", 0 ) /* NEC D70008AC-8 (Z80 Clone) */ + ROM_REGION( 0x20000, "sub", 0 ) // NEC D70008AC-8 (Z80 Clone) ROM_LOAD( "6206c-24.h5", 0x00000, 0x10000, CRC(040c8138) SHA1(f6fea192bf2ef0a3f0876133c761488184f54f50) ) ROM_LOAD( "6206c-25.h7", 0x10000, 0x10000, CRC(92c3cef5) SHA1(75883663b309bf46be544114c6e9086ab222300d) ) - ROM_REGION( 0x10000, "audiocpu", 0 ) /* Z80 */ + ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 ROM_LOAD( "6206a-1.f11", 0x00000, 0x08000, CRC(4370207b) SHA1(2c929b571c86d35e646870644751e86bd16b5e22) ) - ROM_REGION( 0x10000, "characters", 0 ) /* 8x8 Characters inc. Alphanumerics */ + ROM_REGION( 0x10000, "characters", 0 ) // 8x8 Characters inc. Alphanumerics ROM_LOAD16_BYTE( "6206b-14.l13", 0x00000, 0x08000, CRC(cf99d0bf) SHA1(d1f23e23c2ebd26e2ffe8b23a02d86e4d32c6f11) ) ROM_LOAD16_BYTE( "6206b-15.l14", 0x00001, 0x08000, CRC(d69248cf) SHA1(4dad6a3fdc36b2fe625df0a43fd9e82d1dfd2af6) ) - ROM_REGION( 0x80000, "bg_tiles", 0 ) /* BG GFX */ + ROM_REGION( 0x80000, "bg_tiles", 0 ) ROM_LOAD16_BYTE( "6206b-8.e1", 0x40001, 0x10000, CRC(b9615ffa) SHA1(813896387291f5325ed7e4058347fe35c0d7b839) ) ROM_LOAD16_BYTE( "6206b-8.e4", 0x40000, 0x10000, CRC(6389c719) SHA1(8043907d6f5b37228c09f05bbf12b4b9bb9bc130) ) ROM_LOAD16_BYTE( "6206b-7.e2", 0x00001, 0x10000, CRC(d139c397) SHA1(4093220e6bddb95d0af445944bead7a064b64c39) ) @@ -637,7 +813,7 @@ ROM_LOAD16_BYTE( "6206b-11.l2", 0x20001, 0x10000, CRC(06bf07bb) SHA1(9f12a39b8832bff2ffd84b7e6c1ddb2855ff924b) ) ROM_LOAD16_BYTE( "6206b-13.l6", 0x20000, 0x10000, CRC(4ad72c16) SHA1(554474987349b5b11e181ee8a2d1308777b030c1) ) - ROM_REGION( 0x80000, "sprites", 0 ) /* SPR GFX */ + ROM_REGION( 0x80000, "sprites", 0 ) ROM_LOAD16_BYTE( "6206c-16.b11", 0x60001, 0x10000, CRC(1a2fb925) SHA1(bc96ee87372826d5bee2b4d2aefde4c47b9ee80a) ) ROM_LOAD16_BYTE( "6206c-20.d11", 0x60000, 0x10000, CRC(70bb38a3) SHA1(5145b246f7720dd0359b97be35aa027af07cb6da) ) ROM_LOAD16_BYTE( "6206c-17.b13", 0x40001, 0x10000, CRC(de16bc10) SHA1(88e2452c7caf44cd541c27fc56c99703f3330bd7) ) @@ -653,28 +829,28 @@ ROM_END ROM_START( tbowlp ) - ROM_REGION( 0x20000, "maincpu", 0 ) /* NEC D70008AC-8 (Z80 Clone) */ + ROM_REGION( 0x20000, "maincpu", 0 ) // NEC D70008AC-8 (Z80 Clone) // same as 'tbowl' ROM_LOAD( "4.b11", 0x00000, 0x08000, CRC(db8a4f5d) SHA1(730dee040c18ed8736c07a7de0b986f667b0f2f5) ) ROM_LOAD( "main_data_10-25.b13", 0x10000, 0x10000, CRC(133c5c11) SHA1(7d4e76db3505ccf033d0d9b8d21feaf09b76dcc4) ) - ROM_REGION( 0x20000, "sub", 0 ) /* NEC D70008AC-8 (Z80 Clone) */ + ROM_REGION( 0x20000, "sub", 0 ) // NEC D70008AC-8 (Z80 Clone) // different to other sets ROM_LOAD( "sub_pro_10-29.h5", 0x00000, 0x10000, CRC(1933a3f0) SHA1(e19b3d7ad3cf6ccfc7b51240608f0edb95a50b5a) ) ROM_LOAD( "sub_data_10-25.h7", 0x10000, 0x10000, CRC(7277c852) SHA1(0b9e607159f54cf59727299c82cfc01dd90c8eb3) ) - ROM_REGION( 0x10000, "audiocpu", 0 ) /* Z80 */ - // this rom is quite strange, maybe damaged / badly programmed? areas which should be a 0x00 0x00 end up being + ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 + // this ROM is quite strange, maybe damaged / badly programmed? areas which should be a 0x00 0x00 end up being // a 0x00 / 0xff alternating pattern, and there are some odd sounds at times. It does however read consistently // and is a different revision of the code to the other sets, so it might be correct and we can't just replace it - // with a rom from another set. + // with a ROM from another set. ROM_LOAD( "6206_sound_10-25.f11", 0x00000, 0x08000, CRC(2158472d) SHA1(bc47f4d59505fec6a5c2b924cbe8fc6d6cd4609e) ) - ROM_REGION( 0x10000, "characters", 0 ) /* 8x8 Characters inc. Alphanumerics */ + ROM_REGION( 0x10000, "characters", 0 ) // 8x8 Characters inc. Alphanumerics ROM_LOAD16_BYTE( "14.13l", 0x00000, 0x08000, CRC(f9cf60b9) SHA1(0a79ed29f82ac7bd08062f922f79e439c194f30a) ) ROM_LOAD16_BYTE( "15.15l", 0x00001, 0x08000, CRC(a23f6c53) SHA1(0bb64894a27f41d74117ec492aafd52bc5b16ca4) ) - ROM_REGION( 0x80000, "bg_tiles", 0 ) /* BG GFX */ + ROM_REGION( 0x80000, "bg_tiles", 0 ) ROM_LOAD16_BYTE( "6206b-8.e1", 0x40001, 0x10000, CRC(b9615ffa) SHA1(813896387291f5325ed7e4058347fe35c0d7b839) ) ROM_LOAD16_BYTE( "6206b-8.e4", 0x40000, 0x10000, CRC(6389c719) SHA1(8043907d6f5b37228c09f05bbf12b4b9bb9bc130) ) ROM_LOAD16_BYTE( "6206b-7.e2", 0x00001, 0x10000, CRC(d139c397) SHA1(4093220e6bddb95d0af445944bead7a064b64c39) ) @@ -684,7 +860,7 @@ ROM_LOAD16_BYTE( "6206b-11.l2", 0x20001, 0x10000, CRC(06bf07bb) SHA1(9f12a39b8832bff2ffd84b7e6c1ddb2855ff924b) ) ROM_LOAD16_BYTE( "6206b-13.l6", 0x20000, 0x10000, CRC(4ad72c16) SHA1(554474987349b5b11e181ee8a2d1308777b030c1) ) - ROM_REGION( 0x80000, "sprites", 0 ) /* SPR GFX */ + ROM_REGION( 0x80000, "sprites", 0 ) // todo: check how these differ ROM_LOAD16_BYTE( "sp_7_10-16.b11", 0x60001, 0x10000, CRC(807af46a) SHA1(c7b2ce489b129de16e1081595c255b85ea2b684a) ) ROM_LOAD16_BYTE( "sp_6_10-16.d11", 0x60000, 0x10000, CRC(3c5654a9) SHA1(44f8d251c9f5d8c2c0aaaf23426c16d3fedaa0c0) ) @@ -701,22 +877,22 @@ ROM_END ROM_START( tbowlj ) - ROM_REGION( 0x20000, "maincpu", 0 ) /* NEC D70008AC-8 (Z80 Clone) */ + ROM_REGION( 0x20000, "maincpu", 0 ) // NEC D70008AC-8 (Z80 Clone) ROM_LOAD( "6206b.4", 0x00000, 0x08000, CRC(7ed3eff7) SHA1(4a17f2838e9bbed8b1638783c62d07d1074e2b35) ) ROM_LOAD( "6206b.5", 0x10000, 0x10000, CRC(133c5c11) SHA1(7d4e76db3505ccf033d0d9b8d21feaf09b76dcc4) ) - ROM_REGION( 0x20000, "sub", 0 ) /* NEC D70008AC-8 (Z80 Clone) */ + ROM_REGION( 0x20000, "sub", 0 ) // NEC D70008AC-8 (Z80 Clone) ROM_LOAD( "6206c-24.h5", 0x00000, 0x10000, CRC(040c8138) SHA1(f6fea192bf2ef0a3f0876133c761488184f54f50) ) ROM_LOAD( "6206c-25.h7", 0x10000, 0x10000, CRC(92c3cef5) SHA1(75883663b309bf46be544114c6e9086ab222300d) ) - ROM_REGION( 0x10000, "audiocpu", 0 ) /* Z80 */ + ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 ROM_LOAD( "6206a-1.f11", 0x00000, 0x08000, CRC(4370207b) SHA1(2c929b571c86d35e646870644751e86bd16b5e22) ) - ROM_REGION( 0x10000, "characters", 0 ) /* 8x8 Characters inc. Alphanumerics */ + ROM_REGION( 0x10000, "characters", 0 ) // 8x8 Characters inc. Alphanumerics ROM_LOAD16_BYTE( "6206b-14.l13", 0x00000, 0x08000, CRC(cf99d0bf) SHA1(d1f23e23c2ebd26e2ffe8b23a02d86e4d32c6f11) ) ROM_LOAD16_BYTE( "6206b-15.l14", 0x00001, 0x08000, CRC(d69248cf) SHA1(4dad6a3fdc36b2fe625df0a43fd9e82d1dfd2af6) ) - ROM_REGION( 0x80000, "bg_tiles", 0 ) /* BG GFX */ + ROM_REGION( 0x80000, "bg_tiles", 0 ) ROM_LOAD16_BYTE( "6206b-8.e1", 0x40001, 0x10000, CRC(b9615ffa) SHA1(813896387291f5325ed7e4058347fe35c0d7b839) ) ROM_LOAD16_BYTE( "6206b-8.e4", 0x40000, 0x10000, CRC(6389c719) SHA1(8043907d6f5b37228c09f05bbf12b4b9bb9bc130) ) ROM_LOAD16_BYTE( "6206b-7.e2", 0x00001, 0x10000, CRC(d139c397) SHA1(4093220e6bddb95d0af445944bead7a064b64c39) ) @@ -726,7 +902,7 @@ ROM_LOAD16_BYTE( "6206b-11.l2", 0x20001, 0x10000, CRC(06bf07bb) SHA1(9f12a39b8832bff2ffd84b7e6c1ddb2855ff924b) ) ROM_LOAD16_BYTE( "6206b-13.l6", 0x20000, 0x10000, CRC(4ad72c16) SHA1(554474987349b5b11e181ee8a2d1308777b030c1) ) - ROM_REGION( 0x80000, "sprites", 0 ) /* SPR GFX */ + ROM_REGION( 0x80000, "sprites", 0 ) ROM_LOAD16_BYTE( "6206c-16.b11", 0x60001, 0x10000, CRC(1a2fb925) SHA1(bc96ee87372826d5bee2b4d2aefde4c47b9ee80a) ) ROM_LOAD16_BYTE( "6206c-20.d11", 0x60000, 0x10000, CRC(70bb38a3) SHA1(5145b246f7720dd0359b97be35aa027af07cb6da) ) ROM_LOAD16_BYTE( "6206c-17.b13", 0x40001, 0x10000, CRC(de16bc10) SHA1(88e2452c7caf44cd541c27fc56c99703f3330bd7) ) @@ -741,6 +917,9 @@ ROM_LOAD( "6206a-2.l16", 0x10000, 0x10000, CRC(1e9e5936) SHA1(60370d1de28b1c5ffeff7843702aaddb19ff1f58) ) ROM_END +} // anonymous namespace + + GAME( 1987, tbowl, 0, tbowl, tbowl, tbowl_state, empty_init, ROT0, "Tecmo", "Tecmo Bowl (World, set 1)", MACHINE_SUPPORTS_SAVE ) GAME( 1987, tbowla, tbowl, tbowl, tbowl, tbowl_state, empty_init, ROT0, "Tecmo", "Tecmo Bowl (World, set 2)", MACHINE_SUPPORTS_SAVE ) GAME( 1987, tbowlp, tbowl, tbowl, tbowl, tbowl_state, empty_init, ROT0, "Tecmo", "Tecmo Bowl (World, prototype?)", MACHINE_SUPPORTS_SAVE ) // or early version, handwritten labels diff -Nru mame-0.242+dfsg.1/src/mame/drivers/tec1.cpp mame-0.243+dfsg.1/src/mame/drivers/tec1.cpp --- mame-0.242+dfsg.1/src/mame/drivers/tec1.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/tec1.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -2,7 +2,7 @@ // copyright-holders:Robbbert /*************************************************************************** - TEC-1 driver, written by Robbbert in April, 2009 for MESS. +TEC-1 driver, written by Robbbert in April, 2009. The TEC-1 was a single-board "computer" described in Talking Electronics magazine, issues number 10 and 11. Talking Electronics do not have dates on diff -Nru mame-0.242+dfsg.1/src/mame/drivers/techno.cpp mame-0.243+dfsg.1/src/mame/drivers/techno.cpp --- mame-0.242+dfsg.1/src/mame/drivers/techno.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/techno.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -94,12 +94,12 @@ emu_timer *m_irq_set_timer = 0; emu_timer *m_irq_advance_timer = 0; - bool m_digwait = 0; + bool m_digwait = false; u8 m_keyrow = 0U; u16 m_digit = 0U; u8 m_vector = 0U; u8 m_snd_cmd = 0U; - bool m_snd_ack = 0; + bool m_snd_ack = false; u32 m_last_solenoid = 0U; }; @@ -434,5 +434,5 @@ } // Anonymous namespace -GAME(1987, xforce, 0, techno, techno, techno_state, empty_init, ROT0, "Tecnoplay", "X Force", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1988, spcteam, 0, techno, techno, techno_state, empty_init, ROT0, "Tecnoplay", "Space Team", MACHINE_IS_SKELETON_MECHANICAL) +GAME(1987, xforce, 0, techno, techno, techno_state, empty_init, ROT0, "Tecnoplay", "X Force", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1988, spcteam, 0, techno, techno, techno_state, empty_init, ROT0, "Tecnoplay", "Space Team", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/terracre.cpp mame-0.243+dfsg.1/src/mame/drivers/terracre.cpp --- mame-0.242+dfsg.1/src/mame/drivers/terracre.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/terracre.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -418,23 +418,6 @@ INPUT_PORTS_END -static const gfx_layout tile_layout = -{ - 16,16, - RGN_FRAC(1,1), - 4, - { 0, 1, 2, 3 }, - { - 4, 0, 12, 8, 20, 16, 28, 24, - 32+4, 32+0, 32+12, 32+8, 32+20, 32+16, 32+28, 32+24 - }, - { - 0*64, 1*64, 2*64, 3*64, 4*64, 5*64, 6*64, 7*64, - 8*64, 9*64, 10*64, 11*64, 12*64, 13*64, 14*64, 15*64 - }, - 64*16 -}; - static const gfx_layout sprite_layout = { 16,16, @@ -455,8 +438,8 @@ }; static GFXDECODE_START( gfx_terracre ) - GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x4_packed_lsb, 0, 1 ) - GFXDECODE_ENTRY( "gfx2", 0, tile_layout, 1*16, 16 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x4_packed_lsb, 0, 1 ) + GFXDECODE_ENTRY( "gfx2", 0, gfx_16x16x4_packed_lsb, 1*16, 16 ) GFXDECODE_ENTRY( "gfx3", 0, sprite_layout, 1*16+16*16, 256 ) GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/thepit.cpp mame-0.243+dfsg.1/src/mame/drivers/thepit.cpp --- mame-0.242+dfsg.1/src/mame/drivers/thepit.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/thepit.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -328,9 +328,9 @@ PORT_START("DSW") PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:!1,!2") - PORT_DIPSETTING( 0x01, DEF_STR( 2C_3C ) ) - PORT_DIPSETTING( 0x02, DEF_STR( 2C_4C ) ) - PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x01, DEF_STR( 3C_2C ) ) + PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x03, DEF_STR( Free_Play ) ) PORT_DIPNAME( 0x04, 0x00, "Game Speed" ) PORT_DIPLOCATION("SW1:!3") PORT_DIPSETTING( 0x04, "Slow" ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/thunderj.cpp mame-0.243+dfsg.1/src/mame/drivers/thunderj.cpp --- mame-0.242+dfsg.1/src/mame/drivers/thunderj.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/thunderj.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -215,22 +215,10 @@ }; -static const gfx_layout pfmolayout = -{ - 8,8, - RGN_FRAC(1,4), - 4, - { RGN_FRAC(3,4), RGN_FRAC(2,4), RGN_FRAC(1,4), RGN_FRAC(0,4) }, - { 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_thunderj ) - GFXDECODE_ENTRY( "gfx1", 0, pfmolayout, 512, 96 ) /* sprites & playfield */ - GFXDECODE_ENTRY( "gfx2", 0, pfmolayout, 256, 112 ) /* sprites & playfield */ - GFXDECODE_ENTRY( "gfx3", 0, anlayout, 0, 512 ) /* characters 8x8 */ + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x4_planar, 512, 96 ) /* sprites & playfield */ + GFXDECODE_ENTRY( "gfx2", 0, gfx_8x8x4_planar, 256, 112 ) /* sprites & playfield */ + GFXDECODE_ENTRY( "gfx3", 0, anlayout, 0, 512 ) /* characters 8x8 */ GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/ti99_4p.cpp mame-0.243+dfsg.1/src/mame/drivers/ti99_4p.cpp --- mame-0.242+dfsg.1/src/mame/drivers/ti99_4p.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/ti99_4p.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -443,6 +443,10 @@ m_decode = SGCPU_NONE; m_muxready = true; + // Trigger the TMS9901 clock when A10 is 1 + if ((m_addr_buf & 0x0020) != 0) + m_tms9901->update_clock(); + m_decode = decode_address(m_addr_buf); if (m_decode == SGCPU_NONE) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/ti99_4x.cpp mame-0.243+dfsg.1/src/mame/drivers/ti99_4x.cpp --- mame-0.242+dfsg.1/src/mame/drivers/ti99_4x.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/ti99_4x.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -56,7 +56,6 @@ #include "speaker.h" #define TI99_CONSOLEGROM "cons_grom" -#define TI99_TMS9901_TAG "tms9901" #define TI99_SCREEN_TAG "screen" // Debugging diff -Nru mame-0.242+dfsg.1/src/mame/drivers/timetrv.cpp mame-0.243+dfsg.1/src/mame/drivers/timetrv.cpp --- mame-0.242+dfsg.1/src/mame/drivers/timetrv.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/timetrv.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -280,7 +280,7 @@ PORT_DIPSETTING( 0x0c, DEF_STR( Medium ) ) PORT_DIPSETTING( 0x08, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x04, DEF_STR( Difficult ) ) - PORT_DIPSETTING( 0x0c, DEF_STR( Very_Difficult ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Very_Difficult ) ) PORT_DIPNAME( 0x10, 0x10, "LaserDisc Player Protocol" ) PORT_DIPLOCATION("SW3:5") PORT_DIPSETTING( 0x10, "Pioneer LDV-4200" ) PORT_DIPSETTING( 0x00, "Sony LDP-1450" ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/tispeak.cpp mame-0.243+dfsg.1/src/mame/drivers/tispeak.cpp --- mame-0.242+dfsg.1/src/mame/drivers/tispeak.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/tispeak.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -533,8 +533,6 @@ void tispeak_state::init_cartridge() { - m_overlay = 0; - if (m_cart != nullptr && m_cart->exists()) { std::string region_tag; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/tk80bs.cpp mame-0.243+dfsg.1/src/mame/drivers/tk80bs.cpp --- mame-0.242+dfsg.1/src/mame/drivers/tk80bs.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/tk80bs.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -68,16 +68,13 @@ uint32_t tk80bs_state::screen_update_tk80bs(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - int x,y; - int count; + u16 count = 0; - count = 0; - - for(y=0;y<16;y++) + for(u8 y = 0; y < 16; y++) { - for(x=0;x<32;x++) + for(u8 x = 0; x < 32; x++) { - int tile = m_p_videoram[count++]; + u8 tile = m_p_videoram[count++]; m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, tile, 0, 0, 0, x*8, y*8); } diff -Nru mame-0.242+dfsg.1/src/mame/drivers/tmnt.cpp mame-0.243+dfsg.1/src/mame/drivers/tmnt.cpp --- mame-0.242+dfsg.1/src/mame/drivers/tmnt.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/tmnt.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -2358,20 +2358,8 @@ -static const gfx_layout zoomlayout = -{ - 16,16, - RGN_FRAC(1,1), - 4, - { 0, 1, 2, 3 }, - { 1*4, 0*4, 3*4, 2*4, 5*4, 4*4, 7*4, 6*4, - 9*4, 8*4, 11*4, 10*4, 13*4, 12*4, 15*4, 14*4 }, - { 0*64, 1*64, 2*64, 3*64, 4*64, 5*64, 6*64, 7*64, - 8*64, 9*64, 10*64, 11*64, 12*64, 13*64, 14*64, 15*64 }, - 16*64 -}; static GFXDECODE_START( gfx_glfgreat ) - GFXDECODE_ENTRY( "zoom", 0, zoomlayout, 0x400, 16 ) + GFXDECODE_ENTRY( "zoom", 0, gfx_16x16x4_packed_lsb, 0x400, 16 ) GFXDECODE_END void glfgreat_state::glfgreat(machine_config &config) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/toaplan2.cpp mame-0.243+dfsg.1/src/mame/drivers/toaplan2.cpp --- mame-0.242+dfsg.1/src/mame/drivers/toaplan2.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/toaplan2.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -3245,17 +3245,6 @@ // Text layer graphics -- ROM based in some games, RAM based in others // See video/gp9001.cpp for the main graphics layouts -static const gfx_layout rom_textlayout = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { STEP4(0,1) }, - { STEP8(0,4) }, - { STEP8(0,4*8) }, - 8*8*4 -}; - #define XOR(a) WORD_XOR_LE(a) #define LOC(x) (x+XOR(0)) @@ -3286,7 +3275,7 @@ GFXDECODE_END static GFXDECODE_START( gfx_textrom ) - GFXDECODE_ENTRY( "text", 0, rom_textlayout, 64*16, 64 ) + GFXDECODE_ENTRY( "text", 0, gfx_8x8x4_packed_msb, 64*16, 64 ) GFXDECODE_END static GFXDECODE_START( gfx_batrider ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/trackfld.cpp mame-0.243+dfsg.1/src/mame/drivers/trackfld.cpp --- mame-0.242+dfsg.1/src/mame/drivers/trackfld.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/trackfld.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -831,17 +831,6 @@ INPUT_PORTS_END -static const gfx_layout charlayout = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { 0, 1, 2, 3 }, - { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4 }, - { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 }, - 32*8 -}; - static const gfx_layout spritelayout = { 16,16, @@ -856,8 +845,8 @@ }; static GFXDECODE_START( gfx_trackfld ) - GFXDECODE_ENTRY( "gfx1", 0, spritelayout, 0, 16 ) - GFXDECODE_ENTRY( "gfx2", 0, charlayout, 16*16, 16 ) + GFXDECODE_ENTRY( "gfx1", 0, spritelayout, 0, 16 ) + GFXDECODE_ENTRY( "gfx2", 0, gfx_8x8x4_packed_msb, 16*16, 16 ) GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/travrusa.cpp mame-0.243+dfsg.1/src/mame/drivers/travrusa.cpp --- mame-0.242+dfsg.1/src/mame/drivers/travrusa.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/travrusa.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -251,17 +251,6 @@ -static const gfx_layout charlayout = -{ - 8,8, - RGN_FRAC(1,3), - 3, - { RGN_FRAC(2,3), RGN_FRAC(1,3), RGN_FRAC(0,3) }, - { 0, 1, 2, 3, 4, 5, 6, 7 }, - { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, - 8*8 -}; - static const gfx_layout spritelayout = { 16,16, @@ -289,12 +278,12 @@ }; static GFXDECODE_START( gfx_travrusa ) - GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 16 ) - GFXDECODE_ENTRY( "gfx2", 0, spritelayout, 16*8, 16 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x3_planar, 0, 16 ) + GFXDECODE_ENTRY( "gfx2", 0, spritelayout, 16*8, 16 ) GFXDECODE_END static GFXDECODE_START( gfx_shtrider ) - GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 16 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x3_planar, 0, 16 ) GFXDECODE_ENTRY( "gfx2", 0, shtrider_spritelayout, 16*8, 16 ) GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/trs80dt1.cpp mame-0.243+dfsg.1/src/mame/drivers/trs80dt1.cpp --- mame-0.242+dfsg.1/src/mame/drivers/trs80dt1.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/trs80dt1.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -77,8 +77,8 @@ void io_map(address_map &map); void prg_map(address_map &map); - bool m_bow = 0; - bool m_cent_busy = 0; + bool m_bow = false; + bool m_cent_busy = false; virtual void machine_reset() override; virtual void machine_start() override; required_shared_ptr m_p_videoram; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/tsamurai.cpp mame-0.243+dfsg.1/src/mame/drivers/tsamurai.cpp --- mame-0.242+dfsg.1/src/mame/drivers/tsamurai.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/tsamurai.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -675,17 +675,6 @@ -static const gfx_layout char_layout = -{ - 8,8, - RGN_FRAC(1,3), - 3, - { RGN_FRAC(2,3), RGN_FRAC(1,3), RGN_FRAC(0,3) }, - { 0,1,2,3, 4,5,6,7 }, - { 0*8,1*8,2*8,3*8,4*8,5*8,6*8,7*8 }, - 8*8 -}; - static const gfx_layout sprite_layout = { 32,32, @@ -707,21 +696,10 @@ 4*256 }; -static const gfx_layout tile_layout = -{ - 8,8, - RGN_FRAC(1,3), - 3, - { RGN_FRAC(2,3), RGN_FRAC(1,3), RGN_FRAC(0,3) }, - { 0,1,2,3,4,5,6,7 }, - { 0*8,1*8,2*8,3*8,4*8,5*8,6*8,7*8 }, - 8*8 -}; - static GFXDECODE_START( gfx_tsamurai ) - GFXDECODE_ENTRY( "gfx1", 0, tile_layout, 0, 32 ) - GFXDECODE_ENTRY( "gfx2", 0, char_layout, 0, 32 ) - GFXDECODE_ENTRY( "gfx3", 0, sprite_layout, 0, 32 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x3_planar, 0, 32 ) + GFXDECODE_ENTRY( "gfx2", 0, gfx_8x8x3_planar, 0, 32 ) + GFXDECODE_ENTRY( "gfx3", 0, sprite_layout, 0, 32 ) GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/ttchamp.cpp mame-0.243+dfsg.1/src/mame/drivers/ttchamp.cpp --- mame-0.242+dfsg.1/src/mame/drivers/ttchamp.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/ttchamp.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -104,7 +104,7 @@ SET_READLATCH = 4 }; - picmode m_picmodex; + picmode m_picmodex{}; int m_pic_readaddr = 0; int m_pic_writeaddr = 0; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/tugboat.cpp mame-0.243+dfsg.1/src/mame/drivers/tugboat.cpp --- mame-0.242+dfsg.1/src/mame/drivers/tugboat.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/tugboat.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -329,33 +329,11 @@ INPUT_PORTS_END -static const gfx_layout charlayout = -{ - 8,8, - RGN_FRAC(1,1), - 1, - { 0 }, - { 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 const gfx_layout tilelayout = -{ - 8,8, - RGN_FRAC(1,3), - 3, - { RGN_FRAC(2,3), RGN_FRAC(1,3), RGN_FRAC(0,3) }, - { 0, 1, 2, 3, 4, 5, 6, 7 }, - { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, - 8*8 -}; - static GFXDECODE_START( gfx_tugboat ) - GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0x80, 16 ) - GFXDECODE_ENTRY( "gfx2", 0, tilelayout, 0x80, 16 ) - GFXDECODE_ENTRY( "gfx3", 0, charlayout, 0x00, 16 ) - GFXDECODE_ENTRY( "gfx4", 0, tilelayout, 0x00, 16 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x1, 0x80, 16 ) + GFXDECODE_ENTRY( "gfx2", 0, gfx_8x8x3_planar, 0x80, 16 ) + GFXDECODE_ENTRY( "gfx3", 0, gfx_8x8x1, 0x00, 16 ) + GFXDECODE_ENTRY( "gfx4", 0, gfx_8x8x3_planar, 0x00, 16 ) GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/twin16.cpp mame-0.243+dfsg.1/src/mame/drivers/twin16.cpp --- mame-0.242+dfsg.1/src/mame/drivers/twin16.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/twin16.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -608,29 +608,16 @@ PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) INPUT_PORTS_END -/* Graphics Layouts */ - -static const gfx_layout tile_layout = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { 0,1,2,3 }, - { STEP8(0, 4) }, - { STEP8(0, 4*8) }, - 4*8*8 -}; - /* Graphics Decode Info */ static GFXDECODE_START( gfx_twin16 ) - GFXDECODE_ENTRY( "fixed", 0, tile_layout, 0, 16 ) - GFXDECODE_RAM( "zipram", 0, tile_layout, 512, 16 ) + GFXDECODE_ENTRY( "fixed", 0, gfx_8x8x4_packed_msb, 0, 16 ) + GFXDECODE_RAM( "zipram", 0, gfx_8x8x4_packed_msb, 512, 16 ) GFXDECODE_END static GFXDECODE_START( gfx_fround ) - GFXDECODE_ENTRY( "fixed", 0, tile_layout, 0, 16 ) - GFXDECODE_ENTRY( "tiles", 0, tile_layout, 512, 16 ) + GFXDECODE_ENTRY( "fixed", 0, gfx_8x8x4_packed_msb, 0, 16 ) + GFXDECODE_ENTRY( "tiles", 0, gfx_8x8x4_packed_msb, 512, 16 ) GFXDECODE_END /* Sound Interfaces */ diff -Nru mame-0.242+dfsg.1/src/mame/drivers/twinkle.cpp mame-0.243+dfsg.1/src/mame/drivers/twinkle.cpp --- mame-0.242+dfsg.1/src/mame/drivers/twinkle.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/twinkle.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -305,15 +305,18 @@ } void twinklex(machine_config &config); + void twinklex2(machine_config &config); void twinklei(machine_config &config); void twinkle(machine_config &config); + void twinkle_dvd_type1(machine_config &config); + void twinkle_dvd_type2(machine_config &config); private: virtual void machine_start() override; void twinkle_io_w(offs_t offset, uint8_t data); uint8_t twinkle_io_r(offs_t offset); - void twinkle_output_w(offs_t offset, uint16_t data); + void twinkle_videomixer_w(offs_t offset, uint16_t data); void led_w(uint16_t data); void key_led_w(uint16_t data); void serial_w(uint16_t data); @@ -691,21 +694,71 @@ return data; } -void twinkle_state::twinkle_output_w(offs_t offset, uint16_t data) +void twinkle_state::twinkle_videomixer_w(offs_t offset, uint16_t data) { + // Bt812 NTSC/PAL to RGB/YCrCb Decoder chip switch( offset ) { case 0x00: - /* offset */ + /* + Address Register offset + 0x00 Command Register 0, Input Select Register + 0x01 Reserved + 0x02 Command Register 2, Status Register + 0x03 Command Register 3, Output Format Register + 0x04 Command Register 4, Operation Mode Select Register + 0x05 Command Register 5, Input Format Register + 0x06 Command Register 6, Clock Definition Register + 0x07 Command Register 7, Video Timing Definition Register + 0x08 Brightness Adjust Register (range: -64 to +63) + 0x09 Contrast Adjust Register (range: 0 to 198.44%) + 0x0a Saturation Adjust Register (range: 0 to 198.44%) + 0x0b Hue Adjust Register (range: -45 to +44.3) + 0x0c HCLOCK Low Register + 0x0d HCLOCK High Register + 0x0e HDELAY Low Register + 0x0f HDELAY High Register + 0x10 ACTIVE_PIXELS Low Register + 0x11 ACTIVE_PIXELS High Register + 0x12 VDELAY Low Register + 0x13 VDELAY High Register + 0x14 ACTIVE_LINES Low Register + 0x15 ACTIVE_LINES High Register + 0x16 P (subcarrier freq) Register 0 + 0x17 P (subcarrier freq) Register 1 + 0x18 P (subcarrier freq) Register 2 + 0x19 AGC Delay Register + 0x1a Burst Delay Register + 0x1b Sample Rate Conversion Low Register + 0x1c Sample Rate Conversion High Register + 0x1d Command Register 1D, Video Timing Polarity Register + 0x1e-0xfe Reserved + 0xff Software Reset + */ break; case 0x04: - /* data */ + /* + Register data + Uses offset given in the address register offset command. + + Game initialized values: + HCLOCK 853 + HDELAY 126 + ACTIVE_PIXELS 706 + VDELAY 22 + ACTIVE_LINES 16 + */ break; case 0x08: - // overlay enable? + // Status bits? + // Seen values: + // 0x01 - ? + // 0x02 - Perform overlay mixing + // 0x08 - ? break; case 0x10: { + // Always writes 0x214 and 0x128 here? int clock = (data >> 0) & 1; int _do = (data >> 1) & 1; int cs = (data >> 2) & 1; @@ -738,13 +791,13 @@ } break; case 0x18: - /* ?? */ + // Always 0x69? break; case 0x30: - /* ?? */ + // Always 0x10? break; case 0x48: - /* ?? */ + // 0x20 - Powered on? break; } } @@ -835,7 +888,7 @@ map(0x1f280000, 0x1f280003).portr("INSEC"); map(0x1f290000, 0x1f29007f).rw("rtc", FUNC(rtc65271_device::rtc_r), FUNC(rtc65271_device::rtc_w)).umask32(0x00ff00ff); map(0x1f2a0000, 0x1f2a007f).rw("rtc", FUNC(rtc65271_device::xram_r), FUNC(rtc65271_device::xram_w)).umask32(0x00ff00ff); - map(0x1f2b0000, 0x1f2b00ff).w(FUNC(twinkle_state::twinkle_output_w)); + map(0x1f2b0000, 0x1f2b00ff).w(FUNC(twinkle_state::twinkle_videomixer_w)); } /* SPU board */ @@ -1094,21 +1147,6 @@ FDC37C665GT(config, "fdc37c665gt", XTAL(24'000'000)); - rs232_port_device &rs232(RS232_PORT(config, "rs232", 0)); - rs232.option_add("xvd701", JVC_XVD701); -// rs232.option_add("xvs1100", JVC_XVS1100); // 8th mix only - rs232.set_default_option("xvd701"); - rs232.rxd_handler().set("fdc37c665gt:uart2", FUNC(ins8250_uart_device::rx_w)); - rs232.dcd_handler().set("fdc37c665gt:uart2", FUNC(ins8250_uart_device::dcd_w)); - rs232.dsr_handler().set("fdc37c665gt:uart2", FUNC(ins8250_uart_device::dsr_w)); - rs232.ri_handler().set("fdc37c665gt:uart2", FUNC(ins8250_uart_device::ri_w)); - rs232.cts_handler().set("fdc37c665gt:uart2", FUNC(ins8250_uart_device::cts_w)); - - ns16550_device &uart(*subdevice("fdc37c665gt:uart2")); - uart.out_tx_callback().set("rs232", FUNC(rs232_port_device::write_txd)); - uart.out_dtr_callback().set("rs232", FUNC(rs232_port_device::write_dtr)); - uart.out_rts_callback().set("rs232", FUNC(rs232_port_device::write_rts)); - /* video hardware */ CXD8561Q(config, "gpu", XTAL(53'693'175), 0x200000, subdevice("maincpu")).set_screen("screen"); @@ -1130,15 +1168,82 @@ rf5c400.add_route(1, "speakerright", 1.0); } +void twinkle_state::twinkle_dvd_type1(machine_config &config) +{ + // All versions before beatmania IIDX 2nd style + // - maincpu:sio1 (PSX SIO1) is used for the DVD player + // - fdc37c665gt:uart2 is used for network/session play + rs232_port_device &rs232(RS232_PORT(config, "rs232_dvd", 0)); + rs232.option_add("xvd701", JVC_XVD701); + rs232.set_default_option("xvd701"); + + // TODO: CTS isn't implemented in SIO but it's required to fix the DVD player error for very early IIDX games + auto sio1 = subdevice("maincpu:sio1"); + rs232.rxd_handler().set(*sio1, FUNC(psxsio1_device::write_rxd)); + rs232.dsr_handler().set(*sio1, FUNC(psxsio1_device::write_dsr)); + //rs232.cts_handler().set(*sio1, FUNC(psxsio1_device::write_cts)); + sio1->txd_handler().set(rs232, FUNC(rs232_port_device::write_txd)); + sio1->dtr_handler().set(rs232, FUNC(rs232_port_device::write_dtr)); + sio1->rts_handler().set(rs232, FUNC(rs232_port_device::write_rts)); + + ns16550_device &uart(*subdevice("fdc37c665gt:uart2")); + rs232_port_device &rs232_network(RS232_PORT(config, "rs232_network", default_rs232_devices, nullptr)); + uart.out_tx_callback().set(rs232_network, FUNC(rs232_port_device::write_txd)); + uart.out_dtr_callback().set(rs232_network, FUNC(rs232_port_device::write_dtr)); + uart.out_rts_callback().set(rs232_network, FUNC(rs232_port_device::write_rts)); + rs232_network.rxd_handler().set(uart, FUNC(ns16550_device::rx_w)); + rs232_network.dcd_handler().set(uart, FUNC(ns16550_device::dcd_w)); + rs232_network.dsr_handler().set(uart, FUNC(ns16550_device::dsr_w)); + rs232_network.ri_handler().set(uart, FUNC(ns16550_device::ri_w)); + rs232_network.cts_handler().set(uart, FUNC(ns16550_device::cts_w)); +} + +void twinkle_state::twinkle_dvd_type2(machine_config &config) +{ + // All versions starting from beatmania IIDX 2nd style + // - fdc37c665gt:uart2 is used for the DVD player + // - maincpu:sio1 (PSX SIO1) is used for network/session play + rs232_port_device &rs232(RS232_PORT(config, "rs232_dvd", 0)); + rs232.option_add("xvd701", JVC_XVD701); + // rs232.option_add("xvs1100", JVC_XVS1100); // 8th mix only + rs232.set_default_option("xvd701"); + + auto sio1 = subdevice("maincpu:sio1"); + rs232_port_device &rs232_network(RS232_PORT(config, "rs232_network", default_rs232_devices, nullptr)); + sio1->txd_handler().set(rs232_network, FUNC(rs232_port_device::write_txd)); + sio1->dtr_handler().set(rs232_network, FUNC(rs232_port_device::write_dtr)); + rs232_network.rxd_handler().set(*sio1, FUNC(psxsio1_device::write_rxd)); + rs232_network.dsr_handler().set(*sio1, FUNC(psxsio1_device::write_dsr)); + + ns16550_device &uart(*subdevice("fdc37c665gt:uart2")); + uart.out_tx_callback().set(rs232, FUNC(rs232_port_device::write_txd)); + uart.out_dtr_callback().set(rs232, FUNC(rs232_port_device::write_dtr)); + uart.out_rts_callback().set(rs232, FUNC(rs232_port_device::write_rts)); + rs232.rxd_handler().set(uart, FUNC(ns16550_device::rx_w)); + rs232.dcd_handler().set(uart, FUNC(ns16550_device::dcd_w)); + rs232.dsr_handler().set(uart, FUNC(ns16550_device::dsr_w)); + rs232.ri_handler().set(uart, FUNC(ns16550_device::ri_w)); + rs232.cts_handler().set(uart, FUNC(ns16550_device::cts_w)); +} + void twinkle_state::twinklex(machine_config &config) { twinkle(config); + twinkle_dvd_type1(config); + X76F041(config, "security"); +} + +void twinkle_state::twinklex2(machine_config &config) +{ + twinkle(config); + twinkle_dvd_type2(config); X76F041(config, "security"); } void twinkle_state::twinklei(machine_config &config) { twinkle(config); + twinkle_dvd_type2(config); I2C_M24C02(config, "security", 0); // M24C02-W } @@ -1530,9 +1635,9 @@ GAMEL( 1999, bmiidxa, bmiidx, twinklex, twinklex, twinkle_state, empty_init, ROT0, "Konami", "beatmania IIDX (863 JAA)", MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING, layout_bmiidx ) GAMEL( 1999, bmiidxc, gq863, twinklex, twinklex, twinkle_state, empty_init, ROT0, "Konami", "beatmania IIDX with DDR 2nd Club Version (896 JAB)", MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING, layout_bmiidx ) GAMEL( 1999, bmiidxca, bmiidxc, twinklex, twinklex, twinkle_state, empty_init, ROT0, "Konami", "beatmania IIDX with DDR 2nd Club Version (896 JAA)", MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING, layout_bmiidx ) -GAMEL( 1999, bmiidxs, gq863, twinklex, twinklex, twinkle_state, empty_init, ROT0, "Konami", "beatmania IIDX Substream (983 JAA)", MACHINE_IMPERFECT_SOUND, layout_bmiidx ) -GAMEL( 1999, bmiidxsa, bmiidxs, twinklex, twinklex, twinkle_state, empty_init, ROT0, "Konami", "beatmania IIDX Substream (983-AA JAA)", MACHINE_IMPERFECT_SOUND, layout_bmiidx ) -GAMEL( 1999, bmiidxc2, gq863, twinklex, twinklex, twinkle_state, empty_init, ROT0, "Konami", "beatmania IIDX Substream with DDR 2nd Club Version 2 (984 A01 BM)", MACHINE_IMPERFECT_SOUND, layout_bmiidx ) +GAMEL( 1999, bmiidxs, gq863, twinklex2,twinklex, twinkle_state, empty_init, ROT0, "Konami", "beatmania IIDX Substream (983 JAA)", MACHINE_IMPERFECT_SOUND, layout_bmiidx ) +GAMEL( 1999, bmiidxsa, bmiidxs, twinklex2,twinklex, twinkle_state, empty_init, ROT0, "Konami", "beatmania IIDX Substream (983-AA JAA)", MACHINE_IMPERFECT_SOUND, layout_bmiidx ) +GAMEL( 1999, bmiidxc2, gq863, twinklex2,twinklex, twinkle_state, empty_init, ROT0, "Konami", "beatmania IIDX Substream with DDR 2nd Club Version 2 (984 A01 BM)", MACHINE_IMPERFECT_SOUND, layout_bmiidx ) GAMEL( 1999, bmiidx2, gq863, twinklei, twinklei, twinkle_state, empty_init, ROT0, "Konami", "beatmania IIDX 2nd style (GC985 JAA)", MACHINE_IMPERFECT_SOUND, layout_bmiidx ) GAMEL( 2000, bmiidx3, gq863, twinklei, twinklei, twinkle_state, empty_init, ROT0, "Konami", "beatmania IIDX 3rd style (GC992 JAC)", MACHINE_IMPERFECT_SOUND, layout_bmiidx ) GAMEL( 2000, bmiidx3b, bmiidx3, twinklei, twinklei, twinkle_state, empty_init, ROT0, "Konami", "beatmania IIDX 3rd style (GC992 JAB)", MACHINE_IMPERFECT_SOUND, layout_bmiidx ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/unior.cpp mame-0.243+dfsg.1/src/mame/drivers/unior.cpp --- mame-0.242+dfsg.1/src/mame/drivers/unior.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/unior.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -2,14 +2,14 @@ // copyright-holders:Robbbert /************************************************************************************************ - Unior +Unior - 2009-05-12 Skeleton driver. - 2013-10-09 Added DMA and CRTC - 2013-10-11 Added PPI, PIT, UART, sound +2009-05-12 Skeleton driver. +2013-10-09 Added DMA and CRTC +2013-10-11 Added PPI, PIT, UART, sound - Some info obtained from EMU-80. - The schematic is difficult to read, and some code is guesswork. +Some info obtained from EMU-80. +The schematic is difficult to read, and some code is guesswork. The monitor will only allow certain characters to be typed, thus the modifier keys appear to do nothing. There is no need to use the enter @@ -95,7 +95,7 @@ u8 m_4c = 0U; u8 m_4e = 0U; - bool m_txe = 0, m_txd = 0, m_rts = 0, m_casspol = 0; + bool m_txe = false, m_txd = false, m_rts = false, m_casspol = false; u8 m_cass_data[4]{}; virtual void machine_reset() override; virtual void machine_start() override; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/univac.cpp mame-0.243+dfsg.1/src/mame/drivers/univac.cpp --- mame-0.242+dfsg.1/src/mame/drivers/univac.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/univac.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -210,22 +210,22 @@ u16 m_disp_mask = 0U; u16 m_bank_mask = 0U; - bool m_parity_poison = 0; - bool m_display_enable = 0; + bool m_parity_poison = false; + bool m_display_enable = false; u8 m_framecnt = 0U; - bool m_nvram_protect = 0; + bool m_nvram_protect = false; - bool m_alarm_enable = 0; - bool m_alarm_toggle = 0; + bool m_alarm_enable = false; + bool m_alarm_toggle = false; - bool m_loopback_control = 0; - bool m_comm_rxd = 0; - bool m_sio_txda = 0; - bool m_aux_rxd = 0; - bool m_sio_txdb = 0; - bool m_sio_rtsb = 0; - bool m_aux_dsr = 0; - bool m_sio_wrdyb = 0; + bool m_loopback_control = false; + bool m_comm_rxd = false; + bool m_sio_txda = false; + bool m_aux_rxd = false; + bool m_sio_txdb = false; + bool m_sio_rtsb = false; + bool m_aux_dsr = false; + bool m_sio_wrdyb = false; }; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/unkpoker.cpp mame-0.243+dfsg.1/src/mame/drivers/unkpoker.cpp --- mame-0.242+dfsg.1/src/mame/drivers/unkpoker.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/unkpoker.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -138,20 +138,8 @@ INPUT_PORTS_END -static const gfx_layout tiles8x8_layout = -{ - 8,8, - RGN_FRAC(1,1), - 1, - { 0 }, - { 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_unkpoker ) - GFXDECODE_ENTRY( "gfx1", 0, tiles8x8_layout, 0, 1 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x1, 0, 1 ) GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/ut88.cpp mame-0.243+dfsg.1/src/mame/drivers/ut88.cpp --- mame-0.242+dfsg.1/src/mame/drivers/ut88.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/ut88.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -2,10 +2,10 @@ // copyright-holders:Miodrag Milanovic /*************************************************************************** - UT88 driver by Miodrag Milanovic +UT88 driver by Miodrag Milanovic - 09/03/2008 Keyboard fixed, sound added. - 06/03/2008 Preliminary driver. +2008-03-09 Keyboard fixed, sound added. +2008-03-06 Preliminary driver. UT88MINI ******** diff -Nru mame-0.242+dfsg.1/src/mame/drivers/v6809.cpp mame-0.243+dfsg.1/src/mame/drivers/v6809.cpp --- mame-0.242+dfsg.1/src/mame/drivers/v6809.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/v6809.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -2,9 +2,9 @@ // copyright-holders:Robbbert /********************************************************************************************** - Vegas 6809 +Vegas 6809 - Skeleton driver +Skeleton driver Devices: @@ -31,16 +31,16 @@ ToDo: - - Colours (Looks like characters 0xc0-0xff produce coloured lores gfx). +- Colours (Looks like characters 0xc0-0xff produce coloured lores gfx). - - Connect the RTC interrupt pin (not supported currently) +- Connect the RTC interrupt pin (not supported currently) - - Find the missing character generator rom. +- Find the missing character generator rom. - - Schematic is almost useless, riddled with omissions and errors. All documents are in - French. The parts list only has half of the parts. +- Schematic is almost useless, riddled with omissions and errors. All documents are in + French. The parts list only has half of the parts. - - Need software (there are floppy images, but they are not yet in a supported format) +- Need software (there are floppy images, but they are not yet in a supported format) *******************************************************************************************/ diff -Nru mame-0.242+dfsg.1/src/mame/drivers/vcs80.cpp mame-0.243+dfsg.1/src/mame/drivers/vcs80.cpp --- mame-0.242+dfsg.1/src/mame/drivers/vcs80.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/vcs80.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -57,7 +57,6 @@ , m_bdmem(*this, "bdmem") , m_display(*this, "display") , m_io_keyboard(*this, "Y%u", 0U) - , m_keyclk(0) { } void vcs80(machine_config &config); @@ -102,7 +101,7 @@ } /* keyboard state */ - bool m_keyclk = 0; + bool m_keyclk = false; u8 m_digit = 0U; u8 m_seg = 0U; void init_vcs80(); diff -Nru mame-0.242+dfsg.1/src/mame/drivers/vd.cpp mame-0.243+dfsg.1/src/mame/drivers/vd.cpp --- mame-0.242+dfsg.1/src/mame/drivers/vd.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/vd.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -60,7 +60,7 @@ void io_map(address_map &map); void mem_map(address_map &map); - bool m_ready = 0; + bool m_ready = false; u8 m_t_c = 0U; u8 m_game = 0U; u8 m_segment[5]{}; @@ -355,5 +355,5 @@ } // Anonymous namespace -GAME(1986, break86, 0, vd, break86, vd_state, init_0, ROT0, "Video Dens", "Break '86", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1986, papillon, 0, vd, papillon, vd_state, init_1, ROT0, "Video Dens", "Papillon", MACHINE_IS_SKELETON_MECHANICAL) +GAME(1986, break86, 0, vd, break86, vd_state, init_0, ROT0, "Video Dens", "Break '86", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1986, papillon, 0, vd, papillon, vd_state, init_1, ROT0, "Video Dens", "Papillon", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/vegas.cpp mame-0.243+dfsg.1/src/mame/drivers/vegas.cpp --- mame-0.242+dfsg.1/src/mame/drivers/vegas.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/vegas.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -274,6 +274,7 @@ #include "emu.h" #include "audio/dcs.h" +#include "machine/midwayic.h" #include "bus/ata/idehd.h" #include "bus/rs232/rs232.h" @@ -282,7 +283,6 @@ #include "machine/idectrl.h" #include "machine/input_merger.h" #include "machine/ins8250.h" -#include "machine/midwayic.h" #include "machine/pci-ide.h" #include "machine/pci.h" #include "machine/smc91c9x.h" @@ -472,6 +472,8 @@ void vegas_cs6_map(address_map &map); void vegas_cs7_map(address_map &map); void vegas_cs8_map(address_map &map); + + static void hdd_config(device_t *device); }; /************************************* @@ -483,7 +485,10 @@ void vegas_state::machine_start() { /* set the fastest DRC options, but strict verification */ - m_maincpu->mips3drc_set_options(MIPS3DRC_FASTEST_OPTIONS + MIPS3DRC_STRICT_VERIFY); + /* need to check the current options since some drivers add options in their init */ + uint32_t new_options = m_maincpu->mips3drc_get_options(); + new_options |= MIPS3DRC_FASTEST_OPTIONS | MIPS3DRC_STRICT_VERIFY; + m_maincpu->mips3drc_set_options(new_options); m_system_led.resolve(); m_wheel_driver.resolve(); @@ -542,12 +547,6 @@ m_wheel_offset = 0; m_wheel_calibrated = false; - // Set the disk dma transfer speed - auto *hdd = subdevice(PCI_ID_IDE":ide:0:hdd"); - hdd->set_dma_transfer_time(attotime::from_usec(15)); - // Allow ultra dma - //uint16_t *identify_device = hdd->identify_device_buffer(); - //identify_device[88] = 0x7f; } /************************************* @@ -1926,6 +1925,7 @@ ide_pci_device &ide(IDE_PCI(config, PCI_ID_IDE, 0, 0x10950646, 0x05, 0x0)); ide.irq_handler().set(PCI_ID_NILE, FUNC(vrc5074_device::pci_intr_d)); //ide.set_pif(0x8f); + ide.subdevice("ide")->slot(0).set_option_machine_config("hdd", hdd_config); // video hardware voodoo_2_pci_device &voodoo(VOODOO_2_PCI(config, PCI_ID_VIDEO, 0, m_maincpu, "screen")); @@ -1950,6 +1950,16 @@ screen.set_screen_update(PCI_ID_VIDEO, FUNC(voodoo_pci_device::screen_update)); } +void vegas_state::hdd_config(device_t *device) +{ + // Set the disk dma transfer speed + dynamic_cast(device)->set_dma_transfer_time(attotime::from_usec(15)); + // Allow ultra dma + //uint16_t *identify_device = dynamic_cast(device)->identify_device_buffer(); + //identify_device[88] = 0x7f; + +} + void vegas_state::vegas(machine_config &config) { @@ -2027,14 +2037,14 @@ m_uart2->out_rts_callback().set("ttys02", FUNC(rs232_port_device::write_rts)); m_uart2->out_int_callback().set("duart_irq", FUNC(input_merger_device::in_w<1>)); - rs232_port_device &ttys01(RS232_PORT(config, "ttys01", 0)); + rs232_port_device &ttys01(RS232_PORT(config, "ttys01", default_rs232_devices, nullptr)); ttys01.rxd_handler().set(m_uart1, FUNC(ins8250_uart_device::rx_w)); ttys01.dcd_handler().set(m_uart1, FUNC(ins8250_uart_device::dcd_w)); ttys01.dsr_handler().set(m_uart1, FUNC(ins8250_uart_device::dsr_w)); ttys01.ri_handler().set(m_uart1, FUNC(ins8250_uart_device::ri_w)); ttys01.cts_handler().set(m_uart1, FUNC(ins8250_uart_device::cts_w)); - rs232_port_device &ttys02(RS232_PORT(config, "ttys02", 0)); + rs232_port_device &ttys02(RS232_PORT(config, "ttys02", default_rs232_devices, nullptr)); ttys02.rxd_handler().set(m_uart2, FUNC(ins8250_uart_device::rx_w)); ttys02.dcd_handler().set(m_uart2, FUNC(ins8250_uart_device::dcd_w)); ttys02.dsr_handler().set(m_uart2, FUNC(ins8250_uart_device::dsr_w)); @@ -2047,7 +2057,9 @@ void vegas_state::gauntleg(machine_config &config) { - vegas(config); + // Needs 250MHz MIPS or screen tearing occurs (See MT8064) + // Firmware frequency detection seems to have a bug, console reports 220MHz for a 200MHz cpu and 260MHz for a 250MHz cpu + vegas250(config); dcs2_audio_2104_device &dcs(DCS2_AUDIO_2104(config, "dcs", 0)); dcs.set_dram_in_mb(4); dcs.set_polling_offset(0x0b5d); @@ -2062,7 +2074,8 @@ void vegas_state::gauntdl(machine_config &config) { - vegas(config); + // Needs 250MHz MIPS or screen tearing occurs (See MT8064) + vegas250(config); dcs2_audio_2104_device &dcs(DCS2_AUDIO_2104(config, "dcs", 0)); dcs.set_dram_in_mb(4); dcs.set_polling_offset(0x0b5d); @@ -2614,11 +2627,13 @@ void vegas_state::init_nbashowt() { + m_maincpu->mips3drc_set_options(MIPS3DRC_FASTEST_OPTIONS | MIPS3DRC_STRICT_VERIFY | MIPS3DRC_EXTRA_INSTR_CHECK); } void vegas_state::init_nbanfl() { + m_maincpu->mips3drc_set_options(MIPS3DRC_FASTEST_OPTIONS | MIPS3DRC_STRICT_VERIFY | MIPS3DRC_EXTRA_INSTR_CHECK); // The first three bytes of the blitz00_nov30_1999.u27 ROM are FF's which breaks the reset vector. // These bytes are from blitz00_sep22_1999.u27 which allows the other ROM to start. // The last byte which is part of the checksum is also FF. By changing it to 0x01 the 4 byte checksum matches with the other 3 changes. @@ -2632,6 +2647,7 @@ void vegas_state::init_nbagold() { + m_maincpu->mips3drc_set_options(MIPS3DRC_FASTEST_OPTIONS | MIPS3DRC_STRICT_VERIFY | MIPS3DRC_EXTRA_INSTR_CHECK); } @@ -2674,10 +2690,10 @@ // Vegas/Durango + Vegas SIO + Voodoo 2 GAME( 1999, gauntdl, 0, gauntdl, gauntleg, vegas_state, init_gauntdl, ROT0, "Midway Games", "Gauntlet Dark Legacy (version DL 2.52)", MACHINE_SUPPORTS_SAVE ) GAME( 1999, gauntdl24, gauntdl, gauntdl, gauntleg, vegas_state, init_gauntdl, ROT0, "Midway Games", "Gauntlet Dark Legacy (version DL 2.4)", MACHINE_SUPPORTS_SAVE ) -GAME( 1999, warfa, 0, warfa, warfa, vegas_state, init_warfa, ROT0, "Atari Games", "War: The Final Assault (EPROM 1.9 Mar 25 1999, GUTS 1.3 Apr 20 1999, GAME Apr 20 1999)", MACHINE_SUPPORTS_SAVE ) -GAME( 1999, warfaa, warfa, warfa, warfa, vegas_state, init_warfa, ROT0, "Atari Games", "War: The Final Assault (EPROM 1.6 Jan 14 1999, GUTS 1.1 Mar 16 1999, GAME Mar 16 1999)", MACHINE_SUPPORTS_SAVE ) -GAME( 1999, warfab, warfa, warfa, warfa, vegas_state, init_warfa, ROT0, "Atari Games", "War: The Final Assault (EPROM 1.3 Apr 7 1999, GUTS 1.3 Apr 7 1999, GAME Apr 7 1999)", MACHINE_SUPPORTS_SAVE ) // version numbers comes from test mode, can be unreliable -GAME( 1999, warfac, warfa, warfa, warfa, vegas_state, init_warfa, ROT0, "Atari Games", "War: The Final Assault (EPROM 1.91 Apr 13 1999, GUTS 1.3 Apr 7 1999, GAME Apr 7 1999)", MACHINE_SUPPORTS_SAVE ) +GAME( 1999, warfa, 0, warfa, warfa, vegas_state, init_warfa, ROT0, "Atari Games", "War: Final Assault (EPROM 1.9 Mar 25 1999, GUTS 1.3 Apr 20 1999, GAME Apr 20 1999)", MACHINE_SUPPORTS_SAVE ) +GAME( 1999, warfaa, warfa, warfa, warfa, vegas_state, init_warfa, ROT0, "Atari Games", "War: Final Assault (EPROM 1.6 Jan 14 1999, GUTS 1.1 Mar 16 1999, GAME Mar 16 1999)", MACHINE_SUPPORTS_SAVE ) +GAME( 1999, warfab, warfa, warfa, warfa, vegas_state, init_warfa, ROT0, "Atari Games", "War: Final Assault (EPROM 1.3 Apr 7 1999, GUTS 1.3 Apr 7 1999, GAME Apr 7 1999)", MACHINE_SUPPORTS_SAVE ) // version numbers comes from test mode, can be unreliable +GAME( 1999, warfac, warfa, warfa, warfa, vegas_state, init_warfa, ROT0, "Atari Games", "War: Final Assault (EPROM 1.91 Apr 13 1999, GUTS 1.3 Apr 7 1999, GAME Apr 7 1999)", MACHINE_SUPPORTS_SAVE ) // Durango + DSIO + Voodoo 2 GAME( 1999, roadburn, 0, roadburn, roadburn, vegas_state, init_roadburn, ROT0, "Atari Games", "Road Burners (ver 1.04)", MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/vendetta.cpp mame-0.243+dfsg.1/src/mame/drivers/vendetta.cpp --- mame-0.242+dfsg.1/src/mame/drivers/vendetta.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/vendetta.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -88,17 +88,187 @@ ***************************************************************************/ #include "emu.h" -#include "includes/vendetta.h" + #include "includes/konamipt.h" +#include "video/k052109.h" +#include "video/k053246_k053247_k055673.h" +#include "video/k053251.h" +#include "video/k054000.h" +#include "video/konami_helper.h" +#include "cpu/m6809/konami.h" // for the callback and the firq irq definition #include "cpu/z80/z80.h" #include "machine/eepromser.h" +#include "machine/k053252.h" #include "machine/watchdog.h" #include "sound/k053260.h" #include "sound/ymopm.h" + +#include "emupal.h" #include "speaker.h" +namespace { + +class vendetta_state : public driver_device +{ +public: + vendetta_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_k052109(*this, "k052109"), + m_k053246(*this, "k053246"), + m_k053251(*this, "k053251"), + m_k053252(*this, "k053252"), + m_k054000(*this, "k054000"), + m_palette(*this, "palette"), + m_videoview0(*this, "videoview0"), + m_videoview1(*this, "videoview1"), + m_mainbank(*this, "mainbank"), + m_eeprom_out(*this, "EEPROMOUT") + { } + + void esckids(machine_config &config); + void vendetta(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + +private: + // video-related + uint8_t m_layer_colorbase[3]{}; + uint8_t m_sprite_colorbase = 0; + int m_layerpri[3]{}; + + // misc + uint8_t m_irq_enabled = 0; + emu_timer *m_z80_nmi_timer; + + // devices + required_device m_maincpu; + required_device m_audiocpu; + required_device m_k052109; + required_device m_k053246; + required_device m_k053251; + optional_device m_k053252; + optional_device m_k054000; + required_device m_palette; + + // views + memory_view m_videoview0; + memory_view m_videoview1; + + required_memory_bank m_mainbank; + + required_ioport m_eeprom_out; + + void eeprom_w(uint8_t data); + uint8_t K052109_r(offs_t offset); + void K052109_w(offs_t offset, uint8_t data); + void _5fe0_w(uint8_t data); + void z80_arm_nmi_w(uint8_t data); + void z80_irq_w(uint8_t data); + uint8_t z80_irq_r(); + + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + INTERRUPT_GEN_MEMBER(irq); + TIMER_CALLBACK_MEMBER(z80_nmi); + + K052109_CB_MEMBER(vendetta_tile_callback); + K052109_CB_MEMBER(esckids_tile_callback); + void banking_callback(uint8_t data); + K053246_CB_MEMBER(sprite_callback); + + void esckids_map(address_map &map); + void main_map(address_map &map); + void sound_map(address_map &map); +}; + + +// video + +/*************************************************************************** + + Callbacks for the K052109 + +***************************************************************************/ + +K052109_CB_MEMBER(vendetta_state::vendetta_tile_callback) +{ + *code |= ((*color & 0x03) << 8) | ((*color & 0x30) << 6) | ((*color & 0x0c) << 10) | (bank << 14); + *color = m_layer_colorbase[layer] + ((*color & 0xc0) >> 6); +} + +K052109_CB_MEMBER(vendetta_state::esckids_tile_callback) +{ + *code |= ((*color & 0x03) << 8) | ((*color & 0x10) << 6) | ((*color & 0x0c) << 9) | (bank << 13); + *color = m_layer_colorbase[layer] + ((*color & 0xe0) >> 5); +} + + +/*************************************************************************** + + Callbacks for the K053247 + +***************************************************************************/ + +K053246_CB_MEMBER(vendetta_state::sprite_callback) +{ + int pri = (*color & 0x03e0) >> 4; // ??????? + if (pri <= m_layerpri[2]) + *priority_mask = 0; + else if (pri > m_layerpri[2] && pri <= m_layerpri[1]) + *priority_mask = 0xf0; + else if (pri > m_layerpri[1] && pri <= m_layerpri[0]) + *priority_mask = 0xf0 | 0xcc; + else + *priority_mask = 0xf0 | 0xcc | 0xaa; + + *color = m_sprite_colorbase + (*color & 0x001f); +} + + +/*************************************************************************** + + Display refresh + +***************************************************************************/ + +uint32_t vendetta_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + int layer[3]; + + m_sprite_colorbase = m_k053251->get_palette_index(k053251_device::CI1); + m_layer_colorbase[0] = m_k053251->get_palette_index(k053251_device::CI2); + m_layer_colorbase[1] = m_k053251->get_palette_index(k053251_device::CI3); + m_layer_colorbase[2] = m_k053251->get_palette_index(k053251_device::CI4); + + m_k052109->tilemap_update(); + + layer[0] = 0; + m_layerpri[0] = m_k053251->get_priority(k053251_device::CI2); + layer[1] = 1; + m_layerpri[1] = m_k053251->get_priority(k053251_device::CI3); + layer[2] = 2; + m_layerpri[2] = m_k053251->get_priority(k053251_device::CI4); + + konami_sortlayers3(layer, m_layerpri); + + screen.priority().fill(0, cliprect); + m_k052109->tilemap_draw(screen, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 1); + m_k052109->tilemap_draw(screen, bitmap, cliprect, layer[1], 0, 2); + m_k052109->tilemap_draw(screen, bitmap, cliprect, layer[2], 0, 4); + + m_k053246->k053247_sprites_draw(bitmap, cliprect); + return 0; +} + + +// machine + /*************************************************************************** EEPROM @@ -107,21 +277,21 @@ void vendetta_state::eeprom_w(uint8_t data) { - /* bit 0 - VOC0 - Video banking related */ - /* bit 1 - VOC1 - Video banking related */ - /* bit 2 - MSCHNG - Mono Sound select (Amp) */ - /* bit 3 - EEPCS - EEPROM CS */ - /* bit 4 - EEPCLK - EEPROM clock */ - /* bit 5 - EEPDI - EEPROM data */ - /* bit 6 - IRQ enable */ - /* bit 7 - Unused */ + // bit 0 - VOC0 - Video banking related + // bit 1 - VOC1 - Video banking related + // bit 2 - MSCHNG - Mono Sound select (Amp) + // bit 3 - EEPCS - EEPROM CS + // bit 4 - EEPCLK - EEPROM clock + // bit 5 - EEPDI - EEPROM data + // bit 6 - IRQ enable + // bit 7 - Unused - if (data == 0xff ) /* this is a bug in the EEPROM write code */ + if (data == 0xff ) // this is a bug in the EEPROM write code return; - /* EEPROM */ - ioport("EEPROMOUT")->write(data, 0xff); + // EEPROM + m_eeprom_out->write(data, 0xff); m_irq_enabled = (data >> 6) & 1; @@ -150,38 +320,31 @@ void vendetta_state::_5fe0_w(uint8_t data) { - /* bit 0,1 coin counters */ + // bit 0,1 coin counters machine().bookkeeping().coin_counter_w(0, data & 0x01); machine().bookkeeping().coin_counter_w(1, data & 0x02); - /* bit 2 = BRAMBK ?? */ + // bit 2 = BRAMBK ?? - /* bit 3 = enable char ROM reading through the video RAM */ + // bit 3 = enable char ROM reading through the video RAM m_k052109->set_rmrd_line((data & 0x08) ? ASSERT_LINE : CLEAR_LINE); - /* bit 4 = INIT ?? */ + // bit 4 = INIT ?? - /* bit 5 = enable sprite ROM reading */ + // bit 5 = enable sprite ROM reading m_k053246->k053246_set_objcha_line((data & 0x20) ? ASSERT_LINE : CLEAR_LINE); } -void vendetta_state::device_timer(emu_timer &timer, device_timer_id id, int param) +TIMER_CALLBACK_MEMBER(vendetta_state::z80_nmi) { - switch (id) - { - case TIMER_Z80_NMI: - m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); - break; - default: - throw emu_fatalerror("Unknown id in vendetta_state::device_timer"); - } + m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); } void vendetta_state::z80_arm_nmi_w(uint8_t data) { m_audiocpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); - timer_set(attotime::from_usec(25), TIMER_Z80_NMI); + m_z80_nmi_timer->adjust(attotime::from_usec(25)); } void vendetta_state::z80_irq_w(uint8_t data) @@ -199,10 +362,10 @@ void vendetta_state::main_map(address_map &map) { - map(0x0000, 0x1fff).bankr("bank1"); + map(0x0000, 0x1fff).bankr(m_mainbank); map(0x2000, 0x3fff).ram(); - /* what is the desired effect of overlapping these memory regions anyway? */ + // what is the desired effect of overlapping these memory regions anyway? map(0x4000, 0x7fff).rw(m_k052109, FUNC(k052109_device::read), FUNC(k052109_device::write)); map(0x4000, 0x4fff).view(m_videoview0); @@ -232,7 +395,7 @@ void vendetta_state::esckids_map(address_map &map) { map(0x0000, 0x1fff).ram(); // 053248 64K SRAM - /* what is the desired effect of overlapping these memory regions anyway? */ + // what is the desired effect of overlapping these memory regions anyway? map(0x2000, 0x5fff).rw(m_k052109, FUNC(k052109_device::read), FUNC(k052109_device::write)); // 052109 (Tilemap) map(0x2000, 0x2fff).view(m_videoview0); // 052109 (Tilemap) 0x0000-0x0fff - 052109 (Tilemap) @@ -244,19 +407,19 @@ map(0x3f83, 0x3f83).portr("P4"); // ??? (But not used) map(0x3f92, 0x3f92).portr("EEPROM"); map(0x3f93, 0x3f93).portr("SERVICE"); - map(0x3fa0, 0x3fa7).w(m_k053246, FUNC(k053247_device::k053246_w)); // 053246 (Sprite) - map(0x3fb0, 0x3fbf).w(m_k053251, FUNC(k053251_device::write)); // 053251 (Priority Encoder) - map(0x3fc0, 0x3fcf).rw(m_k053252, FUNC(k053252_device::read), FUNC(k053252_device::write)); // 053252 + map(0x3fa0, 0x3fa7).w(m_k053246, FUNC(k053247_device::k053246_w)); // Sprite + map(0x3fb0, 0x3fbf).w(m_k053251, FUNC(k053251_device::write)); // Priority Encoder + map(0x3fc0, 0x3fcf).rw(m_k053252, FUNC(k053252_device::read), FUNC(k053252_device::write)); map(0x3fd0, 0x3fd0).w(FUNC(vendetta_state::_5fe0_w)); // Coin Counter, 052109 RMRD, 053246 OBJCHA map(0x3fd2, 0x3fd2).w(FUNC(vendetta_state::eeprom_w)); // EEPROM, Video banking map(0x3fd4, 0x3fd4).rw(FUNC(vendetta_state::z80_irq_r), FUNC(vendetta_state::z80_irq_w)); // Sound map(0x3fd6, 0x3fd7).rw("k053260", FUNC(k053260_device::main_read), FUNC(k053260_device::main_write)); // Sound - map(0x3fd8, 0x3fd9).r(m_k053246, FUNC(k053247_device::k053246_r)); // 053246 (Sprite) + map(0x3fd8, 0x3fd9).r(m_k053246, FUNC(k053247_device::k053246_r)); // Sprite map(0x3fda, 0x3fda).nopw(); // Not Emulated (Watchdog ???) map(0x4000, 0x4fff).view(m_videoview1); // Tilemap mask ROM bank selector (mask ROM Test) m_videoview1[0](0x4000, 0x4fff).rw(FUNC(vendetta_state::K052109_r), FUNC(vendetta_state::K052109_w)); m_videoview1[1](0x4000, 0x4fff).ram().w(m_palette, FUNC(palette_device::write8)).share("palette"); - map(0x6000, 0x7fff).bankr("bank1"); // 053248 '975r01' 1M ROM (Banked) + map(0x6000, 0x7fff).bankr(m_mainbank); // 053248 '975r01' 1M ROM (Banked) map(0x8000, 0xffff).rom().region("maincpu", 0x18000); // 053248 '975r01' 1M ROM (0x18000-0x1ffff) } @@ -302,7 +465,7 @@ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_er5911_device, do_read) PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_er5911_device, ready_read) PORT_SERVICE_NO_TOGGLE(0x04, IP_ACTIVE_LOW) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") /* not really vblank, object related. Its timed, otherwise sprites flicker */ + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") // not really vblank, object related. It's timed, otherwise sprites flicker PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START( "EEPROMOUT" ) @@ -358,7 +521,7 @@ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_er5911_device, do_read) PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_er5911_device, ready_read) PORT_SERVICE_NO_TOGGLE(0x04, IP_ACTIVE_LOW) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") /* not really vblank, object related. Its timed, otherwise sprites flicker */ + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") // not really vblank, object related. It's timed, otherwise sprites flicker PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START( "EEPROMOUT" ) @@ -391,8 +554,10 @@ void vendetta_state::machine_start() { - membank("bank1")->configure_entries(0, 28, memregion("maincpu")->base(), 0x2000); - membank("bank1")->set_entry(0); + m_mainbank->configure_entries(0, 28, memregion("maincpu")->base(), 0x2000); + m_mainbank->set_entry(0); + + m_z80_nmi_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(vendetta_state::z80_nmi), this)); save_item(NAME(m_irq_enabled)); save_item(NAME(m_sprite_colorbase)); @@ -417,28 +582,28 @@ if (data >= 0x1c) logerror("%s Unknown bank selected %02x\n", machine().describe_context(), data); else - membank("bank1")->set_entry(data); + m_mainbank->set_entry(data); } void vendetta_state::vendetta(machine_config &config) { - /* basic machine hardware */ - KONAMI(config, m_maincpu, XTAL(24'000'000)/8); /* 052001 (verified on pcb) */ + // basic machine hardware + KONAMI(config, m_maincpu, XTAL(24'000'000) / 8); // 052001 (verified on PCB) m_maincpu->set_addrmap(AS_PROGRAM, &vendetta_state::main_map); m_maincpu->set_vblank_int("screen", FUNC(vendetta_state::irq)); m_maincpu->line().set(FUNC(vendetta_state::banking_callback)); - Z80(config, m_audiocpu, XTAL(3'579'545)); /* verified with PCB */ - m_audiocpu->set_addrmap(AS_PROGRAM, &vendetta_state::sound_map); /* interrupts are triggered by the main CPU */ + Z80(config, m_audiocpu, XTAL(3'579'545)); // verified with PCB + m_audiocpu->set_addrmap(AS_PROGRAM, &vendetta_state::sound_map); // interrupts are triggered by the main CPU EEPROM_ER5911_8BIT(config, "eeprom"); WATCHDOG_TIMER(config, "watchdog"); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); - screen.set_refresh_hz(59.17); /* measured on PCB */ - screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ + screen.set_refresh_hz(59.17); // measured on PCB + screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); // not accurate screen.set_size(64*8, 32*8); screen.set_visarea(13*8, (64-13)*8-1, 2*8, 30*8-1); screen.set_screen_update(FUNC(vendetta_state::screen_update)); @@ -459,13 +624,13 @@ K053251(config, m_k053251, 0); K054000(config, m_k054000, 0); - /* sound hardware */ + // sound hardware SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - YM2151(config, "ymsnd", XTAL(3'579'545)).add_route(0, "lspeaker", 0.5).add_route(1, "rspeaker", 0.5); /* verified with PCB */ + YM2151(config, "ymsnd", XTAL(3'579'545)).add_route(0, "lspeaker", 0.5).add_route(1, "rspeaker", 0.5); // verified with PCB - k053260_device &k053260(K053260(config, "k053260", XTAL(3'579'545))); /* verified with PCB */ + k053260_device &k053260(K053260(config, "k053260", XTAL(3'579'545))); // verified with PCB k053260.add_route(0, "lspeaker", 0.75); k053260.add_route(1, "rspeaker", 0.75); } @@ -474,10 +639,10 @@ { vendetta(config); - /* basic machine hardware */ + // basic machine hardware m_maincpu->set_addrmap(AS_PROGRAM, &vendetta_state::esckids_map); - //subdevice("screen")->set_visarea(13*8, (64-13)*8-1, 2*8, 30*8-1); /* black areas on the edges */ + //subdevice("screen")->set_visarea(13*8, (64-13)*8-1, 2*8, 30*8-1); // black areas on the edges subdevice("screen")->set_visarea(14*8, (64-14)*8-1, 2*8, 30*8-1); config.device_remove("k054000"); @@ -501,267 +666,330 @@ ***************************************************************************/ ROM_START( vendetta ) - ROM_REGION( 0x40000, "maincpu", 0 ) /* code + banked ROMs + banked RAM */ + ROM_REGION( 0x40000, "maincpu", 0 ) // code + banked ROMs ROM_LOAD( "081t01.17c", 0x00000, 0x40000, CRC(e76267f5) SHA1(efef6c2edb4c181374661f358dad09123741b63d) ) - ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the sound CPU */ + ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "081b02", 0x000000, 0x10000, CRC(4c604d9b) SHA1(22d979f5dbde7912dd927bf5538fdbfc5b82905e) ) - ROM_REGION( 0x100000, "k052109", 0 ) /* tiles */ + ROM_REGION( 0x100000, "k052109", 0 ) // tiles ROM_LOAD32_WORD( "081a09", 0x000000, 0x080000, CRC(b4c777a9) SHA1(cc2b1dff4404ecd72b604e25d00fffdf7f0f8b52) ) ROM_LOAD32_WORD( "081a08", 0x000002, 0x080000, CRC(272ac8d9) SHA1(2da12fe4c13921bf0d4ebffec326f8d207ec4fad) ) - ROM_REGION( 0x400000, "k053246", 0 ) /* graphics ( don't dispose as the program can read them ) */ - ROM_LOAD64_WORD( "081a04", 0x000000, 0x100000, CRC(464b9aa4) SHA1(28066ff0a07c3e56e7192918a882778c1b316b37) ) /* sprites */ - ROM_LOAD64_WORD( "081a05", 0x000002, 0x100000, CRC(4e173759) SHA1(ce803f2aca7d7dedad00ab30e112443848747bd2) ) /* sprites */ - ROM_LOAD64_WORD( "081a06", 0x000004, 0x100000, CRC(e9fe6d80) SHA1(2b7fc9d7fe43cd85dc8b975fe639c273cb0d9256) ) /* sprites */ - ROM_LOAD64_WORD( "081a07", 0x000006, 0x100000, CRC(8a22b29a) SHA1(be539f21518e13038ab1d4cc2b2a901dd3e621f4) ) /* sprites */ + ROM_REGION( 0x400000, "k053246", 0 ) // graphics + ROM_LOAD64_WORD( "081a04", 0x000000, 0x100000, CRC(464b9aa4) SHA1(28066ff0a07c3e56e7192918a882778c1b316b37) ) // sprites + ROM_LOAD64_WORD( "081a05", 0x000002, 0x100000, CRC(4e173759) SHA1(ce803f2aca7d7dedad00ab30e112443848747bd2) ) // sprites + ROM_LOAD64_WORD( "081a06", 0x000004, 0x100000, CRC(e9fe6d80) SHA1(2b7fc9d7fe43cd85dc8b975fe639c273cb0d9256) ) // sprites + ROM_LOAD64_WORD( "081a07", 0x000006, 0x100000, CRC(8a22b29a) SHA1(be539f21518e13038ab1d4cc2b2a901dd3e621f4) ) // sprites - ROM_REGION( 0x100000, "k053260", 0 ) /* 053260 samples */ + ROM_REGION( 0x100000, "k053260", 0 ) // samples ROM_LOAD( "081a03", 0x000000, 0x100000, CRC(14b6baea) SHA1(fe15ee57f19f5acaad6c1642d51f390046a7468a) ) ROM_REGION( 0x80, "eeprom", 0 ) // default EEPROM to prevent game booting upside down with error ROM_LOAD( "vendetta.nv", 0x0000, 0x080, CRC(fbac4e30) SHA1(d3ff3a392550d9b06400b9292a44bdac7ba5c801) ) + + ROM_REGION( 0x22e, "plds", 0 ) + ROM_LOAD( "p1-pal16l8acn.17e", 0x000, 0x117, BAD_DUMP CRC(eae70da3) SHA1(2707ff413ea1fdc4e483f437f44a40042aa41d4e) ) // Bruteforced + ROM_LOAD( "p2-pal16l8acn.14e", 0x117, 0x117, BAD_DUMP CRC(b84abb7d) SHA1(c3744771c486a4db0d5a067100318f8f076c1aa2) ) // Bruteforced ROM_END ROM_START( vendettar ) - ROM_REGION( 0x40000, "maincpu", 0 ) /* code + banked ROMs + banked RAM */ + ROM_REGION( 0x40000, "maincpu", 0 ) // code + banked ROMs ROM_LOAD( "081r01.17c", 0x00000, 0x40000, CRC(84796281) SHA1(e4330c6eaa17adda5b4bd3eb824388c89fb07918) ) - ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the sound CPU */ + ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "081b02", 0x000000, 0x10000, CRC(4c604d9b) SHA1(22d979f5dbde7912dd927bf5538fdbfc5b82905e) ) - ROM_REGION( 0x100000, "k052109", 0 ) /* tiles */ + ROM_REGION( 0x100000, "k052109", 0 ) // tiles ROM_LOAD32_WORD( "081a09", 0x000000, 0x080000, CRC(b4c777a9) SHA1(cc2b1dff4404ecd72b604e25d00fffdf7f0f8b52) ) ROM_LOAD32_WORD( "081a08", 0x000002, 0x080000, CRC(272ac8d9) SHA1(2da12fe4c13921bf0d4ebffec326f8d207ec4fad) ) - ROM_REGION( 0x400000, "k053246", 0 ) /* graphics ( don't dispose as the program can read them ) */ - ROM_LOAD64_WORD( "081a04", 0x000000, 0x100000, CRC(464b9aa4) SHA1(28066ff0a07c3e56e7192918a882778c1b316b37) ) /* sprites */ - ROM_LOAD64_WORD( "081a05", 0x000002, 0x100000, CRC(4e173759) SHA1(ce803f2aca7d7dedad00ab30e112443848747bd2) ) /* sprites */ - ROM_LOAD64_WORD( "081a06", 0x000004, 0x100000, CRC(e9fe6d80) SHA1(2b7fc9d7fe43cd85dc8b975fe639c273cb0d9256) ) /* sprites */ - ROM_LOAD64_WORD( "081a07", 0x000006, 0x100000, CRC(8a22b29a) SHA1(be539f21518e13038ab1d4cc2b2a901dd3e621f4) ) /* sprites */ + ROM_REGION( 0x400000, "k053246", 0 ) // graphics + ROM_LOAD64_WORD( "081a04", 0x000000, 0x100000, CRC(464b9aa4) SHA1(28066ff0a07c3e56e7192918a882778c1b316b37) ) // sprites + ROM_LOAD64_WORD( "081a05", 0x000002, 0x100000, CRC(4e173759) SHA1(ce803f2aca7d7dedad00ab30e112443848747bd2) ) // sprites + ROM_LOAD64_WORD( "081a06", 0x000004, 0x100000, CRC(e9fe6d80) SHA1(2b7fc9d7fe43cd85dc8b975fe639c273cb0d9256) ) // sprites + ROM_LOAD64_WORD( "081a07", 0x000006, 0x100000, CRC(8a22b29a) SHA1(be539f21518e13038ab1d4cc2b2a901dd3e621f4) ) // sprites - ROM_REGION( 0x100000, "k053260", 0 ) /* 053260 samples */ + ROM_REGION( 0x100000, "k053260", 0 ) // samples ROM_LOAD( "081a03", 0x000000, 0x100000, CRC(14b6baea) SHA1(fe15ee57f19f5acaad6c1642d51f390046a7468a) ) ROM_REGION( 0x80, "eeprom", 0 ) // default EEPROM to prevent game booting upside down with error ROM_LOAD( "vendettar.nv", 0x0000, 0x080, CRC(ec3f0449) SHA1(da35b98cd10bfabe9df3ede05462fabeb0e01ca9) ) + + ROM_REGION( 0x22e, "plds", 0 ) + ROM_LOAD( "p1-pal16l8acn.17e", 0x000, 0x117, BAD_DUMP CRC(eae70da3) SHA1(2707ff413ea1fdc4e483f437f44a40042aa41d4e) ) // Bruteforced + ROM_LOAD( "p2-pal16l8acn.14e", 0x117, 0x117, BAD_DUMP CRC(b84abb7d) SHA1(c3744771c486a4db0d5a067100318f8f076c1aa2) ) // Bruteforced ROM_END ROM_START( vendettaz ) - ROM_REGION( 0x40000, "maincpu", 0 ) /* code + banked ROMs + banked RAM */ + ROM_REGION( 0x40000, "maincpu", 0 ) // code + banked ROMs ROM_LOAD( "081z01.17c", 0x00000, 0x40000, CRC(4d225a8d) SHA1(fe8f6e63d033cf04c9a287d870db244fddb81f03) ) - ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the sound CPU */ + ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "081b02", 0x000000, 0x10000, CRC(4c604d9b) SHA1(22d979f5dbde7912dd927bf5538fdbfc5b82905e) ) - ROM_REGION( 0x100000, "k052109", 0 ) /* tiles */ + ROM_REGION( 0x100000, "k052109", 0 ) // tiles ROM_LOAD32_WORD( "081a09", 0x000000, 0x080000, CRC(b4c777a9) SHA1(cc2b1dff4404ecd72b604e25d00fffdf7f0f8b52) ) ROM_LOAD32_WORD( "081a08", 0x000002, 0x080000, CRC(272ac8d9) SHA1(2da12fe4c13921bf0d4ebffec326f8d207ec4fad) ) - ROM_REGION( 0x400000, "k053246", 0 ) /* graphics ( don't dispose as the program can read them ) */ - ROM_LOAD64_WORD( "081a04", 0x000000, 0x100000, CRC(464b9aa4) SHA1(28066ff0a07c3e56e7192918a882778c1b316b37) ) /* sprites */ - ROM_LOAD64_WORD( "081a05", 0x000002, 0x100000, CRC(4e173759) SHA1(ce803f2aca7d7dedad00ab30e112443848747bd2) ) /* sprites */ - ROM_LOAD64_WORD( "081a06", 0x000004, 0x100000, CRC(e9fe6d80) SHA1(2b7fc9d7fe43cd85dc8b975fe639c273cb0d9256) ) /* sprites */ - ROM_LOAD64_WORD( "081a07", 0x000006, 0x100000, CRC(8a22b29a) SHA1(be539f21518e13038ab1d4cc2b2a901dd3e621f4) ) /* sprites */ + ROM_REGION( 0x400000, "k053246", 0 ) // graphics + ROM_LOAD64_WORD( "081a04", 0x000000, 0x100000, CRC(464b9aa4) SHA1(28066ff0a07c3e56e7192918a882778c1b316b37) ) // sprites + ROM_LOAD64_WORD( "081a05", 0x000002, 0x100000, CRC(4e173759) SHA1(ce803f2aca7d7dedad00ab30e112443848747bd2) ) // sprites + ROM_LOAD64_WORD( "081a06", 0x000004, 0x100000, CRC(e9fe6d80) SHA1(2b7fc9d7fe43cd85dc8b975fe639c273cb0d9256) ) // sprites + ROM_LOAD64_WORD( "081a07", 0x000006, 0x100000, CRC(8a22b29a) SHA1(be539f21518e13038ab1d4cc2b2a901dd3e621f4) ) // sprites - ROM_REGION( 0x100000, "k053260", 0 ) /* 053260 samples */ + ROM_REGION( 0x100000, "k053260", 0 ) // samples ROM_LOAD( "081a03", 0x000000, 0x100000, CRC(14b6baea) SHA1(fe15ee57f19f5acaad6c1642d51f390046a7468a) ) ROM_REGION( 0x80, "eeprom", 0 ) // default EEPROM to prevent game booting upside down with error ROM_LOAD( "vendetta.nv", 0x0000, 0x080, CRC(fbac4e30) SHA1(d3ff3a392550d9b06400b9292a44bdac7ba5c801) ) + + ROM_REGION( 0x22e, "plds", 0 ) + ROM_LOAD( "p1-pal16l8acn.17e", 0x000, 0x117, BAD_DUMP CRC(eae70da3) SHA1(2707ff413ea1fdc4e483f437f44a40042aa41d4e) ) // Bruteforced + ROM_LOAD( "p2-pal16l8acn.14e", 0x117, 0x117, BAD_DUMP CRC(b84abb7d) SHA1(c3744771c486a4db0d5a067100318f8f076c1aa2) ) // Bruteforced ROM_END ROM_START( vendettaun ) - ROM_REGION( 0x40000, "maincpu", 0 ) /* code + banked ROMs + banked RAM */ - ROM_LOAD( "1.17c", 0x00000, 0x40000, CRC(1a7ceb1b) SHA1(c7454e11b7a06d10c94fe44ba6f83208bca4ced9) ) /* World 4 player, program ROM found labeled simply as "1" */ + ROM_REGION( 0x40000, "maincpu", 0 ) // code + banked ROMs + ROM_LOAD( "1.17c", 0x00000, 0x40000, CRC(1a7ceb1b) SHA1(c7454e11b7a06d10c94fe44ba6f83208bca4ced9) ) // World 4 player, program ROM found labeled simply as "1" - ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the sound CPU */ + ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "081b02", 0x000000, 0x10000, CRC(4c604d9b) SHA1(22d979f5dbde7912dd927bf5538fdbfc5b82905e) ) - ROM_REGION( 0x100000, "k052109", 0 ) /* tiles */ + ROM_REGION( 0x100000, "k052109", 0 ) // tiles ROM_LOAD32_WORD( "081a09", 0x000000, 0x080000, CRC(b4c777a9) SHA1(cc2b1dff4404ecd72b604e25d00fffdf7f0f8b52) ) ROM_LOAD32_WORD( "081a08", 0x000002, 0x080000, CRC(272ac8d9) SHA1(2da12fe4c13921bf0d4ebffec326f8d207ec4fad) ) - ROM_REGION( 0x400000, "k053246", 0 ) /* graphics ( don't dispose as the program can read them ) */ - ROM_LOAD64_WORD( "081a04", 0x000000, 0x100000, CRC(464b9aa4) SHA1(28066ff0a07c3e56e7192918a882778c1b316b37) ) /* sprites */ - ROM_LOAD64_WORD( "081a05", 0x000002, 0x100000, CRC(4e173759) SHA1(ce803f2aca7d7dedad00ab30e112443848747bd2) ) /* sprites */ - ROM_LOAD64_WORD( "081a06", 0x000004, 0x100000, CRC(e9fe6d80) SHA1(2b7fc9d7fe43cd85dc8b975fe639c273cb0d9256) ) /* sprites */ - ROM_LOAD64_WORD( "081a07", 0x000006, 0x100000, CRC(8a22b29a) SHA1(be539f21518e13038ab1d4cc2b2a901dd3e621f4) ) /* sprites */ + ROM_REGION( 0x400000, "k053246", 0 ) // graphics + ROM_LOAD64_WORD( "081a04", 0x000000, 0x100000, CRC(464b9aa4) SHA1(28066ff0a07c3e56e7192918a882778c1b316b37) ) // sprites + ROM_LOAD64_WORD( "081a05", 0x000002, 0x100000, CRC(4e173759) SHA1(ce803f2aca7d7dedad00ab30e112443848747bd2) ) // sprites + ROM_LOAD64_WORD( "081a06", 0x000004, 0x100000, CRC(e9fe6d80) SHA1(2b7fc9d7fe43cd85dc8b975fe639c273cb0d9256) ) // sprites + ROM_LOAD64_WORD( "081a07", 0x000006, 0x100000, CRC(8a22b29a) SHA1(be539f21518e13038ab1d4cc2b2a901dd3e621f4) ) // sprites - ROM_REGION( 0x100000, "k053260", 0 ) /* 053260 samples */ + ROM_REGION( 0x100000, "k053260", 0 ) // samples ROM_LOAD( "081a03", 0x000000, 0x100000, CRC(14b6baea) SHA1(fe15ee57f19f5acaad6c1642d51f390046a7468a) ) ROM_REGION( 0x80, "eeprom", 0 ) // default EEPROM to prevent game booting upside down with error ROM_LOAD( "vendetta.nv", 0x0000, 0x080, CRC(fbac4e30) SHA1(d3ff3a392550d9b06400b9292a44bdac7ba5c801) ) -ROM_END + ROM_REGION( 0x22e, "plds", 0 ) + ROM_LOAD( "p1-pal16l8acn.17e", 0x000, 0x117, BAD_DUMP CRC(eae70da3) SHA1(2707ff413ea1fdc4e483f437f44a40042aa41d4e) ) // Bruteforced + ROM_LOAD( "p2-pal16l8acn.14e", 0x117, 0x117, BAD_DUMP CRC(b84abb7d) SHA1(c3744771c486a4db0d5a067100318f8f076c1aa2) ) // Bruteforced +ROM_END + +/* +This set has also been found with a different ROM layout, using three daughter boards: + 27c512.5f 081b02 IDENTICAL + 27c020.17c 081w01.17c IDENTICAL + 1d-3-daughter-board-27c040.bin 081a03 [1/2] IDENTICAL + 1d-2-daughter-board-27c040.bin 081a03 [2/2] IDENTICAL + 8-yellow-sticker-daughter-board-27c040.bin 081a04 [even] IDENTICAL + 4-yellow-sticker-daughter-board-27c040.bin 081a05 [even] IDENTICAL + 27c020.17j 081a09 [even] IDENTICAL + 6-yellow-sticker-daughter-board-27c040.bin 081a06 [even] IDENTICAL + 27c020.16j 081a08 [even] IDENTICAL + 2-yellow-sticker-daughter-board-27c040.bin 081a07 [even] IDENTICAL + 27c020.17h 081a09 [odd] IDENTICAL + 3-yellow-sticker-daughter-board-27c040.bin 081a05 [odd] IDENTICAL + 7-yellow-sticker-daughter-board-27c040.bin 081a04 [odd] IDENTICAL + 5-yellow-sticker-daughter-board-27c040.bin 081a06 [odd] IDENTICAL + 1-yellow-sticker-daughter-board-27c040.bin 081a07 [odd] IDENTICAL + 27c020.16h 081a08 [odd] IDENTICAL +*/ ROM_START( vendetta2pw ) - ROM_REGION( 0x40000, "maincpu", 0 ) /* code + banked ROMs + banked RAM */ + ROM_REGION( 0x40000, "maincpu", 0 ) // code + banked ROMs ROM_LOAD( "081w01.17c", 0x00000, 0x40000, CRC(cee57132) SHA1(8b6413877e127511daa76278910c2ee3247d613a) ) - ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the sound CPU */ + ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "081b02", 0x000000, 0x10000, CRC(4c604d9b) SHA1(22d979f5dbde7912dd927bf5538fdbfc5b82905e) ) - ROM_REGION( 0x100000, "k052109", 0 ) /* tiles */ + ROM_REGION( 0x100000, "k052109", 0 ) // tiles ROM_LOAD32_WORD( "081a09", 0x000000, 0x080000, CRC(b4c777a9) SHA1(cc2b1dff4404ecd72b604e25d00fffdf7f0f8b52) ) ROM_LOAD32_WORD( "081a08", 0x000002, 0x080000, CRC(272ac8d9) SHA1(2da12fe4c13921bf0d4ebffec326f8d207ec4fad) ) - ROM_REGION( 0x400000, "k053246", 0 ) /* graphics ( don't dispose as the program can read them ) */ - ROM_LOAD64_WORD( "081a04", 0x000000, 0x100000, CRC(464b9aa4) SHA1(28066ff0a07c3e56e7192918a882778c1b316b37) ) /* sprites */ - ROM_LOAD64_WORD( "081a05", 0x000002, 0x100000, CRC(4e173759) SHA1(ce803f2aca7d7dedad00ab30e112443848747bd2) ) /* sprites */ - ROM_LOAD64_WORD( "081a06", 0x000004, 0x100000, CRC(e9fe6d80) SHA1(2b7fc9d7fe43cd85dc8b975fe639c273cb0d9256) ) /* sprites */ - ROM_LOAD64_WORD( "081a07", 0x000006, 0x100000, CRC(8a22b29a) SHA1(be539f21518e13038ab1d4cc2b2a901dd3e621f4) ) /* sprites */ + ROM_REGION( 0x400000, "k053246", 0 ) // graphics + ROM_LOAD64_WORD( "081a04", 0x000000, 0x100000, CRC(464b9aa4) SHA1(28066ff0a07c3e56e7192918a882778c1b316b37) ) // sprites + ROM_LOAD64_WORD( "081a05", 0x000002, 0x100000, CRC(4e173759) SHA1(ce803f2aca7d7dedad00ab30e112443848747bd2) ) // sprites + ROM_LOAD64_WORD( "081a06", 0x000004, 0x100000, CRC(e9fe6d80) SHA1(2b7fc9d7fe43cd85dc8b975fe639c273cb0d9256) ) // sprites + ROM_LOAD64_WORD( "081a07", 0x000006, 0x100000, CRC(8a22b29a) SHA1(be539f21518e13038ab1d4cc2b2a901dd3e621f4) ) // sprites - ROM_REGION( 0x100000, "k053260", 0 ) /* 053260 samples */ + ROM_REGION( 0x100000, "k053260", 0 ) // samples ROM_LOAD( "081a03", 0x000000, 0x100000, CRC(14b6baea) SHA1(fe15ee57f19f5acaad6c1642d51f390046a7468a) ) ROM_REGION( 0x80, "eeprom", 0 ) // default EEPROM to prevent game booting upside down with error ROM_LOAD( "vendetta.nv", 0x0000, 0x080, CRC(fbac4e30) SHA1(d3ff3a392550d9b06400b9292a44bdac7ba5c801) ) + + ROM_REGION( 0x22e, "plds", 0 ) + ROM_LOAD( "p1-pal16l8acn.17e", 0x000, 0x117, BAD_DUMP CRC(eae70da3) SHA1(2707ff413ea1fdc4e483f437f44a40042aa41d4e) ) // Bruteforced + ROM_LOAD( "p2-pal16l8acn.14e", 0x117, 0x117, BAD_DUMP CRC(b84abb7d) SHA1(c3744771c486a4db0d5a067100318f8f076c1aa2) ) // Bruteforced ROM_END ROM_START( vendetta2peba ) - ROM_REGION( 0x40000, "maincpu", 0 ) /* code + banked ROMs + banked RAM */ + ROM_REGION( 0x40000, "maincpu", 0 ) // code + banked ROMs ROM_LOAD( "081-eb-a01.17c", 0x00000, 0x40000, CRC(8430bb52) SHA1(54e896510fa44e76b0640b17150210fbf6b3b5bc)) // Label was unclear apart from EB stamp on the middle line. Bottom line looked like 401, but probably A01 - ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the sound CPU */ + ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "081b02", 0x000000, 0x10000, CRC(4c604d9b) SHA1(22d979f5dbde7912dd927bf5538fdbfc5b82905e) ) - ROM_REGION( 0x100000, "k052109", 0 ) /* tiles */ + ROM_REGION( 0x100000, "k052109", 0 ) // tiles ROM_LOAD32_WORD( "081a09", 0x000000, 0x080000, CRC(b4c777a9) SHA1(cc2b1dff4404ecd72b604e25d00fffdf7f0f8b52) ) ROM_LOAD32_WORD( "081a08", 0x000002, 0x080000, CRC(272ac8d9) SHA1(2da12fe4c13921bf0d4ebffec326f8d207ec4fad) ) - ROM_REGION( 0x400000, "k053246", 0 ) /* graphics ( don't dispose as the program can read them ) */ - ROM_LOAD64_WORD( "081a04", 0x000000, 0x100000, CRC(464b9aa4) SHA1(28066ff0a07c3e56e7192918a882778c1b316b37) ) /* sprites */ - ROM_LOAD64_WORD( "081a05", 0x000002, 0x100000, CRC(4e173759) SHA1(ce803f2aca7d7dedad00ab30e112443848747bd2) ) /* sprites */ - ROM_LOAD64_WORD( "081a06", 0x000004, 0x100000, CRC(e9fe6d80) SHA1(2b7fc9d7fe43cd85dc8b975fe639c273cb0d9256) ) /* sprites */ - ROM_LOAD64_WORD( "081a07", 0x000006, 0x100000, CRC(8a22b29a) SHA1(be539f21518e13038ab1d4cc2b2a901dd3e621f4) ) /* sprites */ + ROM_REGION( 0x400000, "k053246", 0 ) // graphics + ROM_LOAD64_WORD( "081a04", 0x000000, 0x100000, CRC(464b9aa4) SHA1(28066ff0a07c3e56e7192918a882778c1b316b37) ) // sprites + ROM_LOAD64_WORD( "081a05", 0x000002, 0x100000, CRC(4e173759) SHA1(ce803f2aca7d7dedad00ab30e112443848747bd2) ) // sprites + ROM_LOAD64_WORD( "081a06", 0x000004, 0x100000, CRC(e9fe6d80) SHA1(2b7fc9d7fe43cd85dc8b975fe639c273cb0d9256) ) // sprites + ROM_LOAD64_WORD( "081a07", 0x000006, 0x100000, CRC(8a22b29a) SHA1(be539f21518e13038ab1d4cc2b2a901dd3e621f4) ) // sprites - ROM_REGION( 0x100000, "k053260", 0 ) /* 053260 samples */ + ROM_REGION( 0x100000, "k053260", 0 ) // samples ROM_LOAD( "081a03", 0x000000, 0x100000, CRC(14b6baea) SHA1(fe15ee57f19f5acaad6c1642d51f390046a7468a) ) ROM_REGION( 0x80, "eeprom", 0 ) // default EEPROM to prevent game booting upside down with error ROM_LOAD( "vendetta.nv", 0x0000, 0x080, CRC(fbac4e30) SHA1(d3ff3a392550d9b06400b9292a44bdac7ba5c801) ) + + ROM_REGION( 0x22e, "plds", 0 ) + ROM_LOAD( "p1-pal16l8acn.17e", 0x000, 0x117, BAD_DUMP CRC(eae70da3) SHA1(2707ff413ea1fdc4e483f437f44a40042aa41d4e) ) // Bruteforced + ROM_LOAD( "p2-pal16l8acn.14e", 0x117, 0x117, BAD_DUMP CRC(b84abb7d) SHA1(c3744771c486a4db0d5a067100318f8f076c1aa2) ) // Bruteforced ROM_END ROM_START( vendetta2pun ) - ROM_REGION( 0x40000, "maincpu", 0 ) /* code + banked ROMs + banked RAM */ - ROM_LOAD( "1.17c", 0x00000, 0x40000, CRC(b4edde48) SHA1(bf6342cfeb0560cdf9c943f6d112fd89ee5a4f6b) ) /* World 2 player, program ROM found labeled simply as "1" */ + ROM_REGION( 0x40000, "maincpu", 0 ) // code + banked ROMs + ROM_LOAD( "1.17c", 0x00000, 0x40000, CRC(b4edde48) SHA1(bf6342cfeb0560cdf9c943f6d112fd89ee5a4f6b) ) // World 2 player, program ROM found labeled simply as "1" - ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the sound CPU */ + ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "081b02", 0x000000, 0x10000, CRC(4c604d9b) SHA1(22d979f5dbde7912dd927bf5538fdbfc5b82905e) ) - ROM_REGION( 0x100000, "k052109", 0 ) /* tiles */ + ROM_REGION( 0x100000, "k052109", 0 ) // tiles ROM_LOAD32_WORD( "081a09", 0x000000, 0x080000, CRC(b4c777a9) SHA1(cc2b1dff4404ecd72b604e25d00fffdf7f0f8b52) ) ROM_LOAD32_WORD( "081a08", 0x000002, 0x080000, CRC(272ac8d9) SHA1(2da12fe4c13921bf0d4ebffec326f8d207ec4fad) ) - ROM_REGION( 0x400000, "k053246", 0 ) /* graphics ( don't dispose as the program can read them ) */ - ROM_LOAD64_WORD( "081a04", 0x000000, 0x100000, CRC(464b9aa4) SHA1(28066ff0a07c3e56e7192918a882778c1b316b37) ) /* sprites */ - ROM_LOAD64_WORD( "081a05", 0x000002, 0x100000, CRC(4e173759) SHA1(ce803f2aca7d7dedad00ab30e112443848747bd2) ) /* sprites */ - ROM_LOAD64_WORD( "081a06", 0x000004, 0x100000, CRC(e9fe6d80) SHA1(2b7fc9d7fe43cd85dc8b975fe639c273cb0d9256) ) /* sprites */ - ROM_LOAD64_WORD( "081a07", 0x000006, 0x100000, CRC(8a22b29a) SHA1(be539f21518e13038ab1d4cc2b2a901dd3e621f4) ) /* sprites */ + ROM_REGION( 0x400000, "k053246", 0 ) // graphics + ROM_LOAD64_WORD( "081a04", 0x000000, 0x100000, CRC(464b9aa4) SHA1(28066ff0a07c3e56e7192918a882778c1b316b37) ) // sprites + ROM_LOAD64_WORD( "081a05", 0x000002, 0x100000, CRC(4e173759) SHA1(ce803f2aca7d7dedad00ab30e112443848747bd2) ) // sprites + ROM_LOAD64_WORD( "081a06", 0x000004, 0x100000, CRC(e9fe6d80) SHA1(2b7fc9d7fe43cd85dc8b975fe639c273cb0d9256) ) // sprites + ROM_LOAD64_WORD( "081a07", 0x000006, 0x100000, CRC(8a22b29a) SHA1(be539f21518e13038ab1d4cc2b2a901dd3e621f4) ) // sprites - ROM_REGION( 0x100000, "k053260", 0 ) /* 053260 samples */ + ROM_REGION( 0x100000, "k053260", 0 ) // samples ROM_LOAD( "081a03", 0x000000, 0x100000, CRC(14b6baea) SHA1(fe15ee57f19f5acaad6c1642d51f390046a7468a) ) ROM_REGION( 0x80, "eeprom", 0 ) // default EEPROM to prevent game booting upside down with error ROM_LOAD( "vendetta.nv", 0x0000, 0x080, CRC(fbac4e30) SHA1(d3ff3a392550d9b06400b9292a44bdac7ba5c801) ) + + ROM_REGION( 0x22e, "plds", 0 ) + ROM_LOAD( "p1-pal16l8acn.17e", 0x000, 0x117, BAD_DUMP CRC(eae70da3) SHA1(2707ff413ea1fdc4e483f437f44a40042aa41d4e) ) // Bruteforced + ROM_LOAD( "p2-pal16l8acn.14e", 0x117, 0x117, BAD_DUMP CRC(b84abb7d) SHA1(c3744771c486a4db0d5a067100318f8f076c1aa2) ) // Bruteforced ROM_END ROM_START( vendetta2pu ) - ROM_REGION( 0x40000, "maincpu", 0 ) /* code + banked ROMs + banked RAM */ + ROM_REGION( 0x40000, "maincpu", 0 ) // code + banked ROMs ROM_LOAD( "081u01.17c", 0x00000, 0x40000, CRC(b4d9ade5) SHA1(fbd543738cb0b68c80ff05eed7849b608de03395) ) - ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the sound CPU */ + ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "081b02", 0x000000, 0x10000, CRC(4c604d9b) SHA1(22d979f5dbde7912dd927bf5538fdbfc5b82905e) ) - ROM_REGION( 0x100000, "k052109", 0 ) /* tiles */ + ROM_REGION( 0x100000, "k052109", 0 ) // tiles ROM_LOAD32_WORD( "081a09", 0x000000, 0x080000, CRC(b4c777a9) SHA1(cc2b1dff4404ecd72b604e25d00fffdf7f0f8b52) ) ROM_LOAD32_WORD( "081a08", 0x000002, 0x080000, CRC(272ac8d9) SHA1(2da12fe4c13921bf0d4ebffec326f8d207ec4fad) ) - ROM_REGION( 0x400000, "k053246", 0 ) /* graphics ( don't dispose as the program can read them ) */ - ROM_LOAD64_WORD( "081a04", 0x000000, 0x100000, CRC(464b9aa4) SHA1(28066ff0a07c3e56e7192918a882778c1b316b37) ) /* sprites */ - ROM_LOAD64_WORD( "081a05", 0x000002, 0x100000, CRC(4e173759) SHA1(ce803f2aca7d7dedad00ab30e112443848747bd2) ) /* sprites */ - ROM_LOAD64_WORD( "081a06", 0x000004, 0x100000, CRC(e9fe6d80) SHA1(2b7fc9d7fe43cd85dc8b975fe639c273cb0d9256) ) /* sprites */ - ROM_LOAD64_WORD( "081a07", 0x000006, 0x100000, CRC(8a22b29a) SHA1(be539f21518e13038ab1d4cc2b2a901dd3e621f4) ) /* sprites */ + ROM_REGION( 0x400000, "k053246", 0 ) // graphics + ROM_LOAD64_WORD( "081a04", 0x000000, 0x100000, CRC(464b9aa4) SHA1(28066ff0a07c3e56e7192918a882778c1b316b37) ) // sprites + ROM_LOAD64_WORD( "081a05", 0x000002, 0x100000, CRC(4e173759) SHA1(ce803f2aca7d7dedad00ab30e112443848747bd2) ) // sprites + ROM_LOAD64_WORD( "081a06", 0x000004, 0x100000, CRC(e9fe6d80) SHA1(2b7fc9d7fe43cd85dc8b975fe639c273cb0d9256) ) // sprites + ROM_LOAD64_WORD( "081a07", 0x000006, 0x100000, CRC(8a22b29a) SHA1(be539f21518e13038ab1d4cc2b2a901dd3e621f4) ) // sprites - ROM_REGION( 0x100000, "k053260", 0 ) /* 053260 samples */ + ROM_REGION( 0x100000, "k053260", 0 ) // samples ROM_LOAD( "081a03", 0x000000, 0x100000, CRC(14b6baea) SHA1(fe15ee57f19f5acaad6c1642d51f390046a7468a) ) ROM_REGION( 0x80, "eeprom", 0 ) // default EEPROM to prevent game booting upside down with error ROM_LOAD( "vendetta.nv", 0x0000, 0x080, CRC(fbac4e30) SHA1(d3ff3a392550d9b06400b9292a44bdac7ba5c801) ) + + ROM_REGION( 0x22e, "plds", 0 ) + ROM_LOAD( "p1-pal16l8acn.17e", 0x000, 0x117, BAD_DUMP CRC(eae70da3) SHA1(2707ff413ea1fdc4e483f437f44a40042aa41d4e) ) // Bruteforced + ROM_LOAD( "p2-pal16l8acn.14e", 0x117, 0x117, BAD_DUMP CRC(b84abb7d) SHA1(c3744771c486a4db0d5a067100318f8f076c1aa2) ) // Bruteforced ROM_END ROM_START( vendetta2pd ) - ROM_REGION( 0x40000, "maincpu", 0 ) /* code + banked ROMs + banked RAM */ + ROM_REGION( 0x40000, "maincpu", 0 ) // code + banked ROMs ROM_LOAD( "081d01.17c", 0x00000, 0x40000, CRC(335da495) SHA1(ea74680eb898aeecf9f1eec95f151bcf66e6b6cb) ) - ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the sound CPU */ + ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "081b02", 0x000000, 0x10000, CRC(4c604d9b) SHA1(22d979f5dbde7912dd927bf5538fdbfc5b82905e) ) - ROM_REGION( 0x100000, "k052109", 0 ) /* tiles */ + ROM_REGION( 0x100000, "k052109", 0 ) // tiles ROM_LOAD32_WORD( "081a09", 0x000000, 0x080000, CRC(b4c777a9) SHA1(cc2b1dff4404ecd72b604e25d00fffdf7f0f8b52) ) ROM_LOAD32_WORD( "081a08", 0x000002, 0x080000, CRC(272ac8d9) SHA1(2da12fe4c13921bf0d4ebffec326f8d207ec4fad) ) - ROM_REGION( 0x400000, "k053246", 0 ) /* graphics ( don't dispose as the program can read them ) */ - ROM_LOAD64_WORD( "081a04", 0x000000, 0x100000, CRC(464b9aa4) SHA1(28066ff0a07c3e56e7192918a882778c1b316b37) ) /* sprites */ - ROM_LOAD64_WORD( "081a05", 0x000002, 0x100000, CRC(4e173759) SHA1(ce803f2aca7d7dedad00ab30e112443848747bd2) ) /* sprites */ - ROM_LOAD64_WORD( "081a06", 0x000004, 0x100000, CRC(e9fe6d80) SHA1(2b7fc9d7fe43cd85dc8b975fe639c273cb0d9256) ) /* sprites */ - ROM_LOAD64_WORD( "081a07", 0x000006, 0x100000, CRC(8a22b29a) SHA1(be539f21518e13038ab1d4cc2b2a901dd3e621f4) ) /* sprites */ + ROM_REGION( 0x400000, "k053246", 0 ) // graphics + ROM_LOAD64_WORD( "081a04", 0x000000, 0x100000, CRC(464b9aa4) SHA1(28066ff0a07c3e56e7192918a882778c1b316b37) ) // sprites + ROM_LOAD64_WORD( "081a05", 0x000002, 0x100000, CRC(4e173759) SHA1(ce803f2aca7d7dedad00ab30e112443848747bd2) ) // sprites + ROM_LOAD64_WORD( "081a06", 0x000004, 0x100000, CRC(e9fe6d80) SHA1(2b7fc9d7fe43cd85dc8b975fe639c273cb0d9256) ) // sprites + ROM_LOAD64_WORD( "081a07", 0x000006, 0x100000, CRC(8a22b29a) SHA1(be539f21518e13038ab1d4cc2b2a901dd3e621f4) ) // sprites - ROM_REGION( 0x100000, "k053260", 0 ) /* 053260 samples */ + ROM_REGION( 0x100000, "k053260", 0 ) // samples ROM_LOAD( "081a03", 0x000000, 0x100000, CRC(14b6baea) SHA1(fe15ee57f19f5acaad6c1642d51f390046a7468a) ) ROM_REGION( 0x80, "eeprom", 0 ) // default EEPROM to prevent game booting upside down with error ROM_LOAD( "vendetta.nv", 0x0000, 0x080, CRC(fbac4e30) SHA1(d3ff3a392550d9b06400b9292a44bdac7ba5c801) ) + + ROM_REGION( 0x22e, "plds", 0 ) + ROM_LOAD( "p1-pal16l8acn.17e", 0x000, 0x117, BAD_DUMP CRC(eae70da3) SHA1(2707ff413ea1fdc4e483f437f44a40042aa41d4e) ) // Bruteforced + ROM_LOAD( "p2-pal16l8acn.14e", 0x117, 0x117, BAD_DUMP CRC(b84abb7d) SHA1(c3744771c486a4db0d5a067100318f8f076c1aa2) ) // Bruteforced ROM_END ROM_START( vendettan ) - ROM_REGION( 0x40000, "maincpu", 0 ) /* code + banked ROMs + banked RAM */ + ROM_REGION( 0x40000, "maincpu", 0 ) // code + banked ROMs ROM_LOAD( "081n01.17c", 0x00000, 0x40000, CRC(fc766fab) SHA1(a22c82810f2a2b66fc112e2d043e8025d0dc2841) ) - ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the sound CPU */ + ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "081b02", 0x000000, 0x10000, CRC(4c604d9b) SHA1(22d979f5dbde7912dd927bf5538fdbfc5b82905e) ) - ROM_REGION( 0x100000, "k052109", 0 ) /* tiles */ + ROM_REGION( 0x100000, "k052109", 0 ) // tiles ROM_LOAD32_WORD( "081a09", 0x000000, 0x080000, CRC(b4c777a9) SHA1(cc2b1dff4404ecd72b604e25d00fffdf7f0f8b52) ) ROM_LOAD32_WORD( "081a08", 0x000002, 0x080000, CRC(272ac8d9) SHA1(2da12fe4c13921bf0d4ebffec326f8d207ec4fad) ) - ROM_REGION( 0x400000, "k053246", 0 ) /* graphics ( don't dispose as the program can read them ) */ - ROM_LOAD64_WORD( "081a04", 0x000000, 0x100000, CRC(464b9aa4) SHA1(28066ff0a07c3e56e7192918a882778c1b316b37) ) /* sprites */ - ROM_LOAD64_WORD( "081a05", 0x000002, 0x100000, CRC(4e173759) SHA1(ce803f2aca7d7dedad00ab30e112443848747bd2) ) /* sprites */ - ROM_LOAD64_WORD( "081a06", 0x000004, 0x100000, CRC(e9fe6d80) SHA1(2b7fc9d7fe43cd85dc8b975fe639c273cb0d9256) ) /* sprites */ - ROM_LOAD64_WORD( "081a07", 0x000006, 0x100000, CRC(8a22b29a) SHA1(be539f21518e13038ab1d4cc2b2a901dd3e621f4) ) /* sprites */ + ROM_REGION( 0x400000, "k053246", 0 ) // graphics + ROM_LOAD64_WORD( "081a04", 0x000000, 0x100000, CRC(464b9aa4) SHA1(28066ff0a07c3e56e7192918a882778c1b316b37) ) // sprites + ROM_LOAD64_WORD( "081a05", 0x000002, 0x100000, CRC(4e173759) SHA1(ce803f2aca7d7dedad00ab30e112443848747bd2) ) // sprites + ROM_LOAD64_WORD( "081a06", 0x000004, 0x100000, CRC(e9fe6d80) SHA1(2b7fc9d7fe43cd85dc8b975fe639c273cb0d9256) ) // sprites + ROM_LOAD64_WORD( "081a07", 0x000006, 0x100000, CRC(8a22b29a) SHA1(be539f21518e13038ab1d4cc2b2a901dd3e621f4) ) // sprites - ROM_REGION( 0x100000, "k053260", 0 ) /* 053260 samples */ + ROM_REGION( 0x100000, "k053260", 0 ) // samples ROM_LOAD( "081a03", 0x000000, 0x100000, CRC(14b6baea) SHA1(fe15ee57f19f5acaad6c1642d51f390046a7468a) ) ROM_REGION( 0x80, "eeprom", 0 ) // default EEPROM to prevent game booting upside down with error ROM_LOAD( "vendettaj.nv", 0x0000, 0x080, CRC(3550a54e) SHA1(370cd40a12c471b3b6690ecbdde9c7979bc2a652) ) + + ROM_REGION( 0x22e, "plds", 0 ) + ROM_LOAD( "p1-pal16l8acn.17e", 0x000, 0x117, BAD_DUMP CRC(eae70da3) SHA1(2707ff413ea1fdc4e483f437f44a40042aa41d4e) ) // Bruteforced + ROM_LOAD( "p2-pal16l8acn.14e", 0x117, 0x117, BAD_DUMP CRC(b84abb7d) SHA1(c3744771c486a4db0d5a067100318f8f076c1aa2) ) // Bruteforced ROM_END ROM_START( vendetta2pp ) - ROM_REGION( 0x40000, "maincpu", 0 ) /* code + banked ROMs + banked RAM */ + ROM_REGION( 0x40000, "maincpu", 0 ) // code + banked ROMs ROM_LOAD( "081p01.17c", 0x00000, 0x40000, CRC(5fe30242) SHA1(2ea98e66637fa2ad60044b1a2b0dd158a82403a2) ) - ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the sound CPU */ + ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "081b02", 0x000000, 0x10000, CRC(4c604d9b) SHA1(22d979f5dbde7912dd927bf5538fdbfc5b82905e) ) - ROM_REGION( 0x100000, "k052109", 0 ) /* tiles */ + ROM_REGION( 0x100000, "k052109", 0 ) // tiles ROM_LOAD32_WORD( "081a09", 0x000000, 0x080000, CRC(b4c777a9) SHA1(cc2b1dff4404ecd72b604e25d00fffdf7f0f8b52) ) ROM_LOAD32_WORD( "081a08", 0x000002, 0x080000, CRC(272ac8d9) SHA1(2da12fe4c13921bf0d4ebffec326f8d207ec4fad) ) - ROM_REGION( 0x400000, "k053246", 0 ) /* graphics ( don't dispose as the program can read them ) */ - ROM_LOAD64_WORD( "081a04", 0x000000, 0x100000, CRC(464b9aa4) SHA1(28066ff0a07c3e56e7192918a882778c1b316b37) ) /* sprites */ - ROM_LOAD64_WORD( "081a05", 0x000002, 0x100000, CRC(4e173759) SHA1(ce803f2aca7d7dedad00ab30e112443848747bd2) ) /* sprites */ - ROM_LOAD64_WORD( "081a06", 0x000004, 0x100000, CRC(e9fe6d80) SHA1(2b7fc9d7fe43cd85dc8b975fe639c273cb0d9256) ) /* sprites */ - ROM_LOAD64_WORD( "081a07", 0x000006, 0x100000, CRC(8a22b29a) SHA1(be539f21518e13038ab1d4cc2b2a901dd3e621f4) ) /* sprites */ + ROM_REGION( 0x400000, "k053246", 0 ) // graphics + ROM_LOAD64_WORD( "081a04", 0x000000, 0x100000, CRC(464b9aa4) SHA1(28066ff0a07c3e56e7192918a882778c1b316b37) ) // sprites + ROM_LOAD64_WORD( "081a05", 0x000002, 0x100000, CRC(4e173759) SHA1(ce803f2aca7d7dedad00ab30e112443848747bd2) ) // sprites + ROM_LOAD64_WORD( "081a06", 0x000004, 0x100000, CRC(e9fe6d80) SHA1(2b7fc9d7fe43cd85dc8b975fe639c273cb0d9256) ) // sprites + ROM_LOAD64_WORD( "081a07", 0x000006, 0x100000, CRC(8a22b29a) SHA1(be539f21518e13038ab1d4cc2b2a901dd3e621f4) ) // sprites - ROM_REGION( 0x100000, "k053260", 0 ) /* 053260 samples */ + ROM_REGION( 0x100000, "k053260", 0 ) // samples ROM_LOAD( "081a03", 0x000000, 0x100000, CRC(14b6baea) SHA1(fe15ee57f19f5acaad6c1642d51f390046a7468a) ) ROM_REGION( 0x80, "eeprom", 0 ) // default EEPROM to prevent game booting upside down with error ROM_LOAD( "vendettaj.nv", 0x0000, 0x080, CRC(3550a54e) SHA1(370cd40a12c471b3b6690ecbdde9c7979bc2a652) ) + + ROM_REGION( 0x22e, "plds", 0 ) + ROM_LOAD( "p1-pal16l8acn.17e", 0x000, 0x117, BAD_DUMP CRC(eae70da3) SHA1(2707ff413ea1fdc4e483f437f44a40042aa41d4e) ) // Bruteforced + ROM_LOAD( "p2-pal16l8acn.14e", 0x117, 0x117, BAD_DUMP CRC(b84abb7d) SHA1(c3744771c486a4db0d5a067100318f8f076c1aa2) ) // Bruteforced ROM_END @@ -814,6 +1042,8 @@ ROM_LOAD( "esckidsj.nv", 0x0000, 0x080, CRC(985e2a2d) SHA1(afd9e5fc014d593d0a384326f32caf2a73fba867) ) ROM_END +} // anonymous namespace + /*************************************************************************** @@ -822,16 +1052,16 @@ ***************************************************************************/ -GAME( 1991, vendetta, 0, vendetta, vendet4p, vendetta_state, empty_init, ROT0, "Konami", "Vendetta (World, 4 Players, ver. T)", MACHINE_SUPPORTS_SAVE ) -GAME( 1991, vendettar, vendetta, vendetta, vendet4p, vendetta_state, empty_init, ROT0, "Konami", "Vendetta (US, 4 Players, ver. R)", MACHINE_SUPPORTS_SAVE ) -GAME( 1991, vendettaz, vendetta, vendetta, vendet4p, vendetta_state, empty_init, ROT0, "Konami", "Vendetta (Asia, 4 Players, ver. Z)", MACHINE_SUPPORTS_SAVE ) -GAME( 1991, vendettaun, vendetta, vendetta, vendet4p, vendetta_state, empty_init, ROT0, "Konami", "Vendetta (World, 4 Players, ver. ?)", MACHINE_SUPPORTS_SAVE ) /* program ROM labeled as 1 */ -GAME( 1991, vendetta2pw, vendetta, vendetta, vendetta, vendetta_state, empty_init, ROT0, "Konami", "Vendetta (World, 2 Players, ver. W)", MACHINE_SUPPORTS_SAVE ) -GAME( 1991, vendetta2peba,vendetta,vendetta, vendetta, vendetta_state, empty_init, ROT0, "Konami", "Vendetta (World, 2 Players, ver. EB-A?)", MACHINE_SUPPORTS_SAVE ) -GAME( 1991, vendetta2pun,vendetta, vendetta, vendetta, vendetta_state, empty_init, ROT0, "Konami", "Vendetta (World, 2 Players, ver. ?)", MACHINE_SUPPORTS_SAVE ) /* program ROM labeled as 1 */ -GAME( 1991, vendetta2pu, vendetta, vendetta, vendetta, vendetta_state, empty_init, ROT0, "Konami", "Vendetta (Asia, 2 Players, ver. U)", MACHINE_SUPPORTS_SAVE ) -GAME( 1991, vendetta2pd, vendetta, vendetta, vendetta, vendetta_state, empty_init, ROT0, "Konami", "Vendetta (Asia, 2 Players, ver. D)", MACHINE_SUPPORTS_SAVE ) +GAME( 1991, vendetta, 0, vendetta, vendet4p, vendetta_state, empty_init, ROT0, "Konami", "Vendetta (World, 4 Players, ver. T)", MACHINE_SUPPORTS_SAVE ) +GAME( 1991, vendettar, vendetta, vendetta, vendet4p, vendetta_state, empty_init, ROT0, "Konami", "Vendetta (US, 4 Players, ver. R)", MACHINE_SUPPORTS_SAVE ) +GAME( 1991, vendettaz, vendetta, vendetta, vendet4p, vendetta_state, empty_init, ROT0, "Konami", "Vendetta (Asia, 4 Players, ver. Z)", MACHINE_SUPPORTS_SAVE ) +GAME( 1991, vendettaun, vendetta, vendetta, vendet4p, vendetta_state, empty_init, ROT0, "Konami", "Vendetta (World, 4 Players, ver. ?)", MACHINE_SUPPORTS_SAVE ) // program ROM labeled as 1 +GAME( 1991, vendetta2pw, vendetta, vendetta, vendetta, vendetta_state, empty_init, ROT0, "Konami", "Vendetta (World, 2 Players, ver. W)", MACHINE_SUPPORTS_SAVE ) +GAME( 1991, vendetta2peba,vendetta,vendetta, vendetta, vendetta_state, empty_init, ROT0, "Konami", "Vendetta (World, 2 Players, ver. EB-A?)", MACHINE_SUPPORTS_SAVE ) +GAME( 1991, vendetta2pun,vendetta, vendetta, vendetta, vendetta_state, empty_init, ROT0, "Konami", "Vendetta (World, 2 Players, ver. ?)", MACHINE_SUPPORTS_SAVE ) // program ROM labeled as 1 +GAME( 1991, vendetta2pu, vendetta, vendetta, vendetta, vendetta_state, empty_init, ROT0, "Konami", "Vendetta (Asia, 2 Players, ver. U)", MACHINE_SUPPORTS_SAVE ) +GAME( 1991, vendetta2pd, vendetta, vendetta, vendetta, vendetta_state, empty_init, ROT0, "Konami", "Vendetta (Asia, 2 Players, ver. D)", MACHINE_SUPPORTS_SAVE ) GAME( 1991, vendettan, vendetta, vendetta, vendet4p, vendetta_state, empty_init, ROT0, "Konami", "Crime Fighters 2 (Japan, 4 Players, ver. N)", MACHINE_SUPPORTS_SAVE ) GAME( 1991, vendetta2pp, vendetta, vendetta, vendetta, vendetta_state, empty_init, ROT0, "Konami", "Crime Fighters 2 (Japan, 2 Players, ver. P)", MACHINE_SUPPORTS_SAVE ) -GAME( 1991, esckids, 0, esckids, esckids, vendetta_state, empty_init, ROT0, "Konami", "Escape Kids (Asia, 4 Players)", MACHINE_SUPPORTS_SAVE ) -GAME( 1991, esckidsj, esckids, esckids, esckidsj, vendetta_state, empty_init, ROT0, "Konami", "Escape Kids (Japan, 2 Players)", MACHINE_SUPPORTS_SAVE ) +GAME( 1991, esckids, 0, esckids, esckids, vendetta_state, empty_init, ROT0, "Konami", "Escape Kids (Asia, 4 Players)", MACHINE_SUPPORTS_SAVE ) +GAME( 1991, esckidsj, esckids, esckids, esckidsj, vendetta_state, empty_init, ROT0, "Konami", "Escape Kids (Japan, 2 Players)", MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/vgmplay.cpp mame-0.243+dfsg.1/src/mame/drivers/vgmplay.cpp --- mame-0.242+dfsg.1/src/mame/drivers/vgmplay.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/vgmplay.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -473,7 +473,7 @@ private: virtual void machine_start() override; - uint32_t m_held_clock; + uint32_t m_held_clock = 0; std::vector m_file_data; required_device m_vgmplay; required_device m_mixer; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/video21.cpp mame-0.243+dfsg.1/src/mame/drivers/video21.cpp --- mame-0.242+dfsg.1/src/mame/drivers/video21.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/video21.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Robbbert, hap +// copyright-holders:hap /**************************************************************************************** 2018-09-15 diff -Nru mame-0.242+dfsg.1/src/mame/drivers/vigilant.cpp mame-0.243+dfsg.1/src/mame/drivers/vigilant.cpp --- mame-0.242+dfsg.1/src/mame/drivers/vigilant.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/vigilant.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -19,6 +19,16 @@ Top board - M75-A-B (up to Rev A), M75-A-C (Rev B onwards) Bottom board - M75-B-A (all versions regardless of mask ROM/EPROM) +**************************************************************************** + +Roberto Fresca 2022.04.23: +Added Bowmen, from Ten-Level. A very rare Spanish game. + +The game uses derivative hardware, and has some oddities, like lack of some +music codes or clipped samples. They may have finished development +abruptly, without time for final polish. Seems to finish in level 10 +(30 stages), but the game is so hard, testing is difficult. + ***************************************************************************/ #include "emu.h" @@ -118,6 +128,27 @@ // map(0x07, 0x07).nopw(); /* ?? */ } +void vigilant_state::bowmen_io_map(address_map &map) +{ + map.global_mask(0xff); + map(0x00, 0x00).portr("IN0").w("soundlatch", FUNC(generic_latch_8_device::write)); // SD seems BAD + map(0x01, 0x01).portr("IN1").w(FUNC(vigilant_state::vigilant_out2_w)); // OUT2? + map(0x02, 0x02).portr("IN2"); + map(0x03, 0x03).portr("DSW2"); + map(0x04, 0x04).portr("DSW1").w(FUNC(vigilant_state::bank_select_w)); // PBANK? +// map(0x10, 0x11).w(FUNC(vigilant_state::vigilant_horiz_scroll_w)); // HSPL, HSPH + map(0x12, 0x13).w(FUNC(vigilant_state::bowmen_rear_horiz_scroll_w)); // RHSPL, RHSPH + map(0x14, 0x14).w(FUNC(vigilant_state::bowmen_rear_color_w)); // RCOD +/* + 02; w + 10; w + 11; w + 12; w + 13; w + 14; w +*/ +} + void vigilant_state::sound_map(address_map &map) { map(0x0000, 0xbfff).rom(); @@ -377,6 +408,95 @@ INPUT_PORTS_END +static INPUT_PORTS_START( bowmen ) + PORT_START("IN0") + PORT_SERVICE( 0x2f, IP_ACTIVE_LOW ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) + + PORT_START("IN1") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) // checked in the test mode. + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) + + PORT_START("IN2") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_COCKTAIL + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_COCKTAIL + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_COIN2 ) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL // checked in the test mode. + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL + + PORT_START("DSW1") + PORT_DIPNAME( 0x01, 0x01, "Screen Orientation" ) PORT_DIPLOCATION("SW1:1") + PORT_DIPSETTING( 0x01, "Normal Screen" ) + PORT_DIPSETTING( 0x00, "Inverted Screen" ) + PORT_DIPNAME( 0x02, 0x02, "Players" ) PORT_DIPLOCATION("SW1:2") + PORT_DIPSETTING( 0x02, "Two Players" ) + PORT_DIPSETTING( 0x00, "One Player" ) + PORT_DIPNAME( 0x0c, 0x0c, "Time for Round" ) PORT_DIPLOCATION("SW1:3,4") + PORT_DIPSETTING( 0x00, "Free Time per Round" ) + PORT_DIPSETTING( 0x04, "30 Seconds per Round" ) + PORT_DIPSETTING( 0x08, "50 Seconds per Round" ) + PORT_DIPSETTING( 0x0c, "60 Seconds per Round" ) + PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:5,6") + PORT_DIPSETTING( 0x00, DEF_STR( Very_Hard ) ) + PORT_DIPSETTING( 0x10, DEF_STR( Hard ) ) + PORT_DIPSETTING( 0x20, DEF_STR( Very_Easy ) ) + PORT_DIPSETTING( 0x30, DEF_STR( Normal ) ) + PORT_DIPNAME( 0x40, 0x40, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:7") + PORT_DIPSETTING( 0x40, DEF_STR( Yes ) ) + PORT_DIPSETTING( 0x00, DEF_STR( No ) ) + PORT_DIPNAME( 0x80, 0x80, "Test Type" ) PORT_DIPLOCATION("SW1:8") + PORT_DIPSETTING( 0x80, "Easy Test" ) + PORT_DIPSETTING( 0x00, "Advanced Test" ) + + PORT_START("DSW2") + PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:1,2,3,4") + PORT_DIPSETTING( 0x00, DEF_STR( 5C_2C ) ) + PORT_DIPSETTING( 0x01, DEF_STR( 5C_1C ) ) + PORT_DIPSETTING( 0x02, DEF_STR( 4C_5C ) ) + PORT_DIPSETTING( 0x03, DEF_STR( 4C_3C ) ) + PORT_DIPSETTING( 0x04, DEF_STR( 4C_1C ) ) + PORT_DIPSETTING( 0x05, DEF_STR( 3C_5C ) ) + PORT_DIPSETTING( 0x06, DEF_STR( 3C_2C ) ) + PORT_DIPSETTING( 0x07, DEF_STR( 3C_1C ) ) + PORT_DIPSETTING( 0x08, DEF_STR( 2C_5C ) ) + PORT_DIPSETTING( 0x09, DEF_STR( 2C_3C ) ) + PORT_DIPSETTING( 0x0a, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x0b, DEF_STR( 1C_5C ) ) + PORT_DIPSETTING( 0x0c, DEF_STR( 1C_4C ) ) + PORT_DIPSETTING( 0x0d, DEF_STR( 1C_3C ) ) + PORT_DIPSETTING( 0x0e, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0x0f, DEF_STR( 1C_1C ) ) + PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:5,6,7,8") + PORT_DIPSETTING( 0x00, DEF_STR( 5C_2C ) ) + PORT_DIPSETTING( 0x10, DEF_STR( 5C_1C ) ) + PORT_DIPSETTING( 0x20, DEF_STR( 4C_5C ) ) + PORT_DIPSETTING( 0x30, DEF_STR( 4C_3C ) ) + PORT_DIPSETTING( 0x40, DEF_STR( 4C_1C ) ) + PORT_DIPSETTING( 0x50, DEF_STR( 3C_5C ) ) + PORT_DIPSETTING( 0x60, DEF_STR( 3C_2C ) ) + PORT_DIPSETTING( 0x70, DEF_STR( 3C_1C ) ) + PORT_DIPSETTING( 0x80, DEF_STR( 2C_5C ) ) + PORT_DIPSETTING( 0x90, DEF_STR( 2C_3C ) ) + PORT_DIPSETTING( 0xa0, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0xb0, DEF_STR( 1C_5C ) ) + PORT_DIPSETTING( 0xc0, DEF_STR( 1C_4C ) ) + PORT_DIPSETTING( 0xd0, DEF_STR( 1C_3C ) ) + PORT_DIPSETTING( 0xe0, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0xf0, DEF_STR( 1C_1C ) ) +INPUT_PORTS_END + + static const gfx_layout text_layout = { 8,8, /* tile size */ @@ -473,6 +593,13 @@ /* pens we can handle it more easily. */ GFXDECODE_END +static GFXDECODE_START( gfx_bowmen ) + GFXDECODE_ENTRY( "gfx1", 0, text_layout, 256, 16 ) + GFXDECODE_ENTRY( "gfx2", 0, sprite_layout_buccanrs, 0, 16 ) + GFXDECODE_ENTRY( "gfx3", 0, buccaneer_back_layout, 512, 2 ) + +GFXDECODE_END + static GFXDECODE_START( gfx_kikcubic ) GFXDECODE_ENTRY( "gfx1", 0, text_layout, 0, 16 ) GFXDECODE_ENTRY( "gfx2", 0, sprite_layout, 0, 16 ) @@ -646,6 +773,73 @@ } +void vigilant_state::bowmen(machine_config &config) +{ + // basic machine hardware + Z80(config, m_maincpu, 18_MHz_XTAL / 3); // 5.99538 MHz verified + m_maincpu->set_addrmap(AS_PROGRAM, &vigilant_state::vigilant_map); + m_maincpu->set_addrmap(AS_IO, &vigilant_state::bowmen_io_map); + m_maincpu->set_vblank_int("screen", FUNC(vigilant_state::irq0_line_hold)); + + z80_device &soundcpu(Z80(config, "soundcpu", 18_MHz_XTAL / 3)); // 5.99528 MHz verified + soundcpu.set_addrmap(AS_PROGRAM, &vigilant_state::sound_map); + soundcpu.set_addrmap(AS_IO, &vigilant_state::buccanrs_sound_io_map); + soundcpu.set_periodic_int(FUNC(vigilant_state::nmi_line_pulse), attotime::from_hz(7806.5)); // 7.80650 kHz measured + + soundcpu.set_irq_acknowledge_callback("soundirq", FUNC(rst_neg_buffer_device::inta_cb)); + + // video hardware + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(55); // 54.9752 Hz verified + screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); + screen.set_size(64 * 8, 32 * 8); + screen.set_visarea(16 * 8, (64 - 16) * 8 - 1, 0 * 8, 32 * 8 - 1); + screen.set_screen_update(FUNC(vigilant_state::screen_update_bowmen)); + screen.set_palette(m_palette); + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_bowmen); + PALETTE(config, m_palette).set_entries(512 + 32); // 512 real palette, 32 virtual palette + + // sound hardware + SPEAKER(config, "lspeaker").front_left(); + SPEAKER(config, "rspeaker").front_right(); + + generic_latch_8_device &soundlatch(GENERIC_LATCH_8(config, "soundlatch")); + soundlatch.data_pending_callback().set("soundirq", FUNC(rst_neg_buffer_device::rst18_w)); + soundlatch.set_separate_acknowledge(true); + + RST_NEG_BUFFER(config, "soundirq", 0).int_callback().set_inputline("soundcpu", 0); + + IREM_M72_AUDIO(config, m_audio); + m_audio->set_dac_tag("dac"); + + ym2203_device &ym1(YM2203(config, "ym1", 18_MHz_XTAL / 6)); + ym1.irq_handler().set("soundirq", FUNC(rst_neg_buffer_device::rst28_w)); + ym1.add_route(0, "lspeaker", 0.35); + ym1.add_route(0, "rspeaker", 0.35); + ym1.add_route(1, "lspeaker", 0.35); + ym1.add_route(1, "rspeaker", 0.35); + ym1.add_route(2, "lspeaker", 0.35); + ym1.add_route(2, "rspeaker", 0.35); + ym1.add_route(3, "lspeaker", 0.50); + ym1.add_route(3, "rspeaker", 0.50); + + ym2203_device &ym2(YM2203(config, "ym2", 18_MHz_XTAL / 6)); + ym2.add_route(0, "lspeaker", 0.35); + ym2.add_route(0, "rspeaker", 0.35); + ym2.add_route(1, "lspeaker", 0.35); + ym2.add_route(1, "rspeaker", 0.35); + ym2.add_route(2, "lspeaker", 0.35); + ym2.add_route(2, "rspeaker", 0.35); + ym2.add_route(3, "lspeaker", 0.50); + ym2.add_route(3, "rspeaker", 0.50); + + dac_8bit_r2r_device &dac(DAC_8BIT_R2R(config, "dac", 0)); // unknown DAC + dac.add_route(ALL_OUTPUTS, "lspeaker", 0.35); + dac.add_route(ALL_OUTPUTS, "rspeaker", 0.35); +} + + /*************************************************************************** Game ROMs @@ -1161,6 +1355,63 @@ ROM_LOAD( "prom2.u99", 0x0300, 0x0100, CRC(e0aa8869) SHA1(ac8bdfeba69420ba56ec561bf3d0f1229d02cea2) ) ROM_END + +ROM_START( bowmen ) + ROM_REGION( 0x30000, "maincpu", 0 ) // 64k for code (+ 128k for bankswitching?) + ROM_LOAD( "4_27256.bin", 0x00000, 0x08000, CRC(e8dcabb6) SHA1(d6baf9af0ebdced8b73a36486ffd9b48b0d446ca) ) + ROM_LOAD( "3_27c512.bin", 0x10000, 0x10000, CRC(9c8af1eb) SHA1(e36efb2b6d1df4b313bf81c083df64ccf6764bbc) ) + + ROM_REGION( 0x10000, "soundcpu", 0 ) // 64k for sound + ROM_LOAD( "2_27c512.bin", 0x00000, 0x10000, CRC(477a5756) SHA1(675e066adec5fa34c491d71520827d568a5f8d7a) ) + + ROM_REGION( 0x20000, "gfx1", 0 ) // chars + ROM_LOAD( "8_27c512.bin", 0x00000, 0x10000, CRC(782b0b7f) SHA1(35eef9bd32ca2063c730026a71300a7cf2e55778) ) + ROM_LOAD( "7_27c512.bin", 0x10000, 0x10000, CRC(449720ea) SHA1(aa52ea17293ab86c87eeb04c0c4172001ec56379) ) + + ROM_REGION( 0x20000, "gfx2", 0 ) // sprites + ROM_LOAD( "10_27c512.bin", 0x00000, 0x10000, CRC(8cf4e040) SHA1(641a5d13a63ca0dc56fef42ea1ada3b5b28ca864) ) + ROM_LOAD( "9_27c512.bin", 0x10000, 0x10000, CRC(3c06fdf7) SHA1(cfce7eda1e6353b850777c38cabc304e1b123ea0) ) + + ROM_REGION( 0x100000, "gfx3", 0 ) // bitmaps + ROM_LOAD( "5_27c040.bin", 0x00000, 0x80000, CRC(5bac2567) SHA1(bd773761ce31192efc69d031fee13a95ab13b2fd) ) + ROM_LOAD( "6_27c4001.bin", 0x80000, 0x80000, CRC(35b3b7bc) SHA1(2b7dc0606deb52e5ac725cd63cd56e1e2ef040f8) ) + + ROM_REGION( 0x10000, "m72", 0 ) // samples + ROM_LOAD( "1_27c512.bin", 0x00000, 0x10000, CRC(456c478b) SHA1(c8c8bf682dcc2b3a28ffbadcfaaba524141f792b) ) + + ROM_REGION( 0x400, "proms", 0 ) + ROM_LOAD( "prom_4_82s129.bin", 0x0000, 0x0100, CRC(c324835e) SHA1(cf6ffe38523badfda211d341410e93e647de87a9) ) // video timing prom + ROM_LOAD( "prom_3_82s129.bin", 0x0100, 0x0100, CRC(e6506ef4) SHA1(079841da7640b14d94aaaeb572bf018932b58293) ) // unknown + ROM_LOAD( "prom_2_82s129.bin", 0x0200, 0x0100, CRC(b43d094f) SHA1(2bed4892d8a91d7faac5a07bf858d9294eb30606) ) // unknown + ROM_LOAD( "prom_1_82s129.bin", 0x0300, 0x0100, CRC(e0aa8869) SHA1(ac8bdfeba69420ba56ec561bf3d0f1229d02cea2) ) // unknown + + ROM_REGION( 0x2000, "plds", 0 ) + ROM_LOAD( "1_16v8.bin", 0x0000, 0x0117, NO_DUMP ) // PLD is read protected + ROM_LOAD( "2_22v10.bin", 0x0200, 0x0200, NO_DUMP ) // PLD is read protected + ROM_LOAD( "3_20v8.bin", 0x0400, 0x0157, NO_DUMP ) // PLD is read protected + ROM_LOAD( "4_16v8.bin", 0x0600, 0x0117, NO_DUMP ) // PLD is read protected + ROM_LOAD( "5_22v10.bin", 0x0800, 0x0200, NO_DUMP ) // PLD is read protected + ROM_LOAD( "6_16v8.bin", 0x0a00, 0x0117, NO_DUMP ) // PLD is read protected + ROM_LOAD( "7_22v10.bin", 0x0c00, 0x0200, NO_DUMP ) // PLD is read protected + ROM_LOAD( "8_16v8.bin", 0x0e00, 0x0117, NO_DUMP ) // PLD is read protected + ROM_LOAD( "9_16v8.bin", 0x1000, 0x0117, NO_DUMP ) // PLD is read protected +ROM_END + + +void vigilant_state::init_bowmen() +{ + uint8_t *ROM = memregion("maincpu")->base(); + int size = memregion("maincpu")->bytes(); + + m_rear_pages = 16; + + for (int i = 0x0000; i < size; i++) + { + ROM[i]= bitswap(ROM[i], 2, 5, 0, 7, 6, 1, 4, 3); // 0->5, 1->2, 2->7, 3->0, 4->1, 5->6, 6->3, 7->4 + } +} + + GAME( 1988, vigilant, 0, vigilant, vigilant, vigilant_state, empty_init, ROT0, "Irem", "Vigilante (World, Rev E)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) GAME( 1988, vigilantg, vigilant, vigilant, vigilant, vigilant_state, empty_init, ROT0, "Irem (Data East license)", "Vigilante (US, Rev G)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) GAME( 1988, vigilanto, vigilant, vigilant, vigilant, vigilant_state, empty_init, ROT0, "Irem (Data East license)", "Vigilante (US)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) @@ -1176,3 +1427,5 @@ GAME( 1989, buccanrs, 0, buccanrs, buccanrs, vigilant_state, empty_init, ROT0, "Duintronic", "Buccaneers (set 1)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) GAME( 1989, buccanrsa, buccanrs, buccanrs, buccanra, vigilant_state, empty_init, ROT0, "Duintronic", "Buccaneers (set 2)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) GAME( 1989, buccanrsb, buccanrs, buccanrs, buccanrs, vigilant_state, empty_init, ROT0, "Duintronic", "Buccaneers (set 3, harder)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) + +GAME( 1994, bowmen, 0, bowmen, bowmen, vigilant_state, init_bowmen, ROT0, "Ten-Level", "Bowmen", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/viper.cpp mame-0.243+dfsg.1/src/mame/drivers/viper.cpp --- mame-0.242+dfsg.1/src/mame/drivers/viper.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/viper.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -2541,9 +2541,7 @@ WRITE_LINE_MEMBER(viper_state::voodoo_vblank) { - // FIXME: The driver seems to hang using the voodoo vblank signal - // Seems to only work if using negative vsync - if (!state) + if (state) mpc8240_interrupt(MPC8240_IRQ0); //mpc8240_interrupt(MPC8240_IRQ3); } diff -Nru mame-0.242+dfsg.1/src/mame/drivers/vis.cpp mame-0.243+dfsg.1/src/mame/drivers/vis.cpp --- mame-0.242+dfsg.1/src/mame/drivers/vis.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/vis.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -252,7 +252,7 @@ int m_extcnt = 0; uint8_t m_extreg = 0U; uint8_t m_interlace = 0U; - uint16_t m_wina, m_winb = 0U; + uint16_t m_wina = 0U, m_winb = 0U; uint8_t m_shift256 = 0U, m_dw = 0U, m_8bit_640 = 0U; uint8_t m_crtc_regs[0x32]{}; }; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/vixen.cpp mame-0.243+dfsg.1/src/mame/drivers/vixen.cpp --- mame-0.242+dfsg.1/src/mame/drivers/vixen.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/vixen.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -164,7 +164,7 @@ int m_cmd_d0 = 0; int m_cmd_d1 = 0; - bool m_fdint = 0; + bool m_fdint = false; int m_vsync = 0; int m_srq = 1; @@ -180,8 +180,8 @@ int m_enb_ring_int = 0; // video state - bool m_alt = 0; - bool m_256 = 0; + bool m_alt = false; + bool m_256 = false; }; diff -Nru mame-0.242+dfsg.1/src/mame/drivers/vta2000.cpp mame-0.243+dfsg.1/src/mame/drivers/vta2000.cpp --- mame-0.242+dfsg.1/src/mame/drivers/vta2000.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/vta2000.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -3,6 +3,8 @@ /*************************************************************************** VTA-2000 Terminal +Made at Ukrainian SSR, Vinnitsa Terminal Plant +(info from https://prog.world/dataart-has-opened-the-website-of-the-it-museum/ ) Board images : http://fotki.yandex.ru/users/lodedome/album/93699?p=0 @@ -46,6 +48,7 @@ private: void output_00(uint8_t data); DECLARE_WRITE_LINE_MEMBER(speaker_w); + uint8_t m_framecnt = 0; uint32_t screen_update_vta2000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); @@ -101,10 +104,9 @@ uint32_t vta2000_state::screen_update_vta2000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) /* Cursor is missing. */ { - static uint8_t framecnt=0; // FIXME: static variable uint16_t sy=0,ma=0; - framecnt++; + m_framecnt++; for (uint8_t y = 0; y < 25; y++) { @@ -134,7 +136,7 @@ fg = 2; // highlight else fg = 1; - if ((BIT(attr, 1)) && (BIT(framecnt, 5))) + if ((BIT(attr, 1)) && (BIT(m_framecnt, 5))) gfx = 0; // blink if ((BIT(attr, 5)) && (ra == 10)) { @@ -236,4 +238,4 @@ } // Anonymous namespace // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS -COMP( 19??, vta2000, 0, 0, vta2000, vta2000, vta2000_state, empty_init, "", "VTA2000-15m", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +COMP( 198?, vta2000, 0, 0, vta2000, vta2000, vta2000_state, empty_init, "", "VTA2000-15m", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/vtech1.cpp mame-0.243+dfsg.1/src/mame/drivers/vtech1.cpp --- mame-0.242+dfsg.1/src/mame/drivers/vtech1.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/vtech1.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -157,14 +157,16 @@ SNAPSHOT_LOAD_MEMBER(vtech1_base_state::snapshot_cb) { - address_space &space = m_maincpu->space(AS_PROGRAM); - uint8_t header[24]; - char pgmname[18]; - // get the header - image.fread(&header, sizeof(header)); + uint8_t header[24]; + if (image.fread(&header, sizeof(header)) != sizeof(header)) + { + //image.seterror(image_error::UNSPECIFIED); + return image_init_result::FAIL; + } // get image name + char pgmname[17]; for (int i = 0; i < 16; i++) pgmname[i] = header[i+4]; pgmname[16] = '\0'; @@ -175,9 +177,16 @@ uint16_t size = end - start; // write it to ram - uint8_t *ptr = (uint8_t *)image.ptr() + sizeof(header); + auto buf = std::make_unique(size); + if (image.fread(buf.get(), size) != size) + { + //image.seterror(image_error::UNSPECIFIED); + return image_init_result::FAIL; + } + uint8_t *ptr = &buf[0]; - for (uint16_t addr = start; addr <= end; addr++, ptr++) + address_space &space = m_maincpu->space(AS_PROGRAM); + for (uint16_t addr = start; addr < end; addr++, ptr++) { uint8_t to_write = *ptr; space.write_byte(addr, to_write); diff -Nru mame-0.242+dfsg.1/src/mame/drivers/warpwarp.cpp mame-0.243+dfsg.1/src/mame/drivers/warpwarp.cpp --- mame-0.242+dfsg.1/src/mame/drivers/warpwarp.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/warpwarp.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -685,27 +685,16 @@ -static const gfx_layout charlayout = -{ - 8,8, - RGN_FRAC(1,1), - 1, - { 0 }, - { 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_1k ) - GFXDECODE_ENTRY( "gfx1", 0x0000, charlayout, 0, 4 ) + GFXDECODE_ENTRY( "gfx1", 0x0000, gfx_8x8x1, 0, 4 ) GFXDECODE_END static GFXDECODE_START( gfx_2k ) - GFXDECODE_ENTRY( "gfx1", 0x0000, charlayout, 0, 2 ) + GFXDECODE_ENTRY( "gfx1", 0x0000, gfx_8x8x1, 0, 2 ) GFXDECODE_END static GFXDECODE_START( gfx_color ) - GFXDECODE_ENTRY( "gfx1", 0x0000, charlayout, 0, 256 ) + GFXDECODE_ENTRY( "gfx1", 0x0000, gfx_8x8x1, 0, 256 ) GFXDECODE_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/whitestar.cpp mame-0.243+dfsg.1/src/mame/drivers/whitestar.cpp --- mame-0.242+dfsg.1/src/mame/drivers/whitestar.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/whitestar.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -86,20 +86,23 @@ , m_decobsmt(*this, "decobsmt") , m_decodmd(*this, "decodmd") , m_io_keyboard(*this, "X%d", 0U) + , m_mainbank(*this, "mainbank") { } void whitestar(machine_config &config); void whitestarm(machine_config &config); void goldcue(machine_config &config); +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + private: void bank_w(uint8_t data); void dmddata_w(uint8_t data); uint8_t switch_r(); void switch_w(uint8_t data); - virtual void machine_start() override; - virtual void machine_reset() override; INTERRUPT_GEN_MEMBER(whitestar_firq_interrupt); void whitestar_base_map(address_map &map); @@ -113,6 +116,7 @@ optional_device m_decobsmt; required_device m_decodmd; required_ioport_array<8> m_io_keyboard; + required_memory_bank m_mainbank; }; static INPUT_PORTS_START( whitestar ) @@ -231,7 +235,7 @@ map(0x3600, 0x3600).w(FUNC(whitestar_state::dmddata_w)); map(0x3601, 0x3601).rw(m_decodmd, FUNC(decodmd_type2_device::ctrl_r), FUNC(decodmd_type2_device::ctrl_w)); map(0x3700, 0x3700).r(m_decodmd, FUNC(decodmd_type2_device::busy_r)); - map(0x4000, 0x7fff).bankr("bank1"); + map(0x4000, 0x7fff).bankr(m_mainbank); map(0x8000, 0xffff).rom().region("maincpu", 0x18000); } @@ -270,7 +274,7 @@ void whitestar_state::bank_w(uint8_t data) { - membank("bank1")->set_entry(data & 0x1f); + m_mainbank->set_entry(data & 0x1f); } // Whitestar automatically pulses the DMD IRQ line? DE hardware doesn't do that... @@ -283,8 +287,8 @@ void whitestar_state::machine_start() { - membank("bank1")->configure_entries(0, 32, memregion("maincpu")->base(), 0x4000); - membank("bank1")->set_entry(0); + m_mainbank->configure_entries(0, 32, memregion("maincpu")->base(), 0x4000); + m_mainbank->set_entry(0); genpin_class::machine_start(); //m_io_outputs.resolve(); @@ -6745,354 +6749,354 @@ } // Anonymous namespace -GAME(1995, apollo13, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Apollo 13 (5.01)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1995, apollo13_d4, apollo13, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Apollo 13 (5.01, Display 4.01)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1995, apollo13_20, apollo13, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Apollo 13 (2.03)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1995, apollo13_10, apollo13, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Apollo 13 (1.00)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2001, austin, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Austin Powers (3.02)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2001, aust301, austin, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Austin Powers (3.01)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2001, aust300, austin, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Austin Powers (3.00)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2001, aust201, austin, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Austin Powers (2.01)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2001, austnew, austin, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Austin Powers (ARM7 Sound Board)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2001, austinf, austin, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Austin Powers (France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2001, austing, austin, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Austin Powers (Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2001, austini, austin, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Austin Powers (Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1998, godzillp, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Godzilla (Pinball, 2.05)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1998, godzillp_100, godzillp, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Godzilla (Pinball, 1.00)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1998, godzillp_090, godzillp, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Godzilla (Pinball, 0.90)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1996, gldneye, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Goldeneye (4.04)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1996, gldneye_402, gldneye, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Goldeneye (4.02)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1998, goldcue, 0, goldcue, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Golden Cue", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1999, harl_a13, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Harley Davidson (1.03)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1999, harl_u13, harl_a13, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Harley Davidson (1.03 UK)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1999, harl_a10, harl_a13, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Harley Davidson (1.03 Display rev. 1.00)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1999, harl_f13, harl_a13, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Harley Davidson (1.03 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1999, harl_g13, harl_a13, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Harley Davidson (1.03 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1999, harl_i13, harl_a13, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Harley Davidson (1.03 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1999, harl_l13, harl_a13, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Harley Davidson (1.03 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, harl_a40, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Harley Davidson (4.00)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, harl_f40, harl_a40, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Harley Davidson (4.00 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, harl_g40, harl_a40, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Harley Davidson (4.00 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, harl_i40, harl_a40, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Harley Davidson (4.00 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, harl_l40, harl_a40, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Harley Davidson (4.00 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, harl_a30, harl_a40, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Harley Davidson (3.00)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, harl_f30, harl_a40, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Harley Davidson (3.00 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, harl_g30, harl_a40, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Harley Davidson (3.00 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, harl_i30, harl_a40, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Harley Davidson (3.00 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, harl_l30, harl_a40, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Harley Davidson (3.00 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, harl_a18, harl_a40, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Harley Davidson (1.08)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, harl_f18, harl_a40, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Harley Davidson (1.08 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, harl_g18, harl_a40, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Harley Davidson (1.08 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, harl_i18, harl_a40, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Harley Davidson (1.08 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, harl_l18, harl_a40, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Harley Davidson (1.08 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2001, hirolcas, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "High Roller Casino (3.00)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2001, hironew, hirolcas, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "High Roller Casino (ARM7 Sound Board)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2001, hirolcat, hirolcas, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "High Roller Casino (3.00) TEST", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2001, hirolcas_210, hirolcas, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "High Roller Casino (2.10)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2001, hirol_fr, hirolcas, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "High Roller Casino (3.00 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2001, hirol_gr, hirolcas, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "High Roller Casino (3.00 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2001, hirol_gr_210, hirolcas, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "High Roller Casino (2.10 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2001, hirol_it, hirolcas, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "High Roller Casino (3.00 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1996, id4, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Independence Day (v2.02)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1996, id4f, id4, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Independence Day (v2.02 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1996, id4_201, id4, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Independence Day (v2.01)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1996, id4f_201, id4, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Independence Day (v2.01 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1998, lostspc, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Lost in Space (1.01)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1998, lostspcf, lostspc, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Lost in Space (1.01 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1998, lostspcg, lostspc, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Lost in Space (1.01 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1998, lostspc_d1, lostspc, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Lost in Space (1.01, Display 1.01)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2001, monopolp, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Monopoly (3.20)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, monop303, monopolp, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Monopoly (3.03)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, monop301, monopolp, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Monopoly (3.01)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, monop251, monopolp, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Monopoly (2.51)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, monop233, monopolp, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Monopoly (2.33)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, monopolf, monopolp, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Monopoly (France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, monopolg, monopolp, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Monopoly (Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, monopoli, monopolp, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Monopoly (Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, monopoll, monopolp, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Monopoly (Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, mononew, monopolp, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Monopoly (ARM7 Sound Board)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2001, nfl, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "NFL", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, playboys, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (5.00)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, playboys_401, playboys, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (4.01)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, playboys_303, playboys, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (3.03)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, playboys_302, playboys, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (3.02)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, playboys_300, playboys, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (3.00)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, playboys_203, playboys, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (2.03)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, playnew, playboys, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (ARM7 Sound Board)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, playboyf, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (5.00 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, playboyf_401, playboyf, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (4.01 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, playboyf_303, playboyf, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (3.03 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, playboyf_302, playboyf, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (3.02 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, playboyf_300, playboyf, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (3.00 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, playboyf_203, playboyf, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (2.03 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, playboyg, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (5.00 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, playboyg_401, playboyg, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (4.01 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, playboyg_303, playboyg, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (3.03 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, playboyg_302, playboyg, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (3.02 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, playboyg_300, playboyg, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (3.00 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, playboyg_203, playboyg, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (2.03 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, playboyi, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (5.00 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, playboyi_401, playboyi, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (4.01 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, playboyi_303, playboyi, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (3.03 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, playboyi_302, playboyi, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (3.02 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, playboyi_300, playboyi, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (3.00 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, playboyi_203, playboyi, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (2.03 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, playboyl, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (5.00 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, playboyl_401, playboyl, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (4.01 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, playboyl_303, playboyl, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (3.03 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, playboyl_302, playboyl, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (3.02 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, playboyl_300, playboyl, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (3.00 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, playboyl_203, playboyl, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (2.03 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, rctycn, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "RollerCoaster Tycoon (7.02)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, rctycn_701, rctycn, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "RollerCoaster Tycoon (7.01)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, rctycn_600, rctycn, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "RollerCoaster Tycoon (6.00)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, rctycn_400, rctycn, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "RollerCoaster Tycoon (4.00)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, rctnew, rctycn, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "RollerCoaster Tycoon (ARM7 Sound Board)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, rctycng, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "RollerCoaster Tycoon (7.02 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, rctycng_701, rctycng, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "RollerCoaster Tycoon (7.01 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, rctycng_400, rctycng, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "RollerCoaster Tycoon (4.00 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, rctycnf, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "RollerCoaster Tycoon (7.02 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, rctycnf_701, rctycnf, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "RollerCoaster Tycoon (7.01 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, rctycnf_600, rctycnf, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "RollerCoaster Tycoon (6.00 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, rctycnf_400, rctycnf, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "RollerCoaster Tycoon (4.00 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, rctycni, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "RollerCoaster Tycoon (7.02 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, rctycni_701, rctycni, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "RollerCoaster Tycoon (7.01 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, rctycni_600, rctycni, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "RollerCoaster Tycoon (6.00 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, rctycni_400, rctycni, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "RollerCoaster Tycoon (4.00 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, rctycnl, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "RollerCoaster Tycoon (7.02 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, rctycnl_701, rctycnl, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "RollerCoaster Tycoon (7.01 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, rctycnl_600, rctycnl, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "RollerCoaster Tycoon (6.00 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, rctycnl_400, rctycnl, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "RollerCoaster Tycoon (4.00 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2000, shrkysht, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Sharkey's Shootout (2.11)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2000, shrky_207, shrkysht, goldcue, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Sharkey's Shootout (2.07)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2001, shrknew, shrkysht, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Sharkey's Shootout (ARM7 Sound Board)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2001, shrkygr, shrkysht, goldcue, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Sharkey's Shootout (2.11 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2001, shrkygr_207, shrkysht, goldcue, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Sharkey's Shootout (2.07 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2001, shrkyfr, shrkysht, goldcue, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Sharkey's Shootout (2.11 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2001, shrkyfr_207, shrkysht, goldcue, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Sharkey's Shootout (2.07 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2001, shrkyit, shrkysht, goldcue, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Sharkey's Shootout (2.11 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2001, shrkyit_207, shrkysht, goldcue, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Sharkey's Shootout (2.07 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1999, sprk_103, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "South Park (1.03)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1999, sprk_096, sprk_103, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "South Park (0.96)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1999, sprk_090, sprk_103, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "South Park (0.90)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1997, spacejam, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Space Jam (3.00)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1997, spacejam_200, spacejam, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Space Jam (2.00)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1997, spacejmg, spacejam, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Space Jam (3.00 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1997, spacejmf, spacejam, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Space Jam (3.00 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1997, spacejmi, spacejam, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Space Jam (3.00 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1997, swtril43, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Star Wars Trilogy (4.03)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1997, swtril41, swtril43, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Star Wars Trilogy (4.01)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1997, startrp, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Starship Troopers (2.01)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1997, startrp2, startrp, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Starship Troopers (2.00)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2000, strikext, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Striker Xtreme (1.02)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2000, strikext_100, strikext, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Striker Xtreme (1.00)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1999, strknew, strikext, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Striker Xtreme (ARM7 Sound Board)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2000, strxt_uk, strikext, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Striker Xtreme (1.01 UK)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2000, strxt_gr, strikext, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Striker Xtreme (1.03 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2000, strxt_fr, strikext, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Striker Xtreme (1.02 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2000, strxt_it, strikext, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Striker Xtreme (1.02 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2000, strxt_it_101, strikext, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Striker Xtreme (1.01 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2000, strxt_sp, strikext, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Striker Xtreme (1.02 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, term3, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Terminator 3: Rise of the Machines (4.00)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, term3_301, term3, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Terminator 3: Rise of the Machines (3.01)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, term3_205, term3, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Terminator 3: Rise of the Machines (2.05)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, t3new, term3, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Terminator 3: Rise of the Machines (ARM7 Sound Board)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, term3g, term3, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Terminator 3: Rise of the Machines (4.00 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, term3g_301, term3, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Terminator 3: Rise of the Machines (3.01 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, term3l, term3, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Terminator 3: Rise of the Machines (4.00 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, term3l_301, term3, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Terminator 3: Rise of the Machines (3.01 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, term3l_205, term3, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Terminator 3: Rise of the Machines (2.05 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, term3f, term3, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Terminator 3: Rise of the Machines (4.00 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, term3f_301, term3, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Terminator 3: Rise of the Machines (3.01 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, term3f_205, term3, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Terminator 3: Rise of the Machines (2.05 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, term3i, term3, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Terminator 3: Rise of the Machines (4.00 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, term3i_301, term3, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Terminator 3: Rise of the Machines (3.01 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, term3i_205, term3, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Terminator 3: Rise of the Machines (2.05 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1997, jplstw22, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "The Lost World: Jurassic Park (2.02)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1997, jplstw20, jplstw22, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "The Lost World: Jurassic Park (2.00)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, simpprty, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Simpsons Pinball Party (5.00)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, simpprty_400, simpprty, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Simpsons Pinball Party (4.00)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, simpprty_300, simpprty, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Simpsons Pinball Party (3.00)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, simpprty_204, simpprty, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Simpsons Pinball Party (2.04)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, simpnew, simpprty, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Simpsons Pinball Party (ARM7 Sound Board)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, simpprtg, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Simpsons Pinball Party (5.00 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, simpprtg_400, simpprtg, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Simpsons Pinball Party (4.00 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, simpprtl, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Simpsons Pinball Party (5.00 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, simpprtl_400, simpprtl, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Simpsons Pinball Party (4.00 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, simpprtl_300, simpprtl, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Simpsons Pinball Party (3.00 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, simpprtl_204, simpprtl, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Simpsons Pinball Party (2.04 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, simpprtf, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Simpsons Pinball Party (5.00 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, simpprtf_400, simpprtf, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Simpsons Pinball Party (4.00 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, simpprtf_300, simpprtf, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Simpsons Pinball Party (3.00 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, simpprtf_204, simpprtf, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Simpsons Pinball Party (2.04 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, simpprti, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Simpsons Pinball Party (5.00 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, simpprti_400, simpprti, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Simpsons Pinball Party (4.00 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, simpprti_300, simpprti, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Simpsons Pinball Party (3.00 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, simpprti_204, simpprti, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Simpsons Pinball Party (2.04 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1997, xfilesp, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "X-Files (3.03)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1997, xfilespf, xfilesp, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "X-Files (3.03 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1997, xfiles2, xfilesp, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "X-Files (2.04)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1997, xfiles20, xfilesp, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "X-Files (2.00)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1996, twst_405, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Twister (4.05)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1996, twst_404, twst_405, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Twister (4.04)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1996, twst_300, twst_405, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Twister (3.00)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1998, viprsega, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Viper Night Drivin' (2.01)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1998, viprsega_102, viprsega, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Viper Night Drivin' (1.02)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1998, ctchzdlx, ctcheese, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Cut The Cheese Deluxe (Redemption)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1998, titanic, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Titanic (Coin dropper)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2002, monopred, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Monopoly (Coin dropper)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1998, wackadoo, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Wack-A-Doodle-Doo (Redemption)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, elvisp, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Elvis (5.00)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, elvisp4, elvisp, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Elvis (4.00)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, elvisp303, elvisp, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Elvis (3.03)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, elvisp302, elvisp, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Elvis (3.02)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, elvisl, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Elvis (5.00 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, elvisl4, elvisl, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Elvis (4.00 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, elvisl303, elvisl, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Elvis (3.03 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, elvisl302, elvisl, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Elvis (3.02 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, elvisg, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Elvis (5.00 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, elvisg4, elvisg, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Elvis (4.00 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, elvisg303, elvisg, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Elvis (3.03 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, elvisg302, elvisg, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Elvis (3.02 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, elvisf, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Elvis (5.00 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, elvisf4, elvisf, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Elvis (4.00 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, elvisf303, elvisf, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Elvis (3.03 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, elvisf302, elvisf, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Elvis (3.02 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, elvisi, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Elvis (5.00 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, elvisi4, elvisi, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Elvis (4.00 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, elvisi303, elvisi, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Elvis (3.03 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, elvisi302, elvisi, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Elvis (3.02 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, gprix, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (4.50)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, gprix_400, gprix, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (4.00)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, gprix_352, gprix, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (3.52)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, gprix_350, gprix, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (3.50)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, gprix_340, gprix, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (3.40)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, gprix_301, gprix, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (3.01)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, gprixg, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (4.50 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, gprixg_400, gprixg, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (4.00 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, gprixg_352, gprixg, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (3.52 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, gprixg_350, gprixg, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (3.50 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, gprixg_340, gprixg, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (3.40 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, gprixg_301, gprixg, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (3.01 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, gprixl, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (4.50 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, gprixl_400, gprixl, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (4.00 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, gprixl_352, gprixl, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (3.52 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, gprixl_350, gprixl, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (3.50 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, gprixl_340, gprixl, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (3.40 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, gprixl_301, gprixl, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (3.01 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, gprixf, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (4.50 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, gprixf_400, gprixf, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (4.00 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, gprixf_352, gprixf, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (3.52 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, gprixf_350, gprixf, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (3.50 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, gprixf_340, gprixf, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (3.40 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, gprixf_301, gprixf, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (3.01 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, gprixi, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (4.50 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, gprixi_400, gprixi, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (4.00 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, gprixi_352, gprixi, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (3.52 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, gprixi_350, gprixi, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (3.50 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, gprixi_340, gprixi, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (3.40 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, gprixi_301, gprixi, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (3.01 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, nascar, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Nascar (4.50)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, nascar_400, nascar, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Nascar (4.00)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, nascar_352, nascar, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Nascar (3.52)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, nascar_350, nascar, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Nascar (3.50)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, nascar_340, nascar, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Nascar (3.40)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, nascar_301, nascar, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Nascar (3.01)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, dalejr, nascar, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Dale Jr. (5.00)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, nascarl, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Nascar (4.50 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, nascarl_400, nascarl, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Nascar (4.00 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, nascarl_352, nascarl, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Nascar (3.52 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, nascarl_350, nascarl, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Nascar (3.50 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, nascarl_340, nascarl, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Nascar (3.40 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, nascarl_301, nascarl, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Nascar (3.01 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, ripleys, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Ripley's Believe It or Not! (3.20)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, rip310, ripleys, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Ripley's Believe It or Not! (3.10)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, rip302, ripleys, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Ripley's Believe It or Not! (3.02)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, rip301, ripleys, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Ripley's Believe It or Not! (3.01)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, rip300, ripleys, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Ripley's Believe It or Not! (3.00)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, ripleysf, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Ripley's Believe It or Not! (3.20 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, ripf310, ripleysf, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Ripley's Believe It or Not! (3.10 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, ripf302, ripleysf, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Ripley's Believe It or Not! (3.02 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, ripf301, ripleysf, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Ripley's Believe It or Not! (3.01 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, ripf300, ripleysf, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Ripley's Believe It or Not! (3.00 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, ripleysg, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Ripley's Believe It or Not! (3.20 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, ripg310, ripleysg, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Ripley's Believe It or Not! (3.10 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, ripg302, ripleysg, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Ripley's Believe It or Not! (3.02 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, ripg301, ripleysg, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Ripley's Believe It or Not! (3.01 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, ripg300, ripleysg, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Ripley's Believe It or Not! (3.00 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, ripleysi, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Ripley's Believe It or Not! (3.20 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, ripi310, ripleysi, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Ripley's Believe It or Not! (3.10 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, ripi302, ripleysi, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Ripley's Believe It or Not! (3.02 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, ripi301, ripleysi, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Ripley's Believe It or Not! (3.01 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, ripi300, ripleysi, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Ripley's Believe It or Not! (3.00 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, ripleysl, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Ripley's Believe It or Not! (3.20 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, ripl310, ripleysl, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Ripley's Believe It or Not! (3.10 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, ripl302, ripleysl, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Ripley's Believe It or Not! (3.02 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, ripl301, ripleysl, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Ripley's Believe It or Not! (3.01 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2004, ripl300, ripleysl, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Ripley's Believe It or Not! (3.00 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, lotr, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (10.00)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, lotr_le, lotr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (10.02 Limited Edition)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, lotr9, lotr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (9.00)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, lotr8, lotr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (8.00)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, lotr7, lotr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (7.00)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, lotr6, lotr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (6.00)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, lotr501, lotr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (5.01)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, lotr5, lotr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (5.00)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, lotr410, lotr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (4.10)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, lotr401, lotr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (4.01)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, lotr3, lotr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (3.00)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, lotr_sp, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (10.00 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, lotr_sp9, lotr_sp, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (9.0 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, lotr_sp8, lotr_sp, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (8.0 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, lotr_sp7, lotr_sp, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (7.0 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, lotr_sp6, lotr_sp, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (6.0 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, lotr_sp501, lotr_sp, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (5.01 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, lotr_sp5, lotr_sp, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (5.0 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, lotr_sp401, lotr_sp, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (4.01 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, lotr_gr, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (10.00 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, lotr_gr9, lotr_gr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (9.0 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, lotr_gr8, lotr_gr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (8.0 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, lotr_gr7, lotr_gr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (7.0 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, lotr_gr6, lotr_gr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (6.0 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, lotr_gr501, lotr_gr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (5.01 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, lotr_gr5, lotr_gr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (5.0 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, lotr_gr410, lotr_gr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (4.10 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, lotr_gr401, lotr_gr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (4.01 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, lotr_fr, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (10.00 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, lotr_fr9, lotr_fr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (9.0 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, lotr_fr8, lotr_fr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (8.0 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, lotr_fr7, lotr_fr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (7.0 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, lotr_fr6, lotr_fr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (6.0 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, lotr_fr501, lotr_fr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (5.01 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, lotr_fr5, lotr_fr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (5.0 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, lotr_fr410, lotr_fr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (4.10 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, lotr_fr401, lotr_fr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (4.01 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, lotr_it, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (10.00 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, lotr_it9, lotr_it, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (9.0 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, lotr_it8, lotr_it, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (8.0 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, lotr_it7, lotr_it, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (7.0 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, lotr_it6, lotr_it, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (6.0 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, lotr_it501, lotr_it, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (5.01 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, lotr_it5, lotr_it, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (5.0 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, lotr_it410, lotr_it, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (4.10 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2003, lotr_it401, lotr_it, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (4.01 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, sopranos, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Sopranos (5.00)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, sopranos_400, sopranos, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Sopranos (4.00)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, sopranos_300, sopranos, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Sopranos (3.00)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, sopranos_204, sopranos, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Sopranos (2.04)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, sopranog, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Sopranos (5.00 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, sopranog_400, sopranog, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Sopranos (4.00 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, sopranog_300, sopranog, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Sopranos (3.00 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, sopranog_107, sopranog, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Sopranos (1.07 Germany)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, sopranof, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Sopranos (5.00 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, sopranof_400, sopranof, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Sopranos (4.00 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, sopranof_300, sopranof, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Sopranos (3.00 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, sopranof_107, sopranof, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Sopranos (1.07 France)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, sopranol, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Sopranos (5.00 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, sopranol_400, sopranol, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Sopranos (4.00 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, sopranol_300, sopranol, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Sopranos (3.00 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, sopranol_107, sopranol, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Sopranos (1.07 Spain)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, sopranoi, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Sopranos (5.00 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, sopranoi_400, sopranoi, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Sopranos (4.00 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, sopranoi_300, sopranoi, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Sopranos (3.00 Italy)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2005, sopranoi_107, sopranoi, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Sopranos (1.07 Italy)", MACHINE_IS_SKELETON_MECHANICAL) +GAME(1995, apollo13, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Apollo 13 (5.01)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, apollo13_d4, apollo13, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Apollo 13 (5.01, Display 4.01)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, apollo13_20, apollo13, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Apollo 13 (2.03)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, apollo13_10, apollo13, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Apollo 13 (1.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2001, austin, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Austin Powers (3.02)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2001, aust301, austin, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Austin Powers (3.01)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2001, aust300, austin, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Austin Powers (3.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2001, aust201, austin, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Austin Powers (2.01)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2001, austnew, austin, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Austin Powers (ARM7 Sound Board)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2001, austinf, austin, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Austin Powers (France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2001, austing, austin, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Austin Powers (Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2001, austini, austin, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Austin Powers (Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1998, godzillp, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Godzilla (Pinball, 2.05)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1998, godzillp_100, godzillp, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Godzilla (Pinball, 1.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1998, godzillp_090, godzillp, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Godzilla (Pinball, 0.90)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1996, gldneye, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Goldeneye (4.04)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1996, gldneye_402, gldneye, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Goldeneye (4.02)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1998, goldcue, 0, goldcue, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Golden Cue", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1999, harl_a13, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Harley Davidson (1.03)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1999, harl_u13, harl_a13, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Harley Davidson (1.03 UK)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1999, harl_a10, harl_a13, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Harley Davidson (1.03 Display rev. 1.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1999, harl_f13, harl_a13, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Harley Davidson (1.03 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1999, harl_g13, harl_a13, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Harley Davidson (1.03 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1999, harl_i13, harl_a13, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Harley Davidson (1.03 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1999, harl_l13, harl_a13, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Harley Davidson (1.03 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, harl_a40, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Harley Davidson (4.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, harl_f40, harl_a40, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Harley Davidson (4.00 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, harl_g40, harl_a40, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Harley Davidson (4.00 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, harl_i40, harl_a40, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Harley Davidson (4.00 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, harl_l40, harl_a40, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Harley Davidson (4.00 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, harl_a30, harl_a40, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Harley Davidson (3.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, harl_f30, harl_a40, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Harley Davidson (3.00 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, harl_g30, harl_a40, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Harley Davidson (3.00 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, harl_i30, harl_a40, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Harley Davidson (3.00 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, harl_l30, harl_a40, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Harley Davidson (3.00 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, harl_a18, harl_a40, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Harley Davidson (1.08)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, harl_f18, harl_a40, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Harley Davidson (1.08 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, harl_g18, harl_a40, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Harley Davidson (1.08 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, harl_i18, harl_a40, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Harley Davidson (1.08 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, harl_l18, harl_a40, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Harley Davidson (1.08 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2001, hirolcas, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "High Roller Casino (3.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2001, hironew, hirolcas, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "High Roller Casino (ARM7 Sound Board)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2001, hirolcat, hirolcas, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "High Roller Casino (3.00) TEST", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2001, hirolcas_210, hirolcas, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "High Roller Casino (2.10)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2001, hirol_fr, hirolcas, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "High Roller Casino (3.00 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2001, hirol_gr, hirolcas, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "High Roller Casino (3.00 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2001, hirol_gr_210, hirolcas, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "High Roller Casino (2.10 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2001, hirol_it, hirolcas, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "High Roller Casino (3.00 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1996, id4, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Independence Day (v2.02)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1996, id4f, id4, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Independence Day (v2.02 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1996, id4_201, id4, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Independence Day (v2.01)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1996, id4f_201, id4, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Independence Day (v2.01 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1998, lostspc, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Lost in Space (1.01)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1998, lostspcf, lostspc, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Lost in Space (1.01 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1998, lostspcg, lostspc, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Lost in Space (1.01 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1998, lostspc_d1, lostspc, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Lost in Space (1.01, Display 1.01)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2001, monopolp, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Monopoly (3.20)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, monop303, monopolp, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Monopoly (3.03)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, monop301, monopolp, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Monopoly (3.01)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, monop251, monopolp, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Monopoly (2.51)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, monop233, monopolp, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Monopoly (2.33)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, monopolf, monopolp, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Monopoly (France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, monopolg, monopolp, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Monopoly (Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, monopoli, monopolp, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Monopoly (Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, monopoll, monopolp, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Monopoly (Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, mononew, monopolp, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Monopoly (ARM7 Sound Board)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2001, nfl, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "NFL", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, playboys, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (5.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, playboys_401, playboys, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (4.01)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, playboys_303, playboys, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (3.03)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, playboys_302, playboys, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (3.02)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, playboys_300, playboys, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (3.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, playboys_203, playboys, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (2.03)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, playnew, playboys, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (ARM7 Sound Board)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, playboyf, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (5.00 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, playboyf_401, playboyf, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (4.01 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, playboyf_303, playboyf, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (3.03 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, playboyf_302, playboyf, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (3.02 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, playboyf_300, playboyf, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (3.00 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, playboyf_203, playboyf, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (2.03 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, playboyg, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (5.00 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, playboyg_401, playboyg, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (4.01 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, playboyg_303, playboyg, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (3.03 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, playboyg_302, playboyg, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (3.02 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, playboyg_300, playboyg, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (3.00 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, playboyg_203, playboyg, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (2.03 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, playboyi, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (5.00 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, playboyi_401, playboyi, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (4.01 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, playboyi_303, playboyi, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (3.03 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, playboyi_302, playboyi, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (3.02 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, playboyi_300, playboyi, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (3.00 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, playboyi_203, playboyi, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (2.03 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, playboyl, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (5.00 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, playboyl_401, playboyl, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (4.01 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, playboyl_303, playboyl, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (3.03 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, playboyl_302, playboyl, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (3.02 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, playboyl_300, playboyl, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (3.00 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, playboyl_203, playboyl, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Playboy (2.03 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, rctycn, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "RollerCoaster Tycoon (7.02)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, rctycn_701, rctycn, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "RollerCoaster Tycoon (7.01)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, rctycn_600, rctycn, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "RollerCoaster Tycoon (6.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, rctycn_400, rctycn, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "RollerCoaster Tycoon (4.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, rctnew, rctycn, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "RollerCoaster Tycoon (ARM7 Sound Board)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, rctycng, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "RollerCoaster Tycoon (7.02 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, rctycng_701, rctycng, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "RollerCoaster Tycoon (7.01 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, rctycng_400, rctycng, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "RollerCoaster Tycoon (4.00 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, rctycnf, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "RollerCoaster Tycoon (7.02 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, rctycnf_701, rctycnf, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "RollerCoaster Tycoon (7.01 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, rctycnf_600, rctycnf, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "RollerCoaster Tycoon (6.00 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, rctycnf_400, rctycnf, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "RollerCoaster Tycoon (4.00 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, rctycni, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "RollerCoaster Tycoon (7.02 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, rctycni_701, rctycni, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "RollerCoaster Tycoon (7.01 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, rctycni_600, rctycni, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "RollerCoaster Tycoon (6.00 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, rctycni_400, rctycni, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "RollerCoaster Tycoon (4.00 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, rctycnl, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "RollerCoaster Tycoon (7.02 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, rctycnl_701, rctycnl, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "RollerCoaster Tycoon (7.01 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, rctycnl_600, rctycnl, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "RollerCoaster Tycoon (6.00 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, rctycnl_400, rctycnl, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "RollerCoaster Tycoon (4.00 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2000, shrkysht, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Sharkey's Shootout (2.11)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2000, shrky_207, shrkysht, goldcue, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Sharkey's Shootout (2.07)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2001, shrknew, shrkysht, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Sharkey's Shootout (ARM7 Sound Board)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2001, shrkygr, shrkysht, goldcue, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Sharkey's Shootout (2.11 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2001, shrkygr_207, shrkysht, goldcue, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Sharkey's Shootout (2.07 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2001, shrkyfr, shrkysht, goldcue, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Sharkey's Shootout (2.11 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2001, shrkyfr_207, shrkysht, goldcue, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Sharkey's Shootout (2.07 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2001, shrkyit, shrkysht, goldcue, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Sharkey's Shootout (2.11 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2001, shrkyit_207, shrkysht, goldcue, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Sharkey's Shootout (2.07 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1999, sprk_103, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "South Park (1.03)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1999, sprk_096, sprk_103, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "South Park (0.96)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1999, sprk_090, sprk_103, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "South Park (0.90)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1997, spacejam, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Space Jam (3.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1997, spacejam_200, spacejam, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Space Jam (2.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1997, spacejmg, spacejam, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Space Jam (3.00 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1997, spacejmf, spacejam, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Space Jam (3.00 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1997, spacejmi, spacejam, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Space Jam (3.00 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1997, swtril43, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Star Wars Trilogy (4.03)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1997, swtril41, swtril43, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Star Wars Trilogy (4.01)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1997, startrp, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Starship Troopers (2.01)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1997, startrp2, startrp, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Starship Troopers (2.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2000, strikext, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Striker Xtreme (1.02)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2000, strikext_100, strikext, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Striker Xtreme (1.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1999, strknew, strikext, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Striker Xtreme (ARM7 Sound Board)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2000, strxt_uk, strikext, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Striker Xtreme (1.01 UK)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2000, strxt_gr, strikext, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Striker Xtreme (1.03 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2000, strxt_fr, strikext, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Striker Xtreme (1.02 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2000, strxt_it, strikext, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Striker Xtreme (1.02 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2000, strxt_it_101, strikext, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Striker Xtreme (1.01 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2000, strxt_sp, strikext, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Striker Xtreme (1.02 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, term3, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Terminator 3: Rise of the Machines (4.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, term3_301, term3, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Terminator 3: Rise of the Machines (3.01)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, term3_205, term3, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Terminator 3: Rise of the Machines (2.05)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, t3new, term3, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Terminator 3: Rise of the Machines (ARM7 Sound Board)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, term3g, term3, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Terminator 3: Rise of the Machines (4.00 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, term3g_301, term3, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Terminator 3: Rise of the Machines (3.01 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, term3l, term3, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Terminator 3: Rise of the Machines (4.00 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, term3l_301, term3, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Terminator 3: Rise of the Machines (3.01 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, term3l_205, term3, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Terminator 3: Rise of the Machines (2.05 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, term3f, term3, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Terminator 3: Rise of the Machines (4.00 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, term3f_301, term3, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Terminator 3: Rise of the Machines (3.01 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, term3f_205, term3, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Terminator 3: Rise of the Machines (2.05 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, term3i, term3, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Terminator 3: Rise of the Machines (4.00 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, term3i_301, term3, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Terminator 3: Rise of the Machines (3.01 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, term3i_205, term3, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Terminator 3: Rise of the Machines (2.05 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1997, jplstw22, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "The Lost World: Jurassic Park (Pinball, 2.02)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1997, jplstw20, jplstw22, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "The Lost World: Jurassic Park (Pinball, 2.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, simpprty, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Simpsons Pinball Party (5.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, simpprty_400, simpprty, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Simpsons Pinball Party (4.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, simpprty_300, simpprty, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Simpsons Pinball Party (3.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, simpprty_204, simpprty, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Simpsons Pinball Party (2.04)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, simpnew, simpprty, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Simpsons Pinball Party (ARM7 Sound Board)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, simpprtg, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Simpsons Pinball Party (5.00 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, simpprtg_400, simpprtg, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Simpsons Pinball Party (4.00 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, simpprtl, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Simpsons Pinball Party (5.00 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, simpprtl_400, simpprtl, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Simpsons Pinball Party (4.00 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, simpprtl_300, simpprtl, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Simpsons Pinball Party (3.00 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, simpprtl_204, simpprtl, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Simpsons Pinball Party (2.04 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, simpprtf, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Simpsons Pinball Party (5.00 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, simpprtf_400, simpprtf, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Simpsons Pinball Party (4.00 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, simpprtf_300, simpprtf, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Simpsons Pinball Party (3.00 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, simpprtf_204, simpprtf, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Simpsons Pinball Party (2.04 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, simpprti, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Simpsons Pinball Party (5.00 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, simpprti_400, simpprti, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Simpsons Pinball Party (4.00 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, simpprti_300, simpprti, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Simpsons Pinball Party (3.00 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, simpprti_204, simpprti, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Simpsons Pinball Party (2.04 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1997, xfilesp, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "X-Files (3.03)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1997, xfilespf, xfilesp, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "X-Files (3.03 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1997, xfiles2, xfilesp, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "X-Files (2.04)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1997, xfiles20, xfilesp, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "X-Files (2.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1996, twst_405, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Twister (4.05)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1996, twst_404, twst_405, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Twister (4.04)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1996, twst_300, twst_405, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Twister (3.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1998, viprsega, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Viper Night Drivin' (2.01)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1998, viprsega_102, viprsega, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Viper Night Drivin' (1.02)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1998, ctchzdlx, ctcheese, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Cut The Cheese Deluxe (Redemption)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1998, titanic, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Titanic (Coin dropper)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2002, monopred, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Monopoly (Coin dropper)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1998, wackadoo, 0, whitestar, whitestar, whitestar_state, empty_init, ROT0, "Sega", "Wack-A-Doodle-Doo (Redemption)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, elvisp, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Elvis (5.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, elvisp4, elvisp, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Elvis (4.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, elvisp303, elvisp, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Elvis (3.03)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, elvisp302, elvisp, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Elvis (3.02)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, elvisl, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Elvis (5.00 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, elvisl4, elvisl, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Elvis (4.00 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, elvisl303, elvisl, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Elvis (3.03 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, elvisl302, elvisl, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Elvis (3.02 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, elvisg, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Elvis (5.00 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, elvisg4, elvisg, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Elvis (4.00 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, elvisg303, elvisg, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Elvis (3.03 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, elvisg302, elvisg, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Elvis (3.02 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, elvisf, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Elvis (5.00 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, elvisf4, elvisf, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Elvis (4.00 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, elvisf303, elvisf, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Elvis (3.03 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, elvisf302, elvisf, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Elvis (3.02 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, elvisi, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Elvis (5.00 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, elvisi4, elvisi, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Elvis (4.00 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, elvisi303, elvisi, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Elvis (3.03 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, elvisi302, elvisi, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Elvis (3.02 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, gprix, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (4.50)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, gprix_400, gprix, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (4.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, gprix_352, gprix, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (3.52)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, gprix_350, gprix, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (3.50)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, gprix_340, gprix, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (3.40)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, gprix_301, gprix, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (3.01)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, gprixg, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (4.50 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, gprixg_400, gprixg, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (4.00 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, gprixg_352, gprixg, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (3.52 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, gprixg_350, gprixg, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (3.50 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, gprixg_340, gprixg, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (3.40 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, gprixg_301, gprixg, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (3.01 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, gprixl, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (4.50 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, gprixl_400, gprixl, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (4.00 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, gprixl_352, gprixl, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (3.52 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, gprixl_350, gprixl, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (3.50 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, gprixl_340, gprixl, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (3.40 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, gprixl_301, gprixl, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (3.01 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, gprixf, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (4.50 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, gprixf_400, gprixf, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (4.00 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, gprixf_352, gprixf, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (3.52 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, gprixf_350, gprixf, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (3.50 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, gprixf_340, gprixf, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (3.40 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, gprixf_301, gprixf, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (3.01 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, gprixi, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (4.50 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, gprixi_400, gprixi, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (4.00 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, gprixi_352, gprixi, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (3.52 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, gprixi_350, gprixi, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (3.50 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, gprixi_340, gprixi, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (3.40 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, gprixi_301, gprixi, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Grand Prix (3.01 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, nascar, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Nascar (4.50)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, nascar_400, nascar, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Nascar (4.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, nascar_352, nascar, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Nascar (3.52)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, nascar_350, nascar, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Nascar (3.50)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, nascar_340, nascar, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Nascar (3.40)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, nascar_301, nascar, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Nascar (3.01)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, dalejr, nascar, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Dale Jr. (5.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, nascarl, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Nascar (4.50 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, nascarl_400, nascarl, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Nascar (4.00 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, nascarl_352, nascarl, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Nascar (3.52 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, nascarl_350, nascarl, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Nascar (3.50 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, nascarl_340, nascarl, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Nascar (3.40 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, nascarl_301, nascarl, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Nascar (3.01 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, ripleys, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Ripley's Believe It or Not! (3.20)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, rip310, ripleys, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Ripley's Believe It or Not! (3.10)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, rip302, ripleys, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Ripley's Believe It or Not! (3.02)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, rip301, ripleys, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Ripley's Believe It or Not! (3.01)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, rip300, ripleys, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Ripley's Believe It or Not! (3.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, ripleysf, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Ripley's Believe It or Not! (3.20 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, ripf310, ripleysf, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Ripley's Believe It or Not! (3.10 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, ripf302, ripleysf, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Ripley's Believe It or Not! (3.02 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, ripf301, ripleysf, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Ripley's Believe It or Not! (3.01 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, ripf300, ripleysf, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Ripley's Believe It or Not! (3.00 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, ripleysg, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Ripley's Believe It or Not! (3.20 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, ripg310, ripleysg, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Ripley's Believe It or Not! (3.10 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, ripg302, ripleysg, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Ripley's Believe It or Not! (3.02 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, ripg301, ripleysg, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Ripley's Believe It or Not! (3.01 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, ripg300, ripleysg, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Ripley's Believe It or Not! (3.00 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, ripleysi, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Ripley's Believe It or Not! (3.20 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, ripi310, ripleysi, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Ripley's Believe It or Not! (3.10 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, ripi302, ripleysi, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Ripley's Believe It or Not! (3.02 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, ripi301, ripleysi, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Ripley's Believe It or Not! (3.01 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, ripi300, ripleysi, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Ripley's Believe It or Not! (3.00 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, ripleysl, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Ripley's Believe It or Not! (3.20 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, ripl310, ripleysl, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Ripley's Believe It or Not! (3.10 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, ripl302, ripleysl, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Ripley's Believe It or Not! (3.02 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, ripl301, ripleysl, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Ripley's Believe It or Not! (3.01 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2004, ripl300, ripleysl, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "Ripley's Believe It or Not! (3.00 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, lotr, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (10.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, lotr_le, lotr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (10.02 Limited Edition)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, lotr9, lotr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (9.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, lotr8, lotr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (8.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, lotr7, lotr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (7.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, lotr6, lotr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (6.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, lotr501, lotr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (5.01)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, lotr5, lotr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (5.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, lotr410, lotr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (4.10)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, lotr401, lotr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (4.01)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, lotr3, lotr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (3.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, lotr_sp, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (10.00 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, lotr_sp9, lotr_sp, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (9.0 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, lotr_sp8, lotr_sp, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (8.0 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, lotr_sp7, lotr_sp, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (7.0 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, lotr_sp6, lotr_sp, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (6.0 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, lotr_sp501, lotr_sp, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (5.01 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, lotr_sp5, lotr_sp, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (5.0 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, lotr_sp401, lotr_sp, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (4.01 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, lotr_gr, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (10.00 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, lotr_gr9, lotr_gr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (9.0 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, lotr_gr8, lotr_gr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (8.0 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, lotr_gr7, lotr_gr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (7.0 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, lotr_gr6, lotr_gr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (6.0 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, lotr_gr501, lotr_gr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (5.01 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, lotr_gr5, lotr_gr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (5.0 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, lotr_gr410, lotr_gr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (4.10 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, lotr_gr401, lotr_gr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (4.01 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, lotr_fr, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (10.00 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, lotr_fr9, lotr_fr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (9.0 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, lotr_fr8, lotr_fr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (8.0 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, lotr_fr7, lotr_fr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (7.0 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, lotr_fr6, lotr_fr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (6.0 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, lotr_fr501, lotr_fr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (5.01 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, lotr_fr5, lotr_fr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (5.0 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, lotr_fr410, lotr_fr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (4.10 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, lotr_fr401, lotr_fr, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (4.01 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, lotr_it, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (10.00 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, lotr_it9, lotr_it, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (9.0 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, lotr_it8, lotr_it, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (8.0 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, lotr_it7, lotr_it, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (7.0 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, lotr_it6, lotr_it, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (6.0 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, lotr_it501, lotr_it, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (5.01 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, lotr_it5, lotr_it, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (5.0 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, lotr_it410, lotr_it, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (4.10 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2003, lotr_it401, lotr_it, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Lord Of The Rings (4.01 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, sopranos, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Sopranos (5.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, sopranos_400, sopranos, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Sopranos (4.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, sopranos_300, sopranos, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Sopranos (3.00)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, sopranos_204, sopranos, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Sopranos (2.04)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, sopranog, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Sopranos (5.00 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, sopranog_400, sopranog, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Sopranos (4.00 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, sopranog_300, sopranog, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Sopranos (3.00 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, sopranog_107, sopranog, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Sopranos (1.07 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, sopranof, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Sopranos (5.00 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, sopranof_400, sopranof, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Sopranos (4.00 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, sopranof_300, sopranof, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Sopranos (3.00 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, sopranof_107, sopranof, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Sopranos (1.07 France)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, sopranol, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Sopranos (5.00 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, sopranol_400, sopranol, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Sopranos (4.00 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, sopranol_300, sopranol, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Sopranos (3.00 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, sopranol_107, sopranol, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Sopranos (1.07 Spain)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, sopranoi, 0, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Sopranos (5.00 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, sopranoi_400, sopranoi, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Sopranos (4.00 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, sopranoi_300, sopranoi, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Sopranos (3.00 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, sopranoi_107, sopranoi, whitestarm, whitestar, whitestar_state, empty_init, ROT0, "Stern", "The Sopranos (1.07 Italy)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/wico.cpp mame-0.243+dfsg.1/src/mame/drivers/wico.cpp --- mame-0.242+dfsg.1/src/mame/drivers/wico.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/wico.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -78,10 +78,10 @@ void ccpu_map(address_map &map); void hcpu_map(address_map &map); - bool m_zcen = 0; - bool m_gten = 0; - bool m_disp_on = 0; - bool m_diag_on = 0; + bool m_zcen = false; + bool m_gten = false; + bool m_disp_on = false; + bool m_diag_on = false; u8 m_firqtimer = 0U; u8 m_diag_segments = 0U; virtual void machine_start() override; @@ -525,4 +525,4 @@ } // Anonymous namespace -GAME(1984, aftor, 0, wico, wico, wico_state, empty_init, ROT0, "Wico", "Af-Tor", MACHINE_IS_SKELETON_MECHANICAL ) +GAME(1984, aftor, 0, wico, wico, wico_state, empty_init, ROT0, "Wico", "Af-Tor", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/wink.cpp mame-0.243+dfsg.1/src/mame/drivers/wink.cpp --- mame-0.242+dfsg.1/src/mame/drivers/wink.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/wink.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -243,59 +243,53 @@ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON3 ) // slam PORT_START("DSW1") - PORT_DIPNAME( 0x01, 0x01, "1" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x11, 0x10, DEF_STR( Bonus_Life ) ) + PORT_DIPSETTING( 0x10, "60k/120k/240k/480k" ) + PORT_DIPSETTING( 0x01, "80k/160k/320k/640k" ) + PORT_DIPSETTING( 0x00, "100k/200k/400k/800k" ) + PORT_DIPSETTING( 0x11, DEF_STR( None ) ) + PORT_DIPNAME( 0x26, 0x26, DEF_STR( Coin_B ) ) + PORT_DIPSETTING( 0x26, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x24, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0x06, DEF_STR( 1C_3C ) ) + PORT_DIPSETTING( 0x04, DEF_STR( 1C_5C ) ) + PORT_DIPSETTING( 0x22, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x20, DEF_STR( 2C_2C ) ) + PORT_DIPSETTING( 0x02, DEF_STR( 2C_3C ) ) + PORT_DIPSETTING( 0x00, DEF_STR( 2C_5C ) ) + PORT_DIPNAME( 0xc8, 0xc8, DEF_STR( Coin_A ) ) + PORT_DIPSETTING( 0xc8, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x88, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0xc0, DEF_STR( 1C_3C ) ) + PORT_DIPSETTING( 0x80, DEF_STR( 1C_5C ) ) + PORT_DIPSETTING( 0x48, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x08, DEF_STR( 2C_2C ) ) + PORT_DIPSETTING( 0x40, DEF_STR( 2C_3C ) ) + PORT_DIPSETTING( 0x00, DEF_STR( 2C_5C ) ) PORT_START("DSW2") - PORT_DIPNAME( 0x01, 0x01, "2" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x11, 0x11, "Ball Save Barrier" ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x11, DEF_STR( On ) ) PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x04, "1 Credit Award" ) + PORT_DIPSETTING( 0x04, DEF_STR( Yes ) ) + PORT_DIPSETTING( 0x00, DEF_STR( No ) ) + PORT_DIPNAME( 0x88, 0x80, DEF_STR( Lives ) ) + PORT_DIPSETTING( 0x88, "2" ) + PORT_DIPSETTING( 0x80, "3" ) + PORT_DIPSETTING( 0x08, "5" ) + PORT_DIPSETTING( 0x00, "7" ) + PORT_DIPNAME( 0x60, 0x40, "Timer Speed" ) + PORT_DIPSETTING( 0x00, "Slow" ) + PORT_DIPSETTING( 0x40, DEF_STR( Normal ) ) + PORT_DIPSETTING( 0x60, "Fast" ) + PORT_DIPSETTING( 0x20, "Very Fast" ) PORT_START("DSW3") - PORT_DIPNAME( 0x01, 0x01, "3" ) + PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) @@ -324,23 +318,22 @@ PORT_DIPNAME( 0x01, 0x01, "Summary" ) PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, "4" ) + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) + PORT_DIPNAME( 0x44, 0x44, "Credit Payout" ) + PORT_DIPSETTING( 0x44, "2.5%" ) + PORT_DIPSETTING( 0x40, "5%" ) + PORT_DIPSETTING( 0x04, "10%" ) + PORT_DIPSETTING( 0x00, "20%" ) + PORT_DIPNAME( 0x08, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) + PORT_DIPNAME( 0x80, 0x80, "Reset Summary Stats" ) PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) INPUT_PORTS_END diff -Nru mame-0.242+dfsg.1/src/mame/drivers/wiz.cpp mame-0.243+dfsg.1/src/mame/drivers/wiz.cpp --- mame-0.242+dfsg.1/src/mame/drivers/wiz.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/wiz.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1069,6 +1069,33 @@ ROM_LOAD( "stinger.a8", 0x0200, 0x0100, CRC(76b57629) SHA1(836763948753b7fed97c9e5d90a16dc4ba68f42a) ) /* blue component */ ROM_END +ROM_START( finger ) // AFC 02300 Rev.0 + AFC 03300 Rev.0 PCBs. Only the first three main CPU ROMs differ. Basically just a GFX hack of the stinger2 set. + ROM_REGION( 0xc000, "maincpu", 0 ) + ROM_LOAD( "1.5j", 0x0000, 0x2000, CRC(4949ae39) SHA1(f24a38b5c8a9dbe01c60c93895af8729898bc324) ) // encrypted + ROM_LOAD( "2.7j", 0x2000, 0x2000, CRC(7288db11) SHA1(dd657e3912bf0e5e9c5bf840bb696739701800e8) ) // encrypted + ROM_LOAD( "3.8j", 0x4000, 0x2000, CRC(386c6207) SHA1(bb23c6f6bb279e39a3931fda3bafc4a6292e58b1) ) // encrypted + ROM_LOAD( "4.9j", 0x6000, 0x2000, CRC(230ba682) SHA1(c419ffebd021d41b3f5021948007fb6bcdb1cdf7) ) // encrypted + ROM_LOAD( "5.10j", 0x8000, 0x2000, CRC(a03a01da) SHA1(28fecac7a821ac4718242919840266a907160df0) ) // encrypted + + ROM_REGION( 0x2000, "audiocpu", 0 ) + ROM_LOAD( "6.9f", 0x0000, 0x2000, CRC(79757f0c) SHA1(71be938c32c6a84618763761786ecc5d7d47581a) ) + + ROM_REGION( 0x6000, "gfx1", 0 ) // sprites/chars + ROM_LOAD( "7.9e", 0x0000, 0x2000, CRC(775489be) SHA1(5fccede323895626cf2eabd606ed21282aa36356) ) + ROM_LOAD( "8.11e", 0x2000, 0x2000, CRC(43c61b3f) SHA1(5cdb6a5096b42406c2f2784d37e4e39207c35d40) ) + ROM_LOAD( "9.14e", 0x4000, 0x2000, CRC(c9ed8fc7) SHA1(259d7681b663adb1c5fe057e2ef08469ddcbd3c3) ) + + ROM_REGION( 0x6000, "gfx2", 0 ) // sprites/chars. Labels were actually all 1 but overwritten with a marker + ROM_LOAD( "10.9h", 0x0000, 0x2000, CRC(f6721930) SHA1(fb903f1deb5f093ff5fe129e213966af58a68339) ) + ROM_LOAD( "11.11h", 0x2000, 0x2000, CRC(a4404e63) SHA1(50ae99748547af20e04f6c6c8c7eba85f967b9dc) ) + ROM_LOAD( "12.14h", 0x4000, 0x2000, CRC(b60fa88c) SHA1(2d3bca35076625251933989f5e566d5d3290542b) ) + + ROM_REGION( 0x0300, "proms", 0 ) + ROM_LOAD( "6301.a7", 0x0000, 0x0100, CRC(52c06fc2) SHA1(b416077fcfabe0dbb1ca30752de6a219ea896f75) ) // red component + ROM_LOAD( "6301.b7", 0x0100, 0x0100, CRC(9985e575) SHA1(b0d609968917121325760f8d4777066abdb7ccfc) ) // green component + ROM_LOAD( "6301.a8", 0x0200, 0x0100, CRC(76b57629) SHA1(836763948753b7fed97c9e5d90a16dc4ba68f42a) ) // blue component +ROM_END + ROM_START( scion ) ROM_REGION( 0xc000, "maincpu", 0 ) ROM_LOAD( "sc1", 0x0000, 0x2000, CRC(8dcad575) SHA1(3f194ece25e730b1cbbf3f332bbdebc3a6a72b0f) ) @@ -1161,6 +1188,7 @@ GAME( 1983, stinger, 0, stinger, stinger, wiz_state, init_stinger, ROT90, "Seibu Denshi", "Stinger", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE ) GAME( 1983, stinger2, stinger, stinger, stinger2, wiz_state, init_stinger, ROT90, "Seibu Denshi", "Stinger (prototype?)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE ) +GAME( 1983, finger, stinger, stinger, stinger2, wiz_state, init_stinger, ROT90, "bootleg", "Finger (bootleg of Stinger)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE ) GAME( 1984, scion, 0, scion, scion, wiz_state, empty_init, ROT0, "Seibu Denshi", "Scion", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE ) GAME( 1984, scionc, scion, scion, scion, wiz_state, empty_init, ROT0, "Seibu Denshi (Cinematronics license)", "Scion (Cinematronics)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE ) GAME( 1984, kungfut, 0, kungfut, kungfut, wiz_state, empty_init, ROT0, "Seibu Kaihatsu", "Kung-Fu Taikun (set 1)", MACHINE_SUPPORTS_SAVE | MACHINE_NODEVICE_MICROPHONE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/wms_shuffle.cpp mame-0.243+dfsg.1/src/mame/drivers/wms_shuffle.cpp --- mame-0.242+dfsg.1/src/mame/drivers/wms_shuffle.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/wms_shuffle.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -110,9 +110,9 @@ void clockcnt_w(u16 data); u8 m_strobe = 0; u8 m_row = 0; - bool m_data_ok = 0; + bool m_data_ok = false; u8 m_lamp_data = 0; - bool m_irq_in_progress = 0; + bool m_irq_in_progress = false; DECLARE_WRITE_LINE_MEMBER(pia21_cb2_w) { } // enable solenoids DECLARE_WRITE_LINE_MEMBER(pia22_ca2_w) { } //ST5 DECLARE_WRITE_LINE_MEMBER(pia22_cb2_w) { } //ST-solenoids enable @@ -778,19 +778,19 @@ } // Anonymous namespace -GAME( 1978, topaz_l1, 0, s4, s4, shuffle_state, empty_init, ROT0, "Williams", "Topaz (Shuffle) (L-1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1978, pomp_l1, 0, s4, s4, shuffle_state, empty_init, ROT0, "Williams/United", "Pompeii (Shuffle) (L-1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1978, arist_l1, 0, s4, s4, shuffle_state, empty_init, ROT0, "Williams/United", "Aristocrat (Shuffle) (L-1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1979, taurs_l1, 0, s4, s4, shuffle_state, empty_init, ROT0, "Williams", "Taurus (Shuffle) (L-1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1979, kingt_l1, 0, s4, s4, shuffle_state, empty_init, ROT0, "Williams/United", "King Tut (Shuffle) (L-1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1980, omni_l1, 0, s4, s4, shuffle_state, empty_init, ROT0, "Williams/United", "Omni (Shuffle) (L-1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1983, bstrk_l1, 0, s4, s4, shuffle_state, empty_init, ROT0, "Williams/United", "Big Strike (Shuffle) (L-1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1983, tstrk_l1, 0, s4, s4, shuffle_state, empty_init, ROT0, "Williams/United", "Triple Strike (Shuffle) (L-1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1984, szone_l5, 0, s9, s9, shuffle_state, empty_init, ROT0, "Williams/United", "Strike Zone (Shuffle) (L-5)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1984, szone_l2, szone_l5, s9, s9, shuffle_state, empty_init, ROT0, "Williams/United", "Strike Zone (Shuffle) (L-2)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1985, alcat_l7, 0, s11, s9, shuffle_state, empty_init, ROT0, "Williams", "Alley Cats (Shuffle) (L-7)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1986, tts_l2, 0, s11, s9, shuffle_state, empty_init, ROT0, "Williams", "Tic-Tac-Strike (Shuffle) (L-2)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1986, tts_l1, tts_l2, s11, s9, shuffle_state, empty_init, ROT0, "Williams", "Tic-Tac-Strike (Shuffle) (L-1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1987, gmine_l2, 0, s11, s9, shuffle_state, empty_init, ROT0, "Williams", "Gold Mine (Shuffle) (L-2)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1987, tdawg_l1, 0, s11, s9, shuffle_state, empty_init, ROT0, "Williams", "Top Dawg (Shuffle) (L-1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 1987, shfin_l1, 0, s11, s9, shuffle_state, empty_init, ROT0, "Williams", "Shuffle Inn (Shuffle) (L-1)", MACHINE_IS_SKELETON_MECHANICAL ) +GAME( 1978, topaz_l1, 0, s4, s4, shuffle_state, empty_init, ROT0, "Williams", "Topaz (Shuffle) (L-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1978, pomp_l1, 0, s4, s4, shuffle_state, empty_init, ROT0, "Williams/United", "Pompeii (Shuffle) (L-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1978, arist_l1, 0, s4, s4, shuffle_state, empty_init, ROT0, "Williams/United", "Aristocrat (Shuffle) (L-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1979, taurs_l1, 0, s4, s4, shuffle_state, empty_init, ROT0, "Williams", "Taurus (Shuffle) (L-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1979, kingt_l1, 0, s4, s4, shuffle_state, empty_init, ROT0, "Williams/United", "King Tut (Shuffle) (L-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1980, omni_l1, 0, s4, s4, shuffle_state, empty_init, ROT0, "Williams/United", "Omni (Shuffle) (L-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1983, bstrk_l1, 0, s4, s4, shuffle_state, empty_init, ROT0, "Williams/United", "Big Strike (Shuffle) (L-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1983, tstrk_l1, 0, s4, s4, shuffle_state, empty_init, ROT0, "Williams/United", "Triple Strike (Shuffle) (L-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1984, szone_l5, 0, s9, s9, shuffle_state, empty_init, ROT0, "Williams/United", "Strike Zone (Shuffle) (L-5)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1984, szone_l2, szone_l5, s9, s9, shuffle_state, empty_init, ROT0, "Williams/United", "Strike Zone (Shuffle) (L-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1985, alcat_l7, 0, s11, s9, shuffle_state, empty_init, ROT0, "Williams", "Alley Cats (Shuffle) (L-7)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1986, tts_l2, 0, s11, s9, shuffle_state, empty_init, ROT0, "Williams", "Tic-Tac-Strike (Shuffle) (L-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1986, tts_l1, tts_l2, s11, s9, shuffle_state, empty_init, ROT0, "Williams", "Tic-Tac-Strike (Shuffle) (L-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1987, gmine_l2, 0, s11, s9, shuffle_state, empty_init, ROT0, "Williams", "Gold Mine (Shuffle) (L-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1987, tdawg_l1, 0, s11, s9, shuffle_state, empty_init, ROT0, "Williams", "Top Dawg (Shuffle) (L-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1987, shfin_l1, 0, s11, s9, shuffle_state, empty_init, ROT0, "Williams", "Shuffle Inn (Shuffle) (L-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/wpc_an.cpp mame-0.243+dfsg.1/src/mame/drivers/wpc_an.cpp --- mame-0.242+dfsg.1/src/mame/drivers/wpc_an.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/wpc_an.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -152,8 +152,8 @@ uint32_t m_irq_count = 0U; uint8_t m_bankmask = 0U; uint8_t m_ram[0x3000]{}; - emu_timer* m_vblank_timer; - emu_timer* m_irq_timer; + emu_timer* m_vblank_timer = nullptr; + emu_timer* m_irq_timer = nullptr; }; @@ -812,23 +812,23 @@ ROM_REGION(0x8000, "fixed", ROMREGION_ERASE00) ROM_END -GAME(1990, tfa_13, 0, wpc_an, wpc_an, wpc_an_state, init_wpc_an, ROT0, "Bally", "WPC Test Fixture: Alphanumeric (1.3)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1990, dd_p7, dd_l2, wpc_an_dd, wpc_an, wpc_an_state, init_wpc_an, ROT0, "Bally", "Dr. Dude (PA-7 WPC)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1990, dd_p06, dd_l2, wpc_an_dd, wpc_an, wpc_an_state, init_wpc_an, ROT0, "Bally", "Dr. Dude (PA-6 WPC)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1990, fh_l9, 0, wpc_an, wpc_an, wpc_an_state, init_wpc_an, ROT0, "Williams", "Funhouse (L-9, SL-2m)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1990, fh_l9b, fh_l9, wpc_an, wpc_an, wpc_an_state, init_wpc_an, ROT0, "Williams", "Funhouse (L-9, SL-2m, bootleg improved German translation)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1996, fh_905h, fh_l9, wpc_an, wpc_an, wpc_an_state, init_wpc_an, ROT0, "Williams", "Funhouse (9.05H)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1990, fh_l2, fh_l9, wpc_an, wpc_an, wpc_an_state, init_wpc_an, ROT0, "Williams", "Funhouse (L-2)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1990, fh_l3, fh_l9, wpc_an, wpc_an, wpc_an_state, init_wpc_an, ROT0, "Williams", "Funhouse (L-3)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1990, fh_l4, fh_l9, wpc_an, wpc_an, wpc_an_state, init_wpc_an, ROT0, "Williams", "Funhouse (L-4)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1990, fh_l5, fh_l9, wpc_an, wpc_an, wpc_an_state, init_wpc_an, ROT0, "Williams", "Funhouse (L-5)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1990, fh_pa1, fh_l9, wpc_an_dd, wpc_an, wpc_an_state, init_wpc_an, ROT0, "Williams", "Funhouse (L-2, prototype PA-1 System 11 sound)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1991, hd_l3, 0, wpc_an, wpc_an, wpc_an_state, init_wpc_an, ROT0, "Bally", "Harley Davidson (L-3)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1991, hd_l2, hd_l3, wpc_an, wpc_an, wpc_an_state, init_wpc_an, ROT0, "Bally", "Harley Davidson (L-2)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1991, hd_l1, hd_l3, wpc_an, wpc_an, wpc_an_state, init_wpc_an, ROT0, "Bally", "Harley Davidson (L-1)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1992, bop_l7, 0, wpc_an, wpc_an, wpc_an_state, init_wpc_an, ROT0, "Williams", "The Machine: Bride of Pinbot (L-7)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1991, bop_l6, bop_l7, wpc_an, wpc_an, wpc_an_state, init_wpc_an, ROT0, "Williams", "The Machine: Bride of Pinbot (L-6)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1991, bop_l5, bop_l7, wpc_an, wpc_an, wpc_an_state, init_wpc_an, ROT0, "Williams", "The Machine: Bride of Pinbot (L-5)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1991, bop_l4, bop_l7, wpc_an, wpc_an, wpc_an_state, init_wpc_an, ROT0, "Williams", "The Machine: Bride of Pinbot (L-4)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1991, bop_l3, bop_l7, wpc_an, wpc_an, wpc_an_state, init_wpc_an, ROT0, "Williams", "The Machine: Bride of Pinbot (L-3)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1991, bop_l2, bop_l7, wpc_an, wpc_an, wpc_an_state, init_wpc_an, ROT0, "Williams", "The Machine: Bride of Pinbot (L-2)", MACHINE_IS_SKELETON_MECHANICAL) +GAME(1990, tfa_13, 0, wpc_an, wpc_an, wpc_an_state, init_wpc_an, ROT0, "Bally", "WPC Test Fixture: Alphanumeric (1.3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1990, dd_p7, dd_l2, wpc_an_dd, wpc_an, wpc_an_state, init_wpc_an, ROT0, "Bally", "Dr. Dude (PA-7 WPC)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1990, dd_p06, dd_l2, wpc_an_dd, wpc_an, wpc_an_state, init_wpc_an, ROT0, "Bally", "Dr. Dude (PA-6 WPC)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1990, fh_l9, 0, wpc_an, wpc_an, wpc_an_state, init_wpc_an, ROT0, "Williams", "Funhouse (L-9, SL-2m)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1990, fh_l9b, fh_l9, wpc_an, wpc_an, wpc_an_state, init_wpc_an, ROT0, "Williams", "Funhouse (L-9, SL-2m, bootleg improved German translation)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1996, fh_905h, fh_l9, wpc_an, wpc_an, wpc_an_state, init_wpc_an, ROT0, "Williams", "Funhouse (9.05H)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1990, fh_l2, fh_l9, wpc_an, wpc_an, wpc_an_state, init_wpc_an, ROT0, "Williams", "Funhouse (L-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1990, fh_l3, fh_l9, wpc_an, wpc_an, wpc_an_state, init_wpc_an, ROT0, "Williams", "Funhouse (L-3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1990, fh_l4, fh_l9, wpc_an, wpc_an, wpc_an_state, init_wpc_an, ROT0, "Williams", "Funhouse (L-4)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1990, fh_l5, fh_l9, wpc_an, wpc_an, wpc_an_state, init_wpc_an, ROT0, "Williams", "Funhouse (L-5)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1990, fh_pa1, fh_l9, wpc_an_dd, wpc_an, wpc_an_state, init_wpc_an, ROT0, "Williams", "Funhouse (L-2, prototype PA-1 System 11 sound)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1991, hd_l3, 0, wpc_an, wpc_an, wpc_an_state, init_wpc_an, ROT0, "Bally", "Harley Davidson (L-3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1991, hd_l2, hd_l3, wpc_an, wpc_an, wpc_an_state, init_wpc_an, ROT0, "Bally", "Harley Davidson (L-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1991, hd_l1, hd_l3, wpc_an, wpc_an, wpc_an_state, init_wpc_an, ROT0, "Bally", "Harley Davidson (L-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1992, bop_l7, 0, wpc_an, wpc_an, wpc_an_state, init_wpc_an, ROT0, "Williams", "The Machine: Bride of Pinbot (L-7)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1991, bop_l6, bop_l7, wpc_an, wpc_an, wpc_an_state, init_wpc_an, ROT0, "Williams", "The Machine: Bride of Pinbot (L-6)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1991, bop_l5, bop_l7, wpc_an, wpc_an, wpc_an_state, init_wpc_an, ROT0, "Williams", "The Machine: Bride of Pinbot (L-5)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1991, bop_l4, bop_l7, wpc_an, wpc_an, wpc_an_state, init_wpc_an, ROT0, "Williams", "The Machine: Bride of Pinbot (L-4)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1991, bop_l3, bop_l7, wpc_an, wpc_an, wpc_an_state, init_wpc_an, ROT0, "Williams", "The Machine: Bride of Pinbot (L-3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1991, bop_l2, bop_l7, wpc_an, wpc_an, wpc_an_state, init_wpc_an, ROT0, "Williams", "The Machine: Bride of Pinbot (L-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/wpc_dcs.cpp mame-0.243+dfsg.1/src/mame/drivers/wpc_dcs.cpp --- mame-0.242+dfsg.1/src/mame/drivers/wpc_dcs.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/wpc_dcs.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -917,36 +917,36 @@ } // Anonymous namespace -GAME(1994, dm_lx4, 0, wpc_dcs, wpc_dcs, wpc_dcs_state, init_dm, ROT0, "Williams", "Demolition Man (LX-4)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1994, dm_pa2, dm_lx4, wpc_dcs, wpc_dcs, wpc_dcs_state, init_dm, ROT0, "Williams", "Demolition Man (PA-2)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1994, dm_px5, dm_lx4, wpc_dcs, wpc_dcs, wpc_dcs_state, init_dm, ROT0, "Williams", "Demolition Man (PX-5)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1994, dm_la1, dm_lx4, wpc_dcs, wpc_dcs, wpc_dcs_state, init_dm, ROT0, "Williams", "Demolition Man (LA-1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1994, dm_lx3, dm_lx4, wpc_dcs, wpc_dcs, wpc_dcs_state, init_dm, ROT0, "Williams", "Demolition Man (LX-3)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1995, dm_h5, dm_lx4, wpc_dcs, wpc_dcs, wpc_dcs_state, init_dm, ROT0, "Williams", "Demolition Man (H-5)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1995, dm_h6, dm_lx4, wpc_dcs, wpc_dcs, wpc_dcs_state, init_dm, ROT0, "Williams", "Demolition Man (H-6)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1993, ij_l7, 0, wpc_dcs, wpc_dcs, wpc_dcs_state, init_ij, ROT0, "Williams", "Indiana Jones (L-7)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1993, ij_lg7, ij_l7, wpc_dcs, wpc_dcs, wpc_dcs_state, init_ij, ROT0, "Williams", "Indiana Jones (LG-7)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1993, ij_l6, ij_l7, wpc_dcs, wpc_dcs, wpc_dcs_state, init_ij, ROT0, "Williams", "Indiana Jones (L-6)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1993, ij_l5, ij_l7, wpc_dcs, wpc_dcs, wpc_dcs_state, init_ij, ROT0, "Williams", "Indiana Jones (L-5)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1993, ij_l4, ij_l7, wpc_dcs, wpc_dcs, wpc_dcs_state, init_ij, ROT0, "Williams", "Indiana Jones (L-4)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1993, ij_l3, ij_l7, wpc_dcs, wpc_dcs, wpc_dcs_state, init_ij, ROT0, "Williams", "Indiana Jones (L-3)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1993, jd_l7, 0, wpc_dcs, wpc_dcs, wpc_dcs_state, init_jd, ROT0, "Bally", "Judge Dredd (L-7)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1993, jd_l1, jd_l7, wpc_dcs, wpc_dcs, wpc_dcs_state, init_jd, ROT0, "Bally", "Judge Dredd (L-1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1993, jd_l6, jd_l7, wpc_dcs, wpc_dcs, wpc_dcs_state, init_jd, ROT0, "Bally", "Judge Dredd (L-6)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1993, jd_l5, jd_l7, wpc_dcs, wpc_dcs, wpc_dcs_state, init_jd, ROT0, "Bally", "Judge Dredd (L-5)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1993, jd_l4, jd_l7, wpc_dcs, wpc_dcs, wpc_dcs_state, init_jd, ROT0, "Bally", "Judge Dredd (L-4)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1994, pop_lx5, 0, wpc_dcs, wpc_dcs, wpc_dcs_state, init_pop, ROT0, "Bally", "Popeye Saves The Earth (LX-5)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1994, pop_la4, pop_lx5, wpc_dcs, wpc_dcs, wpc_dcs_state, init_pop, ROT0, "Bally", "Popeye Saves The Earth (LA-4)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1994, pop_pa3, pop_lx5, wpc_dcs, wpc_dcs, wpc_dcs_state, init_pop, ROT0, "Bally", "Popeye Saves The Earth (PA-3)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1994, sttng_l7, 0, wpc_dcs, wpc_dcs, wpc_dcs_state, init_sttng, ROT0, "Williams", "Star Trek: The Next Generation (LX-7)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1994, sttng_l5, sttng_l7, wpc_dcs, wpc_dcs, wpc_dcs_state, init_sttng, ROT0, "Williams", "Star Trek: The Next Generation (LX-5)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1994, sttng_x7, sttng_l7, wpc_dcs, wpc_dcs, wpc_dcs_state, init_sttng, ROT0, "Williams", "Star Trek: The Next Generation (LX-7 Special)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1993, sttng_p8, sttng_l7, wpc_dcs, wpc_dcs, wpc_dcs_state, init_sttng, ROT0, "Williams", "Star Trek: The Next Generation (P-8)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1993, sttng_p5, sttng_l7, wpc_dcs, wpc_dcs, wpc_dcs_state, init_sttng, ROT0, "Williams", "Star Trek: The Next Generation (P-5)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1993, sttng_p4, sttng_l7, wpc_dcs, wpc_dcs, wpc_dcs_state, init_sttng, ROT0, "Williams", "Star Trek: The Next Generation (P-4)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1994, sttng_s7, sttng_l7, wpc_dcs, wpc_dcs, wpc_dcs_state, init_sttng, ROT0, "Williams", "Star Trek: The Next Generation (LX-7) SP1", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1994, sttng_g7, sttng_l7, wpc_dcs, wpc_dcs, wpc_dcs_state, init_sttng, ROT0, "Williams", "Star Trek: The Next Generation (LG-7)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1993, sttng_l1, sttng_l7, wpc_dcs, wpc_dcs, wpc_dcs_state, init_sttng, ROT0, "Williams", "Star Trek: The Next Generation (LX-1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1993, sttng_l2, sttng_l7, wpc_dcs, wpc_dcs, wpc_dcs_state, init_sttng, ROT0, "Williams", "Star Trek: The Next Generation (LX-2)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1994, sttng_l3, sttng_l7, wpc_dcs, wpc_dcs, wpc_dcs_state, init_sttng, ROT0, "Williams", "Star Trek: The Next Generation (LX-3)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1993, afv_l4, 0, wpc_dcs, wpc_dcs, wpc_dcs_state, init_afv, ROT0, "Williams", "Addams Family Values (Coin Dropper L-4)", MACHINE_IS_SKELETON_MECHANICAL ) +GAME(1994, dm_lx4, 0, wpc_dcs, wpc_dcs, wpc_dcs_state, init_dm, ROT0, "Williams", "Demolition Man (LX-4)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, dm_pa2, dm_lx4, wpc_dcs, wpc_dcs, wpc_dcs_state, init_dm, ROT0, "Williams", "Demolition Man (PA-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, dm_px5, dm_lx4, wpc_dcs, wpc_dcs, wpc_dcs_state, init_dm, ROT0, "Williams", "Demolition Man (PX-5)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, dm_la1, dm_lx4, wpc_dcs, wpc_dcs, wpc_dcs_state, init_dm, ROT0, "Williams", "Demolition Man (LA-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, dm_lx3, dm_lx4, wpc_dcs, wpc_dcs, wpc_dcs_state, init_dm, ROT0, "Williams", "Demolition Man (LX-3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, dm_h5, dm_lx4, wpc_dcs, wpc_dcs, wpc_dcs_state, init_dm, ROT0, "Williams", "Demolition Man (H-5)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, dm_h6, dm_lx4, wpc_dcs, wpc_dcs, wpc_dcs_state, init_dm, ROT0, "Williams", "Demolition Man (H-6)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1993, ij_l7, 0, wpc_dcs, wpc_dcs, wpc_dcs_state, init_ij, ROT0, "Williams", "Indiana Jones (L-7)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1993, ij_lg7, ij_l7, wpc_dcs, wpc_dcs, wpc_dcs_state, init_ij, ROT0, "Williams", "Indiana Jones (LG-7)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1993, ij_l6, ij_l7, wpc_dcs, wpc_dcs, wpc_dcs_state, init_ij, ROT0, "Williams", "Indiana Jones (L-6)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1993, ij_l5, ij_l7, wpc_dcs, wpc_dcs, wpc_dcs_state, init_ij, ROT0, "Williams", "Indiana Jones (L-5)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1993, ij_l4, ij_l7, wpc_dcs, wpc_dcs, wpc_dcs_state, init_ij, ROT0, "Williams", "Indiana Jones (L-4)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1993, ij_l3, ij_l7, wpc_dcs, wpc_dcs, wpc_dcs_state, init_ij, ROT0, "Williams", "Indiana Jones (L-3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1993, jd_l7, 0, wpc_dcs, wpc_dcs, wpc_dcs_state, init_jd, ROT0, "Bally", "Judge Dredd (L-7)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1993, jd_l1, jd_l7, wpc_dcs, wpc_dcs, wpc_dcs_state, init_jd, ROT0, "Bally", "Judge Dredd (L-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1993, jd_l6, jd_l7, wpc_dcs, wpc_dcs, wpc_dcs_state, init_jd, ROT0, "Bally", "Judge Dredd (L-6)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1993, jd_l5, jd_l7, wpc_dcs, wpc_dcs, wpc_dcs_state, init_jd, ROT0, "Bally", "Judge Dredd (L-5)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1993, jd_l4, jd_l7, wpc_dcs, wpc_dcs, wpc_dcs_state, init_jd, ROT0, "Bally", "Judge Dredd (L-4)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, pop_lx5, 0, wpc_dcs, wpc_dcs, wpc_dcs_state, init_pop, ROT0, "Bally", "Popeye Saves The Earth (LX-5)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, pop_la4, pop_lx5, wpc_dcs, wpc_dcs, wpc_dcs_state, init_pop, ROT0, "Bally", "Popeye Saves The Earth (LA-4)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, pop_pa3, pop_lx5, wpc_dcs, wpc_dcs, wpc_dcs_state, init_pop, ROT0, "Bally", "Popeye Saves The Earth (PA-3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, sttng_l7, 0, wpc_dcs, wpc_dcs, wpc_dcs_state, init_sttng, ROT0, "Williams", "Star Trek: The Next Generation (LX-7)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, sttng_l5, sttng_l7, wpc_dcs, wpc_dcs, wpc_dcs_state, init_sttng, ROT0, "Williams", "Star Trek: The Next Generation (LX-5)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, sttng_x7, sttng_l7, wpc_dcs, wpc_dcs, wpc_dcs_state, init_sttng, ROT0, "Williams", "Star Trek: The Next Generation (LX-7 Special)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1993, sttng_p8, sttng_l7, wpc_dcs, wpc_dcs, wpc_dcs_state, init_sttng, ROT0, "Williams", "Star Trek: The Next Generation (P-8)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1993, sttng_p5, sttng_l7, wpc_dcs, wpc_dcs, wpc_dcs_state, init_sttng, ROT0, "Williams", "Star Trek: The Next Generation (P-5)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1993, sttng_p4, sttng_l7, wpc_dcs, wpc_dcs, wpc_dcs_state, init_sttng, ROT0, "Williams", "Star Trek: The Next Generation (P-4)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, sttng_s7, sttng_l7, wpc_dcs, wpc_dcs, wpc_dcs_state, init_sttng, ROT0, "Williams", "Star Trek: The Next Generation (LX-7) SP1", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, sttng_g7, sttng_l7, wpc_dcs, wpc_dcs, wpc_dcs_state, init_sttng, ROT0, "Williams", "Star Trek: The Next Generation (LG-7)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1993, sttng_l1, sttng_l7, wpc_dcs, wpc_dcs, wpc_dcs_state, init_sttng, ROT0, "Williams", "Star Trek: The Next Generation (LX-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1993, sttng_l2, sttng_l7, wpc_dcs, wpc_dcs, wpc_dcs_state, init_sttng, ROT0, "Williams", "Star Trek: The Next Generation (LX-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, sttng_l3, sttng_l7, wpc_dcs, wpc_dcs, wpc_dcs_state, init_sttng, ROT0, "Williams", "Star Trek: The Next Generation (LX-3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1993, afv_l4, 0, wpc_dcs, wpc_dcs, wpc_dcs_state, init_afv, ROT0, "Williams", "Addams Family Values (Coin Dropper L-4)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/wpc_dot.cpp mame-0.243+dfsg.1/src/mame/drivers/wpc_dot.cpp --- mame-0.242+dfsg.1/src/mame/drivers/wpc_dot.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/wpc_dot.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -698,22 +698,22 @@ ROM_END -GAME(1991, tfdmd_l3, 0, wpc_dot, wpc_dot, wpc_dot_state, init_wpc_dot, ROT0, "Bally", "WPC Test Fixture: DMD (L-3)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1991, gi_l9, 0, wpc_dot, wpc_dot, wpc_dot_state, init_wpc_dot, ROT0, "Bally", "Gilligan's Island (L-9)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1991, gi_l3, gi_l9, wpc_dot, wpc_dot, wpc_dot_state, init_wpc_dot, ROT0, "Bally", "Gilligan's Island (L-3)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1991, gi_l4, gi_l9, wpc_dot, wpc_dot, wpc_dot_state, init_wpc_dot, ROT0, "Bally", "Gilligan's Island (L-4)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1991, gi_l6, gi_l9, wpc_dot, wpc_dot, wpc_dot_state, init_wpc_dot, ROT0, "Bally", "Gilligan's Island (L-6)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1991, gi_l8, gi_l9, wpc_dot, wpc_dot, wpc_dot_state, init_wpc_dot, ROT0, "Bally", "Gilligan's Island (L-8)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1992, hshot_p8, 0, wpc_dot, wpc_dot, wpc_dot_state, init_wpc_dot, ROT0, "Midway", "Hot Shot Basketball (P-8)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1991, hurr_l2, 0, wpc_dot, wpc_dot, wpc_dot_state, init_wpc_dot, ROT0, "Williams", "Hurricane (L-2)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1991, pz_f4, 0, wpc_dot, wpc_dot, wpc_dot_state, init_wpc_dot, ROT0, "Bally", "The Party Zone (F-4)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1991, pz_l1, pz_f4, wpc_dot, wpc_dot, wpc_dot_state, init_wpc_dot, ROT0, "Bally", "The Party Zone (L-1)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1991, pz_l2, pz_f4, wpc_dot, wpc_dot, wpc_dot_state, init_wpc_dot, ROT0, "Bally", "The Party Zone (L-2)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1991, pz_l3, pz_f4, wpc_dot, wpc_dot, wpc_dot_state, init_wpc_dot, ROT0, "Bally", "The Party Zone (L-3)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1991, sf_l1, 0, wpc_dot, wpc_dot, wpc_dot_state, init_wpc_dot, ROT0, "Williams", "Slugfest (L-1)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1991, t2_l8, 0, wpc_dot, wpc_dot, wpc_dot_state, init_wpc_dot, ROT0, "Williams", "Terminator 2: Judgment Day (L-8)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1991, t2_l6, t2_l8, wpc_dot, wpc_dot, wpc_dot_state, init_wpc_dot, ROT0, "Williams", "Terminator 2: Judgment Day (L-6)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1991, t2_p2f, t2_l8, wpc_dot, wpc_dot, wpc_dot_state, init_wpc_dot, ROT0, "Williams", "Terminator 2: Judgment Day (P-2F) Profanity", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1991, t2_l4, t2_l8, wpc_dot, wpc_dot, wpc_dot_state, init_wpc_dot, ROT0, "Williams", "Terminator 2: Judgment Day (L-4)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1991, t2_l3, t2_l8, wpc_dot, wpc_dot, wpc_dot_state, init_wpc_dot, ROT0, "Williams", "Terminator 2: Judgment Day (L-3)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1991, t2_l2, t2_l8, wpc_dot, wpc_dot, wpc_dot_state, init_wpc_dot, ROT0, "Williams", "Terminator 2: Judgment Day (L-2)", MACHINE_IS_SKELETON_MECHANICAL) +GAME(1991, tfdmd_l3, 0, wpc_dot, wpc_dot, wpc_dot_state, init_wpc_dot, ROT0, "Bally", "WPC Test Fixture: DMD (L-3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1991, gi_l9, 0, wpc_dot, wpc_dot, wpc_dot_state, init_wpc_dot, ROT0, "Bally", "Gilligan's Island (L-9)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1991, gi_l3, gi_l9, wpc_dot, wpc_dot, wpc_dot_state, init_wpc_dot, ROT0, "Bally", "Gilligan's Island (L-3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1991, gi_l4, gi_l9, wpc_dot, wpc_dot, wpc_dot_state, init_wpc_dot, ROT0, "Bally", "Gilligan's Island (L-4)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1991, gi_l6, gi_l9, wpc_dot, wpc_dot, wpc_dot_state, init_wpc_dot, ROT0, "Bally", "Gilligan's Island (L-6)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1991, gi_l8, gi_l9, wpc_dot, wpc_dot, wpc_dot_state, init_wpc_dot, ROT0, "Bally", "Gilligan's Island (L-8)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1992, hshot_p8, 0, wpc_dot, wpc_dot, wpc_dot_state, init_wpc_dot, ROT0, "Midway", "Hot Shot Basketball (P-8)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1991, hurr_l2, 0, wpc_dot, wpc_dot, wpc_dot_state, init_wpc_dot, ROT0, "Williams", "Hurricane (L-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1991, pz_f4, 0, wpc_dot, wpc_dot, wpc_dot_state, init_wpc_dot, ROT0, "Bally", "The Party Zone (F-4)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1991, pz_l1, pz_f4, wpc_dot, wpc_dot, wpc_dot_state, init_wpc_dot, ROT0, "Bally", "The Party Zone (L-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1991, pz_l2, pz_f4, wpc_dot, wpc_dot, wpc_dot_state, init_wpc_dot, ROT0, "Bally", "The Party Zone (L-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1991, pz_l3, pz_f4, wpc_dot, wpc_dot, wpc_dot_state, init_wpc_dot, ROT0, "Bally", "The Party Zone (L-3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1991, sf_l1, 0, wpc_dot, wpc_dot, wpc_dot_state, init_wpc_dot, ROT0, "Williams", "Slugfest (L-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1991, t2_l8, 0, wpc_dot, wpc_dot, wpc_dot_state, init_wpc_dot, ROT0, "Williams", "Terminator 2: Judgment Day (L-8)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1991, t2_l6, t2_l8, wpc_dot, wpc_dot, wpc_dot_state, init_wpc_dot, ROT0, "Williams", "Terminator 2: Judgment Day (L-6)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1991, t2_p2f, t2_l8, wpc_dot, wpc_dot, wpc_dot_state, init_wpc_dot, ROT0, "Williams", "Terminator 2: Judgment Day (P-2F) Profanity", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1991, t2_l4, t2_l8, wpc_dot, wpc_dot, wpc_dot_state, init_wpc_dot, ROT0, "Williams", "Terminator 2: Judgment Day (L-4)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1991, t2_l3, t2_l8, wpc_dot, wpc_dot, wpc_dot_state, init_wpc_dot, ROT0, "Williams", "Terminator 2: Judgment Day (L-3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1991, t2_l2, t2_l8, wpc_dot, wpc_dot, wpc_dot_state, init_wpc_dot, ROT0, "Williams", "Terminator 2: Judgment Day (L-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/wpc_flip1.cpp mame-0.243+dfsg.1/src/mame/drivers/wpc_flip1.cpp --- mame-0.242+dfsg.1/src/mame/drivers/wpc_flip1.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/wpc_flip1.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -285,12 +285,12 @@ /*-------------- / Game drivers /---------------*/ -GAME(1992, taf_l5, 0, wpc_flip1, wpc_flip1, wpc_flip1_state, init_wpc_flip1, ROT0, "Bally", "The Addams Family (L-5)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1992, taf_p2, taf_l5, wpc_flip1, wpc_flip1, wpc_flip1_state, init_wpc_flip1, ROT0, "Bally", "The Addams Family (Prototype) (P-2)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1992, taf_l1, taf_l5, wpc_flip1, wpc_flip1, wpc_flip1_state, init_wpc_flip1, ROT0, "Bally", "The Addams Family (L-1)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1992, taf_l2, taf_l5, wpc_flip1, wpc_flip1, wpc_flip1_state, init_wpc_flip1, ROT0, "Bally", "The Addams Family (L-2)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1992, taf_l3, taf_l5, wpc_flip1, wpc_flip1, wpc_flip1_state, init_wpc_flip1, ROT0, "Bally", "The Addams Family (L-3)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1992, taf_l4, taf_l5, wpc_flip1, wpc_flip1, wpc_flip1_state, init_wpc_flip1, ROT0, "Bally", "The Addams Family (L-4)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1992, taf_l7, taf_l5, wpc_flip1, wpc_flip1, wpc_flip1_state, init_wpc_flip1, ROT0, "Bally", "The Addams Family (Prototype L-5) (L-7)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1992, taf_l6, taf_l5, wpc_flip1, wpc_flip1, wpc_flip1_state, init_wpc_flip1, ROT0, "Bally", "The Addams Family (L-6)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1992, taf_h4, taf_l5, wpc_flip1, wpc_flip1, wpc_flip1_state, init_wpc_flip1, ROT0, "Bally", "The Addams Family (H-4)", MACHINE_IS_SKELETON_MECHANICAL) +GAME(1992, taf_l5, 0, wpc_flip1, wpc_flip1, wpc_flip1_state, init_wpc_flip1, ROT0, "Bally", "The Addams Family (L-5)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1992, taf_p2, taf_l5, wpc_flip1, wpc_flip1, wpc_flip1_state, init_wpc_flip1, ROT0, "Bally", "The Addams Family (Prototype) (P-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1992, taf_l1, taf_l5, wpc_flip1, wpc_flip1, wpc_flip1_state, init_wpc_flip1, ROT0, "Bally", "The Addams Family (L-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1992, taf_l2, taf_l5, wpc_flip1, wpc_flip1, wpc_flip1_state, init_wpc_flip1, ROT0, "Bally", "The Addams Family (L-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1992, taf_l3, taf_l5, wpc_flip1, wpc_flip1, wpc_flip1_state, init_wpc_flip1, ROT0, "Bally", "The Addams Family (L-3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1992, taf_l4, taf_l5, wpc_flip1, wpc_flip1, wpc_flip1_state, init_wpc_flip1, ROT0, "Bally", "The Addams Family (L-4)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1992, taf_l7, taf_l5, wpc_flip1, wpc_flip1, wpc_flip1_state, init_wpc_flip1, ROT0, "Bally", "The Addams Family (Prototype L-5) (L-7)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1992, taf_l6, taf_l5, wpc_flip1, wpc_flip1, wpc_flip1_state, init_wpc_flip1, ROT0, "Bally", "The Addams Family (L-6)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1992, taf_h4, taf_l5, wpc_flip1, wpc_flip1, wpc_flip1_state, init_wpc_flip1, ROT0, "Bally", "The Addams Family (H-4)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/wpc_flip2.cpp mame-0.243+dfsg.1/src/mame/drivers/wpc_flip2.cpp --- mame-0.242+dfsg.1/src/mame/drivers/wpc_flip2.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/wpc_flip2.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -927,56 +927,56 @@ ROM_END -GAME(1993, br_l4, 0, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "Black Rose (L-4)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1992, br_p17, br_l4, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "Black Rose (SP-1)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1992, br_l1, br_l4, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "Black Rose (L-1)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1993, br_l3, br_l4, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "Black Rose (L-3)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1993, drac_l1, 0, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Williams", "Bram Stoker's Dracula (L-1)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1993, drac_p11, drac_l1, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Williams", "Bram Stoker's Dracula (P-11)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1993, cftbl_l4, 0, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "Creature from the Black Lagoon (L-4)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1993, cftbl_l3, cftbl_l4, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "Creature from the Black Lagoon (L-3,SP-1)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1993, cftbl_l2, cftbl_l4, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "Creature from the Black Lagoon (L-2)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1992, dw_l2, 0, wpc_flip2, wpc_dw, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "Doctor Who (L-2)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1992, dw_l1, dw_l2, wpc_flip2, wpc_dw, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "Doctor Who (L-1)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1992, dw_p5, dw_l2, wpc_flip2, wpc_dw, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "Doctor Who (P-5)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1992, ft_l5, 0, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Williams", "Fish Tales (L-5)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1992, ft_l3, ft_l5, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Williams", "Fish Tales (L-3)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1992, ft_l4, ft_l5, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Williams", "Fish Tales (L-4)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1992, ft_p4, ft_l5, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Williams", "Fish Tales (P-4)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1992, ft_p2, ft_l5, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Williams", "Fish Tales (P-2)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1994, tafg_lx3, 0, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "The Addams Family Special Collectors Edition Gold (LX-3)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1994, tafg_h3, tafg_lx3, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "The Addams Family Special Collectors Edition (H-3)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1994, tafg_la2, tafg_lx3, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "The Addams Family Special Collectors Edition (LA-2)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1994, tafg_la3, tafg_lx3, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "The Addams Family Special Collectors Edition (LA-3)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1992, gw_l5, 0, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Williams", "The Getaway: High Speed II (L-5)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1992, gw_pb, gw_l5, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Williams", "The Getaway: High Speed II (P-B)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1992, gw_pc, gw_l5, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Williams", "The Getaway: High Speed II (P-C)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1992, gw_l1, gw_l5, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Williams", "The Getaway: High Speed II (L-1)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1992, gw_l2, gw_l5, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Williams", "The Getaway: High Speed II (L-2)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1992, gw_l3, gw_l5, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Williams", "The Getaway: High Speed II (L-3)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1992, gw_p7, gw_l5, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Williams", "The Getaway: High Speed II (P-7)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1998, tz_92, 0, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "Twilight Zone (9.2)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1998, tz_94h, tz_92, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "Twilight Zone (9.4H)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1998, tz_94ch, tz_92, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "Twilight Zone (9.4CH)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1993, tz_pa1, tz_92, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "Twilight Zone (PA-1)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1993, tz_p3, tz_92, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "Twilight Zone (P-3)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1993, tz_p4, tz_92, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "Twilight Zone (P-4)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1993, tz_l1, tz_92, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "Twilight Zone (L-1)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1993, tz_l2, tz_92, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "Twilight Zone (L-2)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1993, tz_ifpa, tz_92, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "Twilight Zone (IFPA rules)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1993, tz_l3, tz_92, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "Twilight Zone (L-3)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1993, tz_l4, tz_92, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "Twilight Zone (L-4)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1993, tz_l5, tz_92, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "Twilight Zone (L-5)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1994, tz_h7, tz_92, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "Twilight Zone (H-7)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1994, tz_h8, tz_92, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "Twilight Zone (H-8)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2000, ww_l5, 0, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Williams", "White Water (L-5)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2000, ww_lh6, ww_l5, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Williams", "White Water (LH-6)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(2000, ww_lh5, ww_l5, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Williams", "White Water (LH-5)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1993, ww_l4, ww_l5, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Williams", "White Water (L-4)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1993, ww_l3, ww_l5, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Williams", "White Water (L-3)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1992, ww_l2, ww_l5, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Williams", "White Water (L-2)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1992, ww_p8, ww_l5, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Williams", "White Water (P-8 P-2 sound)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1992, ww_p1, ww_l5, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Williams", "White Water (P-8 P-1 sound)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1992, strik_l4, 0, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Williams", "Strike Master (L-4) (Shuffle)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1996, lc_11, 0, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "League Champ (1.1) (Shuffle)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(20??, rush, 0, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Dave Astill", "Rush (1.0)", MACHINE_IS_SKELETON_MECHANICAL) +GAME(1993, br_l4, 0, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "Black Rose (L-4)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1992, br_p17, br_l4, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "Black Rose (SP-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1992, br_l1, br_l4, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "Black Rose (L-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1993, br_l3, br_l4, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "Black Rose (L-3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1993, drac_l1, 0, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Williams", "Bram Stoker's Dracula (L-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1993, drac_p11, drac_l1, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Williams", "Bram Stoker's Dracula (P-11)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1993, cftbl_l4, 0, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "Creature from the Black Lagoon (L-4)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1993, cftbl_l3, cftbl_l4, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "Creature from the Black Lagoon (L-3,SP-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1993, cftbl_l2, cftbl_l4, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "Creature from the Black Lagoon (L-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1992, dw_l2, 0, wpc_flip2, wpc_dw, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "Doctor Who (L-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1992, dw_l1, dw_l2, wpc_flip2, wpc_dw, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "Doctor Who (L-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1992, dw_p5, dw_l2, wpc_flip2, wpc_dw, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "Doctor Who (P-5)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1992, ft_l5, 0, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Williams", "Fish Tales (L-5)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1992, ft_l3, ft_l5, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Williams", "Fish Tales (L-3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1992, ft_l4, ft_l5, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Williams", "Fish Tales (L-4)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1992, ft_p4, ft_l5, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Williams", "Fish Tales (P-4)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1992, ft_p2, ft_l5, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Williams", "Fish Tales (P-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, tafg_lx3, 0, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "The Addams Family Special Collectors Edition Gold (LX-3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, tafg_h3, tafg_lx3, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "The Addams Family Special Collectors Edition (H-3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, tafg_la2, tafg_lx3, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "The Addams Family Special Collectors Edition (LA-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, tafg_la3, tafg_lx3, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "The Addams Family Special Collectors Edition (LA-3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1992, gw_l5, 0, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Williams", "The Getaway: High Speed II (L-5)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1992, gw_pb, gw_l5, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Williams", "The Getaway: High Speed II (P-B)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1992, gw_pc, gw_l5, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Williams", "The Getaway: High Speed II (P-C)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1992, gw_l1, gw_l5, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Williams", "The Getaway: High Speed II (L-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1992, gw_l2, gw_l5, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Williams", "The Getaway: High Speed II (L-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1992, gw_l3, gw_l5, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Williams", "The Getaway: High Speed II (L-3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1992, gw_p7, gw_l5, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Williams", "The Getaway: High Speed II (P-7)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1998, tz_92, 0, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "Twilight Zone (9.2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1998, tz_94h, tz_92, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "Twilight Zone (9.4H)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1998, tz_94ch, tz_92, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "Twilight Zone (9.4CH)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1993, tz_pa1, tz_92, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "Twilight Zone (PA-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1993, tz_p3, tz_92, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "Twilight Zone (P-3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1993, tz_p4, tz_92, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "Twilight Zone (P-4)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1993, tz_l1, tz_92, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "Twilight Zone (L-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1993, tz_l2, tz_92, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "Twilight Zone (L-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1993, tz_ifpa, tz_92, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "Twilight Zone (IFPA rules)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1993, tz_l3, tz_92, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "Twilight Zone (L-3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1993, tz_l4, tz_92, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "Twilight Zone (L-4)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1993, tz_l5, tz_92, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "Twilight Zone (L-5)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, tz_h7, tz_92, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "Twilight Zone (H-7)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, tz_h8, tz_92, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "Twilight Zone (H-8)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2000, ww_l5, 0, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Williams", "White Water (L-5)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2000, ww_lh6, ww_l5, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Williams", "White Water (LH-6)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2000, ww_lh5, ww_l5, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Williams", "White Water (LH-5)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1993, ww_l4, ww_l5, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Williams", "White Water (L-4)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1993, ww_l3, ww_l5, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Williams", "White Water (L-3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1992, ww_l2, ww_l5, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Williams", "White Water (L-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1992, ww_p8, ww_l5, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Williams", "White Water (P-8 P-2 sound)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1992, ww_p1, ww_l5, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Williams", "White Water (P-8 P-1 sound)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1992, strik_l4, 0, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Williams", "Strike Master (L-4) (Shuffle)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1996, lc_11, 0, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Bally", "League Champ (1.1) (Shuffle)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(20??, rush, 0, wpc_flip2, wpc_flip2, wpc_flip2_state, init_wpc_flip2, ROT0, "Dave Astill", "Rush (1.0)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/wpc_s.cpp mame-0.243+dfsg.1/src/mame/drivers/wpc_s.cpp --- mame-0.242+dfsg.1/src/mame/drivers/wpc_s.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/wpc_s.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -2887,67 +2887,67 @@ } // Anonymous namespace -GAME(1994, corv_21, 0, wpc_s, corv, wpc_s_state, init_corv, ROT0, "Bally", "Corvette (2.1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1994, corv_px4, corv_21, wpc_s, corv, wpc_s_state, init_corv, ROT0, "Bally", "Corvette (PX4 Prototype)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1994, corv_px3, corv_21, wpc_s, corv, wpc_s_state, init_corv, ROT0, "Bally", "Corvette (PX3 Prototype)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1994, corv_lx1, corv_21, wpc_s, corv, wpc_s_state, init_corv, ROT0, "Bally", "Corvette (LX1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1994, corv_lx2, corv_21, wpc_s, corv, wpc_s_state, init_corv, ROT0, "Bally", "Corvette (LX2)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1994, corv_la1, corv_21, wpc_s, corv, wpc_s_state, init_corv, ROT0, "Bally", "Corvette (LA1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1995, dh_lx2, 0, wpc_s, dh, wpc_s_state, init_dh, ROT0, "Williams", "Dirty Harry (LX-2)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1995, dh_lf2, dh_lx2, wpc_s, dh, wpc_s_state, init_dh, ROT0, "Williams", "Dirty Harry (LF-2)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1995, i500_11r, 0, wpc_s, i500, wpc_s_state, init_i500, ROT0, "Bally", "Indianapolis 500 (1.1R)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1995, i500_10r, i500_11r, wpc_s, i500, wpc_s_state, init_i500, ROT0, "Bally", "Indianapolis 500 (1.0R)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1995, i500_11b, i500_11r, wpc_s, i500, wpc_s_state, init_i500, ROT0, "Bally", "Indianapolis 500 (1.1 Belgium)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1995, jb_10r, 0, wpc_s, jb, wpc_s_state, init_jb, ROT0, "Williams", "Jack*Bot (1.0R)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1995, jb_10b, jb_10r, wpc_s, jb, wpc_s_state, init_jb, ROT0, "Williams", "Jack*Bot (1.0B) (Belgium/Canada)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1995, jb_04a, jb_10r, wpc_s, jb, wpc_s_state, init_jb, ROT0, "Williams", "Jack*Bot (0.4A prototype)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1995, jm_12r, 0, wpc_s, jm, wpc_s_state, init_jm, ROT0, "Williams", "Johnny Mnemonic (1.2R)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1995, jm_12b, jm_12r, wpc_s, jm, wpc_s_state, init_jm, ROT0, "Williams", "Johnny Mnemonic (1.2B) Belgium", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1995, jm_05r, jm_12r, wpc_s, jm, wpc_s_state, init_jm, ROT0, "Williams", "Johnny Mnemonic (0.5R)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1995, nf_23x, 0, wpc_s, nf, wpc_s_state, init_nf, ROT0, "Williams", "No Fear: Dangerous Sports (2.3X)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1995, nf_23, nf_23x, wpc_s, nf, wpc_s_state, init_nf, ROT0, "Williams", "No Fear: Dangerous Sports (2.3)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1995, nf_23f, nf_23x, wpc_s, nf, wpc_s_state, init_nf, ROT0, "Williams", "No Fear: Dangerous Sports (2.3F)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1995, nf_22, nf_23x, wpc_s, nf, wpc_s_state, init_nf, ROT0, "Williams", "No Fear: Dangerous Sports (2.2)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1995, nf_20, nf_23x, wpc_s, nf, wpc_s_state, init_nf, ROT0, "Williams", "No Fear: Dangerous Sports (2.0)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1995, nf_10, nf_23x, wpc_s, nf, wpc_s_state, init_nf, ROT0, "Williams", "No Fear: Dangerous Sports (1.0)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1995, nf_08x, nf_23x, wpc_s, nf, wpc_s_state, init_nf, ROT0, "Williams", "No Fear: Dangerous Sports (0.8X)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1994, rs_l6, 0, wpc_s, rs, wpc_s_state, init_rs, ROT0, "Williams", "Red and Ted's Road Show (L-6)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1994, rs_la5, rs_l6, wpc_s, rs, wpc_s_state, init_rs, ROT0, "Williams", "Red and Ted's Road Show (La-5)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1994, rs_lx5, rs_l6, wpc_s, rs, wpc_s_state, init_rs, ROT0, "Williams", "Red and Ted's Road Show (Lx-5)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1994, rs_la4, rs_l6, wpc_s, rs, wpc_s_state, init_rs, ROT0, "Williams", "Red and Ted's Road Show (La-4)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1994, rs_lx4, rs_l6, wpc_s, rs, wpc_s_state, init_rs, ROT0, "Williams", "Red and Ted's Road Show (Lx-4)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1994, rs_lx3, rs_l6, wpc_s, rs, wpc_s_state, init_rs, ROT0, "Williams", "Red and Ted's Road Show (Lx-3)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1994, rs_lx2, rs_l6, wpc_s, rs, wpc_s_state, init_rs, ROT0, "Williams", "Red and Ted's Road Show (Lx-2)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1994, fs_lx5, 0, wpc_s, fs, wpc_s_state, init_fs, ROT0, "Williams", "The Flintstones (LX-5)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1994, fs_lx2, fs_lx5, wpc_s, fs, wpc_s_state, init_fs, ROT0, "Williams", "The Flintstones (LX-2)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1994, fs_sp2, fs_lx5, wpc_s, fs, wpc_s_state, init_fs, ROT0, "Williams", "The Flintstones (SP-2)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1994, fs_lx3, fs_lx5, wpc_s, fs, wpc_s_state, init_fs, ROT0, "Williams", "The Flintstones (LX-3)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1994, fs_lx4, fs_lx5, wpc_s, fs, wpc_s_state, init_fs, ROT0, "Williams", "The Flintstones (LX-4)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1994, fs_la5, fs_lx5, wpc_s, fs, wpc_s_state, init_fs, ROT0, "Williams", "The Flintstones (LA-5)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1995, ts_lx5, 0, wpc_s, ts, wpc_s_state, init_ts, ROT0, "Bally", "The Shadow (LX-5)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1995, ts_lh6, ts_lx5, wpc_s, ts, wpc_s_state, init_ts, ROT0, "Bally", "The Shadow (LH-6)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1995, ts_lx4, ts_lx5, wpc_s, ts, wpc_s_state, init_ts, ROT0, "Bally", "The Shadow (LX-4)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1995, ts_la4, ts_lx5, wpc_s, ts, wpc_s_state, init_ts, ROT0, "Bally", "The Shadow (LA-4)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1994, ts_la2, ts_lx5, wpc_s, ts, wpc_s_state, init_ts, ROT0, "Bally", "The Shadow (LA-2)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1994, ts_pa1, ts_lx5, wpc_s, ts, wpc_s_state, init_ts, ROT0, "Bally", "The Shadow (PA-1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1994, ts_lf6, ts_lx5, wpc_s, ts, wpc_s_state, init_ts, ROT0, "Bally", "The Shadow (LF-6) French", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1994, ts_lm6, ts_lx5, wpc_s, ts, wpc_s_state, init_ts, ROT0, "Bally", "The Shadow (LM-6) Mild", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1995, tom_13, 0, wpc_s, tom, wpc_s_state, init_tom, ROT0, "Bally", "Theatre Of Magic (1.3X)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(2005, tom_14h, tom_13, wpc_s, tom, wpc_s_state, init_tom14, ROT0, "Bally", "Theatre Of Magic (1.4H)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1995, tom_12, tom_13, wpc_s, tom, wpc_s_state, init_tom, ROT0, "Bally", "Theatre Of Magic (1.2X)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1995, tom_12a, tom_13, wpc_s, tom, wpc_s_state, init_tom, ROT0, "Bally", "Theatre Of Magic (1.2A)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1995, tom_10f, tom_13, wpc_s, tom, wpc_s_state, init_tom, ROT0, "Bally", "Theatre Of Magic (1.0 French)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1995, tom_06, tom_13, wpc_s, tom, wpc_s_state, init_tom, ROT0, "Bally", "Theatre Of Magic (0.6a)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1995, wd_12, 0, wpc_s, wd, wpc_s_state, init_wd, ROT0, "Bally", "Who Dunnit (1.2)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1995, wd_12g, wd_12, wpc_s, wd, wpc_s_state, init_wd, ROT0, "Bally", "Who Dunnit (1.2 Germany)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1995, wd_11, wd_12, wpc_s, wd, wpc_s_state, init_wd, ROT0, "Bally", "Who Dunnit (1.1)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1995, wd_10r, wd_12, wpc_s, wd, wpc_s_state, init_wd, ROT0, "Bally", "Who Dunnit (1.0 R)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1995, wd_10g, wd_12, wpc_s, wd, wpc_s_state, init_wd, ROT0, "Bally", "Who Dunnit (1.0 Germany)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1995, wd_10f, wd_12, wpc_s, wd, wpc_s_state, init_wd, ROT0, "Bally", "Who Dunnit (1.0 French)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1995, wd_03r, wd_12, wpc_s, wd, wpc_s_state, init_wd, ROT0, "Bally", "Who Dunnit (0.3 R)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1995, wd_048r, wd_12, wpc_s, wd, wpc_s_state, init_wd, ROT0, "Bally", "Who Dunnit (0.48 R)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1994, wcs_l2, 0, wpc_s, wcs, wpc_s_state, init_wcs, ROT0, "Bally", "World Cup Soccer (Lx-2)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1994, wcs_la2, wcs_l2, wpc_s, wcs, wpc_s_state, init_wcs, ROT0, "Bally", "World Cup Soccer (La-2)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1994, wcs_p2, wcs_l2, wpc_s, wcs, wpc_s_state, init_wcs, ROT0, "Bally", "World Cup Soccer (Pa-2)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1994, wcs_p3, wcs_l2, wpc_s, wcs, wpc_s_state, init_wcs, ROT0, "Bally", "World Cup Soccer (Px-3)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME(1994, tfs_12, 0, wpc_s, tfs, wpc_s_state, init_tfs, ROT0, "Bally", "WPC Test Fixture: Security (1.2)", MACHINE_IS_SKELETON_MECHANICAL ) +GAME(1994, corv_21, 0, wpc_s, corv, wpc_s_state, init_corv, ROT0, "Bally", "Corvette (2.1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, corv_px4, corv_21, wpc_s, corv, wpc_s_state, init_corv, ROT0, "Bally", "Corvette (PX4 Prototype)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, corv_px3, corv_21, wpc_s, corv, wpc_s_state, init_corv, ROT0, "Bally", "Corvette (PX3 Prototype)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, corv_lx1, corv_21, wpc_s, corv, wpc_s_state, init_corv, ROT0, "Bally", "Corvette (LX1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, corv_lx2, corv_21, wpc_s, corv, wpc_s_state, init_corv, ROT0, "Bally", "Corvette (LX2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, corv_la1, corv_21, wpc_s, corv, wpc_s_state, init_corv, ROT0, "Bally", "Corvette (LA1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, dh_lx2, 0, wpc_s, dh, wpc_s_state, init_dh, ROT0, "Williams", "Dirty Harry (LX-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, dh_lf2, dh_lx2, wpc_s, dh, wpc_s_state, init_dh, ROT0, "Williams", "Dirty Harry (LF-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, i500_11r, 0, wpc_s, i500, wpc_s_state, init_i500, ROT0, "Bally", "Indianapolis 500 (1.1R)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, i500_10r, i500_11r, wpc_s, i500, wpc_s_state, init_i500, ROT0, "Bally", "Indianapolis 500 (1.0R)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, i500_11b, i500_11r, wpc_s, i500, wpc_s_state, init_i500, ROT0, "Bally", "Indianapolis 500 (1.1 Belgium)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, jb_10r, 0, wpc_s, jb, wpc_s_state, init_jb, ROT0, "Williams", "Jack*Bot (1.0R)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, jb_10b, jb_10r, wpc_s, jb, wpc_s_state, init_jb, ROT0, "Williams", "Jack*Bot (1.0B) (Belgium/Canada)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, jb_04a, jb_10r, wpc_s, jb, wpc_s_state, init_jb, ROT0, "Williams", "Jack*Bot (0.4A prototype)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, jm_12r, 0, wpc_s, jm, wpc_s_state, init_jm, ROT0, "Williams", "Johnny Mnemonic (1.2R)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, jm_12b, jm_12r, wpc_s, jm, wpc_s_state, init_jm, ROT0, "Williams", "Johnny Mnemonic (1.2B) Belgium", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, jm_05r, jm_12r, wpc_s, jm, wpc_s_state, init_jm, ROT0, "Williams", "Johnny Mnemonic (0.5R)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, nf_23x, 0, wpc_s, nf, wpc_s_state, init_nf, ROT0, "Williams", "No Fear: Dangerous Sports (2.3X)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, nf_23, nf_23x, wpc_s, nf, wpc_s_state, init_nf, ROT0, "Williams", "No Fear: Dangerous Sports (2.3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, nf_23f, nf_23x, wpc_s, nf, wpc_s_state, init_nf, ROT0, "Williams", "No Fear: Dangerous Sports (2.3F)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, nf_22, nf_23x, wpc_s, nf, wpc_s_state, init_nf, ROT0, "Williams", "No Fear: Dangerous Sports (2.2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, nf_20, nf_23x, wpc_s, nf, wpc_s_state, init_nf, ROT0, "Williams", "No Fear: Dangerous Sports (2.0)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, nf_10, nf_23x, wpc_s, nf, wpc_s_state, init_nf, ROT0, "Williams", "No Fear: Dangerous Sports (1.0)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, nf_08x, nf_23x, wpc_s, nf, wpc_s_state, init_nf, ROT0, "Williams", "No Fear: Dangerous Sports (0.8X)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, rs_l6, 0, wpc_s, rs, wpc_s_state, init_rs, ROT0, "Williams", "Red and Ted's Road Show (L-6)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, rs_la5, rs_l6, wpc_s, rs, wpc_s_state, init_rs, ROT0, "Williams", "Red and Ted's Road Show (La-5)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, rs_lx5, rs_l6, wpc_s, rs, wpc_s_state, init_rs, ROT0, "Williams", "Red and Ted's Road Show (Lx-5)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, rs_la4, rs_l6, wpc_s, rs, wpc_s_state, init_rs, ROT0, "Williams", "Red and Ted's Road Show (La-4)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, rs_lx4, rs_l6, wpc_s, rs, wpc_s_state, init_rs, ROT0, "Williams", "Red and Ted's Road Show (Lx-4)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, rs_lx3, rs_l6, wpc_s, rs, wpc_s_state, init_rs, ROT0, "Williams", "Red and Ted's Road Show (Lx-3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, rs_lx2, rs_l6, wpc_s, rs, wpc_s_state, init_rs, ROT0, "Williams", "Red and Ted's Road Show (Lx-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, fs_lx5, 0, wpc_s, fs, wpc_s_state, init_fs, ROT0, "Williams", "The Flintstones (LX-5)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, fs_lx2, fs_lx5, wpc_s, fs, wpc_s_state, init_fs, ROT0, "Williams", "The Flintstones (LX-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, fs_sp2, fs_lx5, wpc_s, fs, wpc_s_state, init_fs, ROT0, "Williams", "The Flintstones (SP-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, fs_lx3, fs_lx5, wpc_s, fs, wpc_s_state, init_fs, ROT0, "Williams", "The Flintstones (LX-3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, fs_lx4, fs_lx5, wpc_s, fs, wpc_s_state, init_fs, ROT0, "Williams", "The Flintstones (LX-4)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, fs_la5, fs_lx5, wpc_s, fs, wpc_s_state, init_fs, ROT0, "Williams", "The Flintstones (LA-5)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, ts_lx5, 0, wpc_s, ts, wpc_s_state, init_ts, ROT0, "Bally", "The Shadow (LX-5)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, ts_lh6, ts_lx5, wpc_s, ts, wpc_s_state, init_ts, ROT0, "Bally", "The Shadow (LH-6)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, ts_lx4, ts_lx5, wpc_s, ts, wpc_s_state, init_ts, ROT0, "Bally", "The Shadow (LX-4)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, ts_la4, ts_lx5, wpc_s, ts, wpc_s_state, init_ts, ROT0, "Bally", "The Shadow (LA-4)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, ts_la2, ts_lx5, wpc_s, ts, wpc_s_state, init_ts, ROT0, "Bally", "The Shadow (LA-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, ts_pa1, ts_lx5, wpc_s, ts, wpc_s_state, init_ts, ROT0, "Bally", "The Shadow (PA-1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, ts_lf6, ts_lx5, wpc_s, ts, wpc_s_state, init_ts, ROT0, "Bally", "The Shadow (LF-6) French", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, ts_lm6, ts_lx5, wpc_s, ts, wpc_s_state, init_ts, ROT0, "Bally", "The Shadow (LM-6) Mild", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, tom_13, 0, wpc_s, tom, wpc_s_state, init_tom, ROT0, "Bally", "Theatre Of Magic (1.3X)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(2005, tom_14h, tom_13, wpc_s, tom, wpc_s_state, init_tom14, ROT0, "Bally", "Theatre Of Magic (1.4H)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, tom_12, tom_13, wpc_s, tom, wpc_s_state, init_tom, ROT0, "Bally", "Theatre Of Magic (1.2X)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, tom_12a, tom_13, wpc_s, tom, wpc_s_state, init_tom, ROT0, "Bally", "Theatre Of Magic (1.2A)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, tom_10f, tom_13, wpc_s, tom, wpc_s_state, init_tom, ROT0, "Bally", "Theatre Of Magic (1.0 French)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, tom_06, tom_13, wpc_s, tom, wpc_s_state, init_tom, ROT0, "Bally", "Theatre Of Magic (0.6a)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, wd_12, 0, wpc_s, wd, wpc_s_state, init_wd, ROT0, "Bally", "Who Dunnit (1.2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, wd_12g, wd_12, wpc_s, wd, wpc_s_state, init_wd, ROT0, "Bally", "Who Dunnit (1.2 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, wd_11, wd_12, wpc_s, wd, wpc_s_state, init_wd, ROT0, "Bally", "Who Dunnit (1.1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, wd_10r, wd_12, wpc_s, wd, wpc_s_state, init_wd, ROT0, "Bally", "Who Dunnit (1.0 R)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, wd_10g, wd_12, wpc_s, wd, wpc_s_state, init_wd, ROT0, "Bally", "Who Dunnit (1.0 Germany)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, wd_10f, wd_12, wpc_s, wd, wpc_s_state, init_wd, ROT0, "Bally", "Who Dunnit (1.0 French)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, wd_03r, wd_12, wpc_s, wd, wpc_s_state, init_wd, ROT0, "Bally", "Who Dunnit (0.3 R)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1995, wd_048r, wd_12, wpc_s, wd, wpc_s_state, init_wd, ROT0, "Bally", "Who Dunnit (0.48 R)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, wcs_l2, 0, wpc_s, wcs, wpc_s_state, init_wcs, ROT0, "Bally", "World Cup Soccer (Lx-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, wcs_la2, wcs_l2, wpc_s, wcs, wpc_s_state, init_wcs, ROT0, "Bally", "World Cup Soccer (La-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, wcs_p2, wcs_l2, wpc_s, wcs, wpc_s_state, init_wcs, ROT0, "Bally", "World Cup Soccer (Pa-2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, wcs_p3, wcs_l2, wpc_s, wcs, wpc_s_state, init_wcs, ROT0, "Bally", "World Cup Soccer (Px-3)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1994, tfs_12, 0, wpc_s, tfs, wpc_s_state, init_tfs, ROT0, "Bally", "WPC Test Fixture: Security (1.2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/xavix.cpp mame-0.243+dfsg.1/src/mame/drivers/xavix.cpp --- mame-0.242+dfsg.1/src/mame/drivers/xavix.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/xavix.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1234,17 +1234,6 @@ /* correct, 4bpp gfxs */ -static const gfx_layout charlayout = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { STEP4(0,1) }, - { 1*4,0*4,3*4,2*4,5*4,4*4,7*4,6*4 }, - { STEP8(0,4*8) }, - 8*8*4 -}; - static const gfx_layout char16layout = { 16,16, @@ -1279,7 +1268,7 @@ }; static GFXDECODE_START( gfx_xavix ) - GFXDECODE_ENTRY( "bios", 0, charlayout, 0, 16 ) + GFXDECODE_ENTRY( "bios", 0, gfx_8x8x4_packed_lsb, 0, 16 ) GFXDECODE_ENTRY( "bios", 0, char16layout, 0, 16 ) GFXDECODE_ENTRY( "bios", 0, charlayout8bpp, 0, 1 ) GFXDECODE_ENTRY( "bios", 0, char16layout8bpp, 0, 1 ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/ymmu100.cpp mame-0.243+dfsg.1/src/mame/drivers/ymmu100.cpp --- mame-0.242+dfsg.1/src/mame/drivers/ymmu100.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/ymmu100.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -779,6 +779,6 @@ ROM_LOAD32_WORD( "xt463a0.ic38", 0x1000002, 0x400000, CRC(cce5f8d3) SHA1(bdca8c5158f452f2b5535c7d658c9b22c6d66048) ) ROM_END -CONS( 1997, mu100, 0, 0, mu100, mu100, mu100_state, empty_init, "Yamaha", "MU100", MACHINE_NOT_WORKING ) -CONS( 1997, mu100r, mu100, 0, mu100, mu100, mu100r_state, empty_init, "Yamaha", "MU100 Rackable version", MACHINE_NOT_WORKING ) -CONS( 1998, mu100b, mu100, 0, mu100, mu100, mu100_state, empty_init, "Yamaha", "MU100B", MACHINE_NOT_WORKING ) +SYST( 1997, mu100, 0, 0, mu100, mu100, mu100_state, empty_init, "Yamaha", "MU100", MACHINE_NOT_WORKING ) +SYST( 1997, mu100r, mu100, 0, mu100, mu100, mu100r_state, empty_init, "Yamaha", "MU100 Rackable version", MACHINE_NOT_WORKING ) +SYST( 1998, mu100b, mu100, 0, mu100, mu100, mu100_state, empty_init, "Yamaha", "MU100B", MACHINE_NOT_WORKING ) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/ympsr60.cpp mame-0.243+dfsg.1/src/mame/drivers/ympsr60.cpp --- mame-0.242+dfsg.1/src/mame/drivers/ympsr60.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/ympsr60.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -68,6 +68,8 @@ #include "psr60.lh" #include "psr70.lh" +namespace { + class psr60_state : public driver_device { static constexpr int DRVIF_MAX_TARGETS = 23; @@ -305,7 +307,7 @@ void psr60_state::recalc_irqs() { - int irq_state = m_acia_irq | m_ym_irq | m_drvif_irq | m_ym2154_irq; + int const irq_state = m_acia_irq | m_ym_irq | m_drvif_irq | m_ym2154_irq; m_maincpu->set_input_line(0, irq_state); } @@ -314,7 +316,10 @@ m_drvif_out.resolve(); m_rom2bank->configure_entries(0, 2, memregion("rom2")->base(), 0x4000); m_rom2bank->set_entry(0); - m_acia_irq = CLEAR_LINE; + m_acia_irq = 0; + m_ym_irq = 0; + m_drvif_irq = 0; + m_ym2154_irq = 0; } void psr60_state::machine_reset() @@ -731,5 +736,7 @@ ROM_LOAD("ym21909.bin", 0x0000, 0x8000, CRC(a555b42a) SHA1(f96cdea88ffc0af4cf6009529398a0181a91a70c)) ROM_END +} // namespace + CONS(1985, psr60, 0, 0, psr60, psr60, psr60_state, empty_init, "Yamaha", "PSR-60 PortaSound", MACHINE_IMPERFECT_SOUND | MACHINE_CLICKABLE_ARTWORK) CONS(1985, psr70, psr60, 0, psr70, psr70, psr60_state, empty_init, "Yamaha", "PSR-70 PortaSound", MACHINE_IMPERFECT_SOUND | MACHINE_CLICKABLE_ARTWORK) diff -Nru mame-0.242+dfsg.1/src/mame/drivers/zexall.cpp mame-0.243+dfsg.1/src/mame/drivers/zexall.cpp --- mame-0.242+dfsg.1/src/mame/drivers/zexall.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/zexall.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Jonathan Gevaryahu, Robbbert +// copyright-holders:Jonathan Gevaryahu /****************************************************************************** Self Contained zexall 'Z80 instruction exerciser' test driver diff -Nru mame-0.242+dfsg.1/src/mame/drivers/zpinball.cpp mame-0.243+dfsg.1/src/mame/drivers/zpinball.cpp --- mame-0.242+dfsg.1/src/mame/drivers/zpinball.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/drivers/zpinball.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1,8 +1,15 @@ // license:BSD-3-Clause // copyright-holders:AJR /**************************************************************************** +PINBALL +Skeleton driver for EFO "Z-Pinball" hardware. - Skeleton driver for EFO "Z-Pinball" hardware. +ToDo: +- Inputs +- Outputs +- Screen +- Sound +- Mechanical sounds ****************************************************************************/ diff -Nru mame-0.242+dfsg.1/src/mame/includes/1942.h mame-0.243+dfsg.1/src/mame/includes/1942.h --- mame-0.242+dfsg.1/src/mame/includes/1942.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/1942.h 2022-04-29 05:37:26.000000000 +0000 @@ -72,8 +72,8 @@ required_device m_soundlatch; /* video-related */ - tilemap_t *m_fg_tilemap = 0; - tilemap_t *m_bg_tilemap = 0; + tilemap_t *m_fg_tilemap = nullptr; + tilemap_t *m_bg_tilemap = nullptr; int m_palette_bank = 0; uint8_t m_scroll[2]{}; void create_palette(palette_device &palette) const; diff -Nru mame-0.242+dfsg.1/src/mame/includes/1943.h mame-0.243+dfsg.1/src/mame/includes/1943.h --- mame-0.242+dfsg.1/src/mame/includes/1943.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/1943.h 2022-04-29 05:37:26.000000000 +0000 @@ -59,22 +59,22 @@ required_memory_bank m_mainbank; /* video-related */ - tilemap_t *m_fg_tilemap; - tilemap_t *m_bg_tilemap; - tilemap_t *m_bg2_tilemap; - int m_char_on; - int m_obj_on; - int m_bg1_on; - int m_bg2_on; + tilemap_t *m_fg_tilemap = nullptr; + tilemap_t *m_bg_tilemap = nullptr; + tilemap_t *m_bg2_tilemap = nullptr; + int m_char_on = 0; + int m_obj_on = 0; + int m_bg1_on = 0; + int m_bg2_on = 0; /* protection */ - u8 m_cpu_to_mcu; // ls374 at 5k - u8 m_mcu_to_cpu; // ls374 at 6k - u8 m_audiocpu_to_mcu; // ls374 at 5l - u8 m_mcu_to_audiocpu; // ls374 at 6l - u8 m_mcu_p0; - u8 m_mcu_p2; - u8 m_mcu_p3; + u8 m_cpu_to_mcu = 0; // ls374 at 5k + u8 m_mcu_to_cpu = 0; // ls374 at 6k + u8 m_audiocpu_to_mcu = 0; // ls374 at 5l + u8 m_mcu_to_audiocpu = 0; // ls374 at 6l + u8 m_mcu_p0 = 0; + u8 m_mcu_p2 = 0; + u8 m_mcu_p3 = 0; INTERRUPT_GEN_MEMBER(mcu_irq); void mcu_p3_w(u8 data); diff -Nru mame-0.242+dfsg.1/src/mame/includes/20pacgal.h mame-0.243+dfsg.1/src/mame/includes/20pacgal.h --- mame-0.242+dfsg.1/src/mame/includes/20pacgal.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/20pacgal.h 2022-04-29 05:37:26.000000000 +0000 @@ -54,7 +54,7 @@ optional_memory_bank m_mainbank; /* machine state */ - uint8_t m_game_selected; /* 0 = Ms. Pac-Man, 1 = Galaga */ + uint8_t m_game_selected = 0; /* 0 = Ms. Pac-Man, 1 = Galaga */ /* devices */ required_device m_maincpu; @@ -69,9 +69,9 @@ std::unique_ptr m_ram_48000; /* 25pacman and 20pacgal store the sprite palette at a different address, this is a hardware difference and confirmed NOT to be a register */ - uint8_t m_sprite_pal_base; + uint8_t m_sprite_pal_base = 0; - uint8_t m_irq_mask; + uint8_t m_irq_mask = 0; void irqack_w(uint8_t data); void timer_pulse_w(uint8_t data); void _20pacgal_coin_counter_w(uint8_t data); diff -Nru mame-0.242+dfsg.1/src/mame/includes/3do.h mame-0.243+dfsg.1/src/mame/includes/3do.h --- mame-0.242+dfsg.1/src/mame/includes/3do.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/3do.h 2022-04-29 05:37:26.000000000 +0000 @@ -39,118 +39,118 @@ /* 03180000 - 0318003f - configuration group */ /* 03180040 - 0318007f - diagnostic UART */ - uint8_t cg_r_count; - uint8_t cg_w_count; - uint32_t cg_input; - uint32_t cg_output; + uint8_t cg_r_count = 0; + uint8_t cg_w_count = 0; + uint32_t cg_input = 0; + uint32_t cg_output = 0; }; struct MADAM { - uint32_t revision; /* 03300000 */ - uint32_t msysbits; /* 03300004 */ - uint32_t mctl; /* 03300008 */ - uint32_t sltime; /* 0330000c */ - uint32_t abortbits; /* 03300020 */ - uint32_t privbits; /* 03300024 */ - uint32_t statbits; /* 03300028 */ - uint32_t diag; /* 03300040 */ - - uint32_t ccobctl0; /* 03300110 */ - uint32_t ppmpc; /* 03300120 */ - - uint32_t regctl0; /* 03300130 */ - uint32_t regctl1; /* 03300134 */ - uint32_t regctl2; /* 03300138 */ - uint32_t regctl3; /* 0330013c */ - uint32_t xyposh; /* 03300140 */ - uint32_t xyposl; /* 03300144 */ - uint32_t linedxyh; /* 03300148 */ - uint32_t linedxyl; /* 0330014c */ - uint32_t dxyh; /* 03300150 */ - uint32_t dxyl; /* 03300154 */ - uint32_t ddxyh; /* 03300158 */ - uint32_t ddxyl; /* 0330015c */ - - uint32_t pip[16]; /* 03300180-033001bc (W); 03300180-033001fc (R) */ - uint32_t fence[16]; /* 03300200-0330023c (W); 03300200-0330027c (R) */ - uint32_t mmu[64]; /* 03300300-033003fc */ - uint32_t dma[32][4]; /* 03300400-033005fc */ - uint32_t mult[40]; /* 03300600-0330069c */ - uint32_t mult_control; /* 033007f0-033007f4 */ - uint32_t mult_status; /* 033007f8 */ + uint32_t revision = 0; /* 03300000 */ + uint32_t msysbits = 0; /* 03300004 */ + uint32_t mctl = 0; /* 03300008 */ + uint32_t sltime = 0; /* 0330000c */ + uint32_t abortbits = 0; /* 03300020 */ + uint32_t privbits = 0; /* 03300024 */ + uint32_t statbits = 0; /* 03300028 */ + uint32_t diag = 0; /* 03300040 */ + + uint32_t ccobctl0 = 0; /* 03300110 */ + uint32_t ppmpc = 0; /* 03300120 */ + + uint32_t regctl0 = 0; /* 03300130 */ + uint32_t regctl1 = 0; /* 03300134 */ + uint32_t regctl2 = 0; /* 03300138 */ + uint32_t regctl3 = 0; /* 0330013c */ + uint32_t xyposh = 0; /* 03300140 */ + uint32_t xyposl = 0; /* 03300144 */ + uint32_t linedxyh = 0; /* 03300148 */ + uint32_t linedxyl = 0; /* 0330014c */ + uint32_t dxyh = 0; /* 03300150 */ + uint32_t dxyl = 0; /* 03300154 */ + uint32_t ddxyh = 0; /* 03300158 */ + uint32_t ddxyl = 0; /* 0330015c */ + + uint32_t pip[16]{}; /* 03300180-033001bc (W); 03300180-033001fc (R) */ + uint32_t fence[16]{}; /* 03300200-0330023c (W); 03300200-0330027c (R) */ + uint32_t mmu[64]{}; /* 03300300-033003fc */ + uint32_t dma[32][4]{}; /* 03300400-033005fc */ + uint32_t mult[40]{}; /* 03300600-0330069c */ + uint32_t mult_control = 0; /* 033007f0-033007f4 */ + uint32_t mult_status = 0; /* 033007f8 */ }; struct CLIO { - screen_device *screen; + screen_device *screen = nullptr; - uint32_t revision; /* 03400000 */ - uint32_t csysbits; /* 03400004 */ - uint32_t vint0; /* 03400008 */ - uint32_t vint1; /* 0340000c */ - uint32_t audin; /* 03400020 */ - uint32_t audout; /* 03400024 */ - uint32_t cstatbits; /* 03400028 */ - uint32_t wdog; /* 0340002c */ - uint32_t hcnt; /* 03400030 */ - uint32_t vcnt; /* 03400034 */ - uint32_t seed; /* 03400038 */ - uint32_t random; /* 0340004c */ - uint32_t irq0; /* 03400040 / 03400044 */ - uint32_t irq0_enable; /* 03400048 / 0340004c */ - uint32_t mode; /* 03400050 / 03400054 */ - uint32_t badbits; /* 03400058 */ - uint32_t spare; /* 0340005c */ - uint32_t irq1; /* 03400060 / 03400064 */ - uint32_t irq1_enable; /* 03400068 / 0340006c */ - uint32_t hdelay; /* 03400080 */ - uint32_t adbio; /* 03400084 */ - uint32_t adbctl; /* 03400088 */ + uint32_t revision = 0; /* 03400000 */ + uint32_t csysbits = 0; /* 03400004 */ + uint32_t vint0 = 0; /* 03400008 */ + uint32_t vint1 = 0; /* 0340000c */ + uint32_t audin = 0; /* 03400020 */ + uint32_t audout = 0; /* 03400024 */ + uint32_t cstatbits = 0; /* 03400028 */ + uint32_t wdog = 0; /* 0340002c */ + uint32_t hcnt = 0; /* 03400030 */ + uint32_t vcnt = 0; /* 03400034 */ + uint32_t seed = 0; /* 03400038 */ + uint32_t random = 0; /* 0340004c */ + uint32_t irq0 = 0; /* 03400040 / 03400044 */ + uint32_t irq0_enable = 0; /* 03400048 / 0340004c */ + uint32_t mode = 0; /* 03400050 / 03400054 */ + uint32_t badbits = 0; /* 03400058 */ + uint32_t spare = 0; /* 0340005c */ + uint32_t irq1 = 0; /* 03400060 / 03400064 */ + uint32_t irq1_enable = 0; /* 03400068 / 0340006c */ + uint32_t hdelay = 0; /* 03400080 */ + uint32_t adbio = 0; /* 03400084 */ + uint32_t adbctl = 0; /* 03400088 */ /* Timers */ - uint32_t timer_count[16];/* 034001** & 8 */ - uint32_t timer_backup[16]; /* 034001**+4 & 8 */ - uint64_t timer_ctrl; /* 03400200 */ - uint32_t slack; /* 03400220 */ + uint32_t timer_count[16]{};/* 034001** & 8 */ + uint32_t timer_backup[16]{}; /* 034001**+4 & 8 */ + uint64_t timer_ctrl = 0; /* 03400200 */ + uint32_t slack = 0; /* 03400220 */ /* DMA */ - uint32_t dmareqdis; /* 03400308 */ + uint32_t dmareqdis = 0; /* 03400308 */ /* Expansion bus */ - uint32_t expctl; /* 03400400/03400404 */ - uint32_t type0_4; /* 03400408 */ - uint32_t dipir1; /* 03400410 */ - uint32_t dipir2; /* 03400414 */ + uint32_t expctl = 0; /* 03400400/03400404 */ + uint32_t type0_4 = 0; /* 03400408 */ + uint32_t dipir1 = 0; /* 03400410 */ + uint32_t dipir2 = 0; /* 03400414 */ /* Bus signals */ - uint32_t sel; /* 03400500 - 0340053f */ - uint32_t poll; /* 03400540 - 0340057f */ - uint32_t cmdstat; /* 03400580 - 034005bf */ - uint32_t data; /* 034005c0 - 034005ff */ + uint32_t sel = 0; /* 03400500 - 0340053f */ + uint32_t poll = 0; /* 03400540 - 0340057f */ + uint32_t cmdstat = 0; /* 03400580 - 034005bf */ + uint32_t data = 0; /* 034005c0 - 034005ff */ /* DSPP */ - uint32_t semaphore; /* 034017d0 */ - uint32_t semaack; /* 034017d4 */ - uint32_t dsppdma; /* 034017e0 */ - uint32_t dspprst0; /* 034017e4 */ - uint32_t dspprst1; /* 034017e8 */ - uint32_t dspppc; /* 034017f4 */ - uint32_t dsppnr; /* 034017f8 */ - uint32_t dsppgw; /* 034017fc */ - uint32_t dsppn[0x400]; /* 03401800 - 03401bff DSPP N stack (32bit writes) */ + uint32_t semaphore = 0; /* 034017d0 */ + uint32_t semaack = 0; /* 034017d4 */ + uint32_t dsppdma = 0; /* 034017e0 */ + uint32_t dspprst0 = 0; /* 034017e4 */ + uint32_t dspprst1 = 0; /* 034017e8 */ + uint32_t dspppc = 0; /* 034017f4 */ + uint32_t dsppnr = 0; /* 034017f8 */ + uint32_t dsppgw = 0; /* 034017fc */ + uint32_t dsppn[0x400]{}; /* 03401800 - 03401bff DSPP N stack (32bit writes) */ /* 03402000 - 034027ff DSPP N stack (16bit writes) */ - uint32_t dsppei[0x100]; /* 03403000 - 034030ff DSPP EI stack (32bit writes) */ + uint32_t dsppei[0x100]{}; /* 03403000 - 034030ff DSPP EI stack (32bit writes) */ /* 03403400 - 034035ff DSPP EI stack (16bit writes) */ - uint32_t dsppeo[0x1f]; /* 03403800 - 0340381f DSPP EO stack (32bit reads) */ + uint32_t dsppeo[0x1f]{}; /* 03403800 - 0340381f DSPP EO stack (32bit reads) */ /* 03403c00 - 03403c3f DSPP EO stack (32bit reads) */ - uint32_t dsppclkreload; /* 034039dc / 03403fbc */ + uint32_t dsppclkreload = 0; /* 034039dc / 03403fbc */ /* UNCLE */ - uint32_t unclerev; /* 0340c000 */ - uint32_t uncle_soft_rev; /* 0340c004 */ - uint32_t uncle_addr; /* 0340c008 */ - uint32_t uncle_rom; /* 0340c00c */ + uint32_t unclerev = 0; /* 0340c000 */ + uint32_t uncle_soft_rev = 0; /* 0340c004 */ + uint32_t uncle_addr = 0; /* 0340c008 */ + uint32_t uncle_rom = 0; /* 0340c00c */ }; struct SVF { - uint32_t sport[512]; - uint32_t color; + uint32_t sport[512]{}; + uint32_t color = 0; }; struct DSPP { @@ -171,7 +171,7 @@ CLIO m_clio; SVF m_svf; DSPP m_dspp; - uint8_t m_nvmem[0x8000]; + uint8_t m_nvmem[0x8000]{}; // uint8_t m_video_bits[512]; uint8_t nvarea_r(offs_t offset); diff -Nru mame-0.242+dfsg.1/src/mame/includes/4enraya.h mame-0.243+dfsg.1/src/mame/includes/4enraya.h --- mame-0.242+dfsg.1/src/mame/includes/4enraya.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/4enraya.h 2022-04-29 05:37:26.000000000 +0000 @@ -63,7 +63,7 @@ optional_region_ptr m_rom; /* video-related */ - tilemap_t *m_bg_tilemap = 0; + tilemap_t *m_bg_tilemap = nullptr; /* sound-related */ uint8_t m_soundlatch = 0U; diff -Nru mame-0.242+dfsg.1/src/mame/includes/8080bw.h mame-0.243+dfsg.1/src/mame/includes/8080bw.h --- mame-0.242+dfsg.1/src/mame/includes/8080bw.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/8080bw.h 2022-04-29 05:37:26.000000000 +0000 @@ -24,7 +24,7 @@ #include "screen.h" -/* for games in 8080bw.c */ +/* for games in 8080bw.cpp */ #define CABINET_PORT_TAG "CAB" @@ -113,30 +113,30 @@ optional_ioport m_gunx; optional_ioport m_guny; - uint8_t m_color_map; - uint8_t m_screen_red; - uint8_t m_fleet_step; + uint8_t m_color_map = 0; + uint8_t m_screen_red = 0; + uint8_t m_fleet_step = 0; std::unique_ptr m_scattered_colorram; std::unique_ptr m_scattered_colorram2; /* sound-related */ - uint8_t m_port_1_last_extra; - uint8_t m_port_2_last_extra; - uint8_t m_port_3_last_extra; + uint8_t m_port_1_last_extra = 0; + uint8_t m_port_2_last_extra = 0; + uint8_t m_port_3_last_extra = 0; attotime m_schaser_effect_555_time_remain; - int32_t m_schaser_effect_555_time_remain_savable; - int m_schaser_effect_555_is_low; - int m_schaser_explosion; - int m_schaser_last_effect; - uint8_t m_polaris_cloud_speed; - uint8_t m_polaris_cloud_pos; - uint8_t m_schaser_background_disable; - uint8_t m_schaser_background_select; - uint16_t m_claybust_gun_pos; - u8 m_sound_data; - bool m_timer_state; + int32_t m_schaser_effect_555_time_remain_savable = 0; + int m_schaser_effect_555_is_low = 0; + int m_schaser_explosion = 0; + int m_schaser_last_effect = 0; + uint8_t m_polaris_cloud_speed = 0; + uint8_t m_polaris_cloud_pos = 0; + uint8_t m_schaser_background_disable = 0; + uint8_t m_schaser_background_select = 0; + uint16_t m_claybust_gun_pos = 0; + u8 m_sound_data = 0; + bool m_timer_state = false; TIMER_DEVICE_CALLBACK_MEMBER(nmi_timer); uint8_t indianbt_r(); diff -Nru mame-0.242+dfsg.1/src/mame/includes/88games.h mame-0.243+dfsg.1/src/mame/includes/88games.h --- mame-0.242+dfsg.1/src/mame/includes/88games.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/88games.h 2022-04-29 05:37:26.000000000 +0000 @@ -37,10 +37,10 @@ private: /* video-related */ - int m_k88games_priority; - int m_videobank; - int m_zoomreadroms; - int m_speech_chip; + int m_k88games_priority = 0; + int m_videobank = 0; + int m_zoomreadroms = 0; + int m_speech_chip = 0; /* devices */ required_device m_maincpu; diff -Nru mame-0.242+dfsg.1/src/mame/includes/a2600.h mame-0.243+dfsg.1/src/mame/includes/a2600.h --- mame-0.242+dfsg.1/src/mame/includes/a2600.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/a2600.h 2022-04-29 05:37:26.000000000 +0000 @@ -137,8 +137,8 @@ required_memory_bank m_bank; required_ioport m_a8; required_ioport m_swb; - emu_timer *m_reset_timer = 0; - emu_timer *m_game_select_button_timer = 0; + emu_timer *m_reset_timer = nullptr; + emu_timer *m_game_select_button_timer = nullptr; }; diff -Nru mame-0.242+dfsg.1/src/mame/includes/abc1600.h mame-0.243+dfsg.1/src/mame/includes/abc1600.h --- mame-0.242+dfsg.1/src/mame/includes/abc1600.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/abc1600.h 2022-04-29 05:37:26.000000000 +0000 @@ -149,7 +149,6 @@ int m_dmadis = 0; int m_sysscc = 0; int m_sysfs = 0; - int m_partst = 0; // parity test void abc1600_mem(address_map &map); void mac_mem(address_map &map); diff -Nru mame-0.242+dfsg.1/src/mame/includes/abc80.h mame-0.243+dfsg.1/src/mame/includes/abc80.h --- mame-0.242+dfsg.1/src/mame/includes/abc80.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/abc80.h 2022-04-29 05:37:26.000000000 +0000 @@ -161,17 +161,17 @@ }; // keyboard state - int m_key_data; - int m_key_strobe; - int m_pio_astb; + int m_key_data = 0; + int m_key_strobe = 0; + int m_pio_astb = 0; // video state bitmap_rgb32 m_bitmap; - u8 m_latch; - int m_blink; - int m_c; - int m_r; - int m_mode; + u8 m_latch = 0; + int m_blink = 0; + int m_c = 0; + int m_r = 0; + int m_mode = 0; // cassette state bool m_motor; @@ -179,11 +179,11 @@ int m_tape_in_latch; // timers - emu_timer *m_scanline_timer; - emu_timer *m_cassette_timer; - emu_timer *m_blink_timer; - emu_timer *m_vsync_on_timer; - emu_timer *m_vsync_off_timer; + emu_timer *m_scanline_timer = nullptr; + emu_timer *m_cassette_timer = nullptr; + emu_timer *m_blink_timer = nullptr; + emu_timer *m_vsync_on_timer = nullptr; + emu_timer *m_vsync_off_timer = nullptr; void abc80(machine_config &config); void abc80_video(machine_config &config); void abc80_io(address_map &map); diff -Nru mame-0.242+dfsg.1/src/mame/includes/abc80x.h mame-0.243+dfsg.1/src/mame/includes/abc80x.h --- mame-0.242+dfsg.1/src/mame/includes/abc80x.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/abc80x.h 2022-04-29 05:37:26.000000000 +0000 @@ -134,23 +134,23 @@ DECLARE_QUICKLOAD_LOAD_MEMBER(quickload_cb); // memory state - int m_keydtr; // keyboard DTR - bool m_fetch_charram; // opcode fetched from character RAM region (0x7800-0x7fff) + int m_keydtr = 0; // keyboard DTR + bool m_fetch_charram = false; // opcode fetched from character RAM region (0x7800-0x7fff) // serial state - uint8_t m_sb; + uint8_t m_sb = 0; int m_ctc_z0; int m_sio_txcb; int m_sio_txdb; int m_sio_rtsb; int m_dfd_out; - int m_dfd_in; + int m_dfd_in = 0; int m_tape_ctr; // video state - size_t m_char_ram_size; - uint8_t m_hrs; // HR picture start scanline - uint8_t m_fgctl; // HR foreground control + size_t m_char_ram_size = 0; + uint8_t m_hrs = 0; // HR picture start scanline + uint8_t m_fgctl = 0; // HR foreground control // timers emu_timer *m_cassette_timer; @@ -248,12 +248,12 @@ MC6845_UPDATE_ROW( abc802_update_row ); // cpu state - int m_lrs; // low RAM select + int m_lrs = 0; // low RAM select // video state - int m_flshclk_ctr; // flash clock counter - int m_flshclk; // flash clock - int m_80_40_mux; // 40/80 column mode + int m_flshclk_ctr = 0; // flash clock counter + int m_flshclk = 0; // flash clock + int m_80_40_mux = 0; // 40/80 column mode void abc802(machine_config &config); void abc802_video(machine_config &config); @@ -317,22 +317,22 @@ MC6845_UPDATE_ROW( abc806_update_row ); // memory state - int m_eme; // extended memory enable - uint8_t m_map[16]; // memory page register + int m_eme = 0; // extended memory enable + uint8_t m_map[16]{}; // memory page register // video state - int m_txoff; // text display enable - int m_40; // 40/80 column mode - int m_flshclk_ctr; // flash clock counter - int m_flshclk; // flash clock - uint8_t m_attr_data; // attribute data latch - uint8_t m_hrc[16]; // HR palette - uint8_t m_sync; // line synchronization delay - uint8_t m_v50_addr; // vertical sync PROM address - int m_hru2_a8; // HRU II PROM address line 8 - uint32_t m_vsync_shift; // vertical sync shift register - int m_vsync; // vertical sync - int m_d_vsync; // delayed vertical sync + int m_txoff = 0; // text display enable + int m_40 = 0; // 40/80 column mode + int m_flshclk_ctr = 0; // flash clock counter + int m_flshclk = 0; // flash clock + uint8_t m_attr_data = 0; // attribute data latch + uint8_t m_hrc[16]{}; // HR palette + uint8_t m_sync = 0; // line synchronization delay + uint8_t m_v50_addr = 0; // vertical sync PROM address + int m_hru2_a8 = 0; // HRU II PROM address line 8 + uint32_t m_vsync_shift = 0; // vertical sync shift register + int m_vsync = 0; // vertical sync + int m_d_vsync = 0; // delayed vertical sync void abc806(machine_config &config); void abc806_video(machine_config &config); diff -Nru mame-0.242+dfsg.1/src/mame/includes/advision.h mame-0.243+dfsg.1/src/mame/includes/advision.h --- mame-0.242+dfsg.1/src/mame/includes/advision.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/advision.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,92 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Dan Boris - -#ifndef MAME_INCLUDES_ADVISION_H -#define MAME_INCLUDES_ADVISION_H - -#pragma once - -#include "bus/generic/slot.h" -#include "bus/generic/carts.h" -#include "cpu/cop400/cop400.h" -#include "cpu/mcs48/mcs48.h" -#include "sound/dac.h" -#include "emupal.h" - -#define SCREEN_TAG "screen" -#define I8048_TAG "i8048" -#define COP411_TAG "cop411" - -class advision_state : public driver_device -{ -public: - advision_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag) - , m_maincpu(*this, I8048_TAG) - , m_soundcpu(*this, COP411_TAG) - , m_dac(*this, "dac") - , m_cart(*this, "cartslot") - , m_bank1(*this, "bank1") - , m_joy(*this, "joystick") - , m_palette(*this, "palette") - { } - - required_device m_maincpu; - required_device m_soundcpu; - required_device m_dac; - required_device m_cart; - required_memory_bank m_bank1; - required_ioport m_joy; - required_device m_palette; - - virtual void machine_start() override; - virtual void machine_reset() override; - - virtual void video_start() override; - uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - - void update_dac(); - void vh_write(int data); - void vh_update(int x); - - uint8_t rom_r(offs_t offset); - uint8_t ext_ram_r(offs_t offset); - void ext_ram_w(offs_t offset, uint8_t data); - uint8_t controller_r(); - void bankswitch_w(uint8_t data); - void av_control_w(uint8_t data); - DECLARE_READ_LINE_MEMBER( vsync_r ); - - TIMER_CALLBACK_MEMBER( sound_cmd_sync ); - uint8_t sound_cmd_r(); - void sound_g_w(uint8_t data); - void sound_d_w(uint8_t data); - - memory_region *m_cart_rom; - - int m_ea_bank; - - /* external RAM state */ - std::vector m_ext_ram; - int m_rambank; - - /* video state */ - int m_frame_count; - int m_frame_start; - int m_video_enable; - int m_video_bank; - int m_video_hpos; - uint8_t m_led_latch[8]; - std::unique_ptr m_display; - - /* sound state */ - int m_sound_cmd; - int m_sound_d; - int m_sound_g; - void advision_palette(palette_device &palette) const; - void advision(machine_config &config); - void io_map(address_map &map); - void program_map(address_map &map); -}; - -#endif diff -Nru mame-0.242+dfsg.1/src/mame/includes/aerofgt.h mame-0.243+dfsg.1/src/mame/includes/aerofgt.h --- mame-0.242+dfsg.1/src/mame/includes/aerofgt.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/aerofgt.h 2022-04-29 05:37:26.000000000 +0000 @@ -62,17 +62,17 @@ optional_memory_bank m_okibank; /* video-related */ - tilemap_t *m_tilemap[2]; - uint8_t m_gfxbank[8]; - uint16_t m_bank[4]; - uint16_t m_scrollx[2]; - uint16_t m_scrolly[2]; - bool m_flip_screen; - uint16_t m_wbbc97_bitmap_enable; - int m_charpalettebank; - int m_spritepalettebank; - int m_sprite_gfx; - int m_spikes91_lookup; + tilemap_t *m_tilemap[2]{}; + uint8_t m_gfxbank[8]{}; + uint16_t m_bank[4]{}; + uint16_t m_scrollx[2]{}; + uint16_t m_scrolly[2]{}; + bool m_flip_screen = false; + uint16_t m_wbbc97_bitmap_enable = 0; + int m_charpalettebank = 0; + int m_spritepalettebank = 0; + int m_sprite_gfx = 0; + int m_spikes91_lookup = 0; uint32_t aerofgt_tile_callback( uint32_t code ); uint32_t aerofgt_old_tile_callback( uint32_t code ); diff -Nru mame-0.242+dfsg.1/src/mame/includes/aim65.h mame-0.243+dfsg.1/src/mame/includes/aim65.h --- mame-0.242+dfsg.1/src/mame/includes/aim65.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/aim65.h 2022-04-29 05:37:26.000000000 +0000 @@ -88,7 +88,7 @@ DECLARE_DEVICE_IMAGE_LOAD_MEMBER(z13_load) { return load_cart(image, m_z13, "z13"); } DECLARE_DEVICE_IMAGE_LOAD_MEMBER(z14_load) { return load_cart(image, m_z14, "z14"); } DECLARE_DEVICE_IMAGE_LOAD_MEMBER(z15_load) { return load_cart(image, m_z15, "z15"); } - emu_timer *m_print_timer = 0; + emu_timer *m_print_timer = nullptr; TIMER_CALLBACK_MEMBER(printer_timer); uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); @@ -99,13 +99,13 @@ optional_device m_palette; uint8_t m_riot_port_a = 0U; uint8_t m_pb_save = 0U; - bool m_kb_en = 0; - bool m_ca2 = 0; - bool m_cb2 = 0; + bool m_kb_en = false; + bool m_ca2 = false; + bool m_cb2 = false; u8 m_printer_x =0U; u8 m_printer_y = 0U; u8 m_printer_flag = 0U; - bool m_printer_level = 0; + bool m_printer_level = false; std::unique_ptr m_printerRAM {}; required_device m_maincpu; diff -Nru mame-0.242+dfsg.1/src/mame/includes/airbustr.h mame-0.243+dfsg.1/src/mame/includes/airbustr.h --- mame-0.242+dfsg.1/src/mame/includes/airbustr.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/airbustr.h 2022-04-29 05:37:26.000000000 +0000 @@ -51,10 +51,10 @@ required_memory_bank m_audiobank; /* video-related */ - tilemap_t *m_tilemap[2]; - int m_scrollx[2]; - int m_scrolly[2]; - int m_highbits; + tilemap_t *m_tilemap[2]{}; + int m_scrollx[2]{}; + int m_scrolly[2]{}; + int m_highbits = 0; /* devices */ required_device m_master; diff -Nru mame-0.242+dfsg.1/src/mame/includes/ajax.h mame-0.243+dfsg.1/src/mame/includes/ajax.h --- mame-0.242+dfsg.1/src/mame/includes/ajax.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/ajax.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,81 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Manuel Abadia -#ifndef MAME_INCLUDES_AJAX_H -#define MAME_INCLUDES_AJAX_H - -#pragma once - -#include "machine/gen_latch.h" -#include "machine/watchdog.h" -#include "sound/k007232.h" -#include "video/k052109.h" -#include "video/k051960.h" -#include "video/k051316.h" -#include "video/konami_helper.h" -#include "emupal.h" - -class ajax_state : public driver_device -{ -public: - ajax_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_subcpu(*this, "sub"), - m_watchdog(*this, "watchdog"), - m_k007232_1(*this, "k007232_1"), - m_k007232_2(*this, "k007232_2"), - m_k052109(*this, "k052109"), - m_k051960(*this, "k051960"), - m_k051316(*this, "k051316"), - m_palette(*this, "palette"), - m_soundlatch(*this, "soundlatch"), - m_lamps(*this, "lamp%u", 0U) - { } - - void ajax(machine_config &config); - -private: - void sound_bank_w(uint8_t data); - uint8_t ls138_f10_r(offs_t offset); - void ls138_f10_w(offs_t offset, uint8_t data); - void bankswitch_2_w(uint8_t data); - void bankswitch_w(uint8_t data); - void lamps_w(uint8_t data); - void k007232_extvol_w(uint8_t data); - uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void volume_callback0(uint8_t data); - void volume_callback1(uint8_t data); - K051316_CB_MEMBER(zoom_callback); - K052109_CB_MEMBER(tile_callback); - K051960_CB_MEMBER(sprite_callback); - void ajax_main_map(address_map &map); - void ajax_sound_map(address_map &map); - void ajax_sub_map(address_map &map); - -protected: - virtual void machine_start() override; - virtual void machine_reset() override; - - /* video-related */ - uint8_t m_priority = 0U; - - /* misc */ - int m_firq_enable = 0; - - /* devices */ - required_device m_maincpu; - required_device m_audiocpu; - required_device m_subcpu; - required_device m_watchdog; - required_device m_k007232_1; - required_device m_k007232_2; - required_device m_k052109; - required_device m_k051960; - required_device m_k051316; - required_device m_palette; - required_device m_soundlatch; - output_finder<8> m_lamps; -}; - -#endif // MAME_INCLUDES_AJAX_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/alesis.h mame-0.243+dfsg.1/src/mame/includes/alesis.h --- mame-0.242+dfsg.1/src/mame/includes/alesis.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/alesis.h 2022-04-29 05:37:26.000000000 +0000 @@ -42,12 +42,12 @@ required_device m_dac; required_region_ptr m_samples; - emu_timer * m_dac_update_timer; - bool m_output_active; - int m_count; - int m_shift; - uint32_t m_cur_sample; - uint8_t m_cmd[5]; + emu_timer * m_dac_update_timer = nullptr; + bool m_output_active = false; + int m_count = 0; + int m_shift = 0; + uint32_t m_cur_sample = 0; + uint8_t m_cmd[5]{}; }; @@ -156,9 +156,9 @@ void sr16_mem(address_map &map); private: - uint8_t m_kb_matrix; - uint8_t m_leds; - uint8_t m_lcd_digits[5]; + uint8_t m_kb_matrix = 0; + uint8_t m_leds = 0; + uint8_t m_lcd_digits[5]{}; required_device m_lcdc; optional_device m_cassette; diff -Nru mame-0.242+dfsg.1/src/mame/includes/alpha68k.h mame-0.243+dfsg.1/src/mame/includes/alpha68k.h --- mame-0.242+dfsg.1/src/mame/includes/alpha68k.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/alpha68k.h 2022-04-29 05:37:26.000000000 +0000 @@ -131,7 +131,7 @@ u16 alpha_II_trigger_r(offs_t offset); /* video-related */ - tilemap_t *m_fix_tilemap = 0; + tilemap_t *m_fix_tilemap = nullptr; int m_bank_base = 0; void outlatch_w(offs_t offset, u8 data = 0); @@ -268,7 +268,7 @@ private: u16 m_tile_transchar = 0U; int m_tile_bankshift = 0; - bool m_is_super_stingray = 0; + bool m_is_super_stingray = false; }; class sstingray_state : public alpha68k_N_state diff -Nru mame-0.242+dfsg.1/src/mame/includes/amiga.h mame-0.243+dfsg.1/src/mame/includes/amiga.h --- mame-0.242+dfsg.1/src/mame/includes/amiga.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/amiga.h 2022-04-29 05:37:26.000000000 +0000 @@ -389,43 +389,43 @@ } /* sprite states */ - uint8_t m_sprite_comparitor_enable_mask; - uint8_t m_sprite_dma_reload_mask; - uint8_t m_sprite_dma_live_mask; - uint8_t m_sprite_ctl_written; - uint32_t m_sprite_shiftreg[8]; - uint8_t m_sprite_remain[8]; + uint8_t m_sprite_comparitor_enable_mask = 0; + uint8_t m_sprite_dma_reload_mask = 0; + uint8_t m_sprite_dma_live_mask = 0; + uint8_t m_sprite_ctl_written = 0; + uint32_t m_sprite_shiftreg[8]{}; + uint8_t m_sprite_remain[8]{}; /* copper states */ - uint32_t m_copper_pc; - uint8_t m_copper_waiting; - uint8_t m_copper_waitblit; - uint16_t m_copper_waitval; - uint16_t m_copper_waitmask; - uint16_t m_copper_pending_offset; - uint16_t m_copper_pending_data; - int m_wait_offset; + uint32_t m_copper_pc = 0; + uint8_t m_copper_waiting = 0; + uint8_t m_copper_waitblit = 0; + uint16_t m_copper_waitval = 0; + uint16_t m_copper_waitmask = 0; + uint16_t m_copper_pending_offset = 0; + uint16_t m_copper_pending_data = 0; + int m_wait_offset = 0; /* playfield states */ - int m_last_scanline; + int m_last_scanline = 0; rgb_t m_ham_color; /* misc states */ - uint16_t m_genlock_color; + uint16_t m_genlock_color = 0; /* separate 6 in-order bitplanes into 2 x 3-bit bitplanes in two nibbles */ // FIXME: we instantiate 256 entries so that it pleases AGA uint8_t m_separate_bitplanes[2][256]; /* aga */ - int m_aga_diwhigh_written; - rgb_t m_aga_palette[256]; - rgb_t m_aga_ehb_palette[32 + 32]; - uint64_t m_aga_bpldat[8]; - uint16_t m_aga_sprdata[8][4]; - uint16_t m_aga_sprdatb[8][4]; - int m_aga_sprite_fetched_words; - int m_aga_sprite_dma_used_words[8]; + int m_aga_diwhigh_written = 0; + rgb_t m_aga_palette[256]{}; + rgb_t m_aga_ehb_palette[32 + 32]{}; + uint64_t m_aga_bpldat[8]{}; + uint16_t m_aga_sprdata[8][4]{}; + uint16_t m_aga_sprdatb[8][4]{}; + int m_aga_sprite_fetched_words = 0; + int m_aga_sprite_dma_used_words[8]{}; DECLARE_VIDEO_START( amiga ); DECLARE_VIDEO_START( amiga_aga ); @@ -499,10 +499,10 @@ HBLANK = 186 }; - emu_timer *m_blitter_timer; + emu_timer *m_blitter_timer = nullptr; - uint16_t m_agnus_id; - uint16_t m_denise_id; + uint16_t m_agnus_id = 0; + uint16_t m_denise_id = 0; void blitter_setup(); @@ -610,10 +610,10 @@ memory_array m_chip_ram; uint32_t m_chip_ram_mask; - int m_cia_0_irq; - int m_cia_1_irq; + int m_cia_0_irq = 0; + int m_cia_1_irq = 0; - uint16_t m_custom_regs[256]; + uint16_t m_custom_regs[256]{}; static const char *const s_custom_reg_names[0x100]; void ocs_map(address_map &map); @@ -705,9 +705,9 @@ int m_centronics_perror; int m_centronics_select; - emu_timer *m_irq_timer; - emu_timer *m_serial_timer; - emu_timer *m_scanline_timer; + emu_timer *m_irq_timer = nullptr; + emu_timer *m_serial_timer = nullptr; + emu_timer *m_scanline_timer = nullptr; bool m_gayle_reset; @@ -725,10 +725,10 @@ int m_tx_state; int m_rx_previous; - int m_rs232_dcd; - int m_rs232_dsr; - int m_rs232_ri; - int m_rs232_cts; + int m_rs232_dcd = 0; + int m_rs232_dsr = 0; + int m_rs232_ri = 0; + int m_rs232_cts = 0; void serial_adjust(); void serial_shift(); diff -Nru mame-0.242+dfsg.1/src/mame/includes/amstrad.h mame-0.243+dfsg.1/src/mame/includes/amstrad.h --- mame-0.242+dfsg.1/src/mame/includes/amstrad.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/amstrad.h 2022-04-29 05:37:26.000000000 +0000 @@ -119,9 +119,9 @@ required_device m_ram; optional_device m_rtc; // Aleste 520EX only - int m_system_type; - uint8_t m_aleste_mode; - int m_plus_irq_cause; + int m_system_type = 0; + uint8_t m_aleste_mode = 0; + int m_plus_irq_cause = 0; /**************************** * Gate Array data (CPC) - @@ -129,35 +129,35 @@ struct gate_array_t { std::unique_ptr bitmap; /* The bitmap we work on */ - uint8_t pen_selected; /* Pen selection */ - uint8_t mrer; /* Mode and ROM Enable Register */ - uint8_t upper_bank; - uint8_t romdis; // ROMDIS signal from the expansion port + uint8_t pen_selected = 0; /* Pen selection */ + uint8_t mrer = 0; /* Mode and ROM Enable Register */ + uint8_t upper_bank = 0; + uint8_t romdis = 0; // ROMDIS signal from the expansion port /* input signals from CRTC */ - int vsync; - int hsync; - int de; - int ma; - int ra; + int vsync = 0; + int hsync = 0; + int de = 0; + int ma = 0; + int ra = 0; /* used for timing */ - int hsync_after_vsync_counter; - int hsync_counter; /* The gate array counts CRTC HSYNC pulses using an internal 6-bit counter. */ + int hsync_after_vsync_counter = 0; + int hsync_counter = 0; /* The gate array counts CRTC HSYNC pulses using an internal 6-bit counter. */ /* used for drawing the screen */ attotime last_draw_time; - int y; - uint16_t *draw_p; /* Position in the bitmap where we are currently drawing */ - uint16_t colour; - uint16_t address; - uint8_t *mode_lookup; - uint8_t data; - uint8_t ticks; - uint8_t ticks_increment; - uint16_t line_ticks; - uint8_t colour_ticks; - uint8_t max_colour_ticks; + int y = 0; + uint16_t *draw_p = nullptr; /* Position in the bitmap where we are currently drawing */ + uint16_t colour = 0; + uint16_t address = 0; + uint8_t *mode_lookup = nullptr; + uint8_t data = 0; + uint8_t ticks = 0; + uint8_t ticks_increment = 0; + uint16_t line_ticks = 0; + uint8_t colour_ticks = 0; + uint8_t max_colour_ticks = 0; }; gate_array_t m_gate_array; @@ -167,52 +167,52 @@ ****************************/ struct asic_t { - uint8_t *ram; /* pointer to RAM used for the CPC+ ASIC memory-mapped registers */ - uint8_t enabled; /* Are CPC plus features enabled/unlocked */ - uint8_t pri; /* Programmable raster interrupt */ - uint8_t seqptr; /* Current position in the ASIC unlocking sequence */ - uint8_t rmr2; /* ROM mapping register 2 */ - uint16_t split_ma_base; /* Used to handle split screen support */ - uint16_t split_ma_started; /* Used to handle split screen support */ - uint16_t vpos; /* Current logical scanline */ - uint16_t h_start; /* Position where DE became active */ - uint16_t h_end; /* Position where DE became inactive */ - uint8_t addr_6845; /* We need these to store a shadow copy of R1 of the mc6845 */ - uint8_t horiz_disp; - uint8_t hscroll; - uint8_t de_start; /* flag to check if DE is been enabled this frame yet */ - bool hsync_first_tick; /* flag to check in first CRTC tick, used for knowing when to cover left side of screen to cover horizontal softscroll mess */ - uint8_t hsync_tick_count; + uint8_t *ram = nullptr; /* pointer to RAM used for the CPC+ ASIC memory-mapped registers */ + uint8_t enabled = 0; /* Are CPC plus features enabled/unlocked */ + uint8_t pri = 0; /* Programmable raster interrupt */ + uint8_t seqptr = 0; /* Current position in the ASIC unlocking sequence */ + uint8_t rmr2 = 0; /* ROM mapping register 2 */ + uint16_t split_ma_base = 0; /* Used to handle split screen support */ + uint16_t split_ma_started = 0; /* Used to handle split screen support */ + uint16_t vpos = 0; /* Current logical scanline */ + uint16_t h_start = 0; /* Position where DE became active */ + uint16_t h_end = 0; /* Position where DE became inactive */ + uint8_t addr_6845 = 0; /* We need these to store a shadow copy of R1 of the mc6845 */ + uint8_t horiz_disp = 0; + uint8_t hscroll = 0; + uint8_t de_start = 0; /* flag to check if DE is been enabled this frame yet */ + bool hsync_first_tick = false; /* flag to check in first CRTC tick, used for knowing when to cover left side of screen to cover horizontal softscroll mess */ + uint8_t hsync_tick_count = 0; /* DMA */ - uint8_t dma_status; - uint8_t dma_clear; /* Set if DMA interrupts are to be cleared automatically */ - uint8_t dma_prescaler[3]; /* DMA channel prescaler */ - uint16_t dma_repeat[3]; /* Location of the DMA channel's last repeat */ - uint16_t dma_addr[3]; /* DMA channel address */ - uint16_t dma_loopcount[3]; /* Count loops taken on this channel */ - uint16_t dma_pause[3]; /* DMA pause count */ + uint8_t dma_status = 0; + uint8_t dma_clear = 0; /* Set if DMA interrupts are to be cleared automatically */ + uint8_t dma_prescaler[3]{}; /* DMA channel prescaler */ + uint16_t dma_repeat[3]{}; /* Location of the DMA channel's last repeat */ + uint16_t dma_addr[3]{}; /* DMA channel address */ + uint16_t dma_loopcount[3]{}; /* Count loops taken on this channel */ + uint16_t dma_pause[3]{}; /* DMA pause count */ }; asic_t m_asic; - int m_GateArray_RamConfiguration; - unsigned char *m_AmstradCPC_RamBanks[4]; - unsigned char *m_Aleste_RamBanks[4]; - int m_aleste_active_page[4]; - unsigned char *m_Amstrad_ROM_Table[256]; - uint8_t m_ppi_port_inputs[3]; - uint8_t m_ppi_port_outputs[3]; - int m_aleste_rtc_function; - int m_prev_reg; - uint16_t m_GateArray_render_colours[17]; - uint8_t m_mode0_lookup[256]; - uint8_t m_mode1_lookup[256]; - uint8_t m_mode2_lookup[256]; - int m_prev_data; - int m_printer_bit8_selected; - unsigned char m_Psg_FunctionSelected; - int m_previous_ppi_portc_w; - uint8_t m_amx_mouse_data; + int m_GateArray_RamConfiguration = 0; + unsigned char *m_AmstradCPC_RamBanks[4]{}; + unsigned char *m_Aleste_RamBanks[4]{}; + int m_aleste_active_page[4]{}; + unsigned char *m_Amstrad_ROM_Table[256]{}; + uint8_t m_ppi_port_inputs[3]{}; + uint8_t m_ppi_port_outputs[3]{}; + int m_aleste_rtc_function = 0; + int m_prev_reg = 0; + uint16_t m_GateArray_render_colours[17]{}; + uint8_t m_mode0_lookup[256]{}; + uint8_t m_mode1_lookup[256]{}; + uint8_t m_mode2_lookup[256]{}; + int m_prev_data = 0; + int m_printer_bit8_selected = 0; + unsigned char m_Psg_FunctionSelected = 0; + int m_previous_ppi_portc_w = 0; + uint8_t m_amx_mouse_data = 0; void amstrad_plus_asic_4000_w(offs_t offset, uint8_t data); void amstrad_plus_asic_6000_w(offs_t offset, uint8_t data); uint8_t amstrad_plus_asic_4000_r(offs_t offset); @@ -284,7 +284,7 @@ required_device m_screen; required_device m_palette; - memory_region *m_region_cart; + memory_region *m_region_cart = nullptr; void amstrad_init_lookups(); void amstrad_vh_update_mode(); @@ -309,8 +309,8 @@ void enumerate_roms(); static uint8_t kccomp_get_colour_element(int colour_value); - int m_centronics_busy; - uint8_t m_last_write; + int m_centronics_busy = 0; + uint8_t m_last_write = 0; }; diff -Nru mame-0.242+dfsg.1/src/mame/includes/angelkds.h mame-0.243+dfsg.1/src/mame/includes/angelkds.h --- mame-0.242+dfsg.1/src/mame/includes/angelkds.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/angelkds.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,87 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:David Haywood -/************************************************************************* - - Angel Kids - -*************************************************************************/ -#ifndef MAME_INCLUDES_ANGELKDS_H -#define MAME_INCLUDES_ANGELKDS_H - -#pragma once - -#include "tilemap.h" - -class angelkds_state : public driver_device -{ -public: - angelkds_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_bgtopvideoram(*this, "bgtopvideoram"), - m_bgbotvideoram(*this, "bgbotvideoram"), - m_txvideoram(*this, "txvideoram"), - m_spriteram(*this, "spriteram"), - m_subcpu(*this, "sub"), - m_maincpu(*this, "maincpu"), - m_gfxdecode(*this, "gfxdecode"), - m_decrypted_opcodes(*this, "decrypted_opcodes") - { } - - void init_angelkds(); - void angelkds(machine_config &config); - void spcpostn(machine_config &config); - -private: - /* memory pointers */ - required_shared_ptr m_bgtopvideoram; - required_shared_ptr m_bgbotvideoram; - required_shared_ptr m_txvideoram; - required_shared_ptr m_spriteram; - - tilemap_t *m_tx_tilemap = nullptr; - tilemap_t *m_bgbot_tilemap = nullptr; - tilemap_t *m_bgtop_tilemap = nullptr; - int m_txbank = 0; - int m_bgbotbank = 0; - int m_bgtopbank = 0; - - uint8_t m_sound[4]{}; - uint8_t m_sound2[4]{}; - uint8_t m_layer_ctrl = 0; - - /* devices */ - required_device m_subcpu; - uint8_t angeklds_ff_r() { return 0xff; } - void angelkds_cpu_bank_write(uint8_t data); - void angelkds_main_sound_w(offs_t offset, uint8_t data); - uint8_t angelkds_main_sound_r(offs_t offset); - void angelkds_sub_sound_w(offs_t offset, uint8_t data); - uint8_t angelkds_sub_sound_r(offs_t offset); - void angelkds_txvideoram_w(offs_t offset, uint8_t data); - void angelkds_txbank_write(uint8_t data); - void angelkds_bgtopvideoram_w(offs_t offset, uint8_t data); - void angelkds_bgtopbank_write(uint8_t data); - void angelkds_bgtopscroll_write(uint8_t data); - void angelkds_bgbotvideoram_w(offs_t offset, uint8_t data); - void angelkds_bgbotbank_write(uint8_t data); - void angelkds_bgbotscroll_write(uint8_t data); - void angelkds_layer_ctrl_write(uint8_t data); - TILE_GET_INFO_MEMBER(get_tx_tile_info); - TILE_GET_INFO_MEMBER(get_bgtop_tile_info); - TILE_GET_INFO_MEMBER(get_bgbot_tile_info); - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; - uint32_t screen_update_angelkds(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int enable_n); - required_device m_maincpu; - required_device m_gfxdecode; - optional_shared_ptr m_decrypted_opcodes; - void decrypted_opcodes_map(address_map &map); - void main_map(address_map &map); - void main_portmap(address_map &map); - void sub_map(address_map &map); - void sub_portmap(address_map &map); -}; - -#endif // MAME_INCLUDES_ANGELKDS_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/apexc.h mame-0.243+dfsg.1/src/mame/includes/apexc.h --- mame-0.242+dfsg.1/src/mame/includes/apexc.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/apexc.h 2022-04-29 05:37:26.000000000 +0000 @@ -54,17 +54,17 @@ void mem(address_map &map); - uint32_t m_panel_data_reg; /* value of a data register on the control panel which can + uint32_t m_panel_data_reg = 0; /* value of a data register on the control panel which can be edited - the existence of this register is a personnal guess */ std::unique_ptr m_bitmap; - uint32_t m_old_edit_keys; - int m_old_control_keys; + uint32_t m_old_edit_keys = 0; + int m_old_control_keys = 0; - int m_letters; - int m_pos; + int m_letters = 0; + int m_pos = 0; required_device m_maincpu; required_device m_screen; @@ -77,7 +77,7 @@ required_ioport m_panel_port; required_ioport m_data_port; - emu_timer *m_input_timer; + emu_timer *m_input_timer = nullptr; static const device_timer_id TIMER_POLL_INPUTS; static const rgb_t palette_table[4]; diff -Nru mame-0.242+dfsg.1/src/mame/includes/apollo.h mame-0.243+dfsg.1/src/mame/includes/apollo.h --- mame-0.242+dfsg.1/src/mame/includes/apollo.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/apollo.h 2022-04-29 05:37:26.000000000 +0000 @@ -296,7 +296,7 @@ uint32_t ptm_counter = 0U; uint8_t sio_output_data = 0U; int m_dma_channel = 0; - bool m_cur_eop = 0; + bool m_cur_eop = false; }; /*----------- machine/apollo_config.cpp -----------*/ @@ -704,9 +704,9 @@ uint8_t m_xmitring[XMIT_RING_SIZE]{}; int m_xmit_read = 0, m_xmit_write = 0; - bool m_tx_busy = 0; + bool m_tx_busy = false; - emu_timer* m_poll_timer = 0; + emu_timer* m_poll_timer = nullptr; devcb_write_line m_tx_w; }; diff -Nru mame-0.242+dfsg.1/src/mame/includes/apple3.h mame-0.243+dfsg.1/src/mame/includes/apple3.h --- mame-0.242+dfsg.1/src/mame/includes/apple3.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/apple3.h 2022-04-29 05:37:26.000000000 +0000 @@ -130,44 +130,44 @@ DECLARE_WRITE_LINE_MEMBER(a2bus_inh_w); // these need to be public for now - uint32_t m_flags; - int m_enable_mask; + uint32_t m_flags = 0; + int m_enable_mask = 0; void apple3(machine_config &config); void apple3_map(address_map &map); private: - uint8_t m_via_0_a; - uint8_t m_via_0_b; - uint8_t m_via_1_a; - uint8_t m_via_1_b; - offs_t m_zpa; - uint8_t m_last_n; - uint8_t m_char_mem[0x800]; + uint8_t m_via_0_a = 0; + uint8_t m_via_0_b = 0; + uint8_t m_via_1_a = 0; + uint8_t m_via_1_b = 0; + offs_t m_zpa = 0; + uint8_t m_last_n = 0; + uint8_t m_char_mem[0x800]{}; std::unique_ptr m_hgr_map; - bool m_sync; - bool m_rom_has_been_disabled; - int m_cnxx_slot; - uint8_t m_indir_bank; - - uint8_t *m_bank2, *m_bank3, *m_bank4, *m_bank5, *m_bank8, *m_bank9; - uint8_t *m_bank10, *m_bank11; - uint8_t *m_bank6, *m_bank7rd, *m_bank7wr; - int m_bell_state; - int m_c040_time; - uint16_t m_lastchar, m_strobe; - uint8_t m_transchar; - bool m_charwrt; - - emu_timer *m_scanstart, *m_scanend; - - int m_analog_sel; - bool m_ramp_active; - int m_pdl_charge; - int m_va, m_vb, m_vc; - int m_smoothscr; + bool m_sync = false; + bool m_rom_has_been_disabled = false; + int m_cnxx_slot = 0; + uint8_t m_indir_bank = 0; + + uint8_t *m_bank2 = nullptr, *m_bank3 = nullptr, *m_bank4 = nullptr, *m_bank5 = nullptr, *m_bank8 = nullptr, *m_bank9 = nullptr; + uint8_t *m_bank10 = nullptr, *m_bank11 = nullptr; + uint8_t *m_bank6 = nullptr, *m_bank7rd = nullptr, *m_bank7wr = nullptr; + int m_bell_state = 0; + int m_c040_time = 0; + uint16_t m_lastchar = 0, m_strobe = 0; + uint8_t m_transchar = 0; + bool m_charwrt = false; + + emu_timer *m_scanstart = nullptr, *m_scanend = nullptr; + + int m_analog_sel = 0; + bool m_ramp_active = false; + int m_pdl_charge = 0; + int m_va = 0, m_vb = 0, m_vc = 0; + int m_smoothscr = 0; - int m_inh_state; + int m_inh_state = 0; }; #endif // MAME_INCLUDES_APPLE3_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/aquarium.h mame-0.243+dfsg.1/src/mame/includes/aquarium.h --- mame-0.242+dfsg.1/src/mame/includes/aquarium.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/aquarium.h 2022-04-29 05:37:26.000000000 +0000 @@ -50,9 +50,9 @@ required_memory_bank m_audiobank; /* video-related */ - tilemap_t *m_txt_tilemap; - tilemap_t *m_mid_tilemap; - tilemap_t *m_bak_tilemap; + tilemap_t *m_txt_tilemap = nullptr; + tilemap_t *m_mid_tilemap = nullptr; + tilemap_t *m_bak_tilemap = nullptr; std::unique_ptr m_decoded_gfx[2]; /* devices */ diff -Nru mame-0.242+dfsg.1/src/mame/includes/arcadia.h mame-0.243+dfsg.1/src/mame/includes/arcadia.h --- mame-0.242+dfsg.1/src/mame/includes/arcadia.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/arcadia.h 2022-04-29 05:37:26.000000000 +0000 @@ -60,24 +60,24 @@ virtual void video_start() override; private: - int m_line; - int m_charline; - int m_shift; - int m_ad_delay; - int m_ad_select; - int m_ypos; - int m_graphics; - int m_doublescan; - int m_lines26; - int m_multicolor; - struct { int x, y; } m_pos[4]; - uint8_t m_bg[262][16+2*XPOS/8]; - uint8_t m_rectangle[0x40][8]; - uint8_t m_chars[0x40][8]; - int m_breaker; + int m_line = 0; + int m_charline = 0; + int m_shift = 0; + int m_ad_delay = 0; + int m_ad_select = 0; + int m_ypos = 0; + int m_graphics = 0; + int m_doublescan = 0; + int m_lines26 = 0; + int m_multicolor = 0; + struct { int x = 0, y = 0; } m_pos[4]; + uint8_t m_bg[262][16+2*XPOS/8]{}; + uint8_t m_rectangle[0x40][8]{}; + uint8_t m_chars[0x40][8]{}; + int m_breaker = 0; union { - uint8_t data[0x400]; + uint8_t data[0x400]{}; struct { // 0x1800 diff -Nru mame-0.242+dfsg.1/src/mame/includes/armedf.h mame-0.243+dfsg.1/src/mame/includes/armedf.h --- mame-0.242+dfsg.1/src/mame/includes/armedf.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/armedf.h 2022-04-29 05:37:26.000000000 +0000 @@ -73,19 +73,19 @@ u16 m_legion_cmd[4]; // legionjb only! // video-related - tilemap_t *m_bg_tilemap; - tilemap_t *m_fg_tilemap; - tilemap_t *m_tx_tilemap; - u16 m_scroll_msb; - u16 m_vreg; - u16 m_fg_scrollx; - u16 m_fg_scrolly; - u16 m_bg_scrollx; - u16 m_bg_scrolly; - int m_scroll_type; - int m_sprite_offy; - int m_old_mcu_mode; - int m_waiting_msb; + tilemap_t *m_bg_tilemap = nullptr; + tilemap_t *m_fg_tilemap = nullptr; + tilemap_t *m_tx_tilemap = nullptr; + u16 m_scroll_msb = 0; + u16 m_vreg = 0; + u16 m_fg_scrollx = 0; + u16 m_fg_scrolly = 0; + u16 m_bg_scrollx = 0; + u16 m_bg_scrolly = 0; + int m_scroll_type = 0; + int m_sprite_offy = 0; + int m_old_mcu_mode = 0; + int m_waiting_msb = 0; // read/write handlers void terraf_io_w(offs_t offset, u16 data, u16 mem_mask); diff -Nru mame-0.242+dfsg.1/src/mame/includes/ashnojoe.h mame-0.243+dfsg.1/src/mame/includes/ashnojoe.h --- mame-0.242+dfsg.1/src/mame/includes/ashnojoe.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/ashnojoe.h 2022-04-29 05:37:26.000000000 +0000 @@ -46,11 +46,11 @@ required_memory_bank m_audiobank; /* video-related */ - tilemap_t *m_tilemap[7]; + tilemap_t *m_tilemap[7]{}; /* sound-related */ - u8 m_adpcm_byte; - int m_msm5205_vclk_toggle; + u8 m_adpcm_byte = 0; + int m_msm5205_vclk_toggle = 0; /* devices */ required_device m_maincpu; diff -Nru mame-0.242+dfsg.1/src/mame/includes/astrof.h mame-0.243+dfsg.1/src/mame/includes/astrof.h --- mame-0.242+dfsg.1/src/mame/includes/astrof.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/astrof.h 2022-04-29 05:37:26.000000000 +0000 @@ -57,18 +57,18 @@ optional_shared_ptr m_tomahawk_protection; optional_ioport m_fake_port; - uint8_t m_astrof_palette_bank; - uint8_t m_red_on; - uint8_t m_flipscreen; - uint8_t m_screen_off; - uint16_t m_abattle_count; + uint8_t m_astrof_palette_bank = 0; + uint8_t m_red_on = 0; + uint8_t m_flipscreen = 0; + uint8_t m_screen_off = 0; + uint16_t m_abattle_count = 0; /* sound-related */ - uint8_t m_port_1_last; - uint8_t m_port_2_last; - uint8_t m_astrof_start_explosion; - uint8_t m_astrof_death_playing; - uint8_t m_astrof_bosskill_playing; + uint8_t m_port_1_last = 0; + uint8_t m_port_2_last = 0; + uint8_t m_astrof_start_explosion = 0; + uint8_t m_astrof_death_playing = 0; + uint8_t m_astrof_bosskill_playing = 0; /* devices */ required_device m_maincpu; diff -Nru mame-0.242+dfsg.1/src/mame/includes/atarig1.h mame-0.243+dfsg.1/src/mame/includes/atarig1.h --- mame-0.242+dfsg.1/src/mame/includes/atarig1.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/atarig1.h 2022-04-29 05:37:26.000000000 +0000 @@ -58,17 +58,17 @@ optional_device m_adc; optional_ioport m_in1; - bool m_is_pitfight; + bool m_is_pitfight = false; required_shared_ptr m_mo_command; - bool m_bslapstic_primed; + bool m_bslapstic_primed = false; - uint8_t m_pfscroll_xoffset; - uint16_t m_current_control; - uint8_t m_playfield_tile_bank; - uint16_t m_playfield_xscroll; - uint16_t m_playfield_yscroll; + uint8_t m_pfscroll_xoffset = 0; + uint16_t m_current_control = 0; + uint8_t m_playfield_tile_bank = 0; + uint16_t m_playfield_xscroll = 0; + uint16_t m_playfield_yscroll = 0; void video_int_ack_w(uint16_t data = 0); TIMER_DEVICE_CALLBACK_MEMBER(scanline_update); diff -Nru mame-0.242+dfsg.1/src/mame/includes/atarig42.h mame-0.243+dfsg.1/src/mame/includes/atarig42.h --- mame-0.242+dfsg.1/src/mame/includes/atarig42.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/atarig42.h 2022-04-29 05:37:26.000000000 +0000 @@ -57,23 +57,23 @@ required_device m_asic65; optional_device m_adc; - uint16_t m_playfield_base; + uint16_t m_playfield_base = 0; - uint16_t m_current_control; - uint8_t m_playfield_tile_bank; - uint8_t m_playfield_color_bank; - uint16_t m_playfield_xscroll; - uint16_t m_playfield_yscroll; + uint16_t m_current_control = 0; + uint8_t m_playfield_tile_bank = 0; + uint8_t m_playfield_color_bank = 0; + uint16_t m_playfield_xscroll = 0; + uint16_t m_playfield_yscroll = 0; required_shared_ptr m_mo_command; - int m_sloop_bank; - int m_sloop_next_bank; - int m_sloop_offset; - int m_sloop_state; - uint16_t * m_sloop_base; + int m_sloop_bank = 0; + int m_sloop_next_bank = 0; + int m_sloop_offset = 0; + int m_sloop_state = 0; + uint16_t * m_sloop_base = nullptr; - uint32_t m_last_accesses[8]; + uint32_t m_last_accesses[8]{}; }; class atarig42_0x200_state : public atarig42_state diff -Nru mame-0.242+dfsg.1/src/mame/includes/atarigt.h mame-0.243+dfsg.1/src/mame/includes/atarigt.h --- mame-0.242+dfsg.1/src/mame/includes/atarigt.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/atarigt.h 2022-04-29 05:37:26.000000000 +0000 @@ -39,6 +39,7 @@ { } void atarigt(machine_config &config); + void atarigt_stereo(machine_config &config); void tmek(machine_config &config); void primrage20(machine_config &config); void primrage(machine_config &config); @@ -52,7 +53,7 @@ private: - bool m_is_primrage; + bool m_is_primrage = false; required_device m_palette; memory_share_creator m_colorram; @@ -66,18 +67,18 @@ optional_ioport m_coin_io; optional_ioport m_fake_io; - bool m_scanline_int_state; - bool m_video_int_state; + bool m_scanline_int_state = false; + bool m_video_int_state = false; bitmap_ind16 m_pf_bitmap; bitmap_ind16 m_an_bitmap; - uint8_t m_playfield_tile_bank; - uint8_t m_playfield_color_bank; - uint16_t m_playfield_xscroll; - uint16_t m_playfield_yscroll; + uint8_t m_playfield_tile_bank = 0; + uint8_t m_playfield_color_bank = 0; + uint16_t m_playfield_xscroll = 0; + uint16_t m_playfield_yscroll = 0; - uint32_t m_tram_checksum; + uint32_t m_tram_checksum = 0; required_shared_ptr m_mo_command; required_device m_cage; @@ -85,10 +86,10 @@ void (atarigt_state::*m_protection_w)(address_space &space, offs_t offset, uint16_t data); void (atarigt_state::*m_protection_r)(address_space &space, offs_t offset, uint16_t *data); - bool m_ignore_writes; - offs_t m_protaddr[ADDRSEQ_COUNT]; - uint8_t m_protmode; - uint16_t m_protresult; + bool m_ignore_writes = false; + offs_t m_protaddr[ADDRSEQ_COUNT]{}; + uint8_t m_protmode = 0; + uint16_t m_protresult = 0; std::unique_ptr m_protdata; INTERRUPT_GEN_MEMBER(scanline_int_gen); diff -Nru mame-0.242+dfsg.1/src/mame/includes/atarisy1.h mame-0.243+dfsg.1/src/mame/includes/atarisy1.h --- mame-0.242+dfsg.1/src/mame/includes/atarisy1.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/atarisy1.h 2022-04-29 05:37:26.000000000 +0000 @@ -83,8 +83,8 @@ required_device m_mob; required_device m_palette; - uint8_t m_joystick_type; - uint8_t m_trackball_type; + uint8_t m_joystick_type = 0; + uint8_t m_trackball_type = 0; optional_device m_adc; optional_device m_ajsint; @@ -94,16 +94,16 @@ required_device m_alpha_tilemap; required_shared_ptr m_xscroll; required_shared_ptr m_yscroll; - uint16_t m_playfield_lookup[256]; - uint8_t m_playfield_tile_bank; - uint16_t m_playfield_priority_pens; + uint16_t m_playfield_lookup[256]{}; + uint8_t m_playfield_tile_bank = 0; + uint16_t m_playfield_priority_pens = 0; required_device m_yscroll_reset_timer; // INT3 tracking - int m_next_timer_scanline; + int m_next_timer_scanline = 0; required_device m_scanline_timer; required_device m_int3off_timer; - uint8_t m_scanline_int_state; + uint8_t m_scanline_int_state = 0; // speech optional_device m_tms; @@ -112,11 +112,11 @@ optional_device m_via; // graphics bank tracking - uint8_t m_bank_gfx[3][8]; - uint8_t m_bank_color_shift[MAX_GFX_ELEMENTS]; - uint8_t m_bankselect; + uint8_t m_bank_gfx[3][8]{}; + uint8_t m_bank_color_shift[MAX_GFX_ELEMENTS]{}; + uint8_t m_bankselect = 0; - uint8_t m_cur[2][2]; + uint8_t m_cur[2][2]{}; void video_int_ack_w(uint8_t data = 0); template uint8_t digital_joystick_r(); diff -Nru mame-0.242+dfsg.1/src/mame/includes/aussiebyte.h mame-0.243+dfsg.1/src/mame/includes/aussiebyte.h --- mame-0.242+dfsg.1/src/mame/includes/aussiebyte.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/aussiebyte.h 2022-04-29 05:37:26.000000000 +0000 @@ -116,7 +116,7 @@ void mem_map(address_map &map); u8 crt8002(u8 ac_ra, u8 ac_chr, u8 ac_attr, u16 ac_cnt, bool ac_curs); - bool m_port15 = 0; // rom switched in (0), out (1) + bool m_port15 = false; // rom switched in (0), out (1) u8 m_port17 = 0U; u8 m_port17_rdy = 0U; u8 m_port19 = 0U; @@ -128,7 +128,7 @@ u16 m_cnt = 0U; u16 m_alpha_address = 0U; u16 m_graph_address = 0U; - bool m_centronics_busy = 0; + bool m_centronics_busy = false; std::unique_ptr m_vram; // video ram, 64k dynamic std::unique_ptr m_aram; // attribute ram, 2k static std::unique_ptr m_ram; // main ram, 256k dynamic diff -Nru mame-0.242+dfsg.1/src/mame/includes/avigo.h mame-0.243+dfsg.1/src/mame/includes/avigo.h --- mame-0.242+dfsg.1/src/mame/includes/avigo.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/avigo.h 2022-04-29 05:37:26.000000000 +0000 @@ -113,7 +113,7 @@ uint8_t m_bank1_h = 0U; uint8_t m_ad_control_status = 0U; uint16_t m_ad_value = 0U; - std::unique_ptr m_video_memory{}; + std::unique_ptr m_video_memory; uint8_t m_screen_column = 0U; uint8_t m_warm_start = 0U; }; diff -Nru mame-0.242+dfsg.1/src/mame/includes/balsente.h mame-0.243+dfsg.1/src/mame/includes/balsente.h --- mame-0.242+dfsg.1/src/mame/includes/balsente.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/balsente.h 2022-04-29 05:37:26.000000000 +0000 @@ -159,34 +159,34 @@ /* global data */ - uint8_t m_shooter; - uint8_t m_shooter_x; - uint8_t m_shooter_y; - uint8_t m_adc_shift; + uint8_t m_shooter = 0; + uint8_t m_shooter_x = 0; + uint8_t m_shooter_y = 0; + uint8_t m_adc_shift = 0; /* random number generator states */ - uint8_t m_rand17[POLY17_SIZE + 1]; + uint8_t m_rand17[POLY17_SIZE + 1]{}; /* ADC I/O states */ - int8_t m_analog_input_data[4]; - uint8_t m_adc_value; + int8_t m_analog_input_data[4]{}; + uint8_t m_adc_value = 0; /* game-specific states */ - uint8_t m_nstocker_bits; - uint8_t m_spiker_expand_color; - uint8_t m_spiker_expand_bgcolor; - uint8_t m_spiker_expand_bits; - uint8_t m_grudge_steering_result; - uint8_t m_grudge_last_steering[3]; - uint8_t m_teamht_input; + uint8_t m_nstocker_bits = 0; + uint8_t m_spiker_expand_color = 0; + uint8_t m_spiker_expand_bgcolor = 0; + uint8_t m_spiker_expand_bits = 0; + uint8_t m_grudge_steering_result = 0; + uint8_t m_grudge_last_steering[3]{}; + uint8_t m_teamht_input = 0; /* video data */ - uint8_t m_expanded_videoram[256*256]; - uint8_t *m_sprite_data; - uint32_t m_sprite_mask; - uint8_t *m_sprite_bank[2]; + uint8_t m_expanded_videoram[256*256]{}; + uint8_t *m_sprite_data = nullptr; + uint32_t m_sprite_mask = 0; + uint8_t *m_sprite_bank[2]{}; - uint8_t m_palettebank_vis; + uint8_t m_palettebank_vis = 0; required_shared_ptr m_spriteram; required_shared_ptr m_videoram; diff -Nru mame-0.242+dfsg.1/src/mame/includes/battlnts.h mame-0.243+dfsg.1/src/mame/includes/battlnts.h --- mame-0.242+dfsg.1/src/mame/includes/battlnts.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/battlnts.h 2022-04-29 05:37:26.000000000 +0000 @@ -27,7 +27,7 @@ { } /* video-related */ - int m_spritebank; + int m_spritebank = 0; /* devices */ required_device m_maincpu; diff -Nru mame-0.242+dfsg.1/src/mame/includes/bbc.h mame-0.243+dfsg.1/src/mame/includes/bbc.h --- mame-0.242+dfsg.1/src/mame/includes/bbc.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/bbc.h 2022-04-29 05:37:26.000000000 +0000 @@ -259,9 +259,9 @@ output_finder<> m_motor_led; - int m_romsel; // This is the latch that holds the sideways ROM bank to read - int m_paged_ram; // BBC B+ memory handling - int m_vdusel; // BBC B+ memory handling + int m_romsel = 0; // This is the latch that holds the sideways ROM bank to read + int m_paged_ram = 0; // BBC B+ memory handling + int m_vdusel = 0; // BBC B+ memory handling /* ACCCON @@ -282,59 +282,59 @@ ACCCON is a read/write register */ - int m_acccon; - int m_acccon_irr; - int m_acccon_tst; - int m_acccon_ifj; - int m_acccon_itu; - int m_acccon_y; - int m_acccon_x; - int m_acccon_e; - int m_acccon_d; + int m_acccon = 0; + int m_acccon_irr = 0; + int m_acccon_tst = 0; + int m_acccon_ifj = 0; + int m_acccon_itu = 0; + int m_acccon_y = 0; + int m_acccon_x = 0; + int m_acccon_e = 0; + int m_acccon_d = 0; void mc146818_set(); - int m_mc146818_as; // 6522 port b bit 7 - int m_mc146818_ce; // 6522 port b bit 6 + int m_mc146818_as = 0; // 6522 port b bit 7 + int m_mc146818_ce = 0; // 6522 port b bit 6 - int m_via_system_porta; + int m_via_system_porta = 0; // interrupt state - int m_adlc_irq; - int m_bus_nmi; + int m_adlc_irq = 0; + int m_bus_nmi = 0; - int m_column; // this is a counter in the keyboard circuit + int m_column = 0; // this is a counter in the keyboard circuit /*************************************** BBC 2C199 Serial Interface Cassette ****************************************/ - double m_last_dev_val; - int m_wav_len; - int m_len0; - int m_len1; - int m_len2; - int m_len3; - uint8_t m_serproc_data; - int m_rxd_serial; - int m_dcd_serial; - int m_cts_serial; - int m_dcd_cass; - int m_rxd_cass; - int m_cass_out_enabled; - int m_txd; - uint32_t m_nr_high_tones; - int m_cass_out_samples_to_go; - int m_cass_out_bit; - int m_cass_out_phase; - emu_timer *m_tape_timer; + double m_last_dev_val = 0; + int m_wav_len = 0; + int m_len0 = 0; + int m_len1 = 0; + int m_len2 = 0; + int m_len3 = 0; + uint8_t m_serproc_data = 0; + int m_rxd_serial = 0; + int m_dcd_serial = 0; + int m_cts_serial = 0; + int m_dcd_cass = 0; + int m_rxd_cass = 0; + int m_cass_out_enabled = 0; + int m_txd = 0; + uint32_t m_nr_high_tones = 0; + int m_cass_out_samples_to_go = 0; + int m_cass_out_bit = 0; + int m_cass_out_phase = 0; + emu_timer *m_tape_timer = nullptr; /************************************** WD1770 disc control ***************************************/ - int m_fdc_irq; - int m_fdc_drq; + int m_fdc_irq = 0; + int m_fdc_drq = 0; /************************************** Video Code @@ -342,31 +342,31 @@ // this is the real location of the start of the BBC's ram in the emulation // it can be changed if shadow ram is being used to point at the upper 32K of RAM - uint8_t *m_video_ram; - uint8_t m_pixel_bits[256]; - int m_hsync; - int m_vsync; + uint8_t *m_video_ram = nullptr; + uint8_t m_pixel_bits[256]{}; + int m_hsync = 0; + int m_vsync = 0; - uint8_t m_teletext_latch; - uint8_t m_vula_ctrl; + uint8_t m_teletext_latch = 0; + uint8_t m_vula_ctrl = 0; struct video_nula { - uint8_t palette_mode; - uint8_t horiz_offset; - uint8_t left_blank; - uint8_t disable; - uint8_t attr_mode; - uint8_t attr_text; - uint8_t flash[8]; - uint8_t palette_byte; - uint8_t palette_write; + uint8_t palette_mode = 0; + uint8_t horiz_offset = 0; + uint8_t left_blank = 0; + uint8_t disable = 0; + uint8_t attr_mode = 0; + uint8_t attr_text = 0; + uint8_t flash[8]{}; + uint8_t palette_byte = 0; + uint8_t palette_write = 0; } m_vnula; - int m_pixels_per_byte; - int m_cursor_size; + int m_pixels_per_byte = 0; + int m_cursor_size = 0; - uint8_t m_vula_palette[16]; - uint8_t m_vula_palette_lookup[16]; + uint8_t m_vula_palette[16]{}; + uint8_t m_vula_palette_lookup[16]{}; void setvideoshadow(int vdusel); void set_pixel_lookup(); @@ -379,7 +379,7 @@ uint16_t calculate_video_address(uint16_t ma, uint8_t ra); private: - emu_timer *m_reset_timer; + emu_timer *m_reset_timer = nullptr; }; diff -Nru mame-0.242+dfsg.1/src/mame/includes/beathead.h mame-0.243+dfsg.1/src/mame/includes/beathead.h --- mame-0.242+dfsg.1/src/mame/includes/beathead.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/beathead.h 2022-04-29 05:37:26.000000000 +0000 @@ -82,7 +82,7 @@ required_shared_ptr m_ram_base; required_region_ptr m_rom_base; - attotime m_hblank_offset{}; + attotime m_hblank_offset; uint8_t m_irq_line_state = 0U; uint8_t m_irq_enable[3]{}; diff -Nru mame-0.242+dfsg.1/src/mame/includes/bladestl.h mame-0.243+dfsg.1/src/mame/includes/bladestl.h --- mame-0.242+dfsg.1/src/mame/includes/bladestl.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/bladestl.h 2022-04-29 05:37:26.000000000 +0000 @@ -74,10 +74,10 @@ required_memory_bank m_rombank; /* video-related */ - int m_spritebank; + int m_spritebank = 0; /* misc */ - int m_last_track[4]; + int m_last_track[4]{}; output_finder<2> m_lamps; }; diff -Nru mame-0.242+dfsg.1/src/mame/includes/blmbycar.h mame-0.243+dfsg.1/src/mame/includes/blmbycar.h --- mame-0.242+dfsg.1/src/mame/includes/blmbycar.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/blmbycar.h 2022-04-29 05:37:26.000000000 +0000 @@ -50,12 +50,12 @@ optional_ioport m_opt_wheel_io; /* video-related */ - tilemap_t *m_tilemap[2]; + tilemap_t *m_tilemap[2]{}; /* input-related */ - uint8_t m_pot_wheel; // blmbycar - uint8_t m_old_val; // blmbycar - int m_retvalue; // waterball + uint8_t m_pot_wheel = 0; // blmbycar + uint8_t m_old_val = 0; // blmbycar + int m_retvalue = 0; // waterball // common void okibank_w(uint8_t data); diff -Nru mame-0.242+dfsg.1/src/mame/includes/blockout.h mame-0.243+dfsg.1/src/mame/includes/blockout.h --- mame-0.242+dfsg.1/src/mame/includes/blockout.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/blockout.h 2022-04-29 05:37:26.000000000 +0000 @@ -31,7 +31,7 @@ /* video-related */ bitmap_ind16 m_tmpbitmap; - u16 m_color; + u16 m_color = 0; /* devices */ required_device m_maincpu; diff -Nru mame-0.242+dfsg.1/src/mame/includes/bottom9.h mame-0.243+dfsg.1/src/mame/includes/bottom9.h --- mame-0.242+dfsg.1/src/mame/includes/bottom9.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/bottom9.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,77 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Nicola Salmoria -/************************************************************************* - - Bottom of the Ninth - -*************************************************************************/ -#ifndef MAME_INCLUDES_BOTTOM9_H -#define MAME_INCLUDES_BOTTOM9_H - -#pragma once - -#include "sound/k007232.h" -#include "video/k052109.h" -#include "video/k051960.h" -#include "video/k051316.h" -#include "video/konami_helper.h" -#include "emupal.h" - -class bottom9_state : public driver_device -{ -public: - bottom9_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_k007232_1(*this, "k007232_1"), - m_k007232_2(*this, "k007232_2"), - m_k052109(*this, "k052109"), - m_k051960(*this, "k051960"), - m_k051316(*this, "k051316"), - m_palette(*this, "palette") - { } - - void bottom9(machine_config &config); - -private: - /* misc */ - int m_video_enable = 0; - int m_zoomreadroms = 0; - int m_k052109_selected = 0; - int m_nmienable = 0; - - /* devices */ - required_device m_maincpu; - required_device m_audiocpu; - required_device m_k007232_1; - required_device m_k007232_2; - required_device m_k052109; - required_device m_k051960; - required_device m_k051316; - required_device m_palette; - uint8_t k052109_051960_r(offs_t offset); - void k052109_051960_w(offs_t offset, uint8_t data); - uint8_t bottom9_bankedram1_r(offs_t offset); - void bottom9_bankedram1_w(offs_t offset, uint8_t data); - uint8_t bottom9_bankedram2_r(offs_t offset); - void bottom9_bankedram2_w(offs_t offset, uint8_t data); - void bankswitch_w(uint8_t data); - void bottom9_1f90_w(uint8_t data); - void bottom9_sh_irqtrigger_w(uint8_t data); - void nmi_enable_w(uint8_t data); - void sound_bank_w(uint8_t data); - virtual void machine_start() override; - virtual void machine_reset() override; - uint32_t screen_update_bottom9(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - INTERRUPT_GEN_MEMBER(bottom9_sound_interrupt); - void volume_callback0(uint8_t data); - void volume_callback1(uint8_t data); - K051316_CB_MEMBER(zoom_callback); - K052109_CB_MEMBER(tile_callback); - K051960_CB_MEMBER(sprite_callback); - void audio_map(address_map &map); - void main_map(address_map &map); -}; - -#endif // MAME_INCLUDES_BOTTOM9_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/btime.h mame-0.243+dfsg.1/src/mame/includes/btime.h --- mame-0.242+dfsg.1/src/mame/includes/btime.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/btime.h 2022-04-29 05:37:26.000000000 +0000 @@ -55,19 +55,19 @@ /* video-related */ std::unique_ptr m_background_bitmap; - uint8_t m_btime_palette; - uint8_t m_bnj_scroll1; - uint8_t m_bnj_scroll2; - uint8_t m_btime_tilemap[4]; + uint8_t m_btime_palette = 0; + uint8_t m_bnj_scroll1 = 0; + uint8_t m_bnj_scroll2 = 0; + uint8_t m_btime_tilemap[4]{}; /* audio-related */ - uint8_t m_audio_nmi_enable_type; + uint8_t m_audio_nmi_enable_type = 0; /* protection-related (for mmonkey) */ - int m_protection_command; - int m_protection_status; - int m_protection_value; - int m_protection_ret; + int m_protection_command = 0; + int m_protection_status = 0; + int m_protection_value = 0; + int m_protection_ret = 0; /* devices */ required_device m_maincpu; diff -Nru mame-0.242+dfsg.1/src/mame/includes/btoads.h mame-0.243+dfsg.1/src/mame/includes/btoads.h --- mame-0.242+dfsg.1/src/mame/includes/btoads.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/btoads.h 2022-04-29 05:37:26.000000000 +0000 @@ -65,23 +65,23 @@ required_shared_ptr m_sprite_control; // state - uint8_t m_main_to_sound_data; - uint8_t m_main_to_sound_ready; - uint8_t m_sound_to_main_data; - uint8_t m_sound_to_main_ready; - uint8_t m_sound_int_state; - uint8_t *m_vram_fg_draw; - uint8_t *m_vram_fg_display; - int32_t m_xscroll0; - int32_t m_yscroll0; - int32_t m_xscroll1; - int32_t m_yscroll1; - uint8_t m_screen_control; - uint16_t m_sprite_source_offs; - uint8_t *m_sprite_dest_base; - uint16_t m_sprite_dest_offs; - uint16_t m_misc_control; - int m_xcount; + uint8_t m_main_to_sound_data = 0; + uint8_t m_main_to_sound_ready = 0; + uint8_t m_sound_to_main_data = 0; + uint8_t m_sound_to_main_ready = 0; + uint8_t m_sound_int_state = 0; + uint8_t *m_vram_fg_draw = nullptr; + uint8_t *m_vram_fg_display = nullptr; + int32_t m_xscroll0 = 0; + int32_t m_yscroll0 = 0; + int32_t m_xscroll1 = 0; + int32_t m_yscroll1 = 0; + uint8_t m_screen_control = 0; + uint16_t m_sprite_source_offs = 0; + uint8_t *m_sprite_dest_base = nullptr; + uint16_t m_sprite_dest_offs = 0; + uint16_t m_misc_control = 0; + int m_xcount = 0; std::unique_ptr m_nvram_data; // in drivers/btoads diff -Nru mame-0.242+dfsg.1/src/mame/includes/buggychl.h mame-0.243+dfsg.1/src/mame/includes/buggychl.h --- mame-0.242+dfsg.1/src/mame/includes/buggychl.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/buggychl.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,114 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Ernesto Corvi, Nicola Salmoria -/* - buggychl -*/ -#ifndef MAME_INCLUDES_BUGGYCHL_H -#define MAME_INCLUDES_BUGGYCHL_H - -#pragma once - -#include "machine/taito68705interface.h" -#include "machine/input_merger.h" -#include "machine/gen_latch.h" -#include "sound/msm5232.h" -#include "sound/ta7630.h" -#include "sound/ay8910.h" -#include "emupal.h" -#include "screen.h" - -class buggychl_state : public driver_device -{ -public: - buggychl_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_charram(*this, "charram"), - m_videoram(*this, "videoram"), - m_spriteram(*this, "spriteram"), - m_scrollv(*this, "scrollv"), - m_scrollh(*this, "scrollh"), - m_audiocpu(*this, "audiocpu"), - m_maincpu(*this, "maincpu"), - m_bmcu(*this, "bmcu"), - m_ta7630(*this, "ta7630"), - m_msm(*this, "msm"), - m_ay1(*this, "ay1"), - m_ay2(*this, "ay2"), - m_gfxdecode(*this, "gfxdecode"), - m_screen(*this, "screen"), - m_palette(*this, "palette"), - m_soundnmi(*this, "soundnmi"), - m_soundlatch(*this, "soundlatch"), - m_soundlatch2(*this, "soundlatch2"), - m_pedal_input(*this, "PEDAL"), - m_led(*this, "led%u", 0U) - { } - - /* memory pointers */ - required_shared_ptr m_charram; - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; - required_shared_ptr m_scrollv; - required_shared_ptr m_scrollh; - - /* devices */ - required_device m_audiocpu; - required_device m_maincpu; - required_device m_bmcu; - required_device m_ta7630; - required_device m_msm; - required_device m_ay1; - required_device m_ay2; - required_device m_gfxdecode; - required_device m_screen; - required_device m_palette; - required_device m_soundnmi; - required_device m_soundlatch; - required_device m_soundlatch2; - required_ioport m_pedal_input; - - output_finder<1> m_led; - - void bankswitch_w(uint8_t data); - void sound_enable_w(uint8_t data); - uint8_t mcu_status_r(); - uint8_t sound_status_main_r(); - uint8_t sound_status_sound_r(); - void buggychl_chargen_w(offs_t offset, uint8_t data); - void buggychl_sprite_lookup_bank_w(uint8_t data); - void buggychl_sprite_lookup_w(offs_t offset, uint8_t data); - void buggychl_ctrl_w(uint8_t data); - void buggychl_bg_scrollx_w(uint8_t data); - void ta7630_volbal_ay1_w(uint8_t data); - void port_b_0_w(uint8_t data); - void ta7630_volbal_ay2_w(uint8_t data); - void port_b_1_w(uint8_t data); - void ta7630_volbal_msm_w(uint8_t data); - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; - void buggychl_palette(palette_device &palette) const; - uint32_t screen_update_buggychl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - DECLARE_CUSTOM_INPUT_MEMBER( pedal_in_r ); - - void buggychl(machine_config &config); - void buggychl_map(address_map &map); - void sound_map(address_map &map); -private: - void draw_sky( bitmap_ind16 &bitmap, const rectangle &cliprect ); - void draw_bg( bitmap_ind16 &bitmap, const rectangle &cliprect ); - void draw_fg( bitmap_ind16 &bitmap, const rectangle &cliprect ); - void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); - /* video-related */ - bitmap_ind16 m_tmp_bitmap1; - bitmap_ind16 m_tmp_bitmap2; - int m_sl_bank; - int m_bg_clip_on; - int m_sky_on; - int m_sprite_color_base; - int m_bg_scrollx; - bool m_sound_irq_enable; - uint8_t m_sprite_lookup[0x2000]; -}; - -#endif // MAME_INCLUDES_BUGGYCHL_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/bw12.h mame-0.243+dfsg.1/src/mame/includes/bw12.h --- mame-0.242+dfsg.1/src/mame/includes/bw12.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/bw12.h 2022-04-29 05:37:26.000000000 +0000 @@ -122,25 +122,25 @@ required_memory_bank m_bank; /* memory state */ - int m_curbank; + int m_curbank = 0; /* PIT state */ - int m_pit_out2; + int m_pit_out2 = 0; /* keyboard state */ - int m_key_data[9]; - int m_key_sin; - int m_key_stb; - int m_key_shift; + int m_key_data[9]{}; + int m_key_sin = 0; + int m_key_stb = 0; + int m_key_shift = 0; /* floppy state */ - int m_motor_on; - int m_motor0; - int m_motor1; - - int m_centronics_busy; - int m_centronics_fault; - int m_centronics_perror; + int m_motor_on = 0; + int m_motor0 = 0; + int m_motor1 = 0; + + int m_centronics_busy = 0; + int m_centronics_fault = 0; + int m_centronics_perror = 0; }; #endif diff -Nru mame-0.242+dfsg.1/src/mame/includes/bw2.h mame-0.243+dfsg.1/src/mame/includes/bw2.h --- mame-0.242+dfsg.1/src/mame/includes/bw2.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/bw2.h 2022-04-29 05:37:26.000000000 +0000 @@ -77,14 +77,14 @@ static void floppy_formats(format_registration &fr); // keyboard state - uint8_t m_kb; + uint8_t m_kb = 0; // memory state - uint8_t m_bank; + uint8_t m_bank = 0; // floppy state - int m_mtron; - int m_mfdbk; + int m_mtron = 0; + int m_mfdbk = 0; // video state optional_shared_ptr m_video_ram; diff -Nru mame-0.242+dfsg.1/src/mame/includes/bwidow.h mame-0.243+dfsg.1/src/mame/includes/bwidow.h --- mame-0.242+dfsg.1/src/mame/includes/bwidow.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/bwidow.h 2022-04-29 05:37:26.000000000 +0000 @@ -50,7 +50,7 @@ virtual void machine_start() override { m_leds.resolve(); } virtual void machine_reset() override; - int m_lastdata; + int m_lastdata = 0; required_device m_maincpu; required_device m_earom; optional_ioport m_in3; diff -Nru mame-0.242+dfsg.1/src/mame/includes/c80.h mame-0.243+dfsg.1/src/mame/includes/c80.h --- mame-0.242+dfsg.1/src/mame/includes/c80.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/c80.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,63 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Curt Coder - -#ifndef MAME_INCLUDES_C80_H -#define MAME_INCLUDES_C80_H - -#include "cpu/z80/z80.h" -#include "machine/z80daisy.h" -#include "machine/z80pio.h" -#include "imagedev/cassette.h" -#include "machine/ram.h" - -#define SCREEN_TAG "screen" -#define Z80_TAG "d2" -#define Z80PIO1_TAG "d11" -#define Z80PIO2_TAG "d12" - -class c80_state : public driver_device -{ -public: - c80_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag) - , m_maincpu(*this, Z80_TAG) - , m_pio1(*this, Z80PIO1_TAG) - , m_cassette(*this, "cassette") - , m_row0(*this, "ROW0") - , m_row1(*this, "ROW1") - , m_row2(*this, "ROW2") - , m_digits(*this, "digit%u", 0U) - { } - - DECLARE_INPUT_CHANGED_MEMBER( trigger_reset ); - DECLARE_INPUT_CHANGED_MEMBER( trigger_nmi ); - void c80(machine_config &config); - -private: - required_device m_maincpu; - required_device m_pio1; - required_device m_cassette; - required_ioport m_row0; - required_ioport m_row1; - required_ioport m_row2; - output_finder<9> m_digits; - - virtual void machine_start() override; - - uint8_t pio1_pa_r(); - void pio1_pa_w(uint8_t data); - void pio1_pb_w(uint8_t data); - DECLARE_WRITE_LINE_MEMBER( pio1_brdy_w ); - - /* keyboard state */ - int m_keylatch = 0; - - /* display state */ - int m_digit = 0; - int m_pio1_a5 = 0; - int m_pio1_brdy = 0; - void c80_io(address_map &map); - void c80_mem(address_map &map); -}; - -#endif diff -Nru mame-0.242+dfsg.1/src/mame/includes/cave.h mame-0.243+dfsg.1/src/mame/includes/cave.h --- mame-0.242+dfsg.1/src/mame/includes/cave.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/cave.h 2022-04-29 05:37:26.000000000 +0000 @@ -235,13 +235,13 @@ int line_offset_zbuf = 0; } m_blit; - std::unique_ptr m_sprite[4]{}; + std::unique_ptr m_sprite[4]; sprite_cave *m_sprite_table[4][MAX_PRIORITY][MAX_SPRITE_NUM + 1]{}; - bitmap_ind16 m_sprite_zbuf[4]{}; + bitmap_ind16 m_sprite_zbuf[4]; u16 m_sprite_zbuf_baseval = 0U; - std::unique_ptr m_sprite_gfx[4]{}; + std::unique_ptr m_sprite_gfx[4]; offs_t m_sprite_gfx_mask[4]{}; int m_num_sprites[4]{}; diff -Nru mame-0.242+dfsg.1/src/mame/includes/cbasebal.h mame-0.243+dfsg.1/src/mame/includes/cbasebal.h --- mame-0.242+dfsg.1/src/mame/includes/cbasebal.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/cbasebal.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,70 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Nicola Salmoria -/************************************************************************* - - Capcom Baseball - -*************************************************************************/ - -#include "emupal.h" -#include "tilemap.h" - -class cbasebal_state : public driver_device -{ -public: - cbasebal_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_spriteram(*this, "spriteram"), - m_maincpu(*this, "maincpu"), - m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") { } - - void init_cbasebal(); - void cbasebal(machine_config &config); - -private: - /* memory pointers */ - required_shared_ptr m_spriteram; - - /* video-related */ - tilemap_t *m_fg_tilemap = nullptr; - tilemap_t *m_bg_tilemap = nullptr; - std::unique_ptr m_textram; - std::unique_ptr m_scrollram; - std::unique_ptr m_decoded; - uint8_t m_scroll_x[2]{}; - uint8_t m_scroll_y[2]{}; - int m_tilebank = 0; - int m_spritebank = 0; - int m_text_on = 0; - int m_bg_on = 0; - int m_obj_on = 0; - int m_flipscreen = 0; - - /* misc */ - uint8_t m_rambank = 0U; - void cbasebal_bankswitch_w(uint8_t data); - uint8_t bankedram_r(offs_t offset); - void bankedram_w(offs_t offset, uint8_t data); - void cbasebal_coinctrl_w(uint8_t data); - void cbasebal_textram_w(offs_t offset, uint8_t data); - uint8_t cbasebal_textram_r(offs_t offset); - void cbasebal_scrollram_w(offs_t offset, uint8_t data); - uint8_t cbasebal_scrollram_r(offs_t offset); - void cbasebal_gfxctrl_w(uint8_t data); - void cbasebal_scrollx_w(offs_t offset, uint8_t data); - void cbasebal_scrolly_w(offs_t offset, uint8_t data); - TILE_GET_INFO_MEMBER(get_bg_tile_info); - TILE_GET_INFO_MEMBER(get_fg_tile_info); - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; - uint32_t screen_update_cbasebal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); - required_device m_maincpu; - required_device m_gfxdecode; - required_device m_palette; - void cbasebal_map(address_map &map); - void cbasebal_portmap(address_map &map); - void decrypted_opcodes_map(address_map &map); -}; diff -Nru mame-0.242+dfsg.1/src/mame/includes/contra.h mame-0.243+dfsg.1/src/mame/includes/contra.h --- mame-0.242+dfsg.1/src/mame/includes/contra.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/contra.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,100 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Carlos A. Lozano, Phil Stroffolino -/************************************************************************* - - Contra / Gryzor - -*************************************************************************/ -#ifndef MAME_INCLUDES_CONTRA_H -#define MAME_INCLUDES_CONTRA_H - -#pragma once - -#include "video/k007121.h" -#include "machine/k007452.h" -#include "emupal.h" -#include "screen.h" -#include "tilemap.h" - -class contra_state : public driver_device -{ -public: - contra_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_fg_cram(*this, "fg_cram"), - m_fg_vram(*this, "fg_vram"), - m_tx_cram(*this, "tx_cram"), - m_tx_vram(*this, "tx_vram"), - m_spriteram(*this, "spriteram"), - m_spriteram_2(*this, "spriteram_2"), - m_bg_cram(*this, "bg_cram"), - m_bg_vram(*this, "bg_vram"), - m_audiocpu(*this, "audiocpu"), - m_k007121_1(*this, "k007121_1"), - m_k007121_2(*this, "k007121_2"), - m_k007452(*this, "k007452"), - m_maincpu(*this, "maincpu"), - m_gfxdecode(*this, "gfxdecode"), - m_screen(*this, "screen"), - m_palette(*this, "palette") - { } - - void contra(machine_config &config); - -private: - /* memory pointers */ - std::unique_ptr m_buffered_spriteram; - std::unique_ptr m_buffered_spriteram_2; - required_shared_ptr m_fg_cram; - required_shared_ptr m_fg_vram; - required_shared_ptr m_tx_cram; - required_shared_ptr m_tx_vram; - required_shared_ptr m_spriteram; - required_shared_ptr m_spriteram_2; - required_shared_ptr m_bg_cram; - required_shared_ptr m_bg_vram; - - /* video-related */ - tilemap_t *m_bg_tilemap = nullptr; - tilemap_t *m_fg_tilemap = nullptr; - tilemap_t *m_tx_tilemap = nullptr; - rectangle m_bg_clip{}; - rectangle m_fg_clip{}; - rectangle m_tx_clip{}; - - /* devices */ - required_device m_audiocpu; - required_device m_k007121_1; - required_device m_k007121_2; - required_device m_k007452; - void contra_bankswitch_w(uint8_t data); - void contra_sh_irqtrigger_w(uint8_t data); - void sirq_clear_w(uint8_t data); - void contra_coin_counter_w(uint8_t data); - void contra_fg_vram_w(offs_t offset, uint8_t data); - void contra_fg_cram_w(offs_t offset, uint8_t data); - void contra_bg_vram_w(offs_t offset, uint8_t data); - void contra_bg_cram_w(offs_t offset, uint8_t data); - void contra_text_vram_w(offs_t offset, uint8_t data); - void contra_text_cram_w(offs_t offset, uint8_t data); - void contra_K007121_ctrl_0_w(offs_t offset, uint8_t data); - void contra_K007121_ctrl_1_w(offs_t offset, uint8_t data); - TILE_GET_INFO_MEMBER(get_fg_tile_info); - TILE_GET_INFO_MEMBER(get_bg_tile_info); - TILE_GET_INFO_MEMBER(get_tx_tile_info); - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; - void contra_palette(palette_device &palette) const; - uint32_t screen_update_contra(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - INTERRUPT_GEN_MEMBER(contra_interrupt); - void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, int bank ); - required_device m_maincpu; - required_device m_gfxdecode; - required_device m_screen; - required_device m_palette; - void contra_map(address_map &map); - void sound_map(address_map &map); -}; - -#endif // MAME_INCLUDES_CONTRA_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/cps1.h mame-0.243+dfsg.1/src/mame/includes/cps1.h --- mame-0.242+dfsg.1/src/mame/includes/cps1.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/cps1.h 2022-04-29 05:37:26.000000000 +0000 @@ -51,54 +51,54 @@ // start and end are as passed by the game (shift adjusted to be all // in the same scale a 8x8 tiles): they don't necessarily match the // position in ROM. - int type; - int start; - int end; - int bank; + int type = 0; + int start = 0; + int end = 0; + int bank = 0; }; struct CPS1config { - const char *name; /* game driver name */ + const char *name = nullptr; /* game driver name */ /* Some games interrogate a couple of registers on bootup. */ /* These are CPS1 board B self test checks. They wander from game to */ /* game. */ - int cpsb_addr; /* CPS board B test register address */ - int cpsb_value; /* CPS board B test register expected value */ + int cpsb_addr = 0; /* CPS board B test register address */ + int cpsb_value = 0; /* CPS board B test register expected value */ /* some games use as a protection check the ability to do 16-bit multiplies */ /* with a 32-bit result, by writing the factors to two ports and reading the */ /* result from two other ports. */ /* It looks like this feature was introduced with 3wonders (CPSB ID = 08xx) */ - int mult_factor1; - int mult_factor2; - int mult_result_lo; - int mult_result_hi; + int mult_factor1 = 0; + int mult_factor2 = 0; + int mult_result_lo = 0; + int mult_result_hi = 0; /* unknown registers which might be related to the multiply protection */ - int unknown1; - int unknown2; - int unknown3; - - int layer_control; - int priority[4]; - int palette_control; + int unknown1 = 0; + int unknown2 = 0; + int unknown3 = 0; + + int layer_control = 0; + int priority[4]{}; + int palette_control = 0; /* ideally, the layer enable masks should consist of only one bit, */ /* but in many cases it is unknown which bit is which. */ - int layer_enable_mask[5]; + int layer_enable_mask[5]{}; /* these depend on the B-board model and PAL */ - int bank_sizes[4]; + int bank_sizes[4]{}; const struct gfx_range *bank_mapper; /* some C-boards have additional I/O for extra buttons/extra players */ - int in2_addr; - int in3_addr; - int out2_addr; + int in2_addr = 0; + int in3_addr = 0; + int out2_addr = 0; - int bootleg_kludge; + int bootleg_kludge = 0; }; @@ -237,40 +237,40 @@ void varthb2_map(address_map &map); // game-specific - uint16_t sf2ceblp_prot; - uint16_t pang3b4_prot; + uint16_t m_sf2ceblp_prot = 0; + uint16_t m_pang3b4_prot = 0; /* video-related */ - tilemap_t *m_bg_tilemap[3]; - int m_scanline1; - int m_scanline2; - int m_scancalls; - - int m_scroll1x; - int m_scroll1y; - int m_scroll2x; - int m_scroll2y; - int m_scroll3x; - int m_scroll3y; - - int m_stars_enabled[2]; /* Layer enabled [Y/N] */ - int m_stars1x; - int m_stars1y; - int m_stars2x; - int m_stars2y; - int m_last_sprite_offset; /* Offset of the last sprite */ + tilemap_t *m_bg_tilemap[3]{}; + int m_scanline1 = 0; + int m_scanline2 = 0; + int m_scancalls = 0; + + int m_scroll1x = 0; + int m_scroll1y = 0; + int m_scroll2x = 0; + int m_scroll2y = 0; + int m_scroll3x = 0; + int m_scroll3y = 0; + + int m_stars_enabled[2]{}; /* Layer enabled [Y/N] */ + int m_stars1x = 0; + int m_stars1y = 0; + int m_stars2x = 0; + int m_stars2y = 0; + int m_last_sprite_offset = 0; /* Offset of the last sprite */ bitmap_ind16 m_dummy_bitmap; /* video config (never changed after video_start) */ const struct CPS1config *m_game_config; - int m_scroll_size; - int m_obj_size; - int m_other_size; - int m_palette_align; - int m_palette_size; - int m_stars_rom_size; - uint8_t m_empty_tile[32*32]; + int m_scroll_size = 0; + int m_obj_size = 0; + int m_other_size = 0; + int m_palette_align = 0; + int m_palette_size = 0; + int m_stars_rom_size = 0; + uint8_t m_empty_tile[32*32]{}; /* video/cps1.cpp */ inline uint16_t *cps1_base( int offset, int boundary ); @@ -289,16 +289,16 @@ required_shared_ptr m_gfxram; required_shared_ptr m_cps_a_regs; required_shared_ptr m_cps_b_regs; - uint16_t * m_scroll1; - uint16_t * m_scroll2; - uint16_t * m_scroll3; - uint16_t * m_obj; - uint16_t * m_other; + uint16_t * m_scroll1 = nullptr; + uint16_t * m_scroll2 = nullptr; + uint16_t * m_scroll3 = nullptr; + uint16_t * m_obj = nullptr; + uint16_t * m_other = nullptr; std::unique_ptr m_buffered_obj; optional_shared_ptr m_qsound_sharedram1; optional_shared_ptr m_qsound_sharedram2; std::unique_ptr m_decrypt_kabuki; - int m_cps_version; + int m_cps_version = 0; /* devices */ required_device m_maincpu; @@ -399,22 +399,22 @@ std::unique_ptr m_gigaman2_dummyqsound_ram; /* video-related */ - int m_cps2_last_sprite_offset; /* Offset of the last sprite */ - int m_pri_ctrl; /* Sprite layer priorities */ - int m_objram_bank; - int m_cps2_obj_size; + int m_cps2_last_sprite_offset = 0; /* Offset of the last sprite */ + int m_pri_ctrl = 0; /* Sprite layer priorities */ + int m_objram_bank = 0; + int m_cps2_obj_size = 0; /* misc */ - int m_readpaddle; // pzloop2 - int m_cps2networkpresent; - int m_cps2digitalvolumelevel; - int m_cps2disabledigitalvolume; - emu_timer *m_digital_volume_timer; - int m_cps2_dial_type; - int m_ecofghtr_dial_direction0; - int m_ecofghtr_dial_direction1; - int m_ecofghtr_dial_last0; - int m_ecofghtr_dial_last1; + int m_readpaddle = 0; // pzloop2 + int m_cps2networkpresent = 0; + int m_cps2digitalvolumelevel = 0; + int m_cps2disabledigitalvolume = 0; + emu_timer *m_digital_volume_timer = nullptr; + int m_cps2_dial_type = 0; + int m_ecofghtr_dial_direction0 = 0; + int m_ecofghtr_dial_direction1 = 0; + int m_ecofghtr_dial_last0 = 0; + int m_ecofghtr_dial_last1 = 0; }; diff -Nru mame-0.242+dfsg.1/src/mame/includes/cps3.h mame-0.243+dfsg.1/src/mame/includes/cps3.h --- mame-0.242+dfsg.1/src/mame/includes/cps3.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/cps3.h 2022-04-29 05:37:26.000000000 +0000 @@ -104,41 +104,41 @@ optional_memory_region m_user5_region; private: - u32 m_cram_gfxflash_bank; + u32 m_cram_gfxflash_bank = 0; std::unique_ptr m_char_ram; std::unique_ptr m_eeprom; std::unique_ptr m_ss_ram; std::unique_ptr m_spritelist; - u32 m_ppu_gscroll_buff[0x20/4]; - s16 m_ss_hscroll; - s16 m_ss_vscroll; - u8 m_ss_pal_base; - u32 m_screenwidth; + u32 m_ppu_gscroll_buff[0x20/4]{}; + s16 m_ss_hscroll = 0; + s16 m_ss_vscroll = 0; + u8 m_ss_pal_base = 0; + u32 m_screenwidth = 0; std::unique_ptr m_mame_colours; bitmap_rgb32 m_renderbuffer_bitmap; rectangle m_renderbuffer_clip; - u8* m_user4; + u8* m_user4 = nullptr; std::unique_ptr m_user4_allocated; - u32 m_key1; - u32 m_key2; - int m_altEncryption; - u16 m_dma_status; - u16 m_spritelist_dma; - u32 m_cram_bank; - u16 m_current_eeprom_read; - u32 m_paldma_source; - u32 m_paldma_realsource; - u32 m_paldma_dest; - u32 m_paldma_fade; - u32 m_paldma_other2; - u32 m_paldma_length; - u32 m_chardma_source; - u32 m_chardma_other; - int m_rle_length; - int m_last_normal_byte; - u16 m_lastb; - u16 m_lastb2; - u8* m_user5; + u32 m_key1 = 0; + u32 m_key2 = 0; + int m_altEncryption = 0; + u16 m_dma_status = 0; + u16 m_spritelist_dma = 0; + u32 m_cram_bank = 0; + u16 m_current_eeprom_read = 0; + u32 m_paldma_source = 0; + u32 m_paldma_realsource = 0; + u32 m_paldma_dest = 0; + u32 m_paldma_fade = 0; + u32 m_paldma_other2 = 0; + u32 m_paldma_length = 0; + u32 m_chardma_source = 0; + u32 m_chardma_other = 0; + int m_rle_length = 0; + int m_last_normal_byte = 0; + u16 m_lastb = 0; + u16 m_lastb2 = 0; + u8* m_user5 = nullptr; std::unique_ptr m_user5_allocated; u8 ssram_r(offs_t offset); diff -Nru mame-0.242+dfsg.1/src/mame/includes/crgolf.h mame-0.243+dfsg.1/src/mame/includes/crgolf.h --- mame-0.242+dfsg.1/src/mame/includes/crgolf.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/crgolf.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,95 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Aaron Giles -/************************************************************************* - - Kitco Crowns Golf hardware - -**************************************************************************/ -#ifndef MAME_INCLUDES_CRGOLF_H -#define MAME_INCLUDES_CRGOLF_H - -#pragma once - -#include "sound/msm5205.h" -#include "machine/bankdev.h" -#include "emupal.h" - -#define MASTER_CLOCK XTAL(18'432'000) - - -class crgolf_state : public driver_device -{ -public: - crgolf_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - - m_videoram_a(*this, "vrama"), - m_videoram_b(*this, "vramb"), - - m_vrambank(*this, "vrambank"), - m_maincpu(*this, "maincpu"), - m_audiocpu(*this, "audiocpu"), - m_msm(*this, "msm"), - m_palette(*this, "palette") - { } - - void crgolfhi(machine_config &config); - void crgolf(machine_config &config); - void crgolf_video(machine_config &config); - void mastrglf(machine_config &config); - void init_crgolfhi(); - -private: - - /* memory pointers */ - required_shared_ptr m_videoram_a; - required_shared_ptr m_videoram_b; - - bool m_color_select = false; - bool m_screen_flip = false; - bool m_screena_enable = false; - bool m_screenb_enable = false; - - /* misc */ - uint8_t m_port_select = 0U; - uint16_t m_sample_offset = 0U; - uint8_t m_sample_count = 0U; - - /* devices */ - required_device m_vrambank; - required_device m_maincpu; - required_device m_audiocpu; - optional_device m_msm; - required_device m_palette; - void rom_bank_select_w(uint8_t data); - uint8_t switch_input_r(); - uint8_t analog_input_r(); - void switch_input_select_w(uint8_t data); - void unknown_w(uint8_t data); - DECLARE_WRITE_LINE_MEMBER(color_select_w); - DECLARE_WRITE_LINE_MEMBER(screen_flip_w); - DECLARE_WRITE_LINE_MEMBER(screen_select_w); - DECLARE_WRITE_LINE_MEMBER(screena_enable_w); - DECLARE_WRITE_LINE_MEMBER(screenb_enable_w); - void crgolfhi_sample_w(offs_t offset, uint8_t data); - uint8_t unk_sub_02_r(); - uint8_t unk_sub_05_r(); - uint8_t unk_sub_07_r(); - void unk_sub_0c_w(uint8_t data); - virtual void machine_start() override; - virtual void machine_reset() override; - void crgolf_palette(palette_device &palette) const; - void mastrglf_palette(palette_device &palette) const; - uint32_t screen_update_crgolf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void get_pens( pen_t *pens ); - DECLARE_WRITE_LINE_MEMBER(vck_callback); - void main_map(address_map &map); - void mastrglf_io(address_map &map); - void mastrglf_map(address_map &map); - void mastrglf_subio(address_map &map); - void mastrglf_submap(address_map &map); - void sound_map(address_map &map); - void vrambank_map(address_map &map); -}; - -#endif // MAME_INCLUDES_CRGOLF_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/cxgbase.h mame-0.243+dfsg.1/src/mame/includes/cxgbase.h --- mame-0.242+dfsg.1/src/mame/includes/cxgbase.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/cxgbase.h 2022-04-29 05:37:26.000000000 +0000 @@ -41,9 +41,9 @@ output_finder<0x20> m_out_digit; // misc common - u16 m_inp_mux; // multiplexed keypad mask - u16 m_led_select; - u16 m_led_data; + u16 m_inp_mux = 0; // multiplexed keypad mask + u16 m_led_select = 0; + u16 m_led_data = 0; u16 read_inputs(int columns); @@ -56,9 +56,9 @@ int m_display_maxy; // display matrix number of rows int m_display_maxx; // display matrix number of columns (max 31 for now) - u32 m_display_state[0x20]; // display matrix rows data (last bit is used for always-on) - u16 m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments - u8 m_display_decay[0x20][0x20]; // (internal use) + u32 m_display_state[0x20]{}; // display matrix rows data (last bit is used for always-on) + u16 m_display_segmask[0x20]{}; // if not 0, display matrix row is a digit, mask indicates connected segments + u8 m_display_decay[0x20][0x20]{}; // (internal use) TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick); void display_update(); diff -Nru mame-0.242+dfsg.1/src/mame/includes/darius.h mame-0.243+dfsg.1/src/mame/includes/darius.h --- mame-0.242+dfsg.1/src/mame/includes/darius.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/darius.h 2022-04-29 05:37:26.000000000 +0000 @@ -58,16 +58,16 @@ required_memory_bank m_audiobank; /* video-related */ - tilemap_t *m_fg_tilemap; + tilemap_t *m_fg_tilemap = nullptr; /* misc */ - u16 m_cpua_ctrl; - u16 m_coin_word; - u8 m_adpcm_command; - u8 m_nmi_enable; - u32 m_def_vol[0x10]; - u8 m_vol[VOL_MAX]; - u8 m_pan[PAN_MAX]; + u16 m_cpua_ctrl = 0; + u16 m_coin_word = 0; + u8 m_adpcm_command = 0; + u8 m_nmi_enable = 0; + u32 m_def_vol[0x10]{}; + u8 m_vol[VOL_MAX]{}; + u8 m_pan[PAN_MAX]{}; /* devices */ required_device m_maincpu; diff -Nru mame-0.242+dfsg.1/src/mame/includes/dbz.h mame-0.243+dfsg.1/src/mame/includes/dbz.h --- mame-0.242+dfsg.1/src/mame/includes/dbz.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/dbz.h 2022-04-29 05:37:26.000000000 +0000 @@ -56,14 +56,14 @@ required_shared_ptr m_bg2_videoram; /* video-related */ - tilemap_t *m_bg1_tilemap; - tilemap_t *m_bg2_tilemap; - int m_layer_colorbase[6]; - int m_layerpri[5]; - int m_sprite_colorbase; + tilemap_t *m_bg1_tilemap = nullptr; + tilemap_t *m_bg2_tilemap = nullptr; + int m_layer_colorbase[6]{}; + int m_layerpri[5]{}; + int m_sprite_colorbase = 0; /* misc */ - int m_control; + int m_control = 0; /* devices */ required_device m_maincpu; diff -Nru mame-0.242+dfsg.1/src/mame/includes/dcheese.h mame-0.243+dfsg.1/src/mame/includes/dcheese.h --- mame-0.242+dfsg.1/src/mame/includes/dcheese.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/dcheese.h 2022-04-29 05:37:26.000000000 +0000 @@ -56,19 +56,19 @@ required_ioport m_2a000e_io; /* video-related */ - u16 m_blitter_color[2]; - u16 m_blitter_xparam[16]; - u16 m_blitter_yparam[16]; - u16 m_blitter_vidparam[32]; + u16 m_blitter_color[2]{}; + u16 m_blitter_xparam[16]{}; + u16 m_blitter_yparam[16]{}; + u16 m_blitter_vidparam[32]{}; std::unique_ptr m_dstbitmap; - emu_timer *m_blitter_timer; - emu_timer *m_signal_irq_timer; + emu_timer *m_blitter_timer = nullptr; + emu_timer *m_signal_irq_timer = nullptr; /* misc */ - u8 m_irq_state[5]; - u8 m_sound_control; - u8 m_sound_msb_latch; + u8 m_irq_state[5]{}; + u8 m_sound_control = 0; + u8 m_sound_msb_latch = 0; /* devices */ required_device m_maincpu; diff -Nru mame-0.242+dfsg.1/src/mame/includes/ddragon.h mame-0.243+dfsg.1/src/mame/includes/ddragon.h --- mame-0.242+dfsg.1/src/mame/includes/ddragon.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/ddragon.h 2022-04-29 05:37:26.000000000 +0000 @@ -72,20 +72,20 @@ optional_memory_bank m_mainbank; /* video-related */ - tilemap_t *m_fg_tilemap; - tilemap_t *m_bg_tilemap; - uint8_t m_technos_video_hw; - uint8_t m_scrollx_hi; - uint8_t m_scrolly_hi; + tilemap_t *m_fg_tilemap = nullptr; + tilemap_t *m_bg_tilemap = nullptr; + uint8_t m_technos_video_hw = 0; + uint8_t m_scrollx_hi = 0; + uint8_t m_scrolly_hi = 0; /* misc */ - uint8_t m_ddragon_sub_port; - uint8_t m_sprite_irq; - uint8_t m_adpcm_sound_irq; - uint32_t m_adpcm_pos[2]; - uint32_t m_adpcm_end[2]; - bool m_adpcm_idle[2]; - int m_adpcm_data[2]; + uint8_t m_ddragon_sub_port = 0; + uint8_t m_sprite_irq = 0; + uint8_t m_adpcm_sound_irq = 0; + uint32_t m_adpcm_pos[2]{}; + uint32_t m_adpcm_end[2]{}; + bool m_adpcm_idle[2]{}; + int m_adpcm_data[2]{}; void ddragon_bgvideoram_w(offs_t offset, uint8_t data); void ddragon_fgvideoram_w(offs_t offset, uint8_t data); @@ -180,7 +180,7 @@ required_device m_darktowr_bank; required_shared_ptr m_rambase; - uint8_t m_mcu_port_a_out; + uint8_t m_mcu_port_a_out = 0; }; diff -Nru mame-0.242+dfsg.1/src/mame/includes/ddribble.h mame-0.243+dfsg.1/src/mame/includes/ddribble.h --- mame-0.242+dfsg.1/src/mame/includes/ddribble.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/ddribble.h 2022-04-29 05:37:26.000000000 +0000 @@ -48,13 +48,13 @@ required_memory_bank m_vlmbank; // video-related - tilemap_t *m_fg_tilemap; - tilemap_t *m_bg_tilemap; - uint8_t m_vregs[2][5]; - uint8_t m_charbank[2]; + tilemap_t *m_fg_tilemap = nullptr; + tilemap_t *m_bg_tilemap = nullptr; + uint8_t m_vregs[2][5]{}; + uint8_t m_charbank[2]{}; // misc - uint8_t m_int_enable[2]; + uint8_t m_int_enable[2]{}; // devices required_device m_maincpu; diff -Nru mame-0.242+dfsg.1/src/mame/includes/dec8.h mame-0.243+dfsg.1/src/mame/includes/dec8.h --- mame-0.242+dfsg.1/src/mame/includes/dec8.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/dec8.h 2022-04-29 05:37:26.000000000 +0000 @@ -105,11 +105,11 @@ required_memory_bank m_mainbank; // MCU communication - uint8_t m_i8751_p2; - int m_i8751_port0; - int m_i8751_port1; - int m_i8751_return; - int m_i8751_value; + uint8_t m_i8751_p2 = 0; + int m_i8751_port0 = 0; + int m_i8751_port1 = 0; + int m_i8751_return = 0; + int m_i8751_value = 0; private: optional_device m_nmigate; @@ -120,37 +120,37 @@ required_shared_ptr m_videoram; optional_shared_ptr m_bg_data; - uint8_t * m_pf1_data; - uint8_t * m_row; + uint8_t * m_pf1_data = nullptr; + uint8_t * m_row = nullptr; std::unique_ptr m_buffered_spriteram16; // for the mxc06 sprite chip emulation (oscar, cobra) /* video-related */ - tilemap_t *m_bg_tilemap; - tilemap_t *m_pf1_tilemap; - tilemap_t *m_fix_tilemap; - //int m_scroll1[4]; - int m_scroll2[4]; - int m_bg_control[0x20]; - int m_pf1_control[0x20]; - int m_game_uses_priority; + tilemap_t *m_bg_tilemap = nullptr; + tilemap_t *m_pf1_tilemap = nullptr; + tilemap_t *m_fix_tilemap = nullptr; + //int m_scroll1[4]{}; + int m_scroll2[4]{}; + int m_bg_control[0x20]{}; + int m_pf1_control[0x20]{}; + int m_game_uses_priority = 0; /* misc */ - bool m_secclr; - bool m_nmi_enable; - int m_coinage_id; - int m_coin1; - int m_coin2; - int m_need1; - int m_need2; - int m_cred1; - int m_cred2; - int m_credits; - int m_latch; - bool m_coin_state; - int m_snd; + bool m_secclr = false; + bool m_nmi_enable = false; + int m_coinage_id = 0; + int m_coin1 = 0; + int m_coin2 = 0; + int m_need1 = 0; + int m_need2 = 0; + int m_cred1 = 0; + int m_cred2 = 0; + int m_credits = 0; + int m_latch = 0; + bool m_coin_state = false; + int m_snd = 0; - emu_timer *m_i8751_timer; - emu_timer *m_m6502_timer; + emu_timer *m_i8751_timer = nullptr; + emu_timer *m_m6502_timer = nullptr; void i8751_reset_w(uint8_t data); uint8_t gondo_player_1_r(offs_t offset); @@ -253,8 +253,8 @@ required_device m_msm; required_memory_bank m_soundbank; - int m_toggle; - int m_msm5205next; + int m_toggle = 0; + int m_msm5205next = 0; }; #endif // MAME_INCLUDES_DEC8_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/deniam.h mame-0.243+dfsg.1/src/mame/includes/deniam.h --- mame-0.242+dfsg.1/src/mame/includes/deniam.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/deniam.h 2022-04-29 05:37:26.000000000 +0000 @@ -44,23 +44,23 @@ required_memory_region m_spritegfx; /* video-related */ - tilemap_t *m_fg_tilemap; - tilemap_t *m_bg_tilemap; - tilemap_t *m_tx_tilemap; - int m_display_enable; - int m_bg_scrollx_offs; - int m_bg_scrolly_offs; - int m_fg_scrollx_offs; - int m_fg_scrolly_offs; - int m_bg_scrollx_reg; - int m_bg_scrolly_reg; - int m_bg_page_reg; - int m_fg_scrollx_reg; - int m_fg_scrolly_reg; - int m_fg_page_reg; - int m_bg_page[4]; - int m_fg_page[4]; - u16 m_coinctrl; + tilemap_t *m_fg_tilemap = nullptr; + tilemap_t *m_bg_tilemap = nullptr; + tilemap_t *m_tx_tilemap = nullptr; + int m_display_enable = 0; + int m_bg_scrollx_offs = 0; + int m_bg_scrolly_offs = 0; + int m_fg_scrollx_offs = 0; + int m_fg_scrolly_offs = 0; + int m_bg_scrollx_reg = 0; + int m_bg_scrolly_reg = 0; + int m_bg_page_reg = 0; + int m_fg_scrollx_reg = 0; + int m_fg_scrolly_reg = 0; + int m_fg_page_reg = 0; + int m_bg_page[4]{}; + int m_fg_page[4]{}; + u16 m_coinctrl = 0; /* devices */ void irq_ack_w(u16 data); diff -Nru mame-0.242+dfsg.1/src/mame/includes/divebomb.h mame-0.243+dfsg.1/src/mame/includes/divebomb.h --- mame-0.242+dfsg.1/src/mame/includes/divebomb.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/divebomb.h 2022-04-29 05:37:26.000000000 +0000 @@ -62,10 +62,10 @@ required_device m_spr2fg_latch; required_device m_roz2fg_latch; - tilemap_t *m_fg_tilemap; + tilemap_t *m_fg_tilemap = nullptr; - uint8_t m_roz_pal; - bool m_roz_enable[2]; + uint8_t m_roz_pal = 0; + bool m_roz_enable[2]{}; void divebomb_palette(palette_device &palette) const; diff -Nru mame-0.242+dfsg.1/src/mame/includes/djboy.h mame-0.243+dfsg.1/src/mame/includes/djboy.h --- mame-0.242+dfsg.1/src/mame/includes/djboy.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/djboy.h 2022-04-29 05:37:26.000000000 +0000 @@ -63,16 +63,16 @@ required_ioport_array<2> m_port_dsw; /* video-related */ - tilemap_t *m_background; - uint8_t m_videoreg; - uint8_t m_scrollx; - uint8_t m_scrolly; + tilemap_t *m_background = nullptr; + uint8_t m_videoreg = 0; + uint8_t m_scrollx = 0; + uint8_t m_scrolly = 0; /* Kaneko BEAST state */ - uint8_t m_beast_p0; - uint8_t m_beast_p1; - uint8_t m_beast_p2; - uint8_t m_beast_p3; + uint8_t m_beast_p0 = 0; + uint8_t m_beast_p1 = 0; + uint8_t m_beast_p2 = 0; + uint8_t m_beast_p3 = 0; /* devices */ required_device m_mastercpu; diff -Nru mame-0.242+dfsg.1/src/mame/includes/electron.h mame-0.243+dfsg.1/src/mame/includes/electron.h --- mame-0.242+dfsg.1/src/mame/includes/electron.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/electron.h 2022-04-29 05:37:26.000000000 +0000 @@ -70,10 +70,10 @@ TIMER_SCANLINE_INTERRUPT }; - emu_timer *m_tape_timer; - int m_map4[256]; - int m_map16[256]; - emu_timer *m_scanline_timer; + emu_timer *m_tape_timer = nullptr; + int m_map4[256]{}; + int m_map16[256]{}; + emu_timer *m_scanline_timer = nullptr; uint8_t electron64_fetch_r(offs_t offset); uint8_t electron_mem_r(offs_t offset); void electron_mem_w(offs_t offset, uint8_t data); @@ -127,33 +127,33 @@ /* ULA context */ struct ULA { - uint8_t interrupt_status; - uint8_t interrupt_control; - uint8_t rompage; - uint16_t screen_start; - uint16_t screen_base; - uint16_t screen_size; - uint16_t screen_addr; - int screen_dispend; - int current_pal[16]; - int communication_mode; - int screen_mode; - int cassette_motor_mode; - int capslock_mode; + uint8_t interrupt_status = 0; + uint8_t interrupt_control = 0; + uint8_t rompage = 0; + uint16_t screen_start = 0; + uint16_t screen_base = 0; + uint16_t screen_size = 0; + uint16_t screen_addr = 0; + int screen_dispend = 0; + int current_pal[16]{}; + int communication_mode = 0; + int screen_mode = 0; + int cassette_motor_mode = 0; + int capslock_mode = 0; /* tape reading related */ - uint32_t tape_value; - int tape_steps; - int bit_count; - int high_tone_set; - int start_bit; - int stop_bit; - int tape_running; - uint8_t tape_byte; + uint32_t tape_value = 0; + int tape_steps = 0; + int bit_count = 0; + int high_tone_set = 0; + int start_bit = 0; + int stop_bit = 0; + int tape_running = 0; + uint8_t tape_byte = 0; }; ULA m_ula; - bool m_mrb_mapped; - bool m_vdu_drivers; + bool m_mrb_mapped = false; + bool m_vdu_drivers = false; }; @@ -186,7 +186,7 @@ required_device_array m_romi; required_ioport m_rompages; - uint8_t m_sp64_bank; + uint8_t m_sp64_bank = 0; std::unique_ptr m_sp64_ram; image_init_result load_rom(device_image_interface &image, generic_slot_device *slot); diff -Nru mame-0.242+dfsg.1/src/mame/includes/elf.h mame-0.243+dfsg.1/src/mame/includes/elf.h --- mame-0.242+dfsg.1/src/mame/includes/elf.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/elf.h 2022-04-29 05:37:26.000000000 +0000 @@ -75,7 +75,7 @@ output_finder<> m_led; // display state - uint8_t m_data; + uint8_t m_data = 0; }; #endif diff -Nru mame-0.242+dfsg.1/src/mame/includes/eolith.h mame-0.243+dfsg.1/src/mame/includes/eolith.h --- mame-0.242+dfsg.1/src/mame/includes/eolith.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/eolith.h 2022-04-29 05:37:26.000000000 +0000 @@ -89,14 +89,14 @@ optional_memory_bank m_sndbank; - int m_coin_counter_bit; + int m_coin_counter_bit = 0; std::unique_ptr m_vram; - int m_buffer; + int m_buffer = 0; // speedups - see machine/eolithsp.c - int m_speedup_address; - int m_speedup_address2; - int m_speedup_resume_scanline; - int m_speedup_vblank; - int m_speedup_scanline; + int m_speedup_address = 0; + int m_speedup_address2 = 0; + int m_speedup_resume_scanline = 0; + int m_speedup_vblank = 0; + int m_speedup_scanline = 0; }; diff -Nru mame-0.242+dfsg.1/src/mame/includes/epos.h mame-0.243+dfsg.1/src/mame/includes/epos.h --- mame-0.242+dfsg.1/src/mame/includes/epos.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/epos.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,70 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Zsolt Vasvari -/************************************************************************* - - Epos games - -**************************************************************************/ -#ifndef MAME_INCLUDES_EPOS_H -#define MAME_INCLUDES_EPOS_H - -#pragma once - -#include "emupal.h" - -class epos_state : public driver_device -{ -public: - epos_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_videoram(*this, "videoram"), - m_inputs(*this, { "INPUTS", "INPUTS2" }), - m_maincpu(*this, "maincpu"), - m_palette(*this, "palette"), - m_leds(*this, "led%u", 0U) - { } - - void epos(machine_config &config); - void dealer(machine_config &config); - - void init_dealer(); - -protected: - virtual void machine_start() override { m_leds.resolve(); } - virtual void machine_reset() override; - -private: - void dealer_decrypt_rom(offs_t offset, uint8_t data); - void port_1_w(uint8_t data); - uint8_t i8255_porta_r(); - void i8255_portc_w(uint8_t data); - uint8_t ay_porta_mpx_r(); - void flip_screen_w(uint8_t data); - void dealer_pal_w(offs_t offset, uint8_t data); - DECLARE_MACHINE_START(epos); - DECLARE_MACHINE_START(dealer); - void epos_palette(palette_device &palette) const; - uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - static void set_pal_color(palette_device &palette, uint8_t offset, uint8_t data); // TODO: convert to an RGB converter and set_format - void dealer_io_map(address_map &map); - void dealer_map(address_map &map); - void epos_io_map(address_map &map); - void epos_map(address_map &map); - - /* memory pointers */ - required_shared_ptr m_videoram; - optional_ioport_array<2> m_inputs; - - /* video-related */ - uint8_t m_palette_bank = 0U; - - /* misc */ - int m_counter = 0; - int m_input_multiplex = 0; - bool m_ay_porta_multiplex = false; - required_device m_maincpu; - required_device m_palette; - output_finder<2> m_leds; -}; - -#endif // MAME_INCLUDES_EPOS_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/esd16.h mame-0.243+dfsg.1/src/mame/includes/esd16.h --- mame-0.242+dfsg.1/src/mame/includes/esd16.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/esd16.h 2022-04-29 05:37:26.000000000 +0000 @@ -64,9 +64,9 @@ optional_ioport m_io_eepromout; /* video-related */ - tilemap_t *m_tilemap_16x16[2]; - tilemap_t *m_tilemap[2]; - int m_tilemap_color[2]; + tilemap_t *m_tilemap_16x16[2]{}; + tilemap_t *m_tilemap[2]{}; + int m_tilemap_color[2]{}; /* devices */ required_device m_maincpu; diff -Nru mame-0.242+dfsg.1/src/mame/includes/esripsys.h mame-0.243+dfsg.1/src/mame/includes/esripsys.h --- mame-0.242+dfsg.1/src/mame/includes/esripsys.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/esripsys.h 2022-04-29 05:37:26.000000000 +0000 @@ -69,7 +69,7 @@ int m_io_firq_status = 0; uint8_t m_cmos_ram_a2_0 = 0U; uint8_t m_cmos_ram_a10_3 = 0U; - std::unique_ptr m_cmos_ram{}; + std::unique_ptr m_cmos_ram; uint8_t m_u56a = 0U; uint8_t m_u56b = 0U; uint8_t m_g_to_s_latch1 = 0U; @@ -78,8 +78,8 @@ uint8_t m_s_to_g_latch2 = 0U; uint8_t m_dac_msb = 0U; uint8_t m_tms_data = 0U; - std::unique_ptr m_fdt_a{}; - std::unique_ptr m_fdt_b{}; + std::unique_ptr m_fdt_a; + std::unique_ptr m_fdt_b; struct line_buffer_t { @@ -98,8 +98,8 @@ int m_video_firq_en = 0; emu_timer *m_hblank_end_timer = nullptr; emu_timer *m_hblank_start_timer = nullptr; - std::unique_ptr m_fig_scale_table{}; - std::unique_ptr m_scale_table{}; + std::unique_ptr m_fig_scale_table; + std::unique_ptr m_scale_table; int m_video_firq = 0; uint8_t m_bg_intensity = 0; void uart_w(offs_t offset, uint8_t data); diff -Nru mame-0.242+dfsg.1/src/mame/includes/exzisus.h mame-0.243+dfsg.1/src/mame/includes/exzisus.h --- mame-0.242+dfsg.1/src/mame/includes/exzisus.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/exzisus.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,54 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Yochizo -#ifndef MAME_INCLUDES_EXZIUS_H -#define MAME_INCLUDES_EXZIUS_H - -#pragma once - -#include "emupal.h" - -class exzisus_state : public driver_device -{ -public: - exzisus_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_cpuc(*this, "cpuc"), - m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette"), - m_objectram1(*this, "objectram1"), - m_videoram1(*this, "videoram1"), - m_sharedram_ac(*this, "sharedram_ac"), - m_sharedram_ab(*this, "sharedram_ab"), - m_objectram0(*this, "objectram0"), - m_videoram0(*this, "videoram0") - { } - - void exzisus(machine_config &config); - -private: - required_device m_cpuc; - required_device m_gfxdecode; - required_device m_palette; - - required_shared_ptr m_objectram1; - required_shared_ptr m_videoram1; - required_shared_ptr m_sharedram_ac; - required_shared_ptr m_sharedram_ab; - required_shared_ptr m_objectram0; - required_shared_ptr m_videoram0; - - void cpua_bankswitch_w(uint8_t data); - void cpub_bankswitch_w(uint8_t data); - void coincounter_w(uint8_t data); - void cpub_reset_w(uint8_t data); - - virtual void machine_start() override; - - uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void cpua_map(address_map &map); - void cpub_map(address_map &map); - void cpuc_map(address_map &map); - void sound_map(address_map &map); -}; - -#endif // MAME_INCLUDES_EXZIUS_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/fantland.h mame-0.243+dfsg.1/src/mame/includes/fantland.h --- mame-0.242+dfsg.1/src/mame/includes/fantland.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/fantland.h 2022-04-29 05:37:26.000000000 +0000 @@ -34,7 +34,7 @@ protected: /* misc */ - uint8_t m_nmi_enable; + uint8_t m_nmi_enable = 0; /* devices */ required_device m_maincpu; @@ -88,13 +88,13 @@ private: /* misc */ - int m_old_x[2]; - int m_old_y[2]; - int m_old_f[2]; - uint8_t m_input_ret[2]; - int m_adpcm_playing[4]; - int m_adpcm_addr[2][4]; - int m_adpcm_nibble[4]; + int m_old_x[2]{}; + int m_old_y[2]{}; + int m_old_f[2]{}; + uint8_t m_input_ret[2]{}; + int m_adpcm_playing[4]{}; + int m_adpcm_addr[2][4]{}; + int m_adpcm_nibble[4]{}; /* devices */ required_device_array m_msm; diff -Nru mame-0.242+dfsg.1/src/mame/includes/fcrash.h mame-0.243+dfsg.1/src/mame/includes/fcrash.h --- mame-0.242+dfsg.1/src/mame/includes/fcrash.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/fcrash.h 2022-04-29 05:37:26.000000000 +0000 @@ -92,20 +92,20 @@ void sgyxz_sound_map(address_map &map); /* sound hw */ - int m_sample_buffer1; - int m_sample_buffer2; - int m_sample_select1; - int m_sample_select2; + int m_sample_buffer1 = 0; + int m_sample_buffer2 = 0; + int m_sample_select1 = 0; + int m_sample_select2 = 0; /* video config */ - uint8_t m_layer_enable_reg; - uint8_t m_layer_mask_reg[4]; - int m_layer_scroll1x_offset; - int m_layer_scroll2x_offset; - int m_layer_scroll3x_offset; - int m_sprite_base; - int m_sprite_list_end_marker; - int m_sprite_x_offset; + uint8_t m_layer_enable_reg = 0; + uint8_t m_layer_mask_reg[4] = {}; + int m_layer_scroll1x_offset = 0; + int m_layer_scroll2x_offset = 0; + int m_layer_scroll3x_offset = 0; + int m_sprite_base = 0; + int m_sprite_list_end_marker = 0; + int m_sprite_x_offset = 0; std::unique_ptr m_bootleg_sprite_ram; std::unique_ptr m_bootleg_work_ram; diff -Nru mame-0.242+dfsg.1/src/mame/includes/firetrap.h mame-0.243+dfsg.1/src/mame/includes/firetrap.h --- mame-0.242+dfsg.1/src/mame/includes/firetrap.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/firetrap.h 2022-04-29 05:37:26.000000000 +0000 @@ -54,23 +54,23 @@ required_shared_ptr m_spriteram; /* video-related */ - tilemap_t *m_fg_tilemap; - tilemap_t *m_bg1_tilemap; - tilemap_t *m_bg2_tilemap; - uint8_t m_scroll1_x[2]; - uint8_t m_scroll1_y[2]; - uint8_t m_scroll2_x[2]; - uint8_t m_scroll2_y[2]; + tilemap_t *m_fg_tilemap = nullptr; + tilemap_t *m_bg1_tilemap = nullptr; + tilemap_t *m_bg2_tilemap = nullptr; + uint8_t m_scroll1_x[2]{}; + uint8_t m_scroll1_y[2]{}; + uint8_t m_scroll2_x[2]{}; + uint8_t m_scroll2_y[2]{}; /* misc */ - int m_sound_irq_enable; - int m_nmi_enable; - int m_adpcm_toggle; - int m_coin_command_pending; + int m_sound_irq_enable = 0; + int m_nmi_enable = 0; + int m_adpcm_toggle = 0; + int m_coin_command_pending = 0; - uint8_t m_mcu_p3; - uint8_t m_maincpu_to_mcu; - uint8_t m_mcu_to_maincpu; + uint8_t m_mcu_p3 = 0; + uint8_t m_maincpu_to_mcu = 0; + uint8_t m_mcu_to_maincpu = 0; /* devices */ required_device m_maincpu; diff -Nru mame-0.242+dfsg.1/src/mame/includes/firetrk.h mame-0.243+dfsg.1/src/mame/includes/firetrk.h --- mame-0.242+dfsg.1/src/mame/includes/firetrk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/firetrk.h 2022-04-29 05:37:26.000000000 +0000 @@ -155,21 +155,21 @@ optional_ioport_array<2> m_steer; output_finder<4> m_leds; - uint8_t m_in_service_mode; - uint32_t m_dial[2]; - uint8_t m_steer_dir[2]; - uint8_t m_steer_flag[2]; - uint8_t m_gear; + uint8_t m_in_service_mode = 0; + uint32_t m_dial[2]{}; + uint8_t m_steer_dir[2]{}; + uint8_t m_steer_flag[2]{}; + uint8_t m_gear = 0; - uint8_t m_flash; - uint8_t m_crash[2]; - uint8_t m_skid[2]; + uint8_t m_flash = 0; + uint8_t m_crash[2]{}; + uint8_t m_skid[2]{}; bitmap_ind16 m_helper1; bitmap_ind16 m_helper2; - uint32_t m_color1_mask; - uint32_t m_color2_mask; - tilemap_t *m_tilemap1; - tilemap_t *m_tilemap2; + uint32_t m_color1_mask = 0; + uint32_t m_color2_mask = 0; + tilemap_t *m_tilemap1 = nullptr; + tilemap_t *m_tilemap2 = nullptr; }; diff -Nru mame-0.242+dfsg.1/src/mame/includes/flstory.h mame-0.243+dfsg.1/src/mame/includes/flstory.h --- mame-0.242+dfsg.1/src/mame/includes/flstory.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/flstory.h 2022-04-29 05:37:26.000000000 +0000 @@ -55,22 +55,22 @@ optional_shared_ptr m_workram; /* video-related */ - tilemap_t *m_bg_tilemap; + tilemap_t *m_bg_tilemap = nullptr; std::vector m_paletteram; std::vector m_paletteram_ext; - uint8_t m_gfxctrl; - uint8_t m_char_bank; - uint8_t m_palette_bank; + uint8_t m_gfxctrl = 0; + uint8_t m_char_bank = 0; + uint8_t m_palette_bank = 0; /* sound-related */ - uint8_t m_snd_ctrl0; - uint8_t m_snd_ctrl1; - uint8_t m_snd_ctrl2; - uint8_t m_snd_ctrl3; + uint8_t m_snd_ctrl0 = 0; + uint8_t m_snd_ctrl1 = 0; + uint8_t m_snd_ctrl2 = 0; + uint8_t m_snd_ctrl3 = 0; /* protection sims */ - uint8_t m_from_mcu; - int m_mcu_select; + uint8_t m_from_mcu = 0; + int m_mcu_select = 0; /* devices */ required_device m_maincpu; diff -Nru mame-0.242+dfsg.1/src/mame/includes/fmtowns.h mame-0.243+dfsg.1/src/mame/includes/fmtowns.h --- mame-0.242+dfsg.1/src/mame/includes/fmtowns.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/fmtowns.h 2022-04-29 05:37:26.000000000 +0000 @@ -38,54 +38,54 @@ struct towns_cdrom_controller { - uint8_t command; - uint8_t status; - uint8_t cmd_status[4]; - uint8_t cmd_status_ptr; - uint8_t extra_status; - uint8_t parameter[8]; - uint8_t mpu_irq_enable; - uint8_t dma_irq_enable; - uint8_t buffer[2048]; - int32_t buffer_ptr; - uint32_t lba_current; - uint32_t lba_last; - uint32_t cdda_current; - uint32_t cdda_length; - bool software_tx; - emu_timer* read_timer; + uint8_t command = 0; + uint8_t status = 0; + uint8_t cmd_status[4]{}; + uint8_t cmd_status_ptr = 0; + uint8_t extra_status = 0; + uint8_t parameter[8]{}; + uint8_t mpu_irq_enable = 0; + uint8_t dma_irq_enable = 0; + uint8_t buffer[2048]{}; + int32_t buffer_ptr = 0; + uint32_t lba_current = 0; + uint32_t lba_last = 0; + uint32_t cdda_current = 0; + uint32_t cdda_length = 0; + bool software_tx = false; + emu_timer* read_timer = nullptr; }; struct towns_video_controller { - uint8_t towns_vram_wplane; - uint8_t towns_vram_rplane; - uint8_t towns_vram_page_sel; - uint8_t towns_palette_select; - uint8_t towns_palette_r[256]; - uint8_t towns_palette_g[256]; - uint8_t towns_palette_b[256]; - uint8_t towns_degipal[8]; - uint8_t towns_dpmd_flag; - uint8_t towns_crtc_mix; - uint8_t towns_crtc_sel; // selected CRTC register - uint16_t towns_crtc_reg[32]; - uint8_t towns_video_sel; // selected video register - uint8_t towns_video_reg[2]; - uint8_t towns_sprite_sel; // selected sprite register - uint8_t towns_sprite_reg[8]; - uint8_t towns_sprite_flag; // sprite drawing flag - uint8_t towns_sprite_page; // VRAM page (not layer) sprites are drawn to - uint8_t towns_tvram_enable; - uint16_t towns_kanji_offset; - uint8_t towns_kanji_code_h; - uint8_t towns_kanji_code_l; + uint8_t towns_vram_wplane = 0; + uint8_t towns_vram_rplane = 0; + uint8_t towns_vram_page_sel = 0; + uint8_t towns_palette_select = 0; + uint8_t towns_palette_r[256]{}; + uint8_t towns_palette_g[256]{}; + uint8_t towns_palette_b[256]{}; + uint8_t towns_degipal[8]{}; + uint8_t towns_dpmd_flag = 0; + uint8_t towns_crtc_mix = 0; + uint8_t towns_crtc_sel = 0; // selected CRTC register + uint16_t towns_crtc_reg[32]{}; + uint8_t towns_video_sel = 0; // selected video register + uint8_t towns_video_reg[2]{}; + uint8_t towns_sprite_sel = 0; // selected sprite register + uint8_t towns_sprite_reg[8]{}; + uint8_t towns_sprite_flag = 0; // sprite drawing flag + uint8_t towns_sprite_page = 0; // VRAM page (not layer) sprites are drawn to + uint8_t towns_tvram_enable = 0; + uint16_t towns_kanji_offset = 0; + uint8_t towns_kanji_code_h = 0; + uint8_t towns_kanji_code_l = 0; rectangle towns_crtc_layerscr[2]; // each layer has independent sizes - uint8_t towns_display_plane; - uint8_t towns_display_page_sel; - uint8_t towns_vblank_flag; - uint8_t towns_layer_ctrl; - emu_timer* sprite_timer; + uint8_t towns_display_plane = 0; + uint8_t towns_display_page_sel = 0; + uint8_t towns_vblank_flag = 0; + uint8_t towns_layer_ctrl = 0; + emu_timer* sprite_timer = nullptr; }; class towns_state : public driver_device @@ -199,59 +199,59 @@ required_memory_bank m_bank_f8000_r; required_memory_bank m_bank_f8000_w; - uint16_t m_ftimer; - uint16_t m_freerun_timer; - emu_timer* m_towns_freerun_counter; - uint16_t m_intervaltimer2_period; - uint8_t m_intervaltimer2_irqmask; - uint8_t m_intervaltimer2_timeout_flag; - uint8_t m_intervaltimer2_timeout_flag2; - emu_timer* m_towns_intervaltimer2; - uint8_t m_nmi_mask; - uint8_t m_compat_mode; - uint8_t m_towns_system_port; - uint32_t m_towns_ankcg_enable; - uint32_t m_towns_mainmem_enable; - uint32_t m_towns_ram_enable; + uint16_t m_ftimer = 0; + uint16_t m_freerun_timer = 0; + emu_timer* m_towns_freerun_counter = nullptr; + uint16_t m_intervaltimer2_period = 0; + uint8_t m_intervaltimer2_irqmask = 0; + uint8_t m_intervaltimer2_timeout_flag = 0; + uint8_t m_intervaltimer2_timeout_flag2 = 0; + emu_timer* m_towns_intervaltimer2 = nullptr; + uint8_t m_nmi_mask = 0; + uint8_t m_compat_mode = 0; + uint8_t m_towns_system_port = 0; + uint32_t m_towns_ankcg_enable = 0; + uint32_t m_towns_mainmem_enable = 0; + uint32_t m_towns_ram_enable = 0; std::unique_ptr m_towns_vram; std::unique_ptr m_towns_gfxvram; std::unique_ptr m_towns_txtvram; - int m_towns_selected_drive; - uint8_t m_towns_fdc_irq6mask; + int m_towns_selected_drive = 0; + uint8_t m_towns_fdc_irq6mask = 0; std::unique_ptr m_towns_serial_rom; - int m_towns_srom_position; - uint8_t m_towns_srom_clk; - uint8_t m_towns_srom_reset; - uint8_t m_towns_rtc_select; - uint8_t m_towns_rtc_data; - uint8_t m_towns_timer_mask; - uint8_t m_towns_kb_status; - uint8_t m_towns_kb_irq1_enable; - uint8_t m_towns_kb_output; // key output - uint8_t m_towns_kb_extend; // extended key output - emu_timer* m_towns_kb_timer; - emu_timer* m_towns_mouse_timer; - uint8_t m_towns_fm_irq_flag; - uint8_t m_towns_pcm_irq_flag; - uint8_t m_towns_pcm_channel_flag; - uint8_t m_towns_pcm_channel_mask; - uint8_t m_towns_pad_mask; - uint8_t m_towns_mouse_output; - uint8_t m_towns_mouse_x; - uint8_t m_towns_mouse_y; - uint8_t m_towns_volume[4]; // volume ports - uint8_t m_towns_volume_select; - uint8_t m_towns_scsi_control; - uint8_t m_towns_scsi_status; - uint8_t m_towns_spkrdata; - uint8_t m_pit_out0; - uint8_t m_pit_out1; - uint8_t m_pit_out2; - uint8_t m_timer0; - uint8_t m_timer1; + int m_towns_srom_position = 0; + uint8_t m_towns_srom_clk = 0; + uint8_t m_towns_srom_reset = 0; + uint8_t m_towns_rtc_select = 0; + uint8_t m_towns_rtc_data = 0; + uint8_t m_towns_timer_mask = 0; + uint8_t m_towns_kb_status = 0; + uint8_t m_towns_kb_irq1_enable = 0; + uint8_t m_towns_kb_output = 0; // key output + uint8_t m_towns_kb_extend = 0; // extended key output + emu_timer* m_towns_kb_timer = nullptr; + emu_timer* m_towns_mouse_timer = nullptr; + uint8_t m_towns_fm_irq_flag = 0; + uint8_t m_towns_pcm_irq_flag = 0; + uint8_t m_towns_pcm_channel_flag = 0; + uint8_t m_towns_pcm_channel_mask = 0; + uint8_t m_towns_pad_mask = 0; + uint8_t m_towns_mouse_output = 0; + uint8_t m_towns_mouse_x = 0; + uint8_t m_towns_mouse_y = 0; + uint8_t m_towns_volume[4]{}; // volume ports + uint8_t m_towns_volume_select = 0; + uint8_t m_towns_scsi_control = 0; + uint8_t m_towns_scsi_status = 0; + uint8_t m_towns_spkrdata = 0; + uint8_t m_pit_out0 = 0; + uint8_t m_pit_out1 = 0; + uint8_t m_pit_out2 = 0; + uint8_t m_timer0 = 0; + uint8_t m_timer1 = 0; - uint8_t m_serial_irq_source; - uint8_t m_serial_irq_enable; // RS232 interrupt control + uint8_t m_serial_irq_source = 0; + uint8_t m_serial_irq_enable = 0; // RS232 interrupt control enum { @@ -265,16 +265,16 @@ TXRDY_IRQ_ENABLE = 0x01 }; - emu_timer* m_towns_wait_timer; - emu_timer* m_towns_status_timer; - emu_timer* m_towns_cdda_timer; + emu_timer* m_towns_wait_timer = nullptr; + emu_timer* m_towns_status_timer = nullptr; + emu_timer* m_towns_cdda_timer = nullptr; struct towns_cdrom_controller m_towns_cd; struct towns_video_controller m_video; - uint32_t m_kb_prev[4]; - uint8_t m_prev_pad_mask; - uint8_t m_prev_x; - uint8_t m_prev_y; + uint32_t m_kb_prev[4]{}; + uint8_t m_prev_pad_mask = 0; + uint8_t m_prev_x = 0; + uint8_t m_prev_y = 0; optional_shared_ptr m_nvram; optional_shared_ptr m_nvram16; @@ -407,10 +407,10 @@ void towns_cd_status_ready(); void towns_delay_cdda(cdrom_image_device* dev); - u8 m_rtc_d; - bool m_rtc_busy; - u8 m_vram_mask[4]; - u8 m_vram_mask_addr; + u8 m_rtc_d = 0; + bool m_rtc_busy = false; + u8 m_vram_mask[4]{}; + u8 m_vram_mask_addr = 0; TIMER_CALLBACK_MEMBER(towns_cdrom_read_byte); TIMER_CALLBACK_MEMBER(towns_vblank_end); diff -Nru mame-0.242+dfsg.1/src/mame/includes/freekick.h mame-0.243+dfsg.1/src/mame/includes/freekick.h --- mame-0.242+dfsg.1/src/mame/includes/freekick.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/freekick.h 2022-04-29 05:37:26.000000000 +0000 @@ -40,16 +40,16 @@ required_shared_ptr m_spriteram; /* video-related */ - tilemap_t *m_freek_tilemap; + tilemap_t *m_freek_tilemap = nullptr; /* misc */ - int m_inval; - int m_outval; - int m_cnt; // used by oigas - int m_romaddr; - int m_spinner; - int m_nmi_en; - int m_ff_data; + int m_inval = 0; + int m_outval = 0; + int m_cnt = 0; // used by oigas + int m_romaddr = 0; + int m_spinner = 0; + int m_nmi_en = 0; + int m_ff_data = 0; std::unique_ptr m_decrypted_opcodes; DECLARE_WRITE_LINE_MEMBER(flipscreen_x_w); DECLARE_WRITE_LINE_MEMBER(flipscreen_y_w); diff -Nru mame-0.242+dfsg.1/src/mame/includes/fromance.h mame-0.243+dfsg.1/src/mame/includes/fromance.h --- mame-0.242+dfsg.1/src/mame/includes/fromance.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/fromance.h 2022-04-29 05:37:26.000000000 +0000 @@ -62,17 +62,17 @@ void fromance_scroll_w(offs_t offset, uint8_t data); void fromance_gga_data_w(offs_t offset, uint8_t data); - uint32_t m_scrolly_ofs; - uint32_t m_scrollx_ofs; - uint32_t m_scrollx[2]; - uint32_t m_scrolly[2]; - uint8_t m_gfxreg; - uint8_t m_flipscreen; - uint8_t m_flipscreen_old; - uint8_t m_selected_videoram; - uint8_t m_selected_paletteram; - tilemap_t *m_bg_tilemap; - tilemap_t *m_fg_tilemap; + uint32_t m_scrolly_ofs = 0; + uint32_t m_scrollx_ofs = 0; + uint32_t m_scrollx[2]{}; + uint32_t m_scrolly[2]{}; + uint8_t m_gfxreg = 0; + uint8_t m_flipscreen = 0; + uint8_t m_flipscreen_old = 0; + uint8_t m_selected_videoram = 0; + uint8_t m_selected_paletteram = 0; + tilemap_t *m_bg_tilemap = nullptr; + tilemap_t *m_fg_tilemap = nullptr; uint32_t screen_update_fromance(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); @@ -87,10 +87,10 @@ emu_timer *m_crtc_timer; /* misc */ - uint8_t m_portselect; - uint8_t m_adpcm_reset; - uint8_t m_adpcm_data; - uint8_t m_vclk_left; + uint8_t m_portselect = 0; + uint8_t m_adpcm_reset = 0; + uint8_t m_adpcm_data = 0; + uint8_t m_vclk_left = 0; /* devices */ uint8_t fromance_busycheck_main_r(); diff -Nru mame-0.242+dfsg.1/src/mame/includes/funybubl.h mame-0.243+dfsg.1/src/mame/includes/funybubl.h --- mame-0.242+dfsg.1/src/mame/includes/funybubl.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/funybubl.h 2022-04-29 05:37:26.000000000 +0000 @@ -44,7 +44,7 @@ required_memory_bank m_okibank; /* video-related */ - tilemap_t *m_tilemap; + tilemap_t *m_tilemap = nullptr; /* devices */ required_device m_maincpu; diff -Nru mame-0.242+dfsg.1/src/mame/includes/fuukifg2.h mame-0.243+dfsg.1/src/mame/includes/fuukifg2.h --- mame-0.242+dfsg.1/src/mame/includes/fuukifg2.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/fuukifg2.h 2022-04-29 05:37:26.000000000 +0000 @@ -63,12 +63,12 @@ required_memory_bank m_soundbank; /* video-related */ - tilemap_t *m_tilemap[3]; + tilemap_t *m_tilemap[3]{}; /* misc */ - emu_timer *m_level_1_interrupt_timer; - emu_timer *m_vblank_interrupt_timer; - emu_timer *m_raster_interrupt_timer; + emu_timer *m_level_1_interrupt_timer = nullptr; + emu_timer *m_vblank_interrupt_timer = nullptr; + emu_timer *m_raster_interrupt_timer = nullptr; void vregs_w(offs_t offset, u16 data, u16 mem_mask = ~0); void sound_command_w(u8 data); diff -Nru mame-0.242+dfsg.1/src/mame/includes/fuukifg3.h mame-0.243+dfsg.1/src/mame/includes/fuukifg3.h --- mame-0.242+dfsg.1/src/mame/includes/fuukifg3.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/fuukifg3.h 2022-04-29 05:37:26.000000000 +0000 @@ -73,13 +73,13 @@ required_ioport m_dsw2; /* video-related */ - tilemap_t *m_tilemap[3]; - u32 m_spr_buffered_tilebank[2]; + tilemap_t *m_tilemap[3]{}; + u32 m_spr_buffered_tilebank[2]{}; /* misc */ - emu_timer *m_level_1_interrupt_timer; - emu_timer *m_vblank_interrupt_timer; - emu_timer *m_raster_interrupt_timer; + emu_timer *m_level_1_interrupt_timer = nullptr; + emu_timer *m_vblank_interrupt_timer = nullptr; + emu_timer *m_raster_interrupt_timer = nullptr; u8 snd_020_r(offs_t offset); void snd_020_w(offs_t offset, u8 data, u8 mem_mask = ~0); diff -Nru mame-0.242+dfsg.1/src/mame/includes/gaelco3d.h mame-0.243+dfsg.1/src/mame/includes/gaelco3d.h --- mame-0.242+dfsg.1/src/mame/includes/gaelco3d.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/gaelco3d.h 2022-04-29 05:37:26.000000000 +0000 @@ -67,11 +67,11 @@ struct gaelco3d_object_data { - uint32_t tex, color; - float ooz_dx, ooz_dy, ooz_base; - float uoz_dx, uoz_dy, uoz_base; - float voz_dx, voz_dy, voz_base; - float z0; + uint32_t tex = 0, color = 0; + float ooz_dx = 0, ooz_dy = 0, ooz_base = 0; + float uoz_dx = 0, uoz_dy = 0, uoz_base = 0; + float voz_dx = 0, voz_dy = 0, voz_base = 0; + float z0 = 0; }; class gaelco3d_renderer : public poly_manager @@ -91,9 +91,9 @@ private: bitmap_ind16 m_screenbits; bitmap_ind16 m_zbuffer; - uint32_t m_polygons; - offs_t m_texture_size; - offs_t m_texmask_size; + uint32_t m_polygons = 0; + offs_t m_texture_size = 0; + offs_t m_texmask_size = 0; std::unique_ptr m_texture; std::unique_ptr m_texmask; @@ -124,22 +124,22 @@ optional_ioport_array<4> m_analog; required_memory_bank m_adsp_bank; - uint8_t m_sound_status; - uint8_t m_analog_ports[4]; - uint32_t m_fp_analog_ports[2]; - uint32_t m_fp_lenght[2]; - uint8_t m_fp_clock; - uint8_t m_fp_state; - uint8_t m_framenum; - uint8_t m_adsp_ireg; - offs_t m_adsp_ireg_base; - offs_t m_adsp_incs; - offs_t m_adsp_size; + uint8_t m_sound_status = 0; + uint8_t m_analog_ports[4]{}; + uint32_t m_fp_analog_ports[2]{}; + uint32_t m_fp_lenght[2]{}; + uint8_t m_fp_clock = 0; + uint8_t m_fp_state = 0; + uint8_t m_framenum = 0; + uint8_t m_adsp_ireg = 0; + offs_t m_adsp_ireg_base = 0; + offs_t m_adsp_incs = 0; + offs_t m_adsp_size = 0; std::unique_ptr m_palette; std::unique_ptr m_polydata_buffer; - uint32_t m_polydata_count; - int m_lastscan; - int m_video_changed; + uint32_t m_polydata_count = 0; + int m_lastscan = 0; + int m_video_changed = 0; std::unique_ptr m_poly; void irq_ack_w(uint16_t data); diff -Nru mame-0.242+dfsg.1/src/mame/includes/gaelco.h mame-0.243+dfsg.1/src/mame/includes/gaelco.h --- mame-0.242+dfsg.1/src/mame/includes/gaelco.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/gaelco.h 2022-04-29 05:37:26.000000000 +0000 @@ -55,7 +55,7 @@ optional_shared_ptr m_screenram; /* video-related */ - tilemap_t *m_tilemap[2]; + tilemap_t *m_tilemap[2]{}; DECLARE_WRITE_LINE_MEMBER(coin1_lockout_w); DECLARE_WRITE_LINE_MEMBER(coin2_lockout_w); @@ -87,7 +87,7 @@ void thoop_map(address_map &map); /* per-game configuration */ - uint8_t m_sprite_palette_force_high; + uint8_t m_sprite_palette_force_high = 0; static constexpr double FRAMERATE_922804 = 57.42; }; diff -Nru mame-0.242+dfsg.1/src/mame/includes/gaiden.h mame-0.243+dfsg.1/src/mame/includes/gaiden.h --- mame-0.242+dfsg.1/src/mame/includes/gaiden.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/gaiden.h 2022-04-29 05:37:26.000000000 +0000 @@ -64,30 +64,30 @@ optional_memory_bank m_adpcm_bank; /* video-related */ - tilemap_t *m_text_layer; - tilemap_t *m_foreground; - tilemap_t *m_background; + tilemap_t *m_text_layer = nullptr; + tilemap_t *m_foreground = nullptr; + tilemap_t *m_background = nullptr; bitmap_ind16 m_sprite_bitmap; bitmap_ind16 m_tile_bitmap_bg; bitmap_ind16 m_tile_bitmap_fg; bitmap_ind16 m_tile_bitmap_tx; - uint16_t m_tx_scroll_x; - uint16_t m_tx_scroll_y; - uint16_t m_bg_scroll_x; - uint16_t m_bg_scroll_y; - uint16_t m_fg_scroll_x; - uint16_t m_fg_scroll_y; - int8_t m_tx_offset_y; - int8_t m_bg_offset_y; - int8_t m_fg_offset_y; - int8_t m_spr_offset_y; + uint16_t m_tx_scroll_x = 0; + uint16_t m_tx_scroll_y = 0; + uint16_t m_bg_scroll_x = 0; + uint16_t m_bg_scroll_y = 0; + uint16_t m_fg_scroll_x = 0; + uint16_t m_fg_scroll_y = 0; + int8_t m_tx_offset_y = 0; + int8_t m_bg_offset_y = 0; + int8_t m_fg_offset_y = 0; + int8_t m_spr_offset_y = 0; /* misc */ - int m_sprite_sizey; - int m_prot; - int m_jumpcode; - const int *m_jumppoints; // raiga, wildfang - bool m_adpcm_toggle; + int m_sprite_sizey = 0; + int m_prot = 0; + int m_jumpcode = 0; + const int *m_jumppoints = nullptr; // raiga, wildfang + bool m_adpcm_toggle = 0; /* devices */ required_device m_maincpu; diff -Nru mame-0.242+dfsg.1/src/mame/includes/galaxian.h mame-0.243+dfsg.1/src/mame/includes/galaxian.h --- mame-0.242+dfsg.1/src/mame/includes/galaxian.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/galaxian.h 2022-04-29 05:37:26.000000000 +0000 @@ -314,6 +314,7 @@ void astroamb(machine_config &config); void mimonkey(machine_config &config); void mimonscr(machine_config &config); + void galartic(machine_config &config); template CUSTOM_INPUT_MEMBER(ckongg_coinage_r); template DECLARE_READ_LINE_MEMBER(ckongs_coinage_r); @@ -351,6 +352,7 @@ void frogger_sound_portmap(address_map &map); void froggeram_map(address_map &map); void froggermc_map(address_map &map); + void galartic_map(address_map &map); void galaxian_map(address_map &map); void galaxian_map_base(address_map &map); void galaxian_map_discrete(address_map &map); @@ -412,10 +414,10 @@ int m_bullets_base = 0x60; int m_sprites_base = 0x40; int m_numspritegens = 1; - uint16_t m_protection_state; - uint8_t m_protection_result; - uint8_t m_konami_sound_control; - uint8_t m_irq_enabled; + uint16_t m_protection_state = 0; + uint8_t m_protection_result = 0; + uint8_t m_konami_sound_control = 0; + uint8_t m_irq_enabled = 0; int m_irq_line = INPUT_LINE_NMI; bool m_frogger_adjust = false; uint8_t m_x_scale = GALAXIAN_XSCALE; @@ -427,21 +429,21 @@ draw_bullet_delegate m_draw_bullet_ptr; draw_background_delegate m_draw_background_ptr; - tilemap_t *m_bg_tilemap; - uint8_t m_flipscreen_x; - uint8_t m_flipscreen_y; - uint8_t m_background_enable; - uint8_t m_background_red; - uint8_t m_background_green; - uint8_t m_background_blue; - uint32_t m_star_rng_origin; - uint32_t m_star_rng_origin_frame; + tilemap_t *m_bg_tilemap = nullptr; + uint8_t m_flipscreen_x = 0; + uint8_t m_flipscreen_y = 0; + uint8_t m_background_enable = 0; + uint8_t m_background_red = 0; + uint8_t m_background_green = 0; + uint8_t m_background_blue = 0; + uint32_t m_star_rng_origin = 0; + uint32_t m_star_rng_origin_frame = 0; rgb_t m_star_color[64]; std::unique_ptr m_stars; - uint8_t m_stars_enabled; - uint8_t m_stars_blink_state; + uint8_t m_stars_enabled = 0; + uint8_t m_stars_blink_state = 0; rgb_t m_bullet_color[8]; - uint8_t m_gfxbank[5]; + uint8_t m_gfxbank[5]{}; uint8_t m_leftspriteclip = 16; }; @@ -608,8 +610,8 @@ required_device m_dac; required_ioport m_mux_port; - uint8_t m_speech_dip; - uint8_t m_sound; + uint8_t m_speech_dip = 0; + uint8_t m_sound = 0; }; @@ -670,7 +672,7 @@ required_ioport_array<10> m_game_dsw; required_memory_bank m_mainbank; - uint8_t m_current_game; + uint8_t m_current_game = 0; }; @@ -902,7 +904,7 @@ required_device m_sp0250; required_memory_bank m_soundbank; - uint8_t m_p2; + uint8_t m_p2 = 0; }; diff -Nru mame-0.242+dfsg.1/src/mame/includes/galpanic.h mame-0.243+dfsg.1/src/mame/includes/galpanic.h --- mame-0.242+dfsg.1/src/mame/includes/galpanic.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/galpanic.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,59 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Nicola Salmoria -#ifndef MAME_INCLUDES_GALPANIC_H -#define MAME_INCLUDES_GALPANIC_H - -#pragma once - -#include "machine/timer.h" -#include "video/kan_pand.h" -#include "emupal.h" -#include "screen.h" - -class galpanic_state : public driver_device -{ -public: - galpanic_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag) - , m_maincpu(*this, "maincpu") - , m_bgvideoram(*this, "bgvideoram") - , m_fgvideoram(*this, "fgvideoram") - , m_gfxdecode(*this, "gfxdecode") - , m_screen(*this, "screen") - , m_palette(*this, "palette") - , m_pandora(*this, "pandora") - { } - - void galpanica(machine_config &config); - void galpanic(machine_config &config); - -private: - required_device m_maincpu; - required_shared_ptr m_bgvideoram; - required_shared_ptr m_fgvideoram; - required_device m_gfxdecode; - required_device m_screen; - required_device m_palette; - required_device m_pandora; - - bitmap_ind16 m_bitmap; - - void m6295_bankswitch_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - void coin_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); - - virtual void machine_start() override; - virtual void video_start() override; - void galpanic_palette(palette_device &palette) const; - - uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - DECLARE_WRITE_LINE_MEMBER(screen_vblank); - TIMER_DEVICE_CALLBACK_MEMBER(scanline); - void draw_fgbitmap(bitmap_ind16 &bitmap, const rectangle &cliprect); - - void galpanic_map(address_map &map); - void galpanic_oki_map(address_map &map); - void galpanica_map(address_map &map); -}; - -#endif // MAME_INCLUDES_GALPANIC_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/gamecom.h mame-0.243+dfsg.1/src/mame/includes/gamecom.h --- mame-0.242+dfsg.1/src/mame/includes/gamecom.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/gamecom.h 2022-04-29 05:37:26.000000000 +0000 @@ -179,13 +179,13 @@ u16 dest_mask = 0U; u8 transfer_mode = 0U; s16 adjust_x = 0U; - bool decrement_y = 0; - bool overwrite_mode = 0; + bool decrement_y = false; + bool overwrite_mode = false; }; struct GAMECOM_TIMER { - bool enabled = 0; + bool enabled = false; u32 prescale_count = 0U; u32 prescale_max = 0U; u8 upcounter_max = 0U; @@ -256,8 +256,8 @@ uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void gamecom_mem_map(address_map &map); - uint8_t *m_p_ram = 0; - uint8_t *m_cart_ptr = 0; + uint8_t *m_p_ram = nullptr; + uint8_t *m_cart_ptr = nullptr; uint8_t m_lcdc_reg = 0U; uint8_t m_lch_reg = 0U; uint8_t m_lcv_reg = 0U; @@ -265,16 +265,16 @@ uint8_t m_sound1_cnt = 0U; uint16_t m_scanline = 0U; uint16_t m_base_address = 0U; - memory_region *m_cart1_rom = 0; - memory_region *m_cart2_rom = 0; - emu_timer *m_clock_timer = 0; - emu_timer *m_sound0_timer = 0; - emu_timer *m_sound1_timer = 0; - emu_timer *m_scanline_timer = 0; + memory_region *m_cart1_rom = nullptr; + memory_region *m_cart2_rom = nullptr; + emu_timer *m_clock_timer = nullptr; + emu_timer *m_sound0_timer = nullptr; + emu_timer *m_sound1_timer = nullptr; + emu_timer *m_scanline_timer = nullptr; GAMECOM_DMA m_dma; - GAMECOM_TIMER m_timer[2]{}; + GAMECOM_TIMER m_timer[2]; gamecom_sound_t m_sound; - bitmap_ind16 m_bitmap = 0; + bitmap_ind16 m_bitmap; void gamecom_set_mmu(uint8_t mmu, uint8_t data); void handle_stylus_press(int column); void recompute_lcd_params(); diff -Nru mame-0.242+dfsg.1/src/mame/includes/gaplus.h mame-0.243+dfsg.1/src/mame/includes/gaplus.h --- mame-0.242+dfsg.1/src/mame/includes/gaplus.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/gaplus.h 2022-04-29 05:37:26.000000000 +0000 @@ -18,8 +18,8 @@ static constexpr unsigned MAX_STARS = 250; struct star { - float x,y; - int col,set; + float x = 0, y = 0; + int col = 0, set = 0; }; enum @@ -104,18 +104,18 @@ required_memory_region m_gfx1_region; required_memory_region m_gfx2_region; - int m_type; + int m_type = 0; - tilemap_t *m_bg_tilemap; - uint8_t m_starfield_control[4]; - int m_total_stars; - int m_starfield_framecount; + tilemap_t *m_bg_tilemap = nullptr; + uint8_t m_starfield_control[4]{}; + int m_total_stars = 0; + int m_starfield_framecount = 0; struct star m_stars[MAX_STARS]; - uint8_t m_main_irq_mask; - uint8_t m_sub_irq_mask; - uint8_t m_sub2_irq_mask; - emu_timer *m_namcoio0_run_timer; - emu_timer *m_namcoio1_run_timer; + uint8_t m_main_irq_mask = 0; + uint8_t m_sub_irq_mask = 0; + uint8_t m_sub2_irq_mask = 0; + emu_timer *m_namcoio0_run_timer = nullptr; + emu_timer *m_namcoio1_run_timer = nullptr; }; class gaplusd_state : public gaplus_base_state diff -Nru mame-0.242+dfsg.1/src/mame/includes/gauntlet.h mame-0.243+dfsg.1/src/mame/includes/gauntlet.h --- mame-0.242+dfsg.1/src/mame/includes/gauntlet.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/gauntlet.h 2022-04-29 05:37:26.000000000 +0000 @@ -96,10 +96,10 @@ required_shared_ptr m_yscroll; required_device m_mob; - uint16_t m_sound_reset_val; - bool m_vindctr2_screen_refresh; - uint8_t m_playfield_tile_bank; - uint8_t m_playfield_color_bank; + uint16_t m_sound_reset_val = 0; + bool m_vindctr2_screen_refresh = false; + uint8_t m_playfield_tile_bank = 0; + uint8_t m_playfield_color_bank = 0; static const atari_motion_objects_config s_mob_config; diff -Nru mame-0.242+dfsg.1/src/mame/includes/gba.h mame-0.243+dfsg.1/src/mame/includes/gba.h --- mame-0.242+dfsg.1/src/mame/includes/gba.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/gba.h 2022-04-29 05:37:26.000000000 +0000 @@ -48,26 +48,26 @@ void audio_tick(int ref); // DMA - emu_timer *m_dma_timer[4]; - uint32_t m_dma_src[4]; - uint32_t m_dma_dst[4]; - uint16_t m_dma_cnt[4]; + emu_timer *m_dma_timer[4]{}; + uint32_t m_dma_src[4]{}; + uint32_t m_dma_dst[4]{}; + uint16_t m_dma_cnt[4]{}; // Timers - uint32_t m_timer_regs[4]; - uint16_t m_timer_reload[4]; - int m_timer_recalc[4]; - - emu_timer *m_tmr_timer[4], *m_irq_timer; - - double m_timer_hz[4]; - - int m_fifo_a_ptr; - int m_fifo_b_ptr; - int m_fifo_a_in; - int m_fifo_b_in; - uint8_t m_fifo_a[20]; - uint8_t m_fifo_b[20]; + uint32_t m_timer_regs[4]{}; + uint16_t m_timer_reload[4]{}; + int m_timer_recalc[4]{}; + + emu_timer *m_tmr_timer[4]{}, *m_irq_timer = nullptr; + + double m_timer_hz[4]{}; + + int m_fifo_a_ptr = 0; + int m_fifo_b_ptr = 0; + int m_fifo_a_in = 0; + int m_fifo_b_in = 0; + uint8_t m_fifo_a[20]{}; + uint8_t m_fifo_b[20]{}; uint32_t gba_io_r(offs_t offset, uint32_t mem_mask = ~0); diff -Nru mame-0.242+dfsg.1/src/mame/includes/gb.h mame-0.243+dfsg.1/src/mame/includes/gb.h --- mame-0.242+dfsg.1/src/mame/includes/gb.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/gb.h 2022-04-29 05:37:26.000000000 +0000 @@ -37,33 +37,33 @@ m_cart_high(*this, "carthigh") { } - uint8_t m_gb_io[0x10]; + uint8_t m_gb_io[0x10]{}; /* Timer related */ - uint16_t m_divcount; - uint8_t m_shift; - uint16_t m_shift_cycles; - uint8_t m_triggering_irq; - uint8_t m_reloading; + uint16_t m_divcount = 0; + uint8_t m_shift = 0; + uint16_t m_shift_cycles = 0; + uint8_t m_triggering_irq = 0; + uint8_t m_reloading = 0; /* Serial I/O related */ - uint16_t m_internal_serial_clock; - uint16_t m_internal_serial_frequency; - uint32_t m_sio_count; /* Serial I/O counter */ + uint16_t m_internal_serial_clock = 0; + uint16_t m_internal_serial_frequency = 0; + uint32_t m_sio_count = 0; /* Serial I/O counter */ /* SGB variables */ - int8_t m_sgb_packets; - uint8_t m_sgb_bitcount; - uint8_t m_sgb_bytecount; - uint8_t m_sgb_start; - uint8_t m_sgb_rest; - uint8_t m_sgb_controller_no; - uint8_t m_sgb_controller_mode; - uint8_t m_sgb_data[0x100]; + int8_t m_sgb_packets = 0; + uint8_t m_sgb_bitcount = 0; + uint8_t m_sgb_bytecount = 0; + uint8_t m_sgb_start = 0; + uint8_t m_sgb_rest = 0; + uint8_t m_sgb_controller_no = 0; + uint8_t m_sgb_controller_mode = 0; + uint8_t m_sgb_data[0x100]{}; /* CGB variables */ - uint8_t *m_gbc_rammap[8]; /* (CGB) Addresses of internal RAM banks */ - uint8_t m_gbc_rambank; /* (CGB) Current CGB RAM bank */ + uint8_t *m_gbc_rammap[8]{}; /* (CGB) Addresses of internal RAM banks */ + uint8_t m_gbc_rambank = 0; /* (CGB) Current CGB RAM bank */ void gb_io_w(offs_t offset, uint8_t data); void gb_io2_w(offs_t offset, uint8_t data); diff -Nru mame-0.242+dfsg.1/src/mame/includes/glass.h mame-0.243+dfsg.1/src/mame/includes/glass.h --- mame-0.242+dfsg.1/src/mame/includes/glass.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/glass.h 2022-04-29 05:37:26.000000000 +0000 @@ -49,13 +49,13 @@ required_memory_bank m_okibank; /* video-related */ - tilemap_t *m_pant[2]; + tilemap_t *m_pant[2]{}; std::unique_ptr m_screen_bitmap; /* misc */ - int m_current_bit; - int m_cause_interrupt; - int m_blitter_command; + int m_current_bit = 0; + int m_cause_interrupt = 0; + int m_blitter_command = 0; void shareram_w(offs_t offset, uint8_t data); uint8_t shareram_r(offs_t offset); diff -Nru mame-0.242+dfsg.1/src/mame/includes/gng.h mame-0.243+dfsg.1/src/mame/includes/gng.h --- mame-0.242+dfsg.1/src/mame/includes/gng.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/gng.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,73 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Pierpaolo Prazzoli -/************************************************************************* - - Ghosts'n Goblins - -*************************************************************************/ -#ifndef MAME_INCLUDES_GNG_H -#define MAME_INCLUDES_GNG_H - -#pragma once - -#include "sound/ymopn.h" -#include "video/bufsprite.h" -#include "emupal.h" -#include "tilemap.h" - -class gng_state : public driver_device -{ -public: - gng_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_spriteram(*this, "spriteram"), - m_fgvideoram(*this, "fgvideoram"), - m_bgvideoram(*this, "bgvideoram"), - m_maincpu(*this, "maincpu"), - m_ym(*this, "ym%u", 1), - m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") - { } - - void gng(machine_config &config); - void diamond(machine_config &config); - -private: - void gng_bankswitch_w(uint8_t data); - DECLARE_WRITE_LINE_MEMBER(ym_reset_w); - uint8_t diamond_hack_r(); - void gng_fgvideoram_w(offs_t offset, uint8_t data); - void gng_bgvideoram_w(offs_t offset, uint8_t data); - void gng_bgscrollx_w(offs_t offset, uint8_t data); - void gng_bgscrolly_w(offs_t offset, uint8_t data); - DECLARE_WRITE_LINE_MEMBER(flipscreen_w); - TILE_GET_INFO_MEMBER(get_fg_tile_info); - TILE_GET_INFO_MEMBER(get_bg_tile_info); - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; - uint32_t screen_update_gng(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); - - void diamond_map(address_map &map); - void gng_map(address_map &map); - void sound_map(address_map &map); - - /* memory pointers */ - required_device m_spriteram; - required_shared_ptr m_fgvideoram; - required_shared_ptr m_bgvideoram; - - /* video-related */ - tilemap_t *m_bg_tilemap = nullptr; - tilemap_t *m_fg_tilemap = nullptr; - uint8_t m_scrollx[2]{}; - uint8_t m_scrolly[2]{}; - - required_device m_maincpu; - required_device_array m_ym; - required_device m_gfxdecode; - required_device m_palette; -}; - -#endif // MAME_INCLUDES_GNG_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/goal92.h mame-0.243+dfsg.1/src/mame/includes/goal92.h --- mame-0.242+dfsg.1/src/mame/includes/goal92.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/goal92.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,89 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Pierpaolo Prazzoli, David Haywood -/************************************************************************* - - Goal! '92 - -*************************************************************************/ -#ifndef MAME_INCLUDES_GOAL92_H -#define MAME_INCLUDES_GOAL92_H - -#pragma once - -#include "machine/gen_latch.h" -#include "sound/msm5205.h" -#include "emupal.h" -#include "tilemap.h" - -class goal92_state : public driver_device -{ -public: - goal92_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_bg_data(*this, "bg_data"), - m_fg_data(*this, "fg_data"), - m_tx_data(*this, "tx_data"), - m_spriteram(*this, "spriteram"), - m_scrollram(*this, "scrollram"), - m_maincpu(*this, "maincpu"), - m_audiocpu(*this, "audiocpu"), - m_msm(*this, "msm"), - m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette"), - m_soundlatch(*this, "soundlatch") - { } - - void goal92(machine_config &config); - -private: - /* memory pointers */ - required_shared_ptr m_bg_data; - required_shared_ptr m_fg_data; - required_shared_ptr m_tx_data; - required_shared_ptr m_spriteram; - required_shared_ptr m_scrollram; - std::unique_ptr m_buffered_spriteram; - - /* video-related */ - tilemap_t *m_bg_layer = nullptr; - tilemap_t *m_fg_layer = nullptr; - tilemap_t *m_tx_layer = nullptr; - uint16_t m_fg_bank = 0U; - - /* misc */ - int m_msm5205next = 0; - int m_adpcm_toggle = 0; - - /* devices */ - required_device m_maincpu; - required_device m_audiocpu; - required_device m_msm; - required_device m_gfxdecode; - required_device m_palette; - required_device m_soundlatch; - - void goal92_sound_command_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - uint16_t goal92_inputs_r(offs_t offset, uint16_t mem_mask = ~0); - void adpcm_data_w(uint8_t data); - uint16_t goal92_fg_bank_r(); - void goal92_fg_bank_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - void goal92_text_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - void goal92_background_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - void goal92_foreground_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - void adpcm_control_w(uint8_t data); - TILE_GET_INFO_MEMBER(get_text_tile_info); - TILE_GET_INFO_MEMBER(get_back_tile_info); - TILE_GET_INFO_MEMBER(get_fore_tile_info); - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; - uint32_t screen_update_goal92(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - DECLARE_WRITE_LINE_MEMBER(screen_vblank_goal92); - void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int pri ); - DECLARE_WRITE_LINE_MEMBER(irqhandler); - DECLARE_WRITE_LINE_MEMBER(goal92_adpcm_int); - void goal92_map(address_map &map); - void sound_cpu(address_map &map); -}; - -#endif // MAME_INCLUDES_GOAL92_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/gottlieb.h mame-0.243+dfsg.1/src/mame/includes/gottlieb.h --- mame-0.242+dfsg.1/src/mame/includes/gottlieb.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/gottlieb.h 2022-04-29 05:37:26.000000000 +0000 @@ -152,12 +152,12 @@ u8 m_knocker_prev = 0U; u8 m_joystick_select = 0U; u8 m_track[2]{}; - emu_timer *m_laserdisc_bit_timer = 0; - emu_timer *m_laserdisc_philips_timer = 0; + emu_timer *m_laserdisc_bit_timer = nullptr; + emu_timer *m_laserdisc_philips_timer = nullptr; u8 m_laserdisc_select = 0U; u8 m_laserdisc_status = 0U; uint16_t m_laserdisc_philips_code = 0U; - std::unique_ptr m_laserdisc_audio_buffer{}; + std::unique_ptr m_laserdisc_audio_buffer; uint16_t m_laserdisc_audio_address = 0U; int16_t m_laserdisc_last_samples[2]{}; attotime m_laserdisc_last_time; @@ -170,6 +170,6 @@ u8 m_background_priority = 0U; u8 m_spritebank = 0U; u8 m_transparent0 = 0U; - tilemap_t *m_bg_tilemap = 0; + tilemap_t *m_bg_tilemap = nullptr; double m_weights[4]{}; }; diff -Nru mame-0.242+dfsg.1/src/mame/includes/gp32.h mame-0.243+dfsg.1/src/mame/includes/gp32.h --- mame-0.242+dfsg.1/src/mame/includes/gp32.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/gp32.h 2022-04-29 05:37:26.000000000 +0000 @@ -45,49 +45,49 @@ struct s3c240x_lcd_t { - uint32_t vramaddr_cur; - uint32_t vramaddr_max; - uint32_t offsize; - uint32_t pagewidth_cur; - uint32_t pagewidth_max; - uint32_t bppmode; - uint32_t bswp, hwswp; - uint32_t hozval, lineval; - int vpos, hpos; + uint32_t vramaddr_cur = 0; + uint32_t vramaddr_max = 0; + uint32_t offsize = 0; + uint32_t pagewidth_cur = 0; + uint32_t pagewidth_max = 0; + uint32_t bppmode = 0; + uint32_t bswp = 0, hwswp = 0; + uint32_t hozval = 0, lineval = 0; + int vpos = 0, hpos = 0; }; struct smc_t { - int add_latch; - int chip; - int cmd_latch; - int do_read; - int do_write; - int read; - int wp; - int busy; - uint8_t datarx; - uint8_t datatx; + int add_latch = 0; + int chip = 0; + int cmd_latch = 0; + int do_read = 0; + int do_write = 0; + int read = 0; + int wp = 0; + int busy = 0; + uint8_t datarx = 0; + uint8_t datatx = 0; }; struct i2s_t { - int l3d; - int l3m; - int l3c; + int l3d = 0; + int l3m = 0; + int l3c = 0; }; struct s3c240x_iic_t { - uint8_t data[4]; - int data_index; - uint16_t address; + uint8_t data[4]{}; + int data_index = 0; + uint16_t address = 0; }; struct s3c240x_iis_t { - uint16_t fifo[16/2]; - int fifo_index; + uint16_t fifo[16/2]{}; + int fifo_index = 0; }; @@ -120,34 +120,34 @@ required_shared_ptr m_s3c240x_ram; std::unique_ptr m_eeprom_data; uint32_t m_s3c240x_lcd_regs[0x400/4]; - emu_timer *m_s3c240x_lcd_timer; + emu_timer *m_s3c240x_lcd_timer = nullptr; s3c240x_lcd_t m_s3c240x_lcd; - uint32_t m_s3c240x_lcd_palette[0x400/4]; - uint32_t m_s3c240x_clkpow_regs[0x18/4]; - uint32_t m_s3c240x_irq_regs[0x18/4]; - emu_timer *m_s3c240x_pwm_timer[5]; - uint32_t m_s3c240x_pwm_regs[0x44/4]; - emu_timer *m_s3c240x_dma_timer[4]; - uint32_t m_s3c240x_dma_regs[0x7c/4]; + uint32_t m_s3c240x_lcd_palette[0x400/4]{}; + uint32_t m_s3c240x_clkpow_regs[0x18/4]{}; + uint32_t m_s3c240x_irq_regs[0x18/4]{}; + emu_timer *m_s3c240x_pwm_timer[5]{}; + uint32_t m_s3c240x_pwm_regs[0x44/4]{}; + emu_timer *m_s3c240x_dma_timer[4]{}; + uint32_t m_s3c240x_dma_regs[0x7c/4]{}; smc_t m_smc; i2s_t m_i2s; - uint32_t m_s3c240x_gpio[0x60/4]; - uint32_t m_s3c240x_memcon_regs[0x34/4]; - uint32_t m_s3c240x_usb_host_regs[0x5C/4]; + uint32_t m_s3c240x_gpio[0x60/4]{}; + uint32_t m_s3c240x_memcon_regs[0x34/4]{}; + uint32_t m_s3c240x_usb_host_regs[0x5C/4]{}; uint32_t m_s3c240x_uart_0_regs[0x2C/4]; uint32_t m_s3c240x_uart_1_regs[0x2C/4]; - uint32_t m_s3c240x_usb_device_regs[0xBC/4]; - uint32_t m_s3c240x_watchdog_regs[0x0C/4]; + uint32_t m_s3c240x_usb_device_regs[0xBC/4]{}; + uint32_t m_s3c240x_watchdog_regs[0x0C/4]{}; s3c240x_iic_t m_s3c240x_iic; - emu_timer *m_s3c240x_iic_timer; - uint32_t m_s3c240x_iic_regs[0x10/4]; + emu_timer *m_s3c240x_iic_timer = nullptr; + uint32_t m_s3c240x_iic_regs[0x10/4]{}; s3c240x_iis_t m_s3c240x_iis; - emu_timer *m_s3c240x_iis_timer; - uint32_t m_s3c240x_iis_regs[0x14/4]; - uint32_t m_s3c240x_rtc_regs[0x4C/4]; - uint32_t m_s3c240x_adc_regs[0x08/4]; - uint32_t m_s3c240x_spi_regs[0x18/4]; - uint32_t m_s3c240x_mmc_regs[0x40/4]; + emu_timer *m_s3c240x_iis_timer = nullptr; + uint32_t m_s3c240x_iis_regs[0x14/4]{}; + uint32_t m_s3c240x_rtc_regs[0x4C/4]{}; + uint32_t m_s3c240x_adc_regs[0x08/4]{}; + uint32_t m_s3c240x_spi_regs[0x18/4]{}; + uint32_t m_s3c240x_mmc_regs[0x40/4]{}; bitmap_rgb32 m_bitmap; uint32_t s3c240x_lcd_r(offs_t offset); void s3c240x_lcd_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0); diff -Nru mame-0.242+dfsg.1/src/mame/includes/gundealr.h mame-0.243+dfsg.1/src/mame/includes/gundealr.h --- mame-0.242+dfsg.1/src/mame/includes/gundealr.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/gundealr.h 2022-04-29 05:37:26.000000000 +0000 @@ -41,9 +41,9 @@ optional_ioport_array<3> m_port_in; /* video-related */ - tilemap_t *m_bg_tilemap; - tilemap_t *m_fg_tilemap; - uint8_t m_scroll[4]; + tilemap_t *m_bg_tilemap = nullptr; + tilemap_t *m_fg_tilemap = nullptr; + uint8_t m_scroll[4]{}; /* misc */ int m_input_ports_hack; diff -Nru mame-0.242+dfsg.1/src/mame/includes/harddriv.h mame-0.243+dfsg.1/src/mame/includes/harddriv.h --- mame-0.242+dfsg.1/src/mame/includes/harddriv.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/harddriv.h 2022-04-29 05:37:26.000000000 +0000 @@ -306,18 +306,18 @@ output_finder<4> m_sel; output_finder<> m_wheel; - uint8_t m_hd34010_host_access; + uint8_t m_hd34010_host_access = 0; optional_shared_ptr m_msp_ram; - uint16_t * m_dsk_ram; - uint16_t * m_dsk_rom; + uint16_t * m_dsk_ram = nullptr; + uint16_t * m_dsk_rom = nullptr; optional_device m_dsk_10c; optional_device m_dsk_30c; - uint8_t m_dsk_pio_access; + uint8_t m_dsk_pio_access = 0; - uint16_t * m_m68k_sloop_base; - uint16_t * m_m68k_sloop_alt_base; + uint16_t * m_m68k_sloop_base = nullptr; + uint16_t * m_m68k_sloop_alt_base = nullptr; required_device m_200e; required_device m_210e; @@ -331,25 +331,25 @@ optional_shared_ptr m_dsp32_ram; - uint16_t * m_gsp_protection; + uint16_t * m_gsp_protection = nullptr; - uint16_t * m_gsp_speedup_addr[2]; - offs_t m_gsp_speedup_pc; + uint16_t * m_gsp_speedup_addr[2]{}; + offs_t m_gsp_speedup_pc = 0; - uint16_t * m_msp_speedup_addr; - offs_t m_msp_speedup_pc; + uint16_t * m_msp_speedup_addr = nullptr; + offs_t m_msp_speedup_pc = 0; - uint16_t * m_ds3_speedup_addr; - offs_t m_ds3_speedup_pc; - offs_t m_ds3_transfer_pc; + uint16_t * m_ds3_speedup_addr = nullptr; + offs_t m_ds3_speedup_pc = 0; + offs_t m_ds3_transfer_pc = 0; - uint32_t * m_rddsp32_sync[2]; + uint32_t * m_rddsp32_sync[2]{}; - uint32_t m_gsp_speedup_count[4]; - uint32_t m_msp_speedup_count[4]; - uint32_t m_adsp_speedup_count[4]; + uint32_t m_gsp_speedup_count[4]{}; + uint32_t m_msp_speedup_count[4]{}; + uint32_t m_adsp_speedup_count[4]{}; - uint8_t m_gsp_multisync; + uint8_t m_gsp_multisync = 0; optional_shared_ptr m_gsp_vram; optional_shared_ptr m_gsp_control_lo; optional_shared_ptr m_gsp_control_hi; @@ -362,97 +362,97 @@ optional_ioport_array<4> m_12badc; /* machine state */ - uint8_t m_irq_state; - uint8_t m_gsp_irq_state; - uint8_t m_msp_irq_state; - uint8_t m_adsp_irq_state; - uint8_t m_ds3sdsp_irq_state; - uint8_t m_duart_irq_state; - - uint8_t m_last_gsp_shiftreg; - - uint8_t m_m68k_zp1; - uint8_t m_m68k_zp2; - uint8_t m_m68k_adsp_buffer_bank; - - uint8_t m_adsp_halt; - uint8_t m_adsp_br; - uint8_t m_adsp_xflag; - uint16_t m_adsp_sim_address; - uint16_t m_adsp_som_address; - uint32_t m_adsp_eprom_base; + uint8_t m_irq_state = 0; + uint8_t m_gsp_irq_state = 0; + uint8_t m_msp_irq_state = 0; + uint8_t m_adsp_irq_state = 0; + uint8_t m_ds3sdsp_irq_state = 0; + uint8_t m_duart_irq_state = 0; + + uint8_t m_last_gsp_shiftreg = 0; + + uint8_t m_m68k_zp1 = 0; + uint8_t m_m68k_zp2 = 0; + uint8_t m_m68k_adsp_buffer_bank = 0; + + uint8_t m_adsp_halt = 0; + uint8_t m_adsp_br = 0; + uint8_t m_adsp_xflag = 0; + uint16_t m_adsp_sim_address = 0; + uint16_t m_adsp_som_address = 0; + uint32_t m_adsp_eprom_base = 0; required_region_ptr m_sim_memory; - uint16_t m_som_memory[0x8000/2]; - uint16_t * m_adsp_pgm_memory_word; + uint16_t m_som_memory[0x8000/2]{}; + uint16_t * m_adsp_pgm_memory_word = 0; - uint16_t * m_ds3_sdata_memory; - uint32_t m_ds3_sdata_memory_size; + uint16_t * m_ds3_sdata_memory = 0; + uint32_t m_ds3_sdata_memory_size = 0; - uint8_t m_ds3_gcmd; - uint8_t m_ds3_gflag; - uint8_t m_ds3_g68irqs; - uint8_t m_ds3_gfirqs; - uint8_t m_ds3_g68flag; - uint8_t m_ds3_send; - uint8_t m_ds3_reset; - uint16_t m_ds3_gdata; - uint16_t m_ds3_g68data; - uint32_t m_ds3_sim_address; - - uint8_t m_ds3_scmd; - uint8_t m_ds3_sflag; - uint8_t m_ds3_s68irqs; - uint8_t m_ds3_sfirqs; - uint8_t m_ds3_s68flag; - uint8_t m_ds3_sreset; - uint16_t m_ds3_sdata; - uint16_t m_ds3_s68data; - uint32_t m_ds3_sdata_address; - uint16_t m_ds3sdsp_regs[32]; - uint16_t m_ds3sdsp_timer_en; - uint16_t m_ds3sdsp_sdata; + uint8_t m_ds3_gcmd = 0; + uint8_t m_ds3_gflag = 0; + uint8_t m_ds3_g68irqs = 0; + uint8_t m_ds3_gfirqs = 0; + uint8_t m_ds3_g68flag = 0; + uint8_t m_ds3_send = 0; + uint8_t m_ds3_reset = 0; + uint16_t m_ds3_gdata = 0; + uint16_t m_ds3_g68data = 0; + uint32_t m_ds3_sim_address = 0; + + uint8_t m_ds3_scmd = 0; + uint8_t m_ds3_sflag = 0; + uint8_t m_ds3_s68irqs = 0; + uint8_t m_ds3_sfirqs = 0; + uint8_t m_ds3_s68flag = 0; + uint8_t m_ds3_sreset = 0; + uint16_t m_ds3_sdata = 0; + uint16_t m_ds3_s68data = 0; + uint32_t m_ds3_sdata_address = 0; + uint16_t m_ds3sdsp_regs[32]{}; + uint16_t m_ds3sdsp_timer_en = 0; + uint16_t m_ds3sdsp_sdata = 0; optional_device m_ds3sdsp_internal_timer; - uint16_t m_ds3xdsp_regs[32]; - uint16_t m_ds3xdsp_timer_en; - uint16_t m_ds3xdsp_sdata; + uint16_t m_ds3xdsp_regs[32]{}; + uint16_t m_ds3xdsp_timer_en = 0; + uint16_t m_ds3xdsp_sdata = 0; optional_device m_ds3xdsp_internal_timer; - uint16_t m_adc_control; - uint8_t m_adc12_select; - uint8_t m_adc12_byte; - uint16_t m_adc12_data; - - uint16_t m_hdc68k_last_wheel; - uint16_t m_hdc68k_last_port1; - uint8_t m_hdc68k_wheel_edge; - uint8_t m_hdc68k_shifter_state; - - uint8_t m_st68k_sloop_bank; - offs_t m_st68k_last_alt_sloop_offset; - - uint8_t m_sel_select; - uint8_t m_sel1_data; - uint8_t m_sel2_data; - uint8_t m_sel3_data; - uint8_t m_sel4_data; + uint16_t m_adc_control = 0; + uint8_t m_adc12_select = 0; + uint8_t m_adc12_byte = 0; + uint16_t m_adc12_data = 0; + + uint16_t m_hdc68k_last_wheel = 0; + uint16_t m_hdc68k_last_port1 = 0; + uint8_t m_hdc68k_wheel_edge = 0; + uint8_t m_hdc68k_shifter_state = 0; + + uint8_t m_st68k_sloop_bank = 0; + offs_t m_st68k_last_alt_sloop_offset = 0; + + uint8_t m_sel_select = 0; + uint8_t m_sel1_data = 0; + uint8_t m_sel2_data = 0; + uint8_t m_sel3_data = 0; + uint8_t m_sel4_data = 0; #define MAX_MSP_SYNC 16 - uint32_t * m_dataptr[MAX_MSP_SYNC]; - uint32_t m_dataval[MAX_MSP_SYNC]; - int m_next_msp_sync; + uint32_t * m_dataptr[MAX_MSP_SYNC]{}; + uint32_t m_dataval[MAX_MSP_SYNC]{}; + int m_next_msp_sync = 0; /* video state */ - offs_t m_vram_mask; + offs_t m_vram_mask = 0; - uint8_t m_shiftreg_enable; + uint8_t m_shiftreg_enable = 0; - uint32_t m_mask_table[65536 * 4]; - uint16_t * m_gsp_shiftreg_source; + uint32_t m_mask_table[65536 * 4]{}; + uint16_t * m_gsp_shiftreg_source = 0; - int8_t m_gfx_finescroll; - uint8_t m_gfx_palettebank; + int8_t m_gfx_finescroll = 0; + uint8_t m_gfx_palettebank = 0; virtual void update_interrupts(); void init_driver(); void init_multisync(int compact_inputs); @@ -485,8 +485,8 @@ inline void gsp_palette_change(int offset); - uint8_t m_sound_int_state; - uint8_t m_video_int_state; + uint8_t m_sound_int_state = 0; + uint8_t m_video_int_state = 0; optional_device m_palette; int get_hblank(screen_device &screen) const { return (screen.hpos() > (screen.width() * 9 / 10)); } @@ -557,18 +557,18 @@ required_shared_ptr m_sounddsp_ram; required_region_ptr m_sound_rom; - uint8_t m_soundflag; - uint8_t m_mainflag; - uint16_t m_sounddata; - uint16_t m_maindata; + uint8_t m_soundflag = 0; + uint8_t m_mainflag = 0; + uint16_t m_sounddata = 0; + uint16_t m_maindata = 0; - uint8_t m_cramen; - uint8_t m_irq68k; + uint8_t m_cramen = 0; + uint8_t m_irq68k = 0; - offs_t m_sound_rom_offs; + offs_t m_sound_rom_offs = 0; - uint16_t m_comram[0x400/2]; - uint64_t m_last_bio_cycles; + uint16_t m_comram[0x400/2]{}; + uint64_t m_last_bio_cycles = 0; void update_68k_interrupts(); TIMER_CALLBACK_MEMBER( delayed_68k_w ); diff -Nru mame-0.242+dfsg.1/src/mame/includes/hcastle.h mame-0.243+dfsg.1/src/mame/includes/hcastle.h --- mame-0.242+dfsg.1/src/mame/includes/hcastle.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/hcastle.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,88 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Bryan McPhail -/************************************************************************* - - Haunted Castle - -*************************************************************************/ -#ifndef MAME_INCLUDES_HCASTLE_H -#define MAME_INCLUDES_HCASTLE_H - -#pragma once - -#include "video/bufsprite.h" -#include "sound/k007232.h" -#include "video/k007121.h" -#include "emupal.h" -#include "tilemap.h" - -class hcastle_state : public driver_device -{ -public: - hcastle_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_spriteram(*this, "spriteram"), - m_spriteram2(*this, "spriteram2") , - m_pf1_videoram(*this, "pf1_videoram"), - m_pf2_videoram(*this, "pf2_videoram"), - m_audiocpu(*this, "audiocpu"), - m_k007121_1(*this, "k007121_1"), - m_k007121_2(*this, "k007121_2"), - m_k007232(*this, "k007232"), - m_maincpu(*this, "maincpu"), - m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") - { } - - void hcastle(machine_config &config); - -private: - required_device m_spriteram; - required_device m_spriteram2; - /* memory pointers */ - required_shared_ptr m_pf1_videoram; - required_shared_ptr m_pf2_videoram; - - /* video-related */ - tilemap_t *m_fg_tilemap = nullptr; - tilemap_t *m_bg_tilemap = nullptr; - int m_pf2_bankbase = 0; - int m_pf1_bankbase = 0; - int m_old_pf1 = 0; - int m_old_pf2 = 0; - int m_gfx_bank = 0; - - /* devices */ - required_device m_audiocpu; - required_device m_k007121_1; - required_device m_k007121_2; - required_device m_k007232; - - void hcastle_bankswitch_w(uint8_t data); - void hcastle_soundirq_w(uint8_t data); - void hcastle_coin_w(uint8_t data); - void hcastle_pf1_video_w(offs_t offset, uint8_t data); - void hcastle_pf2_video_w(offs_t offset, uint8_t data); - void hcastle_gfxbank_w(uint8_t data); - uint8_t hcastle_gfxbank_r(); - void hcastle_pf1_control_w(offs_t offset, uint8_t data); - void hcastle_pf2_control_w(offs_t offset, uint8_t data); - void sound_bank_w(uint8_t data); - TILEMAP_MAPPER_MEMBER(tilemap_scan); - TILE_GET_INFO_MEMBER(get_fg_tile_info); - TILE_GET_INFO_MEMBER(get_bg_tile_info); - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; - void hcastle_palette(palette_device &palette) const; - uint32_t screen_update_hcastle(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, uint8_t *sbank, int bank ); - void volume_callback(uint8_t data); - required_device m_maincpu; - required_device m_gfxdecode; - required_device m_palette; - void hcastle_map(address_map &map); - void sound_map(address_map &map); -}; - -#endif // MAME_INCLUDES_HCASTLE_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/hec2hrp.h mame-0.243+dfsg.1/src/mame/includes/hec2hrp.h --- mame-0.242+dfsg.1/src/mame/includes/hec2hrp.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/hec2hrp.h 2022-04-29 05:37:26.000000000 +0000 @@ -127,38 +127,38 @@ static void minidisc_formats(format_registration &fr); - bool m_hector_flag_hr; - bool m_hector_flag_80c; - uint8_t m_hector_color[4]; - uint8_t m_hector_disc2_data_r_ready; - uint8_t m_hector_disc2_data_w_ready; - uint8_t m_hector_disc2_data_read; - uint8_t m_hector_disc2_data_write; - bool m_hector_disc2_rnmi; - uint8_t m_state3000; - bool m_write_cassette; - emu_timer *m_cassette_timer; - uint8_t m_ck_signal; - bool m_flag_clk; - double m_pin_value[29][2]; - u8 m_au[17]; - u8 m_val_mixer; - u8 m_oldstate3000; - u8 m_oldstate1000; - uint8_t m_pot0; - uint8_t m_pot1; - uint8_t m_actions; - uint8_t m_hector_port_a; - uint8_t m_hector_port_b; - uint8_t m_hector_port_c_h; - uint8_t m_hector_port_c_l; - uint8_t m_hector_port_cmd; - bool m_cassette_bit; - bool m_cassette_bit_mem; - uint8_t m_data_k7; - int m_counter_write; - bool m_irq_current_state; - bool m_nmi_current_state; + bool m_hector_flag_hr = 0; + bool m_hector_flag_80c = 0; + uint8_t m_hector_color[4]{}; + uint8_t m_hector_disc2_data_r_ready = 0; + uint8_t m_hector_disc2_data_w_ready = 0; + uint8_t m_hector_disc2_data_read = 0; + uint8_t m_hector_disc2_data_write = 0; + bool m_hector_disc2_rnmi = false; + uint8_t m_state3000 = 0; + bool m_write_cassette = false; + emu_timer *m_cassette_timer = nullptr; + uint8_t m_ck_signal = 0; + bool m_flag_clk = false; + double m_pin_value[29][2]{}; + u8 m_au[17]{}; + u8 m_val_mixer = 0; + u8 m_oldstate3000 = 0; + u8 m_oldstate1000 = 0; + uint8_t m_pot0 = 0; + uint8_t m_pot1 = 0; + uint8_t m_actions = 0; + uint8_t m_hector_port_a = 0; + uint8_t m_hector_port_b = 0; + uint8_t m_hector_port_c_h = 0; + uint8_t m_hector_port_c_l = 0; + uint8_t m_hector_port_cmd = 0; + bool m_cassette_bit = false; + bool m_cassette_bit_mem = false; + uint8_t m_data_k7 = 0; + int m_counter_write = 0; + bool m_irq_current_state = false; + bool m_nmi_current_state = false; DECLARE_MACHINE_RESET(interact); DECLARE_MACHINE_START(hec2hrp); diff -Nru mame-0.242+dfsg.1/src/mame/includes/hexion.h mame-0.243+dfsg.1/src/mame/includes/hexion.h --- mame-0.242+dfsg.1/src/mame/includes/hexion.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/hexion.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,67 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Nicola Salmoria -#ifndef MAME_INCLUDES_HEXION_H -#define MAME_INCLUDES_HEXION_H - -#pragma once - -#include "machine/k053252.h" -#include "machine/timer.h" -#include "emupal.h" -#include "tilemap.h" - -class hexion_state : public driver_device -{ -public: - hexion_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_k053252(*this, "k053252"), - m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") - { } - - void hexion(machine_config &config); - void hexionb(machine_config &config); - -protected: - virtual void video_start() override; - -private: - required_device m_maincpu; - required_device m_k053252; - required_device m_gfxdecode; - required_device m_palette; - - uint8_t *m_vram[2]{}; - uint8_t *m_unkram = nullptr; - int m_bankctrl = 0; - int m_rambank = 0; - int m_pmcbank = 0; - int m_gfxrom_select = 0; - int m_ccu_int_time = 0; - int m_ccu_int_time_count = 0; - tilemap_t *m_bg_tilemap[2]{}; - - void coincntr_w(uint8_t data); - void bankswitch_w(uint8_t data); - uint8_t bankedram_r(offs_t offset); - void bankedram_w(offs_t offset, uint8_t data); - void bankctrl_w(uint8_t data); - void gfxrom_select_w(uint8_t data); - DECLARE_WRITE_LINE_MEMBER(irq_ack_w); - DECLARE_WRITE_LINE_MEMBER(nmi_ack_w); - void ccu_int_time_w(uint8_t data); - - TILE_GET_INFO_MEMBER(get_tile_info0); - TILE_GET_INFO_MEMBER(get_tile_info1); - - TIMER_DEVICE_CALLBACK_MEMBER(scanline); - - uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - inline void get_tile_info(tile_data &tileinfo,int tile_index,uint8_t *ram); - void hexion_map(address_map &map); - void hexionb_map(address_map &map); -}; - -#endif // MAME_INCLUDES_HEXION_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/hh_sm510.h mame-0.243+dfsg.1/src/mame/includes/hh_sm510.h --- mame-0.242+dfsg.1/src/mame/includes/hh_sm510.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/hh_sm510.h 2022-04-29 05:37:26.000000000 +0000 @@ -32,11 +32,7 @@ m_inputs(*this, "IN.%u", 0), m_io_ba(*this, "BA"), m_io_b(*this, "B"), - m_out_x(*this, "%u.%u.%u", 0U, 0U, 0U), - m_inp_lines(0), - m_inp_fixed(-1), - m_decay_pivot(8), - m_decay_len(17) + m_out_x(*this, "%u.%u.%u", 0U, 0U, 0U) { } virtual DECLARE_INPUT_CHANGED_MEMBER(input_changed); @@ -51,12 +47,12 @@ output_finder<16, 16, 4> m_out_x; // misc common - u16 m_inp_mux; // multiplexed inputs mask - int m_inp_lines; // number of input mux columns - int m_inp_fixed; // input column fixed to GND/Vdd (-1 means none) - u8 m_speaker_data; // speaker output data(if more than 1 bit) - u8 m_s; // MCU S output pins - u8 m_r; // MCU R output pins + u16 m_inp_mux = 0; // multiplexed inputs mask + int m_inp_lines = 0; // number of input mux columns + int m_inp_fixed = -1; // input column fixed to GND/Vdd (-1 means none) + u8 m_speaker_data = 0; // speaker output data(if more than 1 bit) + u8 m_s = 0; // MCU S output pins + u8 m_r = 0; // MCU R output pins void inp_fixed_last() { m_inp_fixed = -2; } // last input line to GND u8 read_inputs(int columns, int fixed = -1); @@ -73,17 +69,17 @@ virtual void piezo2bit_input_w(u8 data); // display common - int m_decay_pivot; // lcd segment off-to-on delay in 1kHz ticks (affects input lag) - int m_decay_len; // lcd segment on-to-off delay in 1kHz ticks (lcd persistence) - u8 m_display_x_len; // lcd number of groups - u8 m_display_y_len; // lcd number of segments - u8 m_display_z_len; // lcd number of commons - u32 m_display_state[0x20]; // lcd segment data (max. 5-bit offset) - u8 m_display_decay[0x20][0x20]; // (internal use) + int m_decay_pivot = 8; // lcd segment off-to-on delay in 1kHz ticks (affects input lag) + int m_decay_len = 17; // lcd segment on-to-off delay in 1kHz ticks (lcd persistence) + u8 m_display_x_len = 0; // lcd number of groups + u8 m_display_y_len = 0; // lcd number of segments + u8 m_display_z_len = 0; // lcd number of commons + u32 m_display_state[0x20] = { }; // lcd segment data (max. 5-bit offset) + u8 m_display_decay[0x20][0x20] = { }; // (internal use) void set_display_size(u8 x, u8 y, u8 z); TIMER_CALLBACK_MEMBER(display_decay_tick); - emu_timer *m_display_decay_timer; + emu_timer *m_display_decay_timer = nullptr; virtual void machine_start() override; virtual void machine_reset() override; diff -Nru mame-0.242+dfsg.1/src/mame/includes/himesiki.h mame-0.243+dfsg.1/src/mame/includes/himesiki.h --- mame-0.242+dfsg.1/src/mame/includes/himesiki.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/himesiki.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,72 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Uki - -/************************************************************************* - - Himeshikibu - -*************************************************************************/ -#ifndef MAME_INCLUDES_HIMESIKI_H -#define MAME_INCLUDES_HIMESIKI_H - -#pragma once - -#include "machine/gen_latch.h" -#include "emupal.h" -#include "tilemap.h" - -class himesiki_state : public driver_device -{ -public: - himesiki_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_bg_ram(*this, "bg_ram"), - m_spriteram_p103a(*this, "sprram_p103a"), - m_spriteram(*this, "spriteram"), - m_maincpu(*this, "maincpu"), - m_subcpu(*this, "sub"), - m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette"), - m_soundlatch(*this, "soundlatch") - { } - - void himesiki(machine_config &config); - -private: - // memory pointers - required_shared_ptr m_bg_ram; - required_shared_ptr m_spriteram_p103a; - required_shared_ptr m_spriteram; - - // video-related - tilemap_t *m_bg_tilemap = nullptr; - int m_scrollx[2]{}; - int m_scrolly = 0; - - int m_flipscreen = 0; - - // devices - required_device m_maincpu; - required_device m_subcpu; - required_device m_gfxdecode; - required_device m_palette; - required_device m_soundlatch; - - void himesiki_rombank_w(uint8_t data); - void himesiki_sound_w(uint8_t data); - void himesiki_bg_ram_w(offs_t offset, uint8_t data); - void himesiki_scrollx_w(offs_t offset, uint8_t data); - void himesiki_scrolly_w(uint8_t data); - TILE_GET_INFO_MEMBER(get_bg_tile_info); - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; - uint32_t screen_update_himesiki(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void himesiki_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); - void himesiki_iom0(address_map &map); - void himesiki_iom1(address_map &map); - void himesiki_prm0(address_map &map); - void himesiki_prm1(address_map &map); -}; - -#endif // MAME_INCLUDES_HIMESIKI_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/hng64.h mame-0.243+dfsg.1/src/mame/includes/hng64.h --- mame-0.242+dfsg.1/src/mame/includes/hng64.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/hng64.h 2022-04-29 05:37:26.000000000 +0000 @@ -25,37 +25,37 @@ struct polyVert { - float worldCoords[4]; // World space coordinates (X Y Z 1.0) + float worldCoords[4]{}; // World space coordinates (X Y Z 1.0) - float texCoords[4]; // Texture coordinates (U V 0 1.0) -> OpenGL style... + float texCoords[4]{}; // Texture coordinates (U V 0 1.0) -> OpenGL style... - float normal[4]; // Normal (X Y Z 1.0) - float clipCoords[4]; // Homogeneous screen space coordinates (X Y Z W) + float normal[4]{}; // Normal (X Y Z 1.0) + float clipCoords[4]{}; // Homogeneous screen space coordinates (X Y Z W) - float light[3]; // The intensity of the illumination at this point + float light[3]{}; // The intensity of the illumination at this point - uint16_t colorIndex; // Flat shaded polygons, no texture, no lighting + uint16_t colorIndex = 0; // Flat shaded polygons, no texture, no lighting }; struct polygon { - int n; // Number of sides - polyVert vert[10]; // Vertices (maximum number per polygon is 10 -> 3+6) + int n = 0; // Number of sides + polyVert vert[10]{}; // Vertices (maximum number per polygon is 10 -> 3+6) - float faceNormal[4]; // Normal of the face overall - for calculating visibility and flat-shading... - bool visible; // Polygon visibility in scene - bool flatShade; // Flat shaded polygon, no texture, no lighting - - uint8_t texIndex; // Which texture to draw from (0x00-0x0f) - uint8_t texType; // How to index into the texture - uint8_t texPageSmall; // Does this polygon use 'small' texture pages? - uint8_t texPageHorizOffset; // If it does use small texture pages, how far is this page horizontally offset? - uint8_t texPageVertOffset; // If it does use small texture pages, how far is this page vertically offset? + float faceNormal[4]{}; // Normal of the face overall - for calculating visibility and flat-shading... + bool visible = false; // Polygon visibility in scene + bool flatShade = false; // Flat shaded polygon, no texture, no lighting + + uint8_t texIndex = 0; // Which texture to draw from (0x00-0x0f) + uint8_t texType = 0; // How to index into the texture + uint8_t texPageSmall = 0; // Does this polygon use 'small' texture pages? + uint8_t texPageHorizOffset = 0; // If it does use small texture pages, how far is this page horizontally offset? + uint8_t texPageVertOffset = 0; // If it does use small texture pages, how far is this page vertically offset? - uint32_t palOffset; // The base offset where this object's palette starts. - uint32_t palPageSize; // The size of the palette page that is being pointed to. + uint32_t palOffset = 0; // The base offset where this object's palette starts. + uint32_t palPageSize = 0; // The size of the palette page that is being pointed to. - uint32_t debugColor; // Will go away someday. Used to explicitly color polygons for debugging. + uint32_t debugColor = 0; // Will go away someday. Used to explicitly color polygons for debugging. }; @@ -82,14 +82,14 @@ struct hng64_poly_data { - uint8_t texType; - uint8_t texIndex; - uint8_t texPageSmall; - uint8_t texPageHorizOffset; - uint8_t texPageVertOffset; - int palOffset; - int palPageSize; - int debugColor; + uint8_t texType = 0; + uint8_t texIndex = 0; + uint8_t texPageSmall = 0; + uint8_t texPageHorizOffset = 0; + uint8_t texPageVertOffset = 0; + int palOffset = 0; + int palPageSize = 0; + int debugColor = 0; }; class hng64_state; @@ -182,7 +182,7 @@ void init_ss64(); void init_hng64_fght(); - uint8_t *m_texturerom; + uint8_t *m_texturerom = nullptr; required_device m_screen; required_device m_palette; @@ -209,12 +209,12 @@ struct blit_parameters { - bitmap_rgb32 * bitmap; + bitmap_rgb32 * bitmap = nullptr; rectangle cliprect; - uint32_t tilemap_priority_code; - uint8_t mask; - uint8_t value; - uint8_t alpha; + uint32_t tilemap_priority_code = 0; + uint8_t mask = 0; + uint8_t value = 0; + uint8_t alpha = 0; hng64trans_t drawformat; }; @@ -264,7 +264,7 @@ int m_samsho64_3d_hack; int m_roadedge_3d_hack; - uint8_t m_fbcontrol[4]; + uint8_t m_fbcontrol[4]{}; std::unique_ptr m_soundram; std::unique_ptr m_soundram2; @@ -272,13 +272,13 @@ /* Communications stuff */ std::unique_ptr m_com_op_base; std::unique_ptr m_com_virtual_mem; - uint8_t m_com_shared[8]; + uint8_t m_com_shared[8]{}; - int32_t m_dma_start; - int32_t m_dma_dst; - int32_t m_dma_len; + int32_t m_dma_start = 0; + int32_t m_dma_dst = 0; + int32_t m_dma_len = 0; - uint16_t m_mcu_en; + uint16_t m_mcu_en = 0; uint32_t m_activeDisplayList = 0U; uint32_t m_no_machine_error_code = 0U; @@ -307,7 +307,7 @@ uint16_t m_old_tileflags[4]{}; // 3d State - int m_paletteState3d; + int m_paletteState3d = 0; float m_projectionMatrix[16]{}; float m_modelViewMatrix[16]{}; float m_cameraMatrix[16]{}; @@ -390,28 +390,28 @@ DECLARE_WRITE_LINE_MEMBER( sio0_w ); - uint8_t m_port7; - uint8_t m_port1; + uint8_t m_port7 = 0; + uint8_t m_port1 = 0; - int m_ex_ramaddr; - int m_ex_ramaddr_upper; + int m_ex_ramaddr = 0; + int m_ex_ramaddr_upper = 0; TIMER_CALLBACK_MEMBER(tempio_irqon_callback); TIMER_CALLBACK_MEMBER(tempio_irqoff_callback); - emu_timer *m_tempio_irqon_timer; - emu_timer *m_tempio_irqoff_timer; + emu_timer *m_tempio_irqon_timer = nullptr; + emu_timer *m_tempio_irqoff_timer = nullptr; void init_io(); void init_hng64_reorder_gfx(); void set_irq(uint32_t irq_vector); - uint32_t m_irq_pending; + uint32_t m_irq_pending = 0; TIMER_CALLBACK_MEMBER(comhack_callback); - emu_timer *m_comhack_timer; + emu_timer *m_comhack_timer = nullptr; - int m_irq_level; + int m_irq_level = 0; TILE_GET_INFO_MEMBER(get_hng64_tile0_8x8_info); TILE_GET_INFO_MEMBER(get_hng64_tile0_16x16_info); TILE_GET_INFO_MEMBER(get_hng64_tile1_8x8_info); @@ -450,10 +450,10 @@ std::unique_ptr m_poly_renderer; TIMER_CALLBACK_MEMBER(hng64_3dfifo_processed); - emu_timer *m_3dfifo_timer; + emu_timer *m_3dfifo_timer = nullptr; - uint16_t* m_vertsrom; - int m_vertsrom_size; + uint16_t* m_vertsrom = nullptr; + int m_vertsrom_size = 0; std::vector m_polys; // HNG64_MAX_POLYGONS void clear3d(); @@ -498,8 +498,8 @@ void main_sound_comms_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); uint16_t sound_comms_r(offs_t offset); void sound_comms_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - uint16_t main_latch[2]; - uint16_t sound_latch[2]; + uint16_t main_latch[2]{}; + uint16_t sound_latch[2]{}; void hng64_audio(machine_config &config); void hng64_network(machine_config &config); void hng_comm_io_map(address_map &map); diff -Nru mame-0.242+dfsg.1/src/mame/includes/homedata.h mame-0.243+dfsg.1/src/mame/includes/homedata.h --- mame-0.242+dfsg.1/src/mame/includes/homedata.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/homedata.h 2022-04-29 05:37:26.000000000 +0000 @@ -59,22 +59,22 @@ optional_memory_bank m_audiobank; /* video-related */ - tilemap_t *m_bg_tilemap[2][4]; - int m_visible_page; - int m_priority; - uint8_t m_reikaids_which; - int m_flipscreen; - uint8_t m_gfx_bank[2]; // pteacher only uses the first one - uint8_t m_blitter_bank; - int m_blitter_param_count; - uint8_t m_blitter_param[4]; /* buffers last 4 writes to 0x8006 */ + tilemap_t *m_bg_tilemap[2][4]{}; + int m_visible_page = 0; + int m_priority = 0; + uint8_t m_reikaids_which = 0; + int m_flipscreen = 0; + uint8_t m_gfx_bank[2]{}; // pteacher only uses the first one + uint8_t m_blitter_bank = 0; + int m_blitter_param_count = 0; + uint8_t m_blitter_param[4]{}; /* buffers last 4 writes to 0x8006 */ /* misc */ - int m_vblank; - int m_keyb; - int m_upd7807_porta; - int m_upd7807_portc; + int m_vblank = 0; + int m_keyb = 0; + int m_upd7807_porta = 0; + int m_upd7807_portc = 0; /* device */ required_device m_maincpu; @@ -89,7 +89,7 @@ optional_ioport_array<12> m_keys; - uint8_t m_prot_data; + uint8_t m_prot_data = 0; uint8_t mrokumei_keyboard_r(offs_t offset); void mrokumei_keyboard_select_w(uint8_t data); void mrokumei_sound_bank_w(uint8_t data); diff -Nru mame-0.242+dfsg.1/src/mame/includes/homerun.h mame-0.243+dfsg.1/src/mame/includes/homerun.h --- mame-0.242+dfsg.1/src/mame/includes/homerun.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/homerun.h 2022-04-29 05:37:26.000000000 +0000 @@ -54,13 +54,13 @@ required_memory_bank m_mainbank; - u8 m_control; - u8 m_sample; + u8 m_control = 0; + u8 m_sample = 0; - tilemap_t *m_tilemap; - int m_gfx_ctrl; - int m_scrollx; - int m_scrolly; + tilemap_t *m_tilemap = nullptr; + int m_gfx_ctrl = 0; + int m_scrollx = 0; + int m_scrolly = 0; void control_w(u8 data); void d7756_sample_w(u8 data); diff -Nru mame-0.242+dfsg.1/src/mame/includes/hp48.h mame-0.243+dfsg.1/src/mame/includes/hp48.h --- mame-0.242+dfsg.1/src/mame/includes/hp48.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/hp48.h 2022-04-29 05:37:26.000000000 +0000 @@ -76,7 +76,7 @@ const char *read_name = nullptr; write8sm_delegate write; void* data = nullptr; // non-NULL for banks - int isnop; + int isnop = 0; /* configurable part */ uint8_t state = 0U; // one of HP48_MODULE_ @@ -142,7 +142,7 @@ uint8_t *m_videoram = nullptr; uint8_t m_io[64]{}; - hp48_models m_model{}; + hp48_models m_model; /* OUT register from SATURN (actually 12-bit) */ uint16_t m_out = 0U; diff -Nru mame-0.242+dfsg.1/src/mame/includes/hp9845.h mame-0.243+dfsg.1/src/mame/includes/hp9845.h --- mame-0.242+dfsg.1/src/mame/includes/hp9845.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/hp9845.h 2022-04-29 05:37:26.000000000 +0000 @@ -87,19 +87,19 @@ // Text mode video I/F struct video_buffer_t { - uint8_t chars[ 80 ]; - uint8_t attrs[ 80 ]; + uint8_t chars[ 80 ]{}; + uint8_t attrs[ 80 ]{}; bool full = 0; }; bitmap_rgb32 m_bitmap; - offs_t m_video_mar; - uint16_t m_video_word; - bool m_video_load_mar; - bool m_video_first_mar; - bool m_video_byte_idx; - bool m_video_buff_idx; - bool m_video_blanked; + offs_t m_video_mar = 0; + uint16_t m_video_word = 0; + bool m_video_load_mar = false; + bool m_video_first_mar = false; + bool m_video_byte_idx = false; + bool m_video_buff_idx = false; + bool m_video_blanked = false; video_buffer_t m_video_buff[ 2 ]; // Graphic video @@ -115,29 +115,29 @@ GV_STAT_WAIT_MEM_2 }; - bool m_graphic_sel; + bool m_graphic_sel = false; gv_fsm_state_t m_gv_fsm_state; - bool m_gv_int_en; - bool m_gv_dma_en; - uint8_t m_gv_cmd; // U65 (GC) - uint16_t m_gv_data_w; // U29, U45, U28 & U44 (GC) - uint16_t m_gv_data_r; // U59 & U60 (GC) - uint16_t m_gv_io_counter; // U1, U2, U14 & U15 (GC) - uint16_t m_gv_cursor_x; // U31 & U23 (GS) - uint16_t m_gv_cursor_y; // U15 & U8 (GS) - bool m_gv_cursor_gc; // U8 (GS) - bool m_gv_cursor_fs; // U8 (GS) + bool m_gv_int_en = false; + bool m_gv_dma_en = false; + uint8_t m_gv_cmd = 0; // U65 (GC) + uint16_t m_gv_data_w = 0; // U29, U45, U28 & U44 (GC) + uint16_t m_gv_data_r = 0; // U59 & U60 (GC) + uint16_t m_gv_io_counter = 0; // U1, U2, U14 & U15 (GC) + uint16_t m_gv_cursor_x = 0; // U31 & U23 (GS) + uint16_t m_gv_cursor_y = 0; // U15 & U8 (GS) + bool m_gv_cursor_gc = false; // U8 (GS) + bool m_gv_cursor_fs = false; // U8 (GS) // State of keyboard ioport_value m_kb_state[ 4 ]; - uint8_t m_kb_scancode; - uint16_t m_kb_status; + uint8_t m_kb_scancode = 0; + uint16_t m_kb_status = 0; // Printer - bool m_prt_irl; + bool m_prt_irl = false; // SC of slots - int m_slot_sc[ 4 ]; + int m_slot_sc[ 4 ]{}; }; #endif // MAME_INCLUDES_HP9845_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/huebler.h mame-0.243+dfsg.1/src/mame/includes/huebler.h --- mame-0.242+dfsg.1/src/mame/includes/huebler.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/huebler.h 2022-04-29 05:37:26.000000000 +0000 @@ -66,8 +66,8 @@ // keyboard state int m_key_d6; int m_key_d7; - int m_key_a4; - int m_key_a5; + int m_key_a4 = 0; + int m_key_a5 = 0; int m_key_a8; // video state @@ -79,8 +79,8 @@ void amu880_mem(address_map &map); // cassette variables - u8 m_cnt; - bool m_cassbit; + u8 m_cnt = 0; + bool m_cassbit = false; }; #endif diff -Nru mame-0.242+dfsg.1/src/mame/includes/hx20.h mame-0.243+dfsg.1/src/mame/includes/hx20.h --- mame-0.242+dfsg.1/src/mame/includes/hx20.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/hx20.h 2022-04-29 05:37:26.000000000 +0000 @@ -101,22 +101,22 @@ void update_interrupt(); // CPU state - int m_slave_sio; - int m_slave_rx; - int m_slave_tx; - int m_slave_flag; - int m_rtc_irq; + int m_slave_sio = 0; + int m_slave_rx = 0; + int m_slave_tx = 0; + int m_slave_flag = 0; + int m_rtc_irq = 0; // keyboard state - uint8_t m_ksc; - int m_kbrequest; + uint8_t m_ksc = 0; + int m_kbrequest = 0; // video state - uint8_t m_lcd_data; + uint8_t m_lcd_data = 0; // sio state - int m_sio_rx; - int m_sio_pin; + int m_sio_rx = 0; + int m_sio_pin = 0; void hx20_mem(address_map &map); void hx20_sub_mem(address_map &map); diff -Nru mame-0.242+dfsg.1/src/mame/includes/intv.h mame-0.243+dfsg.1/src/mame/includes/intv.h --- mame-0.242+dfsg.1/src/mame/includes/intv.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/intv.h 2022-04-29 05:37:26.000000000 +0000 @@ -86,12 +86,12 @@ void intv_ram16_w(offs_t offset, uint16_t data); uint8_t intvkb_iocart_r(offs_t offset); - uint8_t m_bus_copy_mode; - uint8_t m_backtab_row; - uint16_t m_ram16[0x160]; - int m_sr1_int_pending; - uint8_t m_ram8[256]; - bool m_maincpu_reset; + uint8_t m_bus_copy_mode = 0; + uint8_t m_backtab_row = 0; + uint16_t m_ram16[0x160]{}; + int m_sr1_int_pending = 0; + uint8_t m_ram8[256]{}; + bool m_maincpu_reset = false; // Keyboard Component void intvkbd_dualport16_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); @@ -106,15 +106,15 @@ uint16_t iab_r(); - bool m_printer_not_busy; // printer state - bool m_printer_no_paper; // printer state - bool m_printer_not_busy_enable; // printer interface state - - int m_intvkbd_text_blanked; - int m_intvkbd_keyboard_col; - int m_tape_int_pending; - int m_tape_interrupts_enabled; - int m_tape_motor_mode; + bool m_printer_not_busy = false; // printer state + bool m_printer_no_paper = false; // printer state + bool m_printer_not_busy_enable = false; // printer interface state + + int m_intvkbd_text_blanked = 0; + int m_intvkbd_keyboard_col = 0; + int m_tape_int_pending = 0; + int m_tape_interrupts_enabled = 0; + int m_tape_motor_mode = 0; virtual void machine_start() override; virtual void machine_reset() override; @@ -135,7 +135,7 @@ void intvkbd_mem(address_map &map); void intvoice_mem(address_map &map); - int m_is_keybd; + int m_is_keybd = 0; optional_device m_keyboard; optional_device m_iocart1; diff -Nru mame-0.242+dfsg.1/src/mame/includes/itech32.h mame-0.243+dfsg.1/src/mame/includes/itech32.h --- mame-0.242+dfsg.1/src/mame/includes/itech32.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/itech32.h 2022-04-29 05:37:26.000000000 +0000 @@ -106,42 +106,42 @@ virtual void nvram_init(nvram_device &nvram, void *base, size_t length); std::unique_ptr m_videoram; - u8 m_vint_state; - u8 m_xint_state; - u8 m_qint_state; - u8 m_irq_base; - u8 m_sound_return; - offs_t m_itech020_prot_address; - int m_special_result; - int m_p1_effx; - int m_p1_effy; - int m_p1_lastresult; - attotime m_p1_lasttime; - int m_p2_effx; - int m_p2_effy; - int m_p2_lastresult; - attotime m_p2_lasttime; - u8 m_written[0x8000]; - u16 m_xfer_xcount; - u16 m_xfer_ycount; - u16 m_xfer_xcur; - u16 m_xfer_ycur; - rectangle m_clip_rect; - rectangle m_scaled_clip_rect; - rectangle m_clip_save; - emu_timer *m_scanline_timer; - u32 m_grom_bank; - u16 m_color_latch[2]; - u8 m_enable_latch[2]; - u16 *m_videoplane[2]; + u8 m_vint_state = 0; + u8 m_xint_state = 0; + u8 m_qint_state = 0; + u8 m_irq_base = 0; + u8 m_sound_return = 0; + offs_t m_itech020_prot_address = 0; + int m_special_result = 0; + int m_p1_effx = 0; + int m_p1_effy = 0; + int m_p1_lastresult = 0; + attotime m_p1_lasttime{}; + int m_p2_effx = 0; + int m_p2_effy = 0; + int m_p2_lastresult = 0; + attotime m_p2_lasttime{}; + u8 m_written[0x8000]{}; + u16 m_xfer_xcount = 0; + u16 m_xfer_ycount = 0; + u16 m_xfer_xcur = 0; + u16 m_xfer_ycur = 0; + rectangle m_clip_rect{}; + rectangle m_scaled_clip_rect{}; + rectangle m_clip_save{}; + emu_timer *m_scanline_timer = nullptr; + u32 m_grom_bank = 0; + u16 m_color_latch[2]{}; + u8 m_enable_latch[2]{}; + u16 *m_videoplane[2]{}; // configuration at init time - u8 m_planes; - u16 m_vram_height; - u32 m_vram_mask; - u32 m_vram_xmask; - u32 m_vram_ymask; - u32 m_grom_bank_mask; + u8 m_planes = 0; + u16 m_vram_height = 0; + u32 m_vram_mask = 0; + u32 m_vram_xmask = 0; + u32 m_vram_ymask = 0; + u32 m_grom_bank_mask = 0; void int1_ack_w(u16 data); u8 trackball_r(); @@ -301,7 +301,7 @@ required_ioport m_dips; required_ioport_array<2> m_gun_x; required_ioport_array<2> m_gun_y; - emu_timer *m_gun_timer; + emu_timer *m_gun_timer = nullptr; }; #endif // MAME_INCLUDES_ITECH32_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/itech8.h mame-0.243+dfsg.1/src/mame/includes/itech8.h --- mame-0.242+dfsg.1/src/mame/includes/itech8.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/itech8.h 2022-04-29 05:37:26.000000000 +0000 @@ -97,42 +97,42 @@ optional_ioport m_p1; optional_ioport m_p2; - rectangle m_visarea; + rectangle m_visarea{}; - uint8_t m_grom_bank; - uint8_t m_blitter_int; - uint8_t m_tms34061_int; - uint8_t m_periodic_int; - uint8_t m_pia_porta_data; - uint8_t m_pia_portb_data; - uint8_t m_z80_ctrl; - uint8_t m_z80_port_val; - uint8_t m_z80_clear_to_send; - uint16_t m_sensor0; - uint16_t m_sensor1; - uint16_t m_sensor2; - uint16_t m_sensor3; - uint8_t m_curvx; - uint8_t m_curvy; - uint8_t m_curx; - int8_t m_xbuffer[YBUFFER_COUNT]; - int8_t m_ybuffer[YBUFFER_COUNT]; - int m_ybuffer_next; - int m_curxpos; - int m_last_ytotal; - uint8_t m_crosshair_vis; - uint8_t m_blitter_data[16]; - uint8_t m_blit_in_progress; - uint8_t m_page_select; - offs_t m_fetch_offset; - uint8_t m_fetch_rle_count; - uint8_t m_fetch_rle_value; - uint8_t m_fetch_rle_literal; - emu_timer *m_irq_off_timer; - emu_timer *m_behind_beam_update_timer; - emu_timer *m_blitter_done_timer; - emu_timer *m_delayed_z80_control_timer; - int m_bankxor; + uint8_t m_grom_bank = 0; + uint8_t m_blitter_int = 0; + uint8_t m_tms34061_int = 0; + uint8_t m_periodic_int = 0; + uint8_t m_pia_porta_data = 0; + uint8_t m_pia_portb_data = 0; + uint8_t m_z80_ctrl = 0; + uint8_t m_z80_port_val = 0; + uint8_t m_z80_clear_to_send = 0; + uint16_t m_sensor0 = 0; + uint16_t m_sensor1 = 0; + uint16_t m_sensor2 = 0; + uint16_t m_sensor3 = 0; + uint8_t m_curvx = 0; + uint8_t m_curvy = 0; + uint8_t m_curx = 0; + int8_t m_xbuffer[YBUFFER_COUNT]{}; + int8_t m_ybuffer[YBUFFER_COUNT]{}; + int m_ybuffer_next = 0; + int m_curxpos = 0; + int m_last_ytotal = 0; + uint8_t m_crosshair_vis = 0; + uint8_t m_blitter_data[16]{}; + uint8_t m_blit_in_progress = 0; + uint8_t m_page_select = 0; + offs_t m_fetch_offset = 0; + uint8_t m_fetch_rle_count = 0; + uint8_t m_fetch_rle_value = 0; + uint8_t m_fetch_rle_literal = 0; + emu_timer *m_irq_off_timer = nullptr; + emu_timer *m_behind_beam_update_timer = nullptr; + emu_timer *m_blitter_done_timer = nullptr; + emu_timer *m_delayed_z80_control_timer = nullptr; + int m_bankxor = 0; // common DECLARE_WRITE_LINE_MEMBER(generate_tms34061_interrupt); @@ -256,7 +256,7 @@ void palette_update(); - emu_timer *m_palette_timer; + emu_timer *m_palette_timer = nullptr; uint8_t m_palcontrol = 0U; uint8_t m_xscroll = 0U; rgb_t m_palette[2][16]{}; diff -Nru mame-0.242+dfsg.1/src/mame/includes/jackal.h mame-0.243+dfsg.1/src/mame/includes/jackal.h --- mame-0.242+dfsg.1/src/mame/includes/jackal.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/jackal.h 2022-04-29 05:37:26.000000000 +0000 @@ -49,10 +49,10 @@ required_memory_bank m_scrollbank; // video-related - tilemap_t *m_bg_tilemap; + tilemap_t *m_bg_tilemap = nullptr; // misc - uint8_t m_irq_enable; + uint8_t m_irq_enable = 0; optional_ioport_array<2> m_dials; // devices diff -Nru mame-0.242+dfsg.1/src/mame/includes/jedi.h mame-0.243+dfsg.1/src/mame/includes/jedi.h --- mame-0.242+dfsg.1/src/mame/includes/jedi.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/jedi.h 2022-04-29 05:37:26.000000000 +0000 @@ -93,7 +93,7 @@ void main_map(address_map &map); /* machine state */ - emu_timer *m_interrupt_timer; + emu_timer *m_interrupt_timer = nullptr; /* video state */ required_shared_ptr m_backgroundram; @@ -104,10 +104,10 @@ required_region_ptr m_bg_gfx; required_region_ptr m_spr_gfx; required_region_ptr m_proms; - u32 m_vscroll; - u32 m_hscroll; - bool m_foreground_bank; - bool m_video_off; + u32 m_vscroll = 0; + u32 m_hscroll = 0; + bool m_foreground_bank = false; + bool m_video_off = false; required_device m_maincpu; required_device m_audiocpu; diff -Nru mame-0.242+dfsg.1/src/mame/includes/jpmsys5.h mame-0.243+dfsg.1/src/mame/includes/jpmsys5.h --- mame-0.242+dfsg.1/src/mame/includes/jpmsys5.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/jpmsys5.h 2022-04-29 05:37:26.000000000 +0000 @@ -115,8 +115,8 @@ uint16_t reellamps_4567_r(offs_t offset, uint16_t mem_mask = ~0); void reellamps_4567_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - uint16_t m_reellamps_0123; - uint16_t m_reellamps_5678; + uint16_t m_reellamps_0123 = 0; + uint16_t m_reellamps_5678 = 0; void mux_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); uint16_t mux_r(offs_t offset, uint16_t mem_mask = ~0); @@ -134,14 +134,14 @@ output_finder<32> m_reellamp_out; optional_device_array m_reel; - int m_lamp_strobe; - int m_mpxclk; - uint16_t m_muxram[0x100]; - uint16_t m_optic_pattern; - int m_chop; - uint8_t m_a0_data_out; - uint8_t m_a1_data_out; - uint8_t m_a2_data_out; + int m_lamp_strobe = 0; + int m_mpxclk = 0; + uint16_t m_muxram[0x100]{}; + uint16_t m_optic_pattern = 0; + int m_chop = 0; + uint8_t m_a0_data_out = 0; + uint8_t m_a1_data_out = 0; + uint8_t m_a2_data_out = 0; }; @@ -182,14 +182,14 @@ required_memory_bank m_rombank; required_ioport_array<2> m_touch_axes; - uint8_t m_palette_val[16][3]; - int m_pal_addr; - int m_pal_idx; - int m_touch_state; - emu_timer *m_touch_timer; - int m_touch_data_count; - int m_touch_data[3]; - int m_touch_shift_cnt; + uint8_t m_palette_val[16][3]{}; + int m_pal_addr = 0; + int m_pal_idx = 0; + int m_touch_state = 0; + emu_timer *m_touch_timer = nullptr; + int m_touch_data_count = 0; + int m_touch_data[3]{}; + int m_touch_shift_cnt = 0; }; #endif // MAME_INCLUDES_JPMSYS5_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/kangaroo.h mame-0.243+dfsg.1/src/mame/includes/kangaroo.h --- mame-0.242+dfsg.1/src/mame/includes/kangaroo.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/kangaroo.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,49 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Ville Laitinen, Aaron Giles -/*************************************************************************** - - Sun Electronics Kangaroo hardware - - driver by Ville Laitinen - -***************************************************************************/ - -#include "emupal.h" - -class kangaroo_state : public driver_device -{ -public: - kangaroo_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_video_control(*this, "video_control"), - m_maincpu(*this, "maincpu"), - m_palette(*this, "palette") { } - - /* memory pointers */ - required_shared_ptr m_video_control; - - /* video-related */ - std::unique_ptr m_videoram{}; - - /* misc */ - uint8_t m_mcu_clock = 0U; - uint8_t mcu_sim_r(); - void mcu_sim_w(uint8_t data); - void kangaroo_coin_counter_w(uint8_t data); - void kangaroo_videoram_w(offs_t offset, uint8_t data); - void kangaroo_video_control_w(offs_t offset, uint8_t data); - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; - DECLARE_MACHINE_START(kangaroo_mcu); - uint32_t screen_update_kangaroo(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - void videoram_write( uint16_t offset, uint8_t data, uint8_t mask ); - void blitter_execute( ); - required_device m_maincpu; - required_device m_palette; - void nomcu(machine_config &config); - void mcu(machine_config &config); - void main_map(address_map &map); - void sound_map(address_map &map); - void sound_portmap(address_map &map); -}; diff -Nru mame-0.242+dfsg.1/src/mame/includes/kaypro.h mame-0.243+dfsg.1/src/mame/includes/kaypro.h --- mame-0.242+dfsg.1/src/mame/includes/kaypro.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/kaypro.h 2022-04-29 05:37:26.000000000 +0000 @@ -97,12 +97,12 @@ std::unique_ptr m_ram; std::unique_ptr m_vram; // video ram std::unique_ptr m_dummy; // black hole for write to rom - int m_centronics_busy; - bool m_is_motor_off = 0; + int m_centronics_busy = 0; + bool m_is_motor_off = false; u8 m_fdc_rq = 0U; u8 m_system_port = 0U; u16 m_mc6845_video_address = 0U; - floppy_image_device *m_floppy; + floppy_image_device *m_floppy = nullptr; required_device m_palette; required_device m_screen; diff -Nru mame-0.242+dfsg.1/src/mame/includes/kickgoal.h mame-0.243+dfsg.1/src/mame/includes/kickgoal.h --- mame-0.242+dfsg.1/src/mame/includes/kickgoal.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/kickgoal.h 2022-04-29 05:37:26.000000000 +0000 @@ -78,28 +78,28 @@ void oki_map(address_map &map); /* video-related */ - tilemap_t *m_fgtm; - tilemap_t *m_bgtm; - tilemap_t *m_bg2tm; + tilemap_t *m_fgtm = nullptr; + tilemap_t *m_bgtm = nullptr; + tilemap_t *m_bg2tm = nullptr; /* misc */ - int m_snd_new; - int m_snd_sam[4]; + int m_snd_new = 0; + int m_snd_sam[4]{}; - u8 m_pic_portc; - u8 m_pic_portb; - int m_sound_command_sent; + u8 m_pic_portc = 0; + u8 m_pic_portb = 0; + int m_sound_command_sent = 0; - int m_fg_base; + int m_fg_base = 0; - int m_bg_base; - int m_bg_mask; + int m_bg_base = 0; + int m_bg_mask = 0; - int m_bg2_base; - int m_bg2_mask; - int m_bg2_region; + int m_bg2_base = 0; + int m_bg2_mask = 0; + int m_bg2_region = 0; - int m_sprbase; + int m_sprbase = 0; void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect); diff -Nru mame-0.242+dfsg.1/src/mame/includes/klax.h mame-0.243+dfsg.1/src/mame/includes/klax.h --- mame-0.242+dfsg.1/src/mame/includes/klax.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/klax.h 2022-04-29 05:37:26.000000000 +0000 @@ -88,8 +88,8 @@ required_device_array m_msm; required_memory_bank m_rombank; required_shared_ptr m_audio_ram; - uint8_t m_audio_sample[2]; - bool m_audio_nibble; + uint8_t m_audio_sample[2]{}; + bool m_audio_nibble = false; }; #endif // MAME_INCLUDES_KLAX_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/konamigx.h mame-0.243+dfsg.1/src/mame/includes/konamigx.h --- mame-0.242+dfsg.1/src/mame/includes/konamigx.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/konamigx.h 2022-04-29 05:37:26.000000000 +0000 @@ -121,7 +121,7 @@ K055673_CB_MEMBER(salmndr2_sprite_callback); K055673_CB_MEMBER(le2_sprite_callback); - struct GX_OBJ { int order, offs, code, color; }; + struct GX_OBJ { int order = 0, offs = 0, code = 0, color = 0; }; void common_init(); uint32_t k_6bpp_rom_long_r(offs_t offset, uint32_t mem_mask = ~0); @@ -225,55 +225,55 @@ optional_ioport m_an0, m_an1, m_light0_x, m_light0_y, m_light1_x, m_light1_y, m_eepromout; - uint8_t m_sound_ctrl; - uint8_t m_sound_intck; - uint32_t m_fantjour_dma[8]; - int m_konamigx_current_frame; - int m_gx_objdma, m_gx_primode; - emu_timer *m_dmadelay_timer; - emu_timer *m_boothack_timer; - int m_gx_rdport1_3, m_gx_syncen; - int m_gx_cfgport; - int m_suspension_active, m_resume_trigger; - int m_last_prot_op, m_last_prot_clk; - u16 m_last_prot_param; - uint8_t m_prev_pixel_clock; + uint8_t m_sound_ctrl = 0; + uint8_t m_sound_intck = 0; + uint32_t m_fantjour_dma[8]{}; + int m_konamigx_current_frame = 0; + int m_gx_objdma = 0, m_gx_primode = 0; + emu_timer *m_dmadelay_timer = nullptr; + emu_timer *m_boothack_timer = nullptr; + int m_gx_rdport1_3 = 0, m_gx_syncen = 0; + int m_gx_cfgport = 0; + int m_suspension_active = 0, m_resume_trigger = 0; + int m_last_prot_op = 0, m_last_prot_clk = 0; + u16 m_last_prot_param = 0; + uint8_t m_prev_pixel_clock = 0; - uint8_t m_esc_program[4096]; + uint8_t m_esc_program[4096]{}; esc_cb m_esc_cb; - uint16_t m_prot_data[0x20]; + uint16_t m_prot_data[0x20]{}; - uint16_t *m_gx_spriteram; + uint16_t *m_gx_spriteram = nullptr; std::unique_ptr m_gx_spriteram_alloc; // mirrored K054338 settings - int *m_K054338_shdRGB; + int *m_K054338_shdRGB = nullptr; // 1st-Tier GX/MW Variables // frequently used registers - int m_k053247_vrcbk[4]; - int m_k053247_coreg, m_k053247_coregshift, m_k053247_opset; - int m_opri, m_oinprion; - int m_vcblk[6], m_ocblk; - int m_vinmix, m_vmixon, m_osinmix, m_osmixon; - uint8_t m_gx_wrport1_0, m_gx_wrport1_1; - uint16_t m_gx_wrport2; + int m_k053247_vrcbk[4]{}; + int m_k053247_coreg = 0, m_k053247_coregshift = 0, m_k053247_opset = 0; + int m_opri = 0, m_oinprion = 0; + int m_vcblk[6]{}, m_ocblk = 0; + int m_vinmix = 0, m_vmixon = 0, m_osinmix = 0, m_osmixon = 0; + uint8_t m_gx_wrport1_0 = 0, m_gx_wrport1_1 = 0; + uint16_t m_gx_wrport2 = 0; // 2nd-Tier GX/MW Graphics Variables - uint8_t *m_gx_objzbuf; + uint8_t *m_gx_objzbuf = nullptr; std::unique_ptr m_gx_shdzbuf; - int m_layer_colorbase[4]; - int32_t m_gx_tilebanks[8], m_gx_oldbanks[8]; - int m_gx_tilemode, m_gx_rozenable, m_psac_colorbase, m_last_psac_colorbase; - int m_gx_specialrozenable; // type 1 roz, with voxel height-map, rendered from 2 source tilemaps (which include height data) to temp bitmap for further processing - int m_gx_rushingheroes_hack; + int m_layer_colorbase[4]{}; + int32_t m_gx_tilebanks[8]{}, m_gx_oldbanks[8]{}; + int m_gx_tilemode = 0, m_gx_rozenable = 0, m_psac_colorbase = 0, m_last_psac_colorbase = 0; + int m_gx_specialrozenable = 0; // type 1 roz, with voxel height-map, rendered from 2 source tilemaps (which include height data) to temp bitmap for further processing + int m_gx_rushingheroes_hack = 0; - tilemap_t *m_gx_psac_tilemap, *m_gx_psac_tilemap2; + tilemap_t *m_gx_psac_tilemap = nullptr, *m_gx_psac_tilemap2 = nullptr; std::unique_ptr m_type3_roz_temp_bitmap; - tilemap_t *m_gx_psac_tilemap_alt; - int m_konamigx_has_dual_screen; - int m_konamigx_palformat; + tilemap_t *m_gx_psac_tilemap_alt = nullptr; + int m_konamigx_has_dual_screen = 0; + int m_konamigx_palformat = 0; std::unique_ptr m_dualscreen_left_tempbitmap; std::unique_ptr m_dualscreen_right_tempbitmap; @@ -299,10 +299,10 @@ std::unique_ptr m_gx_objpool; - u8 m_type3_psac2_bank; - u8 m_type3_spriteram_bank; + u8 m_type3_psac2_bank = 0; + u8 m_type3_spriteram_bank = 0; //int m_konamigx_type3_psac2_actual_last_bank = 0; - int m_use_68020_post_clock_hack; + int m_use_68020_post_clock_hack = 0; output_finder<> m_lamp; }; diff -Nru mame-0.242+dfsg.1/src/mame/includes/ksayakyu.h mame-0.243+dfsg.1/src/mame/includes/ksayakyu.h --- mame-0.242+dfsg.1/src/mame/includes/ksayakyu.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/ksayakyu.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,74 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Tomasz Slanina - -/************************************************************************* - - Kusayakyuu - -*************************************************************************/ -#ifndef MAME_INCLUDES_KSAYAKYU_H -#define MAME_INCLUDES_KSAYAKYU_H - -#pragma once - -#include "machine/gen_latch.h" -#include "emupal.h" -#include "tilemap.h" - -class ksayakyu_state : public driver_device -{ -public: - ksayakyu_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_videoram(*this, "videoram"), - m_spriteram(*this, "spriteram"), - m_maincpu(*this, "maincpu"), - m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette"), - m_soundlatch(*this, "soundlatch") - { } - - void ksayakyu(machine_config &config); - -protected: - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; - -private: - /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; - - /* video-related */ - tilemap_t *m_tilemap = nullptr; - tilemap_t *m_textmap = nullptr; - int m_video_ctrl = 0; - int m_flipscreen = 0; - - /* misc */ - int m_sound_status = 0; - void bank_select_w(uint8_t data); - void latch_w(uint8_t data); - uint8_t sound_status_r(); - void tomaincpu_w(uint8_t data); - uint8_t int_ack_r(); - void ksayakyu_videoram_w(offs_t offset, uint8_t data); - void ksayakyu_videoctrl_w(uint8_t data); - void dummy1_w(uint8_t data); - void dummy2_w(uint8_t data); - void dummy3_w(uint8_t data); - TILE_GET_INFO_MEMBER(get_ksayakyu_tile_info); - TILE_GET_INFO_MEMBER(get_text_tile_info); - void ksayakyu_palette(palette_device &palette) const; - uint32_t screen_update_ksayakyu(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); - required_device m_maincpu; - required_device m_gfxdecode; - required_device m_palette; - required_device m_soundlatch; - void maincpu_map(address_map &map); - void soundcpu_map(address_map &map); -}; - -#endif // MAME_INCLUDES_KSAYAKYU_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/labyrunr.h mame-0.243+dfsg.1/src/mame/includes/labyrunr.h --- mame-0.242+dfsg.1/src/mame/includes/labyrunr.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/labyrunr.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,72 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Nicola Salmoria -/************************************************************************* - - Labyrinth Runner - -*************************************************************************/ -#ifndef MAME_INCLUDES_LABYRUNR_H -#define MAME_INCLUDES_LABYRUNR_H - -#pragma once - -#include "video/k007121.h" -#include "video/k051733.h" -#include "emupal.h" -#include "screen.h" -#include "tilemap.h" - -class labyrunr_state : public driver_device -{ -public: - labyrunr_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_k007121(*this, "k007121"), - m_maincpu(*this,"maincpu"), - m_scrollram(*this, "scrollram"), - m_spriteram(*this, "spriteram"), - m_videoram1(*this, "videoram1"), - m_videoram2(*this, "videoram2"), - m_gfxdecode(*this, "gfxdecode"), - m_screen(*this, "screen"), - m_palette(*this, "palette") - { } - - void labyrunr(machine_config &config); - -private: - /* devices */ - required_device m_k007121; - - required_device m_maincpu; - /* memory pointers */ - required_shared_ptr m_scrollram; - required_shared_ptr m_spriteram; - required_shared_ptr m_videoram1; - required_shared_ptr m_videoram2; - - required_device m_gfxdecode; - required_device m_screen; - required_device m_palette; - - /* video-related */ - tilemap_t *m_layer0 = nullptr; - tilemap_t *m_layer1 = nullptr; - rectangle m_clip0{}; - rectangle m_clip1{}; - - void labyrunr_bankswitch_w(uint8_t data); - void labyrunr_vram1_w(offs_t offset, uint8_t data); - void labyrunr_vram2_w(offs_t offset, uint8_t data); - TILE_GET_INFO_MEMBER(get_tile_info0); - TILE_GET_INFO_MEMBER(get_tile_info1); - virtual void machine_start() override; - virtual void video_start() override; - void labyrunr_palette(palette_device &palette) const; - uint32_t screen_update_labyrunr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - DECLARE_WRITE_LINE_MEMBER(vblank_irq); - INTERRUPT_GEN_MEMBER(labyrunr_timer_interrupt); - void labyrunr_map(address_map &map); -}; - -#endif // MAME_INCLUDES_LABYRUNR_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/laserbat.h mame-0.243+dfsg.1/src/mame/includes/laserbat.h --- mame-0.242+dfsg.1/src/mame/includes/laserbat.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/laserbat.h 2022-04-29 05:37:26.000000000 +0000 @@ -105,12 +105,12 @@ uint8_t const m_eff2_mask; // control lines - uint8_t m_input_mux; - bool m_mpx_p_1_2; + uint8_t m_input_mux = 0; + bool m_mpx_p_1_2 = 0; // RAM used by TTL video hardware, writable by CPU - uint8_t m_bg_ram[0x400]; // background tilemap - uint8_t m_eff_ram[0x400]; // per-scanline effects (A8 not wired meaning only half is usable) + uint8_t m_bg_ram[0x400]{}; // background tilemap + uint8_t m_eff_ram[0x400]{}; // per-scanline effects (A8 not wired meaning only half is usable) bool m_mpx_bkeff = false; // select between writing background and effects memory // signals affecting the TTL-generated 32x32 sprite diff -Nru mame-0.242+dfsg.1/src/mame/includes/lastduel.h mame-0.243+dfsg.1/src/mame/includes/lastduel.h --- mame-0.242+dfsg.1/src/mame/includes/lastduel.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/lastduel.h 2022-04-29 05:37:26.000000000 +0000 @@ -51,12 +51,12 @@ optional_memory_bank m_audiobank; /* video-related */ - tilemap_t *m_tilemap[2]; - tilemap_t *m_tx_tilemap; - uint16_t m_vctrl[8]; - int m_sprite_flipy_mask; - int m_sprite_pri_mask; - int m_tilemap_priority; + tilemap_t *m_tilemap[2]{}; + tilemap_t *m_tx_tilemap = nullptr; + uint16_t m_vctrl[8]{}; + int m_sprite_flipy_mask = 0; + int m_sprite_pri_mask = 0; + int m_tilemap_priority = 0; void mg_bankswitch_w(uint8_t data); void flip_w(uint8_t data); diff -Nru mame-0.242+dfsg.1/src/mame/includes/lethalj.h mame-0.243+dfsg.1/src/mame/includes/lethalj.h --- mame-0.242+dfsg.1/src/mame/includes/lethalj.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/lethalj.h 2022-04-29 05:37:26.000000000 +0000 @@ -75,14 +75,14 @@ optional_ioport m_light1_y; output_finder<3> m_lamps; - emu_timer *m_gen_ext1_int_timer; - uint16_t m_blitter_data[8]; + emu_timer *m_gen_ext1_int_timer = nullptr; + uint16_t m_blitter_data[8]{}; std::unique_ptr m_screenram; - uint8_t m_vispage; - int m_blitter_rows; - uint16_t m_gunx; - uint16_t m_guny; - uint8_t m_blank_palette; + uint8_t m_vispage = 0; + int m_blitter_rows = 0; + uint16_t m_gunx = 0; + uint16_t m_guny = 0; + uint8_t m_blank_palette = 0; }; #endif // MAME_INCLUDES_LETHALJ_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/lisa.h mame-0.243+dfsg.1/src/mame/includes/lisa.h --- mame-0.242+dfsg.1/src/mame/includes/lisa.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/lisa.h 2022-04-29 05:37:26.000000000 +0000 @@ -27,8 +27,8 @@ /* lisa MMU segment regs */ struct real_mmu_entry { - uint16_t sorg; - uint16_t slim; + uint16_t sorg = 0; + uint16_t slim = 0; }; /* MMU regs translated into a more efficient format */ @@ -36,9 +36,9 @@ struct mmu_entry { - offs_t sorg; /* (real_sorg & 0x0fff) << 9 */ + offs_t sorg = 0; /* (real_sorg & 0x0fff) << 9 */ mmu_entry_t type; /* <-> (real_slim & 0x0f00) */ - int slim; /* (~ ((real_slim & 0x00ff) << 9)) & 0x01ffff */ + int slim = 0; /* (~ ((real_slim & 0x00ff) << 9)) & 0x01ffff */ }; enum floppy_hardware_t @@ -59,20 +59,20 @@ /* clock registers */ struct clock_regs_t { - long alarm; /* alarm (20-bit binary) */ - int years; /* years (4-bit binary ) */ - int days1; /* days (BCD : 1-366) */ - int days2; - int days3; - int hours1; /* hours (BCD : 0-23) */ - int hours2; - int minutes1; /* minutes (BCD : 0-59) */ - int minutes2; - int seconds1; /* seconds (BCD : 0-59) */ - int seconds2; - int tenths; /* tenths of second (BCD : 0-9) */ + long alarm = 0; /* alarm (20-bit binary) */ + int years = 0; /* years (4-bit binary ) */ + int days1 = 0; /* days (BCD : 1-366) */ + int days2 = 0; + int days3 = 0; + int hours1 = 0; /* hours (BCD : 0-23) */ + int hours2 = 0; + int minutes1 = 0; /* minutes (BCD : 0-59) */ + int minutes2 = 0; + int seconds1 = 0; /* seconds (BCD : 0-59) */ + int seconds2 = 0; + int tenths = 0; /* tenths of second (BCD : 0-9) */ - int clock_write_ptr; /* clock byte to be written next (-1 if clock write disabled) */ + int clock_write_ptr = 0; /* clock byte to be written next (-1 if clock write disabled) */ enum clock_mode_t clock_mode; }; @@ -162,48 +162,48 @@ required_device m_palette; required_device m_screen; - uint8_t *m_ram_ptr; - uint8_t *m_rom_ptr; - uint8_t *m_videoROM_ptr; - int m_setup; - int m_seg; + uint8_t *m_ram_ptr = nullptr; + uint8_t *m_rom_ptr = nullptr; + uint8_t *m_videoROM_ptr = nullptr; + int m_setup = 0; + int m_seg = 0; real_mmu_entry m_real_mmu_regs[4][128]; mmu_entry m_mmu_regs[4][128]; - int m_diag2; - int m_test_parity; - uint16_t m_mem_err_addr_latch; - int m_parity_error_pending; - int m_bad_parity_count; + int m_diag2 = 0; + int m_test_parity = 0; + uint16_t m_mem_err_addr_latch = 0; + int m_parity_error_pending = 0; + int m_bad_parity_count = 0; std::unique_ptr m_bad_parity_table; - int m_VTMSK; - int m_VTIR; - uint16_t m_video_address_latch; - uint16_t *m_videoram_ptr; - int m_KBIR; - int m_FDIR; - int m_DISK_DIAG; - int m_MT1; - int m_PWM_floppy_motor_speed; - int m_model; + int m_VTMSK = 0; + int m_VTIR = 0; + uint16_t m_video_address_latch = 0; + uint16_t *m_videoram_ptr = nullptr; + int m_KBIR = 0; + int m_FDIR = 0; + int m_DISK_DIAG = 0; + int m_MT1 = 0; + int m_PWM_floppy_motor_speed = 0; + int m_model = 0; lisa_features_t m_features; - int m_COPS_Ready; - int m_COPS_command; - int m_fifo_data[8]; - int m_fifo_size; - int m_fifo_head; - int m_fifo_tail; - int m_mouse_data_offset; - int m_COPS_force_unplug; - emu_timer *m_mouse_timer; - emu_timer *m_cops_ready_timer; - int m_hold_COPS_data; - int m_NMIcode; + int m_COPS_Ready = 0; + int m_COPS_command = 0; + int m_fifo_data[8]{}; + int m_fifo_size = 0; + int m_fifo_head = 0; + int m_fifo_tail = 0; + int m_mouse_data_offset = 0; + int m_COPS_force_unplug = 0; + emu_timer *m_mouse_timer = nullptr; + emu_timer *m_cops_ready_timer = nullptr; + int m_hold_COPS_data = 0; + int m_NMIcode = 0; clock_regs_t m_clock_regs; - int m_key_matrix[8]; - int m_last_mx; - int m_last_my; - int m_frame_count; - int m_videoROM_address; + int m_key_matrix[8]{}; + int m_last_mx = 0; + int m_last_my = 0; + int m_frame_count = 0; + int m_videoROM_address = 0; uint8_t lisa_fdc_io_r(offs_t offset); void lisa_fdc_io_w(offs_t offset, uint8_t data); uint16_t lisa_r(offs_t offset, uint16_t mem_mask = ~0); diff -Nru mame-0.242+dfsg.1/src/mame/includes/m107.h mame-0.243+dfsg.1/src/mame/includes/m107.h --- mame-0.242+dfsg.1/src/mame/includes/m107.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/m107.h 2022-04-29 05:37:26.000000000 +0000 @@ -20,8 +20,8 @@ struct pf_layer_info { - tilemap_t * tmap; - uint16_t vram_base; + tilemap_t * tmap = nullptr; + uint16_t vram_base = 0; }; class m107_state : public driver_device @@ -66,12 +66,12 @@ optional_memory_bank m_mainbank; // driver init - uint8_t m_spritesystem; + uint8_t m_spritesystem = 0; - uint8_t m_sprite_display; - uint16_t m_raster_irq_position; + uint8_t m_sprite_display = 0; + uint16_t m_raster_irq_position = 0; pf_layer_info m_pf_layer[4]; - uint16_t m_control[0x10]; + uint16_t m_control[0x10]{}; void coincounter_w(uint8_t data); void bankswitch_w(uint8_t data); diff -Nru mame-0.242+dfsg.1/src/mame/includes/m72.h mame-0.243+dfsg.1/src/mame/includes/m72.h --- mame-0.242+dfsg.1/src/mame/includes/m72.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/m72.h 2022-04-29 05:37:26.000000000 +0000 @@ -129,28 +129,28 @@ optional_ioport m_io_dsw; std::unique_ptr m_protection_ram; - emu_timer *m_scanline_timer; - const u8 *m_protection_code; - const u8 *m_protection_crc; - u32 m_raster_irq_position; - tilemap_t *m_fg_tilemap; - tilemap_t *m_bg_tilemap; - tilemap_t *m_bg_tilemap_large; - s32 m_scrollx[2]; - s32 m_scrolly[2]; - s32 m_video_off; + emu_timer *m_scanline_timer = nullptr; + const u8 *m_protection_code = nullptr; + const u8 *m_protection_crc = nullptr; + u32 m_raster_irq_position = 0; + tilemap_t *m_fg_tilemap = nullptr; + tilemap_t *m_bg_tilemap = nullptr; + tilemap_t *m_bg_tilemap_large = nullptr; + s32 m_scrollx[2]{}; + s32 m_scrolly[2]{}; + s32 m_video_off = 0; - int m_fg_source; - int m_bg_source; + int m_fg_source = 0; + int m_bg_source = 0; optional_ioport m_m81_b_b_j3; // majtitle specific - int m_m82_rowscroll; - u16 m_m82_tmcontrol; + int m_m82_rowscroll = 0; + u16 m_m82_tmcontrol = 0; // m72_i8751 specific - u8 m_mcu_sample_latch; - u32 m_mcu_sample_addr; + u8 m_mcu_sample_latch = 0; + u32 m_mcu_sample_addr = 0; // common template u16 palette_r(offs_t offset); diff -Nru mame-0.242+dfsg.1/src/mame/includes/m79amb.h mame-0.243+dfsg.1/src/mame/includes/m79amb.h --- mame-0.242+dfsg.1/src/mame/includes/m79amb.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/m79amb.h 2022-04-29 05:37:26.000000000 +0000 @@ -47,8 +47,8 @@ output_finder<> m_self_test; /* misc */ - uint8_t m_lut_gun1[0x100]; - uint8_t m_lut_gun2[0x100]; + uint8_t m_lut_gun1[0x100]{}; + uint8_t m_lut_gun2[0x100]{}; }; /*----------- defined in audio/m79amb.c -----------*/ diff -Nru mame-0.242+dfsg.1/src/mame/includes/m90.h mame-0.243+dfsg.1/src/mame/includes/m90.h --- mame-0.242+dfsg.1/src/mame/includes/m90.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/m90.h 2022-04-29 05:37:26.000000000 +0000 @@ -57,8 +57,8 @@ required_device m_palette; required_device m_screen; - tilemap_t *m_pf_layer[2][2]; - uint8_t m_last_pf[2]; + tilemap_t *m_pf_layer[2][2]{}; + uint8_t m_last_pf[2]{}; void coincounter_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); void quizf1_bankswitch_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); void m90_video_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); diff -Nru mame-0.242+dfsg.1/src/mame/includes/m92.h mame-0.243+dfsg.1/src/mame/includes/m92.h --- mame-0.242+dfsg.1/src/mame/includes/m92.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/m92.h 2022-04-29 05:37:26.000000000 +0000 @@ -21,10 +21,10 @@ struct M92_pf_layer_info { - tilemap_t * tmap; - tilemap_t * wide_tmap; - uint16_t vram_base; - uint16_t control[4]; + tilemap_t * tmap = nullptr; + tilemap_t * wide_tmap = nullptr; + uint16_t vram_base = 0; + uint16_t control[4]{}; }; class m92_state : public driver_device @@ -47,7 +47,8 @@ m_screen(*this, "screen"), m_palette(*this, "palette"), m_upd71059c(*this, "upd71059c"), - m_mainbank(*this, "mainbank") + m_mainbank(*this, "mainbank"), + m_dsw(*this, "DSW") { } void m92(machine_config &config); @@ -86,15 +87,16 @@ required_device m_upd71059c; optional_memory_bank m_mainbank; + required_ioport m_dsw; - emu_timer *m_spritebuffer_timer; - uint32_t m_raster_irq_position; - uint16_t m_videocontrol; - uint8_t m_sprite_buffer_busy; + emu_timer *m_spritebuffer_timer = nullptr; + uint32_t m_raster_irq_position = 0; + uint16_t m_videocontrol = 0; + uint8_t m_sprite_buffer_busy = 0; M92_pf_layer_info m_pf_layer[3]; - uint16_t m_pf_master_control[4]; - int32_t m_sprite_list; - uint8_t m_palette_bank; + uint16_t m_pf_master_control[4]{}; + int32_t m_sprite_list = 0; + uint8_t m_palette_bank = 0; std::vector m_paletteram; void coincounter_w(uint8_t data); diff -Nru mame-0.242+dfsg.1/src/mame/includes/mac.h mame-0.243+dfsg.1/src/mame/includes/mac.h --- mame-0.242+dfsg.1/src/mame/includes/mac.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/mac.h 2022-04-29 05:37:26.000000000 +0000 @@ -221,36 +221,36 @@ }; - uint32_t m_overlay; + uint32_t m_overlay = 0; - uint32_t m_via2_vbl; - uint32_t m_se30_vbl_enable; - uint8_t m_nubus_irq_state; + uint32_t m_via2_vbl = 0; + uint32_t m_se30_vbl_enable = 0; + uint8_t m_nubus_irq_state = 0; - emu_timer *m_overlay_timeout; + emu_timer *m_overlay_timeout = nullptr; TIMER_CALLBACK_MEMBER(overlay_timeout_func); uint32_t rom_switch_r(offs_t offset); - bool m_main_buffer; - int m_adb_irq_pending; - int m_screen_buffer; + bool m_main_buffer = false; + int m_adb_irq_pending = 0; + int m_screen_buffer = 0; int irq_count, ca1_data, ca2_data; // 60.15 Hz timer for RBV/V8/Sonora/Eagle/VASP/etc. - emu_timer *m_6015_timer; + emu_timer *m_6015_timer = nullptr; // ADB refresh timer, independent of anything else going on - emu_timer *m_adbupdate_timer; + emu_timer *m_adbupdate_timer = nullptr; WRITE_LINE_MEMBER(adb_irq_w) { m_adb_irq_pending = state; } // RBV and friends (V8, etc) - uint8_t m_rbv_regs[256], m_rbv_ier, m_rbv_ifr, m_rbv_type, m_rbv_montype, m_rbv_vbltime; - uint32_t m_rbv_colors[3], m_rbv_count, m_rbv_clutoffs, m_rbv_immed10wr; - uint32_t m_rbv_palette[256]; - uint8_t m_sonora_vctl[8]; - emu_timer *m_vbl_timer, *m_cursor_timer; - uint16_t m_cursor_line; + uint8_t m_rbv_regs[256]{}, m_rbv_ier = 0, m_rbv_ifr = 0, m_rbv_type = 0, m_rbv_montype = 0, m_rbv_vbltime = 0; + uint32_t m_rbv_colors[3]{}, m_rbv_count = 0, m_rbv_clutoffs = 0, m_rbv_immed10wr = 0; + uint32_t m_rbv_palette[256]{}; + uint8_t m_sonora_vctl[8]{}; + emu_timer *m_vbl_timer = nullptr, *m_cursor_timer = nullptr; + uint16_t m_cursor_line = 0; // this is shared among all video setups with vram optional_shared_ptr m_vram; @@ -258,7 +258,7 @@ optional_shared_ptr m_vram64; // interrupts - int m_scc_interrupt, m_via_interrupt, m_via2_interrupt, m_scsi_interrupt, m_asc_interrupt, m_last_taken_interrupt; + int m_scc_interrupt = false, m_via_interrupt = false, m_via2_interrupt = false, m_scsi_interrupt = false, m_last_taken_interrupt = false; // defined in machine/mac.c void v8_resize(); @@ -334,20 +334,20 @@ void macse30_map(address_map &map); void pwrmac_map(address_map &map); - uint8_t m_oss_regs[0x400]; + uint8_t m_oss_regs[0x400]{}; - int m_via2_ca1_hack; + int m_via2_ca1_hack = 0; optional_device m_screen; optional_device m_palette; - uint32_t m_rom_size; - uint32_t *m_rom_ptr; + uint32_t m_rom_size = 0; + uint32_t *m_rom_ptr = nullptr; - emu_timer *m_scanline_timer; + emu_timer *m_scanline_timer = nullptr; - floppy_image_device *m_cur_floppy; + floppy_image_device *m_cur_floppy = nullptr; - uint8_t m_pm_req, m_pm_state, m_pm_dptr, m_pm_cmd; + uint8_t m_pm_req = 0, m_pm_state = 0, m_pm_dptr = 0, m_pm_cmd = 0; void phases_w(uint8_t phases); void sel35_w(int sel35); diff -Nru mame-0.242+dfsg.1/src/mame/includes/macpci.h mame-0.243+dfsg.1/src/mame/includes/macpci.h --- mame-0.242+dfsg.1/src/mame/includes/macpci.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/macpci.h 2022-04-29 05:37:26.000000000 +0000 @@ -102,25 +102,25 @@ }; - model_t m_model; + model_t m_model{}; // 60.15 Hz timer for RBV/V8/Sonora/Eagle/VASP/etc. - emu_timer *m_6015_timer; + emu_timer *m_6015_timer = nullptr; // RBV and friends (V8, etc) - uint8_t m_rbv_regs[256], m_rbv_ier, m_rbv_ifr, m_rbv_type, m_rbv_montype, m_rbv_vbltime; - uint32_t m_rbv_colors[3], m_rbv_count, m_rbv_clutoffs, m_rbv_immed10wr; - uint32_t m_rbv_palette[256]; - uint8_t m_sonora_vctl[8]; - emu_timer *m_vbl_timer, *m_cursor_timer; - uint16_t m_cursor_line; - uint16_t m_dafb_int_status; - int m_dafb_scsi1_drq, m_dafb_scsi2_drq; - uint8_t m_dafb_mode; - uint32_t m_dafb_base, m_dafb_stride; + uint8_t m_rbv_regs[256]{}, m_rbv_ier = 0, m_rbv_ifr = 0, m_rbv_type = 0, m_rbv_montype = 0, m_rbv_vbltime = 0; + uint32_t m_rbv_colors[3]{}, m_rbv_count = 0, m_rbv_clutoffs = 0, m_rbv_immed10wr = 0; + uint32_t m_rbv_palette[256]{}; + uint8_t m_sonora_vctl[8]{}; + emu_timer *m_vbl_timer = nullptr, *m_cursor_timer = nullptr; + uint16_t m_cursor_line = 0; + uint16_t m_dafb_int_status = 0; + int m_dafb_scsi1_drq = 0, m_dafb_scsi2_drq = 0; + uint8_t m_dafb_mode = 0; + uint32_t m_dafb_base = 0, m_dafb_stride = 0; // this is shared among all video setups with vram - uint32_t *m_vram; + uint32_t *m_vram = nullptr; uint16_t mac_via_r(offs_t offset); void mac_via_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); @@ -148,12 +148,12 @@ void cdmcu_mem(address_map &map); void cdmcu_data(address_map &map); // wait states for accessing the VIA - int m_via_cycles; + int m_via_cycles = 0; // hack - uint16_t m_unk1_test; + uint16_t m_unk1_test = 0; - emu_timer *m_scanline_timer; + emu_timer *m_scanline_timer = nullptr; uint32_t screen_update_pippin(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(mac_6015_tick); uint8_t mac_via_in_a(); diff -Nru mame-0.242+dfsg.1/src/mame/includes/mainevt.h mame-0.243+dfsg.1/src/mame/includes/mainevt.h --- mame-0.242+dfsg.1/src/mame/includes/mainevt.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/mainevt.h 2022-04-29 05:37:26.000000000 +0000 @@ -66,8 +66,8 @@ virtual void machine_reset() override; /* misc */ - int m_nmi_enable; - uint8_t m_sound_irq_mask; + int m_nmi_enable = 0; + uint8_t m_sound_irq_mask = 0; /* devices */ required_device m_maincpu; diff -Nru mame-0.242+dfsg.1/src/mame/includes/malzak.h mame-0.243+dfsg.1/src/mame/includes/malzak.h --- mame-0.242+dfsg.1/src/mame/includes/malzak.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/malzak.h 2022-04-29 05:37:26.000000000 +0000 @@ -72,12 +72,12 @@ TILE_GET_INFO_MEMBER(get_tile_info); std::unique_ptr m_trom_bitmap; std::unique_ptr m_playfield_bitmap; - tilemap_t *m_playfield_tilemap; - int m_playfield_code[256]; - int m_scrollx; - int m_scrolly; - int m_collision_counter; - u8 m_playfield_bank; + tilemap_t *m_playfield_tilemap = nullptr; + int m_playfield_code[256]{}; + int m_scrollx = 0; + int m_scrolly = 0; + int m_collision_counter = 0; + u8 m_playfield_bank = 0; }; #endif // MAME_INCLUDES_MALZAK_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/marineb.h mame-0.243+dfsg.1/src/mame/includes/marineb.h --- mame-0.242+dfsg.1/src/mame/includes/marineb.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/marineb.h 2022-04-29 05:37:26.000000000 +0000 @@ -42,12 +42,12 @@ required_ioport m_system; /* video-related */ - tilemap_t *m_bg_tilemap; - tilemap_t *m_fg_tilemap; - uint8_t m_palette_bank; - uint8_t m_column_scroll; - uint8_t m_flipscreen_x; - uint8_t m_flipscreen_y; + tilemap_t *m_bg_tilemap = nullptr; + tilemap_t *m_fg_tilemap = nullptr; + uint8_t m_palette_bank = 0; + uint8_t m_column_scroll = 0; + uint8_t m_flipscreen_x = 0; + uint8_t m_flipscreen_y = 0; /* devices */ required_device m_maincpu; @@ -57,7 +57,7 @@ required_device m_outlatch; required_device m_watchdog; - bool m_irq_mask; + bool m_irq_mask = false; DECLARE_WRITE_LINE_MEMBER(irq_mask_w); DECLARE_WRITE_LINE_MEMBER(nmi_mask_w); void marineb_videoram_w(offs_t offset, uint8_t data); diff -Nru mame-0.242+dfsg.1/src/mame/includes/maygay1b.h mame-0.243+dfsg.1/src/mame/includes/maygay1b.h --- mame-0.242+dfsg.1/src/mame/includes/maygay1b.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/maygay1b.h 2022-04-29 05:37:26.000000000 +0000 @@ -77,21 +77,21 @@ output_finder<256> m_lamps; output_finder<8> m_triacs; - uint8_t m_lamppos; - int m_lamp_strobe; - int m_old_lamp_strobe; - int m_lamp_strobe2; - int m_old_lamp_strobe2; - int m_RAMEN; - int m_ALARMEN; - int m_PSUrelay; - bool m_Vmm; - int m_WDOG; - int m_NMIENABLE; - int m_meter; + uint8_t m_lamppos = 0; + int m_lamp_strobe = 0; + int m_old_lamp_strobe = 0; + int m_lamp_strobe2 = 0; + int m_old_lamp_strobe2 = 0; + int m_RAMEN = 0; + int m_ALARMEN = 0; + int m_PSUrelay = 0; + bool m_Vmm = false; + int m_WDOG = 0; + int m_NMIENABLE = 0; + int m_meter = 0; TIMER_DEVICE_CALLBACK_MEMBER( maygay1b_nmitimer_callback ); - uint8_t m_Lamps[256]; - int m_optic_pattern; + uint8_t m_Lamps[256]{}; + int m_optic_pattern = 0; template DECLARE_WRITE_LINE_MEMBER(reel_optic_cb) { if (state) m_optic_pattern |= (1 << N); else m_optic_pattern &= ~(1 << N); } void scanlines_w(uint8_t data); void scanlines_2_w(uint8_t data); diff -Nru mame-0.242+dfsg.1/src/mame/includes/mbee.h mame-0.243+dfsg.1/src/mame/includes/mbee.h --- mame-0.242+dfsg.1/src/mame/includes/mbee.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/mbee.h 2022-04-29 05:37:26.000000000 +0000 @@ -157,23 +157,23 @@ u8 m_features = 0; u16 m_size = 0; u32 m_ramsize = 0; - bool m_b7_rtc = 0; - bool m_b7_vs = 0; - bool m_b2 = 0; + bool m_b7_rtc = false; + bool m_b7_vs = false; + bool m_b2 = false; u8 m_framecnt = 0; u8 m_08 = 0; u8 m_09 = 0; u8 m_0a = 0; u8 m_0b = 0; u8 m_1c = 0; - u8 m_newkb_was_pressed[15] = { 0, }; - u8 m_newkb_q[20] = { 0, }; + u8 m_newkb_was_pressed[15] = { }; + u8 m_newkb_q[20] = { }; u8 m_newkb_q_pos = 0; - u8 m_sy6545_reg[32] = { 0, }; + u8 m_sy6545_reg[32] = { }; u8 m_sy6545_ind = 0; u8 m_fdc_rq = 0; - u8 m_bank_array[33] = { 0, }; - bool m_pak_extended[10] = { 0, }; + u8 m_bank_array[33] = { }; + bool m_pak_extended[10] = { }; std::unique_ptr m_dummy; // black hole for writes to rom std::unique_ptr m_ram; // main banked-switch ram, 128/256/pp std::unique_ptr m_vram; // video ram, all models diff -Nru mame-0.242+dfsg.1/src/mame/includes/mcatadv.h mame-0.243+dfsg.1/src/mame/includes/mcatadv.h --- mame-0.242+dfsg.1/src/mame/includes/mcatadv.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/mcatadv.h 2022-04-29 05:37:26.000000000 +0000 @@ -41,7 +41,7 @@ required_memory_bank m_soundbank; /* video-related */ - int m_palette_bank[2]; + int m_palette_bank[2] = {}; /* devices */ required_device m_maincpu; diff -Nru mame-0.242+dfsg.1/src/mame/includes/megasys1.h mame-0.243+dfsg.1/src/mame/includes/megasys1.h --- mame-0.242+dfsg.1/src/mame/includes/megasys1.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/megasys1.h 2022-04-29 05:37:26.000000000 +0000 @@ -115,38 +115,38 @@ optional_ioport m_io_dsw2; // configuration - u16 m_ip_select_values[7]; // System B and C - int m_hardware_type_z; // System Z - int m_layers_order[16]; - u8 m_ignore_oki_status; + u16 m_ip_select_values[7]{}; // System B and C + int m_hardware_type_z = 0; // System Z + int m_layers_order[16]{}; + u8 m_ignore_oki_status = 0; // all bitmap_ind16 m_sprite_buffer_bitmap; - u16 m_screen_flag; + u16 m_screen_flag = 0; std::unique_ptr m_buffer_objectram; std::unique_ptr m_buffer2_objectram; std::unique_ptr m_buffer_spriteram16; std::unique_ptr m_buffer2_spriteram16; // all but System Z - u16 m_active_layers; - u16 m_sprite_flag; + u16 m_active_layers = 0; + u16 m_sprite_flag = 0; // System B and C - u16 m_ip_latched; + u16 m_ip_latched = 0; // System C - u16 m_sprite_bank; + u16 m_sprite_bank = 0; // System A only - int m_mcu_hs; - u16 m_mcu_hs_ram[0x10]; + int m_mcu_hs = 0; + u16 m_mcu_hs_ram[0x10]{}; // peekaboo - u16 m_protection_val; + u16 m_protection_val = 0; // soldam - u16 *m_spriteram; + u16 *m_spriteram = nullptr; DECLARE_WRITE_LINE_MEMBER(sound_irq); u16 ip_select_r(); diff -Nru mame-0.242+dfsg.1/src/mame/includes/metlclsh.h mame-0.243+dfsg.1/src/mame/includes/metlclsh.h --- mame-0.242+dfsg.1/src/mame/includes/metlclsh.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/metlclsh.h 2022-04-29 05:37:26.000000000 +0000 @@ -38,10 +38,10 @@ std::unique_ptr m_otherram; /* video-related */ - tilemap_t *m_bg_tilemap; - tilemap_t *m_fg_tilemap; - uint8_t m_write_mask; - uint8_t m_gfxbank; + tilemap_t *m_bg_tilemap = nullptr; + tilemap_t *m_fg_tilemap = nullptr; + uint8_t m_write_mask = 0; + uint8_t m_gfxbank = 0; /* devices */ required_device m_maincpu; diff -Nru mame-0.242+dfsg.1/src/mame/includes/metro.h mame-0.243+dfsg.1/src/mame/includes/metro.h --- mame-0.242+dfsg.1/src/mame/includes/metro.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/metro.h 2022-04-29 05:37:26.000000000 +0000 @@ -97,7 +97,6 @@ private: enum { - TIMER_KARATOUR_IRQ, TIMER_MOUJA_IRQ }; @@ -206,26 +205,29 @@ optional_memory_bank m_okibank; /* video-related */ - tilemap_t *m_k053936_tilemap; + tilemap_t *m_k053936_tilemap = nullptr; /* irq_related */ - emu_timer *m_mouja_irq_timer; - emu_timer *m_karatour_irq_timer; + emu_timer *m_mouja_irq_timer = nullptr; /* sound related */ - u8 m_sound_data; - uint16_t m_soundstatus; - int m_porta; - int m_portb; - int m_busy_sndcpu; - int m_essnd_bank; - bool m_essnd_gate; + u8 m_sound_data = 0; + uint16_t m_soundstatus = 0; + int m_porta = 0; + int m_portb = 0; + int m_busy_sndcpu = 0; + int m_essnd_bank = 0; + bool m_essnd_gate = false; /* misc */ - int m_gakusai_oki_bank_lo; - int m_gakusai_oki_bank_hi; + int m_gakusai_oki_bank_lo = 0; + int m_gakusai_oki_bank_hi = 0; void gakusai_oki_bank_set(); + + DECLARE_WRITE_LINE_MEMBER(ext_irq5_enable_w); + + bool m_ext_irq_enable = false; }; #endif // MAME_INCLUDES_METRO_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/mhavoc.h mame-0.243+dfsg.1/src/mame/includes/mhavoc.h --- mame-0.242+dfsg.1/src/mame/includes/mhavoc.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/mhavoc.h 2022-04-29 05:37:26.000000000 +0000 @@ -88,16 +88,16 @@ optional_ioport m_coin; optional_ioport m_service; - uint8_t m_alpha_data; - uint8_t m_alpha_rcvd; - uint8_t m_alpha_xmtd; - uint8_t m_gamma_data; - uint8_t m_gamma_rcvd; - uint8_t m_gamma_xmtd; - uint8_t m_player_1; - uint8_t m_alpha_irq_clock; - uint8_t m_alpha_irq_clock_enable; - uint8_t m_gamma_irq_clock; - uint8_t m_has_gamma_cpu; - uint8_t m_speech_write_buffer; + uint8_t m_alpha_data = 0; + uint8_t m_alpha_rcvd = 0; + uint8_t m_alpha_xmtd = 0; + uint8_t m_gamma_data = 0; + uint8_t m_gamma_rcvd = 0; + uint8_t m_gamma_xmtd = 0; + uint8_t m_player_1 = 0; + uint8_t m_alpha_irq_clock = 0; + uint8_t m_alpha_irq_clock_enable = 0; + uint8_t m_gamma_irq_clock = 0; + uint8_t m_has_gamma_cpu = 0; + uint8_t m_speech_write_buffer = 0; }; diff -Nru mame-0.242+dfsg.1/src/mame/includes/micro3d.h mame-0.243+dfsg.1/src/mame/includes/micro3d.h --- mame-0.242+dfsg.1/src/mame/includes/micro3d.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/micro3d.h 2022-04-29 05:37:26.000000000 +0000 @@ -85,7 +85,7 @@ struct micro3d_vtx { - int32_t x, y, z; + int32_t x = 0, y = 0, z = 0; constexpr int64_t dot_product(micro3d_vtx const &that) const; }; @@ -108,49 +108,49 @@ optional_ioport m_joystick_y; required_shared_ptr m_shared_ram; - uint8_t m_m68681_tx0; + uint8_t m_m68681_tx0 = 0; /* Sound */ - uint8_t m_sound_port_latch[4]; + uint8_t m_sound_port_latch[4]{}; /* Hardware version-check latch for BOTSS 1.1a */ - uint8_t m_botss_latch; + uint8_t m_botss_latch = 0; /* MAC */ required_shared_ptr m_mac_sram; - uint32_t m_sram_r_addr; - uint32_t m_sram_w_addr; - uint32_t m_vtx_addr; - uint32_t m_mrab11; - uint32_t m_mac_stat; - uint32_t m_mac_inst; + uint32_t m_sram_r_addr = 0; + uint32_t m_sram_w_addr = 0; + uint32_t m_vtx_addr = 0; + uint32_t m_mrab11 = 0; + uint32_t m_mac_stat = 0; + uint32_t m_mac_inst = 0; /* 2D video */ required_shared_ptr m_sprite_vram; - uint16_t m_creg; - uint16_t m_xfer3dk; + uint16_t m_creg = 0; + uint16_t m_xfer3dk = 0; /* 3D pipeline */ - uint32_t m_pipe_data; - uint32_t m_pipeline_state; - int32_t m_vtx_fifo[512]; - uint32_t m_fifo_idx; - uint32_t m_draw_cmd; - int m_draw_state; - int32_t m_x_min; - int32_t m_x_max; - int32_t m_y_min; - int32_t m_y_max; - int32_t m_z_min; - int32_t m_z_max; - int32_t m_x_mid; - int32_t m_y_mid; - int m_dpram_bank; - uint32_t m_draw_dpram[1024]; + uint32_t m_pipe_data = 0; + uint32_t m_pipeline_state = 0; + int32_t m_vtx_fifo[512]{}; + uint32_t m_fifo_idx = 0; + uint32_t m_draw_cmd = 0; + int m_draw_state = 0; + int32_t m_x_min = 0; + int32_t m_x_max = 0; + int32_t m_y_min = 0; + int32_t m_y_max = 0; + int32_t m_z_min = 0; + int32_t m_z_max = 0; + int32_t m_x_mid = 0; + int32_t m_y_mid = 0; + int m_dpram_bank = 0; + uint32_t m_draw_dpram[1024]{}; std::unique_ptr m_frame_buffers[2]; std::unique_ptr m_tmp_buffer; - int m_drawing_buffer; - int m_display_buffer; + int m_drawing_buffer = 0; + int m_display_buffer = 0; void vgb_uart_w(offs_t offset, uint8_t data); uint8_t vgb_uart_r(offs_t offset); diff -Nru mame-0.242+dfsg.1/src/mame/includes/micronic.h mame-0.243+dfsg.1/src/mame/includes/micronic.h --- mame-0.242+dfsg.1/src/mame/includes/micronic.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/micronic.h 2022-04-29 05:37:26.000000000 +0000 @@ -87,11 +87,11 @@ required_device m_ram; required_shared_ptr m_ram_base; - uint8_t m_banks_num; - uint8_t m_kp_matrix; - uint8_t m_lcd_contrast; - int m_lcd_backlight; - uint8_t m_status_flag; + uint8_t m_banks_num = 0; + uint8_t m_kp_matrix = 0; + uint8_t m_lcd_contrast = 0; + int m_lcd_backlight = 0; + uint8_t m_status_flag = 0; required_memory_bank m_bank1; required_ioport m_bit0; diff -Nru mame-0.242+dfsg.1/src/mame/includes/microtan.h mame-0.243+dfsg.1/src/mame/includes/microtan.h --- mame-0.242+dfsg.1/src/mame/includes/microtan.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/microtan.h 2022-04-29 05:37:26.000000000 +0000 @@ -72,15 +72,15 @@ optional_ioport m_keypad; optional_device m_tanbus; - uint8_t m_keypad_column; - uint8_t m_keyboard_ascii; - emu_timer *m_pulse_nmi_timer; - uint8_t m_keyrows[10]; - int m_lastrow; - int m_mask; - int m_key; - int m_repeat; - int m_repeater; + uint8_t m_keypad_column = 0; + uint8_t m_keyboard_ascii = 0; + emu_timer *m_pulse_nmi_timer = nullptr; + uint8_t m_keyrows[10]{}; + int m_lastrow = 0; + int m_mask = 0; + int m_key = 0; + int m_repeat = 0; + int m_repeater = 0; virtual void store_key(int key); @@ -90,9 +90,9 @@ optional_memory_region m_gfx1; output_finder<> m_led; - uint8_t m_chunky_graphics; + uint8_t m_chunky_graphics = 0; std::unique_ptr m_chunky_buffer; - tilemap_t *m_bg_tilemap; + tilemap_t *m_bg_tilemap = nullptr; uint8_t sound_r(); void sound_w(uint8_t data); diff -Nru mame-0.242+dfsg.1/src/mame/includes/midtunit.h mame-0.243+dfsg.1/src/mame/includes/midtunit.h --- mame-0.242+dfsg.1/src/mame/includes/midtunit.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/midtunit.h 2022-04-29 05:37:26.000000000 +0000 @@ -83,24 +83,24 @@ void init_nbajam_common(int te_protection); /* CMOS-related variables */ - uint8_t m_cmos_write_enable; + uint8_t m_cmos_write_enable = 0; /* sound-related variables */ - uint8_t m_chip_type; - uint8_t m_fake_sound_state; + uint8_t m_chip_type = 0; + uint8_t m_fake_sound_state = 0; /* protection */ - uint8_t m_mk_prot_index; - uint16_t m_mk2_prot_data; + uint8_t m_mk_prot_index = 0; + uint16_t m_mk2_prot_data = 0; std::unique_ptr m_hidden_ram; - const uint32_t *m_nbajam_prot_table; - uint16_t m_nbajam_prot_queue[5]; - uint8_t m_nbajam_prot_index; - - const uint8_t *m_jdredd_prot_table; - uint8_t m_jdredd_prot_index; - uint8_t m_jdredd_prot_max; + const uint32_t *m_nbajam_prot_table = nullptr; + uint16_t m_nbajam_prot_queue[5] = {}; + uint8_t m_nbajam_prot_index = 0; + + const uint8_t *m_jdredd_prot_table = nullptr; + uint8_t m_jdredd_prot_index = 0; + uint8_t m_jdredd_prot_max = 0; void main_map(address_map &map); }; diff -Nru mame-0.242+dfsg.1/src/mame/includes/midvunit.h mame-0.243+dfsg.1/src/mame/includes/midvunit.h --- mame-0.242+dfsg.1/src/mame/includes/midvunit.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/midvunit.h 2022-04-29 05:37:26.000000000 +0000 @@ -20,10 +20,10 @@ struct midvunit_object_data { - uint16_t * destbase; - uint8_t * texbase; - uint16_t pixdata; - uint8_t dither; + uint16_t * destbase = nullptr; + uint8_t * texbase = 0; + uint16_t pixdata = 0; + uint8_t dither = 0; }; class midvunit_state; @@ -85,9 +85,9 @@ void init_offroadc(); void init_crusnusa(); - uint16_t m_page_control; - uint16_t m_dma_data[16]; - uint8_t m_video_changed; + uint16_t m_page_control = 0; + uint16_t m_dma_data[16]{}; + uint8_t m_video_changed = 0; memory_share_creator m_videoram; required_shared_ptr m_textureram; @@ -107,29 +107,29 @@ required_shared_ptr m_tms32031_control; optional_shared_ptr m_midvplus_misc; - uint8_t m_cmos_protected; - uint16_t m_control_data; - uint8_t m_adc_shift; - uint16_t m_last_port0; - uint8_t m_shifter_state; - double m_timer_rate; - uint16_t m_bit_index; - int m_lastval; - uint32_t *m_generic_speedup; - uint16_t m_video_regs[16]; - uint8_t m_dma_data_index; - emu_timer *m_scanline_timer; + uint8_t m_cmos_protected = 0; + uint16_t m_control_data = 0; + uint8_t m_adc_shift = 0; + uint16_t m_last_port0 = 0; + uint8_t m_shifter_state = 0; + double m_timer_rate = 0; + uint16_t m_bit_index = 0; + int m_lastval = 0; + uint32_t *m_generic_speedup = nullptr; + uint16_t m_video_regs[16]{}; + uint8_t m_dma_data_index = 0; + emu_timer *m_scanline_timer = nullptr; std::unique_ptr m_poly; - uint8_t m_galil_input_index; - uint8_t m_galil_input_length; - const char *m_galil_input; - uint8_t m_galil_output_index; - char m_galil_output[450]; - uint8_t m_wheel_board_output; - uint32_t m_wheel_board_last; - uint32_t m_wheel_board_u8_latch; - uint8_t m_comm_flags; - uint16_t m_comm_data; + uint8_t m_galil_input_index = 0; + uint8_t m_galil_input_length = 0; + const char *m_galil_input = nullptr; + uint8_t m_galil_output_index = 0; + char m_galil_output[450]{}; + uint8_t m_wheel_board_output = 0; + uint32_t m_wheel_board_last = 0; + uint32_t m_wheel_board_u8_latch = 0; + uint8_t m_comm_flags = 0; + uint16_t m_comm_data = 0; void midvunit_dma_queue_w(uint32_t data); uint32_t midvunit_dma_queue_entries_r(); uint32_t midvunit_dma_trigger_r(offs_t offset); diff -Nru mame-0.242+dfsg.1/src/mame/includes/midwunit.h mame-0.243+dfsg.1/src/mame/includes/midwunit.h --- mame-0.242+dfsg.1/src/mame/includes/midwunit.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/midwunit.h 2022-04-29 05:37:26.000000000 +0000 @@ -80,12 +80,12 @@ required_shared_ptr m_mainram; required_ioport_array<4> m_ports; - uint8_t m_cmos_write_enable; - uint16_t m_iodata[8]; - uint8_t m_ioshuffle[16]; - uint8_t m_uart[8]; - uint8_t m_security_bits; - uint16_t *m_umk3_palette; + uint8_t m_cmos_write_enable = 0; + uint16_t m_iodata[8] = {}; + uint8_t m_ioshuffle[16] = {}; + uint8_t m_uart[8] = {}; + uint8_t m_security_bits = 0; + uint16_t *m_umk3_palette = nullptr; }; #endif // MAME_INCLUDES_MIDWUNIT_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/midxunit.h mame-0.243+dfsg.1/src/mame/includes/midxunit.h --- mame-0.242+dfsg.1/src/mame/includes/midxunit.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/midxunit.h 2022-04-29 05:37:26.000000000 +0000 @@ -69,16 +69,16 @@ output_finder<3> m_gun_recoil; output_finder<3> m_gun_led; - uint8_t m_cmos_write_enable; - uint16_t m_iodata[8]; - uint8_t m_uart[8]; - bool m_adc_int; + uint8_t m_cmos_write_enable = 0; + uint16_t m_iodata[8] = {}; + uint8_t m_uart[8] = {}; + bool m_adc_int = false; std::unique_ptr m_nvram_data; - uint8_t m_pic_command; - uint8_t m_pic_data; - uint8_t m_pic_clk; - uint8_t m_pic_status; + uint8_t m_pic_command = 0; + uint8_t m_pic_data = 0; + uint8_t m_pic_clk = 0; + uint8_t m_pic_status = 0; }; #endif // MAME_INCLUDES_MIDXUNIT_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/midyunit.h mame-0.243+dfsg.1/src/mame/includes/midyunit.h --- mame-0.242+dfsg.1/src/mame/includes/midyunit.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/midyunit.h 2022-04-29 05:37:26.000000000 +0000 @@ -77,20 +77,20 @@ /* protection data types */ struct protection_data { - uint16_t reset_sequence[3]; - uint16_t data_sequence[100]; + uint16_t reset_sequence[3]{}; + uint16_t data_sequence[100]{}; }; struct dma_state_t { - uint32_t offset; // source offset, in bits - int32_t rowbytes; // source bytes to skip each row - int32_t xpos; // x position, clipped - int32_t ypos; // y position, clipped - int32_t width; // horizontal pixel count - int32_t height; // vertical pixel count - uint16_t palette; // palette base - uint16_t color; // current foreground color with palette + uint32_t offset = 0; // source offset, in bits + int32_t rowbytes = 0; // source bytes to skip each row + int32_t xpos = 0; // x position, clipped + int32_t ypos = 0; // y position, clipped + int32_t width = 0; // horizontal pixel count + int32_t height = 0; // vertical pixel count + uint16_t palette = 0; // palette base + uint16_t color = 0; // current foreground color with palette }; enum @@ -117,25 +117,25 @@ std::unique_ptr m_cmos_ram; std::unique_ptr m_hidden_ram; - uint32_t m_cmos_page; - uint16_t m_prot_result; - uint16_t m_prot_sequence[3]; - uint8_t m_prot_index; - const struct protection_data *m_prot_data; - uint8_t m_cmos_w_enable; - uint8_t m_chip_type; - uint16_t *m_t2_hack_mem; - uint8_t *m_cvsd_protection_base; - uint8_t m_autoerase_enable; - uint32_t m_palette_mask; + uint32_t m_cmos_page = 0; + uint16_t m_prot_result = 0; + uint16_t m_prot_sequence[3]{}; + uint8_t m_prot_index = 0; + const struct protection_data *m_prot_data = nullptr; + uint8_t m_cmos_w_enable = 0; + uint8_t m_chip_type = 0; + uint16_t *m_t2_hack_mem = nullptr; + uint8_t *m_cvsd_protection_base = nullptr; + uint8_t m_autoerase_enable = 0; + uint32_t m_palette_mask = 0; std::unique_ptr m_pen_map; std::unique_ptr m_local_videoram; - uint8_t m_videobank_select; - uint8_t m_yawdim_dma; - uint16_t m_dma_register[16]; + uint8_t m_videobank_select = 0; + uint8_t m_yawdim_dma = 0; + uint16_t m_dma_register[16]{}; dma_state_t m_dma_state; - emu_timer *m_dma_timer; - emu_timer *m_autoerase_line_timer; + emu_timer *m_dma_timer = nullptr; + emu_timer *m_autoerase_line_timer = nullptr; void midyunit_cmos_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); uint16_t midyunit_cmos_r(offs_t offset); void midyunit_cmos_enable_w(address_space &space, uint16_t data); diff -Nru mame-0.242+dfsg.1/src/mame/includes/midzeus.h mame-0.243+dfsg.1/src/mame/includes/midzeus.h --- mame-0.242+dfsg.1/src/mame/includes/midzeus.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/midzeus.h 2022-04-29 05:37:26.000000000 +0000 @@ -24,18 +24,18 @@ { const void * palbase; const void * texbase; - uint16_t solidcolor; - uint16_t voffset; - int16_t zoffset; - uint16_t transcolor; - uint16_t texwidth; - uint16_t color; - uint32_t alpha; - uint32_t ctrl_word; - bool blend_enable; - bool depth_test_enable; - bool depth_write_enable; - uint32_t blend; + uint16_t solidcolor = 0; + uint16_t voffset = 0; + int16_t zoffset = 0; + uint16_t transcolor = 0; + uint16_t texwidth = 0; + uint16_t color = 0; + uint32_t alpha = 0; + uint32_t ctrl_word = 0; + bool blend_enable = false; + bool depth_test_enable = false; + bool depth_write_enable = false; + uint32_t blend = 0; uint8_t (*get_texel)(const void *, int, int, int); }; @@ -152,20 +152,20 @@ optional_ioport m_io_keypad; output_finder<7> m_digits; - emu_timer * m_display_irq_off_timer; - uint8_t m_crusnexo_leds_select; - uint32_t m_disk_asic_jr[0x10]; + emu_timer * m_display_irq_off_timer = nullptr; + uint8_t m_crusnexo_leds_select = 0; + uint32_t m_disk_asic_jr[0x10]{}; - uint8_t m_cmos_protected; + uint8_t m_cmos_protected = 0; - emu_timer * m_timer[2]; + emu_timer * m_timer[2]{}; private: - uint32_t m_gun_control; - uint8_t m_gun_irq_state; - emu_timer * m_gun_timer[2]; - int32_t m_gun_x[2], m_gun_y[2]; - uint8_t m_keypad_select; + uint32_t m_gun_control = 0; + uint8_t m_gun_irq_state = 0; + emu_timer * m_gun_timer[2]{}; + int32_t m_gun_x[2]{}, m_gun_y[2]{}; + uint8_t m_keypad_select = 0; void exit_handler(); void zeus_pointer_w(uint32_t which, uint32_t data, bool logit); @@ -189,22 +189,22 @@ void waveram_plot_check_depth_nowrite(int y, int x, uint16_t color, uint16_t depth); std::unique_ptr m_poly; - uint8_t m_log_fifo; + uint8_t m_log_fifo = 0; - uint32_t m_zeus_fifo[20]; - uint8_t m_zeus_fifo_words; - int16_t m_zeus_matrix[3][3]; - int32_t m_zeus_point[3]; - int16_t m_zeus_light[3]; - void * m_zeus_renderbase; - uint32_t m_zeus_palbase; - uint32_t m_zeus_unkbase; - int m_zeus_enable_logging; - uint32_t m_zeus_objdata; + uint32_t m_zeus_fifo[20]{}; + uint8_t m_zeus_fifo_words = 0; + int16_t m_zeus_matrix[3][3]{}; + int32_t m_zeus_point[3]{}; + int16_t m_zeus_light[3]{}; + void * m_zeus_renderbase = 0; + uint32_t m_zeus_palbase = 0; + uint32_t m_zeus_unkbase = 0; + int m_zeus_enable_logging = 0; + uint32_t m_zeus_objdata = 0; rectangle m_zeus_cliprect; std::unique_ptr m_waveram[2]; - int m_yoffs; - int m_texel_width; - int m_is_mk4b; + int m_yoffs = 0; + int m_texel_width = 0; + int m_is_mk4b = 0; }; diff -Nru mame-0.242+dfsg.1/src/mame/includes/mikromik.h mame-0.243+dfsg.1/src/mame/includes/mikromik.h --- mame-0.242+dfsg.1/src/mame/includes/mikromik.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/mikromik.h 2022-04-29 05:37:26.000000000 +0000 @@ -103,13 +103,13 @@ int m_a8; // video state - int m_llen; + int m_llen = 0; // serial state - int m_intc; - int m_rx21; - int m_tx21; - int m_rcl; + int m_intc = 0; + int m_rx21 = 0; + int m_tx21 = 0; + int m_rcl = 0; // floppy state int m_recall; diff -Nru mame-0.242+dfsg.1/src/mame/includes/mjkjidai.h mame-0.243+dfsg.1/src/mame/includes/mjkjidai.h --- mame-0.242+dfsg.1/src/mame/includes/mjkjidai.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/mjkjidai.h 2022-04-29 05:37:26.000000000 +0000 @@ -48,12 +48,12 @@ required_ioport_array<12> m_row; - int m_adpcm_pos; - int m_adpcm_end; - int m_keyb; - bool m_nmi_enable; - bool m_display_enable; - tilemap_t *m_bg_tilemap; + int m_adpcm_pos = 0; + int m_adpcm_end = 0; + int m_keyb = 0; + bool m_nmi_enable = false; + bool m_display_enable = false; + tilemap_t *m_bg_tilemap = nullptr; void keyboard_select_lo_w(uint8_t data); void keyboard_select_hi_w(uint8_t data); diff -Nru mame-0.242+dfsg.1/src/mame/includes/model1.h mame-0.243+dfsg.1/src/mame/includes/model1.h --- mame-0.242+dfsg.1/src/mame/includes/model1.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/model1.h 2022-04-29 05:37:26.000000000 +0000 @@ -130,14 +130,14 @@ void copro_reset(); - u32 m_copro_sincos_base; - u32 m_copro_inv_base; - u32 m_copro_isqrt_base; - u32 m_copro_atan_base[4]; - u32 m_copro_data_base; - u32 m_copro_ram_adr[4]; + u32 m_copro_sincos_base = 0; + u32 m_copro_inv_base = 0; + u32 m_copro_isqrt_base = 0; + u32 m_copro_atan_base[4]{}; + u32 m_copro_data_base = 0; + u32 m_copro_ram_adr[4]{}; - uint16_t m_r360_state; + uint16_t m_r360_state = 0; uint8_t r360_r(); void r360_w(uint8_t data); @@ -209,8 +209,8 @@ void irq_init(); void irq_control_w(u8 data); - uint8_t m_irq_status; - int m_last_irq; + uint8_t m_irq_status = 0; + int m_last_irq = 0; // Devices required_device m_maincpu; // V60 @@ -232,7 +232,7 @@ required_shared_ptr m_color_xlat; // Sound - int m_sound_irq; + int m_sound_irq = 0; // TGP FIFO void fifoout_push(uint32_t data); @@ -241,7 +241,7 @@ float fifoin_pop_f(); uint16_t ram_get_i(); float ram_get_f(); - u32 m_v60_copro_fifo_r, m_v60_copro_fifo_w; + u32 m_v60_copro_fifo_r = 0, m_v60_copro_fifo_w = 0; // TGP void tgp_reset(); @@ -271,12 +271,12 @@ quad_t *m_quadpt; std::unique_ptr m_quadind; - uint16_t m_v60_copro_ram_adr; - uint16_t m_v60_copro_ram_latch[2]; + uint16_t m_v60_copro_ram_adr = 0; + uint16_t m_v60_copro_ram_latch[2]{}; std::unique_ptr m_copro_ram_data; - uint16_t m_listctl[2]; - uint16_t *m_glist; - bool m_render_done; + uint16_t m_listctl[2]{}; + uint16_t *m_glist = nullptr; + bool m_render_done = false; std::unique_ptr m_tgp_ram; std::unique_ptr m_poly_ram; @@ -331,7 +331,7 @@ clipper_t m_clipfn[4]; // run-time rendering - uint16_t* m_display_list_current; + uint16_t* m_display_list_current = nullptr; optional_shared_ptr m_paletteram16; required_device m_palette; diff -Nru mame-0.242+dfsg.1/src/mame/includes/model2.h mame-0.243+dfsg.1/src/mame/includes/model2.h --- mame-0.242+dfsg.1/src/mame/includes/model2.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/model2.h 2022-04-29 05:37:26.000000000 +0000 @@ -77,7 +77,7 @@ std::unique_ptr m_palram; std::unique_ptr m_colorxlat; std::unique_ptr m_lumaram; - u8 m_gamma_table[256]; + u8 m_gamma_table[256]{}; std::unique_ptr m_poly; /* Public for access by the ioports */ @@ -133,25 +133,25 @@ optional_ioport m_gears; optional_ioport_array<4> m_lightgun_ports; - u32 m_timervals[4]; - u32 m_timerorig[4]; - int m_timerrun[4]; - int m_ctrlmode; - u16 m_cmd_data; - u8 m_driveio_comm_data; - int m_iop_write_num; - u32 m_iop_data; + u32 m_timervals[4]{}; + u32 m_timerorig[4]{}; + int m_timerrun[4]{}; + int m_ctrlmode = 0; + u16 m_cmd_data = 0; + u8 m_driveio_comm_data = 0; + int m_iop_write_num = 0; + u32 m_iop_data = 0; - u32 m_geo_read_start_address; - u32 m_geo_write_start_address; + u32 m_geo_read_start_address = 0; + u32 m_geo_write_start_address = 0; std::unique_ptr m_raster; std::unique_ptr m_geo; bitmap_rgb32 m_sys24_bitmap; // u32 m_soundack; void model2_check_irq_state(); void model2_check_irqack_state(u32 data); - u8 m_gearsel; - u8 m_lightgun_mux; + u8 m_gearsel = 0; + u8 m_lightgun_mux = 0; // Coprocessor communications u32 copro_prg_r(); @@ -196,7 +196,7 @@ u32 doa_prot_r(offs_t offset, u32 mem_mask = ~0); u32 doa_unk_r(); void sega_0229_map(address_map &map); - int m_prot_a; + int m_prot_a = 0; void raster_init(memory_region *texture_rom); void geo_init(memory_region *polygon_rom); @@ -253,10 +253,10 @@ virtual void video_start() override; - u32 m_intreq; - u32 m_intena; - u32 m_coproctl; - u32 m_coprocnt; + u32 m_intreq = 0; + u32 m_intena = 0; + u32 m_coproctl = 0; + u32 m_coprocnt = 0; virtual void copro_halt() = 0; virtual void copro_boot() = 0; @@ -264,14 +264,14 @@ private: void tri_list_dump(FILE *dst); - u32 m_geoctl; - u32 m_geocnt; - u32 m_videocontrol; - - bool m_render_unk; - bool m_render_mode; - bool m_render_test_mode; - int16 m_crtc_xoffset, m_crtc_yoffset; + u32 m_geoctl = 0; + u32 m_geocnt = 0; + u32 m_videocontrol = 0; + + bool m_render_unk = false; + bool m_render_mode = false; + bool m_render_test_mode = false; + int16 m_crtc_xoffset = 0, m_crtc_yoffset = 0; u32 *geo_process_command( geo_state *geo, u32 opcode, u32 *input, bool *end_code ); // geo commands @@ -345,7 +345,7 @@ u32 m_copro_sincos_base = 0; u32 m_copro_inv_base = 0; u32 m_copro_isqrt_base = 0; - u32 m_copro_atan_base[4]; + u32 m_copro_atan_base[4]{}; void copro_function_port_w(offs_t offset, u32 data); u32 copro_fifo_r(); @@ -721,7 +721,7 @@ private: model2_state& m_state; bitmap_rgb32 m_destmap; - int16_t m_xoffs,m_yoffs; + int16_t m_xoffs = 0, m_yoffs = 0; }; typedef model2_renderer::vertex_t poly_vertex; diff -Nru mame-0.242+dfsg.1/src/mame/includes/model3.h mame-0.243+dfsg.1/src/mame/includes/model3.h --- mame-0.242+dfsg.1/src/mame/includes/model3.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/model3.h 2022-04-29 05:37:26.000000000 +0000 @@ -216,51 +216,51 @@ required_device m_billboard; memory_bank_creator m_bank2; - tilemap_t *m_layer4[4]; - tilemap_t *m_layer8[4]; + tilemap_t *m_layer4[4]{}; + tilemap_t *m_layer8[4]{}; - int m_sound_irq_enable; - emu_timer *m_sound_timer; - emu_timer *m_real3d_dma_timer; - emu_timer *m_scan_timer; - uint8_t m_irq_enable; - uint8_t m_irq_state; - uint8_t m_scsi_irq_state; - int m_crom_bank; - int m_controls_bank; - bool m_step15_with_mpc106; - bool m_step20_with_old_real3d; - uint32_t m_real3d_device_id; - int m_pci_bus; - int m_pci_device; - int m_pci_function; - int m_pci_reg; - uint32_t m_mpc105_regs[0x40]; - uint32_t m_mpc105_addr; - uint32_t m_mpc106_regs[0x40]; - uint32_t m_mpc106_addr; - uint32_t m_dma_data; - uint32_t m_dma_status; - uint32_t m_dma_source; - uint32_t m_dma_dest; - uint32_t m_dma_endian; - uint32_t m_dma_irq; - uint32_t m_dma_busy; - uint64_t m_controls_2; - uint64_t m_controls_3; - uint8_t m_serial_fifo1; - uint8_t m_serial_fifo2; - int m_lightgun_reg_sel; - int m_adc_channel; - uint64_t m_real3d_status; - int m_prot_data_ptr; + int m_sound_irq_enable = 0; + emu_timer *m_sound_timer = nullptr; + emu_timer *m_real3d_dma_timer = nullptr; + emu_timer *m_scan_timer = nullptr; + uint8_t m_irq_enable = 0; + uint8_t m_irq_state = 0; + uint8_t m_scsi_irq_state = 0; + int m_crom_bank = 0; + int m_controls_bank = 0; + bool m_step15_with_mpc106 = false; + bool m_step20_with_old_real3d = false; + uint32_t m_real3d_device_id = 0; + int m_pci_bus = 0; + int m_pci_device = 0; + int m_pci_function = 0; + int m_pci_reg = 0; + uint32_t m_mpc105_regs[0x40]{}; + uint32_t m_mpc105_addr = 0; + uint32_t m_mpc106_regs[0x40]{}; + uint32_t m_mpc106_addr = 0; + uint32_t m_dma_data = 0; + uint32_t m_dma_status = 0; + uint32_t m_dma_source = 0; + uint32_t m_dma_dest = 0; + uint32_t m_dma_endian = 0; + uint32_t m_dma_irq = 0; + uint32_t m_dma_busy = 0; + uint64_t m_controls_2 = 0; + uint64_t m_controls_3 = 0; + uint8_t m_serial_fifo1 = 0; + uint8_t m_serial_fifo2 = 0; + int m_lightgun_reg_sel = 0; + int m_adc_channel = 0; + uint64_t m_real3d_status = 0; + int m_prot_data_ptr = 0; std::unique_ptr m_vrom; - int m_step; - int m_m3_step; - int32_t m_tap_state; - uint64_t m_ir; - uint8_t m_id_data[32]; - int32_t m_id_size; + int m_step = 0; + int m_m3_step = 0; + int32_t m_tap_state = 0; + uint64_t m_ir = 0; + uint8_t m_id_data[32]{}; + int32_t m_id_size = 0; int m_tdo = 0; uint16_t m_layer_priority = 0; uint32_t m_layer_modulate_r = 0; diff -Nru mame-0.242+dfsg.1/src/mame/includes/momoko.h mame-0.243+dfsg.1/src/mame/includes/momoko.h --- mame-0.242+dfsg.1/src/mame/includes/momoko.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/momoko.h 2022-04-29 05:37:26.000000000 +0000 @@ -50,16 +50,16 @@ required_ioport m_io_fake; /* video-related */ - u8 m_fg_scrollx; - u8 m_fg_scrolly; - u8 m_fg_select; - u8 m_text_scrolly; - u8 m_text_mode; - u8 m_bg_select; - u8 m_bg_priority; - u8 m_bg_mask; - u8 m_fg_mask; - u8 m_flipscreen; + u8 m_fg_scrollx = 0; + u8 m_fg_scrolly = 0; + u8 m_fg_select = 0; + u8 m_text_scrolly = 0; + u8 m_text_mode = 0; + u8 m_bg_select = 0; + u8 m_bg_priority = 0; + u8 m_bg_mask = 0; + u8 m_fg_mask = 0; + u8 m_flipscreen = 0; void bg_read_bank_w(u8 data); void fg_scrollx_w(u8 data); void fg_scrolly_w(u8 data); diff -Nru mame-0.242+dfsg.1/src/mame/includes/mpf1.h mame-0.243+dfsg.1/src/mame/includes/mpf1.h --- mame-0.242+dfsg.1/src/mame/includes/mpf1.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/mpf1.h 2022-04-29 05:37:26.000000000 +0000 @@ -66,13 +66,13 @@ void ppi_pb_w(uint8_t data); void ppi_pc_w(uint8_t data); - int m_break; - int m_m1; + int m_break = 0; + int m_m1 = 0; - uint8_t m_lednum; + uint8_t m_lednum = 0; - emu_timer *m_led_refresh_timer; - address_space *m_program; + emu_timer *m_led_refresh_timer = nullptr; + address_space *m_program = nullptr; TIMER_CALLBACK_MEMBER(led_refresh); TIMER_DEVICE_CALLBACK_MEMBER(check_halt_callback); diff -Nru mame-0.242+dfsg.1/src/mame/includes/mpu4.h mame-0.243+dfsg.1/src/mame/includes/mpu4.h --- mame-0.242+dfsg.1/src/mame/includes/mpu4.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/mpu4.h 2022-04-29 05:37:26.000000000 +0000 @@ -97,7 +97,7 @@ struct bwb_chr_table//dynamically populated table for BwB protection { - uint8_t response; + uint8_t response = 0; }; @@ -369,68 +369,68 @@ TIMER_IC24 }; - int m_mod_number; - int m_mmtr_data; - int m_ay8913_address; - int m_serial_data; - int m_signal_50hz; - int m_ic4_input_b; - int m_aux1_input; - int m_aux2_input; - int m_IC23G1; - int m_IC23G2A; - int m_IC23G2B; - int m_IC23GC; - int m_IC23GB; - int m_IC23GA; - int m_prot_col; - int m_lamp_col; - int m_init_col; - int m_reel_flag; - int m_ic23_active; - int m_led_lamp; - int m_link7a_connected; + int m_mod_number = 0; + int m_mmtr_data = 0; + int m_ay8913_address = 0; + int m_serial_data = 0; + int m_signal_50hz = 0; + int m_ic4_input_b = 0; + int m_aux1_input = 0; + int m_aux2_input = 0; + int m_IC23G1 = 0; + int m_IC23G2A = 0; + int m_IC23G2B = 0; + int m_IC23GC = 0; + int m_IC23GB = 0; + int m_IC23GA = 0; + int m_prot_col = 0; + int m_lamp_col = 0; + int m_init_col = 0; + int m_reel_flag = 0; + int m_ic23_active = 0; + int m_led_lamp = 0; + int m_link7a_connected = 0; int m_low_volt_detect_disable = 0; - int m_aux1_invert; - int m_aux2_invert; - int m_door_invert; - emu_timer *m_ic24_timer; - int m_expansion_latch; - int m_global_volume; + int m_aux1_invert = 0; + int m_aux2_invert = 0; + int m_door_invert = 0; + emu_timer *m_ic24_timer = nullptr; + int m_expansion_latch = 0; + int m_global_volume = 0; int m_input_strobe = 0; - uint8_t m_lamp_strobe; - uint8_t m_lamp_strobe2; - uint8_t m_lamp_strobe_ext; - uint8_t m_lamp_strobe_ext_persistence; - uint8_t m_led_strobe; - uint8_t m_ay_data; - int m_optic_pattern; + uint8_t m_lamp_strobe = 0; + uint8_t m_lamp_strobe2 = 0; + uint8_t m_lamp_strobe_ext = 0; + uint8_t m_lamp_strobe_ext_persistence = 0; + uint8_t m_led_strobe = 0; + uint8_t m_ay_data = 0; + int m_optic_pattern = 0; - int m_active_reel; + int m_active_reel = 0; int m_remote_meter = 0; - int m_reel_mux; - int m_lamp_extender; - int m_last_b7; - int m_last_latch; - int m_lamp_sense; - int m_card_live; - int m_led_extender; + int m_reel_mux = 0; + int m_lamp_extender = 0; + int m_last_b7 = 0; + int m_last_latch = 0; + int m_lamp_sense = 0; + int m_card_live = 0; + int m_led_extender = 0; int m_bwb_bank = 0; - int m_chr_state; - int m_chr_counter; - int m_chr_value; - int m_bwb_return; - int m_pageval; - int m_pageset; - int m_hopper; + int m_chr_state = 0; + int m_chr_counter = 0; + int m_chr_value = 0; + int m_bwb_return = 0; + int m_pageval = 0; + int m_pageset = 0; + int m_hopper = 0; int m_reels = 0; - int m_chrdata; - int m_t1; - int m_t3l; - int m_t3h; + int m_chrdata = 0; + int m_t1 = 0; + int m_t3l = 0; + int m_t3h = 0; uint8_t m_numbanks = 0; - mpu4_chr_table* m_current_chr_table; - const bwb_chr_table* m_bwb_chr_table1; + mpu4_chr_table* m_current_chr_table = nullptr; + const bwb_chr_table* m_bwb_chr_table1 = nullptr; }; INPUT_PORTS_EXTERN( mpu4 ); diff -Nru mame-0.242+dfsg.1/src/mame/includes/mpz80.h mame-0.243+dfsg.1/src/mame/includes/mpz80.h --- mame-0.242+dfsg.1/src/mame/includes/mpz80.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/mpz80.h 2022-04-29 05:37:26.000000000 +0000 @@ -73,9 +73,9 @@ DECLARE_WRITE_LINE_MEMBER( s100_nmi_w ); // memory state - uint32_t m_addr; - uint8_t m_task; - uint8_t m_mask; + uint32_t m_addr = 0; + uint8_t m_task = 0; + uint8_t m_mask = 0; // interrupt state int m_nmi; diff -Nru mame-0.242+dfsg.1/src/mame/includes/msx.h mame-0.243+dfsg.1/src/mame/includes/msx.h --- mame-0.242+dfsg.1/src/mame/includes/msx.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/msx.h 2022-04-29 05:37:26.000000000 +0000 @@ -330,21 +330,21 @@ private: /* PSG */ - int m_psg_b; + int m_psg_b = 0; /* mouse */ - uint16_t m_mouse[2]; - int m_mouse_stat[2]; + uint16_t m_mouse[2]{}; + int m_mouse_stat[2]{}; /* kanji */ - int m_kanji_latch; + int m_kanji_latch = 0; /* memory */ msx_internal_slot_interface m_empty_slot; - msx_internal_slot_interface *m_all_slots[4][4][4]; - msx_internal_slot_interface *m_current_page[4]; - bool m_slot_expanded[4]; - uint8_t m_primary_slot; - uint8_t m_secondary_slot[4]; - int m_port_c_old; - int m_keylatch; + msx_internal_slot_interface *m_all_slots[4][4][4]{}; + msx_internal_slot_interface *m_current_page[4]{}; + bool m_slot_expanded[4]{}; + uint8_t m_primary_slot = 0; + uint8_t m_secondary_slot[4]{}; + int m_port_c_old = 0; + int m_keylatch = 0; }; @@ -509,7 +509,7 @@ required_device m_rtc; /* rtc */ - int m_rtc_latch; + int m_rtc_latch = 0; }; diff -Nru mame-0.242+dfsg.1/src/mame/includes/mustache.h mame-0.243+dfsg.1/src/mame/includes/mustache.h --- mame-0.242+dfsg.1/src/mame/includes/mustache.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/mustache.h 2022-04-29 05:37:26.000000000 +0000 @@ -40,8 +40,8 @@ required_ioport m_dswb; - tilemap_t *m_bg_tilemap; - int m_control_byte; + tilemap_t *m_bg_tilemap = nullptr; + int m_control_byte = 0; void videoram_w(offs_t offset, uint8_t data); void video_control_w(uint8_t data); diff -Nru mame-0.242+dfsg.1/src/mame/includes/mystston.h mame-0.243+dfsg.1/src/mame/includes/mystston.h --- mame-0.242+dfsg.1/src/mame/includes/mystston.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/mystston.h 2022-04-29 05:37:26.000000000 +0000 @@ -53,9 +53,9 @@ required_ioport m_dsw1; // video state - tilemap_t *m_fg_tilemap; - tilemap_t *m_bg_tilemap; - emu_timer *m_interrupt_timer; + tilemap_t *m_fg_tilemap = nullptr; + tilemap_t *m_bg_tilemap = nullptr; + emu_timer *m_interrupt_timer = nullptr; required_shared_ptr m_bg_videoram; required_shared_ptr m_fg_videoram; required_shared_ptr m_spriteram; diff -Nru mame-0.242+dfsg.1/src/mame/includes/mystwarr.h mame-0.243+dfsg.1/src/mame/includes/mystwarr.h --- mame-0.242+dfsg.1/src/mame/includes/mystwarr.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/mystwarr.h 2022-04-29 05:37:26.000000000 +0000 @@ -38,22 +38,22 @@ optional_memory_bank m_okibank; // for viostormabbl std::unique_ptr m_decoded; - uint8_t m_mw_irq_control; - int m_cur_sound_region; - int m_layer_colorbase[6]; - int m_oinprion; - int m_cbparam; - int m_sprite_colorbase; - int m_sub1_colorbase; - int m_last_psac_colorbase; - int m_gametype; - int m_roz_enable; - int m_roz_rombank; - tilemap_t *m_ult_936_tilemap; - uint16_t m_clip; + uint8_t m_mw_irq_control = 0; + int m_cur_sound_region = 0; + int m_layer_colorbase[6]{}; + int m_oinprion = 0; + int m_cbparam = 0; + int m_sprite_colorbase = 0; + int m_sub1_colorbase = 0; + int m_last_psac_colorbase = 0; + int m_gametype = 0; + int m_roz_enable = 0; + int m_roz_rombank = 0; + tilemap_t *m_ult_936_tilemap = nullptr; + uint16_t m_clip = 0; - uint8_t m_sound_ctrl; - uint8_t m_sound_nmi_clk; + uint8_t m_sound_ctrl = 0; + uint8_t m_sound_nmi_clk = 0; uint16_t eeprom_r(offs_t offset, uint16_t mem_mask = ~0); void mweeprom_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); diff -Nru mame-0.242+dfsg.1/src/mame/includes/mz2500.h mame-0.243+dfsg.1/src/mame/includes/mz2500.h --- mame-0.242+dfsg.1/src/mame/includes/mz2500.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/mz2500.h 2022-04-29 05:37:26.000000000 +0000 @@ -76,33 +76,33 @@ required_shared_ptr m_cgram; required_shared_ptr m_wram; - uint8_t *m_ipl_rom; - uint8_t *m_kanji_rom; - uint8_t *m_kanji2_rom; + uint8_t *m_ipl_rom = nullptr; + uint8_t *m_kanji_rom = nullptr; + uint8_t *m_kanji2_rom = nullptr; std::unique_ptr m_pcg_ram; std::unique_ptr m_emm_ram; - uint8_t *m_dic_rom; - uint8_t *m_phone_rom; - uint8_t *m_iplpro_rom; + uint8_t *m_dic_rom = nullptr; + uint8_t *m_phone_rom = nullptr; + uint8_t *m_iplpro_rom = nullptr; - uint8_t m_bank_val[8]; - uint8_t m_bank_addr; - uint8_t m_irq_sel; - uint8_t m_irq_vector[4]; - uint8_t m_irq_mask[4]; - uint8_t m_irq_pending[4]; - uint8_t m_kanji_bank; - uint8_t m_dic_bank; - uint8_t m_fdc_reverse; - uint8_t m_key_mux; - uint8_t m_monitor_type; - uint8_t m_text_reg[0x100]; - uint8_t m_text_reg_index; - uint8_t m_text_col_size; - uint8_t m_text_font_reg; - uint8_t m_pal_select; - uint16_t m_cg_vs; - uint16_t m_cg_ve; + uint8_t m_bank_val[8]{}; + uint8_t m_bank_addr = 0; + uint8_t m_irq_sel = 0; + uint8_t m_irq_vector[4]{}; + uint8_t m_irq_mask[4]{}; + uint8_t m_irq_pending[4]{}; + uint8_t m_kanji_bank = 0; + uint8_t m_dic_bank = 0; + uint8_t m_fdc_reverse = 0; + uint8_t m_key_mux = 0; + uint8_t m_monitor_type = 0; + uint8_t m_text_reg[0x100]{}; + uint8_t m_text_reg_index = 0; + uint8_t m_text_col_size = 0; + uint8_t m_text_font_reg = 0; + uint8_t m_pal_select = 0; + uint16_t m_cg_vs = 0; + uint16_t m_cg_ve = 0; uint16_t m_cg_hs = 0; uint16_t m_cg_he = 0; int16_t m_tv_vs = 0; diff -Nru mame-0.242+dfsg.1/src/mame/includes/n64.h mame-0.243+dfsg.1/src/mame/includes/n64.h --- mame-0.242+dfsg.1/src/mame/includes/n64.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/n64.h 2022-04-29 05:37:26.000000000 +0000 @@ -64,9 +64,9 @@ struct n64_savable_data_t { - uint8_t sram[0x20000]; - uint8_t eeprom[2048]; - uint8_t mempak[2][0x8000]; + uint8_t sram[0x20000]{}; + uint8_t eeprom[2048]{}; + uint8_t mempak[2][0x8000]{}; }; class n64_periphs : public device_t, @@ -75,8 +75,8 @@ private: struct AUDIO_DMA { - uint32_t address; - uint32_t length; + uint32_t address = 0; + uint32_t length = 0; }; public: @@ -127,40 +127,40 @@ void video_update(bitmap_rgb32 &bitmap); // Video Interface (VI) registers - uint32_t vi_width; - uint32_t vi_origin; - uint32_t vi_control; - uint32_t vi_blank; - uint32_t vi_hstart; - uint32_t vi_vstart; - uint32_t vi_xscale; - uint32_t vi_yscale; - uint32_t vi_burst; - uint32_t vi_vsync; - uint32_t vi_hsync; - uint32_t vi_leap; - uint32_t vi_intr; - uint32_t vi_vburst; - uint8_t field; + uint32_t vi_width = 0; + uint32_t vi_origin = 0; + uint32_t vi_control = 0; + uint32_t vi_blank = 0; + uint32_t vi_hstart = 0; + uint32_t vi_vstart = 0; + uint32_t vi_xscale = 0; + uint32_t vi_yscale = 0; + uint32_t vi_burst = 0; + uint32_t vi_vsync = 0; + uint32_t vi_hsync = 0; + uint32_t vi_leap = 0; + uint32_t vi_intr = 0; + uint32_t vi_vburst = 0; + uint8_t field = 0; // nvram-specific for the console - device_t *m_nvram_image; + device_t *m_nvram_image = nullptr; n64_savable_data_t m_save_data; - uint32_t cart_length; + uint32_t cart_length = 0; - bool dd_present; - bool disk_present; - bool cart_present; + bool dd_present = false; + bool disk_present = false; + bool cart_present = false; // Mouse X2/Y2 for delta position - int mouse_x2[4]; - int mouse_y2[4]; + int mouse_x2[4]{}; + int mouse_y2[4]{}; void poll_reset_button(bool button); - uint32_t dp_clock; + uint32_t dp_clock = 0; protected: // device-level overrides @@ -168,70 +168,70 @@ virtual void device_reset() override; private: - n64_state* m_n64; - address_space *m_mem_map; + n64_state* m_n64 = nullptr; + address_space *m_mem_map = nullptr; required_device m_vr4300; required_device m_rsp; required_shared_ptr m_rsp_imem; required_shared_ptr m_rsp_dmem; - uint32_t *m_rdram; - uint32_t *m_sram; + uint32_t *m_rdram = nullptr; + uint32_t *m_sram = nullptr; void clear_rcp_interrupt(int interrupt); - bool reset_held; - emu_timer *reset_timer; - emu_timer *dp_delay_timer; + bool reset_held = false; + emu_timer *reset_timer = nullptr; + emu_timer *dp_delay_timer = nullptr; - uint8_t is64_buffer[0x10000]; + uint8_t is64_buffer[0x10000]{}; // Video interface (VI) registers and functions - emu_timer *vi_scanline_timer; + emu_timer *vi_scanline_timer = nullptr; // Audio Interface (AI) registers and functions void ai_dma(); AUDIO_DMA *ai_fifo_get_top(); void ai_fifo_push(uint32_t address, uint32_t length); void ai_fifo_pop(); - bool ai_delayed_carry; + bool ai_delayed_carry = false; required_device_array ai_dac; - uint32_t ai_dram_addr; - uint32_t ai_len; - uint32_t ai_control; - int ai_dacrate; - int ai_bitrate; - uint32_t ai_status; - - emu_timer *ai_timer; - - AUDIO_DMA ai_fifo[AUDIO_DMA_DEPTH]; - int ai_fifo_wpos; - int ai_fifo_rpos; - int ai_fifo_num; + uint32_t ai_dram_addr = 0; + uint32_t ai_len = 0; + uint32_t ai_control = 0; + int ai_dacrate = 0; + int ai_bitrate = 0; + uint32_t ai_status = 0; + + emu_timer *ai_timer = nullptr; + + AUDIO_DMA ai_fifo[AUDIO_DMA_DEPTH]{}; + int ai_fifo_wpos = 0; + int ai_fifo_rpos = 0; + int ai_fifo_num = 0; // Memory Interface (MI) registers - uint32_t mi_version; - uint32_t mi_interrupt; - uint32_t mi_intr_mask; - uint32_t mi_mode; + uint32_t mi_version = 0; + uint32_t mi_interrupt = 0; + uint32_t mi_intr_mask = 0; + uint32_t mi_mode = 0; // RDRAM Interface (RI) registers - uint32_t rdram_regs[10]; - uint32_t ri_regs[8]; + uint32_t rdram_regs[10]{}; + uint32_t ri_regs[8]{}; // RSP Interface (SP) registers void sp_dma(int direction); - uint32_t sp_mem_addr; - uint32_t sp_dram_addr; - uint32_t sp_mem_addr_start; - uint32_t sp_dram_addr_start; - int sp_dma_length; - int sp_dma_count; - int sp_dma_skip; - uint32_t sp_semaphore; + uint32_t sp_mem_addr = 0; + uint32_t sp_dram_addr = 0; + uint32_t sp_mem_addr_start = 0; + uint32_t sp_dram_addr_start = 0; + int sp_dma_length = 0; + int sp_dma_count = 0; + int sp_dma_skip = 0; + uint32_t sp_semaphore = 0; // Disk Drive (DD) registers and functions void dd_set_zone_and_track_offset(); @@ -239,62 +239,62 @@ void dd_write_sector(); void dd_read_sector(); void dd_read_C2(); - uint32_t dd_buffer[256]; - uint32_t dd_sector_data[64]; - uint32_t dd_ram_seq_data[16]; - uint32_t dd_data_reg; - uint32_t dd_status_reg; - uint32_t dd_track_reg; - uint32_t dd_buf_status_reg; - uint32_t dd_sector_err_reg; - uint32_t dd_seq_status_reg; - uint32_t dd_seq_ctrl_reg; - uint32_t dd_sector_reg; - uint32_t dd_reset_reg; - uint32_t dd_current_reg; - bool dd_bm_reset_held; - bool dd_write; - uint8_t dd_int; - uint8_t dd_start_block; - uint8_t dd_start_sector; - uint8_t dd_sectors_per_block; - uint8_t dd_sector_size; - uint8_t dd_zone; - uint32_t dd_track_offset; + uint32_t dd_buffer[256]{}; + uint32_t dd_sector_data[64]{}; + uint32_t dd_ram_seq_data[16]{}; + uint32_t dd_data_reg = 0; + uint32_t dd_status_reg = 0; + uint32_t dd_track_reg = 0; + uint32_t dd_buf_status_reg = 0; + uint32_t dd_sector_err_reg = 0; + uint32_t dd_seq_status_reg = 0; + uint32_t dd_seq_ctrl_reg = 0; + uint32_t dd_sector_reg = 0; + uint32_t dd_reset_reg = 0; + uint32_t dd_current_reg = 0; + bool dd_bm_reset_held = false; + bool dd_write = 0; + uint8_t dd_int = 0; + uint8_t dd_start_block = 0; + uint8_t dd_start_sector = 0; + uint8_t dd_sectors_per_block = 0; + uint8_t dd_sector_size = 0; + uint8_t dd_zone = 0; + uint32_t dd_track_offset = 0; // Peripheral Interface (PI) registers and functions - emu_timer *pi_dma_timer; - uint32_t pi_dram_addr; - uint32_t pi_cart_addr; - uint32_t pi_rd_len; - uint32_t pi_wr_len; - uint32_t pi_status; - uint32_t pi_bsd_dom1_lat; - uint32_t pi_bsd_dom1_pwd; - uint32_t pi_bsd_dom1_pgs; - uint32_t pi_bsd_dom1_rls; - uint32_t pi_bsd_dom2_lat; - uint32_t pi_bsd_dom2_pwd; - uint32_t pi_bsd_dom2_pgs; - uint32_t pi_bsd_dom2_rls; - uint32_t pi_dma_dir; + emu_timer *pi_dma_timer = nullptr; + uint32_t pi_dram_addr = 0; + uint32_t pi_cart_addr = 0; + uint32_t pi_rd_len = 0; + uint32_t pi_wr_len = 0; + uint32_t pi_status = 0; + uint32_t pi_bsd_dom1_lat = 0; + uint32_t pi_bsd_dom1_pwd = 0; + uint32_t pi_bsd_dom1_pgs = 0; + uint32_t pi_bsd_dom1_rls = 0; + uint32_t pi_bsd_dom2_lat = 0; + uint32_t pi_bsd_dom2_pwd = 0; + uint32_t pi_bsd_dom2_pgs = 0; + uint32_t pi_bsd_dom2_rls = 0; + uint32_t pi_dma_dir = 0; // Serial Interface (SI) registers and functions - emu_timer *si_dma_timer; + emu_timer *si_dma_timer = nullptr; void pif_dma(int direction); void handle_pif(); int pif_channel_handle_command(int channel, int slength, uint8_t *sdata, int rlength, uint8_t *rdata); uint8_t calc_mempak_crc(uint8_t *buffer, int length); - uint8_t pif_ram[0x40]; - uint8_t pif_cmd[0x40]; - uint32_t si_dram_addr; - uint32_t si_pif_addr; - uint32_t si_pif_addr_rd64b; - uint32_t si_pif_addr_wr64b; - uint32_t si_status_val; - uint32_t si_dma_dir; - uint32_t cic_status; - int cic_type; + uint8_t pif_ram[0x40]{}; + uint8_t pif_cmd[0x40]{}; + uint32_t si_dram_addr = 0; + uint32_t si_pif_addr = 0; + uint32_t si_pif_addr_rd64b = 0; + uint32_t si_pif_addr_wr64b = 0; + uint32_t si_status_val = 0; + uint32_t si_dma_dir = 0; + uint32_t cic_status = 0; + int cic_type = 0; n64_savable_data_t savable_data; @@ -302,11 +302,11 @@ void vi_recalculate_resolution(); void video_update16(bitmap_rgb32 &bitmap); void video_update32(bitmap_rgb32 &bitmap); - uint8_t random_seed; // %HACK%, adds 19 each time it's read and is more or less random + uint8_t random_seed = 0x55; // %HACK%, adds 19 each time it's read and is more or less random uint8_t get_random() { return random_seed += 0x13; } - int32_t m_gamma_table[256]; - int32_t m_gamma_dither_table[0x4000]; + int32_t m_gamma_table[256]{}; + int32_t m_gamma_dither_table[0x4000]{}; }; diff -Nru mame-0.242+dfsg.1/src/mame/includes/namcofl.h mame-0.243+dfsg.1/src/mame/includes/namcofl.h --- mame-0.242+dfsg.1/src/mame/includes/namcofl.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/namcofl.h 2022-04-29 05:37:26.000000000 +0000 @@ -63,11 +63,11 @@ optional_ioport m_brake; optional_ioport m_wheel; - emu_timer *m_raster_interrupt_timer; - emu_timer *m_vblank_interrupt_timer; - emu_timer *m_network_interrupt_timer; - uint8_t m_mcu_port6; - uint32_t m_sprbank; + emu_timer *m_raster_interrupt_timer = nullptr; + emu_timer *m_vblank_interrupt_timer = nullptr; + emu_timer *m_network_interrupt_timer = nullptr; + uint8_t m_mcu_port6 = 0; + uint32_t m_sprbank = 0; uint32_t unk1_r(); uint8_t network_r(offs_t offset); diff -Nru mame-0.242+dfsg.1/src/mame/includes/namconb1.h mame-0.243+dfsg.1/src/mame/includes/namconb1.h --- mame-0.242+dfsg.1/src/mame/includes/namconb1.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/namconb1.h 2022-04-29 05:37:26.000000000 +0000 @@ -72,7 +72,7 @@ virtual void video_start() override; private: - int m_gametype; + int m_gametype = 0; enum { /* Namco NB1 */ @@ -112,12 +112,12 @@ optional_shared_ptr m_rozbank32; required_shared_ptr m_namconb_shareram; - u8 m_vbl_irq_level; - u8 m_pos_irq_level; - u8 m_unk_irq_level; - u16 m_count; - u8 m_port6; - u32 m_tilemap_tile_bank[4]; + u8 m_vbl_irq_level = 0; + u8 m_pos_irq_level = 0; + u8 m_unk_irq_level = 0; + u16 m_count = 0; + u8 m_port6 = 0; + u32 m_tilemap_tile_bank[4]{}; std::unique_ptr m_spritebank32_delayed; bool m_update_to_line_before_posirq; diff -Nru mame-0.242+dfsg.1/src/mame/includes/namcos1.h mame-0.243+dfsg.1/src/mame/includes/namcos1.h --- mame-0.242+dfsg.1/src/mame/includes/namcos1.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/namcos1.h 2022-04-29 05:37:26.000000000 +0000 @@ -96,25 +96,25 @@ required_ioport m_io_dipsw; required_device m_dsw_sel; - int m_key_id; - int m_key_reg; - int m_key_rng; - int m_key_swap4_arg; - int m_key_swap4; - int m_key_bottom4; - int m_key_top4; - u32 m_key_quotient; - u32 m_key_reminder; - u32 m_key_numerator_high_word; - u8 m_key[8]; - int m_mcu_patch_data; - int m_reset; - int m_input_count; - int m_strobe; - int m_strobe_count; - int m_stored_input[2]; - bool m_copy_sprites; - u8 m_drawmode_table[16]; + int m_key_id = 0; + int m_key_reg = 0; + int m_key_rng = 0; + int m_key_swap4_arg = 0; + int m_key_swap4 = 0; + int m_key_bottom4 = 0; + int m_key_top4 = 0; + u32 m_key_quotient = 0; + u32 m_key_reminder = 0; + u32 m_key_numerator_high_word = 0; + u8 m_key[8]{}; + int m_mcu_patch_data = 0; + int m_reset = 0; + int m_input_count = 0; + int m_strobe = 0; + int m_strobe_count = 0; + int m_stored_input[2]{}; + bool m_copy_sprites = false; + u8 m_drawmode_table[16]{}; DECLARE_WRITE_LINE_MEMBER(subres_w); void audiocpu_irq_ack_w(u8 data); diff -Nru mame-0.242+dfsg.1/src/mame/includes/namcos22.h mame-0.243+dfsg.1/src/mame/includes/namcos22.h --- mame-0.242+dfsg.1/src/mame/includes/namcos22.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/namcos22.h 2022-04-29 05:37:26.000000000 +0000 @@ -154,8 +154,8 @@ struct namcos22_scenenode *m_scenenode_cur; std::list m_scenenode_alloc; - float m_clipx; - float m_clipy; + float m_clipx = 0.0; + float m_clipy = 0.0; rectangle m_cliprect; inline u8 nthbyte(const u32 *src, int n) { return (src[n / 4] << ((n & 3) * 8)) >> 24; } @@ -255,7 +255,7 @@ int m_fog_r_per_cztype[4]; int m_fog_g_per_cztype[4]; int m_fog_b_per_cztype[4]; - u16 m_czattr[8]; + u16 m_czattr[8] = { }; required_device m_palette; optional_shared_ptr m_czram; @@ -428,74 +428,74 @@ output_finder<16> m_mcu_out; output_finder<8> m_cpuled_out; - u8 m_syscontrol[0x20]; - bool m_dsp_irq_enabled; - u16 m_dsp_master_bioz; + u8 m_syscontrol[0x20] = { }; + bool m_dsp_irq_enabled = false; + u16 m_dsp_master_bioz = 0; std::unique_ptr m_pointram; - int m_old_coin_state; - u32 m_credits1; - u32 m_credits2; - u32 m_point_address; - u32 m_point_data; - u16 m_SerialDataSlaveToMasterNext; - u16 m_SerialDataSlaveToMasterCurrent; - int m_RenderBufSize; - u16 m_RenderBufData[NAMCOS22_MAX_RENDER_CMD_SEQ]; - u16 m_portbits[2]; - int m_irq_state; - int m_irq_enabled; + int m_old_coin_state = 0; + u32 m_credits1 = 0; + u32 m_credits2 = 0; + u32 m_point_address = 0; + u32 m_point_data = 0; + u16 m_SerialDataSlaveToMasterNext = 0; + u16 m_SerialDataSlaveToMasterCurrent = 0; + int m_RenderBufSize = 0; + u16 m_RenderBufData[NAMCOS22_MAX_RENDER_CMD_SEQ] = { }; + u16 m_portbits[2] = { }; + int m_irq_state = 0; + int m_irq_enabled = 0; namcos22_dsp_upload_state m_dsp_upload_state; - int m_UploadDestIdx; - u32 m_cpuled_data; - u16 m_su_82; - u16 m_keycus_id; - u16 m_keycus_rng; - int m_gametype; - int m_cz_adjust; + int m_UploadDestIdx = 0; + u32 m_cpuled_data = 0; + u16 m_su_82 = 0; + u16 m_keycus_id = 0; + u16 m_keycus_rng = 0; + int m_gametype = 0; + int m_cz_adjust = 0; std::unique_ptr m_poly; - u16 m_dspram_bank; - u16 m_dspram16_latch; - bool m_slave_simulation_active; - int m_absolute_priority; - int m_objectshift; - float m_viewmatrix[4][4]; - u8 m_reflection; - bool m_cullflip; - u8 m_LitSurfaceInfo[NAMCOS22_MAX_LIT_SURFACES]; - int m_SurfaceNormalFormat; - unsigned m_LitSurfaceCount; - unsigned m_LitSurfaceIndex; - int m_pointrom_size; + u16 m_dspram_bank = 0; + u16 m_dspram16_latch = 0; + bool m_slave_simulation_active = false; + int m_absolute_priority = 0; + int m_objectshift = 0; + float m_viewmatrix[4][4] = { }; + u8 m_reflection = 0; + bool m_cullflip = false; + u8 m_LitSurfaceInfo[NAMCOS22_MAX_LIT_SURFACES] = { }; + int m_SurfaceNormalFormat = 0; + unsigned m_LitSurfaceCount = 0; + unsigned m_LitSurfaceIndex = 0; + int m_pointrom_size = 0; std::unique_ptr m_pointrom; std::unique_ptr m_dirtypal; std::unique_ptr m_mix_bitmap; tilemap_t *m_bgtilemap; - u16 m_tilemapattr[8]; + u16 m_tilemapattr[8] = { }; - int m_spot_factor; - int m_text_palbase; - int m_bg_palbase; - - float m_camera_zoom; - float m_camera_vx; - float m_camera_vy; - float m_camera_vu; - float m_camera_vd; - float m_camera_vl; - float m_camera_vr; - float m_camera_lx; // unit vector for light direction - float m_camera_ly; // " - float m_camera_lz; // " - int m_camera_ambient; // 0.0..1.0 - int m_camera_power; // 0.0..1.0 + int m_spot_factor = 0; + int m_text_palbase = 0; + int m_bg_palbase = 0; + + float m_camera_zoom = 0.0f; + float m_camera_vx = 0.0f; + float m_camera_vy = 0.0f; + float m_camera_vu = 0.0f; + float m_camera_vd = 0.0f; + float m_camera_vl = 0.0f; + float m_camera_vr = 0.0f; + float m_camera_lx = 0.0f; // unit vector for light direction + float m_camera_ly = 0.0f; // " + float m_camera_lz = 0.0f; // " + int m_camera_ambient = 0; // 0.0..1.0 + int m_camera_power = 0; // 0.0..1.0 - bool m_skipped_this_frame; + bool m_skipped_this_frame = false; void render_frame_active(); DECLARE_WRITE_LINE_MEMBER(screen_vblank); - bool m_pdp_render_done; - bool m_render_refresh; - uint64_t m_pdp_frame; - u16 m_pdp_base; + bool m_pdp_render_done = false; + bool m_render_refresh = false; + uint64_t m_pdp_frame = 0; + u16 m_pdp_base = 0; }; class namcos22s_state : public namcos22_state diff -Nru mame-0.242+dfsg.1/src/mame/includes/namcos2.h mame-0.243+dfsg.1/src/mame/includes/namcos2.h --- mame-0.242+dfsg.1/src/mame/includes/namcos2.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/namcos2.h 2022-04-29 05:37:26.000000000 +0000 @@ -173,8 +173,8 @@ NAMCOS2_KYUUKAI_DOUCHUUKI, }; - int m_gametype; - bool m_update_to_line_before_posirq; + int m_gametype = 0; + bool m_update_to_line_before_posirq = false; required_device m_maincpu; required_device m_slave; @@ -234,9 +234,9 @@ required_shared_ptr m_dpram; /* 2Kx8 */ optional_shared_ptr m_spriteram; - uint16_t m_gfx_ctrl; - unsigned m_finallap_prot_count; - int m_sendval; + uint16_t m_gfx_ctrl = 0; + unsigned m_finallap_prot_count = 0; + int m_sendval = 0; optional_device m_c45_road; optional_device m_ns2sprite; diff -Nru mame-0.242+dfsg.1/src/mame/includes/nbmj8688.h mame-0.243+dfsg.1/src/mame/includes/nbmj8688.h --- mame-0.242+dfsg.1/src/mame/includes/nbmj8688.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/nbmj8688.h 2022-04-29 05:37:26.000000000 +0000 @@ -102,8 +102,8 @@ std::unique_ptr m_tmpbitmap; std::unique_ptr m_videoram; std::unique_ptr m_clut; - int m_flipscreen_old; - emu_timer *m_blitter_timer; + int m_flipscreen_old = 0; + emu_timer *m_blitter_timer = nullptr; // common uint8_t ff_r(); diff -Nru mame-0.242+dfsg.1/src/mame/includes/nc.h mame-0.243+dfsg.1/src/mame/includes/nc.h --- mame-0.242+dfsg.1/src/mame/includes/nc.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/nc.h 2022-04-29 05:37:26.000000000 +0000 @@ -113,7 +113,7 @@ optional_device m_fdc; required_memory_bank_array<4> m_bankhandler_r, m_bankhandler_w; - char m_memory_config[4]; + char m_memory_config[4]{}; emu_timer *m_keyboard_timer = nullptr; int m_membank_rom_mask = 0; int m_membank_internal_ram_mask = 0; @@ -124,7 +124,7 @@ int m_irq_status = 0; int m_irq_latch = 0; int m_irq_latch_mask = 0; - int m_sound_channel_periods[2]; + int m_sound_channel_periods[2]{}; int m_previous_inputport_10_state = 0; int m_previous_alarm_state = 0; memory_region *m_card_ram = nullptr; diff -Nru mame-0.242+dfsg.1/src/mame/includes/neogeo.h mame-0.243+dfsg.1/src/mame/includes/neogeo.h --- mame-0.242+dfsg.1/src/mame/includes/neogeo.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/neogeo.h 2022-04-29 05:37:26.000000000 +0000 @@ -153,12 +153,12 @@ virtual void video_start() override; virtual void video_reset() override; - const pen_t *m_bg_pen; - uint8_t m_vblank_level; - uint8_t m_raster_level; + const pen_t *m_bg_pen = nullptr; + uint8_t m_vblank_level = 0; + uint8_t m_raster_level = 0; - int m_use_cart_vectors; - int m_use_cart_audio; + int m_use_cart_vectors = 0; + int m_use_cart_audio = 0; void set_slot_idx(int slot); @@ -168,11 +168,11 @@ void init_ym(); void init_sprites(); // temporary helper to restore memory banking while bankswitch is handled in the driver... - uint32_t m_bank_base; + uint32_t m_bank_base = 0; optional_device_array m_slots; - int m_curr_slot; + int m_curr_slot = 0; private: void update_interrupts(); @@ -190,16 +190,16 @@ void set_pens(); // internal state - bool m_recurse; + bool m_recurse = false; - emu_timer *m_display_position_interrupt_timer; - emu_timer *m_display_position_vblank_timer; - emu_timer *m_vblank_interrupt_timer; - uint32_t m_display_counter; - uint8_t m_vblank_interrupt_pending; - uint8_t m_display_position_interrupt_pending; - uint8_t m_irq3_pending; - uint8_t m_display_position_interrupt_control; + emu_timer *m_display_position_interrupt_timer = nullptr; + emu_timer *m_display_position_vblank_timer = nullptr; + emu_timer *m_vblank_interrupt_timer = nullptr; + uint32_t m_display_counter = 0; + uint8_t m_vblank_interrupt_pending = 0; + uint8_t m_display_position_interrupt_pending = 0; + uint8_t m_irq3_pending = 0; + uint8_t m_display_position_interrupt_control = 0; uint16_t get_video_control(); @@ -207,9 +207,9 @@ // color/palette related std::vector m_paletteram; - uint8_t m_palette_lookup[32][4]; - int m_screen_shadow; - int m_palette_bank; + uint8_t m_palette_lookup[32][4]{}; + int m_screen_shadow = 0; + int m_palette_bank = 0; }; @@ -248,7 +248,7 @@ required_device m_upd4990a; required_ioport m_dsw; - uint8_t m_save_ram_unlocked; + uint8_t m_save_ram_unlocked = 0; }; diff -Nru mame-0.242+dfsg.1/src/mame/includes/newbrain.h mame-0.243+dfsg.1/src/mame/includes/newbrain.h --- mame-0.242+dfsg.1/src/mame/includes/newbrain.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/newbrain.h 2022-04-29 05:37:26.000000000 +0000 @@ -117,32 +117,32 @@ required_ioport_array<16> m_y; output_finder<16> m_digits; - int m_clk; - int m_tvp; - int m_pwrup; - int m_userint; - int m_clkint; - int m_copint; - - int m_cop_so; - int m_cop_tdo; - int m_cop_g1; - int m_cop_g3; - int m_cop_k6; - - int m_405_q; - uint8_t m_403_q; - uint8_t m_403_d; - uint16_t m_402_q; - - int m_rv; - int m_fs; - int m_32_40; - int m_ucr; - int m_80l; - uint16_t m_tvl; + int m_clk = 0; + int m_tvp = 0; + int m_pwrup = 0; + int m_userint = 0; + int m_clkint = 0; + int m_copint = 0; + + int m_cop_so = 0; + int m_cop_tdo = 0; + int m_cop_g1 = 0; + int m_cop_g3 = 0; + int m_cop_k6 = 0; + + int m_405_q = 0; + uint8_t m_403_q = 0; + uint8_t m_403_d = 0; + uint16_t m_402_q = 0; + + int m_rv = 0; + int m_fs = 0; + int m_32_40 = 0; + int m_ucr = 0; + int m_80l = 0; + uint16_t m_tvl = 0; - emu_timer *m_clkint_timer; + emu_timer *m_clkint_timer = nullptr; }; #endif diff -Nru mame-0.242+dfsg.1/src/mame/includes/next.h mame-0.243+dfsg.1/src/mame/includes/next.h --- mame-0.242+dfsg.1/src/mame/includes/next.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/next.h 2022-04-29 05:37:26.000000000 +0000 @@ -102,15 +102,15 @@ void timer_ctrl_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0); void ramdac_w(offs_t offset, uint8_t data); - uint32_t scr1; - uint32_t scr2; - uint32_t irq_status; + uint32_t scr1 = 0; + uint32_t scr2 = 0; + uint32_t irq_status = 0; uint32_t irq_mask = 0; int irq_level = 0; required_shared_ptr vram; uint8_t scsictrl = 0, scsistat = 0; - uint32_t phy[2]; + uint32_t phy[2]{}; attotime timer_tbase; uint16_t timer_vbase = 0; diff -Nru mame-0.242+dfsg.1/src/mame/includes/nforcepc.h mame-0.243+dfsg.1/src/mame/includes/nforcepc.h --- mame-0.242+dfsg.1/src/mame/includes/nforcepc.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/nforcepc.h 2022-04-29 05:37:26.000000000 +0000 @@ -52,7 +52,7 @@ private: required_device cpu; required_device biosrom; - uint32_t ram_size; + uint32_t ram_size = 0; virtual uint8_t header_type_r() override; uint8_t unknown_r(); @@ -83,9 +83,9 @@ private: int ddr_ram_size = 0; - std::vector ram; - crush11_host_device *host; - address_space *ram_space; + std::vector ram{}; + crush11_host_device *host = nullptr; + address_space *ram_space = nullptr; }; DECLARE_DEVICE_TYPE(CRUSH11_MEMORY, crush11_memory_device) @@ -274,11 +274,11 @@ ACPI, // ACPI Gpio567 = 12 // GPIO set 5, 6 and 7 }; - int config_key_step; - int config_index; - int logical_device; - uint8_t global_configuration_registers[0x30]; - uint8_t configuration_registers[13][0x100]; + int config_key_step = 0; + int config_index = 0; + int logical_device = 0; + uint8_t global_configuration_registers[0x30]{}; + uint8_t configuration_registers[13][0x100]{}; devcb_write_line pin_reset_callback; devcb_write_line pin_gatea20_callback; devcb_write_line m_txd1_callback; @@ -292,14 +292,14 @@ required_device pc_serial1_comdev; required_device pc_serial2_comdev; required_device m_kbdc; - bool enabled_logical[13]; - bool enabled_game_port; - bool enabled_midi_port; - - lpcbus_host_interface *lpchost; - int lpcindex; - address_space *memspace; - address_space *iospace; + bool enabled_logical[13]{}; + bool enabled_game_port = false; + bool enabled_midi_port = false; + + lpcbus_host_interface *lpchost = nullptr; + int lpcindex = 0; + address_space *memspace = nullptr; + address_space *iospace = nullptr; void internal_memory_map(address_map &map); void internal_io_map(address_map &map); diff -Nru mame-0.242+dfsg.1/src/mame/includes/ninjaw.h mame-0.243+dfsg.1/src/mame/includes/ninjaw.h --- mame-0.242+dfsg.1/src/mame/includes/ninjaw.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/ninjaw.h 2022-04-29 05:37:26.000000000 +0000 @@ -61,8 +61,8 @@ required_memory_bank m_z80bank; /* misc */ - u16 m_cpua_ctrl; - int m_pandata[4]; + u16 m_cpua_ctrl = 0; + int m_pandata[4]{}; void coin_control_w(u8 data); void cpua_ctrl_w(u16 data); diff -Nru mame-0.242+dfsg.1/src/mame/includes/nitedrvr.h mame-0.243+dfsg.1/src/mame/includes/nitedrvr.h --- mame-0.242+dfsg.1/src/mame/includes/nitedrvr.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/nitedrvr.h 2022-04-29 05:37:26.000000000 +0000 @@ -75,15 +75,15 @@ required_shared_ptr m_hvc; // input - uint8_t m_gear; - uint8_t m_track; - int32_t m_steering_buf; - int32_t m_steering_val; - uint8_t m_crash_en; - uint8_t m_crash_data; - uint8_t m_crash_data_en; // IC D8 - uint8_t m_ac_line; - int32_t m_last_steering_val; + uint8_t m_gear = 0; + uint8_t m_track = 0; + int32_t m_steering_buf = 0; + int32_t m_steering_val = 0; + uint8_t m_crash_en = 0; + uint8_t m_crash_data = 0; + uint8_t m_crash_data_en = 0; // IC D8 + uint8_t m_ac_line = 0; + int32_t m_last_steering_val = 0; required_ioport m_steer, m_gears, m_in0; required_ioport_array<3> m_dsw; diff -Nru mame-0.242+dfsg.1/src/mame/includes/nmk16.h mame-0.243+dfsg.1/src/mame/includes/nmk16.h --- mame-0.242+dfsg.1/src/mame/includes/nmk16.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/nmk16.h 2022-04-29 05:37:26.000000000 +0000 @@ -119,24 +119,24 @@ optional_ioport_array<2> m_dsw_io; optional_ioport_array<3> m_in_io; - emu_timer *m_dma_timer; - int m_tilerambank; - int m_sprdma_base; - int mask[4*2]; + emu_timer *m_dma_timer = nullptr; + int m_tilerambank = 0; + int m_sprdma_base = 0; + int mask[4*2]{}; std::unique_ptr m_spriteram_old; std::unique_ptr m_spriteram_old2; - int m_bgbank; - int m_bioship_background_bank; - tilemap_t *m_bg_tilemap[2]; - tilemap_t *m_tx_tilemap; - int m_mustang_bg_xscroll; - u8 m_scroll[2][4]; - u16 m_vscroll[4]; - int m_prot_count; - u8 m_input_pressed; - u8 m_start_helper; - u8 m_coin_count[2]; - u8 m_coin_count_frac[2]; + int m_bgbank = 0; + int m_bioship_background_bank = 0; + tilemap_t *m_bg_tilemap[2]{}; + tilemap_t *m_tx_tilemap = nullptr; + int m_mustang_bg_xscroll = 0; + u8 m_scroll[2][4]{}; + u16 m_vscroll[4]{}; + int m_prot_count = 0; + u8 m_input_pressed = 0; + u8 m_start_helper = 0; + u8 m_coin_count[2]{}; + u8 m_coin_count_frac[2]{}; void mainram_strange_w(offs_t offset, u16 data/*, u16 mem_mask = ~0*/); u16 mainram_swapped_r(offs_t offset); void mainram_swapped_w(offs_t offset, u16 data, u16 mem_mask = ~0); @@ -216,6 +216,7 @@ void mustang_map(address_map &map); void mustangb_map(address_map &map); void mustangb3_map(address_map &map); + void mustangb3_sound_map(address_map &map); void oki1_map(address_map &map); void oki2_map(address_map &map); void raphero_map(address_map &map); diff -Nru mame-0.242+dfsg.1/src/mame/includes/nova2001.h mame-0.243+dfsg.1/src/mame/includes/nova2001.h --- mame-0.242+dfsg.1/src/mame/includes/nova2001.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/nova2001.h 2022-04-29 05:37:26.000000000 +0000 @@ -43,9 +43,9 @@ optional_shared_ptr m_spriteram; memory_share_creator m_paletteram; - u8 m_ninjakun_io_a002_ctrl; - tilemap_t *m_bg_tilemap; - tilemap_t *m_fg_tilemap; + u8 m_ninjakun_io_a002_ctrl = 0; + tilemap_t *m_bg_tilemap = nullptr; + tilemap_t *m_fg_tilemap = nullptr; void ninjakun_cpu1_io_A002_w(u8 data); void ninjakun_cpu2_io_A002_w(u8 data); diff -Nru mame-0.242+dfsg.1/src/mame/includes/ojankohs.h mame-0.243+dfsg.1/src/mame/includes/ojankohs.h --- mame-0.242+dfsg.1/src/mame/includes/ojankohs.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/ojankohs.h 2022-04-29 05:37:26.000000000 +0000 @@ -57,20 +57,20 @@ required_memory_bank m_mainbank; // video-related - tilemap_t *m_tilemap; + tilemap_t *m_tilemap = nullptr; bitmap_ind16 m_tmpbitmap; - uint8_t m_gfxreg; - uint8_t m_flipscreen; - uint8_t m_flipscreen_old; - int16_t m_scrollx; - int16_t m_scrolly; - uint8_t m_screen_refresh; + uint8_t m_gfxreg = 0; + uint8_t m_flipscreen = 0; + uint8_t m_flipscreen_old = 0; + int16_t m_scrollx = 0; + int16_t m_scrolly = 0; + uint8_t m_screen_refresh = 0; // misc - uint8_t m_port_select; - uint8_t m_adpcm_reset; - int m_adpcm_data; - uint8_t m_vclk_left; + uint8_t m_port_select = 0; + uint8_t m_adpcm_reset = 0; + int m_adpcm_data = 0; + uint8_t m_vclk_left = 0; // devices required_device m_maincpu; diff -Nru mame-0.242+dfsg.1/src/mame/includes/ondra.h mame-0.243+dfsg.1/src/mame/includes/ondra.h --- mame-0.242+dfsg.1/src/mame/includes/ondra.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/ondra.h 2022-04-29 05:37:26.000000000 +0000 @@ -48,9 +48,9 @@ void update_banks(); - bool m_video_enable; - u8 m_bank_status; - u8 m_bank_old; + bool m_video_enable = false; + u8 m_bank_status = 0; + u8 m_bank_old = 0; required_device m_maincpu; required_device m_cassette; diff -Nru mame-0.242+dfsg.1/src/mame/includes/oneshot.h mame-0.243+dfsg.1/src/mame/includes/oneshot.h --- mame-0.242+dfsg.1/src/mame/includes/oneshot.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/oneshot.h 2022-04-29 05:37:26.000000000 +0000 @@ -50,18 +50,18 @@ optional_ioport_array<2> m_io_lightgun_y; /* video-related */ - tilemap_t *m_bg_tilemap; - tilemap_t *m_mid_tilemap; - tilemap_t *m_fg_tilemap; + tilemap_t *m_bg_tilemap = nullptr; + tilemap_t *m_mid_tilemap = nullptr; + tilemap_t *m_fg_tilemap = nullptr; /* misc */ - int m_gun_x_p1; - int m_gun_y_p1; - int m_gun_x_p2; - int m_gun_y_p2; - int m_gun_x_shift; - int m_p1_wobble; - int m_p2_wobble; + int m_gun_x_p1 = 0; + int m_gun_y_p1 = 0; + int m_gun_x_p2 = 0; + int m_gun_y_p2 = 0; + int m_gun_x_shift = 0; + int m_p1_wobble = 0; + int m_p2_wobble = 0; /* devices */ required_device m_maincpu; diff -Nru mame-0.242+dfsg.1/src/mame/includes/orion.h mame-0.243+dfsg.1/src/mame/includes/orion.h --- mame-0.242+dfsg.1/src/mame/includes/orion.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/orion.h 2022-04-29 05:37:26.000000000 +0000 @@ -88,24 +88,24 @@ static void orion_floppy_formats(format_registration &fr); void machine_start() override; - uint8_t m_orion128_video_mode; - uint8_t m_orion128_video_page; - uint8_t m_orion128_video_width; - uint8_t m_video_mode_mask; - uint8_t m_orionpro_pseudo_color; - uint8_t m_romdisk_lsb; - uint8_t m_romdisk_msb; - uint8_t m_orion128_memory_page; - uint8_t m_orionz80_memory_page; - uint8_t m_orionz80_dispatcher; - uint8_t m_speaker_data; - uint8_t m_orionpro_ram0_segment; - uint8_t m_orionpro_ram1_segment; - uint8_t m_orionpro_ram2_segment; - uint8_t m_orionpro_page; - uint8_t m_orionpro_128_page; - uint8_t m_orionpro_rom2_segment; - uint8_t m_orionpro_dispatcher; + uint8_t m_orion128_video_mode = 0; + uint8_t m_orion128_video_page = 0; + uint8_t m_orion128_video_width = 0; + uint8_t m_video_mode_mask = 0; + uint8_t m_orionpro_pseudo_color = 0; + uint8_t m_romdisk_lsb = 0; + uint8_t m_romdisk_msb = 0; + uint8_t m_orion128_memory_page = 0; + uint8_t m_orionz80_memory_page = 0; + uint8_t m_orionz80_dispatcher = 0; + uint8_t m_speaker_data = 0; + uint8_t m_orionpro_ram0_segment = 0; + uint8_t m_orionpro_ram1_segment = 0; + uint8_t m_orionpro_ram2_segment = 0; + uint8_t m_orionpro_page = 0; + uint8_t m_orionpro_128_page = 0; + uint8_t m_orionpro_rom2_segment = 0; + uint8_t m_orionpro_dispatcher = 0; required_device m_fdc; diff -Nru mame-0.242+dfsg.1/src/mame/includes/osi.h mame-0.243+dfsg.1/src/mame/includes/osi.h --- mame-0.242+dfsg.1/src/mame/includes/osi.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/osi.h 2022-04-29 05:37:26.000000000 +0000 @@ -68,8 +68,8 @@ void osi600_mem(address_map &map); uint8_t m_cass_data[4]{}; - bool m_cassbit = 0; - bool m_cassold = 0; + bool m_cassbit = false; + bool m_cassold = false; required_device m_maincpu; required_device m_acia; required_device m_cass; diff -Nru mame-0.242+dfsg.1/src/mame/includes/othunder.h mame-0.243+dfsg.1/src/mame/includes/othunder.h --- mame-0.242+dfsg.1/src/mame/includes/othunder.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/othunder.h 2022-04-29 05:37:26.000000000 +0000 @@ -72,17 +72,17 @@ /* video-related */ struct tempsprite { - u32 code,color; - bool flipx,flipy; - int x,y; - int zoomx,zoomy; - u32 primask; + u32 code = 0, color = 0; + bool flipx = false, flipy = false; + int x = 0, y = 0; + int zoomx = 0, zoomy = 0; + u32 primask = 0; }; std::unique_ptr m_spritelist; /* misc */ - int m_pan[4]; + int m_pan[4]{}; /* devices */ required_device m_maincpu; diff -Nru mame-0.242+dfsg.1/src/mame/includes/parodius.h mame-0.243+dfsg.1/src/mame/includes/parodius.h --- mame-0.242+dfsg.1/src/mame/includes/parodius.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/parodius.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,75 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Nicola Salmoria -/************************************************************************* - - Parodius - -*************************************************************************/ -#ifndef MAME_INCLUDES_PARODIUS_H -#define MAME_INCLUDES_PARODIUS_H - -#pragma once - -#include "cpu/m6809/konami.h" /* for the callback and the firq irq definition */ -#include "machine/bankdev.h" -#include "video/k052109.h" -#include "video/k053244_k053245.h" -#include "video/k053251.h" -#include "video/konami_helper.h" - -class parodius_state : public driver_device -{ -public: - enum - { - TIMER_NMI - }; - - parodius_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_bank0000(*this, "bank0000"), - m_bank2000(*this, "bank2000"), - m_k052109(*this, "k052109"), - m_k053245(*this, "k053245"), - m_k053251(*this, "k053251") - { } - - /* video-related */ - int m_layer_colorbase[3]{}; - int m_sprite_colorbase = 0; - int m_layerpri[3]{}; - - /* misc */ - //int m_nmi_enabled; - - /* devices */ - required_device m_maincpu; - required_device m_audiocpu; - required_device m_bank0000; - required_device m_bank2000; - required_device m_k052109; - required_device m_k053245; - required_device m_k053251; - void parodius_videobank_w(uint8_t data); - void parodius_3fc0_w(uint8_t data); - void parodius_sh_irqtrigger_w(uint8_t data); - void sound_arm_nmi_w(uint8_t data); - virtual void machine_start() override; - virtual void machine_reset() override; - uint32_t screen_update_parodius(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - K05324X_CB_MEMBER(sprite_callback); - K052109_CB_MEMBER(tile_callback); - void banking_callback(uint8_t data); - - void parodius(machine_config &config); - void bank0000_map(address_map &map); - void bank2000_map(address_map &map); - void parodius_map(address_map &map); - void parodius_sound_map(address_map &map); -protected: - virtual void device_timer(emu_timer &timer, device_timer_id id, int param) override; -}; - -#endif // MAME_INCLUDES_PARODIUS_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/pass.h mame-0.243+dfsg.1/src/mame/includes/pass.h --- mame-0.242+dfsg.1/src/mame/includes/pass.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/pass.h 2022-04-29 05:37:26.000000000 +0000 @@ -38,8 +38,8 @@ void pass_sound_io_map(address_map &map); void pass_sound_map(address_map &map); - tilemap_t *m_bg_tilemap; - tilemap_t *m_fg_tilemap; + tilemap_t *m_bg_tilemap = nullptr; + tilemap_t *m_fg_tilemap = nullptr; required_shared_ptr m_bg_videoram; required_shared_ptr m_fg_videoram; diff -Nru mame-0.242+dfsg.1/src/mame/includes/pc1251.h mame-0.243+dfsg.1/src/mame/includes/pc1251.h --- mame-0.242+dfsg.1/src/mame/includes/pc1251.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/pc1251.h 2022-04-29 05:37:26.000000000 +0000 @@ -54,7 +54,7 @@ required_ioport_array<10> m_keys; required_ioport m_mode; - uint8_t m_reg[0x100]; + uint8_t m_reg[0x100]{}; static const char *const s_def[5]; static const char *const s_shift[5]; diff -Nru mame-0.242+dfsg.1/src/mame/includes/pc1350.h mame-0.243+dfsg.1/src/mame/includes/pc1350.h --- mame-0.242+dfsg.1/src/mame/includes/pc1350.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/pc1350.h 2022-04-29 05:37:26.000000000 +0000 @@ -47,7 +47,7 @@ required_device m_ram; required_ioport_array<12> m_keys; - uint8_t m_reg[0x1000]; + uint8_t m_reg[0x1000]{}; static const char* const s_def[5]; static const char* const s_shift[5]; diff -Nru mame-0.242+dfsg.1/src/mame/includes/pc1512.h mame-0.243+dfsg.1/src/mame/includes/pc1512.h --- mame-0.242+dfsg.1/src/mame/includes/pc1512.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/pc1512.h 2022-04-29 05:37:26.000000000 +0000 @@ -156,20 +156,20 @@ int m_nmi_enable; // keyboard state - uint8_t m_kbd; + uint8_t m_kbd = 0; int m_kb_bits; int m_kbclk; int m_kbdata; // mouse state - uint8_t m_mouse_x_old; - uint8_t m_mouse_y_old; - uint8_t m_mouse_x; - uint8_t m_mouse_y; + uint8_t m_mouse_x_old = 0; + uint8_t m_mouse_y_old = 0; + uint8_t m_mouse_x = 0; + uint8_t m_mouse_y = 0; // DMA state - uint8_t m_dma_page[4]; - int m_dma_channel; + uint8_t m_dma_page[4]{}; + int m_dma_channel = 0; int m_dreq0; // floppy state @@ -182,12 +182,12 @@ // printer state int m_ack_int_enable; int m_centronics_ack; - int m_centronics_busy; - int m_centronics_perror; - int m_centronics_select; - int m_centronics_fault; - uint8_t m_printer_data; - uint8_t m_printer_control; + int m_centronics_busy = 0; + int m_centronics_perror = 0; + int m_centronics_select = 0; + int m_centronics_fault = 0; + uint8_t m_printer_data = 0; + uint8_t m_printer_control = 0; // sound state int m_speaker_drive; diff -Nru mame-0.242+dfsg.1/src/mame/includes/pc4.h mame-0.243+dfsg.1/src/mame/includes/pc4.h --- mame-0.242+dfsg.1/src/mame/includes/pc4.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/pc4.h 2022-04-29 05:37:26.000000000 +0000 @@ -57,23 +57,23 @@ void pc4_io(address_map &map); void pc4_mem(address_map &map); - emu_timer *m_blink_timer; - emu_timer *m_busy_timer; + emu_timer *m_blink_timer = nullptr; + emu_timer *m_busy_timer = nullptr; - uint8_t m_busy_flag; - uint8_t m_ddram[0xa0]; - uint8_t m_cgram[0x40]; - int16_t m_ac; - uint8_t m_ac_mode; - uint8_t m_data_bus_flag; - int16_t m_cursor_pos; - uint8_t m_display_on; - uint8_t m_cursor_on; - uint8_t m_blink_on; - uint8_t m_shift_on; - int8_t m_disp_shift; - int8_t m_direction; - uint8_t m_blink; + uint8_t m_busy_flag = 0; + uint8_t m_ddram[0xa0]{}; + uint8_t m_cgram[0x40]{}; + int16_t m_ac = 0; + uint8_t m_ac_mode = 0; + uint8_t m_data_bus_flag = 0; + int16_t m_cursor_pos = 0; + uint8_t m_display_on = 0; + uint8_t m_cursor_on = 0; + uint8_t m_blink_on = 0; + uint8_t m_shift_on = 0; + int8_t m_disp_shift = 0; + int8_t m_direction = 0; + uint8_t m_blink = 0; required_device m_maincpu; required_device m_beep; diff -Nru mame-0.242+dfsg.1/src/mame/includes/pc6001.h mame-0.243+dfsg.1/src/mame/includes/pc6001.h --- mame-0.242+dfsg.1/src/mame/includes/pc6001.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/pc6001.h 2022-04-29 05:37:26.000000000 +0000 @@ -98,9 +98,9 @@ optional_memory_bank m_bank1; required_device m_palette; - memory_region *m_cart_rom; - uint8_t m_timer_irq_vector; - uint16_t m_timer_hz_div; + memory_region *m_cart_rom = nullptr; + uint8_t m_timer_irq_vector = 0; + uint16_t m_timer_hz_div = 0; virtual void machine_start() override; virtual void machine_reset() override; @@ -131,26 +131,26 @@ void draw_border(bitmap_ind16 &bitmap,const rectangle &cliprect,int attr,int has_mc6847); void pc6001_screen_draw(bitmap_ind16 &bitmap,const rectangle &cliprect, int has_mc6847); - emu_timer *m_timer_irq_timer; - uint8_t *m_video_base; + emu_timer *m_timer_irq_timer = nullptr; + uint8_t *m_video_base = nullptr; std::unique_ptr m_video_ram; - uint8_t m_cas_switch; - uint8_t m_sys_latch; - uint32_t m_cas_offset; - uint32_t m_cas_maxsize; - uint8_t m_bank_opt; - bool m_timer_enable; - bool m_timer_irq_mask; - uint8_t m_port_c_8255; - uint8_t m_cur_keycode; + uint8_t m_cas_switch = 0; + uint8_t m_sys_latch = 0; + uint32_t m_cas_offset = 0; + uint32_t m_cas_maxsize = 0; + uint8_t m_bank_opt = 0; + bool m_timer_enable = false; + bool m_timer_irq_mask = false; + uint8_t m_port_c_8255 = 0; + uint8_t m_cur_keycode = 0; private: - uint32_t m_old_key1; - uint32_t m_old_key2; - uint32_t m_old_key3; + uint32_t m_old_key1 = 0; + uint32_t m_old_key2 = 0; + uint32_t m_old_key3 = 0; u8 m_old_key_fn; - emu_timer *m_sub_trig_timer; + emu_timer *m_sub_trig_timer = nullptr; // IRQ model protected: @@ -177,8 +177,8 @@ virtual u8 get_timer_base_divider(); private: - u8 m_irq_pending; - u8 m_sub_vector; + u8 m_irq_pending = 0; + u8 m_sub_vector = 0; }; @@ -228,8 +228,8 @@ void pc6001mk2_map(address_map &map); void pc6001mk2_io(address_map &map); - uint8_t m_bgcol_bank; - uint8_t m_gfx_bank_on; + uint8_t m_bgcol_bank = 0; + uint8_t m_gfx_bank_on = 0; optional_memory_bank m_bank2; optional_memory_bank m_bank3; optional_memory_bank m_bank4; @@ -245,14 +245,14 @@ virtual u8 vrtc_ack() override; private: - uint8_t m_bank_r0; - uint8_t m_bank_r1; - uint8_t m_bank_w; - uint8_t m_ex_vram_bank; - uint8_t m_exgfx_text_mode; - uint32_t m_cgrom_bank_addr; - uint8_t m_exgfx_bitmap_mode; - uint8_t m_exgfx_2bpp_mode; + uint8_t m_bank_r0 = 0; + uint8_t m_bank_r1 = 0; + uint8_t m_bank_w = 0; + uint8_t m_ex_vram_bank = 0; + uint8_t m_exgfx_text_mode = 0; + uint32_t m_cgrom_bank_addr = 0; + uint8_t m_exgfx_bitmap_mode = 0; + uint8_t m_exgfx_2bpp_mode = 0; void vram_bank_change(uint8_t vram_bank); }; @@ -322,12 +322,12 @@ required_shared_ptr m_sr_scrolly; required_device m_ym; - u8 m_sr_bank_reg[16]; - bool m_sr_text_mode; - u8 m_sr_text_rows; + u8 m_sr_bank_reg[16]{}; + bool m_sr_text_mode = false; + u8 m_sr_text_rows = 0; std::unique_ptr m_gvram; - u8 m_bitmap_yoffs, m_bitmap_xoffs; - u8 m_width80; + u8 m_bitmap_yoffs = 0, m_bitmap_xoffs = 0; + u8 m_width80 = 0; // memory_view m_gvram_view; diff -Nru mame-0.242+dfsg.1/src/mame/includes/pc8001.h mame-0.243+dfsg.1/src/mame/includes/pc8001.h --- mame-0.242+dfsg.1/src/mame/includes/pc8001.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/pc8001.h 2022-04-29 05:37:26.000000000 +0000 @@ -54,20 +54,22 @@ void port30_w(u8 data); virtual void machine_start() override; void set_screen_frequency(bool is_24KHz) { m_screen_is_24KHz = is_24KHz; } + bool get_screen_frequency() { return m_screen_is_24KHz; } DECLARE_WRITE_LINE_MEMBER( crtc_reverse_w ); UPD3301_DRAW_CHARACTER_MEMBER( draw_text ); - UPD3301_FETCH_ATTRIBUTE( attr_fetch ); + virtual UPD3301_FETCH_ATTRIBUTE( attr_fetch ); DECLARE_WRITE_LINE_MEMBER( hrq_w ); - uint8_t dma_mem_r(offs_t offset); + virtual uint8_t dma_mem_r(offs_t offset); private: - bool m_screen_reverse; - bool m_screen_is_24KHz; + bool m_screen_reverse = false; + bool m_screen_is_24KHz = false; /* video state */ - int m_width80; - int m_color; + int m_width80 = 0; + int m_color = 0; + u8 m_attr_color = 0xe8, m_attr_decoration = 0; }; class pc8001_state : public pc8001_base_state @@ -110,8 +112,8 @@ uint8_t port40_r(); void port40_w(uint8_t data); - int m_centronics_busy; - int m_centronics_ack; + int m_centronics_busy = 0; + int m_centronics_ack = 0; DECLARE_WRITE_LINE_MEMBER(write_centronics_busy); DECLARE_WRITE_LINE_MEMBER(write_centronics_ack); @@ -159,7 +161,7 @@ u8 port71_r(); void port71_w(u8 data); - u8 m_n80sr_bank; + u8 m_n80sr_bank = 0; }; #endif diff -Nru mame-0.242+dfsg.1/src/mame/includes/pc8401a.h mame-0.243+dfsg.1/src/mame/includes/pc8401a.h --- mame-0.242+dfsg.1/src/mame/includes/pc8401a.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/pc8401a.h 2022-04-29 05:37:26.000000000 +0000 @@ -65,7 +65,7 @@ memory_share_creator m_crt_ram; required_ioport_array<10> m_io_y; - memory_region *m_cart_rom; + memory_region *m_cart_rom = nullptr; virtual void machine_start() override; virtual void video_start() override; @@ -89,13 +89,13 @@ void bankswitch(uint8_t data); // keyboard state - int m_key_strobe; // key pressed + int m_key_strobe = 0; // key pressed // memory state - uint8_t m_mmr; // memory mapping register - uint32_t m_io_addr; // I/O ROM address counter + uint8_t m_mmr = 0; // memory mapping register + uint32_t m_io_addr = 0; // I/O ROM address counter - uint8_t m_key_latch; + uint8_t m_key_latch = 0; TIMER_DEVICE_CALLBACK_MEMBER(pc8401a_keyboard_tick); void pc8401a(machine_config &config); void pc8401a_video(machine_config &config); diff -Nru mame-0.242+dfsg.1/src/mame/includes/pc8801.h mame-0.243+dfsg.1/src/mame/includes/pc8801.h --- mame-0.242+dfsg.1/src/mame/includes/pc8801.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/pc8801.h 2022-04-29 05:37:26.000000000 +0000 @@ -11,8 +11,8 @@ #pragma once +#include "includes/pc8001.h" #include "cpu/z80/z80.h" -#include "bus/centronics/ctronics.h" #include "imagedev/cassette.h" #include "imagedev/floppy.h" #include "machine/i8214.h" @@ -23,236 +23,309 @@ #include "machine/pc80s31k.h" #include "sound/beep.h" #include "sound/ymopn.h" +#include "bus/centronics/ctronics.h" +#include "bus/pc8801/pc8801_31.h" +#include "bus/pc8801/pc8801_exp.h" #include "emupal.h" #include "screen.h" #include "softlist.h" #include "speaker.h" -#define USE_PROPER_I8214 0 - #define I8214_TAG "i8214" #define UPD1990A_TAG "upd1990a" -#define I8251_TAG "i8251" -class pc8801_state : public driver_device +class pc8801_state : public pc8001_base_state { public: pc8801_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag) - , m_maincpu(*this, "maincpu") + : pc8001_base_state(mconfig, type, tag) +// , m_maincpu(*this, "maincpu") , m_screen(*this, "screen") , m_pc80s31(*this, "pc80s31") , m_pic(*this, I8214_TAG) , m_rtc(*this, UPD1990A_TAG) - , m_cassette(*this, "cassette") + , m_usart(*this, "usart") +// , m_cassette(*this, "cassette") , m_beeper(*this, "beeper") - , m_opna(*this, "opna") - , m_opn(*this, "opn") + , m_lspeaker(*this, "lspeaker") + , m_rspeaker(*this, "rspeaker") , m_palette(*this, "palette") - { } + , m_n80rom(*this, "n80rom") + , m_n88rom(*this, "n88rom") +// , m_cg_rom(*this, "cgrom") + , m_kanji_rom(*this, "kanji") + , m_kanji_lv2_rom(*this, "kanji_lv2") + , m_exp(*this, "exp") + { + } void pc8801(machine_config &config); - void pc8801mk2mr(machine_config &config); - void pc8801fh(machine_config &config); - void pc8801ma(machine_config &config); - void pc8801mc(machine_config &config); protected: virtual void video_start() override; virtual void machine_start() override; virtual void machine_reset() override; - required_device m_maincpu; + uint8_t mem_r(offs_t offset); + void mem_w(offs_t offset, uint8_t data); + + virtual UPD3301_FETCH_ATTRIBUTE( attr_fetch ) override; + + virtual uint8_t dma_mem_r(offs_t offset) override; + + virtual attotime mouse_limit_hz(); + + virtual uint8_t dictionary_rom_r(offs_t offset); + virtual bool dictionary_rom_enable(); + + virtual uint8_t cdbios_rom_r(offs_t offset); + virtual bool cdbios_rom_enable(); + virtual void main_io(address_map &map); + +// required_device m_maincpu; required_device m_screen; required_device m_pc80s31; optional_device m_pic; required_device m_rtc; - required_device m_cassette; + required_device m_usart; +// required_device m_cassette; required_device m_beeper; - required_device m_opna; - required_device m_opn; + required_device m_lspeaker; + required_device m_rspeaker; required_device m_palette; + required_region_ptr m_n80rom; + required_region_ptr m_n88rom; +// required_region_ptr m_cg_rom; + required_region_ptr m_kanji_rom; + required_region_ptr m_kanji_lv2_rom; + required_device m_exp; + + DECLARE_WRITE_LINE_MEMBER(int4_irq_w); + + struct mouse_t { + uint8_t phase = 0; + int8_t prev_dx = 0, prev_dy = 0; + uint8_t lx = 0, ly = 0; -private: - struct crtc_t - { - uint8_t cmd,param_count,cursor_on,status,irq_mask; - uint8_t param[8][5]; - uint8_t inverse; + attotime time = attotime::never; }; - struct mouse_t - { - uint8_t phase; - uint8_t x,y; - attotime time; - }; + mouse_t m_mouse; + uint8_t m_gfx_ctrl = 0; + +private: + void main_map(address_map &map); std::unique_ptr m_work_ram; std::unique_ptr m_hi_work_ram; std::unique_ptr m_ext_work_ram; std::unique_ptr m_gvram; - uint8_t *m_n80rom; - uint8_t *m_n88rom; - uint8_t *m_kanji_rom; - uint8_t *m_cg_rom; - - uint8_t m_i8255_0_pc; - uint8_t m_i8255_1_pc; - uint8_t m_fdc_irq_opcode; - uint8_t m_ext_rom_bank; - uint8_t m_gfx_ctrl; - uint8_t m_vram_sel; - uint8_t m_misc_ctrl; - uint8_t m_device_ctrl_data; - uint8_t m_window_offset_bank; - uint8_t m_layer_mask; - uint16_t m_dma_counter[4]; - uint16_t m_dma_address[4]; - uint8_t m_alu_reg[3]; - uint8_t m_dmac_mode; - uint8_t m_alu_ctrl1; - uint8_t m_alu_ctrl2; - uint8_t m_extram_mode; - uint8_t m_extram_bank; - uint8_t m_txt_width; - uint8_t m_txt_color; -#if USE_PROPER_I8214 - uint8_t m_timer_irq_mask; - uint8_t m_vblank_irq_mask; - uint8_t m_sound_irq_mask; - uint8_t m_int_state; -#else - uint8_t m_i8214_irq_level; - uint8_t m_vrtc_irq_mask; - uint8_t m_vrtc_irq_latch; - uint8_t m_timer_irq_mask; - uint8_t m_timer_irq_latch; - uint8_t m_sound_irq_mask; - uint8_t m_sound_irq_latch; - uint8_t m_sound_irq_pending; -#endif - uint8_t m_has_clock_speed; - uint8_t m_clock_setting; - uint8_t m_baudrate_val; - uint8_t m_has_dictionary; - uint8_t m_dic_ctrl; - uint8_t m_dic_bank; - uint8_t m_has_cdrom; - uint8_t m_cdrom_reg[0x10]; - crtc_t m_crtc; - mouse_t m_mouse; - struct { uint8_t r, g, b; } m_palram[8]; - uint8_t m_dmac_ff; - uint32_t m_knj_addr[2]; - uint32_t m_extram_size; - uint8_t m_has_opna; - - uint8_t pc8801_alu_r(offs_t offset); - void pc8801_alu_w(offs_t offset, uint8_t data); - uint8_t pc8801_wram_r(offs_t offset); - void pc8801_wram_w(offs_t offset, uint8_t data); - uint8_t pc8801_ext_wram_r(offs_t offset); - void pc8801_ext_wram_w(offs_t offset, uint8_t data); - uint8_t pc8801_nbasic_rom_r(offs_t offset); - uint8_t pc8801_n88basic_rom_r(offs_t offset); - uint8_t pc8801_gvram_r(offs_t offset); - void pc8801_gvram_w(offs_t offset, uint8_t data); - uint8_t pc8801_high_wram_r(offs_t offset); - void pc8801_high_wram_w(offs_t offset, uint8_t data); - uint8_t pc8801ma_dic_r(offs_t offset); - uint8_t pc8801_cdbios_rom_r(offs_t offset); - uint8_t pc8801_mem_r(offs_t offset); - void pc8801_mem_w(offs_t offset, uint8_t data); - uint8_t pc8801_ctrl_r(); - void pc8801_ctrl_w(uint8_t data); - uint8_t pc8801_ext_rom_bank_r(); - void pc8801_ext_rom_bank_w(uint8_t data); - void pc8801_gfx_ctrl_w(uint8_t data); - uint8_t pc8801_vram_select_r(); - void pc8801_vram_select_w(offs_t offset, uint8_t data); - void pc8801_irq_level_w(uint8_t data); - void pc8801_irq_mask_w(uint8_t data); - uint8_t pc8801_window_bank_r(); - void pc8801_window_bank_w(uint8_t data); - void pc8801_window_bank_inc_w(uint8_t data); - uint8_t pc8801_misc_ctrl_r(); - void pc8801_misc_ctrl_w(uint8_t data); - void pc8801_bgpal_w(uint8_t data); - void pc8801_palram_w(offs_t offset, uint8_t data); - void pc8801_layer_masking_w(uint8_t data); - uint8_t pc8801_crtc_param_r(); - void pc88_crtc_param_w(uint8_t data); - uint8_t pc8801_crtc_status_r(); - void pc88_crtc_cmd_w(uint8_t data); - uint8_t pc8801_dmac_r(offs_t offset); - void pc8801_dmac_w(offs_t offset, uint8_t data); - uint8_t pc8801_dmac_status_r(); - void pc8801_dmac_mode_w(uint8_t data); - uint8_t pc8801_extram_mode_r(); - void pc8801_extram_mode_w(uint8_t data); - uint8_t pc8801_extram_bank_r(); - void pc8801_extram_bank_w(uint8_t data); - void pc8801_alu_ctrl1_w(uint8_t data); - void pc8801_alu_ctrl2_w(uint8_t data); - void pc8801_pcg8100_w(offs_t offset, uint8_t data); - void pc8801_txt_cmt_ctrl_w(uint8_t data); - uint8_t pc8801_kanji_r(offs_t offset); - void pc8801_kanji_w(offs_t offset, uint8_t data); - uint8_t pc8801_kanji_lv2_r(offs_t offset); - void pc8801_kanji_lv2_w(offs_t offset, uint8_t data); - void pc8801_dic_bank_w(uint8_t data); - void pc8801_dic_ctrl_w(uint8_t data); - uint8_t pc8801_cdrom_r(offs_t offset); - void pc8801_cdrom_w(offs_t offset, uint8_t data); - uint8_t pc8801_cpuclock_r(); - uint8_t pc8801_baudrate_r(); - void pc8801_baudrate_w(uint8_t data); - void pc8801_rtc_w(uint8_t data); - void upd765_mc_w(uint8_t data); - uint8_t upd765_tc_r(); - void fdc_irq_vector_w(uint8_t data); - void fdc_drive_mode_w(uint8_t data); + + std::array, 400> m_attr_info = {}; + + uint8_t m_ext_rom_bank = 0; + uint8_t m_vram_sel = 0; + uint8_t m_misc_ctrl = 0; + uint8_t m_device_ctrl_data = 0; + uint8_t m_window_offset_bank = 0; + bool m_text_layer_mask = false; + u8 m_bitmap_layer_mask = 0; + uint8_t m_alu_reg[3]{}; + uint8_t m_alu_ctrl1 = 0; + uint8_t m_alu_ctrl2 = 0; + uint8_t m_extram_mode = 0; + uint8_t m_extram_bank = 0; + uint32_t m_extram_size = 0; + + struct { uint8_t r = 0, g = 0, b = 0; } m_palram[8]; + enum { + BGPAL_PEN = 8, + BORDER_PEN = 9 + }; + + uint32_t m_knj_addr[2]{}; + + uint8_t alu_r(offs_t offset); + void alu_w(offs_t offset, uint8_t data); + uint8_t wram_r(offs_t offset); + void wram_w(offs_t offset, uint8_t data); + uint8_t ext_wram_r(offs_t offset); + void ext_wram_w(offs_t offset, uint8_t data); + uint8_t nbasic_rom_r(offs_t offset); + uint8_t n88basic_rom_r(offs_t offset); + uint8_t gvram_r(offs_t offset); + void gvram_w(offs_t offset, uint8_t data); + uint8_t high_wram_r(offs_t offset); + void high_wram_w(offs_t offset, uint8_t data); + uint8_t ext_rom_bank_r(); + void ext_rom_bank_w(uint8_t data); +// void port30_w(uint8_t data); + void port31_w(uint8_t data); + uint8_t port40_r(); + void port40_w(uint8_t data); + uint8_t vram_select_r(); + void vram_select_w(offs_t offset, uint8_t data); + void irq_level_w(uint8_t data); + void irq_mask_w(uint8_t data); + uint8_t window_bank_r(); + void window_bank_w(uint8_t data); + void window_bank_inc_w(uint8_t data); + uint8_t misc_ctrl_r(); + void misc_ctrl_w(uint8_t data); + void bgpal_w(uint8_t data); + void palram_w(offs_t offset, uint8_t data); + void layer_masking_w(uint8_t data); + uint8_t extram_mode_r(); + void extram_mode_w(uint8_t data); + uint8_t extram_bank_r(); + void extram_bank_w(uint8_t data); + void alu_ctrl1_w(uint8_t data); + void alu_ctrl2_w(uint8_t data); + template uint8_t kanji_r(offs_t offset); + template void kanji_w(offs_t offset, uint8_t data); + void rtc_w(uint8_t data); + DECLARE_WRITE_LINE_MEMBER(txdata_callback); - DECLARE_WRITE_LINE_MEMBER(rxrdy_w); - uint8_t pc8801_sound_board_r(offs_t offset); - void pc8801_sound_board_w(offs_t offset, uint8_t data); - uint8_t pc8801_opna_r(offs_t offset); - void pc8801_opna_w(offs_t offset, uint8_t data); - uint8_t pc8801_unk_r(); - void pc8801_unk_w(uint8_t data); - - uint8_t pc8801_pixel_clock(void); - void pc8801_dynamic_res_change(void); - void draw_bitmap_3bpp(bitmap_ind16 &bitmap,const rectangle &cliprect); - void draw_bitmap_1bpp(bitmap_ind16 &bitmap,const rectangle &cliprect); - uint8_t calc_cursor_pos(int x,int y,int yi); - uint8_t extract_text_attribute(uint32_t address,int x, uint8_t width, uint8_t &non_special); - void pc8801_draw_char(bitmap_ind16 &bitmap,int x,int y,int pal,uint8_t gfx_mode,uint8_t reverse,uint8_t secret, - uint8_t blink,uint8_t upper,uint8_t lower,int y_size,int width, uint8_t non_special); - void draw_text(bitmap_ind16 &bitmap,int y_size, uint8_t width); - - uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void pc8801_palette(palette_device &palette) const; - void pc8801_io(address_map &map); - void pc8801_mem(address_map &map); - void pc8801fdc_io(address_map &map); - void pc8801fdc_mem(address_map &map); - DECLARE_MACHINE_RESET(pc8801_clock_speed); - DECLARE_MACHINE_RESET(pc8801_dic); - DECLARE_MACHINE_RESET(pc8801_cdrom); - INTERRUPT_GEN_MEMBER(pc8801_vrtc_irq); - TIMER_CALLBACK_MEMBER(pc8801fd_upd765_tc_to_zero); - TIMER_DEVICE_CALLBACK_MEMBER(pc8801_rtc_irq); - uint8_t cpu_8255_c_r(); - void cpu_8255_c_w(uint8_t data); - uint8_t fdc_8255_c_r(); - void fdc_8255_c_w(uint8_t data); + + // video section + void draw_bitmap(bitmap_rgb32 &bitmap, const rectangle &cliprect, palette_device *palette, std::function dot_func); + + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + void palette_reset(); + bitmap_rgb32 m_text_bitmap; + + // irq section + DECLARE_WRITE_LINE_MEMBER(rxrdy_irq_w); + DECLARE_WRITE_LINE_MEMBER(vrtc_irq_w); + TIMER_DEVICE_CALLBACK_MEMBER(clock_irq_w); + IRQ_CALLBACK_MEMBER(int_ack_cb); + DECLARE_WRITE_LINE_MEMBER(irq_w); + + struct { + u8 enable = 0, pending = 0; + } m_irq_state; + + bool m_sound_irq_enable = false; + bool m_sound_irq_pending = false; + + enum { + RXRDY_IRQ_LEVEL = 0, + VRTC_IRQ_LEVEL, + CLOCK_IRQ_LEVEL, + INT3_IRQ_LEVEL, + INT4_IRQ_LEVEL, + INT5_IRQ_LEVEL, + FDCINT1_IRQ_LEVEL, + FDCINT2_IRQ_LEVEL + }; + + void assert_irq(u8 level); + void check_irq(u8 level); +}; + +class pc8801mk2sr_state : public pc8801_state +{ +public: + pc8801mk2sr_state(const machine_config &mconfig, device_type type, const char *tag) + : pc8801_state(mconfig, type, tag) + , m_opn(*this, "opn") + { } + + void pc8801mk2sr(machine_config &config); + void pc8801mk2mr(machine_config &config); + +protected: + virtual void main_io(address_map &map) override; + uint8_t opn_porta_r(); - uint8_t opn_portb_r(); + +private: + optional_device m_opn; +}; + +// both FH and MH family bases sports selectable 8/4 MHz CPU clock switch +class pc8801fh_state : public pc8801mk2sr_state +{ +public: + pc8801fh_state(const machine_config &mconfig, device_type type, const char *tag) + : pc8801mk2sr_state(mconfig, type, tag) + , m_opna(*this, "opna") + { } + + void pc8801fh(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void main_io(address_map &map) override; + + virtual attotime mouse_limit_hz() override; + +private: + required_device m_opna; void opna_map(address_map &map); - IRQ_CALLBACK_MEMBER(pc8801_irq_callback); - DECLARE_WRITE_LINE_MEMBER(pc8801_sound_irq); + + uint8_t cpuclock_r(); + uint8_t baudrate_r(); + void baudrate_w(uint8_t data); + + uint8_t m_clock_setting = 0; + uint8_t m_baudrate_val = 0; +}; + +class pc8801ma_state : public pc8801fh_state +{ +public: + pc8801ma_state(const machine_config &mconfig, device_type type, const char *tag) + : pc8801fh_state(mconfig, type, tag) + , m_dictionary_rom(*this, "dictionary") + { } + + void pc8801ma(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + + virtual void main_io(address_map &map) override; + + virtual uint8_t dictionary_rom_r(offs_t offset) override; + virtual bool dictionary_rom_enable() override; + +private: + void dic_bank_w(uint8_t data); + void dic_ctrl_w(uint8_t data); + required_region_ptr m_dictionary_rom; + + uint8_t m_dic_ctrl = 0; + uint8_t m_dic_bank = 0; +}; + +class pc8801mc_state : public pc8801ma_state +{ +public: + pc8801mc_state(const machine_config &mconfig, device_type type, const char *tag) + : pc8801ma_state(mconfig, type, tag) + , m_cdrom_if(*this, "cdrom_if") + , m_cdrom_bios(*this, "cdrom_bios") + { } + + void pc8801mc(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + + virtual void main_io(address_map &map) override; + +private: + virtual uint8_t cdbios_rom_r(offs_t offset) override; + virtual bool cdbios_rom_enable() override; + + required_device m_cdrom_if; + required_region_ptr m_cdrom_bios; + + bool m_cdrom_bank = true; }; #endif // MAME_INCLUDES_PC8801_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/pc88va.h mame-0.243+dfsg.1/src/mame/includes/pc88va.h --- mame-0.242+dfsg.1/src/mame/includes/pc88va.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/pc88va.h 2022-04-29 05:37:26.000000000 +0000 @@ -70,18 +70,18 @@ protected: struct tsp_t { - uint16_t tvram_vreg_offset; - uint16_t attr_offset; - uint16_t spr_offset; - uint8_t disp_on; - uint8_t spr_on; - uint8_t pitch; - uint8_t line_height; - uint8_t h_line_pos; - uint8_t blink; - uint16_t cur_pos_x,cur_pos_y; - uint8_t curn; - uint8_t curn_blink; + uint16_t tvram_vreg_offset = 0; + uint16_t attr_offset = 0; + uint16_t spr_offset = 0; + uint8_t disp_on = 0; + uint8_t spr_on = 0; + uint8_t pitch = 0; + uint8_t line_height = 0; + uint8_t h_line_pos = 0; + uint8_t blink = 0; + uint16_t cur_pos_x = 0, cur_pos_y = 0; + uint8_t curn = 0; + uint8_t curn_blink = 0; }; virtual void machine_start() override; @@ -102,25 +102,25 @@ required_shared_ptr m_tvram; required_shared_ptr m_gvram; std::unique_ptr m_kanjiram; - uint16_t m_bank_reg; - uint16_t m_screen_ctrl_reg; - uint8_t m_timer3_io_reg; - emu_timer *m_t3_mouse_timer; + uint16_t m_bank_reg = 0; + uint16_t m_screen_ctrl_reg = 0; + uint8_t m_timer3_io_reg = 0; + emu_timer *m_t3_mouse_timer = nullptr; tsp_t m_tsp; - uint16_t m_video_pri_reg[2]; - uint8_t m_backupram_wp; - uint8_t m_cmd; - uint8_t m_buf_size; - uint8_t m_buf_index; - uint8_t m_buf_ram[16]; - uint8_t m_portc_test; - uint8_t m_fdc_motor_status[2]; + uint16_t m_video_pri_reg[2]{}; + uint8_t m_backupram_wp = 0; + uint8_t m_cmd = 0; + uint8_t m_buf_size = 0; + uint8_t m_buf_index = 0; + uint8_t m_buf_ram[16]{}; + uint8_t m_portc_test = 0; + uint8_t m_fdc_motor_status[2]{}; /* floppy state */ - uint8_t m_i8255_0_pc; - uint8_t m_i8255_1_pc; - uint8_t m_fdc_mode; - uint8_t m_fdc_irq_opcode; + uint8_t m_i8255_0_pc = 0; + uint8_t m_i8255_1_pc = 0; + uint8_t m_fdc_mode = 0; + uint8_t m_fdc_irq_opcode = 0; uint8_t idp_status_r(); void idp_command_w(uint8_t data); void idp_param_w(uint8_t data); diff -Nru mame-0.242+dfsg.1/src/mame/includes/pc9801_epson.h mame-0.243+dfsg.1/src/mame/includes/pc9801_epson.h --- mame-0.242+dfsg.1/src/mame/includes/pc9801_epson.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/pc9801_epson.h 2022-04-29 05:37:26.000000000 +0000 @@ -50,8 +50,8 @@ template void shadow_ipl_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - u8 m_shadow_ipl_bank; - bool m_itf_bank_enable; + u8 m_shadow_ipl_bank = 0; + bool m_itf_bank_enable = false; // u8 m_itf_bank; }; diff -Nru mame-0.242+dfsg.1/src/mame/includes/pc9801.h mame-0.243+dfsg.1/src/mame/includes/pc9801.h --- mame-0.242+dfsg.1/src/mame/includes/pc9801.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/pc9801.h 2022-04-29 05:37:26.000000000 +0000 @@ -118,7 +118,7 @@ static void floppy_formats(format_registration &fr); - u8 m_sys_type; + u8 m_sys_type = 0; }; class pc9801_state : public pc98_base_state @@ -204,7 +204,7 @@ u8 unk_r(offs_t offset); uint8_t f0_r(offs_t offset); - uint8_t m_nmi_ff; + uint8_t m_nmi_ff = 0; virtual u8 ppi_prn_portb_r(); @@ -241,7 +241,7 @@ uint8_t fdc_2hd_ctrl_r(); void fdc_2hd_ctrl_w(uint8_t data); - u8 m_fdc_2hd_ctrl; + u8 m_fdc_2hd_ctrl = 0; bool fdc_drive_ready_r(upd765a_device *fdc); private: @@ -250,7 +250,7 @@ uint8_t fdc_2dd_ctrl_r(); void fdc_2dd_ctrl_w(uint8_t data); - u8 m_fdc_2dd_ctrl; + u8 m_fdc_2dd_ctrl = 0; // DMA protected: @@ -282,12 +282,12 @@ virtual void video_start() override; void pc9801_palette(palette_device &palette) const; - uint8_t *m_char_rom; - uint8_t *m_kanji_rom; + uint8_t *m_char_rom = nullptr; + uint8_t *m_kanji_rom = nullptr; struct { - uint8_t mode; - uint8_t tile[4], tile_index; + uint8_t mode = 0; + uint8_t tile[4]{}, tile_index = 0; }m_grcg; enum @@ -310,8 +310,8 @@ uint8_t m_video_ff[8]; // TODO: move to derived state uint8_t m_ex_video_ff[128]; - u8 m_vram_bank; - u8 m_vram_disp; + u8 m_vram_bank = 0; + u8 m_vram_disp = 0; private: UPD7220_DRAW_TEXT_LINE_MEMBER( hgdc_draw_text ); @@ -325,26 +325,26 @@ // (necessary for H98 high-reso mode, PC9821-E02, SVGA binds) uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - uint8_t m_font_line; + uint8_t m_font_line = 0; std::unique_ptr m_tvram; - uint8_t m_gfx_ff; - uint8_t m_txt_scroll_reg[8]; - uint8_t m_pal_clut[4]; + uint8_t m_gfx_ff = 0; + uint8_t m_txt_scroll_reg[8]{}; + uint8_t m_pal_clut[4]{}; // SASI - uint8_t m_sasi_data; - int m_sasi_data_enable; - uint8_t m_sasi_ctrl; + uint8_t m_sasi_data = 0; + int m_sasi_data_enable = 0; + uint8_t m_sasi_ctrl = 0; // Mouse protected: struct{ - uint8_t control; - uint8_t lx, ly; - uint8_t dx, dy; - uint8_t prev_dx, prev_dy; - uint8_t freq_reg; - uint8_t freq_index; + uint8_t control = 0; + uint8_t lx = 0, ly = 0; + uint8_t dx = 0, dy = 0; + uint8_t prev_dx = 0, prev_dy = 0; + uint8_t freq_reg = 0; + uint8_t freq_index = 0; }m_mouse; private: @@ -420,9 +420,9 @@ DECLARE_MACHINE_START(pc9801rs); DECLARE_MACHINE_RESET(pc9801rs); - u8 m_gate_a20; - u8 m_dma_access_ctrl; - u8 m_ide_sel; + u8 m_gate_a20 = 0; + u8 m_dma_access_ctrl = 0; + u8 m_ide_sel = 0; // starting from PC9801VF/U buzzer is substituted with a DAC1BIT bool m_dac1bit_disable; @@ -456,29 +456,29 @@ DECLARE_WRITE_LINE_MEMBER(fdc_irq_w); DECLARE_WRITE_LINE_MEMBER(fdc_drq_w); - emu_timer *m_fdc_timer; + emu_timer *m_fdc_timer = nullptr; - u8 m_fdc_mode; + u8 m_fdc_mode = 0; u8 fdc_mode_r(); void fdc_mode_w(u8 data); void fdc_set_density_mode(bool is_2hd); protected: struct { - uint8_t pal_entry; - uint8_t r[16],g[16],b[16]; + uint8_t pal_entry = 0; + uint8_t r[16]{}, g[16]{}, b[16]{}; }m_analog16; private: // EGC, PC9801VX onward struct { - uint16_t regs[8]; - uint16_t pat[4]; - uint16_t src[4]; - int16_t count; - uint16_t leftover[4]; - bool first; - bool init; + uint16_t regs[8]{}; + uint16_t pat[4]{}; + uint16_t src[4]{}; + int16_t count = 0; + uint16_t leftover[4]{}; + bool first = false; + bool init = false; } m_egc; protected: diff -Nru mame-0.242+dfsg.1/src/mame/includes/pc9821.h mame-0.243+dfsg.1/src/mame/includes/pc9821.h --- mame-0.242+dfsg.1/src/mame/includes/pc9821.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/pc9821.h 2022-04-29 05:37:26.000000000 +0000 @@ -45,13 +45,13 @@ uint8_t ext2_video_ff_r(); void ext2_video_ff_w(uint8_t data); - uint8_t m_pc9821_window_bank; - uint8_t m_ext2_ff; + uint8_t m_pc9821_window_bank = 0; + uint8_t m_ext2_ff = 0; struct { - uint8_t pal_entry; - uint8_t r[0x100],g[0x100],b[0x100]; - uint16_t bank[2]; + uint8_t pal_entry = 0; + uint8_t r[0x100]{}, g[0x100]{}, b[0x100]{}; + uint16_t bank[2]{}; }m_analog256; void pc9821_egc_w(offs_t offset, u16 data, u16 mem_mask = ~0); @@ -84,7 +84,7 @@ void ext_sdip_address_w(offs_t offset, u8 data); void ext_sdip_access_w(offs_t offset, u8 data); - uint8_t m_ext_sdip[0x100], m_ext_sdip_addr; + uint8_t m_ext_sdip[0x100]{}, m_ext_sdip_addr = 0; }; // CanBe @@ -112,7 +112,7 @@ DECLARE_MACHINE_START(pc9821_canbe); struct { - u8 index; + u8 index = 0; }m_remote; }; diff -Nru mame-0.242+dfsg.1/src/mame/includes/pc98ha.h mame-0.243+dfsg.1/src/mame/includes/pc98ha.h --- mame-0.242+dfsg.1/src/mame/includes/pc98ha.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/pc98ha.h 2022-04-29 05:37:26.000000000 +0000 @@ -57,13 +57,13 @@ u8 fdc_ctrl_r(offs_t offset); void fdc_ctrl_w(offs_t offset, u8 data); - u8 m_romdrv_bank_reg; - u8 m_bram_banks; - u8 m_bram_bank_reg; - u8 m_dict_bank_reg; + u8 m_romdrv_bank_reg = 0; + u8 m_bram_banks = 0; + u8 m_bram_bank_reg = 0; + u8 m_dict_bank_reg = 0; - u8 m_floppy_mode; - u8 m_fdc_ctrl; + u8 m_floppy_mode = 0; + u8 m_fdc_ctrl = 0; }; class pc98ha_state : public pc98lt_state @@ -98,7 +98,7 @@ void ems_bank_w(offs_t offset, u8 data); u8 memcard_status_1_r(offs_t offset); u8 memcard_status_2_r(offs_t offset); - u8 m_ext_view_sel; + u8 m_ext_view_sel = 0; }; #endif // MAME_INCLUDES_PC9801_EPSON_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/pce.h mame-0.243+dfsg.1/src/mame/includes/pce.h --- mame-0.242+dfsg.1/src/mame/includes/pce.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/pce.h 2022-04-29 05:37:26.000000000 +0000 @@ -66,9 +66,9 @@ required_device m_port_ctrl; required_ioport m_a_card; - u8 m_io_port_options; - u8 m_sys3_card; - u8 m_acard; + u8 m_io_port_options = 0; + u8 m_sys3_card = 0; + u8 m_acard = 0; void controller_w(u8 data); u8 controller_r(); void cd_intf_w(offs_t offset, u8 data); diff -Nru mame-0.242+dfsg.1/src/mame/includes/pcktgal.h mame-0.243+dfsg.1/src/mame/includes/pcktgal.h --- mame-0.242+dfsg.1/src/mame/includes/pcktgal.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/pcktgal.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,62 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Bryan McPhail -#ifndef MAME_INCLUDES_PCKTGAL_H -#define MAME_INCLUDES_PCKTGAL_H - -#pragma once - -#include "machine/gen_latch.h" -#include "sound/msm5205.h" -#include "video/decbac06.h" -#include "emupal.h" - -class pcktgal_state : public driver_device -{ -public: - pcktgal_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_msm(*this, "msm"), - m_tilegen(*this, "tilegen"), - m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette"), - m_soundlatch(*this, "soundlatch"), - m_spriteram(*this, "spriteram") - { } - - required_device m_maincpu; - required_device m_audiocpu; - required_device m_msm; - required_device m_tilegen; - required_device m_gfxdecode; - required_device m_palette; - required_device m_soundlatch; - - required_shared_ptr m_spriteram; - - int m_msm5205next = 0; - int m_toggle = 0; - - void bank_w(uint8_t data); - void sound_bank_w(uint8_t data); - void sound_w(uint8_t data); - void adpcm_data_w(uint8_t data); - uint8_t sound_unk_r(); - DECLARE_WRITE_LINE_MEMBER(adpcm_int); - - void init_pcktgal(); - void pcktgal_palette(palette_device &palette) const; - virtual void machine_start() override; - - uint32_t screen_update_pcktgal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - uint32_t screen_update_pcktgalb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, bool flip_screen); - void bootleg(machine_config &config); - void pcktgal(machine_config &config); - void pcktgal2(machine_config &config); - void pcktgal_map(address_map &map); - void pcktgal_sound_map(address_map &map); -}; - -#endif // MAME_INCLUDES_PCKTGAL_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/pcw16.h mame-0.243+dfsg.1/src/mame/includes/pcw16.h --- mame-0.242+dfsg.1/src/mame/includes/pcw16.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/pcw16.h 2022-04-29 05:37:26.000000000 +0000 @@ -127,30 +127,30 @@ required_memory_region m_region_rom; required_ioport m_io_extra; - unsigned long m_interrupt_counter; - int m_banks[4]; - int m_4_bit_port; - int m_fdc_int_code; - int m_system_status; - char *m_mem_ptr[4]; - unsigned char m_keyboard_data_shift; - int m_keyboard_parity_table[256]; - int m_keyboard_bits; - int m_keyboard_bits_output; - int m_keyboard_state; - int m_keyboard_previous_state; - unsigned char m_rtc_seconds; - unsigned char m_rtc_minutes; - unsigned char m_rtc_hours; - unsigned char m_rtc_days_max; - unsigned char m_rtc_days; - unsigned char m_rtc_months; - unsigned char m_rtc_years; - unsigned char m_rtc_control; - unsigned char m_rtc_256ths_seconds; - int m_previous_fdc_int_state; - int m_colour_palette[16]; - int m_video_control; + unsigned long m_interrupt_counter = 0; + int m_banks[4]{}; + int m_4_bit_port = 0; + int m_fdc_int_code = 0; + int m_system_status = 0; + char *m_mem_ptr[4]{}; + unsigned char m_keyboard_data_shift = 0; + int m_keyboard_parity_table[256]{}; + int m_keyboard_bits = 0; + int m_keyboard_bits_output = 0; + int m_keyboard_state = 0; + int m_keyboard_previous_state = 0; + unsigned char m_rtc_seconds = 0; + unsigned char m_rtc_minutes = 0; + unsigned char m_rtc_hours = 0; + unsigned char m_rtc_days_max = 0; + unsigned char m_rtc_days = 0; + unsigned char m_rtc_months = 0; + unsigned char m_rtc_years = 0; + unsigned char m_rtc_control = 0; + unsigned char m_rtc_256ths_seconds = 0; + int m_previous_fdc_int_state = 0; + int m_colour_palette[16]{}; + int m_video_control = 0; }; #endif // MAME_INCLUDES_PCW16_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/pcw.h mame-0.243+dfsg.1/src/mame/includes/pcw.h --- mame-0.242+dfsg.1/src/mame/includes/pcw.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/pcw.h 2022-04-29 05:37:26.000000000 +0000 @@ -67,12 +67,12 @@ virtual void video_start() override; private: - int m_boot; - int m_system_status; - int m_fdc_interrupt_code; - int m_interrupt_counter; - uint8_t m_banks[4]; - unsigned char m_bank_force; + int m_boot = 0; + int m_system_status = 0; + int m_fdc_interrupt_code = 0; + int m_interrupt_counter = 0; + uint8_t m_banks[4]{}; + unsigned char m_bank_force = 0; uint8_t m_timer_irq_flag = 0; uint8_t m_nmi_flag = 0; int16_t m_printer_headpos = 0; diff -Nru mame-0.242+dfsg.1/src/mame/includes/pecom.h mame-0.243+dfsg.1/src/mame/includes/pecom.h --- mame-0.242+dfsg.1/src/mame/includes/pecom.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/pecom.h 2022-04-29 05:37:26.000000000 +0000 @@ -54,11 +54,11 @@ void mem_map(address_map &map); std::unique_ptr m_charram; /* character generator ROM */ - bool m_reset; /* CPU mode */ - bool m_dma; /* memory refresh DMA */ + bool m_reset = false; /* CPU mode */ + bool m_dma = false; /* memory refresh DMA */ /* timers */ - emu_timer *m_reset_timer; /* power on reset timer */ + emu_timer *m_reset_timer = nullptr; /* power on reset timer */ required_device m_maincpu; required_device m_cdp1869; diff -Nru mame-0.242+dfsg.1/src/mame/includes/pgm2.h mame-0.243+dfsg.1/src/mame/includes/pgm2.h --- mame-0.242+dfsg.1/src/mame/includes/pgm2.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/pgm2.h 2022-04-29 05:37:26.000000000 +0000 @@ -124,8 +124,8 @@ void decrypt_kov3_module(u32 addrxor, u16 dataxor); - tilemap_t *m_fg_tilemap; - tilemap_t *m_bg_tilemap; + tilemap_t *m_fg_tilemap = nullptr; + tilemap_t *m_bg_tilemap = nullptr; bitmap_ind16 m_sprite_bitmap; @@ -139,32 +139,32 @@ void copy_sprites_from_bitmap(bitmap_rgb32 &bitmap, const rectangle &cliprect, u16 pri); void common_encryption_init(); - u8 m_encryption_table[0x100]; - bool m_has_decrypted; // so we only do it once. - bool m_has_decrypted_kov3_module; - u32 m_spritekey; - u32 m_realspritekey; - bool m_sprite_predecrypted; - - u8 m_shareram[0x100]; - u16 m_share_bank; - u32 m_mcu_regs[8]; - u32 m_mcu_result0; - u32 m_mcu_result1; - u8 m_mcu_last_cmd; + u8 m_encryption_table[0x100]{}; + bool m_has_decrypted = false; // so we only do it once. + bool m_has_decrypted_kov3_module = false; + u32 m_spritekey = 0; + u32 m_realspritekey = 0; + bool m_sprite_predecrypted = false; + + u8 m_shareram[0x100]{}; + u16 m_share_bank = 0; + u32 m_mcu_regs[8]{}; + u32 m_mcu_result0 = 0; + u32 m_mcu_result1 = 0; + u8 m_mcu_last_cmd = 0; void mcu_command(bool is_command); std::vector m_encrypted_copy; - u32 m_pio_out_data; - const kov3_module_key *module_key; - bool module_sum_read; - u32 module_in_latch; - u32 module_out_latch; - int module_prev_state; - int module_clk_cnt; - u8 module_rcv_buf[10]; - u8 module_send_buf[9]; + u32 m_pio_out_data = 0; + const kov3_module_key *module_key = nullptr; + bool module_sum_read = false; + u32 module_in_latch = 0; + u32 module_out_latch = 0; + int module_prev_state = 0; + int module_clk_cnt = 0; + u8 module_rcv_buf[10]{}; + u8 module_send_buf[9]{}; // devices required_device m_maincpu; diff -Nru mame-0.242+dfsg.1/src/mame/includes/pgm.h mame-0.243+dfsg.1/src/mame/includes/pgm.h --- mame-0.242+dfsg.1/src/mame/includes/pgm.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/pgm.h 2022-04-29 05:37:26.000000000 +0000 @@ -68,7 +68,7 @@ required_device m_maincpu; /* hack */ - int m_irq4_disabled; + int m_irq4_disabled = 0; void pgm_base_mem(address_map &map); void pgm_mem(address_map &map); @@ -78,25 +78,25 @@ required_shared_ptr m_videoregs; required_shared_ptr m_videoram; required_shared_ptr m_z80_mainram; - u16 * m_bg_videoram; - u16 * m_tx_videoram; - u16 * m_rowscrollram; + u16 * m_bg_videoram = nullptr; + u16 * m_tx_videoram = nullptr; + u16 * m_rowscrollram = nullptr; /* video-related */ struct sprite_t { - int x,y; - bool xgrow, ygrow; - u32 xzoom, yzoom; - u32 color, offs; - u32 width, height; - u8 flip, pri; + int x = 0, y = 0; + bool xgrow = false, ygrow = false; + u32 xzoom = 0, yzoom = 0; + u32 color = 0, offs = 0; + u32 width = 0, height = 0; + u8 flip = 0, pri = 0; }; std::unique_ptr m_spritelist; - struct sprite_t *m_sprite_ptr_pre; - tilemap_t *m_bg_tilemap; - tilemap_t *m_tx_tilemap; + struct sprite_t *m_sprite_ptr_pre = nullptr; + tilemap_t *m_bg_tilemap = nullptr; + tilemap_t *m_tx_tilemap = nullptr; /* devices */ required_device m_soundcpu; @@ -109,9 +109,9 @@ /* used by rendering */ required_region_ptr m_adata; required_region_ptr m_bdata; - u32 m_aoffset; - u8 m_abit; - u32 m_boffset; + u32 m_aoffset = 0; + u8 m_abit = 0; + u32 m_boffset = 0; u16 videoram_r(offs_t offset); void videoram_w(offs_t offset, u16 data, u16 mem_mask = ~0); diff -Nru mame-0.242+dfsg.1/src/mame/includes/pk8020.h mame-0.243+dfsg.1/src/mame/includes/pk8020.h --- mame-0.242+dfsg.1/src/mame/includes/pk8020.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/pk8020.h 2022-04-29 05:37:26.000000000 +0000 @@ -83,17 +83,17 @@ void pk8020_mem(address_map &map); void devices_map(address_map &map); - uint8_t m_bank_select; - uint8_t m_color; - uint8_t m_video_page; - uint8_t m_wide; - uint8_t m_font; - uint8_t m_attr; - uint8_t m_text_attr; - uint8_t m_takt; - uint8_t m_video_page_access; - uint8_t m_sound_gate; - uint8_t m_sound_level; + uint8_t m_bank_select = 0; + uint8_t m_color = 0; + uint8_t m_video_page = 0; + uint8_t m_wide = 0; + uint8_t m_font = 0; + uint8_t m_attr = 0; + uint8_t m_text_attr = 0; + uint8_t m_takt = 0; + uint8_t m_video_page_access = 0; + uint8_t m_sound_gate = 0; + uint8_t m_sound_level = 0; required_device m_maincpu; required_device m_decplm; diff -Nru mame-0.242+dfsg.1/src/mame/includes/playch10.h mame-0.243+dfsg.1/src/mame/includes/playch10.h --- mame-0.242+dfsg.1/src/mame/includes/playch10.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/playch10.h 2022-04-29 05:37:26.000000000 +0000 @@ -121,8 +121,8 @@ struct chr_bank { - int writable; // 1 for RAM, 0 for ROM - uint8_t* chr; // direct access to the memory + int writable = 0; // 1 for RAM, 0 for ROM + uint8_t* chr = nullptr; // direct access to the memory }; void playch10_palette(palette_device &palette) const; @@ -159,39 +159,39 @@ void prg8(int slot, int bank); memory_bank_array_creator<4> m_prg_banks; memory_view m_prg_view; - int m_prg_chunks; + int m_prg_chunks = 0; optional_memory_region m_vrom_region; output_finder<4> m_timedigits; - int m_up_8w; - int m_pc10_nmi_enable; - int m_pc10_dog_di; - int m_pc10_sdcs; - int m_pc10_dispmask; - int m_pc10_int_detect; - int m_pc10_game_mode; - int m_pc10_dispmask_old; - int m_pc10_gun_controller; - int m_cart_sel; - int m_cntrl_mask; - int m_input_latch[2]; - int m_mirroring; - int m_MMC2_bank[4]; - int m_MMC2_bank_latch[2]; - uint8_t* m_vrom; + int m_up_8w = 0; + int m_pc10_nmi_enable = 0; + int m_pc10_dog_di = 0; + int m_pc10_sdcs = 0; + int m_pc10_dispmask = 0; + int m_pc10_int_detect = 0; + int m_pc10_game_mode = 0; + int m_pc10_dispmask_old = 0; + int m_pc10_gun_controller = 0; + int m_cart_sel = 0; + int m_cntrl_mask = 0; + int m_input_latch[2]{}; + int m_mirroring = 0; + int m_MMC2_bank[4]{}; + int m_MMC2_bank_latch[2]{}; + uint8_t* m_vrom = nullptr; std::unique_ptr m_vram; chr_bank m_chr_page[8]; - int m_mmc1_shiftreg; - int m_mmc1_shiftcount; - int m_gboard_banks[2]; - int m_gboard_command; - int m_IRQ_count; - uint8_t m_IRQ_count_latch; - int m_IRQ_enable; - int m_pc10_bios; - tilemap_t *m_bg_tilemap; + int m_mmc1_shiftreg = 0; + int m_mmc1_shiftcount = 0; + int m_gboard_banks[2]{}; + int m_gboard_command = 0; + int m_IRQ_count = 0; + uint8_t m_IRQ_count_latch = 0; + int m_IRQ_enable = 0; + int m_pc10_bios = 0; + tilemap_t *m_bg_tilemap = nullptr; }; #endif // MAME_INCLUDES_PLAYCH10_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/pmd85.h mame-0.243+dfsg.1/src/mame/includes/pmd85.h --- mame-0.242+dfsg.1/src/mame/includes/pmd85.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/pmd85.h 2022-04-29 05:37:26.000000000 +0000 @@ -27,6 +27,7 @@ , m_maincpu(*this, "maincpu") , m_rom(*this, "maincpu") , m_ram(*this, RAM_TAG) + , m_user1(*this, "user1") , m_cassette(*this, "cassette") , m_speaker(*this, "speaker") , m_pit(*this, "pit") @@ -66,16 +67,16 @@ TIMER_CASSETTE }; - bool m_txd, m_rts; - uint8_t m_rom_module_present; - uint8_t m_ppi_port_outputs[4][3]; - uint8_t m_startup_mem_map; - uint8_t m_pmd853_memory_mapping; - bool m_previous_level; - bool m_clk_level; - bool m_clk_level_tape; - uint8_t m_model; - emu_timer * m_cassette_timer; + bool m_txd = false, m_rts = false; + uint8_t m_rom_module_present = 0; + uint8_t m_ppi_port_outputs[4][3]{}; + uint8_t m_startup_mem_map = 0; + uint8_t m_pmd853_memory_mapping = 0; + bool m_previous_level = false; + bool m_clk_level = false; + bool m_clk_level_tape = false; + uint8_t m_model = 0; + emu_timer * m_cassette_timer = nullptr; void (pmd85_state::*update_memory)(); uint8_t io_r(offs_t offset); void io_w(offs_t offset, uint8_t data); @@ -136,6 +137,7 @@ required_device m_maincpu; required_region_ptr m_rom; required_device m_ram; + optional_memory_region m_user1; required_device m_cassette; required_device m_speaker; required_device m_pit; diff -Nru mame-0.242+dfsg.1/src/mame/includes/pocketc.h mame-0.243+dfsg.1/src/mame/includes/pocketc.h --- mame-0.242+dfsg.1/src/mame/includes/pocketc.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/pocketc.h 2022-04-29 05:37:26.000000000 +0000 @@ -56,9 +56,9 @@ required_ioport m_dsw0; required_ioport m_extra; - uint8_t m_outa; - uint8_t m_outb; - int m_power; + uint8_t m_outa = 0; + uint8_t m_outb = 0; + int m_power = 0; emu_timer *m_power_timer; static const int colortable[8][2]; diff -Nru mame-0.242+dfsg.1/src/mame/includes/poly88.h mame-0.243+dfsg.1/src/mame/includes/poly88.h --- mame-0.242+dfsg.1/src/mame/includes/poly88.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/poly88.h 2022-04-29 05:37:26.000000000 +0000 @@ -78,11 +78,11 @@ required_ioport m_linec; required_ioport m_onboard_config; - uint8_t m_int_vector; - bool m_dtr, m_rts, m_txd, m_rxd, m_cassold, m_casspol; - u8 m_cass_data[5]; + uint8_t m_int_vector = 0; + bool m_dtr = false, m_rts = false, m_txd = false, m_rxd = false, m_cassold = false, m_casspol = false; + u8 m_cass_data[5] = {}; std::unique_ptr m_onboard_ram; - bool m_onboard_disable; + bool m_onboard_disable = false; }; #endif // MAME_INCLUDES_POLY88_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/polyplay.h mame-0.243+dfsg.1/src/mame/includes/polyplay.h --- mame-0.242+dfsg.1/src/mame/includes/polyplay.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/polyplay.h 2022-04-29 05:37:26.000000000 +0000 @@ -79,8 +79,8 @@ required_device m_palette; /* audio */ - uint8_t m_flipflop1; - uint8_t m_flipflop2; + uint8_t m_flipflop1 = 0; + uint8_t m_flipflop2 = 0; required_device m_speaker1; required_device m_speaker2; output_finder<4> m_lamps; diff -Nru mame-0.242+dfsg.1/src/mame/includes/powerins.h mame-0.243+dfsg.1/src/mame/includes/powerins.h --- mame-0.242+dfsg.1/src/mame/includes/powerins.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/powerins.h 2022-04-29 05:37:26.000000000 +0000 @@ -21,8 +21,6 @@ void powerinsb(machine_config &config); void powerinsc(machine_config &config); - void init_powerinsc(); - private: void powerinsa_okibank_w(u8 data); u8 powerinsb_fake_ym2203_r(); diff -Nru mame-0.242+dfsg.1/src/mame/includes/prehisle.h mame-0.243+dfsg.1/src/mame/includes/prehisle.h --- mame-0.242+dfsg.1/src/mame/includes/prehisle.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/prehisle.h 2022-04-29 05:37:26.000000000 +0000 @@ -59,15 +59,15 @@ required_region_ptr m_tilemap_rom; required_ioport m_io_p1; - uint8_t m_invert_controls; - uint16_t m_bg_scrollx; - uint16_t m_bg_scrolly; - uint16_t m_fg_scrollx; - uint16_t m_fg_scrolly; + uint8_t m_invert_controls = 0; + uint16_t m_bg_scrollx = 0; + uint16_t m_bg_scrolly = 0; + uint16_t m_fg_scrollx = 0; + uint16_t m_fg_scrolly = 0; - tilemap_t *m_bg_tilemap; - tilemap_t *m_fg_tilemap; - tilemap_t *m_tx_tilemap; + tilemap_t *m_bg_tilemap = nullptr; + tilemap_t *m_fg_tilemap = nullptr; + tilemap_t *m_tx_tilemap = nullptr; required_device m_maincpu; required_device m_audiocpu; diff -Nru mame-0.242+dfsg.1/src/mame/includes/primo.h mame-0.243+dfsg.1/src/mame/includes/primo.h --- mame-0.242+dfsg.1/src/mame/includes/primo.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/primo.h 2022-04-29 05:37:26.000000000 +0000 @@ -86,12 +86,12 @@ required_ioport m_reset_port; required_shared_ptr m_vram; - memory_region *m_cart1_rom; - memory_region *m_cart2_rom; + memory_region *m_cart1_rom = nullptr; + memory_region *m_cart2_rom = nullptr; - uint16_t m_video_memory_base; - uint8_t m_port_FD; - int m_nmi; + uint16_t m_video_memory_base = 0; + uint8_t m_port_FD = 0; + int m_nmi = 0; }; diff -Nru mame-0.242+dfsg.1/src/mame/includes/prof80.h mame-0.243+dfsg.1/src/mame/includes/prof80.h --- mame-0.242+dfsg.1/src/mame/includes/prof80.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/prof80.h 2022-04-29 05:37:26.000000000 +0000 @@ -90,12 +90,12 @@ DECLARE_WRITE_LINE_MEMBER(mstop_w); // floppy state - int m_motor; - int m_ready; - int m_select; + int m_motor = 0; + int m_ready = 0; + int m_select = 0; // timers - emu_timer *m_floppy_motor_off_timer; + emu_timer *m_floppy_motor_off_timer = nullptr; void prof80_io(address_map &map); void prof80_mem(address_map &map); diff -Nru mame-0.242+dfsg.1/src/mame/includes/psikyo4.h mame-0.243+dfsg.1/src/mame/includes/psikyo4.h --- mame-0.242+dfsg.1/src/mame/includes/psikyo4.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/psikyo4.h 2022-04-29 05:37:26.000000000 +0000 @@ -49,12 +49,12 @@ required_memory_bank m_gfxbank; required_memory_bank_array<4> m_ymf_bank; - uint16_t m_gfx_max_bank; - uint8_t m_ymf_max_bank; - uint8_t m_io_select; + uint16_t m_gfx_max_bank = 0; + uint8_t m_ymf_max_bank = 0; + uint8_t m_io_select = 0; /* video-related */ - double m_oldbrt[2]; + double m_oldbrt[2]{}; /* devices */ required_device m_maincpu; diff -Nru mame-0.242+dfsg.1/src/mame/includes/psikyo.h mame-0.243+dfsg.1/src/mame/includes/psikyo.h --- mame-0.242+dfsg.1/src/mame/includes/psikyo.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/psikyo.h 2022-04-29 05:37:26.000000000 +0000 @@ -80,37 +80,37 @@ /* video-related */ struct sprite_t { - u8 gfx; - u32 code,color; - bool flipx,flipy; - s32 x,y; - u32 zoomx,zoomy; - u32 primask; + u8 gfx = 0; + u32 code = 0, color = 0; + bool flipx = false, flipy = false; + s32 x = 0, y = 0; + u32 zoomx = 0, zoomy = 0; + u32 primask = 0; }; - tilemap_t *m_tilemap[2]; - u8 m_tilemap_bank[2]; - bool m_ka302c_banking; - u32 m_old_linescroll[2]; - u32 m_old_tmapsize[2]; - u32 m_tmapsize[2]; + tilemap_t *m_tilemap[2]{}; + u8 m_tilemap_bank[2]{}; + bool m_ka302c_banking = false; + u32 m_old_linescroll[2]{}; + u32 m_old_tmapsize[2]{}; + u32 m_tmapsize[2]{}; std::unique_ptr m_spritelist; struct sprite_t *m_sprite_ptr_pre; - u16 m_sprite_ctrl; + u16 m_sprite_ctrl = 0; /* game-specific */ // 1945 MCU - int m_mcu_status; - u8 m_s1945_mcu_direction; - u8 m_s1945_mcu_latch1; - u8 m_s1945_mcu_latch2; - u8 m_s1945_mcu_inlatch; - u8 m_s1945_mcu_index; - u8 m_s1945_mcu_latching; - u8 m_s1945_mcu_mode; - u8 m_s1945_mcu_control; - u8 m_s1945_mcu_bctrl; - const u8 *m_s1945_mcu_table; + int m_mcu_status = 0; + u8 m_s1945_mcu_direction = 0; + u8 m_s1945_mcu_latch1 = 0; + u8 m_s1945_mcu_latch2 = 0; + u8 m_s1945_mcu_inlatch = 0; + u8 m_s1945_mcu_index = 0; + u8 m_s1945_mcu_latching = 0; + u8 m_s1945_mcu_mode = 0; + u8 m_s1945_mcu_control = 0; + u8 m_s1945_mcu_bctrl = 0; + const u8 *m_s1945_mcu_table = nullptr; u32 sngkace_input_r(offs_t offset); u32 gunbird_input_r(offs_t offset); diff -Nru mame-0.242+dfsg.1/src/mame/includes/psikyosh.h mame-0.243+dfsg.1/src/mame/includes/psikyosh.h --- mame-0.242+dfsg.1/src/mame/includes/psikyosh.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/psikyosh.h 2022-04-29 05:37:26.000000000 +0000 @@ -61,15 +61,15 @@ /* video-related */ struct sprite_t { - s32 ypos, xpos; - u8 high, wide; - u8 flpy, flpx; - u8 spr_pri, bg_pri; - u8 zoomy, zoomx; - u32 tnum; - u16 colr; - u8 dpth; - s16 alpha; + s32 ypos = 0, xpos = 0; + u8 high = 0, wide = 0; + u8 flpy = 0, flpx = 0; + u8 spr_pri = 0, bg_pri = 0; + u8 zoomy = 0, zoomx = 0; + u32 tnum = 0; + u16 colr = 0; + u8 dpth = 0; + s16 alpha = 0; }; bitmap_ind8 m_zoom_bitmap; diff -Nru mame-0.242+dfsg.1/src/mame/includes/psion5.h mame-0.243+dfsg.1/src/mame/includes/psion5.h --- mame-0.242+dfsg.1/src/mame/includes/psion5.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/psion5.h 2022-04-29 05:37:26.000000000 +0000 @@ -188,32 +188,32 @@ required_ioport m_touch; required_ioport_array<8> m_kbd_cols; - emu_timer *m_timers[2]; + emu_timer *m_timers[2]{}; - uint32_t m_memcfg[2]; - uint16_t m_dramcfg; + uint32_t m_memcfg[2]{}; + uint16_t m_dramcfg = 0; - uint16_t m_timer_reload[2]; - uint16_t m_timer_ctrl[2]; - uint16_t m_timer_value[2]; + uint16_t m_timer_reload[2]{}; + uint16_t m_timer_ctrl[2]{}; + uint16_t m_timer_value[2]{}; - uint32_t m_pending_ints; - uint32_t m_int_mask; + uint32_t m_pending_ints = 0; + uint32_t m_int_mask = 0; - uint32_t m_lcd_display_base_addr; + uint32_t m_lcd_display_base_addr = 0; - uint32_t m_rtc; - uint32_t m_pwrsr; - uint32_t m_last_ssi_request; - uint32_t m_ssi_read_counter; - uint8_t m_buzzer_ctrl; + uint32_t m_rtc = 0; + uint32_t m_pwrsr = 0; + uint32_t m_last_ssi_request = 0; + uint32_t m_ssi_read_counter = 0; + uint8_t m_buzzer_ctrl = 0; - uint8_t m_kbd_scan; + uint8_t m_kbd_scan = 0; - uint8_t m_ports[5]; + uint8_t m_ports[5]{}; - emu_timer *m_periodic; - emu_timer *m_rtc_ticker; + emu_timer *m_periodic = nullptr; + emu_timer *m_rtc_ticker = nullptr; }; #endif // MAME_INCLUDES_PSION5_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/punchout.h mame-0.243+dfsg.1/src/mame/includes/punchout.h --- mame-0.242+dfsg.1/src/mame/includes/punchout.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/punchout.h 2022-04-29 05:37:26.000000000 +0000 @@ -68,7 +68,7 @@ tilemap_t *m_spr1_tilemap_flipx = nullptr; tilemap_t *m_spr2_tilemap = nullptr; - bool m_nmi_mask; + bool m_nmi_mask = false; uint8_t spunchout_exp_r(offs_t offset); void spunchout_exp_w(offs_t offset, uint8_t data); void spunchout_rp5h01_reset_w(uint8_t data); diff -Nru mame-0.242+dfsg.1/src/mame/includes/qdrmfgp.h mame-0.243+dfsg.1/src/mame/includes/qdrmfgp.h --- mame-0.242+dfsg.1/src/mame/includes/qdrmfgp.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/qdrmfgp.h 2022-04-29 05:37:26.000000000 +0000 @@ -53,10 +53,10 @@ required_device m_palette; required_shared_ptr m_sndram; - uint16_t m_control; - int32_t m_gp2_irq_control; - int32_t m_pal; - emu_timer *m_gp2_timer; + uint16_t m_control = 0; + int32_t m_gp2_irq_control = 0; + int32_t m_pal = 0; + emu_timer *m_gp2_timer = nullptr; void gp_control_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); void gp2_control_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); diff -Nru mame-0.242+dfsg.1/src/mame/includes/relief.h mame-0.243+dfsg.1/src/mame/includes/relief.h --- mame-0.242+dfsg.1/src/mame/includes/relief.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/relief.h 2022-04-29 05:37:26.000000000 +0000 @@ -56,9 +56,9 @@ required_device m_ym2413; required_memory_bank m_okibank; - uint8_t m_ym2413_volume; - uint8_t m_overall_volume; - uint8_t m_adpcm_bank; + uint8_t m_ym2413_volume = 0; + uint8_t m_overall_volume = 0; + uint8_t m_adpcm_bank = 0; static const atari_motion_objects_config s_mob_config; }; diff -Nru mame-0.242+dfsg.1/src/mame/includes/renegade.h mame-0.243+dfsg.1/src/mame/includes/renegade.h --- mame-0.242+dfsg.1/src/mame/includes/renegade.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/renegade.h 2022-04-29 05:37:26.000000000 +0000 @@ -61,13 +61,13 @@ required_region_ptr m_adpcmrom; - uint32_t m_adpcm_pos; - uint32_t m_adpcm_end; - bool m_adpcm_playing; + uint32_t m_adpcm_pos = 0; + uint32_t m_adpcm_end = 0; + bool m_adpcm_playing = false; - int32_t m_scrollx; - tilemap_t *m_bg_tilemap; - tilemap_t *m_fg_tilemap; + int32_t m_scrollx = 0; + tilemap_t *m_bg_tilemap = nullptr; + tilemap_t *m_fg_tilemap = nullptr; uint8_t mcu_reset_r(); void bankswitch_w(uint8_t data); diff -Nru mame-0.242+dfsg.1/src/mame/includes/rmnimbus.h mame-0.243+dfsg.1/src/mame/includes/rmnimbus.h --- mame-0.242+dfsg.1/src/mame/includes/rmnimbus.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/rmnimbus.h 2022-04-29 05:37:26.000000000 +0000 @@ -87,8 +87,8 @@ void nimbus(machine_config &config); - uint32_t m_debug_machine; - uint32_t m_debug_trap; + uint32_t m_debug_machine = 0; + uint32_t m_debug_trap = 0; void decode_subbios(device_t *device, offs_t pc); void decode_subbios_return(device_t *device, offs_t pc); @@ -118,17 +118,17 @@ bitmap_ind16 m_video_mem; - uint8_t m_mcu_reg080; - uint8_t m_iou_reg092; - uint8_t m_last_playmode; - uint8_t m_ay8910_a; - uint8_t m_ay8910_b; - uint16_t m_x, m_y, m_yline; - uint8_t m_colours, m_mode, m_upmode; - uint32_t m_debug_video; - uint8_t m_vector; - uint8_t m_eeprom_bits; - uint8_t m_eeprom_state; + uint8_t m_mcu_reg080 = 0; + uint8_t m_iou_reg092 = 0; + uint8_t m_last_playmode = 0; + uint8_t m_ay8910_a = 0; + uint8_t m_ay8910_b = 0; + uint16_t m_x = 0, m_y = 0, m_yline = 0; + uint8_t m_colours = 0, m_mode = 0, m_upmode = 0; + uint32_t m_debug_video = 0; + uint8_t m_vector = 0; + uint8_t m_eeprom_bits = 0; + uint8_t m_eeprom_state = 0; uint8_t nimbus_mcu_r(); void nimbus_mcu_w(uint8_t data); @@ -202,13 +202,13 @@ void check_scsi_irq(); void set_scsi_drqlat(bool clock, bool clear); - int m_scsi_iena; - int m_scsi_msg; - int m_scsi_bsy; - int m_scsi_io; - int m_scsi_cd; - int m_scsi_req; - int m_scsi_reqlat; + int m_scsi_iena = 0; + int m_scsi_msg = 0; + int m_scsi_bsy = 0; + int m_scsi_io = 0; + int m_scsi_cd = 0; + int m_scsi_req = 0; + int m_scsi_reqlat = 0; virtual void device_timer(emu_timer &timer, device_timer_id id, int param) override; @@ -220,36 +220,36 @@ // Static data related to Floppy and SCSI hard disks struct { - uint8_t reg400; + uint8_t reg400 = 0; } m_nimbus_drives; /* 8031 Peripheral controller */ struct { - uint8_t ipc_in; - uint8_t ipc_out; - uint8_t status_in; - uint8_t status_out; + uint8_t ipc_in = 0; + uint8_t ipc_out = 0; + uint8_t status_in = 0; + uint8_t status_out = 0; } m_ipc_interface; /* Mouse/Joystick */ struct { - uint8_t m_mouse_x; - uint8_t m_mouse_y; + uint8_t m_mouse_x = 0; + uint8_t m_mouse_y = 0; - uint8_t m_mouse_pcx; - uint8_t m_mouse_pcy; + uint8_t m_mouse_pcx = 0; + uint8_t m_mouse_pcy = 0; - uint8_t m_intstate_x; - uint8_t m_intstate_y; + uint8_t m_intstate_x = 0; + uint8_t m_intstate_y = 0; - uint8_t m_reg0a4; + uint8_t m_reg0a4 = 0; - emu_timer *m_mouse_timer; + emu_timer *m_mouse_timer = nullptr; } m_nimbus_mouse; - bool m_voice_enabled; + bool m_voice_enabled = false; void nimbus_io(address_map &map); void nimbus_iocpu_io(address_map &map); diff -Nru mame-0.242+dfsg.1/src/mame/includes/rockrage.h mame-0.243+dfsg.1/src/mame/includes/rockrage.h --- mame-0.242+dfsg.1/src/mame/includes/rockrage.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/rockrage.h 2022-04-29 05:37:26.000000000 +0000 @@ -49,7 +49,7 @@ required_memory_bank m_rombank; /* video-related */ - int m_vreg; + int m_vreg = 0; void rockrage_bankswitch_w(uint8_t data); void rockrage_sh_irqtrigger_w(uint8_t data); diff -Nru mame-0.242+dfsg.1/src/mame/includes/sage2.h mame-0.243+dfsg.1/src/mame/includes/sage2.h --- mame-0.242+dfsg.1/src/mame/includes/sage2.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/sage2.h 2022-04-29 05:37:26.000000000 +0000 @@ -89,12 +89,12 @@ required_device m_ieee488; // floppy state - int m_fdc_int; - int m_fdie; + int m_fdc_int = 0; + int m_fdie = 0; - int m_centronics_busy; - int m_centronics_perror; - int m_centronics_select; - int m_centronics_fault; + int m_centronics_busy = 0; + int m_centronics_perror = 0; + int m_centronics_select = 0; + int m_centronics_fault = 0; output_finder<> m_led; }; diff -Nru mame-0.242+dfsg.1/src/mame/includes/saturn.h mame-0.243+dfsg.1/src/mame/includes/saturn.h --- mame-0.242+dfsg.1/src/mame/includes/saturn.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/saturn.h 2022-04-29 05:37:26.000000000 +0000 @@ -77,48 +77,48 @@ std::unique_ptr m_vdp1_vram; std::unique_ptr m_vdp1_regs; - uint8_t m_en_68k; + uint8_t m_en_68k = 0; - int m_minit_boost; - int m_sinit_boost; + int m_minit_boost = 0; + int m_sinit_boost = 0; attotime m_minit_boost_timeslice; attotime m_sinit_boost_timeslice; struct { std::unique_ptr framebuffer_display_lines; - int framebuffer_mode; - int framebuffer_double_interlace; - int fbcr_accessed; - int framebuffer_width; - int framebuffer_height; - int framebuffer_current_display; - int framebuffer_current_draw; - int framebuffer_clear_on_next_frame; + int framebuffer_mode = 0; + int framebuffer_double_interlace = 0; + int fbcr_accessed = 0; + int framebuffer_width = 0; + int framebuffer_height = 0; + int framebuffer_current_display = 0; + int framebuffer_current_draw = 0; + int framebuffer_clear_on_next_frame = 0; rectangle system_cliprect; rectangle user_cliprect; std::unique_ptr framebuffer[2]; std::unique_ptr framebuffer_draw_lines; std::unique_ptr gfx_decode; - uint16_t lopr; - uint16_t copr; - uint16_t ewdr; + uint16_t lopr = 0; + uint16_t copr = 0; + uint16_t ewdr = 0; - int local_x; - int local_y; + int local_x = 0; + int local_y = 0; }m_vdp1; struct { std::unique_ptr gfx_decode; bitmap_rgb32 roz_bitmap[2]; - uint8_t dotsel; - uint8_t pal; - uint8_t odd; - uint16_t h_count; - uint16_t v_count; - uint8_t exltfg; - uint8_t exsyfg; - int old_crmd; - int old_tvmd; + uint8_t dotsel = 0; + uint8_t pal = 0; + uint8_t odd = 0; + uint16_t h_count = 0; + uint16_t v_count = 0; + uint8_t exltfg = 0; + uint8_t exsyfg = 0; + int old_crmd = 0; + int old_tvmd = 0; }m_vdp2; required_device m_maincpu; @@ -148,7 +148,7 @@ uint8_t saturn_backupram_r(offs_t offset); void saturn_backupram_w(offs_t offset, uint8_t data); - int m_scsp_last_line; + int m_scsp_last_line = 0; uint16_t saturn_vdp1_regs_r(offs_t offset); uint32_t saturn_vdp1_vram_r(offs_t offset); @@ -215,18 +215,18 @@ struct stv_vdp1_poly_scanline { - int32_t x[2]; - int32_t b[2]; - int32_t g[2]; - int32_t r[2]; - int32_t db; - int32_t dg; - int32_t dr; + int32_t x[2]{}; + int32_t b[2]{}; + int32_t g[2]{}; + int32_t r[2]{}; + int32_t db = 0; + int32_t dg = 0; + int32_t dr = 0; }; struct stv_vdp1_poly_scanline_data { - int32_t sy, ey; + int32_t sy = 0, ey = 0; struct stv_vdp1_poly_scanline scanline[512]; }; @@ -234,13 +234,13 @@ struct stv_vdp2_sprite_list { - int CMDCTRL, CMDLINK, CMDPMOD, CMDCOLR, CMDSRCA, CMDSIZE, CMDGRDA; - int CMDXA, CMDYA; - int CMDXB, CMDYB; - int CMDXC, CMDYC; - int CMDXD, CMDYD; + int CMDCTRL = 0, CMDLINK = 0, CMDPMOD = 0, CMDCOLR = 0, CMDSRCA = 0, CMDSIZE = 0, CMDGRDA = 0; + int CMDXA = 0, CMDYA = 0; + int CMDXB = 0, CMDYB = 0; + int CMDXC = 0, CMDYC = 0; + int CMDXD = 0, CMDYD = 0; - int ispoly; + int ispoly = 0; } stv2_current_sprite; @@ -249,18 +249,18 @@ struct _stv_gouraud_shading { /* Gouraud shading table */ - uint16_t GA; - uint16_t GB; - uint16_t GC; - uint16_t GD; + uint16_t GA = 0; + uint16_t GB = 0; + uint16_t GC = 0; + uint16_t GD = 0; } stv_gouraud_shading; - uint16_t m_sprite_colorbank; + uint16_t m_sprite_colorbank = 0; /* VDP1 Framebuffer handling */ - int stv_sprite_priorities_used[8]; - int stv_sprite_priorities_usage_valid; - uint8_t stv_sprite_priorities_in_fb_line[512][8]; + int stv_sprite_priorities_used[8]{}; + int stv_sprite_priorities_usage_valid = 0; + uint8_t stv_sprite_priorities_in_fb_line[512][8]{}; /* VDP2 */ @@ -334,105 +334,105 @@ void stv_vdp2_exit ( void ); int stv_vdp2_start ( void ); - uint8_t m_vdpdebug_roz; + uint8_t m_vdpdebug_roz = 0; struct stv_vdp2_tilemap_capabilities { - uint8_t enabled; - uint8_t transparency; - uint8_t colour_calculation_enabled; - uint8_t colour_depth; - uint8_t alpha; - uint8_t tile_size; - uint8_t bitmap_enable; - uint8_t bitmap_size; - uint8_t bitmap_palette_number; - uint8_t bitmap_map; - uint16_t map_offset[16]; - uint8_t map_count; - - uint8_t pattern_data_size; - uint8_t character_number_supplement; - uint8_t special_priority_register; - uint8_t special_colour_control_register; - uint8_t supplementary_palette_bits; - uint8_t supplementary_character_bits; - - int16_t scrollx; - int16_t scrolly; - uint32_t incx, incy; - - uint8_t linescroll_enable; - uint8_t linescroll_interval; - uint32_t linescroll_table_address; - uint8_t vertical_linescroll_enable; - uint8_t vertical_cell_scroll_enable; - uint8_t linezoom_enable; - - uint8_t plane_size; - uint8_t colour_ram_address_offset; - uint8_t fade_control; + uint8_t enabled = 0; + uint8_t transparency = 0; + uint8_t colour_calculation_enabled = 0; + uint8_t colour_depth = 0; + uint8_t alpha = 0; + uint8_t tile_size = 0; + uint8_t bitmap_enable = 0; + uint8_t bitmap_size = 0; + uint8_t bitmap_palette_number = 0; + uint8_t bitmap_map = 0; + uint16_t map_offset[16]{}; + uint8_t map_count = 0; + + uint8_t pattern_data_size = 0; + uint8_t character_number_supplement = 0; + uint8_t special_priority_register = 0; + uint8_t special_colour_control_register = 0; + uint8_t supplementary_palette_bits = 0; + uint8_t supplementary_character_bits = 0; + + int16_t scrollx = 0; + int16_t scrolly = 0; + uint32_t incx = 0, incy = 0; + + uint8_t linescroll_enable = 0; + uint8_t linescroll_interval = 0; + uint32_t linescroll_table_address = 0; + uint8_t vertical_linescroll_enable = 0; + uint8_t vertical_cell_scroll_enable = 0; + uint8_t linezoom_enable = 0; + + uint8_t plane_size = 0; + uint8_t colour_ram_address_offset = 0; + uint8_t fade_control = 0; struct{ - uint8_t logic; - uint8_t enabled[2]; - uint8_t area[2]; + uint8_t logic = 0; + uint8_t enabled[2]{}; + uint8_t area[2]{}; }window_control; - uint8_t line_screen_enabled; - uint8_t mosaic_screen_enabled; - bool roz_mode3; + uint8_t line_screen_enabled = 0; + uint8_t mosaic_screen_enabled = 0; + bool roz_mode3 = false; - int layer_name; /* just to keep track */ + int layer_name = 0; /* just to keep track */ } stv2_current_tilemap; struct rotation_table { - int32_t xst; - int32_t yst; - int32_t zst; - int32_t dxst; - int32_t dyst; - int32_t dx; - int32_t dy; - int32_t A; - int32_t B; - int32_t C; - int32_t D; - int32_t E; - int32_t F; - int32_t px; - int32_t py; - int32_t pz; - int32_t cx; - int32_t cy; - int32_t cz; - int32_t mx; - int32_t my; - int32_t kx; - int32_t ky; - uint32_t kast; - int32_t dkast; - int32_t dkax; + int32_t xst = 0; + int32_t yst = 0; + int32_t zst = 0; + int32_t dxst = 0; + int32_t dyst = 0; + int32_t dx = 0; + int32_t dy = 0; + int32_t A = 0; + int32_t B = 0; + int32_t C = 0; + int32_t D = 0; + int32_t E = 0; + int32_t F = 0; + int32_t px = 0; + int32_t py = 0; + int32_t pz = 0; + int32_t cx = 0; + int32_t cy = 0; + int32_t cz = 0; + int32_t mx = 0; + int32_t my = 0; + int32_t kx = 0; + int32_t ky = 0; + uint32_t kast = 0; + int32_t dkast = 0; + int32_t dkax = 0; } stv_current_rotation_parameter_table; struct _stv_vdp2_layer_data_placement { - uint32_t map_offset_min; - uint32_t map_offset_max; - uint32_t tile_offset_min; - uint32_t tile_offset_max; + uint32_t map_offset_min = 0; + uint32_t map_offset_max = 0; + uint32_t tile_offset_min = 0; + uint32_t tile_offset_max = 0; } stv_vdp2_layer_data_placement; struct _stv_rbg_cache_data { - uint8_t watch_vdp2_vram_writes; - uint8_t is_cache_dirty; + uint8_t watch_vdp2_vram_writes = 0; + uint8_t is_cache_dirty = 0; - uint32_t map_offset_min[2]; - uint32_t map_offset_max[2]; - uint32_t tile_offset_min[2]; - uint32_t tile_offset_max[2]; + uint32_t map_offset_min[2]{}; + uint32_t map_offset_max[2]{}; + uint32_t tile_offset_min[2]{}; + uint32_t tile_offset_max[2]{}; struct stv_vdp2_tilemap_capabilities layer_data[2]; diff -Nru mame-0.242+dfsg.1/src/mame/includes/scramble.h mame-0.243+dfsg.1/src/mame/includes/scramble.h --- mame-0.242+dfsg.1/src/mame/includes/scramble.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/scramble.h 2022-04-29 05:37:26.000000000 +0000 @@ -139,13 +139,13 @@ inline int bit(int i,int n); void sh_init(); - uint8_t m_cavelon_bank; + uint8_t m_cavelon_bank = 0; // harem - uint8_t m_harem_decrypt_mode; - uint8_t m_harem_decrypt_bit; - uint8_t m_harem_decrypt_clk; - uint8_t m_harem_decrypt_count; + uint8_t m_harem_decrypt_mode = 0; + uint8_t m_harem_decrypt_bit = 0; + uint8_t m_harem_decrypt_clk = 0; + uint8_t m_harem_decrypt_count = 0; std::unique_ptr m_harem_decrypted_data; std::unique_ptr m_harem_decrypted_opcodes; }; diff -Nru mame-0.242+dfsg.1/src/mame/includes/segag80r.h mame-0.243+dfsg.1/src/mame/includes/segag80r.h --- mame-0.242+dfsg.1/src/mame/includes/segag80r.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/segag80r.h 2022-04-29 05:37:26.000000000 +0000 @@ -109,7 +109,7 @@ offs_t m_scrambled_write_pc = 0; - segag80_decrypt_func m_decrypt; + segag80_decrypt_func m_decrypt{}; uint8_t m_background_pcb = 0; double m_rweights[3]{}; double m_gweights[3]{}; diff -Nru mame-0.242+dfsg.1/src/mame/includes/segahang.h mame-0.243+dfsg.1/src/mame/includes/segahang.h --- mame-0.242+dfsg.1/src/mame/includes/segahang.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/segahang.h 2022-04-29 05:37:26.000000000 +0000 @@ -141,12 +141,12 @@ required_shared_ptr m_workram; // configuration - bool m_sharrier_video; + bool m_sharrier_video = false; // internal state - uint8_t m_adc_select; + uint8_t m_adc_select = 0; optional_ioport_array<4> m_adc_ports; - bool m_shadow; + bool m_shadow = false; optional_shared_ptr m_decrypted_opcodes; output_finder<2> m_lamps; }; diff -Nru mame-0.242+dfsg.1/src/mame/includes/segaorun.h mame-0.243+dfsg.1/src/mame/includes/segaorun.h --- mame-0.242+dfsg.1/src/mame/includes/segaorun.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/segaorun.h 2022-04-29 05:37:26.000000000 +0000 @@ -162,7 +162,7 @@ // internal state emu_timer * m_scanline_timer; - emu_timer * m_irq2_gen_timer; + emu_timer * m_irq2_gen_timer = nullptr; uint8_t m_irq2_state; uint8_t m_adc_select; uint8_t m_vblank_irq_state; diff -Nru mame-0.242+dfsg.1/src/mame/includes/segas16a.h mame-0.243+dfsg.1/src/mame/includes/segas16a.h --- mame-0.242+dfsg.1/src/mame/includes/segas16a.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/segas16a.h 2022-04-29 05:37:26.000000000 +0000 @@ -179,14 +179,14 @@ lamp_changed_delegate m_lamp_changed_w; // internal state - uint8_t m_video_control; - uint8_t m_mcu_control; - uint8_t m_n7751_command; - uint32_t m_n7751_rom_address; - uint8_t m_last_buttons1; - uint8_t m_last_buttons2; - uint8_t m_read_port; - uint8_t m_mj_input_num; + uint8_t m_video_control = 0; + uint8_t m_mcu_control = 0; + uint8_t m_n7751_command = 0; + uint32_t m_n7751_rom_address = 0; + uint8_t m_last_buttons1 = 0; + uint8_t m_last_buttons2 = 0; + uint8_t m_read_port = 0; + uint8_t m_mj_input_num = 0; optional_ioport_array<6> m_mj_inputs; output_finder<2> m_lamps; }; diff -Nru mame-0.242+dfsg.1/src/mame/includes/segas18.h mame-0.243+dfsg.1/src/mame/includes/segas18.h --- mame-0.242+dfsg.1/src/mame/includes/segas18.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/segas18.h 2022-04-29 05:37:26.000000000 +0000 @@ -176,14 +176,14 @@ write16sm_delegate m_custom_io_w; // internal state - int m_grayscale_enable; - int m_vdp_enable; - uint8_t m_vdp_mixing; + int m_grayscale_enable = 0; + int m_vdp_enable = 0; + uint8_t m_vdp_mixing = 0; bitmap_ind16 m_temp_bitmap; // game-specific state - uint8_t m_lghost_value; - uint8_t m_lghost_select; + uint8_t m_lghost_value = 0; + uint8_t m_lghost_select = 0; }; #endif // MAME_INCLUDES_SEGAS18_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/segas24.h mame-0.243+dfsg.1/src/mame/includes/segas24.h --- mame-0.242+dfsg.1/src/mame/includes/segas24.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/segas24.h 2022-04-29 05:37:26.000000000 +0000 @@ -94,39 +94,39 @@ static const uint8_t s_quizmeku_mlt[8]; static const uint8_t s_dcclub_mlt[8]; - uint8_t m_fdc_track_side; - uint8_t m_fdc_mode; - int m_fdc_status; - int m_fdc_track; - int m_fdc_sector; - int m_fdc_data; - int m_fdc_phys_track; - bool m_fdc_irq; - bool m_fdc_drq; - int m_fdc_span; - int m_fdc_index_count; - uint8_t *m_fdc_pt; - int m_track_size; - int m_cur_input_line; - uint8_t m_curbank; - uint8_t m_mlatch; - const uint8_t *m_mlatch_table; - - uint16_t m_irq_tdata, m_irq_tval; - uint8_t m_irq_tmode, m_irq_allow0, m_irq_allow1; - bool m_irq_timer_pend0; - bool m_irq_timer_pend1; - bool m_irq_yms; - bool m_irq_vblank; - bool m_irq_sprite; + uint8_t m_fdc_track_side = 0; + uint8_t m_fdc_mode = 0; + int m_fdc_status = 0; + int m_fdc_track = 0; + int m_fdc_sector = 0; + int m_fdc_data = 0; + int m_fdc_phys_track = 0; + bool m_fdc_irq = false; + bool m_fdc_drq = false; + int m_fdc_span = 0; + int m_fdc_index_count = 0; + uint8_t *m_fdc_pt = nullptr; + int m_track_size = 0; + int m_cur_input_line = 0; + uint8_t m_curbank = 0; + uint8_t m_mlatch = 0; + const uint8_t *m_mlatch_table = nullptr; + + uint16_t m_irq_tdata = 0, m_irq_tval = 0; + uint8_t m_irq_tmode = 0, m_irq_allow0 = 0, m_irq_allow1 = 0; + bool m_irq_timer_pend0 = false; + bool m_irq_timer_pend1 = false; + bool m_irq_yms = false; + bool m_irq_vblank = false; + bool m_irq_sprite = false; attotime m_irq_synctime, m_irq_vsynctime; required_device m_irq_timer; required_device m_irq_timer_clear; //timer_device *m_irq_frc; required_device m_frc_cnt_timer; - uint8_t m_frc_mode; + uint8_t m_frc_mode = 0; - bool m_cnt1; + bool m_cnt1 = false; required_device m_vtile; required_device m_vsprite; @@ -177,7 +177,7 @@ // game specific TIMER_CALLBACK_MEMBER(gground_hack_timer_callback); - emu_timer *m_gground_hack_timer; + emu_timer *m_gground_hack_timer = nullptr; required_ioport m_p1; required_ioport m_p2; required_ioport m_p3; diff -Nru mame-0.242+dfsg.1/src/mame/includes/segas32.h mame-0.243+dfsg.1/src/mame/includes/segas32.h --- mame-0.242+dfsg.1/src/mame/includes/segas32.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/segas32.h 2022-04-29 05:37:26.000000000 +0000 @@ -76,13 +76,13 @@ { bitmap_ind16 bitmap; std::unique_ptr transparent; - int num; + int num = 0; }; struct extents_list { - uint8_t scan_extent[256]; - uint16_t extent[32][16]; + uint8_t scan_extent[256]{}; + uint16_t extent[32][16]{}; }; @@ -231,44 +231,44 @@ optional_memory_bank m_multipcm_bank_hi; optional_memory_bank m_multipcm_bank_lo; - const bool m_is_multi32; + const bool m_is_multi32 = false; // internal states - uint8_t m_v60_irq_control[0x10]; - timer_device *m_v60_irq_timer[2]; - uint8_t m_sound_irq_control[4]; - uint8_t m_sound_irq_input; - uint8_t m_sound_dummy_value; - uint16_t m_sound_bank; + uint8_t m_v60_irq_control[0x10]{}; + timer_device *m_v60_irq_timer[2]{}; + uint8_t m_sound_irq_control[4]{}; + uint8_t m_sound_irq_input = 0; + uint8_t m_sound_dummy_value = 0; + uint16_t m_sound_bank = 0; sys32_output_callback m_sw1_output; sys32_output_callback m_sw2_output; sys32_output_callback m_sw3_output; // hardware specific std::unique_ptr m_system32_protram; - uint16_t m_arescue_dsp_io[6]; + uint16_t m_arescue_dsp_io[6]{}; // video-related - uint16_t m_system32_displayenable[2]; - uint16_t m_system32_tilebank_external; + uint16_t m_system32_displayenable[2]{}; + uint16_t m_system32_tilebank_external = 0; std::unique_ptr m_tmap_cache; - cache_entry *m_cache_head; + cache_entry *m_cache_head = nullptr; layer_info m_layer_data[11]; - uint16_t m_mixer_control[2][0x40]; + uint16_t m_mixer_control[2][0x40]{}; std::unique_ptr m_solid_0000; std::unique_ptr m_solid_ffff; - uint8_t m_sprite_render_count; - uint8_t m_sprite_control_latched[8]; - uint8_t m_sprite_control[8]; + uint8_t m_sprite_render_count = 0; + uint8_t m_sprite_control_latched[8]{}; + uint8_t m_sprite_control[8]{}; std::unique_ptr m_spriteram_32bit; std::unique_ptr m_prev_bgstartx; std::unique_ptr m_prev_bgendx; std::unique_ptr m_bgcolor_line; typedef void (segas32_state::*prot_vblank_func)(); prot_vblank_func m_system32_prot_vblank; - int m_print_count; - emu_timer *m_vblank_end_int_timer; - emu_timer *m_update_sprites_timer; + int m_print_count = 0; + emu_timer *m_vblank_end_int_timer = nullptr; + emu_timer *m_update_sprites_timer = nullptr; }; class segas32_regular_state : public segas32_state @@ -380,7 +380,7 @@ private: optional_ioport_array<8> m_analog_ports; - uint8_t m_analog_bank; + uint8_t m_analog_bank = 0; }; class sega_multi32_6player_state : public sega_multi32_state diff -Nru mame-0.242+dfsg.1/src/mame/includes/segaxbd.h mame-0.243+dfsg.1/src/mame/includes/segaxbd.h --- mame-0.242+dfsg.1/src/mame/includes/segaxbd.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/segaxbd.h 2022-04-29 05:37:26.000000000 +0000 @@ -120,28 +120,28 @@ required_shared_ptr m_subram0; // configuration - bool m_adc_reverse[8]; - uint8_t m_road_priority; + bool m_adc_reverse[8]{}; + uint8_t m_road_priority = 0; // internal state - emu_timer * m_scanline_timer; - uint8_t m_timer_irq_state; - uint8_t m_vblank_irq_state; - uint8_t m_pc_0; + emu_timer * m_scanline_timer = nullptr; + uint8_t m_timer_irq_state = 0; + uint8_t m_vblank_irq_state = 0; + uint8_t m_pc_0 = 0; // game-specific state - uint16_t * m_loffire_sync; - uint8_t m_lastsurv_mux; + uint16_t * m_loffire_sync = 0; + uint8_t m_lastsurv_mux = 0; // memory pointers required_shared_ptr m_paletteram; - bool m_gprider_hack; + bool m_gprider_hack = false; void palette_init(); - uint32_t m_palette_entries; // number of palette entries - uint8_t m_palette_normal[32]; // RGB translations for normal pixels - uint8_t m_palette_shadow[32]; // RGB translations for shadowed pixels - uint8_t m_palette_hilight[32]; // RGB translations for hilighted pixels + uint32_t m_palette_entries = 0; // number of palette entries + uint8_t m_palette_normal[32]{}; // RGB translations for normal pixels + uint8_t m_palette_shadow[32]{}; // RGB translations for shadowed pixels + uint8_t m_palette_hilight[32]{}; // RGB translations for hilighted pixels required_device m_screen; required_device m_palette; required_ioport m_io0_porta; @@ -244,7 +244,7 @@ required_device m_commram; required_device m_usart; - uint8_t m_commram_bank; + uint8_t m_commram_bank = 0; }; #endif // MAME_INCLUDES_SEGAXBD_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/segaybd.h mame-0.243+dfsg.1/src/mame/includes/segaybd.h --- mame-0.242+dfsg.1/src/mame/includes/segaybd.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/segaybd.h 2022-04-29 05:37:26.000000000 +0000 @@ -135,12 +135,12 @@ output_delegate m_output_cb2; // internal state - uint16_t m_pdrift_bank; - emu_timer * m_scanline_timer; - int m_irq2_scanline; - uint8_t m_timer_irq_state; - uint8_t m_vblank_irq_state; - uint8_t m_misc_io_data; + uint16_t m_pdrift_bank = 0; + emu_timer * m_scanline_timer = nullptr; + int m_irq2_scanline = 0; + uint8_t m_timer_irq_state = 0; + uint8_t m_vblank_irq_state = 0; + uint8_t m_misc_io_data = 0; }; #endif // MAME_INCLUDES_SEGAYBD_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/seibuspi.h mame-0.243+dfsg.1/src/mame/includes/seibuspi.h --- mame-0.242+dfsg.1/src/mame/includes/seibuspi.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/seibuspi.h 2022-04-29 05:37:26.000000000 +0000 @@ -83,37 +83,37 @@ optional_region_ptr m_soundflash1_region; - int m_z80_prg_transfer_pos; - int m_z80_lastbank; - u8 m_sb_coin_latch; - u8 m_ejsakura_input_port; - tilemap_t *m_text_layer; - tilemap_t *m_back_layer; - tilemap_t *m_midl_layer; - tilemap_t *m_fore_layer; - u32 m_video_dma_length; - u32 m_video_dma_address; - u16 m_layer_enable; - u16 m_layer_bank; - u8 m_rf2_layer_bank; - u16 m_scrollram[6]; - bool m_rowscroll_enable; - int m_midl_layer_offset; - int m_fore_layer_offset; - int m_text_layer_offset; - int m_fore_layer_d13; - int m_back_layer_d14; - int m_midl_layer_d14; - int m_fore_layer_d14; + int m_z80_prg_transfer_pos = 0; + int m_z80_lastbank = 0; + u8 m_sb_coin_latch = 0; + u8 m_ejsakura_input_port = 0; + tilemap_t *m_text_layer = nullptr; + tilemap_t *m_back_layer = nullptr; + tilemap_t *m_midl_layer = nullptr; + tilemap_t *m_fore_layer = nullptr; + u32 m_video_dma_length = 0; + u32 m_video_dma_address = 0; + u16 m_layer_enable = 0; + u16 m_layer_bank = 0; + u8 m_rf2_layer_bank = 0; + u16 m_scrollram[6]{}; + bool m_rowscroll_enable = false; + int m_midl_layer_offset = 0; + int m_fore_layer_offset = 0; + int m_text_layer_offset = 0; + int m_fore_layer_d13 = 0; + int m_back_layer_d14 = 0; + int m_midl_layer_d14 = 0; + int m_fore_layer_d14 = 0; std::unique_ptr m_tilemap_ram; std::unique_ptr m_palette_ram; std::unique_ptr m_sprite_ram; - u32 m_tilemap_ram_size; - u32 m_palette_ram_size; - u32 m_sprite_ram_size; - u32 m_bg_fore_layer_position; - u8 m_alpha_table[0x2000]; - int m_sprite_bpp; + u32 m_tilemap_ram_size = 0; + u32 m_palette_ram_size = 0; + u32 m_sprite_ram_size = 0; + u32 m_bg_fore_layer_position = 0; + u8 m_alpha_table[0x2000]{}; + int m_sprite_bpp = 0; void tile_decrypt_key_w(u16 data); void spi_layer_bank_w(offs_t offset, u16 data, u16 mem_mask = ~0); diff -Nru mame-0.242+dfsg.1/src/mame/includes/seicross.h mame-0.243+dfsg.1/src/mame/includes/seicross.h --- mame-0.242+dfsg.1/src/mame/includes/seicross.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/seicross.h 2022-04-29 05:37:26.000000000 +0000 @@ -55,9 +55,9 @@ required_shared_ptr m_spriteram2; required_shared_ptr m_colorram; - uint8_t m_portb; - tilemap_t *m_bg_tilemap; - uint8_t m_irq_mask; + uint8_t m_portb = 0; + tilemap_t *m_bg_tilemap = nullptr; + uint8_t m_irq_mask = 0; void videoram_w(offs_t offset, uint8_t data); void colorram_w(offs_t offset, uint8_t data); diff -Nru mame-0.242+dfsg.1/src/mame/includes/shadfrce.h mame-0.243+dfsg.1/src/mame/includes/shadfrce.h --- mame-0.242+dfsg.1/src/mame/includes/shadfrce.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/shadfrce.h 2022-04-29 05:37:26.000000000 +0000 @@ -67,15 +67,15 @@ required_shared_ptr m_spvideoram; std::unique_ptr m_spvideoram_old; - tilemap_t *m_fgtilemap; - tilemap_t *m_bg0tilemap; - tilemap_t *m_bg1tilemap; - int m_video_enable; - int m_irqs_enable; - int m_raster_scanline; - int m_raster_irq_enable; - int m_vblank; - int m_prev_value; + tilemap_t *m_fgtilemap = nullptr; + tilemap_t *m_bg0tilemap = nullptr; + tilemap_t *m_bg1tilemap = nullptr; + int m_video_enable = 0; + int m_irqs_enable = 0; + int m_raster_scanline = 0; + int m_raster_irq_enable = 0; + int m_vblank = 0; + int m_prev_value = 0; void flip_screen(uint16_t data); uint16_t input_ports_r(offs_t offset); diff -Nru mame-0.242+dfsg.1/src/mame/includes/shangha3.h mame-0.243+dfsg.1/src/mame/includes/shangha3.h --- mame-0.242+dfsg.1/src/mame/includes/shangha3.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/shangha3.h 2022-04-29 05:37:26.000000000 +0000 @@ -53,11 +53,11 @@ optional_memory_bank m_okibank; // driver init configuration - int m_do_shadows; - uint8_t m_drawmode_table[16]; + int m_do_shadows = 0; + uint8_t m_drawmode_table[16]{}; - int m_prot_count; - uint16_t m_gfxlist_addr; + int m_prot_count = 0; + uint16_t m_gfxlist_addr = 0; bitmap_ind16 m_rawbitmap; // common diff -Nru mame-0.242+dfsg.1/src/mame/includes/shisen.h mame-0.243+dfsg.1/src/mame/includes/shisen.h --- mame-0.242+dfsg.1/src/mame/includes/shisen.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/shisen.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,56 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Nicola Salmoria -#ifndef MAME_INCLUDES_SHISEN_H -#define MAME_INCLUDES_SHISEN_H - -#pragma once - -#include "audio/m72.h" -#include "emupal.h" -#include "tilemap.h" - -class shisen_state : public driver_device -{ -public: - shisen_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_audio(*this, "m72"), - m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette"), - m_paletteram(*this, "paletteram"), - m_videoram(*this, "videoram") - { } - - void shisen(machine_config &config); - -private: - required_device m_maincpu; - required_device m_audio; - required_device m_gfxdecode; - required_device m_palette; - - required_shared_ptr m_paletteram; - required_shared_ptr m_videoram; - - int m_gfxbank = 0; - tilemap_t *m_bg_tilemap = nullptr; - - void coin_w(uint8_t data); - void videoram_w(offs_t offset, uint8_t data); - void bankswitch_w(uint8_t data); - void paletteram_w(offs_t offset, uint8_t data); - - TILE_GET_INFO_MEMBER(get_bg_tile_info); - - virtual void video_start() override; - - uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - - void shisen_io_map(address_map &map); - void shisen_map(address_map &map); - void shisen_sound_io_map(address_map &map); - void shisen_sound_map(address_map &map); -}; - -#endif // MAME_INCLUDES_SHISEN_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/shuuz.h mame-0.243+dfsg.1/src/mame/includes/shuuz.h --- mame-0.242+dfsg.1/src/mame/includes/shuuz.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/shuuz.h 2022-04-29 05:37:26.000000000 +0000 @@ -48,7 +48,7 @@ required_device m_screen; required_device m_vad; - int m_cur[2]; + int m_cur[2]{}; static const atari_motion_objects_config s_mob_config; }; diff -Nru mame-0.242+dfsg.1/src/mame/includes/silkroad.h mame-0.243+dfsg.1/src/mame/includes/silkroad.h --- mame-0.242+dfsg.1/src/mame/includes/silkroad.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/silkroad.h 2022-04-29 05:37:26.000000000 +0000 @@ -40,7 +40,7 @@ required_memory_bank m_okibank; - tilemap_t *m_tilemap[3]; + tilemap_t *m_tilemap[3]{}; void coin_w(uint8_t data); template void vram_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0); diff -Nru mame-0.242+dfsg.1/src/mame/includes/skykid.h mame-0.243+dfsg.1/src/mame/includes/skykid.h --- mame-0.242+dfsg.1/src/mame/includes/skykid.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/skykid.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,80 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Manuel Abadia -#ifndef MAME_INCLUDES_SKYKID_H -#define MAME_INCLUDES_SKYKID_H - -#pragma once - -#include "cpu/m6800/m6801.h" -#include "sound/namco.h" -#include "emupal.h" -#include "tilemap.h" - -class skykid_state : public driver_device -{ -public: - skykid_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag) - , m_videoram(*this, "videoram") - , m_textram(*this, "textram") - , m_spriteram(*this, "spriteram") - , m_maincpu(*this, "maincpu") - , m_mcu(*this, "mcu") - , m_cus30(*this, "namco") - , m_gfxdecode(*this, "gfxdecode") - , m_palette(*this, "palette") - , m_leds(*this, "led%u", 0U) - { } - - void skykid(machine_config &config); - - void init_skykid(); - -private: - void inputport_select_w(uint8_t data); - uint8_t inputport_r(); - void skykid_led_w(uint8_t data); - void skykid_subreset_w(offs_t offset, uint8_t data); - void skykid_bankswitch_w(offs_t offset, uint8_t data); - void skykid_irq_1_ctrl_w(offs_t offset, uint8_t data); - void skykid_irq_2_ctrl_w(offs_t offset, uint8_t data); - uint8_t skykid_videoram_r(offs_t offset); - void skykid_videoram_w(offs_t offset, uint8_t data); - uint8_t skykid_textram_r(offs_t offset); - void skykid_textram_w(offs_t offset, uint8_t data); - void skykid_scroll_x_w(offs_t offset, uint8_t data); - void skykid_scroll_y_w(offs_t offset, uint8_t data); - void skykid_flipscreen_priority_w(offs_t offset, uint8_t data); - TILEMAP_MAPPER_MEMBER(tx_tilemap_scan); - TILE_GET_INFO_MEMBER(tx_get_tile_info); - TILE_GET_INFO_MEMBER(bg_get_tile_info); - void skykid_palette(palette_device &palette) const; - uint32_t screen_update_skykid(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - DECLARE_WRITE_LINE_MEMBER(vblank_irq); - void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect); - void mcu_map(address_map &map); - void skykid_map(address_map &map); - - virtual void machine_start() override; - virtual void video_start() override; - - uint8_t m_inputport_selected = 0; - required_shared_ptr m_videoram; - required_shared_ptr m_textram; - required_shared_ptr m_spriteram; - required_device m_maincpu; - required_device m_mcu; - required_device m_cus30; - required_device m_gfxdecode; - required_device m_palette; - output_finder<2> m_leds; - tilemap_t *m_bg_tilemap = nullptr; - tilemap_t *m_tx_tilemap = nullptr; - uint8_t m_priority = 0; - uint16_t m_scroll_x = 0; - uint16_t m_scroll_y = 0; - uint8_t m_main_irq_mask = 0; - uint8_t m_mcu_irq_mask = 0; -}; - -#endif // MAME_INCLUDES_SKYKID_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/slapshot.h mame-0.243+dfsg.1/src/mame/includes/slapshot.h --- mame-0.242+dfsg.1/src/mame/includes/slapshot.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/slapshot.h 2022-04-29 05:37:26.000000000 +0000 @@ -53,12 +53,12 @@ private: struct slapshot_tempsprite { - u8 gfx; - u32 code,color; - bool flipx,flipy; - int x,y; - int zoomx,zoomy; - u32 primask; + u8 gfx = 0; + u32 code = 0, color = 0; + bool flipx = false, flipy = false; + int x = 0, y = 0; + int zoomx = 0, zoomy = 0; + u32 primask = 0; }; /* devices */ @@ -82,17 +82,17 @@ /* video-related */ std::unique_ptr m_spritelist; - bool m_sprites_disabled; - s32 m_sprites_active_area; - s32 m_sprites_master_scrollx; - s32 m_sprites_master_scrolly; - bool m_sprites_flipscreen; - bool m_prepare_sprites; + bool m_sprites_disabled = false; + s32 m_sprites_active_area = 0; + s32 m_sprites_master_scrollx = 0; + s32 m_sprites_master_scrolly = 0; + bool m_sprites_flipscreen = false; + bool m_prepare_sprites = false; #ifdef MAME_DEBUG int m_dislayer[5] = { 0, 0, 0, 0, 0 }; #endif - emu_timer *m_int6_timer; + emu_timer *m_int6_timer = nullptr; std::unique_ptr m_decoded_gfx; // generic diff -Nru mame-0.242+dfsg.1/src/mame/includes/snk.h mame-0.243+dfsg.1/src/mame/includes/snk.h --- mame-0.242+dfsg.1/src/mame/includes/snk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/snk.h 2022-04-29 05:37:26.000000000 +0000 @@ -93,39 +93,39 @@ optional_ioport m_joymode_io; optional_ioport m_bonus_io; - int m_countryc_trackball; - int m_last_value[2]; - int m_cp_count[2]; + int m_countryc_trackball = 0; + int m_last_value[2]{}; + int m_cp_count[2]{}; // FIXME this should be initialised on machine reset - int m_sound_status; + int m_sound_status = 0; - tilemap_t *m_tx_tilemap; - tilemap_t *m_fg_tilemap; - tilemap_t *m_bg_tilemap; - int m_fg_scrollx; - int m_fg_scrolly; - int m_bg_scrollx; - int m_bg_scrolly; - int m_sp16_scrollx; - int m_sp16_scrolly; - int m_sp32_scrollx; - int m_sp32_scrolly; - uint8_t m_sprite_split_point; - int m_num_sprites; - int m_yscroll_mask; - uint32_t m_bg_tile_offset; - uint32_t m_tx_tile_offset; - int m_is_psychos; + tilemap_t *m_tx_tilemap = nullptr; + tilemap_t *m_fg_tilemap = nullptr; + tilemap_t *m_bg_tilemap = nullptr; + int m_fg_scrollx = 0; + int m_fg_scrolly = 0; + int m_bg_scrollx = 0; + int m_bg_scrolly = 0; + int m_sp16_scrollx = 0; + int m_sp16_scrolly = 0; + int m_sp32_scrollx = 0; + int m_sp32_scrolly = 0; + uint8_t m_sprite_split_point = 0; + int m_num_sprites = 0; + int m_yscroll_mask = 0; + uint32_t m_bg_tile_offset = 0; + uint32_t m_tx_tile_offset = 0; + int m_is_psychos = 0; - uint8_t m_drawmode_table[16]; - uint8_t m_empty_tile[16*16]; - int m_hf_posy; - int m_hf_posx; - int m_tc16_posy; - int m_tc16_posx; - int m_tc32_posy; - int m_tc32_posx; + uint8_t m_drawmode_table[16]{}; + uint8_t m_empty_tile[16*16]{}; + int m_hf_posy = 0; + int m_hf_posx = 0; + int m_tc16_posy = 0; + int m_tc16_posx = 0; + int m_tc32_posy = 0; + int m_tc32_posx = 0; uint8_t snk_cpuA_nmi_trigger_r(); void snk_cpuA_nmi_ack_w(uint8_t data); uint8_t snk_cpuB_nmi_trigger_r(); diff -Nru mame-0.242+dfsg.1/src/mame/includes/sorcerer.h mame-0.243+dfsg.1/src/mame/includes/sorcerer.h --- mame-0.242+dfsg.1/src/mame/includes/sorcerer.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/sorcerer.h 2022-04-29 05:37:26.000000000 +0000 @@ -37,14 +37,14 @@ struct cass_data_t { struct { - int length; // time cassette level is at input.level - int level; // cassette level - int bit; // bit being read + int length = 0; // time cassette level is at input.level + int level = 0; // cassette level + int bit = 0; // bit being read } input; struct { - int length; // time cassette level is at output.level - int level; // cassette level - int bit; // bit to output + int length = 0; // time cassette level is at output.level + int level = 0; // cassette level + int bit = 0; // bit to output } output; }; @@ -111,8 +111,8 @@ u8 m_portfe = 0U; u8 m_keyboard_line = 0U; - emu_timer *m_serial_timer; - emu_timer *m_cassette_timer; + emu_timer *m_serial_timer = nullptr; + emu_timer *m_cassette_timer = nullptr; cass_data_t m_cass_data; virtual void device_timer(emu_timer &timer, device_timer_id id, int param) override; required_device m_maincpu; @@ -145,8 +145,8 @@ memory_passthrough_handler m_rom_shadow_tap; private: - u8 m_port48; - u8 m_port34; + u8 m_port48 = 0; + u8 m_port34 = 0; u8 port34_r(); u8 port48_r(); void port34_w(u8 data); @@ -180,9 +180,9 @@ void intrq2_w(bool state); void drq2_w(bool state); u8 m_port2c = 0U; - bool m_wait = 0; - bool m_drq_off = 0; - bool m_intrq_off = 0; + bool m_wait = false; + bool m_drq_off = false; + bool m_intrq_off = false; virtual void machine_start() override; virtual void machine_reset() override; optional_device m_fdc; diff -Nru mame-0.242+dfsg.1/src/mame/includes/spdodgeb.h mame-0.243+dfsg.1/src/mame/includes/spdodgeb.h --- mame-0.242+dfsg.1/src/mame/includes/spdodgeb.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/spdodgeb.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,101 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Paul Hampson, Nicola Salmoria -/************************************************************************* - - Super Dodge Ball hardware - -*************************************************************************/ -#ifndef MAME_INCLUDES_SPDODGEB_H -#define MAME_INCLUDES_SPDODGEB_H - -#pragma once - -#include "machine/gen_latch.h" -#include "machine/timer.h" -#include "sound/msm5205.h" -#include "emupal.h" -#include "screen.h" -#include "tilemap.h" - -class spdodgeb_state : public driver_device -{ -public: - spdodgeb_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_mcu(*this, "mcu"), - m_msm1(*this, "msm1"), - m_msm2(*this, "msm2"), - m_gfxdecode(*this, "gfxdecode"), - m_screen(*this, "screen"), - m_palette(*this, "palette"), - m_soundlatch(*this, "soundlatch"), - m_videoram(*this, "videoram"), - m_spriteram(*this, "spriteram") - { } - - void spdodgeb(machine_config &config); - - DECLARE_READ_LINE_MEMBER(mcu_busy_r); - -protected: - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; - -private: - required_device m_maincpu; - required_device m_audiocpu; - required_device m_mcu; - required_device m_msm1; - required_device m_msm2; - required_device m_gfxdecode; - required_device m_screen; - required_device m_palette; - required_device m_soundlatch; - - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; - - int m_adpcm_pos[2]{}; - int m_adpcm_end[2]{}; - int m_adpcm_idle[2]{}; - int m_adpcm_data[2]{}; - uint8_t m_mcu_status = 0; - uint8_t m_inputs[5]{}; - - int m_tile_palbank = 0; - int m_sprite_palbank = 0; - tilemap_t *m_bg_tilemap = nullptr; - int m_lastscroll = 0; - - void spd_adpcm_w(offs_t offset, uint8_t data); - uint8_t mcu63701_r(offs_t offset); - void mcu_data_w(offs_t offset, uint8_t data); - void mcu_status_w(uint8_t data); - void mcu_nmi_w(uint8_t data); - - void scrollx_lo_w(uint8_t data); - void ctrl_w(uint8_t data); - void videoram_w(offs_t offset, uint8_t data); - DECLARE_WRITE_LINE_MEMBER(spd_adpcm_int_1); - DECLARE_WRITE_LINE_MEMBER(spd_adpcm_int_2); - - TILEMAP_MAPPER_MEMBER(background_scan); - TILE_GET_INFO_MEMBER(get_bg_tile_info); - - void spdodgeb_palette(palette_device &palette) const; - - uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect ); - - TIMER_DEVICE_CALLBACK_MEMBER(interrupt); - - void spd_adpcm_int(msm5205_device *device, int chip); - void spdodgeb_map(address_map &map); - void spdodgeb_sound_map(address_map &map); - void mcu_map(address_map &map); -}; - -#endif // MAME_INCLUDES_SPDODGEB_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/special.h mame-0.243+dfsg.1/src/mame/includes/special.h --- mame-0.242+dfsg.1/src/mame/includes/special.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/special.h 2022-04-29 05:37:26.000000000 +0000 @@ -110,16 +110,16 @@ void specimx_mem(address_map &map); std::unique_ptr m_specimx_colorram; - uint8_t m_erik_color_1; - uint8_t m_erik_color_2; - uint8_t m_erik_background; - uint8_t m_specimx_color; - u8 m_porta; - u8 m_portb; - u8 m_portc; - uint8_t m_RR_register; - uint8_t m_RC_register; - u8 m_drive; + uint8_t m_erik_color_1 = 0; + uint8_t m_erik_color_2 = 0; + uint8_t m_erik_background = 0; + uint8_t m_specimx_color = 0; + u8 m_porta = 0; + u8 m_portb = 0; + u8 m_portc = 0; + uint8_t m_RR_register = 0; + uint8_t m_RC_register = 0; + u8 m_drive = 0; required_device m_maincpu; optional_device m_ppi; optional_device m_fdc; diff -Nru mame-0.242+dfsg.1/src/mame/includes/spectrum.h mame-0.243+dfsg.1/src/mame/includes/spectrum.h --- mame-0.242+dfsg.1/src/mame/includes/spectrum.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/spectrum.h 2022-04-29 05:37:26.000000000 +0000 @@ -52,6 +52,7 @@ spectrum_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_video_ram(*this, "video_ram"), + m_scanline_timer(nullptr), m_maincpu(*this, "maincpu"), m_screen(*this, "screen"), m_cassette(*this, "cassette"), @@ -113,7 +114,7 @@ optional_shared_ptr m_video_ram; uint8_t *m_screen_location; - int m_ROMSelection; + int m_ROMSelection = 0; // FIXME: this is used for various things in derived classes, but not by this base class, and should be removed // Build up the screen bitmap line-by-line as the z80 uses CPU cycles. // Eliminates sprite flicker on various games (E.g. Marauder and diff -Nru mame-0.242+dfsg.1/src/mame/includes/speedspn.h mame-0.243+dfsg.1/src/mame/includes/speedspn.h --- mame-0.242+dfsg.1/src/mame/includes/speedspn.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/speedspn.h 2022-04-29 05:37:26.000000000 +0000 @@ -44,9 +44,9 @@ required_memory_bank m_okibank; required_shared_ptr m_attram; - tilemap_t *m_tilemap; - bool m_display_disable; - uint32_t m_bank_vidram; + tilemap_t *m_tilemap = nullptr; + bool m_display_disable = false; + uint32_t m_bank_vidram = 0; std::vector m_vidram; uint8_t irq_ack_r(); void rombank_w(uint8_t data); diff -Nru mame-0.242+dfsg.1/src/mame/includes/sprint2.h mame-0.243+dfsg.1/src/mame/includes/sprint2.h --- mame-0.242+dfsg.1/src/mame/includes/sprint2.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/sprint2.h 2022-04-29 05:37:26.000000000 +0000 @@ -80,13 +80,13 @@ required_ioport m_dsw; output_finder<2> m_gear_sel; - uint8_t m_steering[2]; - uint8_t m_gear[2]; - uint8_t m_game; - uint8_t m_dial[2]; - tilemap_t* m_bg_tilemap; + uint8_t m_steering[2]{}; + uint8_t m_gear[2]{}; + uint8_t m_game = 0; + uint8_t m_dial[2]{}; + tilemap_t* m_bg_tilemap = nullptr; bitmap_ind16 m_helper; - uint8_t m_collision[2]; + uint8_t m_collision[2]{}; uint8_t wram_r(offs_t offset); uint8_t dip_r(offs_t offset); diff -Nru mame-0.242+dfsg.1/src/mame/includes/srmp2.h mame-0.243+dfsg.1/src/mame/includes/srmp2.h --- mame-0.242+dfsg.1/src/mame/includes/srmp2.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/srmp2.h 2022-04-29 05:37:26.000000000 +0000 @@ -14,10 +14,10 @@ public: struct iox_t { - int reset,ff_event,ff_1,protcheck[4],protlatch[4]; - uint8_t data; - uint8_t mux; - uint8_t ff; + int reset = 0, ff_event,ff_1 = 0, protcheck[4]{}, protlatch[4]{}; + uint8_t data = 0; + uint8_t mux = 0; + uint8_t ff = 0; }; srmp2_state(const machine_config &mconfig, device_type type, const char *tag) : @@ -41,12 +41,12 @@ required_region_ptr m_adpcm_rom; optional_memory_bank m_mainbank; - uint8_t m_color_bank; - uint8_t m_gfx_bank; - uint8_t m_adpcm_bank; - int16_t m_adpcm_data; - uint32_t m_adpcm_sptr; - uint32_t m_adpcm_eptr; + uint8_t m_color_bank = 0; + uint8_t m_gfx_bank = 0; + uint8_t m_adpcm_bank = 0; + int16_t m_adpcm_data = 0; + uint32_t m_adpcm_sptr = 0; + uint32_t m_adpcm_eptr = 0; iox_t m_iox; // common diff -Nru mame-0.242+dfsg.1/src/mame/includes/stactics.h mame-0.243+dfsg.1/src/mame/includes/stactics.h --- mame-0.242+dfsg.1/src/mame/includes/stactics.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/stactics.h 2022-04-29 05:37:26.000000000 +0000 @@ -110,21 +110,21 @@ required_ioport m_fake; /* machine state */ - int m_vert_pos; - int m_horiz_pos; - bool m_motor_on; + int m_vert_pos = 0; + int m_horiz_pos = 0; + bool m_motor_on = false; /* video state */ - uint8_t m_y_scroll_d; - uint8_t m_y_scroll_e; - uint8_t m_y_scroll_f; - uint8_t m_frame_count; - uint8_t m_shot_standby; - uint8_t m_shot_arrive; - uint16_t m_beam_state; - uint16_t m_old_beam_state; - uint16_t m_beam_states_per_frame; - uint8_t m_palette_bank; + uint8_t m_y_scroll_d = 0; + uint8_t m_y_scroll_e = 0; + uint8_t m_y_scroll_f = 0; + uint8_t m_frame_count = 0; + uint8_t m_shot_standby = 0; + uint8_t m_shot_arrive = 0; + uint16_t m_beam_state = 0; + uint16_t m_old_beam_state = 0; + uint16_t m_beam_states_per_frame = 0; + uint8_t m_palette_bank = 0; }; #endif // MAME_INCLUDES_STACTICS_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/stadhero.h mame-0.243+dfsg.1/src/mame/includes/stadhero.h --- mame-0.242+dfsg.1/src/mame/includes/stadhero.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/stadhero.h 2022-04-29 05:37:26.000000000 +0000 @@ -41,7 +41,7 @@ required_ioport m_coin; - tilemap_t *m_pf1_tilemap; + tilemap_t *m_pf1_tilemap = nullptr; void int_ack_w(uint16_t data); void pf1_data_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); diff -Nru mame-0.242+dfsg.1/src/mame/includes/starwars.h mame-0.243+dfsg.1/src/mame/includes/starwars.h --- mame-0.242+dfsg.1/src/mame/includes/starwars.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/starwars.h 2022-04-29 05:37:26.000000000 +0000 @@ -57,21 +57,21 @@ optional_device m_slapstic; optional_memory_bank m_slapstic_bank; - int m_MPA; - int m_BIC; - uint16_t m_dvd_shift; - uint16_t m_quotient_shift; - uint16_t m_divisor; - uint16_t m_dividend; + int m_MPA = 0; + int m_BIC = 0; + uint16_t m_dvd_shift = 0; + uint16_t m_quotient_shift = 0; + uint16_t m_divisor = 0; + uint16_t m_dividend = 0; std::unique_ptr m_PROM_STR; std::unique_ptr m_PROM_MAS; std::unique_ptr m_PROM_AM; - int m_math_run; - emu_timer *m_math_timer; - int16_t m_A; - int16_t m_B; - int16_t m_C; - int32_t m_ACC; + int m_math_run = 0; + emu_timer *m_math_timer = nullptr; + int16_t m_A = 0; + int16_t m_B = 0; + int16_t m_C = 0; + int32_t m_ACC = 0; void irq_ack_w(uint8_t data); void starwars_nstore_w(uint8_t data); DECLARE_WRITE_LINE_MEMBER(recall_w); diff -Nru mame-0.242+dfsg.1/src/mame/includes/stfight.h mame-0.243+dfsg.1/src/mame/includes/stfight.h --- mame-0.242+dfsg.1/src/mame/includes/stfight.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/stfight.h 2022-04-29 05:37:26.000000000 +0000 @@ -94,20 +94,20 @@ required_region_ptr m_samples; optional_shared_ptr m_decrypted_opcodes; - uint8_t m_coin_state; + uint8_t m_coin_state = 0; - uint8_t m_fm_data; + uint8_t m_fm_data = 0; - bool m_cpu_to_mcu_empty; - uint8_t m_cpu_to_mcu_data; - uint8_t m_port_a_out; - uint8_t m_port_c_out; + bool m_cpu_to_mcu_empty = false; + uint8_t m_cpu_to_mcu_data = 0; + uint8_t m_port_a_out = 0; + uint8_t m_port_c_out = 0; - bool m_vck2; - bool m_adpcm_reset; - uint16_t m_adpcm_data_offs; + bool m_vck2 = false; + bool m_adpcm_reset = false; + uint16_t m_adpcm_data_offs = 0; - emu_timer *m_int1_timer; + emu_timer *m_int1_timer = nullptr; }; #endif // MAME_INCLUDES_STFIGHT_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/stv.h mame-0.243+dfsg.1/src/mame/includes/stv.h --- mame-0.242+dfsg.1/src/mame/includes/stv.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/stv.h 2022-04-29 05:37:26.000000000 +0000 @@ -126,16 +126,16 @@ void batmanfr_sound_comms_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0); optional_device m_rax; - uint8_t m_port_sel,m_mux_data; - uint8_t m_system_output; - uint8_t m_ioga_mode; - uint8_t m_ioga_portg; - uint16_t m_ioga_count[4]; - uint16_t m_serial_tx; + uint8_t m_port_sel,m_mux_data = 0; + uint8_t m_system_output = 0; + uint8_t m_ioga_mode = 0; + uint8_t m_ioga_portg = 0; + uint16_t m_ioga_count[4]{}; + uint16_t m_serial_tx = 0; // protection specific variables and functions - uint32_t m_abus_protenable; - uint32_t m_abus_protkey; + uint32_t m_abus_protenable = 0; + uint32_t m_abus_protkey = 0; uint32_t decathlt_prot_r(offs_t offset, uint32_t mem_mask = ~0); void sega5838_map(address_map &map); @@ -144,7 +144,7 @@ int m_protbankval; // debug helper only, doesn't need saving void decathlt_prot_srcaddr_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0); - uint32_t m_a_bus[4]; + uint32_t m_a_bus[4]{}; uint32_t common_prot_r(offs_t offset); void common_prot_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0); @@ -169,7 +169,7 @@ void pdr1_output_w(uint8_t data); void pdr2_output_w(uint8_t data); void stv_select_game(int gameno); - uint8_t m_prev_gamebank_select; + uint8_t m_prev_gamebank_select = 0; void sound_mem(address_map &map); void scsp_mem(address_map &map); diff -Nru mame-0.242+dfsg.1/src/mame/includes/suna16.h mame-0.243+dfsg.1/src/mame/includes/suna16.h --- mame-0.242+dfsg.1/src/mame/includes/suna16.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/suna16.h 2022-04-29 05:37:26.000000000 +0000 @@ -62,6 +62,7 @@ virtual void video_start() override; DECLARE_MACHINE_START(bestbest); DECLARE_MACHINE_START(bssoccer); + DECLARE_MACHINE_START(sunaq); DECLARE_MACHINE_START(uballoon); DECLARE_MACHINE_RESET(uballoon); @@ -103,6 +104,6 @@ output_finder<4> m_leds; std::unique_ptr m_paletteram; - int m_color_bank; - uint8_t m_prot; + int m_color_bank = 0; + uint8_t m_prot = 0; }; diff -Nru mame-0.242+dfsg.1/src/mame/includes/suna8.h mame-0.243+dfsg.1/src/mame/includes/suna8.h --- mame-0.242+dfsg.1/src/mame/includes/suna8.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/suna8.h 2022-04-29 05:37:26.000000000 +0000 @@ -195,29 +195,29 @@ std::unique_ptr m_decrypt; - uint8_t m_rombank; // all - uint8_t m_rombank_latch; // sparkman and starfigh - uint8_t m_spritebank; // all - uint8_t m_palettebank; // all brickzn sets - uint8_t m_paletteram_enab; // only brickzn newer sets (no 1.1) - uint8_t m_prot2; // only brickzn newer sets (no 1.1) - uint8_t m_prot2_prev; // only brickzn newer sets (no 1.1) - - uint8_t m_protection_val; // hardhead and brickzn newer sets (no 1.1) - uint8_t m_nmi_enable; // hardhea2, sparkman and starfigh - uint8_t m_spritebank_latch; // sparkman and starfigh - uint8_t m_write_disable; // only sparkman - uint8_t m_prot_opcode_toggle; // only brickzn newer sets (no 1.1) - uint8_t m_remap_sound; // only brickzn newer sets (no 1.1) + uint8_t m_rombank = 0; // all + uint8_t m_rombank_latch = 0; // sparkman and starfigh + uint8_t m_spritebank = 0; // all + uint8_t m_palettebank = 0; // all brickzn sets + uint8_t m_paletteram_enab = 0; // only brickzn newer sets (no 1.1) + uint8_t m_prot2 = 0; // only brickzn newer sets (no 1.1) + uint8_t m_prot2_prev = 0; // only brickzn newer sets (no 1.1) + + uint8_t m_protection_val = 0; // hardhead and brickzn newer sets (no 1.1) + uint8_t m_nmi_enable = 0; // hardhea2, sparkman and starfigh + uint8_t m_spritebank_latch = 0; // sparkman and starfigh + uint8_t m_write_disable = 0; // only sparkman + uint8_t m_prot_opcode_toggle = 0; // only brickzn newer sets (no 1.1) + uint8_t m_remap_sound = 0; // only brickzn newer sets (no 1.1) - uint8_t m_gfxbank; // only starfigh + uint8_t m_gfxbank = 0; // only starfigh - bool m_has_text; // has text sprites (older games) + bool m_has_text = false; // has text sprites (older games) // samples std::unique_ptr m_samplebuf; - uint8_t m_sample, m_play; - int m_numsamples; + uint8_t m_sample = 0, m_play = 0; + int m_numsamples = 0; }; #endif // MAME_INCLUDES_SUNA8_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/super6.h mame-0.243+dfsg.1/src/mame/includes/super6.h --- mame-0.242+dfsg.1/src/mame/includes/super6.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/super6.h 2022-04-29 05:37:26.000000000 +0000 @@ -83,9 +83,9 @@ required_ioport m_j7; // memory state - uint8_t m_s100; - uint8_t m_bank0; - uint8_t m_bank1; + uint8_t m_s100 = 0; + uint8_t m_bank0 = 0; + uint8_t m_bank1 = 0; }; #endif // MAME_INCLUDES_SUPER6_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/super80.h mame-0.243+dfsg.1/src/mame/includes/super80.h --- mame-0.242+dfsg.1/src/mame/includes/super80.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/super80.h 2022-04-29 05:37:26.000000000 +0000 @@ -76,7 +76,7 @@ u8 m_cass_data[4]{}; u8 m_key_pressed = 0U; u8 m_last_data = 0U; - bool m_boot_in_progress = 0; + bool m_boot_in_progress = false; void super80m_palette(palette_device &palette) const; TIMER_DEVICE_CALLBACK_MEMBER(timer_k); TIMER_DEVICE_CALLBACK_MEMBER(kansas_r); @@ -117,9 +117,9 @@ void super80e_io(address_map &map); void super80m_map(address_map &map); - u8 m_int_sw; - u16 m_vidpg; - bool m_current_charset; + u8 m_int_sw = 0; + u16 m_vidpg = 0; + bool m_current_charset = false; }; diff -Nru mame-0.242+dfsg.1/src/mame/includes/superchs.h mame-0.243+dfsg.1/src/mame/includes/superchs.h --- mame-0.242+dfsg.1/src/mame/includes/superchs.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/superchs.h 2022-04-29 05:37:26.000000000 +0000 @@ -37,12 +37,12 @@ private: struct schs_tempsprite { - u8 gfx; - u32 code,color; - bool flipx,flipy; - int x,y; - int zoomx,zoomy; - u32 primask; + u8 gfx = 0; + u32 code = 0, color = 0; + bool flipx = 0, flipy = 0; + int x = 0, y = 0; + int zoomx = 0, zoomy = 0; + u32 primask = 0; }; required_shared_ptr m_ram; diff -Nru mame-0.242+dfsg.1/src/mame/includes/suprnova.h mame-0.243+dfsg.1/src/mame/includes/suprnova.h --- mame-0.242+dfsg.1/src/mame/includes/suprnova.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/suprnova.h 2022-04-29 05:37:26.000000000 +0000 @@ -71,17 +71,17 @@ private: struct hit_t { - uint16_t x1p, y1p, z1p, x1s, y1s, z1s; - uint16_t x2p, y2p, z2p, x2s, y2s, z2s; - uint16_t org; + uint16_t x1p = 0, y1p = 0, z1p = 0, x1s = 0, y1s = 0, z1s = 0; + uint16_t x2p = 0, y2p = 0, z2p = 0, x2s = 0, y2s = 0, z2s = 0; + uint16_t org = 0; - uint16_t x1_p1, x1_p2, y1_p1, y1_p2, z1_p1, z1_p2; - uint16_t x2_p1, x2_p2, y2_p1, y2_p2, z2_p1, z2_p2; - uint16_t x1tox2, y1toy2, z1toz2; - int16_t x_in, y_in, z_in; - uint16_t flag; + uint16_t x1_p1 = 0, x1_p2 = 0, y1_p1 = 0, y1_p2 = 0, z1_p1 = 0, z1_p2 = 0; + uint16_t x2_p1 = 0, x2_p2 = 0, y2_p1 = 0, y2_p2 = 0, z2_p1 = 0, z2_p2 = 0; + uint16_t x1tox2 = 0, y1toy2 = 0, z1toz2 = 0; + int16_t x_in = 0, y_in = 0, z_in = 0; + uint16_t flag = 0; - uint8_t disconnect; + uint8_t disconnect = 0; }; required_device m_maincpu; diff -Nru mame-0.242+dfsg.1/src/mame/includes/surpratk.h mame-0.243+dfsg.1/src/mame/includes/surpratk.h --- mame-0.242+dfsg.1/src/mame/includes/surpratk.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/surpratk.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,63 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Nicola Salmoria -/************************************************************************* - - Surprise Attack - -*************************************************************************/ -#ifndef MAME_INCLUDES_SURPRATK_H -#define MAME_INCLUDES_SURPRATK_H - -#pragma once - -#include "cpu/m6809/konami.h" /* for the callback and the firq irq definition */ -#include "machine/bankdev.h" -#include "video/k052109.h" -#include "video/k053244_k053245.h" -#include "video/k053251.h" -#include "video/konami_helper.h" -#include "emupal.h" - -class surpratk_state : public driver_device -{ -public: - surpratk_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_bank0000(*this, "bank0000"), - m_k052109(*this, "k052109"), - m_k053244(*this, "k053244"), - m_k053251(*this, "k053251"), - m_palette(*this, "palette") - { } - - void surpratk(machine_config &config); - -private: - /* video-related */ - int m_layer_colorbase[3]{}; - int m_sprite_colorbase = 0; - int m_layerpri[3]{}; - - /* devices */ - required_device m_maincpu; - required_device m_bank0000; - required_device m_k052109; - required_device m_k053244; - required_device m_k053251; - required_device m_palette; - - void surpratk_videobank_w(uint8_t data); - void surpratk_5fc0_w(uint8_t data); - virtual void machine_start() override; - virtual void machine_reset() override; - uint32_t screen_update_surpratk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - - K05324X_CB_MEMBER(sprite_callback); - K052109_CB_MEMBER(tile_callback); - void banking_callback(uint8_t data); - void bank0000_map(address_map &map); - void surpratk_map(address_map &map); -}; - -#endif // MAME_INCLUDES_SURPRATK_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/svision.h mame-0.243+dfsg.1/src/mame/includes/svision.h --- mame-0.242+dfsg.1/src/mame/includes/svision.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/svision.h 2022-04-29 05:37:26.000000000 +0000 @@ -59,16 +59,16 @@ private: struct svision_t { - emu_timer *timer1; - int timer_shot; + emu_timer *timer1 = nullptr; + int timer_shot = 0; }; struct svision_pet_t { - int state; - int on, clock, data; - uint8_t input; - emu_timer *timer; + int state = 0; + int on = 0, clock = 0, data = 0; + uint8_t input = 0; + emu_timer *timer = nullptr; }; DECLARE_WRITE_LINE_MEMBER(sound_irq_w); @@ -117,12 +117,12 @@ required_memory_bank m_bank1; required_memory_bank m_bank2; - memory_region *m_cart_rom; + memory_region *m_cart_rom = nullptr; svision_t m_svision; svision_pet_t m_pet; tvlink_t m_tvlink; - bool m_dma_finished; + bool m_dma_finished = false; }; #endif // MAME_INCLUDES_SVISION_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/swtpc09.h mame-0.243+dfsg.1/src/mame/includes/swtpc09.h --- mame-0.242+dfsg.1/src/mame/includes/swtpc09.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/swtpc09.h 2022-04-29 05:37:26.000000000 +0000 @@ -176,33 +176,33 @@ required_ioport m_sbug_double_density; required_ioport m_piaide_flex_boot_cd00; - uint8_t m_pia_counter; // this is the counter on pia porta + uint8_t m_pia_counter = 0; // this is the counter on pia porta - uint8_t m_dmaf_high_address[4]; // dmaf2 or dmaf3 dma extended address reg - uint8_t m_dmaf2_interrupt_enable; + uint8_t m_dmaf_high_address[4]{}; // dmaf2 or dmaf3 dma extended address reg + uint8_t m_dmaf2_interrupt_enable = 0; - uint8_t m_system_type; // flag to indicate hw and rom combination - uint8_t m_fdc_status; // for floppy controller - int m_floppy_motor_on; - emu_timer *m_floppy_motor_timer; - floppy_image_device *m_fdc_floppy; // Current selected floppy. - uint8_t m_fdc_side; // Current floppy side. - uint8_t m_fdc_dden; // Current dden state. - uint8_t m_dmaf3_via_porta; - uint8_t m_dmaf3_via_portb; - uint8_t m_active_interrupt; - uint8_t m_interrupt; + uint8_t m_system_type = 0; // flag to indicate hw and rom combination + uint8_t m_fdc_status = 0; // for floppy controller + int m_floppy_motor_on = 0; + emu_timer *m_floppy_motor_timer = nullptr; + floppy_image_device *m_fdc_floppy = nullptr; // Current selected floppy. + uint8_t m_fdc_side = 0; // Current floppy side. + uint8_t m_fdc_dden = 0; // Current dden state. + uint8_t m_dmaf3_via_porta = 0; + uint8_t m_dmaf3_via_portb = 0; + uint8_t m_active_interrupt = 0; + uint8_t m_interrupt = 0; - address_space *m_banked_space; + address_space *m_banked_space = nullptr; // TODO: move this in proper device /* channel_data structure holds info about each 6844 DMA channel */ struct m6844_channel_data { - int active; - int address; - int counter; + int active = 0; + int address = 0; + int counter = 0; // Channel control register. // bit 0: Read / Write mode // bit 1: Mode control B @@ -217,22 +217,22 @@ // read. Sets IRQ. // Mode control A,B: 0,0 Mode2; 0,1 Mode 3; 1,0 Mode 0; // 1,1 Undefined. - uint8_t control; - int start_address; - int start_counter; + uint8_t control = 0; + int start_address = 0; + int start_counter = 0; }; /* 6844 description */ m6844_channel_data m_m6844_channel[4]; - uint8_t m_m6844_priority; + uint8_t m_m6844_priority = 0; // Interrupt control register. // Bit 0-3: channel interrupt enable, 1 enabled, 0 masked. // Bit 4-6: unused // Bit 7: Read only. Set to 1 when IRQ asserted. Clear when the // control register associated with the channel that caused the // interrut is read. - uint8_t m_m6844_interrupt; - uint8_t m_m6844_chain; + uint8_t m_m6844_interrupt = 0; + uint8_t m_m6844_chain = 0; void m6844_update_interrupt(); void m6844_fdc_dma_transfer(uint8_t channel); void m6844_hdc_dma_transfer(uint8_t channel); diff -Nru mame-0.242+dfsg.1/src/mame/includes/system16.h mame-0.243+dfsg.1/src/mame/includes/system16.h --- mame-0.242+dfsg.1/src/mame/includes/system16.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/system16.h 2022-04-29 05:37:26.000000000 +0000 @@ -227,76 +227,76 @@ required_device m_screen; optional_device m_sprites; - uint16_t m_coinctrl; + uint16_t m_coinctrl = 0; /* game specific */ - int m_passht4b_io1_val; - int m_passht4b_io2_val; - int m_passht4b_io3_val; + int m_passht4b_io1_val = 0; + int m_passht4b_io2_val = 0; + int m_passht4b_io3_val = 0; - int m_beautyb_unkx; + int m_beautyb_unkx = 0; - int m_shinobl_kludge; // TODO: this never gets set, causing unreachable code in get_text_tile_info + int m_shinobl_kludge = 0; // TODO: this never gets set, causing unreachable code in get_text_tile_info - int m_eswat_tilebank0; + int m_eswat_tilebank0 = 0; /* video-related */ - tilemap_t *m_background[2]; - tilemap_t *m_foreground[2]; - tilemap_t *m_text_layer; - tilemap_t *m_bg_tilemaps[2]; - tilemap_t *m_text_tilemap; - double m_weights[2][3][6]; - - int m_spritebank_type; - int m_back_yscroll; - int m_fore_yscroll; - int m_text_yscroll; - - int m_bg1_trans; // alien syn + sys18 - - int m_tile_bank[2]; - int m_bg_page[2][4]; - int m_fg_page[2][4]; - - uint16_t m_datsu_page[4]; - - int m_old_bg_page[2][4]; - int m_old_fg_page[2][4]; - int m_old_tile_bank[2]; - - int m_bg_scrollx; - int m_bg_scrolly; - int m_fg_scrollx; - int m_fg_scrolly; - uint16_t m_tilemapselect; - - int m_textlayer_lo_min; - int m_textlayer_lo_max; - int m_textlayer_hi_min; - int m_textlayer_hi_max; + tilemap_t *m_background[2]{}; + tilemap_t *m_foreground[2]{}; + tilemap_t *m_text_layer = nullptr; + tilemap_t *m_bg_tilemaps[2]{}; + tilemap_t *m_text_tilemap = nullptr; + double m_weights[2][3][6]{}; + + int m_spritebank_type = 0; + int m_back_yscroll = 0; + int m_fore_yscroll = 0; + int m_text_yscroll = 0; + + int m_bg1_trans = 0; // alien syn + sys18 + + int m_tile_bank[2]{}; + int m_bg_page[2][4]{}; + int m_fg_page[2][4]{}; + + uint16_t m_datsu_page[4]{}; + + int m_old_bg_page[2][4]{}; + int m_old_fg_page[2][4]{}; + int m_old_tile_bank[2]{}; + + int m_bg_scrollx = 0; + int m_bg_scrolly = 0; + int m_fg_scrollx = 0; + int m_fg_scrolly = 0; + uint16_t m_tilemapselect = 0; + + int m_textlayer_lo_min = 0; + int m_textlayer_lo_max = 0; + int m_textlayer_hi_min = 0; + int m_textlayer_hi_max = 0; - int m_tilebank_switch; + int m_tilebank_switch = 0; /* sound-related */ - int m_sample_buffer; - int m_sample_select; + int m_sample_buffer = 0; + int m_sample_select = 0; - uint8_t *m_soundbank_ptr; /* Pointer to currently selected portion of ROM */ + uint8_t *m_soundbank_ptr = nullptr; /* Pointer to currently selected portion of ROM */ /* sys18 */ - uint8_t *m_sound_bank; - uint16_t *m_splittab_bg_x; - uint16_t *m_splittab_bg_y; - uint16_t *m_splittab_fg_x; - uint16_t *m_splittab_fg_y; - int m_sound_info[4*2]; - int m_refreshenable; - int m_system18; + uint8_t *m_sound_bank = nullptr; + uint16_t *m_splittab_bg_x = nullptr; + uint16_t *m_splittab_bg_y = nullptr; + uint16_t *m_splittab_fg_x = nullptr; + uint16_t *m_splittab_fg_y = nullptr; + int m_sound_info[4*2]{}; + int m_refreshenable = 0; + int m_system18 = 0; - uint8_t *m_decrypted_region; // goldnaxeb1 & bayrouteb1 + uint8_t *m_decrypted_region = nullptr; // goldnaxeb1 & bayrouteb1 /* devices */ required_device m_maincpu; diff -Nru mame-0.242+dfsg.1/src/mame/includes/system1.h mame-0.243+dfsg.1/src/mame/includes/system1.h --- mame-0.242+dfsg.1/src/mame/includes/system1.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/system1.h 2022-04-29 05:37:26.000000000 +0000 @@ -121,25 +121,25 @@ // video related std::unique_ptr m_videoram; void (system1_state::*m_videomode_custom)(u8 data, u8 prevdata); - u8 m_videomode_prev; + u8 m_videomode_prev = 0; std::unique_ptr m_mix_collide; - u8 m_mix_collide_summary; + u8 m_mix_collide_summary = 0; std::unique_ptr m_sprite_collide; - u8 m_sprite_collide_summary; + u8 m_sprite_collide_summary = 0; bitmap_ind16 m_sprite_bitmap; - u8 m_video_mode; - u8 m_videoram_bank; - tilemap_t *m_tilemap_page[8]; - u8 m_tilemap_pages; + u8 m_video_mode = 0; + u8 m_videoram_bank = 0; + tilemap_t *m_tilemap_page[8]{}; + u8 m_tilemap_pages = 0; // protection, miscs - u8 m_mute_xor; - u8 m_dakkochn_mux_data; - u8 m_mcu_control; - u8 m_nob_maincpu_latch; - u8 m_nob_mcu_latch; - u8 m_nob_mcu_status; - int m_nobb_inport23_step; + u8 m_mute_xor = 0; + u8 m_dakkochn_mux_data = 0; + u8 m_mcu_control = 0; + u8 m_nob_maincpu_latch = 0; + u8 m_nob_mcu_latch = 0; + u8 m_nob_mcu_status = 0; + int m_nobb_inport23_step = 0; // video handlers void common_videomode_w(u8 data); diff -Nru mame-0.242+dfsg.1/src/mame/includes/taitoair.h mame-0.243+dfsg.1/src/mame/includes/taitoair.h --- mame-0.242+dfsg.1/src/mame/includes/taitoair.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/taitoair.h 2022-04-29 05:37:26.000000000 +0000 @@ -20,13 +20,13 @@ enum { TAITOAIR_FRAC_SHIFT = 16, TAITOAIR_POLY_MAX_PT = 16 }; struct taitoair_spoint { - s32 x, y; + s32 x = 0, y = 0; }; struct taitoair_poly { struct taitoair_spoint p[TAITOAIR_POLY_MAX_PT]; - int pcount; - u16 header; + int pcount = 0; + u16 header = 0; }; @@ -67,7 +67,7 @@ taitoair_poly m_q; /* misc */ - int m_dsp_hold_signal; + int m_dsp_hold_signal = 0; /* devices */ required_device m_maincpu; @@ -84,15 +84,15 @@ std::unique_ptr m_framebuffer[2]; /* 3d info */ - s16 m_frustumLeft; - s16 m_frustumBottom; - s16 m_eyecoordBuffer[4]; /* homogeneous */ - - bool m_gradbank; - - u16 m_dsp_test_object_type; - s16 m_dsp_test_or_clip, m_dsp_test_and_clip; - s16 m_dsp_test_x, m_dsp_test_y, m_dsp_test_z; + s16 m_frustumLeft = 0; + s16 m_frustumBottom = 0; + s16 m_eyecoordBuffer[4]{}; /* homogeneous */ + + bool m_gradbank = false; + + u16 m_dsp_test_object_type = 0; + s16 m_dsp_test_or_clip = 0, m_dsp_test_and_clip = 0; + s16 m_dsp_test_x = 0, m_dsp_test_y = 0, m_dsp_test_z = 0; void dsp_test_start_w(u16 data); void dsp_test_x_w(u16 data); @@ -102,14 +102,14 @@ u16 dsp_test_or_clip_r(); u16 dsp_test_and_clip_r(); - s16 m_dsp_muldiv_a_1, m_dsp_muldiv_b_1, m_dsp_muldiv_c_1; + s16 m_dsp_muldiv_a_1 = 0, m_dsp_muldiv_b_1 = 0, m_dsp_muldiv_c_1 = 0; void dsp_muldiv_a_1_w(u16 data); void dsp_muldiv_b_1_w(u16 data); void dsp_muldiv_c_1_w(u16 data); u16 dsp_muldiv_1_r(); - s16 m_dsp_muldiv_a_2, m_dsp_muldiv_b_2, m_dsp_muldiv_c_2; + s16 m_dsp_muldiv_a_2 = 0, m_dsp_muldiv_b_2 = 0, m_dsp_muldiv_c_2 = 0; void dsp_muldiv_a_2_w(u16 data); void dsp_muldiv_b_2_w(u16 data); diff -Nru mame-0.242+dfsg.1/src/mame/includes/taito_f2.h mame-0.243+dfsg.1/src/mame/includes/taito_f2.h --- mame-0.242+dfsg.1/src/mame/includes/taito_f2.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/taito_f2.h 2022-04-29 05:37:26.000000000 +0000 @@ -120,45 +120,45 @@ /* video-related */ std::unique_ptr m_spritelist; - int m_sprite_type; + int m_sprite_type = 0; - u16 m_spritebank[8]; -// u16 m_spritebank_eof[8]; - u16 m_spritebank_buffered[8]; - - bool m_sprites_disabled; - s32 m_sprites_active_area; - s32 m_sprites_master_scrollx; - s32 m_sprites_master_scrolly; + u16 m_spritebank[8]{}; +// u16 m_spritebank_eof[8]{}; + u16 m_spritebank_buffered[8]{}; + + bool m_sprites_disabled = false; + s32 m_sprites_active_area = 0; + s32 m_sprites_master_scrollx = 0; + s32 m_sprites_master_scrolly = 0; /* remember flip status over frames because driftout can fail to set it */ - bool m_sprites_flipscreen; + bool m_sprites_flipscreen = false; /* On the left hand screen edge (assuming horiz screen, no screenflip: in screenflip it is the right hand edge etc.) there may be 0-3 unwanted pixels in both tilemaps *and* sprites. To erase this we use f2_hide_pixels (0 to +3). */ - s32 m_hide_pixels; - s32 m_flip_hide_pixels; /* Different in some games */ + s32 m_hide_pixels = 0; + s32 m_flip_hide_pixels = 0; /* Different in some games */ - s32 m_pivot_xdisp; /* Needed in games with a pivot layer */ - s32 m_pivot_ydisp; + s32 m_pivot_xdisp = 0; /* Needed in games with a pivot layer */ + s32 m_pivot_ydisp = 0; - s32 m_game; + s32 m_game = 0; - u8 m_tilepri[6]; // todo - move into taitoic.c - u8 m_spritepri[6]; // todo - move into taitoic.c - u8 m_spriteblendmode; // todo - move into taitoic.c + u8 m_tilepri[6]{}; // todo - move into taitoic.c + u8 m_spritepri[6]{}; // todo - move into taitoic.c + u8 m_spriteblendmode = 0; // todo - move into taitoic.c - int m_prepare_sprites; - u8 m_gfxbank; + int m_prepare_sprites = 0; + u8 m_gfxbank = 0; /* misc */ - s32 m_mjnquest_input; - int m_last[2]; - int m_nibble; - s32 m_driveout_sound_latch; - emu_timer *m_int6_timer; + s32 m_mjnquest_input = 0; + int m_last[2]{}; + int m_nibble = 0; + s32 m_driveout_sound_latch = 0; + emu_timer *m_int6_timer = nullptr; std::unique_ptr m_decoded_gfx; /* devices */ diff -Nru mame-0.242+dfsg.1/src/mame/includes/taito_f3.h mame-0.243+dfsg.1/src/mame/includes/taito_f3.h --- mame-0.242+dfsg.1/src/mame/includes/taito_f3.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/taito_f3.h 2022-04-29 05:37:26.000000000 +0000 @@ -172,116 +172,116 @@ struct tempsprite { - int code, color; - int flipx, flipy; - int x, y; - int zoomx, zoomy; - int pri; + int code = 0, color = 0; + int flipx = 0, flipy = 0; + int x = 0, y = 0; + int zoomx = 0, zoomy = 0; + int pri = 0; }; struct f3_playfield_line_inf { - int alpha_mode[256]; - int pri[256]; + int alpha_mode[256]{}; + int pri[256]{}; /* use for draw_scanlines */ - u16 *src[256], *src_s[256], *src_e[256]; - u8 *tsrc[256], *tsrc_s[256]; - int x_count[256]; - u32 x_zoom[256]; - u32 clip0[256]; - u32 clip1[256]; + u16 *src[256]{}, *src_s[256]{}, *src_e[256]{}; + u8 *tsrc[256]{}, *tsrc_s[256]{}; + int x_count[256]{}; + u32 x_zoom[256]{}; + u32 clip0[256]{}; + u32 clip1[256]{}; }; struct f3_spritealpha_line_inf { - u16 alpha_level[256]; - u16 spri[256]; - u16 sprite_alpha[256]; - u32 sprite_clip0[256]; - u32 sprite_clip1[256]; - s16 clip0_l[256]; - s16 clip0_r[256]; - s16 clip1_l[256]; - s16 clip1_r[256]; + u16 alpha_level[256]{}; + u16 spri[256]{}; + u16 sprite_alpha[256]{}; + u32 sprite_clip0[256]{}; + u32 sprite_clip1[256]{}; + s16 clip0_l[256]{}; + s16 clip0_r[256]{}; + s16 clip1_l[256]{}; + s16 clip1_r[256]{}; }; - int m_game; - tilemap_t *m_tilemap[8]; - tilemap_t *m_pixel_layer; - tilemap_t *m_vram_layer; + int m_game = 0; + tilemap_t *m_tilemap[8]{}; + tilemap_t *m_pixel_layer = nullptr; + tilemap_t *m_vram_layer = nullptr; std::unique_ptr m_spriteram16_buffered; - u16 m_control_0[8]; - u16 m_control_1[8]; - int m_flipscreen; - u8 m_sprite_extra_planes; - u8 m_sprite_pen_mask; - u16 *m_pf_data[8]; - int m_sprite_lag; - u8 m_sprite_pri_usage; + u16 m_control_0[8]{}; + u16 m_control_1[8]{}; + int m_flipscreen = 0; + u8 m_sprite_extra_planes = 0; + u8 m_sprite_pen_mask = 0; + u16 *m_pf_data[8]{}; + int m_sprite_lag = 0; + u8 m_sprite_pri_usage = 0; bitmap_ind8 m_pri_alp_bitmap; - int m_alpha_level_2as; - int m_alpha_level_2ad; - int m_alpha_level_3as; - int m_alpha_level_3ad; - int m_alpha_level_2bs; - int m_alpha_level_2bd; - int m_alpha_level_3bs; - int m_alpha_level_3bd; - int m_alpha_level_last; - int m_width_mask; - int m_twidth_mask; - int m_twidth_mask_bit; + int m_alpha_level_2as = 0; + int m_alpha_level_2ad = 0; + int m_alpha_level_3as = 0; + int m_alpha_level_3ad = 0; + int m_alpha_level_2bs = 0; + int m_alpha_level_2bd = 0; + int m_alpha_level_3bs = 0; + int m_alpha_level_3bd = 0; + int m_alpha_level_last = 0; + int m_width_mask = 0; + int m_twidth_mask = 0; + int m_twidth_mask_bit = 0; std::unique_ptr m_tile_opaque_sp; std::unique_ptr m_tile_opaque_pf[8]; - u8 m_add_sat[256][256]; - int m_alpha_s_1_1; - int m_alpha_s_1_2; - int m_alpha_s_1_4; - int m_alpha_s_1_5; - int m_alpha_s_1_6; - int m_alpha_s_1_8; - int m_alpha_s_1_9; - int m_alpha_s_1_a; - int m_alpha_s_2a_0; - int m_alpha_s_2a_4; - int m_alpha_s_2a_8; - int m_alpha_s_2b_0; - int m_alpha_s_2b_4; - int m_alpha_s_2b_8; - int m_alpha_s_3a_0; - int m_alpha_s_3a_1; - int m_alpha_s_3a_2; - int m_alpha_s_3b_0; - int m_alpha_s_3b_1; - int m_alpha_s_3b_2; - u32 m_dval; - u8 m_pval; - u8 m_tval; - u8 m_pdest_2a; - u8 m_pdest_2b; - int m_tr_2a; - int m_tr_2b; - u8 m_pdest_3a; - u8 m_pdest_3b; - int m_tr_3a; - int m_tr_3b; - u16 *m_src[5]; - u16 *m_src_s[5]; - u16 *m_src_e[5]; - u16 m_clip_al[5]; - u16 m_clip_ar[5]; - u16 m_clip_bl[5]; - u16 m_clip_br[5]; - u8 *m_tsrc[5]; - u8 *m_tsrc_s[5]; - u32 m_x_count[5]; - u32 m_x_zoom[5]; + u8 m_add_sat[256][256]{}; + int m_alpha_s_1_1 = 0; + int m_alpha_s_1_2 = 0; + int m_alpha_s_1_4 = 0; + int m_alpha_s_1_5 = 0; + int m_alpha_s_1_6 = 0; + int m_alpha_s_1_8 = 0; + int m_alpha_s_1_9 = 0; + int m_alpha_s_1_a = 0; + int m_alpha_s_2a_0 = 0; + int m_alpha_s_2a_4 = 0; + int m_alpha_s_2a_8 = 0; + int m_alpha_s_2b_0 = 0; + int m_alpha_s_2b_4 = 0; + int m_alpha_s_2b_8 = 0; + int m_alpha_s_3a_0 = 0; + int m_alpha_s_3a_1 = 0; + int m_alpha_s_3a_2 = 0; + int m_alpha_s_3b_0 = 0; + int m_alpha_s_3b_1 = 0; + int m_alpha_s_3b_2 = 0; + u32 m_dval = 0; + u8 m_pval = 0; + u8 m_tval = 0; + u8 m_pdest_2a = 0; + u8 m_pdest_2b = 0; + int m_tr_2a = 0; + int m_tr_2b = 0; + u8 m_pdest_3a = 0; + u8 m_pdest_3b = 0; + int m_tr_3a = 0; + int m_tr_3b = 0; + u16 *m_src[5]{}; + u16 *m_src_s[5]{}; + u16 *m_src_e[5]{}; + u16 m_clip_al[5]{}; + u16 m_clip_ar[5]{}; + u16 m_clip_bl[5]{}; + u16 m_clip_br[5]{}; + u8 *m_tsrc[5]{}; + u8 *m_tsrc_s[5]{}; + u32 m_x_count[5]{}; + u32 m_x_zoom[5]{}; std::unique_ptr m_spritelist; - const tempsprite *m_sprite_end; + const tempsprite *m_sprite_end = nullptr; std::unique_ptr m_pf_line_inf; std::unique_ptr m_sa_line_inf; - const F3config *m_game_config; + const F3config *m_game_config = nullptr; int (taito_f3_state::*m_dpix_n[8][16])(u32 s_pix); int (taito_f3_state::**m_dpix_lp[5])(u32 s_pix); int (taito_f3_state::**m_dpix_sp[9])(u32 s_pix); diff -Nru mame-0.242+dfsg.1/src/mame/includes/taitosj.h mame-0.243+dfsg.1/src/mame/includes/taitosj.h --- mame-0.242+dfsg.1/src/mame/includes/taitosj.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/taitosj.h 2022-04-29 05:37:26.000000000 +0000 @@ -96,21 +96,21 @@ typedef void (taitosj_state::*copy_layer_func_t)(bitmap_ind16 &, const rectangle &, int, int *, rectangle *); - uint8_t m_input_port_4_f0; - uint8_t m_kikstart_gears[2]; + uint8_t m_input_port_4_f0 = 0; + uint8_t m_kikstart_gears[2]{}; - uint8_t m_spacecr_prot_value; - uint8_t m_protection_value; - uint32_t m_address; - uint8_t m_soundlatch_data; - bool m_soundlatch_flag; // 74ls74 1/2 @ GAME BOARD IC42 - bool m_sound_semaphore2; // 74ls74 2/2 @ GAME BOARD IC42 + uint8_t m_spacecr_prot_value = 0; + uint8_t m_protection_value = 0; + uint32_t m_address = 0; + uint8_t m_soundlatch_data = 0; + bool m_soundlatch_flag = false; // 74ls74 1/2 @ GAME BOARD IC42 + bool m_sound_semaphore2 = false; // 74ls74 2/2 @ GAME BOARD IC42 bitmap_ind16 m_layer_bitmap[3]; bitmap_ind16 m_sprite_sprite_collbitmap1; bitmap_ind16 m_sprite_sprite_collbitmap2; bitmap_ind16 m_sprite_layer_collbitmap1; bitmap_ind16 m_sprite_layer_collbitmap2[3]; - int m_draw_order[32][4]; + int m_draw_order[32][4]{}; void soundlatch_w(uint8_t data); void sound_semaphore2_w(uint8_t data); TIMER_CALLBACK_MEMBER(soundlatch_w_cb); diff -Nru mame-0.242+dfsg.1/src/mame/includes/tandy2k.h mame-0.243+dfsg.1/src/mame/includes/tandy2k.h --- mame-0.242+dfsg.1/src/mame/includes/tandy2k.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/tandy2k.h 2022-04-29 05:37:26.000000000 +0000 @@ -205,7 +205,7 @@ /* DMA state */ uint8_t m_dma_mux; - int m_busdmarq[4]; + int m_busdmarq[4]{}; /* keyboard state */ int m_kbdclk; @@ -235,7 +235,7 @@ int m_sld; uint8_t m_cgra; uint8_t m_vidla; - uint8_t m_hires_en; + uint8_t m_hires_en = 0; /* sound state */ int m_outspkr; @@ -259,12 +259,12 @@ MCU_DELAY }; - uint8_t m_clkmouse_cmd[8]; - int m_clkmouse_cnt; - uint8_t m_clkmouse_irq; - uint16_t m_mouse_x, m_mouse_y; - emu_timer *m_mouse_timer; - emu_timer *m_mcu_delay; + uint8_t m_clkmouse_cmd[8]{}; + int m_clkmouse_cnt = 0; + uint8_t m_clkmouse_irq = 0; + uint16_t m_mouse_x = 0, m_mouse_y = 0; + emu_timer *m_mouse_timer = nullptr; + emu_timer *m_mcu_delay = nullptr; void tandy2k_hd_io(address_map &map); void tandy2k_io(address_map &map); diff -Nru mame-0.242+dfsg.1/src/mame/includes/tankbatt.h mame-0.243+dfsg.1/src/mame/includes/tankbatt.h --- mame-0.242+dfsg.1/src/mame/includes/tankbatt.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/tankbatt.h 2022-04-29 05:37:26.000000000 +0000 @@ -54,8 +54,8 @@ required_device m_sound_shoot; required_device m_sound_hit; - int m_sound_enable; - tilemap_t *m_bg_tilemap; + int m_sound_enable = 0; + tilemap_t *m_bg_tilemap = nullptr; uint8_t in0_r(offs_t offset); uint8_t in1_r(offs_t offset); diff -Nru mame-0.242+dfsg.1/src/mame/includes/taotaido.h mame-0.243+dfsg.1/src/mame/includes/taotaido.h --- mame-0.242+dfsg.1/src/mame/includes/taotaido.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/taotaido.h 2022-04-29 05:37:26.000000000 +0000 @@ -52,8 +52,8 @@ memory_share_creator m_spritebank; - uint8_t m_bgbank[8]; - tilemap_t *m_bg_tilemap; + uint8_t m_bgbank[8]{}; + tilemap_t *m_bg_tilemap = nullptr; std::unique_ptr m_spriteram_old; std::unique_ptr m_spriteram_older; std::unique_ptr m_spriteram2_old; diff -Nru mame-0.242+dfsg.1/src/mame/includes/targeth.h mame-0.243+dfsg.1/src/mame/includes/targeth.h --- mame-0.242+dfsg.1/src/mame/includes/targeth.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/targeth.h 2022-04-29 05:37:26.000000000 +0000 @@ -68,9 +68,9 @@ required_memory_bank m_okibank; - emu_timer *m_gun_irq_timer[2]; + emu_timer *m_gun_irq_timer[2]{}; - tilemap_t *m_pant[2]; + tilemap_t *m_pant[2]{}; }; #endif // MAME_INCLUDES_TARGETH_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/tbowl.h mame-0.243+dfsg.1/src/mame/includes/tbowl.h --- mame-0.242+dfsg.1/src/mame/includes/tbowl.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/tbowl.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,101 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:David Haywood -#ifndef MAME_INCLUDES_TBOWL_H -#define MAME_INCLUDES_TBOWL_H - -#pragma once - -#include "machine/gen_latch.h" -#include "sound/msm5205.h" -#include "video/tecmo_spr.h" -#include "emupal.h" -#include "tilemap.h" - -class tbowl_state : public driver_device -{ -public: - tbowl_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_msm1(*this, "msm1"), - m_msm2(*this, "msm2"), - m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette"), - m_sprgen(*this, "spritegen"), - m_soundlatch(*this, "soundlatch"), - m_txvideoram(*this, "txvideoram"), - m_bgvideoram(*this, "bgvideoram"), - m_bg2videoram(*this, "bg2videoram"), - m_spriteram(*this, "spriteram") - { } - - void tbowl(machine_config &config); - -protected: - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; - -private: - required_device m_maincpu; - required_device m_audiocpu; - required_device m_msm1; - required_device m_msm2; - required_device m_gfxdecode; - required_device m_palette; - required_device m_sprgen; - required_device m_soundlatch; - - required_shared_ptr m_txvideoram; - required_shared_ptr m_bgvideoram; - required_shared_ptr m_bg2videoram; - required_shared_ptr m_spriteram; - - tilemap_t *m_tx_tilemap = nullptr; - tilemap_t *m_bg_tilemap = nullptr; - tilemap_t *m_bg2_tilemap = nullptr; - uint16_t m_xscroll = 0; - uint16_t m_yscroll = 0; - uint16_t m_bg2xscroll = 0; - uint16_t m_bg2yscroll = 0; - int m_adpcm_pos[2]{}; - int m_adpcm_end[2]{}; - int m_adpcm_data[2]{}; - - void coincounter_w(uint8_t data); - void boardb_bankswitch_w(uint8_t data); - void boardc_bankswitch_w(uint8_t data); - void trigger_nmi(uint8_t data); - void adpcm_start_w(offs_t offset, uint8_t data); - void adpcm_end_w(offs_t offset, uint8_t data); - void adpcm_vol_w(offs_t offset, uint8_t data); - void txvideoram_w(offs_t offset, uint8_t data); - void bg2videoram_w(offs_t offset, uint8_t data); - void bgxscroll_lo(uint8_t data); - void bgxscroll_hi(uint8_t data); - void bgyscroll_lo(uint8_t data); - void bgyscroll_hi(uint8_t data); - void bgvideoram_w(offs_t offset, uint8_t data); - void bg2xscroll_lo(uint8_t data); - void bg2xscroll_hi(uint8_t data); - void bg2yscroll_lo(uint8_t data); - void bg2yscroll_hi(uint8_t data); - - TILE_GET_INFO_MEMBER(get_tx_tile_info); - TILE_GET_INFO_MEMBER(get_bg_tile_info); - TILE_GET_INFO_MEMBER(get_bg2_tile_info); - - uint32_t screen_update_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - uint32_t screen_update_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - - void adpcm_int(msm5205_device *device, int chip); - DECLARE_WRITE_LINE_MEMBER(adpcm_int_1); - DECLARE_WRITE_LINE_MEMBER(adpcm_int_2); - - void _6206A_map(address_map &map); - void _6206B_map(address_map &map); - void _6206C_map(address_map &map); -}; - -#endif // MAME_INCLUDES_TBOWL_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/tecmo.h mame-0.243+dfsg.1/src/mame/includes/tecmo.h --- mame-0.242+dfsg.1/src/mame/includes/tecmo.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/tecmo.h 2022-04-29 05:37:26.000000000 +0000 @@ -68,13 +68,13 @@ optional_region_ptr m_adpcm_rom; required_memory_bank m_mainbank; - tilemap_t *m_tx_tilemap; - tilemap_t *m_fg_tilemap; - tilemap_t *m_bg_tilemap; - int m_adpcm_pos; - int m_adpcm_end; - int m_adpcm_data; - int m_video_type; + tilemap_t *m_tx_tilemap = nullptr; + tilemap_t *m_fg_tilemap = nullptr; + tilemap_t *m_bg_tilemap = nullptr; + int m_adpcm_pos = 0; + int m_adpcm_end = 0; + int m_adpcm_data = 0; + int m_video_type = 0; void bankswitch_w(uint8_t data); void adpcm_end_w(uint8_t data); diff -Nru mame-0.242+dfsg.1/src/mame/includes/tecmosys.h mame-0.243+dfsg.1/src/mame/includes/tecmosys.h --- mame-0.242+dfsg.1/src/mame/includes/tecmosys.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/tecmosys.h 2022-04-29 05:37:26.000000000 +0000 @@ -74,20 +74,20 @@ required_region_ptr m_sprite_region; std::unique_ptr m_sprite_gfx; - offs_t m_sprite_gfx_mask; + offs_t m_sprite_gfx_mask = 0; required_memory_bank m_audiobank; required_memory_bank_array<2> m_okibank; - int m_spritelist; + int m_spritelist = 0; bitmap_ind16 m_sprite_bitmap; bitmap_ind16 m_tmp_tilemap_composebitmap; bitmap_ind16 m_tmp_tilemap_renderbitmap; - tilemap_t *m_tilemap[4]; - u8 m_device_read_ptr; - u8 m_device_status; - const struct prot_data* m_device_data; - u8 m_device_value; + tilemap_t *m_tilemap[4]{}; + u8 m_device_read_ptr = 0; + u8 m_device_status = 0; + const struct prot_data* m_device_data = nullptr; + u8 m_device_value = 0; u8 sound_command_pending_r(); void sound_nmi_disable_w(u8 data); diff -Nru mame-0.242+dfsg.1/src/mame/includes/tek405x.h mame-0.243+dfsg.1/src/mame/includes/tek405x.h --- mame-0.242+dfsg.1/src/mame/includes/tek405x.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/tek405x.h 2022-04-29 05:37:26.000000000 +0000 @@ -131,25 +131,25 @@ output_finder<3> m_lamps; // interrupts - int m_x_pia_irqa; - int m_x_pia_irqb; - int m_y_pia_irqa; - int m_y_pia_irqb; - int m_tape_pia_irqa; - int m_tape_pia_irqb; - int m_kb_pia_irqa; - int m_kb_pia_irqb; - int m_gpib_pia_irqa; - int m_gpib_pia_irqb; - int m_com_pia_irqa; - int m_com_pia_irqb; - int m_acia_irq; + int m_x_pia_irqa = 0; + int m_x_pia_irqb = 0; + int m_y_pia_irqa = 0; + int m_y_pia_irqb = 0; + int m_tape_pia_irqa = 0; + int m_tape_pia_irqb = 0; + int m_kb_pia_irqa = 0; + int m_kb_pia_irqb = 0; + int m_gpib_pia_irqa = 0; + int m_gpib_pia_irqb = 0; + int m_com_pia_irqa = 0; + int m_com_pia_irqb = 0; + int m_acia_irq = 0; // keyboard - int m_kc; + int m_kc = 0; // GPIB - int m_talk; + int m_talk = 0; }; class tek4052_state : public driver_device diff -Nru mame-0.242+dfsg.1/src/mame/includes/tetrisp2.h mame-0.243+dfsg.1/src/mame/includes/tetrisp2.h --- mame-0.242+dfsg.1/src/mame/includes/tetrisp2.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/tetrisp2.h 2022-04-29 05:37:26.000000000 +0000 @@ -115,7 +115,7 @@ u16 m_rockn_protectdata = 0; u16 m_rockn_adpcmbank = 0; u16 m_rockn_soundvolume = 0; - int m_rot_ofsx, m_rot_ofsy = 0; + int m_rot_ofsx = 0, m_rot_ofsy = 0; int m_bank_lo = 0; int m_bank_hi = 0; diff -Nru mame-0.242+dfsg.1/src/mame/includes/thomson.h mame-0.243+dfsg.1/src/mame/includes/thomson.h --- mame-0.242+dfsg.1/src/mame/includes/thomson.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/thomson.h 2022-04-29 05:37:26.000000000 +0000 @@ -178,8 +178,8 @@ void mode80_to9_scandraw_8( uint8_t* vram, uint16_t* dst, uint16_t* pal, int org, int len ); protected: - emu_timer* m_mo5_periodic_timer; - uint8_t m_mo5_reg_cart; /* 0xa7cb bank switch */ + emu_timer* m_mo5_periodic_timer = nullptr; + uint8_t m_mo5_reg_cart = 0; /* 0xa7cb bank switch */ virtual void video_start() override; @@ -241,8 +241,8 @@ TIMER_CALLBACK_MEMBER( ans ); void thom_palette(palette_device &palette); - int m_centronics_busy; - int m_centronics_perror; + int m_centronics_busy = 0; + int m_centronics_perror = 0; void to7_map(address_map &map); void to770_map(address_map &map); @@ -284,75 +284,75 @@ output_finder<> m_caps_led; /* bank logging and optimisations */ - int m_old_cart_bank; - int m_old_cart_bank_was_read_only; - int m_old_ram_bank; + int m_old_cart_bank = 0; + int m_old_cart_bank_was_read_only = 0; + int m_old_ram_bank = 0; /* buffer storing demodulated bits, only for k7 and with speed hack */ - uint32_t m_to7_k7_bitsize; - uint8_t* m_to7_k7_bits; + uint32_t m_to7_k7_bitsize = 0; + uint8_t* m_to7_k7_bits = 0; /* ------------ cartridge ------------ */ - uint8_t m_thom_cart_nb_banks; /* number of 16 KB banks (up to 4) */ - uint8_t m_thom_cart_bank; /* current bank */ - uint8_t m_to7_lightpen_step; - uint8_t m_to7_lightpen; - uint8_t m_to7_modem_tx; + uint8_t m_thom_cart_nb_banks = 0; /* number of 16 KB banks (up to 4) */ + uint8_t m_thom_cart_bank = 0; /* current bank */ + uint8_t m_to7_lightpen_step = 0; + uint8_t m_to7_lightpen = 0; + uint8_t m_to7_modem_tx = 0; /* calls to7_game_update_cb periodically */ - emu_timer* m_to7_game_timer; - uint8_t m_to7_game_sound; - uint8_t m_to7_game_mute; + emu_timer* m_to7_game_timer = nullptr; + uint8_t m_to7_game_sound = 0; + uint8_t m_to7_game_mute = 0; /* We allow choosing dynamically: - the border size - whether we use 640 pixels or 320 pixels in an active row (now this is automatically chosen by default for each frame) */ - uint16_t m_thom_bwidth; - uint16_t m_thom_bheight; + uint16_t m_thom_bwidth = 0; + uint16_t m_thom_bheight = 0; /* border size */ - uint8_t m_thom_hires; + uint8_t m_thom_hires = 0; /* 0 = low res: 320x200 active area (faster) 1 = hi res: 640x200 active area (can represent all video modes) */ - uint8_t m_thom_hires_better; + uint8_t m_thom_hires_better = 0; /* 1 = a 640 mode was used in the last frame */ /* we use our own video timing to precisely cope with VBLANK and HBLANK */ - emu_timer* m_thom_video_timer; /* time elapsed from beginning of frame */ + emu_timer* m_thom_video_timer = nullptr; /* time elapsed from beginning of frame */ /* number of lightpen call-backs per frame */ - int m_thom_lightpen_nb; + int m_thom_lightpen_nb = 0; /* called thom_lightpen_nb times */ - emu_timer *m_thom_lightpen_timer; + emu_timer *m_thom_lightpen_timer = nullptr; /* lightpen callback function to call from timer */ std::function m_thom_lightpen_cb; - uint8_t* m_thom_vram; /* pointer to video memory */ - emu_timer* m_thom_scanline_timer; /* scan-line update */ - uint16_t m_thom_last_pal[16]; /* palette at last scanline start */ - uint16_t m_thom_pal[16]; /* current palette */ - bool m_thom_pal_changed; /* whether pal != old_pal */ - uint8_t m_thom_border_index; /* current border color index */ + uint8_t* m_thom_vram = nullptr; /* pointer to video memory */ + emu_timer* m_thom_scanline_timer = nullptr; /* scan-line update */ + uint16_t m_thom_last_pal[16]{}; /* palette at last scanline start */ + uint16_t m_thom_pal[16]{}; /* current palette */ + bool m_thom_pal_changed = false; /* whether pal != old_pal */ + uint8_t m_thom_border_index = 0; /* current border color index */ /* the left and right border color for each row (including top and bottom border rows); -1 means unchanged wrt last scanline */ - int16_t m_thom_border_l[THOM_TOTAL_HEIGHT+1]; - int16_t m_thom_border_r[THOM_TOTAL_HEIGHT+1]; + int16_t m_thom_border_l[THOM_TOTAL_HEIGHT+1]{}; + int16_t m_thom_border_r[THOM_TOTAL_HEIGHT+1]{}; /* active area, updated one scan-line at a time every 64us, then blitted in screen_update */ - uint16_t m_thom_vbody[640*200]; - uint8_t m_thom_vmode; /* current vide mode */ - uint8_t m_thom_vpage; /* current video page */ + uint16_t m_thom_vbody[640*200]{}; + uint8_t m_thom_vmode = 0; /* current vide mode */ + uint8_t m_thom_vpage = 0; /* current video page */ /* this stores the video mode & page at each GPL in the current line (-1 means unchanged) */ - int16_t m_thom_vmodepage[41]; - uint8_t m_thom_vmodepage_changed; + int16_t m_thom_vmodepage[41]{}; + uint8_t m_thom_vmodepage_changed = 0; /* one dirty flag for each video memory line */ - bool m_thom_vmem_dirty[205]; + bool m_thom_vmem_dirty[205]{}; /* set to 1 if undirty scanlines need to be redrawn due to other video state changes */ - bool m_thom_vstate_dirty; - bool m_thom_vstate_last_dirty; - uint32_t m_thom_mode_point; - emu_timer *m_thom_init_timer; + bool m_thom_vstate_dirty = false; + bool m_thom_vstate_last_dirty = false; + uint32_t m_thom_mode_point = 0; + emu_timer *m_thom_init_timer = nullptr; void (thomson_state::*m_thom_init_cb)( int init ); int to7_get_cassette(); @@ -452,24 +452,24 @@ optional_memory_bank m_datahibank; optional_memory_bank m_biosbank; - uint8_t m_to8_kbd_ack; /* 1 = cpu inits / accepts transfers */ - uint16_t m_to8_kbd_data; /* data to transmit */ - uint16_t m_to8_kbd_step; /* transmission automaton state */ - uint8_t m_to8_kbd_last_key; /* last key (for repetition) */ - uint32_t m_to8_kbd_key_count; /* keypress time (for repetition) */ - uint8_t m_to8_kbd_caps; /* caps lock */ - emu_timer* m_to8_kbd_timer; /* bit-send */ - emu_timer* m_to8_kbd_signal; /* signal from CPU */ - uint8_t m_to8_data_vpage; - uint8_t m_to8_cart_vpage; - uint8_t m_to8_reg_ram; - uint8_t m_to8_reg_cart; - uint8_t m_to8_reg_sys1; - uint8_t m_to8_reg_sys2; - uint8_t m_to8_lightpen_intr; - uint8_t m_to8_soft_select; - uint8_t m_to8_soft_bank; - uint8_t m_to8_bios_bank; + uint8_t m_to8_kbd_ack = 0; /* 1 = cpu inits / accepts transfers */ + uint16_t m_to8_kbd_data = 0; /* data to transmit */ + uint16_t m_to8_kbd_step = 0; /* transmission automaton state */ + uint8_t m_to8_kbd_last_key = 0; /* last key (for repetition) */ + uint32_t m_to8_kbd_key_count = 0; /* keypress time (for repetition) */ + uint8_t m_to8_kbd_caps = 0; /* caps lock */ + emu_timer* m_to8_kbd_timer = nullptr; /* bit-send */ + emu_timer* m_to8_kbd_signal = nullptr; /* signal from CPU */ + uint8_t m_to8_data_vpage = 0; + uint8_t m_to8_cart_vpage = 0; + uint8_t m_to8_reg_ram = 0; + uint8_t m_to8_reg_cart = 0; + uint8_t m_to8_reg_sys1 = 0; + uint8_t m_to8_reg_sys2 = 0; + uint8_t m_to8_lightpen_intr = 0; + uint8_t m_to8_soft_select = 0; + uint8_t m_to8_soft_bank = 0; + uint8_t m_to8_bios_bank = 0; TIMER_CALLBACK_MEMBER( to8_kbd_timer_cb ); void to8_update_ram_bank_postload(); @@ -534,23 +534,23 @@ void to9_map(address_map &map); void to9p_map(address_map &map); - uint8_t m_to9_palette_data[32]; - uint8_t m_to9_palette_idx; - uint8_t m_to9_soft_bank; - uint8_t m_to9_kbd_parity; /* 0=even, 1=odd, 2=no parity */ - uint8_t m_to9_kbd_intr; /* interrupt mode */ - uint8_t m_to9_kbd_in; /* data from keyboard */ - uint8_t m_to9_kbd_status; /* status */ - uint8_t m_to9_kbd_overrun; /* character lost */ - uint8_t m_to9_kbd_periph; /* peripheral mode */ - uint8_t m_to9_kbd_byte_count; /* byte-count in peripheral mode */ - uint16_t m_to9_mouse_x; - uint16_t m_to9_mouse_y; - uint8_t m_to9_kbd_last_key; /* for key repetition */ - uint16_t m_to9_kbd_key_count; - uint8_t m_to9_kbd_caps; /* caps-lock */ - uint8_t m_to9_kbd_pad; /* keypad outputs special codes */ - emu_timer* m_to9_kbd_timer; + uint8_t m_to9_palette_data[32]{}; + uint8_t m_to9_palette_idx = 0; + uint8_t m_to9_soft_bank = 0; + uint8_t m_to9_kbd_parity = 0; /* 0=even, 1=odd, 2=no parity */ + uint8_t m_to9_kbd_intr = 0; /* interrupt mode */ + uint8_t m_to9_kbd_in = 0; /* data from keyboard */ + uint8_t m_to9_kbd_status = 0; /* status */ + uint8_t m_to9_kbd_overrun = 0; /* character lost */ + uint8_t m_to9_kbd_periph = 0; /* peripheral mode */ + uint8_t m_to9_kbd_byte_count = 0; /* byte-count in peripheral mode */ + uint16_t m_to9_mouse_x = 0; + uint16_t m_to9_mouse_y = 0; + uint8_t m_to9_kbd_last_key = 0; /* for key repetition */ + uint16_t m_to9_kbd_key_count = 0; + uint8_t m_to9_kbd_caps = 0; /* caps-lock */ + uint8_t m_to9_kbd_pad = 0; /* keypad outputs special codes */ + emu_timer* m_to9_kbd_timer = nullptr; void to9_set_video_mode( uint8_t data, int style ); void to9_palette_init(); @@ -709,11 +709,11 @@ private: required_device m_pia_io; required_device m_rs232; - int m_last_low; - int m_centronics_busy; - int m_rxd; - int m_cts; - int m_dsr; + int m_last_low = 0; + int m_centronics_busy = 0; + int m_rxd = 0; + int m_cts = 0; + int m_dsr = 0; /* read data register */ uint8_t porta_in(); diff -Nru mame-0.242+dfsg.1/src/mame/includes/thoop2.h mame-0.243+dfsg.1/src/mame/includes/thoop2.h --- mame-0.242+dfsg.1/src/mame/includes/thoop2.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/thoop2.h 2022-04-29 05:37:26.000000000 +0000 @@ -52,7 +52,7 @@ void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - tilemap_t *m_pant[2]; + tilemap_t *m_pant[2]{}; required_device m_maincpu; required_device m_outlatch; diff -Nru mame-0.242+dfsg.1/src/mame/includes/thunderx.h mame-0.243+dfsg.1/src/mame/includes/thunderx.h --- mame-0.242+dfsg.1/src/mame/includes/thunderx.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/thunderx.h 2022-04-29 05:37:26.000000000 +0000 @@ -60,9 +60,9 @@ optional_shared_ptr m_pmcram; /* misc */ - int m_priority; - uint8_t m_1f98_latch; - emu_timer *m_thunderx_firq_timer; + int m_priority = 0; + uint8_t m_1f98_latch = 0; + emu_timer *m_thunderx_firq_timer = nullptr; void scontra_bankswitch_w(uint8_t data); void thunderx_videobank_w(uint8_t data); diff -Nru mame-0.242+dfsg.1/src/mame/includes/ti85.h mame-0.243+dfsg.1/src/mame/includes/ti85.h --- mame-0.242+dfsg.1/src/mame/includes/ti85.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/ti85.h 2022-04-29 05:37:26.000000000 +0000 @@ -34,15 +34,15 @@ TI84PSE }; -typedef struct +struct ti83pse_timer { - uint8_t loop; - uint8_t setup; - float divsor; - bool interrupt; - uint8_t max; - uint8_t count; -} ti83pse_timer; + uint8_t loop = 0; + uint8_t setup = 0; + float divsor = 1; + bool interrupt = false; + uint8_t max = 0; + uint8_t count = 0; +}; typedef enum TI83PSE_CTIMER { @@ -87,26 +87,26 @@ optional_device m_flash; optional_device_array m_membank; - ti85_model m_model; + ti85_model m_model{}; - uint8_t m_LCD_memory_base; - uint8_t m_LCD_contrast; - uint8_t m_LCD_status; - uint8_t m_timer_interrupt_mask; - uint8_t m_timer_interrupt_status; - uint8_t m_ctimer_interrupt_status; - uint8_t m_ON_interrupt_mask; - uint8_t m_ON_interrupt_status; - uint8_t m_ON_pressed; - uint8_t m_flash_unlocked; - uint8_t m_ti8x_memory_page_1; - uint8_t m_ti8x_memory_page_2; - uint8_t m_ti8x_memory_page_3; - bool m_booting; - uint8_t m_LCD_mask; - uint8_t m_power_mode; - uint8_t m_cpu_speed; - uint8_t m_keypad_mask; + uint8_t m_LCD_memory_base = 0; + uint8_t m_LCD_contrast = 0; + uint8_t m_LCD_status = 0; + uint8_t m_timer_interrupt_mask = 0; + uint8_t m_timer_interrupt_status = 0; + uint8_t m_ctimer_interrupt_status = 0; + uint8_t m_ON_interrupt_mask = 0; + uint8_t m_ON_interrupt_status = 0; + uint8_t m_ON_pressed = 0; + uint8_t m_flash_unlocked = 0; + uint8_t m_ti8x_memory_page_1 = 0; + uint8_t m_ti8x_memory_page_2 = 0; + uint8_t m_ti8x_memory_page_3 = 0; + bool m_booting = false; + uint8_t m_LCD_mask = 0; + uint8_t m_power_mode = 0; + uint8_t m_cpu_speed = 0; + uint8_t m_keypad_mask = 0; uint8_t m_video_buffer_width = 0; uint8_t m_interrupt_speed = 0; uint8_t m_port4_bit0 = 0; diff -Nru mame-0.242+dfsg.1/src/mame/includes/ti89.h mame-0.243+dfsg.1/src/mame/includes/ti89.h --- mame-0.242+dfsg.1/src/mame/includes/ti89.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/ti89.h 2022-04-29 05:37:26.000000000 +0000 @@ -63,29 +63,29 @@ required_ioport m_io_bit7; // HW specifications - uint8_t m_hw_version; - bool m_ram_enabled; + uint8_t m_hw_version = 0; + bool m_ram_enabled = false; // keyboard - uint16_t m_kb_mask; - uint8_t m_on_key; + uint16_t m_kb_mask = 0; + uint8_t m_on_key = 0; // LCD - uint8_t m_lcd_on; - uint32_t m_lcd_base; - uint16_t m_lcd_width; - uint16_t m_lcd_height; - uint16_t m_lcd_contrast; + uint8_t m_lcd_on = 0; + uint32_t m_lcd_base = 0; + uint16_t m_lcd_width = 0; + uint16_t m_lcd_height = 0; + uint16_t m_lcd_contrast = 0; // I/O - uint16_t m_io_hw1[0x10]; - uint16_t m_io_hw2[0x80]; + uint16_t m_io_hw1[0x10]{}; + uint16_t m_io_hw2[0x80]{}; // Timer - uint8_t m_timer_on; - uint8_t m_timer_val; - uint16_t m_timer_mask; - uint64_t m_timer; + uint8_t m_timer_on = 0; + uint8_t m_timer_val = 0; + uint16_t m_timer_mask = 0; + uint64_t m_timer = 0; uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); diff -Nru mame-0.242+dfsg.1/src/mame/includes/tiki100.h mame-0.243+dfsg.1/src/mame/includes/tiki100.h --- mame-0.242+dfsg.1/src/mame/includes/tiki100.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/tiki100.h 2022-04-29 05:37:26.000000000 +0000 @@ -140,25 +140,25 @@ }; // memory state - bool m_rome; - bool m_vire; + bool m_rome = false; + bool m_vire = false; // video state - uint8_t m_scroll; - uint8_t m_mode; - uint8_t m_palette_val; - uint8_t m_current_pixel; + uint8_t m_scroll = 0; + uint8_t m_mode = 0; + uint8_t m_palette_val = 0; + uint8_t m_current_pixel = 0; // keyboard state - int m_keylatch; + int m_keylatch = 0; // printer state - int m_centronics_ack; - int m_centronics_busy; - int m_centronics_perror; + int m_centronics_ack = 0; + int m_centronics_busy = 0; + int m_centronics_perror = 0; // serial state - bool m_st; + bool m_st = false; }; diff -Nru mame-0.242+dfsg.1/src/mame/includes/tmc2000e.h mame-0.243+dfsg.1/src/mame/includes/tmc2000e.h --- mame-0.242+dfsg.1/src/mame/includes/tmc2000e.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/tmc2000e.h 2022-04-29 05:37:26.000000000 +0000 @@ -54,11 +54,11 @@ void dma_w(offs_t offset, uint8_t data); /* video state */ - int m_cdp1864_efx; /* EFx */ - uint8_t m_color; + int m_cdp1864_efx = 0; /* EFx */ + uint8_t m_color = 0; /* keyboard state */ - int m_keylatch; /* key latch */ + int m_keylatch = 0; /* key latch */ void tmc2000e_io_map(address_map &map); void tmc2000e_map(address_map &map); diff -Nru mame-0.242+dfsg.1/src/mame/includes/tmc600.h mame-0.243+dfsg.1/src/mame/includes/tmc600.h --- mame-0.242+dfsg.1/src/mame/includes/tmc600.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/tmc600.h 2022-04-29 05:37:26.000000000 +0000 @@ -81,12 +81,12 @@ uint8_t get_color(uint16_t pma); // video state - int m_vismac_reg_latch; // video register latch - int m_vismac_color_latch; // color latch - bool m_blink; // cursor blink - int m_frame; - bool m_rtc_int; - u8 m_out3; + int m_vismac_reg_latch = 0; // video register latch + int m_vismac_color_latch = 0; // color latch + bool m_blink = false; // cursor blink + int m_frame = 0; + bool m_rtc_int = false; + u8 m_out3 = 0; TIMER_DEVICE_CALLBACK_MEMBER(blink_tick); CDP1869_CHAR_RAM_READ_MEMBER(tmc600_char_ram_r); diff -Nru mame-0.242+dfsg.1/src/mame/includes/tnzs.h mame-0.243+dfsg.1/src/mame/includes/tnzs.h --- mame-0.242+dfsg.1/src/mame/includes/tnzs.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/tnzs.h 2022-04-29 05:37:26.000000000 +0000 @@ -58,7 +58,7 @@ optional_memory_bank m_subbank; /* FIXME: optional because of reuse from cchance.cpp */ /* misc / mcu */ - int m_bank2; + int m_bank2 = 0; }; class tnzs_mcu_state : public tnzs_base_state @@ -96,8 +96,8 @@ required_ioport m_in1; required_ioport m_in2; - int m_input_select; - bool m_lockout_level; + int m_input_select = 0; + bool m_lockout_level = false; }; class tnzs_state : public tnzs_mcu_state @@ -155,16 +155,16 @@ void mcu_reset(); - int m_mcu_initializing; - int m_mcu_coinage_init; - int m_mcu_command; - int m_mcu_readcredits; - int m_mcu_reportcoin; - int m_insertcoin; - uint8_t m_mcu_coinage[4]; - uint8_t m_mcu_coins_a; - uint8_t m_mcu_coins_b; - uint8_t m_mcu_credits; + int m_mcu_initializing = 0; + int m_mcu_coinage_init = 0; + int m_mcu_command = 0; + int m_mcu_readcredits = 0; + int m_mcu_reportcoin = 0; + int m_insertcoin = 0; + uint8_t m_mcu_coinage[4]{}; + uint8_t m_mcu_coins_a = 0; + uint8_t m_mcu_coins_b = 0; + uint8_t m_mcu_credits = 0; void mcu_handle_coins(int coin); }; @@ -209,9 +209,9 @@ /* sound-related */ std::unique_ptr m_sampledata[MAX_SAMPLES]; - int m_samplesize[MAX_SAMPLES]; + int m_samplesize[MAX_SAMPLES]{}; - int m_csport_sel; + int m_csport_sel = 0; }; class jpopnics_state : public tnzs_base_state diff -Nru mame-0.242+dfsg.1/src/mame/includes/toaplan2.h mame-0.243+dfsg.1/src/mame/includes/toaplan2.h --- mame-0.242+dfsg.1/src/mame/includes/toaplan2.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/toaplan2.h 2022-04-29 05:37:26.000000000 +0000 @@ -127,17 +127,17 @@ optional_ioport_array<2> m_io_pad; optional_ioport m_eepromout; - s8 m_old_p1_paddle_h; /* For Ghox */ - s8 m_old_p2_paddle_h; - u8 m_sound_reset_bit; /* 0x20 for dogyuun/batsugun, 0x10 for vfive, 0x08 for fixeight */ - u8 m_sndirq_line; /* IRQ4 for batrider, IRQ2 for bbakraid */ - u8 m_z80_busreq; - u16 m_gfxrom_bank[8]; /* Batrider object bank */ + s8 m_old_p1_paddle_h = 0; /* For Ghox */ + s8 m_old_p2_paddle_h = 0; + u8 m_sound_reset_bit = 0; /* 0x20 for dogyuun/batsugun, 0x10 for vfive, 0x08 for fixeight */ + u8 m_sndirq_line = 0; /* IRQ4 for batrider, IRQ2 for bbakraid */ + u8 m_z80_busreq = 0; + u16 m_gfxrom_bank[8]{}; /* Batrider object bank */ bitmap_ind8 m_custom_priority_bitmap; bitmap_ind16 m_secondary_render_bitmap; - tilemap_t *m_tx_tilemap; /* Tilemap for extra-text-layer */ + tilemap_t *m_tx_tilemap = nullptr; /* Tilemap for extra-text-layer */ u16 video_count_r(); void coin_w(u8 data); void coin_sound_reset_w(u8 data); diff -Nru mame-0.242+dfsg.1/src/mame/includes/topspeed.h mame-0.243+dfsg.1/src/mame/includes/topspeed.h --- mame-0.242+dfsg.1/src/mame/includes/topspeed.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/topspeed.h 2022-04-29 05:37:26.000000000 +0000 @@ -74,16 +74,16 @@ required_ioport m_steer; // Misc - u16 m_cpua_ctrl; - s32 m_ioc220_port; + u16 m_cpua_ctrl = 0; + s32 m_ioc220_port = 0; // ADPCM required_region_ptr_array m_msm_rom; - u16 m_msm_pos[2]; - u8 m_msm_reset[2]; - u8 m_msm_nibble[2]; - u8 m_msm2_vck; - u8 m_msm2_vck2; + u16 m_msm_pos[2]{}; + u8 m_msm_reset[2]{}; + u8 m_msm_nibble[2]{}; + u8 m_msm2_vck = 0; + u8 m_msm2_vck2 = 0; #ifdef MAME_DEBUG u8 m_dislayer[5] = { 0, 0, 0, 0, 0 }; diff -Nru mame-0.242+dfsg.1/src/mame/includes/trs80.h mame-0.243+dfsg.1/src/mame/includes/trs80.h --- mame-0.242+dfsg.1/src/mame/includes/trs80.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/trs80.h 2022-04-29 05:37:26.000000000 +0000 @@ -90,9 +90,9 @@ u8 m_tape_unit = 1U; bool m_reg_load = true; bool m_cassette_data = false; - emu_timer *m_cassette_data_timer = 0; + emu_timer *m_cassette_data_timer = nullptr; double m_old_cassette_val = 0; - bool m_cpl = 0; + bool m_cpl = false; u8 m_cols = 0xffU; bool m_7bit = false; u16 m_timeout = 600U; diff -Nru mame-0.242+dfsg.1/src/mame/includes/trs80m3.h mame-0.243+dfsg.1/src/mame/includes/trs80m3.h --- mame-0.242+dfsg.1/src/mame/includes/trs80m3.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/trs80m3.h 2022-04-29 05:37:26.000000000 +0000 @@ -116,20 +116,20 @@ uint8_t m_mask = 0U; uint8_t m_nmi_mask = 0U; uint8_t m_port_ec = 0U; - bool m_reg_load = 0; + bool m_reg_load = false; uint8_t m_nmi_data = 0U; uint8_t m_cassette_data = 0U; - emu_timer *m_cassette_data_timer; + emu_timer *m_cassette_data_timer = nullptr; double m_old_cassette_val = 0; uint16_t m_start_address = 0U; uint8_t m_crtc_reg = 0U; uint8_t m_size_store = 0U; - bool m_a11_flipflop = 0; + bool m_a11_flipflop = false; uint16_t m_timeout = 0U; - bool m_wait = 0; - bool m_drq_off = 0; - bool m_intrq_off = 0; - floppy_image_device *m_fdd; + bool m_wait = false; + bool m_drq_off = false; + bool m_intrq_off = false; + floppy_image_device *m_fdd = nullptr; required_device m_maincpu; required_memory_region m_region_maincpu; required_region_ptr m_p_chargen; diff -Nru mame-0.242+dfsg.1/src/mame/includes/tryout.h mame-0.243+dfsg.1/src/mame/includes/tryout.h --- mame-0.242+dfsg.1/src/mame/includes/tryout.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/tryout.h 2022-04-29 05:37:26.000000000 +0000 @@ -47,9 +47,9 @@ required_memory_bank m_rombank; - tilemap_t *m_fg_tilemap; - tilemap_t *m_bg_tilemap; - uint8_t m_vram_bank; + tilemap_t *m_fg_tilemap = nullptr; + tilemap_t *m_bg_tilemap = nullptr; + uint8_t m_vram_bank = 0; void nmi_ack_w(uint8_t data); void sound_irq_ack_w(uint8_t data); diff -Nru mame-0.242+dfsg.1/src/mame/includes/turrett.h mame-0.243+dfsg.1/src/mame/includes/turrett.h --- mame-0.242+dfsg.1/src/mame/includes/turrett.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/turrett.h 2022-04-29 05:37:26.000000000 +0000 @@ -130,7 +130,7 @@ private: memory_access<28, 1, 0, ENDIANNESS_LITTLE>::cache m_cache; - sound_stream *m_stream; + sound_stream *m_stream = nullptr; struct { diff -Nru mame-0.242+dfsg.1/src/mame/includes/tutankhm.h mame-0.243+dfsg.1/src/mame/includes/tutankhm.h --- mame-0.242+dfsg.1/src/mame/includes/tutankhm.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/tutankhm.h 2022-04-29 05:37:26.000000000 +0000 @@ -67,13 +67,13 @@ required_memory_bank m_mainbank; /* video-related */ - tilemap_t *m_bg_tilemap; - uint8_t m_flipscreen_x; - uint8_t m_flipscreen_y; + tilemap_t *m_bg_tilemap = nullptr; + uint8_t m_flipscreen_x = 0; + uint8_t m_flipscreen_y = 0; /* misc */ - uint8_t m_irq_toggle; - uint8_t m_irq_enable; + uint8_t m_irq_toggle = 0; + uint8_t m_irq_enable = 0; /* devices */ required_device m_maincpu; @@ -91,11 +91,11 @@ void scramble_draw_stars(bitmap_rgb32 &bitmap, const rectangle &cliprect, int maxx); void scramble_draw_background(bitmap_rgb32 &bitmap, const rectangle &cliprect); - uint8_t m_star_mode; + uint8_t m_star_mode = 0; rgb_t m_star_color[64]; std::unique_ptr m_stars; - uint8_t m_stars_enabled; - uint8_t m_stars_blink_state; + uint8_t m_stars_enabled = 0; + uint8_t m_stars_blink_state = 0; }; #endif // MAME_INCLUDES_TUTANKHM_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/twin16.h mame-0.243+dfsg.1/src/mame/includes/twin16.h --- mame-0.242+dfsg.1/src/mame/includes/twin16.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/twin16.h 2022-04-29 05:37:26.000000000 +0000 @@ -61,18 +61,18 @@ optional_shared_ptr m_sprite_gfx_ram; required_region_ptr m_gfxrom; - uint16_t m_CPUA_register; - uint16_t m_CPUB_register; - bool m_is_fround; - uint16_t m_sprite_buffer[0x800]; - emu_timer *m_sprite_timer; - int m_sprite_busy; - int m_need_process_spriteram; - uint16_t m_scrollx[3]; - uint16_t m_scrolly[3]; - uint16_t m_video_register; - tilemap_t *m_fixed_tmap; - tilemap_t *m_scroll_tmap[2]; + uint16_t m_CPUA_register = 0; + uint16_t m_CPUB_register = 0; + bool m_is_fround = false; + uint16_t m_sprite_buffer[0x800]{}; + emu_timer *m_sprite_timer = nullptr; + int m_sprite_busy = 0; + int m_need_process_spriteram = 0; + uint16_t m_scrollx[3]{}; + uint16_t m_scrolly[3]{}; + uint16_t m_video_register = 0; + tilemap_t *m_fixed_tmap = nullptr; + tilemap_t *m_scroll_tmap[2]{}; void CPUA_register_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); void CPUB_register_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); @@ -131,7 +131,7 @@ virtual void video_start() override; virtual void tile_get_info(tile_data &tileinfo, uint16_t data, int color_base) override; - uint8_t m_gfx_bank[4]; + uint8_t m_gfx_bank[4]{}; }; class cuebrickj_state : public twin16_state @@ -149,7 +149,7 @@ void nvram_bank_w(uint8_t data); void cuebrickj_main_map(address_map &map); - uint16_t m_nvram[0x400 * 0x20 / 2]; + uint16_t m_nvram[0x400 * 0x20 / 2]{}; }; #endif // MAME_INCLUDES_TWIN16_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/tx0.h mame-0.243+dfsg.1/src/mame/includes/tx0.h --- mame-0.242+dfsg.1/src/mame/includes/tx0.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/tx0.h 2022-04-29 05:37:26.000000000 +0000 @@ -68,44 +68,44 @@ /* tape reader registers */ struct tx0_tape_reader_t { - device_image_interface *fd; /* file descriptor of tape image */ + device_image_interface *fd = nullptr; /* file descriptor of tape image */ - int motor_on; /* 1-bit reader motor on */ + int motor_on = 0; /* 1-bit reader motor on */ - int rcl; /* 1-bit reader clutch */ - int rc; /* 2-bit reader counter */ + int rcl = 0; /* 1-bit reader clutch */ + int rc = 0; /* 2-bit reader counter */ - emu_timer *timer; /* timer to simulate reader timing */ + emu_timer *timer = nullptr; /* timer to simulate reader timing */ }; /* tape puncher registers */ struct tape_puncher_t { - device_image_interface *fd; /* file descriptor of tape image */ + device_image_interface *fd = nullptr; /* file descriptor of tape image */ - emu_timer *timer; /* timer to generate completion pulses */ + emu_timer *timer = nullptr; /* timer to generate completion pulses */ }; /* typewriter registers */ struct tx0_typewriter_t { - device_image_interface *fd; /* file descriptor of output image */ + device_image_interface *fd = nullptr; /* file descriptor of output image */ - emu_timer *prt_timer;/* timer to generate completion pulses */ + emu_timer *prt_timer = nullptr;/* timer to generate completion pulses */ }; /* magnetic tape unit registers */ struct magtape_t { - device_image_interface *img; /* image descriptor */ + device_image_interface *img = nullptr; /* image descriptor */ state_t state; - int command; - int binary_flag; + int command = 0; + int binary_flag = 0; union { @@ -122,14 +122,14 @@ } write; } u; - int sel_pending; - int cpy_pending; + int sel_pending = 0; + int cpy_pending = 0; irg_pos_t irg_pos; /* position relative to inter-record gap */ - int long_parity; + int long_parity = 0; - emu_timer *timer; /* timer to simulate reader timing */ + emu_timer *timer = nullptr; /* timer to simulate reader timing */ }; @@ -160,15 +160,15 @@ void schedule_unselect(); protected: - int m_old_typewriter_keys[4]; - int m_old_control_keys; - int m_old_tsr_keys; - int m_tsr_index; - int m_typewriter_color; + int m_old_typewriter_keys[4]{}; + int m_old_control_keys = 0; + int m_old_tsr_keys = 0; + int m_tsr_index = 0; + int m_typewriter_color = 0; bitmap_ind16 m_panel_bitmap; bitmap_ind16 m_typewriter_bitmap; - int m_pos; - int m_case_shift; + int m_pos = 0; + int m_case_shift = 0; virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; diff -Nru mame-0.242+dfsg.1/src/mame/includes/ultraman.h mame-0.243+dfsg.1/src/mame/includes/ultraman.h --- mame-0.242+dfsg.1/src/mame/includes/ultraman.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/ultraman.h 2022-04-29 05:37:26.000000000 +0000 @@ -33,7 +33,7 @@ void ultraman(machine_config &config); private: - int m_bank[3]; + int m_bank[3] = {}; /* devices */ required_device m_maincpu; diff -Nru mame-0.242+dfsg.1/src/mame/includes/undrfire.h mame-0.243+dfsg.1/src/mame/includes/undrfire.h --- mame-0.242+dfsg.1/src/mame/includes/undrfire.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/undrfire.h 2022-04-29 05:37:26.000000000 +0000 @@ -48,12 +48,12 @@ private: struct uf_tempsprite { - u8 gfx; - u32 code,color; - bool flipx,flipy; - int x,y; - int zoomx,zoomy; - u32 primask; + u8 gfx = 0; + u32 code = 0, color = 0; + bool flipx = 0, flipy = 0; + int x = 0, y = 0; + int zoomx = 0, zoomy = 0; + u32 primask = 0; }; required_device m_maincpu; @@ -64,10 +64,10 @@ required_device m_eeprom; optional_shared_ptr m_ram; optional_shared_ptr m_shared_ram; - u16 m_port_sel; - int m_frame_counter; + u16 m_port_sel = 0; + int m_frame_counter = 0; std::unique_ptr m_spritelist; - u16 m_rotate_ctrl[8]; + u16 m_rotate_ctrl[8]{}; #ifdef MAME_DEBUG u8 m_dislayer[6] = { 0, 0, 0, 0, 0, 0 }; #endif diff -Nru mame-0.242+dfsg.1/src/mame/includes/unico.h mame-0.243+dfsg.1/src/mame/includes/unico.h --- mame-0.242+dfsg.1/src/mame/includes/unico.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/unico.h 2022-04-29 05:37:26.000000000 +0000 @@ -55,9 +55,9 @@ private: memory_share_creator m_vram; memory_share_creator m_scroll; - tilemap_t *m_tilemap[3]; - int m_sprites_scrolldx; - int m_sprites_scrolldy; + tilemap_t *m_tilemap[3]{}; + int m_sprites_scrolldx = 0; + int m_sprites_scrolldy = 0; memory_share_creator m_spriteram; }; diff -Nru mame-0.242+dfsg.1/src/mame/includes/vc4000.h mame-0.243+dfsg.1/src/mame/includes/vc4000.h --- mame-0.242+dfsg.1/src/mame/includes/vc4000.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/vc4000.h 2022-04-29 05:37:26.000000000 +0000 @@ -66,31 +66,31 @@ private: struct SPRITE_HELPER { - uint8_t bitmap[10],x1,x2,y1,y2, res1, res2; + uint8_t bitmap[10], x1, x2, y1, y2, res1, res2; }; struct SPRITE { const SPRITE_HELPER *data; - int mask; - int state; - int delay; - int size; - int y; - uint8_t scolor; - int finished; - int finished_now; + int mask = 0; + int state = 0; + int delay = 0; + int size = 0; + int y = 0; + uint8_t scolor = 0; + int finished = 0; + int finished_now = 0; }; struct vc4000_video_t { SPRITE sprites[4]; - int line; - uint8_t sprite_collision; - uint8_t background_collision; + int line = 0; + uint8_t sprite_collision = 0; + uint8_t background_collision = 0; union { - uint8_t data[0x100]; + uint8_t data[0x100]{}; struct { SPRITE_HELPER sprites[3]; @@ -121,14 +121,14 @@ uint8_t elektor_cass_r(); void elektor_cass_w(uint8_t data); vc4000_video_t m_video; - uint8_t m_sprite_collision[0x20]; - uint8_t m_background_collision[0x20]; - uint8_t m_joy1_x; - uint8_t m_joy1_y; - uint8_t m_joy2_x; - uint8_t m_joy2_y; - uint8_t m_objects[512]; - uint8_t m_irq_pause; + uint8_t m_sprite_collision[0x20]{}; + uint8_t m_background_collision[0x20]{}; + uint8_t m_joy1_x = 0; + uint8_t m_joy1_y = 0; + uint8_t m_joy2_x = 0; + uint8_t m_joy2_y = 0; + uint8_t m_objects[512]{}; + uint8_t m_irq_pause = 0; std::unique_ptr m_bitmap; virtual void machine_start() override; virtual void video_start() override; diff -Nru mame-0.242+dfsg.1/src/mame/includes/vendetta.h mame-0.243+dfsg.1/src/mame/includes/vendetta.h --- mame-0.242+dfsg.1/src/mame/includes/vendetta.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/vendetta.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,97 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Ernesto Corvi -/************************************************************************* - - Vendetta - -*************************************************************************/ -#ifndef MAME_INCLUDES_VENDETTA_H -#define MAME_INCLUDES_VENDETTA_H - -#pragma once - -#include "cpu/m6809/konami.h" // for the callback and the firq irq definition -#include "machine/k053252.h" -#include "video/k052109.h" -#include "video/k053246_k053247_k055673.h" -#include "video/k053251.h" -#include "video/k054000.h" -#include "video/konami_helper.h" -#include "emupal.h" - -class vendetta_state : public driver_device -{ -public: - vendetta_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_k052109(*this, "k052109"), - m_k053246(*this, "k053246"), - m_k053251(*this, "k053251"), - m_k053252(*this, "k053252"), - m_k054000(*this, "k054000"), - m_palette(*this, "palette"), - m_videoview0(*this, "videoview0"), - m_videoview1(*this, "videoview1") - { } - - void esckids(machine_config &config); - void vendetta(machine_config &config); - -protected: - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void device_timer(emu_timer &timer, device_timer_id id, int param) override; - -private: - enum - { - TIMER_Z80_NMI - }; - - // video-related - int m_layer_colorbase[3]{}; - int m_sprite_colorbase = 0; - int m_layerpri[3]{}; - - // misc - int m_irq_enabled = 0; - - // devices - required_device m_maincpu; - required_device m_audiocpu; - required_device m_k052109; - required_device m_k053246; - required_device m_k053251; - optional_device m_k053252; - optional_device m_k054000; - required_device m_palette; - - // views - memory_view m_videoview0; - memory_view m_videoview1; - - void eeprom_w(uint8_t data); - uint8_t K052109_r(offs_t offset); - void K052109_w(offs_t offset, uint8_t data); - void _5fe0_w(uint8_t data); - void z80_arm_nmi_w(uint8_t data); - void z80_irq_w(uint8_t data); - uint8_t z80_irq_r(); - - uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - - INTERRUPT_GEN_MEMBER(irq); - - K052109_CB_MEMBER(vendetta_tile_callback); - K052109_CB_MEMBER(esckids_tile_callback); - void banking_callback(uint8_t data); - K053246_CB_MEMBER(sprite_callback); - - void esckids_map(address_map &map); - void main_map(address_map &map); - void sound_map(address_map &map); -}; - -#endif // MAME_INCLUDES_VENDETTA_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/vertigo.h mame-0.243+dfsg.1/src/mame/includes/vertigo.h --- mame-0.242+dfsg.1/src/mame/includes/vertigo.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/vertigo.h 2022-04-29 05:37:26.000000000 +0000 @@ -62,11 +62,11 @@ struct am2901 { - uint32_t ram[16]; /* internal ram */ - uint32_t d; /* direct data D input */ - uint32_t q; /* Q register */ - uint32_t f; /* F ALU result */ - uint32_t y; /* Y output */ + uint32_t ram[16]{}; /* internal ram */ + uint32_t d = 0; /* direct data D input */ + uint32_t q = 0; /* Q register */ + uint32_t f = 0; /* F ALU result */ + uint32_t y = 0; /* Y output */ }; class vector_generator @@ -114,11 +114,11 @@ struct vproc { - uint16_t sram[64]; /* external sram */ - uint16_t ramlatch; /* latch between 2901 and sram */ - uint16_t rom_adr; /* vector ROM/RAM address latch */ - uint32_t pc; /* program counter */ - uint32_t ret; /* return address */ + uint16_t sram[64]{}; /* external sram */ + uint16_t ramlatch = 0; /* latch between 2901 and sram */ + uint16_t rom_adr = 0; /* vector ROM/RAM address latch */ + uint32_t pc = 0; /* program counter */ + uint32_t ret = 0; /* return address */ }; @@ -136,7 +136,7 @@ required_device m_adc; required_shared_ptr m_vectorram; attotime m_irq4_time; - uint8_t m_irq_state; + uint8_t m_irq_state = 0; vproc m_vs; am2901 m_bsp; vector_generator m_vgen; diff -Nru mame-0.242+dfsg.1/src/mame/includes/vigilant.h mame-0.243+dfsg.1/src/mame/includes/vigilant.h --- mame-0.242+dfsg.1/src/mame/includes/vigilant.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/vigilant.h 2022-04-29 05:37:26.000000000 +0000 @@ -25,6 +25,8 @@ void vigilant(machine_config &config); void kikcubic(machine_config &config); void buccanrs(machine_config &config); + void bowmen(machine_config &config); + void init_bowmen(); private: required_device m_maincpu; @@ -43,6 +45,7 @@ int m_rear_color = 0; int m_rear_disable = 0; int m_rear_refresh = 0; + int m_rear_pages = 4; std::unique_ptr m_bg_bitmap; // common @@ -54,6 +57,8 @@ void vigilant_horiz_scroll_w(offs_t offset, uint8_t data); void vigilant_rear_horiz_scroll_w(offs_t offset, uint8_t data); void vigilant_rear_color_w(uint8_t data); + void bowmen_rear_horiz_scroll_w(offs_t offset, uint8_t data); + void bowmen_rear_color_w(uint8_t data); // kikcubic void kikcubic_coin_w(uint8_t data); @@ -64,9 +69,13 @@ uint32_t screen_update_vigilant(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); uint32_t screen_update_kikcubic(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_bowmen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void update_background(); + void update_background_bowmen(); void draw_foreground(bitmap_ind16 &bitmap, const rectangle &cliprect, int priority, int opaque ); + void draw_foreground_bowmen(bitmap_ind16 &bitmap, const rectangle &cliprect, int priority, int opaque ); void draw_background(bitmap_ind16 &bitmap, const rectangle &cliprect); + void draw_background_bowmen(bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect); void vigilant_postload(); @@ -77,6 +86,7 @@ void sound_map(address_map &map); void vigilant_io_map(address_map &map); void vigilant_map(address_map &map); + void bowmen_io_map(address_map &map); }; #endif // MAME_INCLUDES_VIGILANT_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/vp415.h mame-0.243+dfsg.1/src/mame/includes/vp415.h --- mame-0.242+dfsg.1/src/mame/includes/vp415.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/vp415.h 2022-04-29 05:37:26.000000000 +0000 @@ -243,25 +243,25 @@ required_shared_ptr m_ctrlram; required_ioport m_switches; - uint8_t m_sel34; - uint8_t m_sel37; + uint8_t m_sel34 = 0; + uint8_t m_sel37 = 0; - uint8_t m_int_lines[2]; + uint8_t m_int_lines[2]{}; - uint8_t m_refv; + uint8_t m_refv = 0; - uint8_t m_ctrl_cpu_p1; - uint8_t m_ctrl_cpu_p3; - uint8_t m_ctrl_mcu_p1; - uint8_t m_ctrl_mcu_p2; + uint8_t m_ctrl_cpu_p1 = 0; + uint8_t m_ctrl_cpu_p3 = 0; + uint8_t m_ctrl_mcu_p1 = 0; + uint8_t m_ctrl_mcu_p2 = 0; - uint8_t m_drive_p1; - uint8_t m_drive_pc_bits; + uint8_t m_drive_p1 = 0; + uint8_t m_drive_pc_bits = 0; - uint8_t m_drive_rad_mir_dac; - uint8_t m_drive_i8255_pb; - emu_timer *m_drive_2ppr_timer; - uint8_t m_drive_2ppr; + uint8_t m_drive_rad_mir_dac = 0; + uint8_t m_drive_i8255_pb = 0; + emu_timer *m_drive_2ppr_timer = nullptr; + uint8_t m_drive_2ppr = 0; static const char *const DATARAM_TAG; static const char *const SCSI_TAG; diff -Nru mame-0.242+dfsg.1/src/mame/includes/vsmile.h mame-0.243+dfsg.1/src/mame/includes/vsmile.h --- mame-0.242+dfsg.1/src/mame/includes/vsmile.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/vsmile.h 2022-04-29 05:37:26.000000000 +0000 @@ -119,8 +119,8 @@ output_finder<2> m_blueled; output_finder<2> m_greenled; - bool m_ctrl_rts[2]; - bool m_ctrl_select[2]; + bool m_ctrl_rts[2]{}; + bool m_ctrl_select[2]{}; }; class vsmilem_state : public vsmile_state @@ -176,7 +176,7 @@ required_ioport m_io_logo; - uint16_t m_mode; + uint16_t m_mode = 0; }; #endif // MAME_INCLUDES_VSMILE_H diff -Nru mame-0.242+dfsg.1/src/mame/includes/warpwarp.h mame-0.243+dfsg.1/src/mame/includes/warpwarp.h --- mame-0.242+dfsg.1/src/mame/includes/warpwarp.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/warpwarp.h 2022-04-29 05:37:26.000000000 +0000 @@ -71,15 +71,15 @@ optional_ioport m_in_config; optional_ioport_array<4> m_ports; - int m_geebee_bgw; - int m_ball_on; - int m_ball_h; - int m_ball_v; - int m_ball_pen; - int m_ball_sizex; - int m_ball_sizey; - int m_handle_joystick; - tilemap_t *m_bg_tilemap; + int m_geebee_bgw = 0; + int m_ball_on = 0; + int m_ball_h = 0; + int m_ball_v = 0; + int m_ball_pen = 0; + int m_ball_sizex = 0; + int m_ball_sizey = 0; + int m_handle_joystick = 0; + tilemap_t *m_bg_tilemap = nullptr; // warpwarp and bombbee uint8_t warpwarp_sw_r(offs_t offset); diff -Nru mame-0.242+dfsg.1/src/mame/includes/warriorb.h mame-0.243+dfsg.1/src/mame/includes/warriorb.h --- mame-0.242+dfsg.1/src/mame/includes/warriorb.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/warriorb.h 2022-04-29 05:37:26.000000000 +0000 @@ -54,7 +54,7 @@ required_memory_bank m_z80bank; /* misc */ - int m_pandata[4]; + int m_pandata[4]{}; void coin_control_w(u8 data); void sound_bankswitch_w(u8 data); diff -Nru mame-0.242+dfsg.1/src/mame/includes/wecleman.h mame-0.243+dfsg.1/src/mame/includes/wecleman.h --- mame-0.242+dfsg.1/src/mame/includes/wecleman.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/wecleman.h 2022-04-29 05:37:26.000000000 +0000 @@ -86,7 +86,7 @@ int m_cloud_visible = 0; int m_sound_hw_type = 0; bool m_hotchase_sound_hs = 0; - pen_t m_black_pen; + pen_t m_black_pen{}; uint16_t wecleman_protection_r(); void wecleman_protection_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); diff -Nru mame-0.242+dfsg.1/src/mame/includes/wgp.h mame-0.243+dfsg.1/src/mame/includes/wgp.h --- mame-0.242+dfsg.1/src/mame/includes/wgp.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/wgp.h 2022-04-29 05:37:26.000000000 +0000 @@ -96,20 +96,20 @@ required_shared_ptr m_piv_ctrlram; /* video-related */ - tilemap_t *m_piv_tilemap[3]; - u16 m_piv_ctrl_reg; - u16 m_piv_zoom[3]; - u16 m_piv_scrollx[3]; - u16 m_piv_scrolly[3]; - u16 m_rotate_ctrl[8]; - int m_piv_xoffs; - int m_piv_yoffs; - u8 m_dislayer[4]; + tilemap_t *m_piv_tilemap[3]{}; + u16 m_piv_ctrl_reg = 0; + u16 m_piv_zoom[3]{}; + u16 m_piv_scrollx[3]{}; + u16 m_piv_scrolly[3]{}; + u16 m_rotate_ctrl[8]{}; + int m_piv_xoffs = 0; + int m_piv_yoffs = 0; + u8 m_dislayer[4]{}; /* misc */ - u16 m_cpua_ctrl; - u16 m_port_sel; - emu_timer *m_cpub_int6_timer; + u16 m_cpua_ctrl = 0; + u16 m_port_sel = 0; + emu_timer *m_cpub_int6_timer = nullptr; /* devices */ required_device m_maincpu; diff -Nru mame-0.242+dfsg.1/src/mame/includes/x07.h mame-0.243+dfsg.1/src/mame/includes/x07.h --- mame-0.242+dfsg.1/src/mame/includes/x07.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/x07.h 2022-04-29 05:37:26.000000000 +0000 @@ -223,7 +223,7 @@ DECLARE_DEVICE_IMAGE_LOAD_MEMBER( card_load ); /* general */ - uint8_t m_sleep; + uint8_t m_sleep = 0; uint8_t m_warm_start; uint8_t m_t6834_ram[0x800]; uint8_t m_regs_r[8]; @@ -233,16 +233,16 @@ struct fifo_buffer { uint8_t data[0x100]; - uint8_t read; - uint8_t write; + uint8_t read = 0; + uint8_t write = 0; }; fifo_buffer m_in; fifo_buffer m_out; - uint8_t m_udk_on; - uint8_t m_draw_udk; - uint8_t m_sp_on; - uint8_t m_font_code; + uint8_t m_udk_on = 0; + uint8_t m_draw_udk = 0; + uint8_t m_sp_on = 0; + uint8_t m_font_code = 0; emu_timer *m_rsta_clear = nullptr; emu_timer *m_rstb_clear = nullptr; emu_timer *m_beep_stop = nullptr; diff -Nru mame-0.242+dfsg.1/src/mame/includes/x68k.h mame-0.243+dfsg.1/src/mame/includes/x68k.h --- mame-0.242+dfsg.1/src/mame/includes/x68k.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/x68k.h 2022-04-29 05:37:26.000000000 +0000 @@ -155,100 +155,100 @@ struct { - int sram_writeprotect; - int monitor; - int contrast; - int keyctrl; - uint16_t cputype; + int sram_writeprotect = 0; + int monitor = 0; + int contrast = 0; + int keyctrl = 0; + uint16_t cputype = 0; } m_sysport; struct { - floppy_image_device *floppy[4]; - int led_ctrl[4]; - int led_eject[4]; - int eject[4]; - int motor; - int control_drives; - int select_drive; + floppy_image_device *floppy[4]{}; + int led_ctrl[4]{}; + int led_eject[4]{}; + int eject[4]{}; + int motor = 0; + int control_drives = 0; + int select_drive = 0; } m_fdc; struct { - int ioc7; // "Function B operation of joystick # one option" - int ioc6; // "Function A operation of joystick # one option" - int joy1_enable; // IOC4 - int joy2_enable; // IOC5 + int ioc7 = 0; // "Function B operation of joystick # one option" + int ioc6 = 0; // "Function A operation of joystick # one option" + int joy1_enable = 0; // IOC4 + int joy2_enable = 0; // IOC5 } m_joy; struct { - int rate; // ADPCM sample rate - int pan; // ADPCM output switch - int clock; // ADPCM clock speed + int rate = 0; // ADPCM sample rate + int pan = 0; // ADPCM output switch + int clock = 0; // ADPCM clock speed } m_adpcm; struct { // video controller at 0xe82000 - unsigned short reg[3]; - int text_pri; - int sprite_pri; - int gfx_pri; - int gfxlayer_pri[4]; // block displayed for each priority level - int tile8_dirty[1024]; - int tile16_dirty[256]; - int bg_visible_height; - int bg_visible_width; - int bg_hshift; - int bg_vshift; - int bg_hvres; // bits 0,1 = H-Res, bits 2,3 = V-Res, bit 4 = L/H Freq (0=15.98kHz, 1=31.5kHz) + unsigned short reg[3]{}; + int text_pri = 0; + int sprite_pri = 0; + int gfx_pri = 0; + int gfxlayer_pri[4]{}; // block displayed for each priority level + int tile8_dirty[1024]{}; + int tile16_dirty[256]{}; + int bg_visible_height = 0; + int bg_visible_width = 0; + int bg_hshift = 0; + int bg_vshift = 0; + int bg_hvres = 0; // bits 0,1 = H-Res, bits 2,3 = V-Res, bit 4 = L/H Freq (0=15.98kHz, 1=31.5kHz) } m_video; struct { - uint8_t irqstatus; - uint8_t fdcvector; - uint8_t fddvector; - uint8_t hdcvector; - uint8_t prnvector; + uint8_t irqstatus = 0; + uint8_t fdcvector = 0; + uint8_t fddvector = 0; + uint8_t hdcvector = 0; + uint8_t prnvector = 0; } m_ioc; struct { - int inputtype; // determines which input is to be received - bool irqactive; // true if IRQ is being serviced - uint8_t irqvector; - char last_mouse_x; // previous mouse x-axis value - char last_mouse_y; // previous mouse y-axis value - int bufferempty; // non-zero if buffer is empty + int inputtype = 0; // determines which input is to be received + bool irqactive = false; // true if IRQ is being serviced + uint8_t irqvector = 0; + char last_mouse_x = 0; // previous mouse x-axis value + char last_mouse_y = 0; // previous mouse y-axis value + int bufferempty = 0; // non-zero if buffer is empty } m_mouse; struct { // port A - int mux1; // multiplexer value - int seq1; // part of 6-button input sequence. - emu_timer* io_timeout1; + int mux1 = 0; // multiplexer value + int seq1 = 0; // part of 6-button input sequence. + emu_timer* io_timeout1 = nullptr; // port B - int mux2; // multiplexer value - int seq2; // part of 6-button input sequence. - emu_timer* io_timeout2; + int mux2 = 0; // multiplexer value + int seq2 = 0; // part of 6-button input sequence. + emu_timer* io_timeout2 = nullptr; } m_mdctrl; - uint8_t m_ppi_port[3]; - bool m_dmac_int; - bool m_mfp_int; - bool m_exp_irq2[2]; - bool m_exp_irq4[2]; - bool m_exp_nmi[2]; - uint8_t m_current_ipl; - int m_led_state; - emu_timer* m_mouse_timer; - emu_timer* m_led_timer; - unsigned char m_scc_prev; - uint16_t m_ppi_prev; - emu_timer* m_fdc_tc; - emu_timer* m_adpcm_timer; - emu_timer* m_bus_error_timer; - uint16_t* m_spriteram; - tilemap_t* m_bg0_8; - tilemap_t* m_bg1_8; - tilemap_t* m_bg0_16; - tilemap_t* m_bg1_16; - int m_sprite_shift; - bool m_is_32bit; + uint8_t m_ppi_port[3]{}; + bool m_dmac_int = false; + bool m_mfp_int = false; + bool m_exp_irq2[2]{}; + bool m_exp_irq4[2]{}; + bool m_exp_nmi[2]{}; + uint8_t m_current_ipl = 0; + int m_led_state = 0; + emu_timer* m_mouse_timer = nullptr; + emu_timer* m_led_timer = nullptr; + unsigned char m_scc_prev = 0; + uint16_t m_ppi_prev = 0; + emu_timer* m_fdc_tc = nullptr; + emu_timer* m_adpcm_timer = nullptr; + emu_timer* m_bus_error_timer = nullptr; + uint16_t* m_spriteram = nullptr; + tilemap_t* m_bg0_8 = nullptr; + tilemap_t* m_bg1_8 = nullptr; + tilemap_t* m_bg0_16 = nullptr; + tilemap_t* m_bg1_16 = nullptr; + int m_sprite_shift = 0; + bool m_is_32bit = false; TILE_GET_INFO_MEMBER(get_bg0_tile); TILE_GET_INFO_MEMBER(get_bg1_tile); @@ -344,7 +344,7 @@ virtual void machine_start() override; virtual void machine_reset() override; void set_bus_error(uint32_t address, bool write, uint16_t mem_mask); - bool m_bus_error; + bool m_bus_error = false; }; class x68ksupr_state : public x68k_state diff -Nru mame-0.242+dfsg.1/src/mame/includes/xavix.h mame-0.243+dfsg.1/src/mame/includes/xavix.h --- mame-0.242+dfsg.1/src/mame/includes/xavix.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/xavix.h 2022-04-29 05:37:26.000000000 +0000 @@ -51,16 +51,16 @@ virtual void sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) override; private: - sound_stream *m_stream; + sound_stream *m_stream = nullptr; struct xavix_voice { - bool enabled[2]; - uint32_t position[2]; - uint32_t startposition[2]; - uint8_t bank; // no samples appear to cross a bank boundary, so likely wraps - int type; - int rate; - int vol; + bool enabled[2]{}; + uint32_t position[2]{}; + uint32_t startposition[2]{}; + uint8_t bank = 0; // no samples appear to cross a bank boundary, so likely wraps + int type = 0; + int rate = 0; + int vol = 0; }; devcb_read8 m_readregs_cb; @@ -134,8 +134,8 @@ DECLARE_WRITE_LINE_MEMBER(ioevent_trg04); DECLARE_WRITE_LINE_MEMBER(ioevent_trg08); - int m_rgnlen; - uint8_t* m_rgn; + int m_rgnlen = 0; + uint8_t* m_rgn = nullptr; /* this is just a quick memory system bypass for video reads etc. because going through the memory system is slow and also pollutes logs significantly with unmapped reads if the games @@ -200,7 +200,7 @@ optional_device m_nvram; required_device m_screen; required_device m_lowbus; - address_space* m_cpuspace; + address_space* m_cpuspace = nullptr; private: @@ -283,8 +283,8 @@ void ioevent_enable_w(uint8_t data); uint8_t ioevent_irqstate_r(); void ioevent_irqack_w(uint8_t data); - uint8_t m_ioevent_enable; - uint8_t m_ioevent_active; + uint8_t m_ioevent_enable = 0; + uint8_t m_ioevent_active = 0; void process_ioevent(uint8_t bits); void slotreg_7810_w(uint8_t data); @@ -312,8 +312,8 @@ void io0_direction_w(uint8_t data); void io1_direction_w(uint8_t data); - uint8_t m_io0_data; - uint8_t m_io1_data; + uint8_t m_io0_data = 0; + uint8_t m_io1_data = 0; uint8_t m_io0_direction; uint8_t m_io1_direction; @@ -377,13 +377,13 @@ uint8_t sound_irqstatus_r(); void sound_irqstatus_w(uint8_t data); void sound_75ff_w(uint8_t data); - uint8_t m_sound_irqstatus; - uint8_t m_soundreg16_0[2]; - uint8_t m_soundreg16_1[2]; - uint8_t m_sound_regbase; + uint8_t m_sound_irqstatus = 0; + uint8_t m_soundreg16_0[2]{}; + uint8_t m_soundreg16_1[2]{}; + uint8_t m_sound_regbase = 0; TIMER_CALLBACK_MEMBER(sound_timer_done); - emu_timer *m_sound_timer[4]; + emu_timer *m_sound_timer[4]{}; uint8_t timer_status_r(); @@ -393,10 +393,10 @@ uint8_t timer_freq_r(); void timer_freq_w(uint8_t data); uint8_t timer_curval_r(); - uint8_t m_timer_control; - uint8_t m_timer_freq; + uint8_t m_timer_control = 0; + uint8_t m_timer_freq = 0; TIMER_CALLBACK_MEMBER(freq_timer_done); - emu_timer *m_freq_timer; + emu_timer *m_freq_timer = nullptr; void palram_sh_w(offs_t offset, uint8_t data); void palram_l_w(offs_t offset, uint8_t data); @@ -418,7 +418,7 @@ uint8_t xavix_memoryemu_txarray_r(offs_t offset); void xavix_memoryemu_txarray_w(offs_t offset, uint8_t data); - uint8_t m_txarray[3]; + uint8_t m_txarray[3]{}; inline uint8_t txarray_r(uint16_t offset) { @@ -474,40 +474,40 @@ uint8_t anport3_r() { logerror("%s: unhandled anport3_r\n", machine().describe_context()); return 0xff; } void update_irqs(); - uint8_t m_irqsource; + uint8_t m_irqsource = 0; - uint8_t m_vectorenable; - uint8_t m_nmi_vector_lo_data; - uint8_t m_nmi_vector_hi_data; - uint8_t m_irq_vector_lo_data; - uint8_t m_irq_vector_hi_data; - - uint8_t m_spritefragment_dmaparam1[2]; - uint8_t m_spritefragment_dmaparam2[2]; - - uint8_t m_tmap1_regs[8]; - uint8_t m_tmap2_regs[8]; - - int m_arena_start; - int m_arena_end; - uint8_t m_arena_control; - - uint8_t m_6ff0; - uint8_t m_video_ctrl; - - uint8_t m_mastervol; - uint8_t m_unk_snd75f8; - uint8_t m_unk_snd75f9; - uint8_t m_unk_snd75ff; - uint8_t m_sndtimer[4]; + uint8_t m_vectorenable = 0; + uint8_t m_nmi_vector_lo_data = 0; + uint8_t m_nmi_vector_hi_data = 0; + uint8_t m_irq_vector_lo_data = 0; + uint8_t m_irq_vector_hi_data = 0; + + uint8_t m_spritefragment_dmaparam1[2]{}; + uint8_t m_spritefragment_dmaparam2[2]{}; + + uint8_t m_tmap1_regs[8]{}; + uint8_t m_tmap2_regs[8]{}; + + int m_arena_start = 0; + int m_arena_end = 0; + uint8_t m_arena_control = 0; + + uint8_t m_6ff0 = 0; + uint8_t m_video_ctrl = 0; + + uint8_t m_mastervol = 0; + uint8_t m_unk_snd75f8 = 0; + uint8_t m_unk_snd75f9 = 0; + uint8_t m_unk_snd75ff = 0; + uint8_t m_sndtimer[4]{}; - uint8_t m_timer_baseval; + uint8_t m_timer_baseval = 0; int16_t get_vectors(int which, int half); // raster IRQ TIMER_CALLBACK_MEMBER(interrupt_gen); - emu_timer *m_interrupt_timer; + emu_timer *m_interrupt_timer = nullptr; void dispctrl_posirq_x_w(uint8_t data); void dispctrl_posirq_y_w(uint8_t data); @@ -549,12 +549,12 @@ bitmap_ind16 m_zbuffer; - uint8_t m_spritereg; + uint8_t m_spritereg = 0; // variables used by rendering - int m_tmp_dataaddress; - int m_tmp_databit; - uint8_t m_bit; + int m_tmp_dataaddress = 0; + int m_tmp_databit = 0; + uint8_t m_bit = 0; void set_data_address(int address, int bit); uint8_t get_next_bit(); @@ -573,13 +573,13 @@ required_device m_math; optional_device m_xavix2002io; - uint8_t m_extbusctrl[3]; + uint8_t m_extbusctrl[3]{}; virtual uint8_t extintrf_790x_r(offs_t offset); virtual void extintrf_790x_w(offs_t offset, uint8_t data); // additional SuperXaviX / XaviX2002 stuff - uint8_t m_sx_extended_extbus[3]; + uint8_t m_sx_extended_extbus[3]{}; void extended_extbus_reg0_w(uint8_t data); void extended_extbus_reg1_w(uint8_t data); @@ -885,7 +885,7 @@ } } - int m_cartlimit; + int m_cartlimit = 0; required_device m_cartslot; }; diff -Nru mame-0.242+dfsg.1/src/mame/includes/xbox.h mame-0.243+dfsg.1/src/mame/includes/xbox.h --- mame-0.242+dfsg.1/src/mame/includes/xbox.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/xbox.h 2022-04-29 05:37:26.000000000 +0000 @@ -93,14 +93,14 @@ private: void internal_io_map(address_map &map); - lpcbus_host_interface *lpchost; - int lpcindex; - address_space *memspace; - address_space *iospace; + lpcbus_host_interface *lpchost = nullptr; + int lpcindex = 0; + address_space *memspace = nullptr; + address_space *iospace = nullptr; bool configuration_mode; int index; int selected; - uint8_t registers[16][256]; // 256 registers for up to 16 devices, registers 0-0x2f common to all + uint8_t registers[16][256]{}; // 256 registers for up to 16 devices, registers 0-0x2f common to all }; DECLARE_DEVICE_TYPE(XBOX_SUPERIO, xbox_superio_device) diff -Nru mame-0.242+dfsg.1/src/mame/includes/xbox_nv2a.h mame-0.243+dfsg.1/src/mame/includes/xbox_nv2a.h --- mame-0.242+dfsg.1/src/mame/includes/xbox_nv2a.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/xbox_nv2a.h 2022-04-29 05:37:26.000000000 +0000 @@ -233,7 +233,7 @@ float zero[4]; } registers; float output[4]; - } work[WORK_MAX_THREADS]; + } work[WORK_MAX_THREADS]{}; struct { struct { float constantcolor0[4]; @@ -318,7 +318,7 @@ } mapin_rgb; } final; int stages; - } setup; + } setup{}; int used; }; @@ -744,8 +744,8 @@ uint32_t ramin[0x100000 / 4]; uint32_t dma_offset[13]; uint32_t dma_size[13]; - uint8_t *basemempointer; - uint8_t *topmempointer; + uint8_t *basemempointer = nullptr; + uint8_t *topmempointer = nullptr; std::function irq_callback; rectangle clippingwindows[8]; rectangle limits_rendertarget; diff -Nru mame-0.242+dfsg.1/src/mame/includes/xbox_pci.h mame-0.243+dfsg.1/src/mame/includes/xbox_pci.h --- mame-0.242+dfsg.1/src/mame/includes/xbox_pci.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/xbox_pci.h 2022-04-29 05:37:26.000000000 +0000 @@ -62,7 +62,7 @@ void config_register_w(uint32_t data); private: - int ram_size; + int ram_size = 0; std::vector ram; }; @@ -304,25 +304,25 @@ required_device cpu; // APU contains 3 dsps: voice processor (VP) global processor (GP) encode processor (EP) struct apu_state { - uint32_t memory[0x60000 / 4]; - uint32_t gpdsp_sgaddress; // global processor scatter-gather - uint32_t gpdsp_sgblocks; - uint32_t gpdsp_address; - uint32_t epdsp_sgaddress; // encoder processor scatter-gather - uint32_t epdsp_sgblocks; - uint32_t epdsp_sgaddress2; - uint32_t epdsp_sgblocks2; - int voice_number; - uint32_t voices_heap_blockaddr[1024]; - uint64_t voices_active[4]; //one bit for each voice: 1 playing 0 not - uint32_t voicedata_address; - int voices_frequency[256]; // sample rate - int voices_position[256]; // position in samples * 1000 - int voices_position_start[256]; // position in samples * 1000 - int voices_position_end[256]; // position in samples * 1000 - int voices_position_increment[256]; // position increment every 1ms * 1000 - emu_timer *timer; - address_space *space; + uint32_t memory[0x60000 / 4]{}; + uint32_t gpdsp_sgaddress = 0; // global processor scatter-gather + uint32_t gpdsp_sgblocks = 0; + uint32_t gpdsp_address = 0; + uint32_t epdsp_sgaddress = 0; // encoder processor scatter-gather + uint32_t epdsp_sgblocks = 0; + uint32_t epdsp_sgaddress2 = 0; + uint32_t epdsp_sgblocks2 = 0; + int voice_number = 0; + uint32_t voices_heap_blockaddr[1024]{}; + uint64_t voices_active[4]{}; //one bit for each voice: 1 playing 0 not + uint32_t voicedata_address = 0; + int voices_frequency[256]{}; // sample rate + int voices_position[256]{}; // position in samples * 1000 + int voices_position_start[256]{}; // position in samples * 1000 + int voices_position_end[256]{}; // position in samples * 1000 + int voices_position_increment[256]{}; // position increment every 1ms * 1000 + emu_timer *timer = nullptr; + address_space *space = nullptr; } apust; void apu_mmio(address_map &map); uint8_t minimum_grant_r() { return 1; } diff -Nru mame-0.242+dfsg.1/src/mame/includes/xbox_usb.h mame-0.243+dfsg.1/src/mame/includes/xbox_usb.h --- mame-0.242+dfsg.1/src/mame/includes/xbox_usb.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/xbox_usb.h 2022-04-29 05:37:26.000000000 +0000 @@ -11,45 +11,45 @@ struct OHCIEndpointDescriptor { - int mps; // MaximumPacketSize - int f; // Format - int k; // sKip - int s; // Speed - int d; // Direction - int en; // EndpointNumber - int fa; // FunctionAddress - uint32_t tailp; // TDQueueTailPointer - uint32_t headp; // TDQueueHeadPointer - uint32_t nexted; // NextED - int c; // toggleCarry - int h; // Halted - uint32_t word0; + int mps = 0; // MaximumPacketSize + int f = 0; // Format + int k = 0; // sKip + int s = 0; // Speed + int d = 0; // Direction + int en = 0; // EndpointNumber + int fa = 0; // FunctionAddress + uint32_t tailp = 0; // TDQueueTailPointer + uint32_t headp = 0; // TDQueueHeadPointer + uint32_t nexted = 0; // NextED + int c = 0; // toggleCarry + int h = 0; // Halted + uint32_t word0 = 0; }; struct OHCITransferDescriptor { - int cc; // ConditionCode - int ec; // ErrorCount - int t; // DataToggle - int di; // DelayInterrupt - int dp; // Direction/PID - int r; // bufferRounding - uint32_t cbp; // CurrentBufferPointer - uint32_t nexttd; // NextTD - uint32_t be; // BufferEnd - uint32_t word0; + int cc = 0; // ConditionCode + int ec = 0; // ErrorCount + int t = 0; // DataToggle + int di = 0; // DelayInterrupt + int dp = 0; // Direction/PID + int r = 0; // bufferRounding + uint32_t cbp = 0; // CurrentBufferPointer + uint32_t nexttd = 0; // NextTD + uint32_t be = 0; // BufferEnd + uint32_t word0 = 0; }; struct OHCIIsochronousTransferDescriptor { - int cc; // ConditionCode - int fc; // FrameCount - int di; // DelayInterrupt - int sf; // StartingFrame - uint32_t bp0; // BufferPage0 - uint32_t nexttd; // NextTD - uint32_t be; // BufferEnd - uint32_t offset[8]; // Offset/PacketStatusWord - uint32_t word0; - uint32_t word1; + int cc = 0; // ConditionCode + int fc = 0; // FrameCount + int di = 0; // DelayInterrupt + int sf = 0; // StartingFrame + uint32_t bp0 = 0; // BufferPage0 + uint32_t nexttd = 0; // NextTD + uint32_t be = 0; // BufferEnd + uint32_t offset[8]{}; // Offset/PacketStatusWord + uint32_t word0 = 0; + uint32_t word1 = 0; }; enum OHCIRegisters { @@ -192,60 +192,60 @@ }; struct USBSetupPacket { - uint8_t bmRequestType; - uint8_t bRequest; - uint16_t wValue; - uint16_t wIndex; - uint16_t wLength; + uint8_t bmRequestType = 0; + uint8_t bRequest = 0; + uint16_t wValue = 0; + uint16_t wIndex = 0; + uint16_t wLength = 0; }; struct USBStandardDeviceDescriptor { - uint8_t bLength; - uint8_t bDescriptorType; - uint16_t bcdUSB; - uint8_t bDeviceClass; - uint8_t bDeviceSubClass; - uint8_t bDeviceProtocol; - uint8_t bMaxPacketSize0; - uint16_t idVendor; - uint16_t idProduct; - uint16_t bcdDevice; - uint8_t iManufacturer; - uint8_t iProduct; - uint8_t iSerialNumber; - uint8_t bNumConfigurations; + uint8_t bLength = 0; + uint8_t bDescriptorType = 0; + uint16_t bcdUSB = 0; + uint8_t bDeviceClass = 0; + uint8_t bDeviceSubClass = 0; + uint8_t bDeviceProtocol = 0; + uint8_t bMaxPacketSize0 = 0; + uint16_t idVendor = 0; + uint16_t idProduct = 0; + uint16_t bcdDevice = 0; + uint8_t iManufacturer = 0; + uint8_t iProduct = 0; + uint8_t iSerialNumber = 0; + uint8_t bNumConfigurations = 0; }; struct USBStandardConfigurationDescriptor { - uint8_t bLength; - uint8_t bDescriptorType; - uint16_t wTotalLength; - uint8_t bNumInterfaces; - uint8_t bConfigurationValue; - uint8_t iConfiguration; - uint8_t bmAttributes; - uint8_t MaxPower; + uint8_t bLength = 0; + uint8_t bDescriptorType = 0; + uint16_t wTotalLength = 0; + uint8_t bNumInterfaces = 0; + uint8_t bConfigurationValue = 0; + uint8_t iConfiguration = 0; + uint8_t bmAttributes = 0; + uint8_t MaxPower = 0; }; struct USBStandardInterfaceDescriptor { - uint8_t bLength; - uint8_t bDescriptorType; - uint8_t bInterfaceNumber; - uint8_t bAlternateSetting; - uint8_t bNumEndpoints; - uint8_t bInterfaceClass; - uint8_t bInterfaceSubClass; - uint8_t bInterfaceProtocol; - uint8_t iInterface; + uint8_t bLength = 0; + uint8_t bDescriptorType = 0; + uint8_t bInterfaceNumber = 0; + uint8_t bAlternateSetting = 0; + uint8_t bNumEndpoints = 0; + uint8_t bInterfaceClass = 0; + uint8_t bInterfaceSubClass = 0; + uint8_t bInterfaceProtocol = 0; + uint8_t iInterface = 0; }; struct USBStandardEndpointDescriptor { - uint8_t bLength; - uint8_t bDescriptorType; - uint8_t bEndpointAddress; - uint8_t bmAttributes; - uint16_t wMaxPacketSize; - uint8_t bInterval; + uint8_t bLength = 0; + uint8_t bDescriptorType = 0; + uint8_t bEndpointAddress = 0; + uint8_t bmAttributes = 0; + uint16_t wMaxPacketSize = 0; + uint8_t bInterval = 0; }; enum USBPid { @@ -315,22 +315,22 @@ struct usb_device_string { - uint8_t *position; - int size; + uint8_t *position = nullptr; + int size = 0; }; struct usb_device_interfac_alternate { - uint8_t *position; - int size; + uint8_t *position = nullptr; + int size = 0; USBStandardInterfaceDescriptor interface_descriptor; std::forward_list endpoint_descriptors; }; struct usb_device_interfac { - uint8_t *position; - int size; + uint8_t *position = nullptr; + int size = 0; std::forward_list alternate_settings; int selected_alternate; }; @@ -338,8 +338,8 @@ struct usb_device_configuration { USBStandardConfigurationDescriptor configuration_descriptor; - uint8_t *position; - int size; + uint8_t *position = nullptr; + int size = 0; std::forward_list interfaces; }; @@ -376,28 +376,28 @@ void usb_ohci_read_isochronous_transfer_descriptor(uint32_t address); void usb_ohci_writeback_isochronous_transfer_descriptor(uint32_t address); std::function irq_callback; - cpu_device *m_maincpu; + cpu_device *m_maincpu = nullptr; struct { - uint32_t hc_regs[256]; + uint32_t hc_regs[256]{}; struct { - device_usb_ohci_function_interface *function; - int address; - int delay; + device_usb_ohci_function_interface *function = nullptr; + int address = 0; + int delay = 0; } ports[4 + 1]; struct { - device_usb_ohci_function_interface *function; - int port; + device_usb_ohci_function_interface *function = nullptr; + int port = 0; } address[256]; - emu_timer *timer; - int state; - uint32_t framenumber; - uint32_t nextinterupted; - uint32_t nextbulked; - int interruptbulkratio; - int writebackdonehadcounter; - address_space *space; - uint8_t buffer[1024]; + emu_timer *timer = nullptr; + int state = 0; + uint32_t framenumber = 0; + uint32_t nextinterupted = 0; + uint32_t nextbulked = 0; + int interruptbulkratio = 0; + int writebackdonehadcounter = 0; + address_space *space = nullptr; + uint8_t buffer[1024]{}; OHCIEndpointDescriptor endpoint_descriptor; OHCITransferDescriptor transfer_descriptor; OHCIIsochronousTransferDescriptor isochronous_transfer_descriptor; @@ -440,30 +440,30 @@ uint8_t *position_device_descriptor(int &size); uint8_t *position_configuration_descriptor(int index, int &size); uint8_t *position_string_descriptor(int index, int &size); - ohci_usb_controller *busmanager; + ohci_usb_controller *busmanager = nullptr; struct { - int type; - int controldirection; - int controltype; - int controlrecipient; - int remain; - uint8_t *position; - uint8_t buffer[128]; + int type = 0; + int controldirection = 0; + int controltype = 0; + int controlrecipient = 0; + int remain = 0; + uint8_t *position = nullptr; + uint8_t buffer[128]{}; } endpoints[256]; - int state; - bool settingaddress; - int newaddress; - int address; - int configurationvalue; + int state = 0; + bool settingaddress = false; + int newaddress = 0; + int address = 0; + int configurationvalue = 0; std::unique_ptr descriptors; - int descriptors_pos; - bool wantstatuscallback; + int descriptors_pos = 0; + bool wantstatuscallback = false; USBStandardDeviceDescriptor device_descriptor; std::forward_list configurations; std::forward_list device_strings; - usb_device_configuration *latest_configuration; - usb_device_interfac_alternate *latest_alternate; - usb_device_configuration *selected_configuration; + usb_device_configuration *latest_configuration = nullptr; + usb_device_interfac_alternate *latest_alternate = nullptr; + usb_device_configuration *selected_configuration = nullptr; }; /* diff -Nru mame-0.242+dfsg.1/src/mame/includes/xexex.h mame-0.243+dfsg.1/src/mame/includes/xexex.h --- mame-0.242+dfsg.1/src/mame/includes/xexex.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/xexex.h 2022-04-29 05:37:26.000000000 +0000 @@ -62,18 +62,18 @@ required_memory_bank m_z80bank; /* video-related */ - int m_layer_colorbase[4]; - int m_sprite_colorbase; - int m_layerpri[4]; - int m_cur_alpha; + int m_layer_colorbase[4]{}; + int m_sprite_colorbase = 0; + int m_layerpri[4]{}; + int m_cur_alpha = 0; /* misc */ - uint16_t m_cur_control2; - int32_t m_strip_0x1a; - int m_suspension_active; - int m_resume_trigger; - emu_timer *m_dmadelay_timer; - int m_frame; + uint16_t m_cur_control2 = 0; + int32_t m_strip_0x1a = 0; + int m_suspension_active = 0; + int m_resume_trigger = 0; + emu_timer *m_dmadelay_timer = nullptr; + int m_frame = 0; /* devices */ required_device m_maincpu; diff -Nru mame-0.242+dfsg.1/src/mame/includes/xmen.h mame-0.243+dfsg.1/src/mame/includes/xmen.h --- mame-0.242+dfsg.1/src/mame/includes/xmen.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/xmen.h 2022-04-29 05:37:26.000000000 +0000 @@ -40,9 +40,9 @@ private: /* video-related */ - int m_layer_colorbase[3]; - int m_sprite_colorbase; - int m_layerpri[3]; + int m_layer_colorbase[3]{}; + int m_sprite_colorbase = 0; + int m_layerpri[3]{}; /* for xmen6p */ std::unique_ptr m_screen_right; @@ -53,7 +53,7 @@ bool m_xmen6p_tilemap_select; /* misc */ - uint8_t m_vblank_irq_mask; + uint8_t m_vblank_irq_mask = 0; /* devices */ required_device m_maincpu; diff -Nru mame-0.242+dfsg.1/src/mame/includes/xybots.h mame-0.243+dfsg.1/src/mame/includes/xybots.h --- mame-0.242+dfsg.1/src/mame/includes/xybots.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/xybots.h 2022-04-29 05:37:26.000000000 +0000 @@ -55,7 +55,7 @@ required_device m_alpha_tilemap; required_device m_mob; - uint16_t m_h256; + uint16_t m_h256 = 0; static const atari_motion_objects_config s_mob_config; }; diff -Nru mame-0.242+dfsg.1/src/mame/includes/z80ne.h mame-0.243+dfsg.1/src/mame/includes/z80ne.h --- mame-0.242+dfsg.1/src/mame/includes/z80ne.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/z80ne.h 2022-04-29 05:37:26.000000000 +0000 @@ -45,20 +45,20 @@ struct z80ne_cass_data_t { struct { - int length; /* time cassette level is at input.level */ - int level; /* cassette level */ - int bit; /* bit being read */ + int length = 0; /* time cassette level is at input.level */ + int level = 0; /* cassette level */ + int bit = 0; /* bit being read */ } input; struct { - int length; /* time cassette level is at output.level */ - int level; /* cassette level */ - int bit; /* bit to output */ + int length = 0; /* time cassette level is at output.level */ + int level = 0; /* cassette level */ + int bit = 0; /* bit to output */ } output; z80netape_speed speed; /* 300 - 600 - 1200 */ - int wave_filter; - int wave_length; - int wave_short; - int wave_long; + int wave_filter = 0; + int wave_length = 0; + int wave_short = 0; + int wave_long = 0; }; @@ -101,12 +101,12 @@ static void floppy_formats(format_registration &fr); - uint8_t m_lx383_scan_counter; - uint8_t m_lx383_key[LX383_KEYS]; - int m_lx383_downsampler; - uint8_t m_lx385_ctrl; - emu_timer *m_cassette_timer; - emu_timer *m_kbd_timer; + uint8_t m_lx383_scan_counter = 0; + uint8_t m_lx383_key[LX383_KEYS]{}; + int m_lx383_downsampler = 0; + uint8_t m_lx385_ctrl = 0; + emu_timer *m_cassette_timer = nullptr; + emu_timer *m_kbd_timer = nullptr; z80ne_cass_data_t m_cass_data; uint8_t lx383_r(); @@ -140,7 +140,7 @@ required_region_ptr m_rom; optional_shared_ptr m_mram; - emu_timer *m_timer_nmi; + emu_timer *m_timer_nmi = nullptr; cassette_image_device *cassette_device_image(); @@ -228,10 +228,10 @@ struct wd17xx_state_t { - int drq; - int intrq; - uint8_t drive; /* current drive */ - uint8_t head; /* current head */ + int drq = 0; + int intrq = 0; + uint8_t drive = 0; /* current drive */ + uint8_t head = 0; /* current head */ }; void mem_map(address_map &map); diff -Nru mame-0.242+dfsg.1/src/mame/includes/z88.h mame-0.243+dfsg.1/src/mame/includes/z88.h --- mame-0.242+dfsg.1/src/mame/includes/z88.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/includes/z88.h 2022-04-29 05:37:26.000000000 +0000 @@ -105,13 +105,13 @@ struct { - uint8_t slot; - uint8_t page; + uint8_t slot = 0; + uint8_t page = 0; } m_bank[4]; - int m_bank_type[4]; - uint8_t * m_bios; - uint8_t * m_ram_base; + int m_bank_type[4] = {}; + uint8_t * m_bios = 0; + uint8_t * m_ram_base = 0; }; #endif // MAME_INCLUDES_Z88_H diff -Nru mame-0.242+dfsg.1/src/mame/layout/c80.lay mame-0.243+dfsg.1/src/mame/layout/c80.lay --- mame-0.242+dfsg.1/src/mame/layout/c80.lay 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/layout/c80.lay 2022-04-29 05:37:26.000000000 +0000 @@ -10,33 +10,32 @@ + + - + - + - + - + + + + + + + + + + + + + - - - - - - - - - - - - - - - diff -Nru mame-0.242+dfsg.1/src/mame/layout/hh_b5000_test.lay mame-0.243+dfsg.1/src/mame/layout/hh_b5000_test.lay --- mame-0.242+dfsg.1/src/mame/layout/hh_b5000_test.lay 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/layout/hh_b5000_test.lay 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -Nru mame-0.242+dfsg.1/src/mame/layout/hh_rw5000_test.lay mame-0.243+dfsg.1/src/mame/layout/hh_rw5000_test.lay --- mame-0.242+dfsg.1/src/mame/layout/hh_rw5000_test.lay 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/layout/hh_rw5000_test.lay 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru mame-0.242+dfsg.1/src/mame/layout/lependu.lay mame-0.243+dfsg.1/src/mame/layout/lependu.lay --- mame-0.242+dfsg.1/src/mame/layout/lependu.lay 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/layout/lependu.lay 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru mame-0.242+dfsg.1/src/mame/layout/lespendu.lay mame-0.243+dfsg.1/src/mame/layout/lespendu.lay --- mame-0.242+dfsg.1/src/mame/layout/lespendu.lay 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/layout/lespendu.lay 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru mame-0.242+dfsg.1/src/mame/layout/m5gdrag.lay mame-0.243+dfsg.1/src/mame/layout/m5gdrag.lay --- mame-0.242+dfsg.1/src/mame/layout/m5gdrag.lay 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/layout/m5gdrag.lay 2022-04-29 05:37:26.000000000 +0000 @@ -3736,1974 +3736,1001 @@ + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + diff -Nru mame-0.242+dfsg.1/src/mame/layout/m5ggems20.lay mame-0.243+dfsg.1/src/mame/layout/m5ggems20.lay --- mame-0.242+dfsg.1/src/mame/layout/m5ggems20.lay 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/layout/m5ggems20.lay 2022-04-29 05:37:26.000000000 +0000 @@ -3007,1974 +3007,1001 @@ + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + diff -Nru mame-0.242+dfsg.1/src/mame/layout/m5gimmie.lay mame-0.243+dfsg.1/src/mame/layout/m5gimmie.lay --- mame-0.242+dfsg.1/src/mame/layout/m5gimmie.lay 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/layout/m5gimmie.lay 2022-04-29 05:37:26.000000000 +0000 @@ -3596,1974 +3596,1001 @@ + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + diff -Nru mame-0.242+dfsg.1/src/mame/layout/m5grush5.lay mame-0.243+dfsg.1/src/mame/layout/m5grush5.lay --- mame-0.242+dfsg.1/src/mame/layout/m5grush5.lay 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/layout/m5grush5.lay 2022-04-29 05:37:26.000000000 +0000 @@ -1725,1974 +1725,1001 @@ + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + diff -Nru mame-0.242+dfsg.1/src/mame/layout/m5grush.lay mame-0.243+dfsg.1/src/mame/layout/m5grush.lay --- mame-0.242+dfsg.1/src/mame/layout/m5grush.lay 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/layout/m5grush.lay 2022-04-29 05:37:26.000000000 +0000 @@ -1374,1974 +1374,1001 @@ + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + diff -Nru mame-0.242+dfsg.1/src/mame/layout/m5gsstrk07.lay mame-0.243+dfsg.1/src/mame/layout/m5gsstrk07.lay --- mame-0.242+dfsg.1/src/mame/layout/m5gsstrk07.lay 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/layout/m5gsstrk07.lay 2022-04-29 05:37:26.000000000 +0000 @@ -1289,1974 +1289,1001 @@ + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + diff -Nru mame-0.242+dfsg.1/src/mame/layout/m5gstrik.lay mame-0.243+dfsg.1/src/mame/layout/m5gstrik.lay --- mame-0.242+dfsg.1/src/mame/layout/m5gstrik.lay 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/layout/m5gstrik.lay 2022-04-29 05:37:26.000000000 +0000 @@ -4144,1974 +4144,1001 @@ + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + diff -Nru mame-0.242+dfsg.1/src/mame/layout/m5hellrz.lay mame-0.243+dfsg.1/src/mame/layout/m5hellrz.lay --- mame-0.242+dfsg.1/src/mame/layout/m5hellrz.lay 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/layout/m5hellrz.lay 2022-04-29 05:37:26.000000000 +0000 @@ -3363,1974 +3363,1001 @@ + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + diff -Nru mame-0.242+dfsg.1/src/mame/layout/rw10r.lay mame-0.243+dfsg.1/src/mame/layout/rw10r.lay --- mame-0.242+dfsg.1/src/mame/layout/rw10r.lay 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/layout/rw10r.lay 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + diff -Nru mame-0.242+dfsg.1/src/mame/layout/rw18r.lay mame-0.243+dfsg.1/src/mame/layout/rw18r.lay --- mame-0.242+dfsg.1/src/mame/layout/rw18r.lay 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/layout/rw18r.lay 1970-01-01 00:00:00.000000000 +0000 @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff -Nru mame-0.242+dfsg.1/src/mame/layout/rw24k.lay mame-0.243+dfsg.1/src/mame/layout/rw24k.lay --- mame-0.242+dfsg.1/src/mame/layout/rw24k.lay 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/layout/rw24k.lay 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + diff -Nru mame-0.242+dfsg.1/src/mame/layout/rw30r.lay mame-0.243+dfsg.1/src/mame/layout/rw30r.lay --- mame-0.242+dfsg.1/src/mame/layout/rw30r.lay 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/layout/rw30r.lay 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + diff -Nru mame-0.242+dfsg.1/src/mame/layout/s8a.lay mame-0.243+dfsg.1/src/mame/layout/s8a.lay --- mame-0.242+dfsg.1/src/mame/layout/s8a.lay 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/layout/s8a.lay 1970-01-01 00:00:00.000000000 +0000 @@ -1,52 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -Nru mame-0.242+dfsg.1/src/mame/layout/s8.lay mame-0.243+dfsg.1/src/mame/layout/s8.lay --- mame-0.242+dfsg.1/src/mame/layout/s8.lay 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/layout/s8.lay 1970-01-01 00:00:00.000000000 +0000 @@ -1,83 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -Nru mame-0.242+dfsg.1/src/mame/layout/s8pfevr.lay mame-0.243+dfsg.1/src/mame/layout/s8pfevr.lay --- mame-0.242+dfsg.1/src/mame/layout/s8pfevr.lay 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/layout/s8pfevr.lay 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru mame-0.242+dfsg.1/src/mame/layout/s8ratrc.lay mame-0.243+dfsg.1/src/mame/layout/s8ratrc.lay --- mame-0.242+dfsg.1/src/mame/layout/s8ratrc.lay 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/layout/s8ratrc.lay 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru mame-0.242+dfsg.1/src/mame/layout/s8scrzy.lay mame-0.243+dfsg.1/src/mame/layout/s8scrzy.lay --- mame-0.242+dfsg.1/src/mame/layout/s8scrzy.lay 1970-01-01 00:00:00.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/layout/s8scrzy.lay 2022-04-29 05:37:26.000000000 +0000 @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru mame-0.242+dfsg.1/src/mame/machine/315_5296.h mame-0.243+dfsg.1/src/mame/machine/315_5296.h --- mame-0.242+dfsg.1/src/mame/machine/315_5296.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/315_5296.h 2022-04-29 05:37:26.000000000 +0000 @@ -65,8 +65,8 @@ devcb_write_line::array<3> m_out_cnt_cb; uint8_t m_output_latch[8]; - uint8_t m_cnt; - uint8_t m_dir; + uint8_t m_cnt = 0; + uint8_t m_dir = 0; uint8_t m_dir_override; }; diff -Nru mame-0.242+dfsg.1/src/mame/machine/315-5838_317-0229_comp.h mame-0.243+dfsg.1/src/mame/machine/315-5838_317-0229_comp.h --- mame-0.242+dfsg.1/src/mame/machine/315-5838_317-0229_comp.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/315-5838_317-0229_comp.h 2022-04-29 05:37:26.000000000 +0000 @@ -47,20 +47,20 @@ void write_prot_data(uint32_t data, uint32_t mem_mask, int rev_words); void set_prot_addr(uint32_t data, uint32_t mem_mask); - uint32_t m_srcoffset; - uint32_t m_srcstart; // failsafe - bool m_abort; + uint32_t m_srcoffset = 0; + uint32_t m_srcstart = 0; // failsafe + bool m_abort = false; struct { - uint16_t mode; + uint16_t mode = 0; struct { - uint8_t len; /* in bits */ - uint8_t idx; /* in the dictionary */ - uint16_t pattern; /* of the first node */ - } tree[12]; - int it2; - uint8_t dictionary[256]; - int id; + uint8_t len = 0; /* in bits */ + uint8_t idx = 0; /* in the dictionary */ + uint16_t pattern = 0; /* of the first node */ + } tree[13]; + int it2 = 0; + uint8_t dictionary[256]{}; + int id = 0; } m_compstate; void set_table_upload_mode_w(uint16_t val); @@ -69,10 +69,10 @@ uint8_t get_decompressed_byte(void); uint16_t decipher(uint16_t c); - int m_num_bits_compressed; - uint16_t m_val_compressed; - int m_num_bits; - uint16_t m_val; + int m_num_bits_compressed = 0; + uint16_t m_val_compressed = 0; + int m_num_bits = 0; + uint16_t m_val = 0; int m_hackmode; #ifdef SEGA315_DUMP_DEBUG diff -Nru mame-0.242+dfsg.1/src/mame/machine/315-5881_crypt.h mame-0.243+dfsg.1/src/mame/machine/315-5881_crypt.h --- mame-0.242+dfsg.1/src/mame/machine/315-5881_crypt.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/315-5881_crypt.h 2022-04-29 05:37:26.000000000 +0000 @@ -43,7 +43,7 @@ private: - bool first_read; + bool first_read = false; enum { // BUFFER_SIZE = 32768, LINE_SIZE = 512, @@ -51,25 +51,25 @@ FLAG_COMPRESSED = 0x20000 }; - uint32_t key; + uint32_t key = 0; std::unique_ptr buffer; std::unique_ptr line_buffer; std::unique_ptr line_buffer_prev; - uint32_t prot_cur_address; - uint16_t subkey, dec_hist; - uint32_t dec_header; - - bool enc_ready; - - int buffer_pos, line_buffer_pos, line_buffer_size, buffer_bit, buffer_bit2; - uint8_t buffer2[2]; - uint16_t buffer2a; - - int block_size; - int block_pos; - int block_numlines; - int done_compression; + uint32_t prot_cur_address = 0; + uint16_t subkey = 0, dec_hist = 0; + uint32_t dec_header = 0; + + bool enc_ready = 0; + + int buffer_pos = 0, line_buffer_pos = 0, line_buffer_size = 0, buffer_bit = 0, buffer_bit2 = 0; + uint8_t buffer2[2]{}; + uint16_t buffer2a = 0; + + int block_size = 0; + int block_pos = 0; + int block_numlines = 0; + int done_compression = 0; struct sbox { uint8_t table[64]; diff -Nru mame-0.242+dfsg.1/src/mame/machine/315-6154.h mame-0.243+dfsg.1/src/mame/machine/315-6154.h --- mame-0.242+dfsg.1/src/mame/machine/315-6154.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/315-6154.h 2022-04-29 05:37:26.000000000 +0000 @@ -38,7 +38,7 @@ private: address_space_config m_configuration_config; address_space_config m_memory_config; - address_space *m_configuration; + address_space *m_configuration = nullptr; u32 m_registers[0x100 / 4]; u32 m_bases[4 * 3]; diff -Nru mame-0.242+dfsg.1/src/mame/machine/3dom2.h mame-0.243+dfsg.1/src/mame/machine/3dom2.h --- mame-0.242+dfsg.1/src/mame/machine/3dom2.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/3dom2.h 2022-04-29 05:37:26.000000000 +0000 @@ -370,10 +370,10 @@ devcb_write_line::array<4> m_gpio_out; // Registers - uint32_t m_mcfg; - uint32_t m_mref; - uint32_t m_mcntl; - uint32_t m_reset; + uint32_t m_mcfg = 0; + uint32_t m_mref = 0; + uint32_t m_mcntl = 0; + uint32_t m_reset = 0; }; diff -Nru mame-0.242+dfsg.1/src/mame/machine/6883sam.h mame-0.243+dfsg.1/src/mame/machine/6883sam.h --- mame-0.242+dfsg.1/src/mame/machine/6883sam.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/6883sam.h 2022-04-29 05:37:26.000000000 +0000 @@ -144,12 +144,12 @@ memory_access<14, 0, 0, ENDIANNESS_BIG>::cache m_rom_space[3]; memory_access< 5, 0, 0, ENDIANNESS_BIG>::specific m_io_space[3]; memory_access< 7, 0, 0, ENDIANNESS_BIG>::cache m_boot_space; - uint16_t m_counter_mask; + uint16_t m_counter_mask = 0; // SAM state - uint16_t m_counter; - uint8_t m_counter_xdiv; - uint8_t m_counter_ydiv; + uint16_t m_counter = 0; + uint8_t m_counter_xdiv = 0; + uint8_t m_counter_ydiv = 0; // typically called by CPU void internal_write(offs_t offset, uint8_t data); diff -Nru mame-0.242+dfsg.1/src/mame/machine/abc1600mac.cpp mame-0.243+dfsg.1/src/mame/machine/abc1600mac.cpp --- mame-0.242+dfsg.1/src/mame/machine/abc1600mac.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/abc1600mac.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -26,6 +26,8 @@ #define PAGE_WP BIT(page_data, 14) #define PAGE_NONX BIT(page_data, 15) +#define DMAOK 0x04 + //************************************************************************** @@ -98,7 +100,7 @@ m_mac_config("mac", ENDIANNESS_BIG, 8, 20, 0, address_map_constructor(FUNC(abc1600_mac_device::mac_map), this)), m_rom(*this, "boot"), m_segment_ram(*this, "segment_ram", 0x400, ENDIANNESS_LITTLE), - m_page_ram(*this, "page_ram", 0x800, ENDIANNESS_LITTLE), + m_page_ram(*this, "page_ram", 0x400*2, ENDIANNESS_LITTLE), m_watchdog(*this, "watchdog"), m_read_fc(*this), m_write_buserr(*this), @@ -107,7 +109,8 @@ m_boote(0), m_magic(0), m_task(0), - m_cause(0) + m_cause(0), + m_partst(0) { } @@ -130,6 +133,7 @@ save_item(NAME(m_task)); save_item(NAME(m_dmamap)); save_item(NAME(m_cause)); + save_item(NAME(m_partst)); // HACK fill segment RAM or abcenix won't boot memset(m_segment_ram, 0xff, 0x200); @@ -183,6 +187,8 @@ nonx = PAGE_NONX; wp = PAGE_WP; + m_cause = ((offset >> 13) & 0x1f) | DMAOK; + if (LOG && (offset != virtual_offset)) logerror("%s MAC %05x:%06x (SEGA %03x SEGD %02x PGA %03x PGD %04x NONX %u WP %u TASK %u FC %u MAGIC %u)\n", machine().describe_context(), offset, virtual_offset, sega, segd, pga, page_data, nonx, wp, task, m_read_fc(), m_magic); @@ -313,10 +319,12 @@ */ - uint8_t data = 0x02; + uint8_t data = 0; - // DMA status - data |= m_cause; + if (!m_partst) + { + data = 0x02 | m_cause; + } m_watchdog->watchdog_reset(); @@ -573,8 +581,6 @@ bool rw; offs_t virtual_offset = get_dma_address(dmamap, offset, rw); - if (LOG_DMA) logerror("%s DMRQ R %04x:%06x %c\n", machine().describe_context(), offset, virtual_offset, rw ? 'R' : 'W'); - uint8_t data = 0xff; if (rw) @@ -590,6 +596,9 @@ space().write_byte(virtual_offset, data); } + if (LOG_DMA) logerror("%s DMRQ R:%c %04x:%06x=%02x\n", + machine().describe_context(), rw ? 'R' : 'W', offset, virtual_offset, data); + return data; } @@ -603,7 +612,8 @@ bool rw; offs_t virtual_offset = get_dma_address(dmamap, offset, rw); - if (LOG_DMA) logerror("%s DMRQ W %04x:%06x %c\n", machine().describe_context(), offset, virtual_offset, rw ? 'R' : 'W'); + if (LOG_DMA) logerror("%s DMRQ W:%c %04x:%06x=%02x\n", + machine().describe_context(), rw ? 'R' : 'W', offset, virtual_offset, data); if (!rw) { @@ -621,7 +631,8 @@ bool rw; offs_t virtual_offset = 0x1fe000 | get_dma_address(dmamap, offset, rw); - if (LOG_DMA) logerror("%s DIORQ R %04x:%06x\n", machine().describe_context(), offset, virtual_offset); + if (LOG_DMA) logerror("%s DIORQ R %04x:%06x\n", + machine().describe_context(), offset, virtual_offset); return space().read_byte(virtual_offset); } @@ -636,7 +647,8 @@ bool rw; offs_t virtual_offset = 0x1fe000 | get_dma_address(dmamap, offset, rw); - if (LOG_DMA) logerror("%s DIORQ W %04x:%06x\n", machine().describe_context(), offset, virtual_offset); + if (LOG_DMA) logerror("%s DIORQ W %04x:%06x=%02x\n", + machine().describe_context(), offset, virtual_offset, data); space().write_byte(virtual_offset, data); } @@ -663,12 +675,23 @@ */ - if (LOG_DMA) logerror("%s DMAMAP %u:%02x\n", machine().describe_context(), offset & 7, data); + if (LOG_DMA) logerror("%s DMAMAP %u:%02x\n", + machine().describe_context(), offset & 7, data); m_dmamap[offset & 7] = data; } +//------------------------------------------------- +// partst_w - parity test +//------------------------------------------------- + +void abc1600_mac_device::partst_w(int state) +{ + m_partst = state; +} + + //------------------------------------------------- // dump - dump MAC mappings //------------------------------------------------- diff -Nru mame-0.242+dfsg.1/src/mame/machine/abc1600mac.h mame-0.243+dfsg.1/src/mame/machine/abc1600mac.h --- mame-0.242+dfsg.1/src/mame/machine/abc1600mac.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/abc1600mac.h 2022-04-29 05:37:26.000000000 +0000 @@ -56,6 +56,7 @@ uint8_t page_hi_r(offs_t offset); void page_hi_w(offs_t offset, uint8_t data); void dmamap_w(offs_t offset, uint8_t data); + void partst_w(int state); uint8_t dma0_mreq_r(offs_t offset) { return dma_mreq_r(0, DMAMAP_R0_LO, offset); } void dma0_mreq_w(offs_t offset, uint8_t data) { dma_mreq_w(0, DMAMAP_R0_LO, offset, data); } @@ -111,8 +112,8 @@ const address_space_config m_mac_config; required_memory_region m_rom; - memory_share_creator m_segment_ram; - memory_share_creator m_page_ram; + memory_share_creator m_segment_ram; + memory_share_creator m_page_ram; required_device m_watchdog; @@ -122,12 +123,13 @@ devcb_read8::array<3> m_read_tren; devcb_write8::array<3> m_write_tren; - bool m_boote; - bool m_magic; - int m_task; + bool m_boote = 0; + bool m_magic = 0; + int m_task = 0; uint8_t m_dmamap[8]; uint8_t m_cause; + bool m_partst = 0; }; diff -Nru mame-0.242+dfsg.1/src/mame/machine/advision.cpp mame-0.243+dfsg.1/src/mame/machine/advision.cpp --- mame-0.242+dfsg.1/src/mame/machine/advision.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/advision.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,196 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Dan Boris -/*************************************************************************** - - Machine file to handle emulation of the AdventureVision. - -***************************************************************************/ - -#include "emu.h" -#include "includes/advision.h" -#include "cpu/mcs48/mcs48.h" - -/* - 8048 Ports: - - P1 Bit 0..1 - RAM bank select - Bit 3..7 - Keypad input - - P2 Bit 0..3 - A8-A11 - Bit 4..7 - Sound control/Video write address - - T1 Mirror sync pulse -*/ - -/* Machine Initialization */ - -void advision_state::machine_start() -{ - std::string region_tag; - m_cart_rom = memregion(region_tag.assign(m_cart->tag()).append(GENERIC_ROM_REGION_TAG).c_str()); - - /* configure EA banking */ - m_bank1->configure_entry(0, memregion(I8048_TAG)->base()); - if (m_cart_rom) - m_bank1->configure_entry(1, m_cart_rom->base()); - m_maincpu->space(AS_PROGRAM).install_readwrite_bank(0x0000, 0x03ff, m_bank1); - m_bank1->set_entry(0); - - m_sound_d = 0; - m_sound_g = 0; - - /* allocate external RAM */ - m_ext_ram.resize(0x400); - save_item(NAME(m_ext_ram)); - - save_item(NAME(m_ea_bank)); - save_item(NAME(m_rambank)); - save_item(NAME(m_frame_count)); - save_item(NAME(m_frame_start)); - save_item(NAME(m_video_enable)); - save_item(NAME(m_video_bank)); - save_item(NAME(m_led_latch)); - save_item(NAME(m_sound_cmd)); - save_item(NAME(m_sound_d)); - save_item(NAME(m_sound_g)); -} - -void advision_state::machine_reset() -{ - m_ea_bank = 1; - m_rambank = 0x300; - m_frame_start = 0; - m_video_enable = 0; - m_sound_cmd = 0; - - /* enable internal ROM */ - m_maincpu->set_input_line(MCS48_INPUT_EA, CLEAR_LINE); - if (m_cart_rom) - m_bank1->set_entry(m_ea_bank); - - /* reset sound CPU */ - m_soundcpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); -} - -/* Bank Switching */ - -void advision_state::bankswitch_w(uint8_t data) -{ - m_ea_bank = BIT(data, 2); - m_rambank = (data & 0x03) << 8; - - m_maincpu->set_input_line(MCS48_INPUT_EA, m_ea_bank ? ASSERT_LINE : CLEAR_LINE); - if (m_cart_rom) - m_bank1->set_entry(m_ea_bank); -} - -/* External RAM */ - -uint8_t advision_state::ext_ram_r(offs_t offset) -{ - uint8_t data = m_ext_ram[m_rambank + offset]; - - /* the video hardware interprets reads as writes */ - vh_write(data); - - if (m_video_bank == 0x06) - { - m_soundcpu->set_input_line(INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE); - } - - return data; -} - -void advision_state::ext_ram_w(offs_t offset, uint8_t data) -{ - m_ext_ram[m_rambank + offset] = data; -} - -/* Sound */ - -TIMER_CALLBACK_MEMBER( advision_state::sound_cmd_sync ) -{ - m_sound_cmd = param; -} - -uint8_t advision_state::sound_cmd_r() -{ - return m_sound_cmd; -} - -void advision_state::update_dac() -{ - int translate[] = { 2, 0, 0, 1 }; - m_dac->write(translate[(m_sound_g << 1) | m_sound_d]); -} - -void advision_state::sound_g_w(uint8_t data) -{ - m_sound_g = data & 0x01; - - update_dac(); -} - -void advision_state::sound_d_w(uint8_t data) -{ - m_sound_d = data & 0x01; - - update_dac(); -} - -/* Video */ - -void advision_state::av_control_w(uint8_t data) -{ - machine().scheduler().synchronize(timer_expired_delegate(FUNC(advision_state::sound_cmd_sync), this), data >> 4); - - if ((m_video_enable == 0x00) && (data & 0x10)) - { - vh_update(m_video_hpos); - - m_video_hpos++; - - if (m_video_hpos > 255) - { - m_video_hpos = 0; - logerror("HPOS OVERFLOW\n"); - } - } - - m_video_enable = data & 0x10; - m_video_bank = (data & 0xe0) >> 5; -} - -READ_LINE_MEMBER( advision_state::vsync_r ) -{ - if (m_frame_start) - { - m_frame_start = 0; - - return 0; - } - else - { - return 1; - } -} - -/* Input */ - -uint8_t advision_state::controller_r() -{ - // Get joystick switches - uint8_t in = m_joy->read(); - uint8_t data = in | 0x0f; - - // Get buttons - if (in & 0x02) data = data & 0xf7; /* Button 3 */ - if (in & 0x08) data = data & 0xcf; /* Button 1 */ - if (in & 0x04) data = data & 0xaf; /* Button 2 */ - if (in & 0x01) data = data & 0x6f; /* Button 4 */ - - data &= 0xf8; - data |= (m_ea_bank << 2); - data |= (m_rambank >> 8); - return data; -} diff -Nru mame-0.242+dfsg.1/src/mame/machine/agatkeyb.h mame-0.243+dfsg.1/src/mame/machine/agatkeyb.h --- mame-0.242+dfsg.1/src/mame/machine/agatkeyb.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/agatkeyb.h 2022-04-29 05:37:26.000000000 +0000 @@ -60,7 +60,7 @@ attotime typematic_delay() const; attotime typematic_period() const; - bool m_meta; + bool m_meta = false; u16 m_last_modifiers; devcb_write8 m_keyboard_cb; devcb_write_line m_out_meta_cb; diff -Nru mame-0.242+dfsg.1/src/mame/machine/ajax.cpp mame-0.243+dfsg.1/src/mame/machine/ajax.cpp --- mame-0.242+dfsg.1/src/mame/machine/ajax.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/ajax.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,215 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Manuel Abadia -/*************************************************************************** - - ajax.cpp - - Functions to emulate general aspects of the machine (RAM, ROM, interrupts, - I/O ports) - -***************************************************************************/ - -#include "emu.h" -#include "cpu/m6809/m6809.h" -#include "cpu/z80/z80.h" -#include "cpu/m6809/konami.h" - -#include "includes/ajax.h" - -/* bankswitch_w: - Handled by the LS273 Octal +ve edge trigger D-type Flip-flop with Reset at H11: - - Bit Description - --- ----------- - 7 MRB3 Selects ROM N11/N12 - 6 CCOUNT2 Coin Counter 2 (*) - 5 CCOUNT1 Coin Counter 1 (*) - 4 SRESET Slave CPU Reset? - 3 PRI0 Layer Priority Selector - 2 MRB2 \ - 1 MRB1 | ROM Bank Select - 0 MRB0 / - - (*) The Coin Counters are handled by the Konami Custom 051550 -*/ - -void ajax_state::bankswitch_w(uint8_t data) -{ - int bank = 0; - - /* rom select */ - if (!(data & 0x80)) - bank += 4; - - /* coin counters */ - machine().bookkeeping().coin_counter_w(0, data & 0x20); - machine().bookkeeping().coin_counter_w(1, data & 0x40); - - /* priority */ - m_priority = data & 0x08; - - /* bank # (ROMS N11 and N12) */ - bank += (data & 0x07); - membank("mainbank")->set_entry(bank); -} - -/* lamps_w: - Handled by the LS273 Octal +ve edge trigger D-type Flip-flop with Reset at B9: - - Bit Description - --- ----------- - 7 LAMP7 & LAMP8 - Game over lamps (*) - 6 LAMP3 & LAMP4 - Game over lamps (*) - 5 LAMP1 - Start lamp (*) - 4 Control panel quaking (**) - 3 Joystick vibration (**) - 2 LAMP5 & LAMP6 - Power up lamps (*) - 1 LAMP2 - Super weapon lamp (*) - 0 unused - - (*) The Lamps are handled by the M54585P - (**)Vibration/Quaking handled by these chips: - Chip Location Description - ---- -------- ----------- - PS2401-4 B21 ??? - UPA1452H B22 ??? - LS74 H2 Dual +ve edge trigger D-type Flip-flop with SET and RESET - LS393 C20 Dual -ve edge trigger 4-bit Binary Ripple Counter with Resets -*/ - -void ajax_state::lamps_w(uint8_t data) -{ - m_lamps[1] = BIT(data, 1); /* super weapon lamp */ - m_lamps[2] = BIT(data, 2); /* power up lamps */ - m_lamps[5] = BIT(data, 2); /* power up lamps */ - m_lamps[0] = BIT(data, 5); /* start lamp */ - m_lamps[3] = BIT(data, 6); /* game over lamps */ - m_lamps[6] = BIT(data, 6); /* game over lamps */ - m_lamps[4] = BIT(data, 7); /* game over lamps */ - m_lamps[7] = BIT(data, 7); /* game over lamps */ -} - -/* ajax_ls138_f10: - The LS138 1-of-8 Decoder/Demultiplexer at F10 selects what to do: - - Address R/W Description - ------- --- ----------- - 0x0000 (r) ??? I think this read is because a CPU core bug - (w) 0x0000 NSFIRQ Trigger FIRQ on the M6809 - 0x0020 AFR Watchdog reset (handled by the 051550) - 0x0040 (w) SOUND Cause interrupt on the Z80 - 0x0080 (w) SOUNDDATA Sound code number - 0x00c0 (w) MBL1 Enables the LS273 at H11 (Banking + Coin counters) - 0x0100 (r) MBL2 Enables 2P Inputs reading - 0x0140 (w) MBL3 Enables the LS273 at B9 (Lamps + Vibration) - 0x0180 (r) MIO1 Enables 1P Inputs + DIPSW #1 & #2 reading - 0x01c0 (r) MIO2 Enables DIPSW #3 reading -*/ - -uint8_t ajax_state::ls138_f10_r(offs_t offset) -{ - int data = 0, index; - static const char *const portnames[] = { "SYSTEM", "P1", "DSW1", "DSW2" }; - - switch ((offset & 0x01c0) >> 6) - { - case 0x00: /* ??? */ - data = machine().rand(); - break; - case 0x04: /* 2P inputs */ - data = ioport("P2")->read(); - break; - case 0x06: /* 1P inputs + DIPSW #1 & #2 */ - index = offset & 0x01; - data = ioport((offset & 0x02) ? portnames[2 + index] : portnames[index])->read(); - break; - case 0x07: /* DIPSW #3 */ - data = ioport("DSW3")->read(); - break; - - default: - logerror("%04x: (ls138_f10) read from an unknown address %02x\n",m_maincpu->pc(), offset); - } - - return data; -} - -void ajax_state::ls138_f10_w(offs_t offset, uint8_t data) -{ - switch ((offset & 0x01c0) >> 6) - { - case 0x00: /* NSFIRQ + AFR */ - if (offset) - m_watchdog->watchdog_reset(); - else{ - if (m_firq_enable) /* Cause interrupt on slave CPU */ - m_subcpu->set_input_line(M6809_FIRQ_LINE, HOLD_LINE); - } - break; - case 0x01: /* Cause interrupt on audio CPU */ - m_audiocpu->set_input_line(0, HOLD_LINE); - break; - case 0x02: /* Sound command number */ - m_soundlatch->write(data); - break; - case 0x03: /* Bankswitch + coin counters + priority*/ - bankswitch_w(data); - break; - case 0x05: /* Lamps + Joystick vibration + Control panel quaking */ - lamps_w(data); - break; - - default: - logerror("%04x: (ls138_f10) write %02x to an unknown address %02x\n", m_maincpu->pc(), data, offset); - } -} - -/* bankswitch_w_2: - Handled by the LS273 Octal +ve edge trigger D-type Flip-flop with Reset at K14: - - Bit Description - --- ----------- - 7 unused - 6 RMRD Enable char ROM reading through the video RAM - 5 RVO enables 051316 wraparound - 4 FIRQST FIRQ control - 3 SRB3 \ - 2 SRB2 | - 1 SRB1 | ROM Bank Select - 0 SRB0 / -*/ - -void ajax_state::bankswitch_2_w(uint8_t data) -{ - /* enable char ROM reading through the video RAM */ - m_k052109->set_rmrd_line((data & 0x40) ? ASSERT_LINE : CLEAR_LINE); - - /* bit 5 enables 051316 wraparound */ - m_k051316->wraparound_enable(data & 0x20); - - /* FIRQ control */ - m_firq_enable = data & 0x10; - - /* bank # (ROMS G16 and I16) */ - membank("subbank")->set_entry(data & 0x0f); -} - -void ajax_state::machine_start() -{ - uint8_t *MAIN = memregion("maincpu")->base(); - uint8_t *SUB = memregion("sub")->base(); - - m_lamps.resolve(); - membank("mainbank")->configure_entries(0, 4, &MAIN[0x00000], 0x2000); - membank("mainbank")->configure_entries(4, 8, &MAIN[0x10000], 0x2000); - membank("subbank")->configure_entries(0, 9, &SUB[0x00000], 0x2000); - - save_item(NAME(m_priority)); - save_item(NAME(m_firq_enable)); -} - -void ajax_state::machine_reset() -{ - m_priority = 0; - m_firq_enable = 0; -} diff -Nru mame-0.242+dfsg.1/src/mame/machine/alpha8201.h mame-0.243+dfsg.1/src/mame/machine/alpha8201.h --- mame-0.242+dfsg.1/src/mame/machine/alpha8201.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/alpha8201.h 2022-04-29 05:37:26.000000000 +0000 @@ -33,10 +33,10 @@ required_device m_mcu; // internal state - int m_bus; // shared RAM bus direction - u16 m_mcu_address; // MCU side RAM address - u16 m_mcu_d; // MCU D output data - u8 m_mcu_r[4]; // MCU R0-R3 output data + int m_bus = 0; // shared RAM bus direction + u16 m_mcu_address = 0; // MCU side RAM address + u16 m_mcu_d = 0; // MCU D output data + u8 m_mcu_r[4]{}; // MCU R0-R3 output data std::unique_ptr m_shared_ram; // 1KB RAM void mcu_update_address(); diff -Nru mame-0.242+dfsg.1/src/mame/machine/apexc.h mame-0.243+dfsg.1/src/mame/machine/apexc.h --- mame-0.242+dfsg.1/src/mame/machine/apexc.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/apexc.h 2022-04-29 05:37:26.000000000 +0000 @@ -51,7 +51,7 @@ private: virtual void device_start() override { } - int m_writable; + int m_writable = 0; }; /* diff -Nru mame-0.242+dfsg.1/src/mame/machine/apollo_kbd.h mame-0.243+dfsg.1/src/mame/machine/apollo_kbd.h --- mame-0.242+dfsg.1/src/mame/machine/apollo_kbd.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/apollo_kbd.h 2022-04-29 05:37:26.000000000 +0000 @@ -103,10 +103,10 @@ private: apollo_kbd_device *m_device; // pointer back to our device - int m_last_b; // previous mouse button values - int m_last_x; // previous mouse x-axis value - int m_last_y; // previous mouse y-axis value - int m_tx_pending; // mouse data packet is pending + int m_last_b = 0; // previous mouse button values + int m_last_x = 0; // previous mouse x-axis value + int m_last_y = 0; // previous mouse y-axis value + int m_tx_pending = 0; // mouse data packet is pending }; static const int XMIT_RING_SIZE = 64; diff -Nru mame-0.242+dfsg.1/src/mame/machine/apple2common.h mame-0.243+dfsg.1/src/mame/machine/apple2common.h --- mame-0.242+dfsg.1/src/mame/machine/apple2common.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/apple2common.h 2022-04-29 05:37:26.000000000 +0000 @@ -35,11 +35,11 @@ private: optional_device m_GScpu; - double m_x_calibration, m_y_calibration; - double m_joystick_x1_time; - double m_joystick_y1_time; - double m_joystick_x2_time; - double m_joystick_y2_time; + double m_x_calibration = 0, m_y_calibration = 0; + double m_joystick_x1_time = 0; + double m_joystick_y1_time = 0; + double m_joystick_x2_time = 0; + double m_joystick_y2_time = 0; offs_t com_2byte_op(std::ostream &stream, offs_t pc, const util::disasm_interface::data_buffer &opcodes, const char *opname); offs_t com_3byte_op(std::ostream &stream, offs_t pc, const util::disasm_interface::data_buffer &opcodes, const char *opname); diff -Nru mame-0.242+dfsg.1/src/mame/machine/atarixga.h mame-0.243+dfsg.1/src/mame/machine/atarixga.h --- mame-0.242+dfsg.1/src/mame/machine/atarixga.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/atarixga.h 2022-04-29 05:37:26.000000000 +0000 @@ -60,9 +60,9 @@ FPGA_DECIPHER }; - fpga_mode m_mode; - uint16_t m_address; // last written address - uint16_t m_ciphertext; // last written ciphertext + fpga_mode m_mode{}; + uint16_t m_address = 0; // last written address + uint16_t m_ciphertext = 0; // last written ciphertext }; class atari_136095_0072_device : public atari_xga_device @@ -98,13 +98,13 @@ struct { - uint16_t addr; - uint32_t data[64]; + uint16_t addr = 0; + uint32_t data[64]{}; } m_update; - fpga_mode m_mode; - uint8_t m_poly_lsb; - uint16_t m_reply; + fpga_mode m_mode{}; + uint8_t m_poly_lsb = 0; + uint16_t m_reply = 0; }; diff -Nru mame-0.242+dfsg.1/src/mame/machine/at.h mame-0.243+dfsg.1/src/mame/machine/at.h --- mame-0.242+dfsg.1/src/mame/machine/at.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/at.h 2022-04-29 05:37:26.000000000 +0000 @@ -55,16 +55,16 @@ required_device m_mc146818; optional_device m_keybc; // removed in mtouchxl.cpp and vis.cpp - uint8_t m_at_spkrdata; - uint8_t m_pit_out2; - int m_dma_channel; - bool m_cur_eop, m_cur_eop2; - uint8_t m_dma_offset[2][4]; - uint8_t m_at_pages[0x10]; - uint16_t m_dma_high_byte; - uint8_t m_at_speaker; - uint8_t m_channel_check; - uint8_t m_nmi_enabled; + uint8_t m_at_spkrdata = 0; + uint8_t m_pit_out2 = 0; + int m_dma_channel = 0; + bool m_cur_eop = false, m_cur_eop2 = false; + uint8_t m_dma_offset[2][4]{}; + uint8_t m_at_pages[0x10]{}; + uint16_t m_dma_high_byte = 0; + uint8_t m_at_speaker = 0; + uint8_t m_channel_check = 0; + uint8_t m_nmi_enabled = 0; DECLARE_WRITE_LINE_MEMBER(pit8254_out2_changed); diff -Nru mame-0.242+dfsg.1/src/mame/machine/bacta_datalogger.cpp mame-0.243+dfsg.1/src/mame/machine/bacta_datalogger.cpp --- mame-0.242+dfsg.1/src/mame/machine/bacta_datalogger.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/bacta_datalogger.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -68,11 +68,11 @@ { if (is_transmit_register_empty()) { - if (m_output_char != -1) + if (m_output_char != 255) { set_tra_rate(1200); transmit_register_setup(m_output_char); - m_output_char = -1; + m_output_char = 255; } } } diff -Nru mame-0.242+dfsg.1/src/mame/machine/bfm_bd1.h mame-0.243+dfsg.1/src/mame/machine/bfm_bd1.h --- mame-0.242+dfsg.1/src/mame/machine/bfm_bd1.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/bfm_bd1.h 2022-04-29 05:37:26.000000000 +0000 @@ -45,25 +45,25 @@ std::unique_ptr > m_outputs; uint8_t m_port_val; - int m_cursor_pos; - int m_window_start; // display window start pos 0-15 - int m_window_end; // display window end pos 0-15 - int m_window_size; // window size - int m_shift_count; - int m_shift_data; - int m_pcursor_pos; - int m_scroll_active; - int m_display_mode; - int m_flash_rate; - int m_flash_control; - int m_sclk; - int m_data; + int m_cursor_pos = 0; + int m_window_start = 0; // display window start pos 0-15 + int m_window_end = 0; // display window end pos 0-15 + int m_window_size = 0; // window size + int m_shift_count = 0; + int m_shift_data = 0; + int m_pcursor_pos = 0; + int m_scroll_active = 0; + int m_display_mode = 0; + int m_flash_rate = 0; + int m_flash_control = 0; + int m_sclk = 0; + int m_data = 0; - uint8_t m_cursor; - uint16_t m_chars[16]; - uint8_t m_attrs[16]; - uint16_t m_user_data; // user defined character data (16 bit) - uint16_t m_user_def; // user defined character state + uint8_t m_cursor = 0; + uint16_t m_chars[16]{}; + uint8_t m_attrs[16]{}; + uint16_t m_user_data = 0; // user defined character data (16 bit) + uint16_t m_user_def = 0; // user defined character state }; DECLARE_DEVICE_TYPE(BFM_BD1, bfm_bd1_device) diff -Nru mame-0.242+dfsg.1/src/mame/machine/bfm_bda.h mame-0.243+dfsg.1/src/mame/machine/bfm_bda.h --- mame-0.242+dfsg.1/src/mame/machine/bfm_bda.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/bfm_bda.h 2022-04-29 05:37:26.000000000 +0000 @@ -42,25 +42,25 @@ std::unique_ptr > m_outputs; uint8_t m_port_val; - int m_cursor_pos; - int m_window_start; // display window start pos 0-15 - int m_window_end; // display window end pos 0-15 - int m_window_size; // window size - int m_shift_count; - int m_shift_data; - int m_pcursor_pos; - int m_blank_flag; - int m_flash_flag; - int m_scroll_active; - int m_display_mode; - int m_flash_rate; - int m_flash_control; + int m_cursor_pos = 0; + int m_window_start = 0; // display window start pos 0-15 + int m_window_end = 0; // display window end pos 0-15 + int m_window_size = 0; // window size + int m_shift_count = 0; + int m_shift_data = 0; + int m_pcursor_pos = 0; + int m_blank_flag = 0; + int m_flash_flag = 0; + int m_scroll_active = 0; + int m_display_mode = 0; + int m_flash_rate = 0; + int m_flash_control = 0; - uint8_t m_cursor; - uint16_t m_chars[16]; - uint8_t m_attrs[16]; - uint16_t m_user_data; // user defined character data (16 bit) - uint16_t m_user_def; // user defined character state + uint8_t m_cursor = 0; + uint16_t m_chars[16]{}; + uint8_t m_attrs[16]{}; + uint16_t m_user_data = 0; // user defined character data (16 bit) + uint16_t m_user_def = 0; // user defined character state }; DECLARE_DEVICE_TYPE(BFM_BDA, bfm_bda_device) diff -Nru mame-0.242+dfsg.1/src/mame/machine/cat702.cpp mame-0.243+dfsg.1/src/mame/machine/cat702.cpp --- mame-0.242+dfsg.1/src/mame/machine/cat702.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/cat702.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -95,6 +95,8 @@ m_select(1), m_clock(1), m_datain(1), + m_state(0), + m_bit(0), m_dataout_handler(*this) { } @@ -119,6 +121,8 @@ m_dataout_handler.resolve_safe(); save_item(NAME(m_select)); + save_item(NAME(m_clock)); + save_item(NAME(m_datain)); save_item(NAME(m_state)); save_item(NAME(m_bit)); diff -Nru mame-0.242+dfsg.1/src/mame/machine/cdicdic.cpp mame-0.243+dfsg.1/src/mame/machine/cdicdic.cpp --- mame-0.242+dfsg.1/src/mame/machine/cdicdic.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/cdicdic.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -931,7 +931,7 @@ LOGMASKED(LOG_SECTORS, "Disc sector, current LBA: %08x, MSF: %02x %02x %02x\n", real_lba, mins_bcd, secs_bcd, frac_bcd); uint8_t buffer[2560] = { 0 }; - cdrom_read_data(m_cd, m_curr_lba, buffer, CD_TRACK_RAW_DONTCARE); + m_cd->read_data(m_curr_lba, buffer, cdrom_file::CD_TRACK_RAW_DONTCARE); // Detect (badly) if we're dealing with a byteswapped loose-bin image if (buffer[0] == 0xff && buffer[1] == 0x00) @@ -1022,23 +1022,23 @@ if (m_disc_mode == DISC_TOC) { uint8_t *toc_buffer = buffer; - const cdrom_toc *toc = cdrom_get_toc(m_cd); + const cdrom_file::toc &toc = m_cd->get_toc(); uint32_t entry_count = 0; // Determine total frame count for data, and total audio track count - uint32_t frames = toc->tracks[0].pregap; + uint32_t frames = toc.tracks[0].pregap; int audio_tracks = 0; int other_tracks = 0; - uint32_t audio_starts[CD_MAX_TRACKS]; - for (uint32_t i = 0; i < toc->numtrks; i++) + uint32_t audio_starts[cdrom_file::MAX_TRACKS]; + for (uint32_t i = 0; i < toc.numtrks; i++) { - if (toc->tracks[i].trktype != CD_TRACK_AUDIO) + if (toc.tracks[i].trktype != cdrom_file::CD_TRACK_AUDIO) { - frames += toc->tracks[i].frames + toc->tracks[i].extraframes; + frames += toc.tracks[i].frames + toc.tracks[i].extraframes; } else { - audio_starts[audio_tracks++] = toc->tracks[i].logframeofs; + audio_starts[audio_tracks++] = toc.tracks[i].logframeofs; } } @@ -1572,7 +1572,7 @@ else { // Arcade case - m_cd = cdrom_open(machine().rom_load().get_disk_handle(":cdrom")); + m_cd = new cdrom_file(machine().rom_load().get_disk_handle(":cdrom")); } m_audio_timer->adjust(attotime::from_hz(75), 0, attotime::from_hz(75)); diff -Nru mame-0.242+dfsg.1/src/mame/machine/cedar_magnet_board.h mame-0.243+dfsg.1/src/mame/machine/cedar_magnet_board.h --- mame-0.242+dfsg.1/src/mame/machine/cedar_magnet_board.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/cedar_magnet_board.h 2022-04-29 05:37:26.000000000 +0000 @@ -44,11 +44,11 @@ TIMER_CALLBACK_MEMBER(halt_clear_callback); TIMER_CALLBACK_MEMBER(reset_clear_callback); - bool m_is_running; - emu_timer *m_halt_assert_timer; - emu_timer *m_halt_clear_timer; - emu_timer *m_reset_assert_timer; - emu_timer *m_reset_clear_timer; + bool m_is_running = false; + emu_timer *m_halt_assert_timer = nullptr; + emu_timer *m_halt_clear_timer = nullptr; + emu_timer *m_reset_assert_timer = nullptr; + emu_timer *m_reset_clear_timer = nullptr; }; #endif // MAME_MACHINE_CEDAR_MAGNET_BOARD_H diff -Nru mame-0.242+dfsg.1/src/mame/machine/cedar_magnet_flop.h mame-0.243+dfsg.1/src/mame/machine/cedar_magnet_flop.h --- mame-0.242+dfsg.1/src/mame/machine/cedar_magnet_flop.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/cedar_magnet_flop.h 2022-04-29 05:37:26.000000000 +0000 @@ -34,14 +34,14 @@ private: required_region_ptr m_disk; - u8 m_flopdat; - u8 m_flopcmd; - u8 m_flopsec; - u8 m_flopstat; - u8 m_floptrk; + u8 m_flopdat = 0; + u8 m_flopcmd = 0; + u8 m_flopsec = 0; + u8 m_flopstat = 0; + u8 m_floptrk = 0; - u8 m_curtrack; - int m_secoffs; + u8 m_curtrack = 0; + int m_secoffs = 0; }; diff -Nru mame-0.242+dfsg.1/src/mame/machine/cedar_magnet_plane.h mame-0.243+dfsg.1/src/mame/machine/cedar_magnet_plane.h --- mame-0.242+dfsg.1/src/mame/machine/cedar_magnet_plane.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/cedar_magnet_plane.h 2022-04-29 05:37:26.000000000 +0000 @@ -34,17 +34,17 @@ private: std::unique_ptr m_framebuffer; - int m_curline; - int m_lineoffset; + int m_curline = 0; + int m_lineoffset = 0; - u8 m_pio0_pa_data; - u8 m_pio0_pb_data; - u8 m_scrollx; - u8 m_scrolly; - int m_direction; + u8 m_pio0_pa_data = 0; + u8 m_pio0_pb_data = 0; + u8 m_scrollx = 0; + u8 m_scrolly = 0; + int m_direction = 0; - u8 m_cd_data; - u8 m_cf_data; + u8 m_cd_data = 0; + u8 m_cf_data = 0; u8 pio0_pa_r(); void pio0_pa_w(u8 data); diff -Nru mame-0.242+dfsg.1/src/mame/machine/cedar_magnet_sprite.h mame-0.243+dfsg.1/src/mame/machine/cedar_magnet_sprite.h --- mame-0.242+dfsg.1/src/mame/machine/cedar_magnet_sprite.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/cedar_magnet_sprite.h 2022-04-29 05:37:26.000000000 +0000 @@ -44,20 +44,20 @@ void do_blit(); std::unique_ptr m_framebuffer; - u8 m_pio2_pb_data; + u8 m_pio2_pb_data = 0; required_device m_sprite_ram_bankdev; - u8 m_upperaddr; - u8 m_loweraddr; + u8 m_upperaddr = 0; + u8 m_loweraddr = 0; - u8 m_spritesize; - u8 m_pio0_pb_data; - u8 m_spritecodelow; - u8 m_spritecodehigh; + u8 m_spritesize = 0; + u8 m_pio0_pb_data = 0; + u8 m_spritecodelow = 0; + u8 m_spritecodehigh = 0; - int m_high_write; - u8 m_uppersprite; + int m_high_write = 0; + u8 m_uppersprite = 0; u8 pio0_pa_r(); void pio0_pa_w(u8 data); diff -Nru mame-0.242+dfsg.1/src/mame/machine/coco.cpp mame-0.243+dfsg.1/src/mame/machine/coco.cpp --- mame-0.242+dfsg.1/src/mame/machine/coco.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/coco.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -691,7 +691,7 @@ { /* conventional joystick */ joyval = analog->input(joystick, joystick_axis); - joyin_value = (dac_output() <= (joyval / 10)); + joyin_value = (dac_output() <= (joyval / 16)); } break; @@ -1019,10 +1019,23 @@ if (m_hiresjoy_ca && !newvalue) { /* hi to lo */ - double value = m_joystick.input(joystick_index, axis) / 640.0; - value *= is_cocomax3 ? 2500.0 : 4250.0; - value += is_cocomax3 ? 400.0 : 592.0; - attotime duration = m_maincpu->clocks_to_attotime((uint64_t) value) * 2; + double value = m_joystick.input(joystick_index, axis) / 1023.0; + + attotime duration; + + if (is_cocomax3) + { + value *= 2500.0; + value += 400.0; + duration = m_maincpu->clocks_to_attotime((uint64_t) value) * 2; + } + else /* Tandy Hi-Res Joystick Interface */ + { + value *= 5850.0; + value += 535.0; + duration = attotime::from_usec(value); + } + m_hiresjoy_transition_timer[axis]->adjust(duration); } else if (!m_hiresjoy_ca && newvalue) diff -Nru mame-0.242+dfsg.1/src/mame/machine/coco_vhd.h mame-0.243+dfsg.1/src/mame/machine/coco_vhd.h --- mame-0.242+dfsg.1/src/mame/machine/coco_vhd.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/coco_vhd.h 2022-04-29 05:37:26.000000000 +0000 @@ -56,10 +56,10 @@ private: required_device m_cpu; - address_space * m_cpu_space; - uint32_t m_logical_record_number; - uint32_t m_buffer_address; - uint8_t m_status; + address_space * m_cpu_space = nullptr; + uint32_t m_logical_record_number = 0; + uint32_t m_buffer_address = 0; + uint8_t m_status = 0; }; // device type definition diff -Nru mame-0.242+dfsg.1/src/mame/machine/cuda.h mame-0.243+dfsg.1/src/mame/machine/cuda.h --- mame-0.242+dfsg.1/src/mame/machine/cuda.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/cuda.h 2022-04-29 05:37:26.000000000 +0000 @@ -90,21 +90,21 @@ virtual void device_timer(emu_timer &timer, device_timer_id id, int param) override; private: - uint8_t ddrs[3]; - uint8_t ports[3]; - uint8_t pll_ctrl; - uint8_t timer_ctrl; - uint8_t timer_counter, ripple_counter; - uint8_t onesec; - uint8_t treq, byteack, tip, via_data, via_clock, last_adb; - uint64_t last_adb_time; - bool cuda_controls_power; - bool adb_in; - int reset_line; - int m_adb_dtime; - emu_timer *m_timer, *m_prog_timer; - uint8_t pram[0x100], disk_pram[0x100]; - bool pram_loaded; + uint8_t ddrs[3]{}; + uint8_t ports[3]{}; + uint8_t pll_ctrl = 0; + uint8_t timer_ctrl = 0; + uint8_t timer_counter = 0, ripple_counter = 0; + uint8_t onesec = 0; + uint8_t treq = 0, byteack = 0, tip = 0, via_data = 0, via_clock = 0, last_adb = 0; + uint64_t last_adb_time = 0; + bool cuda_controls_power = false; + bool adb_in = false; + int reset_line = 0; + int m_adb_dtime = 0; + emu_timer *m_timer = nullptr, *m_prog_timer = nullptr; + uint8_t pram[0x100]{}, disk_pram[0x100]{}; + bool pram_loaded = false; void send_port(uint8_t offset, uint8_t data); }; diff -Nru mame-0.242+dfsg.1/src/mame/machine/dc-ctrl.h mame-0.243+dfsg.1/src/mame/machine/dc-ctrl.h --- mame-0.242+dfsg.1/src/mame/machine/dc-ctrl.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/dc-ctrl.h 2022-04-29 05:37:26.000000000 +0000 @@ -36,10 +36,10 @@ // device-level overrides virtual void device_start() override; - const char *model, *license, *versions; - uint32_t id; - uint32_t electric_current; - uint32_t region; + const char *model = nullptr, *license = nullptr, *versions = nullptr; + uint32_t id = 0; + uint32_t electric_current = 0; + uint32_t region = 0; optional_ioport_array<8> port; diff -Nru mame-0.242+dfsg.1/src/mame/machine/dmv_keyb.h mame-0.243+dfsg.1/src/mame/machine/dmv_keyb.h --- mame-0.242+dfsg.1/src/mame/machine/dmv_keyb.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/dmv_keyb.h 2022-04-29 05:37:26.000000000 +0000 @@ -44,9 +44,9 @@ required_device m_maincpu; required_ioport_array<16> m_keyboard; - uint8_t m_col; - int m_sd_data_state; - int m_sd_poll_state; + uint8_t m_col = 0; + int m_sd_data_state = 0; + int m_sd_poll_state = 0; uint8_t port1_r(); uint8_t port2_r(); diff -Nru mame-0.242+dfsg.1/src/mame/machine/docg3.h mame-0.243+dfsg.1/src/mame/machine/docg3.h --- mame-0.242+dfsg.1/src/mame/machine/docg3.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/docg3.h 2022-04-29 05:37:26.000000000 +0000 @@ -72,26 +72,26 @@ void sec_2_write16(uint32_t offset, uint16_t data); void sec_2_write8(uint32_t offset, uint8_t data); - int m_size; + int m_size = 0; - uint32_t m_planes; - uint32_t m_blocks; - uint32_t m_pages; - uint32_t m_user_data_size; - uint32_t m_extra_area_size; - std::unique_ptr m_data[3]; - uint32_t m_data_size[3]; - uint8_t m_sec_2[0x800]; - uint32_t m_data_1036; - uint32_t m_data_1036_count; - uint32_t m_transfer_offset; - uint8_t m_device; - uint32_t m_block; - uint32_t m_page; - uint32_t m_plane; - uint32_t m_transfersize; - uint8_t m_test; - uint32_t m_address_count; + uint32_t m_planes = 0; + uint32_t m_blocks = 0; + uint32_t m_pages = 0; + uint32_t m_user_data_size = 0; + uint32_t m_extra_area_size = 0; + std::unique_ptr m_data[3]{}; + uint32_t m_data_size[3]{}; + uint8_t m_sec_2[0x800]{}; + uint32_t m_data_1036 = 0; + uint32_t m_data_1036_count = 0; + uint32_t m_transfer_offset = 0; + uint8_t m_device = 0; + uint32_t m_block = 0; + uint32_t m_page = 0; + uint32_t m_plane = 0; + uint32_t m_transfersize = 0; + uint8_t m_test = 0; + uint32_t m_address_count = 0; }; // device type definition diff -Nru mame-0.242+dfsg.1/src/mame/machine/egret.h mame-0.243+dfsg.1/src/mame/machine/egret.h --- mame-0.242+dfsg.1/src/mame/machine/egret.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/egret.h 2022-04-29 05:37:26.000000000 +0000 @@ -101,28 +101,28 @@ virtual void device_timer(emu_timer &timer, device_timer_id id, int param) override; private: - uint8_t ddrs[3]; - uint8_t ports[3]; - uint8_t pll_ctrl; - uint8_t timer_ctrl; - uint8_t timer_counter; - uint8_t onesec; - uint8_t xcvr_session, via_full, sys_session, via_data, via_clock, last_adb; - uint64_t last_adb_time; - bool egret_controls_power; - bool adb_in; - int reset_line; - int m_adb_dtime; - emu_timer *m_timer; - uint8_t pram[0x100], disk_pram[0x100]; - bool pram_loaded; + uint8_t ddrs[3]{}; + uint8_t ports[3]{}; + uint8_t pll_ctrl = 0; + uint8_t timer_ctrl = 0; + uint8_t timer_counter = 0; + uint8_t onesec = 0; + uint8_t xcvr_session = 0, via_full = 0, sys_session = 0, via_data = 0, via_clock = 0, last_adb = 0; + uint64_t last_adb_time = 0; + bool egret_controls_power = false; + bool adb_in = false; + int reset_line = 0; + int m_adb_dtime = 0; + emu_timer *m_timer = nullptr; + uint8_t pram[0x100]{}, disk_pram[0x100]{}; + bool pram_loaded = false; #if USE_BUS_ADB optional_device m_adb_connector[2]; - adb_device *m_adb_device[2]; - bool m_adb_device_out[2]; - bool m_adb_device_poweron[2]; - bool m_adb_out; + adb_device *m_adb_device[2]{}; + bool m_adb_device_out[2]{}; + bool m_adb_device_poweron[2]{}; + bool m_adb_out = false; #endif void send_port(uint8_t offset, uint8_t data); diff -Nru mame-0.242+dfsg.1/src/mame/machine/elan_eu3a05commonsys.h mame-0.243+dfsg.1/src/mame/machine/elan_eu3a05commonsys.h --- mame-0.242+dfsg.1/src/mame/machine/elan_eu3a05commonsys.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/elan_eu3a05commonsys.h 2022-04-29 05:37:26.000000000 +0000 @@ -36,15 +36,15 @@ required_device m_cpu; required_device m_bank; - uint8_t m_intmask[2]; + uint8_t m_intmask[2]{}; - int m_custom_irq; - int m_custom_nmi; - uint16_t m_custom_irq_vector; - uint16_t m_custom_nmi_vector; + int m_custom_irq = 0; + int m_custom_nmi = 0; + uint16_t m_custom_irq_vector = 0; + uint16_t m_custom_nmi_vector = 0; - uint8_t m_rombank_hi; - uint8_t m_rombank_lo; + uint8_t m_rombank_hi = 0; + uint8_t m_rombank_lo = 0; bool m_is_pal; // this is usually a jumper connected to the chip that the software can read (clocks also differ on PAL units) bool m_allow_timer_irq; @@ -62,7 +62,7 @@ uint8_t radica_5009_unk_r() { return machine().rand(); } - emu_timer *m_unk_timer; + emu_timer *m_unk_timer = nullptr; static const device_timer_id TIMER_UNK = 0; int m_whichtimer; diff -Nru mame-0.242+dfsg.1/src/mame/machine/esqlcd.h mame-0.243+dfsg.1/src/mame/machine/esqlcd.h --- mame-0.242+dfsg.1/src/mame/machine/esqlcd.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/esqlcd.h 2022-04-29 05:37:26.000000000 +0000 @@ -22,9 +22,9 @@ virtual void device_start() override; virtual void device_reset() override; - uint8_t m_lcdpg[4][32]; - int m_lcdPage; - int m_lcdPos, m_lcdSavedPos; + uint8_t m_lcdpg[4][32]{}; + int m_lcdPage = 0; + int m_lcdPos = 0, m_lcdSavedPos = 0; output_finder<4, 32*7> m_lcdPix; output_finder<16> m_leds; @@ -35,7 +35,7 @@ static char rotate_lcd_char(uint8_t lcdChar, int charRow); - int m_lcd_command; + int m_lcd_command = 0; }; DECLARE_DEVICE_TYPE(ESQ2X16_SQ1, esq2x16_sq1_device) diff -Nru mame-0.242+dfsg.1/src/mame/machine/esqvfd.h mame-0.243+dfsg.1/src/mame/machine/esqvfd.h --- mame-0.242+dfsg.1/src/mame/machine/esqvfd.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/esqvfd.h 2022-04-29 05:37:26.000000000 +0000 @@ -51,14 +51,14 @@ virtual void device_timer(emu_timer &timer, device_timer_id id, int param) override; output_helper::ptr m_vfds; - int m_cursx, m_cursy; - int m_savedx, m_savedy; - int const m_rows, m_cols; - uint8_t m_curattr; - uint8_t m_lastchar; - uint8_t m_chars[2][40]; - uint8_t m_attrs[2][40]; - uint8_t m_dirty[2][40]; + int m_cursx = 0, m_cursy = 0; + int m_savedx = 0, m_savedy = 0; + int const m_rows = 0, m_cols = 0; + uint8_t m_curattr = 0; + uint8_t m_lastchar = 0; + uint8_t m_chars[2][40]{}; + uint8_t m_attrs[2][40]{}; + uint8_t m_dirty[2][40]{}; }; class esq1x22_device : public esqvfd_device { diff -Nru mame-0.242+dfsg.1/src/mame/machine/fidel_clockdiv.h mame-0.243+dfsg.1/src/mame/machine/fidel_clockdiv.h --- mame-0.242+dfsg.1/src/mame/machine/fidel_clockdiv.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/fidel_clockdiv.h 2022-04-29 05:37:26.000000000 +0000 @@ -39,9 +39,9 @@ memory_passthrough_handler m_read_tap; memory_passthrough_handler m_write_tap; - u16 m_div_status; - double m_div_scale; - emu_timer *m_div_timer; + u16 m_div_status = 0; + double m_div_scale = 0; + emu_timer *m_div_timer = nullptr; }; diff -Nru mame-0.242+dfsg.1/src/mame/machine/gaelcrpt.h mame-0.243+dfsg.1/src/mame/machine/gaelcrpt.h --- mame-0.242+dfsg.1/src/mame/machine/gaelcrpt.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/gaelcrpt.h 2022-04-29 05:37:26.000000000 +0000 @@ -26,7 +26,7 @@ private: int decrypt(int const enc_prev_word, int const dec_prev_word, int const enc_word); - int32_t m_lastpc, m_lastoffset, m_lastencword, m_lastdecword; + int32_t m_lastpc = 0, m_lastoffset = 0, m_lastencword = 0, m_lastdecword = 0; // config uint8_t m_param1; diff -Nru mame-0.242+dfsg.1/src/mame/machine/gdrom.cpp mame-0.243+dfsg.1/src/mame/machine/gdrom.cpp --- mame-0.242+dfsg.1/src/mame/machine/gdrom.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/gdrom.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -246,9 +246,17 @@ // READ TOC (GD-ROM ver.) case 0x14: { + if (m_cdrom == nullptr) + { + m_phase = SCSI_PHASE_STATUS; + m_status_code = SCSI_STATUS_CODE_CHECK_CONDITION; + m_transfer_length = 0; + break; + } + // TODO: is this correct? int start_trk = command[2]; - int end_trk = cdrom_get_last_track(m_cdrom); + int end_trk = m_cdrom->get_last_track(); int length; int allocation_length = SCSILengthFromUINT16( &command[ 3 ] ); @@ -335,7 +343,7 @@ { while (dataLength > 0) { - if (!cdrom_read_data(m_cdrom, m_lba, tmp_buffer, CD_TRACK_MODE1)) + if (!m_cdrom->read_data(m_lba, tmp_buffer, cdrom_file::CD_TRACK_MODE1)) { LOGWARN("CD read error!\n"); } @@ -387,7 +395,7 @@ start_trk = 1; } - end_trk = cdrom_get_last_track(m_cdrom); + end_trk = m_cdrom->get_last_track(); len = (end_trk * 8) + 2; // the returned TOC DATA LENGTH must be the full amount, @@ -419,13 +427,13 @@ } data[dptr++] = 0; - data[dptr++] = cdrom_get_adr_control(m_cdrom, cdrom_track); + data[dptr++] = m_cdrom->get_adr_control(cdrom_track); data[dptr++] = i; data[dptr++] = 0; - tstart = cdrom_get_track_start(m_cdrom, cdrom_track); + tstart = m_cdrom->get_track_start(cdrom_track); if ((command[1]&2)>>1) - tstart = lba_to_msf(tstart); + tstart = cdrom_file::lba_to_msf(tstart); data[dptr++] = (tstart>>24) & 0xff; data[dptr++] = (tstart>>16) & 0xff; data[dptr++] = (tstart>>8) & 0xff; @@ -494,7 +502,7 @@ // try to find if the mounted chd is from an actual gd-rom disc if (m_cdrom) - if (cdrom_get_toc(m_cdrom)->flags & CD_FLAG_GDROM) + if (m_cdrom->get_toc().flags & cdrom_file::CD_FLAG_GDROM) is_real_gdrom_disc = true; } diff -Nru mame-0.242+dfsg.1/src/mame/machine/gdrom.h mame-0.243+dfsg.1/src/mame/machine/gdrom.h --- mame-0.242+dfsg.1/src/mame/machine/gdrom.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/gdrom.h 2022-04-29 05:37:26.000000000 +0000 @@ -35,9 +35,9 @@ private: uint8_t GDROM_Cmd11_Reply[32]; - uint32_t read_type; // for command 0x30 only - uint32_t data_select; // for command 0x30 only - uint32_t transferOffset; + uint32_t read_type = 0; // for command 0x30 only + uint32_t data_select = 0; // for command 0x30 only + uint32_t transferOffset = 0; bool is_real_gdrom_disc; }; diff -Nru mame-0.242+dfsg.1/src/mame/machine/hal2.h mame-0.243+dfsg.1/src/mame/machine/hal2.h --- mame-0.242+dfsg.1/src/mame/machine/hal2.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/hal2.h 2022-04-29 05:37:26.000000000 +0000 @@ -82,27 +82,27 @@ required_device m_ldac; required_device m_rdac; - uint16_t m_isr; - uint16_t m_iar; - uint16_t m_idr[4]; - - uint16_t m_codeca_ctrl[2]; - uint16_t m_codeca_channel; - uint16_t m_codeca_clock; - uint16_t m_codeca_channel_count; - - uint16_t m_codecb_ctrl[2]; - uint16_t m_codecb_channel; - uint16_t m_codecb_clock; - uint16_t m_codecb_channel_count; - - uint16_t m_bres_clock_sel[3]; - uint16_t m_bres_clock_inc[3]; - uint16_t m_bres_clock_modctrl[3]; - uint16_t m_bres_clock_freq[3]; - attotime m_bres_clock_rate[3]; + uint16_t m_isr = 0; + uint16_t m_iar = 0; + uint16_t m_idr[4]{}; + + uint16_t m_codeca_ctrl[2]{}; + uint16_t m_codeca_channel = 0; + uint16_t m_codeca_clock = 0; + uint16_t m_codeca_channel_count = 0; + + uint16_t m_codecb_ctrl[2]{}; + uint16_t m_codecb_channel = 0; + uint16_t m_codecb_clock = 0; + uint16_t m_codecb_channel_count = 0; + + uint16_t m_bres_clock_sel[3]{}; + uint16_t m_bres_clock_inc[3]{}; + uint16_t m_bres_clock_modctrl[3]{}; + uint16_t m_bres_clock_freq[3]{}; + attotime m_bres_clock_rate[3]{}; - uint16_t m_curr_dac; + uint16_t m_curr_dac = 0; static const uint32_t s_channel_pair[4]; }; diff -Nru mame-0.242+dfsg.1/src/mame/machine/hp48_port.h mame-0.243+dfsg.1/src/mame/machine/hp48_port.h --- mame-0.242+dfsg.1/src/mame/machine/hp48_port.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/hp48_port.h 2022-04-29 05:37:26.000000000 +0000 @@ -59,8 +59,8 @@ void fill_port(); void unfill_port(); - int m_module; /* memory module where the port is visible */ - int m_max_size; /* maximum size, in bytes 128 KB or 4 GB */ + int m_module = 0; /* memory module where the port is visible */ + int m_max_size = 0; /* maximum size, in bytes 128 KB or 4 GB */ uint32_t m_port_size; bool m_port_write; diff -Nru mame-0.242+dfsg.1/src/mame/machine/hpc1.h mame-0.243+dfsg.1/src/mame/machine/hpc1.h --- mame-0.242+dfsg.1/src/mame/machine/hpc1.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/hpc1.h 2022-04-29 05:37:26.000000000 +0000 @@ -96,15 +96,15 @@ struct scsi_dma_t { - uint32_t m_desc; - uint32_t m_addr; - uint32_t m_ctrl; - uint32_t m_length; - uint32_t m_next; - bool m_irq; - bool m_drq; - bool m_to_mem; - bool m_active; + uint32_t m_desc = 0; + uint32_t m_addr = 0; + uint32_t m_ctrl = 0; + uint32_t m_length = 0; + uint32_t m_next = 0; + bool m_irq = false; + bool m_drq = false; + bool m_to_mem = false; + bool m_active = false; }; static void cdrom_config(device_t *device); @@ -112,19 +112,19 @@ static void indigo_mice(device_slot_interface &device); void wd33c93(device_t *device); - uint8_t m_misc_status; - uint32_t m_cpu_aux_ctrl; - uint32_t m_parbuf_ptr; - uint32_t m_local_int_status[2]; - uint32_t m_local_int_mask[2]; - bool m_int_status[2]; - uint32_t m_vme_int_mask[2]; + uint8_t m_misc_status = 0; + uint32_t m_cpu_aux_ctrl = 0; + uint32_t m_parbuf_ptr = 0; + uint32_t m_local_int_status[2]{}; + uint32_t m_local_int_mask[2]{}; + bool m_int_status[2]{}; + uint32_t m_vme_int_mask[2]{}; scsi_dma_t m_scsi_dma; - uint8_t m_duart_int_status; + uint8_t m_duart_int_status = 0; - address_space *m_cpu_space; + address_space *m_cpu_space = nullptr; static char const *const RS232A_TAG; static char const *const RS232B_TAG; diff -Nru mame-0.242+dfsg.1/src/mame/machine/hpc3.h mame-0.243+dfsg.1/src/mame/machine/hpc3.h --- mame-0.242+dfsg.1/src/mame/machine/hpc3.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/hpc3.h 2022-04-29 05:37:26.000000000 +0000 @@ -127,15 +127,15 @@ struct pbus_dma_t { - bool m_active; - uint32_t m_cur_ptr; - uint32_t m_desc_ptr; - uint32_t m_desc_flags; - uint32_t m_next_ptr; - uint32_t m_bytes_left; - uint32_t m_config; - uint32_t m_control; - emu_timer *m_timer; + bool m_active = false; + uint32_t m_cur_ptr = 0; + uint32_t m_desc_ptr = 0; + uint32_t m_desc_flags = 0; + uint32_t m_next_ptr = 0; + uint32_t m_bytes_left = 0; + uint32_t m_config = 0; + uint32_t m_control = 0; + emu_timer *m_timer = nullptr; }; enum @@ -177,10 +177,10 @@ ENET_XMIT = 1 }; - const address_space_config m_pio_space_config[10]; + const address_space_config m_pio_space_config[10]{}; required_address_space m_gio64_space; - address_space *m_pio_space[10]; + address_space *m_pio_space[10]{}; required_device m_hal2; required_device m_enet; @@ -199,23 +199,23 @@ devcb_write_line m_eeprom_pre_cb; devcb_write_line m_dma_complete_int_cb; - uint32_t m_intstat; - uint32_t m_misc; - uint32_t m_cpu_aux_ctrl; + uint32_t m_intstat = 0; + uint32_t m_misc = 0; + uint32_t m_cpu_aux_ctrl = 0; struct scsi_dma_t { - uint32_t m_cbp; - uint32_t m_nbdp; - uint8_t m_ctrl; - uint32_t m_bc; - uint16_t m_count; - uint32_t m_dmacfg; - uint32_t m_piocfg; - bool m_drq; - bool m_big_endian; - bool m_to_device; - bool m_active; + uint32_t m_cbp = 0; + uint32_t m_nbdp = 0; + uint8_t m_ctrl = 0; + uint32_t m_bc = 0; + uint16_t m_count = 0; + uint32_t m_dmacfg = 0; + uint32_t m_piocfg = 0; + bool m_drq = false; + bool m_big_endian = false; + bool m_to_device = false; + bool m_active = false; }; scsi_dma_t m_scsi_dma[2]; @@ -227,7 +227,7 @@ std::unique_ptr m_enet_fifo[2]; private: - emu_timer *m_enet_tx_timer; + emu_timer *m_enet_tx_timer = nullptr; enum enet_dma_rx_ctrl : u32 { @@ -279,24 +279,24 @@ }; // ethernet registers - u32 m_enet_rx_cbp; // current receive buffer pointer - u32 m_enet_rx_nbdp; // next receive buffer descriptor pointer - u32 m_enet_rx_bc; // receive byte count - u32 m_enet_rx_ctrl; // receive status - u32 m_enet_rx_gio; // receive gio fifo pointer - u32 m_enet_rx_dev; // receive device fifo pointer - u32 m_enet_misc; // reset, clear interrupt, loopback - u32 m_enet_piocfg; // pio configuration - u32 m_enet_dmacfg; // dma configuration - u32 m_enet_tx_cbp; // current transmit buffer pointer - u32 m_enet_tx_nbdp; // next transmit buffer descriptor pointer - u32 m_enet_tx_bc; // transmit byte count - u32 m_enet_tx_ctrl; // transmit status - u32 m_enet_tx_gio; // transmit gio fifo pointer - u32 m_enet_tx_dev; // transmit device fifo pointer - u32 m_enet_rx_cbdp; // current receive buffer descriptor pointer - u32 m_enet_tx_cpfbdp; // current/previous first transmit buffer descriptor pointer - u32 m_enet_tx_ppfbdp; // previous/previous? first transmit buffer descriptor pointer + u32 m_enet_rx_cbp = 0; // current receive buffer pointer + u32 m_enet_rx_nbdp = 0; // next receive buffer descriptor pointer + u32 m_enet_rx_bc = 0; // receive byte count + u32 m_enet_rx_ctrl = 0; // receive status + u32 m_enet_rx_gio = 0; // receive gio fifo pointer + u32 m_enet_rx_dev = 0; // receive device fifo pointer + u32 m_enet_misc = 0; // reset, clear interrupt, loopback + u32 m_enet_piocfg = 0; // pio configuration + u32 m_enet_dmacfg = 0; // dma configuration + u32 m_enet_tx_cbp = 0; // current transmit buffer pointer + u32 m_enet_tx_nbdp = 0; // next transmit buffer descriptor pointer + u32 m_enet_tx_bc = 0; // transmit byte count + u32 m_enet_tx_ctrl = 0; // transmit status + u32 m_enet_tx_gio = 0; // transmit gio fifo pointer + u32 m_enet_tx_dev = 0; // transmit device fifo pointer + u32 m_enet_rx_cbdp = 0; // current receive buffer descriptor pointer + u32 m_enet_tx_cpfbdp = 0; // current/previous first transmit buffer descriptor pointer + u32 m_enet_tx_ppfbdp = 0; // previous/previous? first transmit buffer descriptor pointer }; DECLARE_DEVICE_TYPE(SGI_HPC3, hpc3_device) diff -Nru mame-0.242+dfsg.1/src/mame/machine/hyperscan_card.h mame-0.243+dfsg.1/src/mame/machine/hyperscan_card.h --- mame-0.242+dfsg.1/src/mame/machine/hyperscan_card.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/hyperscan_card.h 2022-04-29 05:37:26.000000000 +0000 @@ -39,12 +39,12 @@ void make_resp(std::vector const &data, bool add_crc); void check_command(); - int m_state; - int m_bit_pos; - uint8_t m_data; + int m_state = 0; + int m_bit_pos = 0; + uint8_t m_data = 0; std::vector m_cmd_buf; std::vector m_resp_buf; - uint8_t m_resp_idx; + uint8_t m_resp_idx = 0; attotime m_last_at; uint8_t m_memory[120]; }; diff -Nru mame-0.242+dfsg.1/src/mame/machine/igs025.h mame-0.243+dfsg.1/src/mame/machine/igs025.h --- mame-0.242+dfsg.1/src/mame/machine/igs025.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/igs025.h 2022-04-29 05:37:26.000000000 +0000 @@ -16,9 +16,9 @@ uint16_t killbld_igs025_prot_r(offs_t offset); // use setters instead of making public? - const uint8_t (*m_kb_source_data)[0xec]; - uint32_t m_kb_game_id; - uint32_t m_kb_region; + const uint8_t (*m_kb_source_data)[0xec]{}; + uint32_t m_kb_game_id = 0; + uint32_t m_kb_region = 0; template void set_external_cb(T &&... args) { m_execute_external.set(std::forward(args)...); } @@ -33,14 +33,14 @@ igs025_execute_external m_execute_external; - uint16_t m_kb_prot_hold; - uint16_t m_kb_prot_hilo; - uint16_t m_kb_prot_hilo_select; - - int m_kb_cmd; - int m_kb_reg; - int m_kb_ptr; - uint8_t m_kb_swap; + uint16_t m_kb_prot_hold = 0; + uint16_t m_kb_prot_hilo = 0; + uint16_t m_kb_prot_hilo_select = 0; + + int m_kb_cmd = 0; + int m_kb_reg = 0; + int m_kb_ptr = 0; + uint8_t m_kb_swap = 0; void killbld_protection_calculate_hilo(); void killbld_protection_calculate_hold(int y, int z); @@ -48,8 +48,8 @@ void no_callback_setup(void); - uint16_t m_olds_bs; - uint16_t m_kb_cmd3; + uint16_t m_olds_bs = 0; + uint16_t m_kb_cmd3 = 0; }; diff -Nru mame-0.242+dfsg.1/src/mame/machine/igs028.h mame-0.243+dfsg.1/src/mame/machine/igs028.h --- mame-0.242+dfsg.1/src/mame/machine/igs028.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/igs028.h 2022-04-29 05:37:26.000000000 +0000 @@ -12,7 +12,7 @@ public: igs028_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - uint16_t* m_sharedprotram; + uint16_t* m_sharedprotram = nullptr; void IGS028_handle(void); diff -Nru mame-0.242+dfsg.1/src/mame/machine/inder_vid.h mame-0.243+dfsg.1/src/mame/machine/inder_vid.h --- mame-0.242+dfsg.1/src/mame/machine/inder_vid.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/inder_vid.h 2022-04-29 05:37:26.000000000 +0000 @@ -44,7 +44,7 @@ required_device m_palette; required_device m_tms; - int m_shiftfull; // this might be a driver specific hack for a TMS bug. + int m_shiftfull = 0; // this might be a driver specific hack for a TMS bug. TMS340X0_TO_SHIFTREG_CB_MEMBER(to_shiftreg); TMS340X0_FROM_SHIFTREG_CB_MEMBER(from_shiftreg); diff -Nru mame-0.242+dfsg.1/src/mame/machine/interpro_arbga.h mame-0.243+dfsg.1/src/mame/machine/interpro_arbga.h --- mame-0.242+dfsg.1/src/mame/machine/interpro_arbga.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/interpro_arbga.h 2022-04-29 05:37:26.000000000 +0000 @@ -67,21 +67,21 @@ virtual void device_reset() override; private: - u32 m_sdepid; - u32 m_arbsnap; - u32 m_fixprils; - u32 m_fixprims; - u32 m_sysdomls; - u32 m_sysdomms; - u32 m_tctrl; - u8 m_inem; - u8 m_enem; - u32 m_hog; - u32 m_lock; - u32 m_lockprs; - u32 m_hiblockls; - u32 m_hiblockms; - u32 m_arbrev; + u32 m_sdepid = 0; + u32 m_arbsnap = 0; + u32 m_fixprils = 0; + u32 m_fixprims = 0; + u32 m_sysdomls = 0; + u32 m_sysdomms = 0; + u32 m_tctrl = 0; + u8 m_inem = 0; + u8 m_enem = 0; + u32 m_hog = 0; + u32 m_lock = 0; + u32 m_lockprs = 0; + u32 m_hiblockls = 0; + u32 m_hiblockms = 0; + u32 m_arbrev = 0; }; // device type definition diff -Nru mame-0.242+dfsg.1/src/mame/machine/interpro_ioga.h mame-0.243+dfsg.1/src/mame/machine/interpro_ioga.h --- mame-0.242+dfsg.1/src/mame/machine/interpro_ioga.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/interpro_ioga.h 2022-04-29 05:37:26.000000000 +0000 @@ -412,8 +412,8 @@ void eth_control_w(offs_t offset, u16 data, u16 mem_mask = ~0); private: - u32 m_eth_base; - u16 m_eth_control; + u32 m_eth_base = 0; + u16 m_eth_control = 0; }; class turquoise_ioga_device : public interpro_ioga_device @@ -454,8 +454,8 @@ void eth_control_w(offs_t offset, u16 data, u16 mem_mask = ~0); private: - u32 m_eth_base; - u16 m_eth_control; + u32 m_eth_base = 0; + u16 m_eth_control = 0; }; class sapphire_ioga_device : public interpro_ioga_device @@ -549,18 +549,18 @@ private: static const u8 INTERRUPT_COUNT = 19; - u32 m_eth_remap; - u32 m_eth_mappg; - u32 m_eth_control; - - u32 m_timer2_count; - u32 m_timer2_value; - u32 m_timer3_count; + u32 m_eth_remap = 0; + u32 m_eth_mappg = 0; + u32 m_eth_control = 0; + + u32 m_timer2_count = 0; + u32 m_timer2_value = 0; + u32 m_timer3_count = 0; - emu_timer *m_timer2; - emu_timer *m_timer3; + emu_timer *m_timer2 = nullptr; + emu_timer *m_timer3 = nullptr; - u16 m_swicr[8]; + u16 m_swicr[8]{}; }; // device type definition diff -Nru mame-0.242+dfsg.1/src/mame/machine/interpro_mcga.h mame-0.243+dfsg.1/src/mame/machine/interpro_mcga.h --- mame-0.242+dfsg.1/src/mame/machine/interpro_mcga.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/interpro_mcga.h 2022-04-29 05:37:26.000000000 +0000 @@ -64,10 +64,10 @@ virtual void device_start() override; virtual void device_reset() override; - u16 m_control, m_error, m_memsize; - u8 m_frcrd, m_cbsub; + u16 m_control = 0, m_error = 0, m_memsize = 0; + u8 m_frcrd = 0, m_cbsub = 0; - u16 m_reg[3]; + u16 m_reg[3]{}; private: @@ -116,7 +116,7 @@ void error_control_w(u16 data) { m_error_control = data; } private: - u16 m_error_control; + u16 m_error_control = 0; }; // device type definition diff -Nru mame-0.242+dfsg.1/src/mame/machine/ioc2.h mame-0.243+dfsg.1/src/mame/machine/ioc2.h --- mame-0.242+dfsg.1/src/mame/machine/ioc2.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/ioc2.h 2022-04-29 05:37:26.000000000 +0000 @@ -177,7 +177,7 @@ uint32_t m_par_read_cnt; uint32_t m_par_cntl; - uint8_t m_system_id; + uint8_t m_system_id = 0; static char const *const SCC_TAG; static char const *const PI1_TAG; diff -Nru mame-0.242+dfsg.1/src/mame/machine/isbc_215g.cpp mame-0.243+dfsg.1/src/mame/machine/isbc_215g.cpp --- mame-0.242+dfsg.1/src/mame/machine/isbc_215g.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/isbc_215g.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -64,7 +64,7 @@ uint16_t wps = 64 << ((m_idcompare[0] >> 4) & 3); harddisk_image_device *drive = (m_drive ? m_hdd1 : m_hdd0); if(!m_secoffset) - hard_disk_read(drive->get_hard_disk_file(), m_lba[m_drive], m_sector); + drive->get_hard_disk_file()->read(m_lba[m_drive], m_sector); if(m_secoffset >= wps) return 0; return m_sector[m_secoffset++]; @@ -79,7 +79,7 @@ m_sector[m_secoffset++] = data; if(m_secoffset == wps) { - hard_disk_write(drive->get_hard_disk_file(), m_lba[m_drive], m_sector); + drive->get_hard_disk_file()->write(m_lba[m_drive], m_sector); return true; } return false; @@ -387,11 +387,11 @@ void isbc_215g_device::device_reset() { if(m_hdd0->get_hard_disk_file()) - m_geom[0] = hard_disk_get_info(m_hdd0->get_hard_disk_file()); + m_geom[0] = &m_hdd0->get_hard_disk_file()->get_info(); else m_geom[0] = nullptr; if(m_hdd1->get_hard_disk_file()) - m_geom[1] = hard_disk_get_info(m_hdd1->get_hard_disk_file()); + m_geom[1] = &m_hdd1->get_hard_disk_file()->get_info(); else m_geom[1] = nullptr; diff -Nru mame-0.242+dfsg.1/src/mame/machine/isbc_215g.h mame-0.243+dfsg.1/src/mame/machine/isbc_215g.h --- mame-0.242+dfsg.1/src/mame/machine/isbc_215g.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/isbc_215g.h 2022-04-29 05:37:26.000000000 +0000 @@ -76,7 +76,7 @@ bool m_step; bool m_format; - const struct hard_disk_info* m_geom[2]; + const struct hard_disk_file::info* m_geom[2]; DECLARE_WRITE_LINE_MEMBER(isbx_irq_00_w); DECLARE_WRITE_LINE_MEMBER(isbx_irq_01_w); diff -Nru mame-0.242+dfsg.1/src/mame/machine/iteagle_fpga.h mame-0.243+dfsg.1/src/mame/machine/iteagle_fpga.h --- mame-0.242+dfsg.1/src/mame/machine/iteagle_fpga.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/iteagle_fpga.h 2022-04-29 05:37:26.000000000 +0000 @@ -135,7 +135,7 @@ virtual void device_add_mconfig(machine_config &config) override; private: - address_space *m_memory_space; + address_space *m_memory_space = nullptr; uint16_t m_sw_version; uint8_t m_hw_version; diff -Nru mame-0.242+dfsg.1/src/mame/machine/k007452.h mame-0.243+dfsg.1/src/mame/machine/k007452.h --- mame-0.242+dfsg.1/src/mame/machine/k007452.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/k007452.h 2022-04-29 05:37:26.000000000 +0000 @@ -33,10 +33,10 @@ private: // internal state - u8 m_math_regs[6]; - u16 m_multiply_result; - u16 m_divide_quotient; - u16 m_divide_remainder; + u8 m_math_regs[6]{}; + u16 m_multiply_result = 0; + u16 m_divide_quotient = 0; + u16 m_divide_remainder = 0; }; diff -Nru mame-0.242+dfsg.1/src/mame/machine/k573dio.cpp mame-0.243+dfsg.1/src/mame/machine/k573dio.cpp --- mame-0.242+dfsg.1/src/mame/machine/k573dio.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/k573dio.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -82,6 +82,9 @@ void k573dio_device::amap(address_map &map) { + // TODO: Split address maps between DDR Solo Bass Mix's FPGA code and the normal FPGA code. + // For example, DDR Solo Bass Mix's FPGA code returns 0x7654 for unused registers like mp3_counter_high_r. + map(0x00, 0x01).r(FUNC(k573dio_device::a00_r)); map(0x02, 0x03).r(FUNC(k573dio_device::a02_r)); map(0x04, 0x05).r(FUNC(k573dio_device::a04_r)); @@ -95,7 +98,7 @@ map(0xa2, 0xa3).rw(FUNC(k573dio_device::mpeg_start_adr_low_r), FUNC(k573dio_device::mpeg_start_adr_low_w)); map(0xa4, 0xa5).rw(FUNC(k573dio_device::mpeg_end_adr_high_r), FUNC(k573dio_device::mpeg_end_adr_high_w)); map(0xa6, 0xa7).rw(FUNC(k573dio_device::mpeg_end_adr_low_r), FUNC(k573dio_device::mpeg_end_adr_low_w)); - map(0xa8, 0xa9).rw(FUNC(k573dio_device::mpeg_key_1_r), FUNC(k573dio_device::mpeg_key_1_w)); + map(0xa8, 0xa9).rw(FUNC(k573dio_device::mpeg_frame_counter_r), FUNC(k573dio_device::mpeg_key_1_w)); map(0xaa, 0xab).r(FUNC(k573dio_device::mpeg_ctrl_r)); map(0xac, 0xad).rw(FUNC(k573dio_device::mas_i2c_r), FUNC(k573dio_device::mas_i2c_w)); map(0xae, 0xaf).rw(FUNC(k573dio_device::fpga_ctrl_r), FUNC(k573dio_device::fpga_ctrl_w)); @@ -144,6 +147,7 @@ save_item(NAME(output_data)); save_item(NAME(is_ddrsbm_fpga)); save_item(NAME(crypto_key1)); + save_item(NAME(fpga_counter)); save_item(NAME(network_id)); k573fpga->set_ddrsbm_fpga(is_ddrsbm_fpga); @@ -154,6 +158,8 @@ ram_adr = 0; ram_read_adr = 0; crypto_key1 = 0; + fpga_counter = 0; + network_id = 0; std::fill(std::begin(output_data), std::end(output_data), 0); @@ -179,10 +185,6 @@ DS2401(config, digital_id); } -void k573dio_device::device_timer(emu_timer &timer, device_timer_id id, int param) -{ -} - uint16_t k573dio_device::a00_r() { LOGUNKNOWNREG("%s: a00_r (%s)\n", tag(), machine().describe_context()); @@ -244,9 +246,6 @@ { LOGMP3("FPGA MPEG start address low %04x\n", data); k573fpga->set_mp3_start_addr((k573fpga->get_mp3_start_addr() & 0xffff0000) | data); // low - - if(is_ddrsbm_fpga) - k573fpga->set_crypto_key3(0); } uint16_t k573dio_device::mpeg_end_adr_high_r() @@ -271,10 +270,9 @@ k573fpga->set_mp3_end_addr((k573fpga->get_mp3_end_addr() & 0xffff0000) | data); // low } -uint16_t k573dio_device::mpeg_key_1_r() +uint16_t k573dio_device::mpeg_frame_counter_r() { - // Dance Dance Revolution Solo Bass Mix reads this key before starting songs - return crypto_key1; + return k573fpga->get_mp3_frame_count(); } void k573dio_device::mpeg_key_1_w(uint16_t data) @@ -306,7 +304,7 @@ void k573dio_device::fpga_ctrl_w(uint16_t data) { - k573fpga->set_mpeg_ctrl(data); + k573fpga->set_fpga_ctrl(data); } void k573dio_device::ram_write_adr_high_w(uint16_t data) @@ -348,12 +346,13 @@ uint16_t k573dio_device::mp3_counter_high_r() { - return (k573fpga->get_counter() & 0xffff0000) >> 16; + return (fpga_counter & 0xffff0000) >> 16; } uint16_t k573dio_device::mp3_counter_low_r() { - return k573fpga->get_counter() & 0x0000ffff; + fpga_counter = k573fpga->get_counter(); + return fpga_counter & 0x0000ffff; } void k573dio_device::mp3_counter_low_w(uint16_t data) diff -Nru mame-0.242+dfsg.1/src/mame/machine/k573dio.h mame-0.243+dfsg.1/src/mame/machine/k573dio.h --- mame-0.242+dfsg.1/src/mame/machine/k573dio.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/k573dio.h 2022-04-29 05:37:26.000000000 +0000 @@ -34,7 +34,7 @@ void mpeg_end_adr_high_w(uint16_t data); uint16_t mpeg_end_adr_low_r(); void mpeg_end_adr_low_w(uint16_t data); - uint16_t mpeg_key_1_r(); + uint16_t mpeg_frame_counter_r(); void mpeg_key_1_w(uint16_t data); uint16_t mpeg_ctrl_r(); uint16_t mas_i2c_r(); @@ -75,7 +75,6 @@ virtual void device_reset() override; virtual const tiny_rom_entry *device_rom_region() const override; virtual void device_add_mconfig(machine_config &config) override; - virtual void device_timer(emu_timer &timer, device_timer_id id, int param) override; private: memory_share_creator ram; @@ -90,6 +89,7 @@ bool is_ddrsbm_fpga; u16 crypto_key1; + uint32_t fpga_counter; uint16_t network_id; }; diff -Nru mame-0.242+dfsg.1/src/mame/machine/k573fpga.cpp mame-0.243+dfsg.1/src/mame/machine/k573fpga.cpp --- mame-0.242+dfsg.1/src/mame/machine/k573fpga.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/k573fpga.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -15,14 +15,15 @@ device_t(mconfig, KONAMI_573_DIGITAL_FPGA, tag, owner, clock), ram(*this, finder_base::DUMMY_TAG), mas3507d(*this, "mpeg"), - use_ddrsbm_fpga(false) + is_ddrsbm_fpga(false) { } void k573fpga_device::device_add_mconfig(machine_config &config) { MAS3507D(config, mas3507d); - mas3507d->sample_cb().set(*this, FUNC(k573fpga_device::get_decrypted)); + mas3507d->mpeg_frame_sync_cb().set(*this, FUNC(k573fpga_device::mpeg_frame_sync)); + mas3507d->demand_cb().set(*this, FUNC(k573fpga_device::mas3507d_demand)); } void k573fpga_device::device_start() @@ -30,74 +31,104 @@ save_item(NAME(crypto_key1)); save_item(NAME(crypto_key2)); save_item(NAME(crypto_key3)); + save_item(NAME(crypto_key1_start)); + save_item(NAME(crypto_key2_start)); + save_item(NAME(crypto_key3_start)); save_item(NAME(mp3_start_addr)); - save_item(NAME(mp3_cur_addr)); save_item(NAME(mp3_end_addr)); - save_item(NAME(use_ddrsbm_fpga)); - save_item(NAME(is_stream_active)); - save_item(NAME(is_timer_active)); - save_item(NAME(counter_previous)); + save_item(NAME(mp3_cur_start_addr)); + save_item(NAME(mp3_cur_end_addr)); + save_item(NAME(mp3_cur_addr)); + save_item(NAME(mp3_data)); + save_item(NAME(mp3_remaining_bytes)); + save_item(NAME(is_ddrsbm_fpga)); + save_item(NAME(mpeg_status)); + save_item(NAME(fpga_status)); + save_item(NAME(mp3_frame_counter)); + save_item(NAME(counter_value)); save_item(NAME(counter_current)); - save_item(NAME(last_playback_status)); + save_item(NAME(counter_base)); + save_item(NAME(is_mpeg_frame_synced)); + + m_stream_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(k573fpga_device::update_stream), this)); + m_stream_timer->adjust(attotime::never); } void k573fpga_device::device_reset() { + fpga_status = 0; mp3_start_addr = 0; - mp3_cur_addr = 0; mp3_end_addr = 0; + mp3_cur_start_addr = 0; + mp3_cur_end_addr = 0; + mp3_cur_addr = 0; + mp3_data = 0; + mp3_remaining_bytes = 0; - crypto_key1 = 0; - crypto_key2 = 0; - crypto_key3 = 0; - - is_stream_active = false; - is_timer_active = false; - - counter_current = counter_previous = counter_offset = 0; + crypto_key1_start = crypto_key1 = 0; + crypto_key2_start = crypto_key2 = 0; + crypto_key3_start = crypto_key3 = 0; + + counter_current = counter_base = machine().time(); + + mpeg_status = 0; + mp3_frame_counter = 0; + counter_value = 0; + is_mpeg_frame_synced = false; mas3507d->reset_playback(); - last_playback_status = get_mpeg_ctrl(); -} - -void k573fpga_device::reset_counter() { - counter_current = counter_previous = counter_offset = 0; - status_update(); } -void k573fpga_device::status_update() { - auto cur_playback_status = get_mpeg_ctrl(); - is_timer_active = is_streaming() || ((cur_playback_status == last_playback_status && last_playback_status > PLAYBACK_STATE_IDLE) || cur_playback_status > last_playback_status); - last_playback_status = cur_playback_status; - - if(!is_timer_active) - counter_current = counter_previous = counter_offset = 0; -} - -uint32_t k573fpga_device::get_counter() { - status_update(); - - counter_previous = counter_current; - - if(is_timer_active) { - mas3507d->update_stream(); - counter_current = mas3507d->get_samples() - counter_offset; +void k573fpga_device::reset_counter() +{ + is_mpeg_frame_synced = false; + counter_current = counter_base = machine().time(); + counter_value = 0; +} + +void k573fpga_device::update_counter() +{ + if (is_ddrsbm_fpga) { + // The counter for Solo Bass Mix is used differently than other games. + // DDR Solo Bass Mix will sync the internal playback timer to the first second of the MP3 using the MP3 frame counter. + // After that the playback timer is incremented using the difference between the last counter value and the current counter value. + // This counter register itself is always running even when no audio is playing. + // TODO: What happens when mp3_counter_low_w is written to on Solo Bass Mix? + counter_value = (machine().time() - counter_base).as_double(); } + else if (is_mpeg_frame_synced) { + // Timer only seems to start when the first MPEG frame sync is encountered, so wait for that trigger + counter_base = counter_current; + counter_current = machine().time(); + counter_value += (counter_current - counter_base).as_double(); + } +} - return counter_current; +uint32_t k573fpga_device::get_counter() +{ + update_counter(); + return counter_value * 44100; } -uint32_t k573fpga_device::get_counter_diff() { +uint32_t k573fpga_device::get_counter_diff() +{ // Delta playback time since last counter update. // I couldn't find any active usages of this register but it exists in some code paths. // The functionality was tested using custom code running on real hardware. // When this is called, it will return the difference between the current counter value // and the last read counter value, and then reset the counter back to the previously read counter's value. - auto diff = counter_current - counter_previous; - counter_current -= diff; - counter_previous = counter_current; - get_counter(); - return diff; + auto prev = counter_value; + update_counter(); + auto diff = counter_value - prev; + counter_value = prev; + return diff * 44100; +} + +uint16_t k573fpga_device::get_mp3_frame_count() +{ + // All games can read this but only DDR Solo Bass Mix actively uses it. + // Returns the same value as using a default read to get the frame counter from the MAS3507D over i2c. + return mp3_frame_counter & 0xffff; } uint16_t k573fpga_device::mas_i2c_r() @@ -113,72 +144,91 @@ mas3507d->i2c_sda_w(data & 0x1000); } -uint16_t k573fpga_device::get_mpeg_ctrl() +void k573fpga_device::set_crypto_key1(uint16_t v) { - switch(mas3507d->get_status()) { - case mas3507d_device::PLAYBACK_STATE_IDLE: - return PLAYBACK_STATE_IDLE; - - case mas3507d_device::PLAYBACK_STATE_BUFFER_FULL: - return PLAYBACK_STATE_BUFFER_FULL; + crypto_key1_start = crypto_key1 = v; + update_mp3_decode_state(); +} +void k573fpga_device::set_crypto_key2(uint16_t v) +{ + crypto_key2_start = crypto_key2 = v; + update_mp3_decode_state(); +} +void k573fpga_device::set_crypto_key3(uint8_t v) +{ + crypto_key3_start = crypto_key3 = v; + update_mp3_decode_state(); +} - case mas3507d_device::PLAYBACK_STATE_DEMAND_BUFFER: - return PLAYBACK_STATE_DEMAND_BUFFER; - } +void k573fpga_device::set_mp3_start_addr(uint32_t v) +{ + mp3_start_addr = v; + update_mp3_decode_state(); +} - return PLAYBACK_STATE_IDLE; +void k573fpga_device::set_mp3_end_addr(uint32_t v) +{ + mp3_end_addr = v; + update_mp3_decode_state(); } -bool k573fpga_device::is_mp3_playing() +uint16_t k573fpga_device::get_mpeg_ctrl() { - return get_mpeg_ctrl() > PLAYBACK_STATE_IDLE; + return mpeg_status; } uint16_t k573fpga_device::get_fpga_ctrl() { // 0x0000 Not Streaming // 0x1000 Streaming - return is_streaming() << 12; -} - -bool k573fpga_device::is_streaming() -{ - return is_stream_active && mp3_cur_addr < mp3_end_addr; + int is_streaming = BIT(fpga_status, FPGA_STREAMING_ENABLE) + && mp3_cur_addr >= mp3_cur_start_addr + && mp3_cur_addr < mp3_cur_end_addr; + return is_streaming << 12; } -void k573fpga_device::set_mpeg_ctrl(uint16_t data) +void k573fpga_device::set_fpga_ctrl(uint16_t data) { LOG("FPGA MPEG control %c%c%c | %04x\n", - data & 0x8000 ? '#' : '.', - data & 0x4000 ? '#' : '.', // "Active" flag. The FPGA will never start streaming data without this bit set - data & 0x2000 ? '#' : '.', + BIT(data, FPGA_FRAME_COUNTER_ENABLE) ? '#' : '.', + BIT(data, FPGA_STREAMING_ENABLE) ? '#' : '.', + BIT(data, FPGA_MP3_ENABLE) ? '#' : '.', data); - mas3507d->reset_playback(); + if (!BIT(data, FPGA_FRAME_COUNTER_ENABLE) && BIT(fpga_status, FPGA_FRAME_COUNTER_ENABLE)) { + mp3_frame_counter = 0; + } - if(data == 0xa000) { - is_stream_active = false; - counter_current = counter_previous = 0; - status_update(); - } else if(data == 0xe000) { - is_stream_active = true; - mp3_cur_addr = mp3_start_addr; - - reset_counter(); - - if(!mas3507d->is_started) { - mas3507d->start_playback(); - mas3507d->update_stream(); - - // Audio should be buffered by this point. - // The assumption is that the number of samples actually played can be - // calculated by subtracting the base sample count when the song was started - // from the current sample count when the counter register is read. - // Otherwise, the sample count will always be ahead by the number of samples - // that were in the buffered frames. - counter_offset = mas3507d->get_samples(); - } + if ((BIT(data, FPGA_MP3_ENABLE) != BIT(fpga_status, FPGA_MP3_ENABLE)) + || (BIT(data, FPGA_STREAMING_ENABLE) != BIT(fpga_status, FPGA_STREAMING_ENABLE))) { + mas3507d->reset_playback(); } + + fpga_status = data; +} + + +void k573fpga_device::update_mp3_decode_state() +{ + // HACK: The exact timing of when the internal state in the FPGA updates is still unknown + // so update the state any time one of the core settings (decryption keys or data start/stop addr) + // for a stream changes. + mp3_cur_addr = mp3_start_addr; + mp3_cur_start_addr = mp3_start_addr; + mp3_cur_end_addr = mp3_end_addr; + is_mpeg_frame_synced = false; + mp3_remaining_bytes = 0; + crypto_key1 = crypto_key1_start; + crypto_key2 = crypto_key2_start; + crypto_key3 = crypto_key3_start; + mp3_frame_counter = 0; + reset_counter(); + + if (is_ddrsbm_fpga) { + crypto_key3 = crypto_key3_start = 0; + } + + mas3507d->reset_playback(); } uint16_t k573fpga_device::decrypt_default(uint16_t v) @@ -234,6 +284,11 @@ uint16_t k573fpga_device::decrypt_ddrsbm(uint16_t data) { + // TODO: Work out the proper decryption algorithm. + // Similar to the other games, ddrsbm is capable of sending a pre-mutated key that is used to simulate seeking by starting MP3 playback from a non-zero offset. + // The MP3 seeking functionality doesn't appear to be used so the game doesn't break from lack of support from what I can tell. + // The proper key mutation found in game code is: crypto_key1 = rol(crypto_key1, offset & 0x0f) + uint8_t key[16] = {0}; uint16_t key_state = bitswap<16>( crypto_key1, @@ -273,18 +328,66 @@ return output_word; } -uint16_t k573fpga_device::get_decrypted() +TIMER_CALLBACK_MEMBER(k573fpga_device::update_stream) +{ + if (!BIT(mpeg_status, PLAYBACK_STATE_DEMAND)) { + return; + } + + if (!BIT(fpga_status, FPGA_MP3_ENABLE) + || !BIT(fpga_status, FPGA_STREAMING_ENABLE) + || mp3_cur_addr < mp3_cur_start_addr + || mp3_cur_addr >= mp3_cur_end_addr) { + return; + } + + if (mp3_remaining_bytes <= 0) { + uint16_t src = ram[mp3_cur_addr >> 1]; + mp3_data = is_ddrsbm_fpga ? decrypt_ddrsbm(src) : decrypt_default(src); + mp3_data = ((mp3_data >> 8) & 0xff) | ((mp3_data & 0xff) << 8); + mp3_cur_addr += 2; + mp3_remaining_bytes = 2; + } + + mas3507d->sid_w(mp3_data & 0xff); + mp3_data >>= 8; + mp3_remaining_bytes--; +} + +WRITE_LINE_MEMBER(k573fpga_device::mpeg_frame_sync) { - if(!is_streaming()) { - is_stream_active = false; - return 0; + if (state) { + mpeg_status &= ~(1 << PLAYBACK_STATE_IDLE); + mpeg_status |= 1 << PLAYBACK_STATE_PLAYING; + + if (!is_mpeg_frame_synced) { + reset_counter(); + is_mpeg_frame_synced = true; + } + + if (BIT(fpga_status, FPGA_FRAME_COUNTER_ENABLE)) { + mp3_frame_counter++; + } } + else { + mpeg_status &= ~(1 << PLAYBACK_STATE_PLAYING); + mpeg_status |= 1 << PLAYBACK_STATE_IDLE; + } +} - uint16_t src = ram[mp3_cur_addr >> 1]; - uint16_t result = use_ddrsbm_fpga ? decrypt_ddrsbm(src) : decrypt_default(src); - mp3_cur_addr += 2; +WRITE_LINE_MEMBER(k573fpga_device::mas3507d_demand) +{ + if (state && !BIT(mpeg_status, PLAYBACK_STATE_DEMAND)) { + mpeg_status |= 1 << PLAYBACK_STATE_DEMAND; + } + else if (!state && BIT(mpeg_status, PLAYBACK_STATE_DEMAND)) { + mpeg_status &= ~(1 << PLAYBACK_STATE_DEMAND); + m_stream_timer->adjust(attotime::never); + } - return result; + if (state && BIT(mpeg_status, PLAYBACK_STATE_DEMAND)) { + m_stream_timer->adjust(attotime::zero); + } } DEFINE_DEVICE_TYPE(KONAMI_573_DIGITAL_FPGA, k573fpga_device, "k573fpga", "Konami 573 Digital I/O FPGA") diff -Nru mame-0.242+dfsg.1/src/mame/machine/k573fpga.h mame-0.243+dfsg.1/src/mame/machine/k573fpga.h --- mame-0.242+dfsg.1/src/mame/machine/k573fpga.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/k573fpga.h 2022-04-29 05:37:26.000000000 +0000 @@ -7,6 +7,7 @@ #include "sound/mas3507d.h" #include "machine/ds2401.h" +#include "machine/timer.h" DECLARE_DEVICE_TYPE(KONAMI_573_DIGITAL_FPGA, k573fpga_device) @@ -18,32 +19,33 @@ template void add_route(T &&... args) { subdevice("mpeg")->add_route(std::forward(args)...); } template void set_ram(T &&tag) { ram.set_tag(std::forward(tag)); } - void set_ddrsbm_fpga(bool flag) { use_ddrsbm_fpga = flag; } + void set_ddrsbm_fpga(bool flag) { is_ddrsbm_fpga = flag; } - uint16_t get_decrypted(); + DECLARE_WRITE_LINE_MEMBER(mpeg_frame_sync); + DECLARE_WRITE_LINE_MEMBER(mas3507d_demand); - void set_crypto_key1(uint16_t v) { crypto_key1 = v; } - void set_crypto_key2(uint16_t v) { crypto_key2 = v; } - void set_crypto_key3(uint8_t v) { crypto_key3 = v; } + void set_crypto_key1(uint16_t v); + void set_crypto_key2(uint16_t v); + void set_crypto_key3(uint8_t v); uint32_t get_mp3_start_addr() { return mp3_start_addr; } - void set_mp3_start_addr(uint32_t v) { mp3_start_addr = v; } + void set_mp3_start_addr(uint32_t v); uint32_t get_mp3_end_addr() { return mp3_end_addr; } - void set_mp3_end_addr(uint32_t v) { mp3_end_addr = v; } + void set_mp3_end_addr(uint32_t v); uint16_t mas_i2c_r(); void mas_i2c_w(uint16_t data); uint16_t get_fpga_ctrl(); - void set_mpeg_ctrl(uint16_t data); + void set_fpga_ctrl(uint16_t data); uint16_t get_mpeg_ctrl(); uint32_t get_counter(); uint32_t get_counter_diff(); + uint16_t get_mp3_frame_count(); - void status_update(); void reset_counter(); protected: @@ -52,33 +54,58 @@ virtual void device_add_mconfig(machine_config &config) override; private: + TIMER_CALLBACK_MEMBER(update_stream); + void update_counter(); + void update_mp3_decode_state(); + uint16_t decrypt_default(uint16_t data); uint16_t decrypt_ddrsbm(uint16_t data); - bool is_mp3_playing(); - bool is_streaming(); + emu_timer* m_stream_timer; + + enum { + PLAYBACK_STATE_DEMAND = 12, + PLAYBACK_STATE_IDLE = 13, + PLAYBACK_STATE_PLAYING = 14, + PLAYBACK_STATE_ENABLED = 15, + }; enum { - PLAYBACK_STATE_UNKNOWN = 0x8000, - PLAYBACK_STATE_ERROR = 0xa000, // Error? - PLAYBACK_STATE_IDLE = 0xb000, // Not playing - PLAYBACK_STATE_BUFFER_FULL = 0xc000, // Playing, demand pin = 0? - PLAYBACK_STATE_DEMAND_BUFFER = 0xd000 // Playing, demand pin = 1? + // Allows MP3 data to be decrypted? + // If this is 0 then data won't be sent to the MAS3507D even if FPGA_STREAMING_ENABLE is 1. + FPGA_MP3_ENABLE = 13, + + // Allows data to be streamed to MAS3507D. + // This needs to be set before the register at 0x1f6400ae will return the streaming status. + FPGA_STREAMING_ENABLE = 14, + + // Allows frame counter to be incremented based on the MPEG frame sync pin from the MAS3507D. + // Setting this to 0 resets the frame counter register. + FPGA_FRAME_COUNTER_ENABLE = 15, }; required_shared_ptr ram; required_device mas3507d; + bool is_ddrsbm_fpga; + + uint16_t mpeg_status, fpga_status; + uint16_t crypto_key1, crypto_key2; uint8_t crypto_key3; + uint16_t crypto_key1_start, crypto_key2_start; + uint8_t crypto_key3_start; + + uint32_t mp3_start_addr, mp3_end_addr; + uint32_t mp3_cur_start_addr, mp3_cur_end_addr, mp3_cur_addr; + uint16_t mp3_data; + int mp3_remaining_bytes; - uint32_t mp3_start_addr, mp3_cur_addr, mp3_end_addr; - bool use_ddrsbm_fpga; + bool is_mpeg_frame_synced; + uint32_t mp3_frame_counter; - bool is_stream_active, is_timer_active; - uint32_t counter_previous, counter_offset; - int32_t counter_current; - uint32_t last_playback_status; + attotime counter_current, counter_base; + double counter_value; }; #endif // MAME_MACHINE_K573FPGA_H diff -Nru mame-0.242+dfsg.1/src/mame/machine/k7659kb.h mame-0.243+dfsg.1/src/mame/machine/k7659kb.h --- mame-0.242+dfsg.1/src/mame/machine/k7659kb.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/k7659kb.h 2022-04-29 05:37:26.000000000 +0000 @@ -46,13 +46,13 @@ virtual void device_add_mconfig(machine_config &config) override; virtual ioport_constructor device_input_ports() const override; - emu_timer *m_timer; + emu_timer *m_timer = nullptr; private: uint8_t key_pos(uint8_t val); - uint8_t m_lookup; - uint8_t m_key; - const uint8_t *m_p_rom; + uint8_t m_lookup = 0; + uint8_t m_key = 0; + const uint8_t *m_p_rom = nullptr; }; diff -Nru mame-0.242+dfsg.1/src/mame/machine/konppc.h mame-0.243+dfsg.1/src/mame/machine/konppc.h --- mame-0.242+dfsg.1/src/mame/machine/konppc.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/konppc.h 2022-04-29 05:37:26.000000000 +0000 @@ -80,22 +80,22 @@ uint32_t dsp_comm_sharc[MAX_CG_BOARDS][2]; uint8_t dsp_shared_ram_bank[MAX_CG_BOARDS]; - int32_t cgboard_id; + int32_t cgboard_id = 0; int32_t cgboard_type; int32_t num_cgboards; std::unique_ptr dsp_shared_ram[MAX_CG_BOARDS]; - uint32_t dsp_state[MAX_CG_BOARDS]; - uint32_t nwk_device_sel[MAX_CG_BOARDS]; - const char *texture_bank[MAX_CG_BOARDS]; - - int nwk_fifo_half_full_r; - int nwk_fifo_half_full_w; - int nwk_fifo_full; - int nwk_fifo_mask; + uint32_t dsp_state[MAX_CG_BOARDS]{}; + uint32_t nwk_device_sel[MAX_CG_BOARDS]{}; + const char *texture_bank[MAX_CG_BOARDS]{}; + + int nwk_fifo_half_full_r = 0; + int nwk_fifo_half_full_w = 0; + int nwk_fifo_full = 0; + int nwk_fifo_mask = 0; - bool enable_3d[MAX_CG_BOARDS]; + bool enable_3d[MAX_CG_BOARDS]{}; std::unique_ptr nwk_fifo[MAX_CG_BOARDS]; int32_t nwk_fifo_read_ptr[MAX_CG_BOARDS]; diff -Nru mame-0.242+dfsg.1/src/mame/machine/m1comm.h mame-0.243+dfsg.1/src/mame/machine/m1comm.h --- mame-0.242+dfsg.1/src/mame/machine/m1comm.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/m1comm.h 2022-04-29 05:37:26.000000000 +0000 @@ -78,26 +78,26 @@ // - share_r // - share_w - uint8_t m_shared[0x1000]; // 2x 2k = 4k; model1 accesses this with 16bit data and 11bit address (A0 to A10) - uint8_t m_syn; // bit0 is used to trigger DOP line on VINT, bit1 is used to enable/disable VINT/IRQ5 - uint8_t m_zfg; // z80 flip gate, bit0 is stored - uint8_t m_cn; // bit0 is used to enable/disable the comm board - uint8_t m_fg; // flip gate, bit0 is stored, bit7 is connected to ZFG bit 0 + uint8_t m_shared[0x1000]{}; // 2x 2k = 4k; model1 accesses this with 16bit data and 11bit address (A0 to A10) + uint8_t m_syn = 0; // bit0 is used to trigger DOP line on VINT, bit1 is used to enable/disable VINT/IRQ5 + uint8_t m_zfg = 0; // z80 flip gate, bit0 is stored + uint8_t m_cn = 0; // bit0 is used to enable/disable the comm board + uint8_t m_fg = 0; // flip gate, bit0 is stored, bit7 is connected to ZFG bit 0 #ifdef M1COMM_SIMULATION osd_file::ptr m_line_rx; // rx line - can be either differential, simple serial or toslink osd_file::ptr m_line_tx; // tx line - is differential, simple serial and toslink - char m_localhost[256]; - char m_remotehost[256]; - uint8_t m_buffer0[0x200]; - uint8_t m_buffer1[0x200]; + char m_localhost[256]{}; + char m_remotehost[256]{}; + uint8_t m_buffer0[0x200]{}; + uint8_t m_buffer1[0x200]{}; uint8_t m_framesync; - uint8_t m_linkenable; - uint16_t m_linktimer; - uint8_t m_linkalive; - uint8_t m_linkid; - uint8_t m_linkcount; + uint8_t m_linkenable = 0; + uint16_t m_linktimer = 0; + uint8_t m_linkalive = 0; + uint8_t m_linkid = 0; + uint8_t m_linkcount = 0; void comm_tick(); int read_frame(int dataSize); diff -Nru mame-0.242+dfsg.1/src/mame/machine/m20_8086.h mame-0.243+dfsg.1/src/mame/machine/m20_8086.h --- mame-0.242+dfsg.1/src/mame/machine/m20_8086.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/m20_8086.h 2022-04-29 05:37:26.000000000 +0000 @@ -44,7 +44,7 @@ required_device m_pic; required_device m_ram; bool m_8086_halt; - int m_nvi, m_vi; + int m_nvi = 0, m_vi = 0; IRQ_CALLBACK_MEMBER(int_cb); }; diff -Nru mame-0.242+dfsg.1/src/mame/machine/m2comm.h mame-0.243+dfsg.1/src/mame/machine/m2comm.h --- mame-0.242+dfsg.1/src/mame/machine/m2comm.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/m2comm.h 2022-04-29 05:37:26.000000000 +0000 @@ -51,27 +51,27 @@ virtual void device_add_mconfig(machine_config &config) override; private: - uint8_t m_shared[0x4000]; // 16k shared memory - uint8_t m_zfg; // z80 flip gate - bit 0 switches memory banks, bit7 is connected to FG bit 0 - uint8_t m_cn; // bit0 is used to enable/disable the comm board - uint8_t m_fg; // i960 flip gate - bit0 is stored, bit7 is connected to ZFG bit 0 + uint8_t m_shared[0x4000]{}; // 16k shared memory + uint8_t m_zfg = 0; // z80 flip gate - bit 0 switches memory banks, bit7 is connected to FG bit 0 + uint8_t m_cn = 0; // bit0 is used to enable/disable the comm board + uint8_t m_fg = 0; // i960 flip gate - bit0 is stored, bit7 is connected to ZFG bit 0 osd_file::ptr m_line_rx; // rx line - can be either differential, simple serial or toslink osd_file::ptr m_line_tx; // tx line - is differential, simple serial and toslink - char m_localhost[256]; - char m_remotehost[256]; - uint8_t m_buffer0[0x1000]; - uint8_t m_buffer1[0x1000]; + char m_localhost[256]{}; + char m_remotehost[256]{}; + uint8_t m_buffer0[0x1000]{}; + uint8_t m_buffer1[0x1000]{}; uint8_t m_framesync; uint16_t m_frameoffset; #ifdef M2COMM_SIMULATION - uint8_t m_linkenable; - uint16_t m_linktimer; - uint8_t m_linkalive; - uint8_t m_linkid; - uint8_t m_linkcount; - uint8_t m_zfg_delay; + uint8_t m_linkenable = 0; + uint16_t m_linktimer = 0; + uint8_t m_linkalive = 0; + uint8_t m_linkid = 0; + uint8_t m_linkcount = 0; + uint8_t m_zfg_delay = 0; void comm_tick(); void read_fg(); diff -Nru mame-0.242+dfsg.1/src/mame/machine/m3comm.h mame-0.243+dfsg.1/src/mame/machine/m3comm.h --- mame-0.242+dfsg.1/src/mame/machine/m3comm.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/m3comm.h 2022-04-29 05:37:26.000000000 +0000 @@ -51,24 +51,24 @@ virtual void device_add_mconfig(machine_config &config) override; private: - uint16_t naomi_control; - uint16_t naomi_offset; - uint16_t m_status0; - uint16_t m_status1; - uint16_t m_commbank; - - uint16_t recv_offset; - uint16_t recv_size; - uint16_t send_offset; - uint16_t send_size; + uint16_t naomi_control = 0; + uint16_t naomi_offset = 0; + uint16_t m_status0 = 0; + uint16_t m_status1 = 0; + uint16_t m_commbank = 0; + + uint16_t recv_offset = 0; + uint16_t recv_size = 0; + uint16_t send_offset = 0; + uint16_t send_size = 0; emu_file m_line_rx; // rx line - can be either differential, simple serial or toslink emu_file m_line_tx; // tx line - is differential, simple serial and toslink - char m_localhost[256]; - char m_remotehost[256]; + char m_localhost[256]{}; + char m_remotehost[256]{}; - emu_timer *timer; + emu_timer *timer = nullptr; required_shared_ptr m68k_ram; required_device m_commcpu; diff -Nru mame-0.242+dfsg.1/src/mame/machine/mac.cpp mame-0.243+dfsg.1/src/mame/machine/mac.cpp --- mame-0.242+dfsg.1/src/mame/machine/mac.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/mac.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1195,6 +1195,9 @@ m_overlay = 1; m_scsi_interrupt = 0; m_model = model; + m_scc_interrupt = 0; + m_via_interrupt = 0; + m_via2_interrupt = 0; m_rom_size = memregion("bootrom")->bytes(); m_rom_ptr = reinterpret_cast(memregion("bootrom")->base()); diff -Nru mame-0.242+dfsg.1/src/mame/machine/macrtc.h mame-0.243+dfsg.1/src/mame/machine/macrtc.h --- mame-0.242+dfsg.1/src/mame/machine/macrtc.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/macrtc.h 2022-04-29 05:37:26.000000000 +0000 @@ -51,35 +51,35 @@ private: /* state of rTCEnb and rTCClk lines */ - uint8_t m_rtc_rTCEnb; - uint8_t m_rtc_rTCClk; + uint8_t m_rtc_rTCEnb = 0; + uint8_t m_rtc_rTCClk = 0; /* serial transmit/receive register : bits are shifted in/out of this byte */ - uint8_t m_rtc_data_byte; + uint8_t m_rtc_data_byte = 0; /* serial transmitted/received bit count */ - uint8_t m_rtc_bit_count; + uint8_t m_rtc_bit_count = 0; /* direction of the current transfer (0 : VIA->RTC, 1 : RTC->VIA) */ - uint8_t m_rtc_data_dir; + uint8_t m_rtc_data_dir = 0; /* when rtc_data_dir == 1, state of rTCData as set by RTC (-> data bit seen by VIA) */ - uint8_t m_rtc_data_out; + uint8_t m_rtc_data_out = 0; /* set to 1 when command in progress */ - uint8_t m_rtc_cmd; + uint8_t m_rtc_cmd = 0; /* write protect flag */ - uint8_t m_rtc_write_protect; + uint8_t m_rtc_write_protect = 0; /* internal seconds register */ - uint8_t m_rtc_seconds[/*8*/4]; + uint8_t m_rtc_seconds[/*8*/4]{}; /* 20-byte long PRAM, or 256-byte long XPRAM */ - uint8_t m_pram[256]; + uint8_t m_pram[256]{}; /* current extended address and RTC state */ - uint8_t m_rtc_xpaddr; - uint8_t m_rtc_state; - uint8_t m_data_latch; + uint8_t m_rtc_xpaddr = 0; + uint8_t m_rtc_state = 0; + uint8_t m_data_latch = 0; // timers - emu_timer *m_clock_timer; + emu_timer *m_clock_timer = nullptr; void rtc_shift_data(int data); void rtc_execute_cmd(int data); diff -Nru mame-0.242+dfsg.1/src/mame/machine/mapledev.h mame-0.243+dfsg.1/src/mame/machine/mapledev.h --- mame-0.242+dfsg.1/src/mame/machine/mapledev.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/mapledev.h 2022-04-29 05:37:26.000000000 +0000 @@ -20,9 +20,9 @@ maple_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); - uint32_t reply_size; - bool reply_partial; - uint32_t reply_buffer[256]; + uint32_t reply_size = 0; + bool reply_partial = false; + uint32_t reply_buffer[256]{}; // device-level overrides virtual void device_start() override; @@ -40,10 +40,10 @@ // Configuration required_device host; - int host_port; + int host_port = 0; private: - emu_timer *timer; + emu_timer *timer = nullptr; }; #endif // MAME_MACHINE_MAPLEDEV_H diff -Nru mame-0.242+dfsg.1/src/mame/machine/mathbox.h mame-0.243+dfsg.1/src/mame/machine/mathbox.h --- mame-0.242+dfsg.1/src/mame/machine/mathbox.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/mathbox.h 2022-04-29 05:37:26.000000000 +0000 @@ -32,10 +32,10 @@ // internal state /* math box scratch registers */ - int16_t m_reg[16]; + int16_t m_reg[16]{}; /* math box result */ - int16_t m_result; + int16_t m_result = 0; }; DECLARE_DEVICE_TYPE(MATHBOX, mathbox_device) diff -Nru mame-0.242+dfsg.1/src/mame/machine/mbee.cpp mame-0.243+dfsg.1/src/mame/machine/mbee.cpp --- mame-0.242+dfsg.1/src/mame/machine/mbee.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/mbee.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -735,7 +735,7 @@ m_pak_extended[pak_index] = (size > 0x2000) ? true : false; - slot->rom_alloc(m_pak_extended ? 0x4000 : 0x2000, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE); // we alloc the amount for a real rom + slot->rom_alloc(m_pak_extended[pak_index] ? 0x4000 : 0x2000, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE); // we alloc the amount for a real rom slot->common_load_rom(slot->get_rom_base(), size, "rom"); // Validate the rom @@ -757,7 +757,7 @@ } m_pak_extended[pak_index] = (size > 0x1000) ? true : false; - slot->rom_alloc(m_pak_extended ? 0x2000 : 0x1000, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE); + slot->rom_alloc(m_pak_extended[pak_index] ? 0x2000 : 0x1000, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE); slot->common_load_rom(slot->get_rom_base(), size, "rom"); // Validate the rom diff -Nru mame-0.242+dfsg.1/src/mame/machine/mega32x.h mame-0.243+dfsg.1/src/mame/machine/mega32x.h --- mame-0.242+dfsg.1/src/mame/machine/mega32x.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/mega32x.h 2022-04-29 05:37:26.000000000 +0000 @@ -87,7 +87,7 @@ void render_videobuffer_to_screenbuffer_helper(int scanline); void render_videobuffer_to_screenbuffer(int x, uint32_t priority, uint32_t &lineptr); - int sh2_master_pwmint_enable, sh2_slave_pwmint_enable; + int sh2_master_pwmint_enable = 0, sh2_slave_pwmint_enable = 0; void check_framebuffer_swap(bool enabled); void check_irqs(); @@ -123,80 +123,80 @@ required_device m_scan_timer; memory_bank_creator m_rombank; - int m_32x_hcount_compare_val; - int m_32x_vblank_flag; - int m_sh2_are_running; - int m_32x_240mode; - uint16_t m_32x_a1518a_reg; + int m_32x_hcount_compare_val = 0; + int m_32x_vblank_flag = 0; + int m_sh2_are_running = 0; + int m_32x_240mode = 0; + uint16_t m_32x_a1518a_reg = 0; - sound_stream *m_stream; + sound_stream *m_stream = nullptr; TIMER_CALLBACK_MEMBER(handle_pwm_callback); void calculate_pwm_timer(); - uint16_t m_pwm_ctrl, m_pwm_cycle, m_pwm_tm_reg; + uint16_t m_pwm_ctrl = 0, m_pwm_cycle = 0, m_pwm_tm_reg = 0; static constexpr int PWM_FIFO_SIZE = 3; - uint16_t m_cur_lch[PWM_FIFO_SIZE],m_cur_rch[PWM_FIFO_SIZE]; - uint16_t m_pwm_cycle_reg; //used for latching - uint8_t m_pwm_timer_tick; - uint8_t m_lch_size, m_rch_size; - uint16_t m_lch_fifo_state, m_rch_fifo_state; + uint16_t m_cur_lch[PWM_FIFO_SIZE]{},m_cur_rch[PWM_FIFO_SIZE]{}; + uint16_t m_pwm_cycle_reg = 0; //used for latching + uint8_t m_pwm_timer_tick = 0; + uint8_t m_lch_size = 0, m_rch_size = 0; + uint16_t m_lch_fifo_state = 0, m_rch_fifo_state = 0; void lch_pop(); void rch_pop(); uint16_t get_hposition(void); - emu_timer *m_32x_pwm_timer; + emu_timer *m_32x_pwm_timer = nullptr; private: - int m_32x_displaymode; - int m_32x_videopriority; - uint32_t m_32x_linerender[320+258]; // tmp buffer (bigger than it needs to be to simplify RLE decode) - - int m_32x_adapter_enabled; - int m_32x_access_auth; - int m_32x_screenshift; - - uint16_t m_32x_68k_a15104_reg; - int m_sh2_master_vint_enable, m_sh2_slave_vint_enable; - int m_sh2_master_hint_enable, m_sh2_slave_hint_enable; - int m_sh2_master_cmdint_enable, m_sh2_slave_cmdint_enable; - int m_sh2_hint_in_vbl; - int m_sh2_master_vint_pending; - int m_sh2_slave_vint_pending; - int m_32x_fb_swap; - int m_32x_hcount_reg; - - uint16_t m_32x_autofill_length; - uint16_t m_32x_autofill_address; - uint16_t m_32x_autofill_data; - uint16_t m_a15106_reg; - uint16_t m_dreq_src_addr[2],m_dreq_dst_addr[2],m_dreq_size; - uint8_t m_sega_tv; - uint16_t m_hint_vector[2]; - uint16_t m_a15100_reg; - int m_32x_68k_a15102_reg; - - int m_32x_pal; - int m_framerate; - int m_base_total_scanlines; - int m_total_scanlines; + int m_32x_displaymode = 0; + int m_32x_videopriority = 0; + uint32_t m_32x_linerender[320+258]{}; // tmp buffer (bigger than it needs to be to simplify RLE decode) + + int m_32x_adapter_enabled = 0; + int m_32x_access_auth = 0; + int m_32x_screenshift = 0; + + uint16_t m_32x_68k_a15104_reg = 0; + int m_sh2_master_vint_enable = 0, m_sh2_slave_vint_enable = 0; + int m_sh2_master_hint_enable = 0, m_sh2_slave_hint_enable = 0; + int m_sh2_master_cmdint_enable = 0, m_sh2_slave_cmdint_enable = 0; + int m_sh2_hint_in_vbl = 0; + int m_sh2_master_vint_pending = 0; + int m_sh2_slave_vint_pending = 0; + int m_32x_fb_swap = 0; + int m_32x_hcount_reg = 0; + + uint16_t m_32x_autofill_length = 0; + uint16_t m_32x_autofill_address = 0; + uint16_t m_32x_autofill_data = 0; + uint16_t m_a15106_reg = 0; + uint16_t m_dreq_src_addr[2]{}, m_dreq_dst_addr[2]{}, m_dreq_size = 0; + uint8_t m_sega_tv = 0; + uint16_t m_hint_vector[2]{}; + uint16_t m_a15100_reg = 0; + int m_32x_68k_a15102_reg = 0; + + int m_32x_pal = 0; + int m_framerate = 0; + int m_base_total_scanlines = 0; + int m_total_scanlines = 0; - uint16_t m_commsram[8]; + uint16_t m_commsram[8]{}; std::unique_ptr m_32x_dram0; std::unique_ptr m_32x_dram1; - uint16_t *m_32x_display_dram, *m_32x_access_dram; + uint16_t *m_32x_display_dram = nullptr, *m_32x_access_dram = nullptr; std::unique_ptr m_32x_palette; - uint16_t m_fifo_block_a[4]; - uint16_t m_fifo_block_b[4]; - uint16_t* m_current_fifo_block; - uint16_t* m_current_fifo_readblock; - int m_current_fifo_write_pos; - int m_current_fifo_read_pos; - int m_fifo_block_a_full; - int m_fifo_block_b_full; + uint16_t m_fifo_block_a[4]{}; + uint16_t m_fifo_block_b[4]{}; + uint16_t* m_current_fifo_block = nullptr; + uint16_t* m_current_fifo_readblock = nullptr; + int m_current_fifo_write_pos = 0; + int m_current_fifo_read_pos = 0; + int m_fifo_block_a_full = 0; + int m_fifo_block_b_full = 0; }; diff -Nru mame-0.242+dfsg.1/src/mame/machine/megacdcd.cpp mame-0.243+dfsg.1/src/mame/machine/megacdcd.cpp --- mame-0.242+dfsg.1/src/mame/machine/megacdcd.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/megacdcd.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -113,7 +113,7 @@ #define CURRENT_TRACK_IS_DATA \ - (segacd.toc->tracks[SCD_CURTRK - 1].trktype != CD_TRACK_AUDIO) + (segacd.toc->tracks[SCD_CURTRK - 1].trktype != cdrom_file::CD_TRACK_AUDIO) #define CDD_PLAYINGCDDA 0x0100 #define CDD_READY 0x0400 @@ -314,7 +314,7 @@ if(segacd.cd == nullptr) // no CD is there, bail out return; CDD_STATUS |= SCD_STATUS; - msf = lba_to_msf_alt(SCD_CURLBA+150); + msf = cdrom_file::lba_to_msf_alt(SCD_CURLBA+150); CDD_MIN = to_bcd(((msf & 0x00ff0000)>>16),false); CDD_SEC = to_bcd(((msf & 0x0000ff00)>>8),false); CDD_FRAME = to_bcd(((msf & 0x000000ff)>>0),false); @@ -330,8 +330,8 @@ if(segacd.cd == nullptr) // no CD is there, bail out return; CDD_STATUS |= SCD_STATUS; - elapsedlba = SCD_CURLBA - segacd.toc->tracks[ cdrom_get_track(segacd.cd, SCD_CURLBA) ].logframeofs; - msf = lba_to_msf_alt (elapsedlba); + elapsedlba = SCD_CURLBA - segacd.toc->tracks[ segacd.cd->get_track(SCD_CURLBA) ].logframeofs; + msf = cdrom_file::lba_to_msf_alt (elapsedlba); //popmessage("%08x %08x",SCD_CURLBA,segacd.toc->tracks[ cdrom_get_track(segacd.cd, SCD_CURLBA) + 1 ].logframeofs); CDD_MIN = to_bcd(((msf & 0x00ff0000)>>16),false); CDD_SEC = to_bcd(((msf & 0x0000ff00)>>8),false); @@ -345,7 +345,7 @@ if(segacd.cd == nullptr) // no CD is there, bail out return; CDD_STATUS |= SCD_STATUS; - SCD_CURTRK = cdrom_get_track(segacd.cd, SCD_CURLBA)+1; + SCD_CURTRK = segacd.cd->get_track(SCD_CURLBA)+1; CDD_MIN = to_bcd(SCD_CURTRK, false); } @@ -357,8 +357,8 @@ return; CDD_STATUS |= SCD_STATUS; - uint32_t startlba = (segacd.toc->tracks[cdrom_get_last_track(segacd.cd)].logframeofs); - uint32_t startmsf = lba_to_msf_alt( startlba ); + uint32_t startlba = (segacd.toc->tracks[segacd.cd->get_last_track()].logframeofs); + uint32_t startmsf = cdrom_file::lba_to_msf_alt( startlba ); CDD_MIN = to_bcd((startmsf&0x00ff0000)>>16,false); CDD_SEC = to_bcd((startmsf&0x0000ff00)>>8,false); @@ -374,19 +374,20 @@ return; CDD_STATUS |= SCD_STATUS; CDD_MIN = 1; // first - CDD_SEC = to_bcd(cdrom_get_last_track(segacd.cd),false); // last + CDD_SEC = to_bcd(segacd.cd->get_last_track(),false); // last } void lc89510_temp_device::CDD_GetTrackAdr(void) { CLEAR_CDD_RESULT - int track = (CDD_TX[5] & 0xF) + (CDD_TX[4] & 0xF) * 10; - int last_track = cdrom_get_last_track(segacd.cd); - CDD_STATUS &= 0xFF; if(segacd.cd == nullptr) // no CD is there, bail out return; + + int track = (CDD_TX[5] & 0xF) + (CDD_TX[4] & 0xF) * 10; + int last_track = segacd.cd->get_last_track(); + CDD_STATUS |= SCD_STATUS; if (track > last_track) @@ -396,14 +397,14 @@ track = 1; uint32_t startlba = (segacd.toc->tracks[track-1].logframeofs); - uint32_t startmsf = lba_to_msf_alt( startlba+150 ); + uint32_t startmsf = cdrom_file::lba_to_msf_alt( startlba+150 ); CDD_MIN = to_bcd((startmsf&0x00ff0000)>>16,false); CDD_SEC = to_bcd((startmsf&0x0000ff00)>>8,false); CDD_FRAME = to_bcd((startmsf&0x000000ff)>>0,false); CDD_EXT = track % 10; - if (segacd.toc->tracks[track - 1].trktype != CD_TRACK_AUDIO) + if (segacd.toc->tracks[track - 1].trktype != cdrom_file::CD_TRACK_AUDIO) CDD_FRAME |= 0x0800; } @@ -413,12 +414,13 @@ { CLEAR_CDD_RESULT - int track = (CDD_TX[5] & 0xF) + (CDD_TX[4] & 0xF) * 10; - int last_track = cdrom_get_last_track(segacd.cd); - CDD_STATUS &= 0xFF; if(segacd.cd == nullptr) // no CD is there, bail out return; + + int track = (CDD_TX[5] & 0xF) + (CDD_TX[4] & 0xF) * 10; + int last_track = segacd.cd->get_last_track(); + CDD_STATUS |= SCD_STATUS; if (track > last_track) @@ -427,7 +429,7 @@ if (track < 1) track = 1; - if (segacd.toc->tracks[track - 1].trktype != CD_TRACK_AUDIO) + if (segacd.toc->tracks[track - 1].trktype != cdrom_file::CD_TRACK_AUDIO) { CDD_EXT = 0x08; CDD_FRAME |= 0x0800; @@ -452,11 +454,11 @@ { CLEAR_CDD_RESULT uint32_t msf = getmsf_from_regs(); - SCD_CURLBA = msf_to_lba(msf)-150; + SCD_CURLBA = cdrom_file::msf_to_lba(msf)-150; if(segacd.cd == nullptr) // no CD is there, bail out return; - uint32_t track_length = segacd.toc->tracks[ cdrom_get_track(segacd.cd, SCD_CURLBA) ].logframes; - SCD_CURTRK = cdrom_get_track(segacd.cd, SCD_CURLBA)+1; + uint32_t track_length = segacd.toc->tracks[ segacd.cd->get_track(SCD_CURLBA) ].logframes; + SCD_CURTRK = segacd.cd->get_track(SCD_CURLBA)+1; LC8951UpdateHeader(); SCD_STATUS = CDD_PLAYINGCDDA; CDD_STATUS = 0x0102; @@ -477,10 +479,10 @@ { CLEAR_CDD_RESULT uint32_t msf = getmsf_from_regs(); - SCD_CURLBA = msf_to_lba(msf)-150; + SCD_CURLBA = cdrom_file::msf_to_lba(msf)-150; if(segacd.cd == nullptr) // no CD is there, bail out return; - SCD_CURTRK = cdrom_get_track(segacd.cd, SCD_CURLBA)+1; + SCD_CURTRK = segacd.cd->get_track(SCD_CURLBA)+1; LC8951UpdateHeader(); STOP_CDC_READ SCD_STATUS = CDD_READY; @@ -513,7 +515,7 @@ STOP_CDC_READ if(segacd.cd == nullptr) // no CD is there, bail out return; - SCD_CURTRK = cdrom_get_track(segacd.cd, SCD_CURLBA)+1; + SCD_CURTRK = segacd.cd->get_track(SCD_CURLBA)+1; SCD_STATUS = CDD_PLAYINGCDDA; CDD_STATUS = 0x0102; set_data_audio_mode(); @@ -1108,7 +1110,7 @@ segacd.cd = m_cdrom->get_cdrom_file(); if ( segacd.cd ) { - segacd.toc = cdrom_get_toc( segacd.cd ); + segacd.toc = &segacd.cd->get_toc(); m_cdda->set_cdrom(segacd.cd); m_cdda->stop_audio(); //stop any pending CD-DA } @@ -1219,7 +1221,7 @@ } else { // HEAD registers have header - uint32_t msf = lba_to_msf_alt(SCD_CURLBA+150); + uint32_t msf = cdrom_file::lba_to_msf_alt(SCD_CURLBA+150); LC8951RegistersR[REG_R_HEAD0] = to_bcd (((msf & 0x00ff0000)>>16), true); // HEAD0 LC8951RegistersR[REG_R_HEAD1] = to_bcd (((msf & 0x0000ff00)>>8), true); // HEAD1 @@ -1333,7 +1335,7 @@ if (CDD_CONTROL & 0x0100) data_track = true; if (data_track) - cdrom_read_data(segacd.cd, SCD_CURLBA, SCD_BUFFER, CD_TRACK_MODE1); + segacd.cd->read_data(SCD_CURLBA, SCD_BUFFER, cdrom_file::CD_TRACK_MODE1); LC8951UpdateHeader(); diff -Nru mame-0.242+dfsg.1/src/mame/machine/megacdcd.h mame-0.243+dfsg.1/src/mame/machine/megacdcd.h --- mame-0.242+dfsg.1/src/mame/machine/megacdcd.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/megacdcd.h 2022-04-29 05:37:26.000000000 +0000 @@ -92,7 +92,7 @@ struct segacd_t { cdrom_file *cd; - const cdrom_toc *toc; + const cdrom_file::toc *toc; uint32_t current_frame; }; diff -Nru mame-0.242+dfsg.1/src/mame/machine/megacd.h mame-0.243+dfsg.1/src/mame/machine/megacd.h --- mame-0.242+dfsg.1/src/mame/machine/megacd.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/megacd.h 2022-04-29 05:37:26.000000000 +0000 @@ -129,51 +129,51 @@ // can't use a memshare because it's 8-bit RAM in a 16-bit address space std::vector m_backupram; - uint8_t m_font_color; + uint8_t m_font_color = 0; - uint16_t scd_rammode; - uint32_t scd_mode_dmna_ret_flags ; + uint16_t scd_rammode = 0; + uint32_t scd_mode_dmna_ret_flags = 0; - tilemap_t *segacd_stampmap[4]; + tilemap_t *segacd_stampmap[4]{}; - uint8_t segacd_ram_writeprotect_bits; - int segacd_4meg_prgbank;// = 0; // which bank the MainCPU can see of the SubCPU PrgRAM - int segacd_memory_priority_mode;// = 0; - int segacd_stampsize; + uint8_t segacd_ram_writeprotect_bits = 0; + int segacd_4meg_prgbank = 0; // which bank the MainCPU can see of the SubCPU PrgRAM + int segacd_memory_priority_mode = 0; + int segacd_stampsize = 0; - uint16_t segacd_hint_register; - uint16_t segacd_imagebuffer_vdot_size; - uint16_t segacd_imagebuffer_vcell_size; - uint16_t segacd_imagebuffer_hdot_size; + uint16_t segacd_hint_register = 0; + uint16_t segacd_imagebuffer_vdot_size = 0; + uint16_t segacd_imagebuffer_vcell_size = 0; + uint16_t segacd_imagebuffer_hdot_size = 0; - int segacd_conversion_active;// = 0; - uint16_t segacd_stampmap_base_address; - uint16_t segacd_imagebuffer_start_address; - uint16_t segacd_imagebuffer_offset; + int segacd_conversion_active = 0; + uint16_t segacd_stampmap_base_address = 0; + uint16_t segacd_imagebuffer_start_address = 0; + uint16_t segacd_imagebuffer_offset = 0; - uint16_t segacd_comms_flags;// = 0x0000; - uint16_t segacd_comms_part1[0x8]; - uint16_t segacd_comms_part2[0x8]; + uint16_t segacd_comms_flags = 0; + uint16_t segacd_comms_part1[0x8]{}; + uint16_t segacd_comms_part2[0x8]{}; - int segacd_redled;// = 0; - int segacd_greenled;// = 0; - int segacd_ready;// = 1; // actually set 100ms after startup? - uint8_t m_irq3_timer_reg; + int segacd_redled = 0; + int segacd_greenled = 0; + int segacd_ready = 1; // actually set 100ms after startup? + uint8_t m_irq3_timer_reg = 0; inline void write_pixel(uint8_t pix, int pixeloffset); uint16_t segacd_1meg_mode_word_read(offs_t offset); void segacd_1meg_mode_word_write(offs_t offset, uint16_t data, uint16_t mem_mask, int use_pm); - uint16_t m_dmaaddr; + uint16_t m_dmaaddr = 0; - uint16_t m_a12000_halt_reset_reg; + uint16_t m_a12000_halt_reset_reg = 0; - int m_framerate; - int m_base_total_scanlines; - int m_total_scanlines; + int m_framerate = 0; + int m_base_total_scanlines = 0; + int m_total_scanlines = 0; void segacd_mark_tiles_dirty(int offset); int segacd_get_active_stampmap_tilemap(void); diff -Nru mame-0.242+dfsg.1/src/mame/machine/microtan.cpp mame-0.243+dfsg.1/src/mame/machine/microtan.cpp --- mame-0.242+dfsg.1/src/mame/machine/microtan.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/microtan.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -667,14 +667,27 @@ SNAPSHOT_LOAD_MEMBER(microtan_state::snapshot_cb) { - uint8_t *snapshot_buff = (uint8_t*)image.ptr(); - if (!snapshot_buff) + uint64_t snapshot_len = image.length(); + if (snapshot_len < 4 || snapshot_len >= 66000) + { + //image.seterror(image_error::INVALIDIMAGE); return image_init_result::FAIL; + } - if (verify_snapshot(snapshot_buff, image.length()) != image_verify_result::PASS) + auto snapshot_buff = std::make_unique(snapshot_len); + if (image.fread(snapshot_buff.get(), snapshot_len) != snapshot_len) + { + //image.seterror(image_error::UNSPECIFIED); return image_init_result::FAIL; + } - snapshot_copy(snapshot_buff, image.length()); + if (verify_snapshot(snapshot_buff.get(), snapshot_len) != image_verify_result::PASS) + { + //image.seterror(image_error::INVALIDIMAGE); + return image_init_result::FAIL; + } + + snapshot_copy(snapshot_buff.get(), snapshot_len); return image_init_result::PASS; } diff -Nru mame-0.242+dfsg.1/src/mame/machine/midwayic.h mame-0.243+dfsg.1/src/mame/machine/midwayic.h --- mame-0.242+dfsg.1/src/mame/machine/midwayic.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/midwayic.h 2022-04-29 05:37:26.000000000 +0000 @@ -43,14 +43,14 @@ required_ioport m_io_serial_digit; - uint8_t m_data[16]; // reused by other devices - int m_upper; + uint8_t m_data[16]{}; // reused by other devices + int m_upper = 0; private: - uint8_t m_buff; - uint8_t m_idx; - uint8_t m_status; - uint8_t m_bits; + uint8_t m_buff = 0; + uint8_t m_idx = 0; + uint8_t m_status = 0; + uint8_t m_bits = 0; }; @@ -83,10 +83,10 @@ u8 read_c(); void write_c(u8 data); - u8 m_command; - u8 m_data_out; - u8 m_clk; - u8 m_status; + u8 m_command = 0; + u8 m_data_out = 0; + u8 m_clk = 0; + u8 m_status = 0; }; @@ -129,20 +129,20 @@ void pic_register_state(); TIMER_CALLBACK_MEMBER( reset_timer ); - uint16_t m_latch; - attotime m_latch_expire_time; - uint8_t m_state; - uint8_t m_index; - uint8_t m_total; - uint8_t m_nvram_addr; - uint8_t m_buffer[0x10]; - uint8_t m_nvram[0x100]; - uint8_t m_default_nvram[0x100]; - uint8_t m_time_buf[8]; - uint8_t m_time_index; - uint8_t m_time_just_written; - uint16_t m_yearoffs; - emu_timer *m_time_write_timer; + uint16_t m_latch = 0; + attotime m_latch_expire_time{}; + uint8_t m_state = 0; + uint8_t m_index = 0; + uint8_t m_total = 0; + uint8_t m_nvram_addr = 0; + uint8_t m_buffer[0x10]{}; + uint8_t m_nvram[0x100]{}; + uint8_t m_default_nvram[0x100]{}; + uint8_t m_time_buf[8]{}; + uint8_t m_time_index = 0; + uint8_t m_time_just_written = 0; + uint16_t m_yearoffs = 0; + emu_timer *m_time_write_timer = nullptr; }; @@ -205,25 +205,25 @@ devcb_write8 m_serial_tx_cb; devcb_write32 m_aux_output_cb; - uint32_t m_reg[16]; - uint8_t m_has_dcs; - uint8_t m_has_cage; - cpu_device *m_dcs_cpu; - uint8_t m_shuffle_type; - uint8_t m_shuffle_default; - uint8_t m_shuffle_active; - const uint8_t * m_shuffle_map; + uint32_t m_reg[16]{}; + uint8_t m_has_dcs = 0; + uint8_t m_has_cage = 0; + cpu_device *m_dcs_cpu = nullptr; + uint8_t m_shuffle_type = 0; + uint8_t m_shuffle_default = 0; + uint8_t m_shuffle_active = 0; + const uint8_t * m_shuffle_map = nullptr; devcb_write8 m_irq_callback; - uint8_t m_irq_state; - uint16_t m_sound_irq_state; - uint8_t m_auto_ack; - uint8_t m_force_fifo_full; - - uint16_t m_fifo[512]; - uint16_t m_fifo_in; - uint16_t m_fifo_out; - uint16_t m_fifo_bytes; - offs_t m_fifo_force_buffer_empty_pc; + uint8_t m_irq_state = 0; + uint16_t m_sound_irq_state = 0; + uint8_t m_auto_ack = 0; + uint8_t m_force_fifo_full = 0; + + uint16_t m_fifo[512]{}; + uint16_t m_fifo_in = 0; + uint16_t m_fifo_out = 0; + uint16_t m_fifo_bytes = 0; + offs_t m_fifo_force_buffer_empty_pc = 0; optional_device m_cage; optional_device m_dcs; diff -Nru mame-0.242+dfsg.1/src/mame/machine/mie.h mame-0.243+dfsg.1/src/mame/machine/mie.h --- mame-0.242+dfsg.1/src/mame/machine/mie.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/mie.h 2022-04-29 05:37:26.000000000 +0000 @@ -107,16 +107,16 @@ // internal state required_device cpu; - emu_timer *timer; + emu_timer *timer = nullptr; required_device jvs; optional_ioport_array<8> gpio_port; - uint32_t tbuf[TBUF_SIZE]; - uint32_t control, lreg, jvs_rpos; - uint8_t gpiodir, gpio_val[8]; - uint8_t irq_enable, irq_pending, maple_irqlevel; - uint8_t jvs_control, jvs_dest; - uint8_t jvs_lcr; + uint32_t tbuf[TBUF_SIZE]{}; + uint32_t control = 0, lreg = 0, jvs_rpos = 0; + uint8_t gpiodir = 0, gpio_val[8]{}; + uint8_t irq_enable = 0, irq_pending = 0, maple_irqlevel = 0; + uint8_t jvs_control = 0, jvs_dest = 0; + uint8_t jvs_lcr = 0; void raise_irq(int level); void recalc_irq(); diff -Nru mame-0.242+dfsg.1/src/mame/machine/mmboard.h mame-0.243+dfsg.1/src/mame/machine/mmboard.h --- mame-0.242+dfsg.1/src/mame/machine/mmboard.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/mmboard.h 2022-04-29 05:37:26.000000000 +0000 @@ -49,8 +49,8 @@ attotime m_sensordelay; bool m_disable_leds; - u8 m_led_data; - u8 m_mux; + u8 m_led_data = 0; + u8 m_mux = 0; }; diff -Nru mame-0.242+dfsg.1/src/mame/machine/mtx.cpp mame-0.243+dfsg.1/src/mame/machine/mtx.cpp --- mame-0.242+dfsg.1/src/mame/machine/mtx.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/mtx.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -435,8 +435,26 @@ // more data from tape. todo: tapes which autorun after loading SNAPSHOT_LOAD_MEMBER(mtx_state::snapshot_cb) { - address_space &program = m_maincpu->space(AS_PROGRAM); - uint8_t *data = (uint8_t*)image.ptr(); + uint64_t length = image.length(); + + if (length < 18) + { + image.seterror(image_error::INVALIDIMAGE, "File too short"); + return image_init_result::FAIL; + } + + if (length >= 0x10000 - 0x4000 + 18) + { + image.seterror(image_error::INVALIDIMAGE, "File too long"); + return image_init_result::FAIL; + } + + auto data = std::make_unique(length); + if (image.fread(data.get(), length) != length) + { + image.seterror(image_error::UNSPECIFIED, "Error reading file"); + return image_init_result::FAIL; + } // verify first byte if (data[0] != 0xff) @@ -451,11 +469,13 @@ tape_name[15] = '\0'; image.message("Loading '%s'", tape_name); + address_space &program = m_maincpu->space(AS_PROGRAM); + // reset memory map bankswitch(0); // start of system variables area - uint16_t system_variables_base = pick_integer_le(data, 16, 2); + uint16_t system_variables_base = pick_integer_le(data.get(), 16, 2); // write system variables uint16_t system_variables_size = 0; @@ -483,19 +503,31 @@ QUICKLOAD_LOAD_MEMBER(mtx_state::quickload_cb) { - address_space &program = m_maincpu->space(AS_PROGRAM); - uint8_t *data = (uint8_t*)image.ptr(); + uint64_t length = image.length(); - if (image.length() < 4) + if (length < 4) { image.seterror(image_error::INVALIDIMAGE, "File too short"); return image_init_result::FAIL; } - uint16_t code_base = pick_integer_le(data, 0, 2); - uint16_t code_length = pick_integer_le(data, 2, 2); + if (length >= 0x10000 - 0x4000 + 4) + { + image.seterror(image_error::INVALIDIMAGE, "File too long"); + return image_init_result::FAIL; + } - if (image.length() < code_length) + auto data = std::make_unique(length); + if (image.fread(data.get(), length) != length) + { + image.seterror(image_error::UNSPECIFIED, "Error reading file"); + return image_init_result::FAIL; + } + + uint16_t code_base = pick_integer_le(data.get(), 0, 2); + uint16_t code_length = pick_integer_le(data.get(), 2, 2); + + if (length < code_length) { image.seterror(image_error::INVALIDIMAGE, "File too short"); return image_init_result::FAIL; @@ -511,6 +543,7 @@ bankswitch(0); // write image data + address_space &program = m_maincpu->space(AS_PROGRAM); for (int i = 0; i < code_length; i++) program.write_byte(code_base + i, data[4 + i]); diff -Nru mame-0.242+dfsg.1/src/mame/machine/namco06.h mame-0.243+dfsg.1/src/mame/machine/namco06.h --- mame-0.242+dfsg.1/src/mame/machine/namco06.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/namco06.h 2022-04-29 05:37:26.000000000 +0000 @@ -37,7 +37,7 @@ TIMER_CALLBACK_MEMBER( ctrl_w_sync ); // internal state - emu_timer *m_nmi_timer; + emu_timer *m_nmi_timer = nullptr; uint8_t m_control; bool m_next_timer_state; bool m_read_stretch; diff -Nru mame-0.242+dfsg.1/src/mame/machine/namco_c139.h mame-0.243+dfsg.1/src/mame/machine/namco_c139.h --- mame-0.242+dfsg.1/src/mame/machine/namco_c139.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/namco_c139.h 2022-04-29 05:37:26.000000000 +0000 @@ -47,7 +47,7 @@ virtual space_config_vector memory_space_config() const override; private: const address_space_config m_space_config; - uint16_t* m_ram; + uint16_t* m_ram = nullptr; }; diff -Nru mame-0.242+dfsg.1/src/mame/machine/namcoio_gearbox.h mame-0.243+dfsg.1/src/mame/machine/namcoio_gearbox.h --- mame-0.242+dfsg.1/src/mame/machine/namcoio_gearbox.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/namcoio_gearbox.h 2022-04-29 05:37:26.000000000 +0000 @@ -26,7 +26,7 @@ // I/O operations DECLARE_CUSTOM_INPUT_MEMBER( in_r ); DECLARE_READ_LINE_MEMBER( clutch_r ); - uint8_t m_gearbox_state; + uint8_t m_gearbox_state = 0; virtual ioport_constructor device_input_ports() const override; protected: diff -Nru mame-0.242+dfsg.1/src/mame/machine/namcoio.h mame-0.243+dfsg.1/src/mame/machine/namcoio.h --- mame-0.242+dfsg.1/src/mame/machine/namcoio.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/namcoio.h 2022-04-29 05:37:26.000000000 +0000 @@ -36,18 +36,18 @@ }; // internal state - uint8_t m_ram[16]; + uint8_t m_ram[16]{}; devcb_read8::array<4> m_in_cb; devcb_write8::array<2> m_out_cb; - int m_reset; - int32_t m_lastcoins, m_lastbuttons; - int32_t m_credits; - int32_t m_coins[2]; - int32_t m_coins_per_cred[2]; - int32_t m_creds_per_coin[2]; - int32_t m_in_count; + int m_reset = 0; + int32_t m_lastcoins = 0, m_lastbuttons = 0; + int32_t m_credits = 0; + int32_t m_coins[2]{}; + int32_t m_coins_per_cred[2]{}; + int32_t m_creds_per_coin[2]{}; + int32_t m_in_count = 0; void handle_coins( int swap ); diff -Nru mame-0.242+dfsg.1/src/mame/machine/namcos21_dsp.h mame-0.243+dfsg.1/src/mame/machine/namcos21_dsp.h --- mame-0.242+dfsg.1/src/mame/machine/namcos21_dsp.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/namcos21_dsp.h 2022-04-29 05:37:26.000000000 +0000 @@ -49,20 +49,20 @@ required_device m_renderer; std::unique_ptr m_pointram; - int m_pointram_idx; - uint16_t m_pointram_control; + int m_pointram_idx = 0; + uint16_t m_pointram_control = 0; - uint16_t m_winrun_dspcomram_control[8]; + uint16_t m_winrun_dspcomram_control[8]{}; std::unique_ptr m_winrun_dspcomram; - uint16_t m_winrun_poly_buf[WINRUN_MAX_POLY_PARAM]; - int m_winrun_poly_index; - uint32_t m_winrun_pointrom_addr; - int m_winrun_dsp_alive; + uint16_t m_winrun_poly_buf[WINRUN_MAX_POLY_PARAM]{}; + int m_winrun_poly_index = 0; + uint32_t m_winrun_pointrom_addr = 0; + int m_winrun_dsp_alive = 0; void winrun_flush_poly(); - int m_poly_frame_width; - int m_poly_frame_height; + int m_poly_frame_width = 0; + int m_poly_frame_height = 0; uint16_t winrun_cuskey_r(); void winrun_cuskey_w(uint16_t data); @@ -76,7 +76,7 @@ uint16_t winrun_dsp_pointrom_data_r(); TIMER_CALLBACK_MEMBER(suspend_callback); - emu_timer *m_suspend_timer; + emu_timer *m_suspend_timer = nullptr; }; diff -Nru mame-0.242+dfsg.1/src/mame/machine/namco_settings.h mame-0.243+dfsg.1/src/mame/machine/namco_settings.h --- mame-0.242+dfsg.1/src/mame/machine/namco_settings.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/namco_settings.h 2022-04-29 05:37:26.000000000 +0000 @@ -21,9 +21,9 @@ virtual void device_reset() override; private: - int ce, clk, data; - int cur_bit; - uint8_t adr, value; + int ce = 0, clk = 0, data = 0; + int cur_bit = 0; + uint8_t adr = 0, value = 0; }; DECLARE_DEVICE_TYPE(NAMCO_SETTINGS, namco_settings_device) diff -Nru mame-0.242+dfsg.1/src/mame/machine/naomibd.h mame-0.243+dfsg.1/src/mame/machine/naomibd.h --- mame-0.242+dfsg.1/src/mame/machine/naomibd.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/naomibd.h 2022-04-29 05:37:26.000000000 +0000 @@ -44,13 +44,13 @@ // To be optionally defined in the underlying class virtual void board_write(offs_t offset, uint16_t data); - uint32_t rom_offset; + uint32_t rom_offset = 0; optional_device eeprom; private: - uint32_t dma_offset, dma_cur_offset; - uint16_t dma_count; - bool pio_ready, dma_ready; + uint32_t dma_offset = 0, dma_cur_offset = 0; + uint16_t dma_count = 0; + bool pio_ready = false, dma_ready = false; }; #endif // MAME_MACHINE_NAOMIBD_H diff -Nru mame-0.242+dfsg.1/src/mame/machine/naomigd.cpp mame-0.243+dfsg.1/src/mame/machine/naomigd.cpp --- mame-0.242+dfsg.1/src/mame/machine/naomigd.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/naomigd.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -370,22 +370,6 @@ return (uint64_t(r) << 32) | uint64_t(l); } -uint64_t naomi_gdrom_board::rev64(uint64_t src) -{ - uint64_t ret; - - ret = ((src & 0x00000000000000ffULL) << 56) - | ((src & 0x000000000000ff00ULL) << 40) - | ((src & 0x0000000000ff0000ULL) << 24) - | ((src & 0x00000000ff000000ULL) << 8 ) - | ((src & 0x000000ff00000000ULL) >> 8 ) - | ((src & 0x0000ff0000000000ULL) >> 24) - | ((src & 0x00ff000000000000ULL) >> 40) - | ((src & 0xff00000000000000ULL) >> 56); - - return ret; -} - uint64_t naomi_gdrom_board::read_to_qword(const uint8_t *region) { uint64_t ret = 0; @@ -960,22 +944,22 @@ logerror("key is %08x%08x\n", (uint32_t)((key & 0xffffffff00000000ULL)>>32), (uint32_t)(key & 0x00000000ffffffffULL)); uint8_t buffer[2048]; - cdrom_file *gdromfile = cdrom_open(machine().rom_load().get_disk_handle(image_tag)); + cdrom_file *gdromfile = new cdrom_file(machine().rom_load().get_disk_handle(image_tag)); // primary volume descriptor // read frame 0xb06e (frame=sector+150) // dimm board firmware starts straight from this frame - cdrom_read_data(gdromfile, (netpic ? 0 : 45000) + 16, buffer, CD_TRACK_MODE1); + gdromfile->read_data((netpic ? 0 : 45000) + 16, buffer, cdrom_file::CD_TRACK_MODE1); uint32_t path_table = ((buffer[0x8c+0] << 0) | (buffer[0x8c+1] << 8) | (buffer[0x8c+2] << 16) | (buffer[0x8c+3] << 24)); // path table - cdrom_read_data(gdromfile, path_table, buffer, CD_TRACK_MODE1); + gdromfile->read_data(path_table, buffer, cdrom_file::CD_TRACK_MODE1); // directory - uint8_t dir_sector[2048]; + uint8_t dir_sector[2048]{}; // find data of file - uint32_t file_start, file_size; + uint32_t file_start = 0, file_size = 0; if (netpic == 0) { uint32_t dir = ((buffer[0x2 + 0] << 0) | @@ -983,12 +967,12 @@ (buffer[0x2 + 2] << 16) | (buffer[0x2 + 3] << 24)); - cdrom_read_data(gdromfile, dir, dir_sector, CD_TRACK_MODE1); + gdromfile->read_data(dir, dir_sector, cdrom_file::CD_TRACK_MODE1); find_file(name, dir_sector, file_start, file_size); if (file_start && (file_size == 0x100)) { // read file - cdrom_read_data(gdromfile, file_start, buffer, CD_TRACK_MODE1); + gdromfile->read_data(file_start, buffer, cdrom_file::CD_TRACK_MODE1); // get "rom" file name memset(name, '\0', 128); memcpy(name, buffer + 0xc0, FILENAME_LENGTH - 1); @@ -1004,7 +988,7 @@ (buffer[i + 4] << 16) | (buffer[i + 5] << 24)); memcpy(name, "ROM.BIN", 7); - cdrom_read_data(gdromfile, dir, dir_sector, CD_TRACK_MODE1); + gdromfile->read_data(dir, dir_sector, cdrom_file::CD_TRACK_MODE1); break; } i += buffer[i] + 8 + (buffer[i] & 1); @@ -1024,17 +1008,17 @@ // read encrypted data into dimm_des_data uint32_t sectors = file_rounded_size / 2048; for (uint32_t sec = 0; sec != sectors; sec++) - cdrom_read_data(gdromfile, file_start + sec, &dimm_des_data[2048 * sec], CD_TRACK_MODE1); + gdromfile->read_data(file_start + sec, &dimm_des_data[2048 * sec], cdrom_file::CD_TRACK_MODE1); uint32_t des_subkeys[32]; - des_generate_subkeys(rev64(key), des_subkeys); + des_generate_subkeys(swapendian_int64(key), des_subkeys); // decrypt read data from dimm_des_data to dimm_data for (int i = 0; i < file_rounded_size; i += 8) - write_from_qword(&dimm_data[i], rev64(des_encrypt_decrypt(true, rev64(read_to_qword(&dimm_des_data[i])), des_subkeys))); + write_from_qword(&dimm_data[i], swapendian_int64(des_encrypt_decrypt(true, swapendian_int64(read_to_qword(&dimm_des_data[i])), des_subkeys))); } - cdrom_close(gdromfile); + delete gdromfile; if(!dimm_data) throw emu_fatalerror("GDROM: Could not find the file to decrypt."); diff -Nru mame-0.242+dfsg.1/src/mame/machine/naomigd.h mame-0.243+dfsg.1/src/mame/machine/naomigd.h --- mame-0.242+dfsg.1/src/mame/machine/naomigd.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/naomigd.h 2022-04-29 05:37:26.000000000 +0000 @@ -194,7 +194,6 @@ inline void permutate(uint32_t &a, uint32_t &b, uint32_t m, int shift); void des_generate_subkeys(const uint64_t key, uint32_t *subkeys); uint64_t des_encrypt_decrypt(bool decrypt, uint64_t src, const uint32_t *des_subkeys); - uint64_t rev64(uint64_t src); uint64_t read_to_qword(const uint8_t *region); void write_from_qword(uint8_t *region, uint64_t qword); }; diff -Nru mame-0.242+dfsg.1/src/mame/machine/nb1413m3.h mame-0.243+dfsg.1/src/mame/machine/nb1413m3.h --- mame-0.242+dfsg.1/src/mame/machine/nb1413m3.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/nb1413m3.h 2022-04-29 05:37:26.000000000 +0000 @@ -174,7 +174,7 @@ int m_busyctr; int m_outcoin_flag; int m_inputport; - int m_nb1413m3_type; + int m_nb1413m3_type = 0; protected: // device-level overrides @@ -194,7 +194,7 @@ int m_gfxradr_h; int m_gfxrombank; int m_outcoin_enable; - emu_timer *m_timer_cb; + emu_timer *m_timer_cb = nullptr; output_finder<> m_led; TIMER_CALLBACK_MEMBER( timer_callback ); }; diff -Nru mame-0.242+dfsg.1/src/mame/machine/nb1414m4.h mame-0.243+dfsg.1/src/mame/machine/nb1414m4.h --- mame-0.242+dfsg.1/src/mame/machine/nb1414m4.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/nb1414m4.h 2022-04-29 05:37:26.000000000 +0000 @@ -31,9 +31,9 @@ void _0e00(uint16_t mcu_cmd, uint8_t *vram); required_region_ptr m_data; - uint16_t m_previous_0200_command; - uint64_t m_previous_0200_command_frame; - bool m_in_game; + uint16_t m_previous_0200_command = 0; + uint64_t m_previous_0200_command_frame = 0; + bool m_in_game = false; }; DECLARE_DEVICE_TYPE(NB1414M4, nb1414m4_device) diff -Nru mame-0.242+dfsg.1/src/mame/machine/nes.cpp mame-0.243+dfsg.1/src/mame/machine/nes.cpp --- mame-0.242+dfsg.1/src/mame/machine/nes.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/nes.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -89,7 +89,7 @@ BMC_800IN1, BMC_8157, BMC_970630C, - BMC_GOLD150, + BMC_DS927, BMC_KC885, BMC_TELETUBBIES, BMC_VT5201, diff -Nru mame-0.242+dfsg.1/src/mame/machine/nes_vt369_vtunknown_soc.h mame-0.243+dfsg.1/src/mame/machine/nes_vt369_vtunknown_soc.h --- mame-0.242+dfsg.1/src/mame/machine/nes_vt369_vtunknown_soc.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/nes_vt369_vtunknown_soc.h 2022-04-29 05:37:26.000000000 +0000 @@ -51,8 +51,8 @@ required_device m_soundcpu; uint8_t m_relative[2]; std::vector m_6000_ram; - uint8_t m_bank6000; - uint8_t m_bank6000_enable; + uint8_t m_bank6000 = 0; + uint8_t m_bank6000_enable = 0; }; class nes_vtunknown_soc_bt_device : public nes_vt09_soc_device diff -Nru mame-0.242+dfsg.1/src/mame/machine/nes_vt_soc.h mame-0.243+dfsg.1/src/mame/machine/nes_vt_soc.h --- mame-0.242+dfsg.1/src/mame/machine/nes_vt_soc.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/nes_vt_soc.h 2022-04-29 05:37:26.000000000 +0000 @@ -108,21 +108,21 @@ uint32_t screen_update(screen_device& screen, bitmap_rgb32& bitmap, const rectangle& cliprect); - uint8_t m_410x[0xc]; + uint8_t m_410x[0xc]{}; - uint8_t m_vdma_ctrl; - int m_timer_irq_enabled; - int m_timer_running; - int m_timer_val; + uint8_t m_vdma_ctrl = 0; + int m_timer_irq_enabled = 0; + int m_timer_running = 0; + int m_timer_val = 0; - uint8_t m_8000_scramble[8]; - uint8_t m_410x_scramble[2]; + uint8_t m_8000_scramble[8]{}; + uint8_t m_410x_scramble[2]{}; - uint8_t m_8000_addr_latch; + uint8_t m_8000_addr_latch = 0; - uint8_t m_4242; - uint8_t m_411c; - uint8_t m_411d; + uint8_t m_4242 = 0; + uint8_t m_411c = 0; + uint8_t m_411d = 0; uint8_t m_initial_e000_bank; /* expansion nametable - todo, see if we can refactor NES code to be reusable without having to add full NES bus etc. */ @@ -141,7 +141,7 @@ address_space_config m_space_config; - int m_bankaddr[4]; + int m_bankaddr[4]{}; devcb_write8 m_write_0_callback; devcb_read8 m_read_0_callback; @@ -159,8 +159,8 @@ uint8_t m_2012_2017_descramble[0x6]; // passed to PPU in reset vtxx_pal_mode m_default_palette_mode; - bool m_force_baddma; - bool m_use_raster_timing_hack; + bool m_force_baddma = false; + bool m_use_raster_timing_hack = false; }; class nes_vt02_vt03_soc_pal_device : public nes_vt02_vt03_soc_device diff -Nru mame-0.242+dfsg.1/src/mame/machine/ns10crypt.cpp mame-0.243+dfsg.1/src/mame/machine/ns10crypt.cpp --- mame-0.242+dfsg.1/src/mame/machine/ns10crypt.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/ns10crypt.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -132,23 +132,23 @@ ns10_decrypter_device::ns10_decrypter_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, type, tag, owner, clock) { - _active = false; + m_active = false; } void ns10_decrypter_device::activate(int iv) { init(iv); - _active = true; + m_active = true; } void ns10_decrypter_device::deactivate() { - _active = false; + m_active = false; } bool ns10_decrypter_device::is_active()const { - return _active; + return m_active; } ns10_decrypter_device::~ns10_decrypter_device() @@ -170,41 +170,41 @@ uint16_t ns10_type1_decrypter_device::decrypt(uint16_t cipherword) { - uint16_t plainword = _mask ^ bitswap(cipherword,9,13,15,7,14,8,6,10,11,12,3,5,0,1,4,2); + uint16_t plainword = m_mask ^ bitswap(cipherword,9,13,15,7,14,8,6,10,11,12,3,5,0,1,4,2); uint16_t nbs = - ((BIT(_counter, 4) ) << 15) ^ + ((BIT(m_counter, 4) ) << 15) ^ ((BIT(cipherword, 2) ^ BIT(cipherword, 5) ) << 14) ^ ((BIT(cipherword, 0) ) << 13) ^ (((BIT(cipherword, 4) | BIT(cipherword, 5))) << 12) ^ // this is the only nonlinear term not involving the counter - ((BIT(_counter, 0) ) << 11) ^ + ((BIT(m_counter, 0) ) << 11) ^ ((BIT(cipherword, 6) ) << 10) ^ - (((BIT(cipherword, 4) & BIT(_counter, 1)) ) << 8) ^ - ((BIT(_counter, 3) ) << 6) ^ - (((BIT(cipherword, 3) | BIT(_counter, 7)) ) << 5) ^ - ((BIT(cipherword, 2) ^ BIT(_counter, 3) ) << 4) ^ - ((BIT(_counter, 2) ) << 3) ^ - (((BIT(cipherword, 7) & BIT(_counter, 7)) ) << 2) ^ - ((BIT(_counter, 5) ) << 1) ^ - (((BIT(cipherword, 7) | BIT(_counter, 1)) ) << 0); - _mask = nbs + (((BIT(cipherword, 4) & BIT(m_counter, 1)) ) << 8) ^ + ((BIT(m_counter, 3) ) << 6) ^ + (((BIT(cipherword, 3) | BIT(m_counter, 7)) ) << 5) ^ + ((BIT(cipherword, 2) ^ BIT(m_counter, 3) ) << 4) ^ + ((BIT(m_counter, 2) ) << 3) ^ + (((BIT(cipherword, 7) & BIT(m_counter, 7)) ) << 2) ^ + ((BIT(m_counter, 5) ) << 1) ^ + (((BIT(cipherword, 7) | BIT(m_counter, 1)) ) << 0); + m_mask = nbs ^ bitswap(cipherword, 6,11, 3, 1,13, 5,15,10, 2, 9, 8, 4, 0,12, 7,14) ^ bitswap(plainword , 9, 7, 5, 2,14, 4,13, 8, 0,15,10, 1, 3, 6,12,11) ^ 0xecbe; - ++_counter; + ++m_counter; return plainword; } void ns10_type1_decrypter_device::init(int iv) { - _mask = initSbox[iv]; - _counter = 0; + m_mask = initSbox[iv]; + m_counter = 0; } void ns10_type1_decrypter_device::device_start() { - _active = false; + m_active = false; } @@ -215,28 +215,28 @@ ns10_type2_decrypter_device::ns10_type2_decrypter_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, const ns10_type2_decrypter_device::ns10_crypto_logic &logic) : ns10_decrypter_device(mconfig, type, tag, owner, clock) - , _logic(logic) + , m_logic(logic) { } uint16_t ns10_type2_decrypter_device::decrypt(uint16_t cipherword) { - uint16_t plainword = cipherword ^ _mask; + uint16_t plainword = cipherword ^ m_mask; - _previous_cipherwords <<= 16; - _previous_cipherwords ^= cipherword; - _previous_plainwords <<= 16; - _previous_plainwords ^= plainword; + m_previous_cipherwords <<= 16; + m_previous_cipherwords ^= cipherword; + m_previous_plainwords <<= 16; + m_previous_plainwords ^= plainword; - _mask = 0; + m_mask = 0; for (int j = 15; j >= 0; --j) { - _mask <<= 1; - _mask ^= _reducer->gf2_reduce(_logic.eMask[j] & _previous_cipherwords); - _mask ^= _reducer->gf2_reduce(_logic.dMask[j] & _previous_plainwords); + m_mask <<= 1; + m_mask ^= m_reducer->gf2_reduce(m_logic.eMask[j] & m_previous_cipherwords); + m_mask ^= m_reducer->gf2_reduce(m_logic.dMask[j] & m_previous_plainwords); } - _mask ^= _logic.xMask; - _mask ^= _logic.nonlinear_calculation(_previous_cipherwords, _previous_plainwords, *_reducer); + m_mask ^= m_logic.xMask; + m_mask ^= m_logic.nonlinear_calculation(m_previous_cipherwords, m_previous_plainwords, *m_reducer); return plainword; } @@ -245,15 +245,15 @@ { // by now, only gamshara requires non-trivial initialization code; data // should be moved to the per-game logic in case any other game do it differently - _previous_cipherwords = bitswap(initSbox[iv],3,16,16,2,1,16,16,0,16,16,16,16,16,16,16,16); - _previous_plainwords = 0; - _mask = 0; + m_previous_cipherwords = bitswap(initSbox[iv],3,16,16,2,1,16,16,0,16,16,16,16,16,16,16,16); + m_previous_plainwords = 0; + m_mask = 0; } void ns10_type2_decrypter_device::device_start() { - _active = false; - _reducer = std::make_unique(); + m_active = false; + m_reducer = std::make_unique(); } @@ -270,17 +270,17 @@ reduction ^= reduction >> 2; reduction ^= reduction >> 1; - _gf2Reduction[i] = reduction & 1; + m_gf2Reduction[i] = reduction & 1; } } int ns10_type2_decrypter_device::gf2_reducer::gf2_reduce(uint64_t num)const { return - _gf2Reduction[num & 0xffff] ^ - _gf2Reduction[(num >> 16) & 0xffff] ^ - _gf2Reduction[(num >> 32) & 0xffff] ^ - _gf2Reduction[num >> 48]; + m_gf2Reduction[num & 0xffff] ^ + m_gf2Reduction[(num >> 16) & 0xffff] ^ + m_gf2Reduction[(num >> 32) & 0xffff] ^ + m_gf2Reduction[num >> 48]; } diff -Nru mame-0.242+dfsg.1/src/mame/machine/ns10crypt.h mame-0.243+dfsg.1/src/mame/machine/ns10crypt.h --- mame-0.242+dfsg.1/src/mame/machine/ns10crypt.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/ns10crypt.h 2022-04-29 05:37:26.000000000 +0000 @@ -22,7 +22,7 @@ virtual void init(int iv)=0; virtual void device_start()override=0; - bool _active; + bool m_active; }; class ns10_type1_decrypter_device : public ns10_decrypter_device @@ -36,8 +36,8 @@ ns10_type1_decrypter_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); private: - uint16_t _mask; - uint8_t _counter; + uint16_t m_mask = 0; + uint8_t m_counter = 0; static const int initSbox[16]; void init(int iv)override; @@ -57,27 +57,27 @@ gf2_reducer(); int gf2_reduce(uint64_t num)const; private: - int _gf2Reduction[0x10000]; + int m_gf2Reduction[0x10000]{}; }; // this encodes the decryption logic, which varies per game // and is probably hard-coded into the CPLD struct ns10_crypto_logic { - uint64_t eMask[16]; - uint64_t dMask[16]; - uint16_t xMask; + uint64_t eMask[16]{}; + uint64_t dMask[16]{}; + uint16_t xMask = 0; uint16_t(*nonlinear_calculation)(uint64_t, uint64_t, const gf2_reducer&); // preliminary encoding; need research }; ns10_type2_decrypter_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, const ns10_crypto_logic &logic); private: - uint16_t _mask; - uint64_t _previous_cipherwords; - uint64_t _previous_plainwords; - const ns10_crypto_logic& _logic; - std::unique_ptr_reducer; + uint16_t m_mask = 0; + uint64_t m_previous_cipherwords = 0; + uint64_t m_previous_plainwords = 0; + const ns10_crypto_logic& m_logic; + std::unique_ptrm_reducer; static const int initSbox[16]; void init(int iv)override; diff -Nru mame-0.242+dfsg.1/src/mame/machine/ns11prot.h mame-0.243+dfsg.1/src/mame/machine/ns11prot.h --- mame-0.242+dfsg.1/src/mame/machine/ns11prot.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/ns11prot.h 2022-04-29 05:37:26.000000000 +0000 @@ -18,9 +18,9 @@ virtual void device_start() override; virtual void device_reset() override; - uint16_t m_p1; - uint16_t m_p2; - uint16_t m_p3; + uint16_t m_p1 = 0; + uint16_t m_p2 = 0; + uint16_t m_p3 = 0; public: virtual uint16_t read(offs_t offset) = 0; diff -Nru mame-0.242+dfsg.1/src/mame/machine/octo_kbd.h mame-0.243+dfsg.1/src/mame/machine/octo_kbd.h --- mame-0.242+dfsg.1/src/mame/machine/octo_kbd.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/octo_kbd.h 2022-04-29 05:37:26.000000000 +0000 @@ -24,9 +24,9 @@ private: virtual void received_byte(uint8_t data) override; - int m_delay; // keypress delay after initial press - int m_repeat; // keypress repeat rate - uint8_t m_enabled; // keyboard enabled? + int m_delay = 0; // keypress delay after initial press + int m_repeat = 0; // keypress repeat rate + uint8_t m_enabled = 0; // keyboard enabled? }; DECLARE_DEVICE_TYPE(OCTOPUS_KEYBOARD, octopus_keyboard_device) diff -Nru mame-0.242+dfsg.1/src/mame/machine/pc80s31k.cpp mame-0.243+dfsg.1/src/mame/machine/pc80s31k.cpp --- mame-0.242+dfsg.1/src/mame/machine/pc80s31k.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/pc80s31k.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -30,6 +30,8 @@ \- It then tries to read at memory [0xc0ff], set the value read in [0xf012]; \- Expects that ROM [0x0000] is not equal to 0xc3; Bottom line: Is it trying to access some custom HW? + - Hookup a bridge for internal BIOSes (later PC8801 models); + - Save state support (resuming fails latch hookups here); =================================================================================================== @@ -255,13 +257,14 @@ void pc80s31_device::device_add_mconfig(machine_config &config) { - constexpr XTAL fdc_xtal = XTAL(4'000'000); - Z80(config, m_fdc_cpu, fdc_xtal); + // TODO: confirm clock arrangement + constexpr XTAL fdc_xtal = XTAL(8'000'000); + Z80(config, m_fdc_cpu, fdc_xtal / 2); m_fdc_cpu->set_addrmap(AS_PROGRAM, &pc80s31_device::fdc_map); m_fdc_cpu->set_addrmap(AS_IO, &pc80s31_device::fdc_io); m_fdc_cpu->set_irq_acknowledge_callback(FUNC(pc80s31_device::irq_cb)); - UPD765A(config, m_fdc, XTAL(4'000'000), true, true); + UPD765A(config, m_fdc, fdc_xtal, true, true); m_fdc->intrq_wr_callback().set_inputline(m_fdc_cpu, INPUT_LINE_IRQ0); for (auto &floppy : m_floppy) diff -Nru mame-0.242+dfsg.1/src/mame/machine/pc80s31k.h mame-0.243+dfsg.1/src/mame/machine/pc80s31k.h --- mame-0.242+dfsg.1/src/mame/machine/pc80s31k.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/pc80s31k.h 2022-04-29 05:37:26.000000000 +0000 @@ -44,7 +44,7 @@ required_device m_fdc; required_device_array m_floppy; - u8 m_irq_vector; + u8 m_irq_vector = 0; private: required_device m_fdc_cpu; @@ -61,7 +61,7 @@ u8 terminal_count_r(address_space &space); void motor_control_w(u8 data); - emu_timer *m_tc_zero_timer; + emu_timer *m_tc_zero_timer = nullptr; IRQ_CALLBACK_MEMBER(irq_cb); }; diff -Nru mame-0.242+dfsg.1/src/mame/machine/pce220_ser.h mame-0.243+dfsg.1/src/mame/machine/pce220_ser.h --- mame-0.242+dfsg.1/src/mame/machine/pce220_ser.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/pce220_ser.h 2022-04-29 05:37:26.000000000 +0000 @@ -66,19 +66,19 @@ static const device_timer_id TIMER_SEND = 0; static const device_timer_id TIMER_RECEIVE = 1; - emu_timer* m_send_timer; // timer for send data - emu_timer* m_receive_timer; // timer for receive data - uint8_t m_state; // transfer status - uint32_t m_bytes_count; // number of bytes transferred - uint8_t m_current_byte; // byte in transfer - uint8_t m_enabled; // enable/disable + emu_timer* m_send_timer = nullptr; // timer for send data + emu_timer* m_receive_timer = nullptr; // timer for receive data + uint8_t m_state = 0; // transfer status + uint32_t m_bytes_count = 0; // number of bytes transferred + uint8_t m_current_byte = 0; // byte in transfer + uint8_t m_enabled = 0; // enable/disable - uint8_t m_busy; // CTS - uint8_t m_dout; // DTR - uint8_t m_xout; // TXD - uint8_t m_xin; // RXD - uint8_t m_din; // DSR - uint8_t m_ack; // RTS + uint8_t m_busy = 0; // CTS + uint8_t m_dout = 0; // DTR + uint8_t m_xout = 0; // TXD + uint8_t m_xin = 0; // RXD + uint8_t m_din = 0; // DSR + uint8_t m_ack = 0; // RTS }; // device type definition diff -Nru mame-0.242+dfsg.1/src/mame/machine/pce_cd.cpp mame-0.243+dfsg.1/src/mame/machine/pce_cd.cpp --- mame-0.242+dfsg.1/src/mame/machine/pce_cd.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/pce_cd.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -261,10 +261,10 @@ m_cd_file = m_cdrom->get_cdrom_file(); if (m_cd_file) { - m_toc = cdrom_get_toc(m_cd_file); + m_toc = &m_cd_file->get_toc(); m_cdda->set_cdrom(m_cd_file); - m_last_frame = cdrom_get_track_start(m_cd_file, cdrom_get_last_track(m_cd_file) - 1); - m_last_frame += m_toc->tracks[cdrom_get_last_track(m_cd_file) - 1].frames; + m_last_frame = m_cd_file->get_track_start(m_cd_file->get_last_track() - 1); + m_last_frame += m_toc->tracks[m_cd_file->get_last_track() - 1].frames; m_end_frame = m_last_frame; } @@ -466,7 +466,7 @@ frame = f + 75 * (s + m * 60); // PCE tries to be clever here and set (start of track + track pregap size) to skip the pregap // (I guess it wants the TOC to have the real start sector for data tracks and the start of the pregap for audio?) - frame -= m_toc->tracks[cdrom_get_track(m_cd_file, frame)].pregap; + frame -= m_toc->tracks[m_cd_file->get_track(frame)].pregap; break; } case 0x80: @@ -503,7 +503,7 @@ else { //m_cdda_status = PCE_CD_CDDA_PLAYING; - m_end_frame = m_toc->tracks[ cdrom_get_track(m_cd_file, m_current_frame) ].logframeofs + m_toc->tracks[ cdrom_get_track(m_cd_file, m_current_frame) ].logframes; //get the end of THIS track + m_end_frame = m_toc->tracks[ m_cd_file->get_track(m_current_frame) ].logframeofs + m_toc->tracks[ m_cd_file->get_track(m_current_frame) ].logframes; //get the end of THIS track m_cdda->start_audio(m_current_frame, m_end_frame - m_current_frame); m_end_mark = 0; m_cdda_play_mode = 3; @@ -637,11 +637,11 @@ break; } - msf_abs = lba_to_msf_alt(frame); - track = cdrom_get_track(m_cd_file, frame); - msf_rel = lba_to_msf_alt(frame - cdrom_get_track_start(m_cd_file, track)); + msf_abs = cdrom_file::lba_to_msf_alt(frame); + track = m_cd_file->get_track(frame); + msf_rel = cdrom_file::lba_to_msf_alt(frame - m_cd_file->get_track_start(track)); - m_data_buffer[1] = 0x01 | ((cdrom_get_track_type(m_cd_file, cdrom_get_track(m_cd_file, track+1)) == CD_TRACK_AUDIO) ? 0x00 : 0x40); + m_data_buffer[1] = 0x01 | ((m_cd_file->get_track_type(m_cd_file->get_track(track+1)) == cdrom_file::CD_TRACK_AUDIO) ? 0x00 : 0x40); m_data_buffer[2] = dec_2_bcd(track+1); /* track */ m_data_buffer[3] = 1; /* index */ m_data_buffer[4] = dec_2_bcd((msf_rel >> 16) & 0xFF);/* M (relative) */ @@ -662,7 +662,6 @@ void pce_cd_device::nec_get_dir_info() { uint32_t frame, msf, track = 0; - const cdrom_toc *toc; logerror("nec get dir info\n"); if (!m_cd_file) @@ -671,19 +670,19 @@ reply_status_byte(SCSI_CHECK_CONDITION); } - toc = cdrom_get_toc(m_cd_file); + const cdrom_file::toc &toc = m_cd_file->get_toc(); switch (m_command_buffer[1]) { case 0x00: /* Get first and last track numbers */ m_data_buffer[0] = dec_2_bcd(1); - m_data_buffer[1] = dec_2_bcd(toc->numtrks); + m_data_buffer[1] = dec_2_bcd(toc.numtrks); m_data_buffer_size = 2; break; case 0x01: /* Get total disk size in MSF format */ - frame = toc->tracks[toc->numtrks-1].logframeofs; - frame += toc->tracks[toc->numtrks-1].frames; - msf = lba_to_msf(frame + 150); + frame = toc.tracks[toc.numtrks-1].logframeofs; + frame += toc.tracks[toc.numtrks-1].frames; + msf = cdrom_file::lba_to_msf(frame + 150); m_data_buffer[0] = (msf >> 16) & 0xFF; /* M */ m_data_buffer[1] = (msf >> 8) & 0xFF; /* S */ @@ -693,17 +692,17 @@ case 0x02: /* Get track information */ if (m_command_buffer[2] == 0xAA) { - frame = toc->tracks[toc->numtrks-1].logframeofs; - frame += toc->tracks[toc->numtrks-1].frames; + frame = toc.tracks[toc.numtrks-1].logframeofs; + frame += toc.tracks[toc.numtrks-1].frames; m_data_buffer[3] = 0x04; /* correct? */ } else { track = std::max(bcd_2_dec(m_command_buffer[2]), 1U); - frame = toc->tracks[track-1].logframeofs; - m_data_buffer[3] = (toc->tracks[track-1].trktype == CD_TRACK_AUDIO) ? 0x00 : 0x04; + frame = toc.tracks[track-1].logframeofs; + m_data_buffer[3] = (toc.tracks[track-1].trktype == cdrom_file::CD_TRACK_AUDIO) ? 0x00 : 0x04; } logerror("track = %d, frame = %d\n", track, frame); - msf = lba_to_msf(frame + 150); + msf = cdrom_file::lba_to_msf(frame + 150); m_data_buffer[0] = (msf >> 16) & 0xFF; /* M */ m_data_buffer[1] = (msf >> 8) & 0xFF; /* S */ m_data_buffer[2] = msf & 0xFF; /* F */ @@ -978,7 +977,7 @@ { /* Read next data sector */ logerror("read sector %d\n", m_current_frame); - if (! cdrom_read_data(m_cd_file, m_current_frame, m_data_buffer.get(), CD_TRACK_MODE1)) + if (! m_cd_file->read_data(m_current_frame, m_data_buffer.get(), cdrom_file::CD_TRACK_MODE1)) { logerror("Mode1 CD read failed for frame #%d\n", m_current_frame); } diff -Nru mame-0.242+dfsg.1/src/mame/machine/pce_cd.h mame-0.243+dfsg.1/src/mame/machine/pce_cd.h --- mame-0.242+dfsg.1/src/mame/machine/pce_cd.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/pce_cd.h 2022-04-29 05:37:26.000000000 +0000 @@ -93,17 +93,17 @@ void adpcm_playback_rate_w(uint8_t data); void fade_register_w(uint8_t data); - uint8_t m_reset_reg; - uint8_t m_irq_mask; - uint8_t m_irq_status; - uint8_t m_cdc_status; - uint8_t m_cdc_data; - uint8_t m_bram_status; - uint8_t m_adpcm_status; - uint16_t m_adpcm_latch_address; - uint8_t m_adpcm_control; - uint8_t m_adpcm_dma_reg; - uint8_t m_fade_reg; + uint8_t m_reset_reg = 0; + uint8_t m_irq_mask = 0; + uint8_t m_irq_status = 0; + uint8_t m_cdc_status = 0; + uint8_t m_cdc_data = 0; + uint8_t m_bram_status = 0; + uint8_t m_adpcm_status = 0; + uint16_t m_adpcm_latch_address = 0; + uint8_t m_adpcm_control = 0; + uint8_t m_adpcm_dma_reg = 0; + uint8_t m_fade_reg = 0; void regs_map(address_map &map); void adpcm_stop(uint8_t irq_flag); @@ -138,77 +138,77 @@ std::unique_ptr m_bram; std::unique_ptr m_adpcm_ram; - int m_bram_locked; - int m_adpcm_read_ptr; - uint8_t m_adpcm_read_buf; - int m_adpcm_write_ptr; - uint8_t m_adpcm_write_buf; - int m_adpcm_length; - int m_adpcm_clock_divider; - uint32_t m_msm_start_addr; - uint32_t m_msm_end_addr; - uint32_t m_msm_half_addr; - uint8_t m_msm_nibble; - uint8_t m_msm_idle; - uint8_t m_msm_repeat; + int m_bram_locked = 0; + int m_adpcm_read_ptr = 0; + uint8_t m_adpcm_read_buf = 0; + int m_adpcm_write_ptr = 0; + uint8_t m_adpcm_write_buf = 0; + int m_adpcm_length = 0; + int m_adpcm_clock_divider = 0; + uint32_t m_msm_start_addr = 0; + uint32_t m_msm_end_addr = 0; + uint32_t m_msm_half_addr = 0; + uint8_t m_msm_nibble = 0; + uint8_t m_msm_idle = 0; + uint8_t m_msm_repeat = 0; /* SCSI signals */ - int m_scsi_BSY; /* Busy. Bus in use */ - int m_scsi_SEL; /* Select. Initiator has won arbitration and has selected a target */ - int m_scsi_CD; /* Control/Data. Target is sending control (data) information */ - int m_scsi_IO; /* Input/Output. Target is sending (receiving) information */ - int m_scsi_MSG; /* Message. Target is sending or receiving a message */ - int m_scsi_REQ; /* Request. Target is requesting a data transfer */ - int m_scsi_ACK; /* Acknowledge. Initiator acknowledges that it is ready for a data transfer */ - int m_scsi_ATN; /* Attention. Initiator has a message ready for the target */ - int m_scsi_RST; /* Reset. Initiator forces all targets and any other initiators to do a warm reset */ - int m_scsi_last_RST; /* To catch setting of RST signal */ - int m_cd_motor_on; - int m_selected; + int m_scsi_BSY = 0; /* Busy. Bus in use */ + int m_scsi_SEL = 0; /* Select. Initiator has won arbitration and has selected a target */ + int m_scsi_CD = 0; /* Control/Data. Target is sending control (data) information */ + int m_scsi_IO = 0; /* Input/Output. Target is sending (receiving) information */ + int m_scsi_MSG = 0; /* Message. Target is sending or receiving a message */ + int m_scsi_REQ = 0; /* Request. Target is requesting a data transfer */ + int m_scsi_ACK = 0; /* Acknowledge. Initiator acknowledges that it is ready for a data transfer */ + int m_scsi_ATN = 0; /* Attention. Initiator has a message ready for the target */ + int m_scsi_RST = 0; /* Reset. Initiator forces all targets and any other initiators to do a warm reset */ + int m_scsi_last_RST = 0; /* To catch setting of RST signal */ + int m_cd_motor_on = 0; + int m_selected = 0; std::unique_ptr m_command_buffer; - int m_command_buffer_index; - int m_status_sent; - int m_message_after_status; - int m_message_sent; + int m_command_buffer_index = 0; + int m_status_sent = 0; + int m_message_after_status = 0; + int m_message_sent = 0; std::unique_ptr m_data_buffer; - int m_data_buffer_size; - int m_data_buffer_index; - int m_data_transferred; + int m_data_buffer_size = 0; + int m_data_buffer_index = 0; + int m_data_transferred = 0; /* Arcade Card specific */ std::unique_ptr m_acard_ram; - uint8_t m_acard_latch; + uint8_t m_acard_latch = 0; uint8_t m_acard_ctrl[4]; uint32_t m_acard_base_addr[4]; uint16_t m_acard_addr_offset[4]; uint16_t m_acard_addr_inc[4]; - uint32_t m_acard_shift; - uint8_t m_acard_shift_reg; + uint32_t m_acard_shift = 0; + uint8_t m_acard_shift_reg = 0; - uint32_t m_current_frame; - uint32_t m_end_frame; - uint32_t m_last_frame; - uint8_t m_cdda_status; - uint8_t m_cdda_play_mode; + uint32_t m_current_frame = 0; + uint32_t m_end_frame = 0; + uint32_t m_last_frame = 0; + uint8_t m_cdda_status = 0; + uint8_t m_cdda_play_mode = 0; std::unique_ptr m_subcode_buffer; - uint8_t m_end_mark; + uint8_t m_end_mark = 0; required_device m_msm; required_device m_cdda; required_device m_nvram; required_device m_cdrom; - cdrom_file *m_cd_file; - const cdrom_toc* m_toc; - emu_timer *m_data_timer; - emu_timer *m_adpcm_dma_timer; - - emu_timer *m_cdda_fadeout_timer; - emu_timer *m_cdda_fadein_timer; - double m_cdda_volume; - emu_timer *m_adpcm_fadeout_timer; - emu_timer *m_adpcm_fadein_timer; - double m_adpcm_volume; + cdrom_file *m_cd_file = nullptr; + const cdrom_file::toc* m_toc = nullptr; + emu_timer *m_data_timer = nullptr; + emu_timer *m_adpcm_dma_timer = nullptr; + + emu_timer *m_cdda_fadeout_timer = nullptr; + emu_timer *m_cdda_fadein_timer = nullptr; + double m_cdda_volume = 0; + emu_timer *m_adpcm_fadeout_timer = nullptr; + emu_timer *m_adpcm_fadein_timer = nullptr; + double m_adpcm_volume = 0; DECLARE_WRITE_LINE_MEMBER(msm5205_int); void nvram_init(nvram_device &nvram, void *data, size_t size); diff -Nru mame-0.242+dfsg.1/src/mame/machine/pcecommn.h mame-0.243+dfsg.1/src/mame/machine/pcecommn.h --- mame-0.242+dfsg.1/src/mame/machine/pcecommn.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/pcecommn.h 2022-04-29 05:37:26.000000000 +0000 @@ -36,9 +36,9 @@ required_device m_huc6260; private: - uint8_t m_io_port_options; /*driver-specific options for the PCE*/ - int m_joystick_port_select; /* internal index of joystick ports */ - int m_joystick_data_select; /* which nibble of joystick data we want */ + uint8_t m_io_port_options = 0; /*driver-specific options for the PCE*/ + int m_joystick_port_select = 0; /* internal index of joystick ports */ + int m_joystick_data_select = 0; /* which nibble of joystick data we want */ }; // used by the Arcade bootlegs. diff -Nru mame-0.242+dfsg.1/src/mame/machine/pcshare.h mame-0.243+dfsg.1/src/mame/machine/pcshare.h --- mame-0.242+dfsg.1/src/mame/machine/pcshare.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/pcshare.h 2022-04-29 05:37:26.000000000 +0000 @@ -59,10 +59,10 @@ optional_device m_mc146818; required_device m_kbdc; - int m_dma_channel; - uint8_t m_dma_offset[2][4]; - uint8_t m_at_pages[0x10]; - int m_pit_out2; + int m_dma_channel = 0; + uint8_t m_dma_offset[2][4]{}; + uint8_t m_at_pages[0x10]{}; + int m_pit_out2 = 0; }; #endif // MAME_MACHINE_PCSHARE_H diff -Nru mame-0.242+dfsg.1/src/mame/machine/pgm2_memcard.h mame-0.243+dfsg.1/src/mame/machine/pgm2_memcard.h --- mame-0.242+dfsg.1/src/mame/machine/pgm2_memcard.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/pgm2_memcard.h 2022-04-29 05:37:26.000000000 +0000 @@ -53,7 +53,7 @@ u8 m_memcard_data[0x100]; u8 m_protection_data[4]; u8 m_security_data[4]; - bool m_authenticated; + bool m_authenticated = false; }; diff -Nru mame-0.242+dfsg.1/src/mame/machine/pgmprot_igs027a_type1.h mame-0.243+dfsg.1/src/mame/machine/pgmprot_igs027a_type1.h --- mame-0.242+dfsg.1/src/mame/machine/pgmprot_igs027a_type1.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/pgmprot_igs027a_type1.h 2022-04-29 05:37:26.000000000 +0000 @@ -40,35 +40,35 @@ private: /////////////// simulations - u16 m_value0; - u16 m_value1; - u16 m_valuekey; - u16 m_ddp3lastcommand; - u32 m_valueresponse; - int m_curslots; - u32 m_slots[0x100]; + u16 m_value0 = 0; + u16 m_value1 = 0; + u16 m_valuekey = 0; + u16 m_ddp3lastcommand = 0; + u32 m_valueresponse = 0; + int m_curslots = 0; + u32 m_slots[0x100]{}; // pstars / oldsplus / kov - u16 m_pstar_e7_value; - u16 m_pstar_b1_value; - u16 m_pstar_ce_value; - u16 m_kov_c0_value; - u16 m_kov_cb_value; - u16 m_kov_fe_value; - u16 m_extra_ram[0x100]; + u16 m_pstar_e7_value = 0; + u16 m_pstar_b1_value = 0; + u16 m_pstar_ce_value = 0; + u16 m_kov_c0_value = 0; + u16 m_kov_cb_value = 0; + u16 m_kov_fe_value = 0; + u16 m_extra_ram[0x100]{}; // puzzli2 s32 m_puzzli_54_trigger; typedef void (pgm_arm_type1_state::*pgm_arm_sim_command_handler)(int pc); - pgm_arm_sim_command_handler arm_sim_handler; + pgm_arm_sim_command_handler arm_sim_handler{}; /////////////// emulation - u16 m_arm_type1_highlatch_arm_w; - u16 m_arm_type1_lowlatch_arm_w; - u16 m_arm_type1_highlatch_68k_w; - u16 m_arm_type1_lowlatch_68k_w; - u32 m_arm_type1_counter; + u16 m_arm_type1_highlatch_arm_w = 0; + u16 m_arm_type1_lowlatch_arm_w = 0; + u16 m_arm_type1_highlatch_68k_w = 0; + u16 m_arm_type1_lowlatch_68k_w = 0; + u32 m_arm_type1_counter = 0; optional_shared_ptr m_arm7_shareram; optional_device m_prot; @@ -102,39 +102,39 @@ void arm7_type1_sim_w(offs_t offset, u16 data); u16 arm7_type1_sim_protram_r(offs_t offset); u16 pstars_arm7_type1_sim_protram_r(offs_t offset); - int m_simregion; + int m_simregion = 0; /* puzzli2 protection internal state stuff */ - int stage; - int tableoffs; - int tableoffs2; - int entries_left; - int currentcolumn; - int currentrow; - int num_entries; - int full_entry; - int prev_tablloc; - int numbercolumns; - int depth; - u16 m_row_bitmask; - int hackcount; - int hackcount2; - int hack_47_value; - int hack_31_table_offset; - int hack_31_table_offset2; - int p2_31_retcounter; + int stage = 0; + int tableoffs = 0; + int tableoffs2 = 0; + int entries_left = 0; + int currentcolumn = 0; + int currentrow = 0; + int num_entries = 0; + int full_entry = 0; + int prev_tablloc = 0; + int numbercolumns = 0; + int depth = 0; + u16 m_row_bitmask = 0; + int hackcount = 0; + int hackcount2 = 0; + int hack_47_value = 0; + int hack_31_table_offset = 0; + int hack_31_table_offset2 = 0; + int p2_31_retcounter = 0; - u8 coverage[256]; // coverage is how much of the table we've managed to verify using known facts about the table structure + u8 coverage[256]{}; // coverage is how much of the table we've managed to verify using known facts about the table structure - int command_31_write_type; + int command_31_write_type = 0; // py2k2 protection related - u16 m_py2k2_sprite_pos; - u16 m_py2k2_sprite_base; - u16 m_py2k2_prev_base; + u16 m_py2k2_sprite_pos = 0; + u16 m_py2k2_sprite_base = 0; + u16 m_py2k2_prev_base = 0; // the maximum level size returned or read by the device appears to be this size - u16 level_structure[8][10]; + u16 level_structure[8][10]{}; int puzzli2_take_leveldata_value(u8 datvalue); diff -Nru mame-0.242+dfsg.1/src/mame/machine/pgmprot_igs027a_type2.h mame-0.243+dfsg.1/src/mame/machine/pgmprot_igs027a_type2.h --- mame-0.242+dfsg.1/src/mame/machine/pgmprot_igs027a_type2.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/pgmprot_igs027a_type2.h 2022-04-29 05:37:26.000000000 +0000 @@ -23,8 +23,8 @@ private: // kov2 - u32 m_kov2_latchdata_68k_w; - u32 m_kov2_latchdata_arm_w; + u32 m_kov2_latchdata_68k_w = 0; + u32 m_kov2_latchdata_arm_w = 0; required_shared_ptr m_arm_ram; required_shared_ptr m_arm7_shareram; diff -Nru mame-0.242+dfsg.1/src/mame/machine/pgmprot_igs027a_type3.h mame-0.243+dfsg.1/src/mame/machine/pgmprot_igs027a_type3.h --- mame-0.242+dfsg.1/src/mame/machine/pgmprot_igs027a_type3.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/pgmprot_igs027a_type3.h 2022-04-29 05:37:26.000000000 +0000 @@ -29,15 +29,15 @@ private: // svg - int m_svg_ram_sel; + int m_svg_ram_sel = 0; std::unique_ptr m_svg_shareram[2]; //for 5585G MACHINE - u32 m_svg_latchdata_68k_w; - u32 m_svg_latchdata_arm_w; + u32 m_svg_latchdata_68k_w = 0; + u32 m_svg_latchdata_arm_w = 0; required_shared_ptr m_arm_ram; required_shared_ptr m_arm_ram2; - u32* m_armrom; + u32* m_armrom = nullptr; optional_device m_prot; diff -Nru mame-0.242+dfsg.1/src/mame/machine/pgmprot_orlegend.h mame-0.243+dfsg.1/src/mame/machine/pgmprot_orlegend.h --- mame-0.242+dfsg.1/src/mame/machine/pgmprot_orlegend.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/pgmprot_orlegend.h 2022-04-29 05:37:26.000000000 +0000 @@ -14,11 +14,11 @@ private: // ASIC 3 (oriental legends protection) - u8 m_asic3_reg; - u8 m_asic3_latch[3]; - u8 m_asic3_x; - u16 m_asic3_hilo; - u16 m_asic3_hold; + u8 m_asic3_reg = 0; + u8 m_asic3_latch[3]{}; + u8 m_asic3_x = 0; + u16 m_asic3_hilo = 0; + u16 m_asic3_hold = 0; void asic3_compute_hold(int,int); u16 pgm_asic3_r(); diff -Nru mame-0.242+dfsg.1/src/mame/machine/pmd85.cpp mame-0.243+dfsg.1/src/mame/machine/pmd85.cpp --- mame-0.242+dfsg.1/src/mame/machine/pmd85.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/pmd85.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -394,10 +394,14 @@ uint8_t pmd85_state::ppi3_porta_r() { - if (memregion("user1")->base()) - return memregion("user1")->base()[m_ppi_port_outputs[3][1] | (m_ppi_port_outputs[3][2] << 8)]; - else - return 0; + if (m_user1) + { + u16 t = m_ppi_port_outputs[3][1] | (m_ppi_port_outputs[3][2] << 8); + if (t < m_user1->bytes()) + return m_user1->base()[t]; + } + + return 0; } uint8_t pmd85_state::ppi3_portb_r() diff -Nru mame-0.242+dfsg.1/src/mame/machine/prof80mmu.h mame-0.243+dfsg.1/src/mame/machine/prof80mmu.h --- mame-0.242+dfsg.1/src/mame/machine/prof80mmu.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/prof80mmu.h 2022-04-29 05:37:26.000000000 +0000 @@ -42,8 +42,8 @@ private: const address_space_config m_program_space_config; - uint8_t m_blk[16]; - bool m_enabled; + uint8_t m_blk[16]{}; + bool m_enabled = false; }; diff -Nru mame-0.242+dfsg.1/src/mame/machine/psion_pack.h mame-0.243+dfsg.1/src/mame/machine/psion_pack.h --- mame-0.242+dfsg.1/src/mame/machine/psion_pack.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/psion_pack.h 2022-04-29 05:37:26.000000000 +0000 @@ -57,13 +57,13 @@ private: // internal device state - uint8_t m_id; //datapack ID - uint8_t m_size; //size in 8k blocks - uint8_t m_data; //data lines - uint8_t m_control; //control lines - uint16_t m_counter; //address counter - uint8_t m_page; //active page (only for paged Datapack) - uint8_t m_segment; //active segment (only for segmented Datapack) + uint8_t m_id = 0; //datapack ID + uint8_t m_size = 0; //size in 8k blocks + uint8_t m_data = 0; //data lines + uint8_t m_control = 0; //control lines + uint16_t m_counter = 0; //address counter + uint8_t m_page = 0; //active page (only for paged Datapack) + uint8_t m_segment = 0; //active segment (only for segmented Datapack) }; diff -Nru mame-0.242+dfsg.1/src/mame/machine/psxcd.cpp mame-0.243+dfsg.1/src/mame/machine/psxcd.cpp --- mame-0.242+dfsg.1/src/mame/machine/psxcd.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/psxcd.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -425,7 +425,7 @@ void psxcd_device::write_command(uint8_t byte) { - if(byte > 31) + if(byte > 30) // coverity 140157 illegalcmd(byte); else (this->*cmd_table[byte])(); @@ -473,7 +473,7 @@ void psxcd_device::cdcmd_play() { if(cmdbuf[0] && m_param_count) - loc.w = lba_to_msf_ps(cdrom_get_track_start(m_cdrom_handle, bcd_to_decimal(cmdbuf[0]) - 1)); + loc.w = lba_to_msf_ps(m_cdrom_handle->get_track_start(bcd_to_decimal(cmdbuf[0]) - 1)); curpos.w = loc.w; if (!curpos.w) @@ -631,8 +631,8 @@ void psxcd_device::cdcmd_getlocp() { CDPOS tloc, start; - uint8_t track = cdrom_get_track(m_cdrom_handle, msf_to_lba_ps(loc.w)) + 1; - start.w = (track == 1) ? 0x000200 : lba_to_msf_ps(cdrom_get_track_start(m_cdrom_handle, track - 1)); + uint8_t track = m_cdrom_handle->get_track(msf_to_lba_ps(loc.w)) + 1; + start.w = (track == 1) ? 0x000200 : lba_to_msf_ps(m_cdrom_handle->get_track_start(track - 1)); tloc.w = sub_loc(loc, start); unsigned char data[8]= @@ -664,7 +664,7 @@ { status, decimal_to_bcd(1), - decimal_to_bcd(cdrom_get_last_track(m_cdrom_handle)) + decimal_to_bcd(m_cdrom_handle->get_last_track()) }; send_result(intr_complete,data,3); @@ -678,14 +678,14 @@ void psxcd_device::cdcmd_gettd() { uint8_t track = bcd_to_decimal(cmdbuf[0]); - uint8_t last = cdrom_get_last_track(m_cdrom_handle); + uint8_t last = m_cdrom_handle->get_last_track(); if(track <= last) { CDPOS trkstart; if(!track) // length of disk - trkstart.w = lba_to_msf_ps(cdrom_get_track_start(m_cdrom_handle, 0xaa)); + trkstart.w = lba_to_msf_ps(m_cdrom_handle->get_track_start(0xaa)); else - trkstart.w = lba_to_msf_ps(cdrom_get_track_start(m_cdrom_handle, track - 1)); + trkstart.w = lba_to_msf_ps(m_cdrom_handle->get_track_start(track - 1)); unsigned char data[3]= { @@ -760,7 +760,7 @@ memset(cdid, '\0', 8); send_result(intr_complete); - if(cdrom_get_track_type(m_cdrom_handle, 0) == CD_TRACK_AUDIO) + if(m_cdrom_handle->get_track_type(0) == cdrom_file::CD_TRACK_AUDIO) { irq = intr_diskerror; cdid[0] = status | status_invalid; @@ -954,7 +954,7 @@ bool isend = false; uint32_t sector = msf_to_lba_ps(curpos.w); uint8_t *buf = secbuf[sectail]; - if (cdrom_read_data(m_cdrom_handle, sector, buf, CD_TRACK_RAW_DONTCARE)) + if (m_cdrom_handle->read_data(sector, buf, cdrom_file::CD_TRACK_RAW_DONTCARE)) { subheader *sub=(subheader *)(buf+16); memcpy(lastsechdr, buf+12, 8); @@ -1027,14 +1027,14 @@ { uint32_t sector = msf_to_lba_ps(curpos.w); - if(cdrom_read_data(m_cdrom_handle, sector, secbuf[sectail], CD_TRACK_AUDIO)) + if(m_cdrom_handle->read_data(sector, secbuf[sectail], cdrom_file::CD_TRACK_AUDIO)) { if(!m_mute) m_spu->play_cdda(0, secbuf[sectail]); } else { - if(!cdrom_read_data(m_cdrom_handle, sector, secbuf[sectail], CD_TRACK_RAW_DONTCARE)) + if(!m_cdrom_handle->read_data(sector, secbuf[sectail], cdrom_file::CD_TRACK_RAW_DONTCARE)) { stop_read(); // assume we've reached the end cmd_complete(prepare_result(intr_dataend)); @@ -1074,7 +1074,7 @@ if ((mode&mode_report) && !(sector & 15)) // slow the int rate { auto res=new command_result; - uint8_t track = cdrom_get_track(m_cdrom_handle, sector) + 1; + uint8_t track = m_cdrom_handle->get_track(sector) + 1; res->res=intr_dataready; res->data[0]=status; @@ -1083,7 +1083,7 @@ if(sector & 0x10) { CDPOS tloc, start; - start.w = (track == 1) ? 0x000200 : lba_to_msf_ps(cdrom_get_track_start(m_cdrom_handle, track - 1)); + start.w = (track == 1) ? 0x000200 : lba_to_msf_ps(m_cdrom_handle->get_track_start(track - 1)); tloc.w = sub_loc(loc, start); res->data[3]=decimal_to_bcd(tloc.b[M]); res->data[4]=decimal_to_bcd(tloc.b[S]) | 0x80; @@ -1115,7 +1115,7 @@ assert((status&(status_reading|status_playing))==0); - if(!(mode & mode_cdda) && (cdrom_get_track_type(m_cdrom_handle, cdrom_get_track(m_cdrom_handle, sector + 150)) == CD_TRACK_AUDIO)) + if(!(mode & mode_cdda) && (m_cdrom_handle->get_track_type(m_cdrom_handle->get_track(sector + 150)) == cdrom_file::CD_TRACK_AUDIO)) { stop_read(); cmd_complete(prepare_result(intr_diskerror, nullptr, 0, 0x40)); @@ -1139,9 +1139,9 @@ void psxcd_device::start_play() { - uint8_t track = cdrom_get_track(m_cdrom_handle, msf_to_lba_ps(curpos.w) + 150); + uint8_t track = m_cdrom_handle->get_track(msf_to_lba_ps(curpos.w) + 150); - if(cdrom_get_track_type(m_cdrom_handle, track) != CD_TRACK_AUDIO) + if(m_cdrom_handle->get_track_type(track) != cdrom_file::CD_TRACK_AUDIO) verboselog(*this, 0, "psxcd: playing data track\n"); status|=status_playing; @@ -1150,8 +1150,8 @@ if (mode&mode_autopause) { - auto toc = cdrom_get_toc(m_cdrom_handle); - autopause_sector = cdrom_get_track_start(m_cdrom_handle, track) + toc->tracks[track].logframes; + const auto &toc = m_cdrom_handle->get_toc(); + autopause_sector = m_cdrom_handle->get_track_start(track) + toc.tracks[track].logframes; // printf("pos=%d auto=%d\n",pos,autopause_sector); } diff -Nru mame-0.242+dfsg.1/src/mame/machine/psxcd.h mame-0.243+dfsg.1/src/mame/machine/psxcd.h --- mame-0.242+dfsg.1/src/mame/machine/psxcd.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/psxcd.h 2022-04-29 05:37:26.000000000 +0000 @@ -103,24 +103,24 @@ uint8_t bcd_to_decimal(const uint8_t bcd) { return ((bcd>>4)*10)+(bcd&0xf); } uint8_t decimal_to_bcd(const uint8_t dec) { return ((dec/10)<<4)|(dec%10); } - uint32_t msf_to_lba_ps(uint32_t msf) { msf = msf_to_lba(msf); return (msf>150)?(msf-150):msf; } - uint32_t lba_to_msf_ps(uint32_t lba) { return lba_to_msf_alt(lba+150); } + uint32_t msf_to_lba_ps(uint32_t msf) { msf = cdrom_file::msf_to_lba(msf); return (msf>150)?(msf-150):msf; } + uint32_t lba_to_msf_ps(uint32_t lba) { return cdrom_file::lba_to_msf_alt(lba+150); } static const unsigned int sector_buffer_size=16, default_irq_delay=16000; //480; //8000; //2000<<2; static const unsigned int raw_sector_size=2352; - uint8_t cmdbuf[64], mode, secbuf[sector_buffer_size][raw_sector_size]; - uint8_t filter_file, filter_channel, lastsechdr[8], status; - int rdp; - uint8_t m_cursec, sectail; - uint16_t m_transcurr; - uint8_t m_transbuf[raw_sector_size]; - command_result *res_queue, *m_int1; + uint8_t cmdbuf[64]{}, mode = 0, secbuf[sector_buffer_size][raw_sector_size]{}; + uint8_t filter_file = 0, filter_channel = 0, lastsechdr[8]{}, status = 0; + int rdp = 0; + uint8_t m_cursec = 0, sectail = 0; + uint16_t m_transcurr = 0; + uint8_t m_transbuf[raw_sector_size]{}; + command_result *res_queue = nullptr, *m_int1 = nullptr; struct { - uint8_t sr, ir, imr; + uint8_t sr = 0, ir = 0, imr = 0; struct { - uint8_t ll, lr, rl, rr; + uint8_t ll = 0, lr = 0, rl = 0, rr = 0; } vol; } m_regs; @@ -140,16 +140,16 @@ }; #endif - bool open, m_mute, m_dmaload; - device_timer_id next_read_event; - int64_t next_sector_t; - unsigned int autopause_sector, start_read_delay, read_sector_cycles, preread_delay; - - uint32_t m_param_count; - uint32_t m_sysclock; - emu_timer *m_timers[MAX_PSXCD_TIMERS]; - bool m_timerinuse[MAX_PSXCD_TIMERS]; - command_result *m_results[MAX_PSXCD_TIMERS]; + bool open = false, m_mute = false, m_dmaload = false; + device_timer_id next_read_event{}; + int64_t next_sector_t = 0; + unsigned int autopause_sector = 0, start_read_delay = 0, read_sector_cycles = 0, preread_delay = 0; + + uint32_t m_param_count = 0; + uint32_t m_sysclock = 0; + emu_timer *m_timers[MAX_PSXCD_TIMERS]{}; + bool m_timerinuse[MAX_PSXCD_TIMERS]{}; + command_result *m_results[MAX_PSXCD_TIMERS]{}; devcb_write_line m_irq_handler; required_device m_maincpu; diff -Nru mame-0.242+dfsg.1/src/mame/machine/qx10kbd.h mame-0.243+dfsg.1/src/mame/machine/qx10kbd.h --- mame-0.242+dfsg.1/src/mame/machine/qx10kbd.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/qx10kbd.h 2022-04-29 05:37:26.000000000 +0000 @@ -28,9 +28,9 @@ private: required_ioport_array<16> m_rows; required_device m_mcu; - emu_timer *m_bit_timer; - u8 m_rxd; - int m_row, m_clk_state; + emu_timer *m_bit_timer = nullptr; + u8 m_rxd = 0; + int m_row = 0, m_clk_state = 0; }; DECLARE_DEVICE_TYPE(QX10_KEYBOARD, qx10_keyboard_device) diff -Nru mame-0.242+dfsg.1/src/mame/machine/rx01.h mame-0.243+dfsg.1/src/mame/machine/rx01.h --- mame-0.242+dfsg.1/src/mame/machine/rx01.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/rx01.h 2022-04-29 05:37:26.000000000 +0000 @@ -64,17 +64,17 @@ }; required_device_array m_image; - uint8_t m_buffer[128]; - int m_buf_pos; + uint8_t m_buffer[128]{}; + int m_buf_pos = 0; - uint16_t m_rxcs; // Command and Status Register - uint16_t m_rxdb; // Data Buffer Register - uint16_t m_rxta; // RX Track Address - uint16_t m_rxsa; // RX Sector Address - uint16_t m_rxes; // RX Error and Status - int m_unit; - int m_interrupt; - rx01_state m_state; + uint16_t m_rxcs = 0; // Command and Status Register + uint16_t m_rxdb = 0; // Data Buffer Register + uint16_t m_rxta = 0; // RX Track Address + uint16_t m_rxsa = 0; // RX Sector Address + uint16_t m_rxes = 0; // RX Error and Status + int m_unit = 0; + int m_interrupt = 0; + rx01_state m_state{}; }; // device type definition diff -Nru mame-0.242+dfsg.1/src/mame/machine/s32comm.h mame-0.243+dfsg.1/src/mame/machine/s32comm.h --- mame-0.242+dfsg.1/src/mame/machine/s32comm.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/s32comm.h 2022-04-29 05:37:26.000000000 +0000 @@ -54,26 +54,26 @@ virtual void device_add_mconfig(machine_config &config) override; private: - uint8_t m_shared[0x800]; // 2k shared memory - uint8_t m_zfg; // z80 flip gate? purpose unknown, bit0 is stored - uint8_t m_cn; // bit0 is used to enable/disable the comm board - uint8_t m_fg; // flip gate? purpose unknown, bit0 is stored, bit7 is connected to ZFG bit 0 + uint8_t m_shared[0x800]{}; // 2k shared memory + uint8_t m_zfg = 0; // z80 flip gate? purpose unknown, bit0 is stored + uint8_t m_cn = 0; // bit0 is used to enable/disable the comm board + uint8_t m_fg = 0; // flip gate? purpose unknown, bit0 is stored, bit7 is connected to ZFG bit 0 osd_file::ptr m_line_rx; // rx line - can be either differential, simple serial or toslink osd_file::ptr m_line_tx; // tx line - is differential, simple serial and toslink - char m_localhost[256]; - char m_remotehost[256]; - uint8_t m_buffer0[0x100]; - uint8_t m_buffer1[0x100]; - uint8_t m_framesync; + char m_localhost[256]{}; + char m_remotehost[256]{}; + uint8_t m_buffer0[0x100]{}; + uint8_t m_buffer1[0x100]{}; + uint8_t m_framesync = 0; #ifdef S32COMM_SIMULATION - uint8_t m_linkenable; - uint16_t m_linktimer; - uint8_t m_linkalive; - uint8_t m_linkid; - uint8_t m_linkcount; - uint16_t m_linktype; + uint8_t m_linkenable = 0; + uint16_t m_linktimer = 0; + uint8_t m_linkalive = 0; + uint8_t m_linkid = 0; + uint8_t m_linkcount = 0; + uint16_t m_linktype = 0; void comm_tick(); int read_frame(int dataSize); diff -Nru mame-0.242+dfsg.1/src/mame/machine/sec.h mame-0.243+dfsg.1/src/mame/machine/sec.h --- mame-0.242+dfsg.1/src/mame/machine/sec.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/sec.h 2022-04-29 05:37:26.000000000 +0000 @@ -63,31 +63,31 @@ static const size_t MAX_COUNTERS = 32; // stuff the SEC stores - int m_counters[MAX_COUNTERS]; - char m_strings[MAX_COUNTERS][8]; - uint8_t m_market; - uint8_t m_nocnt; - uint8_t m_last; + int m_counters[MAX_COUNTERS]{}; + char m_strings[MAX_COUNTERS][8]{}; + uint8_t m_market = 0; + uint8_t m_nocnt = 0; + uint8_t m_last = 0; // serial comms - uint8_t m_curbyte; - uint8_t m_data; + uint8_t m_curbyte = 0; + uint8_t m_data = 0; - uint8_t m_clk; - uint8_t m_clks; - uint8_t m_rxpos; - uint8_t m_rxclk; - uint8_t m_rxdat; - uint8_t m_rxlen; - uint8_t m_chars_left; + uint8_t m_clk = 0; + uint8_t m_clks = 0; + uint8_t m_rxpos = 0; + uint8_t m_rxclk = 0; + uint8_t m_rxdat = 0; + uint8_t m_rxlen = 0; + uint8_t m_chars_left = 0; - uint8_t m_reqpos; + uint8_t m_reqpos = 0; // communication buffer - uint8_t m_request[12]; - uint8_t m_reply[8]; + uint8_t m_request[12]{}; + uint8_t m_reply[8]{}; - bool m_enabled; + bool m_enabled = false; // execute command void do_command(void); diff -Nru mame-0.242+dfsg.1/src/mame/machine/segacrpt_device.h mame-0.243+dfsg.1/src/mame/machine/segacrpt_device.h --- mame-0.242+dfsg.1/src/mame/machine/segacrpt_device.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/segacrpt_device.h 2022-04-29 05:37:26.000000000 +0000 @@ -28,7 +28,7 @@ virtual void device_reset() override; virtual void decrypt() = 0; - const char* m_decrypted_tag; + const char* m_decrypted_tag = nullptr; uint8_t* m_decrypted_ptr; uint8_t* m_region_ptr; int m_decode_size; diff -Nru mame-0.242+dfsg.1/src/mame/machine/seicopbl.h mame-0.243+dfsg.1/src/mame/machine/seicopbl.h --- mame-0.242+dfsg.1/src/mame/machine/seicopbl.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/seicopbl.h 2022-04-29 05:37:26.000000000 +0000 @@ -47,17 +47,17 @@ private: required_device m_host_cpu; - address_space *m_host_space; + address_space *m_host_space = nullptr; const address_space_config m_space_config; inline uint16_t read_word(offs_t address); inline void write_word(offs_t address, uint16_t data); - uint32_t m_reg[8]; - uint16_t m_angle,m_dist,m_status; - int m_dx,m_dy; - uint32_t m_d104_move_offset; - uint16_t m_prng_max; - uint16_t m_scale; + uint32_t m_reg[8]{}; + uint16_t m_angle = 0, m_dist = 0, m_status = 0; + int m_dx = 0, m_dy = 0; + uint32_t m_d104_move_offset = 0; + uint16_t m_prng_max = 0; + uint16_t m_scale = 0; //required_device m_raiden2cop; }; diff -Nru mame-0.242+dfsg.1/src/mame/machine/super80.cpp mame-0.243+dfsg.1/src/mame/machine/super80.cpp --- mame-0.242+dfsg.1/src/mame/machine/super80.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/super80.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -91,7 +91,7 @@ TIMER_DEVICE_CALLBACK_MEMBER( super80_state::timer_h ) { uint8_t go_fast = 0; - if ( (!BIT(m_portf0, 2)) | (!BIT(m_io_config->read(), 1)) ) // bit 2 of port F0 is low, OR user turned on config switch + if ( (!BIT(m_portf0, 2)) || (!BIT(m_io_config->read(), 1)) ) // bit 2 of port F0 is low, OR user turned on config switch go_fast++; // must be 1 at boot so banking works correctly /* code to slow down computer to 1 MHz by halting cpu on every second frame */ diff -Nru mame-0.242+dfsg.1/src/mame/machine/swim.h mame-0.243+dfsg.1/src/mame/machine/swim.h --- mame-0.242+dfsg.1/src/mame/machine/swim.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/swim.h 2022-04-29 05:37:26.000000000 +0000 @@ -46,11 +46,11 @@ virtual void iwm_modereg_w(uint8_t data) override; private: - uint8_t m_swim_mode; - uint8_t m_swim_magic_state; - uint8_t m_parm_offset; - uint8_t m_ism_regs[8]; - uint8_t m_parms[16]; + uint8_t m_swim_mode = 0; + uint8_t m_swim_magic_state = 0; + uint8_t m_parm_offset = 0; + uint8_t m_ism_regs[8]{}; + uint8_t m_parms[16]{}; }; #endif // MAME_MACHINE_SWIM_H diff -Nru mame-0.242+dfsg.1/src/mame/machine/vt1682_alu.h mame-0.243+dfsg.1/src/mame/machine/vt1682_alu.h --- mame-0.242+dfsg.1/src/mame/machine/vt1682_alu.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/vt1682_alu.h 2022-04-29 05:37:26.000000000 +0000 @@ -39,7 +39,7 @@ virtual void device_reset() override; private: - bool m_is_sound_alu; + bool m_is_sound_alu = false; uint8_t m_alu_oprand[4]; uint8_t m_alu_oprand_mult[2]; diff -Nru mame-0.242+dfsg.1/src/mame/machine/wpc_lamp.h mame-0.243+dfsg.1/src/mame/machine/wpc_lamp.h --- mame-0.242+dfsg.1/src/mame/machine/wpc_lamp.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/wpc_lamp.h 2022-04-29 05:37:26.000000000 +0000 @@ -20,9 +20,9 @@ void set_names(const char *const *lamp_names); protected: - uint8_t state[64]; - uint8_t col, row; - emu_timer *timer; + uint8_t state[64]{}; + uint8_t col = 0, row = 0; + emu_timer *timer = nullptr; const char *const *names; virtual void device_start() override; diff -Nru mame-0.242+dfsg.1/src/mame/machine/wpc_out.h mame-0.243+dfsg.1/src/mame/machine/wpc_out.h --- mame-0.242+dfsg.1/src/mame/machine/wpc_out.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/wpc_out.h 2022-04-29 05:37:26.000000000 +0000 @@ -32,12 +32,12 @@ void set_gi_count(int _count); protected: - uint8_t state[6], gi; - bool first_after_led; + uint8_t state[6]{}, gi = 0; + bool first_after_led = false; attotime previous_gi_update; - int gi_count; + int gi_count = 0; uint32_t gi_time[5]; - emu_timer *timer; + emu_timer *timer = nullptr; const char *const *names; handler_t handler_cb; diff -Nru mame-0.242+dfsg.1/src/mame/machine/wpc_pic.h mame-0.243+dfsg.1/src/mame/machine/wpc_pic.h --- mame-0.242+dfsg.1/src/mame/machine/wpc_pic.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/wpc_pic.h 2022-04-29 05:37:26.000000000 +0000 @@ -22,7 +22,7 @@ protected: required_ioport_array<8> swarray; - uint8_t mem[16], chk[3], curcmd, scrambler, count, chk_count, cmpchk[3]; + uint8_t mem[16]{}, chk[3]{}, curcmd = 0, scrambler = 0, count = 0, chk_count = 0, cmpchk[3]{}; const char *serial; virtual void device_start() override; diff -Nru mame-0.242+dfsg.1/src/mame/machine/wpc_shift.h mame-0.243+dfsg.1/src/mame/machine/wpc_shift.h --- mame-0.242+dfsg.1/src/mame/machine/wpc_shift.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/wpc_shift.h 2022-04-29 05:37:26.000000000 +0000 @@ -19,8 +19,8 @@ virtual void device_reset() override; private: - uint16_t adr; - uint8_t val1, val2; + uint16_t adr = 0; + uint8_t val1 = 0, val2 = 0; uint8_t adrh_r(); void adrh_w(uint8_t data); diff -Nru mame-0.242+dfsg.1/src/mame/machine/x68k_hdc.h mame-0.243+dfsg.1/src/mame/machine/x68k_hdc.h --- mame-0.242+dfsg.1/src/mame/machine/x68k_hdc.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/x68k_hdc.h 2022-04-29 05:37:26.000000000 +0000 @@ -113,17 +113,17 @@ private: TIMER_CALLBACK_MEMBER(req_timer_callback); - sasi_phase m_phase; - u8 m_status_port; // read at 0xe96003 - u8 m_status; // status phase output - u8 m_command[10]; - u8 m_sense[4]; - u16 m_command_byte_count; - u16 m_command_byte_total; - u8 m_current_command; - u16 m_transfer_byte_count; - u16 m_transfer_byte_total; - emu_timer *m_req_timer; + sasi_phase m_phase{}; + u8 m_status_port = 0; // read at 0xe96003 + u8 m_status = 0; // status phase output + u8 m_command[10]{}; + u8 m_sense[4]{}; + u16 m_command_byte_count = 0; + u16 m_command_byte_total = 0; + u8 m_current_command = 0; + u16 m_transfer_byte_count = 0; + u16 m_transfer_byte_total = 0; + emu_timer *m_req_timer = nullptr; }; // device type definition diff -Nru mame-0.242+dfsg.1/src/mame/machine/x68k_kbd.h mame-0.243+dfsg.1/src/mame/machine/x68k_kbd.h --- mame-0.242+dfsg.1/src/mame/machine/x68k_kbd.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/x68k_kbd.h 2022-04-29 05:37:26.000000000 +0000 @@ -33,9 +33,9 @@ output_finder<> m_led_hiragana; output_finder<> m_led_fullsize; - int m_delay; // keypress delay after initial press - int m_repeat; // keypress repeat rate - uint8_t m_enabled; // keyboard enabled? + int m_delay = 0; // keypress delay after initial press + int m_repeat = 0; // keypress repeat rate + uint8_t m_enabled = 0; // keyboard enabled? }; DECLARE_DEVICE_TYPE(X68K_KEYBOARD, x68k_keyboard_device) diff -Nru mame-0.242+dfsg.1/src/mame/machine/z80bin.cpp mame-0.243+dfsg.1/src/mame/machine/z80bin.cpp --- mame-0.242+dfsg.1/src/mame/machine/z80bin.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/machine/z80bin.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -10,7 +10,6 @@ image_init_result z80bin_load_file(device_image_interface &image, address_space &space, uint16_t &exec_addr, uint16_t &start_addr, uint16_t &end_addr) { - int ch = 0; uint16_t args[3]{}; uint16_t i = 0U, j = 0U, size = 0U; uint8_t data = 0U; @@ -19,15 +18,10 @@ image.fseek(7, SEEK_SET); - while((ch = image.fgetc()) != 0x1A) + char ch = '\0'; + uint32_t bytes = 0; + while ((bytes = image.fread(&ch, 1)) != 0 && ch != 0x1A) { - if (ch == EOF) - { - image.seterror(image_error::INVALIDIMAGE, "Unexpected EOF while getting file name"); - image.message(" Unexpected EOF while getting file name"); - return image_init_result::FAIL; - } - if (ch != '\0') { if (i >= (std::size(pgmname) - 1)) @@ -42,6 +36,13 @@ } } + if (bytes == 0) + { + image.seterror(image_error::INVALIDIMAGE, "Unexpected EOF while getting file name"); + image.message(" Unexpected EOF while getting file name"); + return image_init_result::FAIL; + } + pgmname[i] = '\0'; /* terminate string with a null */ if (image.fread(args, sizeof(args)) != sizeof(args)) diff -Nru mame-0.242+dfsg.1/src/mame/mame.lst mame-0.243+dfsg.1/src/mame/mame.lst --- mame-0.242+dfsg.1/src/mame/mame.lst 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/mame.lst 2022-04-29 05:37:26.000000000 +0000 @@ -111,6 +111,7 @@ k7_olym // (c) 1994 K7 Kursaal / NMI Electronics k7_olym30 // (c) 1994 K7 Kursaal / NMI Electronics sprtdart // (c) 1993 Compumatic / Desarrollos y Recambios S.L. +unkdarts // (c) 1992 Oper Coin. @source:4enraya.cpp 4enraya // (c) 1990 IDSA @@ -3279,6 +3280,9 @@ @source:badlands.cpp badlands // 136074 (c) 1989 +@source:badlands_ms.cpp +badlandsm + @source:badlandsbl.cpp badlandsb // bootleg badlandsb2 // bootleg set 2 @@ -9470,6 +9474,7 @@ megadblj // (c) 1990 Blitz Systems Inc. megastrp // (c) 1992 Blitz Systems Inc. poker52 // (c) 1993 Blitz Systems Inc. ? +super97 // (c) 1997 Cadillac Jack surpr5 // (c) 1997 Cadillac Jack steaser // (c) 1993 unknown texasrls // (c) 1998 Cadillac Jack @@ -9957,6 +9962,7 @@ comg159 // (c) 1983 Cal Omega Inc. comg164 // (c) 1983 Cal Omega Inc. comg168 // (c) 1983 Cal Omega Inc. +comg170 // (c) 1983 Cal Omega Inc. comg172 // (c) 1983 Cal Omega Inc. comg175 // (c) 1984 Cal Omega / Casino Electronics Inc. comg176 // (c) 1982 Cal Omega Inc. @@ -11505,6 +11511,7 @@ redearthr1 // 23/10/1996 (c) 1996 (Euro) sfiii // 04/02/1997 (c) 1997 (Euro) sfiii2 // 30/09/1997 (c) 1997 (USA) +sfiii2h // 30/09/1997 (c) 1997 (Hispanic) sfiii2j // 30/09/1997 (c) 1997 (Japan) sfiii2n // 30/09/1997 (c) 1997 (Asia) sfiii3 // 08/06/1999 (c) 1999 (Euro) @@ -12645,6 +12652,7 @@ dowild // 8339A (c) 1984 idsoccer // ???? (c) 1985 idsoccera // ???? (c) 1985 +idsoccert // 8461A (c) 1985 jjack // ???? (c) 1984 kickridr // ???? (c) 1984 spiero // ???? (c) 1987 @@ -13394,6 +13402,7 @@ @source:electra.cpp avenger // (c) 1975 Electra +flyingf // (c) 1976 Electra @source:electron.cpp electron // 1983 Acorn Electron @@ -13932,6 +13941,7 @@ feversoc // (c) 2004 @source:ffantasy_ms.cpp +drgninjam // ffantasym // @source:fgoal.cpp @@ -14255,7 +14265,6 @@ @source:fruitpc.cpp fruitpc // ??? -gogostrk // @source:fs3216.cpp fs3216 // @@ -14358,6 +14367,8 @@ megacard // (c) 1993 Fun World mongolnw // 199? bootleg multiwin // (c) 1992 Fun World +multiwina // (c) 1991 Fun World +multiwinb // (c) 2001 Amatic nevadafw // 199? unknown nkoulit // 1995 JK Amusement novoplay // (c) 1986 Novomatic @@ -14631,6 +14642,7 @@ galap1 // hack galap4 // hack galapx // hack +galartic // Artic System galaxbsf // hack galaxbsf2 // bootleg galaxcirsa // bootleg (Cirsa) @@ -15607,10 +15619,16 @@ geniea // 198?, Unknown goldnpkb // (c) 1981 Bonanza goldnpkc // Bootleg +goldnpkd // Bootleg +goldnpke // Intercoast (bootleg) +goldnpkf // Intercoast (bootleg) goldnpkr // (c) 1981 Bonanza goodluck // Unknown jokercar // 199?, unknown +lespendu // (c) 198? Voyageur de L'Espace Inc. +lespenduj // (c) 198? Voyageur de L'Espace Inc. maverik // 198?, Unknown +maxidpkr // (c) 1990 Blitz System Inc megadpkr // (c) 1990 Blitz System Inc megadpkrb // (c) 1990 Blitz System Inc ngold // 198? Unknown @@ -16341,6 +16359,7 @@ harddrivc // 136068 (c) 1990 harddrivc1 // 136068 (c) 1990 harddrivcb // 136068 (c) 1990 +harddrivcbl // bootleg harddrivcg // 136068 (c) 1990 harddrivg // 136052 (c) 1988 harddrivg4 // 136052 (c) 1988 @@ -16442,14 +16461,6 @@ @source:hh_amis2k.cpp wildfire // Parker Bros -@source:hh_b5000.cpp -autorace // Mattel -gravity // Mattel -mbaseb // Mattel -mfootb // Mattel -misatk // Mattel -rw18r // Rockwell - @source:hh_cop400.cpp bship82 // Milton Bradley ctstein // Castle Toy @@ -16488,6 +16499,7 @@ bdoramon // Bandai bfriskyt // Bandai bmboxing // Bambino +bombman // Tomy bpengo // Bandai bultrman // Bandai bzaxxon // Bandai @@ -16503,18 +16515,24 @@ estargte // Entex eturtles // Entex gckong // Gakken +gdefender // Gakken gdigdug // Gakken +ggdman // Bandai ghalien // Gakken gscobra // Gakken kingman // Tomy +ktparman // Bandai machiman // Bandai msthawk // Mattel mwcbaseb // Mattel packmon // Bandai pairmtch // Bandai pbqbert // Parker Brothers +puckimon // Romtec +tkjmaru // Bandai tmtron // Tomy vinvader // VTech +wantgman // Actronics / Hanzawa zackman // Bandai @source:hh_melps4.cpp @@ -16550,6 +16568,19 @@ scrabsen // Selchow & Righter smastmind // Invicta +@source:hh_rw5000.cpp +autorace // Mattel +gravity // Mattel +mbaseb // Mattel +mfootb // Mattel +misatk // Mattel +rw10r // Rockwell +rw12r // Rockwell +rw18r // Rockwell +rw24k // Rockwell +rw30r // Rockwell +rw31r // Rockwell + @source:hh_sm510.cpp atakaast // Elektronika auslalom // Elektronika @@ -17214,12 +17245,13 @@ @source:igs_m036.cpp cjddzsp // (c) 200? -lhzb3in1 // (c) 200? cjdh2 // (c) 200? cjdh2a // (c) 200? cjdh2b // (c) 200? cjdh2c // (c) 200? igsm312 // (c) 200? +lhtb // (c) 200? +lhzb3in1 // (c) 200? @source:igs009.cpp gp98 // (c) 1998 @@ -17470,6 +17502,9 @@ isbc8630 // sm1810 // +@source:isbc660.cpp +isbc660 // Intel iSBC 660 System Chassis + @source:isbc8010.cpp isbc8010 // isbc8010a // @@ -17520,10 +17555,11 @@ @source:itech32.cpp bloodstm // (c) 1994 Strata/Incredible Technologies -bloodstm10 // (c) 1994 Strata/Incredible Technologies -bloodstm11 // (c) 1994 Strata/Incredible Technologies -bloodstm21 // (c) 1994 Strata/Incredible Technologies -bloodstm22 // (c) 1994 Strata/Incredible Technologies +bloodstm104 // (c) 1994 Strata/Incredible Technologies +bloodstm110 // (c) 1994 Strata/Incredible Technologies +bloodstm210 // (c) 1994 Strata/Incredible Technologies +bloodstm220 // (c) 1994 Strata/Incredible Technologies +bloodstm221 // (c) 1994 Strata/Incredible Technologies drivedge // (c) 1994 Strata/Incredible Technologies gt2k // (c) 2000 Incredible Technologies gt2kp100 // (c) 2000 Incredible Technologies @@ -20151,6 +20187,9 @@ @source:lemmings.cpp lemmings // prototype (c) 1991 Data East USA (US) +@source:lependu.cpp +lependu // 198? Avenir Amusement Inc. + @source:lethal.cpp lethalen // GX191 (c) 1992 lethaleneaa // GX191 (c) 1992 @@ -31725,6 +31764,9 @@ 18w // 653 (c) 1979 Midway 18w2 // 653 (c) 1979 Midway +@source:mw4pole.cpp +mw4pole // (c) 1995 Waldorf Electronics GmbH Germany + @source:mw8080bw.cpp 280zzzap // 610 [1976] blueshrk // 742 [1978] @@ -32971,7 +33013,7 @@ maglordh // 0005 (c) 1990 Alpha Denshi Co. mahretsu // 0004 (c) 1990 SNK marukodq // 0206 (c) 1995 Takara -matrim // 0266 (c) 2002 Atlus +matrim // 0266 (c) 2003 Atlus matrimbl // bootleg miexchng // 0231 (c) 1997 Face minasan // 0027 (c) 1990 Monolith Corp. @@ -33676,6 +33718,7 @@ sexpertb // sexpertc // sexpertc1 // +sexpertc2 // sfortea // sfortea1 // sfortea2 // @@ -34079,6 +34122,9 @@ panicr // Seibu / Taito panicrg // Seibu / TV-Tuning (Germany) +@source:paokaipc.cpp +gogostrk // + @source:paradise.cpp madball // (c) 1998 Yun Sung madballn // (c) 1998 Yun Sung @@ -35337,10 +35383,15 @@ @source:photoply.cpp photoply98sp // (c) 1998 Funworld +photoply99nl // (c) 1999 Funworld photoply99sp // (c) 1999 Funworld photoply2k // (c) 2000 Funworld +photoply2knl // (c) 2000 Funworld photoply2ksp // (c) 2000 Funworld photoply2k1it // (c) 2001 Funworld +photoply2k1nl // (c) 2001 Funworld +photoply2k1mtnl // (c) 2001 Funworld +photoply2k2be // (c) 2002 Funworld photoply2k4 // (c) 2004 Funworld @source:photoplys.cpp @@ -37080,14 +37131,12 @@ @source:s8.cpp pfevr_l2 // pfevr_p3 // - -@source:s8a.cpp +ratrc_l1 // scrzy_l1 // @source:s9.cpp comet_l4 // comet_l5 // -ratrc_l1 // sorcr_l1 // sorcr_l2 // sshtl_l3 // @@ -38820,13 +38869,13 @@ sigma21 // @source:sigmab31.cpp -cptlucky // (c) 199? Sigma +cptlucky // (c) 1988 Sigma @source:sigmab52.cpp jwildb52 // (c) 199? Sigma jwildb52a // (c) 199? Sigma jwildb52h // (c) 199? Sigma -s8waysfc // (c) 199? Sigma +s8waysfc // (c) 1989 Sigma @source:sigmab98.cpp animalc // (c) 2000 Sammy @@ -38986,6 +39035,9 @@ tigerhb4 // bootleg but (c) 1985 Taito Corporation tigerhj // A47 (c) 1985 Taito Corporation GX-551 [not a Konami board!] +@source:slapfght_ms.cpp +slapfighm + @source:slapshot.cpp opwolf3 // D74 (c) 1994 Taito Corporation Japan opwolf3j // D74 (c) 1994 Taito Corporation @@ -39320,6 +39372,9 @@ spcforc2 // bootleg spcforce // (c) 1980 Venture Line +@source:spdamjes.cpp +spdamjes // (c) 19?? T-90 S.A. + @source:spdheat.cpp spdheat // A55 (c) 1985 Taito Corporation (World) spdheatj // A55 (c) 1985 Taito Corporation (Japan) @@ -40941,9 +40996,10 @@ @source:taitojc.cpp dangcurv // 1995.?? E09 (c) 1995 Taito Corporation dangcurvj // 1995.?? E09 (c) 1995 Taito Corporation -dendego // 1997.03 E35 (c) 1996 Taito Corporation (Japan) - Ver 2.2 J +dendego // 1997.04 E35 (c) 1996 Taito Corporation (Japan) - Ver 2.3 J dendego2 // 1998.03 E52 (c) 1998 Taito Corporation (Japan) - Ver 2.5 J dendego23k // 1998.08 E52 (c) 1998 Taito Corporation (Japan) - Ver 2.20 J +dendegoa // 1997.03 E35 (c) 1996 Taito Corporation (Japan) - Ver 2.2 J dendegox // 1997.09 E35 (c) 1996 Taito Corporation (Japan) - Ver 2.4 J landgear // 1996.?? E17 (c) 1995 Taito Corporation Japan (World) - Ver 4.2 O landgeara // 1996.?? E17 (c) 1995 Taito Corporation Japan (World) - Ver 3.1 O @@ -41091,9 +41147,11 @@ @source:tasman.cpp dragsphr // +horses4c // ivorytsk // kingtut // moneybnk // +thequest // vikingt // @source:tatsumi.cpp @@ -42620,6 +42678,7 @@ winner // @source:vigilant.cpp +bowmen // (c) 1994 Ten-Level buccanrs // (c) 1989 Duintronic buccanrsa // (c) 1989 Duintronic buccanrsb // (c) 1989 Duintronic @@ -43436,6 +43495,7 @@ witchstar // (c) 1994 Fovis Korea Co. Ltd. @source:wiz.cpp +finger // hack kungfut // (c) 1984 Seibu Kaihatsu kungfuta // (c) 1984 Seibu Kaihatsu scion // (c) 1984 Seibu Denshi diff -Nru mame-0.242+dfsg.1/src/mame/mess.flt mame-0.243+dfsg.1/src/mame/mess.flt --- mame-0.242+dfsg.1/src/mame/mess.flt 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/mess.flt 2022-04-29 05:37:26.000000000 +0000 @@ -406,13 +406,13 @@ hektor.cpp hhtiger.cpp hh_amis2k.cpp -hh_b5000.cpp hh_cop400.cpp hh_cops1.cpp hh_hmcs40.cpp hh_melps4.cpp hh_pic16.cpp hh_pps41.cpp +hh_rw5000.cpp hh_sm510.cpp hh_tms1k.cpp hh_ucom4.cpp @@ -484,6 +484,7 @@ iris_power.cpp is48x.cpp isbc.cpp +isbc660.cpp isbc8010.cpp isbc8030.cpp iskr103x.cpp @@ -690,6 +691,7 @@ mupid2.cpp mvme147.cpp mvme162.cpp +mw4pole.cpp mx2178.cpp myb3k.cpp mycom.cpp diff -Nru mame-0.242+dfsg.1/src/mame/video/abc1600.h mame-0.243+dfsg.1/src/mame/video/abc1600.h --- mame-0.242+dfsg.1/src/mame/video/abc1600.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/abc1600.h 2022-04-29 05:37:26.000000000 +0000 @@ -110,31 +110,31 @@ required_region_ptr m_shinf_rom; required_region_ptr m_drmsk_rom; - int m_endisp; // enable display - int m_clocks_disabled; // clocks disabled - uint16_t m_gmdi; // video RAM data latch - uint16_t m_wrm; // write mask latch - uint8_t m_ms[16]; // mover sequence control - uint8_t m_ds[16]; // display sequence control - uint8_t m_flag; // flags - uint16_t m_xsize; // X size - uint16_t m_ysize; // Y size - int m_udx; // up/down X - int m_udy; // up/down Y - uint16_t m_xfrom; // X from - uint16_t m_xto; // X to - uint16_t m_yto; // Y to - uint16_t m_ty; // to Y - uint32_t m_mfa; // mover from address - uint32_t m_mta; // mover to address - uint8_t m_sh; // - uint16_t m_mdor; // - int m_hold_1w_cyk; // - int m_wrms0; // - int m_wrms1; // - int m_rmc; // row match count - int m_cmc; // column match count - int m_amm; // active mover mask + int m_endisp = 0; // enable display + int m_clocks_disabled = 0; // clocks disabled + uint16_t m_gmdi = 0; // video RAM data latch + uint16_t m_wrm = 0; // write mask latch + uint8_t m_ms[16]{}; // mover sequence control + uint8_t m_ds[16]{}; // display sequence control + uint8_t m_flag = 0; // flags + uint16_t m_xsize = 0; // X size + uint16_t m_ysize = 0; // Y size + int m_udx = 0; // up/down X + int m_udy = 0; // up/down Y + uint16_t m_xfrom = 0; // X from + uint16_t m_xto = 0; // X to + uint16_t m_yto = 0; // Y to + uint16_t m_ty = 0; // to Y + uint32_t m_mfa = 0; // mover from address + uint32_t m_mta = 0; // mover to address + uint8_t m_sh = 0; // + uint16_t m_mdor = 0; // + int m_hold_1w_cyk = 0; // + int m_wrms0 = 0; // + int m_wrms1 = 0; // + int m_rmc = 0; // row match count + int m_cmc = 0; // column match count + int m_amm = 0; // active mover mask }; diff -Nru mame-0.242+dfsg.1/src/mame/video/advision.cpp mame-0.243+dfsg.1/src/mame/video/advision.cpp --- mame-0.242+dfsg.1/src/mame/video/advision.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/advision.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,107 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Dan Boris -/*************************************************************************** - - Routines to control the Adventurevision video hardware - - Video hardware is composed of a vertical array of 40 LEDs which is - reflected off a spinning mirror, to give a resolution of 150 x 40 at 15 FPS. - -***************************************************************************/ - -#include "emu.h" -#include "includes/advision.h" - -#include - - -/*************************************************************************** - - Start the video hardware emulation. - -***************************************************************************/ - -void advision_state::video_start() -{ - m_video_hpos = 0; - m_display = std::make_unique(8 * 8 * 256); - std::fill_n(m_display.get(), 8 * 8 * 256, 0); - save_pointer(NAME(m_display), 8 * 8 * 256); - save_item(NAME(m_video_hpos)); -} - -/*************************************************************************** - - Initialise the palette. - -***************************************************************************/ - -void advision_state::advision_palette(palette_device &palette) const -{ - // 8 shades of RED - for (int i = 0; i < 8; i++) - m_palette->set_pen_color(i, pal3bit(i), 0x00, 0x00); -} - -/*************************************************************************** - - Update the display data. - -***************************************************************************/ - -void advision_state::vh_write(int data) -{ - if (m_video_bank >= 1 && m_video_bank <=5) - m_led_latch[m_video_bank] = data; -} - -void advision_state::vh_update(int x) -{ - uint8_t *dst = &m_display[x]; - - for (int y = 0; y < 8; y++) - { - uint8_t data = m_led_latch[7 - y]; - - for (int i = 0; i < 8; i++) - { - if (!BIT(data, 7 - i)) - dst[i * 256] = 8; - } - - m_led_latch[7 - y] = 0xff; - dst += 8 * 256; - } -} - - -/*************************************************************************** - - Refresh the video screen - -***************************************************************************/ - -uint32_t advision_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - if ((m_frame_count++ % 4) == 0) - { - m_frame_start = 1; - m_video_hpos = 0; - } - - for (int x = 0; x < 150; x++) - { - uint8_t *led = &m_display[x]; - - for (int y = 0; y < 128; y+=2) - { - if (*led > 0) - bitmap.pix(30 + y, 85 + x) = --(*led); - else - bitmap.pix(30 + y, 85 + x) = 0; - - led += 256; - } - } - return 0; -} diff -Nru mame-0.242+dfsg.1/src/mame/video/agat9.h mame-0.243+dfsg.1/src/mame/video/agat9.h --- mame-0.242+dfsg.1/src/mame/video/agat9.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/agat9.h 2022-04-29 05:37:26.000000000 +0000 @@ -38,10 +38,10 @@ uint8_t apple_read(offs_t offset); void apple_write(offs_t offset, uint8_t data); - bool m_page2; - bool m_flash; - bool m_mix; - bool m_graphics; + bool m_page2 = false; + bool m_flash = false; + bool m_mix = false; + bool m_graphics = false; std::unique_ptr m_hires_artifact_map; protected: @@ -86,8 +86,8 @@ GRAPHICS_MONO_HIRES, APPLE } m_video_mode; - int m_mode; - int palette_index; + int m_mode = 0; + int palette_index = 0; }; // device type definition diff -Nru mame-0.242+dfsg.1/src/mame/video/airraid_dev.h mame-0.243+dfsg.1/src/mame/video/airraid_dev.h --- mame-0.242+dfsg.1/src/mame/video/airraid_dev.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/airraid_dev.h 2022-04-29 05:37:26.000000000 +0000 @@ -49,9 +49,9 @@ required_shared_ptr m_vregs; // tilemaps - tilemap_t *m_bg_tilemap; - tilemap_t *m_fg_tilemap; - tilemap_t *m_tx_tilemap; + tilemap_t *m_bg_tilemap = nullptr; + tilemap_t *m_fg_tilemap = nullptr; + tilemap_t *m_tx_tilemap = nullptr; TILEMAP_MAPPER_MEMBER(bg_scan); TILEMAP_MAPPER_MEMBER(fg_scan); diff -Nru mame-0.242+dfsg.1/src/mame/video/ajax.cpp mame-0.243+dfsg.1/src/mame/video/ajax.cpp --- mame-0.242+dfsg.1/src/mame/video/ajax.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/ajax.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,98 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Manuel Abadia -/*************************************************************************** - - ajax.cpp - - Functions to emulate the video hardware of the machine. - -***************************************************************************/ - -#include "emu.h" -#include "includes/ajax.h" - - -/*************************************************************************** - - Callbacks for the K052109 - -***************************************************************************/ - -K052109_CB_MEMBER(ajax_state::tile_callback) -{ - static const int layer_colorbase[] = { 1024 / 16, 0 / 16, 512 / 16 }; - - *code |= ((*color & 0x0f) << 8) | (bank << 12); - *color = layer_colorbase[layer] + ((*color & 0xf0) >> 4); -} - - -/*************************************************************************** - - Callbacks for the K051960 - -***************************************************************************/ - -K051960_CB_MEMBER(ajax_state::sprite_callback) -{ - enum { sprite_colorbase = 256 / 16 }; - - /* priority bits: - 4 over zoom (0 = have priority) - 5 over B (0 = have priority) - 6 over A (1 = have priority) - never over F - */ - *priority = 0; - if ( *color & 0x10) *priority |= GFX_PMASK_4; /* Z = 4 */ - if (~*color & 0x40) *priority |= GFX_PMASK_2; /* A = 2 */ - if ( *color & 0x20) *priority |= GFX_PMASK_1; /* B = 1 */ - *color = sprite_colorbase + (*color & 0x0f); -} - - -/*************************************************************************** - - Callbacks for the K051316 - -***************************************************************************/ - -K051316_CB_MEMBER(ajax_state::zoom_callback) -{ - enum { zoom_colorbase = 768 / 128 }; - - *code |= ((*color & 0x07) << 8); - *color = zoom_colorbase + ((*color & 0x08) >> 3); -} - - -/*************************************************************************** - - Display Refresh - -***************************************************************************/ - -uint32_t ajax_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - m_k052109->tilemap_update(); - - screen.priority().fill(0, cliprect); - - bitmap.fill(m_palette->black_pen(), cliprect); - m_k052109->tilemap_draw(screen, bitmap, cliprect, 2, 0, 1); - if (m_priority) - { - /* basic layer order is B, zoom, A, F */ - m_k051316->zoom_draw(screen, bitmap, cliprect, 0, 4); - m_k052109->tilemap_draw(screen, bitmap, cliprect, 1, 0, 2); - } - else - { - /* basic layer order is B, A, zoom, F */ - m_k052109->tilemap_draw(screen, bitmap, cliprect, 1, 0, 2); - m_k051316->zoom_draw(screen, bitmap, cliprect, 0, 4); - } - m_k051960->k051960_sprites_draw(bitmap, cliprect, screen.priority(), -1, -1); - m_k052109->tilemap_draw(screen, bitmap, cliprect, 0, 0, 0); - return 0; -} diff -Nru mame-0.242+dfsg.1/src/mame/video/alpha68k_palette.h mame-0.243+dfsg.1/src/mame/video/alpha68k_palette.h --- mame-0.242+dfsg.1/src/mame/video/alpha68k_palette.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/alpha68k_palette.h 2022-04-29 05:37:26.000000000 +0000 @@ -48,7 +48,7 @@ virtual uint32_t palette_entries() const override { return m_entries; } private: std::vector m_paletteram; - u32 m_entries; + u32 m_entries = 0; void create_rgb_lookups(); uint8_t m_palette_lookup[32][4]; inline void set_color_entry(u16 offset, u16 pal_data, int shift); diff -Nru mame-0.242+dfsg.1/src/mame/video/angelkds.cpp mame-0.243+dfsg.1/src/mame/video/angelkds.cpp --- mame-0.242+dfsg.1/src/mame/video/angelkds.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/angelkds.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,265 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:David Haywood -/* video/angelkds.c - see drivers/angelkds.c for more info */ - -/* graphical issues - -enable / disable tilemap bits might be wrong - -*/ - -#include "emu.h" -#include "includes/angelkds.h" -#include "screen.h" - - -/*** Text Layer Tilemap - -*/ - -TILE_GET_INFO_MEMBER(angelkds_state::get_tx_tile_info) -{ - int tileno; - - tileno = m_txvideoram[tile_index] + (m_txbank * 0x100); - tileinfo.set(0, tileno, 0, 0); -} - -void angelkds_state::angelkds_txvideoram_w(offs_t offset, uint8_t data) -{ - m_txvideoram[offset] = data; - m_tx_tilemap->mark_tile_dirty(offset); -} - -void angelkds_state::angelkds_txbank_write(uint8_t data) -{ - if (m_txbank != data) - { - m_txbank = data; - m_tx_tilemap->mark_all_dirty(); - } -} - -/*** Top Half Background Tilemap - -*/ - -TILE_GET_INFO_MEMBER(angelkds_state::get_bgtop_tile_info) -{ - int tileno; - - tileno = m_bgtopvideoram[tile_index]; - - tileno += m_bgtopbank * 0x100 ; - tileinfo.set(1, tileno, 0, 0); -} - -void angelkds_state::angelkds_bgtopvideoram_w(offs_t offset, uint8_t data) -{ - m_bgtopvideoram[offset] = data; - m_bgtop_tilemap->mark_tile_dirty(offset); -} - -void angelkds_state::angelkds_bgtopbank_write(uint8_t data) -{ - if (m_bgtopbank != data) - { - m_bgtopbank = data; - m_bgtop_tilemap->mark_all_dirty(); - } -} - -void angelkds_state::angelkds_bgtopscroll_write(uint8_t data) -{ - m_bgtop_tilemap->set_scrollx(0, data); -} - -/*** Bottom Half Background Tilemap - -*/ - -TILE_GET_INFO_MEMBER(angelkds_state::get_bgbot_tile_info) -{ - int tileno; - - tileno = m_bgbotvideoram[tile_index]; - - tileno += m_bgbotbank * 0x100 ; - tileinfo.set(2, tileno, 1, 0); -} - -void angelkds_state::angelkds_bgbotvideoram_w(offs_t offset, uint8_t data) -{ - m_bgbotvideoram[offset] = data; - m_bgbot_tilemap->mark_tile_dirty(offset); -} - - -void angelkds_state::angelkds_bgbotbank_write(uint8_t data) -{ - if (m_bgbotbank != data) - { - m_bgbotbank = data; - m_bgbot_tilemap->mark_all_dirty(); - } -} - -void angelkds_state::angelkds_bgbotscroll_write(uint8_t data) -{ - m_bgbot_tilemap->set_scrollx(0, data); -} - - -void angelkds_state::angelkds_layer_ctrl_write(uint8_t data) -{ - m_layer_ctrl = data; -} - -/*** Sprites - -the sprites are similar to the tilemaps in the sense that there is -a split down the middle of the screen - -*/ - -void angelkds_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int enable_n) -{ - const uint8_t *source = m_spriteram + 0x100 - 4; - const uint8_t *finish = m_spriteram; - gfx_element *gfx = m_gfxdecode->gfx(3); - - while (source >= finish) - { - /* - - nnnn nnnn - EeFf B?cc - yyyy yyyy - xxxx xxxx - - n = sprite number - E = Sprite Enabled in Top Half of Screen - e = Sprite Enabled in Bottom Half of Screen - F = Flip Y - f = Flip X - B = Tile Bank - ? = unknown, nothing / unused? recheck - c = color - y = Y position - x = X position - - */ - uint16_t tile_no = source[0]; - uint8_t attr = source[1]; - uint8_t ypos = source[2]; - uint8_t xpos = source[3]; - - uint8_t enable = attr & 0xc0; - uint8_t flipx = (attr & 0x10) >> 4; - uint8_t flipy = (attr & 0x20) >> 5; - uint8_t bank = attr & 0x08; - uint8_t color = attr & 0x03; - - if (bank) - tile_no += 0x100; - - ypos = 0xff - ypos; - - if (enable & enable_n) - { - gfx->transpen( - bitmap, - cliprect, - tile_no, - color*4, - flipx,flipy, - xpos,ypos,15 - ); - /* wraparound */ - if (xpos > 240) - - gfx->transpen( - bitmap, - cliprect, - tile_no, - color*4, - flipx,flipy, - xpos-256,ypos,15 - ); - /* wraparound */ - if (ypos > 240) - { - gfx->transpen( - bitmap, - cliprect, - tile_no, - color*4, - flipx,flipy, - xpos,ypos-256,15 - ); - /* wraparound */ - if (xpos > 240) - - gfx->transpen( - bitmap, - cliprect, - tile_no, - color*4, - flipx,flipy, - xpos-256,ypos-256,15 - ); - } - } - - source -= 0x04; - } - -} - - -/*** Video Start & Update - -*/ - -void angelkds_state::video_start() -{ - m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(angelkds_state::get_tx_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); - m_tx_tilemap->set_transparent_pen(0); - - m_bgbot_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(angelkds_state::get_bgbot_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); - m_bgbot_tilemap->set_transparent_pen(15); - - m_bgtop_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(angelkds_state::get_bgtop_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); - m_bgtop_tilemap->set_transparent_pen(15); -} - -/* enable bits are uncertain */ - -uint32_t angelkds_state::screen_update_angelkds(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - const rectangle &visarea = screen.visible_area(); - rectangle clip; - - bitmap.fill(0x3f, cliprect); /* is there a register controlling the colour?, we currently use the last colour of the tx palette */ - - /* draw top of screen */ - clip.set(8*0, 8*16-1, visarea.min_y, visarea.max_y); - - if ((m_layer_ctrl & 0x80) == 0x00) - m_bgtop_tilemap->draw(screen, bitmap, clip, 0, 0); - - draw_sprites(bitmap, clip, 0x80); - - if ((m_layer_ctrl & 0x20) == 0x00) - m_tx_tilemap->draw(screen, bitmap, clip, 0, 0); - - /* draw bottom of screen */ - clip.set(8*16, 8*32-1, visarea.min_y, visarea.max_y); - - if ((m_layer_ctrl & 0x40) == 0x00) - m_bgbot_tilemap->draw(screen, bitmap, clip, 0, 0); - - draw_sprites(bitmap, clip, 0x40); - - if ((m_layer_ctrl & 0x20) == 0x00) - m_tx_tilemap->draw(screen, bitmap, clip, 0, 0); - - return 0; -} diff -Nru mame-0.242+dfsg.1/src/mame/video/apple2.h mame-0.243+dfsg.1/src/mame/video/apple2.h --- mame-0.242+dfsg.1/src/mame/video/apple2.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/apple2.h 2022-04-29 05:37:26.000000000 +0000 @@ -21,27 +21,27 @@ // construction/destruction a2_video_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - bool m_page2; - bool m_flash; - bool m_mix; - bool m_graphics; - bool m_hires; - bool m_dhires; - bool m_80col; - bool m_altcharset; - bool m_an2; - bool m_80store; - bool m_monohgr; - u8 m_GSfg, m_GSbg, m_GSborder, m_newvideo, m_monochrome, m_rgbmode; - u32 m_GSborder_colors[16], m_shr_palette[256]; + bool m_page2 = false; + bool m_flash = false; + bool m_mix = false; + bool m_graphics = false; + bool m_hires = false; + bool m_dhires = false; + bool m_80col = false; + bool m_altcharset = false; + bool m_an2 = false; + 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; + u32 m_GSborder_colors[16]{}, m_shr_palette[256]{}; std::unique_ptr m_8bit_graphics; std::unique_ptr m_hires_artifact_map; std::unique_ptr m_dhires_artifact_map; - uint8_t *m_ram_ptr, *m_aux_ptr, *m_char_ptr; - int m_char_size; + uint8_t *m_ram_ptr = nullptr, *m_aux_ptr = nullptr, *m_char_ptr = nullptr; + int m_char_size = 0; - int m_sysconfig; + int m_sysconfig = 0; DECLARE_WRITE_LINE_MEMBER(txt_w); DECLARE_WRITE_LINE_MEMBER(mix_w); diff -Nru mame-0.242+dfsg.1/src/mame/video/atarimo.h mame-0.243+dfsg.1/src/mame/video/atarimo.h --- mame-0.242+dfsg.1/src/mame/video/atarimo.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/atarimo.h 2022-04-29 05:37:26.000000000 +0000 @@ -201,7 +201,7 @@ int m_slipramsize; // total size of SLIP RAM, in entries // live state - emu_timer * m_force_update_timer; // timer for forced updating + emu_timer * m_force_update_timer = nullptr; // timer for forced updating uint32_t m_bank; // current bank number uint32_t m_xscroll; // xscroll offset uint32_t m_yscroll; // yscroll offset diff -Nru mame-0.242+dfsg.1/src/mame/video/atarirle.h mame-0.243+dfsg.1/src/mame/video/atarirle.h --- mame-0.242+dfsg.1/src/mame/video/atarirle.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/atarirle.h 2022-04-29 05:37:26.000000000 +0000 @@ -139,10 +139,10 @@ void hilite_object(bitmap_ind16 &bitmap, int hilite); // derived state - int m_bitmapwidth; // width of the full playfield bitmap - int m_bitmapheight; // height of the full playfield bitmap - int m_bitmapxmask; // x coordinate mask for the playfield bitmap - int m_bitmapymask; // y coordinate mask for the playfield bitmap + int m_bitmapwidth = 0; // width of the full playfield bitmap + int m_bitmapheight = 0; // height of the full playfield bitmap + int m_bitmapxmask = 0; // x coordinate mask for the playfield bitmap + int m_bitmapymask = 0; // y coordinate mask for the playfield bitmap rectangle m_cliprect; // clipping rectangle // masks @@ -158,22 +158,22 @@ // ROM information required_region_ptr m_rombase; // pointer to the base of the GFX ROM - int m_objectcount; // number of objects in the ROM + int m_objectcount = 0; // number of objects in the ROM std::vector m_info; // list of info records // rendering state bitmap_ind16 m_vram[2][2]; // pointers to VRAM bitmaps and backbuffers - int m_partial_scanline; // partial update scanline + int m_partial_scanline = 0; // partial update scanline // control state - u8 m_control_bits; // current control bits - u8 m_command; // current command + u8 m_control_bits = 0; // current control bits + u8 m_command = 0; // current command u16 m_checksums[256]; // checksums for each 0x40000 bytes memory_array m_ram; // tables u8 m_rle_bpp[8]; - u16 * m_rle_table[8]; + u16 * m_rle_table[8]{}; u16 m_rle_table_data[0x500]; }; diff -Nru mame-0.242+dfsg.1/src/mame/video/avgdvg.h mame-0.243+dfsg.1/src/mame/video/avgdvg.h --- mame-0.242+dfsg.1/src/mame/video/avgdvg.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/avgdvg.h 2022-04-29 05:37:26.000000000 +0000 @@ -168,17 +168,17 @@ int avg_common_strobe2(); int avg_common_strobe3(); - int m_xmax, m_ymax; + int m_xmax = 0, m_ymax = 0; - u8 m_dvy12; - u16 m_timer; + u8 m_dvy12 = 0; + u16 m_timer = 0; - u8 m_int_latch; - u8 m_bin_scale; - u8 m_color; + u8 m_int_latch = 0; + u8 m_bin_scale = 0; + u8 m_color = 0; - u16 m_xdac_xor; - u16 m_ydac_xor; + u16 m_xdac_xor = 0; + u16 m_ydac_xor = 0; }; @@ -215,11 +215,11 @@ required_shared_ptr m_colorram; required_region_ptr m_bank_region; - u8 m_enspkl; - u8 m_spkl_shift; - u8 m_map; + u8 m_enspkl = 0; + u8 m_spkl_shift = 0; + u8 m_map = 0; - u16 m_lst; + u16 m_lst = 0; }; @@ -270,14 +270,14 @@ virtual int handler_7() override; private: - u16 m_hst; - u16 m_lst; - u16 m_izblank; - - s32 m_clipx_min; - s32 m_clipy_min; - s32 m_clipx_max; - s32 m_clipy_max; + u16 m_hst = 0; + u16 m_lst = 0; + u16 m_izblank = 0; + + s32 m_clipx_min = 0; + s32 m_clipy_min = 0; + s32 m_clipx_max = 0; + s32 m_clipy_max = 0; }; diff -Nru mame-0.242+dfsg.1/src/mame/video/bfm_adr2.h mame-0.243+dfsg.1/src/mame/video/bfm_adr2.h --- mame-0.242+dfsg.1/src/mame/video/bfm_adr2.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/bfm_adr2.h 2022-04-29 05:37:26.000000000 +0000 @@ -47,23 +47,23 @@ virtual void device_add_mconfig(machine_config &config) override; private: - int m_screen_page_reg; // access/display select - int m_c101; - int m_rx; - bool m_vbl_triggered; // flag, VBL IRQ triggered - bool m_acia_triggered; // flag, ACIA receive IRQ - - uint8_t m_adder_ram[0xE80]; // normal RAM - uint8_t m_screen_ram[2][0x1180]; // paged display RAM + int m_screen_page_reg = 0; // access/display select + int m_c101 = 0; + int m_rx = 0; + bool m_vbl_triggered = 0; // flag, VBL IRQ triggered + bool m_acia_triggered = 0; // flag, ACIA receive IRQ + + uint8_t m_adder_ram[0xE80]{}; // normal RAM + uint8_t m_screen_ram[2][0x1180]{}; // paged display RAM - tilemap_t *m_tilemap0; // tilemap screen0 - tilemap_t *m_tilemap1; // tilemap screen1 + tilemap_t *m_tilemap0 = nullptr; // tilemap screen0 + tilemap_t *m_tilemap1 = nullptr; // tilemap screen1 - bool m_data_from_sc2; - bool m_data_to_sc2; + bool m_data_from_sc2 = false; + bool m_data_to_sc2 = false; - uint8_t m_adder2_data; - uint8_t m_sc2data; + uint8_t m_adder2_data = 0; + uint8_t m_sc2data = 0; optional_device m_cpu; diff -Nru mame-0.242+dfsg.1/src/mame/video/bl_handhelds_lcdc.h mame-0.243+dfsg.1/src/mame/video/bl_handhelds_lcdc.h --- mame-0.242+dfsg.1/src/mame/video/bl_handhelds_lcdc.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/bl_handhelds_lcdc.h 2022-04-29 05:37:26.000000000 +0000 @@ -25,12 +25,12 @@ virtual void device_reset() override; private: - u8 m_displaybuffer[256 * 256 * 2]; - u16 m_posx, m_posy; - u16 m_posminx, m_posmaxx; - u16 m_posminy, m_posmaxy; - u8 m_command; - u8 m_commandstep; + u8 m_displaybuffer[256 * 256 * 2]{}; + u16 m_posx = 0, m_posy = 0; + u16 m_posminx = 0, m_posmaxx = 0; + u16 m_posminy = 0, m_posmaxy = 0; + u8 m_command = 0; + u8 m_commandstep = 0; }; diff -Nru mame-0.242+dfsg.1/src/mame/video/bottom9.cpp mame-0.243+dfsg.1/src/mame/video/bottom9.cpp --- mame-0.242+dfsg.1/src/mame/video/bottom9.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/bottom9.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,82 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Nicola Salmoria - -#include "emu.h" -#include "includes/bottom9.h" -#include "screen.h" - - -/*************************************************************************** - - Callbacks for the K052109 - -***************************************************************************/ - -static const int layer_colorbase[] = { 0 / 16, 0 / 16, 256 / 16 }; - -K052109_CB_MEMBER(bottom9_state::tile_callback) -{ - *code |= (*color & 0x3f) << 8; - *color = layer_colorbase[layer] + ((*color & 0xc0) >> 6); -} - - -/*************************************************************************** - - Callbacks for the K051960 - -***************************************************************************/ - -K051960_CB_MEMBER(bottom9_state::sprite_callback) -{ - enum { sprite_colorbase = 512 / 16 }; - - /* bit 4 = priority over zoom (0 = have priority) */ - /* bit 5 = priority over B (1 = have priority) */ - *priority = 0; - if ( *color & 0x10) *priority |= GFX_PMASK_1; - if (~*color & 0x20) *priority |= GFX_PMASK_2; - - *color = sprite_colorbase + (*color & 0x0f); -} - - -/*************************************************************************** - - Callbacks for the K051316 - -***************************************************************************/ - -K051316_CB_MEMBER(bottom9_state::zoom_callback) -{ - enum { zoom_colorbase = 768 / 16 }; - - *flags = (*color & 0x40) ? TILE_FLIPX : 0; - *code |= ((*color & 0x03) << 8); - *color = zoom_colorbase + ((*color & 0x3c) >> 2); -} - - -/*************************************************************************** - - Display refresh - -***************************************************************************/ - -uint32_t bottom9_state::screen_update_bottom9(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - m_k052109->tilemap_update(); - - /* note: FIX layer is not used */ - bitmap.fill(layer_colorbase[1], cliprect); - screen.priority().fill(0, cliprect); - -// if (m_video_enable) - { - m_k051316->zoom_draw(screen, bitmap, cliprect, 0, 1); - m_k052109->tilemap_draw(screen, bitmap, cliprect, 2, 0, 2); - m_k051960->k051960_sprites_draw(bitmap, cliprect, screen.priority(), -1, -1); - m_k052109->tilemap_draw(screen, bitmap, cliprect, 1, 0, 0); - } - return 0; -} diff -Nru mame-0.242+dfsg.1/src/mame/video/buggychl.cpp mame-0.243+dfsg.1/src/mame/video/buggychl.cpp --- mame-0.242+dfsg.1/src/mame/video/buggychl.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/buggychl.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,234 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Ernesto Corvi, Nicola Salmoria -#include "emu.h" -#include "includes/buggychl.h" - - -void buggychl_state::buggychl_palette(palette_device &palette) const -{ - // arbitrary blue shading for the sky, estimation - for (int i = 0; i < 128; i++) - palette.set_pen_color(i + 128, rgb_t(0, 240 - i, 255)); -} - -void buggychl_state::video_start() -{ - m_screen->register_screen_bitmap(m_tmp_bitmap1); - m_screen->register_screen_bitmap(m_tmp_bitmap2); - - save_item(NAME(m_tmp_bitmap1)); - save_item(NAME(m_tmp_bitmap2)); - - m_gfxdecode->gfx(0)->set_source(m_charram); -} - - - -void buggychl_state::buggychl_chargen_w(offs_t offset, uint8_t data) -{ - if (m_charram[offset] != data) - { - m_charram[offset] = data; - m_gfxdecode->gfx(0)->mark_dirty((offset / 8) & 0xff); - } -} - -void buggychl_state::buggychl_sprite_lookup_bank_w(uint8_t data) -{ - m_sl_bank = (data & 0x10) << 8; -} - -void buggychl_state::buggychl_sprite_lookup_w(offs_t offset, uint8_t data) -{ - m_sprite_lookup[offset + m_sl_bank] = data; -} - -void buggychl_state::buggychl_ctrl_w(uint8_t data) -{ -/* - bit7 = lamp - bit6 = lockout - bit4 = OJMODE - bit3 = SKY OFF - bit2 = /SN3OFF - bit1 = HINV - bit0 = VINV -*/ - - flip_screen_y_set(data & 0x01); - flip_screen_x_set(data & 0x02); - - m_bg_clip_on = data & 0x04; - m_sky_on = data & 0x08; - - m_sprite_color_base = (data & 0x10) ? 1 * 16 : 3 * 16; - - machine().bookkeeping().coin_lockout_global_w((~data & 0x40) >> 6); - m_led[0] = BIT(~data, 7); -} - -void buggychl_state::buggychl_bg_scrollx_w(uint8_t data) -{ - m_bg_scrollx = -(data - 0x12); -} - - -void buggychl_state::draw_sky( bitmap_ind16 &bitmap, const rectangle &cliprect ) -{ - for (int y = 0; y < 256; y++) - for (int x = 0; x < 256; x++) - bitmap.pix(y, x) = 128 + x / 2; -} - - -void buggychl_state::draw_bg( bitmap_ind16 &bitmap, const rectangle &cliprect ) -{ - int offs; - int scroll[256]; - - /* prevent wraparound */ - rectangle clip = cliprect; - // enable clipping if on (title screen disable this to cover all of the area) - if(m_bg_clip_on) - { - if (flip_screen_x()) clip.min_x += 8*8; - else clip.max_x -= 8*8; - } - - for (offs = 0; offs < 0x400; offs++) - { - int code = m_videoram[0x400 + offs]; - - int sx = offs % 32; - int sy = offs / 32; - - if (flip_screen_x()) - sx = 31 - sx; - if (flip_screen_y()) - sy = 31 - sy; - - m_gfxdecode->gfx(0)->opaque(m_tmp_bitmap1,m_tmp_bitmap1.cliprect(), - code, - 2, - flip_screen_x(),flip_screen_y(), - 8*sx,8*sy); - } - - /* first copy to a temp bitmap doing column scroll */ - for (offs = 0; offs < 256; offs++) - scroll[offs] = -m_scrollv[offs / 8]; - - copyscrollbitmap(m_tmp_bitmap2, m_tmp_bitmap1, 1, &m_bg_scrollx, 256, scroll, m_tmp_bitmap2.cliprect()); - - /* then copy to the screen doing row scroll */ - for (offs = 0; offs < 256; offs++) - scroll[offs] = -m_scrollh[offs]; - - copyscrollbitmap_trans(bitmap, m_tmp_bitmap2, 256, scroll, 0, nullptr, clip, 32); -} - - -void buggychl_state::draw_fg( bitmap_ind16 &bitmap, const rectangle &cliprect ) -{ - int offs; - - for (offs = 0; offs < 0x400; offs++) - { - int sx = offs % 32; - int sy = offs / 32; - int flipx = flip_screen_x(); - int flipy = flip_screen_y(); - - int code = m_videoram[offs]; - - if (flipx) - sx = 31 - sx; - if (flipy) - sy = 31 - sy; - - m_gfxdecode->gfx(0)->transpen(bitmap,cliprect, - code, - 0, - flipx,flipy, - 8*sx,8*sy, - 0); - } -} - - -void buggychl_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ) -{ - g_profiler.start(PROFILER_USER1); - - uint8_t const *const gfx = memregion("gfx2")->base(); - for (int offs = 0; offs < m_spriteram.bytes(); offs += 4) - { - int sx = m_spriteram[offs + 3] - ((m_spriteram[offs + 2] & 0x80) << 1); - int sy = 256 - 64 - m_spriteram[offs] + ((m_spriteram[offs + 1] & 0x80) << 1); - int flipy = m_spriteram[offs + 1] & 0x40; - int zoom = m_spriteram[offs + 1] & 0x3f; - uint8_t const *const zoomy_rom = gfx + (zoom << 6); - uint8_t const *const zoomx_rom = gfx + 0x2000 + (zoom << 3); - - uint8_t const *const lookup = m_sprite_lookup + ((m_spriteram[offs + 2] & 0x7f) << 6); - - for (int y = 0; y < 64; y++) - { - int dy = flip_screen_y() ? (255 - sy - y) : (sy + y); - - if ((dy & ~0xff) == 0) - { - int charline, base_pos; - - charline = zoomy_rom[y] & 0x07; - base_pos = zoomy_rom[y] & 0x38; - if (flipy) - base_pos ^= 0x38; - - int px = 0; - for (int ch = 0; ch < 4; ch++) - { - int pos = base_pos + 2 * ch; - int code = 8 * (lookup[pos] | ((lookup[pos + 1] & 0x07) << 8)); - int realflipy = (lookup[pos + 1] & 0x80) ? !flipy : flipy; - code += (realflipy ? (charline ^ 7) : charline); - uint8_t const *const pendata = m_gfxdecode->gfx(1)->get_data(code); - - for (int x = 0; x < 16; x++) - { - int col = pendata[x]; - if (col) - { - int dx = flip_screen_x() ? (255 - sx - px) : (sx + px); - if ((dx & ~0xff) == 0) - bitmap.pix(dy, dx) = m_sprite_color_base + col; - } - - /* the following line is almost certainly wrong */ - if (zoomx_rom[7 - (2 * ch + x / 8)] & (1 << (x & 7))) - px++; - } - } - } - } - } - - g_profiler.stop(); -} - - -uint32_t buggychl_state::screen_update_buggychl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - if (m_sky_on) - draw_sky(bitmap, cliprect); - else - bitmap.fill(0x20, cliprect); // stage 3 disables sky, wants background pen to be blue - - draw_bg(bitmap, cliprect); - - draw_sprites(bitmap, cliprect); - - draw_fg(bitmap, cliprect); - - return 0; -} diff -Nru mame-0.242+dfsg.1/src/mame/video/cbasebal.cpp mame-0.243+dfsg.1/src/mame/video/cbasebal.cpp --- mame-0.242+dfsg.1/src/mame/video/cbasebal.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/cbasebal.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,179 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Nicola Salmoria -#include "emu.h" -#include "includes/cbasebal.h" - - -/*************************************************************************** - - Callbacks for the TileMap code - -***************************************************************************/ - -TILE_GET_INFO_MEMBER(cbasebal_state::get_bg_tile_info) -{ - uint8_t attr = m_scrollram[2 * tile_index + 1]; - tileinfo.set(1, - m_scrollram[2 * tile_index] + ((attr & 0x07) << 8) + 0x800 * m_tilebank, - (attr & 0xf0) >> 4, - (attr & 0x08) ? TILE_FLIPX : 0); -} - -TILE_GET_INFO_MEMBER(cbasebal_state::get_fg_tile_info) -{ - uint8_t attr = m_textram[tile_index + 0x800]; - tileinfo.set(0, - m_textram[tile_index] + ((attr & 0xf0) << 4), - attr & 0x07, - (attr & 0x08) ? TILE_FLIPX : 0); -} - - - -/*************************************************************************** - - Start the video hardware emulation. - -***************************************************************************/ - -void cbasebal_state::video_start() -{ - m_textram = std::make_unique(0x1000); - m_scrollram = std::make_unique(0x1000); - - m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(cbasebal_state::get_bg_tile_info)), TILEMAP_SCAN_ROWS, 16, 16, 64, 32); - m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(cbasebal_state::get_fg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); - - m_fg_tilemap->set_transparent_pen(3); - - save_pointer(NAME(m_textram), 0x1000); - save_pointer(NAME(m_scrollram), 0x1000); -} - - - -/*************************************************************************** - - Memory handlers - -***************************************************************************/ - -void cbasebal_state::cbasebal_textram_w(offs_t offset, uint8_t data) -{ - m_textram[offset] = data; - m_fg_tilemap->mark_tile_dirty(offset & 0x7ff); -} - -uint8_t cbasebal_state::cbasebal_textram_r(offs_t offset) -{ - return m_textram[offset]; -} - -void cbasebal_state::cbasebal_scrollram_w(offs_t offset, uint8_t data) -{ - m_scrollram[offset] = data; - m_bg_tilemap->mark_tile_dirty(offset / 2); -} - -uint8_t cbasebal_state::cbasebal_scrollram_r(offs_t offset) -{ - return m_scrollram[offset]; -} - -void cbasebal_state::cbasebal_gfxctrl_w(uint8_t data) -{ - /* bit 0 is unknown - toggles continuously */ - - /* bit 1 is flip screen */ - m_flipscreen = data & 0x02; - machine().tilemap().set_flip_all(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); - - /* bit 2 is unknown - unused? */ - - /* bit 3 is tile bank */ - if (m_tilebank != ((data & 0x08) >> 3)) - { - m_tilebank = (data & 0x08) >> 3; - m_bg_tilemap->mark_all_dirty(); - } - - /* bit 4 is sprite bank */ - m_spritebank = (data & 0x10) >> 4; - - /* bits 5 is text enable */ - m_text_on = ~data & 0x20; - - /* bits 6-7 are bg/sprite enable (don't know which is which) */ - m_bg_on = ~data & 0x40; - m_obj_on = ~data & 0x80; - - /* other bits unknown, but used */ -} - -void cbasebal_state::cbasebal_scrollx_w(offs_t offset, uint8_t data) -{ - m_scroll_x[offset] = data; - m_bg_tilemap->set_scrollx(0, m_scroll_x[0] + 256 * m_scroll_x[1]); -} - -void cbasebal_state::cbasebal_scrolly_w(offs_t offset, uint8_t data) -{ - m_scroll_y[offset] = data; - m_bg_tilemap->set_scrolly(0, m_scroll_y[0] + 256 * m_scroll_y[1]); -} - - - -/*************************************************************************** - - Display refresh - -***************************************************************************/ - -void cbasebal_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ) -{ - uint8_t *spriteram = m_spriteram; - int offs, sx, sy; - - /* the last entry is not a sprite, we skip it otherwise spang shows a bubble */ - /* moving diagonally across the screen */ - for (offs = m_spriteram.bytes() - 8; offs >= 0; offs -= 4) - { - int code = spriteram[offs]; - int attr = spriteram[offs + 1]; - int color = attr & 0x07; - int flipx = attr & 0x08; - sx = spriteram[offs + 3] + ((attr & 0x10) << 4); - sy = ((spriteram[offs + 2] + 8) & 0xff) - 8; - code += (attr & 0xe0) << 3; - code += m_spritebank * 0x800; - - if (m_flipscreen) - { - sx = 496 - sx; - sy = 240 - sy; - flipx = !flipx; - } - - m_gfxdecode->gfx(2)->transpen(bitmap,cliprect, - code, - color, - flipx,m_flipscreen, - sx,sy,15); - } -} - -uint32_t cbasebal_state::screen_update_cbasebal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - if (m_bg_on) - m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - else - bitmap.fill(768, cliprect); - - if (m_obj_on) - draw_sprites(bitmap, cliprect); - - if (m_text_on) - m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - return 0; -} diff -Nru mame-0.242+dfsg.1/src/mame/video/contra.cpp mame-0.243+dfsg.1/src/mame/video/contra.cpp --- mame-0.242+dfsg.1/src/mame/video/contra.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/contra.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,300 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Carlos A. Lozano, Phil Stroffolino -/*************************************************************************** - - video/contra.c - -***************************************************************************/ - -#include "emu.h" -#include "includes/contra.h" - - -/*************************************************************************** -** -** Contra has palette RAM, but it also has four lookup table PROMs -** -** 0 sprites #0 -** 1 tiles #0 -** 2 sprites #1 -** 3 tiles #1 -** -***************************************************************************/ - -void contra_state::contra_palette(palette_device &palette) const -{ - uint8_t const *const color_prom = memregion("proms")->base(); - - for (int chip = 0; chip < 2; chip++) - { - for (int pal = 0; pal < 8; pal++) - { - int const clut = (chip << 1) | (pal & 1); - - for (int i = 0; i < 0x100; i++) - { - uint8_t ctabentry; - - if (((pal & 0x01) == 0) && (color_prom[(clut << 8) | i] == 0)) - ctabentry = 0; - else - ctabentry = (pal << 4) | (color_prom[(clut << 8) | i] & 0x0f); - - palette.set_pen_indirect((chip << 11) | (pal << 8) | i, ctabentry); - } - } - } -} - - - -/*************************************************************************** - - Callbacks for the TileMap code - -***************************************************************************/ - -TILE_GET_INFO_MEMBER(contra_state::get_fg_tile_info) -{ - uint8_t ctrl_3 = m_k007121_1->ctrlram_r(3); - uint8_t ctrl_4 = m_k007121_1->ctrlram_r(4); - uint8_t ctrl_5 = m_k007121_1->ctrlram_r(5); - uint8_t ctrl_6 = m_k007121_1->ctrlram_r(6); - int attr = m_fg_cram[tile_index]; - int bit0 = (ctrl_5 >> 0) & 0x03; - int bit1 = (ctrl_5 >> 2) & 0x03; - int bit2 = (ctrl_5 >> 4) & 0x03; - int bit3 = (ctrl_5 >> 6) & 0x03; - int bank = ((attr & 0x80) >> 7) | - ((attr >> (bit0 + 2)) & 0x02) | - ((attr >> (bit1 + 1)) & 0x04) | - ((attr >> (bit2 )) & 0x08) | - ((attr >> (bit3 - 1)) & 0x10) | - ((ctrl_3 & 0x01) << 5); - int mask = (ctrl_4 & 0xf0) >> 4; - - bank = (bank & ~(mask << 1)) | ((ctrl_4 & mask) << 1); - - tileinfo.set(0, - m_fg_vram[tile_index] + bank * 256, - ((ctrl_6 & 0x30) * 2 + 16) + (attr & 7), - 0); -} - -TILE_GET_INFO_MEMBER(contra_state::get_bg_tile_info) -{ - uint8_t ctrl_3 = m_k007121_2->ctrlram_r(3); - uint8_t ctrl_4 = m_k007121_2->ctrlram_r(4); - uint8_t ctrl_5 = m_k007121_2->ctrlram_r(5); - uint8_t ctrl_6 = m_k007121_2->ctrlram_r(6); - int attr = m_bg_cram[tile_index]; - int bit0 = (ctrl_5 >> 0) & 0x03; - int bit1 = (ctrl_5 >> 2) & 0x03; - int bit2 = (ctrl_5 >> 4) & 0x03; - int bit3 = (ctrl_5 >> 6) & 0x03; - int bank = ((attr & 0x80) >> 7) | - ((attr >> (bit0 + 2)) & 0x02) | - ((attr >> (bit1 + 1)) & 0x04) | - ((attr >> (bit2 )) & 0x08) | - ((attr >> (bit3 - 1)) & 0x10) | - ((ctrl_3 & 0x01) << 5); - int mask = (ctrl_4 & 0xf0) >> 4; - - // 2009-12 FP: TO BE VERIFIED - old code used ctrl4 from chip 0?!? - bank = (bank & ~(mask << 1)) | ((ctrl_4 & mask) << 1); - - tileinfo.set(1, - m_bg_vram[tile_index] + bank * 256, - ((ctrl_6 & 0x30) * 2 + 16) + (attr & 7), - 0); -} - -TILE_GET_INFO_MEMBER(contra_state::get_tx_tile_info) -{ - uint8_t ctrl_5 = m_k007121_1->ctrlram_r(5); - uint8_t ctrl_6 = m_k007121_1->ctrlram_r(6); - int attr = m_tx_cram[tile_index]; - int bit0 = (ctrl_5 >> 0) & 0x03; - int bit1 = (ctrl_5 >> 2) & 0x03; - int bit2 = (ctrl_5 >> 4) & 0x03; - int bit3 = (ctrl_5 >> 6) & 0x03; - int bank = ((attr & 0x80) >> 7) | - ((attr >> (bit0 + 2)) & 0x02) | - ((attr >> (bit1 + 1)) & 0x04) | - ((attr >> (bit2 )) & 0x08) | - ((attr >> (bit3 - 1)) & 0x10); - - tileinfo.set(0, - m_tx_vram[tile_index] + bank * 256, - ((ctrl_6 & 0x30) * 2 + 16) + (attr & 7), - 0); -} - - -/*************************************************************************** - - Start the video hardware emulation. - -***************************************************************************/ - -void contra_state::video_start() -{ - m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(contra_state::get_bg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); - m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(contra_state::get_fg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); - m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(contra_state::get_tx_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); - - m_buffered_spriteram = std::make_unique(0x800); - m_buffered_spriteram_2 = std::make_unique(0x800); - - m_bg_clip = m_screen->visible_area(); - m_bg_clip.min_x += 40; - - m_fg_clip = m_bg_clip; - - m_tx_clip = m_screen->visible_area(); - m_tx_clip.max_x = 39; - m_tx_clip.min_x = 0; - - m_fg_tilemap->set_transparent_pen(0); - - save_pointer(NAME(m_buffered_spriteram), 0x800); - save_pointer(NAME(m_buffered_spriteram_2), 0x800); -} - - -/*************************************************************************** - - Memory handlers - -***************************************************************************/ - -void contra_state::contra_fg_vram_w(offs_t offset, uint8_t data) -{ - m_fg_vram[offset] = data; - m_fg_tilemap->mark_tile_dirty(offset); -} - -void contra_state::contra_fg_cram_w(offs_t offset, uint8_t data) -{ - m_fg_cram[offset] = data; - m_fg_tilemap->mark_tile_dirty(offset); -} - -void contra_state::contra_bg_vram_w(offs_t offset, uint8_t data) -{ - m_bg_vram[offset] = data; - m_bg_tilemap->mark_tile_dirty(offset); -} - -void contra_state::contra_bg_cram_w(offs_t offset, uint8_t data) -{ - m_bg_cram[offset] = data; - m_bg_tilemap->mark_tile_dirty(offset); -} - -void contra_state::contra_text_vram_w(offs_t offset, uint8_t data) -{ - m_tx_vram[offset] = data; - m_tx_tilemap->mark_tile_dirty(offset); -} - -void contra_state::contra_text_cram_w(offs_t offset, uint8_t data) -{ - m_tx_cram[offset] = data; - m_tx_tilemap->mark_tile_dirty(offset); -} - -void contra_state::contra_K007121_ctrl_0_w(offs_t offset, uint8_t data) -{ - uint8_t ctrl_6 = m_k007121_1->ctrlram_r(6); - - if (offset == 3) - { - if ((data & 0x8) == 0) - memcpy(m_buffered_spriteram.get(), m_spriteram + 0x800, 0x800); - else - memcpy(m_buffered_spriteram.get(), m_spriteram, 0x800); - } - - if (offset == 6) - { - if (ctrl_6 != data) - m_fg_tilemap->mark_all_dirty(); - } - - if (offset == 7) - m_fg_tilemap->set_flip((data & 0x08) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); - - m_k007121_1->ctrl_w(offset, data); -} - -void contra_state::contra_K007121_ctrl_1_w(offs_t offset, uint8_t data) -{ - uint8_t ctrl_6 = m_k007121_2->ctrlram_r(6); - - if (offset == 3) - { - if ((data & 0x8) == 0) - memcpy(m_buffered_spriteram_2.get(), m_spriteram_2 + 0x800, 0x800); - else - memcpy(m_buffered_spriteram_2.get(), m_spriteram_2 + 0x000, 0x800); - } - if (offset == 6) - { - if (ctrl_6 != data ) - m_bg_tilemap->mark_all_dirty(); - } - if (offset == 7) - m_bg_tilemap->set_flip((data & 0x08) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); - - m_k007121_2->ctrl_w(offset, data); -} - - - -/*************************************************************************** - - Display Refresh - -***************************************************************************/ - -void contra_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, int bank ) -{ - k007121_device *k007121 = bank ? m_k007121_2 : m_k007121_1; - int base_color = (k007121->ctrlram_r(6) & 0x30) * 2; - const uint8_t *source; - - if (bank == 0) - source = m_buffered_spriteram.get(); - else - source = m_buffered_spriteram_2.get(); - - k007121->sprites_draw(bitmap, cliprect, m_gfxdecode->gfx(bank), *m_palette, source, base_color, 40, 0, priority_bitmap, (uint32_t)-1); -} - -uint32_t contra_state::screen_update_contra(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - uint8_t ctrl_1_0 = m_k007121_1->ctrlram_r(0); - uint8_t ctrl_1_2 = m_k007121_1->ctrlram_r(2); - uint8_t ctrl_2_0 = m_k007121_2->ctrlram_r(0); - uint8_t ctrl_2_2 = m_k007121_2->ctrlram_r(2); - rectangle bg_finalclip = m_bg_clip; - rectangle fg_finalclip = m_fg_clip; - rectangle tx_finalclip = m_tx_clip; - - bg_finalclip &= cliprect; - fg_finalclip &= cliprect; - tx_finalclip &= cliprect; - - m_fg_tilemap->set_scrollx(0, ctrl_1_0 - 40); - m_fg_tilemap->set_scrolly(0, ctrl_1_2); - m_bg_tilemap->set_scrollx(0, ctrl_2_0 - 40); - m_bg_tilemap->set_scrolly(0, ctrl_2_2); - - m_bg_tilemap->draw(screen, bitmap, bg_finalclip, 0 ,0); - m_fg_tilemap->draw(screen, bitmap, fg_finalclip, 0 ,0); - draw_sprites(bitmap,cliprect, screen.priority(), 0); - draw_sprites(bitmap,cliprect, screen.priority(), 1); - m_tx_tilemap->draw(screen, bitmap, tx_finalclip, 0 ,0); - return 0; -} diff -Nru mame-0.242+dfsg.1/src/mame/video/crgolf.cpp mame-0.243+dfsg.1/src/mame/video/crgolf.cpp --- mame-0.242+dfsg.1/src/mame/video/crgolf.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/crgolf.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,131 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Aaron Giles -/*************************************************************************** - - Kitco Crowns Golf hardware - -***************************************************************************/ - -#include "emu.h" -#include "includes/crgolf.h" - - -#define NUM_PENS (0x20) -#define VIDEORAM_SIZE (0x2000 * 3) - - - - - -/************************************* - * - * Video startup - * - *************************************/ - -void crgolf_state::crgolf_palette(palette_device &palette) const -{ - uint8_t const *const prom = memregion("proms")->base(); - - for (offs_t offs = 0; offs < NUM_PENS; offs++) - { - int bit0, bit1, bit2; - - uint8_t const data = prom[offs]; - - // red component - bit0 = BIT(data, 0); - bit1 = BIT(data, 1); - bit2 = BIT(data, 2); - int const r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - // green component - bit0 = BIT(data, 3); - bit1 = BIT(data, 4); - bit2 = BIT(data, 5); - int const g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - // blue component - bit0 = BIT(data, 6); - bit1 = BIT(data, 7); - int const b = 0x4f * bit0 + 0xa8 * bit1; - - m_palette->set_pen_color(offs, r, g, b); - } -} - -void crgolf_state::mastrglf_palette(palette_device &palette) const -{ -} - -/************************************* - * - * Video update - * - *************************************/ - -uint32_t crgolf_state::screen_update_crgolf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - int flip = m_screen_flip; - - /* for each byte in the video RAM */ - for (offs_t offs = 0; offs < VIDEORAM_SIZE / 3; offs++) - { - uint8_t y = (offs & 0x1fe0) >> 5; - uint8_t x = (offs & 0x001f) << 3; - - uint8_t data_a0 = m_videoram_a[0x2000 | offs]; - uint8_t data_a1 = m_videoram_a[0x0000 | offs]; - uint8_t data_a2 = m_videoram_a[0x4000 | offs]; - uint8_t data_b0 = m_videoram_b[0x2000 | offs]; - uint8_t data_b1 = m_videoram_b[0x0000 | offs]; - uint8_t data_b2 = m_videoram_b[0x4000 | offs]; - - if (flip) - { - y = ~y; - x = ~x; - } - - /* for each pixel in the byte */ - for (int i = 0; i < 8; i++) - { - offs_t color; - uint8_t data_b = 0; - uint8_t data_a = 0; - - if (!m_screena_enable) - data_a = ((data_a0 & 0x80) >> 7) | ((data_a1 & 0x80) >> 6) | ((data_a2 & 0x80) >> 5); - - if (!m_screenb_enable) - data_b = ((data_b0 & 0x80) >> 7) | ((data_b1 & 0x80) >> 6) | ((data_b2 & 0x80) >> 5); - - /* screen A has priority over B */ - if (data_a) - color = data_a; - else - color = data_b | 0x08; - - /* add HI bit if enabled */ - if (m_color_select) - color = color | 0x10; - - bitmap.pix(y, x) = color; - - /* next pixel */ - data_a0 = data_a0 << 1; - data_a1 = data_a1 << 1; - data_a2 = data_a2 << 1; - data_b0 = data_b0 << 1; - data_b1 = data_b1 << 1; - data_b2 = data_b2 << 1; - - if (flip) - x = x - 1; - else - x = x + 1; - } - } - - return 0; -} diff -Nru mame-0.242+dfsg.1/src/mame/video/decbac06.h mame-0.243+dfsg.1/src/mame/video/decbac06.h --- mame-0.242+dfsg.1/src/mame/video/decbac06.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/decbac06.h 2022-04-29 05:37:26.000000000 +0000 @@ -95,8 +95,8 @@ std::unique_ptr m_pf_rowscroll; std::unique_ptr m_pf_colscroll; - tilemap_t* m_pf8x8_tilemap[3]; - tilemap_t* m_pf16x16_tilemap[3]; + tilemap_t* m_pf8x8_tilemap[3]{}; + tilemap_t* m_pf16x16_tilemap[3]{}; int m_tile_region_8; int m_tile_region_16; @@ -110,7 +110,7 @@ u16 m_pf_control_1[8]; int m_rambank; // external connection? - bool m_flip_screen; + bool m_flip_screen = false; protected: virtual void device_start() override; diff -Nru mame-0.242+dfsg.1/src/mame/video/deckarn.h mame-0.243+dfsg.1/src/mame/video/deckarn.h --- mame-0.242+dfsg.1/src/mame/video/deckarn.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/deckarn.h 2022-04-29 05:37:26.000000000 +0000 @@ -24,7 +24,7 @@ private: colpri_cb_delegate m_colpri_cb; - bool m_flip_screen; + bool m_flip_screen = false; }; DECLARE_DEVICE_TYPE(DECO_KARNOVSPRITES, deco_karnovsprites_device) diff -Nru mame-0.242+dfsg.1/src/mame/video/decmxc06.h mame-0.243+dfsg.1/src/mame/video/decmxc06.h --- mame-0.242+dfsg.1/src/mame/video/decmxc06.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/decmxc06.h 2022-04-29 05:37:26.000000000 +0000 @@ -35,7 +35,7 @@ u32 pri_mask = 0; }; colpri_cb_delegate m_colpri_cb; - bool m_flip_screen; + bool m_flip_screen = false; std::unique_ptr m_spritelist; }; diff -Nru mame-0.242+dfsg.1/src/mame/video/deco16ic.h mame-0.243+dfsg.1/src/mame/video/deco16ic.h --- mame-0.242+dfsg.1/src/mame/video/deco16ic.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/deco16ic.h 2022-04-29 05:37:26.000000000 +0000 @@ -134,8 +134,8 @@ const u16 *m_pf1_rowscroll_ptr, *m_pf2_rowscroll_ptr; - tilemap_t *m_pf1_tilemap_16x16, *m_pf2_tilemap_16x16; - tilemap_t *m_pf1_tilemap_8x8, *m_pf2_tilemap_8x8; + tilemap_t *m_pf1_tilemap_16x16 = nullptr, *m_pf2_tilemap_16x16 = nullptr; + tilemap_t *m_pf1_tilemap_8x8 = nullptr, *m_pf2_tilemap_8x8 = nullptr; deco16_tile_cb_delegate m_tile_cb; diff -Nru mame-0.242+dfsg.1/src/mame/video/decospr.h mame-0.243+dfsg.1/src/mame/video/decospr.h --- mame-0.242+dfsg.1/src/mame/video/decospr.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/decospr.h 2022-04-29 05:37:26.000000000 +0000 @@ -54,10 +54,10 @@ decospr_pri_cb_delegate m_pri_cb; decospr_col_cb_delegate m_col_cb; bitmap_ind16 m_sprite_bitmap;// optional sprite bitmap (should be INDEXED16) - bool m_alt_format; - uint16_t m_pixmask; - uint16_t m_raw_shift; - bool m_flip_screen; + bool m_alt_format = false; + uint16_t m_pixmask = 0; + uint16_t m_raw_shift = 0; + bool m_flip_screen = false; // used by various bootleg / clone chips. bool m_is_bootleg; // used by various bootlegs (disables masking of sprite tile number when multi-sprite is used) diff -Nru mame-0.242+dfsg.1/src/mame/video/dgn_beta.cpp mame-0.243+dfsg.1/src/mame/video/dgn_beta.cpp --- mame-0.242+dfsg.1/src/mame/video/dgn_beta.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/dgn_beta.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -96,7 +96,7 @@ #define IsTextMode (m_GCtrl & GCtrlChrGfx) ? 1 : 0 // Is this text mode ? #define IsGfx16 ((~m_GCtrl & GCtrlChrGfx) && (~m_GCtrl & GCtrlControl)) ? 1 : 0 // is this 320x256x16bpp mode #define IsGfx2 ((m_GCtrl & GCtrlHiLo) && (~m_GCtrl & GCtrlFS)) ? 1 : 0 // Is this a 2 colour mode -#define SWChar (m_GCtrl & GCtrlSWChar)>>1 // Swchar bit +#define SWChar BIT(m_GCtrl, GCtrlSWChar) // Swchar bit MC6845_UPDATE_ROW( dgn_beta_state::crtc_update_row ) { @@ -120,7 +120,7 @@ int FlashChar=(attr & 0x80) >> 7; // Flashing char // underline is active for character set 0, on character row 9 - int ULActive=(UnderLine && (ra==9) && ~SWChar); + int ULActive=(UnderLine && (ra==9) && !SWChar); /* Invert foreground and background if flashing char and flash active */ int Invert=(FlashChar & m_FlashBit); diff -Nru mame-0.242+dfsg.1/src/mame/video/dynax_blitter_rev2.h mame-0.243+dfsg.1/src/mame/video/dynax_blitter_rev2.h --- mame-0.242+dfsg.1/src/mame/video/dynax_blitter_rev2.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/dynax_blitter_rev2.h 2022-04-29 05:37:26.000000000 +0000 @@ -61,12 +61,12 @@ devcb_write_line m_ready_cb; // internal registers - u8 m_blit_pen; - u8 m_blit_wrap_enable; - u8 m_blit_x; - u8 m_blit_y; - u8 m_blit_flags; - u32 m_blit_src; + u8 m_blit_pen = 0; + u8 m_blit_wrap_enable = 0; + u8 m_blit_x = 0; + u8 m_blit_y = 0; + u8 m_blit_flags = 0; + u32 m_blit_src = 0; }; // ======================> cdracula_blitter_device diff -Nru mame-0.242+dfsg.1/src/mame/video/edevices.h mame-0.243+dfsg.1/src/mame/video/edevices.h --- mame-0.242+dfsg.1/src/mame/video/edevices.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/edevices.h 2022-04-29 05:37:26.000000000 +0000 @@ -48,10 +48,10 @@ private: /* video-related */ - tilemap_t *m_bg_tilemap; - tilemap_t *m_mlow_tilemap; - tilemap_t *m_mhigh_tilemap; - tilemap_t *m_tx_tilemap; + tilemap_t *m_bg_tilemap = nullptr; + tilemap_t *m_mlow_tilemap = nullptr; + tilemap_t *m_mhigh_tilemap = nullptr; + tilemap_t *m_tx_tilemap = nullptr; TILE_GET_INFO_MEMBER(get_bg_tile_info); TILE_GET_INFO_MEMBER(get_mlow_tile_info); @@ -75,7 +75,7 @@ required_device m_palette; /* misc */ - int m_which; + int m_which = 0; int m_spritexoffs; }; diff -Nru mame-0.242+dfsg.1/src/mame/video/elan_eu3a05vid.h mame-0.243+dfsg.1/src/mame/video/elan_eu3a05vid.h --- mame-0.242+dfsg.1/src/mame/video/elan_eu3a05vid.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/elan_eu3a05vid.h 2022-04-29 05:37:26.000000000 +0000 @@ -38,17 +38,17 @@ required_device m_bank; const address_space_config m_space_config; - uint8_t m_vidctrl; + uint8_t m_vidctrl = 0; - uint8_t m_tile_gfxbase_lo_data; - uint8_t m_tile_gfxbase_hi_data; + uint8_t m_tile_gfxbase_lo_data = 0; + uint8_t m_tile_gfxbase_hi_data = 0; - uint8_t m_sprite_gfxbase_lo_data; - uint8_t m_sprite_gfxbase_hi_data; + uint8_t m_sprite_gfxbase_lo_data = 0; + uint8_t m_sprite_gfxbase_hi_data = 0; - uint8_t m_tile_scroll[4*2]; + uint8_t m_tile_scroll[4*2]{}; - uint8_t m_splitpos[2]; + uint8_t m_splitpos[2]{}; uint16_t get_scroll(int which); diff -Nru mame-0.242+dfsg.1/src/mame/video/elan_eu3a14vid.h mame-0.243+dfsg.1/src/mame/video/elan_eu3a14vid.h --- mame-0.242+dfsg.1/src/mame/video/elan_eu3a14vid.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/elan_eu3a14vid.h 2022-04-29 05:37:26.000000000 +0000 @@ -84,15 +84,15 @@ uint8_t m_rowscrollsplit[5]; uint8_t m_rowscrollcfg[2]; uint8_t m_ramtilecfg[6]; - uint8_t m_spriteaddr; + uint8_t m_spriteaddr = 0; uint8_t m_spritebase[2]; - uint8_t m_5107; - uint8_t m_5108; - uint8_t m_5109; + uint8_t m_5107 = 0; + uint8_t m_5108 = 0; + uint8_t m_5109 = 0; - int m_tilerambase; - int m_spriterambase; + int m_tilerambase = 0; + int m_spriterambase = 0; bitmap_ind8 m_prioritybitmap; }; diff -Nru mame-0.242+dfsg.1/src/mame/video/epos.cpp mame-0.243+dfsg.1/src/mame/video/epos.cpp --- mame-0.242+dfsg.1/src/mame/video/epos.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/epos.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,103 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Zsolt Vasvari -/*************************************************************************** - - Epos games - -***************************************************************************/ - -#include "emu.h" -#include "includes/epos.h" - -/*************************************************************************** - - These games has one 32 byte palette PROM, connected to the RGB output this way: - - bit 7 -- 240 ohm resistor -- RED - -- 510 ohm resistor -- RED - -- 1 kohm resistor -- RED - -- 240 ohm resistor -- GREEN - -- 510 ohm resistor -- GREEN - -- 1 kohm resistor -- GREEN - -- 240 ohm resistor -- BLUE - bit 0 -- 510 ohm resistor -- BLUE - -***************************************************************************/ - -void epos_state::epos_palette(palette_device &palette) const -{ - uint8_t const *const color_prom = memregion("proms")->base(); - int const len = memregion("proms")->bytes(); - - for (offs_t i = 0; i < len; i++) - set_pal_color(palette, i, color_prom[i]); -} - -void epos_state::set_pal_color(palette_device &palette, uint8_t offset, uint8_t data) -{ - int bit0, bit1, bit2; - - bit0 = BIT(data, 7); - bit1 = BIT(data, 6); - bit2 = BIT(data, 5); - int const r = 0x92 * bit0 + 0x4a * bit1 + 0x23 * bit2; - - bit0 = BIT(data, 4); - bit1 = BIT(data, 3); - bit2 = BIT(data, 2); - int const g = 0x92 * bit0 + 0x4a * bit1 + 0x23 * bit2; - - bit0 = BIT(data, 1); - bit1 = BIT(data, 0); - int const b = 0xad * bit0 + 0x52 * bit1; - - palette.set_pen_color(offset, rgb_t(r, g, b)); -} - -// later (tristar 9000) games uses a dynamic palette instead of prom -void epos_state::dealer_pal_w(offs_t offset, uint8_t data) -{ - set_pal_color(*m_palette, offset, data); -} - -void epos_state::port_1_w(uint8_t data) -{ - /* D0 - start light #1 - D1 - start light #2 - D2 - coin counter - D3 - palette select - D4-D7 - unused - */ - - m_leds[0] = BIT(data, 0); - m_leds[1] = BIT(data, 1); - - machine().bookkeeping().coin_counter_w(0, (data >> 2) & 0x01); - - m_palette_bank = (data >> 3) & 0x01; -} - - -uint32_t epos_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) -{ - for (offs_t offs = 0; offs < m_videoram.bytes(); offs++) - { - uint8_t const data = m_videoram[offs]; - - int x = (offs % 136) * 2; - int y = (offs / 136); - - if (flip_screen()) - { - bitmap.pix(240 - y, 270 - x + 1) = m_palette->pen((m_palette_bank << 4) | (data & 0x0f)); - bitmap.pix(240 - y, 270 - x + 0) = m_palette->pen((m_palette_bank << 4) | (data >> 4)); - } - else - { - bitmap.pix(y, x + 0) = m_palette->pen((m_palette_bank << 4) | (data & 0x0f)); - bitmap.pix(y, x + 1) = m_palette->pen((m_palette_bank << 4) | (data >> 4)); - } - } - - return 0; -} diff -Nru mame-0.242+dfsg.1/src/mame/video/exzisus.cpp mame-0.243+dfsg.1/src/mame/video/exzisus.cpp --- mame-0.242+dfsg.1/src/mame/video/exzisus.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/exzisus.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,169 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Yochizo -/*************************************************************************** - -Functions to emulate the video hardware of the machine. - - Video hardware of this hardware is almost similar with "mexico86". So, - most routines are derived from mexico86 driver. - -***************************************************************************/ - - -#include "emu.h" -#include "includes/exzisus.h" - - -/*************************************************************************** - Screen refresh -***************************************************************************/ - -uint32_t exzisus_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - int offs; - int sx, sy, xc, yc; - int gfx_num, gfx_attr, gfx_offs; - - /* Is this correct ? */ - bitmap.fill(1023, cliprect); - - /* ---------- 1st TC0010VCU ---------- */ - sx = 0; - for (offs = 0 ; offs < m_objectram0.bytes() ; offs += 4) - { - int height; - - /* Skip empty sprites. */ - if ( !(*(uint32_t *)(&m_objectram0[offs])) ) - { - continue; - } - - gfx_num = m_objectram0[offs + 1]; - gfx_attr = m_objectram0[offs + 3]; - - if ((gfx_num & 0x80) == 0) /* 16x16 sprites */ - { - gfx_offs = ((gfx_num & 0x7f) << 3); - height = 2; - - sx = m_objectram0[offs + 2]; - sx |= (gfx_attr & 0x40) << 2; - } - else /* tilemaps (each sprite is a 16x256 column) */ - { - gfx_offs = ((gfx_num & 0x3f) << 7) + 0x0400; - height = 32; - - if (gfx_num & 0x40) /* Next column */ - { - sx += 16; - } - else - { - sx = m_objectram0[offs + 2]; - sx |= (gfx_attr & 0x40) << 2; - } - } - - sy = 256 - (height << 3) - (m_objectram0[offs]); - - for (xc = 0 ; xc < 2 ; xc++) - { - int goffs = gfx_offs; - for (yc = 0 ; yc < height ; yc++) - { - int code, color, x, y; - - code = (m_videoram0[goffs + 1] << 8) | m_videoram0[goffs]; - color = (m_videoram0[goffs + 1] >> 6) | (gfx_attr & 0x0f); - x = (sx + (xc << 3)) & 0xff; - y = (sy + (yc << 3)) & 0xff; - - if (flip_screen()) - { - x = 248 - x; - y = 248 - y; - } - - m_gfxdecode->gfx(0)->transpen(bitmap,cliprect, - code & 0x3fff, - color, - flip_screen(), flip_screen(), - x, y, 15); - goffs += 2; - } - gfx_offs += height << 1; - } - } - - /* ---------- 2nd TC0010VCU ---------- */ - sx = 0; - for (offs = 0 ; offs < m_objectram1.bytes() ; offs += 4) - { - int height; - - /* Skip empty sprites. */ - if ( !(*(uint32_t *)(&m_objectram1[offs])) ) - { - continue; - } - - gfx_num = m_objectram1[offs + 1]; - gfx_attr = m_objectram1[offs + 3]; - - if ((gfx_num & 0x80) == 0) /* 16x16 sprites */ - { - gfx_offs = ((gfx_num & 0x7f) << 3); - height = 2; - - sx = m_objectram1[offs + 2]; - sx |= (gfx_attr & 0x40) << 2; - } - else /* tilemaps (each sprite is a 16x256 column) */ - { - gfx_offs = ((gfx_num & 0x3f) << 7) + 0x0400; /// - height = 32; - - if (gfx_num & 0x40) /* Next column */ - { - sx += 16; - } - else - { - sx = m_objectram1[offs + 2]; - sx |= (gfx_attr & 0x40) << 2; - } - } - sy = 256 - (height << 3) - (m_objectram1[offs]); - - for (xc = 0 ; xc < 2 ; xc++) - { - int goffs = gfx_offs; - for (yc = 0 ; yc < height ; yc++) - { - int code, color, x, y; - - code = (m_videoram1[goffs + 1] << 8) | m_videoram1[goffs]; - color = (m_videoram1[goffs + 1] >> 6) | (gfx_attr & 0x0f); - x = (sx + (xc << 3)) & 0xff; - y = (sy + (yc << 3)) & 0xff; - - if (flip_screen()) - { - x = 248 - x; - y = 248 - y; - } - - m_gfxdecode->gfx(1)->transpen(bitmap,cliprect, - code & 0x3fff, - color, - flip_screen(), flip_screen(), - x, y, 15); - goffs += 2; - } - gfx_offs += height << 1; - } - } - return 0; -} diff -Nru mame-0.242+dfsg.1/src/mame/video/galpanic.cpp mame-0.243+dfsg.1/src/mame/video/galpanic.cpp --- mame-0.242+dfsg.1/src/mame/video/galpanic.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/galpanic.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,56 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Nicola Salmoria -#include "emu.h" -#include "kan_pand.h" -#include "includes/galpanic.h" - - -void galpanic_state::video_start() -{ - m_screen->register_screen_bitmap(m_bitmap); - - save_item(NAME(m_bitmap)); -} - -void galpanic_state::galpanic_palette(palette_device &palette) const -{ - // first 1024 colors are dynamic - - // initialize 555 GRB lookup - for (int i = 0; i < 32768; i++) - palette.set_pen_color(i + 1024, pal5bit(i >> 5), pal5bit(i >> 10), pal5bit(i >> 0)); -} - -void galpanic_state::bgvideoram_w(offs_t offset, uint16_t data, uint16_t mem_mask) -{ - data = COMBINE_DATA(&m_bgvideoram[offset]); - - int sy = offset / 256; - int sx = offset % 256; - - m_bitmap.pix(sy, sx) = 1024 + (data >> 1); -} - -void galpanic_state::draw_fgbitmap(bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - for (int offs = 0;offs < m_fgvideoram.bytes()/2;offs++) - { - int const sx = offs % 256; - int const sy = offs / 256; - int const color = m_fgvideoram[offs]; - if (color) - bitmap.pix(sy, sx) = color; - } -} - -uint32_t galpanic_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - /* copy the temporary bitmap to the screen */ - copybitmap(bitmap,m_bitmap,0,0,0,0,cliprect); - - draw_fgbitmap(bitmap, cliprect); - - m_pandora->update(bitmap, cliprect); - - return 0; -} diff -Nru mame-0.242+dfsg.1/src/mame/video/gamate.h mame-0.243+dfsg.1/src/mame/video/gamate.h --- mame-0.242+dfsg.1/src/mame/video/gamate.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/gamate.h 2022-04-29 05:37:26.000000000 +0000 @@ -35,7 +35,7 @@ virtual space_config_vector memory_space_config() const override; - address_space *m_vramspace; + address_space *m_vramspace = nullptr; private: uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); diff -Nru mame-0.242+dfsg.1/src/mame/video/gamecom.cpp mame-0.243+dfsg.1/src/mame/video/gamecom.cpp --- mame-0.242+dfsg.1/src/mame/video/gamecom.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/gamecom.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -24,7 +24,7 @@ else { uint8_t const *const line = &m_p_videoram[ m_base_address + 40 * m_scanline ]; - int pal[4]; + int pal[4]{}; switch( m_p_ram[SM8521_LCDC] & 0x30 ) { diff -Nru mame-0.242+dfsg.1/src/mame/video/gic.h mame-0.243+dfsg.1/src/mame/video/gic.h --- mame-0.242+dfsg.1/src/mame/video/gic.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/gic.h 2022-04-29 05:37:26.000000000 +0000 @@ -85,8 +85,8 @@ bitmap_ind16 m_bitmap; required_region_ptr m_cgrom; // internal chargen ROM - emu_timer *m_vblank_timer; - sound_stream *m_stream; + emu_timer *m_vblank_timer = nullptr; + sound_stream *m_stream = nullptr; int m_audiocnt; int m_audioval; diff -Nru mame-0.242+dfsg.1/src/mame/video/gng.cpp mame-0.243+dfsg.1/src/mame/video/gng.cpp --- mame-0.242+dfsg.1/src/mame/video/gng.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/gng.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,147 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Pierpaolo Prazzoli -/*************************************************************************** - - video.c - - Functions to emulate the video hardware of the machine. - -***************************************************************************/ - -#include "emu.h" -#include "includes/gng.h" - - -/*************************************************************************** - - Callbacks for the TileMap code - -***************************************************************************/ - -TILE_GET_INFO_MEMBER(gng_state::get_fg_tile_info) -{ - uint8_t attr = m_fgvideoram[tile_index + 0x400]; - tileinfo.set(0, - m_fgvideoram[tile_index] + ((attr & 0xc0) << 2), - attr & 0x0f, - TILE_FLIPYX((attr & 0x30) >> 4)); -} - -TILE_GET_INFO_MEMBER(gng_state::get_bg_tile_info) -{ - uint8_t attr = m_bgvideoram[tile_index + 0x400]; - tileinfo.set(1, - m_bgvideoram[tile_index] + ((attr & 0xc0) << 2), - attr & 0x07, - TILE_FLIPYX((attr & 0x30) >> 4)); - tileinfo.group = (attr & 0x08) >> 3; -} - - - -/*************************************************************************** - - Start the video hardware emulation. - -***************************************************************************/ - -void gng_state::video_start() -{ - m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(gng_state::get_fg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); - m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(gng_state::get_bg_tile_info)), TILEMAP_SCAN_COLS, 16, 16, 32, 32); - - m_fg_tilemap->set_transparent_pen(3); - m_bg_tilemap->set_transmask(0, 0xff, 0x00); // split type 0 is totally transparent in front half - m_bg_tilemap->set_transmask(1, 0x41, 0xbe); // split type 1 has pens 0 and 6 transparent in front half - - m_bg_tilemap->set_scrolldx(128, 128); - m_bg_tilemap->set_scrolldy( 6, 6); - m_fg_tilemap->set_scrolldx(128, 128); - m_fg_tilemap->set_scrolldy( 6, 6); -} - - -/*************************************************************************** - - Memory handlers - -***************************************************************************/ - -void gng_state::gng_fgvideoram_w(offs_t offset, uint8_t data) -{ - m_fgvideoram[offset] = data; - m_fg_tilemap->mark_tile_dirty(offset & 0x3ff); -} - -void gng_state::gng_bgvideoram_w(offs_t offset, uint8_t data) -{ - m_bgvideoram[offset] = data; - m_bg_tilemap->mark_tile_dirty(offset & 0x3ff); -} - - -void gng_state::gng_bgscrollx_w(offs_t offset, uint8_t data) -{ - m_scrollx[offset] = data; - m_bg_tilemap->set_scrollx(0, m_scrollx[0] + 256 * m_scrollx[1]); -} - -void gng_state::gng_bgscrolly_w(offs_t offset, uint8_t data) -{ - m_scrolly[offset] = data; - m_bg_tilemap->set_scrolly(0, m_scrolly[0] + 256 * m_scrolly[1]); -} - - -WRITE_LINE_MEMBER(gng_state::flipscreen_w) -{ - flip_screen_set(!state); -} - - - -/*************************************************************************** - - Display refresh - -***************************************************************************/ - -void gng_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ) -{ - uint8_t *buffered_spriteram = m_spriteram->buffer(); - gfx_element *gfx = m_gfxdecode->gfx(2); - int offs; - - - for (offs = m_spriteram->bytes() - 4; offs >= 0; offs -= 4) - { - uint8_t attributes = buffered_spriteram[offs + 1]; - int sx = buffered_spriteram[offs + 3] - 0x100 * (attributes & 0x01); - int sy = buffered_spriteram[offs + 2]; - int flipx = attributes & 0x04; - int flipy = attributes & 0x08; - - if (flip_screen()) - { - sx = 240 - sx; - sy = 240 - sy; - flipx = !flipx; - flipy = !flipy; - } - - gfx->transpen(bitmap,cliprect, - buffered_spriteram[offs] + ((attributes << 2) & 0x300), - (attributes >> 4) & 3, - flipx,flipy, - sx+128,sy+6,15); - } -} - -uint32_t gng_state::screen_update_gng(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - m_bg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER1, 0); - draw_sprites(bitmap, cliprect); - m_bg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER0, 0); - m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - return 0; -} diff -Nru mame-0.242+dfsg.1/src/mame/video/goal92.cpp mame-0.243+dfsg.1/src/mame/video/goal92.cpp --- mame-0.242+dfsg.1/src/mame/video/goal92.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/goal92.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,189 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Pierpaolo Prazzoli, David Haywood -/*************************************************************************** - - Goal '92 video hardware - -***************************************************************************/ - -#include "emu.h" -#include "includes/goal92.h" - -uint16_t goal92_state::goal92_fg_bank_r() -{ - return m_fg_bank; -} - -void goal92_state::goal92_fg_bank_w(offs_t offset, uint16_t data, uint16_t mem_mask) -{ - COMBINE_DATA(&m_fg_bank); - - if (ACCESSING_BITS_0_7) - { - m_fg_layer->mark_all_dirty(); - } -} - -void goal92_state::goal92_text_w(offs_t offset, uint16_t data, uint16_t mem_mask) -{ - COMBINE_DATA(&m_tx_data[offset]); - m_tx_layer->mark_tile_dirty(offset); -} - -void goal92_state::goal92_background_w(offs_t offset, uint16_t data, uint16_t mem_mask) -{ - COMBINE_DATA(&m_bg_data[offset]); - m_bg_layer->mark_tile_dirty(offset); -} - -void goal92_state::goal92_foreground_w(offs_t offset, uint16_t data, uint16_t mem_mask) -{ - COMBINE_DATA(&m_fg_data[offset]); - m_fg_layer->mark_tile_dirty(offset); -} - -TILE_GET_INFO_MEMBER(goal92_state::get_text_tile_info) -{ - int tile = m_tx_data[tile_index]; - int color = (tile >> 12) & 0xf; - - tile &= 0xfff; - - tile |= 0xc000; - - tileinfo.set(1, tile, color, 0); -} - -TILE_GET_INFO_MEMBER(goal92_state::get_back_tile_info) -{ - int tile = m_bg_data[tile_index]; - int color = (tile >> 12) & 0xf; - - tile &= 0xfff; - - tileinfo.set(2, tile, color, 0); -} - -TILE_GET_INFO_MEMBER(goal92_state::get_fore_tile_info) -{ - int tile = m_fg_data[tile_index]; - int color = (tile >> 12) & 0xf; - int region; - - tile &= 0xfff; - - if(m_fg_bank & 0xff) - { - region = 3; - tile |= 0x1000; - } - else - { - region = 4; - tile |= 0x2000; - } - - tileinfo.set(region, tile, color, 0); -} - -void goal92_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int pri ) -{ - uint16_t *buffered_spriteram16 = m_buffered_spriteram.get(); - int offs, fx, fy, x, y, color, sprite; - - for (offs = 3; offs <= 0x400 - 5; offs += 4) - { - uint16_t data = buffered_spriteram16[offs + 2]; - - y = buffered_spriteram16[offs + 0]; - - if (y & 0x8000) - break; - - if (!(data & 0x8000)) - continue; - - sprite = buffered_spriteram16[offs + 1]; - - if ((sprite >> 14) != pri) - continue; - - x = buffered_spriteram16[offs + 3]; - - sprite &= 0x1fff; - - x &= 0x1ff; - y &= 0x1ff; - - color = (data & 0x3f) + 0x40; - fx = (data & 0x4000) >> 14; - fy = 0; - - x -= 320 / 4 - 16 - 1; - - y = 256 - (y + 7); - - m_gfxdecode->gfx(0)->transpen(bitmap,cliprect, - sprite, - color,fx,fy,x,y,15); - } -} - - -void goal92_state::video_start() -{ - m_bg_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(goal92_state::get_back_tile_info)), TILEMAP_SCAN_ROWS, 16, 16, 32, 32); - m_fg_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(goal92_state::get_fore_tile_info)), TILEMAP_SCAN_ROWS, 16, 16, 32, 32); - m_tx_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(goal92_state::get_text_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); - - m_buffered_spriteram = std::make_unique(0x400 * 2); - save_pointer(NAME(m_buffered_spriteram), 0x400 * 2); - - m_bg_layer->set_transparent_pen(15); - m_fg_layer->set_transparent_pen(15); - m_tx_layer->set_transparent_pen(15); -} - -uint32_t goal92_state::screen_update_goal92(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - m_bg_layer->set_scrollx(0, m_scrollram[0] + 60); - m_bg_layer->set_scrolly(0, m_scrollram[1] + 8); - - if (m_fg_bank & 0xff) - { - m_fg_layer->set_scrollx(0, m_scrollram[0] + 60); - m_fg_layer->set_scrolly(0, m_scrollram[1] + 8); - } - else - { - m_fg_layer->set_scrollx(0, m_scrollram[2] + 60); - m_fg_layer->set_scrolly(0, m_scrollram[3] + 8); - } - - bitmap.fill(m_palette->black_pen(), cliprect); - - m_bg_layer->draw(screen, bitmap, cliprect, 0, 0); - draw_sprites(bitmap, cliprect, 2); - - if (!(m_fg_bank & 0xff)) - draw_sprites(bitmap, cliprect, 1); - - m_fg_layer->draw(screen, bitmap, cliprect, 0, 0); - - if(m_fg_bank & 0xff) - draw_sprites(bitmap, cliprect, 1); - - draw_sprites(bitmap, cliprect, 0); - draw_sprites(bitmap, cliprect, 3); - m_tx_layer->draw(screen, bitmap, cliprect, 0, 0); - return 0; -} - -WRITE_LINE_MEMBER(goal92_state::screen_vblank_goal92) -{ - // rising edge - if (state) - { - memcpy(m_buffered_spriteram.get(), m_spriteram, 0x400 * 2); - } -} diff -Nru mame-0.242+dfsg.1/src/mame/video/hcastle.cpp mame-0.243+dfsg.1/src/mame/video/hcastle.cpp --- mame-0.242+dfsg.1/src/mame/video/hcastle.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/hcastle.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,239 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Bryan McPhail -/*************************************************************************** - - Haunted Castle video emulation - -***************************************************************************/ - -#include "emu.h" -#include "includes/hcastle.h" -#include "screen.h" - - -void hcastle_state::hcastle_palette(palette_device &palette) const -{ - uint8_t const *const color_prom = memregion("proms")->base(); - for (int chip = 0; chip < 2; chip++) - { - for (int pal = 0; pal < 8; pal++) - { - int const clut = (chip << 1) | (pal & 1); - - for (int i = 0; i < 0x100; i++) - { - uint8_t ctabentry; - - if (((pal & 0x01) == 0) && (color_prom[(clut << 8) | i] == 0)) - ctabentry = 0; - else - ctabentry = (pal << 4) | (color_prom[(clut << 8) | i] & 0x0f); - - palette.set_pen_indirect((chip << 11) | (pal << 8) | i, ctabentry); - } - } - } -} - - - -/*************************************************************************** - - Callbacks for the TileMap code - -***************************************************************************/ - -TILEMAP_MAPPER_MEMBER(hcastle_state::tilemap_scan) -{ - /* logical (col,row) -> memory offset */ - return (col & 0x1f) + ((row & 0x1f) << 5) + ((col & 0x20) << 6); /* skip 0x400 */ -} - -TILE_GET_INFO_MEMBER(hcastle_state::get_fg_tile_info) -{ - uint8_t ctrl_5 = m_k007121_1->ctrlram_r(5); - uint8_t ctrl_6 = m_k007121_1->ctrlram_r(6); - int bit0 = (ctrl_5 >> 0) & 0x03; - int bit1 = (ctrl_5 >> 2) & 0x03; - int bit2 = (ctrl_5 >> 4) & 0x03; - int bit3 = (ctrl_5 >> 6) & 0x03; - int attr = m_pf1_videoram[tile_index]; - int tile = m_pf1_videoram[tile_index + 0x400]; - int color = attr & 0x7; - int bank = ((attr & 0x80) >> 7) | - ((attr >> (bit0 + 2)) & 0x02) | - ((attr >> (bit1 + 1)) & 0x04) | - ((attr >> (bit2 )) & 0x08) | - ((attr >> (bit3 - 1)) & 0x10); - - tileinfo.set(0, - tile + bank * 0x100 + m_pf1_bankbase, - ((ctrl_6 & 0x30) * 2 + 16) + color, - 0); -} - -TILE_GET_INFO_MEMBER(hcastle_state::get_bg_tile_info) -{ - uint8_t ctrl_5 = m_k007121_2->ctrlram_r(5); - uint8_t ctrl_6 = m_k007121_2->ctrlram_r(6); - int bit0 = (ctrl_5 >> 0) & 0x03; - int bit1 = (ctrl_5 >> 2) & 0x03; - int bit2 = (ctrl_5 >> 4) & 0x03; - int bit3 = (ctrl_5 >> 6) & 0x03; - int attr = m_pf2_videoram[tile_index]; - int tile = m_pf2_videoram[tile_index + 0x400]; - int color = attr & 0x7; - int bank = ((attr & 0x80) >> 7) | - ((attr >> (bit0 + 2)) & 0x02) | - ((attr >> (bit1 + 1)) & 0x04) | - ((attr >> (bit2 )) & 0x08) | - ((attr >> (bit3 - 1)) & 0x10); - - tileinfo.set(1, - tile + bank * 0x100 + m_pf2_bankbase, - ((ctrl_6 & 0x30) * 2 + 16) + color, - 0); -} - - - -/*************************************************************************** - - Start the video hardware emulation. - -***************************************************************************/ - -void hcastle_state::video_start() -{ - m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(hcastle_state::get_fg_tile_info)), tilemap_mapper_delegate(*this, FUNC(hcastle_state::tilemap_scan)), 8, 8, 64, 32); - m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(hcastle_state::get_bg_tile_info)), tilemap_mapper_delegate(*this, FUNC(hcastle_state::tilemap_scan)), 8, 8, 64, 32); - - m_fg_tilemap->set_transparent_pen(0); -} - - - -/*************************************************************************** - - Memory handlers - -***************************************************************************/ - -void hcastle_state::hcastle_pf1_video_w(offs_t offset, uint8_t data) -{ - m_pf1_videoram[offset] = data; - m_fg_tilemap->mark_tile_dirty(offset & 0xbff); -} - -void hcastle_state::hcastle_pf2_video_w(offs_t offset, uint8_t data) -{ - m_pf2_videoram[offset] = data; - m_bg_tilemap->mark_tile_dirty(offset & 0xbff); -} - -void hcastle_state::hcastle_gfxbank_w(uint8_t data) -{ - m_gfx_bank = data; -} - -uint8_t hcastle_state::hcastle_gfxbank_r() -{ - return m_gfx_bank; -} - -void hcastle_state::hcastle_pf1_control_w(offs_t offset, uint8_t data) -{ - if (offset == 3) - { - if ((data & 0x8) == 0) - m_spriteram->copy(0x800, 0x800); - else - m_spriteram->copy(0x000, 0x800); - } - else if (offset == 7) - { - m_fg_tilemap->set_flip((data & 0x08) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); - } - m_k007121_1->ctrl_w(offset, data); -} - -void hcastle_state::hcastle_pf2_control_w(offs_t offset, uint8_t data) -{ - if (offset == 3) - { - if ((data & 0x8) == 0) - m_spriteram2->copy(0x800, 0x800); - else - m_spriteram2->copy(0x000, 0x800); - } - else if (offset == 7) - { - m_bg_tilemap->set_flip((data & 0x08) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); - } - m_k007121_2->ctrl_w(offset, data); -} - -/*****************************************************************************/ - -void hcastle_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, uint8_t *sbank, int bank ) -{ - k007121_device *k007121 = bank ? m_k007121_2 : m_k007121_1; - int base_color = (k007121->ctrlram_r(6) & 0x30) * 2; - int bank_base = (bank == 0) ? 0x4000 * (m_gfx_bank & 1) : 0; - - k007121->sprites_draw(bitmap, cliprect, m_gfxdecode->gfx(bank), *m_palette, sbank, base_color, 0, bank_base, priority_bitmap, (uint32_t)-1); -} - -/*****************************************************************************/ - -uint32_t hcastle_state::screen_update_hcastle(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - uint8_t ctrl_1_0 = m_k007121_1->ctrlram_r(0); - uint8_t ctrl_1_1 = m_k007121_1->ctrlram_r(1); - uint8_t ctrl_1_2 = m_k007121_1->ctrlram_r(2); - uint8_t ctrl_1_3 = m_k007121_1->ctrlram_r(3); - uint8_t ctrl_2_0 = m_k007121_2->ctrlram_r(0); - uint8_t ctrl_2_1 = m_k007121_2->ctrlram_r(1); - uint8_t ctrl_2_2 = m_k007121_2->ctrlram_r(2); - uint8_t ctrl_2_3 = m_k007121_2->ctrlram_r(3); - - m_pf1_bankbase = 0x0000; - m_pf2_bankbase = 0x4000 * ((m_gfx_bank & 2) >> 1); - - if (ctrl_1_3 & 0x01) - m_pf1_bankbase += 0x2000; - if (ctrl_2_3 & 0x01) - m_pf2_bankbase += 0x2000; - - if (m_pf1_bankbase != m_old_pf1) - m_fg_tilemap->mark_all_dirty(); - - if (m_pf2_bankbase != m_old_pf2) - m_bg_tilemap->mark_all_dirty(); - - m_old_pf1 = m_pf1_bankbase; - m_old_pf2 = m_pf2_bankbase; - - m_bg_tilemap->set_scrolly(0, ctrl_2_2); - m_bg_tilemap->set_scrollx(0, ((ctrl_2_1 << 8) + ctrl_2_0)); - m_fg_tilemap->set_scrolly(0, ctrl_1_2); - m_fg_tilemap->set_scrollx(0, ((ctrl_1_1 << 8) + ctrl_1_0)); - -// /* Sprite priority */ -// if (ctrl_1_3 & 0x20) - if ((m_gfx_bank & 0x04) == 0) - { - m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - draw_sprites(bitmap, cliprect, screen.priority(), m_spriteram->buffer(), 0); - draw_sprites(bitmap, cliprect, screen.priority(), m_spriteram2->buffer(), 1); - m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - } - else - { - m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - draw_sprites(bitmap, cliprect, screen.priority(), m_spriteram->buffer(), 0); - draw_sprites(bitmap, cliprect, screen.priority(), m_spriteram2->buffer(), 1); - } - return 0; -} diff -Nru mame-0.242+dfsg.1/src/mame/video/hexion.cpp mame-0.243+dfsg.1/src/mame/video/hexion.cpp --- mame-0.242+dfsg.1/src/mame/video/hexion.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/hexion.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,168 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Nicola Salmoria -#include "emu.h" -#include "includes/hexion.h" - - - - -/*************************************************************************** - - Callbacks for the TileMap code - -***************************************************************************/ - -inline void hexion_state::get_tile_info(tile_data &tileinfo,int tile_index,uint8_t *ram) -{ - tile_index *= 4; - tileinfo.set(0, - ram[tile_index] + ((ram[tile_index+1] & 0x3f) << 8), - ram[tile_index+2] & 0x0f, - 0); -} - -TILE_GET_INFO_MEMBER(hexion_state::get_tile_info0) -{ - get_tile_info(tileinfo,tile_index,m_vram[0]); -} - -TILE_GET_INFO_MEMBER(hexion_state::get_tile_info1) -{ - get_tile_info(tileinfo,tile_index,m_vram[1]); -} - - - -/*************************************************************************** - - Start the video hardware emulation. - -***************************************************************************/ - -void hexion_state::video_start() -{ - m_bg_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(hexion_state::get_tile_info0)), TILEMAP_SCAN_ROWS,8,8,64,32); - m_bg_tilemap[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(hexion_state::get_tile_info1)), TILEMAP_SCAN_ROWS, 8,8,64,32); - - m_bg_tilemap[0]->set_transparent_pen(0); - m_bg_tilemap[1]->set_scrollx(0,-4); - m_bg_tilemap[1]->set_scrolly(0,4); - - m_vram[0] = memregion("maincpu")->base() + 0x30000; - m_vram[1] = m_vram[0] + 0x2000; - m_unkram = m_vram[1] + 0x2000; - - membank("bank1")->configure_entries(0, 16, memregion("maincpu")->base() + 0x10000, 0x2000); - - m_gfxrom_select = 0; -} - - - -/*************************************************************************** - - Memory handlers - -***************************************************************************/ - -void hexion_state::bankswitch_w(uint8_t data) -{ - /* bits 0-3 select ROM bank */ - membank("bank1")->set_entry(data & 0x0f); - - /* does bit 6 trigger the 052591? */ - if (data & 0x40) - { - int bank = m_unkram[0]&1; - memset(m_vram[bank],m_unkram[1],0x2000); - m_bg_tilemap[bank]->mark_all_dirty(); - } - /* bit 7 = PMC-BK */ - m_pmcbank = (data & 0x80) >> 7; - - /* other bits unknown */ -if (data & 0x30) - popmessage("bankswitch %02x",data&0xf0); - -//logerror("%s: bankswitch_w %02x\n",m_maincpu->pc(),data); -} - -uint8_t hexion_state::bankedram_r(offs_t offset) -{ - if (m_gfxrom_select && offset < 0x1000) - { - return memregion("gfx1")->base()[((m_gfxrom_select & 0x7f) << 12) + offset]; - } - else if (m_bankctrl == 0) - { - return m_vram[m_rambank][offset]; - } - else if (m_bankctrl == 2 && offset < 0x800) - { - return m_unkram[offset]; - } - else - { -//logerror("%s: bankedram_r offset %04x, bankctrl = %02x\n",m_maincpu->pc(),offset,m_bankctrl); - return 0; - } -} - -void hexion_state::bankedram_w(offs_t offset, uint8_t data) -{ - if (m_bankctrl == 3 && offset == 0 && (data & 0xfe) == 0) - { -//logerror("%s: bankedram_w offset %04x, data %02x, bankctrl = %02x\n",m_maincpu->pc(),offset,data,m_bankctrl); - m_rambank = data & 1; - } - else if (m_bankctrl == 0) - { - if (m_pmcbank) - { -//logerror("%s: bankedram_w offset %04x, data %02x, bankctrl = %02x\n",m_maincpu->pc(),offset,data,m_bankctrl); - m_vram[m_rambank][offset] = data; - m_bg_tilemap[m_rambank]->mark_tile_dirty(offset/4); - } - else - logerror("%04x pmc internal ram %04x = %02x\n",m_maincpu->pc(),offset,data); - } - else if (m_bankctrl == 2 && offset < 0x800) - { - if (m_pmcbank) - { -//logerror("%s: unkram_w offset %04x, data %02x, bankctrl = %02x\n",m_maincpu->pc(),offset,data,m_bankctrl); - m_unkram[offset] = data; - } - else - logerror("%04x pmc internal ram %04x = %02x\n",m_maincpu->pc(),offset,data); - } - else -logerror("%s: bankedram_w offset %04x, data %02x, bankctrl = %02x\n",m_maincpu->pc(),offset,data,m_bankctrl); -} - -void hexion_state::bankctrl_w(uint8_t data) -{ -//logerror("%s: bankctrl_w %02x\n",m_maincpu->pc(),data); - m_bankctrl = data; -} - -void hexion_state::gfxrom_select_w(uint8_t data) -{ -//logerror("%s: gfxrom_select_w %02x\n",m_maincpu->pc(),data); - m_gfxrom_select = data; -} - - - -/*************************************************************************** - - Display refresh - -***************************************************************************/ - -uint32_t hexion_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - m_bg_tilemap[1]->draw(screen, bitmap, cliprect, 0,0); - m_bg_tilemap[0]->draw(screen, bitmap, cliprect, 0,0); - return 0; -} diff -Nru mame-0.242+dfsg.1/src/mame/video/himesiki.cpp mame-0.243+dfsg.1/src/mame/video/himesiki.cpp --- mame-0.242+dfsg.1/src/mame/video/himesiki.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/himesiki.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,133 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Uki -/****************************************************************************** - -Himeshikibu (C) 1989 Hi-Soft - -Video hardware - driver by Uki - -******************************************************************************/ - -#include "emu.h" -#include "includes/himesiki.h" - -TILE_GET_INFO_MEMBER(himesiki_state::get_bg_tile_info) -{ - int code = m_bg_ram[tile_index * 2] + m_bg_ram[tile_index * 2 + 1] * 0x100 ; - int col = code >> 12; - - code &= 0xfff; - - tileinfo.set(0, code, col, 0); -} - -void himesiki_state::video_start() -{ - m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(himesiki_state::get_bg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); -} - -void himesiki_state::himesiki_bg_ram_w(offs_t offset, uint8_t data) -{ - m_bg_ram[offset] = data; - m_bg_tilemap->mark_tile_dirty(offset / 2); -} - -void himesiki_state::himesiki_scrollx_w(offs_t offset, uint8_t data) -{ - m_scrollx[offset] = data; -} - -void himesiki_state::himesiki_scrolly_w(uint8_t data) -{ - m_scrolly = data; -} - -void himesiki_state::himesiki_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ) -{ - uint8_t *spriteram; - int offs; - - // these sprites are from the ET-P103A board (himesiki only) - spriteram = m_spriteram_p103a; - for (offs = 0x00; offs < 0x60; offs += 4) - { - int attr = spriteram[offs + 1]; - int code = spriteram[offs + 0] | (attr & 3) << 8; - int x = spriteram[offs + 3] | (attr & 8) << 5; - int y = spriteram[offs + 2]; - - int col = (attr & 0xf0) >> 4; - int fx = attr & 4; - int fy = 0; - - if (x > 0x1e0) - x -= 0x200; - - if (m_flipscreen) - { - y = (y - 31) & 0xff; - x = 224 - x; - fx ^= 4; - fy = 1; - } - else - { - y = 257 - y; - if (y > 0xc0) - y -= 0x100; - } - - m_gfxdecode->gfx(2)->transpen(bitmap,cliprect, code, col, fx, fy, x, y, 15); - } - - // 0xc0 - 0xff unused - spriteram = m_spriteram; - for (offs = 0; offs < 0x100; offs += 4) - { - // not sure about this, but you sometimes get a garbage sprite in the corner otherwise. - if ((spriteram[offs + 0] == 0x00) && - (spriteram[offs + 1] == 0x00) && - (spriteram[offs + 2] == 0x00) && - (spriteram[offs + 3] == 0x00)) - continue; - - int attr = spriteram[offs + 1]; - int code = spriteram[offs + 0] | (attr & 7) << 8; - int x = spriteram[offs + 3] | (attr & 8) << 5; - int y = spriteram[offs + 2]; - - int col = (attr & 0xf0) >> 4; - int f = 0; - - if (x > 0x1e0) - x -= 0x200; - - if (m_flipscreen) - { - y = (y - 15) &0xff; - x = 240 - x; - f = 1; - } - else - y = 257 - y; - - y &= 0xff; - if (y > 0xf0) - y -= 0x100; - - m_gfxdecode->gfx(1)->transpen(bitmap,cliprect, code, col, f, f, x, y, 15); - } -} - -uint32_t himesiki_state::screen_update_himesiki(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - int x = -(m_scrollx[0] << 8 | m_scrollx[1]) & 0x1ff; - m_bg_tilemap->set_scrolldx(x, x); - m_bg_tilemap->set_scrolldy(-m_scrolly, -m_scrolly-64); - - m_bg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); - himesiki_draw_sprites(bitmap, cliprect); - - return 0; -} diff -Nru mame-0.242+dfsg.1/src/mame/video/igs017_igs031.h mame-0.243+dfsg.1/src/mame/video/igs017_igs031.h --- mame-0.242+dfsg.1/src/mame/video/igs017_igs031.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/igs017_igs031.h 2022-04-29 05:37:26.000000000 +0000 @@ -82,17 +82,17 @@ // the gfx roms were often hooked up with the bits backwards, allow us to handle it here to save doing it in every driver. bool m_revbits; - u8 m_toggle; - int m_debug_addr; - int m_debug_width; - bool m_video_disable; - tilemap_t *m_fg_tilemap; - tilemap_t *m_bg_tilemap; + u8 m_toggle = 0; + int m_debug_addr = 0; + int m_debug_width = 0; + bool m_video_disable = false; + tilemap_t *m_fg_tilemap = nullptr; + tilemap_t *m_bg_tilemap = nullptr; std::unique_ptr m_sprites_gfx; - u32 m_sprites_gfx_size; + u32 m_sprites_gfx_size = 0; - bool m_nmi_enable; - bool m_irq_enable; + bool m_nmi_enable = false; + bool m_irq_enable = false; }; DECLARE_DEVICE_TYPE(IGS017_IGS031, igs017_igs031_device) diff -Nru mame-0.242+dfsg.1/src/mame/video/jag_blitter.h mame-0.243+dfsg.1/src/mame/video/jag_blitter.h --- mame-0.242+dfsg.1/src/mame/video/jag_blitter.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/jag_blitter.h 2022-04-29 05:37:26.000000000 +0000 @@ -60,7 +60,7 @@ void count_inner_w(offs_t offset, u16 data, u16 mem_mask = ~0); // timer setups - emu_timer *m_command_timer; + emu_timer *m_command_timer = nullptr; inline void command_start(); inline void command_run(); inline void command_done(); @@ -81,8 +81,7 @@ struct { u32 base; s16 xstep, ystep; - - u32 ptr; /**< Current pixel address */ + u32 ptr = 0; /**< Current pixel address */ } m_a1; }; diff -Nru mame-0.242+dfsg.1/src/mame/video/k001005.h mame-0.243+dfsg.1/src/mame/video/k001005.h --- mame-0.242+dfsg.1/src/mame/video/k001005.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/k001005.h 2022-04-29 05:37:26.000000000 +0000 @@ -68,7 +68,7 @@ int m_3dfifo_ptr; vertex_t m_vertexb[4]; - int m_vertexb_ptr; + int m_vertexb_ptr = 0; uint32_t m_light_r; uint32_t m_light_g; diff -Nru mame-0.242+dfsg.1/src/mame/video/k001006.h mame-0.243+dfsg.1/src/mame/video/k001006.h --- mame-0.242+dfsg.1/src/mame/video/k001006.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/k001006.h 2022-04-29 05:37:26.000000000 +0000 @@ -41,7 +41,7 @@ std::unique_ptr m_palette; required_region_ptr m_gfxrom; - bool m_enable_bilinear; + bool m_enable_bilinear = false; }; diff -Nru mame-0.242+dfsg.1/src/mame/video/k007342.h mame-0.243+dfsg.1/src/mame/video/k007342.h --- mame-0.242+dfsg.1/src/mame/video/k007342.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/k007342.h 2022-04-29 05:37:26.000000000 +0000 @@ -43,7 +43,7 @@ uint8_t *m_colorram_0; uint8_t *m_colorram_1; - tilemap_t *m_tilemap[2]; + tilemap_t *m_tilemap[2]{}; int m_flipscreen, m_int_enabled; uint8_t m_regs[8]; uint16_t m_scrollx[2]; diff -Nru mame-0.242+dfsg.1/src/mame/video/k037122.h mame-0.243+dfsg.1/src/mame/video/k037122.h --- mame-0.242+dfsg.1/src/mame/video/k037122.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/k037122.h 2022-04-29 05:37:26.000000000 +0000 @@ -33,11 +33,11 @@ private: // internal state - tilemap_t* m_tilemap_128; - tilemap_t* m_tilemap_256; + tilemap_t* m_tilemap_128 = nullptr; + tilemap_t* m_tilemap_256 = nullptr; - uint32_t m_palette_base; - uint32_t m_tilemap_base; + uint32_t m_palette_base = 0; + uint32_t m_tilemap_base = 0; std::unique_ptr m_tile_ram; std::unique_ptr m_char_ram; diff -Nru mame-0.242+dfsg.1/src/mame/video/k051316.h mame-0.243+dfsg.1/src/mame/video/k051316.h --- mame-0.242+dfsg.1/src/mame/video/k051316.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/k051316.h 2022-04-29 05:37:26.000000000 +0000 @@ -68,7 +68,7 @@ // internal state std::vector m_ram; uint8_t m_ctrlram[16]; - tilemap_t *m_tmap; + tilemap_t *m_tmap = nullptr; optional_region_ptr m_zoom_rom; diff -Nru mame-0.242+dfsg.1/src/mame/video/k053246_k053247_k055673.h mame-0.243+dfsg.1/src/mame/video/k053246_k053247_k055673.h --- mame-0.242+dfsg.1/src/mame/video/k053246_k053247_k055673.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/k053246_k053247_k055673.h 2022-04-29 05:37:26.000000000 +0000 @@ -97,7 +97,7 @@ u8 m_kx46_regs[8]; u16 m_kx47_regs[16]; - int m_dx, m_dy; + int m_dx = 0, m_dy = 0; u8 m_objcha_line; int m_z_rejection; @@ -105,7 +105,7 @@ required_region_ptr m_gfxrom; int m_gfx_num; - int m_bpp; + int m_bpp = 0; /* alt implementation - to be collapsed */ void zdrawgfxzoom32GP( diff -Nru mame-0.242+dfsg.1/src/mame/video/k053250.h mame-0.243+dfsg.1/src/mame/video/k053250.h --- mame-0.242+dfsg.1/src/mame/video/k053250.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/k053250.h 2022-04-29 05:37:26.000000000 +0000 @@ -46,16 +46,16 @@ private: // configuration - int m_offx, m_offy; + int m_offx = 0, m_offy = 0; // internal state required_region_ptr m_rom; std::vector m_unpacked_rom; std::vector m_ram; - uint16_t *m_buffer[2]; - uint8_t m_regs[8]; - uint8_t m_page; - int32_t m_frame; + uint16_t *m_buffer[2]{}; + uint8_t m_regs[8]{}; + uint8_t m_page = 0; + int32_t m_frame = 0; // internal helpers void unpack_nibbles(); diff -Nru mame-0.242+dfsg.1/src/mame/video/k053250_ps.h mame-0.243+dfsg.1/src/mame/video/k053250_ps.h --- mame-0.242+dfsg.1/src/mame/video/k053250_ps.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/k053250_ps.h 2022-04-29 05:37:26.000000000 +0000 @@ -58,21 +58,21 @@ }; devcb_write_line m_dmairq_cb; - int m_timer_lvcdma_state; - bool m_dmairq_on; + int m_timer_lvcdma_state = 0; + bool m_dmairq_on = false; // configuration int m_offx, m_offy; - emu_timer *m_timer_lvcdma; + emu_timer *m_timer_lvcdma = nullptr; // internal state required_region_ptr m_rom; std::vector m_unpacked_rom; std::vector m_ram; - uint16_t *m_buffer[2]; - uint8_t m_regs[8]; - uint8_t m_page; + uint16_t *m_buffer[2]{}; + uint8_t m_regs[8]{}; + uint8_t m_page = 0; // internal helpers void unpack_nibbles(); diff -Nru mame-0.242+dfsg.1/src/mame/video/k054000.h mame-0.243+dfsg.1/src/mame/video/k054000.h --- mame-0.242+dfsg.1/src/mame/video/k054000.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/k054000.h 2022-04-29 05:37:26.000000000 +0000 @@ -28,9 +28,9 @@ int convert_raw_to_result(u8 *buf); u8 status_r(); - u8 m_raw_Acx[4], m_raw_Acy[4], m_raw_Bcx[4], m_raw_Bcy[4]; - int m_Acx, m_Acy, m_Bcx, m_Bcy; - int m_Aax, m_Aay, m_Bax, m_Bay; + u8 m_raw_Acx[4]{}, m_raw_Acy[4]{}, m_raw_Bcx[4]{}, m_raw_Bcy[4]{}; + int m_Acx = 0, m_Acy = 0, m_Bcx = 0, m_Bcy = 0; + int m_Aax = 0, m_Aay = 0, m_Bax = 0, m_Bay = 0; std::string print_hitbox_state(bool result); }; diff -Nru mame-0.242+dfsg.1/src/mame/video/k054156_k054157_k056832.h mame-0.243+dfsg.1/src/mame/video/k054156_k054157_k056832.h --- mame-0.242+dfsg.1/src/mame/video/k054156_k054157_k056832.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/k054156_k054157_k056832.h 2022-04-29 05:37:26.000000000 +0000 @@ -110,8 +110,8 @@ private: // internal state - tilemap_t *m_tilemap[K056832_PAGE_COUNT]; - bitmap_ind16 *m_pixmap[K056832_PAGE_COUNT]; + tilemap_t *m_tilemap[K056832_PAGE_COUNT]{}; + bitmap_ind16 *m_pixmap[K056832_PAGE_COUNT]{}; std::vector m_videoram; @@ -133,7 +133,7 @@ // ROM readback involves reading 2 halves of a word // from the same location in a row. Reading the // RAM window resets this state so you get the first half. - int m_rom_half; + int m_rom_half = 0; // locally cached values int m_layer_assoc_with_page[K056832_PAGE_COUNT]; diff -Nru mame-0.242+dfsg.1/src/mame/video/k1ge.h mame-0.243+dfsg.1/src/mame/video/k1ge.h --- mame-0.242+dfsg.1/src/mame/video/k1ge.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/k1ge.h 2022-04-29 05:37:26.000000000 +0000 @@ -47,10 +47,10 @@ devcb_write_line m_vblank_pin_w; devcb_write_line m_hblank_pin_w; std::unique_ptr m_vram; - uint8_t m_wba_h, m_wba_v, m_wsi_h, m_wsi_v; + uint8_t m_wba_h = 0, m_wba_v = 0, m_wsi_h = 0, m_wsi_v = 0; - emu_timer *m_timer; - emu_timer *m_hblank_on_timer; + emu_timer *m_timer = nullptr; + emu_timer *m_hblank_on_timer = nullptr; std::unique_ptr m_bitmap; virtual void draw(int line); diff -Nru mame-0.242+dfsg.1/src/mame/video/kaneko_grap2.h mame-0.243+dfsg.1/src/mame/video/kaneko_grap2.h --- mame-0.242+dfsg.1/src/mame/video/kaneko_grap2.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/kaneko_grap2.h 2022-04-29 05:37:26.000000000 +0000 @@ -24,16 +24,16 @@ void do_rle(uint32_t address); void set_color_555(pen_t color, int rshift, int gshift, int bshift, uint16_t data); - uint16_t m_framebuffer_scrolly; - uint16_t m_framebuffer_scrollx; - uint16_t m_framebuffer_enable; - int m_regs1_i; + uint16_t m_framebuffer_scrolly = 0; + uint16_t m_framebuffer_scrollx = 0; + uint16_t m_framebuffer_enable = 0; + int m_regs1_i = 0; - uint16_t m_framebuffer_bright1; - uint16_t m_framebuffer_bright2; + uint16_t m_framebuffer_bright1 = 0; + uint16_t m_framebuffer_bright2 = 0; - uint16_t m_regs1_address_regs[0x2]; - uint16_t m_regs2; + uint16_t m_regs1_address_regs[0x2]{}; + uint16_t m_regs2 = 0; void framebuffer1_enable_w(uint16_t data) { m_framebuffer_enable = data; } diff -Nru mame-0.242+dfsg.1/src/mame/video/kaneko_tmap.h mame-0.243+dfsg.1/src/mame/video/kaneko_tmap.h --- mame-0.242+dfsg.1/src/mame/video/kaneko_tmap.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/kaneko_tmap.h 2022-04-29 05:37:26.000000000 +0000 @@ -87,7 +87,7 @@ view2_cb_delegate m_view2_cb; std::unique_ptr m_regs; - tilemap_t* m_tmap[2]; + tilemap_t* m_tmap[2]{}; }; diff -Nru mame-0.242+dfsg.1/src/mame/video/kangaroo.cpp mame-0.243+dfsg.1/src/mame/video/kangaroo.cpp --- mame-0.242+dfsg.1/src/mame/video/kangaroo.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/kangaroo.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,190 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Ville Laitinen, Aaron Giles -/*************************************************************************** - - Sun Electronics Kangaroo hardware - -***************************************************************************/ - -#include "emu.h" -#include "includes/kangaroo.h" - -/************************************* - * - * Video setup - * - *************************************/ - -void kangaroo_state::video_start() -{ - /* video RAM is accessed 32 bits at a time (two planes, 4bpp each, 4 pixels) */ - m_videoram = std::make_unique(256 * 64); - save_pointer(NAME(m_videoram), 256 * 64); -} - - - -/************************************* - * - * Video RAM accesses - * - *************************************/ - -void kangaroo_state::videoram_write( uint16_t offset, uint8_t data, uint8_t mask ) -{ - uint32_t expdata, layermask; - - /* data contains 4 2-bit values packed as DCBADCBA; expand these into 4 8-bit values */ - expdata = 0; - if (data & 0x01) expdata |= 0x00000055; - if (data & 0x10) expdata |= 0x000000aa; - if (data & 0x02) expdata |= 0x00005500; - if (data & 0x20) expdata |= 0x0000aa00; - if (data & 0x04) expdata |= 0x00550000; - if (data & 0x40) expdata |= 0x00aa0000; - if (data & 0x08) expdata |= 0x55000000; - if (data & 0x80) expdata |= 0xaa000000; - - /* determine which layers are enabled */ - layermask = 0; - if (mask & 0x08) layermask |= 0x30303030; - if (mask & 0x04) layermask |= 0xc0c0c0c0; - if (mask & 0x02) layermask |= 0x03030303; - if (mask & 0x01) layermask |= 0x0c0c0c0c; - - /* update layers */ - m_videoram[offset] = (m_videoram[offset] & ~layermask) | (expdata & layermask); -} - - -void kangaroo_state::kangaroo_videoram_w(offs_t offset, uint8_t data) -{ - videoram_write(offset, data, m_video_control[8]); -} - - - -/************************************* - * - * Video control writes - * - *************************************/ - -void kangaroo_state::kangaroo_video_control_w(offs_t offset, uint8_t data) -{ - m_video_control[offset] = data; - - switch (offset) - { - case 5: /* blitter start */ - blitter_execute(); - break; - - case 8: /* bank select */ - membank("bank1")->set_entry((data & 0x05) ? 0 : 1); - break; - } -} - - - -/************************************* - * - * DMA blitter - * - *************************************/ - -void kangaroo_state::blitter_execute( ) -{ - uint32_t gfxhalfsize = memregion("gfx1")->bytes() / 2; - const uint8_t *gfxbase = memregion("gfx1")->base(); - uint16_t src = m_video_control[0] + 256 * m_video_control[1]; - uint16_t dst = m_video_control[2] + 256 * m_video_control[3]; - uint8_t height = m_video_control[5]; - uint8_t width = m_video_control[4]; - uint8_t mask = m_video_control[8]; - int x, y; - - /* during DMA operations, the top 2 bits are ORed together, as well as the bottom 2 bits */ - /* adjust the mask to account for this */ - if (mask & 0x0c) mask |= 0x0c; - if (mask & 0x03) mask |= 0x03; - - /* loop over height, then width */ - for (y = 0; y <= height; y++, dst += 256) - for (x = 0; x <= width; x++) - { - uint16_t effdst = (dst + x) & 0x3fff; - uint16_t effsrc = src++ & (gfxhalfsize - 1); - videoram_write(effdst, gfxbase[0 * gfxhalfsize + effsrc], mask & 0x05); - videoram_write(effdst, gfxbase[1 * gfxhalfsize + effsrc], mask & 0x0a); - } -} - - - -/************************************* - * - * Video updater - * - *************************************/ - -uint32_t kangaroo_state::screen_update_kangaroo(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) -{ - uint8_t scrolly = m_video_control[6]; - uint8_t scrollx = m_video_control[7]; - uint8_t maska = (m_video_control[10] & 0x28) >> 3; - uint8_t maskb = (m_video_control[10] & 0x07) >> 0; - uint8_t xora = (m_video_control[9] & 0x20) ? 0xff : 0x00; - uint8_t xorb = (m_video_control[9] & 0x10) ? 0xff : 0x00; - uint8_t enaa = (m_video_control[9] & 0x08); - uint8_t enab = (m_video_control[9] & 0x04); - uint8_t pria = (~m_video_control[9] & 0x02); - uint8_t prib = (~m_video_control[9] & 0x01); - - /* iterate over pixels */ - for (int y = cliprect.min_y; y <= cliprect.max_y; y++) - { - uint32_t *const dest = &bitmap.pix(y); - - for (int x = cliprect.min_x; x <= cliprect.max_x; x += 2) - { - uint8_t effxa = scrollx + ((x / 2) ^ xora); - uint8_t effya = scrolly + (y ^ xora); - uint8_t effxb = (x / 2) ^ xorb; - uint8_t effyb = y ^ xorb; - uint8_t pixa = (m_videoram[effya + 256 * (effxa / 4)] >> (8 * (effxa % 4) + 0)) & 0x0f; - uint8_t pixb = (m_videoram[effyb + 256 * (effxb / 4)] >> (8 * (effxb % 4) + 4)) & 0x0f; - uint8_t finalpens; - - /* for each layer, contribute bits if (a) enabled, and (b) either has priority or the opposite plane is 0 */ - finalpens = 0; - if (enaa && (pria || pixb == 0)) - finalpens |= pixa; - if (enab && (prib || pixa == 0)) - finalpens |= pixb; - - /* store the first of two pixels, which is always full brightness */ - dest[x + 0] = m_palette->pen_color(finalpens & 7); - - /* KOS1 alternates at 5MHz, offset from the pixel clock by 1/2 clock */ - /* when 0, it enables the color mask for pixels with Z = 0 */ - finalpens = 0; - if (enaa && (pria || pixb == 0)) - { - if (!(pixa & 0x08)) pixa &= maska; - finalpens |= pixa; - } - if (enab && (prib || pixa == 0)) - { - if (!(pixb & 0x08)) pixb &= maskb; - finalpens |= pixb; - } - - /* store the second of two pixels, which is affected by KOS1 and the A/B masks */ - dest[x + 1] = m_palette->pen_color(finalpens & 7); - } - } - - return 0; -} diff -Nru mame-0.242+dfsg.1/src/mame/video/kan_pand.h mame-0.243+dfsg.1/src/mame/video/kan_pand.h --- mame-0.242+dfsg.1/src/mame/video/kan_pand.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/kan_pand.h 2022-04-29 05:37:26.000000000 +0000 @@ -53,12 +53,12 @@ // internal state std::unique_ptr m_spriteram; std::unique_ptr m_sprites_bitmap; /* bitmap to render sprites to, Pandora seems to be frame'buffered' */ - int m_clear_bitmap; - int m_bg_pen; // might work some other way.. + int m_clear_bitmap = 0; + int m_bg_pen = 0; // might work some other way.. uint8_t m_gfx_region; int m_xoffset; int m_yoffset; - bool m_flip_screen; + bool m_flip_screen = false; required_device m_gfxdecode; }; diff -Nru mame-0.242+dfsg.1/src/mame/video/ksayakyu.cpp mame-0.243+dfsg.1/src/mame/video/ksayakyu.cpp --- mame-0.242+dfsg.1/src/mame/video/ksayakyu.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/ksayakyu.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,134 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Tomasz Slanina -#include "emu.h" -#include "includes/ksayakyu.h" - - -void ksayakyu_state::ksayakyu_videoram_w(offs_t offset, uint8_t data) -{ - m_videoram[offset]=data; - m_textmap->mark_tile_dirty(offset >> 1); -} - -void ksayakyu_state::ksayakyu_videoctrl_w(uint8_t data) -{ - /* - bits: - 76543210 - xx - ?? layers enable ? - x - screen flip - xx - ?? - xxx - scroll offset - - */ - m_video_ctrl = data; - - m_flipscreen = data & 4; - flip_screen_set(m_flipscreen); - m_tilemap->set_scrolly(0, (data & 0xe0) << 3); - if(m_flipscreen) - m_tilemap->set_flip((data & 2) ? TILEMAP_FLIPY : TILEMAP_FLIPX | TILEMAP_FLIPY); - else - m_tilemap->set_flip((data & 2) ? TILEMAP_FLIPX : 0); -} - -void ksayakyu_state::ksayakyu_palette(palette_device &palette) const -{ - uint8_t const *const prom = memregion("proms")->base(); - - for (int i = 0; i < 0x100; i++) - { - int const r = (prom[i] >> 0) & 0x07; - int const g = (prom[i] >> 3) & 0x07; - int const b = (prom[i] >> 6) & 0x03; - - palette.set_pen_color(i, pal3bit(r), pal3bit(g), pal2bit(b)); - } -} - -TILE_GET_INFO_MEMBER(ksayakyu_state::get_ksayakyu_tile_info) -{ - int code = memregion("user1")->base()[tile_index]; - int attr = memregion("user1")->base()[tile_index + 0x2000]; - code += (attr & 3) << 8; - tileinfo.set(1, code, ((attr >> 2) & 0x0f) * 2, (attr & 0x80) ? TILE_FLIPX : 0); -} - -/* -x--- ---- flip bits --y-- ---- unknown, used when runner slides (NOT flip Y!) ---cc cc-- color ----- --bb bank select -*/ -TILE_GET_INFO_MEMBER(ksayakyu_state::get_text_tile_info) -{ - int code = m_videoram[tile_index * 2 + 1]; - int attr = m_videoram[tile_index * 2]; - int flags = ((attr & 0x80) ? TILE_FLIPX : 0);// | ((attr & 0x40) ? TILE_FLIPY : 0); - int color = (attr & 0x3c) >> 2; - - code |= (attr & 3) << 8; - - tileinfo.set(0, code, color, flags); -} - -/* -[0] X--- ---- flip x - -ttt tttt tile number -[1] yyyy yyyy Y offset -[2] xxxx xxxx X offset -[3] -*/ - -void ksayakyu_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ) -{ - const uint8_t *source = m_spriteram + m_spriteram.bytes() - 4; - const uint8_t *finish = m_spriteram; - - while (source>=finish) /* is order correct ? */ - { - int sx = source[2]; - int sy = 240 - source[1]; - int attributes = source[3]; - int tile = source[0]; - int flipx = (tile & 0x80) ? 1 : 0; - int flipy = 0; - - gfx_element *gfx = m_gfxdecode->gfx(2); - - if (m_flipscreen) - { - sx = 240 - sx; - sy = 240 - sy; - flipx ^= 1; - flipy ^= 1; - } - - gfx->transpen(bitmap,cliprect, - tile & 0x7f, - (attributes & 0x78) >> 3, - flipx,flipy, - sx,sy,0 ); - - source -= 4; - } -} - -void ksayakyu_state::video_start() -{ - m_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(ksayakyu_state::get_ksayakyu_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32 * 8); - m_textmap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(ksayakyu_state::get_text_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); - m_textmap->set_transparent_pen(0); -} - -uint32_t ksayakyu_state::screen_update_ksayakyu(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - bitmap.fill(0, cliprect); - - if (m_video_ctrl & 1) - m_tilemap->draw(screen, bitmap, cliprect, 0, 0); - - m_textmap->draw(screen, bitmap, cliprect, 0, 0); - draw_sprites(bitmap, cliprect); - return 0; -} diff -Nru mame-0.242+dfsg.1/src/mame/video/labyrunr.cpp mame-0.243+dfsg.1/src/mame/video/labyrunr.cpp --- mame-0.242+dfsg.1/src/mame/video/labyrunr.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/labyrunr.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,260 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Nicola Salmoria -#include "emu.h" - -#include "includes/labyrunr.h" - -void labyrunr_state::labyrunr_palette(palette_device &palette) const -{ - const uint8_t *color_prom = memregion("proms")->base(); - - for (int pal = 0; pal < 8; pal++) - { - if (pal & 1) - { - // chars, no lookup table - for (int i = 0; i < 0x100; i++) - palette.set_pen_indirect((pal << 8) | i, (pal << 4) | (i & 0x0f)); - } - else - { - // sprites - for (int i = 0; i < 0x100; i++) - { - uint8_t const ctabentry = !color_prom[i] ? 0 : ((pal << 4) | (color_prom[i] & 0x0f)); - - palette.set_pen_indirect((pal << 8) | i, ctabentry); - } - } - } -} - - - -/*************************************************************************** - - Callbacks for the TileMap code - -***************************************************************************/ - -TILE_GET_INFO_MEMBER(labyrunr_state::get_tile_info0) -{ - uint8_t ctrl_3 = m_k007121->ctrlram_r(3); - uint8_t ctrl_4 = m_k007121->ctrlram_r(4); - uint8_t ctrl_5 = m_k007121->ctrlram_r(5); - uint8_t ctrl_6 = m_k007121->ctrlram_r(6); - int attr = m_videoram1[tile_index]; - int code = m_videoram1[tile_index + 0x400]; - int bit0 = (ctrl_5 >> 0) & 0x03; - int bit1 = (ctrl_5 >> 2) & 0x03; - int bit2 = (ctrl_5 >> 4) & 0x03; - int bit3 = (ctrl_5 >> 6) & 0x03; - int bank = ((attr & 0x80) >> 7) | - ((attr >> (bit0+2)) & 0x02) | - ((attr >> (bit1+1)) & 0x04) | - ((attr >> (bit2 )) & 0x08) | - ((attr >> (bit3-1)) & 0x10) | - ((ctrl_3 & 0x01) << 5); - int mask = (ctrl_4 & 0xf0) >> 4; - - bank = (bank & ~(mask << 1)) | ((ctrl_4 & mask) << 1); - - tileinfo.set(0, - code + bank * 256, - ((ctrl_6 & 0x30) * 2 + 16)+(attr & 7), - 0); - tileinfo.category = (attr & 0x40) >> 6; -} - -TILE_GET_INFO_MEMBER(labyrunr_state::get_tile_info1) -{ - uint8_t ctrl_3 = m_k007121->ctrlram_r(3); - uint8_t ctrl_4 = m_k007121->ctrlram_r(4); - uint8_t ctrl_5 = m_k007121->ctrlram_r(5); - uint8_t ctrl_6 = m_k007121->ctrlram_r(6); - int attr = m_videoram2[tile_index]; - int code = m_videoram2[tile_index + 0x400]; - int bit0 = (ctrl_5 >> 0) & 0x03; - int bit1 = (ctrl_5 >> 2) & 0x03; - int bit2 = (ctrl_5 >> 4) & 0x03; - int bit3 = (ctrl_5 >> 6) & 0x03; - int bank = ((attr & 0x80) >> 7) | - ((attr >> (bit0+2)) & 0x02) | - ((attr >> (bit1+1)) & 0x04) | - ((attr >> (bit2 )) & 0x08) | - ((attr >> (bit3-1)) & 0x10) | - ((ctrl_3 & 0x01) << 5); - int mask = (ctrl_4 & 0xf0) >> 4; - - bank = (bank & ~(mask << 1)) | ((ctrl_4 & mask) << 1); - - tileinfo.set(0, - code+bank*256, - ((ctrl_6 & 0x30) * 2 + 16) + (attr & 7), - 0); -} - - -/*************************************************************************** - - Start the video hardware emulation. - -***************************************************************************/ - -void labyrunr_state::video_start() -{ - m_layer0 = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(labyrunr_state::get_tile_info0)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); - m_layer1 = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(labyrunr_state::get_tile_info1)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); - - m_layer0->set_transparent_pen(0); - m_layer1->set_transparent_pen(0); - - m_clip0 = m_screen->visible_area(); - m_clip0.min_x += 40; - - m_clip1 = m_screen->visible_area(); - m_clip1.max_x = 39; - m_clip1.min_x = 0; - - m_layer0->set_scroll_cols(32); -} - - - -/*************************************************************************** - - Memory Handlers - -***************************************************************************/ - -void labyrunr_state::labyrunr_vram1_w(offs_t offset, uint8_t data) -{ - m_videoram1[offset] = data; - m_layer0->mark_tile_dirty(offset & 0x3ff); -} - -void labyrunr_state::labyrunr_vram2_w(offs_t offset, uint8_t data) -{ - m_videoram2[offset] = data; - m_layer1->mark_tile_dirty(offset & 0x3ff); -} - - - -/*************************************************************************** - - Screen Refresh - -***************************************************************************/ - -uint32_t labyrunr_state::screen_update_labyrunr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - uint8_t ctrl_0 = m_k007121->ctrlram_r(0); - rectangle finalclip0, finalclip1; - - screen.priority().fill(0, cliprect); - bitmap.fill(m_palette->black_pen(), cliprect); - - if (~m_k007121->ctrlram_r(3) & 0x20) - { - int i; - - finalclip0 = m_clip0; - finalclip1 = m_clip1; - - finalclip0 &= cliprect; - finalclip1 &= cliprect; - - m_layer0->set_scrollx(0, ctrl_0 - 40); - m_layer1->set_scrollx(0, 0); - - for(i = 0; i < 32; i++) - { - /* enable colscroll */ - if((m_k007121->ctrlram_r(1) & 6) == 6) // it's probably just one bit, but it's only used once in the game so I don't know which it's - m_layer0->set_scrolly((i + 2) & 0x1f, m_k007121->ctrlram_r(2) + m_scrollram[i]); - else - m_layer0->set_scrolly((i + 2) & 0x1f, m_k007121->ctrlram_r(2)); - } - - m_layer0->draw(screen, bitmap, finalclip0, TILEMAP_DRAW_OPAQUE | TILEMAP_DRAW_CATEGORY(0), 0); - m_k007121->sprites_draw(bitmap, cliprect, m_gfxdecode->gfx(0), *m_palette, m_spriteram,(m_k007121->ctrlram_r(6) & 0x30) * 2, 40,0,screen.priority(),(m_k007121->ctrlram_r(3) & 0x40) >> 5); - m_layer0->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_layer1->draw(screen, bitmap, finalclip1, TILEMAP_DRAW_OPAQUE, 0); - } - else - { - int use_clip3[2] = { 0, 0 }; - rectangle finalclip3; - - /* custom cliprects needed for the weird effect used in the endinq sequence to hide and show the needed part of text */ - finalclip0.min_y = finalclip1.min_y = cliprect.min_y; - finalclip0.max_y = finalclip1.max_y = cliprect.max_y; - - if(m_k007121->ctrlram_r(1) & 1) - { - finalclip0.min_x = cliprect.max_x - ctrl_0 + 8; - finalclip0.max_x = cliprect.max_x; - - if(ctrl_0 >= 40) - { - finalclip1.min_x = cliprect.min_x; - } - else - { - use_clip3[0] = 1; - - finalclip1.min_x = 40 - ctrl_0; - } - - finalclip1.max_x = cliprect.max_x - ctrl_0 + 8; - - } - else - { - if(ctrl_0 >= 40) - { - finalclip0.min_x = cliprect.min_x; - } - else - { - use_clip3[1] = 1; - - finalclip0.min_x = 40 - ctrl_0; - } - - finalclip0.max_x = cliprect.max_x - ctrl_0 + 8; - - finalclip1.min_x = cliprect.max_x - ctrl_0 + 8; - finalclip1.max_x = cliprect.max_x; - } - - if(use_clip3[0] || use_clip3[1]) - { - finalclip3.min_y = cliprect.min_y; - finalclip3.max_y = cliprect.max_y; - finalclip3.min_x = cliprect.min_x; - finalclip3.max_x = 40 - ctrl_0 - 8; - } - - m_layer0->set_scrollx(0, ctrl_0 - 40); - m_layer1->set_scrollx(0, ctrl_0 - 40); - - m_layer0->draw(screen, bitmap, finalclip0, TILEMAP_DRAW_CATEGORY(0), 0); - if(use_clip3[0]) - m_layer0->draw(screen, bitmap, finalclip3, TILEMAP_DRAW_CATEGORY(0), 0); - - m_k007121->sprites_draw(bitmap, cliprect, m_gfxdecode->gfx(0), *m_palette, m_spriteram, (m_k007121->ctrlram_r(6) & 0x30) * 2,40,0,screen.priority(),(m_k007121->ctrlram_r(3) & 0x40) >> 5); - - m_layer0->draw(screen, bitmap, finalclip0, TILEMAP_DRAW_CATEGORY(1), 0); - if(use_clip3[0]) - m_layer0->draw(screen, bitmap, finalclip3, TILEMAP_DRAW_CATEGORY(1), 0); - - m_layer1->draw(screen, bitmap, finalclip1, 0, 0); - if(use_clip3[1]) - m_layer1->draw(screen, bitmap, finalclip3, 0, 0); - - } - return 0; -} diff -Nru mame-0.242+dfsg.1/src/mame/video/ladybug.h mame-0.243+dfsg.1/src/mame/video/ladybug.h --- mame-0.242+dfsg.1/src/mame/video/ladybug.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/ladybug.h 2022-04-29 05:37:26.000000000 +0000 @@ -55,7 +55,7 @@ private: u8 m_enable; u8 m_speed; - u32 m_state; + u32 m_state = 0; u16 m_offset; u8 m_count; }; diff -Nru mame-0.242+dfsg.1/src/mame/video/light.h mame-0.243+dfsg.1/src/mame/video/light.h --- mame-0.242+dfsg.1/src/mame/video/light.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/light.h 2022-04-29 05:37:26.000000000 +0000 @@ -40,28 +40,28 @@ struct lg1_t { - uint32_t m_config_sel; - uint32_t m_write_addr; - uint32_t m_control; + uint32_t m_config_sel = 0; + uint32_t m_write_addr = 0; + uint32_t m_control = 0; - uint32_t m_command; - uint32_t m_x_start_i; - uint32_t m_y_start_i; - uint32_t m_xy_move; - uint32_t m_color_red_i; - uint32_t m_color_green_i; - uint32_t m_color_blue_i; - uint32_t m_color_back; - uint32_t m_z_pattern; - uint32_t m_x_end_i; - uint32_t m_y_end_i; - uint32_t m_x_curr_i; - uint32_t m_y_curr_i; + uint32_t m_command = 0; + uint32_t m_x_start_i = 0; + uint32_t m_y_start_i = 0; + uint32_t m_xy_move = 0; + uint32_t m_color_red_i = 0; + uint32_t m_color_green_i = 0; + uint32_t m_color_blue_i = 0; + uint32_t m_color_back = 0; + uint32_t m_z_pattern = 0; + uint32_t m_x_end_i = 0; + uint32_t m_y_end_i = 0; + uint32_t m_x_curr_i = 0; + uint32_t m_y_curr_i = 0; - uint8_t m_palette_idx; - uint8_t m_palette_channel; - uint8_t m_palette_entry[3]; - uint8_t m_pix_read_mask[256]; + uint8_t m_palette_idx = 0; + uint8_t m_palette_channel = 0; + uint8_t m_palette_entry[3]{}; + uint8_t m_pix_read_mask[256]{}; }; lg1_t m_lg1; diff -Nru mame-0.242+dfsg.1/src/mame/video/m90.cpp mame-0.243+dfsg.1/src/mame/video/m90.cpp --- mame-0.242+dfsg.1/src/mame/video/m90.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/m90.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -150,7 +150,7 @@ int x,y,sprite,colour,fx,fy; - while ((offs < m_spriteram.bytes()/2) & (m_spriteram[offs+0] != 0x8000)) + while ((offs < m_spriteram.bytes()/2) && (m_spriteram[offs+0] != 0x8000)) { last_sprite = offs; offs += 4; @@ -187,7 +187,7 @@ int offs = 0, last_sprite = 0; int x,y,sprite,colour,fx,fy; - while ((offs < m_spriteram.bytes()/2) & (m_spriteram[offs+0] != 0xffff)) + while ((offs < m_spriteram.bytes()/2) && (m_spriteram[offs+0] != 0xffff)) { last_sprite = offs; offs += 4; diff -Nru mame-0.242+dfsg.1/src/mame/video/m92.cpp mame-0.243+dfsg.1/src/mame/video/m92.cpp --- mame-0.242+dfsg.1/src/mame/video/m92.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/m92.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -111,6 +111,17 @@ enabled. This was one of the earlier games and could actually be a different motherboard revision (most games use M92-A-B top pcb, a M92-A-A revision could exist...). + + There is a further test case with R-Type Leo. The flickering + invulnerability effect when you spawn does not work correctly + with the palette bank hooked up, and also causes a 2nd player + spawning in to have the incorrect palette at first. + + It appears that the only games requiring the palette bank logic + are Major Title 2, Ninja Baseball Bat Man, Dream Soccer '94 + and Gun Force 2. These are also the games with the extended + ROM banking, suggesting a difference on those boards is a more + likely explanation. */ /* @@ -128,7 +139,8 @@ */ /* Access to upper palette bank */ - m_palette_bank = (m_videocontrol >> 1) & 1; + if (m_palette->entries() == 2048) + m_palette_bank = (m_videocontrol >> 1) & 1; // logerror("%s: videocontrol_w %d = %02x\n",m_maincpu->pc(),offset,data); } @@ -156,7 +168,7 @@ tileinfo.set(0, tile, - attrib & 0x7f, + (m_palette->entries() == 2048) ? (attrib & 0x7f) : (attrib & 0x3f), TILE_FLIPYX(attrib >> 9)); if (attrib & 0x100) tileinfo.group = 2; else if (attrib & 0x80) tileinfo.group = 1; @@ -233,6 +245,13 @@ { m_spritebuffer_timer = timer_alloc(TIMER_SPRITEBUFFER); + memset(m_pf_master_control, 0, sizeof(m_pf_master_control)); + m_videocontrol = 0; + m_sprite_list = 0; + m_raster_irq_position = 0; + m_sprite_buffer_busy = 0; + m_palette_bank = 0; + memset(&m_pf_layer, 0, sizeof(m_pf_layer)); for (int laynum = 0; laynum < 3; laynum++) { @@ -304,23 +323,22 @@ void m92_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { uint16_t *source = m_spriteram->buffer(); - int offs, layer; - for (layer = 0; layer < 8; layer++) + for (int layer = 0; layer < 8; layer++) { - for (offs = 0; offs < m_sprite_list; ) + for (int offs = 0; offs < m_sprite_list; ) { int x = source[offs+3] & 0x1ff; int y = source[offs+0] & 0x1ff; int code = source[offs+1]; - int color = source[offs+2] & 0x007f; + int color = source[offs+2]; + color &= (m_palette->entries() == 2048) ? 0x7f : 0x3f; int pri = (~source[offs+2] >> 6) & 2; int curlayer = (source[offs+0] >> 13) & 7; int flipx = (source[offs+2] >> 8) & 1; int flipy = (source[offs+2] >> 9) & 1; int numcols = 1 << ((source[offs+0] >> 11) & 3); int numrows = 1 << ((source[offs+0] >> 9) & 3); - int row, col, s_ptr; offs += 4 * numcols; if (layer != curlayer) continue; @@ -330,12 +348,12 @@ if (flipx) x += 16 * (numcols - 1); - for (col = 0; col < numcols; col++) + for (int col = 0; col < numcols; col++) { - s_ptr = 8 * col; + int s_ptr = 8 * col; if (!flipy) s_ptr += numrows - 1; - for (row = 0; row < numrows; row++) + for (int row = 0; row < numrows; row++) { if (flip_screen()) { @@ -528,7 +546,7 @@ draw_sprites(screen, bitmap, cliprect); /* Flipscreen appears hardwired to the dipswitch - strange */ - if (ioport("DSW")->read() & 0x100) + if (m_dsw->read() & 0x100) flip_screen_set(0); else flip_screen_set(1); @@ -545,7 +563,7 @@ ppan_draw_sprites(screen, bitmap, cliprect); /* Flipscreen appears hardwired to the dipswitch - strange */ - if (ioport("DSW")->read() & 0x100) + if (m_dsw->read() & 0x100) flip_screen_set(0); else flip_screen_set(1); diff -Nru mame-0.242+dfsg.1/src/mame/video/maria.h mame-0.243+dfsg.1/src/mame/video/maria.h --- mame-0.242+dfsg.1/src/mame/video/maria.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/maria.h 2022-04-29 05:37:26.000000000 +0000 @@ -32,25 +32,25 @@ private: - int m_maria_palette[32]; - int m_line_ram[2][160]; - int m_active_buffer; - int m_write_mode; - unsigned int m_dll; - unsigned int m_dl; - int m_holey; - int m_offset; - int m_vblank; - int m_dmaon; - int m_dpp; - int m_wsync; - int m_color_kill; - int m_cwidth; - int m_bcntl; - int m_kangaroo; - int m_rm; - int m_nmi; - unsigned int m_charbase; + int m_maria_palette[32]{}; + int m_line_ram[2][160]{}; + int m_active_buffer = 0; + int m_write_mode = 0; + unsigned int m_dll = 0; + unsigned int m_dl = 0; + int m_holey = 0; + int m_offset = 0; + int m_vblank = 0; + int m_dmaon = 0; + int m_dpp = 0; + int m_wsync = 0; + int m_color_kill = 0; + int m_cwidth = 0; + int m_bcntl = 0; + int m_kangaroo = 0; + int m_rm = 0; + int m_nmi = 0; + unsigned int m_charbase = 0; bitmap_ind16 m_bitmap; void draw_scanline(); diff -Nru mame-0.242+dfsg.1/src/mame/video/mcd212.h mame-0.243+dfsg.1/src/mame/video/mcd212.h --- mame-0.242+dfsg.1/src/mame/video/mcd212.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/mcd212.h 2022-04-29 05:37:26.000000000 +0000 @@ -179,28 +179,28 @@ ICM_CLUT4 = 0xb }; - uint8_t m_csrr[2]; - uint16_t m_csrw[2]; - uint16_t m_dcr[2]; - uint16_t m_vsr[2]; - uint16_t m_ddr[2]; - uint16_t m_dcp[2]; - uint32_t m_dca[2]; - uint32_t m_clut[256]; - uint32_t m_image_coding_method; - uint32_t m_transparency_control; - uint32_t m_plane_order; - uint32_t m_clut_bank[2]; - uint32_t m_transparent_color[2]; - uint32_t m_mask_color[2]; - uint32_t m_dyuv_abs_start[2]; - uint32_t m_cursor_position; - uint32_t m_cursor_control; - uint32_t m_cursor_pattern[16]; - uint32_t m_region_control[8]; - uint32_t m_backdrop_color; - uint32_t m_mosaic_hold[2]; - uint8_t m_weight_factor[2][768]; + uint8_t m_csrr[2]{}; + uint16_t m_csrw[2]{}; + uint16_t m_dcr[2]{}; + uint16_t m_vsr[2]{}; + uint16_t m_ddr[2]{}; + uint16_t m_dcp[2]{}; + uint32_t m_dca[2]{}; + uint32_t m_clut[256]{}; + uint32_t m_image_coding_method = 0; + uint32_t m_transparency_control = 0; + uint32_t m_plane_order = 0; + uint32_t m_clut_bank[2]{}; + uint32_t m_transparent_color[2]{}; + uint32_t m_mask_color[2]{}; + uint32_t m_dyuv_abs_start[2]{}; + uint32_t m_cursor_position = 0; + uint32_t m_cursor_control = 0; + uint32_t m_cursor_pattern[16]{}; + uint32_t m_region_control[8]{}; + uint32_t m_backdrop_color = 0; + uint32_t m_mosaic_hold[2]{}; + uint8_t m_weight_factor[2][768]{}; // DYUV color limit arrays. uint32_t m_dyuv_limit_r_lut[3 * 0xff]; @@ -232,11 +232,11 @@ required_shared_ptr m_planeb; // internal state - bool m_region_flag[2][768]; - int m_ica_height; - int m_total_height; - emu_timer *m_ica_timer; - emu_timer *m_dca_timer; + bool m_region_flag[2][768]{}; + int m_ica_height = 0; + int m_total_height = 0; + emu_timer *m_ica_timer = nullptr; + emu_timer *m_dca_timer = nullptr; static const uint32_t s_4bpp_color[16]; diff -Nru mame-0.242+dfsg.1/src/mame/video/model2.cpp mame-0.243+dfsg.1/src/mame/video/model2.cpp --- mame-0.242+dfsg.1/src/mame/video/model2.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/model2.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -944,9 +944,9 @@ int xoffs = (-m_crtc_xoffset)/2; int yoffs = m_crtc_yoffset/2; - for (int y = cliprect.min_y; y <= cliprect.max_y; ++y) + for (int y = cliprect.min_y; y < cliprect.max_y; ++y) { - for (int x = cliprect.min_x; x <= cliprect.max_x; x++) + for (int x = cliprect.min_x; x < cliprect.max_x; x++) { int offset = (x + xoffs) + (y + yoffs)*512; int b = (fbvram[offset] >> 0) & 0x1f; diff -Nru mame-0.242+dfsg.1/src/mame/video/ms1_tmap.h mame-0.243+dfsg.1/src/mame/video/ms1_tmap.h --- mame-0.242+dfsg.1/src/mame/video/ms1_tmap.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/ms1_tmap.h 2022-04-29 05:37:26.000000000 +0000 @@ -73,12 +73,12 @@ DECLARE_GFXDECODE_MEMBER(gfxinfo); // internal state - uint16_t m_scrollx; - uint16_t m_scrolly; - uint16_t m_scroll_flag; - uint16_t m_tile_bank; - tilemap_t *m_tmap; - tilemap_t *m_tilemap[2][4]; + uint16_t m_scrollx = 0; + uint16_t m_scrolly = 0; + uint16_t m_scroll_flag = 0; + uint16_t m_tile_bank = 0; + tilemap_t *m_tmap = nullptr; + tilemap_t *m_tilemap[2][4]{}; // helpers TILEMAP_MAPPER_MEMBER(scan_8x8); diff -Nru mame-0.242+dfsg.1/src/mame/video/n64types.h mame-0.243+dfsg.1/src/mame/video/n64types.h --- mame-0.242+dfsg.1/src/mame/video/n64types.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/n64types.h 2022-04-29 05:37:26.000000000 +0000 @@ -14,24 +14,24 @@ m_min_level = 0; } - int32_t m_fb_format; // Framebuffer pixel format index (0 - I, 1 - IA, 2 - CI, 3 - RGBA) - int32_t m_fb_size; // Framebuffer pixel size index (0 - 4bpp, 1 - 8bpp, 2 - 16bpp, 3 - 32bpp) - int32_t m_fb_width; // Framebuffer width, in pixels - int32_t m_fb_height; // Framebuffer height, in pixels - uint32_t m_fb_address; // Framebuffer source address offset (in bytes) from start of RDRAM - - uint32_t m_zb_address; // Z-buffer source address offset (in bytes) from start of RDRAM - - int32_t m_ti_format; // Format for Texture Interface (TI) transfers - int32_t m_ti_size; // Size (in bytes) of TI transfers - int32_t m_ti_width; // Width (in pixels) of TI transfers - uint32_t m_ti_address; // Destination address for TI transfers + int32_t m_fb_format = 0; // Framebuffer pixel format index (0 - I, 1 - IA, 2 - CI, 3 - RGBA) + int32_t m_fb_size = 0; // Framebuffer pixel size index (0 - 4bpp, 1 - 8bpp, 2 - 16bpp, 3 - 32bpp) + int32_t m_fb_width = 0; // Framebuffer width, in pixels + int32_t m_fb_height = 0; // Framebuffer height, in pixels + uint32_t m_fb_address = 0; // Framebuffer source address offset (in bytes) from start of RDRAM + + uint32_t m_zb_address = 0; // Z-buffer source address offset (in bytes) from start of RDRAM + + int32_t m_ti_format = 0; // Format for Texture Interface (TI) transfers + int32_t m_ti_size = 0; // Size (in bytes) of TI transfers + int32_t m_ti_width = 0; // Width (in pixels) of TI transfers + uint32_t m_ti_address = 0; // Destination address for TI transfers uint32_t m_max_level; // Maximum LOD level for texture filtering uint32_t m_min_level; // Minimum LOD level for texture filtering - uint16_t m_primitive_z; // Forced Z value for current primitive, if applicable - uint16_t m_primitive_dz; // Forced Delta-Z value for current primitive, if applicable + uint16_t m_primitive_z = 0; // Forced Z value for current primitive, if applicable + uint16_t m_primitive_dz = 0; // Forced Delta-Z value for current primitive, if applicable }; #if 0 diff -Nru mame-0.242+dfsg.1/src/mame/video/namco_c169roz.h mame-0.243+dfsg.1/src/mame/video/namco_c169roz.h --- mame-0.242+dfsg.1/src/mame/video/namco_c169roz.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/namco_c169roz.h 2022-04-29 05:37:26.000000000 +0000 @@ -53,12 +53,12 @@ TILEMAP_MAPPER_MEMBER( mapper ); static const int ROZ_TILEMAP_COUNT = 2; - tilemap_t *m_tilemap[ROZ_TILEMAP_COUNT]; + tilemap_t *m_tilemap[ROZ_TILEMAP_COUNT]{}; uint16_t m_control[0x20/2]; std::vector m_videoram; int m_color_base; DECLARE_GFXDECODE_MEMBER(gfxinfo); - uint32_t m_ramsize; + uint32_t m_ramsize = 0; // per-game hacks bool m_is_namcofl; diff -Nru mame-0.242+dfsg.1/src/mame/video/namco_c355spr.h mame-0.243+dfsg.1/src/mame/video/namco_c355spr.h --- mame-0.242+dfsg.1/src/mame/video/namco_c355spr.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/namco_c355spr.h 2022-04-29 05:37:26.000000000 +0000 @@ -122,7 +122,7 @@ }; std::unique_ptr m_spritelist[2]; - const c355_sprite *m_sprite_end[2]; + const c355_sprite *m_sprite_end[2]{}; int m_palxor; u16 m_position[4]; std::unique_ptr m_spriteram[2]; diff -Nru mame-0.242+dfsg.1/src/mame/video/namco_c45road.h mame-0.243+dfsg.1/src/mame/video/namco_c45road.h --- mame-0.242+dfsg.1/src/mame/video/namco_c45road.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/namco_c45road.h 2022-04-29 05:37:26.000000000 +0000 @@ -60,7 +60,7 @@ required_shared_ptr m_tileram; required_shared_ptr m_lineram; optional_region_ptr m_clut; - tilemap_t * m_tilemap; + tilemap_t * m_tilemap = nullptr; pen_t m_transparent_color; int m_xoffset; }; diff -Nru mame-0.242+dfsg.1/src/mame/video/namcos2_roz.h mame-0.243+dfsg.1/src/mame/video/namcos2_roz.h --- mame-0.242+dfsg.1/src/mame/video/namcos2_roz.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/namcos2_roz.h 2022-04-29 05:37:26.000000000 +0000 @@ -33,7 +33,7 @@ void zdrawgfxzoom(screen_device &screen, bitmap_rgb32 &dest_bmp, const rectangle &clip, gfx_element *gfx, uint32_t code, uint32_t color, int flipx, int flipy, int sx, int sy, int scalex, int scaley, int zpos); TILE_GET_INFO_MEMBER( roz_tile_info ); - tilemap_t *m_tilemap_roz; + tilemap_t *m_tilemap_roz = nullptr; required_shared_ptr m_rozram; required_shared_ptr m_roz_ctrl; diff -Nru mame-0.242+dfsg.1/src/mame/video/neogeo_spr.h mame-0.243+dfsg.1/src/mame/video/neogeo_spr.h --- mame-0.242+dfsg.1/src/mame/video/neogeo_spr.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/neogeo_spr.h 2022-04-29 05:37:26.000000000 +0000 @@ -51,24 +51,24 @@ void set_pens(const pen_t* pens); std::unique_ptr m_videoram; - uint16_t *m_videoram_drawsource; + uint16_t *m_videoram_drawsource = nullptr; - uint16_t m_vram_offset; - uint16_t m_vram_read_buffer; - uint16_t m_vram_modulo; + uint16_t m_vram_offset = 0; + uint16_t m_vram_read_buffer = 0; + uint16_t m_vram_modulo = 0; - uint32_t m_sprite_gfx_address_mask; + uint32_t m_sprite_gfx_address_mask = 0; - uint8_t m_auto_animation_speed; - uint8_t m_auto_animation_disabled; - uint8_t m_auto_animation_counter; - uint8_t m_auto_animation_frame_counter; + uint8_t m_auto_animation_speed = 0; + uint8_t m_auto_animation_disabled = 0; + uint8_t m_auto_animation_counter = 0; + uint8_t m_auto_animation_frame_counter = 0; - uint8_t m_fixed_layer_source; - uint8_t m_fixed_layer_bank_type; + uint8_t m_fixed_layer_source = 0; + uint8_t m_fixed_layer_bank_type = 0; - emu_timer *m_auto_animation_timer; - emu_timer *m_sprite_line_timer; + emu_timer *m_auto_animation_timer = nullptr; + emu_timer *m_sprite_line_timer = nullptr; TIMER_CALLBACK_MEMBER(auto_animation_timer_callback); TIMER_CALLBACK_MEMBER(sprite_line_timer_callback); @@ -86,10 +86,10 @@ virtual void device_start() override; virtual void device_reset() override; uint32_t get_region_mask(uint8_t* rgn, uint32_t rgn_size); - uint8_t* m_region_sprites; uint32_t m_region_sprites_size; - uint8_t* m_region_fixed; uint32_t m_region_fixed_size; - memory_region* m_region_fixedbios; - const pen_t *m_pens; + uint8_t* m_region_sprites = nullptr; uint32_t m_region_sprites_size = 0; + uint8_t* m_region_fixed = nullptr; uint32_t m_region_fixed_size = 0; + memory_region* m_region_fixedbios = nullptr; + const pen_t *m_pens = nullptr; required_region_ptr m_region_zoomy; }; diff -Nru mame-0.242+dfsg.1/src/mame/video/nick.h mame-0.243+dfsg.1/src/mame/video/nick.h --- mame-0.242+dfsg.1/src/mame/video/nick.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/nick.h 2022-04-29 05:37:26.000000000 +0000 @@ -135,16 +135,16 @@ LPT_ENTRY m_LPT; - uint32_t *m_dest; - int m_dest_pos; - int m_dest_max_pos; + uint32_t *m_dest = nullptr; + int m_dest_pos = 0; + int m_dest_max_pos = 0; uint8_t m_reg[4]; /* first clock visible on left hand side */ - int m_first_visible_clock; + int m_first_visible_clock = 0; /* first clock visible on right hand side */ - int m_last_visible_clock; + int m_last_visible_clock = 0; /* given a bit pattern, this will get the pen index */ uint8_t m_pen_idx_4col[256]; @@ -156,7 +156,7 @@ bitmap_rgb32 m_bitmap; rgb_t m_palette[256]; - emu_timer *m_timer_scanline; + emu_timer *m_timer_scanline = nullptr; }; diff -Nru mame-0.242+dfsg.1/src/mame/video/orca40c.h mame-0.243+dfsg.1/src/mame/video/orca40c.h --- mame-0.242+dfsg.1/src/mame/video/orca40c.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/orca40c.h 2022-04-29 05:37:26.000000000 +0000 @@ -58,8 +58,8 @@ DECLARE_GFXDECODE_MEMBER(gfxinfo); // internal state - tilemap_t *m_bg_tilemap; - tilemap_t *m_fg_tilemap; + tilemap_t *m_bg_tilemap = nullptr; + tilemap_t *m_fg_tilemap = nullptr; bool m_flip_screen; // helpers diff -Nru mame-0.242+dfsg.1/src/mame/video/parodius.cpp mame-0.243+dfsg.1/src/mame/video/parodius.cpp --- mame-0.242+dfsg.1/src/mame/video/parodius.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/parodius.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,78 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Nicola Salmoria - -#include "emu.h" -#include "includes/parodius.h" -#include "screen.h" - - -/*************************************************************************** - - Callbacks for the K052109 - -***************************************************************************/ - -K052109_CB_MEMBER(parodius_state::tile_callback) -{ - *code |= ((*color & 0x03) << 8) | ((*color & 0x10) << 6) | ((*color & 0x0c) << 9) | (bank << 13); - *color = m_layer_colorbase[layer] + ((*color & 0xe0) >> 5); -} - -/*************************************************************************** - - Callbacks for the K053245 - -***************************************************************************/ - -K05324X_CB_MEMBER(parodius_state::sprite_callback) -{ - int pri = 0x20 | ((*color & 0x60) >> 2); - if (pri <= m_layerpri[2]) - *priority = 0; - else if (pri > m_layerpri[2] && pri <= m_layerpri[1]) - *priority = 0xf0; - else if (pri > m_layerpri[1] && pri <= m_layerpri[0]) - *priority = 0xf0 | 0xcc; - else - *priority = 0xf0 | 0xcc | 0xaa; - - *color = m_sprite_colorbase + (*color & 0x1f); -} - - -/*************************************************************************** - - Start the video hardware emulation. - -***************************************************************************/ - -uint32_t parodius_state::screen_update_parodius(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - int layer[3], bg_colorbase; - - bg_colorbase = m_k053251->get_palette_index(k053251_device::CI0); - m_sprite_colorbase = m_k053251->get_palette_index(k053251_device::CI1); - m_layer_colorbase[0] = m_k053251->get_palette_index(k053251_device::CI2); - m_layer_colorbase[1] = m_k053251->get_palette_index(k053251_device::CI4); - m_layer_colorbase[2] = m_k053251->get_palette_index(k053251_device::CI3); - - m_k052109->tilemap_update(); - - layer[0] = 0; - m_layerpri[0] = m_k053251->get_priority(k053251_device::CI2); - layer[1] = 1; - m_layerpri[1] = m_k053251->get_priority(k053251_device::CI4); - layer[2] = 2; - m_layerpri[2] = m_k053251->get_priority(k053251_device::CI3); - - konami_sortlayers3(layer, m_layerpri); - - screen.priority().fill(0, cliprect); - bitmap.fill(16 * bg_colorbase, cliprect); - m_k052109->tilemap_draw(screen, bitmap, cliprect, layer[0], 0,1); - m_k052109->tilemap_draw(screen, bitmap, cliprect, layer[1], 0,2); - m_k052109->tilemap_draw(screen, bitmap, cliprect, layer[2], 0,4); - - m_k053245->sprites_draw(bitmap, cliprect, screen.priority()); - return 0; -} diff -Nru mame-0.242+dfsg.1/src/mame/video/pcktgal.cpp mame-0.243+dfsg.1/src/mame/video/pcktgal.cpp --- mame-0.242+dfsg.1/src/mame/video/pcktgal.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/pcktgal.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,81 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Bryan McPhail -#include "emu.h" -#include "includes/pcktgal.h" - -void pcktgal_state::pcktgal_palette(palette_device &palette) const -{ - uint8_t const *const color_prom = memregion("proms")->base(); - - for (int i = 0; i < palette.entries(); i++) - { - int bit0, bit1, bit2, bit3; - - bit0 = BIT(color_prom[i], 0); - bit1 = BIT(color_prom[i], 1); - bit2 = BIT(color_prom[i], 2); - bit3 = BIT(color_prom[i], 3); - int const r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - bit0 = BIT(color_prom[i], 4); - bit1 = BIT(color_prom[i], 5); - bit2 = BIT(color_prom[i], 6); - bit3 = BIT(color_prom[i], 7); - int const g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - bit0 = BIT(color_prom[i + palette.entries()], 0); - bit1 = BIT(color_prom[i + palette.entries()], 1); - bit2 = BIT(color_prom[i + palette.entries()], 2); - bit3 = BIT(color_prom[i + palette.entries()], 3); - int const b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - palette.set_pen_color(i, rgb_t(r, g, b)); - } -} - -void pcktgal_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, bool flip_screen) -{ - for (int offs = 0;offs < m_spriteram.bytes();offs += 4) - { - if (m_spriteram[offs] != 0xf8) - { - int sx,sy,flipx,flipy; - - - sx = 240 - m_spriteram[offs+2]; - sy = 240 - m_spriteram[offs]; - - flipx = m_spriteram[offs+1] & 0x04; - flipy = m_spriteram[offs+1] & 0x02; - if (flip_screen) { - sx=240-sx; - sy=240-sy; - if (flipx) flipx=0; else flipx=1; - if (flipy) flipy=0; else flipy=1; - } - - m_gfxdecode->gfx(1)->transpen(bitmap,cliprect, - m_spriteram[offs+3] + ((m_spriteram[offs+1] & 1) << 8), - (m_spriteram[offs+1] & 0x70) >> 4, - flipx,flipy, - sx,sy,0); - } - } -} - -uint32_t pcktgal_state::screen_update_pcktgal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - bool flip = m_tilegen->get_flip_state(); - m_tilegen->set_flip_screen(flip); - m_tilegen->deco_bac06_pf_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0); - draw_sprites(bitmap, cliprect, flip); - return 0; -} - -uint32_t pcktgal_state::screen_update_pcktgalb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - bool flip = m_tilegen->get_flip_state(); - m_tilegen->set_flip_screen(flip); - // the bootleg doesn't properly set the tilemap registers, because it's on non-original hardware, which probably doesn't have the flexible tilemaps. - m_tilegen->deco_bac06_pf_draw_bootleg(screen, bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0, 2, 0); - draw_sprites(bitmap, cliprect, flip); - return 0; -} diff -Nru mame-0.242+dfsg.1/src/mame/video/pc_t1t.h mame-0.243+dfsg.1/src/mame/video/pc_t1t.h --- mame-0.242+dfsg.1/src/mame/video/pc_t1t.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/pc_t1t.h 2022-04-29 05:37:26.000000000 +0000 @@ -112,7 +112,7 @@ void vga_data_w(int data); void bank_w(int data); void mode_control_w(int data); - bool m_disable; + bool m_disable = false; DECLARE_WRITE_LINE_MEMBER( t1000_vsync_changed ); }; diff -Nru mame-0.242+dfsg.1/src/mame/video/powervr2.cpp mame-0.243+dfsg.1/src/mame/video/powervr2.cpp --- mame-0.242+dfsg.1/src/mame/video/powervr2.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/powervr2.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -1392,7 +1392,7 @@ uint32_t vsync = ((screen().vpos() >= spg_vbstart) || (screen().vpos() < spg_vbend)) ? 0 : 1; uint32_t hsync = ((screen().hpos() >= spg_hbstart) || (screen().hpos() < spg_hbend)) ? 0 : 1; // FIXME: following is just a wild guess - uint32_t blank = ((screen().vpos() >= spg_vbstart) || (screen().vpos() < spg_vbend) | + uint32_t blank = ((screen().vpos() >= spg_vbstart) || (screen().vpos() < spg_vbend) || (screen().hpos() >= spg_hbstart) || (screen().hpos() < spg_hbend)) ? 0 : 1; if(vo_control & 4) { blank^=1; } if(vo_control & 2) { vsync^=1; } diff -Nru mame-0.242+dfsg.1/src/mame/video/rdpblend.h mame-0.243+dfsg.1/src/mame/video/rdpblend.h --- mame-0.242+dfsg.1/src/mame/video/rdpblend.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/rdpblend.h 2022-04-29 05:37:26.000000000 +0000 @@ -35,8 +35,8 @@ running_machine &machine() const { assert(m_machine != nullptr); return *m_machine; } private: - running_machine* m_machine; - n64_rdp* m_rdp; + running_machine* m_machine = nullptr; + n64_rdp* m_rdp = nullptr; int32_t min(const int32_t x, const int32_t min); bool alpha_reject(rdp_span_aux* userdata, const rdp_poly_state& object); diff -Nru mame-0.242+dfsg.1/src/mame/video/sega16sp.h mame-0.243+dfsg.1/src/mame/video/sega16sp.h --- mame-0.242+dfsg.1/src/mame/video/sega16sp.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/sega16sp.h 2022-04-29 05:37:26.000000000 +0000 @@ -69,10 +69,10 @@ // internal state bool m_flip; // screen flip? uint8_t m_bank[16]; // banking redirection - int m_xoffs; - int m_yoffs; - int m_xoffs_flipped; - int m_yoffs_flipped; + int m_xoffs = 0; + int m_yoffs = 0; + int m_xoffs_flipped = 0; + int m_yoffs_flipped = 0; }; @@ -218,7 +218,7 @@ virtual void draw(bitmap_ind16 &bitmap, const rectangle &cliprect) override; required_region_ptr m_sprite_region_ptr; - rotate_info* m_segaic16_rotate; + rotate_info* m_segaic16_rotate = nullptr; }; diff -Nru mame-0.242+dfsg.1/src/mame/video/segaic24.h mame-0.243+dfsg.1/src/mame/video/segaic24.h --- mame-0.242+dfsg.1/src/mame/video/segaic24.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/segaic24.h 2022-04-29 05:37:26.000000000 +0000 @@ -53,7 +53,7 @@ std::unique_ptr char_ram; std::unique_ptr tile_ram; int char_gfx_index; - tilemap_t *tile_layer[4]; + tilemap_t *tile_layer[4]{}; uint16_t tile_mask; static const gfx_layout char_layout; diff -Nru mame-0.242+dfsg.1/src/mame/video/segas24.cpp mame-0.243+dfsg.1/src/mame/video/segas24.cpp --- mame-0.242+dfsg.1/src/mame/video/segas24.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/segas24.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -46,7 +46,7 @@ std::sort(order.begin(), order.end(), layer_sort(*m_vmixer)); - int spri[4]; + int spri[4]{}; int level = 0; for(int i=0; i<12; i++) if(order[i] < 8) diff -Nru mame-0.242+dfsg.1/src/mame/video/segas32.cpp mame-0.243+dfsg.1/src/mame/video/segas32.cpp --- mame-0.242+dfsg.1/src/mame/video/segas32.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/segas32.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -274,7 +274,8 @@ /* allocate pre-rendered solid lines of 0's and ffff's */ m_solid_0000 = make_unique_clear(512); - m_solid_ffff = make_unique_clear(512); + m_solid_ffff = std::make_unique(512); + std::fill_n(m_solid_ffff.get(), 512, ~uint16_t(0)); /* allocate background color per line*/ m_prev_bgstartx = std::make_unique(512); diff -Nru mame-0.242+dfsg.1/src/mame/video/seta001.h mame-0.243+dfsg.1/src/mame/video/seta001.h --- mame-0.242+dfsg.1/src/mame/video/seta001.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/seta001.h 2022-04-29 05:37:26.000000000 +0000 @@ -79,7 +79,7 @@ int m_transpen; // live state - uint8_t m_bgflag; + uint8_t m_bgflag = 0; uint8_t m_spritectrl[4]; std::unique_ptr m_spriteylow; std::unique_ptr m_spritecodelow; // tnzs.cpp stuff only uses half? diff -Nru mame-0.242+dfsg.1/src/mame/video/shisen.cpp mame-0.243+dfsg.1/src/mame/video/shisen.cpp --- mame-0.242+dfsg.1/src/mame/video/shisen.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/shisen.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,70 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Nicola Salmoria -#include "emu.h" -#include "includes/shisen.h" - -void shisen_state::videoram_w(offs_t offset, uint8_t data) -{ - m_videoram[offset] = data; - m_bg_tilemap->mark_tile_dirty(offset / 2); -} - -void shisen_state::bankswitch_w(uint8_t data) -{ - if (data & 0xc0) logerror("bank switch %02x\n",data); - - /* bits 0-2 select ROM bank */ - membank("bank1")->set_entry(data & 0x07); - - /* bits 3-5 select gfx bank */ - int bank = (data & 0x38) >> 3; - - if (m_gfxbank != bank) - { - m_gfxbank = bank; - machine().tilemap().mark_all_dirty(); - } - - /* bits 6-7 unknown */ -} - -void shisen_state::paletteram_w(offs_t offset, uint8_t data) -{ - m_paletteram[offset] = data; - - offset &= 0xff; - - m_palette->set_pen_color(offset, pal5bit(m_paletteram[offset + 0x000]), pal5bit(m_paletteram[offset + 0x100]), pal5bit(m_paletteram[offset + 0x200])); -} - -TILE_GET_INFO_MEMBER(shisen_state::get_bg_tile_info) -{ - int offs = tile_index * 2; - int code = m_videoram[offs] + ((m_videoram[offs + 1] & 0x0f) << 8) + (m_gfxbank << 12); - int color = (m_videoram[offs + 1] & 0xf0) >> 4; - - tileinfo.set(0, code, color, 0); -} - -void shisen_state::video_start() -{ - m_bg_tilemap = &machine().tilemap().create( - *m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(shisen_state::get_bg_tile_info)), TILEMAP_SCAN_ROWS, - 8, 8, 64, 32); - - membank("bank1")->configure_entries(0, 8, memregion("maincpu")->base() + 0x10000, 0x4000); - - save_item(NAME(m_gfxbank)); -} - -uint32_t shisen_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - // on Irem boards, screen flip is handled in both hardware and software. - // this game doesn't have cocktail mode so if there's software control we don't - // know where it is mapped. - flip_screen_set(~ioport("DSW2")->read() & 1); - - - m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - return 0; -} diff -Nru mame-0.242+dfsg.1/src/mame/video/sknsspr.h mame-0.243+dfsg.1/src/mame/video/sknsspr.h --- mame-0.242+dfsg.1/src/mame/video/sknsspr.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/sknsspr.h 2022-04-29 05:37:26.000000000 +0000 @@ -23,7 +23,7 @@ virtual void rom_bank_updated() override; private: static constexpr unsigned SUPRNOVA_DECODE_BUFFER_SIZE = 0x2000; - int m_sprite_kludge_x, m_sprite_kludge_y; + int m_sprite_kludge_x = 0, m_sprite_kludge_y = 0; std::unique_ptr m_decodebuffer; int skns_rle_decode ( int romoffset, int size ); }; diff -Nru mame-0.242+dfsg.1/src/mame/video/skykid.cpp mame-0.243+dfsg.1/src/mame/video/skykid.cpp --- mame-0.242+dfsg.1/src/mame/video/skykid.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/skykid.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,263 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Manuel Abadia -#include "emu.h" -#include "includes/skykid.h" - - -/*************************************************************************** - - Convert the color PROMs. - - The palette PROMs are connected to the RGB output this way: - - bit 3 -- 220 ohm resistor -- RED/GREEN/BLUE - -- 470 ohm resistor -- RED/GREEN/BLUE - -- 1 kohm resistor -- RED/GREEN/BLUE - bit 0 -- 2.2kohm resistor -- RED/GREEN/BLUE - -***************************************************************************/ - -void skykid_state::skykid_palette(palette_device &palette) const -{ - const uint8_t *color_prom = memregion("proms")->base(); - - // create a lookup table for the palette - for (int i = 0; i < 0x100; i++) - { - int const r = pal4bit(color_prom[i + 0x000]); - int const g = pal4bit(color_prom[i + 0x100]); - int const b = pal4bit(color_prom[i + 0x200]); - - palette.set_indirect_color(i, rgb_t(r, g, b)); - } - - // color_prom now points to the beginning of the lookup table - color_prom += 0x300; - - // text palette - for (int i = 0; i < 0x100; i++) - palette.set_pen_indirect(i, i); - - // tiles/sprites - for (int i = 0x100; i < 0x500; i++) - { - uint8_t const ctabentry = color_prom[i - 0x100]; - palette.set_pen_indirect(i, ctabentry); - } -} - - - -/*************************************************************************** - - Callbacks for the TileMap code - -***************************************************************************/ - -/* convert from 32x32 to 36x28 */ -TILEMAP_MAPPER_MEMBER(skykid_state::tx_tilemap_scan) -{ - int offs; - - row += 2; - col -= 2; - if (col & 0x20) - offs = row + ((col & 0x1f) << 5); - else - offs = col + (row << 5); - - return offs; -} - -TILE_GET_INFO_MEMBER(skykid_state::tx_get_tile_info) -{ - int code = m_textram[tile_index]; - int attr = m_textram[tile_index + 0x400]; - tileinfo.category = code >> 4 & 0xf; - - /* the hardware has two character sets, one normal and one flipped. When - screen is flipped, character flip is done by selecting the 2nd character set. - We reproduce this here, but since the tilemap system automatically flips - characters when screen is flipped, we have to flip them back. */ - tileinfo.set(0, - code | (flip_screen() ? 0x100 : 0), - attr & 0x3f, - flip_screen() ? (TILE_FLIPY | TILE_FLIPX) : 0); -} - - -TILE_GET_INFO_MEMBER(skykid_state::bg_get_tile_info) -{ - int code = m_videoram[tile_index]; - int attr = m_videoram[tile_index+0x800]; - - tileinfo.set(1, - code + ((attr & 0x01) << 8), - ((attr & 0x7e) >> 1) | ((attr & 0x01) << 6), - 0); -} - - - -/*************************************************************************** - - Start the video hardware emulation. - -***************************************************************************/ - -void skykid_state::video_start() -{ - m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(skykid_state::tx_get_tile_info)), tilemap_mapper_delegate(*this, FUNC(skykid_state::tx_tilemap_scan)), 8,8, 36,28); - m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(skykid_state::bg_get_tile_info)), TILEMAP_SCAN_ROWS, 8,8, 64,32); - - m_tx_tilemap->set_transparent_pen(0); - - save_item(NAME(m_priority)); - save_item(NAME(m_scroll_x)); - save_item(NAME(m_scroll_y)); -} - - - -/*************************************************************************** - - Memory handlers - -***************************************************************************/ - -uint8_t skykid_state::skykid_videoram_r(offs_t offset) -{ - return m_videoram[offset]; -} - -void skykid_state::skykid_videoram_w(offs_t offset, uint8_t data) -{ - m_videoram[offset] = data; - m_bg_tilemap->mark_tile_dirty(offset & 0x7ff); -} - -uint8_t skykid_state::skykid_textram_r(offs_t offset) -{ - return m_textram[offset]; -} - -void skykid_state::skykid_textram_w(offs_t offset, uint8_t data) -{ - m_textram[offset] = data; - m_tx_tilemap->mark_tile_dirty(offset & 0x3ff); -} - -void skykid_state::skykid_scroll_x_w(offs_t offset, uint8_t data) -{ - m_scroll_x = offset; -} - -void skykid_state::skykid_scroll_y_w(offs_t offset, uint8_t data) -{ - m_scroll_y = offset; -} - -void skykid_state::skykid_flipscreen_priority_w(offs_t offset, uint8_t data) -{ - m_priority = data; - flip_screen_set(offset & 1); -} - - - -/*************************************************************************** - - Display Refresh - -***************************************************************************/ - -/* the sprite generator IC is the same as Mappy */ -void skykid_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect) -{ - uint8_t *spriteram = m_spriteram + 0x780; - uint8_t *spriteram_2 = spriteram + 0x0800; - uint8_t *spriteram_3 = spriteram_2 + 0x0800; - int offs; - - for (offs = 0;offs < 0x80;offs += 2) - { - static const int gfx_offs[2][2] = - { - { 0, 1 }, - { 2, 3 } - }; - int sprite = spriteram[offs] + ((spriteram_3[offs] & 0x80) << 1); - int color = (spriteram[offs+1] & 0x3f); - int sx = (spriteram_2[offs+1]) + 0x100*(spriteram_3[offs+1] & 1) - 71; - int sy = 256 - spriteram_2[offs] - 7; - int flipx = (spriteram_3[offs] & 0x01); - int flipy = (spriteram_3[offs] & 0x02) >> 1; - int sizex = (spriteram_3[offs] & 0x04) >> 2; - int sizey = (spriteram_3[offs] & 0x08) >> 3; - int x,y; - - sprite &= ~sizex; - sprite &= ~(sizey << 1); - - if (flip_screen()) - { - flipx ^= 1; - flipy ^= 1; - } - - sy -= 16 * sizey; - sy = (sy & 0xff) - 32; // fix wraparound - - for (y = 0;y <= sizey;y++) - { - for (x = 0;x <= sizex;x++) - { - m_gfxdecode->gfx(2)->transmask(bitmap,cliprect, - sprite + gfx_offs[y ^ (sizey * flipy)][x ^ (sizex * flipx)], - color, - flipx,flipy, - sx + 16*x,sy + 16*y, - m_palette->transpen_mask(*m_gfxdecode->gfx(2), color, 0xff)); - } - } - } -} - - -uint32_t skykid_state::screen_update_skykid(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - if (flip_screen()) - { - m_bg_tilemap->set_scrollx(0, 189 - (m_scroll_x ^ 1)); - m_bg_tilemap->set_scrolly(0, 7 - m_scroll_y); - } - else - { - m_bg_tilemap->set_scrollx(0, m_scroll_x + 35); - m_bg_tilemap->set_scrolly(0, m_scroll_y + 25); - } - - m_bg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0); - - if (m_priority & 0x04) - { - // textlayer priority enabled? - int cat, pri = m_priority >> 4; - - // draw low priority tiles - m_tx_tilemap->draw(screen, bitmap, cliprect, pri, 0); - - draw_sprites(bitmap, cliprect); - - // draw the other tiles - for (cat = 0; cat < 0x10; cat++) - if (cat != pri) m_tx_tilemap->draw(screen, bitmap, cliprect, cat, 0); - } - else - { - draw_sprites(bitmap, cliprect); - m_tx_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_ALL_CATEGORIES, 0); - } - - return 0; -} diff -Nru mame-0.242+dfsg.1/src/mame/video/snk68_spr.h mame-0.243+dfsg.1/src/mame/video/snk68_spr.h --- mame-0.242+dfsg.1/src/mame/video/snk68_spr.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/snk68_spr.h 2022-04-29 05:37:26.000000000 +0000 @@ -42,8 +42,8 @@ required_device m_screen; bool m_flipscreen; int m_partialupdates; // the original hardware needs this, the cloned hardware does not. - u8 m_xpos_shift; - u16 m_color_entry_mask; + u8 m_xpos_shift = 0; + u16 m_color_entry_mask = 0; }; diff -Nru mame-0.242+dfsg.1/src/mame/video/snk_bbusters_spr.h mame-0.243+dfsg.1/src/mame/video/snk_bbusters_spr.h --- mame-0.242+dfsg.1/src/mame/video/snk_bbusters_spr.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/snk_bbusters_spr.h 2022-04-29 05:37:26.000000000 +0000 @@ -30,8 +30,8 @@ template static int adjust_spritecode(int dx, int dy, int code); - const uint8_t *m_scale_table_ptr; - uint8_t m_scale_line_count; + const uint8_t *m_scale_table_ptr = nullptr; + uint8_t m_scale_line_count = 0; required_region_ptr m_scale_table; required_device m_spriteram; diff -Nru mame-0.242+dfsg.1/src/mame/video/spdodgeb.cpp mame-0.243+dfsg.1/src/mame/video/spdodgeb.cpp --- mame-0.242+dfsg.1/src/mame/video/spdodgeb.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/spdodgeb.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,210 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Paul Hampson, Nicola Salmoria -#include "emu.h" -#include "includes/spdodgeb.h" -#include "cpu/m6502/m6502.h" - - -void spdodgeb_state::spdodgeb_palette(palette_device &palette) const -{ - const uint8_t *color_prom = memregion("proms")->base(); - - for (int i = 0;i < palette.entries();i++) - { - int bit0, bit1, bit2, bit3; - - // red component - bit0 = BIT(color_prom[0], 0); - bit1 = BIT(color_prom[0], 1); - bit2 = BIT(color_prom[0], 2); - bit3 = BIT(color_prom[0], 3); - int const r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - // green component - bit0 = BIT(color_prom[0], 4); - bit1 = BIT(color_prom[0], 5); - bit2 = BIT(color_prom[0], 6); - bit3 = BIT(color_prom[0], 7); - int const g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - // blue component - bit0 = BIT(color_prom[palette.entries()], 0); - bit1 = BIT(color_prom[palette.entries()], 1); - bit2 = BIT(color_prom[palette.entries()], 2); - bit3 = BIT(color_prom[palette.entries()], 3); - int const b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - palette.set_pen_color(i,rgb_t(r,g,b)); - color_prom++; - } -} - - -/*************************************************************************** - - Callbacks for the TileMap code - -***************************************************************************/ - -TILEMAP_MAPPER_MEMBER(spdodgeb_state::background_scan) -{ - /* logical (col,row) -> memory offset */ - return (col & 0x1f) + ((row & 0x1f) << 5) + ((col & 0x20) << 5); -} - -TILE_GET_INFO_MEMBER(spdodgeb_state::get_bg_tile_info) -{ - uint8_t code = m_videoram[tile_index]; - uint8_t attr = m_videoram[tile_index + 0x800]; - tileinfo.set(0, - code + ((attr & 0x1f) << 8), - ((attr & 0xe0) >> 5) + 8 * m_tile_palbank, - 0); -} - - -/*************************************************************************** - - Start the video hardware emulation. - -***************************************************************************/ - -void spdodgeb_state::video_start() -{ - m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(spdodgeb_state::get_bg_tile_info)), tilemap_mapper_delegate(*this, FUNC(spdodgeb_state::background_scan)), 8,8, 64,32); - - membank("mainbank")->configure_entries(0, 2, memregion("maincpu")->base(), 0x4000); - - save_item(NAME(m_tile_palbank)); - save_item(NAME(m_sprite_palbank)); - save_item(NAME(m_lastscroll)); -} - - -/*************************************************************************** - - Memory handlers - -***************************************************************************/ - - -TIMER_DEVICE_CALLBACK_MEMBER(spdodgeb_state::interrupt) -{ - int scanline = param; - - if (scanline == 256) - { - m_maincpu->pulse_input_line(INPUT_LINE_NMI, attotime::zero); - m_screen->update_partial(256); - } - else if ((scanline % 8) == 0) - { - m_maincpu->set_input_line(M6502_IRQ_LINE, HOLD_LINE); - m_screen->update_partial(scanline+16); /* TODO: pretty off ... */ - } -} - -void spdodgeb_state::scrollx_lo_w(uint8_t data) -{ - m_lastscroll = (m_lastscroll & 0x100) | data; -} - -void spdodgeb_state::ctrl_w(uint8_t data) -{ - /* bit 0 = flip screen */ - flip_screen_set(data & 0x01); - - /* bit 1 = ROM bank switch */ - membank("mainbank")->set_entry((~data & 0x02) >> 1); - - /* bit 2 = scroll high bit */ - m_lastscroll = (m_lastscroll & 0x0ff) | ((data & 0x04) << 6); - - /* bit 3 = to mcu?? */ - - /* bits 4-7 = palette bank select */ - if (m_tile_palbank != ((data & 0x30) >> 4)) - { - m_tile_palbank = ((data & 0x30) >> 4); - m_bg_tilemap->mark_all_dirty(); - } - m_sprite_palbank = (data & 0xc0) >> 6; -} - -void spdodgeb_state::videoram_w(offs_t offset, uint8_t data) -{ - m_videoram[offset] = data; - m_bg_tilemap->mark_tile_dirty(offset & 0x7ff); -} - - - -/*************************************************************************** - - Display refresh - -***************************************************************************/ - -#define DRAW_SPRITE( order, sx, sy ) gfx->transpen(bitmap,\ - cliprect, \ - (which+order),color+ 8 * m_sprite_palbank,flipx,flipy,sx,sy,0); - -void spdodgeb_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect ) -{ - gfx_element *gfx = m_gfxdecode->gfx(1); - -/* 240-SY Z|F|CLR|WCH WHICH SX - xxxxxxxx x|x|xxx|xxx xxxxxxxx xxxxxxxx -*/ - for (int i = 0;i < m_spriteram.bytes();i += 4) - { - int attr = m_spriteram[i+1]; - int which = m_spriteram[i+2]+((attr & 0x07)<<8); - int sx = m_spriteram[i+3]; - int sy = 240 - m_spriteram[i]; - int size = (attr & 0x80) >> 7; - int color = (attr & 0x38) >> 3; - int flipx = ~attr & 0x40; - int flipy = 0; - int dy = -16; - int cy; - - if (flip_screen()) - { - sx = 240 - sx; - sy = 240 - sy; - flipx = !flipx; - flipy = !flipy; - dy = -dy; - } - - if (sx < -8) sx += 256; else if (sx > 248) sx -= 256; - - switch (size) - { - case 0: /* normal */ - if (sy < -8) sy += 256; else if (sy > 248) sy -= 256; - DRAW_SPRITE(0,sx,sy); - break; - - case 1: /* double y */ - if (flip_screen()) { if (sy > 240) sy -= 256; } else { if (sy < 0) sy += 256; } - cy = sy + dy; - which &= ~1; - DRAW_SPRITE(0,sx,cy); - DRAW_SPRITE(1,sx,sy); - break; - } - } -} - -#undef DRAW_SPRITE - - -uint32_t spdodgeb_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - m_bg_tilemap->set_scrollx(0,m_lastscroll+5); - m_bg_tilemap->draw(screen, bitmap, cliprect, 0,0); - draw_sprites(bitmap,cliprect); - return 0; -} diff -Nru mame-0.242+dfsg.1/src/mame/video/st0020.h mame-0.243+dfsg.1/src/mame/video/st0020.h --- mame-0.242+dfsg.1/src/mame/video/st0020.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/st0020.h 2022-04-29 05:37:26.000000000 +0000 @@ -47,7 +47,7 @@ void regs_st0020_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); void regs_st0032_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - int m_gfxram_bank; + int m_gfxram_bank = 0; void gfxram_bank_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); // blitter @@ -55,7 +55,7 @@ void do_blit_w(uint16_t data); // tilemaps - tilemap_t *m_tmap[4]; + tilemap_t *m_tmap[4]{}; template TILE_GET_INFO_MEMBER(get_tile_info); TILEMAP_MAPPER_MEMBER(scan_16x16); diff -Nru mame-0.242+dfsg.1/src/mame/video/stfight_dev.h mame-0.243+dfsg.1/src/mame/video/stfight_dev.h --- mame-0.242+dfsg.1/src/mame/video/stfight_dev.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/stfight_dev.h 2022-04-29 05:37:26.000000000 +0000 @@ -51,9 +51,9 @@ required_shared_ptr m_txram; // tilemaps - tilemap_t *m_fg_tilemap; - tilemap_t *m_bg_tilemap; - tilemap_t *m_tx_tilemap; + tilemap_t *m_fg_tilemap = nullptr; + tilemap_t *m_bg_tilemap = nullptr; + tilemap_t *m_tx_tilemap = nullptr; TILEMAP_MAPPER_MEMBER(fg_scan); TILEMAP_MAPPER_MEMBER(bg_scan); @@ -63,7 +63,7 @@ TILE_GET_INFO_MEMBER(get_tx_tile_info); // internal variables - int m_sprite_base; + int m_sprite_base = 0; // rendering / mixing bitmap_ind16 m_temp_bitmap; diff -Nru mame-0.242+dfsg.1/src/mame/video/stic.h mame-0.243+dfsg.1/src/mame/video/stic.h --- mame-0.242+dfsg.1/src/mame/video/stic.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/stic.h 2022-04-29 05:37:26.000000000 +0000 @@ -118,22 +118,22 @@ struct intv_sprite_type { - int visible; - int xpos; - int ypos; - int coll; - int collision; - int doublex; - int doubley; - int quady; - int xflip; - int yflip; - int behind_foreground; - int grom; - int card; - int color; - int doubleyres; - int dirty; + int visible = 0; + int xpos = 0; + int ypos = 0; + int coll = 0; + int collision = 0; + int doublex = 0; + int doubley = 0; + int quady = 0; + int xflip = 0; + int yflip = 0; + int behind_foreground = 0; + int grom = 0; + int card = 0; + int color = 0; + int doubleyres = 0; + int dirty = 0; }; @@ -161,21 +161,21 @@ intv_sprite_type m_sprite[MOBS]; uint8_t m_sprite_buffers[MOBS][CARD_WIDTH * 2][CARD_HEIGHT * 4 * 2 * 2]; uint16_t m_backtab_buffer[BACKTAB_HEIGHT][BACKTAB_WIDTH]; - int m_color_stack_mode; - int m_stic_registers[STIC_REGISTERS]; - int m_color_stack_offset; - int m_stic_handshake; - int m_border_color; - int m_col_delay; - int m_row_delay; - int m_left_edge_inhibit; - int m_top_edge_inhibit; + int m_color_stack_mode = 0; + int m_stic_registers[STIC_REGISTERS]{}; + int m_color_stack_offset = 0; + int m_stic_handshake = 0; + int m_border_color = 0; + int m_col_delay = 0; + int m_row_delay = 0; + int m_left_edge_inhibit = 0; + int m_top_edge_inhibit = 0; int m_x_scale; int m_y_scale; - uint8_t m_gramdirty; - uint8_t m_gram[512]; - uint8_t m_gramdirtybytes[512]; + uint8_t m_gramdirty = 0; + uint8_t m_gram[512]{}; + uint8_t m_gramdirtybytes[512]{}; }; // device type definition diff -Nru mame-0.242+dfsg.1/src/mame/video/surpratk.cpp mame-0.243+dfsg.1/src/mame/video/surpratk.cpp --- mame-0.242+dfsg.1/src/mame/video/surpratk.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/surpratk.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,79 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Nicola Salmoria - -#include "emu.h" -#include "includes/surpratk.h" -#include "screen.h" - - -/*************************************************************************** - - Callbacks for the K052109 - -***************************************************************************/ - -K052109_CB_MEMBER(surpratk_state::tile_callback) -{ - *flags = (*color & 0x80) ? TILE_FLIPX : 0; - *code |= ((*color & 0x03) << 8) | ((*color & 0x10) << 6) | ((*color & 0x0c) << 9) | (bank << 13); - *color = m_layer_colorbase[layer] + ((*color & 0x60) >> 5); -} - -/*************************************************************************** - - Callbacks for the K053245 - -***************************************************************************/ - -K05324X_CB_MEMBER(surpratk_state::sprite_callback) -{ - int pri = 0x20 | ((*color & 0x60) >> 2); - if (pri <= m_layerpri[2]) - *priority = 0; - else if (pri > m_layerpri[2] && pri <= m_layerpri[1]) - *priority = 0xf0; - else if (pri > m_layerpri[1] && pri <= m_layerpri[0]) - *priority = 0xf0 | 0xcc; - else - *priority = 0xf0 | 0xcc | 0xaa; - - *color = m_sprite_colorbase + (*color & 0x1f); -} - - -/*************************************************************************** - - Start the video hardware emulation. - -***************************************************************************/ - -uint32_t surpratk_state::screen_update_surpratk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - int layer[3], bg_colorbase; - - bg_colorbase = m_k053251->get_palette_index(k053251_device::CI0); - m_sprite_colorbase = m_k053251->get_palette_index(k053251_device::CI1); - m_layer_colorbase[0] = m_k053251->get_palette_index(k053251_device::CI2); - m_layer_colorbase[1] = m_k053251->get_palette_index(k053251_device::CI4); - m_layer_colorbase[2] = m_k053251->get_palette_index(k053251_device::CI3); - - m_k052109->tilemap_update(); - - layer[0] = 0; - m_layerpri[0] = m_k053251->get_priority(k053251_device::CI2); - layer[1] = 1; - m_layerpri[1] = m_k053251->get_priority(k053251_device::CI4); - layer[2] = 2; - m_layerpri[2] = m_k053251->get_priority(k053251_device::CI3); - - konami_sortlayers3(layer, m_layerpri); - - screen.priority().fill(0, cliprect); - bitmap.fill(16 * bg_colorbase, cliprect); - m_k052109->tilemap_draw(screen, bitmap, cliprect, layer[0], 0, 1); - m_k052109->tilemap_draw(screen, bitmap, cliprect, layer[1], 0, 2); - m_k052109->tilemap_draw(screen, bitmap, cliprect, layer[2], 0, 4); - - m_k053244->sprites_draw(bitmap, cliprect, screen.priority()); - return 0; -} diff -Nru mame-0.242+dfsg.1/src/mame/video/tbowl.cpp mame-0.243+dfsg.1/src/mame/video/tbowl.cpp --- mame-0.242+dfsg.1/src/mame/video/tbowl.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/tbowl.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,164 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:David Haywood -/* video/tbowl.c */ - -/* see drivers/tbowl.cpp for more info */ - -#include "emu.h" -#include "includes/tbowl.h" - - -/* Foreground Layer (tx) Tilemap */ - -TILE_GET_INFO_MEMBER(tbowl_state::get_tx_tile_info) -{ - int tileno; - int col; - - tileno = m_txvideoram[tile_index] | ((m_txvideoram[tile_index+0x800] & 0x07) << 8); - col = (m_txvideoram[tile_index+0x800] & 0xf0) >> 4; - - tileinfo.set(0,tileno,col,0); -} - -void tbowl_state::txvideoram_w(offs_t offset, uint8_t data) -{ - m_txvideoram[offset] = data; - m_tx_tilemap->mark_tile_dirty(offset & 0x7ff); -} - -/* Bottom BG Layer (bg) Tilemap */ - -TILE_GET_INFO_MEMBER(tbowl_state::get_bg_tile_info) -{ - int tileno; - int col; - - tileno = m_bgvideoram[tile_index] | ((m_bgvideoram[tile_index+0x1000] & 0x0f) << 8); - col = (m_bgvideoram[tile_index+0x1000] & 0xf0) >> 4; - - tileinfo.set(1,tileno,col,0); -} - -void tbowl_state::bg2videoram_w(offs_t offset, uint8_t data) -{ - m_bg2videoram[offset] = data; - m_bg2_tilemap->mark_tile_dirty(offset & 0xfff); -} - -void tbowl_state::bgxscroll_lo(uint8_t data) -{ - m_xscroll = (m_xscroll & 0xff00) | data; -} - -void tbowl_state::bgxscroll_hi(uint8_t data) -{ - m_xscroll = (m_xscroll & 0x00ff) | (data << 8); -} - -void tbowl_state::bgyscroll_lo(uint8_t data) -{ - m_yscroll = (m_yscroll & 0xff00) | data; -} - -void tbowl_state::bgyscroll_hi(uint8_t data) -{ - m_yscroll = (m_yscroll & 0x00ff) | (data << 8); -} - -/* Middle BG Layer (bg2) Tilemaps */ - -TILE_GET_INFO_MEMBER(tbowl_state::get_bg2_tile_info) -{ - int tileno; - int col; - - tileno = m_bg2videoram[tile_index] | ((m_bg2videoram[tile_index+0x1000] & 0x0f) << 8); - tileno ^= 0x400; - col = (m_bg2videoram[tile_index+0x1000] & 0xf0) >> 4; - - tileinfo.set(2,tileno,col,0); -} - -void tbowl_state::bgvideoram_w(offs_t offset, uint8_t data) -{ - m_bgvideoram[offset] = data; - m_bg_tilemap->mark_tile_dirty(offset & 0xfff); -} - -void tbowl_state::bg2xscroll_lo(uint8_t data) -{ - m_bg2xscroll = (m_bg2xscroll & 0xff00) | data; -} - -void tbowl_state::bg2xscroll_hi(uint8_t data) -{ - m_bg2xscroll = (m_bg2xscroll & 0x00ff) | (data << 8); -} - -void tbowl_state::bg2yscroll_lo(uint8_t data) -{ - m_bg2yscroll = (m_bg2yscroll & 0xff00) | data; -} - -void tbowl_state::bg2yscroll_hi(uint8_t data) -{ - m_bg2yscroll = (m_bg2yscroll & 0x00ff) | (data << 8); -} - - -/*** Video Start / Update ***/ - -void tbowl_state::video_start() -{ - m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(tbowl_state::get_tx_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64,32); - m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(tbowl_state::get_bg_tile_info)), TILEMAP_SCAN_ROWS, 16,16, 128,32); - m_bg2_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(tbowl_state::get_bg2_tile_info)), TILEMAP_SCAN_ROWS, 16,16, 128,32); - - m_tx_tilemap->set_transparent_pen(0); - m_bg_tilemap->set_transparent_pen(0); - m_bg2_tilemap->set_transparent_pen(0); - - save_item(NAME(m_xscroll)); - save_item(NAME(m_yscroll)); - save_item(NAME(m_bg2xscroll)); - save_item(NAME(m_bg2yscroll)); -} - - - -uint32_t tbowl_state::screen_update_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - m_bg_tilemap->set_scrollx(0, m_xscroll ); - m_bg_tilemap->set_scrolly(0, m_yscroll ); - m_bg2_tilemap->set_scrollx(0, m_bg2xscroll ); - m_bg2_tilemap->set_scrolly(0, m_bg2yscroll ); - m_tx_tilemap->set_scrollx(0, 0 ); - m_tx_tilemap->set_scrolly(0, 0 ); - - bitmap.fill(0x100, cliprect); /* is there a register controlling the colour? looks odd when screen is blank */ - m_bg_tilemap->draw(screen, bitmap, cliprect, 0,0); - m_sprgen->tbowl_draw_sprites(bitmap,cliprect, m_gfxdecode->gfx(3), 0, m_spriteram); - m_bg2_tilemap->draw(screen, bitmap, cliprect, 0,0); - m_tx_tilemap->draw(screen, bitmap, cliprect, 0,0); - - return 0; -} - -uint32_t tbowl_state::screen_update_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - m_bg_tilemap->set_scrollx(0, m_xscroll+32*8 ); - m_bg_tilemap->set_scrolly(0, m_yscroll ); - m_bg2_tilemap->set_scrollx(0, m_bg2xscroll+32*8 ); - m_bg2_tilemap->set_scrolly(0, m_bg2yscroll ); - m_tx_tilemap->set_scrollx(0, 32*8 ); - m_tx_tilemap->set_scrolly(0, 0 ); - - bitmap.fill(0x100, cliprect); /* is there a register controlling the colour? looks odd when screen is blank */ - m_bg_tilemap->draw(screen, bitmap, cliprect, 0,0); - m_sprgen->tbowl_draw_sprites(bitmap,cliprect, m_gfxdecode->gfx(3), 32*8, m_spriteram); - m_bg2_tilemap->draw(screen, bitmap, cliprect, 0,0); - m_tx_tilemap->draw(screen, bitmap, cliprect, 0,0); - - return 0; -} diff -Nru mame-0.242+dfsg.1/src/mame/video/tc0100scn.h mame-0.243+dfsg.1/src/mame/video/tc0100scn.h --- mame-0.242+dfsg.1/src/mame/video/tc0100scn.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/tc0100scn.h 2022-04-29 05:37:26.000000000 +0000 @@ -88,7 +88,7 @@ int m_bgscrollx, m_bgscrolly, m_fgscrollx, m_fgscrolly; /* We keep two tilemaps for each of the 3 actual tilemaps: one at standard width, one double */ - tilemap_t *m_tilemap[3][2]; + tilemap_t *m_tilemap[3][2]{}; s32 m_bg_colbank[2], m_tx_colbank; int m_dblwidth; diff -Nru mame-0.242+dfsg.1/src/mame/video/tc0280grd.h mame-0.243+dfsg.1/src/mame/video/tc0280grd.h --- mame-0.242+dfsg.1/src/mame/video/tc0280grd.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/tc0280grd.h 2022-04-29 05:37:26.000000000 +0000 @@ -37,7 +37,7 @@ // internal state std::unique_ptr m_ram; - tilemap_t *m_tilemap; + tilemap_t *m_tilemap = nullptr; u16 m_ctrl[8]; int m_base_color; diff -Nru mame-0.242+dfsg.1/src/mame/video/tc0480scp.h mame-0.243+dfsg.1/src/mame/video/tc0480scp.h --- mame-0.242+dfsg.1/src/mame/video/tc0480scp.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/tc0480scp.h 2022-04-29 05:37:26.000000000 +0000 @@ -80,7 +80,7 @@ DECLARE_GFXDECODE_MEMBER(gfxinfo_bootleg); /* We keep two tilemaps for each of the 5 actual tilemaps: one at standard width, one double */ - tilemap_t *m_tilemap[5][2]; + tilemap_t *m_tilemap[5][2]{}; s32 m_dblwidth; int m_gfxlayout; diff -Nru mame-0.242+dfsg.1/src/mame/video/tc0780fpa.h mame-0.243+dfsg.1/src/mame/video/tc0780fpa.h --- mame-0.242+dfsg.1/src/mame/video/tc0780fpa.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/tc0780fpa.h 2022-04-29 05:37:26.000000000 +0000 @@ -64,14 +64,14 @@ private: std::unique_ptr m_texture; std::unique_ptr m_poly_fifo; - int m_poly_fifo_ptr; + int m_poly_fifo_ptr = 0; std::unique_ptr m_renderer; - uint16_t m_tex_address; - uint16_t m_tex_offset; - int m_texbase_x; - int m_texbase_y; + uint16_t m_tex_address = 0; + uint16_t m_tex_offset = 0; + int m_texbase_x = 0; + int m_texbase_y = 0; }; DECLARE_DEVICE_TYPE(TC0780FPA, tc0780fpa_device) diff -Nru mame-0.242+dfsg.1/src/mame/video/tmap038.h mame-0.243+dfsg.1/src/mame/video/tmap038.h --- mame-0.242+dfsg.1/src/mame/video/tmap038.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/tmap038.h 2022-04-29 05:37:26.000000000 +0000 @@ -102,7 +102,7 @@ u16 m_gfxno; tmap038_cb_delegate m_038_cb; - tilemap_t* m_tmap; + tilemap_t* m_tmap = nullptr; int m_xoffs, m_flipped_xoffs; int m_yoffs, m_flipped_yoffs; diff -Nru mame-0.242+dfsg.1/src/mame/video/toaplan_scu.h mame-0.243+dfsg.1/src/mame/video/toaplan_scu.h --- mame-0.242+dfsg.1/src/mame/video/toaplan_scu.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/toaplan_scu.h 2022-04-29 05:37:26.000000000 +0000 @@ -35,8 +35,8 @@ DECLARE_GFXDECODE_MEMBER(gfxinfo); pri_cb_delegate m_pri_cb; - int m_xoffs; - int m_xoffs_flipped; + int m_xoffs = 0; + int m_xoffs_flipped = 0; }; DECLARE_DEVICE_TYPE(TOAPLAN_SCU, toaplan_scu_device) diff -Nru mame-0.242+dfsg.1/src/mame/video/vendetta.cpp mame-0.243+dfsg.1/src/mame/video/vendetta.cpp --- mame-0.242+dfsg.1/src/mame/video/vendetta.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/vendetta.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,80 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Ernesto Corvi -#include "emu.h" -#include "includes/vendetta.h" - -/*************************************************************************** - - Callbacks for the K052109 - -***************************************************************************/ - -K052109_CB_MEMBER(vendetta_state::vendetta_tile_callback) -{ - *code |= ((*color & 0x03) << 8) | ((*color & 0x30) << 6) | ((*color & 0x0c) << 10) | (bank << 14); - *color = m_layer_colorbase[layer] + ((*color & 0xc0) >> 6); -} - -K052109_CB_MEMBER(vendetta_state::esckids_tile_callback) -{ - *code |= ((*color & 0x03) << 8) | ((*color & 0x10) << 6) | ((*color & 0x0c) << 9) | (bank << 13); - *color = m_layer_colorbase[layer] + ((*color & 0xe0) >> 5); -} - - -/*************************************************************************** - - Callbacks for the K053247 - -***************************************************************************/ - -K053246_CB_MEMBER(vendetta_state::sprite_callback) -{ - int pri = (*color & 0x03e0) >> 4; /* ??????? */ - if (pri <= m_layerpri[2]) - *priority_mask = 0; - else if (pri > m_layerpri[2] && pri <= m_layerpri[1]) - *priority_mask = 0xf0; - else if (pri > m_layerpri[1] && pri <= m_layerpri[0]) - *priority_mask = 0xf0 | 0xcc; - else - *priority_mask = 0xf0 | 0xcc | 0xaa; - - *color = m_sprite_colorbase + (*color & 0x001f); -} - - -/*************************************************************************** - - Display refresh - -***************************************************************************/ - -uint32_t vendetta_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - int layer[3]; - - m_sprite_colorbase = m_k053251->get_palette_index(k053251_device::CI1); - m_layer_colorbase[0] = m_k053251->get_palette_index(k053251_device::CI2); - m_layer_colorbase[1] = m_k053251->get_palette_index(k053251_device::CI3); - m_layer_colorbase[2] = m_k053251->get_palette_index(k053251_device::CI4); - - m_k052109->tilemap_update(); - - layer[0] = 0; - m_layerpri[0] = m_k053251->get_priority(k053251_device::CI2); - layer[1] = 1; - m_layerpri[1] = m_k053251->get_priority(k053251_device::CI3); - layer[2] = 2; - m_layerpri[2] = m_k053251->get_priority(k053251_device::CI4); - - konami_sortlayers3(layer, m_layerpri); - - screen.priority().fill(0, cliprect); - m_k052109->tilemap_draw(screen, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 1); - m_k052109->tilemap_draw(screen, bitmap, cliprect, layer[1], 0, 2); - m_k052109->tilemap_draw(screen, bitmap, cliprect, layer[2], 0, 4); - - m_k053246->k053247_sprites_draw(bitmap, cliprect); - return 0; -} diff -Nru mame-0.242+dfsg.1/src/mame/video/vicdual-97269pb.h mame-0.243+dfsg.1/src/mame/video/vicdual-97269pb.h --- mame-0.242+dfsg.1/src/mame/video/vicdual-97269pb.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/vicdual-97269pb.h 2022-04-29 05:37:26.000000000 +0000 @@ -30,7 +30,7 @@ // bit 2 enables gradient and starfield // bit 3 seems to be used to flip for cocktail - uint8_t m_palette_bank; + uint8_t m_palette_bank = 0; }; // device type definition diff -Nru mame-0.242+dfsg.1/src/mame/video/vigilant.cpp mame-0.243+dfsg.1/src/mame/video/vigilant.cpp --- mame-0.242+dfsg.1/src/mame/video/vigilant.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/vigilant.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -17,11 +17,12 @@ static const rectangle bottomvisiblearea(16*8, 48*8-1, 6*8, 32*8-1); +static const rectangle bowmenvisiblearea(16*8, 48*8-1, 0*8, 32*8-1); void vigilant_state::video_start() { - m_bg_bitmap = std::make_unique(512*4,256); + m_bg_bitmap = std::make_unique(512 * m_rear_pages, 256); save_item(NAME(m_horiz_scroll_low)); save_item(NAME(m_horiz_scroll_high)); @@ -57,25 +58,57 @@ **************************************************************************/ void vigilant_state::update_background() { - int row,col,page; + int row, col, page; int charcode; - charcode=0; + charcode = 0; - /* There are only three background ROMs (4 on bunccaneers!) */ - for (page=0; page<4; page++) + // There are only three background ROMs (4 on bunccaneers!) + for (page = 0; page < 4; page++) { - for( row=0; row<256; row++ ) + for( row = 0; row < 256; row++ ) { - for( col=0; col<512; col+=32 ) + for( col = 0; col < 512; col += 32 ) { m_gfxdecode->gfx(2)->opaque(*m_bg_bitmap, m_bg_bitmap->cliprect(), charcode, row < 128 ? 0 : 1, - 0,0, - 512*page + col,row); + 0, 0, + 512 * page + col, row); + charcode++; + } + } + } +} + +/*************************************************************************** + update_background + + There are three background ROMs, each one contains a 512x256 picture. + **************************************************************************/ +void vigilant_state::update_background_bowmen() +{ + int row, col, page; + int charcode; + + + charcode = 0; + + // There are 16 backgrounds + for (page = 0; page < 16; page++) + { + for( row = 0; row < 256; row++ ) + { + for( col = 0; col < 512; col += 32 ) + { + m_gfxdecode->gfx(2)->opaque(*m_bg_bitmap, + m_bg_bitmap->cliprect(), + charcode, + 0, + 0, 0, + 512 * page + col, row); charcode++; } } @@ -100,7 +133,7 @@ **************************************************************************/ void vigilant_state::paletteram_w(offs_t offset, uint8_t data) { - int bank,r,g,b; + int bank, r, g, b; m_generic_paletteram_8[offset] = data; @@ -112,7 +145,7 @@ g = (m_generic_paletteram_8[bank + offset + 0x100] << 3) & 0xFF; b = (m_generic_paletteram_8[bank + offset + 0x200] << 3) & 0xFF; - m_palette->set_pen_color((bank >> 2) + offset,rgb_t(r,g,b)); + m_palette->set_pen_color((bank >> 2) + offset, rgb_t(r, g, b)); } @@ -125,10 +158,10 @@ **************************************************************************/ void vigilant_state::vigilant_horiz_scroll_w(offs_t offset, uint8_t data) { - if (offset==0) + if (offset == 0) m_horiz_scroll_low = data; else - m_horiz_scroll_high = (data & 0x01) * 256; + m_horiz_scroll_high = (data & 0xff) * 256; } /*************************************************************************** @@ -139,7 +172,7 @@ ***************************************************************************/ void vigilant_state::vigilant_rear_horiz_scroll_w(offs_t offset, uint8_t data) { - if (offset==0) + if (offset == 0) m_rear_horiz_scroll_low = data; else m_rear_horiz_scroll_high = (data & 0x07) * 256; @@ -167,6 +200,42 @@ } /*************************************************************************** + bowmen_rear_horiz_scroll_w + + rear_horiz_scroll_low = RHSPL, an 8-bit register + rear_horiz_scroll_high = RHSPH, an 8-bit register +***************************************************************************/ +void vigilant_state::bowmen_rear_horiz_scroll_w(offs_t offset, uint8_t data) +{ + if (offset == 0) + m_rear_horiz_scroll_low = data; + else + m_rear_horiz_scroll_high = (data & 0x1f) * 256; +} + +/*************************************************************************** + bowmen_rear_color_w + + This is an 8-bit register labelled RCOD. + D6 is hooked to !ROME (rear_disable) + D3 = RCC2 (rear color bit 2) + D2 = RCC1 (rear color bit 1) + D0 = RCC0 (rear color bit 0) + + I know it looks odd, but D1, D4, D5, and D7 are empty. + + What makes this extremely odd is that RCC is supposed to hook up to the + palette. However, the top four bits of the palette inputs are labelled: + "RCC3", "RCC2", "V256E", "RCC0". Methinks there's a typo. + **************************************************************************/ +void vigilant_state::bowmen_rear_color_w(uint8_t data) +{ + m_rear_disable = data & 0x40; + m_rear_color = (data & 0x0f); +} + + +/*************************************************************************** draw_foreground ??? @@ -179,38 +248,38 @@ for (int offs = 0; offs < 0x1000; offs += 2) { - int sy = 8 * ((offs/2) / 64); - int sx = 8 * ((offs/2) % 64); - int attributes = m_videoram[offs+1]; - int color = attributes & 0x0F; - int tile_number = m_videoram[offs] | ((attributes & 0xF0) << 4); + int sy = 8 * ((offs / 2) / 64); + int sx = 8 * ((offs / 2) % 64); + int attributes = m_videoram[offs + 1]; + int color = attributes & 0x0f; + int tile_number = m_videoram[offs] | ((attributes & 0xf0) << 4); - if (priority) /* foreground */ + if (priority) // foreground { - if ((color & 0x0c) == 0x0c) /* mask sprites */ + if ((color & 0x0c) == 0x0c) // mask sprites { if (sy >= 48) { sx = (sx + scroll) & 0x1ff; - m_gfxdecode->gfx(0)->transmask(bitmap,bottomvisiblearea, + m_gfxdecode->gfx(0)->transmask(bitmap, bottomvisiblearea, tile_number, color, - 0,0, - sx,sy,0x00ff); + 0, 0, + sx, sy, 0x00ff); } } } - else /* background */ + else // background { if (sy >= 48) sx = (sx + scroll) & 0x1ff; - m_gfxdecode->gfx(0)->transpen(bitmap,cliprect, + m_gfxdecode->gfx(0)->transpen(bitmap, cliprect, tile_number, color, - 0,0, - sx,sy, + 0, 0, + sx, sy, (opaque || color >= 4) ? -1 : 0); } } @@ -220,48 +289,48 @@ void vigilant_state::draw_background(bitmap_ind16 &bitmap, const rectangle &cliprect) { - int scrollx = 0x17a + 16*8 - (m_rear_horiz_scroll_low + m_rear_horiz_scroll_high); + int scrollx = 0x17a + 16 * 8 - (m_rear_horiz_scroll_low + m_rear_horiz_scroll_high); if (m_rear_refresh) { update_background(); - m_rear_refresh=0; + m_rear_refresh = 0; } - copyscrollbitmap(bitmap,*m_bg_bitmap,1,&scrollx,0,nullptr,bottomvisiblearea); + copyscrollbitmap(bitmap, *m_bg_bitmap, 1, &scrollx, 0, nullptr, bottomvisiblearea); } -void vigilant_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect) +void vigilant_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) { - for (int offs = 0;offs < m_spriteram.bytes();offs += 8) + for (int offs = 0; offs < m_spriteram.bytes(); offs += 8) { - int code,color,sx,sy,flipx,flipy,h,y; + int code, color, sx, sy, flipx, flipy, h, y; - code = m_spriteram[offs+4] | ((m_spriteram[offs+5] & 0x0f) << 8); - color = m_spriteram[offs+0] & 0x0f; - sx = (m_spriteram[offs+6] | ((m_spriteram[offs+7] & 0x01) << 8)); - sy = 256+128 - (m_spriteram[offs+2] | ((m_spriteram[offs+3] & 0x01) << 8)); - flipx = m_spriteram[offs+5] & 0x40; - flipy = m_spriteram[offs+5] & 0x80; - h = 1 << ((m_spriteram[offs+5] & 0x30) >> 4); + code = m_spriteram[offs + 4] | ((m_spriteram[offs + 5] & 0x0f) << 8); + color = m_spriteram[offs + 0] & 0x0f; + sx = (m_spriteram[offs + 6] | ((m_spriteram[offs + 7] & 0x01) << 8)); + sy = 256 + 128 - (m_spriteram[offs + 2] | ((m_spriteram[offs + 3] & 0x01) << 8)); + flipx = m_spriteram[offs + 5] & 0x40; + flipy = m_spriteram[offs + 5] & 0x80; + h = 1 << ((m_spriteram[offs + 5] & 0x30) >> 4); sy -= 16 * h; code &= ~(h - 1); - for (y = 0;y < h;y++) + for (y = 0; y < h; y++) { int c = code; - if (flipy) c += h-1-y; + if (flipy) c += h - 1 - y; else c += y; - m_gfxdecode->gfx(1)->transpen(bitmap,cliprect, + m_gfxdecode->gfx(1)->transpen(bitmap, cliprect, c, color, - flipx,flipy, - sx,sy + 16*y,0); + flipx, flipy, + sx, sy + 16 * y, 0); } } } @@ -270,17 +339,17 @@ { for (int offs = 0; offs < 0x1000; offs += 2) { - int sy = 8 * ((offs/2) / 64); - int sx = 8 * ((offs/2) % 64); - int attributes = m_videoram[offs+1]; - int color = (attributes & 0xF0) >> 4; - int tile_number = m_videoram[offs] | ((attributes & 0x0F) << 8); + int sy = 8 * ((offs / 2) / 64); + int sx = 8 * ((offs / 2) % 64); + int attributes = m_videoram[offs + 1]; + int color = (attributes & 0xf0) >> 4; + int tile_number = m_videoram[offs] | ((attributes & 0x0f) << 8); - m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, + m_gfxdecode->gfx(0)->opaque(bitmap, cliprect, tile_number, color, - 0,0, - sx,sy); + 0, 0, + sx, sy); } draw_sprites(bitmap,cliprect); @@ -289,37 +358,119 @@ uint32_t vigilant_state::screen_update_vigilant(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - /* copy the background palette */ - for (int i = 0;i < 16;i++) + // copy the background palette + for (int i = 0; i < 16; i++) + { + int r, g, b; + + + r = (m_generic_paletteram_8[0x400 + 16 * m_rear_color + i] << 3) & 0xff; + g = (m_generic_paletteram_8[0x500 + 16 * m_rear_color + i] << 3) & 0xff; + b = (m_generic_paletteram_8[0x600 + 16 * m_rear_color + i] << 3) & 0xff; + + m_palette->set_pen_color(512 + i, rgb_t(r, g, b)); + + r = (m_generic_paletteram_8[0x400 + 16 * m_rear_color + 32 + i] << 3) & 0xff; + g = (m_generic_paletteram_8[0x500 + 16 * m_rear_color + 32 + i] << 3) & 0xff; + b = (m_generic_paletteram_8[0x600 + 16 * m_rear_color + 32 + i] << 3) & 0xff; + + m_palette->set_pen_color(512 + 16 + i, rgb_t(r, g, b)); + } + + if (m_rear_disable) // opaque foreground + { + draw_foreground(bitmap, cliprect, 0, 1); + draw_sprites(bitmap, bottomvisiblearea); + draw_foreground(bitmap, cliprect, 1, 0); + } + else + { + draw_background(bitmap, cliprect); + draw_foreground(bitmap, cliprect, 0, 0); + draw_sprites(bitmap, bottomvisiblearea); + draw_foreground(bitmap, cliprect, 1, 0); // priority tiles + } + return 0; +} + +void vigilant_state::draw_foreground_bowmen(bitmap_ind16 &bitmap, const rectangle &cliprect, int priority, int opaque ) +{ + for (int offs = 0; offs < 0x1000; offs += 2) + { + int sy = 8 * ((offs / 2) / 64); + int sx = 8 * ((offs / 2) % 64); + int attributes = m_videoram[offs + 1]; + int color = attributes & 0x0f; + int tile_number = m_videoram[offs] | ((attributes & 0xf0) << 4); + + if (priority) // foreground + { + if ((color & 0x0f) == 0x0f) // mask sprites + { + m_gfxdecode->gfx(0)->transmask(bitmap, bowmenvisiblearea, + tile_number, + color, + 0, 0, + sx, sy, 0x00ff); + } + } + else // background + { + m_gfxdecode->gfx(0)->transpen(bitmap, cliprect, + tile_number, + color, + 0, 0, + sx, sy, + (opaque) ? -1 : 0); + } + } +} + +void vigilant_state::draw_background_bowmen(bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + int scrollx = 0x179 + 16 * 8 - (m_rear_horiz_scroll_low + m_rear_horiz_scroll_high); + + + if (m_rear_refresh) + { + update_background_bowmen(); + m_rear_refresh = 0; + } + + copyscrollbitmap(bitmap, *m_bg_bitmap, 1, &scrollx, 0, nullptr, bowmenvisiblearea); +} + +uint32_t vigilant_state::screen_update_bowmen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + // copy the background palette + for (int i = 0; i < 16; i++) { - int r,g,b; + int r, g, b; - r = (m_generic_paletteram_8[0x400 + 16 * m_rear_color + i] << 3) & 0xFF; - g = (m_generic_paletteram_8[0x500 + 16 * m_rear_color + i] << 3) & 0xFF; - b = (m_generic_paletteram_8[0x600 + 16 * m_rear_color + i] << 3) & 0xFF; + r = (m_generic_paletteram_8[0x400 + 16 * m_rear_color + i] << 3) & 0xff; + g = (m_generic_paletteram_8[0x500 + 16 * m_rear_color + i] << 3) & 0xff; + b = (m_generic_paletteram_8[0x600 + 16 * m_rear_color + i] << 3) & 0xff; - m_palette->set_pen_color(512 + i,rgb_t(r,g,b)); + m_palette->set_pen_color(512 + i, rgb_t(r, g, b)); - r = (m_generic_paletteram_8[0x400 + 16 * m_rear_color + 32 + i] << 3) & 0xFF; - g = (m_generic_paletteram_8[0x500 + 16 * m_rear_color + 32 + i] << 3) & 0xFF; - b = (m_generic_paletteram_8[0x600 + 16 * m_rear_color + 32 + i] << 3) & 0xFF; + r = (m_generic_paletteram_8[0x400 + 16 * m_rear_color + 32 + i] << 3) & 0xff; + g = (m_generic_paletteram_8[0x500 + 16 * m_rear_color + 32 + i] << 3) & 0xff; + b = (m_generic_paletteram_8[0x600 + 16 * m_rear_color + 32 + i] << 3) & 0xff; - m_palette->set_pen_color(512 + 16 + i,rgb_t(r,g,b)); + m_palette->set_pen_color(512 + 16 + i, rgb_t(r, g, b)); } - if (m_rear_disable) /* opaque foreground */ + if (m_rear_disable) // opaque foreground { - draw_foreground(bitmap,cliprect,0,1); - draw_sprites(bitmap,bottomvisiblearea); - draw_foreground(bitmap,cliprect,1,0); + draw_foreground_bowmen(bitmap, cliprect, 0, 1); } else { - draw_background(bitmap,cliprect); - draw_foreground(bitmap,cliprect,0,0); - draw_sprites(bitmap,bottomvisiblearea); - draw_foreground(bitmap,cliprect,1,0); // priority tiles + draw_background_bowmen(bitmap, cliprect); + draw_foreground_bowmen(bitmap, cliprect, 0, 0); } + draw_sprites(bitmap, bowmenvisiblearea); +// draw_foreground_bowmen(bitmap, cliprect, 1, 0); // priority tiles return 0; } diff -Nru mame-0.242+dfsg.1/src/mame/video/vtvideo.h mame-0.243+dfsg.1/src/mame/video/vtvideo.h --- mame-0.242+dfsg.1/src/mame/video/vtvideo.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/vtvideo.h 2022-04-29 05:37:26.000000000 +0000 @@ -58,34 +58,34 @@ devcb_write8 m_write_lba3_lba4; devcb_write_line m_write_lba7; - int m_lba7; + int m_lba7 = 0; - bool MHFU_FLAG; - int MHFU_counter; + bool MHFU_FLAG = false; + int MHFU_counter = 0; // dc012 attributes - uint8_t m_scroll_latch; - bool m_scroll_latch_valid; - uint8_t m_blink_flip_flop; - uint8_t m_reverse_field; - uint8_t m_basic_attribute; + uint8_t m_scroll_latch = 0; + bool m_scroll_latch_valid = false; + uint8_t m_blink_flip_flop = 0; + uint8_t m_reverse_field = 0; + uint8_t m_basic_attribute = 0; // dc011 attributes - uint8_t m_columns; - uint8_t m_height; - uint8_t m_height_MAX; - uint8_t m_fill_lines; - bool m_is_50hz; - bool m_interlaced; - emu_timer *m_lba3_change_timer; - emu_timer *m_lba7_change_timer; + uint8_t m_columns = 0; + uint8_t m_height = 0; + uint8_t m_height_MAX = 0; + uint8_t m_fill_lines = 0; + bool m_is_50hz = false; + bool m_interlaced = false; + emu_timer *m_lba3_change_timer = nullptr; + emu_timer *m_lba7_change_timer = nullptr; required_region_ptr m_char_rom; /* character rom region */ required_device m_palette; - bool m_notify_vblank; - int m_last_scroll; + bool m_notify_vblank = false; + int m_last_scroll = 0; - bool m_linedoubler; + bool m_linedoubler = false; }; diff -Nru mame-0.242+dfsg.1/src/mame/video/zx8301.h mame-0.243+dfsg.1/src/mame/video/zx8301.h --- mame-0.242+dfsg.1/src/mame/video/zx8301.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/mame/video/zx8301.h 2022-04-29 05:37:26.000000000 +0000 @@ -101,8 +101,8 @@ int m_vsync; // vertical sync int m_vda; // valid data address - emu_timer *m_vsync_timer; // vertical sync timer - emu_timer *m_flash_timer; // flash timer + emu_timer *m_vsync_timer = nullptr; // vertical sync timer + emu_timer *m_flash_timer = nullptr; // flash timer }; diff -Nru mame-0.242+dfsg.1/src/osd/modules/debugger/debugimgui.cpp mame-0.243+dfsg.1/src/osd/modules/debugger/debugimgui.cpp --- mame-0.242+dfsg.1/src/osd/modules/debugger/debugimgui.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/osd/modules/debugger/debugimgui.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -142,7 +142,7 @@ struct image_type_entry { - floppy_image_format_t* format; + const floppy_image_format_t* format; std::string shortname; std::string longname; }; @@ -1061,7 +1061,7 @@ if(fd == nullptr) return; - for(floppy_image_format_t* flist : fd->get_formats()) + for(const floppy_image_format_t* flist : fd->get_formats()) { if(flist->supports_save()) { diff -Nru mame-0.242+dfsg.1/src/osd/modules/osdhelper.h mame-0.243+dfsg.1/src/osd/modules/osdhelper.h --- mame-0.242+dfsg.1/src/osd/modules/osdhelper.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/osd/modules/osdhelper.h 2022-04-29 05:37:26.000000000 +0000 @@ -20,8 +20,8 @@ constexpr int width() const { return m_w; } constexpr int height() const { return m_h; } - constexpr bool operator!=(const osd_dim &other) { return (m_w != other.width()) || (m_h != other.height()); } - constexpr bool operator==(const osd_dim &other) { return (m_w == other.width()) && (m_h == other.height()); } + constexpr bool operator!=(const osd_dim &other) const { return (m_w != other.width()) || (m_h != other.height()); } + constexpr bool operator==(const osd_dim &other) const { return (m_w == other.width()) && (m_h == other.height()); } private: int m_w; diff -Nru mame-0.242+dfsg.1/src/osd/modules/render/d3d/d3dhlsl.cpp mame-0.243+dfsg.1/src/osd/modules/render/d3d/d3dhlsl.cpp --- mame-0.242+dfsg.1/src/osd/modules/render/d3d/d3dhlsl.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/osd/modules/render/d3d/d3dhlsl.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -505,7 +505,7 @@ snap_width = winoptions.d3d_snap_width(); snap_height = winoptions.d3d_snap_height(); - this->options = make_unique_clear().release(); + this->options = new hlsl_options; this->options->params_init = false; // copy last options if initialized diff -Nru mame-0.242+dfsg.1/src/osd/modules/render/d3d/d3dhlsl.h mame-0.243+dfsg.1/src/osd/modules/render/d3d/d3dhlsl.h --- mame-0.242+dfsg.1/src/osd/modules/render/d3d/d3dhlsl.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/osd/modules/render/d3d/d3dhlsl.h 2022-04-29 05:37:26.000000000 +0000 @@ -175,92 +175,92 @@ /* in the future this will be moved into an OSD/emu shared buffer */ struct hlsl_options { - bool params_init; - bool params_dirty; - int shadow_mask_tile_mode; - float shadow_mask_alpha; - char shadow_mask_texture[1024]; - int shadow_mask_count_x; - int shadow_mask_count_y; - float shadow_mask_u_size; - float shadow_mask_v_size; - float shadow_mask_u_offset; - float shadow_mask_v_offset; - float distortion; - float cubic_distortion; - float distort_corner; - float round_corner; - float smooth_border; - float reflection; - float vignetting; - float scanline_alpha; - float scanline_scale; - float scanline_height; - float scanline_variation; - float scanline_bright_scale; - float scanline_bright_offset; - float scanline_jitter; - float hum_bar_alpha; - float defocus[2]; - float converge_x[3]; - float converge_y[3]; - float radial_converge_x[3]; - float radial_converge_y[3]; - float red_ratio[3]; - float grn_ratio[3]; - float blu_ratio[3]; - float offset[3]; - float scale[3]; - float power[3]; - float floor[3]; - float phosphor[3]; - float saturation; - int chroma_mode; - float chroma_a[2]; - float chroma_b[2]; - float chroma_c[2]; - float chroma_conversion_gain[3]; - float chroma_y_gain[3]; + bool params_init = false; + bool params_dirty = false; + int shadow_mask_tile_mode = 0; + float shadow_mask_alpha = 0.0; + char shadow_mask_texture[1024]{ 0 }; + int shadow_mask_count_x = 0; + int shadow_mask_count_y = 0; + float shadow_mask_u_size = 0.0; + float shadow_mask_v_size = 0.0; + float shadow_mask_u_offset = 0.0; + float shadow_mask_v_offset = 0.0; + float distortion = 0.0; + float cubic_distortion = 0.0; + float distort_corner = 0.0; + float round_corner = 0.0; + float smooth_border = 0.0; + float reflection = 0.0; + float vignetting = 0.0; + float scanline_alpha = 0.0; + float scanline_scale = 0.0; + float scanline_height = 0.0; + float scanline_variation = 0.0; + float scanline_bright_scale = 0.0; + float scanline_bright_offset = 0.0; + float scanline_jitter = 0.0; + float hum_bar_alpha = 0.0; + float defocus[2]{ 0.0 }; + float converge_x[3]{ 0.0 }; + float converge_y[3]{ 0.0 }; + float radial_converge_x[3]{ 0.0 }; + float radial_converge_y[3]{ 0.0 }; + float red_ratio[3]{ 0.0 }; + float grn_ratio[3]{ 0.0 }; + float blu_ratio[3]{ 0.0 }; + float offset[3]{ 0.0 }; + float scale[3]{ 0.0 }; + float power[3]{ 0.0 }; + float floor[3]{ 0.0 }; + float phosphor[3]{ 0.0 }; + float saturation = 0.0; + int chroma_mode = 0; + float chroma_a[2]{ 0.0 }; + float chroma_b[2]{ 0.0 }; + float chroma_c[2]{ 0.0 }; + float chroma_conversion_gain[3]{ 0.0 }; + float chroma_y_gain[3]{ 0.0 }; // NTSC - int yiq_enable; - float yiq_jitter; - float yiq_cc; - float yiq_a; - float yiq_b; - float yiq_o; - float yiq_p; - float yiq_n; - float yiq_y; - float yiq_i; - float yiq_q; - float yiq_scan_time; - int yiq_phase_count; + int yiq_enable = 0; + float yiq_jitter = 0.0; + float yiq_cc = 0.0; + float yiq_a = 0.0; + float yiq_b = 0.0; + float yiq_o = 0.0; + float yiq_p = 0.0; + float yiq_n = 0.0; + float yiq_y = 0.0; + float yiq_i = 0.0; + float yiq_q = 0.0; + float yiq_scan_time = 0.0; + int yiq_phase_count = 0; // Vectors - float vector_beam_smooth; - float vector_length_scale; - float vector_length_ratio; + float vector_beam_smooth = 0.0; + float vector_length_scale = 0.0; + float vector_length_ratio = 0.0; // Bloom - int bloom_blend_mode; - float bloom_scale; - float bloom_overdrive[3]; - float bloom_level0_weight; - float bloom_level1_weight; - float bloom_level2_weight; - float bloom_level3_weight; - float bloom_level4_weight; - float bloom_level5_weight; - float bloom_level6_weight; - float bloom_level7_weight; - float bloom_level8_weight; + int bloom_blend_mode = 0; + float bloom_scale = 0.0; + float bloom_overdrive[3]{ 0.0 }; + float bloom_level0_weight = 0.0; + float bloom_level1_weight = 0.0; + float bloom_level2_weight = 0.0; + float bloom_level3_weight = 0.0; + float bloom_level4_weight = 0.0; + float bloom_level5_weight = 0.0; + float bloom_level6_weight = 0.0; + float bloom_level7_weight = 0.0; + float bloom_level8_weight = 0.0; // Final - char lut_texture[1024]; - int lut_enable; - char ui_lut_texture[1024]; - int ui_lut_enable; + char lut_texture[1024]{ 0 }; + int lut_enable = 0; + char ui_lut_texture[1024]{ 0 }; + int ui_lut_enable = 0; }; struct slider_desc diff -Nru mame-0.242+dfsg.1/src/osd/strconv.cpp mame-0.243+dfsg.1/src/osd/strconv.cpp --- mame-0.242+dfsg.1/src/osd/strconv.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/osd/strconv.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -254,6 +254,11 @@ int osd_uchar_from_osdchar(char32_t *uchar, const char *osdchar, size_t count) { + // FIXME: Does not handle charsets that use variable lengths encodings such + // as example GB18030 or UTF-8. + // FIXME: Assumes all characters can be converted into a single wchar_t + // which may not always be the case such as with surrogate pairs. + WCHAR wch; CPINFO cp; @@ -261,7 +266,7 @@ goto error; // The multibyte char can't be bigger than the max character size - count = std::min(count, size_t(cp.MaxCharSize)); + count = std::min(count, size_t(IsDBCSLeadByte(*osdchar) ? cp.MaxCharSize : 1)); if (MultiByteToWideChar(CP_ACP, 0, osdchar, static_cast(count), &wch, 1) == 0) goto error; diff -Nru mame-0.242+dfsg.1/src/tools/chdman.cpp mame-0.243+dfsg.1/src/tools/chdman.cpp --- mame-0.242+dfsg.1/src/tools/chdman.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/tools/chdman.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -11,7 +11,7 @@ #include "avhuff.h" #include "aviio.h" #include "bitmap.h" -#include "chdcd.h" +#include "cdrom.h" #include "corefile.h" #include "hashing.h" #include "md5.h" @@ -309,11 +309,11 @@ // if we have TOC - detect audio sectors and swap data if (m_toc) { - assert(offset % CD_FRAME_SIZE == 0); - assert(length % CD_FRAME_SIZE == 0); + assert(offset % cdrom_file::FRAME_SIZE == 0); + assert(length % cdrom_file::FRAME_SIZE == 0); - int startlba = offset / CD_FRAME_SIZE; - int lenlba = length / CD_FRAME_SIZE; + int startlba = offset / cdrom_file::FRAME_SIZE; + int lenlba = length / cdrom_file::FRAME_SIZE; uint8_t *_dest = reinterpret_cast(dest); for (int chdlba = 0; chdlba < lenlba; chdlba++) @@ -327,11 +327,11 @@ break; } // is it audio ? - if (m_toc->tracks[tracknum].trktype != CD_TRACK_AUDIO) + if (m_toc->tracks[tracknum].trktype != cdrom_file::CD_TRACK_AUDIO) continue; // byteswap if yes - int dataoffset = chdlba * CD_FRAME_SIZE; - for (uint32_t swapindex = dataoffset; swapindex < (dataoffset + CD_MAX_SECTOR_DATA); swapindex += 2) + int dataoffset = chdlba * cdrom_file::FRAME_SIZE; + for (uint32_t swapindex = dataoffset; swapindex < (dataoffset + cdrom_file::MAX_SECTOR_DATA); swapindex += 2) { uint8_t temp = _dest[swapindex]; _dest[swapindex] = _dest[swapindex + 1]; @@ -343,7 +343,7 @@ return length; } -const cdrom_toc * m_toc; +const cdrom_file::toc * m_toc; private: // internal state @@ -359,7 +359,7 @@ { public: // construction/destruction - chd_cd_compressor(cdrom_toc &toc, chdcd_track_input_info &info) + chd_cd_compressor(cdrom_file::toc &toc, cdrom_file::track_input_info &info) : m_file(), m_toc(toc), m_info(info) { } @@ -372,8 +372,8 @@ virtual uint32_t read_data(void *_dest, uint64_t offset, uint32_t length) { // verify assumptions made below - assert(offset % CD_FRAME_SIZE == 0); - assert(length % CD_FRAME_SIZE == 0); + assert(offset % cdrom_file::FRAME_SIZE == 0); + assert(length % cdrom_file::FRAME_SIZE == 0); // initialize destination to 0 so that unused areas are filled uint8_t *dest = reinterpret_cast(_dest); @@ -384,8 +384,8 @@ uint32_t length_remaining = length; for (int tracknum = 0; tracknum < m_toc.numtrks; tracknum++) { - const cdrom_track_info &trackinfo = m_toc.tracks[tracknum]; - uint64_t endoffs = startoffs + (uint64_t)(trackinfo.frames + trackinfo.extraframes) * CD_FRAME_SIZE; + const cdrom_file::track_info &trackinfo = m_toc.tracks[tracknum]; + uint64_t endoffs = startoffs + (uint64_t)(trackinfo.frames + trackinfo.extraframes) * cdrom_file::FRAME_SIZE; if (offset >= startoffs && offset < endoffs) { // if we don't already have this file open, open it now @@ -412,7 +412,7 @@ while (length_remaining != 0 && offset < endoffs) { // determine start of current frame - uint64_t src_frame_start = src_track_start + ((offset - startoffs) / CD_FRAME_SIZE) * bytesperframe; + uint64_t src_frame_start = src_track_start + ((offset - startoffs) / cdrom_file::FRAME_SIZE) * bytesperframe; // auto-advance next track for split-bin read if (src_frame_start == split_track_start && m_lastfile.compare(m_info.track[tracknum+1].fname)!=0) @@ -456,9 +456,9 @@ } // advance - offset += CD_FRAME_SIZE; - dest += CD_FRAME_SIZE; - length_remaining -= CD_FRAME_SIZE; + offset += cdrom_file::FRAME_SIZE; + dest += cdrom_file::FRAME_SIZE; + length_remaining -= cdrom_file::FRAME_SIZE; if (length_remaining == 0) break; } @@ -472,10 +472,10 @@ private: // internal state - std::string m_lastfile; - util::core_file::ptr m_file; - cdrom_toc & m_toc; - chdcd_track_input_info & m_info; + std::string m_lastfile; + util::core_file::ptr m_file; + cdrom_file::toc & m_toc; + cdrom_file::track_input_info &m_info; }; @@ -1290,7 +1290,7 @@ // to a CUE file //------------------------------------------------- -void output_track_metadata(int mode, util::core_file &file, int tracknum, const cdrom_track_info &info, const std::string &filename, uint32_t frameoffs, uint64_t discoffs) +void output_track_metadata(int mode, util::core_file &file, int tracknum, const cdrom_file::track_info &info, const std::string &filename, uint32_t frameoffs, uint64_t discoffs) { if (mode == MODE_GDI) { @@ -1298,42 +1298,42 @@ switch (info.trktype) { - case CD_TRACK_MODE1: + case cdrom_file::CD_TRACK_MODE1: mode = 4; size = 2048; break; - case CD_TRACK_MODE1_RAW: + case cdrom_file::CD_TRACK_MODE1_RAW: mode = 4; size = 2352; break; - case CD_TRACK_MODE2: + case cdrom_file::CD_TRACK_MODE2: mode = 4; size = 2336; break; - case CD_TRACK_MODE2_FORM1: + case cdrom_file::CD_TRACK_MODE2_FORM1: mode = 4; size = 2048; break; - case CD_TRACK_MODE2_FORM2: + case cdrom_file::CD_TRACK_MODE2_FORM2: mode = 4; size = 2324; break; - case CD_TRACK_MODE2_FORM_MIX: + case cdrom_file::CD_TRACK_MODE2_FORM_MIX: mode = 4; size = 2336; break; - case CD_TRACK_MODE2_RAW: + case cdrom_file::CD_TRACK_MODE2_RAW: mode = 4; size = 2352; break; - case CD_TRACK_AUDIO: + case cdrom_file::CD_TRACK_AUDIO: mode = 0; size = 2352; break; @@ -1352,20 +1352,20 @@ std::string tempstr; switch (info.trktype) { - case CD_TRACK_MODE1: - case CD_TRACK_MODE1_RAW: + case cdrom_file::CD_TRACK_MODE1: + case cdrom_file::CD_TRACK_MODE1_RAW: tempstr = string_format("MODE1/%04d", info.datasize); break; - case CD_TRACK_MODE2: - case CD_TRACK_MODE2_FORM1: - case CD_TRACK_MODE2_FORM2: - case CD_TRACK_MODE2_FORM_MIX: - case CD_TRACK_MODE2_RAW: + case cdrom_file::CD_TRACK_MODE2: + case cdrom_file::CD_TRACK_MODE2_FORM1: + case cdrom_file::CD_TRACK_MODE2_FORM2: + case cdrom_file::CD_TRACK_MODE2_FORM_MIX: + case cdrom_file::CD_TRACK_MODE2_RAW: tempstr = string_format("MODE2/%04d", info.datasize); break; - case CD_TRACK_AUDIO: + case cdrom_file::CD_TRACK_AUDIO: tempstr.assign("AUDIO"); break; } @@ -1405,15 +1405,15 @@ // write out the track type std::string modesubmode; - if (info.subtype != CD_SUB_NONE) - modesubmode = string_format("%s %s", cdrom_get_type_string(info.trktype), cdrom_get_subtype_string(info.subtype)); + if (info.subtype != cdrom_file::CD_SUB_NONE) + modesubmode = string_format("%s %s", cdrom_file::get_type_string(info.trktype), cdrom_file::get_subtype_string(info.subtype)); else - modesubmode = string_format("%s", cdrom_get_type_string(info.trktype)); + modesubmode = string_format("%s", cdrom_file::get_type_string(info.trktype)); file.printf("TRACK %s\n", modesubmode); // write out the attributes file.printf("NO COPY\n"); - if (info.trktype == CD_TRACK_AUDIO) + if (info.trktype == cdrom_file::CD_TRACK_AUDIO) { file.printf("NO PRE_EMPHASIS\n"); file.printf("TWO_CHANNEL_AUDIO\n"); @@ -1982,12 +1982,12 @@ static void do_create_cd(parameters_map ¶ms) { // process input file - chdcd_track_input_info track_info; - cdrom_toc toc = { 0 }; + cdrom_file::track_input_info track_info; + cdrom_file::toc toc = { 0 }; auto input_file_str = params.find(OPTION_INPUT); if (input_file_str != params.end()) { - std::error_condition err = chdcd_parse_toc(input_file_str->second->c_str(), toc, track_info); + std::error_condition err = cdrom_file::parse_toc(*input_file_str->second, toc, track_info); if (err) report_error(1, "Error parsing input file (%s: %s)\n", *input_file_str->second, err.message()); } @@ -1997,8 +1997,8 @@ std::string *output_chd_str = parse_output_chd_parameters(params, output_parent); // process hunk size - uint32_t hunk_size = output_parent.opened() ? output_parent.hunk_bytes() : CD_FRAMES_PER_HUNK * CD_FRAME_SIZE; - parse_hunk_size(params, CD_FRAME_SIZE, hunk_size); + uint32_t hunk_size = output_parent.opened() ? output_parent.hunk_bytes() : cdrom_file::FRAMES_PER_HUNK * cdrom_file::FRAME_SIZE; + parse_hunk_size(params, cdrom_file::FRAME_SIZE, hunk_size); // process compression chd_codec_type compression[4]; @@ -2013,9 +2013,9 @@ uint32_t totalsectors = 0; for (int tracknum = 0; tracknum < toc.numtrks; tracknum++) { - cdrom_track_info &trackinfo = toc.tracks[tracknum]; - int padded = (trackinfo.frames + CD_TRACK_PADDING - 1) / CD_TRACK_PADDING; - trackinfo.extraframes = padded * CD_TRACK_PADDING - trackinfo.frames; + cdrom_file::track_info &trackinfo = toc.tracks[tracknum]; + int padded = (trackinfo.frames + cdrom_file::TRACK_PADDING - 1) / cdrom_file::TRACK_PADDING; + trackinfo.extraframes = padded * cdrom_file::TRACK_PADDING - trackinfo.frames; origtotalsectors += trackinfo.frames; totalsectors += trackinfo.frames + trackinfo.extraframes; } @@ -2028,7 +2028,7 @@ printf("Input tracks: %d\n", toc.numtrks); printf("Input length: %s\n", msf_string_from_frames(origtotalsectors).c_str()); printf("Compression: %s\n", compression_string(compression).c_str()); - printf("Logical size: %s\n", big_int_string(uint64_t(totalsectors) * CD_FRAME_SIZE).c_str()); + printf("Logical size: %s\n", big_int_string(uint64_t(totalsectors) * cdrom_file::FRAME_SIZE).c_str()); // catch errors so we can close & delete the output file chd_cd_compressor *chd = nullptr; @@ -2038,14 +2038,14 @@ chd = new chd_cd_compressor(toc, track_info); std::error_condition err; if (output_parent.opened()) - err = chd->create(output_chd_str->c_str(), uint64_t(totalsectors) * uint64_t(CD_FRAME_SIZE), hunk_size, compression, output_parent); + err = chd->create(output_chd_str->c_str(), uint64_t(totalsectors) * uint64_t(cdrom_file::FRAME_SIZE), hunk_size, compression, output_parent); else - err = chd->create(output_chd_str->c_str(), uint64_t(totalsectors) * uint64_t(CD_FRAME_SIZE), hunk_size, CD_FRAME_SIZE, compression); + err = chd->create(output_chd_str->c_str(), uint64_t(totalsectors) * uint64_t(cdrom_file::FRAME_SIZE), hunk_size, cdrom_file::FRAME_SIZE, compression); if (err) report_error(1, "Error creating CHD file (%s): %s", *output_chd_str, err.message()); // add the standard CD metadata; we do this even if we have a parent because it might be different - err = cdrom_write_metadata(chd, &toc); + err = cdrom_file::write_metadata(chd, toc); if (err) report_error(1, "Error adding CD metadata: %s", err.message()); @@ -2299,15 +2299,13 @@ // if we need to re-do the CD metadata, do it now if (redo_cd) { - cdrom_file *cdrom = cdrom_open(&input_chd); - if (cdrom == nullptr) - report_error(1, "Error upgrading CD metadata"); - const cdrom_toc *toc = cdrom_get_toc(cdrom); - err = cdrom_write_metadata(chd, toc); + cdrom_file *cdrom = new cdrom_file(&input_chd); + const cdrom_file::toc &toc = cdrom->get_toc(); + err = cdrom_file::write_metadata(chd, toc); if (err) report_error(1, "Error writing upgraded CD metadata: %s", err.message()); if (cdda_swap) - chd->m_toc = toc; + chd->m_toc = &toc; } // compress it generically @@ -2418,10 +2416,8 @@ parse_input_chd_parameters(params, input_chd, input_parent_chd); // further process input file - cdrom_file *cdrom = cdrom_open(&input_chd); - if (cdrom == nullptr) - report_error(1, "Unable to recognize CHD file as a CD"); - const cdrom_toc *toc = cdrom_get_toc(cdrom); + cdrom_file *cdrom = new cdrom_file(&input_chd); + const cdrom_file::toc &toc = cdrom->get_toc(); // verify output file doesn't exist auto output_file_str = params.find(OPTION_OUTPUT); @@ -2481,20 +2477,20 @@ // determine total frames uint64_t total_bytes = 0; - for (int tracknum = 0; tracknum < toc->numtrks; tracknum++) - total_bytes += toc->tracks[tracknum].frames * (toc->tracks[tracknum].datasize + toc->tracks[tracknum].subsize); + for (int tracknum = 0; tracknum < toc.numtrks; tracknum++) + total_bytes += toc.tracks[tracknum].frames * (toc.tracks[tracknum].datasize + toc.tracks[tracknum].subsize); // GDI must start with the # of tracks if (mode == MODE_GDI) { - output_toc_file->printf("%d\n", toc->numtrks); + output_toc_file->printf("%d\n", toc.numtrks); } // iterate over tracks and copy all data uint64_t outputoffs = 0; uint32_t discoffs = 0; std::vector buffer; - for (int tracknum = 0; tracknum < toc->numtrks; tracknum++) + for (int tracknum = 0; tracknum < toc.numtrks; tracknum++) { std::string trackbin_name(basename); @@ -2503,7 +2499,7 @@ char temp[11]; sprintf(temp, "%02d", tracknum+1); trackbin_name.append(temp); - if (toc->tracks[tracknum].trktype == CD_TRACK_AUDIO) + if (toc.tracks[tracknum].trktype == cdrom_file::CD_TRACK_AUDIO) trackbin_name.append(".raw"); else trackbin_name.append(".bin"); @@ -2518,7 +2514,7 @@ } // output the metadata about the track to the TOC file - const cdrom_track_info &trackinfo = toc->tracks[tracknum]; + const cdrom_file::track_info &trackinfo = toc.tracks[tracknum]; if (mode == MODE_GDI) { output_track_metadata(mode, *output_toc_file, tracknum, trackinfo, std::string(core_filename_extract_base(trackbin_name)), discoffs, outputoffs); @@ -2530,8 +2526,8 @@ // If this is bin/cue output and the CHD contains subdata, warn the user and don't include // the subdata size in the buffer calculation. - uint32_t output_frame_size = trackinfo.datasize + ((trackinfo.subtype != CD_SUB_NONE) ? trackinfo.subsize : 0); - if (trackinfo.subtype != CD_SUB_NONE && ((mode == MODE_CUEBIN) || (mode == MODE_GDI))) + uint32_t output_frame_size = trackinfo.datasize + ((trackinfo.subtype != cdrom_file::CD_SUB_NONE) ? trackinfo.subsize : 0); + if (trackinfo.subtype != cdrom_file::CD_SUB_NONE && ((mode == MODE_CUEBIN) || (mode == MODE_GDI))) { printf("Warning: Track %d has subcode data. bin/cue and gdi formats cannot contain subcode data and it will be omitted.\n", tracknum+1); printf(" : This may affect usage of the output image. Use bin/toc output to keep all data.\n"); @@ -2549,11 +2545,11 @@ progress(false, "Extracting, %.1f%% complete... \r", 100.0 * double(outputoffs) / double(total_bytes)); // read the data - cdrom_read_data(cdrom, cdrom_get_track_start_phys(cdrom, tracknum) + frame, &buffer[bufferoffs], trackinfo.trktype, true); + cdrom->read_data(cdrom->get_track_start_phys(tracknum) + frame, &buffer[bufferoffs], trackinfo.trktype, true); // for CDRWin and GDI audio tracks must be reversed // in the case of GDI and CHD version < 5 we assuming source CHD image is GDROM so audio tracks is already reversed - if (((mode == MODE_GDI && input_chd.version() > 4) || (mode == MODE_CUEBIN)) && (trackinfo.trktype == CD_TRACK_AUDIO)) + if (((mode == MODE_GDI && input_chd.version() > 4) || (mode == MODE_CUEBIN)) && (trackinfo.trktype == cdrom_file::CD_TRACK_AUDIO)) for (int swapindex = 0; swapindex < trackinfo.datasize; swapindex += 2) { uint8_t swaptemp = buffer[bufferoffs + swapindex]; @@ -2564,9 +2560,9 @@ discoffs++; // read the subcode data - if (trackinfo.subtype != CD_SUB_NONE && (mode == MODE_NORMAL)) + if (trackinfo.subtype != cdrom_file::CD_SUB_NONE && (mode == MODE_NORMAL)) { - cdrom_read_subcode(cdrom, cdrom_get_track_start_phys(cdrom, tracknum) + frame, &buffer[bufferoffs], true); + cdrom->read_subcode(cdrom->get_track_start_phys(tracknum) + frame, &buffer[bufferoffs], true); bufferoffs += trackinfo.subsize; } diff -Nru mame-0.242+dfsg.1/src/tools/floptool.cpp mame-0.243+dfsg.1/src/tools/floptool.cpp --- mame-0.242+dfsg.1/src/tools/floptool.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/tools/floptool.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -139,7 +139,13 @@ bool first = true; for(const auto &e : scores) { - printf("%-*s %c %3d - %-*s %s\n", sz, first ? argv[i] : "", first ? ':' : ' ', e.first, sz2, e.second->m_format->name(), e.second->m_format->description()); + printf("%-*s %c %c%c%c%c%c - %-*s %s\n", sz, first ? argv[i] : "", first ? ':' : ' ', + e.first & 0x10 ? '+' : '.', + e.first & 0x08 ? '+' : '.', + e.first & 0x04 ? '+' : '.', + e.first & 0x02 ? '+' : '.', + e.first & 0x01 ? '+' : '.', + sz2, e.second->m_format->name(), e.second->m_format->description()); first = false; } } @@ -277,7 +283,7 @@ if(!meta.has(m.m_name)) continue; size_t slot = nmap.find(m.m_name)->second; - std::string val = fs::meta_value::to_string(m.m_type, meta.get(m.m_name)); + std::string val = meta.get(m.m_name).to_string(); if(slot == 0) val = head + "dir " + val; entries[id][slot] = val; @@ -295,7 +301,7 @@ if(!meta.has(m.m_name)) continue; size_t slot = nmap.find(m.m_name)->second; - std::string val = fs::meta_value::to_string(m.m_type, meta.get(m.m_name)); + std::string val = meta.get(m.m_name).to_string(); if(slot == 0) val = head + (c.m_type == fs::dir_entry_type::system_file ? "sys " : "file ") + val; entries[id][slot] = val; @@ -317,7 +323,7 @@ if(!vmeta.empty()) { std::string vinf = "Volume:"; for(const auto &e : vmetad) - vinf += util::string_format(" %s=%s", fs::meta_data::entry_name(e.m_name), fs::meta_value::to_string(e.m_type, vmeta.get(e.m_name))); + vinf += util::string_format(" %s=%s", fs::meta_data::entry_name(e.m_name), vmeta.get(e.m_name).to_string()); printf("%s\n\n", vinf.c_str()); } diff -Nru mame-0.242+dfsg.1/src/tools/image_handler.cpp mame-0.243+dfsg.1/src/tools/image_handler.cpp --- mame-0.242+dfsg.1/src/tools/image_handler.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/tools/image_handler.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -31,8 +31,8 @@ m_category = name; } - virtual void add(floppy_format_type format) { - m_table->floppy_format_infos.emplace_back(std::make_unique(format(), m_category)); + virtual void add(const floppy_image_format_t &format) { + m_table->floppy_format_infos.emplace_back(std::make_unique(&format, m_category)); } virtual void add(const fs::manager_t &fs) { @@ -45,9 +45,9 @@ fs_enum(filesystem_format *format) : m_format(format) {} - virtual void add(floppy_format_type type, u32 image_size, const char *name, const char *description) override { + virtual void add(const floppy_image_format_t &type, u32 image_size, const char *name, const char *description) override { m_format->m_floppy = true; - m_format->m_floppy_create.emplace_back(std::make_unique(m_format->m_manager, type, image_size, name, description)); + m_format->m_floppy_create.emplace_back(std::make_unique(m_format->m_manager, &type, image_size, name, description)); } virtual void add_raw(const char *name, u32 key, const char *description) override { @@ -246,6 +246,8 @@ for(const auto &e : formats.floppy_format_info_by_key) { u8 score = e.second->m_format->identify(*io, floppy_image::FF_UNKNOWN, variants); + if(score && e.second->m_format->extension_matches(m_on_disk_path.c_str())) + score |= floppy_image_format_t::FIFID_EXT; if(score) res.emplace_back(std::make_pair(score, e.second)); } @@ -292,10 +294,8 @@ auto fs = format->m_manager->mount(blockdev); fs->format(meta); - auto source_format = format->m_type(); auto io = util::ram_read(img.data(), img.size(), 0xff); - source_format->load(*io, floppy_image::FF_UNKNOWN, variants, &m_floppy_image); - delete source_format; + format->m_type->load(*io, floppy_image::FF_UNKNOWN, variants, &m_floppy_image); } else { fs::unformatted_image::format(format->m_key, &m_floppy_image); } @@ -309,10 +309,8 @@ std::vector variants; m_floppy_fs_converter = ci->m_type; m_sector_image.clear(); - auto load_format = m_floppy_fs_converter(); util::random_read_write_fill_wrapper, 0xff> io(m_sector_image); - load_format->save(io, variants, &m_floppy_image); - delete load_format; + m_floppy_fs_converter->save(io, variants, &m_floppy_image); } if(ci->m_image_size == m_sector_image.size()) @@ -344,9 +342,7 @@ { std::vector variants; auto io = util::ram_read(m_sector_image.data(), m_sector_image.size(), 0xff); - auto format = m_floppy_fs_converter(); - format->load(*io, floppy_image::FF_UNKNOWN, variants, &m_floppy_image); - delete format; + m_floppy_fs_converter->load(*io, floppy_image::FF_UNKNOWN, variants, &m_floppy_image); } std::vector image_handler::path_split(std::string path) const diff -Nru mame-0.242+dfsg.1/src/tools/image_handler.h mame-0.243+dfsg.1/src/tools/image_handler.h --- mame-0.242+dfsg.1/src/tools/image_handler.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/tools/image_handler.h 2022-04-29 05:37:26.000000000 +0000 @@ -9,6 +9,7 @@ #pragma once #include "formats/fsmgr.h" +#include "harddisk.h" #include #include @@ -22,22 +23,22 @@ using u32 = uint32_t; struct floppy_format_info { - floppy_image_format_t *m_format; + const floppy_image_format_t *m_format; std::string m_category; - floppy_format_info(floppy_image_format_t *format, std::string category) : m_format(format), m_category(category) {} + floppy_format_info(const floppy_image_format_t *format, std::string category) : m_format(format), m_category(category) {} }; struct floppy_create_info { const fs::manager_t *m_manager; - floppy_format_type m_type; + const floppy_image_format_t *m_type; u32 m_image_size; u32 m_key; const char *m_name; const char *m_description; - floppy_create_info(const fs::manager_t *manager, floppy_format_type type, u32 image_size, const char *name, const char *description) : + floppy_create_info(const fs::manager_t *manager, const floppy_image_format_t *type, u32 image_size, const char *name, const char *description) : m_manager(manager), m_type(type), m_image_size(image_size), m_key(0), m_name(name), m_description(description) { } @@ -106,10 +107,10 @@ floppy_image m_floppy_image; - floppy_format_type m_floppy_fs_converter; + const floppy_image_format_t *m_floppy_fs_converter = nullptr; std::vector m_sector_image; std::unique_ptr m_fsblk; - const fs::manager_t *m_fsm; + const fs::manager_t *m_fsm = nullptr; std::unique_ptr m_fs; }; diff -Nru mame-0.242+dfsg.1/src/tools/imgtool/imghd.cpp mame-0.243+dfsg.1/src/tools/imgtool/imghd.cpp --- mame-0.242+dfsg.1/src/tools/imgtool/imghd.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/tools/imgtool/imghd.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -120,7 +120,7 @@ goto done; } - hard_disk->hard_disk = hard_disk_open(&hard_disk->chd); + hard_disk->hard_disk = new hard_disk_file(&hard_disk->chd); if (!hard_disk->hard_disk) { err = IMGTOOLERR_UNEXPECTED; @@ -145,7 +145,7 @@ { if (disk->hard_disk) { - hard_disk_close(disk->hard_disk); + delete disk->hard_disk; disk->hard_disk = nullptr; } if (disk->stream) @@ -164,7 +164,7 @@ */ imgtoolerr_t imghd_read(struct mess_hard_disk_file *disk, uint32_t lbasector, void *buffer) { - uint32_t reply = hard_disk_read(disk->hard_disk, lbasector, buffer); + uint32_t reply = disk->hard_disk->read(lbasector, buffer); return reply ? IMGTOOLERR_SUCCESS : IMGTOOLERR_READERROR; } @@ -177,7 +177,7 @@ */ imgtoolerr_t imghd_write(struct mess_hard_disk_file *disk, uint32_t lbasector, const void *buffer) { - uint32_t reply = hard_disk_write(disk->hard_disk, lbasector, buffer); + uint32_t reply = disk->hard_disk->write(lbasector, buffer); return reply ? IMGTOOLERR_SUCCESS : IMGTOOLERR_WRITEERROR; } @@ -188,11 +188,9 @@ Return pointer to the header of MAME HD image */ -const hard_disk_info *imghd_get_header(struct mess_hard_disk_file *disk) +const hard_disk_file::info &imghd_get_header(struct mess_hard_disk_file *disk) { - const hard_disk_info *reply; - reply = hard_disk_get_info(disk->hard_disk); - return reply; + return disk->hard_disk->get_info(); } diff -Nru mame-0.242+dfsg.1/src/tools/imgtool/imghd.h mame-0.243+dfsg.1/src/tools/imgtool/imghd.h --- mame-0.242+dfsg.1/src/tools/imgtool/imghd.h 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/tools/imgtool/imghd.h 2022-04-29 05:37:26.000000000 +0000 @@ -45,6 +45,6 @@ imgtoolerr_t imghd_write(struct mess_hard_disk_file *disk, uint32_t lbasector, const void *buffer); /* gets the header from a hard disk */ -const hard_disk_info *imghd_get_header(struct mess_hard_disk_file *disk); +const hard_disk_file::info &imghd_get_header(struct mess_hard_disk_file *disk); #endif /* IMGHD_H */ diff -Nru mame-0.242+dfsg.1/src/tools/imgtool/modules/hp85_tape.cpp mame-0.243+dfsg.1/src/tools/imgtool/modules/hp85_tape.cpp --- mame-0.242+dfsg.1/src/tools/imgtool/modules/hp85_tape.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/tools/imgtool/modules/hp85_tape.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -115,9 +115,9 @@ // Content std::vector content; // First file on track 1 - file_no_t file_track_1; + file_no_t file_track_1{}; // No. of first record on track 1 - uint16_t record_track_1; + uint16_t record_track_1 = 0; bool dec_rec_header(const tape_word_t *hdr , file_no_t& file_no , uint16_t& rec_no , bool& has_body , unsigned& body_len); bool load_whole_tape(); diff -Nru mame-0.242+dfsg.1/src/tools/imgtool/modules/pc_hard.cpp mame-0.243+dfsg.1/src/tools/imgtool/modules/pc_hard.cpp --- mame-0.242+dfsg.1/src/tools/imgtool/modules/pc_hard.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/tools/imgtool/modules/pc_hard.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -105,15 +105,12 @@ static void pc_chd_locate_block(imgtool::image &image, uint64_t block, uint32_t *cylinder, uint32_t *head, uint32_t *sector) { - pc_chd_image_info *info; - const hard_disk_info *hd_info; - - info = pc_chd_get_image_info(image); - hd_info = imghd_get_header(&info->hard_disk); + pc_chd_image_info *info = pc_chd_get_image_info(image); + const auto &hd_info = imghd_get_header(&info->hard_disk); - *sector = block % hd_info->sectors; - *head = (block / hd_info->sectors) % hd_info->heads; - *cylinder = block / hd_info->sectors / hd_info->heads; + *sector = block % hd_info.sectors; + *head = (block / hd_info.sectors) % hd_info.heads; + *cylinder = block / hd_info.sectors / hd_info.heads; } @@ -311,15 +308,12 @@ static imgtoolerr_t pc_chd_image_get_geometry(imgtool::image &image, uint32_t *tracks, uint32_t *heads, uint32_t *sectors) { - pc_chd_image_info *info; - const hard_disk_info *hd_info; - - info = pc_chd_get_image_info(image); - hd_info = imghd_get_header(&info->hard_disk); + pc_chd_image_info *info = pc_chd_get_image_info(image); + const auto &hd_info = imghd_get_header(&info->hard_disk); - *tracks = hd_info->cylinders; - *heads = hd_info->heads; - *sectors = hd_info->sectors; + *tracks = hd_info.cylinders; + *heads = hd_info.heads; + *sectors = hd_info.sectors; return IMGTOOLERR_SUCCESS; } @@ -328,13 +322,11 @@ static uint32_t pc_chd_calc_lbasector(pc_chd_image_info &info, uint32_t track, uint32_t head, uint32_t sector) { uint32_t lbasector; - const hard_disk_info *hd_info; - - hd_info = imghd_get_header(&info.hard_disk); + const auto &hd_info = imghd_get_header(&info.hard_disk); lbasector = track; - lbasector *= hd_info->heads; + lbasector *= hd_info.heads; lbasector += head; - lbasector *= hd_info->sectors; + lbasector *= hd_info.sectors; lbasector += sector; return lbasector; } @@ -346,7 +338,7 @@ pc_chd_image_info *info = pc_chd_get_image_info(image); // get the sector size and resize the buffer - uint32_t sector_size = imghd_get_header(&info->hard_disk)->sectorbytes; + uint32_t sector_size = imghd_get_header(&info->hard_disk).sectorbytes; try { buffer.resize(sector_size); } catch (std::bad_alloc const &) { return IMGTOOLERR_OUTOFMEMORY; } diff -Nru mame-0.242+dfsg.1/src/tools/imgtool/modules/ti99.cpp mame-0.243+dfsg.1/src/tools/imgtool/modules/ti99.cpp --- mame-0.242+dfsg.1/src/tools/imgtool/modules/ti99.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/tools/imgtool/modules/ti99.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -979,17 +979,15 @@ if (img_format == if_harddisk) { - const hard_disk_info *info; - err = imghd_open(*file_handle, &l1_img->harddisk_handle); if (err) return err; - info = imghd_get_header(&l1_img->harddisk_handle); - l1_img->geometry.cylinders = info->cylinders; - l1_img->geometry.heads = info->heads; - l1_img->geometry.secspertrack = info->sectors; - if (info->sectorbytes != 256) + const auto &info = imghd_get_header(&l1_img->harddisk_handle); + l1_img->geometry.cylinders = info.cylinders; + l1_img->geometry.heads = info.heads; + l1_img->geometry.secspertrack = info.sectors; + if (info.sectorbytes != 256) { imghd_close(&l1_img->harddisk_handle); return IMGTOOLERR_CORRUPTIMAGE; /* TODO: support 512-byte sectors */ diff -Nru mame-0.242+dfsg.1/src/tools/regrep.cpp mame-0.243+dfsg.1/src/tools/regrep.cpp --- mame-0.242+dfsg.1/src/tools/regrep.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/tools/regrep.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -727,7 +727,7 @@ static int compare_screenshots(summary_file *curfile) { bitmap_argb32 bitmaps[MAX_COMPARES]; - int unique[MAX_COMPARES]; + int unique[MAX_COMPARES]{}; int numunique = 0; /* iterate over all files and load their bitmaps */ diff -Nru mame-0.242+dfsg.1/src/tools/romcmp.cpp mame-0.243+dfsg.1/src/tools/romcmp.cpp --- mame-0.242+dfsg.1/src/tools/romcmp.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/tools/romcmp.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -211,9 +211,7 @@ { printf("%-23s %-23s 1ST AND 2ND HALF IDENTICAL\n", (side & 1) ? name.c_str() : "", (side & 2) ? name.c_str() : ""); util::hash_collection hash; - hash.begin(); - hash.buffer(buf.get(), size / 2); - hash.end(); + hash.compute(buf.get(), size / 2); printf("%-23s %-23s %s\n", (side & 1) ? name.c_str() : "", (side & 2) ? name.c_str() : "", hash.attribute_string().c_str()); } else diff -Nru mame-0.242+dfsg.1/src/tools/unidasm.cpp mame-0.243+dfsg.1/src/tools/unidasm.cpp --- mame-0.242+dfsg.1/src/tools/unidasm.cpp 2022-03-31 14:07:51.000000000 +0000 +++ mame-0.243+dfsg.1/src/tools/unidasm.cpp 2022-04-29 05:37:26.000000000 +0000 @@ -28,7 +28,6 @@ #include "cpu/arm7/arm7dasm.h" #include "cpu/asap/asapdasm.h" #include "cpu/avr8/avr8dasm.h" -#include "cpu/b5000/b5000d.h" #include "cpu/bcp/bcpdasm.h" #include "cpu/capricorn/capricorn_dasm.h" #include "cpu/ccpu/ccpudasm.h" @@ -140,6 +139,7 @@ #include "cpu/rii/riidasm.h" #include "cpu/romp/rompdasm.h" #include "cpu/rsp/rsp_dasm.h" +#include "cpu/rw5000/rw5000d.h" #include "cpu/rx01/rx01dasm.h" #include "cpu/s2650/2650dasm.h" #include "cpu/saturn/saturnds.h" @@ -376,6 +376,8 @@ { "alpha_unix", le, 0, []() -> util::disasm_interface * { return new alpha_disassembler(alpha_disassembler::TYPE_UNIX); } }, { "alpha_vms", le, 0, []() -> util::disasm_interface * { return new alpha_disassembler(alpha_disassembler::TYPE_VMS); } }, { "alto2", be, -2, []() -> util::disasm_interface * { return new alto2_disassembler; } }, + { "a5000", le, 0, []() -> util::disasm_interface * { return new a5000_disassembler; } }, + { "a5500", le, 0, []() -> util::disasm_interface * { return new a5500_disassembler; } }, { "am29000", be, 0, []() -> util::disasm_interface * { return new am29000_disassembler; } }, { "amis2000", le, 0, []() -> util::disasm_interface * { return new amis2000_disassembler; } }, { "apexc", be, 0, []() -> util::disasm_interface * { return new apexc_disassembler; } }, @@ -393,6 +395,8 @@ { "axc208", le, 0, []() -> util::disasm_interface * { return new ax208_disassembler; } }, { "b5000", le, 0, []() -> util::disasm_interface * { return new b5000_disassembler; } }, { "b5500", le, 0, []() -> util::disasm_interface * { return new b5500_disassembler; } }, + { "b6000", le, 0, []() -> util::disasm_interface * { return new b6000_disassembler; } }, + { "b6100", le, 0, []() -> util::disasm_interface * { return new b6100_disassembler; } }, { "capricorn", le, 0, []() -> util::disasm_interface * { return new capricorn_disassembler; } }, { "ccpu", le, 0, []() -> util::disasm_interface * { return new ccpu_disassembler; } }, { "cdp1801", le, 0, []() -> util::disasm_interface * { return new cosmac_disassembler(cosmac_disassembler::TYPE_1801); } }, @@ -676,7 +680,7 @@ { public: std::vector data; - offs_t base_pc; + offs_t base_pc = 0; u32 size; unidasm_data_buffer(util::disasm_interface *disasm, const dasm_table_entry *entry);